constructor param ctx context param window no window no public m account lookup properties ctx int window no super display type table dir window no m ctx ctx windowno maccountlookup windowno displaytype tabledir windowno m_ctx get display for value param value value return string public string get display object value if contains key value return value to string return to string getdisplay containskey tostring tostring get object of key value param value value return object or null public name pair get object value if value null return null if contains key value return null return new key name pair c validcombination id to string namepair containskey keynamepair c_validcombination_id tostring the lookup contains the key param key key return true if exists public boolean contains key object key int int value 0 if key instanceof integer int value integer key int value else if key null int value integer parse int key to string return load int value containskey intvalue intvalue intvalue intvalue parseint tostring intvalue get description return description public string get description return description getdescription return string representation return combination public string to string if c validcombination id 0 return return combination tostring c_validcombination_id load c validcombination with id param id c validcombination id return true if found public boolean load int id if id 0 new c validcombination id 0 combination description return true if id c validcombination id already loaded return true string sql select c validcombination id combination description from c validcombination where c validcombination id try prepare statement prepared statement pstmt db prepare statement sql null pstmt set int 1 id result set rs pstmt execute query if rs next rs close pstmt close return false c validcombination id rs get int 1 combination rs get string 2 description rs get string 3 rs close pstmt close catch sql exception e return false return true c_validcombination c_validcombination_id c_validcombination_id c_validcombination_id c_validcombination_id c_validcombination c_validcombination_id preparedstatement preparestatement setint resultset executequery c_validcombination_id getint getstring getstring sqlexception get underlying fully qualified table column name return public string get column name return getcolumnname return data as sorted array used in web interface param mandatory mandatory param only validated only valid param only active only active param temporary force load for temporary display return array list with key name pair public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary array list object list new array list object if mandatory list add new key name pair 1 string buffer sql new string buffer select c validcombination id combination description from c validcombination where ad client id if only active sql append and is active y sql append order by 2 try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 env getad client id m ctx result set rs pstmt execute query while rs next list add new key name pair rs get int 1 rs get string 2 rs get string 3 rs close pstmt close catch sql exception e log log level severe sql to string e sort return return list onlyvalidated onlyactive arraylist keynamepair arraylist getdata onlyvalidated onlyactive arraylist arraylist keynamepair stringbuffer stringbuffer c_validcombination_id c_validcombination ad_client_id onlyactive isactive preparedstatement preparestatement tostring setint getad_client_id m_ctx resultset executequery keynamepair getint getstring getstring sqlexception tostring get contsnts return contents public object get contents return contents getcontents get contsnts return contents public object get contents return contents getcontents help system for window help param frame parent param title title param m window window model public help frame frame string title m window m window super frame title false try jb init load info m window catch exception ex log log level severe ex a env position center window frame this mwindow mwindow mwindow jbinit loadinfo mwindow aenv positioncenterwindow help system param frame parent param title window param url url to display public help frame frame string title url url super frame title false try jb init info set page url catch exception ex log log level severe ex a env position center window frame this jbinit setpage aenv positioncenterwindow help system param frame parent param title window param help html helptext public help frame frame string title string help html super frame title false try jb init info set content type text html info set editable false info set background compiereplaf getfieldbackground inactive info set text help html catch exception ex log log level severe help ex a env position center window frame this helphtml helphtml jbinit setcontenttype seteditable setbackground getfieldbackground_inactive settext helphtml aenv positioncenterwindow static init throws exception void jb init throws exception main panel set layout main layout main layout set hgap 2 main layout set vgap 2 info pane set border border factory create lowered bevel border info pane set preferred size new dimension 500 400 get content pane add main panel main panel add info pane border layout center main panel add confirm panel border layout south info pane get viewport add info null confirm panel add action listener this jbinit mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap infopane setborder borderfactory createloweredbevelborder infopane setpreferredsize getcontentpane mainpanel mainpanel infopane borderlayout mainpanel confirmpanel borderlayout infopane getviewport confirmpanel addactionlistener load info windows help param m window window model private void load info m window m window web doc doc m window get help doc true info set text doc to string mwindow loadinfo mwindow mwindow webdoc mwindow gethelpdoc settext tostring action listener param e event public void action performed action event e if e get action command equals confirm panel a ok dispose actionperformed actionevent getactioncommand confirmpanel a_ok ide bean constructor public v date this display type date vdate displaytype simple constructor param display type display type public v date int display type this date false false true display type date displaytype vdate displaytype displaytype create right aligned date field param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display type display type param title title public v date string column name boolean mandatory boolean is read only boolean is updateable int display type string title super super set name column name m columnname column name m title title look and feel install border this text field border this set layout new border layout this set focusable false size this set preferred size m text get preferred size int height m text get preferred size height set minimum size new dimension 30 height vdate mouseadapter mouse new vdate mouseadapter this popup m text add mouse listener mouse text m text set border null m text set horizontal alignment j text field trailing if m displaytype display type date m text add focus listener this m text add key listener this m text set caret new v ovr caret else if m displaytype display type date time m text set columns 20 background set mandatory mandatory this add m text border layout center if display type display type date time display type display type time m displaytype display type default date set format button m button set icon env get image icon calendar10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this m button set focusable false this add m button border layout east prefereed size this set preferred size this get preferred size causes r o to be the same length read write if is read only is updateable set read write false else set read write true columnname isreadonly isupdateable displaytype vdate columnname isreadonly isupdateable displaytype setname columnname m_columnname columnname m_title lookandfeel installborder textfield setlayout borderlayout setfocusable setpreferredsize m_text getpreferredsize m_text getpreferredsize setminimumsize vdate_mouseadapter vdate_mouseadapter m_text addmouselistener m_text setborder m_text sethorizontalalignment jtextfield m_displaytype displaytype m_text addfocuslistener m_text addkeylistener m_text setcaret vovrcaret m_displaytype displaytype datetime m_text setcolumns setmandatory m_text borderlayout displaytype displaytype datetime displaytype displaytype m_displaytype displaytype setformat m_button seticon getimageicon m_button setmargin m_button setpreferredsize m_button addactionlistener m_button setfocusable m_button borderlayout setpreferredsize getpreferredsize readwrite isreadonly isupdateable setreadwrite setreadwrite dispose public void dispose m text null m button null m mfield null m_text m_button m_mfield set document param doc doc protected void set document document doc m text set document doc setdocument m_text setdocument set read write field is always r o for time or date time param value value public void set read write boolean value m readwrite value this set focusable value editor if m displaytype display type date m text set read write value sets background else m text set editable false m text set focusable false set background false don t show button if not read write if m button is visible value m button set visible value if m button is enabled value m button set enabled value readwrite datetime setreadwrite m_readwrite setfocusable m_displaytype displaytype m_text setreadwrite m_text seteditable m_text setfocusable setbackground readwrite m_button isvisible m_button setvisible m_button isenabled m_button setenabled is read write return true if rw public boolean is read write return m readwrite isreadwrite isreadwrite m_readwrite set mandatory and back bolor param mandatory mandatory public void set mandatory boolean mandatory m mandatory mandatory m text set mandatory mandatory set background false setmandatory m_mandatory m_text setmandatory setbackground is it mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set background based on read write mandatory error param error if true set background to error color otherwise mandatory read write public void set background boolean error if error m text set background compiereplaf getfieldbackground error else if m readwrite m text set background compiereplaf getfieldbackground inactive else if m mandatory m text set background compiereplaf getfieldbackground mandatory else m text set background compiereplaf getfieldbackground normal readwrite readwrite setbackground m_text setbackground getfieldbackground_error m_readwrite m_text setbackground getfieldbackground_inactive m_mandatory m_text setbackground getfieldbackground_mandatory m_text setbackground getfieldbackground_normal set foreground param fg color public void set foreground color fg m text set foreground fg setforeground m_text setforeground set format required when format locale changed public void set format m format display type get date format m displaytype if m displaytype display type date m text set document new m doc date m displaytype m format m text m title setformat m_format displaytype getdateformat m_displaytype m_displaytype displaytype m_text setdocument mdocdate m_displaytype m_format m_text m_title request focus public void request focus m text request focus requestfocus m_text requestfocus set editor to value param value timestamp date or string to be parsed public void set value object value log finest value value m oldtext if value null else if value instanceof java util date m oldtext m format format value else string str value value to string string values most likely in yyyy mm dd jdbc format try java util date date display type getdateformat jdbc parse str value m oldtext m format format date convert to display value catch parse exception pe0 try local string format try java util date date m format parse str value m oldtext m format format date catch parse exception pe1 log log level severe set value pe1 get message m oldtext if m setting return m text set text m oldtext m initialtext m oldtext setvalue m_oldtext m_oldtext m_format strvalue tostring displaytype getdateformat_jdbc strvalue m_oldtext m_format parseexception m_format strvalue m_oldtext m_format parseexception setvalue getmessage m_oldtext m_setting m_text settext m_oldtext m_initialtext m_oldtext property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public timestamp get timestamp if m text null return null string value m text get text if value null value length 0 return null timestamp ts null try java util date date m format parse value ts new timestamp date get time catch parse exception pe log fine pe get message return ts gettimestamp m_text m_text gettext m_format gettime parseexception getmessage return editor value timestamp return value public object get value return get timestamp getvalue gettimestamp return display value return display value public string get display return m text get text getdisplay m_text gettext action listener button param e event public void action performed action event e preference if e get action command equals value preference name if m role get default is show preference value preference start m mfield get value get display return if e get source m button m button set enabled false set value start calendar this get timestamp m format m displaytype m title try fire vetoable change m columnname m oldtext get value catch property veto exception pve m button set enabled true m text request focus actionperformed actionevent getactioncommand valuepreference mrole getdefault isshowpreference valuepreference m_mfield getvalue getdisplay getsource m_button m_button setenabled setvalue startcalendar gettimestamp m_format m_displaytype m_title firevetoablechange m_columnname m_oldtext getvalue propertyvetoexception m_button setenabled m_text requestfocus key listener interface param e event public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent key listener escape restore old text first change signal change param e event public void key released key event e log finest key e get key code e get key char m text get text esc if e get key code key event vk escape m text set text m initialtext m setting true try timestamp ts get timestamp get value if ts null format error just indicate change fire vetoable change m columnname m oldtext null else fire vetoable change m columnname m oldtext ts catch property veto exception pve m setting false firstchange keyreleased keyevent getkeycode getkeychar m_text gettext getkeycode keyevent vk_escape m_text settext m_initialtext m_setting gettimestamp getvalue firevetoablechange m_columnname m_oldtext firevetoablechange m_columnname m_oldtext propertyvetoexception m_setting focus gained save for escape param e event public void focus gained focus event e focusgained focusevent data binding to to grid controller param e event public void focus lost focus event e did not get focus first if e is temporary return log config v date focus lost if m text null m text get text null return object value get value if value null is mandatory set value start calendar this get timestamp m format m displaytype m title else set value value gridcontroller focuslost focusevent istemporary vdate focuslost m_text m_text gettext getvalue ismandatory setvalue startcalendar gettimestamp m_format m_displaytype m_title setvalue invalid entry start calendar param jc parent param value value param format format param display type display type param title title return formatted date public static timestamp start calendar container jc timestamp value simple date format format int display type string title log config date value find frame frame frame env get frame jc actual call calendar cal new calendar frame title value display type a env show center window frame cal timestamp result cal get timestamp log config result result if result null cal is cancel result value original cal null return result displaytype startcalendar simpledateformat displaytype getframe displaytype aenv showcenterwindow gettimestamp iscancel set field window no for value preference param m field m field public void set field org compiere model m field m field m mfield m field if m mfield null m role get default is show preference value preference add menu this popup menu windowno valuepreference mfield mfield setfield mfield mfield m_mfield mfield m_mfield mrole getdefault isshowpreference valuepreference addmenu popupmenu set enabled param enabled enabled public void set enabled boolean enabled super set enabled enabled m text set enabled enabled m button set enabled enabled if enabled m button set read write m readwrite setenabled setenabled m_text setenabled m_button setenabled m_button setreadwrite m_readwrite remove action listner param l action listener public void remove action listener action listener l listener list remove action listener class l removeactionlistener actionlistener listenerlist actionlistener add action listner param l action listener public void add action listener action listener l listener list add action listener class l addactionlistener actionlistener listenerlist actionlistener constructor param adaptee adaptee vdate mouseadapter v date adaptee this adaptee adaptee vdate_mouseadapter vdate mouse listener param e mouse event public void mouse clicked mouse event e system out println mouse clicked e getid e get source get class to string popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseevent mouseclicked mouseevent mouseclicked getsource getclass tostring swingutilities isrightmousebutton popupmenu getsource prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad org id p ad org id para i get parameter as int else if name equals m warehouse id p m warehouse id para i get parameter as int else if name equals date doc p datedoc from timestamp para i get parameter p datedoc to timestamp para i getparameter to else if name equals date required p daterequired from timestamp para i get parameter p daterequired to timestamp para i getparameter to else if name equals priority rule p priorityrule string para i get parameter else if name equals ad user id p ad user id para i get parameter as int else if name equals m product id p m product id para i get parameter as int else if name equals m requisition id p m requisition id para i get parameter as int else if name equals consolidate document p consolidatedocument y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_org_id p_ad_org_id getparameterasint m_warehouse_id p_m_warehouse_id getparameterasint datedoc p_datedoc_from getparameter p_datedoc_to getparameter_to daterequired p_daterequired_from getparameter p_daterequired_to getparameter_to priorityrule p_priorityrule getparameter ad_user_id p_ad_user_id getparameterasint m_product_id p_m_product_id getparameterasint m_requisition_id p_m_requisition_id getparameterasint consolidatedocument p_consolidatedocument getparameter process return info throws exception protected string do it throws exception specific if p m requisition id 0 log info m requisition id p m requisition id m requisition req new m requisition get ctx p m requisition id get trxname if m requisition docstatus completed equals req get doc status throw new compiere user error doc status req get doc status m requisition line lines req get lines for int i 0 i lines length i if lines i getc orderline id 0 process lines i close order return single requisition log info ad org id p ad org id m warehouse id p m warehouse id date doc p datedoc from p datedoc to date required p daterequired from p daterequired to priority rule p priorityrule ad user id p ad user id m product id p m product id consolidate document p consolidatedocument string buffer sql new string buffer select from m requisitionline rl append where rl c orderline id is null if p ad org id 0 sql append and ad org id if p m product id 0 sql append and m product id requisition header sql append and exists select from m requisition r where rl m requisition id r m requisition id append and r doc status co if p m warehouse id 0 sql append and r m warehouse id if p datedoc from null p datedoc to null sql append and r date doc between and else if p datedoc from null sql append and r date doc else if p datedoc to null sql append and r date doc if p daterequired from null p daterequired to null sql append and r date required between and else if p daterequired from null sql append and r date required else if p daterequired to null sql append and r date required if p priorityrule null sql append and r priority rule if p ad user id 0 sql append and r ad user id sql append order by if p consolidatedocument sql append m requisition id sql append m product id c charge id m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql to string get trxname int index 1 if p ad org id 0 pstmt set int index p ad org id if p m product id 0 pstmt set int index p m product id if p m warehouse id 0 pstmt set int index p m warehouse id if p datedoc from null p datedoc to null pstmt set timestamp index p datedoc from pstmt set timestamp index p datedoc to else if p datedoc from null pstmt set timestamp index p datedoc from else if p datedoc to null pstmt set timestamp index p datedoc to if p daterequired from null p daterequired to null pstmt set timestamp index p daterequired from pstmt set timestamp index p daterequired to else if p daterequired from null pstmt set timestamp index p daterequired from else if p daterequired to null pstmt set timestamp index p daterequired to if p priorityrule null pstmt set string index p priorityrule if p ad user id 0 pstmt set int index p ad user id result set rs pstmt execute query while rs next process new m requisition line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null close order return doit p_m_requisition_id m_requisition_id p_m_requisition_id mrequisition mrequisition getctx p_m_requisition_id get_trxname mrequisition docstatus_completed getdocstatus compiereusererror docstatus getdocstatus mrequisitionline getlines getc_orderline_id closeorder ad_org_id p_ad_org_id m_warehouse_id p_m_warehouse_id datedoc p_datedoc_from p_datedoc_to daterequired p_daterequired_from p_daterequired_to priorityrule p_priorityrule ad_user_id p_ad_user_id m_product_id p_m_product_id consolidatedocument p_consolidatedocument stringbuffer stringbuffer m_requisitionline c_orderline_id p_ad_org_id ad_org_id p_m_product_id m_product_id m_requisition m_requisition_id m_requisition_id docstatus p_m_warehouse_id m_warehouse_id p_datedoc_from p_datedoc_to datedoc p_datedoc_from datedoc p_datedoc_to datedoc p_daterequired_from p_daterequired_to daterequired p_daterequired_from daterequired p_daterequired_to daterequired p_priorityrule priorityrule p_ad_user_id ad_user_id p_consolidatedocument m_requisition_id m_product_id c_charge_id m_attributesetinstance_id preparedstatement preparestatement tostring get_trxname p_ad_org_id setint p_ad_org_id p_m_product_id setint p_m_product_id p_m_warehouse_id setint p_m_warehouse_id p_datedoc_from p_datedoc_to settimestamp p_datedoc_from settimestamp p_datedoc_to p_datedoc_from settimestamp p_datedoc_from p_datedoc_to settimestamp p_datedoc_to p_daterequired_from p_daterequired_to settimestamp p_daterequired_from settimestamp p_daterequired_to p_daterequired_from settimestamp p_daterequired_from p_daterequired_to settimestamp p_daterequired_to p_priorityrule setstring p_priorityrule p_ad_user_id setint p_ad_user_id resultset executequery mrequisitionline getctx get_trxname tostring closeorder process line param r line request line private void process m requisition line r line throws exception if r line getm product id 0 r line getc charge id 0 log warning ignored line r line get line r line get description r line get line net amt return if p consolidatedocument r line getm requisition id m m requisition id close order if m orderline null r line getm product id m m product id r line getm attributesetinstance id m m attributesetinstance id r line getc charge id 0 single line per charge new line r line update order line m orderline set qty m orderline get qty ordered add r line get qty update requisition line r line setc orderline id m orderline getc orderline id if r line save throw new compiere system error cannot update request line rline mrequisitionline rline rline getm_product_id rline getc_charge_id rline getline rline getdescription rline getlinenetamt p_consolidatedocument rline getm_requisition_id m_m_requisition_id closeorder m_orderline rline getm_product_id m_m_product_id rline getm_attributesetinstance_id m_m_attributesetinstance_id rline getc_charge_id newline rline m_orderline setqty m_orderline getqtyordered rline getqty rline setc_orderline_id m_orderline getc_orderline_id rline compieresystemerror create new order param r line request line private void new order m requisition line r line int c bpartner id throws exception if m order null close order b partner if m bpartner null c bpartner id m bpartner getc bpartner id m bpartner new mb partner get ctx c bpartner id null order m order new m order get ctx 0 get trxname m order set isso trx false m order setc doctypetarget id m order setb partner m bpartner default po document type if p consolidatedocument m order set description msg get element get ctx m requisition id r line get parent get document no prepare save m m requisition id r line getm requisition id if m order save throw new compiere system error cannot save order rline neworder mrequisitionline rline c_bpartner_id m_order closeorder bpartner m_bpartner c_bpartner_id m_bpartner getc_bpartner_id m_bpartner mbpartner getctx c_bpartner_id m_order morder getctx get_trxname m_order setissotrx m_order setc_doctypetarget_id m_order setbpartner m_bpartner p_consolidatedocument m_order setdescription getelement getctx m_requisition_id rline getparent getdocumentno m_m_requisition_id rline getm_requisition_id m_order compieresystemerror close order private void close order throws exception if m orderline null if m orderline save throw new compiere system error cannot update order line if m order null m order load get trxname add log 0 null m order get grand total m order get document no m order null m orderline null closeorder m_orderline m_orderline compieresystemerror m_order m_order get_trxname addlog m_order getgrandtotal m_order getdocumentno m_order m_orderline new order line different product param r line request line private void new line m requisition line r line throws exception if m orderline null if m orderline save throw new compiere system error cannot update order line m orderline null m product product null get business partner int c bpartner id r line getc bpartner id if c bpartner id 0 else if r line getc charge id 0 m charge charge m charge get get ctx r line getc charge id c bpartner id charge getc bpartner id if c bpartner id 0 throw new compiere user error no vendor for charge charge get name else find vendor from produt product m product get get ctx r line getm product id m productpo ppos m productpo get of product get ctx product getm product id null for int i 0 i ppos length i if ppos i is current vendor ppos i getc bpartner id 0 c bpartner id ppos i getc bpartner id break if c bpartner id 0 ppos length 0 c bpartner id ppos 0 getc bpartner id if c bpartner id 0 throw new compiere user error no vendor for product get name new order different vendor if m order null m order getc bpartner id c bpartner id new order r line c bpartner id no order line m orderline new m order line m order if product null m orderline set product product m orderline setm attributesetinstance id r line getm attributesetinstance id else m orderline setc charge id r line getc charge id m orderline set price actual r line get price actual m orderline setad org id r line getad org id prepare save m m product id r line getm product id m m attributesetinstance id r line getm attributesetinstance id if m orderline save throw new compiere system error cannot save order line rline newline mrequisitionline rline m_orderline m_orderline compieresystemerror m_orderline mproduct c_bpartner_id rline getc_bpartner_id c_bpartner_id rline getc_charge_id mcharge mcharge getctx rline getc_charge_id c_bpartner_id getc_bpartner_id c_bpartner_id compiereusererror getname mproduct getctx rline getm_product_id mproductpo mproductpo getofproduct getctx getm_product_id iscurrentvendor getc_bpartner_id c_bpartner_id getc_bpartner_id c_bpartner_id c_bpartner_id getc_bpartner_id c_bpartner_id compiereusererror getname m_order m_order getc_bpartner_id c_bpartner_id neworder rline c_bpartner_id m_orderline morderline m_order m_orderline setproduct m_orderline setm_attributesetinstance_id rline getm_attributesetinstance_id m_orderline setc_charge_id rline getc_charge_id m_orderline setpriceactual rline getpriceactual m_orderline setad_org_id rline getad_org_id m_m_product_id rline getm_product_id m_m_attributesetinstance_id rline getm_attributesetinstance_id m_orderline compieresystemerror prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad impformat id from ad impformat id big decimal para i get parameter int value else log log level severe prepare unknown parameter name to ad impformat id getrecord id processinfoparameter getparameter getparametername getparameter ad_impformat_id from_ad_impformat_id bigdecimal getparameter intvalue to_ad_impformat_id getrecord_id process copy return info throws exception protected string do it throws exception log info do it from from ad impformat id to to ad impformat id m imp format from new m imp format get ctx from ad impformat id get trxname if from getad impformat id from ad impformat id throw new exception from format not found from ad impformat id m imp format to new m imp format get ctx to ad impformat id get trxname if to getad impformat id to ad impformat id throw new exception to format not found from ad impformat id if from getad table id to getad table id throw new exception from to do not have same format table m imp format row rows from get rows incl inactive for int i 0 i rows length i m imp format row row rows i m imp format row copy new m imp format row to row if copy save throw new exception copy error string msg rows length if from get format type equals to get format type return msg note format type different return msg doit doit from_ad_impformat_id to_ad_impformat_id mimpformat mimpformat getctx from_ad_impformat_id get_trxname getad_impformat_id from_ad_impformat_id from_ad_impformat_id mimpformat mimpformat getctx to_ad_impformat_id get_trxname getad_impformat_id to_ad_impformat_id from_ad_impformat_id getad_table_id getad_table_id mimpformatrow getrows mimpformatrow mimpformatrow mimpformatrow getformattype getformattype standard constructor param ctx context param m movement id id public m movement properties ctx int m movement id string trx name super ctx m movement id trx name if m movement id 0 setc doctype id 0 set doc action docaction complete co set doc status docstatus drafted dr set is approved false set is in transit false set movement date new timestamp system current time millis date set posted false super set processed false m_movement_id mmovement m_movement_id trxname m_movement_id trxname m_movement_id setc_doctype_id setdocaction docaction_complete setdocstatus docstatus_drafted setisapproved setisintransit setmovementdate currenttimemillis setposted setprocessed load constructor param ctx context param rs result set public m movement properties ctx result set rs string trx name super ctx rs trx name mmovement resultset trxname trxname get lines param requery requery return array of lines public m movement line get lines boolean requery if m lines null requery return m lines array list m movement line list new array list m movement line string sql select from m movementline where m movement id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm movement id result set rs pstmt execute query while rs next list add new m movement line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m movement line list size list to array m lines return m lines mmovementline getlines m_lines m_lines arraylist mmovementline arraylist mmovementline m_movementline m_movement_id preparedstatement preparestatement get_trxname setint getm_movement_id resultset executequery mmovementline getctx get_trxname getlines m_lines mmovementline toarray m_lines m_lines get confirmations param requery requery return array of confirmations public m movement confirm get confirmations boolean requery if m confirms null requery return m confirms array list m movement confirm list new array list m movement confirm string sql select from m movementconfirm where m movement id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm movement id result set rs pstmt execute query while rs next list add new m movement confirm get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get confirmations e try if pstmt null pstmt close pstmt null catch exception e pstmt null m confirms new m movement confirm list size list to array m confirms return m confirms mmovementconfirm getconfirmations m_confirms m_confirms arraylist mmovementconfirm arraylist mmovementconfirm m_movementconfirm m_movement_id preparedstatement preparestatement get_trxname setint getm_movement_id resultset executequery mmovementconfirm getctx get_trxname getconfirmations m_confirms mmovementconfirm toarray m_confirms m_confirms add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save param new record new return true protected boolean before save boolean new record if getc doctype id 0 m doc type types m doc type get of doc base type get ctx m doc type docbasetype materialmovement if types length 0 get first setc doctype id types 0 getc doctype id else log save error error msg parse translation get ctx not found c doctype id return false return true newrecord beforesave newrecord getc_doctype_id mdoctype mdoctype getofdocbasetype getctx mdoctype docbasetype_materialmovement setc_doctype_id getc_doctype_id saveerror parsetranslation getctx notfound c_doctype_id set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update m movementline set processed processed y n where m movement id getm movement id int no line db execute update sql get trxname m lines null log fine processed processed lines no line setprocessed setprocessed get_id m_movementline m_movement_id getm_movement_id noline executeupdate get_trxname m_lines noline process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctype id std period open if m period is open get ctx get movement date dt get doc base type m processmsg period closed return doc action status invalid m movement line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid add up amounts check material policy confirmation if dt is in transit create confirmation m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getmovementdate getdocbasetype m_processmsg periodclosed docaction status_invalid mmovementline getlines m_processmsg nolines docaction status_invalid checkmaterialpolicy isintransit createconfirmation m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress create movement confirmation private void create confirmation m movement confirm confirmations get confirmations false if confirmations length 0 return create confirmation m movement confirm create this false createconfirmation mmovementconfirm getconfirmations mmovementconfirm approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status outstanding not processed incoming confirmations m movement confirm confirmations get confirmations true for int i 0 i confirmations length i m movement confirm confirm confirmations i if confirm is processed m processmsg open m movementconfirm id confirm get document no return doc action status inprogress implicit approval if is approved approve it log info to string m movement line lines get lines false for int i 0 i lines length i m movement line line lines i m transaction trx from null if line getm attributesetinstance id 0 m movement linema mas m movement linema get get ctx line getm movementline id get trxname for int j 0 j mas length j m movement linema ma mas j m storage storage from m storage get get ctx line getm locator id line getm product id ma getm attributesetinstance id get trxname if storage from null storage from m storage get create get ctx line getm locator id line getm product id ma getm attributesetinstance id get trxname m storage storage to m storage get get ctx line getm locatorto id line getm product id ma getm attributesetinstance id get trxname if storage to null storage to m storage get create get ctx line getm locatorto id line getm product id ma getm attributesetinstance id get trxname storage from set qty on hand storage from get qty on hand subtract ma get movement qty if storage from save get trxname m processmsg storage from not updated ma return doc action status invalid storage to set qty on hand storage to get qty on hand add ma get movement qty if storage to save get trxname m processmsg storage to not updated ma return doc action status invalid trx from new m transaction get ctx m transaction movementtype movementfrom line getm locator id line getm product id ma getm attributesetinstance id ma get movement qty negate get movement date get trxname trx from setm movementline id line getm movementline id if trx from save m processmsg transaction from not inserted ma return doc action status invalid m transaction trx to new m transaction get ctx m transaction movementtype movementto line getm locatorto id line getm product id ma getm attributesetinstance id ma get movement qty get movement date get trxname trx to setm movementline id line getm movementline id if trx to save m processmsg transaction to not inserted ma return doc action status invalid fallback we have asi if trx from null m storage storage from m storage get get ctx line getm locator id line getm product id line getm attributesetinstance id get trxname if storage from null storage from m storage get create get ctx line getm locator id line getm product id line getm attributesetinstance id get trxname m storage storage to m storage get get ctx line getm locatorto id line getm product id line getm attributesetinstanceto id get trxname if storage to null storage to m storage get create get ctx line getm locatorto id line getm product id line getm attributesetinstanceto id get trxname storage from set qty on hand storage from get qty on hand subtract line get movement qty if storage from save get trxname m processmsg storage from not updated return doc action status invalid storage to set qty on hand storage to get qty on hand add line get movement qty if storage to save get trxname m processmsg storage to not updated return doc action status invalid trx from new m transaction get ctx m transaction movementtype movementfrom line getm locator id line getm product id line getm attributesetinstance id line get movement qty negate get movement date get trxname trx from setm movementline id line getm movementline id if trx from save m processmsg transaction from not inserted return doc action status invalid m transaction trx to new m transaction get ctx m transaction movementtype movementto line getm locatorto id line getm product id line getm attributesetinstanceto id line get movement qty get movement date get trxname trx to setm movementline id line getm movementline id if trx to save m processmsg transaction to not inserted return doc action status invalid fallback for all lines user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress mmovementconfirm getconfirmations mmovementconfirm isprocessed m_processmsg m_movementconfirm_id getdocumentno docaction status_inprogress isapproved approveit tostring mmovementline getlines mmovementline mtransaction trxfrom getm_attributesetinstance_id mmovementlinema mmovementlinema getctx getm_movementline_id get_trxname mmovementlinema mstorage storagefrom mstorage getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname storagefrom storagefrom mstorage getcreate getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname mstorage storageto mstorage getctx getm_locatorto_id getm_product_id getm_attributesetinstance_id get_trxname storageto storageto mstorage getcreate getctx getm_locatorto_id getm_product_id getm_attributesetinstance_id get_trxname storagefrom setqtyonhand storagefrom getqtyonhand getmovementqty storagefrom get_trxname m_processmsg docaction status_invalid storageto setqtyonhand storageto getqtyonhand getmovementqty storageto get_trxname m_processmsg docaction status_invalid trxfrom mtransaction getctx mtransaction movementtype_movementfrom getm_locator_id getm_product_id getm_attributesetinstance_id getmovementqty getmovementdate get_trxname trxfrom setm_movementline_id getm_movementline_id trxfrom m_processmsg docaction status_invalid mtransaction trxto mtransaction getctx mtransaction movementtype_movementto getm_locatorto_id getm_product_id getm_attributesetinstance_id getmovementqty getmovementdate get_trxname trxto setm_movementline_id getm_movementline_id trxto m_processmsg docaction status_invalid trxfrom mstorage storagefrom mstorage getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname storagefrom storagefrom mstorage getcreate getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname mstorage storageto mstorage getctx getm_locatorto_id getm_product_id getm_attributesetinstanceto_id get_trxname storageto storageto mstorage getcreate getctx getm_locatorto_id getm_product_id getm_attributesetinstanceto_id get_trxname storagefrom setqtyonhand storagefrom getqtyonhand getmovementqty storagefrom get_trxname m_processmsg docaction status_invalid storageto setqtyonhand storageto getqtyonhand getmovementqty storageto get_trxname m_processmsg docaction status_invalid trxfrom mtransaction getctx mtransaction movementtype_movementfrom getm_locator_id getm_product_id getm_attributesetinstance_id getmovementqty getmovementdate get_trxname trxfrom setm_movementline_id getm_movementline_id trxfrom m_processmsg docaction status_invalid mtransaction trxto mtransaction getctx mtransaction movementtype_movementto getm_locatorto_id getm_product_id getm_attributesetinstanceto_id getmovementqty getmovementdate get_trxname trxto setm_movementline_id getm_movementline_id trxto m_processmsg docaction status_invalid modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed check material policy sets line asi private void check material policy int no m movement linema delete movementma getm movement id get trxname if no 0 log config delete old no m movement line lines get lines false m client client m client get get ctx check lines for int i 0 i lines length i m movement line line lines i boolean need save false attribute set instance if line getm attributesetinstance id 0 m product product m product get get ctx line getm product id m product category pc m product category get get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy m storage storages m storage get all withasi get ctx line getm product id line getm locator id m client mmpolicy fifo equals mm policy get trxname big decimal qty to deliver line get movement qty for int ii 0 ii storages length ii m storage storage storages ii if ii 0 if storage get qty on hand compare to qty to deliver 0 line setm attributesetinstance id storage getm attributesetinstance id need save true log config direct line qty to deliver env zero else log config split line m movement linema ma new m movement linema line storage getm attributesetinstance id storage get qty on hand if ma save qty to deliver qty to deliver subtract storage get qty on hand log fine ii ma qty to deliver qty to deliver else create addl material allocation m movement linema ma new m movement linema line storage getm attributesetinstance id qty to deliver if storage get qty on hand compare to qty to deliver 0 qty to deliver env zero else ma set movement qty storage get qty on hand qty to deliver qty to deliver subtract storage get qty on hand if ma save log fine ii ma qty to deliver qty to deliver if qty to deliver signum 0 break for all storages no attribute set instance found for remainder if qty to deliver signum 0 m movement linema ma new m movement linema line 0 qty to deliver if ma save log fine ma attribute set instance if need save line save log severe not saved line for all lines checkmaterialpolicy mmovementlinema deletemovementma getm_movement_id get_trxname mmovementline getlines mclient mclient getctx mmovementline needsave getm_attributesetinstance_id mproduct mproduct getctx getm_product_id mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy mstorage mstorage getallwithasi getctx getm_product_id getm_locator_id mclient mmpolicy_fifo mmpolicy get_trxname bigdecimal qtytodeliver getmovementqty mstorage getqtyonhand compareto qtytodeliver setm_attributesetinstance_id getm_attributesetinstance_id needsave qtytodeliver mmovementlinema mmovementlinema getm_attributesetinstance_id getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver mmovementlinema mmovementlinema getm_attributesetinstance_id qtytodeliver getqtyonhand compareto qtytodeliver qtytodeliver setmovementqty getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver qtytodeliver attributesetinstance qtytodeliver mmovementlinema mmovementlinema qtytodeliver attributesetinstance needsave void document return true if success public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status return false not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status set lines to 0 m movement line lines get lines false for int i 0 i lines length i m movement line line lines i big decimal old line get movement qty if old compare to env zero 0 line set movement qty env zero line add description void old line save get trxname else return reverse correct it set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus mmovementline getlines mmovementline bigdecimal getmovementqty compareto setmovementqty adddescription get_trxname reversecorrectit setprocessed setdocaction docaction_none close document return true if success public boolean close it log info to string close not delivered qty set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info to string m doc type dt m doc type get get ctx getc doctype id if m period is open get ctx get movement date dt get doc base type m processmsg period closed return false deep copy m movement reversal new m movement get ctx 0 get trxname copy values this reversal getad client id getad org id reversal set doc status docstatus drafted reversal set doc action docaction complete reversal set is approved false reversal set is in transit false reversal set posted false reversal set processed false reversal add description get document no if reversal save m processmsg could not create movement reversal return false reverse line qty m movement line o lines get lines true for int i 0 i o lines length i m movement line o line o lines i m movement line r line new m movement line get ctx 0 get trxname copy values o line r line o line getad client id o line getad org id r line setm movement id reversal getm movement id r line set movement qty r line get movement qty negate r line set target qty env zero r line set scrapped qty env zero r line set confirmed qty env zero r line set processed false if r line save m processmsg could not create movement reversal line return false if reversal process it doc action action complete m processmsg reversal error reversal get process msg return false reversal close it reversal set doc status docstatus reversed reversal set doc action docaction none reversal save m processmsg reversal get document no update reversed this add description reversal get document no set processed true set doc status docstatus reversed may come from void set doc action docaction none return true reversecorrectit tostring mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getmovementdate getdocbasetype m_processmsg periodclosed mmovement mmovement getctx get_trxname copyvalues getad_client_id getad_org_id setdocstatus docstatus_drafted setdocaction docaction_complete setisapproved setisintransit setposted setprocessed adddescription getdocumentno m_processmsg mmovementline olines getlines olines mmovementline oline olines mmovementline rline mmovementline getctx get_trxname copyvalues oline rline oline getad_client_id oline getad_org_id rline setm_movement_id getm_movement_id rline setmovementqty rline getmovementqty rline settargetqty rline setscrappedqty rline setconfirmedqty rline setprocessed rline m_processmsg processit docaction action_complete m_processmsg getprocessmsg closeit setdocstatus docstatus_reversed setdocaction docaction_none m_processmsg getdocumentno adddescription getdocumentno setprocessed setdocstatus docstatus_reversed setdocaction docaction_none reverse accrual none return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return false public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id private object tmp elements null public array init tmpelements public array int size set size size init setsize public array int size int grow set size size set grow grow init setsize setgrow private void init elements new object size public object next element throws java util no such element exception if elements place null place current place return elements place 1 else place 0 throw new java util no such element exception nextelement nosuchelementexception nosuchelementexception public boolean has more elements if place elements length current place return true return false hasmoreelements public void set size int size this size size setsize public int get current size return current getcurrentsize public void rehash tmp elements new object size int count 0 for int x 0 x elements length x if elements x null tmp elements count elements x count elements object tmp elements clone tmp elements null current count tmpelements tmpelements tmpelements tmpelements public void set grow int grow this grow grow setgrow public void grow size size size grow rehash public void add object o if current elements length grow try elements current o current catch java lang array store exception ase arraystoreexception public void add int location object o try elements location o catch java lang array store exception ase arraystoreexception public void remove int location elements location null public int location object o throws no such object exception int loc 1 for int x 0 x elements length x if elements x null elements x o elements x null elements x equals o loc x break if loc 1 throw new no such object exception return loc nosuchobjectexception nosuchobjectexception public object get int location return elements location public java util enumeration elements return this constructor public v panel super new grid bag layout set name v panel set border null set initial values of constraint m gbc anchor grid bag constraints northwest m gbc gridy 0 line m gbc gridx 0 m gbc gridheight 1 m gbc gridwidth 1 m gbc insets m zeroinset m gbc fill grid bag constraints horizontal m gbc weightx 0 m gbc weighty 0 m gbc ipadx 0 m gbc ipady 0 vpanel gridbaglayout setname vpanel setborder m_gbc gridbagconstraints m_gbc m_gbc m_gbc m_gbc m_gbc m_zeroinset m_gbc gridbagconstraints m_gbc m_gbc m_gbc m_gbc add field and label to panel param editor editor param m field field model public void add field v editor editor m field m field c label label v editor factory get label m field if label null editor null return boolean same line m field is same line if add group m field get field group sets top same line false if same line set line m gbc gridy m line 1 else m gbc gridy m line the label if label null m gbc gridwidth 1 m gbc insets m labelinset m gbc fill grid bag constraints horizontal required for right justified set column if m lefttoright m gbc gridx same line 2 0 else m gbc gridx same line m field is long field 3 1 weight factor for label m gbc weightx 0 if m field is create mnemonic set mnemonic label add label this add label m gbc the field if editor null component field component editor default width m gbc gridwidth m field is long field 3 1 m gbc insets m fieldinset m gbc fill grid bag constraints none m gbc fill grid bag constraints horizontal set column if m lefttoright m gbc gridx same line 3 1 else m gbc gridx same line 2 0 weight factor for fields m gbc weightx 1 add field this add field m gbc link label to field if label null label set label for field else if m field is create mnemonic set mnemonic editor mfield addfield veditor mfield mfield clabel veditorfactory getlabel mfield sameline mfield issameline addgroup mfield getfieldgroup sameline sameline m_gbc m_line m_gbc m_line m_gbc m_gbc m_labelinset m_gbc gridbagconstraints m_lefttoright m_gbc sameline m_gbc sameline mfield islongfield m_gbc mfield iscreatemnemonic setmnemonic m_gbc m_gbc mfield islongfield m_gbc m_fieldinset m_gbc gridbagconstraints m_gbc gridbagconstraints m_lefttoright m_gbc sameline m_gbc sameline m_gbc m_gbc setlabelfor mfield iscreatemnemonic setmnemonic add group param field group field group return true if group added private boolean add group string field group first time add top if m oldfieldgroup null add top m oldfieldgroup if field group null field group length 0 field group equals m oldfieldgroup return false m oldfieldgroup field group c panel group new c panel group set border new v line field group group add box create vertical strut v line space m gbc gridx 0 m gbc gridy m line m gbc gridwidth 4 this add group m gbc reset m gbc gridwidth 1 return true fieldgroup addgroup fieldgroup m_oldfieldgroup addtop m_oldfieldgroup fieldgroup fieldgroup fieldgroup m_oldfieldgroup m_oldfieldgroup fieldgroup cpanel cpanel setborder vline fieldgroup createverticalstrut vline m_gbc m_gbc m_line m_gbc m_gbc m_gbc add top 10 and right 12 gap private void add top top gap m gbc gridy m line this add box create vertical strut 10 m gbc top gap right gap m gbc gridx 4 5th column m gbc gridwidth 1 m gbc weightx 0 m gbc insets m zeroinset m gbc fill grid bag constraints none this add box create horizontal strut 12 m gbc addtop m_gbc m_line createverticalstrut m_gbc m_gbc m_gbc m_gbc m_gbc m_zeroinset m_gbc gridbagconstraints createhorizontalstrut m_gbc add end 9 of form public void add end m gbc gridx 0 m gbc gridy m line m gbc gridwidth 1 m gbc insets m zeroinset m gbc fill grid bag constraints horizontal m gbc weightx 0 this add box create vertical strut 9 m gbc botton gap addend m_gbc m_gbc m_line m_gbc m_gbc m_zeroinset m_gbc gridbagconstraints m_gbc createverticalstrut m_gbc set mnemonic for label ctrl x param label label private void set mnemonic c label label string text label get text int pos text index of if pos 1 text length pos we have a nemonic creates ctl char mnemonic text to upper case char at pos 1 if mnemonic m mnemonics add mnemonic text text substring 0 pos text substring pos 1 label set text text label set saved mnemonic mnemonic label set displayed mnemonic mnemonic else char mnemonic get mnemonic text label set saved mnemonic mnemonic label set displayed mnemonic mnemonic m fields add label ctrl_x setmnemonic clabel gettext indexof _ touppercase charat m_mnemonics settext setsavedmnemonic setdisplayedmnemonic getmnemonic setsavedmnemonic setdisplayedmnemonic m_fields set mnemonic for check box or button param editor private void set mnemonic v editor editor if editor instanceof v check box v check box cb v check box editor string text cb get text int pos text index of if pos 1 we have a nemonic creates alt char mnemonic text to upper case char at pos 1 text text substring 0 pos text substring pos 1 cb set text text cb set saved mnemonic mnemonic cb set mnemonic mnemonic else char mnemonic get mnemonic text cb set saved mnemonic mnemonic cb set mnemonic mnemonic m fields add cb button else if editor instanceof v button v button b v button editor string text b get text int pos text index of if pos 1 we have a nemonic creates alt char mnemonic text to upper case char at pos 1 text text substring 0 pos text substring pos 1 b set text text b set saved mnemonic mnemonic b set mnemonic mnemonic m fields add b else if b get column name equals doc action b get input map when in focused window put key stroke get key stroke key event vk f4 event shift mask false pressed b get input map when in focused window put key stroke get key stroke key event vk f4 event shift mask true released util print action input map b else if b get column name equals posted b get input map when in focused window put key stroke get key stroke key event vk f5 event shift mask false pressed b get input map when in focused window put key stroke get key stroke key event vk f5 event shift mask true released util print action input map b else char mnemonic get mnemonic text b set saved mnemonic mnemonic b set mnemonic mnemonic m fields add b setmnemonic veditor vcheckbox vcheckbox vcheckbox gettext indexof _ touppercase charat settext setsavedmnemonic setmnemonic getmnemonic setsavedmnemonic setmnemonic m_fields vbutton vbutton vbutton gettext indexof _ touppercase charat settext setsavedmnemonic setmnemonic m_fields getcolumnname docaction getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_f4 shift_mask getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_f4 shift_mask printactioninputmap getcolumnname getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_f5 shift_mask getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_f5 shift_mask printactioninputmap getmnemonic setsavedmnemonic setmnemonic m_fields get mnemonic param text text return mnemonic private char get mnemonic string text if text null text length 0 return 0 text text trim char mnemonic text to upper case char at 0 if m mnemonics contains mnemonic mnemonic 0 beginning new word int index text index of while index 1 text length index char c text to upper case char at index 1 if character is letter or digit c m mnemonics contains c mnemonic c break index text index of index 1 any character if mnemonic 0 for int i 1 i text length i char c text to upper case char at i if character is letter or digit c m mnemonics contains c mnemonic c break first character fallback if mnemonic 0 mnemonic text to upper case char at 0 m mnemonics add mnemonic return mnemonic getmnemonic touppercase charat m_mnemonics indexof touppercase charat isletterordigit m_mnemonics indexof touppercase charat isletterordigit m_mnemonics touppercase charat m_mnemonics set window level mnemonics param set true if set otherwise unregiser public void set mnemonics boolean set int size m fields size for int i 0 i size i component c m fields get i if c instanceof c label c label l c label c if set l set displayed mnemonic l get saved mnemonic else l set displayed mnemonic 0 else if c instanceof v check box v check box cb v check box c if set cb set mnemonic cb get saved mnemonic else cb set mnemonic 0 else if c instanceof v button v button b v button c if set b set mnemonic b get saved mnemonic else b set mnemonic 0 setmnemonics m_fields m_fields clabel clabel clabel setdisplayedmnemonic getsavedmnemonic setdisplayedmnemonic vcheckbox vcheckbox vcheckbox setmnemonic getsavedmnemonic setmnemonic vbutton vbutton vbutton setmnemonic getsavedmnemonic setmnemonic set background to ad color id nop param ad color id color public void set background int ad color id ad_color_id ad_color_id setbackground ad_color_id is this a valid credit card exp date param mmyy exp in form of mmyy return or error ad message public static string validate credit card exp string mmyy string exp check numeric mmyy if exp length 4 return credit card exp format string mm str exp substring 0 2 string yy str exp substring 2 4 int mm 0 int yy 0 try mm integer parse int mm str yy integer parse int yy str catch exception e return credit card exp format return validate credit card exp mm yy ad_message validatecreditcardexp checknumeric creditcardexpformat mmstr yystr parseint mmstr parseint yystr creditcardexpformat validatecreditcardexp return month of exp param mmyy exp in form of mmyy return month public static int get credit card expmm string mmyy string mm str mmyy substring 0 2 int mm 0 try mm integer parse int mm str catch exception e return mm getcreditcardexpmm mmstr parseint mmstr return year of exp param mmyy exp in form of mmyy return year public static int get credit card expyy string mmyy string yy str mmyy substring 2 int yy 0 try yy integer parse int yy str catch exception e return yy getcreditcardexpyy yystr parseint yystr is this a valid credit card exp date param mm month param yy year return or error ad message public static string validate credit card exp int mm int yy if mm 1 mm 12 return credit card exp month if yy 0 yy exp year return credit card exp year today s date calendar cal calendar get instance int year cal get calendar year 2000 two digits int month cal get calendar month 1 zero based if yy year return credit card expired else if yy year mm month return credit card expired return ad_message validatecreditcardexp creditcardexpmonth exp_year creditcardexpyear getinstance creditcardexpired creditcardexpired validate credit card number based on luhn formula param credit card number credit card number return or error ad message public static string validate credit card number string credit card number if credit card number null credit card number length 0 return credit card number error 1 double the value of alternate digits beginning with the first right hand digit low order 2 add the individual digits comprising the products obtained in step 1 to each of the unaffected digits in the original number 3 subtract the total obtained in step 2 from the next higher number ending in 0 this in the equivalent of calculating the tens complement of the low order digit unit digit of the total if the total obtained in step 2 is a number ending in zero 30 40 etc the check digit is 0 example account number 4992 73 9871 6 4 9 9 2 7 3 9 8 7 1 6 x2 x2 x2 x2 x2 4 18 9 4 7 6 9 16 7 2 6 4 1 8 9 4 7 6 9 1 6 7 2 6 70 70 10 0 clean up number string cc number1 check numeric credit card number int cc length cc number1 length reverse string string buffer buf new string buffer for int i cc length i 0 i buf append cc number1 char at i 1 string cc number buf to string int sum 0 for int i 0 i cc length i int digit character get numeric value cc number char at i if i 2 1 digit 2 if digit 9 digit 9 sum digit if sum 10 0 return s log fine validate credit card number credit card number cc number luhn sum return credit card number error creditcardnumber ad_message validatecreditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumbererror ccnumber1 checknumeric creditcardnumber cclength ccnumber1 stringbuffer stringbuffer cclength ccnumber1 charat ccnumber tostring cclength getnumericvalue ccnumber charat s_log validatecreditcardnumber creditcardnumber ccnumber creditcardnumbererror validate credit card number check card type and length param credit card number cc number param credit card type cc type return or error ad message public static string validate credit card number string credit card number string credit card type if credit card number null credit card type null return credit card number error http www beachnet com hstiles cardtype html http staff semel fi kribe document luhn htm string cc start list comma separated list of starting numbers string cc length list comma separated list of lengths if credit card type equals m payment creditcardtype mastercard cc start list 51 52 53 54 55 cc length list 16 else if credit card type equals m payment creditcardtype visa cc start list 4 cc length list 13 16 else if credit card type equals m payment creditcardtype amex cc start list 34 37 cc length list 15 else if credit card type equals m payment creditcardtype discover cc start list 6011 cc length list 16 else if credit card type equals m payment creditcardtype diners cc start list 300 301 302 303 304 305 36 38 cc length list 14 else en route card cc start list 2014 2149 cc length list 15 jcb card cc start list 3088 3096 3112 3158 3337 3528 cc length list 16 jcb card cc start list 2131 1800 cc length list 15 clean up number string cc number check numeric credit card number check length int cc length cc number length boolean cc lengthok false string tokenizer st new string tokenizer cc length list false while st has more tokens cc lengthok int l integer parse int st next token if cc length l cc lengthok true if cc lengthok s log fine validate credit card number length cc length cc length list return credit card number error check start digits boolean cc identified false st new string tokenizer cc start list false while st has more tokens cc identified if cc number starts with st next token cc identified true if cc identified s log fine validate credit card number type credit card type cc start list string check validate credit card number cc number if check length 0 return check if cc identified return credit card number problem return creditcardnumber creditcardtype ad_message validatecreditcardnumber creditcardnumber creditcardtype creditcardnumber creditcardtype creditcardnumbererror ccstartlist cclengthlist creditcardtype mpayment creditcardtype_mastercard ccstartlist cclengthlist creditcardtype mpayment creditcardtype_visa ccstartlist cclengthlist creditcardtype mpayment creditcardtype_amex ccstartlist cclengthlist creditcardtype mpayment creditcardtype_discover ccstartlist cclengthlist creditcardtype mpayment creditcardtype_diners ccstartlist cclengthlist enroutecard ccstartlist cclengthlist jcbcard ccstartlist cclengthlist jcbcard ccstartlist cclengthlist ccnumber checknumeric creditcardnumber cclength ccnumber cclengthok stringtokenizer stringtokenizer cclengthlist hasmoretokens cclengthok parseint nexttoken cclength cclengthok cclengthok s_log validatecreditcardnumber cclength cclengthlist creditcardnumbererror ccidentified stringtokenizer ccstartlist hasmoretokens ccidentified ccnumber startswith nexttoken ccidentified ccidentified s_log validatecreditcardnumber creditcardtype ccstartlist validatecreditcardnumber ccnumber ccidentified creditcardnumberproblem validate validation code param credit cardvv cc verification code return or error ad message public static string validate credit cardvv string credit cardvv if credit cardvv null return int length check numeric credit cardvv length if length 3 length 4 return try integer parse int credit cardvv return catch number format exception ex s log fine validate credit cardvv ex s log fine validate credit cardvv length length return credit cardvv error creditcardvv ad_message validatecreditcardvv creditcardvv creditcardvv checknumeric creditcardvv parseint creditcardvv numberformatexception s_log validatecreditcardvv s_log validatecreditcardvv creditcardvverror validate validation code param credit cardvv cc verification code param credit card type cc type see cc return or error ad message public static string validate credit cardvv string credit cardvv string credit card type no data if credit cardvv null credit cardvv length 0 credit card type null credit card type length 0 return int length check numeric credit cardvv length amex 4 digits if credit card type equals m payment creditcardtype amex if length 4 try integer parse int credit cardvv return catch number format exception ex s log fine validate credit cardvv ex s log fine validate credit cardvv 4 cc credit card type length length return credit cardvv error visa master card 3 digits if credit card type equals m payment creditcardtype visa credit card type equals m payment creditcardtype mastercard if length 3 try integer parse int credit cardvv return catch number format exception ex s log fine validate credit cardvv ex s log fine validate credit cardvv 3 cc credit card type length length return credit cardvv error other return creditcardvv creditcardtype cc_ ad_message validatecreditcardvv creditcardvv creditcardtype creditcardvv creditcardvv creditcardtype creditcardtype checknumeric creditcardvv creditcardtype mpayment creditcardtype_amex parseint creditcardvv numberformatexception s_log validatecreditcardvv s_log validatecreditcardvv creditcardtype creditcardvverror mastercard creditcardtype mpayment creditcardtype_visa creditcardtype mpayment creditcardtype_mastercard parseint creditcardvv numberformatexception s_log validatecreditcardvv s_log validatecreditcardvv creditcardtype creditcardvverror validate routing number param routing no routing no return or error ad message public static string validate routing no string routing no int length check numeric routing no length us length 9 germany length 8 if length 8 length 9 return return payment bank routing not valid routingno ad_message validateroutingno routingno checknumeric routingno paymentbankroutingnotvalid validate account no param account no account no return or error ad message public static string validate account no string account no int length check numeric account no length if length 0 return return payment bank account not valid accountno accountno ad_message validateaccountno accountno checknumeric accountno paymentbankaccountnotvalid validate check no param check no check no return or error ad message public static string validate check no string check no int length check numeric check no length if length 0 return return payment bank check not valid checkno checkno ad_message validatecheckno checkno checknumeric checkno paymentbankchecknotvalid check numeric param data input return the digits of the data ignore the rest public static string check numeric string data if data null data length 0 return remove all non digits string buffer sb new string buffer for int i 0 i data length i if character is digit data char at i sb append data char at i return sb to string checknumeric stringbuffer stringbuffer isdigit charat charat tostring start application task param task task model static public void start final string title final m task task new thread public void run new a task title task start mtask atask new thread public void run new a task title task atask full constructor param title title param task task public a task string title m task task super title this set icon image compiere get image16 try jb init a env show center screen this if task is server process info set text executing on server else info set text executing locally string result task execute info set text result confirm panel get cancel button set enabled false confirm panel getok button set enabled true catch exception e log log level severe task to string e atask mtask seticonimage getimage16 jbinit aenv showcenterscreen isserverprocess settext settext settext confirmpanel getcancelbutton setenabled confirmpanel getokbutton setenabled tostring static layout throws exception private void jb init throws exception info set editable false info set background compiereplaf getfieldbackground inactive info scroll pane get viewport add info null info scroll pane set preferred size new dimension 500 300 this get content pane add info scroll pane border layout center this get content pane add confirm panel border layout south confirm panel add action listener this confirm panel getok button set enabled false jbinit seteditable setbackground getfieldbackground_inactive infoscrollpane getviewport infoscrollpane setpreferredsize getcontentpane infoscrollpane borderlayout getcontentpane confirmpanel borderlayout confirmpanel addactionlistener confirmpanel getokbutton setenabled action listener param e public void action performed action event e if m task null m task is alive m task interrupt dispose actionperformed actionevent m_task m_task isalive m_task prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message throws exception protected string do it throws exception m client client m client get get ctx if client is multi lingual document throw new compiere user error ad client id is multi lingual document log info client string sql select from ad table where table name like trl and table name not like ad order by table name prepared statement pstmt null try pstmt db prepare statement sql get trxname result set rs pstmt execute query while rs next process table new m table get ctx rs null client getad client id rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ok doit mclient mclient getctx ismultilingualdocument compiereusererror ad_client_id ismultilingualdocument ad_table tablename _trl tablename tablename preparedstatement preparestatement get_trxname resultset executequery processtable m_table getctx getad_client_id process translation table param table table private void process table m table table int ad client id string buffer sql new string buffer m column columns table get columns false for int i 0 i columns length i m column column columns i if column getad reference id display type string column getad reference id display type text string column name column get column name if sql length 0 sql append sql append column name string base table table get table name base table base table substring 0 base table length 4 log config base table sql string column names sql to string sql new string buffer sql append update append table get table name append t set append column names append select append column names append from append base table append b where t append base table append id b append base table append id where ad client id append ad client id int no db execute update sql to string get trxname add log 0 null new big decimal no base table processtable m_table ad_client_id stringbuffer stringbuffer m_column getcolumns m_column getad_reference_id displaytype getad_reference_id displaytype columnname getcolumnname columnname basetable gettablename basetable basetable basetable basetable columnnames tostring stringbuffer gettablename columnnames columnnames basetable basetable _id basetable _id ad_client_id ad_client_id executeupdate tostring get_trxname addlog bigdecimal basetable constructor param frame frame param title title param m locator locator param m locator id locator id param mandatory mandatory param only warehouse id of not 0 restrict warehouse public v locator dialog frame frame string title m locator lookup m locator int m locator id boolean mandatory int only warehouse id super frame title true m windowno env get window no frame try jb init set default close operation j dialog dispose on close catch exception ex log log level severe v locator dialog ex m mlocator m locator m m locator id m locator id m mandatory mandatory m only warehouse id only warehouse id init locator a env position center window frame this mlocator m_locator_id only_warehouse_id vlocatordialog mlocatorlookup mlocator m_locator_id only_warehouse_id m_windowno getwindowno jbinit setdefaultcloseoperation jdialog dispose_on_close vlocatordialog m_mlocator mlocator m_m_locator_id m_locator_id m_mandatory m_only_warehouse_id only_warehouse_id initlocator aenv positioncenterwindow static component init throws exception private void jb init throws exception panel set layout panel layout south panel set layout south layout main panel set layout grid bag layout panel layout set hgap 5 panel layout set vgap 10 f create new set text msg get msg env get ctx create new fx set columns 15 fy set columns 15 fz set columns 15 l locator set label for f locator l locator set text msg translate env get ctx m locator id f warehouse info set background compiereplaf getfieldbackground inactive f warehouse info set read write false f warehouse info set columns 15 f value set columns 15 l warehouse info set label for f warehouse info l warehouse info set text msg translate env get ctx m warehouse id l warehouse set label for f warehouse l warehouse set text msg translate env get ctx m warehouse id lx set label for fx lx set text msg get element env get ctx x ly set label for fy ly set text msg get element env get ctx y lz set label for fz lz set text msg get element env get ctx z l value set label for f value l value set text msg translate env get ctx value get content pane add panel panel add main panel border layout center main panel add l locator new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add f locator new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add f create new new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 0 0 5 0 0 main panel add l warehouse info new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add f warehouse info new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add l warehouse new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add f warehouse new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add lx new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add fx new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add ly new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add fy new grid bag constraints 1 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add lz new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add fz new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 main panel add l value new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 main panel add f value new grid bag constraints 1 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 panel add south panel border layout south south panel add confirm panel border layout north confirm panel add action listener this jbinit setlayout panellayout southpanel setlayout southlayout mainpanel setlayout gridbaglayout panellayout sethgap panellayout setvgap fcreatenew settext getmsg getctx createnew setcolumns setcolumns setcolumns llocator setlabelfor flocator llocator settext getctx m_locator_id fwarehouseinfo setbackground getfieldbackground_inactive fwarehouseinfo setreadwrite fwarehouseinfo setcolumns fvalue setcolumns lwarehouseinfo setlabelfor fwarehouseinfo lwarehouseinfo settext getctx m_warehouse_id lwarehouse setlabelfor fwarehouse lwarehouse settext getctx m_warehouse_id setlabelfor settext getelement getctx setlabelfor settext getelement getctx setlabelfor settext getelement getctx lvalue setlabelfor fvalue lvalue settext getctx getcontentpane mainpanel borderlayout mainpanel llocator gridbagconstraints gridbagconstraints gridbagconstraints mainpanel flocator gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fcreatenew gridbagconstraints gridbagconstraints gridbagconstraints mainpanel lwarehouseinfo gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fwarehouseinfo gridbagconstraints gridbagconstraints gridbagconstraints mainpanel lwarehouse gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fwarehouse gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel lvalue gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fvalue gridbagconstraints gridbagconstraints gridbagconstraints southpanel borderlayout southpanel confirmpanel borderlayout confirmpanel addactionlistener dynanmic init fill fields private void init locator log fine load warehouse string sql select m warehouse id name from m warehouse if m only warehouse id 0 sql where m warehouse id m only warehouse id string sql m role get default add accesssql sql m warehouse m role sql notqualified m role sql ro order by 2 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next f warehouse add item new key name pair rs get int 1 rs get string 2 rs close pstmt close catch sql exception e log log level severe sql e log fine warehouses f warehouse get item count load existing locators m mlocator fill combo box m mandatory true true false log fine m mlocator to string f locator set model m mlocator f locator set value m m locator id f locator add action listener this display locator f create new set selected false f create new add action listener this enable new f warehouse add action listener this fx add key listener this fy add key listener this fz add key listener this update ui pack initlocator m_warehouse_id m_warehouse m_only_warehouse_id m_warehouse_id m_only_warehouse_id mrole getdefault addaccesssql m_warehouse mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery fwarehouse additem keynamepair getint getstring sqlexception fwarehouse getitemcount m_mlocator fillcombobox m_mandatory m_mlocator tostring flocator setmodel m_mlocator flocator setvalue m_m_locator_id flocator addactionlistener displaylocator fcreatenew setselected fcreatenew addactionlistener enablenew fwarehouse addactionlistener addkeylistener addkeylistener addkeylistener action listener param e event public void action performed action event e object source e get source if e get action command equals confirm panel a ok actionok m change true dispose else if e get action command equals confirm panel a cancel m change false dispose locator change else if e get source f locator display locator new value change else if source f create new enable new entered changed data for value else if f create new is selected source f warehouse create value actionlistener actionperformed actionevent getsource getactioncommand confirmpanel a_ok m_change getactioncommand confirmpanel a_cancel m_change getsource flocator displaylocator fcreatenew enablenew fcreatenew isselected fwarehouse createvalue key listener nop param e event public void key pressed key event e keylistener keypressed keyevent key listener param e event public void key released key event e if f create new is selected create value keylistener keyreleased keyevent fcreatenew isselected createvalue key listener nop param e event public void key typed key event e keylistener keytyped keyevent display value of current locator private void display locator m locator l m locator f locator get selected item if l null return m m locator id l getm locator id f warehouse info set text l get warehouse name fx set text l getx fy set text l gety fz set text l getz f value set text l get value get warehouse info l getm warehouse id set warehouse int size f warehouse get item count for int i 0 i size i key name pair pp key name pair f warehouse get item at i if pp get key l getm warehouse id f warehouse set selected index i continue displaylocator mlocator mlocator flocator getselecteditem m_m_locator_id getm_locator_id fwarehouseinfo settext getwarehousename settext settext settext fvalue settext getvalue getwarehouseinfo getm_warehouse_id fwarehouse getitemcount keynamepair keynamepair fwarehouse getitemat getkey getm_warehouse_id fwarehouse setselectedindex enable disable new data entry private void enable new boolean sel f create new is selected l warehouse set visible sel f warehouse set visible sel l warehouse info set visible sel f warehouse info set visible sel fx set read write sel fy set read write sel fz set read write sel f value set read write sel pack enablenew fcreatenew isselected lwarehouse setvisible fwarehouse setvisible lwarehouseinfo setvisible fwarehouseinfo setvisible setreadwrite setreadwrite setreadwrite fvalue setreadwrite get warehouse info param m warehouse id warehouse private void get warehouse info int m warehouse id if m warehouse id m m warehouse id return defaults m m warehouse id 0 m m warehousename m m warehousevalue m separator m ad client id 0 m ad org id 0 string sql select m warehouse id value name separator ad client id ad org id from m warehouse where m warehouse id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m warehouse id result set rs pstmt execute query if rs next m m warehouse id rs get int 1 m m warehousevalue rs get string 2 m m warehousename rs get string 3 m separator rs get string 4 m ad client id rs get int 5 m ad org id rs get int 6 rs close pstmt close catch sql exception e log log level severe sql e m_warehouse_id getwarehouseinfo m_warehouse_id m_warehouse_id m_m_warehouse_id m_m_warehouse_id m_m_warehousename m_m_warehousevalue m_separator m_ad_client_id m_ad_org_id m_warehouse_id ad_client_id ad_org_id m_warehouse m_warehouse_id preparedstatement preparestatement setint m_warehouse_id resultset executequery m_m_warehouse_id getint m_m_warehousevalue getstring m_m_warehousename getstring m_separator getstring m_ad_client_id getint m_ad_org_id getint sqlexception create locator value private void create value get warehouse info key name pair pp key name pair f warehouse get selected item if pp null return get warehouse info pp get key string buffer buf new string buffer m m warehousevalue buf append m separator append fx get text buf append m separator append fy get text buf append m separator append fz get text f value set text buf to string createvalue keynamepair keynamepair fwarehouse getselecteditem getwarehouseinfo getkey stringbuffer stringbuffer m_m_warehousevalue m_separator gettext m_separator gettext m_separator gettext fvalue settext tostring ok check for changes save them exit private void actionok if f create new is selected get warehouse info key name pair pp key name pair f warehouse get selected item if pp null get warehouse info pp get key check mandatory values string mandatory fields if m m warehouse id 0 mandatory fields l warehouse get text if f value get text length 0 mandatory fields l value get text if fx get text length 0 mandatory fields lx get text if fy get text length 0 mandatory fields ly get text if fz get text length 0 mandatory fields lz get text if mandatory fields length 0 a dialog error m windowno this fill mandatory mandatory fields substring 0 mandatory fields length 3 return m locator loc m locator get env get ctx m m warehouse id f value get text fx get text fy get text fz get text m m locator id loc getm locator id f locator add item loc f locator set selected item loc create new log config m locator id m m locator id fcreatenew isselected keynamepair keynamepair fwarehouse getselecteditem getwarehouseinfo getkey mandatoryfields m_m_warehouse_id mandatoryfields lwarehouse gettext fvalue gettext mandatoryfields lvalue gettext gettext mandatoryfields gettext gettext mandatoryfields gettext gettext mandatoryfields gettext mandatoryfields adialog m_windowno fillmandatory mandatoryfields mandatoryfields mlocator mlocator getctx m_m_warehouse_id fvalue gettext gettext gettext gettext m_m_locator_id getm_locator_id flocator additem flocator setselecteditem createnew m_locator_id m_m_locator_id get selected value return value as integer public integer get value m locator l m locator f locator get selected item if l null l getm locator id 0 return new integer l getm locator id return null getvalue mlocator mlocator flocator getselecteditem getm_locator_id getm_locator_id get result return true if changed public boolean is changed if m change m locator l m locator f locator get selected item if l null return l getm locator id m m locator id return m change ischanged m_change mlocator mlocator flocator getselecteditem getm_locator_id m_m_locator_id m_change standard constructor public x k type properties ctx int k type id string trx name super ctx k type id trx name if k type id 0 set is public true y set is public write true y setk type id 0 set name null x_k_type k_type_id trxname k_type_id trxname k_type_id setispublic setispublicwrite setk_type_id setname load constructor public x k type properties ctx result set rs string trx name super ctx rs trx name x_k_type resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k type append get id append return sb to string tostring stringbuffer stringbuffer x_k_type get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set public public can read entry public void set is public boolean is public set value is public new boolean is public setispublic ispublic set_value ispublic ispublic get public public can read entry public boolean is public object oo get value is public if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublic get_value ispublic booleanvalue set public write public can write entries public void set is public write boolean is public write set value is public write new boolean is public write setispublicwrite ispublicwrite set_value ispublicwrite ispublicwrite get public write public can write entries public boolean is public write object oo get value is public write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublicwrite get_value ispublicwrite booleanvalue set knowldge type knowledge type public void setk type id int k type id if k type id 1 throw new illegal argument exception k type id is mandatory set valuenocheck k type id new integer k type id setk_type_id k_type_id k_type_id illegalargumentexception k_type_id set_valuenocheck k_type_id k_type_id get knowldge type knowledge type public int getk type id integer ii integer get value k type id if ii null return 0 return ii int value getk_type_id get_value k_type_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad user id p ad user id para i get parameter as int else if name equals old password p oldpassword string para i get parameter else if name equals new password p newpassword string para i get parameter else if name equals newe mail p newemail string para i get parameter else if name equals newe mail user p newemailuser string para i get parameter else if name equals newe mail userpw p newemailuserpw string para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_user_id p_ad_user_id getparameterasint oldpassword p_oldpassword getparameter newpassword p_newpassword getparameter newemail p_newemail getparameter newemailuser p_newemailuser getparameter newemailuserpw p_newemailuserpw getparameter perrform process return message throws exception if not successful protected string do it throws exception log info ad user id p ad user id from getad user id m user user m user get get ctx p ad user id m user operator m user get get ctx getad user id log fine user user operator operator do we need a password if util is empty p oldpassword password required if p ad user id 0 change of system p ad user id 100 change of super user operator is administrator throw new illegal argument exception old password mandatory is entered password correct else if p oldpassword equals user get password throw new illegal argument exception old password no match change super user if p ad user id 0 string sql update ad user set updated sys date updated by getad user id if util is empty p newpassword sql password db to string p newpassword if util is empty p newemail sql email db to string p newemail if util is empty p newemailuser sql email user db to string p newemailuser if util is empty p newemailuserpw sql email userpw db to string p newemailuserpw sql where ad user id 0 if db execute update sql get trxname 1 return ok else return error else if util is empty p newpassword user set password p newpassword if util is empty p newemail user sete mail p newemail if util is empty p newemailuser user sete mail user p newemailuser if util is empty p newemailuserpw user sete mail userpw p newemailuserpw if user save return ok else return error doit ad_user_id p_ad_user_id getad_user_id muser muser getctx p_ad_user_id muser muser getctx getad_user_id isempty p_oldpassword p_ad_user_id p_ad_user_id superuser isadministrator illegalargumentexception oldpasswordmandatory p_oldpassword getpassword illegalargumentexception oldpasswordnomatch p_ad_user_id ad_user sysdate updatedby getad_user_id isempty p_newpassword to_string p_newpassword isempty p_newemail to_string p_newemail isempty p_newemailuser emailuser to_string p_newemailuser isempty p_newemailuserpw emailuserpw to_string p_newemailuserpw ad_user_id executeupdate get_trxname isempty p_newpassword setpassword p_newpassword isempty p_newemail setemail p_newemail isempty p_newemailuser setemailuser p_newemailuser isempty p_newemailuserpw setemailuserpw p_newemailuserpw create form need to call open form public form frame super add window listener new java awt event window adapter public void window opened java awt event window event evt form window opened evt m windowno env create window no this set glass pane m glasspane try jb init create menu catch exception e log log level severe e openform formframe addwindowlistener windowadapter windowopened windowevent formwindowopened m_windowno createwindowno setglasspane m_glasspane jbinit createmenu add window listener new java awt event window adapter public void window opened java awt event window event evt form window opened evt addwindowlistener windowadapter windowopened windowevent formwindowopened static init throws exception private void jb init throws exception this set icon image org compiere compiere get image16 this set default close operation j frame dispose on close this setj menu bar menu bar jbinit seticonimage getimage16 setdefaultcloseoperation jframe dispose_on_close setjmenubar menubar create menu private void create menu file j menu m file a env get menu file menu bar add m file a env add menu item print screen null key stroke get key stroke key event vk printscreen 0 m file this a env add menu item screen shot null key stroke get key stroke key event vk printscreen event shift mask m file this a env add menu item report null key stroke get key stroke key event vk p event alt mask m file this m file add separator a env add menu item end null key stroke get key stroke key event vk x event alt mask m file this a env add menu item exit null key stroke get key stroke key event vk x event shift mask event alt mask m file this view j menu m view a env get menu view menu bar add m view a env add menu item info product null key stroke get key stroke key event vk i event ctrl mask m view this a env add menu item infob partner null key stroke get key stroke key event vk i event shift mask event ctrl mask m view this a env add menu item info account null key stroke get key stroke key event vk i event alt mask event ctrl mask m view this m view add separator a env add menu item info order info null m view this a env add menu item info invoice info null m view this a env add menu item info in out info null m view this a env add menu item info payment info null m view this a env add menu item info schedule info null m view this tools j menu m tools a env get menu tools menu bar add m tools a env add menu item calculator null null m tools this a env add menu item calendar null null m tools this a env add menu item editor null null m tools this a env add menu item script null null m tools this if m role get default is show preference m tools add separator a env add menu item preference null null m tools this help j menu m help a env get menu help menu bar add m help a env add menu item help help key stroke get key stroke key event vk f1 0 m help this a env add menu item online null null m help this a env add menu item e mail support null null m help this a env add menu item about null null m help this createmenu jmenu mfile aenv getmenu menubar mfile aenv addmenuitem printscreen keystroke getkeystroke keyevent vk_printscreen mfile aenv addmenuitem screenshot keystroke getkeystroke keyevent vk_printscreen shift_mask mfile aenv addmenuitem keystroke getkeystroke keyevent vk_p alt_mask mfile mfile addseparator aenv addmenuitem keystroke getkeystroke keyevent vk_x alt_mask mfile aenv addmenuitem keystroke getkeystroke keyevent vk_x shift_mask alt_mask mfile jmenu mview aenv getmenu menubar mview aenv addmenuitem infoproduct keystroke getkeystroke keyevent vk_i ctrl_mask mview aenv addmenuitem infobpartner keystroke getkeystroke keyevent vk_i shift_mask ctrl_mask mview aenv addmenuitem infoaccount keystroke getkeystroke keyevent vk_i alt_mask ctrl_mask mview mview addseparator aenv addmenuitem infoorder mview aenv addmenuitem infoinvoice mview aenv addmenuitem infoinout mview aenv addmenuitem infopayment mview aenv addmenuitem infoschedule mview jmenu mtools aenv getmenu menubar mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools mrole getdefault isshowpreference mtools addseparator aenv addmenuitem mtools jmenu mhelp aenv getmenu menubar mhelp aenv addmenuitem keystroke getkeystroke keyevent vk_f1 mhelp aenv addmenuitem mhelp aenv addmenuitem emailsupport mhelp aenv addmenuitem mhelp dispose public void dispose log config recursive calls if trace is called from j frame x close window pressed m panel dispose m panel null env clear win context m windowno super dispose iscalledfrom jframe m_panel m_panel clearwincontext m_windowno open form param ad form id form return true if form opened public boolean open form int ad form id properties ctx env get ctx string name null string class name null string sql select name description class name help from ad form where ad form id boolean trl env is base language ctx ad form if trl sql select t name t description f class name t help from ad form f inner join ad form trl t on f ad form id t ad form id and ad language where f ad form id try prepared statement pstmt db prepare statement sql null if trl pstmt set string 1 env getad language ctx pstmt set int 2 ad form id else pstmt set int 1 ad form id result set rs pstmt execute query if rs next name rs get string 1 m description rs get string 2 class name rs get string 3 m help rs get string 4 rs close pstmt close catch sql exception e log log level severe sql e if class name null return false log info ad form id ad form id class class name env set context ctx m windowno window name name set title env get header ctx m windowno try create instance w o parameters m panel form panel class for name class name new instance catch exception e log log level severe class class name ad form id ad form id e return false m panel init m windowno this return true ad_form_id openform ad_form_id getctx classname classname ad_form ad_form_id isbaselanguage ad_form classname ad_form ad_form_trl ad_form_id ad_form_id ad_language ad_form_id preparedstatement preparestatement setstring getad_language setint ad_form_id setint ad_form_id resultset executequery getstring m_description getstring classname getstring m_help getstring sqlexception classname ad_form_id ad_form_id classname setcontext m_windowno windowname settitle getheader m_windowno m_panel formpanel forname classname newinstance classname ad_form_id ad_form_id m_panel m_windowno get form panel return form panel public form panel get form panel return m panel formpanel getformpanel m_panel action listener param e event public void action performed action event e string cmd e get action command if cmd equals end dispose else if cmd equals help action help else if a env action performed cmd m windowno this log log level severe not handeled cmd actionperformed actionevent getactioncommand actionhelp aenv actionperformed m_windowno show help private void action help string buffer sb new string buffer sb append h2 append m description append h2 p append m help help hlp new help env get frame this this get title sb to string hlp set visible true actionhelp stringbuffer stringbuffer m_description m_help getframe gettitle tostring setvisible set window busy param busy busy public void set busy boolean busy if busy m glasspane is visible return log info busy busy if busy set cursor cursor get predefined cursor cursor wait cursor else set cursor cursor get default cursor m glasspane set message null m glasspane set visible busy m glasspane request focus setbusy m_glasspane isvisible setcursor getpredefinedcursor wait_cursor setcursor getdefaultcursor m_glasspane setmessage m_glasspane setvisible m_glasspane requestfocus set busy message param ad message message public void set busy message string ad message m glasspane set message ad message ad_message setbusymessage ad_message m_glasspane setmessage ad_message set and start busy counter param time in seconds public void set busy timer int time m glasspane set busy timer time setbusytimer m_glasspane setbusytimer set maximize window param max maximize public void set maximize boolean max m maximize max setmaximize m_maximize form window opened maximize window if required param evt event private void form window opened java awt event window event evt if m maximize true super set visible true super set extended state j frame maximized both formwindowopened windowevent m_maximize setvisible setextendedstate jframe maximized_both start batch param process return running thread public thread start batch final runnable process thread worker new thread public void run set busy true process run set busy false worker start return worker startbatch setbusy setbusy public void run set busy true process run set busy false setbusy setbusy standard constructor public x c campaign properties ctx int c campaign id string trx name super ctx c campaign id trx name if c campaign id 0 setc campaign id 0 set costs env zero set is summary false set name null set value null x_c_campaign c_campaign_id trxname c_campaign_id trxname c_campaign_id setc_campaign_id setcosts setissummary setname setvalue load constructor public x c campaign properties ctx result set rs string trx name super ctx rs trx name x_c_campaign resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c campaign append get id append return sb to string tostring stringbuffer stringbuffer x_c_campaign get_id tostring set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 1 throw new illegal argument exception c campaign id is mandatory set valuenocheck c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id illegalargumentexception c_campaign_id set_valuenocheck c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set channel sales channel public void setc channel id int c channel id if c channel id 0 set value c channel id null else set value c channel id new integer c channel id setc_channel_id c_channel_id c_channel_id set_value c_channel_id set_value c_channel_id c_channel_id get channel sales channel public int getc channel id integer ii integer get value c channel id if ii null return 0 return ii int value getc_channel_id get_value c_channel_id intvalue set costs costs in accounting currency public void set costs big decimal costs if costs null throw new illegal argument exception costs is mandatory set value costs costs setcosts bigdecimal illegalargumentexception set_value get costs costs in accounting currency public big decimal get costs big decimal bd big decimal get value costs if bd null return env zero return bd bigdecimal getcosts bigdecimal bigdecimal get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set end date last effective date inclusive public void set end date timestamp end date set value end date end date setenddate enddate set_value enddate enddate get end date last effective date inclusive public timestamp get end date return timestamp get value end date getenddate get_value enddate set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set start date first effective day inclusive public void set start date timestamp start date set value start date start date setstartdate startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value server process note that the class is initiated by start process public svr process env zero divide env zero startprocess svrprocess start the process calls the abstract methods code process code it should only return false if the function could not be performed as this causes the process to abort param ctx context param pi process info return true if the next process should be performed see org compiere process process call start process properties process info trx public final boolean start process properties ctx process info pi trx trx preparation m ctx ctx null env get ctx ctx m pi pi m trx trx trx boolean local trx m trx null if local trx m trx trx get trx create trx name svr process true process if local trx m trx commit m trx close m trx null return m pi is error processcall startprocess processinfo startprocess processinfo m_ctx getctx m_pi m_trx localtrx m_trx localtrx m_trx createtrxname svrprocess localtrx m_trx m_trx m_trx m_pi iserror process private void process string msg null boolean error false try lock prepare msg do it catch exception e msg e get message if msg null msg e to string if e get cause null log log level severe msg e get cause else if c log mgt is level fine log log level warning msg e else log warning msg error true throw new runtime exception e unlock parse variables msg msg parse translation m ctx msg m pi set summary msg error process info util save log todb m pi doit getmessage tostring getcause getcause clogmgt islevelfine runtimeexception parsetranslation m_ctx m_pi setsummary processinfoutil savelogtodb m_pi prepare e g get parameters code process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals a asset group id p a asset group id para i get parameter as int else if name equals guarantee date p guaranteedate timestamp para i get parameter else if name equals attach asset p attachasset y equals para i get parameter else log log level severe unknown parameter name code processinfoparameter getparameter getparametername getparameter a_asset_group_id p_a_asset_group_id getparameterasint guaranteedate p_guaranteedate getparameter attachasset p_attachasset getparameter perform process return message variables are parsed throws exception if not successful e g throw new compiere user error fill mandatory c bankaccount id compiereusererror fillmandatory c_bankaccount_id commit protected void commit if m trx null m trx commit m_trx m_trx rollback protected void rollback if m trx null m trx rollback m_trx m_trx lock object needs to be explicitly called unlock is automatic param po object return true if locked protected boolean lock object po po unlock existing if m locked m lockedobject null unlock object nothing to lock if po null return false m lockedobject po m locked m lockedobject lock return m locked lockobject m_locked m_lockedobject unlockobject m_lockedobject m_locked m_lockedobject m_locked is an object locked return true if object locked protected boolean is locked return m locked islocked m_locked unlock object is automatically called at the end of process return true if unlocked or if there was nothing to unlock protected boolean unlock object boolean success true if m locked m lockedobject null success m lockedobject unlock null m locked false m lockedobject null return success unlockobject m_locked m_lockedobject m_lockedobject m_locked m_lockedobject get process info return process info public process info get process info return m pi processinfo getprocessinfo m_pi get properties return properties public properties get ctx return m ctx getctx m_ctx get name title return name protected string get name return m pi get title getname m_pi gettitle get process instance return process instance protected int getad pinstance id return m pi getad pinstance id getad_pinstance_id m_pi getad_pinstance_id get table id return ad table id protected int gettable id return m pi gettable id table_id ad_table_id gettable_id m_pi gettable_id get record id return record id protected int getrecord id return m pi getrecord id record_id record_id getrecord_id m_pi getrecord_id get ad user id return ad user id of process owner protected int getad user id if m pi getad user id null m pi getad client id null string sql select ad user id ad client id from ad pinstance where ad pinstance id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 m pi getad pinstance id result set rs pstmt execute query if rs next m pi setad user id rs get int 1 m pi setad client id rs get int 2 rs close pstmt close catch sql exception e log log level severe sql e if m pi getad user id null return 0 return m pi getad user id int value ad_user_id ad_user_id getad_user_id m_pi getad_user_id m_pi getad_client_id ad_user_id ad_client_id ad_pinstance ad_pinstance_id preparedstatement preparestatement get_trxname setint m_pi getad_pinstance_id resultset executequery m_pi setad_user_id getint m_pi setad_client_id getint sqlexception m_pi getad_user_id m_pi getad_user_id intvalue get ad user id return ad user id of process owner protected int getad client id if m pi getad client id null getad user id sets also client if m pi getad client id null return 0 return m pi getad client id int value ad_user_id ad_user_id getad_client_id m_pi getad_client_id getad_user_id m_pi getad_client_id m_pi getad_client_id intvalue get parameter return parameter protected process info parameter get parameter process info parameter ret value m pi get parameter if ret value null process info util set parameter fromdb m pi ret value m pi get parameter return ret value processinfoparameter getparameter processinfoparameter retvalue m_pi getparameter retvalue processinfoutil setparameterfromdb m_pi retvalue m_pi getparameter retvalue add log entry param date date or null param id record id or 0 param number number or null param msg message or null public void add log int id timestamp date big decimal number string msg if m pi null m pi add log id date number msg log info id date number msg addlog bigdecimal m_pi m_pi addlog execute function param class name class param method name method param args arguments return result public object do it string class name string method name object args try class clazz class for name class name object object clazz new instance method methods clazz get methods for int i 0 i methods length i if methods i get name equals method name return methods i invoke object args catch exception ex log log level severe do it ex throw new runtime exception ex return null classname methodname doit classname methodname forname classname newinstance getmethods getname methodname doit runtimeexception lock process instance private void lock log fine ad pinstance id m pi getad pinstance id db execute update update ad pinstance set is processing y where ad pinstance id m pi getad pinstance id null outside trx ad_pinstance_id m_pi getad_pinstance_id executeupdate ad_pinstance isprocessing ad_pinstance_id m_pi getad_pinstance_id unlock process instance update process instance db and write option return message private void unlock mp instance mpi new mp instance get ctx m pi getad pinstance id null if mpi get id 0 log log level severe did not find p instance m pi getad pinstance id return mpi set is processing false mpi set result m pi is error mpi set error msg m pi get summary mpi save log fine mpi to string mpinstance mpinstance getctx m_pi getad_pinstance_id get_id pinstance m_pi getad_pinstance_id setisprocessing setresult m_pi iserror seterrormsg m_pi getsummary tostring return the main transaction of the current process return the transaction name protected string get trxname if m trx null return m trx get trx name return null get_trxname m_trx m_trx gettrxname standard constructor public x ad wf activityresult properties ctx int ad wf activityresult id string trx name super ctx ad wf activityresult id trx name if ad wf activityresult id 0 setad wf activityresult id 0 setad wf activity id 0 set attribute name null x_ad_wf_activityresult ad_wf_activityresult_id trxname ad_wf_activityresult_id trxname ad_wf_activityresult_id setad_wf_activityresult_id setad_wf_activity_id setattributename load constructor public x ad wf activityresult properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_activityresult resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf activityresult append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_activityresult get_id tostring set workflow activity result result of the workflow process activity public void setad wf activityresult id int ad wf activityresult id if ad wf activityresult id 1 throw new illegal argument exception ad wf activityresult id is mandatory set valuenocheck ad wf activityresult id new integer ad wf activityresult id setad_wf_activityresult_id ad_wf_activityresult_id ad_wf_activityresult_id illegalargumentexception ad_wf_activityresult_id set_valuenocheck ad_wf_activityresult_id ad_wf_activityresult_id get workflow activity result result of the workflow process activity public int getad wf activityresult id integer ii integer get value ad wf activityresult id if ii null return 0 return ii int value getad_wf_activityresult_id get_value ad_wf_activityresult_id intvalue set workflow activity workflow activity public void setad wf activity id int ad wf activity id if ad wf activity id 1 throw new illegal argument exception ad wf activity id is mandatory set valuenocheck ad wf activity id new integer ad wf activity id setad_wf_activity_id ad_wf_activity_id ad_wf_activity_id illegalargumentexception ad_wf_activity_id set_valuenocheck ad_wf_activity_id ad_wf_activity_id get workflow activity workflow activity public int getad wf activity id integer ii integer get value ad wf activity id if ii null return 0 return ii int value getad_wf_activity_id get_value ad_wf_activity_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf activity id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_activity_id set attribute name name of the attribute public void set attribute name string attribute name if attribute name null throw new illegal argument exception attribute name is mandatory if attribute name length 60 log warning length 60 truncated attribute name attribute name substring 0 59 set value attribute name attribute name setattributename attributename attributename illegalargumentexception attributename attributename attributename attributename set_value attributename attributename get attribute name name of the attribute public string get attribute name return string get value attribute name getattributename get_value attributename set attribute value value of the attribute public void set attribute value string attribute value if attribute value null attribute value length 2000 log warning length 2000 truncated attribute value attribute value substring 0 1999 set value attribute value attribute value setattributevalue attributevalue attributevalue attributevalue attributevalue attributevalue set_value attributevalue attributevalue get attribute value value of the attribute public string get attribute value return string get value attribute value getattributevalue get_value attributevalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value get contents return context public object get contents return contents getcontents constructor param ass accounting schemata param rs record parem trx name trx protected doc gljournal m acct schema ass result set rs string trx name super ass m journal class rs null trx name trxname doc_gljournal macctschema resultset trxname mjournal trxname load specific document details return error message or null protected string load document details m journal journal m journal getpo m postingtype journal get posting type m c acctschema id journal getc acctschema id contained objects p lines load lines journal log fine lines p lines length return null loaddocumentdetails mjournal mjournal m_postingtype getpostingtype m_c_acctschema_id getc_acctschema_id p_lines loadlines p_lines load invoice line return doc line array private doc line load lines m journal journal array list doc line list new array list doc line m journal line lines journal get lines false for int i 0 i lines length i m journal line line lines i doc line doc line new doc line line this source amounts doc line set amount line get amt source dr line get amt source cr converted amounts doc line set converted amt m c acctschema id line get amt acct dr line get amt acct cr account m account account line get account doc line set account account organization of line was set to org of account list add doc line return array int size list size doc line dls new doc line size list to array dls return dls docline docline loadlines mjournal arraylist docline arraylist docline mjournalline getlines mjournalline docline docline docline docline setamount getamtsourcedr getamtsourcecr docline setconvertedamt m_c_acctschema_id getamtacctdr getamtacctcr maccount getaccount docline setaccount docline docline docline toarray get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value env zero string buffer sb new string buffer lines for int i 0 i p lines length i ret value ret value add p lines i get amt source sb append append p lines i get amt source sb append log fine to string balance ret value sb to string return ret value bigdecimal getbalance bigdecimal retvalue stringbuffer stringbuffer p_lines retvalue retvalue p_lines getamtsource p_lines getamtsource tostring retvalue tostring retvalue create facts the accounting logic for glj only for the accounting scheme it was created pre account dr cr pre param as acct schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact other acct schema if as getc acctschema id m c acctschema id return facts create fact header fact fact new fact this as m postingtype glj if get document type equals doctype gljournal account dr cr for int i 0 i p lines length i if p lines i getc acctschema id as getc acctschema id fact line line fact create line p lines i p lines i get account getc currency id p lines i get amt source dr p lines i get amt source cr for all lines else p error document type unknown get document type log log level severe p error fact null facts add fact return facts arraylist createfacts macctschema arraylist arraylist getc_acctschema_id m_c_acctschema_id m_postingtype getdocumenttype doctype_gljournal p_lines p_lines getc_acctschema_id getc_acctschema_id factline createline p_lines p_lines getaccount getc_currency_id p_lines getamtsourcedr p_lines getamtsourcecr p_error documenttype getdocumenttype p_error standard constructor public x w store properties ctx int w store id string trx name super ctx w store id trx name if w store id 0 setc paymentterm id 0 set is default false set is menu assets true y set is menu contact true y set is menu interests true y set is menu invoices true y set is menu orders true y set is menu payments true y set is menu registrations true y set is menu requests true y set is menu rf qs true y set is menu shipments true y setm pricelist id 0 setm warehouse id 0 set name null setsalesrep id 0 seturl null setw store id 0 set web context null x_w_store w_store_id trxname w_store_id trxname w_store_id setc_paymentterm_id setisdefault setismenuassets setismenucontact setismenuinterests setismenuinvoices setismenuorders setismenupayments setismenuregistrations setismenurequests setismenurfqs setismenushipments setm_pricelist_id setm_warehouse_id setname setsalesrep_id setw_store_id setwebcontext load constructor public x w store properties ctx result set rs string trx name super ctx rs trx name x_w_store resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w store append get id append return sb to string tostring stringbuffer stringbuffer x_w_store get_id tostring set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set e mail footer footer added to e mails public void sete mail footer string e mail footer if e mail footer null e mail footer length 2000 log warning length 2000 truncated e mail footer e mail footer substring 0 1999 set value e mail footer e mail footer email emails setemailfooter emailfooter emailfooter emailfooter emailfooter emailfooter set_value emailfooter emailfooter get e mail footer footer added to e mails public string gete mail footer return string get value e mail footer email emails getemailfooter get_value emailfooter set e mail header header added to e mails public void sete mail header string e mail header if e mail header null e mail header length 2000 log warning length 2000 truncated e mail header e mail header substring 0 1999 set value e mail header e mail header email emails setemailheader emailheader emailheader emailheader emailheader emailheader set_value emailheader emailheader get e mail header header added to e mails public string gete mail header return string get value e mail header email emails getemailheader get_value emailheader set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set menu assets show menu assets public void set is menu assets boolean is menu assets set value is menu assets new boolean is menu assets setismenuassets ismenuassets set_value ismenuassets ismenuassets get menu assets show menu assets public boolean is menu assets object oo get value is menu assets if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenuassets get_value ismenuassets booleanvalue set menu contact show menu contact public void set is menu contact boolean is menu contact set value is menu contact new boolean is menu contact setismenucontact ismenucontact set_value ismenucontact ismenucontact get menu contact show menu contact public boolean is menu contact object oo get value is menu contact if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenucontact get_value ismenucontact booleanvalue set menu interests show menu interests public void set is menu interests boolean is menu interests set value is menu interests new boolean is menu interests setismenuinterests ismenuinterests set_value ismenuinterests ismenuinterests get menu interests show menu interests public boolean is menu interests object oo get value is menu interests if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenuinterests get_value ismenuinterests booleanvalue set menu invoices show menu invoices public void set is menu invoices boolean is menu invoices set value is menu invoices new boolean is menu invoices setismenuinvoices ismenuinvoices set_value ismenuinvoices ismenuinvoices get menu invoices show menu invoices public boolean is menu invoices object oo get value is menu invoices if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenuinvoices get_value ismenuinvoices booleanvalue set menu orders show menu orders public void set is menu orders boolean is menu orders set value is menu orders new boolean is menu orders setismenuorders ismenuorders set_value ismenuorders ismenuorders get menu orders show menu orders public boolean is menu orders object oo get value is menu orders if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenuorders get_value ismenuorders booleanvalue set menu payments show menu payments public void set is menu payments boolean is menu payments set value is menu payments new boolean is menu payments setismenupayments ismenupayments set_value ismenupayments ismenupayments get menu payments show menu payments public boolean is menu payments object oo get value is menu payments if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenupayments get_value ismenupayments booleanvalue set menu registrations show menu registrations public void set is menu registrations boolean is menu registrations set value is menu registrations new boolean is menu registrations setismenuregistrations ismenuregistrations set_value ismenuregistrations ismenuregistrations get menu registrations show menu registrations public boolean is menu registrations object oo get value is menu registrations if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenuregistrations get_value ismenuregistrations booleanvalue set menu requests show menu requests public void set is menu requests boolean is menu requests set value is menu requests new boolean is menu requests setismenurequests ismenurequests set_value ismenurequests ismenurequests get menu requests show menu requests public boolean is menu requests object oo get value is menu requests if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenurequests get_value ismenurequests booleanvalue set menu rf qs show menu rf qs public void set is menu rf qs boolean is menu rf qs set value is menu rf qs new boolean is menu rf qs rfqs rfqs setismenurfqs ismenurfqs set_value ismenurfqs ismenurfqs get menu rf qs show menu rf qs public boolean is menu rf qs object oo get value is menu rf qs if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false rfqs rfqs ismenurfqs get_value ismenurfqs booleanvalue set menu shipments show menu shipments public void set is menu shipments boolean is menu shipments set value is menu shipments new boolean is menu shipments setismenushipments ismenushipments set_value ismenushipments ismenushipments get menu shipments show menu shipments public boolean is menu shipments object oo get value is menu shipments if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismenushipments get_value ismenushipments booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set url full url address e g http www compiere org public void seturl string url if url null throw new illegal argument exception url is mandatory if url length 120 log warning length 120 truncated url url substring 0 119 set value url url illegalargumentexception set_value get url full url address e g http www compiere org public string geturl return string get value url get_value set web store e mail e mail address used as the sender from public void setw storee mail string w storee mail if w storee mail null w storee mail length 60 log warning length 60 truncated w storee mail w storee mail substring 0 59 set value w storee mail w storee mail email email setwstoreemail wstoreemail wstoreemail wstoreemail wstoreemail wstoreemail set_value wstoreemail wstoreemail get web store e mail e mail address used as the sender from public string getw storee mail return string get value w storee mail email email getwstoreemail get_value wstoreemail set web store user user id of the web store e mail address public void setw store user string w store user if w store user null w store user length 60 log warning length 60 truncated w store user w store user substring 0 59 set value w store user w store user webstore email setwstoreuser wstoreuser wstoreuser wstoreuser wstoreuser wstoreuser set_value wstoreuser wstoreuser get web store user user id of the web store e mail address public string getw store user return string get value w store user webstore email getwstoreuser get_value wstoreuser set web store password password of the web store e mail address public void setw store userpw string w store userpw if w store userpw null w store userpw length 20 log warning length 20 truncated w store userpw w store userpw substring 0 19 set value w store userpw w store userpw webstore email setwstoreuserpw wstoreuserpw wstoreuserpw wstoreuserpw wstoreuserpw wstoreuserpw set_value wstoreuserpw wstoreuserpw get web store password password of the web store e mail address public string getw store userpw return string get value w store userpw webstore email getwstoreuserpw get_value wstoreuserpw set web store a web store of the client public void setw store id int w store id if w store id 1 throw new illegal argument exception w store id is mandatory set valuenocheck w store id new integer w store id setw_store_id w_store_id w_store_id illegalargumentexception w_store_id set_valuenocheck w_store_id w_store_id get web store a web store of the client public int getw store id integer ii integer get value w store id if ii null return 0 return ii int value getw_store_id get_value w_store_id intvalue set web context web server context e g wstore public void set web context string web context if web context null throw new illegal argument exception web context is mandatory if web context length 20 log warning length 20 truncated web context web context substring 0 19 set value web context web context setwebcontext webcontext webcontext illegalargumentexception webcontext webcontext webcontext webcontext set_value webcontext webcontext get web context web server context e g wstore public string get web context return string get value web context getwebcontext get_value webcontext set web store info web store header information public void set web info string web info if web info null web info length 2000 log warning length 2000 truncated web info web info substring 0 1999 set value web info web info setwebinfo webinfo webinfo webinfo webinfo webinfo set_value webinfo webinfo get web store info web store header information public string get web info return string get value web info getwebinfo get_value webinfo set web order e mail e mail address to receive notifications when web orders were processed public void set web ordere mail string web ordere mail if web ordere mail null web ordere mail length 60 log warning length 60 truncated web ordere mail web ordere mail substring 0 59 set value web ordere mail web ordere mail email email setweborderemail weborderemail weborderemail weborderemail weborderemail weborderemail set_value weborderemail weborderemail get web order e mail e mail address to receive notifications when web orders were processed public string get web ordere mail return string get value web ordere mail email email getweborderemail get_value weborderemail set web parameter 1 web site parameter 1 default header image public void set web param1 string web param1 if web param1 null web param1 length 2000 log warning length 2000 truncated web param1 web param1 substring 0 1999 set value web param1 web param1 setwebparam1 webparam1 webparam1 webparam1 webparam1 webparam1 set_value webparam1 webparam1 get web parameter 1 web site parameter 1 default header image public string get web param1 return string get value web param1 getwebparam1 get_value webparam1 set web parameter 2 web site parameter 2 default index page public void set web param2 string web param2 if web param2 null web param2 length 2000 log warning length 2000 truncated web param2 web param2 substring 0 1999 set value web param2 web param2 setwebparam2 webparam2 webparam2 webparam2 webparam2 webparam2 set_value webparam2 webparam2 get web parameter 2 web site parameter 2 default index page public string get web param2 return string get value web param2 getwebparam2 get_value webparam2 set web parameter 3 web site parameter 3 default left menu public void set web param3 string web param3 if web param3 null web param3 length 2000 log warning length 2000 truncated web param3 web param3 substring 0 1999 set value web param3 web param3 setwebparam3 webparam3 webparam3 webparam3 webparam3 webparam3 set_value webparam3 webparam3 get web parameter 3 web site parameter 3 default left menu public string get web param3 return string get value web param3 getwebparam3 get_value webparam3 set web parameter 4 web site parameter 4 default footer left public void set web param4 string web param4 if web param4 null web param4 length 2000 log warning length 2000 truncated web param4 web param4 substring 0 1999 set value web param4 web param4 setwebparam4 webparam4 webparam4 webparam4 webparam4 webparam4 set_value webparam4 webparam4 get web parameter 4 web site parameter 4 default footer left public string get web param4 return string get value web param4 getwebparam4 get_value webparam4 set web parameter 5 web site parameter 5 default footer center public void set web param5 string web param5 if web param5 null web param5 length 2000 log warning length 2000 truncated web param5 web param5 substring 0 1999 set value web param5 web param5 setwebparam5 webparam5 webparam5 webparam5 webparam5 webparam5 set_value webparam5 webparam5 get web parameter 5 web site parameter 5 default footer center public string get web param5 return string get value web param5 getwebparam5 get_value webparam5 set web parameter 6 web site parameter 6 default footer right public void set web param6 string web param6 if web param6 null web param6 length 2000 log warning length 2000 truncated web param6 web param6 substring 0 1999 set value web param6 web param6 setwebparam6 webparam6 webparam6 webparam6 webparam6 webparam6 set_value webparam6 webparam6 get web parameter 6 web site parameter 6 default footer right public string get web param6 return string get value web param6 getwebparam6 get_value webparam6 base test public static void test system out println before init non nls 1 get memory used properties ctx login init test false log print properties system get properties system false system gc cleanup init system out println before creation long start get memory used table 100 shipper 142 window 102 reference 101 int ad window id 102 long start time system current time millis m windowvo vo m windowvo create env get ctx 1 ad window id m window w new m window vo long end def system current time millis system out println load definition time in ms string value of end def start time if 1 2 optional step w load compete long end def complete system current time millis system out println load definition complete time in ms string value of end def complete start time w query long end data system current time millis system out println load data time in ms string value of end data start time w load compete long end data complete system current time millis system out println load data complete time in ms string value of end data complete start time w get tab 0 navigate 0 sleep system out println before dispose get memory used w dispose sleep system out println before gc get memory used w null system gc system out println after gc get memory used system gc system out println final long complete system current time millis system out println complete time in ms string value of complete start time long end get memory used system out println memory increase in kb end start string value of end start 1024 list threads system out println api test system out println 64 72 m conversion rate convert ctx new big decimal 100 0 116 100 0 0 system out println 0 647169 m conversion rate get rate 116 100 null 0 0 0 system out println 12 5 muom conversion convert 101 102 new big decimal 100 0 true getmemoryused inittest printproperties getproperties getmemoryused ad_window_id starttime currenttimemillis mwindowvo mwindowvo getctx ad_window_id mwindow mwindow enddef currenttimemillis valueof enddef starttime loadcompete enddefcomplete currenttimemillis valueof enddefcomplete starttime enddata currenttimemillis valueof enddata starttime loadcompete enddatacomplete currenttimemillis valueof enddatacomplete starttime gettab getmemoryused getmemoryused getmemoryused currenttimemillis valueof starttime getmemoryused valueof listthreads mconversionrate bigdecimal mconversionrate getrate muomconversion bigdecimal get used memory in bytes private static long get memory used long free runtime get runtime free memory long total runtime get runtime total memory long used total free system out println memory used in kb total string value of total 1024 free string value of free 1024 string value of used 1024 system out println active threads thread active count return used getmemoryused getruntime freememory getruntime totalmemory valueof valueof valueof activecount sleep for a second private static void sleep system out println sleeping ini thread active count thread yield try thread sleep 1000 catch interrupted exception ie system out println sleeping end thread active count activecount interruptedexception activecount list threads private static void list threads thread list new thread thread active count int no thread current thread enumerate list for int i 0 i list length i if list i null system out println thread i list i to string listthreads activecount currentthread tostring start public static void main string args base test env exit env 0 exitenv consatructor public a login test dialog frame string host string db name string port string uid string pwd super frame connect test host true m host host m dbname db name m port port m uid uid m pwd pwd try jb init pack catch exception ex inform internal error ex get message start tests try m worker new thread this m worker start catch exception e1 inform internal error e1 a env show center screen this alogintest dbname m_host m_dbname dbname m_port m_uid m_pwd jbinit getmessage m_worker m_worker aenv showcenterscreen static layout void jb init throws exception set default close operation j dialog dispose on close main panel set layout main layout bok set text exit bok add action listener this info set background compiereplaf getfieldbackground inactive south panel set layout south layout south layout set alignment flow layout right info pane set preferred size new dimension 400 400 get content pane add main panel main panel add south panel border layout south south panel add bok null main panel add info pane border layout center info pane get viewport add info null jbinit setdefaultcloseoperation jdialog dispose_on_close mainpanel setlayout mainlayout settext addactionlistener setbackground getfieldbackground_inactive southpanel setlayout southlayout southlayout setalignment flowlayout infopane setpreferredsize getcontentpane mainpanel mainpanel southpanel borderlayout southpanel mainpanel infopane borderlayout infopane getviewport inform private void inform string text system out println text info append text info append n info set caret position info get text length setcaretposition gettext action listener public void action performed action event e if e get source bok while m worker null m worker is alive m worker interrupt dispose actionperformed actionevent getsource m_worker m_worker isalive m_worker run individual tests public void run string vm name system get property java vm name string vm version system get property java vm version inform using java vm name vm version inform boolean found false boolean foundjdbc false inform testing connection to server m host if m host null m host length 0 inform error invalid host name return string host m host inform trying echo port 7 found test host port host 7 inform trying ftp port 21 if test host port host 21 found found true inform trying http port 80 if test host port host 80 found found true inform trying kerberos port 88 if test host port host 88 found found true inform trying net bios session port 139 if test host port host 139 found found true inform trying rmi port 1099 if test host port host 1099 found found true inform trying oracle connection manager port 1630 if test host port host 1630 found found true inform trying oracle jdbc tcp port 1521 foundjdbc test host port host 1521 int jdbc port 0 try jdbc port integer parse int m port catch exception e inform error cannot parse port m port inform e get message return if jdbc port 1521 inform trying oracle jdbc tcp port jdbc port if test host port host jdbc port foundjdbc foundjdbc true test interrupt if m worker null m worker is interrupted return info if found foundjdbc inform server found host inform else if found foundjdbc inform server found host jdbc only inform else if found foundjdbc inform error server found host but no jdbc inform make sure that the oracle listener process is active return else inform error server not found host inform end test make sure that you can ping the server return inform connect to db m dbname inform connect with entered parameters if testjdbc host jdbc port m dbname m uid m pwd if m worker null m worker is interrupted return if jdbc port 1521 inform connect with standard jdbc port 1521 if testjdbc host 1521 m dbname m uid m pwd inform please set port to 1521 return if m worker null m worker is interrupted return inform connect with user system manager if testjdbc host 1521 m dbname system manager inform please check compiere user id and password inform and please change system password return inform compiere database found host jdbc port m dbname if m worker null m worker is interrupted return inform inform testing available application users test compiere users host jdbc port inform inform test complete vmname getproperty vmversion getproperty vmname vmversion m_host m_host m_host m_host testhostport testhostport testhostport testhostport netbios testhostport testhostport testhostport testhostport jdbcport jdbcport parseint m_port m_port getmessage jdbcport jdbcport testhostport jdbcport m_worker m_worker isinterrupted m_dbname jdbcport m_dbname m_uid m_pwd m_worker m_worker isinterrupted jdbcport m_dbname m_uid m_pwd m_worker m_worker isinterrupted m_dbname jdbcport m_dbname m_worker m_worker isinterrupted testcompiereusers jdbcport test host port private boolean test host port string host int port socket ping socket null try resolve address inet address server inet address get by name host establish socket ping socket new socket server port catch unknown host exception e inform unknown host e catch io exception io inform io exception io if ping socket null try ping socket close catch io exception e inform io close exception e inform success return true else return false testhostport pingsocket inetaddress inetaddress getbyname pingsocket unknownhostexception ioexception pingsocket pingsocket ioexception test jdbc private boolean testjdbc string host int port string sid string uid string pwd try inform registering driver oracle jdbc driver oracle driver driver manager register driver new oracle jdbc driver oracle driver inform driver registered driver manager set login timeout 5 driver manager set log writer new print writer system out inform driver initialized catch sql exception e inform error e get message return false boolean ok false string urlc jdbc oracle thin host port sid try inform trying client connection url urlc user uid connection con driver manager get connection urlc uid pwd inform connected database meta data conmd con get meta data inform driver name t conmd get driver name inform driver version t conmd get driver version inform db name t conmd get database product name inform db version t conmd get database product version con close inform success ok true catch sql exception e inform error e get message string urls jdbc oracle oci8 try inform trying server connection url urls user uid connection con driver manager get connection urls uid pwd inform connected database meta data conmd con get meta data inform driver name t conmd get driver name inform driver version t conmd get driver version inform db name t conmd get database product name inform db version t conmd get database product version con close inform success catch sql exception e inform error e get message return ok oracledriver drivermanager registerdriver oracledriver drivermanager setlogintimeout drivermanager setlogwriter printwriter sqlexception getmessage drivermanager getconnection databasemetadata getmetadata getdrivername getdriverversion getdatabaseproductname getdatabaseproductversion sqlexception getmessage drivermanager getconnection databasemetadata getmetadata getdrivername getdriverversion getdatabaseproductname getdatabaseproductversion sqlexception getmessage test compiere users private void test compiere users string host int port string sql select name password from ad user where is active y string urlc jdbc oracle thin host port m dbname try inform client connection url urlc user m uid connection con driver manager get connection urlc m uid m pwd inform connected statement stmt con create statement inform statement created result set rs stmt execute query sql inform query executed listing active application users while rs next string user rs get string 1 string password rs get string 2 string answer user user if user equals system user equals super user password equals system answer with standard password should be changed inform answer rs close inform query closed stmt close inform statement closed con close inform connection closed catch sql exception e inform error e get message testcompiereusers ad_user isactive m_dbname m_uid drivermanager getconnection m_uid m_pwd createstatement resultset executequery getstring getstring superuser sqlexception getmessage standard constructor public x c bpartner product properties ctx int c bpartner product id string trx name super ctx c bpartner product id trx name if c bpartner product id 0 setc bpartner id 0 setm product id 0 set shelf life min days 0 set shelf life min pct 0 x_c_bpartner_product c_bpartner_product_id trxname c_bpartner_product_id trxname c_bpartner_product_id setc_bpartner_id setm_product_id setshelflifemindays setshelflifeminpct load constructor public x c bpartner product properties ctx result set rs string trx name super ctx rs trx name x_c_bpartner_product resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bpartner product append get id append return sb to string tostring stringbuffer stringbuffer x_c_bpartner_product get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set manufacturer manufacturer of the product public void set manufacturer string manufacturer if manufacturer null manufacturer length 30 log warning length 30 truncated manufacturer manufacturer substring 0 29 set value manufacturer manufacturer setmanufacturer set_value get manufacturer manufacturer of the product public string get manufacturer return string get value manufacturer getmanufacturer get_value set quality rating method for rating vendors public void set quality rating big decimal quality rating set value quality rating quality rating setqualityrating bigdecimal qualityrating set_value qualityrating qualityrating get quality rating method for rating vendors public big decimal get quality rating big decimal bd big decimal get value quality rating if bd null return env zero return bd bigdecimal getqualityrating bigdecimal bigdecimal get_value qualityrating set min shelf life days minimum shelf life in days based on product instance guarantee date public void set shelf life min days int shelf life min days set value shelf life min days new integer shelf life min days setshelflifemindays shelflifemindays set_value shelflifemindays shelflifemindays get min shelf life days minimum shelf life in days based on product instance guarantee date public int get shelf life min days integer ii integer get value shelf life min days if ii null return 0 return ii int value getshelflifemindays get_value shelflifemindays intvalue set min shelf life minimum shelf life in percent based on product instance guarantee date public void set shelf life min pct int shelf life min pct set value shelf life min pct new integer shelf life min pct setshelflifeminpct shelflifeminpct set_value shelflifeminpct shelflifeminpct get min shelf life minimum shelf life in percent based on product instance guarantee date public int get shelf life min pct integer ii integer get value shelf life min pct if ii null return 0 return ii int value getshelflifeminpct get_value shelflifeminpct intvalue set partner category product category of the business partner public void set vendor category string vendor category if vendor category null vendor category length 30 log warning length 30 truncated vendor category vendor category substring 0 29 set value vendor category vendor category setvendorcategory vendorcategory vendorcategory vendorcategory vendorcategory vendorcategory set_value vendorcategory vendorcategory get partner category product category of the business partner public string get vendor category return string get value vendor category getvendorcategory get_value vendorcategory set partner product key product key of the business partner public void set vendor product no string vendor product no if vendor product no null vendor product no length 30 log warning length 30 truncated vendor product no vendor product no substring 0 29 set value vendor product no vendor product no setvendorproductno vendorproductno vendorproductno vendorproductno vendorproductno vendorproductno set_value vendorproductno vendorproductno get partner product key product key of the business partner public string get vendor product no return string get value vendor product no getvendorproductno get_value vendorproductno return default print request attributes return print request attribute set public static print request attribute set get default print request attributes return s prats printrequestattributeset printrequestattributeset getdefaultprintrequestattributes s_prats get default application flavor return pageable public static doc flavor get default flavor return doc flavor service formatted pageable docflavor getdefaultflavor docflavor service_formatted get print services for standard flavor and pratt return print services public static print service get print services return print service lookup lookup print services get default flavor get default print request attributes printservice getprintservices printservicelookup lookupprintservices getdefaultflavor getdefaultprintrequestattributes get default print service return print service public static print service get default print service return print service lookup lookup default print service printservice printservice getdefaultprintservice printservicelookup lookupdefaultprintservice print async param printer name optional printer name param job name optional printer job name param pageable pageable param copies number of copies param with dialog if true shows printer dialog static public void print pageable pageable string printer name string job name int copies boolean with dialog if pageable null return string name adempiere if job name null name job name printer job job c printer get printer job printer name job set job name name job set pageable pageable attributes hash print request attribute set prats new hash print request attribute set prats add new copies copies set orientation if pageable get page format 0 get orientation page format portrait prats add orientation requested portrait else prats add orientation requested landscape prats add new job name name language get login language get locale prats add get job priority pageable get number of pages copies with dialog print job prats with dialog false printername jobname withdialog printername jobname withdialog adempiere_ jobname jobname printerjob cprinter getprinterjob printername setjobname setpageable hashprintrequestattributeset hashprintrequestattributeset getpageformat getorientation pageformat orientationrequested orientationrequested jobname getloginlanguage getlocale getjobpriority getnumberofpages withdialog withdialog print async param pageable pageable param prats print attribure set static public void print pageable pageable print request attribute set prats printer job job c printer get printer job job set pageable pageable print job prats true false printrequestattributeset printerjob cprinter getprinterjob setpageable print param job printer job param prats print attribure set param with dialog if true shows dialog param wait for it if false print async static public void print final printer job job final print request attribute set prats boolean with dialog boolean wait for it if job null return boolean printed true if with dialog printed job print dialog prats if printed if with dialog attribute atts prats to array for int i 0 i atts length i log fine atts i get name atts i if wait for it log fine wait job get print service try job print prats catch exception ex log log level severe wait ex else async create thread thread print thread new thread public void run log fine print job get print service try job print prats catch exception ex log log level severe print ex print thread start async printed withdialog waitforit printerjob printrequestattributeset withdialog waitforit withdialog printdialog withdialog toarray getname waitforit getprintservice printthread getprintservice printthread public void run log fine print job get print service try job print prats catch exception ex log log level severe print ex getprintservice get job priority based on pages printed the more pages the lower the priority param pages number of pages param copies number of copies param with dialog dialog gets lower priority than direct print return job priority static public job priority get job priority int pages int copies boolean with dialog set priority the more pages the lower the priority int priority copies pages if with dialog prefer direct print priority 2 priority 100 priority convert to 1 100 supported range if priority 10 priority 10 else if priority 100 priority 100 return new job priority priority withdialog jobpriority getjobpriority withdialog withdialog jobpriority dump printer job info param job printer job public static void dump printer job job string buffer sb new string buffer job get job name sb append append job get user name append service append job get print service get name append copies append job get copies page format pf job default page sb append default page append x append pf get imageablex append y append pf get imageabley append w append pf get imageable width append h append pf get imageable height system out println sb to string printerjob stringbuffer stringbuffer getjobname getusername getprintservice getname getcopies pageformat defaultpage defaultpage getimageablex getimageabley getimageablewidth getimageableheight tostring dump print service attribute set to system out param psas ps attribute set public static void dump print service attribute set psas system out println print service attribute set length psas size attribute ats psas to array for int i 0 i ats length i system out println ats i get name ats i ats i get category printserviceattributeset printserviceattributeset toarray getname getcategory dump print request service attribute set to system out param prats print request attribute set public static void dump print request attribute set prats system out println print request attribute set length prats size attribute ats prats to array for int i 0 i ats length i system out println ats i get name ats i ats i get category printrequestattributeset printrequestattributeset toarray getname getcategory dump stream print services param doc flavor flavor param output mime type mime public static void dump doc flavor doc flavor string output mime type system out println system out println doc flavor doc flavor output output mime type stream print service factory spsfactories stream print service factory lookup stream print service factories doc flavor output mime type for int i 0 i spsfactories length i system out println spsfactories i doc flavor dfs spsfactories i get supported doc flavors for int j 0 j dfs length j system out println dfs j docflavor outputmimetype docflavor docflavor outputmimetype docflavor docflavor outputmimetype streamprintservicefactory streamprintservicefactory lookupstreamprintservicefactories docflavor outputmimetype docflavor getsupporteddocflavors dump stream print services param doc flavor flavor public static void dump doc flavor doc flavor system out println system out println doc flavor doc flavor print request attribute set pras new hash print request attribute set print service pss print service lookup lookup print services doc flavor pras for int i 0 i pss length i print service ps pss i system out println ps system out println factory ps get serviceui factory serviceui factory uif pss i get serviceui factory if uif null system out println about j dialog about j dialog uif getui serviceui factory about uirole serviceui factory jdialog ui about set visible true system out println admin j dialog admin j dialog uif getui serviceui factory admin uirole serviceui factory jdialog ui admin set visible true system out println main j dialog main j dialog uif getui serviceui factory main uirole serviceui factory jdialog ui main set visible true system out println reserved j dialog res j dialog uif getui serviceui factory reserved uirole serviceui factory jdialog ui res set visible true doc flavor dfs pss i get supported doc flavors system out println supported doc flavors for int j 0 j dfs length j system out println dfs j attribute class att cat pss i get supported attribute categories system out println supported attribute categories for int j 0 j att cat length j system out println att cat j get name pss i get default attribute value class extends attribute att cat j docflavor docflavor docflavor docflavor docflavor printrequestattributeset hashprintrequestattributeset printservice printservicelookup lookupprintservices docflavor printservice getserviceuifactory serviceuifactory getserviceuifactory jdialog jdialog serviceuifactory about_uirole serviceuifactory jdialog_ui setvisible jdialog jdialog serviceuifactory admin_uirole serviceuifactory jdialog_ui setvisible jdialog jdialog serviceuifactory main_uirole serviceuifactory jdialog_ui setvisible jdialog jdialog serviceuifactory reserved_uirole serviceuifactory jdialog_ui setvisible docflavor getsupporteddocflavors attcat getsupportedattributecategories attcat attcat getname getdefaultattributevalue attcat test print services private static void testps print service ps get default print service serviceui factory factory ps get serviceui factory system out println factory if factory null system out println factory j panel p0 j panel factory getui serviceui factory about uirole serviceui factory jdialog ui p0 set visible true j panel p1 j panel factory getui serviceui factory admin uirole serviceui factory jdialog ui p1 set visible true j panel p2 j panel factory getui serviceui factory main uirole serviceui factory jdialog ui p2 set visible true system out println 1 printer job pj printer job get printer job print request attribute set pratts get default print request attributes page dialog page format pf pj page dialog pratts system out println pratts size pratts size attribute atts pratts to array for int i 0 i atts length i system out println atts i get name atts i atts i get category system out println page format h pf get height w pf get width x pf get imageablex y pf get imageabley ih pf get imageable height iw pf get imageable width orient pf get orientation ps pj get print service system out println print service ps get name print dialog system out println 2 pj print dialog pratts system out println pratts size pratts size atts pratts to array for int i 0 i atts length i system out println atts i get name atts i atts i get category pf pj default page system out println page format h pf get height w pf get width x pf get imageablex y pf get imageabley ih pf get imageable height iw pf get imageable width orient pf get orientation ps pj get print service system out println print service ps get name system out println 3 try pj set print service ps catch printer exception pe system out println pe pf pj validate page pf system out println page format h pf get height w pf get width x pf get imageablex y pf get imageabley ih pf get imageable height iw pf get imageable width orient pf get orientation ps pj get print service system out println print service ps get name system out println 4 pj print dialog printservice getdefaultprintservice serviceuifactory getserviceuifactory jpanel jpanel serviceuifactory about_uirole serviceuifactory jdialog_ui setvisible jpanel jpanel serviceuifactory admin_uirole serviceuifactory jdialog_ui setvisible jpanel jpanel serviceuifactory main_uirole serviceuifactory jdialog_ui setvisible printerjob printerjob getprinterjob printrequestattributeset getdefaultprintrequestattributes pageformat pagedialog toarray getname getcategory pageformat getheight getwidth getimageablex getimageabley getimageableheight getimageablewidth getorientation getprintservice printservice getname printdialog toarray getname getcategory defaultpage pageformat getheight getwidth getimageablex getimageabley getimageableheight getimageablewidth getorientation getprintservice printservice getname setprintservice printerexception validatepage pageformat getheight getwidth getimageablex getimageabley getimageableheight getimageablewidth getorientation getprintservice printservice getname printdialog test stream print services private static void testsps dump doc flavor input stream gif doc flavor byte array postscript get mime type dump doc flavor service formatted pageable doc flavor byte array postscript get mime type dump doc flavor input stream gif doc flavor byte array pdf get mime type dump doc flavor service formatted pageable doc flavor byte array gif get media subtype dump doc flavor service formatted pageable doc flavor byte array jpeg get media subtype dump doc flavor service formatted pageable lists devices able to output pageable dump doc flavor service formatted printable dump doc flavor input stream text plain host dump doc flavor input stream postscript print request attribute set pras new hash print request attribute set print service pss print service lookup lookup print services doc flavor service formatted pageable pras for int i 0 i pss length i print service ps pss i string name ps get name if name index of pdf 1 name index of acrobat 1 system out println system out println ps class cat ps get supported attribute categories for int j 0 j cat length j system out println cat j dump null doc flavor byte array pdf get mime type lists pdf output dump null doc flavor byte array postscript get media type lists ps output dump null null docflavor input_stream docflavor byte_array getmimetype docflavor service_formatted docflavor byte_array getmimetype docflavor input_stream docflavor byte_array getmimetype docflavor service_formatted docflavor byte_array getmediasubtype docflavor service_formatted docflavor byte_array getmediasubtype docflavor service_formatted docflavor service_formatted docflavor input_stream text_plain_host docflavor input_stream printrequestattributeset hashprintrequestattributeset printservice printservicelookup lookupprintservices docflavor service_formatted printservice getname indexof indexof getsupportedattributecategories docflavor byte_array getmimetype docflavor byte_array getmediatype create print form print formats for a new client order invoice etc called from v setup param ad client id new client public static void setup print form int ad client id log config ad client id ad client id properties ctx env get ctx c log mgt enable false order template int order printformat id m print format copy to client ctx 100 ad client id get id int orderline printformat id m print format copy to client ctx 101 ad client id get id update print format header order printformat id orderline printformat id invoice int invoice printformat id m print format copy to client ctx 102 ad client id get id int invoiceline printformat id m print format copy to client ctx 103 ad client id get id update print format header invoice printformat id invoiceline printformat id shipment int shipment printformat id m print format copy to client ctx 104 ad client id get id int shipmentline printformat id m print format copy to client ctx 105 ad client id get id update print format header shipment printformat id shipmentline printformat id check int check printformat id m print format copy to client ctx 106 ad client id get id int remittanceline printformat id m print format copy to client ctx 107 ad client id get id update print format header check printformat id remittanceline printformat id remittance int remittance printformat id m print format copy to client ctx 108 ad client id get id update print format header remittance printformat id remittanceline printformat id todo m print form m print form form new m print form int ad printform id db get nextid ad client id ad printform null string sql insert into ad printform ad client id ad org id is active created created by updated updated by ad printform id name order printformat id invoice printformat id remittance printformat id shipment printformat id values ad client id 0 y sys date 0 sys date 0 ad printform id msg translate ctx standard order printformat id invoice printformat id remittance printformat id shipment printformat id int no db execute update sql null if no 1 log log level severe print form not inserted c log mgt enable true vsetup ad_client_id setupprintform ad_client_id ad_client_id ad_client_id getctx clogmgt order_printformat_id mprintformat copytoclient ad_client_id get_id orderline_printformat_id mprintformat copytoclient ad_client_id get_id updateprintformatheader order_printformat_id orderline_printformat_id invoice_printformat_id mprintformat copytoclient ad_client_id get_id invoiceline_printformat_id mprintformat copytoclient ad_client_id get_id updateprintformatheader invoice_printformat_id invoiceline_printformat_id shipment_printformat_id mprintformat copytoclient ad_client_id get_id shipmentline_printformat_id mprintformat copytoclient ad_client_id get_id updateprintformatheader shipment_printformat_id shipmentline_printformat_id check_printformat_id mprintformat copytoclient ad_client_id get_id remittanceline_printformat_id mprintformat copytoclient ad_client_id get_id updateprintformatheader check_printformat_id remittanceline_printformat_id remittance_printformat_id mprintformat copytoclient ad_client_id get_id updateprintformatheader remittance_printformat_id remittanceline_printformat_id mprintform mprintform mprintform ad_printform_id getnextid ad_client_id ad_printform ad_printform ad_client_id ad_org_id isactive createdby updatedby ad_printform_id order_printformat_id invoice_printformat_id remittance_printformat_id shipment_printformat_id ad_client_id sysdate sysdate ad_printform_id order_printformat_id invoice_printformat_id remittance_printformat_id shipment_printformat_id executeupdate printform clogmgt update the print format header lines with reference to child print format param header id ad printformat id for header param line id ad printformat id for line static private void update print format header int header id int line id string buffer sb new string buffer sb append update ad printformatitem set ad printformatchild id append line id append where ad printformatchild id is not null and ad printformat id append header id int no db execute update sb to string null printformat header_id ad_printformat_id line_id ad_printformat_id updateprintformatheader header_id line_id stringbuffer stringbuffer ad_printformatitem ad_printformatchild_id line_id ad_printformatchild_id ad_printformat_id header_id executeupdate tostring test param args arg public static void main string args org compiere compiere startup client setup print form 11 setup print form 1000000 testps print services testsps stream print services dumpsps null null startupclient setupprintform setupprintform standard constructor public x m freight properties ctx int m freight id string trx name super ctx m freight id trx name if m freight id 0 setc currency id 0 set freight amt env zero setm freightcategory id 0 setm freight id 0 setm shipper id 0 set valid from new timestamp system current time millis x_m_freight m_freight_id trxname m_freight_id trxname m_freight_id setc_currency_id setfreightamt setm_freightcategory_id setm_freight_id setm_shipper_id setvalidfrom currenttimemillis load constructor public x m freight properties ctx result set rs string trx name super ctx rs trx name x_m_freight resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m freight append get id append return sb to string tostring stringbuffer stringbuffer x_m_freight get_id tostring set country country public void setc country id int c country id if c country id 0 set value c country id null else set value c country id new integer c country id setc_country_id c_country_id c_country_id set_value c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set freight amount freight amount public void set freight amt big decimal freight amt if freight amt null throw new illegal argument exception freight amt is mandatory set value freight amt freight amt setfreightamt bigdecimal freightamt freightamt illegalargumentexception freightamt set_value freightamt freightamt get freight amount freight amount public big decimal get freight amt big decimal bd big decimal get value freight amt if bd null return env zero return bd bigdecimal getfreightamt bigdecimal bigdecimal get_value freightamt set freight category category of the freight public void setm freightcategory id int m freightcategory id if m freightcategory id 1 throw new illegal argument exception m freightcategory id is mandatory set value m freightcategory id new integer m freightcategory id setm_freightcategory_id m_freightcategory_id m_freightcategory_id illegalargumentexception m_freightcategory_id set_value m_freightcategory_id m_freightcategory_id get freight category category of the freight public int getm freightcategory id integer ii integer get value m freightcategory id if ii null return 0 return ii int value getm_freightcategory_id get_value m_freightcategory_id intvalue set freight freight rate public void setm freight id int m freight id if m freight id 1 throw new illegal argument exception m freight id is mandatory set valuenocheck m freight id new integer m freight id setm_freight_id m_freight_id m_freight_id illegalargumentexception m_freight_id set_valuenocheck m_freight_id m_freight_id get freight freight rate public int getm freight id integer ii integer get value m freight id if ii null return 0 return ii int value getm_freight_id get_value m_freight_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 1 throw new illegal argument exception m shipper id is mandatory set valuenocheck m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id illegalargumentexception m_shipper_id set_valuenocheck m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm shipper id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_shipper_id public static final int to country id ad reference id 156 set to receiving country public void setto country id int to country id if to country id 0 set value to country id null else set value to country id new integer to country id to_country_id_ad_reference_id setto_country_id to_country_id to_country_id set_value to_country_id set_value to_country_id to_country_id get to receiving country public int getto country id integer ii integer get value to country id if ii null return 0 return ii int value getto_country_id get_value to_country_id intvalue public static final int to region id ad reference id 157 set to receiving region public void setto region id int to region id if to region id 0 set value to region id null else set value to region id new integer to region id to_region_id_ad_reference_id setto_region_id to_region_id to_region_id set_value to_region_id set_value to_region_id to_region_id get to receiving region public int getto region id integer ii integer get value to region id if ii null return 0 return ii int value getto_region_id get_value to_region_id intvalue set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom standard constructor public x ad find properties ctx int ad find id string trx name super ctx ad find id trx name if ad find id 0 setad column id 0 setad find id 0 set and or null a setfind id env zero set operation null set value null x_ad_find ad_find_id trxname ad_find_id trxname ad_find_id setad_column_id setad_find_id setandor setfind_id setoperation setvalue load constructor public x ad find properties ctx result set rs string trx name super ctx rs trx name x_ad_find resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad find append get id append return sb to string tostring stringbuffer stringbuffer x_ad_find get_id tostring public static final int ad column id ad reference id 251 set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id ad_column_id_ad_reference_id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set find public void setad find id int ad find id if ad find id 1 throw new illegal argument exception ad find id is mandatory set valuenocheck ad find id new integer ad find id setad_find_id ad_find_id ad_find_id illegalargumentexception ad_find_id set_valuenocheck ad_find_id ad_find_id get find public int getad find id integer ii integer get value ad find id if ii null return 0 return ii int value getad_find_id get_value ad_find_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad find id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_find_id public static final string andor or o set and or logical operation and or or public void set and or string and or if and or null throw new illegal argument exception and or is mandatory if and or equals a and or equals o else throw new illegal argument exception and or invalid value and or reference id 204 a o if and or length 1 log warning length 1 truncated and or and or substring 0 0 set value and or and or andor_or setandor andor andor illegalargumentexception andor andor andor illegalargumentexception andor andor reference_id andor andor andor set_value andor andor get and or logical operation and or or public string get and or return string get value and or getandor get_value andor set find id public void setfind id big decimal find id if find id null throw new illegal argument exception find id is mandatory set value find id find id find_id setfind_id bigdecimal find_id find_id illegalargumentexception find_id set_value find_id find_id get find id public big decimal getfind id big decimal bd big decimal get value find id if bd null return env zero return bd find_id bigdecimal getfind_id bigdecimal bigdecimal get_value find_id public static final string operation like set operation compare operation public void set operation string operation if operation null throw new illegal argument exception operation is mandatory if operation equals operation equals operation equals operation equals operation equals operation equals operation equals ab operation equals sq operation equals else throw new illegal argument exception operation invalid value operation reference id 205 ab sq if operation length 2 log warning length 2 truncated operation operation substring 0 1 set value operation operation operation_like setoperation illegalargumentexception illegalargumentexception reference_id set_value get operation compare operation public string get operation return string get value operation getoperation get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set value to value to public void set value2 string value2 if value2 null value2 length 40 log warning length 40 truncated value2 value2 substring 0 39 set value value2 value2 setvalue2 set_value get value to value to public string get value2 return string get value value2 getvalue2 get_value standard constructor public x w click properties ctx int w click id string trx name super ctx w click id trx name if w click id 0 set processed false setw click id 0 x_w_click w_click_id trxname w_click_id trxname w_click_id setprocessed setw_click_id load constructor public x w click properties ctx result set rs string trx name super ctx rs trx name x_w_click resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w click append get id append return sb to string tostring stringbuffer stringbuffer x_w_click get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set accept language language accepted based on browser information public void set accept language string accept language if accept language null accept language length 60 log warning length 60 truncated accept language accept language substring 0 59 set value accept language accept language setacceptlanguage acceptlanguage acceptlanguage acceptlanguage acceptlanguage acceptlanguage set_value acceptlanguage acceptlanguage get accept language language accepted based on browser information public string get accept language return string get value accept language getacceptlanguage get_value acceptlanguage set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set referrer referring web address public void set referrer string referrer if referrer null referrer length 120 log warning length 120 truncated referrer referrer substring 0 119 set value referrer referrer setreferrer set_value get referrer referring web address public string get referrer return string get value referrer getreferrer get_value set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set value remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_value remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr return string get value remote addr public key name pair get key name pair return new key name pair get id getremote addr get_value remote_addr keynamepair getkeynamepair keynamepair get_id getremote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set value remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_value remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set target url url for the target public void set targeturl string targeturl if targeturl null targeturl length 120 log warning length 120 truncated targeturl targeturl substring 0 119 set value targeturl targeturl settargeturl set_value get target url url for the target public string get targeturl return string get value targeturl gettargeturl get_value set user agent browser used public void set user agent string user agent if user agent null user agent length 255 log warning length 255 truncated user agent user agent substring 0 254 set value user agent user agent setuseragent useragent useragent useragent useragent useragent set_value useragent useragent get user agent browser used public string get user agent return string get value user agent getuseragent get_value useragent set click count web click management public void setw clickcount id int w clickcount id if w clickcount id 0 set valuenocheck w clickcount id null else set valuenocheck w clickcount id new integer w clickcount id setw_clickcount_id w_clickcount_id w_clickcount_id set_valuenocheck w_clickcount_id set_valuenocheck w_clickcount_id w_clickcount_id get click count web click management public int getw clickcount id integer ii integer get value w clickcount id if ii null return 0 return ii int value getw_clickcount_id get_value w_clickcount_id intvalue set web click individual web click public void setw click id int w click id if w click id 1 throw new illegal argument exception w click id is mandatory set valuenocheck w click id new integer w click id setw_click_id w_click_id w_click_id illegalargumentexception w_click_id set_valuenocheck w_click_id w_click_id get web click individual web click public int getw click id integer ii integer get value w click id if ii null return 0 return ii int value getw_click_id get_value w_click_id intvalue constructor param m tab tab param mandatory mandatory param is read only read only public v color m tab m tab boolean mandatory boolean is read only m mtab m tab set mandatory mandatory set read write is read only add action listener this mtab isreadonly vcolor mtab mtab isreadonly m_mtab mtab setmandatory setreadwrite isreadonly addactionlistener dispose public void dispose m mtab null m_mtab set mandatory param mandatory mandatory public void set mandatory boolean mandatory m mandatory mandatory setmandatory m_mandatory is mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set background nop param error error public void set background boolean error setbackground set value param value value public void set value object value log config value value m value value m cc get compiere color display it set text get display if m cc null set background color m cc else set opaque false put client property compiereplaf background null repaint setvalue m_value m_cc getcompierecolor settext getdisplay m_cc setbackgroundcolor m_cc setopaque putclientproperty get value return value public object get value return m value getvalue getvalue m_value get displayed value return string representation public string get display if m cc null return return getdisplay m_cc property change listener param evt event public void property change property change event evt log config v color property change evt if evt get property name equals org compiere model m field property set value evt get new value set background false propertychange propertychangeevent vcolor propertychange getpropertyname mfield setvalue getnewvalue setbackground set field window no for value preference param m field field public void set field m field m field m field set value no fire false fire every time windowno valuepreference mfield setfield mfield mfield mfield setvaluenofire load color from tab return true if loaded see org compiere model m color get compiere color private compiere color get compiere color integer ad color id integer m mtab get value ad color id log fine ad color id ad color id compiere color cc null color type string color type string m mtab get value color type if color type null log fine no color type return null if color type equals compiere color type flat cc new compiere color get color true true else if color type equals compiere color type gradient integer repeat distance integer m mtab get value repeat distance string start point string m mtab get value start point int repeat distance repeat distance null 0 repeat distance int value int start point start point null 0 integer parse int start point cc new compiere color get color true get color false start point repeat distance else if color type equals compiere color type lines big decimal line width big decimal m mtab get value line width big decimal line distance big decimal m mtab get value line distance int line width line width null 0 line width int value int line distance line distance null 0 line distance int value cc new compiere color get color false get color true line width line distance else if color type equals compiere color type texture integer ad image id integer m mtab get value ad image id string url geturl ad image id if url null return null big decimal image alpha big decimal m mtab get value image alpha float composite alpha image alpha null 0 7f image alpha float value cc new compiere color url get color true composite alpha else return null log fine compiere color cc return cc mcolor getcompierecolor compierecolor getcompierecolor ad_color_id m_mtab getvalue ad_color_id ad_color_id ad_color_id compierecolor colortype m_mtab getvalue colortype colortype colortype colortype compierecolor type_flat compierecolor getcolor colortype compierecolor type_gradient repeatdistance m_mtab getvalue repeatdistance startpoint m_mtab getvalue startpoint repeatdistance repeatdistance repeatdistance intvalue startpoint startpoint parseint startpoint compierecolor getcolor getcolor startpoint repeatdistance colortype compierecolor type_lines bigdecimal linewidth bigdecimal m_mtab getvalue linewidth bigdecimal linedistance bigdecimal m_mtab getvalue linedistance linewidth linewidth linewidth intvalue linedistance linedistance linedistance intvalue compierecolor getcolor getcolor linewidth linedistance colortype compierecolor type_texture ad_image_id m_mtab getvalue ad_image_id ad_image_id bigdecimal imagealpha bigdecimal m_mtab getvalue imagealpha compositealpha imagealpha imagealpha floatvalue compierecolor getcolor compositealpha compierecolor get color from tab param primary true if primary false if secondary return color private color get color boolean primary string add primary 1 is either bd or int integer red integer m mtab get value red add integer green integer m mtab get value green add integer blue integer m mtab get value blue add int red red null 0 red int value int green green null 0 green int value int blue blue null 0 blue int value return new color red green blue getcolor _1 m_mtab getvalue m_mtab getvalue m_mtab getvalue intvalue intvalue intvalue get url from image param ad image id image return url as string or null private string geturl integer ad image id if ad image id null ad image id int value 0 return null string ret value null string sql select imageurl from ad image where ad image id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad image id int value result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value ad_image_id ad_image_id ad_image_id ad_image_id intvalue retvalue ad_image ad_image_id preparedstatement preparestatement setint ad_image_id intvalue resultset executequery retvalue getstring sqlexception retvalue action listener open dialog param e event public void action performed action event e show dialog compiere color cc compiere color editor show dialog j frame env get parent this m cc if cc null log info v color action performed no color return set background color cc set button repaint update values m mtab set value color type cc get type if cc is flat set color cc get flat color true else if cc is gradient set color cc get gradient upper color true set color cc get gradient lower color false m mtab set value repeat distance new big decimal cc get gradient repeat distance m mtab set value start point string value of cc get gradient start point else if cc is line set color cc get line back color true set color cc get line color false m mtab get value line width m mtab get value line distance else if cc is texture set color cc get texture taint color true url url cc get textureurl m mtab set value ad image id m mtab set value image alpha new big decimal cc get texture composite alpha m cc cc actionperformed actionevent compierecolor compierecoloreditor showdialog jframe getparent m_cc vcolor actionperformed setbackgroundcolor m_mtab setvalue colortype gettype isflat setcolor getflatcolor isgradient setcolor getgradientuppercolor setcolor getgradientlowercolor m_mtab setvalue repeatdistance bigdecimal getgradientrepeatdistance m_mtab setvalue startpoint valueof getgradientstartpoint isline setcolor getlinebackcolor setcolor getlinecolor m_mtab getvalue linewidth m_mtab getvalue linedistance istexture setcolor gettexturetaintcolor gettextureurl m_mtab setvalue ad_image_id m_mtab setvalue imagealpha bigdecimal gettexturecompositealpha m_cc set color in tab param c color param primary true if primary false if secondary private void set color color c boolean primary string add primary 1 m mtab set value red add new big decimal c get red m mtab set value green add new big decimal c get green m mtab set value blue add new big decimal c get blue setcolor _1 m_mtab setvalue bigdecimal getred m_mtab setvalue bigdecimal getgreen m_mtab setvalue bigdecimal getblue standard constructor param ctx context param ad attachmentnote id id public m attachment note properties ctx int ad attachmentnote id string trx name super ctx ad attachmentnote id trx name if ad attachmentnote id 0 setad attachment id 0 setad user id 0 set text msg null set title null ad_attachmentnote_id mattachmentnote ad_attachmentnote_id trxname ad_attachmentnote_id trxname ad_attachmentnote_id setad_attachment_id setad_user_id settextmsg settitle load constructor param ctx context param rs result set public m attachment note properties ctx result set rs string trx name super ctx rs trx name mattachmentnote resultset trxname trxname parent constructor sets current user param attach attachment public m attachment note m attachment attach string title string text msg this attach get ctx 0 attach get trxname set client org attach setad attachment id attach getad attachment id setad user id env getad user id attach get ctx set title title set text msg text msg mattachmentnote mattachment textmsg getctx get_trxname setclientorg setad_attachment_id getad_attachment_id setad_user_id getad_user_id getctx settitle settextmsg textmsg compiere application applet throws java awt headless exception public a applet throws headless exception super headlessexception aapplet headlessexception init public void init super init text area ta new text area compiere get summary add ta textarea textarea getsummary start public void start super start show status compiere get summary splash splash splash get splash compiere startup true needs to be here for ui a menu menu new a menu showstatus getsummary getsplash amenu amenu stop public void stop super stop destroy public void destroy super destroy env exit env 0 exitenv standard constructor public x c bp group acct properties ctx int c bp group acct id string trx name super ctx c bp group acct id trx name if c bp group acct id 0 setc acctschema id 0 setc bp group id 0 setc prepayment acct 0 setc receivable acct 0 setc receivable services acct 0 setnotinvoicedreceipts acct 0 setnotinvoicedreceivables acct 0 setnotinvoicedrevenue acct 0 setpaydiscount exp acct 0 setpaydiscount rev acct 0 setunearnedrevenue acct 0 setv liability acct 0 setv liability services acct 0 setv prepayment acct 0 setwriteoff acct 0 x_c_bp_group_acct c_bp_group_acct_id trxname c_bp_group_acct_id trxname c_bp_group_acct_id setc_acctschema_id setc_bp_group_id setc_prepayment_acct setc_receivable_acct setc_receivable_services_acct setnotinvoicedreceipts_acct setnotinvoicedreceivables_acct setnotinvoicedrevenue_acct setpaydiscount_exp_acct setpaydiscount_rev_acct setunearnedrevenue_acct setv_liability_acct setv_liability_services_acct setv_prepayment_acct setwriteoff_acct load constructor public x c bp group acct properties ctx result set rs string trx name super ctx rs trx name x_c_bp_group_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp group acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_group_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 1 throw new illegal argument exception c bp group id is mandatory set valuenocheck c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id illegalargumentexception c_bp_group_id set_valuenocheck c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc bp group id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_bp_group_id set customer prepayment account for customer prepayments public void setc prepayment acct int c prepayment acct set value c prepayment acct new integer c prepayment acct setc_prepayment_acct c_prepayment_acct set_value c_prepayment_acct c_prepayment_acct get customer prepayment account for customer prepayments public int getc prepayment acct integer ii integer get value c prepayment acct if ii null return 0 return ii int value getc_prepayment_acct get_value c_prepayment_acct intvalue set customer receivables account for customer receivables public void setc receivable acct int c receivable acct set value c receivable acct new integer c receivable acct setc_receivable_acct c_receivable_acct set_value c_receivable_acct c_receivable_acct get customer receivables account for customer receivables public int getc receivable acct integer ii integer get value c receivable acct if ii null return 0 return ii int value getc_receivable_acct get_value c_receivable_acct intvalue set receivable services customer accounts receivables services account public void setc receivable services acct int c receivable services acct set value c receivable services acct new integer c receivable services acct setc_receivable_services_acct c_receivable_services_acct set_value c_receivable_services_acct c_receivable_services_acct get receivable services customer accounts receivables services account public int getc receivable services acct integer ii integer get value c receivable services acct if ii null return 0 return ii int value getc_receivable_services_acct get_value c_receivable_services_acct intvalue set not invoiced receipts account for not invoiced material receipts public void setnotinvoicedreceipts acct int notinvoicedreceipts acct set value notinvoicedreceipts acct new integer notinvoicedreceipts acct setnotinvoicedreceipts_acct notinvoicedreceipts_acct set_value notinvoicedreceipts_acct notinvoicedreceipts_acct get not invoiced receipts account for not invoiced material receipts public int getnotinvoicedreceipts acct integer ii integer get value notinvoicedreceipts acct if ii null return 0 return ii int value getnotinvoicedreceipts_acct get_value notinvoicedreceipts_acct intvalue set not invoiced receivables account for not invoiced receivables public void setnotinvoicedreceivables acct int notinvoicedreceivables acct set value notinvoicedreceivables acct new integer notinvoicedreceivables acct setnotinvoicedreceivables_acct notinvoicedreceivables_acct set_value notinvoicedreceivables_acct notinvoicedreceivables_acct get not invoiced receivables account for not invoiced receivables public int getnotinvoicedreceivables acct integer ii integer get value notinvoicedreceivables acct if ii null return 0 return ii int value getnotinvoicedreceivables_acct get_value notinvoicedreceivables_acct intvalue set not invoiced revenue account for not invoiced revenue public void setnotinvoicedrevenue acct int notinvoicedrevenue acct set value notinvoicedrevenue acct new integer notinvoicedrevenue acct setnotinvoicedrevenue_acct notinvoicedrevenue_acct set_value notinvoicedrevenue_acct notinvoicedrevenue_acct get not invoiced revenue account for not invoiced revenue public int getnotinvoicedrevenue acct integer ii integer get value notinvoicedrevenue acct if ii null return 0 return ii int value getnotinvoicedrevenue_acct get_value notinvoicedrevenue_acct intvalue set payment discount expense payment discount expense account public void setpaydiscount exp acct int paydiscount exp acct set value paydiscount exp acct new integer paydiscount exp acct setpaydiscount_exp_acct paydiscount_exp_acct set_value paydiscount_exp_acct paydiscount_exp_acct get payment discount expense payment discount expense account public int getpaydiscount exp acct integer ii integer get value paydiscount exp acct if ii null return 0 return ii int value getpaydiscount_exp_acct get_value paydiscount_exp_acct intvalue set payment discount revenue payment discount revenue account public void setpaydiscount rev acct int paydiscount rev acct set value paydiscount rev acct new integer paydiscount rev acct setpaydiscount_rev_acct paydiscount_rev_acct set_value paydiscount_rev_acct paydiscount_rev_acct get payment discount revenue payment discount revenue account public int getpaydiscount rev acct integer ii integer get value paydiscount rev acct if ii null return 0 return ii int value getpaydiscount_rev_acct get_value paydiscount_rev_acct intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set unearned revenue account for unearned revenue public void setunearnedrevenue acct int unearnedrevenue acct set value unearnedrevenue acct new integer unearnedrevenue acct setunearnedrevenue_acct unearnedrevenue_acct set_value unearnedrevenue_acct unearnedrevenue_acct get unearned revenue account for unearned revenue public int getunearnedrevenue acct integer ii integer get value unearnedrevenue acct if ii null return 0 return ii int value getunearnedrevenue_acct get_value unearnedrevenue_acct intvalue set vendor liability account for vendor liability public void setv liability acct int v liability acct set value v liability acct new integer v liability acct setv_liability_acct v_liability_acct set_value v_liability_acct v_liability_acct get vendor liability account for vendor liability public int getv liability acct integer ii integer get value v liability acct if ii null return 0 return ii int value getv_liability_acct get_value v_liability_acct intvalue set vendor service liability account for vender service liability public void setv liability services acct int v liability services acct set value v liability services acct new integer v liability services acct setv_liability_services_acct v_liability_services_acct set_value v_liability_services_acct v_liability_services_acct get vendor service liability account for vender service liability public int getv liability services acct integer ii integer get value v liability services acct if ii null return 0 return ii int value getv_liability_services_acct get_value v_liability_services_acct intvalue set vendor prepayment account for vendor prepayments public void setv prepayment acct int v prepayment acct set value v prepayment acct new integer v prepayment acct setv_prepayment_acct v_prepayment_acct set_value v_prepayment_acct v_prepayment_acct get vendor prepayment account for vendor prepayments public int getv prepayment acct integer ii integer get value v prepayment acct if ii null return 0 return ii int value getv_prepayment_acct get_value v_prepayment_acct intvalue set write off account for receivables write off public void setwriteoff acct int writeoff acct set value writeoff acct new integer writeoff acct setwriteoff_acct writeoff_acct set_value writeoff_acct writeoff_acct get write off account for receivables write off public int getwriteoff acct integer ii integer get value writeoff acct if ii null return 0 return ii int value getwriteoff_acct get_value writeoff_acct intvalue constructor public compiere look and feel super system set property awt visualbell true compierelookandfeel setproperty the name return name public string get name return name getname the id return name public string getid return name the description return description public string get description return compiere look feel c 2001 2005 jorg janke getdescription get create defaults return ui defaults public ui defaults get defaults system out println compiere look and feel get defaults theme already created set metal look and feel set current theme s theme ui defaults defaults super get defaults calls init defaults return defaults uidefaults getdefaults compierelookandfeel getdefaults metallookandfeel setcurrenttheme s_theme uidefaults getdefaults creates the mapping from ui class i ds to code componentui code classes putting the id code componentui code pairs in the passed in defaults table each code j component code class specifies its own ui class id string param table ui defaults protected void init class defaults ui defaults table system out println compiere look and feel init class defaults super init class defaults table overwrite put default table panelui put default table buttonui put default table toggle buttonui put default table tabbed paneui put default table table headerui put default table radio buttonui put default table check boxui put default table combo boxui put default table menuui put default table menu barui put default table menu itemui put default table check box menu itemui put default table tool barui put default table root paneui put default table viewportui put default table split paneui put default table scroll paneui put default table labelui put default table tool tipui put default table text areaui ids jcomponent initclassdefaults uidefaults compierelookandfeel initclassdefaults initclassdefaults putdefault putdefault putdefault togglebuttonui putdefault tabbedpaneui putdefault tableheaderui putdefault radiobuttonui putdefault checkboxui putdefault comboboxui putdefault putdefault menubarui putdefault menuitemui putdefault checkboxmenuitemui putdefault toolbarui putdefault rootpaneui putdefault putdefault splitpaneui putdefault scrollpaneui putdefault putdefault tooltipui putdefault textareaui put ui key class name pair in ui defaults param table param ui key private void put default ui defaults table string ui key try string class name org compiere plaf compiere ui key table put ui key class name catch exception ex ex print stack trace uikey classname uidefaults uikey putdefault uidefaults uikey classname uikey uikey classname printstacktrace for overwriting component defaults param table protected void init system color defaults ui defaults table system out println compiere look and feel init system color defaults super init system color defaults table we made the color a bit darker table put text highlight compiere utils get translucent color get text highlight color 128 initsystemcolordefaults uidefaults compierelookandfeel initsystemcolordefaults initsystemcolordefaults texthighlight compiereutils gettranslucentcolor gettexthighlightcolor for overwriting component defaults param table protected void init component defaults ui defaults table system out println compiere look and feel init component defaults super init component defaults table combo box defaults color c table get color text field background table put combo box background c table put combo box list background c initcomponentdefaults uidefaults compierelookandfeel initcomponentdefaults initcomponentdefaults combobox getcolor textfield combobox combobox listbackground create default thems protected void create default theme set current theme s theme createdefaulttheme setcurrenttheme s_theme set current theme param theme metal theme public static void set current theme metal theme theme if theme null s theme theme metal look and feel set current theme s theme setcurrenttheme metaltheme s_theme metallookandfeel setcurrenttheme s_theme get current theme return metal theme public static metal theme get current theme return s theme metaltheme getcurrenttheme s_theme get compiere theme return metal theme public static compiere theme get compiere theme return s compieretheme compieretheme getcompieretheme s_compieretheme error feedback p invoked when the user attempts an invalid operation such as pasting into an uneditable code j text field code that has focus p p if the user has enabled visual error indication on the desktop this method will flash the caption bar of the active window the user can also set the property awt visualbell true to achieve the same results p param component component the error occured in may be null indicating the error condition is not directly associated with a code component code public void provide error feedback component component super provide error feedback component jtextfield provideerrorfeedback provideerrorfeedback get user roles of role param ctx context param ad role id role return array of user roles public static m user roles get of role properties ctx int ad role id string sql select from ad user roles where ad role id array list m user roles list new array list m user roles prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad role id result set rs pstmt execute query while rs next list add new m user roles ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get of role e try if pstmt null pstmt close pstmt null catch exception e pstmt null m user roles ret value new m user roles list size list to array ret value return ret value ad_role_id muserroles getofrole ad_role_id ad_user_roles ad_role_id arraylist muserroles arraylist muserroles preparedstatement preparestatement setint ad_role_id resultset executequery muserroles s_log getofrole muserroles retvalue muserroles toarray retvalue retvalue get user roles of user param ctx context param ad user id role return array of user roles public static m user roles get of user properties ctx int ad user id string sql select from ad user roles where ad user id array list m user roles list new array list m user roles prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad user id result set rs pstmt execute query while rs next list add new m user roles ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get of user e try if pstmt null pstmt close pstmt null catch exception e pstmt null m user roles ret value new m user roles list size list to array ret value return ret value ad_user_id muserroles getofuser ad_user_id ad_user_roles ad_user_id arraylist muserroles arraylist muserroles preparedstatement preparestatement setint ad_user_id resultset executequery muserroles s_log getofuser muserroles retvalue muserroles toarray retvalue retvalue persistence constructor param ctx context param ignored invalid public m user roles properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 throw new illegal argument exception multi key muserroles trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m user roles properties ctx result set rs string trx name super ctx rs trx name muserroles resultset trxname trxname full constructor param ctx context param ad user id user param ad role id role public m user roles properties ctx int ad user id int ad role id string trx name this ctx 0 trx name setad user id ad user id setad role id ad role id ad_user_id ad_role_id muserroles ad_user_id ad_role_id trxname trxname setad_user_id ad_user_id setad_role_id ad_role_id compiere theme ice public compiere theme ice set default s theme this s name name compierethemeice setdefault s_theme s_name set defaults protected void set default blue 102 102 153 primary1 new colorui resource 210 226 239 blue 153 153 204 primary2 new colorui resource 233 240 248 blue 204 204 255 primary3 new colorui resource 167 198 227 gray 102 102 102 secondary1 new colorui resource 102 102 102 gray 153 153 153 secondary2 new colorui resource 153 153 153 blue gray 214 224 234 background secondary3 new colorui resource 210 226 239 black black new colorui resource color black white white new colorui resource color white background for mandatory fields mandatory new colorui resource 224 224 255 blue isch background for fields in error error new colorui resource 255 204 204 red isch background for inactive fields inactive new colorui resource 234 234 234 light gray background for info fields info new colorui resource 253 237 207 light yellow foreground text ok txt ok new colorui resource 51 51 102 dark blue foreground text error txt error new colorui resource 204 0 0 dark red control font control font null getcontroltextfont system font system font null getsystemtextfont user font user font null getusertextfont small font small font null getsubtextfont window title font window font null getwindowtitlefont menu font menu font null getmenutextfont setdefault coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource bluegray coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource txt_ok coloruiresource txt_error coloruiresource controlfont _getcontroltextfont systemfont _getsystemtextfont userfont _getusertextfont smallfont _getsubtextfont windowfont _getwindowtitlefont menufont _getmenutextfont basic constructor public blink basic constructor param element adds an element to the element public blink element element add element element addelement basic constructor param element adds an element to the element public blink string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public blink add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public blink add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public blink add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public blink add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public blink remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry standard constructor public x k category properties ctx int k category id string trx name super ctx k category id trx name if k category id 0 setk category id 0 set name null x_k_category k_category_id trxname k_category_id trxname k_category_id setk_category_id setname load constructor public x k category properties ctx result set rs string trx name super ctx rs trx name x_k_category resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k category append get id append return sb to string tostring stringbuffer stringbuffer x_k_category get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set knowledge category knowledge category public void setk category id int k category id if k category id 1 throw new illegal argument exception k category id is mandatory set valuenocheck k category id new integer k category id setk_category_id k_category_id k_category_id illegalargumentexception k_category_id set_valuenocheck k_category_id k_category_id get knowledge category knowledge category public int getk category id integer ii integer get value k category id if ii null return 0 return ii int value getk_category_id get_value k_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x ad treenode properties ctx int ad treenode id string trx name super ctx ad treenode id trx name if ad treenode id 0 setad tree id 0 setnode id 0 set seq no 0 x_ad_treenode ad_treenode_id trxname ad_treenode_id trxname ad_treenode_id setad_tree_id setnode_id setseqno load constructor public x ad treenode properties ctx result set rs string trx name super ctx rs trx name x_ad_treenode resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad treenode append get id append return sb to string tostring stringbuffer stringbuffer x_ad_treenode get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set node id public void setnode id int node id if node id 0 throw new illegal argument exception node id is mandatory set valuenocheck node id new integer node id node_id setnode_id node_id node_id illegalargumentexception node_id set_valuenocheck node_id node_id get node id public int getnode id integer ii integer get value node id if ii null return 0 return ii int value node_id getnode_id get_value node_id intvalue set parent parent of entity public void setparent id int parent id if parent id 0 set value parent id null else set value parent id new integer parent id setparent_id parent_id parent_id set_value parent_id set_value parent_id parent_id get parent parent of entity public int getparent id integer ii integer get value parent id if ii null return 0 return ii int value getparent_id get_value parent_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception m c projectphase id getrecord id log info do it c projectphase id m c projectphase id if m c projectphase id 0 throw new illegal argument exception c projectphase id 0 m project phase from phase new m project phase get ctx m c projectphase id get trxname m project from project project gen order get project get ctx from phase getc project id get trxname m order order new m order from project true m order docsubtypeso oncredit order set description order get description from phase get name if order save throw new exception could not create order create an order on phase level if from phase getm product id 0 m order line ol new m order line order ol set line from phase get seq no string buffer sb new string buffer from phase get name if from phase get description null from phase get description length 0 sb append append from phase get description ol set description sb to string ol setm product id from phase getm product id true ol set qty from phase get qty ol set price if from phase get price actual null from phase get price actual compare to env zero 0 ol set price from phase get price actual ol set tax if ol save log log level severe do it lines not generated return c order id order get document no 1 project tasks int count 0 m project task tasks from phase get tasks for int i 0 i tasks length i m order line ol new m order line order ol set line tasks i get seq no string buffer sb new string buffer tasks i get name if tasks i get description null tasks i get description length 0 sb append append tasks i get description ol set description sb to string ol setm product id tasks i getm product id true ol set qty tasks i get qty ol set price ol set tax if ol save count for all lines if tasks length count log log level severe do it lines difference project tasks tasks length saved count return c order id order get document no count doit m_c_projectphase_id getrecord_id doit c_projectphase_id m_c_projectphase_id m_c_projectphase_id illegalargumentexception c_projectphase_id mprojectphase fromphase mprojectphase getctx m_c_projectphase_id get_trxname mproject fromproject projectgenorder getproject getctx fromphase getc_project_id get_trxname morder morder fromproject morder docsubtypeso_oncredit setdescription getdescription fromphase getname fromphase getm_product_id morderline morderline setline fromphase getseqno stringbuffer stringbuffer fromphase getname fromphase getdescription fromphase getdescription fromphase getdescription setdescription tostring setm_product_id fromphase getm_product_id setqty fromphase getqty setprice fromphase getpriceactual fromphase getpriceactual compareto setprice fromphase getpriceactual settax doit c_order_id getdocumentno mprojecttask fromphase gettasks morderline morderline setline getseqno stringbuffer stringbuffer getname getdescription getdescription getdescription setdescription tostring setm_product_id getm_product_id setqty getqty setprice settax doit projecttasks c_order_id getdocumentno get mbp group from cache param ctx context param c bp group id id return mbp group public static mbp group get properties ctx int c bp group id integer key new integer c bp group id mbp group ret value mbp group s cache get key if ret value null return ret value ret value new mbp group ctx c bp group id null if ret value get id 0 s cache put key ret value return ret value mbpgroup c_bp_group_id mbpgroup mbpgroup c_bp_group_id c_bp_group_id mbpgroup retvalue mbpgroup s_cache retvalue retvalue retvalue mbpgroup c_bp_group_id retvalue get_id s_cache retvalue retvalue get mbp group from business partner param ctx context param c bpartner id business partner id return mbp group public static mbp group get ofb partner properties ctx int c bpartner id mbp group ret value null prepared statement pstmt null string sql select from c bp group g where exists select from c bpartner p where p c bpartner id and p c bp group id g c bp group id try pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query if rs next ret value new mbp group ctx rs null integer key new integer ret value getc bp group id if ret value get id 0 s cache put key ret value rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value mbpgroup c_bpartner_id mbpgroup mbpgroup getofbpartner c_bpartner_id mbpgroup retvalue preparedstatement c_bp_group c_bpartner c_bpartner_id c_bp_group_id c_bp_group_id preparestatement setint c_bpartner_id resultset executequery retvalue mbpgroup retvalue getc_bp_group_id retvalue get_id s_cache retvalue s_log retvalue standard constructor param ctx context param c bp group id id public mbp group properties ctx int c bp group id string trx name super ctx c bp group id trx name if c bp group id 0 set value null set name null set is confidential info false n set is default false set priority base prioritybase same c_bp_group_id mbpgroup c_bp_group_id trxname c_bp_group_id trxname c_bp_group_id setvalue setname setisconfidentialinfo setisdefault setprioritybase prioritybase_same load constructor param ctx context param rs result set public mbp group properties ctx result set rs string trx name super ctx rs trx name mbpgroup resultset trxname trxname get credit watch percent return 90 or defined percent public big decimal get credit watch percent big decimal bd super get credit watch percent if bd null return bd return new big decimal 90 bigdecimal getcreditwatchpercent bigdecimal getcreditwatchpercent bigdecimal get credit watch ratio return 0 90 or defined percent public big decimal get credit watch ratio big decimal bd super get credit watch percent if bd null return bd divide env onehundred 2 big decimal round half up return new big decimal 0 90 bigdecimal getcreditwatchratio bigdecimal getcreditwatchpercent bigdecimal round_half_up bigdecimal override protected boolean before save boolean new record todo auto generated method stub return true beforesave newrecord after save param new record new record param success success return success protected boolean after save boolean new record boolean success if new record success return insert accounting c bp group acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_bp_group_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c bp group acct beforedelete delete_accounting c_bp_group_acct constructor parse file does the processing public natural account map properties ctx string trx name super natural account map 100 m ctx ctx m trxname trx name naturalaccountmap trxname naturalaccountmap m_ctx m_trxname trxname read and parse file param file accounts file return error message or if ok public string parse file file file log config file get absolute path string line null try see file import buffered reader in new buffered reader new file reader file 10240 not safe see p108 network pgm string err msg read lines while line in read line null err msg length 0 err msg parse line line line in close error if err msg length 0 return err msg catch exception ioe string s ioe get localized message if s null s length 0 s ioe to string return parse error line line s return parsefile getabsolutepath fileimport bufferedreader bufferedreader filereader errmsg readline errmsg errmsg parseline errmsg errmsg getlocalizedmessage tostring create account entry for default accounts only param line line with info line format 9 fields 1 a account value 2 b account name 3 c description 4 d account type 5 e account sign 6 f document controlled 7 g summary account 8 h default account 9 i parent value ignored return error message or if ok suppress warnings unchecked public string parse line string line throws exception log config line fields with are enclosed in string buffer new line new string buffer string tokenizer st new string tokenizer line false new line append st next token first part while st has more elements string s st next token enclosed part new line append s replace remove with space if st has more tokens new line append st next token unenclosed add space at the end tokenizer does not count empty fields new line append parse line replace with tokenizer does not count empty fields string p line util replace new line to string p line util replace p line st new string tokenizer p line false all fields there if st count tokens 1 log log level severe ignored require as separator p line return if st count tokens 9 log log level severe ignored field number wrong st count tokens p line return fill variables string value null name null description null account type null account sign null is doc controlled null is summary null default account null for int i 0 i 8 st has more tokens i string s st next token trim ignore if is it header line if s starts with s ends with return if s null s if i 0 a value value s else if i 1 b name name s else if i 2 c description description s else if i 3 d type account type s length 0 string value of s char at 0 e else if i 4 e sign account sign s length 0 string value of s char at 0 n else if i 5 f doc controlled is doc controlled s length 0 string value of s char at 0 n else if i 6 g is summary is summary s length 0 string value of s char at 0 n else if i 7 h default account default account s ignore if value name are empty no error message if value null value length 0 name null name length 0 return default account may be blank if default account null default account length 0 default account string value of s keyno return no summary account if is summary null is summary length 0 is summary n if is summary equals n return validation if account type null account type length 0 account type e if account sign null account sign length 0 account sign n if is doc controlled null is doc controlled length 0 is doc controlled n log config value value acct type account type sign account sign doc doc controlled summary summary name description try try to find allows to use same natutal account for multiple default accounts m element value na m element value m valuemap get value if na null create account save later na new m element value m ctx value name description account type account sign is doc controlled to upper case starts with y is summary to upper case starts with y m trxname m valuemap put value na add to cache put k default account to upper case v na catch exception e return e get message return default_account suppresswarnings parseline stringbuffer newline stringbuffer stringtokenizer stringtokenizer newline nexttoken hasmoreelements nexttoken newline hasmoretokens newline nexttoken newline pline newline tostring pline pline stringtokenizer pline counttokens pline counttokens fieldnumber counttokens pline accounttype accountsign isdoccontrolled issummary default_account hasmoretokens nexttoken startswith endswith accounttype valueof charat accountsign valueof charat doccontrolled isdoccontrolled valueof charat issummary issummary valueof charat default_account default_account default_account default_account default_account valueof s_keyno issummary issummary issummary issummary accounttype accounttype accounttype accountsign accountsign accountsign isdoccontrolled isdoccontrolled isdoccontrolled accttype accounttype accountsign doccontrolled melementvalue melementvalue m_valuemap melementvalue m_ctx accounttype accountsign isdoccontrolled touppercase startswith issummary touppercase startswith m_trxname m_valuemap default_account touppercase getmessage save all accounts param ad client id client param ad org id org param c element id element return true if created public boolean save accounts int ad client id int ad org id int c element id log config iterator iterator this values iterator while iterator has next m element value na m element value iterator next na setad client id ad client id na setad org id ad org id na setc element id c element id if na save return false return true ad_client_id ad_org_id c_element_id saveaccounts ad_client_id ad_org_id c_element_id hasnext melementvalue melementvalue setad_client_id ad_client_id setad_org_id ad_org_id setc_element_id c_element_id get element value param key key return 0 if error public int getc elementvalue id string key m element value na m element value this get key if na null return 0 return na getc elementvalue id elementvalue getc_elementvalue_id melementvalue melementvalue getc_elementvalue_id prepare protected void prepare process return message throws exception protected string do it throws exception log info do it gl distribution id getrecord id m distribution distribution new m distribution get ctx getrecord id get trxname if distribution get id 0 throw new compiere user error not found gl distribution id getrecord id string error distribution validate boolean saved distribution save if error null throw new compiere user error error if saved throw new compiere system error not saved return ok doit doit gl_distribution_id getrecord_id mdistribution mdistribution getctx getrecord_id get_trxname get_id compiereusererror gl_distribution_id getrecord_id compiereusererror compieresystemerror notsaved get contents return context public object get contents return contents getcontents initialize logging param is client client protected static void initialize boolean is client if is client log manager reset configuration logger root logger log manager get root logger root logger set level s currentlevellog4j isclient isclient isclient logmanager resetconfiguration rootlogger logmanager getrootlogger rootlogger setlevel s_currentlevellog4j enable disable log4j logging param enable logging false assumed public static void enable boolean enable logging logger root logger log manager get root logger if enable logging root logger set level s currentlevellog4j else level level root logger get level root logger set level level off s currentlevellog4j level enablelogging enablelogging rootlogger logmanager getrootlogger enablelogging rootlogger setlevel s_currentlevellog4j rootlogger getlevel rootlogger setlevel s_currentlevellog4j standard constructor public x c paymentterm properties ctx int c paymentterm id string trx name super ctx c paymentterm id trx name if c paymentterm id 0 set after delivery false setc paymentterm id 0 set discount env zero set discount2 env zero set discount days 0 set discount days2 0 set grace days 0 set is due fixed false set is valid false set name null set net days 0 set value null x_c_paymentterm c_paymentterm_id trxname c_paymentterm_id trxname c_paymentterm_id setafterdelivery setc_paymentterm_id setdiscount setdiscount2 setdiscountdays setdiscountdays2 setgracedays setisduefixed setisvalid setname setnetdays setvalue load constructor public x c paymentterm properties ctx result set rs string trx name super ctx rs trx name x_c_paymentterm resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c paymentterm append get id append return sb to string tostring stringbuffer stringbuffer x_c_paymentterm get_id tostring set after delivery due after delivery rather than after invoicing public void set after delivery boolean after delivery set value after delivery new boolean after delivery setafterdelivery afterdelivery set_value afterdelivery afterdelivery get after delivery due after delivery rather than after invoicing public boolean is after delivery object oo get value after delivery if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isafterdelivery get_value afterdelivery booleanvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set valuenocheck c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_valuenocheck c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set discount discount in percent public void set discount big decimal discount if discount null throw new illegal argument exception discount is mandatory set value discount discount setdiscount bigdecimal illegalargumentexception set_value get discount discount in percent public big decimal get discount big decimal bd big decimal get value discount if bd null return env zero return bd bigdecimal getdiscount bigdecimal bigdecimal get_value set discount 2 discount in percent public void set discount2 big decimal discount2 if discount2 null throw new illegal argument exception discount2 is mandatory set value discount2 discount2 setdiscount2 bigdecimal illegalargumentexception set_value get discount 2 discount in percent public big decimal get discount2 big decimal bd big decimal get value discount2 if bd null return env zero return bd bigdecimal getdiscount2 bigdecimal bigdecimal get_value set discount days number of days from invoice date to be eligible for discount public void set discount days int discount days set value discount days new integer discount days setdiscountdays discountdays set_value discountdays discountdays get discount days number of days from invoice date to be eligible for discount public int get discount days integer ii integer get value discount days if ii null return 0 return ii int value getdiscountdays get_value discountdays intvalue set discount days 2 number of days from invoice date to be eligible for discount public void set discount days2 int discount days2 set value discount days2 new integer discount days2 setdiscountdays2 discountdays2 set_value discountdays2 discountdays2 get discount days 2 number of days from invoice date to be eligible for discount public int get discount days2 integer ii integer get value discount days2 if ii null return 0 return ii int value getdiscountdays2 get_value discountdays2 intvalue set document note additional information for a document public void set document note string document note if document note null document note length 2000 log warning length 2000 truncated document note document note substring 0 1999 set value document note document note setdocumentnote documentnote documentnote documentnote documentnote documentnote set_value documentnote documentnote get document note additional information for a document public string get document note return string get value document note getdocumentnote get_value documentnote set fix month cutoff last day to include for next due date public void set fix month cutoff int fix month cutoff set value fix month cutoff new integer fix month cutoff setfixmonthcutoff fixmonthcutoff set_value fixmonthcutoff fixmonthcutoff get fix month cutoff last day to include for next due date public int get fix month cutoff integer ii integer get value fix month cutoff if ii null return 0 return ii int value getfixmonthcutoff get_value fixmonthcutoff intvalue set fix month day day of the month of the due date public void set fix month day int fix month day set value fix month day new integer fix month day setfixmonthday fixmonthday set_value fixmonthday fixmonthday get fix month day day of the month of the due date public int get fix month day integer ii integer get value fix month day if ii null return 0 return ii int value getfixmonthday get_value fixmonthday intvalue set fix month offset number of months 0 same 1 following public void set fix month offset int fix month offset set value fix month offset new integer fix month offset setfixmonthoffset fixmonthoffset set_value fixmonthoffset fixmonthoffset get fix month offset number of months 0 same 1 following public int get fix month offset integer ii integer get value fix month offset if ii null return 0 return ii int value getfixmonthoffset get_value fixmonthoffset intvalue set grace days days after due date to send first dunning letter public void set grace days int grace days set value grace days new integer grace days setgracedays gracedays set_value gracedays gracedays get grace days days after due date to send first dunning letter public int get grace days integer ii integer get value grace days if ii null return 0 return ii int value getgracedays get_value gracedays intvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set fixed due date payment is due on a fixed date public void set is due fixed boolean is due fixed set value is due fixed new boolean is due fixed setisduefixed isduefixed set_value isduefixed isduefixed get fixed due date payment is due on a fixed date public boolean is due fixed object oo get value is due fixed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isduefixed get_value isduefixed booleanvalue set next business day payment due on the next business day public void set is next business day boolean is next business day set value is next business day new boolean is next business day setisnextbusinessday isnextbusinessday set_value isnextbusinessday isnextbusinessday get next business day payment due on the next business day public boolean is next business day object oo get value is next business day if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isnextbusinessday get_value isnextbusinessday booleanvalue set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string netday sunday 7 set net day day when payment is due net public void set net day string net day if net day null throw new illegal argument exception net day is mandatory if net day null net day equals 1 net day equals 2 net day equals 3 net day equals 4 net day equals 5 net day equals 6 net day equals 7 else throw new illegal argument exception net day invalid value net day reference id 167 1 2 3 4 5 6 7 if net day null net day length 1 log warning length 1 truncated net day net day substring 0 0 set value net day net day netday_sunday setnetday netday netday illegalargumentexception netday netday netday netday netday netday netday netday netday illegalargumentexception netday netday reference_id netday netday netday netday set_value netday netday get net day day when payment is due net public string get net day return string get value net day getnetday get_value netday set net days net days in which payment is due public void set net days int net days set value net days new integer net days setnetdays netdays set_value netdays netdays get net days net days in which payment is due public int get net days integer ii integer get value net days if ii null return 0 return ii int value getnetdays get_value netdays intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name m c project id getrecord id processinfoparameter getparameter getparametername getparameter m_c_project_id getrecord_id perrform process return message clear text throws exception if not successful protected string do it throws exception log info c project id m c project id if m c project id 0 throw new illegal argument exception c project id 0 m project from project get project get ctx m c project id get trxname env setso trx get ctx true set so context todo duplicate invoice prevention m order order new m order from project true m order docsubtypeso oncredit if order save throw new exception could not create order lines int count 0 service project if m project projectcategory servicechargeproject equals from project get project category todo service project invoicing throw new exception service charge projects are on the todo list service lines else order lines m project line lines from project get lines for int i 0 i lines length i m order line ol new m order line order ol set line lines i get line ol set description lines i get description ol setm product id lines i getm product id true ol set qty lines i get planned qty subtract lines i get invoiced qty ol set price if lines i get planned price null lines i get planned price compare to env zero 0 ol set price lines i get planned price ol set discount ol set tax if ol save count for all lines if lines length count log log level severe lines difference project lines lines length saved count order lines return c order id order get document no count doit c_project_id m_c_project_id m_c_project_id illegalargumentexception c_project_id mproject fromproject getproject getctx m_c_project_id get_trxname setsotrx getctx morder morder fromproject morder docsubtypeso_oncredit mproject projectcategory_servicechargeproject fromproject getprojectcategory mprojectline fromproject getlines morderline morderline setline getline setdescription getdescription setm_product_id getm_product_id setqty getplannedqty getinvoicedqty setprice getplannedprice getplannedprice compareto setprice getplannedprice setdiscount settax projectlines c_order_id getdocumentno get and validate project param ctx context param c project id id return valid project static protected m project get project properties ctx int c project id string trx name m project from project new m project ctx c project id trx name if from project getc project id 0 throw new illegal argument exception project not found c project id c project id if from project getm pricelist version id 0 throw new illegal argument exception project has no price list if from project getm warehouse id 0 throw new illegal argument exception project has no warehouse if from project getc bpartner id 0 from project getc bpartner location id 0 throw new illegal argument exception project has no business partner location return from project c_project_id mproject getproject c_project_id trxname mproject fromproject mproject c_project_id trxname fromproject getc_project_id illegalargumentexception c_project_id c_project_id fromproject getm_pricelist_version_id illegalargumentexception fromproject getm_warehouse_id illegalargumentexception fromproject getc_bpartner_id fromproject getc_bpartner_location_id illegalargumentexception fromproject private string icon mono32x32 filename public confirm panel bean info iconmono32x32filename confirmpanelbeaninfo public property descriptor get property descriptors try property descriptor cancelbutton new property descriptor cancel button bean class get cancel button null property descriptor cancelvisible new property descriptor cancel visible bean class is cancel visible set cancel visible property descriptor customizebutton new property descriptor customize button bean class get customize button null property descriptor enabled new property descriptor enabled bean class null set enabled property descriptor historybutton new property descriptor history button bean class get history button null property descriptor okbutton new property descriptor ok button bean class getok button null property descriptor okvisible new property descriptor ok visible bean class isok visible setok visible property descriptor refreshbutton new property descriptor refresh button bean class get refresh button null property descriptor zoombutton new property descriptor zoom button bean class get zoom button null property descriptor pds new property descriptor cancelbutton cancelvisible customizebutton enabled historybutton okbutton okvisible refreshbutton zoombutton return pds catch introspection exception ex ex print stack trace return null propertydescriptor getpropertydescriptors propertydescriptor _cancelbutton propertydescriptor cancelbutton beanclass getcancelbutton propertydescriptor _cancelvisible propertydescriptor cancelvisible beanclass iscancelvisible setcancelvisible propertydescriptor _customizebutton propertydescriptor customizebutton beanclass getcustomizebutton propertydescriptor _enabled propertydescriptor beanclass setenabled propertydescriptor _historybutton propertydescriptor historybutton beanclass gethistorybutton propertydescriptor _okbutton propertydescriptor okbutton beanclass getokbutton propertydescriptor _okvisible propertydescriptor okvisible beanclass isokvisible setokvisible propertydescriptor _refreshbutton propertydescriptor refreshbutton beanclass getrefreshbutton propertydescriptor _zoombutton propertydescriptor zoombutton beanclass getzoombutton propertydescriptor propertydescriptor _cancelbutton _cancelvisible _customizebutton _enabled _historybutton _okbutton _okvisible _refreshbutton _zoombutton introspectionexception printstacktrace public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename public bean info get additional bean info class superclass bean class get superclass try bean info super bean info introspector get bean info superclass return new bean info super bean info catch introspection exception ex ex print stack trace return null beaninfo getadditionalbeaninfo beanclass getsuperclass beaninfo superbeaninfo getbeaninfo beaninfo superbeaninfo introspectionexception printstacktrace create ui not shared param x return ui public static componentui createui j component x return new compiere scroll paneui jcomponent compierescrollpaneui install ui param c public void installui j component c super installui c c set opaque false was ignored as set in constructor after updateui sun bug 138828 j scroll pane c get viewport set opaque false jcomponent setopaque jscrollpane getviewport setopaque standard constructor public x r issueproject properties ctx int r issueproject id string trx name super ctx r issueproject id trx name if r issueproject id 0 set name null setr issueproject id 0 set system status null x_r_issueproject r_issueproject_id trxname r_issueproject_id trxname r_issueproject_id setname setr_issueproject_id setsystemstatus load constructor public x r issueproject properties ctx result set rs string trx name super ctx rs trx name x_r_issueproject resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issueproject append get id append return sb to string tostring stringbuffer stringbuffer x_r_issueproject get_id tostring set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set profile information to help profiling the system for solving support issues public void set profile info string profile info if profile info null profile info length 60 log warning length 60 truncated profile info profile info substring 0 59 set value profile info profile info setprofileinfo profileinfo profileinfo profileinfo profileinfo profileinfo set_value profileinfo profileinfo get profile information to help profiling the system for solving support issues public string get profile info return string get value profile info getprofileinfo get_value profileinfo set issue project implementation projects public void setr issueproject id int r issueproject id if r issueproject id 1 throw new illegal argument exception r issueproject id is mandatory set valuenocheck r issueproject id new integer r issueproject id setr_issueproject_id r_issueproject_id r_issueproject_id illegalargumentexception r_issueproject_id set_valuenocheck r_issueproject_id r_issueproject_id get issue project implementation projects public int getr issueproject id integer ii integer get value r issueproject id if ii null return 0 return ii int value getr_issueproject_id get_value r_issueproject_id intvalue set statistics information to help profiling the system for solving support issues public void set statistics info string statistics info if statistics info null statistics info length 60 log warning length 60 truncated statistics info statistics info substring 0 59 set value statistics info statistics info setstatisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo set_value statisticsinfo statisticsinfo get statistics information to help profiling the system for solving support issues public string get statistics info return string get value statistics info getstatisticsinfo get_value statisticsinfo public static final string systemstatus production p set system status status of the system support priority depends on system status public void set system status string system status if system status null throw new illegal argument exception system status is mandatory if system status equals e system status equals i system status equals p else throw new illegal argument exception system status invalid value system status reference id 374 e i p if system status length 1 log warning length 1 truncated system status system status substring 0 0 set value system status system status systemstatus_production setsystemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus reference_id systemstatus systemstatus systemstatus set_value systemstatus systemstatus get system status status of the system support priority depends on system status public string get system status return string get value system status getsystemstatus get_value systemstatus constructor param owner frame dialog onwer param target window no window no of target window param min records number of minimum records public find frame owner int target window no string title int ad table id string table name string where extended m field find fields int min records super owner msg get msg env get ctx find title true log info title m targetwindowno target window no m ad table id ad table id m tablename table name m whereextended where extended m findfields find fields m query new m query table name m query add restriction where extended required for column validation env set context env get ctx m targetwindowno find table id m ad table id context for advanced search grid is window find env set context env get ctx env window find find table id m ad table id try jb init init find if m total min records dispose return catch exception e log log level severe find e this get root pane set default button confirm panels getok button a env show center window owner this targetwindowno windowno minrecords targetwindowno ad_table_id tablename whereextended mfield findfields minrecords getmsg getctx m_targetwindowno targetwindowno m_ad_table_id ad_table_id m_tablename tablename m_whereextended whereextended m_findfields findfields m_query mquery tablename m_query addrestriction whereextended setcontext getctx m_targetwindowno find_table_id m_ad_table_id window_find setcontext getctx window_find find_table_id m_ad_table_id jbinit initfind m_total minrecords getrootpane setdefaultbutton confirmpanels getokbutton aenv showcenterwindow static init pre tabbed pane simple panel scontent panel confirm panels advanced panel tool bar gc confirm panela south panel status bar pre throws exception private void jb init throws exception spacee box create horizontal strut 8 spacen box create vertical strut 8 spacew box create horizontal strut 8 spaces box create vertical strut 8 b ignore set icon new image icon org compiere compiere class get resource images ignore24 gif b ignore set margin new insets 2 2 2 2 b ignore set tool tip text msg get msg env get ctx ignore b ignore add action listener this b save set icon new image icon org compiere compiere class get resource images save24 gif b save set margin new insets 2 2 2 2 b save set tool tip text msg get msg env get ctx save b save add action listener this b new set icon new image icon org compiere compiere class get resource images new24 gif b new set margin new insets 2 2 2 2 b new set tool tip text msg get msg env get ctx new b new add action listener this b delete set icon new image icon org compiere compiere class get resource images delete24 gif b delete set margin new insets 2 2 2 2 b delete set tool tip text msg get msg env get ctx delete b delete add action listener this south panel set layout south layout value label set label for value field value label set text msg translate env get ctx value name label set label for name field name label set text msg translate env get ctx name description label set label for description field description label set text msg translate env get ctx description value field set text value field set columns fieldlength name field set text name field set columns fieldlength description field set text description field set columns fieldlength scontent panel set tool tip text msg get msg env get ctx find tip doc no label set label for doc no field doc no label set text msg translate env get ctx document no doc no field set text doc no field set columns fieldlength advanced scroll pane set preferred size new dimension 450 150 south panel add status bar border layout south this get content pane add south panel border layout south scontent panel set layout scontent layout simple panel set layout simple layout simple panel add confirm panels border layout south simple panel add scontent panel border layout center scontent panel add value label new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 7 5 0 5 0 0 scontent panel add name label new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 7 5 0 5 0 0 scontent panel add description label new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 7 5 5 5 0 0 scontent panel add value field new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 scontent panel add description field new grid bag constraints 2 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 scontent panel add doc no label new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 7 5 0 5 0 0 scontent panel add name field new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 scontent panel add doc no field new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 5 0 0 scontent panel add spacee new grid bag constraints 3 3 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 10 10 10 10 0 0 scontent panel add spacen new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 10 10 10 10 0 0 scontent panel add spacew new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 10 10 10 10 0 0 scontent panel add spaces new grid bag constraints 2 15 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 10 10 10 10 0 0 tabbed pane add simple panel msg get msg env get ctx find tabbed pane add simple panel msg get msg env get ctx find tool bar add b ignore null tool bar add separator tool bar add b new null tool bar add b save null tool bar add b delete null advanced panel set layout advanced layout advanced panel add tool bar border layout north advanced panel add confirm panela border layout south advanced panel add advanced scroll pane border layout center advanced scroll pane get viewport add advanced table null tabbed pane add advanced panel msg get msg env get ctx advanced tabbed pane add advanced panel msg get msg env get ctx advanced this get content pane add tabbed pane border layout center confirm panela add action listener this confirm panels add action listener this j button b confirm panel create new button true confirm panels add component b b add action listener this tabbedpane simplepanel scontentpanel confirmpanels advancedpanel toolbar confirmpanela southpanel statusbar jbinit createhorizontalstrut createverticalstrut createhorizontalstrut createverticalstrut bignore seticon imageicon getresource bignore setmargin bignore settooltiptext getmsg getctx bignore addactionlistener bsave seticon imageicon getresource bsave setmargin bsave settooltiptext getmsg getctx bsave addactionlistener bnew seticon imageicon getresource bnew setmargin bnew settooltiptext getmsg getctx bnew addactionlistener bdelete seticon imageicon getresource bdelete setmargin bdelete settooltiptext getmsg getctx bdelete addactionlistener southpanel setlayout southlayout valuelabel setlabelfor valuefield valuelabel settext getctx namelabel setlabelfor namefield namelabel settext getctx descriptionlabel setlabelfor descriptionfield descriptionlabel settext getctx valuefield settext valuefield setcolumns namefield settext namefield setcolumns descriptionfield settext descriptionfield setcolumns scontentpanel settooltiptext getmsg getctx findtip docnolabel setlabelfor docnofield docnolabel settext getctx documentno docnofield settext docnofield setcolumns advancedscrollpane setpreferredsize southpanel statusbar borderlayout getcontentpane southpanel borderlayout scontentpanel setlayout scontentlayout simplepanel setlayout simplelayout simplepanel confirmpanels borderlayout simplepanel scontentpanel borderlayout scontentpanel valuelabel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel namelabel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel descriptionlabel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel valuefield gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel descriptionfield gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel docnolabel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel namefield gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel docnofield gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel gridbagconstraints gridbagconstraints gridbagconstraints scontentpanel gridbagconstraints gridbagconstraints gridbagconstraints tabbedpane simplepanel getmsg getctx tabbedpane simplepanel getmsg getctx toolbar bignore toolbar addseparator toolbar bnew toolbar bsave toolbar bdelete advancedpanel setlayout advancedlayout advancedpanel toolbar borderlayout advancedpanel confirmpanela borderlayout advancedpanel advancedscrollpane borderlayout advancedscrollpane getviewport advancedtable tabbedpane advancedpanel getmsg getctx tabbedpane advancedpanel getmsg getctx getcontentpane tabbedpane borderlayout confirmpanela addactionlistener confirmpanels addactionlistener jbutton confirmpanel createnewbutton confirmpanels addcomponent addactionlistener dynamic init 6 set up grid controller private void init find log config get info from target tab for int i 0 i m findfields length i m field m field m findfields i string column name m field get column name if column name equals value has value true else if column name equals name has name true else if column name equals document no has doc no true else if column name equals description has description true else if m field is selection column add selection column m field else if column name index of name 1 add selection column m field target fields m targetfields put new integer m field getad column id m field for all target tab fields disable simple query fields value label set visible has value value field set visible has value if has value value field add action listener this doc no label set visible has doc no doc no field set visible has doc no if has doc no doc no field add action listener this name label set visible has name name field set visible has name if has name name field add action listener this description label set visible has description description field set visible has description if has description description field add action listener this get total m total get no of records null false set statusdb m total status bar set status line tabbed pane add change listener this better labels for ok cancel confirm panela getok button set tool tip text msg get msg env get ctx query enter confirm panela get cancel button set tool tip text msg get msg env get ctx query cancel confirm panels getok button set tool tip text msg get msg env get ctx query enter confirm panels get cancel button set tool tip text msg get msg env get ctx query cancel gridcontroller initfind m_findfields mfield mfield m_findfields columnname mfield getcolumnname columnname hasvalue columnname hasname columnname documentno hasdocno columnname hasdescription mfield isselectioncolumn addselectioncolumn mfield columnname indexof addselectioncolumn mfield targetfields m_targetfields mfield getad_column_id mfield valuelabel setvisible hasvalue valuefield setvisible hasvalue hasvalue valuefield addactionlistener docnolabel setvisible hasdocno docnofield setvisible hasdocno hasdocno docnofield addactionlistener namelabel setvisible hasname namefield setvisible hasname hasname namefield addactionlistener descriptionlabel setvisible hasdescription descriptionfield setvisible hasdescription hasdescription descriptionfield addactionlistener m_total getnoofrecords setstatusdb m_total statusbar setstatusline tabbedpane addchangelistener confirmpanela getokbutton settooltiptext getmsg getctx queryenter confirmpanela getcancelbutton settooltiptext getmsg getctx querycancel confirmpanels getokbutton settooltiptext getmsg getctx queryenter confirmpanels getcancelbutton settooltiptext getmsg getctx querycancel add selection column to first tab param m field field private void add selection column m field m field log config m field get header int display length m field get display length if display length fieldlength m field set display length fieldlength else display length 0 editor v editor editor null if m field is lookup v lookup vl new v lookup m field get column name false false true m field get lookup vl set name m field get column name editor vl else editor v editor factory get editor m field false editor set mandatory false editor set read write true c label label v editor factory get label m field if display length 0 set it back m field set display length display length m sline if label null may be null for y n scontent panel add label new grid bag constraints 1 m sline 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 7 5 5 5 0 0 scontent panel add component editor new grid bag constraints 2 m sline 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 m seditors add editor mfield addselectioncolumn mfield mfield mfield getheader displaylength mfield getdisplaylength displaylength mfield setdisplaylength displaylength veditor mfield islookup vlookup vlookup mfield getcolumnname mfield getlookup setname mfield getcolumnname veditorfactory geteditor mfield setmandatory setreadwrite clabel veditorfactory getlabel mfield displaylength mfield setdisplaylength displaylength m_sline scontentpanel gridbagconstraints m_sline gridbagconstraints gridbagconstraints scontentpanel gridbagconstraints m_sline gridbagconstraints gridbagconstraints m_seditors init find grid controller private void init find advanced log config advanced table set model new default table model 0 4 advanced table set auto resize mode j table auto resize subsequent columns 0 columns array list value name pair items new array list value name pair for int c 0 c m findfields length c m field field m findfields c string column name field get column name string header field get header if header null header length 0 header msg translate env get ctx column name if header null header length 0 continue if field is key header id value name pair pp new value name pair column name header system out println pp field items add pp value name pair cols new value name pair items size items to array cols arrays sort cols sort alpha columns new c combo box cols columns add action listener this table column tc advanced table get column model get column index columnname tc set preferred width 150 tc set cell editor new default cell editor columns tc set header value msg translate env get ctx ad column id 1 operators operators new c combo box m query operators tc advanced table get column model get column index operator tc set preferred width 40 tc set cell editor new default cell editor operators tc set header value msg get msg env get ctx operator 2 query value tc advanced table get column model get column index value tc set cell editor new find value editor this false tc set cell renderer new find value renderer this false tc set header value msg get msg env get ctx query value 3 query value2 tc advanced table get column model get column index value2 tc set preferred width 50 tc set cell editor new find value editor this true tc set cell renderer new find value renderer this true tc set header value msg get msg env get ctx query value2 no row create one cmd new gridcontroller initfindadvanced advancedtable setmodel defaulttablemodel advancedtable setautoresizemode jtable auto_resize_subsequent_columns arraylist valuenamepair arraylist valuenamepair m_findfields mfield m_findfields columnname getcolumnname getheader getctx columnname iskey valuenamepair valuenamepair columnname valuenamepair valuenamepair toarray ccombobox addactionlistener tablecolumn advancedtable getcolumnmodel getcolumn index_columnname setpreferredwidth setcelleditor defaultcelleditor setheadervalue getctx ad_column_id ccombobox mquery advancedtable getcolumnmodel getcolumn index_operator setpreferredwidth setcelleditor defaultcelleditor setheadervalue getmsg getctx queryvalue advancedtable getcolumnmodel getcolumn index_value setcelleditor findvalueeditor setcellrenderer findvaluerenderer setheadervalue getmsg getctx queryvalue queryvalue2 advancedtable getcolumnmodel getcolumn index_value2 setpreferredwidth setcelleditor findvalueeditor setcellrenderer findvaluerenderer setheadervalue getmsg getctx queryvalue2 cmd_new dispose window public void dispose log config find sql if m pstmt null try m pstmt close catch sql exception e m pstmt null target fields if m targetfields null m targetfields clear m targetfields null remove all super dispose m_pstmt m_pstmt sqlexception m_pstmt targetfields m_targetfields m_targetfields m_targetfields removeall action listener param e action event public void action performed action event e log info e get action command if e get action command confirm panel a cancel cmd cancel else if e get action command confirm panel a refresh cmd refresh else if e get action command confirm panel a new m query m query get no record query m tablename true m total 0 dispose else if e get source b ignore cmd ignore else if e get source b new cmd new else if e get source b save cmd save else if e get source b delete cmd delete else if e get source columns value name pair column value name pair columns get selected item if column null string column name column get value log config column column name if column name ends with id column name ends with acct operators set model new default combo box model m query operators id else if column name starts with is operators set model new default combo box model m query operators yn else operators set model new default combo box model m query operators else confirm panel a ok and enter in fields if e get source confirm panela getok button cmd ok advanced else cmd ok simple actionevent actionperformed actionevent getactioncommand getactioncommand confirmpanel a_cancel cmd_cancel getactioncommand confirmpanel a_refresh cmd_refresh getactioncommand confirmpanel a_new m_query mquery getnorecordquery m_tablename m_total getsource bignore cmd_ignore getsource bnew cmd_new getsource bsave cmd_save getsource bdelete cmd_delete getsource valuenamepair valuenamepair getselecteditem columnname getvalue columnname columnname endswith _id columnname endswith _acct setmodel defaultcomboboxmodel mquery operators_id columnname startswith setmodel defaultcomboboxmodel mquery operators_yn setmodel defaultcomboboxmodel mquery confirmpanel a_ok getsource confirmpanela getokbutton cmd_ok_advanced cmd_ok_simple change listener tab change param e change ebent public void state changed change event e log info find state changed if tabbed pane get selected index 0 this get root pane set default button confirm panels getok button else init find advanced this get root pane set default button confirm panela getok button changeebent statechanged changeevent statechanged tabbedpane getselectedindex getrootpane setdefaultbutton confirmpanels getokbutton initfindadvanced getrootpane setdefaultbutton confirmpanela getokbutton simple ok button pressed private void cmd ok simple create query string m query new m query m tablename if has value value field get text equals value field get text length 0 string value value field get text to upper case if value ends with value m query add restriction upper value m query like value value label get text value if has doc no doc no field get text equals doc no field get text length 0 string value doc no field get text to upper case if value ends with value m query add restriction upper document no m query like value doc no label get text value if has name name field get text equals name field get text length 0 string value name field get text to upper case if value ends with value m query add restriction upper name m query like value name label get text value if has description description field get text equals description field get text length 0 string value description field get text to upper case if value ends with value m query add restriction upper description m query like value description label get text value special editors for int i 0 i m seditors size i v editor ved v editor m seditors get i object value ved get value if value null value to string length 0 string column name component ved get name log fine column name value if value to string index of 1 m query add restriction column name m query like value column name ved get display else m query add restriction column name m query equal value column name ved get display editors test for no records if get no of records m query true 0 dispose cmd_ok_simple m_query mquery m_tablename hasvalue valuefield gettext valuefield gettext valuefield gettext touppercase endswith m_query addrestriction mquery valuelabel gettext hasdocno docnofield gettext docnofield gettext docnofield gettext touppercase endswith m_query addrestriction documentno mquery docnolabel gettext hasname namefield gettext namefield gettext namefield gettext touppercase endswith m_query addrestriction mquery namelabel gettext hasdescription descriptionfield gettext descriptionfield gettext descriptionfield gettext touppercase endswith m_query addrestriction mquery descriptionlabel gettext m_seditors veditor veditor m_seditors getvalue tostring columnname getname columnname tostring indexof m_query addrestriction columnname mquery columnname getdisplay m_query addrestriction columnname mquery columnname getdisplay getnoofrecords m_query advanced ok button pressed private void cmd ok advanced save pending if b save is enabled cmd save if get no of records m query true 0 dispose cmd_ok_advanced bsave isenabled cmd_save getnoofrecords m_query cancel button pressed private void cmd cancel log info m query null m total 999999 dispose cmd_cancel m_query m_total ignore private void cmd ignore log info cmd_ignore new record private void cmd new log info default table model model default table model advanced table get model model add row new object null m query operators m query equal index null null cmd_new defaulttablemodel defaulttablemodel advancedtable getmodel addrow mquery mquery equal_index save advanced private void cmd save log info advanced table stop editor true m query new m query m tablename for int row 0 row advanced table get row count row column object column advanced table get value at row index columnname if column null continue string column name value name pair column get value string info name column to string m field field get targetm field column name string columnsql field get columnsql false op object op advanced table get value at row index operator if op null continue string operator value name pair op get value value object value advanced table get value at row index value if value null continue object parsed value parse value field value if parsed value null continue string info display value to string if field is lookup info display field get lookup get display value else if field get display type display type yes no info display msg get msg env get ctx info display value2 if m query operators m query between index equals op object value2 advanced table get value at row index value2 if value2 null continue object parsed value2 parse value field value2 string infodisplay to value2 to string if parsed value2 null continue m query add range restriction columnsql parsed value parsed value2 info name info display infodisplay to else m query add restriction columnsql operator parsed value info name info display cmd_save advancedtable stopeditor m_query mquery m_tablename advancedtable getrowcount advancedtable getvalueat index_columnname columnname valuenamepair getvalue infoname tostring mfield gettargetmfield columnname getcolumnsql advancedtable getvalueat index_operator valuenamepair getvalue advancedtable getvalueat index_value parsedvalue parsevalue parsedvalue infodisplay tostring islookup infodisplay getlookup getdisplay getdisplaytype displaytype yesno infodisplay getmsg getctx infodisplay mquery mquery between_index advancedtable getvalueat index_value2 parsedvalue2 parsevalue infodisplay_to tostring parsedvalue2 m_query addrangerestriction parsedvalue parsedvalue2 infoname infodisplay infodisplay_to m_query addrestriction parsedvalue infoname infodisplay parse value param field column param in value return data type corected value private object parse value m field field object in if in null return null int dt field get display type try return integer if dt display type integer display type isid dt field get column name ends with id if in instanceof integer return in int i integer parse int in to string return new integer i return big decimal else if display type is numeric dt if in instanceof big decimal return in return display type get number format dt parse in to string return timestamp else if display type is date dt if in instanceof timestamp return in long time 0 try time display type getdateformat jdbc parse in to string get time return new timestamp time catch exception e log log level severe in in get class e time display type get date format dt parse in to string get time return new timestamp time return y n for boolean else if in instanceof boolean return boolean in boolean value y n catch exception ex log log level severe object in ex string error ex get localized message if error null error length 0 error ex to string string buffer err msg new string buffer err msg append field get column name append append in append append error a dialog error 0 this validation error err msg to string return null return in parsevalue mfield getdisplaytype displaytype displaytype getcolumnname endswith _id parseint tostring bigdecimal displaytype isnumeric bigdecimal displaytype getnumberformat tostring displaytype isdate displaytype getdateformat_jdbc tostring gettime getclass displaytype getdateformat tostring gettime booleanvalue getlocalizedmessage tostring stringbuffer errmsg stringbuffer errmsg getcolumnname adialog validationerror errmsg tostring delete private void cmd delete log info default table model model default table model advanced table get model int row advanced table get selected row if row 0 model remove row row cmd refresh cmd_delete defaulttablemodel defaulttablemodel advancedtable getmodel advancedtable getselectedrow removerow cmd_refresh refresh private void cmd refresh log info int records get no of records m query true set statusdb records status bar set status line cmd_refresh getnoofrecords m_query setstatusdb statusbar setstatusline get query retrieve result return string representation of query public m query get query m role role m role get default if role is query max get total records m query m query get no record query m tablename false m total 0 log warning query over max else log info query m query return m query mquery getquery mrole mrole getdefault isquerymax gettotalrecords m_query mquery getnorecordquery m_tablename m_total m_query m_query get total records return no of records public int get total records return m total gettotalrecords m_total get the number of records of target tab param query where clause for target tab param alert zero records show dialog if there are no records return number of selected records private int get no of records m query query boolean alert zero records log config query string buffer sql new string buffer select count from sql append m tablename boolean has where false if m whereextended null m whereextended length 0 sql append where append m whereextended has where true if query null query is active if has where sql append and else sql append where sql append query get where clause add access string finalsql m role get default add accesssql sql to string m tablename m role sql notqualified m role sql ro finalsql env parse context env get ctx m targetwindowno finalsql false env set context env get ctx m targetwindowno tabno findsql finalsql execute qusery m total 999999 try statement stmt db create statement result set rs stmt execute query finalsql if rs next m total rs get int 1 rs close stmt close catch sql exception e log log level severe finalsql e m role role m role get default no records if m total 0 alert zero records a dialog info m targetwindowno this find zero records more then allowed else if query null role is query max m total a dialog error m targetwindowno this find over max m total role get max query records else log config m total if query null status bar set status tool tip query get where clause return m total alertzerorecords getnoofrecords mquery alertzerorecords stringbuffer stringbuffer m_tablename haswhere m_whereextended m_whereextended m_whereextended haswhere isactive haswhere getwhereclause mrole getdefault addaccesssql tostring m_tablename mrole sql_notqualified mrole sql_ro parsecontext getctx m_targetwindowno setcontext getctx m_targetwindowno m_total createstatement resultset executequery m_total getint sqlexception mrole mrole getdefault m_total alertzerorecords adialog m_targetwindowno findzerorecords isquerymax m_total adialog m_targetwindowno findovermax m_total getmaxqueryrecords m_total statusbar setstatustooltip getwhereclause m_total display current count param current count string representation of current total private void set statusdb int current count string text current count m total status bar set statusdb text currentcount setstatusdb currentcount currentcount m_total statusbar setstatusdb grid status changed param e data statue event public void data status changed data status event e log config e get message action control boolean changed e is changed b ignore set enabled changed b new set enabled changed b save set enabled changed b delete set enabled changed datastatueevent datastatuschanged datastatusevent getmessage ischanged bignore setenabled bnew setenabled bsave setenabled bdelete setenabled get target m field param column name column name return m field public m field get targetm field string column name if column name null return null for int c 0 c m findfields length c m field field m findfields c if column name equals field get column name return field return null mfield columnname mfield mfield gettargetmfield columnname columnname m_findfields mfield m_findfields columnname getcolumnname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals inventory count set p inventorycountsetzero z equals para i get parameter else log log level severe unknown parameter name p m inventory id getrecord id processinfoparameter getparameter getparametername getparameter inventorycountset p_inventorycountsetzero getparameter p_m_inventory_id getrecord_id process return message throws exception protected string do it throws exception log info m inventory id p m inventory id m inventory inventory new m inventory get ctx p m inventory id get trxname if inventory get id 0 throw new compiere system error not found m inventory id p m inventory id multiple lines for one item string sql update m inventoryline set is active n where m inventory id p m inventory id and m product id m locator id m attributesetinstance id in select m product id m locator id m attributesetinstance id from m inventoryline where m inventory id p m inventory id group by m product id m locator id m attributesetinstance id having count 1 int multiple db execute update sql get trxname log info multiple multiple int delma m inventory linema delete inventoryma p m inventory id get trxname log info deletedma delma asi sql update m inventoryline l set qty book qty count select qty on hand qty on hand from m storage s where s m product id l m product id and s m locator id l m locator id and s m attributesetinstance id l m attributesetinstance id updated sys date updated by getad user id where m inventory id p m inventory id and exists select from m storage s where s m product id l m product id and s m locator id l m locator id and s m attributesetinstance id l m attributesetinstance id int no db execute update sql get trxname log info update with asi no no asi int noma update withma set count to zero if p inventorycountsetzero sql update m inventoryline l set qty count 0 where m inventory id p m inventory id no db execute update sql get trxname log info set cont to zero no if multiple 0 return m inventoryline id no noma inventory product multiple return m inventoryline id no doit m_inventory_id p_m_inventory_id minventory minventory getctx p_m_inventory_id get_trxname get_id compieresystemerror m_inventory_id p_m_inventory_id m_inventoryline isactive m_inventory_id p_m_inventory_id m_product_id m_locator_id m_attributesetinstance_id m_product_id m_locator_id m_attributesetinstance_id m_inventoryline m_inventory_id p_m_inventory_id m_product_id m_locator_id m_attributesetinstance_id executeupdate get_trxname minventorylinema deleteinventoryma p_m_inventory_id get_trxname m_inventoryline qtybook qtycount qtyonhand qtyonhand m_storage m_product_id m_product_id m_locator_id m_locator_id m_attributesetinstance_id m_attributesetinstance_id sysdate updatedby getad_user_id m_inventory_id p_m_inventory_id m_storage m_product_id m_product_id m_locator_id m_locator_id m_attributesetinstance_id m_attributesetinstance_id executeupdate get_trxname updatewithma p_inventorycountsetzero m_inventoryline qtycount m_inventory_id p_m_inventory_id executeupdate get_trxname m_inventoryline_id inventoryproductmultiple m_inventoryline_id update inventory lines with material allocation return no updated private int update withma int no 0 string sql select from m inventoryline where m inventory id and m attributesetinstance id 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 p m inventory id result set rs pstmt execute query while rs next m inventory line il new m inventory line get ctx rs get trxname big decimal on hand env zero m storage storages m storage get all get ctx il getm product id il getm locator id get trxname m inventory linema ma null for int i 0 i storages length i m storage storage storages i if storage get qty on hand signum 0 continue on hand on hand add storage get qty on hand no asi if storage getm attributesetinstance id 0 storages length 1 continue save asi ma new m inventory linema il storage getm attributesetinstance id storage get qty on hand if ma save il set qty book on hand il set qty count on hand if il save no rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info no return no updatewithma m_inventoryline m_inventory_id m_attributesetinstance_id preparedstatement preparestatement setint p_m_inventory_id resultset executequery minventoryline minventoryline getctx get_trxname bigdecimal onhand mstorage mstorage getall getctx getm_product_id getm_locator_id get_trxname minventorylinema mstorage getqtyonhand onhand onhand getqtyonhand getm_attributesetinstance_id minventorylinema getm_attributesetinstance_id getqtyonhand setqtybook onhand setqtycount onhand standard constructor param ctx context param gl distributionline id id public m distribution line properties ctx int gl distributionline id string trx name super ctx gl distributionline id trx name if gl distributionline id 0 setgl distribution id 0 parent set line 0 set overwrite acct false set overwrite activity false set overwriteb partner false set overwrite campaign false set overwrite loc from false set overwrite loc to false set overwrite org false set overwrite org trx false set overwrite product false set overwrite project false set overwrite sales region false set overwrite user1 false set overwrite user2 false set percent env zero gl_distributionline_id mdistributionline gl_distributionline_id trxname gl_distributionline_id trxname gl_distributionline_id setgl_distribution_id setline setoverwriteacct setoverwriteactivity setoverwritebpartner setoverwritecampaign setoverwritelocfrom setoverwritelocto setoverwriteorg setoverwriteorgtrx setoverwriteproduct setoverwriteproject setoverwritesalesregion setoverwriteuser1 setoverwriteuser2 setpercent load constructor param ctx context param rs result set public m distribution line properties ctx result set rs string trx name super ctx rs trx name mdistributionline resultset trxname trxname get parent return returns the parent public m distribution get parent if m parent null m parent new m distribution get ctx getgl distribution id get trxname return m parent mdistribution getparent m_parent m_parent mdistribution getctx getgl_distribution_id get_trxname m_parent set parent param parent the parent to set public void set parent m distribution parent m parent parent setparent mdistribution m_parent set account param acct account public void set account m account acct m account acct setaccount maccount m_account get account combination based on account and overwrite return account public m account get account m account acct m account get get ctx m account getad client id is overwrite org getorg id 0 getorg id m account getad org id m account getc acctschema id is overwrite acct getaccount id 0 getaccount id m account getaccount id m account getc subacct id is overwrite product getm product id m account getm product id is overwriteb partner getc bpartner id m account getc bpartner id is overwrite org trx getad orgtrx id m account getad orgtrx id is overwrite loc from getc locfrom id m account getc locfrom id is overwrite loc to getc locto id m account getc locto id is overwrite sales region getc salesregion id m account getc salesregion id is overwrite project getc project id m account getc project id is overwrite campaign getc campaign id m account getc campaign id is overwrite activity getc activity id m account getc activity id is overwrite user1 getuser1 id m account getuser1 id is overwrite user2 getuser2 id m account getuser2 id m account getuserelement1 id m account getuserelement2 id return acct maccount getaccount maccount maccount getctx m_account getad_client_id isoverwriteorg getorg_id getorg_id m_account getad_org_id m_account getc_acctschema_id isoverwriteacct getaccount_id getaccount_id m_account getaccount_id m_account getc_subacct_id isoverwriteproduct getm_product_id m_account getm_product_id isoverwritebpartner getc_bpartner_id m_account getc_bpartner_id isoverwriteorgtrx getad_orgtrx_id m_account getad_orgtrx_id isoverwritelocfrom getc_locfrom_id m_account getc_locfrom_id isoverwritelocto getc_locto_id m_account getc_locto_id isoverwritesalesregion getc_salesregion_id m_account getc_salesregion_id isoverwriteproject getc_project_id m_account getc_project_id isoverwritecampaign getc_campaign_id m_account getc_campaign_id isoverwriteactivity getc_activity_id m_account getc_activity_id isoverwriteuser1 getuser1_id m_account getuser1_id isoverwriteuser2 getuser2_id m_account getuser2_id m_account getuserelement1_id m_account getuserelement2_id get distribution amount return returns the amt public big decimal get amt return m amt bigdecimal getamt m_amt set distribution amount param amt the amt to set public void set amt big decimal amt m amt amt setamt bigdecimal m_amt set distribution amount param amt the amt to set to be multiplied by percent param precision precision public void calculate amt big decimal amt int precision m amt amt multiply get percent m amt m amt divide env onehundred precision big decimal round half up calculateamt bigdecimal m_amt getpercent m_amt m_amt bigdecimal round_half_up before save param new record new return true protected boolean before save boolean new record if get line 0 string sql select coalesce max line 0 10 from gl distributionline where gl distribution id int ii db getsql value get trxname sql getgl distribution id set line ii reset not selected overwrite if is overwrite acct getaccount id 0 setaccount id 0 if is overwrite activity getc activity id 0 setc activity id 0 if is overwriteb partner getc bpartner id 0 setc bpartner id 0 if is overwrite campaign getc campaign id 0 setc campaign id 0 if is overwrite loc from getc locfrom id 0 setc locfrom id 0 if is overwrite loc to getc locto id 0 setc locto id 0 if is overwrite org getorg id 0 setorg id 0 if is overwrite org trx getad orgtrx id 0 setad orgtrx id 0 if is overwrite product getm product id 0 setm product id 0 if is overwrite project getc project id 0 setc project id 0 if is overwrite sales region getc salesregion id 0 setc salesregion id 0 if is overwrite user1 getuser1 id 0 setuser1 id 0 if is overwrite user2 getuser2 id 0 setuser2 id 0 account overwrite cannot be 0 if is overwrite acct getaccount id 0 log save error error msg parse translation get ctx account id 0 return false org overwrite cannot be 0 if is overwrite org getorg id 0 log save error error msg parse translation get ctx org id 0 return false return true newrecord beforesave newrecord getline gl_distributionline gl_distribution_id getsqlvalue get_trxname getgl_distribution_id setline isoverwriteacct getaccount_id setaccount_id isoverwriteactivity getc_activity_id setc_activity_id isoverwritebpartner getc_bpartner_id setc_bpartner_id isoverwritecampaign getc_campaign_id setc_campaign_id isoverwritelocfrom getc_locfrom_id setc_locfrom_id isoverwritelocto getc_locto_id setc_locto_id isoverwriteorg getorg_id setorg_id isoverwriteorgtrx getad_orgtrx_id setad_orgtrx_id isoverwriteproduct getm_product_id setm_product_id isoverwriteproject getc_project_id setc_project_id isoverwritesalesregion getc_salesregion_id setc_salesregion_id isoverwriteuser1 getuser1_id setuser1_id isoverwriteuser2 getuser2_id setuser2_id isoverwriteacct getaccount_id saveerror parsetranslation getctx account_id isoverwriteorg getorg_id saveerror parsetranslation getctx org_id after save param new record new param success success return success protected boolean after save boolean new record boolean success get parent m parent validate m parent save return success newrecord aftersave newrecord getparent m_parent m_parent prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c doctypetarget id p c doctypetarget id para i get parameter as int else if name equals doc status p docstatus string para i get parameter else if name equals is self service p isselfservice string para i get parameter else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals date ordered p dateordered from timestamp para i get parameter p dateordered to timestamp para i getparameter to else if name equals doc action p docaction string para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_doctypetarget_id p_c_doctypetarget_id getparameterasint docstatus p_docstatus getparameter isselfservice p_isselfservice getparameter c_bpartner_id p_c_bpartner_id getparameterasint dateordered p_dateordered_from getparameter p_dateordered_to getparameter_to docaction p_docaction getparameter process return msg throws exception protected string do it throws exception log info c doctypetarget id p c doctypetarget id doc status p docstatus is self service p isselfservice c bpartner id p c bpartner id date ordered p dateordered from p dateordered to doc action p docaction if p c doctypetarget id 0 throw new compiere user error not found c doctypetarget id if p docstatus null p docstatus length 2 throw new compiere user error not found doc status if p docaction null p docaction length 2 throw new compiere user error not found doc action string buffer sql new string buffer select from c order where c doctypetarget id and doc status if p isselfservice null p isselfservice length 1 sql append and is self service append p isselfservice append if p c bpartner id 0 sql append and c bpartner id append p c bpartner id if p dateordered from null sql append and trunc date ordered append db to date p dateordered from true if p dateordered to null sql append and trunc date ordered append db to date p dateordered to true int counter 0 int err counter 0 prepared statement pstmt null try pstmt db prepare statement sql to string get trxname pstmt set int 1 p c doctypetarget id pstmt set string 2 p docstatus result set rs pstmt execute query while rs next if process new m order get ctx rs get trxname counter else err counter rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null return updated counter errors err counter doit c_doctypetarget_id p_c_doctypetarget_id docstatus p_docstatus isselfservice p_isselfservice c_bpartner_id p_c_bpartner_id dateordered p_dateordered_from p_dateordered_to docaction p_docaction p_c_doctypetarget_id compiereusererror notfound c_doctypetarget_id p_docstatus p_docstatus compiereusererror notfound docstatus p_docaction p_docaction compiereusererror notfound docaction stringbuffer stringbuffer c_order c_doctypetarget_id docstatus p_isselfservice p_isselfservice isselfservice p_isselfservice p_c_bpartner_id c_bpartner_id p_c_bpartner_id p_dateordered_from dateordered to_date p_dateordered_from p_dateordered_to dateordered to_date p_dateordered_to errcounter preparedstatement preparestatement tostring get_trxname setint p_c_doctypetarget_id setstring p_docstatus resultset executequery morder getctx get_trxname errcounter tostring errcounter process order param order order return true if ok private boolean process m order order log info order to string order set doc action p docaction if order process it p docaction order save add log 0 null null order get document no ok return true add log 0 null null order get document no error order get process msg return false morder tostring setdocaction p_docaction processit p_docaction addlog getdocumentno addlog getdocumentno getprocessmsg prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m product category id m product category id para i get parameter as int else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter m_product_category_id m_product_category_id getparameterasint p_record_id getrecord_id process return message throws exception protected string do it throws exception string sql string sqlupd string sqlins int cntu 0 int cnti 0 int totu 0 int toti 0 log info copy and overwrite accounts to products of this category sql select p revenue acct p expense acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct c acctschema id m product category id from m product category acct where m product category id m product category id prepared statement pstmt null try pstmt db prepare statement sql result set rs pstmt execute query while rs next update existing products sqlupd update m product acct set p revenue acct rs get int p revenue acct p expense acct rs get int p expense acct p asset acct rs get int p asset acct p cogs acct rs get int p cogs acct p purchasepricevariance acct rs get int p purchasepricevariance acct p invoicepricevariance acct rs get int p invoicepricevariance acct p tradediscountrec acct rs get int p tradediscountrec acct p tradediscountgrant acct rs get int p tradediscountgrant acct updated sys date updated by 0 where m product acct c acctschema id rs get int c acctschema id and exists select from m product p where p m product id m product acct m product id and p m product category id rs get int m product category id cntu db execute update sqlupd totu cntu insert new products sqlins insert into m product acct m product id c acctschema id ad client id ad org id is active created created by updated updated by p revenue acct p expense acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p m product id rs get int c acctschema id p ad client id p ad org id y sys date 0 sys date 0 rs get int p revenue acct rs get int p expense acct rs get int p asset acct rs get int p cogs acct rs get int p purchasepricevariance acct rs get int p invoicepricevariance acct rs get int p tradediscountrec acct rs get int p tradediscountgrant acct from m product p where p m product category id rs get int m product category id and not exists select from m product acct pa where pa m product id p m product id and pa c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info product cntu cnti rs close pstmt close pstmt null log fine committing db commit true get trxname catch exception e log log level severe adding missing elements e try if pstmt null pstmt close pstmt null catch exception e pstmt null return created cnti updated cntu doit p_revenue_acct p_expense_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct c_acctschema_id m_product_category_id m_product_category_acct m_product_category_id m_product_category_id preparedstatement preparestatement resultset executequery m_product_acct p_revenue_acct getint p_revenue_acct p_expense_acct getint p_expense_acct p_asset_acct getint p_asset_acct p_cogs_acct getint p_cogs_acct p_purchasepricevariance_acct getint p_purchasepricevariance_acct p_invoicepricevariance_acct getint p_invoicepricevariance_acct p_tradediscountrec_acct getint p_tradediscountrec_acct p_tradediscountgrant_acct getint p_tradediscountgrant_acct sysdate updatedby m_product_acct c_acctschema_id getint c_acctschema_id m_product m_product_id m_product_acct m_product_id m_product_category_id getint m_product_category_id executeupdate m_product_acct m_product_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby p_revenue_acct p_expense_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint p_revenue_acct getint p_expense_acct getint p_asset_acct getint p_cogs_acct getint p_purchasepricevariance_acct getint p_invoicepricevariance_acct getint p_tradediscountrec_acct getint p_tradediscountgrant_acct m_product m_product_category_id getint m_product_category_id m_product_acct m_product_id m_product_id c_acctschema_id getint c_acctschema_id executeupdate get_trxname do get see javax servlet http http servlet do get javax servlet http http servlet request javax servlet http http servlet response param arg0 param arg1 throws javax servlet servlet exception throws java io io exception protected void do get http servlet request arg0 http servlet response arg1 throws servlet exception io exception super do get arg0 arg1 doget httpservlet doget httpservletrequest httpservletresponse servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception doget do post see javax servlet http http servlet do post javax servlet http http servlet request javax servlet http http servlet response param arg0 param arg1 throws javax servlet servlet exception throws java io io exception protected void do post http servlet request arg0 http servlet response arg1 throws servlet exception io exception todo auto generated method stub super do post arg0 arg1 dopost httpservlet dopost httpservletrequest httpservletresponse servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception dopost get servlet info see javax servlet servlet get servlet info return servlet info public string get servlet info return super get servlet info getservletinfo getservletinfo getservletinfo getservletinfo init see javax servlet generic servlet init throws javax servlet servlet exception public void init throws servlet exception super init genericservlet servletexception servletexception init see javax servlet servlet init javax servlet servlet config param arg0 throws javax servlet servlet exception public void init servlet config arg0 throws servlet exception todo auto generated method stub super init arg0 servletconfig servletexception servletconfig servletexception standard constructor public x c bankstatementline properties ctx int c bankstatementline id string trx name super ctx c bankstatementline id trx name if c bankstatementline id 0 setc bankstatementline id 0 setc bankstatement id 0 setc charge id 0 setc currency id 0 sql select c currency id from c bankaccount where c bankaccount id c bankaccount id set charge amt env zero set date acct new timestamp system current time millis statement date set interest amt env zero set is manual true y set is reversal false set line 0 sql select coalesce max line 0 10 from c bankstatementline where c bankstatement id c bankstatement id set processed false set statement line date new timestamp system current time millis statement line date set stmt amt env zero set trx amt env zero set valuta date new timestamp system current time millis statement date x_c_bankstatementline c_bankstatementline_id trxname c_bankstatementline_id trxname c_bankstatementline_id setc_bankstatementline_id setc_bankstatement_id setc_charge_id setc_currency_id c_currency_id c_bankaccount c_bankaccount_id c_bankaccount_id setchargeamt setdateacct currenttimemillis statementdate setinterestamt setismanual setisreversal setline c_bankstatementline c_bankstatement_id c_bankstatement_id setprocessed setstatementlinedate currenttimemillis statementlinedate setstmtamt settrxamt setvalutadate currenttimemillis statementdate load constructor public x c bankstatementline properties ctx result set rs string trx name super ctx rs trx name x_c_bankstatementline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankstatementline append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankstatementline get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set bank statement line line on a statement from this bank public void setc bankstatementline id int c bankstatementline id if c bankstatementline id 1 throw new illegal argument exception c bankstatementline id is mandatory set valuenocheck c bankstatementline id new integer c bankstatementline id setc_bankstatementline_id c_bankstatementline_id c_bankstatementline_id illegalargumentexception c_bankstatementline_id set_valuenocheck c_bankstatementline_id c_bankstatementline_id get bank statement line line on a statement from this bank public int getc bankstatementline id integer ii integer get value c bankstatementline id if ii null return 0 return ii int value getc_bankstatementline_id get_value c_bankstatementline_id intvalue set bank statement bank statement of account public void setc bankstatement id int c bankstatement id if c bankstatement id 1 throw new illegal argument exception c bankstatement id is mandatory set valuenocheck c bankstatement id new integer c bankstatement id setc_bankstatement_id c_bankstatement_id c_bankstatement_id illegalargumentexception c_bankstatement_id set_valuenocheck c_bankstatement_id c_bankstatement_id get bank statement bank statement of account public int getc bankstatement id integer ii integer get value c bankstatement id if ii null return 0 return ii int value getc_bankstatement_id get_value c_bankstatement_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 1 throw new illegal argument exception c charge id is mandatory set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id illegalargumentexception c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt if charge amt null throw new illegal argument exception charge amt is mandatory set value charge amt charge amt setchargeamt bigdecimal chargeamt chargeamt illegalargumentexception chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set create payment public void set create payment string create payment if create payment null create payment length 1 log warning length 1 truncated create payment create payment substring 0 0 set value create payment create payment setcreatepayment createpayment createpayment createpayment createpayment createpayment set_value createpayment createpayment get create payment public string get create payment return string get value create payment getcreatepayment get_value createpayment set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set eft amount electronic funds transfer amount public void set eft amt big decimal eft amt set value eft amt eft amt seteftamt bigdecimal eftamt set_value eftamt eftamt get eft amount electronic funds transfer amount public big decimal get eft amt big decimal bd big decimal get value eft amt if bd null return env zero return bd bigdecimal geteftamt bigdecimal bigdecimal get_value eftamt set eft check no electronic funds transfer check no public void set eft check no string eft check no if eft check no null eft check no length 20 log warning length 20 truncated eft check no eft check no substring 0 19 set value eft check no eft check no seteftcheckno eftcheckno eftcheckno eftcheckno eftcheckno eftcheckno set_value eftcheckno eftcheckno get eft check no electronic funds transfer check no public string get eft check no return string get value eft check no geteftcheckno get_value eftcheckno set eft currency electronic funds transfer currency public void set eft currency string eft currency if eft currency null eft currency length 20 log warning length 20 truncated eft currency eft currency substring 0 19 set value eft currency eft currency seteftcurrency eftcurrency eftcurrency eftcurrency eftcurrency eftcurrency set_value eftcurrency eftcurrency get eft currency electronic funds transfer currency public string get eft currency return string get value eft currency geteftcurrency get_value eftcurrency set eft memo electronic funds transfer memo public void set eft memo string eft memo if eft memo null eft memo length 2000 log warning length 2000 truncated eft memo eft memo substring 0 1999 set value eft memo eft memo seteftmemo eftmemo eftmemo eftmemo eftmemo eftmemo set_value eftmemo eftmemo get eft memo electronic funds transfer memo public string get eft memo return string get value eft memo geteftmemo get_value eftmemo set eft payee electronic funds transfer payee information public void set eft payee string eft payee if eft payee null eft payee length 255 log warning length 255 truncated eft payee eft payee substring 0 254 set value eft payee eft payee seteftpayee eftpayee eftpayee eftpayee eftpayee eftpayee set_value eftpayee eftpayee get eft payee electronic funds transfer payee information public string get eft payee return string get value eft payee geteftpayee get_value eftpayee set eft payee account electronic funds transfer payyee account information public void set eft payee account string eft payee account if eft payee account null eft payee account length 40 log warning length 40 truncated eft payee account eft payee account substring 0 39 set value eft payee account eft payee account seteftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount set_value eftpayeeaccount eftpayeeaccount get eft payee account electronic funds transfer payyee account information public string get eft payee account return string get value eft payee account geteftpayeeaccount get_value eftpayeeaccount set eft reference electronic funds transfer reference public void set eft reference string eft reference if eft reference null eft reference length 60 log warning length 60 truncated eft reference eft reference substring 0 59 set value eft reference eft reference seteftreference eftreference eftreference eftreference eftreference eftreference set_value eftreference eftreference get eft reference electronic funds transfer reference public string get eft reference return string get value eft reference geteftreference get_value eftreference set eft statement line date electronic funds transfer statement line date public void set eft statement line date timestamp eft statement line date set value eft statement line date eft statement line date seteftstatementlinedate eftstatementlinedate set_value eftstatementlinedate eftstatementlinedate get eft statement line date electronic funds transfer statement line date public timestamp get eft statement line date return timestamp get value eft statement line date geteftstatementlinedate get_value eftstatementlinedate set eft trx id electronic funds transfer transaction id public void set eft trxid string eft trxid if eft trxid null eft trxid length 40 log warning length 40 truncated eft trxid eft trxid substring 0 39 set value eft trxid eft trxid setefttrxid efttrxid efttrxid efttrxid efttrxid efttrxid set_value efttrxid efttrxid get eft trx id electronic funds transfer transaction id public string get eft trxid return string get value eft trxid getefttrxid get_value efttrxid set eft trx type electronic funds transfer transaction type public void set eft trx type string eft trx type if eft trx type null eft trx type length 20 log warning length 20 truncated eft trx type eft trx type substring 0 19 set value eft trx type eft trx type setefttrxtype efttrxtype efttrxtype efttrxtype efttrxtype efttrxtype set_value efttrxtype efttrxtype get eft trx type electronic funds transfer transaction type public string get eft trx type return string get value eft trx type getefttrxtype get_value efttrxtype set eft effective date electronic funds transfer valuta effective date public void set eft valuta date timestamp eft valuta date set value eft valuta date eft valuta date seteftvalutadate eftvalutadate set_value eftvalutadate eftvalutadate get eft effective date electronic funds transfer valuta effective date public timestamp get eft valuta date return timestamp get value eft valuta date geteftvalutadate get_value eftvalutadate set interest amount interest amount public void set interest amt big decimal interest amt if interest amt null throw new illegal argument exception interest amt is mandatory set value interest amt interest amt setinterestamt bigdecimal interestamt interestamt illegalargumentexception interestamt set_value interestamt interestamt get interest amount interest amount public big decimal get interest amt big decimal bd big decimal get value interest amt if bd null return env zero return bd bigdecimal getinterestamt bigdecimal bigdecimal get_value interestamt set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set reversal this is a reversing transaction public void set is reversal boolean is reversal set value is reversal new boolean is reversal setisreversal isreversal set_value isreversal isreversal get reversal this is a reversing transaction public boolean is reversal object oo get value is reversal if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreversal get_value isreversal booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set match statement public void set match statement string match statement if match statement null match statement length 1 log warning length 1 truncated match statement match statement substring 0 0 set value match statement match statement setmatchstatement matchstatement matchstatement matchstatement matchstatement matchstatement set_value matchstatement matchstatement get match statement public string get match statement return string get value match statement getmatchstatement get_value matchstatement set memo memo text public void set memo string memo if memo null memo length 255 log warning length 255 truncated memo memo substring 0 254 set value memo memo setmemo set_value get memo memo text public string get memo return string get value memo getmemo get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set reference no your customer or vendor number at the business partner s site public void set reference no string reference no if reference no null reference no length 40 log warning length 40 truncated reference no reference no substring 0 39 set value reference no reference no setreferenceno referenceno referenceno referenceno referenceno referenceno set_value referenceno referenceno get reference no your customer or vendor number at the business partner s site public string get reference no return string get value reference no getreferenceno get_value referenceno set statement line date date of the statement line public void set statement line date timestamp statement line date if statement line date null throw new illegal argument exception statement line date is mandatory set value statement line date statement line date setstatementlinedate statementlinedate statementlinedate illegalargumentexception statementlinedate set_value statementlinedate statementlinedate get statement line date date of the statement line public timestamp get statement line date return timestamp get value statement line date getstatementlinedate get_value statementlinedate set statement amount statement amount public void set stmt amt big decimal stmt amt if stmt amt null throw new illegal argument exception stmt amt is mandatory set value stmt amt stmt amt setstmtamt bigdecimal stmtamt stmtamt illegalargumentexception stmtamt set_value stmtamt stmtamt get statement amount statement amount public big decimal get stmt amt big decimal bd big decimal get value stmt amt if bd null return env zero return bd bigdecimal getstmtamt bigdecimal bigdecimal get_value stmtamt set transaction amount amount of a transaction public void set trx amt big decimal trx amt if trx amt null throw new illegal argument exception trx amt is mandatory set value trx amt trx amt settrxamt bigdecimal trxamt trxamt illegalargumentexception trxamt set_value trxamt trxamt get transaction amount amount of a transaction public big decimal get trx amt big decimal bd big decimal get value trx amt if bd null return env zero return bd bigdecimal gettrxamt bigdecimal bigdecimal get_value trxamt set effective date date when money is available public void set valuta date timestamp valuta date if valuta date null throw new illegal argument exception valuta date is mandatory set value valuta date valuta date setvalutadate valutadate valutadate illegalargumentexception valutadate set_value valutadate valutadate get effective date date when money is available public timestamp get valuta date return timestamp get value valuta date getvalutadate get_value valutadate standard constructor public x c invoicepayschedule properties ctx int c invoicepayschedule id string trx name super ctx c invoicepayschedule id trx name if c invoicepayschedule id 0 setc invoicepayschedule id 0 setc invoice id 0 set discount amt env zero set discount date new timestamp system current time millis set due amt env zero set due date new timestamp system current time millis set is valid false set processed false x_c_invoicepayschedule c_invoicepayschedule_id trxname c_invoicepayschedule_id trxname c_invoicepayschedule_id setc_invoicepayschedule_id setc_invoice_id setdiscountamt setdiscountdate currenttimemillis setdueamt setduedate currenttimemillis setisvalid setprocessed load constructor public x c invoicepayschedule properties ctx result set rs string trx name super ctx rs trx name x_c_invoicepayschedule resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoicepayschedule append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoicepayschedule get_id tostring set invoice payment schedule invoice payment schedule public void setc invoicepayschedule id int c invoicepayschedule id if c invoicepayschedule id 1 throw new illegal argument exception c invoicepayschedule id is mandatory set valuenocheck c invoicepayschedule id new integer c invoicepayschedule id setc_invoicepayschedule_id c_invoicepayschedule_id c_invoicepayschedule_id illegalargumentexception c_invoicepayschedule_id set_valuenocheck c_invoicepayschedule_id c_invoicepayschedule_id get invoice payment schedule invoice payment schedule public int getc invoicepayschedule id integer ii integer get value c invoicepayschedule id if ii null return 0 return ii int value getc_invoicepayschedule_id get_value c_invoicepayschedule_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set payment schedule payment schedule template public void setc payschedule id int c payschedule id if c payschedule id 0 set valuenocheck c payschedule id null else set valuenocheck c payschedule id new integer c payschedule id setc_payschedule_id c_payschedule_id c_payschedule_id set_valuenocheck c_payschedule_id set_valuenocheck c_payschedule_id c_payschedule_id get payment schedule payment schedule template public int getc payschedule id integer ii integer get value c payschedule id if ii null return 0 return ii int value getc_payschedule_id get_value c_payschedule_id intvalue set discount amount calculated amount of discount public void set discount amt big decimal discount amt if discount amt null throw new illegal argument exception discount amt is mandatory set value discount amt discount amt setdiscountamt bigdecimal discountamt discountamt illegalargumentexception discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set discount date last date for payments with discount public void set discount date timestamp discount date if discount date null throw new illegal argument exception discount date is mandatory set value discount date discount date setdiscountdate discountdate discountdate illegalargumentexception discountdate set_value discountdate discountdate get discount date last date for payments with discount public timestamp get discount date return timestamp get value discount date getdiscountdate get_value discountdate return timestamp get value discount date public key name pair get key name pair return new key name pair get id string value of get discount date get_value discountdate keynamepair getkeynamepair keynamepair get_id valueof getdiscountdate set amount due amount of the payment due public void set due amt big decimal due amt if due amt null throw new illegal argument exception due amt is mandatory set value due amt due amt setdueamt bigdecimal dueamt dueamt illegalargumentexception dueamt set_value dueamt dueamt get amount due amount of the payment due public big decimal get due amt big decimal bd big decimal get value due amt if bd null return env zero return bd bigdecimal getdueamt bigdecimal bigdecimal get_value dueamt set due date date when the payment is due public void set due date timestamp due date if due date null throw new illegal argument exception due date is mandatory set value due date due date setduedate duedate duedate illegalargumentexception duedate set_value duedate duedate get due date date when the payment is due public timestamp get due date return timestamp get value due date getduedate get_value duedate set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue get bank statement matcher algorithms return matchers public static m bank statement matcher get matchers properties ctx string trx name array list m bank statement matcher list new array list m bank statement matcher string sql m role get default ctx false add accesssql select from c bankstatementmatcher order by seq no c bankstatementmatcher m role sql notqualified m role sql ro int ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql trx name result set rs pstmt execute query while rs next list add new m bank statement matcher ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert m bank statement matcher ret value new m bank statement matcher list size list to array ret value return ret value mbankstatementmatcher getmatchers trxname arraylist mbankstatementmatcher arraylist mbankstatementmatcher mrole getdefault addaccesssql c_bankstatementmatcher seqno c_bankstatementmatcher mrole sql_notqualified mrole sql_ro ad_client_id getad_client_id preparedstatement preparestatement trxname resultset executequery mbankstatementmatcher trxname s_log mbankstatementmatcher retvalue mbankstatementmatcher toarray retvalue retvalue standard constructor param ctx context param c bankstatementmatcher id id public m bank statement matcher properties ctx int c bankstatementmatcher id string trx name super ctx c bankstatementmatcher id trx name c_bankstatementmatcher_id mbankstatementmatcher c_bankstatementmatcher_id trxname c_bankstatementmatcher_id trxname load constructor param ctx context param rs result set public m bank statement matcher properties ctx result set rs string trx name super ctx rs trx name mbankstatementmatcher resultset trxname trxname is matcher valid return true if valid public boolean is matcher valid if m matchervalid null get matcher return m matchervalid boolean value ismatchervalid m_matchervalid getmatcher m_matchervalid booleanvalue get matcher return matcher instance public bank statement matcher interface get matcher if m matcher null m matchervalid null m matchervalid boolean value return m matcher string class name get classname if class name null class name length 0 return null try class matcher class class for name class name m matcher bank statement matcher interface matcher class new instance m matchervalid boolean true catch exception e log log level severe class name e m matcher null m matchervalid boolean false return m matcher bankstatementmatcherinterface getmatcher m_matcher m_matchervalid m_matchervalid booleanvalue m_matcher classname getclassname classname classname matcherclass forname classname m_matcher bankstatementmatcherinterface matcherclass newinstance m_matchervalid classname m_matcher m_matchervalid m_matcher initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception test init servletconfig servletexception webenv initweb servletexception process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create get request test web util create response request response this null doc true doget httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create post request test web util create response request response this null doc true dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse get m rfq line from cache param ctx context param c rfqline id id return m rfq line public static m rfq line get properties ctx int c rfqline id string trx name integer key new integer c rfqline id m rfq line ret value m rfq line s cache get key if ret value null return ret value ret value new m rfq line ctx c rfqline id trx name if ret value get id 0 s cache put key ret value return ret value mrfqline c_rfqline_id mrfqline mrfqline c_rfqline_id trxname c_rfqline_id mrfqline retvalue mrfqline s_cache retvalue retvalue retvalue mrfqline c_rfqline_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c rfqline id id public m rfq line properties ctx int c rfqline id string trx name super ctx c rfqline id trx name if c rfqline id 0 set line 0 c_rfqline_id mrfqline c_rfqline_id trxname c_rfqline_id trxname c_rfqline_id setline load constructor param ctx context param rs result set public m rfq line properties ctx result set rs string trx name super ctx rs trx name if get id 0 s cache put new integer get id this mrfqline resultset trxname trxname get_id s_cache get_id parent constructor param rfq rfq public m rfq line m rfq rfq this rfq get ctx 0 rfq get trxname set client org rfq setc rfq id rfq getc rfq id mrfqline mrfq getctx get_trxname setclientorg setc_rfq_id getc_rfq_id get quantities return array of quantities public m rfq line qty get qtys return get qtys false mrfqlineqty getqtys getqtys get quantities param requery requery return array of quantities public m rfq line qty get qtys boolean requery if m qtys null requery return m qtys array list m rfq line qty list new array list m rfq line qty string sql select from c rfqlineqty where c rfqline id and is active y order by qty prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfqline id result set rs pstmt execute query while rs next list add new m rfq line qty get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null create default 1 if list size 0 m rfq line qty qty new m rfq line qty this qty save list add qty m qtys new m rfq line qty list size list to array m qtys return m qtys mrfqlineqty getqtys m_qtys m_qtys arraylist mrfqlineqty arraylist mrfqlineqty c_rfqlineqty c_rfqline_id isactive preparedstatement preparestatement get_trxname setint getc_rfqline_id resultset executequery mrfqlineqty getctx get_trxname mrfqlineqty mrfqlineqty m_qtys mrfqlineqty toarray m_qtys m_qtys get product details return product name etc public string get product detailhtml if getm product id 0 return string buffer sb new string buffer m product product m product get get ctx getm product id sb append product get name if product get description null product get description length 0 sb append br i append product get description append i return sb to string getproductdetailhtml getm_product_id stringbuffer stringbuffer mproduct mproduct getctx getm_product_id getname getdescription getdescription getdescription tostring string representation return info public string to string string buffer sb new string buffer m rfq line sb append get id append append get line append return sb to string tostring stringbuffer stringbuffer mrfqline get_id getline tostring before save param new record new return true protected boolean before save boolean new record calculate complete date also used to verify if get date work start null get delivery days 0 set date work complete time util add days get date work start get delivery days calculate delivery days else if get date work start null get delivery days 0 get date work complete null set delivery days time util get days between get date work start get date work complete calculate start date else if get date work start null get delivery days 0 get date work complete null set date work start time util add days get date work complete get delivery days 1 return true newrecord beforesave newrecord getdateworkstart getdeliverydays setdateworkcomplete timeutil adddays getdateworkstart getdeliverydays getdateworkstart getdeliverydays getdateworkcomplete setdeliverydays timeutil getdaysbetween getdateworkstart getdateworkcomplete getdateworkstart getdeliverydays getdateworkcomplete setdateworkstart timeutil adddays getdateworkcomplete getdeliverydays pay fow pro constructor public pp payflowpro super m pp new pf proapi string path ini get compiere home file separator lib needs certification file not dustributed file file new file path f73e89fd 0 if file exists log log level severe no cert file file get absolute path m pp set cert path path payfowpro pp_payflowpro m_pp pfproapi getcompierehome getabsolutepath m_pp setcertpath get version return version public string get version return pay flow pro m pp version getversion payflowpro m_pp process credit card no date check return true if processed successfully throws illegal argument exception public boolean processcc throws illegal argument exception log fine p mpp get host address p mpp get host port timeout get timeout proxy p mpp get proxy address p mpp get proxy port p mpp get proxy logon p mpp get proxy password string buffer param new string buffer transaction type if p mp get trx type equals m payment trxtype sales param append trxtype append p mp get trx type else throw new illegal argument exception pp payflowpro trx type not supported p mp get trx type mandatory fields param append tender c credit card append acct append m payment validate check numeric p mp get credit card number credit card no param append expdate exp no string month string value of p mp get credit card expmm if month length 1 param append 0 param append month int expyy p mp get credit card expyy if expyy 2000 expyy 2000 string year string value of expyy if year length 1 param append 0 param append year param append amt append p mp get pay amt amount optional control fields auth code orig id param append create pair authcode p mp get voice auth code 6 param append create pair origid p mp getorig trxid 12 pnref returned cvv param append create pair cvv2 p mp get credit cardvv 4 param append create pair swipe p mp getxxx 80 track 1 2 address param append create pair name p mp geta name 30 param append create pair street p mp geta street 30 street param append create pair zip p mp geta zip 9 zip 5 9 city 20 state 2 param append create pair email p mp geta email 64 e mail amex fields desc shiptozip taxamt param append create pair desc p mp getxxx 23 description param append create pair shiptozip p mp geta zip 6 zip 6 param append create pair taxamt p mp get tax amt 10 tax invoice no param append create pair invnum p mp getc invoice id 9 comment1 2 param append create pair comment1 p mp getc payment id 128 comment param append create pair comment2 p mp getc bpartner id 128 comment2 return process param to string creditcard illegalargumentexception illegalargumentexception p_mpp gethostaddress p_mpp gethostport gettimeout p_mpp getproxyaddress p_mpp getproxyport p_mpp getproxylogon p_mpp getproxypassword stringbuffer stringbuffer p_mp gettrxtype mpayment trxtype_sales p_mp gettrxtype illegalargumentexception pp_payflowpro trxtype p_mp gettrxtype creditcard mpaymentvalidate checknumeric p_mp getcreditcardnumber creditcard expno valueof p_mp getcreditcardexpmm p_mp getcreditcardexpyy valueof p_mp getpayamt authcode createpair p_mp getvoiceauthcode createpair p_mp getorig_trxid createpair p_mp getcreditcardvv createpair p_mp createpair p_mp geta_name createpair p_mp geta_street createpair p_mp geta_zip createpair p_mp geta_email email createpair p_mp createpair p_mp geta_zip createpair p_mp gettaxamt createpair p_mp getc_invoice_id createpair p_mp getc_payment_id createpair p_mp getc_bpartner_id tostring process transaction param parameter command string return true if processed successfully public boolean process string parameter long start system current time millis string buffer param new string buffer parameter usr pwd param append partner append p mpp get partnerid append vendor append p mpp get vendorid append user append p mpp get userid append pwd append p mpp get password log fine param to string call the pay flow pro client int rc m pp create context p mpp get host address p mpp get host port get timeout p mpp get proxy address p mpp get proxy port p mpp get proxy logon p mpp get proxy password string response m pp submit transaction param to string m pp destroy context long ms system current time millis start log fine ms ms rc response p mp setr result p mp setr info response complete info result 1 pnref pn0001480030 respmsg invalid user authentication result 0 pnref p60501480167 respmsg approved authcode 010101 avsaddr x avszip x result 31 respmsg the certificate chain did not validate no local certificate found javax net ssl ssl exception cert path c adempiere lib working directory c compiere compiere all2 client temp string tokenizer st new string tokenizer response false while st has more tokens string token st next token int pos token index of string name token substring 0 pos string value token substring pos 1 if name equals result p mp setr result value m ok result ok equals value else if name equals pnref p mp setr pnref value else if name equals respmsg p mp setr respmsg value else if name equals authcode p mp setr authcode value else if name equals avsaddr p mp setr avsaddr value else if name equals avszip p mp setr avszip value else if name equals iavs n ysa y international else if name equals cvv2match y n x not supported else log log level severe response unknown token probelms with rc e g 0 with result 24 return m ok currenttimemillis stringbuffer stringbuffer p_mpp getpartnerid p_mpp getvendorid p_mpp getuserid p_mpp getpassword tostring payflowpro m_pp createcontext p_mpp gethostaddress p_mpp gethostport gettimeout p_mpp getproxyaddress p_mpp getproxyport p_mpp getproxylogon p_mpp getproxypassword m_pp submittransaction tostring m_pp destroycontext currenttimemillis p_mp setr_result p_mp setr_info sslexception stringtokenizer stringtokenizer hasmoretokens nexttoken indexof p_mp setr_result m_ok result_ok p_mp setr_pnref p_mp setr_respmsg p_mp setr_authcode p_mp setr_avsaddr p_mp setr_avszip m_ok payment is procesed successfully return true if ok public boolean is processedok return m ok isprocessedok m_ok constructor started from a panel get number of options is used to determine to show the dialog param window no window no param m tab tab param record id record id param button button public v doc action int window no m tab m tab v button button int record id super env get window window no msg translate env get ctx doc action true log config m windowno window no m mtab m tab try jb init catch exception ex log log level severe ex dynamic init preparation m ad table id env get context as int env get ctx window no basetable id if s value null read reference dyn init record id a env position center window env get window window no this apanel getnumberofoptions windowno mtab record_id vdocaction windowno mtab mtab vbutton record_id getwindow windowno getctx docaction m_windowno windowno m_mtab mtab jbinit m_ad_table_id getcontextasint getctx windowno basetable_id s_value readreference dyninit record_id aenv positioncenterwindow getwindow windowno static init throws exception void jb init throws exception main panel set layout main layout action label set text msg translate env get ctx doc action action combo add action listener this message set line wrap true message set preferred size new dimension 350 35 message set wrap style word true message set background compiereplaf getfieldbackground inactive message set editable false north panel set layout north layout north layout set alignment flow layout right get content pane add main panel main panel add north panel border layout north north panel add action label null north panel add action combo null main panel add center pane border layout center center pane get viewport add message null main panel add confirm panel border layout south confirm panel add action listener this jbinit mainpanel setlayout mainlayout actionlabel settext getctx docaction actioncombo addactionlistener setlinewrap setpreferredsize setwrapstyleword setbackground getfieldbackground_inactive seteditable northpanel setlayout northlayout northlayout setalignment flowlayout getcontentpane mainpanel mainpanel northpanel borderlayout northpanel actionlabel northpanel actioncombo mainpanel centerpane borderlayout centerpane getviewport mainpanel confirmpanel borderlayout confirmpanel addactionlistener dynamic init determine valid doc actions based on doc status for the different documents pre doc status 131 unknown ap approved ch changed cl closed co completed dr drafted in inactive na not approved pe posting error po posted pr printed re reversed te transfer error tr transferred vo voided xx being processed doc action 135 none ap approve cl close co complete po post pr print ra reverse accrual rc reverse correction re re activate rj reject tr transfer vo void xl unlock pre param record id id private void dyn init int record id string doc status string m mtab get value doc status string doc action string m mtab get value doc action object processing m mtab get value processing string order type env get context env get ctx m windowno order type string isso trx env get context env get ctx m windowno isso trx if doc status null message set text error return log fine doc status doc status doc action doc action order type order type isso trx isso trx processing processing ad table id m ad table id record id record id string options new string s value length int index 0 check existence of workflow acrivities string wf status mwf activity get active info env get ctx m ad table id record id if wf status null a dialog error m windowno this wf active for record wf status return status change if check status m mtab get table name record id doc status a dialog error m windowno this document status changed return general actions locked if processing null boolean locked y equals processing if locked processing instanceof boolean locked boolean processing boolean value if locked options index document engine action unlock approval required na if doc status equals document engine status notapproved options index document engine action prepare options index document engine action void draft invalid dr in else if doc status equals document engine status drafted doc status equals document engine status invalid options index document engine action complete options index document engine action prepare options index document engine action void in process ip else if doc status equals document engine status inprogress doc status equals document engine status approved options index document engine action complete options index document engine action void complete co else if doc status equals document engine status completed options index document engine action close waiting payment else if doc status equals document engine status waitingpayment doc status equals document engine status waitingconfirmation options index document engine action void options index document engine action prepare closed voided r eversed cl vo re else if doc status equals document engine status closed doc status equals document engine status voided doc status equals document engine status reversed return order if m ad table id m order table id draft dr ip in if doc status equals document engine status drafted doc status equals document engine status inprogress doc status equals document engine status invalid options index document engine action prepare options index document engine action close draft sales order quote proposal process if y equals isso trx ob equals order type on equals order type doc action document engine action prepare complete co else if doc status equals document engine status completed options index document engine action void options index document engine action reactivate else if doc status equals document engine status waitingpayment options index document engine action reactivate options index document engine action close shipment else if m ad table id m in out table id complete co if doc status equals document engine status completed options index document engine action void options index document engine action reverse correct invoice else if m ad table id m invoice table id complete co if doc status equals document engine status completed options index document engine action void options index document engine action reverse correct payment else if m ad table id m payment table id complete co if doc status equals document engine status completed options index document engine action void options index document engine action reverse correct gl journal else if m ad table id m journal table id m ad table id m journal batch table id complete co if doc status equals document engine status completed options index document engine action reverse correct options index document engine action reverse accrual allocation else if m ad table id m allocation hdr table id complete co if doc status equals document engine status completed options index document engine action void options index document engine action reverse correct bank statement else if m ad table id m bank statement table id complete co if doc status equals document engine status completed options index document engine action void inventory movement physical inventory else if m ad table id m movement table id m ad table id m inventory table id complete co if doc status equals document engine status completed options index document engine action void options index document engine action reverse correct fill action combo for int i 0 i index i serach for option and add it boolean added false for int j 0 j s value length added j if options i equals s value j action combo add item s name j added true set default if doc action equals if none suggest closing doc action document engine action close string defaultv for int i 0 i s value length defaultv equals i if doc action equals s value i defaultv s name i if defaultv equals action combo set selected item defaultv docactions docstatus docstatus docaction record_id dyninit record_id docstatus m_mtab getvalue docstatus docaction m_mtab getvalue docaction m_mtab getvalue ordertype getcontext getctx m_windowno ordertype issotrx getcontext getctx m_windowno issotrx docstatus settext docstatus docstatus docaction docaction ordertype ordertype issotrx issotrx ad_table_id m_ad_table_id record_id record_id s_value wfstatus mwfactivity getactiveinfo getctx m_ad_table_id record_id wfstatus adialog m_windowno wfactiveforrecord wfstatus checkstatus m_mtab gettablename record_id docstatus adialog m_windowno documentstatuschanged booleanvalue documentengine action_unlock docstatus documentengine status_notapproved documentengine action_prepare documentengine action_void docstatus documentengine status_drafted docstatus documentengine status_invalid documentengine action_complete documentengine action_prepare documentengine action_void docstatus documentengine status_inprogress docstatus documentengine status_approved documentengine action_complete documentengine action_void docstatus documentengine status_completed documentengine action_close docstatus documentengine status_waitingpayment docstatus documentengine status_waitingconfirmation documentengine action_void documentengine action_prepare reversed docstatus documentengine status_closed docstatus documentengine status_voided docstatus documentengine status_reversed m_ad_table_id morder table_id docstatus documentengine status_drafted docstatus documentengine status_inprogress docstatus documentengine status_invalid documentengine action_prepare documentengine action_close issotrx ordertype ordertype docaction documentengine action_prepare docstatus documentengine status_completed documentengine action_void documentengine action_reactivate docstatus documentengine status_waitingpayment documentengine action_reactivate documentengine action_close m_ad_table_id minout table_id docstatus documentengine status_completed documentengine action_void documentengine action_reverse_correct m_ad_table_id minvoice table_id docstatus documentengine status_completed documentengine action_void documentengine action_reverse_correct m_ad_table_id mpayment table_id docstatus documentengine status_completed documentengine action_void documentengine action_reverse_correct m_ad_table_id mjournal table_id m_ad_table_id mjournalbatch table_id docstatus documentengine status_completed documentengine action_reverse_correct documentengine action_reverse_accrual m_ad_table_id mallocationhdr table_id docstatus documentengine status_completed documentengine action_void documentengine action_reverse_correct m_ad_table_id mbankstatement table_id docstatus documentengine status_completed documentengine action_void m_ad_table_id mmovement table_id m_ad_table_id minventory table_id docstatus documentengine status_completed documentengine action_void documentengine action_reverse_correct actioncombo s_value s_value actioncombo additem s_name setdefault docaction docaction documentengine action_close s_value docaction s_value s_name actioncombo setselecteditem check status change param table name table name param record id record param doc status current doc status return true if status not changed private boolean check status string table name int record id string doc status string sql select 2 from table name where table name id record id and doc status doc status int result db getsql value null sql return result 2 tablename record_id docstatus checkstatus tablename record_id docstatus tablename tablename _id record_id docstatus docstatus getsqlvalue number of options available to decide to display it return item count public int get number of options return action combo get item count getnumberofoptions actioncombo getitemcount should the process be started return ok pressed public boolean get start process return m okpressed getstartprocess m_okpressed fill vector with doc action ref list 135 values private void read reference string sql if env is base language env get ctx ad ref list sql select value name description from ad ref list where ad reference id 135 order by name else sql select l value t name t description from ad ref list l ad ref list trl t where l ad ref list id t ad ref list id and t ad language env getad language env get ctx and l ad reference id 135 order by t name array list string v value new array list string array list string v name new array list string array list string v description new array list string try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next string value rs get string 1 string name rs get string 2 string description rs get string 3 if description null description v value add value v name add name v description add description rs close pstmt close catch sql exception e log log level severe sql e convert to arrays int size v value size s value new string size s name new string size s description new string size for int i 0 i size i s value i string v value get i s name i string v name get i s description i string v description get i docaction ref_list readreference isbaselanguage getctx ad_ref_list ad_ref_list ad_reference_id ad_ref_list ad_ref_list_trl ad_ref_list_id ad_ref_list_id ad_language getad_language getctx ad_reference_id arraylist v_value arraylist arraylist v_name arraylist arraylist v_description arraylist preparedstatement preparestatement resultset executequery getstring getstring getstring v_value v_name v_description sqlexception v_value s_value s_name s_description s_value v_value s_name v_name s_description v_description action listener param e event public void action performed action event e if e get action command equals confirm panel a ok if save dispose m okpressed true return else if e get action command equals confirm panel a cancel dispose return else if e get source action combo return action combo display the description for the selection int index get selected index display descriprion if index 1 message set text s description index log finer doc action s name index s value index actionlistener actionperformed actionevent getactioncommand confirmpanel a_ok m_okpressed getactioncommand confirmpanel a_cancel getsource actioncombo actioncombo getselectedindex settext s_description docaction s_name s_value get index of selected choice return index or a private int get selected index int index 1 get selection string sel string action combo get selected item if sel null return index find it in vector for int i 0 i s name length index 1 i if sel equals s name i index i return index getselectedindex actioncombo getselecteditem s_name s_name save to database return true if saved to tab private boolean save int index get selected index if index 1 return false save selection log config doc action s value index m mtab set value doc action s value index return true getselectedindex docaction s_value m_mtab setvalue docaction s_value get from cache param ctx context param m warehouse id id return warehouse public static m warehouse get properties ctx int m warehouse id integer key new integer m warehouse id m warehouse ret value m warehouse s cache get key if ret value null return ret value ret value new m warehouse ctx m warehouse id null s cache put key ret value return ret value m_warehouse_id mwarehouse m_warehouse_id m_warehouse_id mwarehouse retvalue mwarehouse s_cache retvalue retvalue retvalue mwarehouse m_warehouse_id s_cache retvalue retvalue get warehouses for org param ctx context param ad org id id return warehouse public static m warehouse get for org properties ctx int ad org id array list m warehouse list new array list m warehouse string sql select from m warehouse where ad org id order by created prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad org id result set rs pstmt execute query while rs next list add new m warehouse ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m warehouse ret value new m warehouse list size list to array ret value return ret value ad_org_id mwarehouse getfororg ad_org_id arraylist mwarehouse arraylist mwarehouse m_warehouse ad_org_id preparedstatement preparestatement setint ad_org_id resultset executequery mwarehouse s_log mwarehouse retvalue mwarehouse toarray retvalue retvalue standard constructor param ctx context param m warehouse id id public m warehouse properties ctx int m warehouse id string trx name super ctx m warehouse id trx name if m warehouse id 0 set value null set name null setc location id 0 set separator m_warehouse_id mwarehouse m_warehouse_id trxname m_warehouse_id trxname m_warehouse_id setvalue setname setc_location_id setseparator load constructor param ctx context param rs result set public m warehouse properties ctx result set rs string trx name super ctx rs trx name mwarehouse resultset trxname trxname organization constructor param org parent public m warehouse m org org this org get ctx 0 org get trxname set client org org set value org get value set name org get name if org get info null setc location id org get info getc location id mwarehouse morg getctx get_trxname setclientorg setvalue getvalue setname getname getinfo setc_location_id getinfo getc_location_id get locators param reload if true reload return array of locators public m locator get locators boolean reload if reload m locators null return m locators string sql select from m locator where m warehouse id order by x y z array list m locator list new array list m locator prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm warehouse id result set rs pstmt execute query while rs next list add new m locator get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m locators new m locator list size list to array m locators return m locators mlocator getlocators m_locators m_locators m_locator m_warehouse_id arraylist mlocator arraylist mlocator preparedstatement preparestatement setint getm_warehouse_id resultset executequery mlocator getctx m_locators mlocator toarray m_locators m_locators get default locator return first default locator public m locator get default locator m locator locators get locators false for int i 0 i locators length i if locators i is default locators i is active return locators i no default first one if locators length 0 log warning no default locator for get name return locators 0 no locator create one m locator loc new m locator this standard loc set is default true loc save log info created default locator for get name return loc mlocator getdefaultlocator mlocator getlocators isdefault isactive getname mlocator mlocator setisdefault getname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting m warehouse acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting m_warehouse_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting m warehouse acct beforedelete delete_accounting m_warehouse_acct standard constructor public x s resourceassignment properties ctx int s resourceassignment id string trx name super ctx s resourceassignment id trx name if s resourceassignment id 0 set assign date from new timestamp system current time millis set is confirmed false set name null sets resourceassignment id 0 sets resource id 0 x_s_resourceassignment s_resourceassignment_id trxname s_resourceassignment_id trxname s_resourceassignment_id setassigndatefrom currenttimemillis setisconfirmed setname sets_resourceassignment_id sets_resource_id load constructor public x s resourceassignment properties ctx result set rs string trx name super ctx rs trx name x_s_resourceassignment resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s resourceassignment append get id append return sb to string tostring stringbuffer stringbuffer x_s_resourceassignment get_id tostring set assign from assign resource from public void set assign date from timestamp assign date from if assign date from null throw new illegal argument exception assign date from is mandatory set valuenocheck assign date from assign date from setassigndatefrom assigndatefrom assigndatefrom illegalargumentexception assigndatefrom set_valuenocheck assigndatefrom assigndatefrom get assign from assign resource from public timestamp get assign date from return timestamp get value assign date from getassigndatefrom get_value assigndatefrom set assign to assign resource until public void set assign date to timestamp assign date to set valuenocheck assign date to assign date to setassigndateto assigndateto set_valuenocheck assigndateto assigndateto get assign to assign resource until public timestamp get assign date to return timestamp get value assign date to getassigndateto get_value assigndateto set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set confirmed assignment is confirmed public void set is confirmed boolean is confirmed set valuenocheck is confirmed new boolean is confirmed setisconfirmed isconfirmed set_valuenocheck isconfirmed isconfirmed get confirmed assignment is confirmed public boolean is confirmed object oo get value is confirmed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isconfirmed get_value isconfirmed booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set quantity quantity public void set qty big decimal qty set valuenocheck qty qty setqty bigdecimal set_valuenocheck get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set resource assignment resource assignment public void sets resourceassignment id int s resourceassignment id if s resourceassignment id 1 throw new illegal argument exception s resourceassignment id is mandatory set valuenocheck s resourceassignment id new integer s resourceassignment id sets_resourceassignment_id s_resourceassignment_id s_resourceassignment_id illegalargumentexception s_resourceassignment_id set_valuenocheck s_resourceassignment_id s_resourceassignment_id get resource assignment resource assignment public int gets resourceassignment id integer ii integer get value s resourceassignment id if ii null return 0 return ii int value gets_resourceassignment_id get_value s_resourceassignment_id intvalue set resource resource public void sets resource id int s resource id if s resource id 1 throw new illegal argument exception s resource id is mandatory set valuenocheck s resource id new integer s resource id sets_resource_id s_resource_id s_resource_id illegalargumentexception s_resource_id set_valuenocheck s_resource_id s_resource_id get resource resource public int gets resource id integer ii integer get value s resource id if ii null return 0 return ii int value gets_resource_id get_value s_resource_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of gets resource id intvalue keynamepair getkeynamepair keynamepair get_id valueof gets_resource_id constructor param file name key store file name param password same password for key store and certificate public key store mgt string file name char password log info file name m file new file file name m password password filename keystoremgt filename filename m_file filename m_password verify create key store return null or error message public string verify j frame parent key store ks null try ks get key store catch exception e log log level severe get key store e return e get message no key store if ks null create certificate certificate alias parent try ks get key store catch exception e log log level severe new key store e return e get message new key store no key store if ks null return no key store verify certificate certificate cert null try cert get certificate certificate alias catch exception e log log level severe certificate e return e get message if cert null return no certificate found return null ok jframe keystore getkeystore keystore getmessage keystore createcertificate certificate_alias getkeystore keystore getmessage keystore getcertificate certificate_alias getmessage get key store return key store or null public key store get key store throws exception try m keystore key store get instance jks catch exception e log log level severe instance e load existing if m file exists log fine m file to string input stream is null try is new file input stream m file catch exception e log log level severe load e return null m keystore load is m password else return null does not exist log fine provider m keystore get provider type m keystore get type return m keystore keystore keystore keystore getkeystore m_keystore keystore getinstance m_file m_file tostring inputstream fileinputstream m_file m_keystore m_password m_keystore getprovider m_keystore gettype m_keystore get certificate param alias alias return certificate or null public certificate get certificate string alias throws exception log config alias alias date date m keystore get creation date alias if date null no certificate return null log fine created date key key m keystore get key alias m password if c log mgt is level finest log info key key multiple lines else log fine key get algorithm certificate cert m keystore get certificate alias if c log mgt is level finest log info certificate cert multiple lines else log fine cert get type log fine certificate type cert get type public key cert get public key return cert getcertificate m_keystore getcreationdate m_keystore getkey m_password clogmgt islevelfinest getalgorithm m_keystore getcertificate clogmgt islevelfinest gettype gettype publickey getpublickey create certificate param alias alias param parent interactive dialog private void create certificate string alias j frame parent log info try file dir m file get parent file if dir exists dir mkdir catch exception e log log level severe directory e string dname get dname parent if dname null return try genkey alias m password m file get absolute path dname selfcert alias m password m file get absolute path dname catch exception e log log level severe certificate e createcertificate jframe m_file getparentfile getdname m_password m_file getabsolutepath m_password m_file getabsolutepath get distinguised name param parent interactive dialog return dname or null public static string get dname j frame parent string cn null try inet address address inet address get local host cn address get canonical host name catch exception e string ou system get property user name string o compiere user string l my town string s string c system get property user country if parent null key store dialog skd new key store dialog parent cn ou o l s c if skd isok return null cn skd getcn ou skd getou o skd geto l skd getl s skd gets c skd getc if cn null cn length 0 log severe no common name cn return null if ou null ou length 0 log severe no organization unit ou return null if o null o length 0 log severe no organization o return null if c null c length 0 log severe no country c return null escape commas string buffer dname new string buffer dname append cn append escape commas cn common name dname append ou append escape commas ou org unit dname append o append escape commas o org if l null l length 0 dname append l append escape commas l locality if s null s length 0 dname append s append escape commas s state dname append c append escape commas c country return dname to string getdname jframe inetaddress inetaddress getlocalhost getcanonicalhostname getproperty compiereuser mytown getproperty keystoredialog keystoredialog stringbuffer stringbuffer escapecommas escapecommas escapecommas escapecommas escapecommas escapecommas tostring escape commas param in input string return excaped string public static string escape commas string in if in null in index of 1 return in string buffer out new string buffer char chars in to char array for int i 0 i chars length i if chars i out append append else out append chars i return out to string escapecommas indexof stringbuffer stringbuffer tochararray tostring generate key param alias compiere param password password param file name key store file name may have spaces param dname distinguished name public static void genkey string alias char password string file name string dname string buffer cmd new string buffer genkey keyalg rsa cmd append alias append alias cmd append dname append dname append cmd append keypass append password append validity 365 if file name index of 1 cmd append keystore append file name append storepass append password else cmd append keystore append file name append storepass append password keytool cmd to string filename filename stringbuffer stringbuffer filename indexof filename filename tostring generate key param alias compiere param password password param file name key store file name may have spaces param dname distinguished name public static void selfcert string alias char password string file name string dname string buffer cmd new string buffer selfcert cmd append alias append alias cmd append dname append dname append cmd append keypass append password append validity 180 if file name index of 1 cmd append keystore append file name append storepass append password else cmd append keystore append file name append storepass append password keytool cmd to string filename filename stringbuffer stringbuffer filename indexof filename filename tostring submit command to key tool param cmd command public static void keytool string cmd log info keytool cmd array list string list new array list string string tokenizer st new string tokenizer cmd string quote buffer null while st has more tokens string token st next token system out println token quote buffer quote buffer size list size if quote buffer null if token starts with quote buffer token substring 1 else list add token else quote buffer token if token ends with string str quote buffer substring 0 quote buffer length 1 system out println buffer str list add str quote buffer null all tokens string args new string list size list to array args system out println args args length key tool main args arraylist arraylist stringtokenizer stringtokenizer quotebuffer hasmoretokens nexttoken quotebuffer quotebuffer quotebuffer startswith quotebuffer quotebuffer endswith quotebuffer quotebuffer quotebuffer toarray keytool get keystore file name param base dir compiere home return file name public static string get keystore file name string base dir string file name base dir if file name null file name else if file name ends with file separator file name file separator file name keystore directory file separator keystore name return file name basedir compiere_home getkeystorefilename basedir filename basedir filename filename filename endswith filename filename keystore_directory keystore_name filename test param args ignored public static void main string args compiere startup environment true system out println new key store mgt c adempiere keystore my keystore2 my password to char array verify null startupenvironment keystoremgt mykeystore2 mypassword tochararray get counter document for document type param ctx context param c doctype id base document return counter document c doctype id or 0 or 1 if no counter doc public static int getcounterdoctype id properties ctx int c doctype id direct relationship m doc type counter dt counter get counter doc type ctx c doctype id if dt counter null if dt counter is create counter dt counter is valid return 1 return dt counter getcounter c doctype id indirect relationship int counter c doctype id 0 m doc type dt m doc type get ctx c doctype id if dt is create counter return 1 string c doc base type get counter doc base type dt get doc base type if c doc base type null return 0 m doc type counters m doc type get of doc base type ctx c doc base type for int i 0 i counters length i m doc type counter counters i if counter is default counter doc counter c doctype id counter getc doctype id break if counter is default counter c doctype id counter getc doctype id else if i 0 counter c doctype id counter getc doctype id return counter c doctype id c_doctype_id c_doctype_id getcounterdoctype_id c_doctype_id mdoctypecounter dtcounter getcounterdoctype c_doctype_id dtcounter dtcounter iscreatecounter dtcounter isvalid dtcounter getcounter_c_doctype_id counter_c_doctype_id mdoctype mdoctype c_doctype_id iscreatecounter cdocbasetype getcounterdocbasetype getdocbasetype cdocbasetype mdoctype mdoctype getofdocbasetype cdocbasetype mdoctype isdefaultcounterdoc counter_c_doctype_id getc_doctype_id isdefault counter_c_doctype_id getc_doctype_id counter_c_doctype_id getc_doctype_id counter_c_doctype_id get first valid counter document for document type param ctx context param c doctype id base document return counter document may be invalid or null public static m doc type counter get counter doc type properties ctx int c doctype id integer key new integer c doctype id m doc type counter ret value m doc type counter s counter get key if ret value null return ret value direct relationship m doc type counter temp null string sql select from c doctypecounter where c doctype id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c doctype id result set rs pstmt execute query while rs next ret value null ret value new m doc type counter ctx rs null if ret value is create counter ret value is valid temp ret value ret value null rs close pstmt close pstmt null catch exception e s log log level severe get counter doc type e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null valid return ret value if temp null invalid return temp return null nothing found c_doctype_id mdoctypecounter getcounterdoctype c_doctype_id c_doctype_id mdoctypecounter retvalue mdoctypecounter s_counter retvalue retvalue mdoctypecounter c_doctypecounter c_doctype_id preparedstatement preparestatement setint c_doctype_id resultset executequery retvalue retvalue mdoctypecounter retvalue iscreatecounter retvalue isvalid retvalue retvalue s_log getcounterdoctype retvalue retvalue get m doc type counter from cache param ctx context param c doctypecounter id id return m doc type counter public static m doc type counter get properties ctx int c doctypecounter id string trx name integer key new integer c doctypecounter id m doc type counter ret value m doc type counter s cache get key if ret value null return ret value ret value new m doc type counter ctx c doctypecounter id trx name if ret value get id 0 s cache put key ret value return ret value mdoctypecounter c_doctypecounter_id mdoctypecounter mdoctypecounter c_doctypecounter_id trxname c_doctypecounter_id mdoctypecounter retvalue mdoctypecounter s_cache retvalue retvalue retvalue mdoctypecounter c_doctypecounter_id trxname retvalue get_id s_cache retvalue retvalue get counter document base type param doc base type document base type e g soo return counter document base type e g poo or null if there is none public static string get counter doc base type string doc base type if doc base type null return null string ret value null so po if m doc type docbasetype salesorder equals doc base type ret value m doc type docbasetype purchaseorder else if m doc type docbasetype purchaseorder equals doc base type ret value m doc type docbasetype salesorder ap ar invoice else if m doc type docbasetype apinvoice equals doc base type ret value m doc type docbasetype arinvoice else if m doc type docbasetype arinvoice equals doc base type ret value m doc type docbasetype apinvoice shipment else if m doc type docbasetype materialdelivery equals doc base type ret value m doc type docbasetype materialreceipt else if m doc type docbasetype materialreceipt equals doc base type ret value m doc type docbasetype materialdelivery ap ar credit memo else if m doc type docbasetype apcreditmemo equals doc base type ret value m doc type docbasetype arcreditmemo else if m doc type docbasetype arcreditmemo equals doc base type ret value m doc type docbasetype apcreditmemo receipt payment else if m doc type docbasetype arreceipt equals doc base type ret value m doc type docbasetype appayment else if m doc type docbasetype appayment equals doc base type ret value m doc type docbasetype arreceipt else s log log level severe get counter doc base type for doc base type none found return ret value basetype docbasetype basetype getcounterdocbasetype docbasetype docbasetype retvalue mdoctype docbasetype_salesorder docbasetype retvalue mdoctype docbasetype_purchaseorder mdoctype docbasetype_purchaseorder docbasetype retvalue mdoctype docbasetype_salesorder mdoctype docbasetype_apinvoice docbasetype retvalue mdoctype docbasetype_arinvoice mdoctype docbasetype_arinvoice docbasetype retvalue mdoctype docbasetype_apinvoice mdoctype docbasetype_materialdelivery docbasetype retvalue mdoctype docbasetype_materialreceipt mdoctype docbasetype_materialreceipt docbasetype retvalue mdoctype docbasetype_materialdelivery creditmemo mdoctype docbasetype_apcreditmemo docbasetype retvalue mdoctype docbasetype_arcreditmemo mdoctype docbasetype_arcreditmemo docbasetype retvalue mdoctype docbasetype_apcreditmemo mdoctype docbasetype_arreceipt docbasetype retvalue mdoctype docbasetype_appayment mdoctype docbasetype_appayment docbasetype retvalue mdoctype docbasetype_arreceipt s_log getcounterdocbasetype docbasetype retvalue standard constructor param ctx context param c doctypecounter id id public m doc type counter properties ctx int c doctypecounter id string trx name super ctx c doctypecounter id trx name if c doctypecounter id 0 set is create counter true y set is valid false c_doctypecounter_id mdoctypecounter c_doctypecounter_id trxname c_doctypecounter_id trxname c_doctypecounter_id setiscreatecounter setisvalid load constructor param ctx context param rs result set public m doc type counter properties ctx result set rs string trx name super ctx rs trx name mdoctypecounter resultset trxname trxname set c doctype id param c doctype id id public void setc doctype id int c doctype id super setc doctype id c doctype id if is valid set is valid false c_doctype_id c_doctype_id setc_doctype_id c_doctype_id setc_doctype_id c_doctype_id isvalid setisvalid set counter c doctype id param counter c doctype id id public void setcounter c doctype id int counter c doctype id super setcounter c doctype id counter c doctype id if is valid set is valid false c_doctype_id counter_c_doctype_id setcounter_c_doctype_id counter_c_doctype_id setcounter_c_doctype_id counter_c_doctype_id isvalid setisvalid get doc type return doc type or null if not existing public m doc type get doc type m doc type dt null if getc doctype id 0 dt m doc type get get ctx getc doctype id if dt get id 0 dt null return dt mdoctype getdoctype mdoctype getc_doctype_id mdoctype getctx getc_doctype_id get_id get counter doc type return counter doc type or null if not existing public m doc type get counter doc type m doc type dt null if getcounter c doctype id 0 dt m doc type get get ctx getcounter c doctype id if dt get id 0 dt null return dt mdoctype getcounterdoctype mdoctype getcounter_c_doctype_id mdoctype getctx getcounter_c_doctype_id get_id validate document type compatability return error message or null if valid public string validate m doc type dt get doc type if dt null log log level severe no doc type getc doctype id set is valid false return no document type m doc type c dt get counter doc type if c dt null log log level severe no counter doc type getcounter c doctype id set is valid false return no counter document type string dtbt dt get doc base type string c dtbt c dt get doc base type log fine dtbt c dtbt so po if m doc type docbasetype salesorder equals dtbt m doc type docbasetype purchaseorder equals c dtbt m doc type docbasetype salesorder equals c dtbt m doc type docbasetype purchaseorder equals dtbt set is valid true ap ar invoice else if m doc type docbasetype apinvoice equals dtbt m doc type docbasetype arinvoice equals c dtbt m doc type docbasetype apinvoice equals c dtbt m doc type docbasetype arinvoice equals dtbt set is valid true shipment else if m doc type docbasetype materialdelivery equals dtbt m doc type docbasetype materialreceipt equals c dtbt m doc type docbasetype materialdelivery equals c dtbt m doc type docbasetype materialreceipt equals dtbt set is valid true ap ar credit memo else if m doc type docbasetype apcreditmemo equals dtbt m doc type docbasetype arcreditmemo equals c dtbt m doc type docbasetype apcreditmemo equals c dtbt m doc type docbasetype arcreditmemo equals dtbt set is valid true receipt payment else if m doc type docbasetype arreceipt equals dtbt m doc type docbasetype appayment equals c dtbt m doc type docbasetype arreceipt equals c dtbt m doc type docbasetype appayment equals dtbt set is valid true else log warning not dtbt c dtbt set is valid false return not valid counter should have document numbering if c dt is doc no controlled return counter document type should be automatically document number controlled return null mdoctype getdoctype doctype getc_doctype_id setisvalid mdoctype c_dt getcounterdoctype c_dt doctype getcounter_c_doctype_id setisvalid getdocbasetype c_dtbt c_dt getdocbasetype c_dtbt mdoctype docbasetype_salesorder mdoctype docbasetype_purchaseorder c_dtbt mdoctype docbasetype_salesorder c_dtbt mdoctype docbasetype_purchaseorder setisvalid mdoctype docbasetype_apinvoice mdoctype docbasetype_arinvoice c_dtbt mdoctype docbasetype_apinvoice c_dtbt mdoctype docbasetype_arinvoice setisvalid mdoctype docbasetype_materialdelivery mdoctype docbasetype_materialreceipt c_dtbt mdoctype docbasetype_materialdelivery c_dtbt mdoctype docbasetype_materialreceipt setisvalid creditmemo mdoctype docbasetype_apcreditmemo mdoctype docbasetype_arcreditmemo c_dtbt mdoctype docbasetype_apcreditmemo c_dtbt mdoctype docbasetype_arcreditmemo setisvalid mdoctype docbasetype_arreceipt mdoctype docbasetype_appayment c_dtbt mdoctype docbasetype_arreceipt c_dtbt mdoctype docbasetype_appayment setisvalid c_dtbt setisvalid c_dt isdocnocontrolled string representation return info public string to string string buffer sb new string buffer m doc type counter sb append get id append append get name append c doctype id append getc doctype id append counter append getcounter c doctype id append doc action append get doc action append return sb to string tostring stringbuffer stringbuffer mdoctypecounter get_id getname c_doctype_id getc_doctype_id getcounter_c_doctype_id docaction getdocaction tostring before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 if new record is valuechanged c doctype id is valuechanged counter c doctype id set is valid false try to validate if is valid validate return true newrecord beforesave newrecord getad_org_id setad_org_id newrecord is_valuechanged c_doctype_id is_valuechanged counter_c_doctype_id setisvalid isvalid get product name return application name public static string get name return name getname get product version return application version public static string get version return main version date version getversion main_version date_version short summary windows return summary public static string get sum string buffer sb new string buffer sb append name append append main version append sub title return sb to string getsum stringbuffer stringbuffer main_version sub_title tostring summary windows compiere tm version 2 5 1a 2004 03 15 smart erp crm copyright c 1999 2005 jorg janke implementation 2 5 1a 20040417 0243 c 1999 2005 jorg janke com piere inc usa return summary in windows character set public static string get summary string buffer sb new string buffer sb append name append append main version append append date version append append sub title append append copyright append implementation append get implementation version append append get implementation vendor return sb to string 1a_2004 compiere getsummary stringbuffer stringbuffer main_version _ date_version sub_title getimplementationversion getimplementationvendor tostring set package info private static void set package info if s implementationvendor null return package compiere package package get package org compiere s implementationvendor compiere package get implementation vendor s implementationversion compiere package get implementation version if s implementationvendor null s implementationvendor not supported s implementationversion unknown setpackageinfo s_implementationvendor compierepackage getpackage s_implementationvendor compierepackage getimplementationvendor s_implementationversion compierepackage getimplementationversion s_implementationvendor s_implementationvendor s_implementationversion get jar implementation version return implementation version public static string get implementation version if s implementationversion null set package info return s implementationversion getimplementationversion s_implementationversion setpackageinfo s_implementationversion get jar implementation vendor return implementation vendor public static string get implementation vendor if s implementationvendor null set package info return s implementationvendor getimplementationvendor s_implementationvendor setpackageinfo s_implementationvendor get checksum return checksum public static int get check sum return get sum hash code getchecksum getsum hashcode summary in ascii return summary in ascii public static string get summary ascii string ret value get summary registered trademark ret value util replace ret value u00ae r trademark ret value util replace ret value u2122 tm copyright ret value util replace ret value u00a9 c cr ret value util replace ret value env nl ret value util replace ret value n return ret value getsummaryascii retvalue getsummary retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue get java vm info return vm info public static string get java info return system get property java vm name system get property java vm version getjavainfo getproperty getproperty get operating system info return os info public static string getos info return system get property os name system get property os version system get property sun os patch level getosinfo getproperty getproperty getproperty get full url return url public static string geturl return http url get sub title return subtitle public static string get subtitle return sub title getsubtitle sub_title get 16x16 image return image icon public static image get image16 if s image16 null toolkit tk toolkit get default toolkit url url org compiere compiere class get resource s file16x16 system out println url if url null return null s image16 tk get image url return s image16 getimage16 s_image16 getdefaulttoolkit getresource s_file16x16 s_image16 getimage s_image16 get 28 15 logo image return image icon public static image get image logo small boolean hr if s image48x15 null toolkit tk toolkit get default toolkit url url null if hr url org compiere compiere class get resource s file48x15hr else url org compiere compiere class get resource s file48x15 system out println url if url null return null s image48x15 tk get image url return s image48x15 getimagelogosmall s_image48x15 getdefaulttoolkit getresource s_file48x15hr getresource s_file48x15 s_image48x15 getimage s_image48x15 get logo image return image logo public static image get image logo if s imagelogo null toolkit tk toolkit get default toolkit url url org compiere compiere class get resource s file100x30 system out println url if url null return null s imagelogo tk get image url return s imagelogo getimagelogo s_imagelogo getdefaulttoolkit getresource s_file100x30 s_imagelogo getimage s_imagelogo get 32x32 image icon return image icon public static image icon get image icon32 if s imageicon32 null url url org compiere compiere class get resource s file32x32 system out println url if url null return null s imageicon32 new image icon url return s imageicon32 imageicon imageicon getimageicon32 s_imageicon32 getresource s_file32x32 s_imageicon32 imageicon s_imageicon32 get 100x30 image icon return image icon public static image icon get image icon logo if s imageiconlogo null url url org compiere compiere class get resource s file100x30 system out println url if url null return null s imageiconlogo new image icon url return s imageiconlogo imageicon imageicon getimageiconlogo s_imageiconlogo getresource s_file100x30 s_imageiconlogo imageicon s_imageiconlogo get default home directory return home directory public static string get compiere home try environment string ret value ini get compiere home look in current directory if ret value null system get property user dir index of adempiere 1 ret value system get property user dir int pos ret value index of adempiere ret value ret value substring pos 9 if ret value null ret value file separator adempiere return ret value getcompierehome retvalue getcompierehome retvalue getproperty indexof retvalue getproperty retvalue indexof retvalue retvalue retvalue retvalue retvalue get support email return support mail address public static string get supporte mail return s supportemail getsupportemail s_supportemail set support email param email support mail address public static void set supporte mail string email s supportemail email setsupportemail s_supportemail get jnlp code base return code base or null public static url get code base try basic service bs basic service service manager lookup javax jnlp basic service url url bs get code base return url catch unavailable service exception ue return null codebase getcodebase basicservice basicservice servicemanager basicservice getcodebase unavailableserviceexception get jnlp code base host return code base or null public static string get code base host url url get code base if url null return null return url get host codebase getcodebasehost getcodebase gethost startup client server print greeting check java version and load ini parameters if it is a client load set plaf and exit if error if client you need to call startup environment explicitly for testing call method startup environment param is client true for client return successful startup public static synchronized boolean startup boolean is client already started if log null return true check version if login is javaok is client is client system exit 1 c log mgt initialize is client ini set client is client ini requires logging init log log c logger getc logger compiere class greeting log info get summary ascii log info get compiere home get java info getos info load system environment env loader load ini env prefix system properties ini load properties false set up log c log mgt set level ini get property ini p tracelevel if is client ini is property bool ini p tracefile c log file get false null is client null c log mgt add handler c log file get true ini find compiere home is client set ui if is client compiere theme load compiereplaf setplaf null set default database connection from ini db setdb target c connection get get code base host if is client don t test connection return false need to call return startup environment is client startupenvironment startupenvironment isclient isclient isjavaok isclient isclient clogmgt isclient setclient isclient clogger getclogger getsummaryascii getcompierehome getjavainfo getosinfo envloader env_prefix loadproperties clogmgt setlevel getproperty p_tracelevel isclient ispropertybool p_tracefile clogfile isclient clogmgt addhandler clogfile findcompierehome isclient isclient compieretheme setdbtarget cconnection getcodebasehost isclient startupenvironment isclient startup compiere environment automatically called for server connections for testing call this method param is client true if client connection return successful startup public static boolean startup environment boolean is client startup is client returns if already initiated if db is connected log severe no database system exit 1 initialize main cached singletons model validation engine get try m system system m system get env get ctx initializes base context too string class name system get encryption key if class name null class name length 0 class name system get property secure interface compiere secure if class name null class name length 0 class name equals secure interface compiere secure default secure engine init class name test it system set encryption key class name system save secure engine init class name if is client m client get env get ctx 0 login client loaded later else m client get all env get ctx document set key system get summary catch exception e log warning environment problems e to string start workflow document manager in other package for po string class name null try class name org compiere wf doc workflow manager class for name class name initialize archive engine class name org compiere print archive engine class for name class name catch exception e log warning not started class name e get message if is client db update mail return true isclient startupenvironment isclient isclient isconnected modelvalidationengine msystem msystem getctx classname getencryptionkey classname classname classname getproperty secureinterface compiere_secure classname classname classname secureinterface compiere_secure_default secureengine classname setencryptionkey classname secureengine classname isclient mclient getctx mclient getall getctx setkey getsummary tostring classname classname docworkflowmanager forname classname classname archiveengine forname classname classname getmessage isclient updatemail main method param args optional start class public static void main string args splash get splash startup true error exit and initui start with class as argument or if nothing provided with client string class name org compiere apps a menu for int i 0 i args length i if args i equals debug ignore debug class name args i break try class start class class for name class name start class new instance catch exception e system err println a dempiere starting class name e to string e print stack trace getsplash classname amenu classname startclass forname classname startclass newinstance adempiere classname tostring printstacktrace get contents return contents public object get contents return contents getcontents create own instance param c compoment return compiere menu barui public static componentui createui j component c return new compiere menu itemui compieremenubarui jcomponent compieremenuitemui install ui param c public void installui j component c super installui c c set opaque false use menu barui background jcomponent setopaque menubarui update ui param g graphics param c component public void update graphics g j component c if c is opaque compiere color bg compiere color get default background bg paint g c g set color c get background g fill rect 0 0 c get width c get height paint g c jcomponent isopaque compierecolor compierecolor getdefaultbackground setcolor getbackground fillrect getwidth getheight paint background param g graphics param menu item menu param bg color bg color protected void paint background graphics g j menu item menu item color bg color button model model menu item get model if model is armed super paint background g menu item bg color else compiere color bg compiere color get default background bg paint g menu item menuitem bgcolor paintbackground jmenuitem menuitem bgcolor buttonmodel menuitem getmodel isarmed paintbackground menuitem bgcolor compierecolor compierecolor getdefaultbackground menuitem standard constructor public x ad orgtype properties ctx int ad orgtype id string trx name super ctx ad orgtype id trx name if ad orgtype id 0 setad orgtype id 0 set name null x_ad_orgtype ad_orgtype_id trxname ad_orgtype_id trxname ad_orgtype_id setad_orgtype_id setname load constructor public x ad orgtype properties ctx result set rs string trx name super ctx rs trx name x_ad_orgtype resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad orgtype append get id append return sb to string tostring stringbuffer stringbuffer x_ad_orgtype get_id tostring set organization type organization type allows you to categorize your organizations public void setad orgtype id int ad orgtype id if ad orgtype id 1 throw new illegal argument exception ad orgtype id is mandatory set valuenocheck ad orgtype id new integer ad orgtype id setad_orgtype_id ad_orgtype_id ad_orgtype_id illegalargumentexception ad_orgtype_id set_valuenocheck ad_orgtype_id ad_orgtype_id get organization type organization type allows you to categorize your organizations public int getad orgtype id integer ii integer get value ad orgtype id if ii null return 0 return ii int value getad_orgtype_id get_value ad_orgtype_id intvalue set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname basic constructor you need to set the attributes using the set methods public h5 use the set methods to set the values of the attributes param element set the value of lt h5 gt value lt h5 gt public h5 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h5 gt value lt h5 gt public h5 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h5 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h5 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h5 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h5 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h5 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c rfqresponselineqty properties ctx int c rfqresponselineqty id string trx name super ctx c rfqresponselineqty id trx name if c rfqresponselineqty id 0 setc rfqlineqty id 0 setc rfqresponselineqty id 0 setc rfqresponseline id 0 set price env zero x_c_rfqresponselineqty c_rfqresponselineqty_id trxname c_rfqresponselineqty_id trxname c_rfqresponselineqty_id setc_rfqlineqty_id setc_rfqresponselineqty_id setc_rfqresponseline_id setprice load constructor public x c rfqresponselineqty properties ctx result set rs string trx name super ctx rs trx name x_c_rfqresponselineqty resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfqresponselineqty append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfqresponselineqty get_id tostring set rfq line quantity request for quotation line quantity public void setc rfqlineqty id int c rfqlineqty id if c rfqlineqty id 1 throw new illegal argument exception c rfqlineqty id is mandatory set valuenocheck c rfqlineqty id new integer c rfqlineqty id setc_rfqlineqty_id c_rfqlineqty_id c_rfqlineqty_id illegalargumentexception c_rfqlineqty_id set_valuenocheck c_rfqlineqty_id c_rfqlineqty_id get rfq line quantity request for quotation line quantity public int getc rfqlineqty id integer ii integer get value c rfqlineqty id if ii null return 0 return ii int value getc_rfqlineqty_id get_value c_rfqlineqty_id intvalue set rfq response line qty request for quotation response line quantity public void setc rfqresponselineqty id int c rfqresponselineqty id if c rfqresponselineqty id 1 throw new illegal argument exception c rfqresponselineqty id is mandatory set valuenocheck c rfqresponselineqty id new integer c rfqresponselineqty id setc_rfqresponselineqty_id c_rfqresponselineqty_id c_rfqresponselineqty_id illegalargumentexception c_rfqresponselineqty_id set_valuenocheck c_rfqresponselineqty_id c_rfqresponselineqty_id get rfq response line qty request for quotation response line quantity public int getc rfqresponselineqty id integer ii integer get value c rfqresponselineqty id if ii null return 0 return ii int value getc_rfqresponselineqty_id get_value c_rfqresponselineqty_id intvalue set rfq response line request for quotation response line public void setc rfqresponseline id int c rfqresponseline id if c rfqresponseline id 1 throw new illegal argument exception c rfqresponseline id is mandatory set valuenocheck c rfqresponseline id new integer c rfqresponseline id setc_rfqresponseline_id c_rfqresponseline_id c_rfqresponseline_id illegalargumentexception c_rfqresponseline_id set_valuenocheck c_rfqresponseline_id c_rfqresponseline_id get rfq response line request for quotation response line public int getc rfqresponseline id integer ii integer get value c rfqresponseline id if ii null return 0 return ii int value getc_rfqresponseline_id get_value c_rfqresponseline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc rfqresponseline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_rfqresponseline_id set discount discount in percent public void set discount big decimal discount set value discount discount setdiscount bigdecimal set_value get discount discount in percent public big decimal get discount big decimal bd big decimal get value discount if bd null return env zero return bd bigdecimal getdiscount bigdecimal bigdecimal get_value set price price public void set price big decimal price if price null throw new illegal argument exception price is mandatory set value price price setprice bigdecimal illegalargumentexception set_value get price price public big decimal get price big decimal bd big decimal get value price if bd null return env zero return bd bigdecimal getprice bigdecimal bigdecimal get_value set ranking relative rank number public void set ranking int ranking set value ranking new integer ranking setranking set_value get ranking relative rank number public int get ranking integer ii integer get value ranking if ii null return 0 return ii int value getranking get_value intvalue get next number for key column 0 is error param ad client id client param table name table name param trx name optional transaction name return next no or 1 not found 2 error public static int get nextid int ad client id string table name string trx name if table name null table name length 0 throw new illegal argument exception table name missing int ret value 1 check compiere sys boolean compiere sys ini is property bool ini p compieresys if compiere sys ad client id 11 compiere sys false if c log mgt is level loglevel s log log loglevel table name compiere sys compiere sys trx name begin vpj cd e evolution 09 02 2005 postgresql string selectsql null if db is postgresql selectsql select current next current next sys increment no ad sequence id from ad sequence where name and is active y and is tableid y and is auto sequence y for update of ad sequence use procedure false else string selectsql select current next current next sys increment no ad sequence id selectsql select current next current next sys increment no ad sequence id end vpj cd e evolution 09 02 2005 postgresql from ad sequence where name and is active y and is tableid y and is auto sequence y for update of current next current next sys trx trx trx name null null trx get trx name true connection conn null prepared statement pstmt null for int i 0 i 3 i try if trx null conn trx get connection else conn db get connectionid error if conn null return 1 pstmt conn prepare statement selectsql result set type forward only result set concur updatable pstmt set string 1 table name result set rs pstmt execute query if c log mgt is level finest s log finest ac conn get auto commit ro conn is read only isolation conn get transaction isolation connection transaction read committed rs type pstmt get result set type result set type scroll sensitive rs concur pstmt get result set concurrency result set concur updatable if rs next int ad sequence id rs get int 4 if use procedure ret value nextid conn ad sequence id compiere sys else int increment no rs get int 3 if compiere sys ret value rs get int 2 rs update int 2 ret value increment no else ret value rs get int 1 rs update int 1 ret value increment no rs update row if trx null conn commit else s log severe no record found table name rs close pstmt close pstmt null conn close conn null break exit catch exception e s log log level severe table name e get message e try conn rollback if pstmt null pstmt close catch sql exception e1 thread yield give it time finish try if pstmt null pstmt close pstmt null if conn null conn close conn null catch exception e s log log level severe finish e pstmt null s log finest ret value table table name trx return ret value ad_client_id tablename trxname getnextid ad_client_id tablename trxname tablename tablename illegalargumentexception tablename retvalue compieresys compieresys ispropertybool p_compieresys compieresys ad_client_id compieresys clogmgt islevel s_log tablename compieresys compieresys trxname ispostgresql currentnext currentnextsys incrementno ad_sequence_id ad_sequence isactive istableid isautosequence ad_sequence use_procedure currentnext currentnextsys incrementno ad_sequence_id currentnext currentnextsys incrementno ad_sequence_id ad_sequence isactive istableid isautosequence currentnext currentnextsys trxname trxname preparedstatement getconnection getconnectionid preparestatement resultset type_forward_only resultset concur_updatable setstring tablename resultset executequery clogmgt islevelfinest s_log getautocommit isreadonly gettransactionisolation transaction_read_committed rstype getresultsettype resultset type_scroll_sensitive rsconcur getresultsetconcurrency resultset concur_updatable ad_sequence_id getint use_procedure retvalue ad_sequence_id compieresys incrementno getint compieresys retvalue getint updateint retvalue incrementno retvalue getint updateint retvalue incrementno updaterow s_log tablename s_log tablename getmessage sqlexception s_log s_log retvalue tablename retvalue get next id param conn connection param ad sequence id sequence param compiere sys sys return next id or 1 error or 3 parameter private static int nextid connection conn int ad sequence id boolean compiere sys if conn null ad sequence id 0 return 3 int ret value 1 string sql update call nextid callable statement cstmt null try cstmt conn prepare call sql update result set type forward only result set concur read only cstmt set int 1 ad sequence id cstmt set string 2 compiere sys y n cstmt register out parameter 3 types integer cstmt execute ret value cstmt get int 3 cstmt close cstmt null catch exception e s log log level severe e to string finish try if cstmt null cstmt close catch exception e return ret value ad_sequence_id compieresys ad_sequence_id compieresys ad_sequence_id retvalue sqlupdate callablestatement preparecall sqlupdate resultset type_forward_only resultset concur_read_only setint ad_sequence_id setstring compieresys registeroutparameter retvalue getint s_log tostring retvalue get document no from table param ad client id client param table name table name param trx name optional transaction name return document no or null public static synchronized string get document no int ad client id string table name string trx name if table name null table name length 0 throw new illegal argument exception table name missing check compiere sys boolean compiere sys ini is property bool ini p compieresys if compiere sys ad client id 11 compiere sys false if c log mgt is level loglevel s log log loglevel table name compiere sys compiere sys trx name begin vpj cd e evolution 09 02 2005 postgresql string selectsql null if db is postgresql selectsql select current next current next sys increment no prefix suffix ad sequence id from ad sequence where name and ad client id in 0 and is active y and is tableid n and is auto sequence y order by ad client id desc for update of ad sequence use procedure false else string selectsql select current next current next sys increment no prefix suffix ad sequence id selectsql select current next current next sys increment no prefix suffix ad sequence id end vpj cd e evolution 09 02 2005 postgresql from ad sequence where name and ad client id in 0 and is active y and is tableid n and is auto sequence y order by ad client id desc for update connection conn null prepared statement pstmt null trx trx trx name null null trx get trx name true int ad sequence id 0 int increment no 0 int next 1 string prefix string suffix try if trx null conn trx get connection else conn db get connectionid error if conn null return null pstmt conn prepare statement selectsql result set type forward only result set concur updatable pstmt set string 1 prefix docseq table name pstmt set int 2 ad client id result set rs pstmt execute query s log fine ac conn get auto commit iso conn get transaction isolation type pstmt get result set type concur pstmt get result set concurrency if rs next ad sequence id rs get int 6 prefix rs get string 4 suffix rs get string 5 increment no rs get int 3 if use procedure next nextid conn ad sequence id compiere sys else if compiere sys next rs get int 2 rs update int 2 next increment no else next rs get int 1 rs update int 1 next increment no rs update row else s log warning table no record found table name m sequence seq new m sequence env get ctx ad client id table name null next seq get nextid seq save rs close pstmt close pstmt null commit if trx null conn commit conn close conn null catch exception e s log log level severe table trx name e next 2 finish try if pstmt null pstmt close pstmt null if conn null trx null conn close conn null catch exception e s log log level severe table finish e pstmt null error if next 0 return null create document no string buffer doc new string buffer if prefix null prefix length 0 doc append prefix doc append next if suffix null suffix length 0 doc append suffix string document no doc to string s log finer document no increment no table table name trx return document no ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname tablename tablename illegalargumentexception tablename compieresys compieresys ispropertybool p_compieresys compieresys ad_client_id compieresys clogmgt islevel s_log tablename compieresys compieresys trxname ispostgresql currentnext currentnextsys incrementno ad_sequence_id ad_sequence ad_client_id isactive istableid isautosequence ad_client_id ad_sequence use_procedure currentnext currentnextsys incrementno ad_sequence_id currentnext currentnextsys incrementno ad_sequence_id ad_sequence ad_client_id isactive istableid isautosequence ad_client_id preparedstatement trxname trxname ad_sequence_id incrementno getconnection getconnectionid preparestatement resultset type_forward_only resultset concur_updatable setstring prefix_docseq tablename setint ad_client_id resultset executequery s_log getautocommit gettransactionisolation getresultsettype getresultsetconcurrency ad_sequence_id getint getstring getstring incrementno getint use_procedure ad_sequence_id compieresys compieresys getint updateint incrementno getint updateint incrementno updaterow s_log tablename msequence msequence getctx ad_client_id tablename getnextid s_log trxname s_log documentno stringbuffer stringbuffer documentno tostring s_log documentno incrementno tablename documentno get document no based on document type param c doctype id document type param trx name optional transaction name return document no or null public static synchronized string get document no int c doctype id string trx name if c doctype id 0 s log severe c doctype id 0 return null m doc type dt m doc type get env get ctx c doctype id wrong for server but r o if dt null dt is doc no controlled s log finer doctype id c doctype id not doc no controlled return null if dt null dt getdocnosequence id 0 s log warning no sequence for doc type dt return null check compiere sys boolean compiere sys ini is property bool ini p compieresys if c log mgt is level loglevel s log log loglevel doctype id c doctype id trx name begin vpj cd e evolution 09 02 2005 postgresql string selectsql null if db is postgresql selectsql select current next current next sys increment no prefix suffix ad client id ad sequence id from ad sequence where ad sequence id and is active y and is tableid n and is auto sequence y for update of ad sequence use procedure false else string selectsql select current next current next sys increment no prefix suffix ad client id ad sequence id selectsql select current next current next sys increment no prefix suffix ad client id ad sequence id end vpj cd e evolution 09 02 2005 postgresql from ad sequence where ad sequence id and is active y and is tableid n and is auto sequence y for update connection conn null prepared statement pstmt null trx trx trx name null null trx get trx name true int ad sequence id 0 int increment no 0 int next 1 string prefix string suffix try if trx null conn trx get connection else conn db get connectionid error if conn null return null pstmt conn prepare statement selectsql result set type forward only result set concur updatable pstmt set int 1 dt getdocnosequence id result set rs pstmt execute query s log fine ac conn get auto commit iso conn get transaction isolation type pstmt get result set type concur pstmt get result set concurrency if rs next increment no rs get int 3 prefix rs get string 4 suffix rs get string 5 int ad client id rs get int 6 if compiere sys ad client id 11 compiere sys false ad sequence id rs get int 7 if use procedure next nextid conn ad sequence id compiere sys else if compiere sys next rs get int 2 rs update int 2 next increment no else next rs get int 1 rs update int 1 next increment no rs update row else s log warning doc type no record found dt next 2 rs close pstmt close pstmt null commit if trx null conn commit conn close conn null catch exception e s log log level severe doc type trx name e next 2 finish try if pstmt null pstmt close pstmt null if conn null trx null conn close conn null catch exception e s log log level severe doc type finish e pstmt null error if next 0 return null create document no string buffer doc new string buffer if prefix null prefix length 0 doc append prefix doc append next if suffix null suffix length 0 doc append suffix string document no doc to string s log finer document no increment no c doctype id c doctype id trx return document no c_doctype_id trxname getdocumentno c_doctype_id trxname c_doctype_id s_log c_doctype_id mdoctype mdoctype getctx c_doctype_id isdocnocontrolled s_log doctype_id c_doctype_id docno getdocnosequence_id s_log doctype compieresys compieresys ispropertybool p_compieresys clogmgt islevel s_log doctype_id c_doctype_id trxname ispostgresql currentnext currentnextsys incrementno ad_client_id ad_sequence_id ad_sequence ad_sequence_id isactive istableid isautosequence ad_sequence use_procedure currentnext currentnextsys incrementno ad_client_id ad_sequence_id currentnext currentnextsys incrementno ad_client_id ad_sequence_id ad_sequence ad_sequence_id isactive istableid isautosequence preparedstatement trxname trxname ad_sequence_id incrementno getconnection getconnectionid preparestatement resultset type_forward_only resultset concur_updatable setint getdocnosequence_id resultset executequery s_log getautocommit gettransactionisolation getresultsettype getresultsetconcurrency incrementno getint getstring getstring ad_client_id getint compieresys ad_client_id compieresys ad_sequence_id getint use_procedure ad_sequence_id compieresys compieresys getint updateint incrementno getint updateint incrementno updaterow s_log doctype s_log doctype trxname s_log doctype documentno stringbuffer stringbuffer documentno tostring s_log documentno incrementno c_doctype_id c_doctype_id documentno check initialize client document no value sequences param ctx context param ad client id client return true if no error public static boolean check client sequences properties ctx int ad client id string trx name string sql select table name from ad table t where is active y and is view n get all tables with document no or value and ad table id in select ad table id from ad column where column name document no or column name value ability to run multiple times and documentno table name not in select name from ad sequence s where s ad client id int counter 0 boolean success true prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad client id result set rs pstmt execute query while rs next string table name rs get string 1 s log fine add table name m sequence seq new m sequence ctx ad client id table name trx name if seq save counter else s log severe not created ad client id ad client id table name success false rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log info ad client id ad client id created counter success success return success documentno ad_client_id checkclientsequences ad_client_id trxname tablename ad_table isactive isview documentno ad_table_id ad_table_id ad_column columnname documentno columnname documentno_ tablename ad_sequence ad_client_id preparedstatement preparestatement trxname setint ad_client_id resultset executequery tablename getstring s_log tablename msequence msequence ad_client_id tablename trxname s_log ad_client_id ad_client_id tablename s_log s_log ad_client_id ad_client_id create table id sequence param ctx context param table name table name return true if created public static boolean create table sequence properties ctx string table name string trx name m sequence seq new m sequence ctx 0 trx name seq set client org 0 0 seq set name table name seq set description table table name seq set is tableid true return seq save tablename createtablesequence tablename trxname msequence msequence trxname setclientorg setname tablename setdescription tablename setistableid get sequence param ctx context param table name table name public static m sequence get properties ctx string table name string sql select from ad sequence where upper name and is tableid y m sequence ret value null prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 table name to upper case result set rs pstmt execute query if rs next ret value new m sequence ctx rs null if rs next s log log level severe more then one sequence for table name rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value tablename msequence tablename ad_sequence istableid msequence retvalue preparedstatement preparestatement setstring tablename touppercase resultset executequery retvalue msequence s_log tablename s_log retvalue standard constructor param ctx context param ad sequence id id public m sequence properties ctx int ad sequence id string trx name super ctx ad sequence id trx name if ad sequence id 0 set name null set is tableid false set start no init no set current next init no set current next sys init sys no set increment no 1 set is auto sequence true set is audited false set start new year false ad_sequence_id msequence ad_sequence_id trxname ad_sequence_id trxname ad_sequence_id setname setistableid setstartno init_no setcurrentnext init_no setcurrentnextsys init_sys_no setincrementno setisautosequence setisaudited setstartnewyear load constructor param ctx context param rs result set public m sequence properties ctx result set rs string trx name super ctx rs trx name msequence resultset trxname trxname new document sequence constructor param ctx context param ad client id owner param table name name public m sequence properties ctx int ad client id string table name string trx name this ctx 0 trx name set client org ad client id 0 client ownership set name prefix docseq table name set description document no value for table table name ad_client_id tablename msequence ad_client_id tablename trxname trxname setclientorg ad_client_id setname prefix_docseq tablename setdescription documentno tablename new document sequence constructor param ctx context param ad client id owner param sequence name name param start no start param trx name trx public m sequence properties ctx int ad client id string sequence name int start no string trx name this ctx 0 trx name set client org ad client id 0 client ownership set name sequence name set description sequence name set start no start no set current next start no set current next sys start no 10 ad_client_id sequencename startno trxname msequence ad_client_id sequencename startno trxname trxname setclientorg ad_client_id setname sequencename setdescription sequencename setstartno startno setcurrentnext startno setcurrentnextsys startno get next no and increase current next return next no to use public int get nextid int ret value get current next set current next ret value get increment no return ret value getnextid retvalue getcurrentnext setcurrentnext retvalue getincrementno retvalue get next document no return document no public string get document no create document no string buffer doc new string buffer string prefix get prefix if prefix null prefix length 0 doc append prefix doc append get nextid string suffix get suffix if suffix null suffix length 0 doc append suffix return doc to string documentno getdocumentno documentno stringbuffer stringbuffer getprefix getnextid getsuffix tostring validate table sequence values return true if updated public boolean validate tableid value if is tableid return false string table name get name int ad column id db getsql value null select max c ad column id from ad table t inner join ad column c on t ad table id c ad table id where t table name table name and c column name table name id if ad column id 0 return false m system system m system get get ctx int id range end 0 if system getid range end null id range end system getid range end int value boolean change false string info null current next string sql select max table name id from table name if id range end 0 sql where table name id id range end int max tableid db getsql value null sql if max tableid init no max tableid init no 1 max tableid next if get current next max tableid set current next max tableid info current next max tableid change true get max system id used in table sql select max table name id from table name where table name id init no int max table sysid db getsql value null sql if max table sysid 0 max table sysid init sys no 1 max table sysid next if get current next sys max table sysid set current next sys max table sysid if info null info current next sys max table sysid else info current next sys max table sysid change true if info null log fine get name info return change validatetableidvalue istableid tablename getname ad_column_id getsqlvalue ad_column_id ad_table ad_column ad_table_id ad_table_id tablename tablename columnname tablename _id ad_column_id msystem msystem getctx idrangeend getidrangeend idrangeend getidrangeend intvalue tablename _id tablename idrangeend tablename _id idrangeend maxtableid getsqlvalue maxtableid init_no maxtableid init_no maxtableid getcurrentnext maxtableid setcurrentnext maxtableid currentnext maxtableid system_id tablename _id tablename tablename _id init_no maxtablesysid getsqlvalue maxtablesysid maxtablesysid init_sys_no maxtablesysid getcurrentnextsys maxtablesysid setcurrentnextsys maxtablesysid currentnextsys maxtablesysid currentnextsys maxtablesysid getname test param args ignored static public void main string args org compiere compiere startup true c log mgt set level level severe c log mgt set logger level level severe null s list new vector integer 1000 lock test string trx name test system out println db get document no 115 trx name system out println db get document no 116 trx name system out println db get document no 117 trx name system out println db get document no 118 trx name system out println db get document no 118 trx name system out println db get document no 117 trx name trx name test1 system out println db get document no 115 trx name hangs here as supposed system out println db get document no 116 trx name system out println db get document no 117 trx name system out println db get document no 118 trx name time test long time system current time millis thread threads new thread 10 for int i 0 i 10 i runnable r new geti ds i threads i new thread r threads i start for int i 0 i 10 i try threads i join catch interrupted exception e time system current time millis time system out println system out println size s list size should be 1000 integer ia new integer s list size s list to array ia arrays sort ia integer last null int duplicates 0 for int i 0 i ia length i if last null if last compare to ia i 0 system out println i ia i duplicates last ia i system out println system out println size s list size should be 1000 system out println duplicates duplicates system out println time ms time float time s list size each system out println try int ret value 1 connection conn db get connectionrw driver manager register driver new oracle jdbc driver oracle driver connection conn driver manager get connection jdbc oracle thin dev2 1521 dev2 adempiere adempiere conn set auto commit false string sql select current next current next sys increment no from ad sequence where name ad sequence sql for update creates ora 00907 missing right parenthesis sql for update of current next current next sys prepared statement pstmt conn prepare statement sql result set type forward only result set concur updatable result set rs pstmt execute query system out println ac conn get auto commit ro conn is read only isolation conn get transaction isolation connection transaction read committed rs type pstmt get result set type result set type scroll sensitive rs concur pstmt get result set concurrency result set concur updatable if rs next int increment no rs get int 3 ret value rs get int 1 rs update int 1 ret value increment no rs update row else s log severe no record found rs close pstmt close conn commit conn close system out println next ret value catch exception e e print stack trace system exit 0 int ad client id 0 int c doctype id 115 gl string table name c invoice string trx name x trx trx trx get trx name true system out println none get nextid 0 test system out println system out println trx1 get nextid 0 test system out println trx2 get nextid 0 test trx rollback system out println trx3 get nextid 0 test trx commit system out println trx4 get nextid 0 test trx rollback trx close system out println system out println none get nextid 0 test system out println trx trx get trx name true system out println none get document no ad client id table name null system out println system out println trx1 get document no ad client id table name trx name system out println trx2 get document no ad client id table name trx name trx rollback system out println trx3 get document no ad client id table name trx name trx commit system out println trx4 get document no ad client id table name trx name trx rollback trx close system out println system out println none get document no ad client id table name null system out println trx trx get trx name true system out println none get document no c doctype id null system out println system out println trx1 get document no c doctype id trx name system out println trx2 get document no c doctype id trx name trx rollback system out println trx3 get document no c doctype id trx name trx commit system out println trx4 get document no c doctype id trx name trx rollback trx close system out println system out println none get document no c doctype id null system out println clogmgt setlevel clogmgt setloggerlevel s_list trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname getdocumentno trxname currenttimemillis getids interruptedexception currenttimemillis s_list s_list s_list toarray compareto s_list s_list retvalue getconnectionrw drivermanager registerdriver oracledriver drivermanager getconnection setautocommit currentnext currentnextsys incrementno ad_sequence ad_sequence currentnext currentnextsys preparedstatement preparestatement resultset type_forward_only resultset concur_updatable resultset executequery getautocommit isreadonly gettransactionisolation transaction_read_committed rstype getresultsettype resultset type_scroll_sensitive rsconcur getresultsetconcurrency resultset concur_updatable incrementno getint retvalue getint updateint retvalue incrementno updaterow s_log retvalue printstacktrace ad_client_id c_doctype_id tablename c_invoice trxname trxname getnextid getnextid getnextid getnextid getnextid getnextid trxname getdocumentno ad_client_id tablename getdocumentno ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname getdocumentno c_doctype_id getdocumentno c_doctype_id trxname getdocumentno c_doctype_id trxname getdocumentno c_doctype_id trxname getdocumentno c_doctype_id trxname getdocumentno c_doctype_id public static class geti ds implements runnable public geti ds int i m i i getids getids m_i public void run for int i 0 i 100 i try int no db get nextid 0 test null s list add new integer no system out println m i no catch exception e system err println e get message getnextid s_list m_i getmessage prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals check new value p checknewvalue new boolean y equals para i get parameter else if name equals check old value p checkoldvalue new boolean y equals para i get parameter else if name equals set customization p setcustomization y equals para i get parameter else log log level severe unknown parameter name p ad changelog id getrecord id processinfoparameter getparameter getparametername getparameter checknewvalue p_checknewvalue getparameter checkoldvalue p_checkoldvalue getparameter setcustomization p_setcustomization getparameter p_ad_changelog_id getrecord_id process return message throws exception protected string do it throws exception if p setcustomization return set customization log info ad changelog id p ad changelog id check old value p checkoldvalue check new value p checknewvalue single change or all customizations string sql select from ad changelog where ad changelog id order by ad table id record id ad column id if p ad changelog id 0 sql select from ad changelog where is customization y and is active y order by ad table id ad changelog id record id ad column id prepared statement pstmt null try pstmt db prepare statement sql get trxname if p ad changelog id 0 pstmt set int 1 p ad changelog id result set rs pstmt execute query while rs next create statement new m change log get ctx rs get trxname get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null final call execute statement return ok m ok errors m errors failed m checkfailed doit p_setcustomization setcustomization ad_changelog_id p_ad_changelog_id checkoldvalue p_checkoldvalue checknewvalue p_checknewvalue ad_changelog ad_changelog_id ad_table_id record_id ad_column_id p_ad_changelog_id ad_changelog iscustomization isactive ad_table_id ad_changelog_id record_id ad_column_id preparedstatement preparestatement get_trxname p_ad_changelog_id setint p_ad_changelog_id resultset executequery createstatement mchangelog getctx get_trxname get_trxname executestatement m_ok m_errors m_checkfailed create statement param c log log param trx name trx private void create statement m change log c log string trx name new table if m table null if c log getad table id m table getad table id execute statement m table null if m table null m table new m table get ctx c log getad table id trx name new record if m sqlupdate null c log getrecord id m oldrecord id execute statement column info m column new m column get ctx c log getad column id get trxname same column twice if m columns contains m column get column name execute statement m columns add m column get column name create new statement if m sqlupdate null string table name m table get table name m keycolumn m table get table name id if table name equals ad ref table m keycolumn ad reference id m sqlupdate new string buffer update append table name append set single key only m sqlupdatewhere new string buffer where append m keycolumn append append c log getrecord id m oldrecord id c log getrecord id insert new value is null and un do only m isinsert c log is new null p checknewvalue null if m isinsert m sqlinsert new string buffer insert into append table name append append m keycolumn m sqlinsertvalue new string buffer values append c log getrecord id if m keycolumn equals m column get column name m sqlinsert append append m column get column name m sqlinsertvalue append append getsql value c log get old value m numbercolumns 1 just new column else m sqlupdate append insert if m isinsert m isinsert c log is new null if m isinsert m keycolumn equals m column get column name m sqlinsert append append m column get column name m sqlinsertvalue append append getsql value c log get old value m numbercolumns update set clause column name value m sqlupdate append m column get column name append un do a b if p checknewvalue null m sqlupdate append getsql value c log get old value if p checknewvalue boolean value m sqlupdatewhere append and append m column get column name append append getsql value c log get new value re do a b else if p checkoldvalue null m sqlupdate append getsql value c log get new value if p checkoldvalue boolean value m sqlupdatewhere append and append m column get column name append append getsql value c log get old value clog trxname createstatement mchangelog clog trxname m_table clog getad_table_id m_table getad_table_id executestatement m_table m_table m_table m_table getctx clog getad_table_id trxname m_sqlupdate clog getrecord_id m_oldrecord_id executestatement m_column m_column getctx clog getad_column_id get_trxname m_columns m_column getcolumnname executestatement m_columns m_column getcolumnname m_sqlupdate tablename m_table gettablename m_keycolumn m_table gettablename _id tablename ad_ref_table m_keycolumn ad_reference_id m_sqlupdate stringbuffer tablename m_sqlupdatewhere stringbuffer m_keycolumn clog getrecord_id m_oldrecord_id clog getrecord_id undo m_isinsert clog isnewnull p_checknewvalue m_isinsert m_sqlinsert stringbuffer tablename m_keycolumn m_sqlinsertvalue stringbuffer clog getrecord_id m_keycolumn m_column getcolumnname m_sqlinsert m_column getcolumnname m_sqlinsertvalue getsqlvalue clog getoldvalue m_numbercolumns m_sqlupdate m_isinsert m_isinsert clog isnewnull m_isinsert m_keycolumn m_column getcolumnname m_sqlinsert m_column getcolumnname m_sqlinsertvalue getsqlvalue clog getoldvalue m_numbercolumns columnname m_sqlupdate m_column getcolumnname undo p_checknewvalue m_sqlupdate getsqlvalue clog getoldvalue p_checknewvalue booleanvalue m_sqlupdatewhere m_column getcolumnname getsqlvalue clog getnewvalue redo p_checkoldvalue m_sqlupdate getsqlvalue clog getnewvalue p_checkoldvalue booleanvalue m_sqlupdatewhere m_column getcolumnname getsqlvalue clog getoldvalue get sql value param value string value return sql compliant value private string getsql value string value if value null value length 0 value equals null return null data types if display type is numeric m column getad reference id display type isid m column getad reference id return value if display type yes no m column getad reference id if value equals true return y else return n if display type is date m column getad reference id return db to date timestamp value of value string etc return db to string value getsqlvalue displaytype isnumeric m_column getad_reference_id displaytype m_column getad_reference_id displaytype yesno m_column getad_reference_id displaytype isdate m_column getad_reference_id to_date valueof to_string execute statement return true if ok private boolean execute statement if m sqlupdate null return false int no 0 insert sql if m isinsert m numbercolumns 2 m sqlinsert append m sqlinsertvalue append log info m sqlinsert to string no db execute update m sqlinsert to string get trxname if no 1 m errors else if no 0 log warning insert failed m sqlinsert m checkfailed else m ok else update sql m sqlupdate append m sqlupdatewhere log info m sqlupdate to string no db execute update m sqlupdate to string get trxname if no 1 m errors else if no 0 log warning failed m sqlupdate m checkfailed else m ok reset m sqlupdate null m sqlupdatewhere null m sqlinsert null m sqlinsertvalue null m columns new array list string return no 0 executestatement m_sqlupdate m_isinsert m_numbercolumns m_sqlinsert m_sqlinsertvalue m_sqlinsert tostring executeupdate m_sqlinsert tostring get_trxname m_errors m_sqlinsert m_checkfailed m_ok m_sqlupdate m_sqlupdatewhere m_sqlupdate tostring executeupdate m_sqlupdate tostring get_trxname m_errors m_sqlupdate m_checkfailed m_ok m_sqlupdate m_sqlupdatewhere m_sqlinsert m_sqlinsertvalue m_columns arraylist set customization flag return summary private string set customization log info string sql update ad changelog set is customization n where is customization y int reset no db execute update sql get trxname int update no 0 get tables sql select from ad table t table with entity type where exists select from ad column c where t ad table id c ad table id and c column name entity type changed tables and exists select from ad changelog l where t ad table id l ad table id string buffer update null prepared statement pstmt null try pstmt db prepare statement sql get trxname result set rs pstmt execute query while rs next m table table new m table get ctx rs get trxname string table name table get table name string column name table name id if table name equals ad ref table column name ad reference id update new string buffer update ad changelog set is customization y where ad table id append table getad table id update append and record id in select append column name append from append table name append where entity type in d c int no db execute update update to string get trxname log config table get table name no update no no rs close pstmt close pstmt null catch exception e log log level severe sql update e try if pstmt null pstmt close pstmt null catch exception e pstmt null return reset reset no updated update no setcustomization ad_changelog iscustomization iscustomization resetno executeupdate get_trxname updateno ad_table entitytype ad_column ad_table_id ad_table_id columnname entitytype ad_changelog ad_table_id ad_table_id stringbuffer preparedstatement preparestatement get_trxname resultset executequery m_table m_table getctx get_trxname tablename gettablename columnname tablename _id tablename ad_ref_table columnname ad_reference_id stringbuffer ad_changelog iscustomization ad_table_id getad_table_id record_id columnname tablename entitytype executeupdate tostring get_trxname gettablename updateno resetno updateno public class ruby theme extends default metal theme public string get name return ruby rubytheme defaultmetaltheme getname private final colorui resource primary3 new colorui resource 244 10 66 protected colorui resource get primary1 return primary1 coloruiresource coloruiresource coloruiresource getprimary1 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 coloruiresource getprimary1 coloruiresource getprimary2 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 protected colorui resource get primary3 return primary3 coloruiresource getprimary1 coloruiresource getprimary2 coloruiresource getprimary3 standard constructor public x s timeexpenseline properties ctx int s timeexpenseline id string trx name super ctx s timeexpenseline id trx name if s timeexpenseline id 0 set date expense new timestamp system current time millis date expense date report set is invoiced false set is time report false set line 0 sql select nvl max line 0 10 as default value from s timeexpenseline where s timeexpense id s timeexpense id set processed false sets timeexpenseline id 0 sets timeexpense id 0 x_s_timeexpenseline s_timeexpenseline_id trxname s_timeexpenseline_id trxname s_timeexpenseline_id setdateexpense currenttimemillis dateexpense datereport setisinvoiced setistimereport setline defaultvalue s_timeexpenseline s_timeexpense_id s_timeexpense_id setprocessed sets_timeexpenseline_id sets_timeexpense_id load constructor public x s timeexpenseline properties ctx result set rs string trx name super ctx rs trx name x_s_timeexpenseline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s timeexpenseline append get id append return sb to string tostring stringbuffer stringbuffer x_s_timeexpenseline get_id tostring set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set valuenocheck c orderline id null else set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_valuenocheck c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set project phase phase of a project public void setc projectphase id int c projectphase id if c projectphase id 0 set value c projectphase id null else set value c projectphase id new integer c projectphase id setc_projectphase_id c_projectphase_id c_projectphase_id set_value c_projectphase_id set_value c_projectphase_id c_projectphase_id get project phase phase of a project public int getc projectphase id integer ii integer get value c projectphase id if ii null return 0 return ii int value getc_projectphase_id get_value c_projectphase_id intvalue set project task actual project task in a phase public void setc projecttask id int c projecttask id if c projecttask id 0 set value c projecttask id null else set value c projecttask id new integer c projecttask id setc_projecttask_id c_projecttask_id c_projecttask_id set_value c_projecttask_id set_value c_projecttask_id c_projecttask_id get project task actual project task in a phase public int getc projecttask id integer ii integer get value c projecttask id if ii null return 0 return ii int value getc_projecttask_id get_value c_projecttask_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set converted amount converted amount public void set converted amt big decimal converted amt set value converted amt converted amt setconvertedamt bigdecimal convertedamt set_value convertedamt convertedamt get converted amount converted amount public big decimal get converted amt big decimal bd big decimal get value converted amt if bd null return env zero return bd bigdecimal getconvertedamt bigdecimal bigdecimal get_value convertedamt set expense date date of expense public void set date expense timestamp date expense if date expense null throw new illegal argument exception date expense is mandatory set value date expense date expense setdateexpense dateexpense dateexpense illegalargumentexception dateexpense set_value dateexpense dateexpense get expense date date of expense public timestamp get date expense return timestamp get value date expense getdateexpense get_value dateexpense set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set expense amount amount for this expense public void set expense amt big decimal expense amt set value expense amt expense amt setexpenseamt bigdecimal expenseamt set_value expenseamt expenseamt get expense amount amount for this expense public big decimal get expense amt big decimal bd big decimal get value expense amt if bd null return env zero return bd bigdecimal getexpenseamt bigdecimal bigdecimal get_value expenseamt set invoice price unit price to be invoiced or 0 for default price public void set invoice price big decimal invoice price set value invoice price invoice price setinvoiceprice bigdecimal invoiceprice set_value invoiceprice invoiceprice get invoice price unit price to be invoiced or 0 for default price public big decimal get invoice price big decimal bd big decimal get value invoice price if bd null return env zero return bd bigdecimal getinvoiceprice bigdecimal bigdecimal get_value invoiceprice set invoiced is this invoiced public void set is invoiced boolean is invoiced set value is invoiced new boolean is invoiced setisinvoiced isinvoiced set_value isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set time report line is a time report only no expense public void set is time report boolean is time report set value is time report new boolean is time report setistimereport istimereport set_value istimereport istimereport get time report line is a time report only no expense public boolean is time report object oo get value is time report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istimereport get_value istimereport booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set note optional additional user defined information public void set note string note if note null note length 255 log warning length 255 truncated note note substring 0 254 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set price invoiced the priced invoiced to the customer in the currency of the customer s ar price list 0 for default price public void set price invoiced big decimal price invoiced set value price invoiced price invoiced setpriceinvoiced bigdecimal priceinvoiced set_value priceinvoiced priceinvoiced get price invoiced the priced invoiced to the customer in the currency of the customer s ar price list 0 for default price public big decimal get price invoiced big decimal bd big decimal get value price invoiced if bd null return env zero return bd bigdecimal getpriceinvoiced bigdecimal bigdecimal get_value priceinvoiced set price reimbursed the reimbursed price in currency of the employee s ap price list public void set price reimbursed big decimal price reimbursed set value price reimbursed price reimbursed setpricereimbursed bigdecimal pricereimbursed set_value pricereimbursed pricereimbursed get price reimbursed the reimbursed price in currency of the employee s ap price list public big decimal get price reimbursed big decimal bd big decimal get value price reimbursed if bd null return env zero return bd bigdecimal getpricereimbursed bigdecimal bigdecimal get_value pricereimbursed set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set quantity reimbursed the reimbursed quantity public void set qty reimbursed big decimal qty reimbursed set value qty reimbursed qty reimbursed setqtyreimbursed bigdecimal qtyreimbursed set_value qtyreimbursed qtyreimbursed get quantity reimbursed the reimbursed quantity public big decimal get qty reimbursed big decimal bd big decimal get value qty reimbursed if bd null return env zero return bd bigdecimal getqtyreimbursed bigdecimal bigdecimal get_value qtyreimbursed set resource assignment resource assignment public void sets resourceassignment id int s resourceassignment id if s resourceassignment id 0 set value s resourceassignment id null else set value s resourceassignment id new integer s resourceassignment id sets_resourceassignment_id s_resourceassignment_id s_resourceassignment_id set_value s_resourceassignment_id set_value s_resourceassignment_id s_resourceassignment_id get resource assignment resource assignment public int gets resourceassignment id integer ii integer get value s resourceassignment id if ii null return 0 return ii int value gets_resourceassignment_id get_value s_resourceassignment_id intvalue set expense line time and expense report line public void sets timeexpenseline id int s timeexpenseline id if s timeexpenseline id 1 throw new illegal argument exception s timeexpenseline id is mandatory set valuenocheck s timeexpenseline id new integer s timeexpenseline id sets_timeexpenseline_id s_timeexpenseline_id s_timeexpenseline_id illegalargumentexception s_timeexpenseline_id set_valuenocheck s_timeexpenseline_id s_timeexpenseline_id get expense line time and expense report line public int gets timeexpenseline id integer ii integer get value s timeexpenseline id if ii null return 0 return ii int value gets_timeexpenseline_id get_value s_timeexpenseline_id intvalue set expense report time and expense report public void sets timeexpense id int s timeexpense id if s timeexpense id 1 throw new illegal argument exception s timeexpense id is mandatory set valuenocheck s timeexpense id new integer s timeexpense id sets_timeexpense_id s_timeexpense_id s_timeexpense_id illegalargumentexception s_timeexpense_id set_valuenocheck s_timeexpense_id s_timeexpense_id get expense report time and expense report public int gets timeexpense id integer ii integer get value s timeexpense id if ii null return 0 return ii int value gets_timeexpense_id get_value s_timeexpense_id intvalue set time type type of time recorded public void sets timetype id int s timetype id if s timetype id 0 set value s timetype id null else set value s timetype id new integer s timetype id sets_timetype_id s_timetype_id s_timetype_id set_value s_timetype_id set_value s_timetype_id s_timetype_id get time type type of time recorded public int gets timetype id integer ii integer get value s timetype id if ii null return 0 return ii int value gets_timetype_id get_value s_timetype_id intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else log log level severe unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername ad_client_id m_ad_client_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i bpartner where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i bpartner set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id 0 is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log fine reset no set bp group sql new string buffer update i bpartner i set group value select value from c bp group g where g is default y and g ad client id i ad client id and rownum 1 where group value is null and c bp group id is null and i isimported y append client check no db execute update sql to string get trxname log fine set group default no sql new string buffer update i bpartner i set c bp group id select c bp group id from c bp group g where i group value g value and g ad client id i ad client id where c bp group id is null and i isimported y append client check no db execute update sql to string get trxname log fine set group no sql new string buffer update i bpartner set i isimported e i errormsg i errormsg err invalid group where c bp group id is null and i isimported y append client check no db execute update sql to string get trxname log config invalid group no set country sql new string buffer update i bpartner i set country code select country code from c country c where c is default y and c ad client id in 0 i ad client id and rownum 1 where country code is null and c country id is null and i isimported y append client check no db execute update sql to string get trxname log fine set country default no sql new string buffer update i bpartner i set c country id select c country id from c country c where i country code c country code and c ad client id in 0 i ad client id where c country id is null and i isimported y append client check no db execute update sql to string get trxname log fine set country no sql new string buffer update i bpartner set i isimported e i errormsg i errormsg err invalid country where c country id is null and city is not null or address1 is not null and i isimported y append client check no db execute update sql to string get trxname log config invalid country no set region sql new string buffer update i bpartner i set region name select name from c region r where r is default y and r c country id i c country id and r ad client id in 0 i ad client id and rownum 1 where region name is null and c region id is null and i isimported y append client check no db execute update sql to string get trxname log fine set region default no sql new string buffer update i bpartner i set c region id select c region id from c region r where r name i region name and r c country id i c country id and r ad client id in 0 i ad client id where c region id is null and i isimported y append client check no db execute update sql to string get trxname log fine set region no sql new string buffer update i bpartner i set i isimported e i errormsg i errormsg err invalid region where c region id is null and exists select from c country c where c c country id i c country id and c has region y and i isimported y append client check no db execute update sql to string get trxname log config invalid region no set greeting sql new string buffer update i bpartner i set c greeting id select c greeting id from c greeting g where i bp contact greeting g name and g ad client id in 0 i ad client id where c greeting id is null and bp contact greeting is not null and i isimported y append client check no db execute update sql to string get trxname log fine set greeting no sql new string buffer update i bpartner i set i isimported e i errormsg i errormsg err invalid greeting where c greeting id is null and bp contact greeting is not null and i isimported y append client check no db execute update sql to string get trxname log config invalid greeting no existing user sql new string buffer update i bpartner i set c bpartner id ad user id select c bpartner id ad user id from ad user u where i e mail u e mail and u ad client id i ad client id where i e mail is not null and i isimported n append client check no db execute update sql to string get trxname log fine found e mail user no existing b partner match value sql new string buffer update i bpartner i set c bpartner id select c bpartner id from c bpartner p where i value p value and p ad client id i ad client id where c bpartner id is null and value is not null and i isimported n append client check no db execute update sql to string get trxname log fine found b partner no existing contact match name sql new string buffer update i bpartner i set ad user id select ad user id from ad user c where i contact name c name and i c bpartner id c c bpartner id and c ad client id i ad client id where c bpartner id is not null and ad user id is null and contact name is not null and i isimported n append client check no db execute update sql to string get trxname log fine found contact no existing location exact match sql new string buffer update i bpartner i set c bpartner location id select c bpartner location id from c bpartner location bpl inner join c location l on bpl c location id l c location id where i c bpartner id bpl c bpartner id and bpl ad client id i ad client id and dump i address1 dump l address1 and dump i address2 dump l address2 and dump i city dump l city and dump i postal dump l postal and dump i postal add dump l postal add and dump i c region id dump l c region id and dump i c country id dump l c country id where c bpartner id is not null and c bpartner location id is null and i isimported n append client check no db execute update sql to string get trxname log fine found location no interest area sql new string buffer update i bpartner i set r interestarea id select r interestarea id from r interestarea ia where i interest area name ia name and ia ad client id i ad client id where r interestarea id is null and interest area name is not null and i isimported n append client check no db execute update sql to string get trxname log fine set interest area no commit int no insert 0 int no update 0 go through records sql new string buffer select from i bpartner where i isimported n append client check try prepared statement pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next x i bpartner impbp new x i bpartner get ctx rs get trxname log fine i bpartner id impbp geti bpartner id c bpartner id impbp getc bpartner id c bpartner location id impbp getc bpartner location id ad user id impbp getad user id create update b partner mb partner bp null if impbp getc bpartner id 0 insert new b partner bp new mb partner impbp if bp save impbp setc bpartner id bp getc bpartner id log finest insert b partner bp getc bpartner id no insert else sql new string buffer update i bpartner i set i isimported e i errormsg i errormsg append cannot insert b partner append where i bpartner id append impbp geti bpartner id db execute update sql to string get trxname continue else update existing b partner bp new mb partner get ctx impbp getc bpartner id get trxname if impbp get value null not to overwite bp set value impbp get value if impbp get name null bp set name impbp get name bp set name2 impbp get name2 if impbp getduns null bp setduns impbp getduns if impbp get taxid null bp set taxid impbp get taxid if impbp getnaics null bp setnaics impbp getn doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_bpartner i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_bpartner ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname bp_group stringbuffer i_bpartner groupvalue c_bp_group isdefault ad_client_id ad_client_id groupvalue c_bp_group_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_bp_group_id c_bp_group_id c_bp_group groupvalue ad_client_id ad_client_id c_bp_group_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner i_isimported i_errormsg i_errormsg c_bp_group_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner countrycode countrycode c_country isdefault ad_client_id ad_client_id countrycode c_country_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_country_id c_country_id c_country countrycode countrycode ad_client_id ad_client_id c_country_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner i_isimported i_errormsg i_errormsg c_country_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner regionname c_region isdefault c_country_id c_country_id ad_client_id ad_client_id regionname c_region_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_region_id c_region_id c_region regionname c_country_id c_country_id ad_client_id ad_client_id c_region_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner i_isimported i_errormsg i_errormsg c_region_id c_country c_country_id c_country_id hasregion i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_greeting_id c_greeting_id c_greeting bpcontactgreeting ad_client_id ad_client_id c_greeting_id bpcontactgreeting i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner i_isimported i_errormsg i_errormsg c_greeting_id bpcontactgreeting i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_bpartner_id ad_user_id c_bpartner_id ad_user_id ad_user email email ad_client_id ad_client_id email i_isimported clientcheck executeupdate tostring get_trxname email bpartner stringbuffer i_bpartner c_bpartner_id c_bpartner_id c_bpartner ad_client_id ad_client_id c_bpartner_id i_isimported clientcheck executeupdate tostring get_trxname bpartner stringbuffer i_bpartner ad_user_id ad_user_id ad_user contactname c_bpartner_id c_bpartner_id ad_client_id ad_client_id c_bpartner_id ad_user_id contactname i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner c_bpartner_location_id c_bpartner_location_id c_bpartner_location c_location c_location_id c_location_id c_bpartner_id c_bpartner_id ad_client_id ad_client_id postal_add postal_add c_region_id c_region_id c_country_id c_country_id c_bpartner_id c_bpartner_location_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bpartner r_interestarea_id r_interestarea_id r_interestarea interestareaname ad_client_id ad_client_id r_interestarea_id interestareaname i_isimported clientcheck executeupdate tostring get_trxname noinsert noupdate stringbuffer i_bpartner i_isimported clientcheck preparedstatement preparestatement tostring get_trxname resultset executequery x_i_bpartner x_i_bpartner getctx get_trxname i_bpartner_id geti_bpartner_id c_bpartner_id getc_bpartner_id c_bpartner_location_id getc_bpartner_location_id ad_user_id getad_user_id bpartner mbpartner getc_bpartner_id bpartner mbpartner setc_bpartner_id getc_bpartner_id bpartner getc_bpartner_id noinsert stringbuffer i_bpartner i_isimported i_errormsg i_errormsg bpartner i_bpartner_id geti_bpartner_id executeupdate tostring get_trxname bpartner mbpartner getctx getc_bpartner_id get_trxname getvalue setvalue getvalue getname setname getname setname2 getname2 gettaxid settaxid gettaxid constructor public queryb partner pos panel pos panel super pos panel querybpartner pospanel pospanel pospanel set up panel protected void init set layout new border layout 5 5 set visible false north north panel new c panel new grid bag layout add north panel border layout north north panel set border new titled border msg get msg p ctx query grid bag constraints gbc new grid bag constraints gbc insets pos sub panel insets2 gbc gridy 0 gbc gridx grid bag constraints relative c label lvalue new c label msg translate p ctx value gbc anchor grid bag constraints east north panel add lvalue gbc f value new c text field 10 lvalue set label for f value gbc anchor grid bag constraints west north panel add f value gbc f value add action listener this c label lcontact new c label msg translate p ctx contact gbc anchor grid bag constraints east north panel add lcontact gbc f contact new c text field 10 lcontact set label for f contact gbc anchor grid bag constraints west north panel add f contact gbc f contact add action listener this c label lphone new c label msg translate p ctx phone gbc anchor grid bag constraints east north panel add lphone gbc f phone new c text field 10 lphone set label for f phone gbc anchor grid bag constraints west north panel add f phone gbc f phone add action listener this gbc gridy 1 c label lname new c label msg translate p ctx name gbc anchor grid bag constraints east north panel add lname gbc f name new c text field 10 lname set label for f name gbc anchor grid bag constraints west north panel add f name gbc f name add action listener this c label lemail new c label msg translate p ctx email gbc anchor grid bag constraints east north panel add lemail gbc f email new c text field 10 lemail set label for f email gbc anchor grid bag constraints west north panel add f email gbc f email add action listener this c label lcity new c label msg translate p ctx city gbc anchor grid bag constraints east north panel add lcity gbc f city new c text field 10 lcity set label for f city gbc anchor grid bag constraints west north panel add f city gbc f city add action listener this gbc gridy 0 gbc gridheight 2 gbc anchor grid bag constraints east gbc weightx 1 f up create button action previous key stroke get key stroke key event vk up 0 north panel add f up gbc gbc weightx 0 f down create button action next key stroke get key stroke key event vk down 0 north panel add f down gbc confirm confirm new confirm panel true true true false false false false add confirm border layout south confirm add action listener this center m table new mini table string sql m table prepare table s layout s sqlfrom s sqlwhere false rv bpartner order by value m table set row selection allowed true m table set column selection allowed false m table set multi selection false m table add mouse listener this m table get selection model add list selection listener this enable buttons center scroll new c scroll pane m table add center scroll border layout center setlayout borderlayout setvisible northpanel cpanel gridbaglayout northpanel borderlayout northpanel setborder titledborder getmsg p_ctx gridbagconstraints gridbagconstraints possubpanel gridbagconstraints clabel clabel p_ctx gridbagconstraints northpanel f_value ctextfield setlabelfor f_value gridbagconstraints northpanel f_value f_value addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_contact ctextfield setlabelfor f_contact gridbagconstraints northpanel f_contact f_contact addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_phone ctextfield setlabelfor f_phone gridbagconstraints northpanel f_phone f_phone addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_name ctextfield setlabelfor f_name gridbagconstraints northpanel f_name f_name addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_email ctextfield setlabelfor f_email gridbagconstraints northpanel f_email f_email addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_city ctextfield setlabelfor f_city gridbagconstraints northpanel f_city f_city addactionlistener gridbagconstraints f_up createbuttonaction keystroke getkeystroke keyevent vk_up northpanel f_up f_down createbuttonaction keystroke getkeystroke keyevent vk_down northpanel f_down confirmpanel borderlayout addactionlistener m_table minitable m_table preparetable s_layout s_sqlfrom s_sqlwhere rv_bpartner m_table setrowselectionallowed m_table setcolumnselectionallowed m_table setmultiselection m_table addmouselistener m_table getselectionmodel addlistselectionlistener enablebuttons centerscroll cscrollpane m_table centerscroll borderlayout get grid bag constraints return constraints protected grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy grid bag constraints relative gbc gridwidth 2 grid bag constraints remainder gbc fill grid bag constraints both gbc weightx 0 1 gbc weighty 0 5 return gbc gridbagconstraints gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints gridbagconstraints gridbagconstraints gridbagconstraints dispose public void dispose remove all north panel null center scroll null confirm null m table null removeall northpanel centerscroll m_table set visible param a flag visible public void set visible boolean a flag super set visible a flag if a flag f value request focus aflag setvisible aflag setvisible aflag aflag f_value requestfocus action listener param e event public void action performed action event e log info e get action command if refresh equals e get action command e get source f value e get source f upc e get source f name e get source f sku set results mb partner info find p ctx f value get text f name get text f contact get text f email get text f phone get text f city get text return else if reset equals e get action command f value set text null f name set text null f contact set text null f email set text null f phone set text null f city set text null set results new mb partner info 0 return else if previous equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row 0 row 0 m table get selection model set selection interval row row return else if next equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row rows row rows 1 m table get selection model set selection interval row row return exit close actionperformed actionevent getactioncommand getactioncommand getsource f_value getsource f_upc getsource f_name getsource f_sku setresults mbpartnerinfo p_ctx f_value gettext f_name gettext f_contact gettext f_email gettext f_phone gettext f_city gettext getactioncommand f_value settext f_name settext f_contact settext f_email settext f_phone settext f_city settext setresults mbpartnerinfo equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval set display results param results results public void set results mb partner info results m table load table results enable buttons setresults mbpartnerinfo m_table loadtable enablebuttons table selection changed param e event public void value changed list selection event e if e get value is adjusting return enable buttons valuechanged listselectionevent getvalueisadjusting enablebuttons enable set buttons and set id private void enable buttons m c bpartner id 1 int row m table get selected row boolean enabled row 1 if enabled integer id m table get selected row key if id null m c bpartner id id int value m bpartnername string m table get value at row 2 m price big decimal m table get value at row 7 confirm getok button set enabled enabled log fine c bpartner id m c bpartner id enablebuttons m_c_bpartner_id m_table getselectedrow m_table getselectedrowkey m_c_bpartner_id intvalue m_bpartnername m_table getvalueat m_price bigdecimal m_table getvalueat getokbutton setenabled c_bpartner_id m_c_bpartner_id mouse clicked param e event public void mouse clicked mouse event e double click with selected row exit if e get click count 1 m table get selected row 1 enable buttons close mouseclicked mouseevent getclickcount m_table getselectedrow enablebuttons mouse clicked public void mouse entered mouse event e mouseclicked mouseentered mouseevent public void mouse entered mouse event e public void mouse exited mouse event e mouseentered mouseevent mouseexited mouseevent public void mouse entered mouse event e public void mouse exited mouse event e public void mouse pressed mouse event e mouseentered mouseevent mouseexited mouseevent mousepressed mouseevent public void mouse exited mouse event e public void mouse pressed mouse event e public void mouse released mouse event e mouseexited mouseevent mousepressed mouseevent mousereleased mouseevent close set values on other panels and close private void close log fine c bpartner id m c bpartner id if m c bpartner id 0 p pospanel f bpartner setc bpartner id m c bpartner id p pospanel f curline set currency m price else p pospanel f bpartner setc bpartner id 0 p pospanel f curline set price env zero p pospanel close query this c_bpartner_id m_c_bpartner_id m_c_bpartner_id p_pospanel f_bpartner setc_bpartner_id m_c_bpartner_id p_pospanel f_curline setcurrency m_price p_pospanel f_bpartner setc_bpartner_id p_pospanel f_curline setprice p_pospanel closequery constructor param ctx context param pa reportlineset id id public m report line set properties ctx int pa reportlineset id string trx name super ctx pa reportlineset id trx name if pa reportlineset id 0 else load lines pa_reportlineset_id mreportlineset pa_reportlineset_id trxname pa_reportlineset_id trxname pa_reportlineset_id loadlines load lines private void load lines array list m report line list new array list m report line string sql select from pa reportline where pa reportlineset id and is active y order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa reportlineset id result set rs pstmt execute query while rs next list add new m report line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m lines new m report line list size list to array m lines log finest id getpa reportlineset id size list size loadlines arraylist mreportline arraylist mreportline pa_reportline pa_reportlineset_id isactive seqno preparedstatement preparestatement get_trxname setint getpa_reportlineset_id resultset executequery mreportline getctx get_trxname m_lines mreportline toarray m_lines getpa_reportlineset_id get liness return array of lines public m report line get liness return m lines mreportline getliness m_lines list info public void list system out println to string if m lines null return for int i 0 i m lines length i m lines i list tostring m_lines m_lines m_lines public string to string string buffer sb new string buffer m report line set append get id append append get name append return sb to string tostring stringbuffer stringbuffer mreportlineset get_id getname tostring workflow processor param model model public workflow processor m workflow processor model super model 120 2 minute dalay m model model m client m client get model get ctx model getad client id workflowprocessor workflowprocessor mworkflowprocessor m_model m_client mclient getctx getad_client_id work protected void do work m summary new string buffer wakeup dynamic priority send alerts int no m model delete log m summary append logs deleted append no m workflow processor log p log new m workflow processor log m model m summary to string p log set reference string value of p runcount time util format elapsed new timestamp p startwork p log save dowork m_summary stringbuffer dynamicpriority sendalerts m_model deletelog m_summary mworkflowprocessorlog plog mworkflowprocessorlog m_model m_summary tostring plog setreference valueof p_runcount timeutil formatelapsed p_startwork plog continue workflow after sleep private void wakeup string sql select from ad wf activity a where processed n and wf state os suspended and end wait time sys date and ad client id and exists select from ad workflow wf inner join ad wf node wfn on wf ad workflow id wfn ad workflow id where a ad wf node id wfn ad wf node id and wfn action z sleeping and wf ad workflowprocessor id is null or wf ad workflowprocessor id prepared statement pstmt null int count 0 int counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id pstmt set int 2 m model getad workflowprocessor id result set rs pstmt execute query while rs next mwf activity activity new mwf activity get ctx rs null activity setwf state state engine state completed saves and calls mwf process check activities count rs close pstmt close pstmt null catch exception e log log level severe wakeup e m summary append wakeup append count append ad_wf_activity wfstate endwaittime sysdate ad_client_id ad_workflow ad_wf_node ad_workflow_id ad_workflow_id ad_wf_node_id ad_wf_node_id ad_workflowprocessor_id ad_workflowprocessor_id preparedstatement countemails preparestatement setint m_model getad_client_id setint m_model getad_workflowprocessor_id resultset executequery mwfactivity mwfactivity getctx setwfstate stateengine state_completed mwfprocess checkactivities m_summary set increase priority dynamically private void dynamic priority suspened activities with dynamic priority node string sql select from ad wf activity a where processed n and wf state os suspended and exists select from ad workflow wf inner join ad wf node wfn on wf ad workflow id wfn ad workflow id where a ad wf node id wfn ad wf node id and wf ad workflowprocessor id and wfn dyn priority unit is not null and wfn dyn priority change is not null prepared statement pstmt null int count 0 int counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad workflowprocessor id result set rs pstmt execute query while rs next mwf activity activity new mwf activity get ctx rs null if activity get dyn priority start 0 activity set dyn priority start activity get priority long ms system current time millis activity get created get time mwf node node activity get node int prio diff node calculate dynamic priority int ms 1000 activity set priority activity get dyn priority start prio diff activity save count rs close pstmt close pstmt null catch exception e log log level severe sql e m summary append dyn priority append count append cleanup try if pstmt null pstmt close pstmt null catch exception e pstmt null dynamicpriority ad_wf_activity wfstate ad_workflow ad_wf_node ad_workflow_id ad_workflow_id ad_wf_node_id ad_wf_node_id ad_workflowprocessor_id dynpriorityunit dynprioritychange preparedstatement countemails preparestatement setint m_model getad_workflowprocessor_id resultset executequery mwfactivity mwfactivity getctx getdynprioritystart setdynprioritystart getpriority currenttimemillis getcreated gettime mwfnode getnode priodiff calculatedynamicpriority setpriority getdynprioritystart priodiff m_summary dynpriority send alerts private void send alerts alert over priority if m model get alert over priority 0 string sql select from ad wf activity a where processed n and wf state os suspended and priority 1 and date last alert is null if m model get remind days 0 sql or date last alert m model get remind days sys date sql and exists select from ad workflow wf inner join ad wf node wfn on wf ad workflow id wfn ad workflow id where a ad wf node id wfn ad wf node id and wf ad workflowprocessor id is null or wf ad workflowprocessor id int count 0 int counte mails 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m model get alert over priority pstmt set int 2 m model getad workflowprocessor id result set rs pstmt execute query while rs next mwf activity activity new mwf activity get ctx rs null boolean escalate activity get date last alert null counte mails send email activity activity over priority escalate true activity set date last alert new timestamp system current time millis activity save count rs close pstmt close catch sql exception e log log level severe priority sql e m summary append over priority append count if counte mails 0 m summary append append counte mails append e mail m summary append alert over priority over end wait string sql select from ad wf activity a where processed n and wf state os suspended and end wait time sys date and date last alert is null if m model get remind days 0 sql or date last alert m model get remind days sys date sql and exists select from ad workflow wf inner join ad wf node wfn on wf ad workflow id wfn ad workflow id where a ad wf node id wfn ad wf node id and wfn action z not sleeping and wf ad workflowprocessor id is null or wf ad workflowprocessor id prepared statement pstmt null int count 0 int counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad workflowprocessor id result set rs pstmt execute query while rs next mwf activity activity new mwf activity get ctx rs null boolean escalate activity get date last alert null counte mails send email activity activity end wait time escalate false activity set date last alert new timestamp system current time millis activity save count rs close pstmt close pstmt null catch exception e log log level severe end wait time sql e m summary append end wait time append count if counte mails 0 m summary append append counte mails append e mail m summary append send inactivity alerts if m model get inactivity alert days 0 sql select from ad wf activity a where processed n and wf state os suspended and updated m model get inactivity alert days sys date and date last alert is null if m model get remind days 0 sql or date last alert m model get remind days sys date sql and exists select from ad workflow wf inner join ad wf node wfn on wf ad workflow id wfn ad workflow id where a ad wf node id wfn ad wf node id and wf ad workflowprocessor id is null or wf ad workflowprocessor id count 0 counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad workflowprocessor id result set rs pstmt execute query while rs next mwf activity activity new mwf activity get ctx rs null boolean escalate activity get date last alert null counte mails send email activity activity inactivity escalate false activity set date last alert new timestamp system current time millis activity save count rs close pstmt close catch sql exception e log log level severe inactivity sql e m summary append inactivity append count if counte mails 0 m summary append append counte mails append e mail m summary append inactivity cleanup try if pstmt null pstmt close pstmt null catch exception e pstmt null sendalerts m_model getalertoverpriority ad_wf_activity wfstate datelastalert m_model getreminddays datelastalert m_model getreminddays sysdate ad_workflow ad_wf_node ad_workflow_id ad_workflow_id ad_wf_node_id ad_wf_node_id ad_workflowprocessor_id ad_workflowprocessor_id countemails preparedstatement preparestatement setint m_model getalertoverpriority setint m_model getad_workflowprocessor_id resultset executequery mwfactivity mwfactivity getctx getdatelastalert countemails sendemail activityoverpriority setdatelastalert currenttimemillis sqlexception m_summary overpriority countemails m_summary countemails email m_summary ad_wf_activity wfstate endwaittime sysdate datelastalert m_model getreminddays datelastalert m_model getreminddays sysdate ad_workflow ad_wf_node ad_workflow_id ad_workflow_id ad_wf_node_id ad_wf_node_id ad_workflowprocessor_id ad_workflowprocessor_id preparedstatement countemails preparestatement setint m_model getad_workflowprocessor_id resultset executequery mwfactivity mwfactivity getctx getdatelastalert countemails sendemail activityendwaittime setdatelastalert currenttimemillis endwaittime m_summary endwaittime countemails m_summary countemails email m_summary m_model getinactivityalertdays ad_wf_activity wfstate m_model getinactivityalertdays sysdate datelastalert m_model getreminddays datelastalert m_model getreminddays sysdate ad_workflow ad_wf_node ad_workflow_id ad_workflow_id ad_wf_node_id ad_wf_node_id ad_workflowprocessor_id ad_workflowprocessor_id countemails preparestatement setint m_model getad_workflowprocessor_id resultset executequery mwfactivity mwfactivity getctx getdatelastalert countemails sendemail activityinactivity setdatelastalert currenttimemillis sqlexception m_summary countemails m_summary countemails email m_summary send alert e mail param activity activity param ad message message return number of mails sent private int send email mwf activity activity string ad message boolean to process boolean to supervisor if m client null m client getad client id activity getad client id m client m client get get ctx activity getad client id mwf process process new mwf process get ctx activity getad wf process id null string subject var activity get node get name string message activity get text msg if message null message length 0 message process get text msg file pdf null po po activity getpo if po instanceof doc action message doc action po get document info n message pdf doc action po createpdf inactivity alert workflow activity 0 string subject msg get msg m client getad language ad message new object subject var prevent duplicates array list integer list new array list integer int counter 0 to activity owner if m client sende mail activity getad user id subject message pdf counter list add new integer activity getad user id to process owner if to process process getad user id activity getad user id if m client sende mail process getad user id subject message pdf counter list add new integer process getad user id to activity responsible mwf responsible responsible mwf responsible get get ctx activity getad wf responsible id counter send alert to responsible responsible list process subject message pdf to process responsible if to process process getad wf responsible id activity getad wf responsible id responsible mwf responsible get get ctx process getad wf responsible id counter send alert to responsible responsible list process subject message pdf processor super visor if to supervisor m model getsupervisor id 0 list contains new integer m model getsupervisor id if m client sende mail m model getsupervisor id subject message pdf counter list add new integer m model getsupervisor id return counter email ad_message sendemail mwfactivity ad_message toprocess tosupervisor m_client m_client getad_client_id getad_client_id m_client mclient getctx getad_client_id mwfprocess mwfprocess getctx getad_wf_process_id subjectvar getnode getname gettextmsg gettextmsg docaction docaction getdocumentinfo docaction getmsg m_client getad_language ad_message subjectvar arraylist arraylist m_client sendemail getad_user_id getad_user_id toprocess getad_user_id getad_user_id m_client sendemail getad_user_id getad_user_id mwfresponsible mwfresponsible getctx getad_wf_responsible_id sendalerttoresponsible toprocess getad_wf_responsible_id getad_wf_responsible_id mwfresponsible getctx getad_wf_responsible_id sendalerttoresponsible supervisor tosupervisor m_model getsupervisor_id m_model getsupervisor_id m_client sendemail m_model getsupervisor_id m_model getsupervisor_id send alert to responsible param responsible responsible param list list of already sent users param process process param subject subject param message message param pdf optional pdf return number of mail sent private int send alert to responsible mwf responsible responsible array list integer list mwf process process string subject string message file pdf int counter 0 if responsible is invoker human else if mwf responsible responsibletype human equals responsible get responsible type responsible getad user id 0 list contains new integer responsible getad user id if m client sende mail responsible getad user id subject message pdf counter list add new integer responsible getad user id org of the document else if mwf responsible responsibletype organization equals responsible get responsible type po document process getpo if document null m org info org m org info get get ctx document getad org id if org getsupervisor id 0 list contains new integer org getsupervisor id if m client sende mail org getsupervisor id subject message pdf counter list add new integer org getsupervisor id role else if mwf responsible responsibletype role equals responsible get responsible type responsible getad role id 0 m user roles user roles m user roles get of role get ctx responsible getad role id for int i 0 i user roles length i m user roles roles user roles i int ad user id roles getad user id if list contains new integer ad user id if m client sende mail ad user id subject message pdf counter list add new integer ad user id return counter sendalerttoresponsible mwfresponsible arraylist mwfprocess isinvoker mwfresponsible responsibletype_human getresponsibletype getad_user_id getad_user_id m_client sendemail getad_user_id getad_user_id mwfresponsible responsibletype_organization getresponsibletype morginfo morginfo getctx getad_org_id getsupervisor_id getsupervisor_id m_client sendemail getsupervisor_id getsupervisor_id mwfresponsible responsibletype_role getresponsibletype getad_role_id muserroles userroles muserroles getofrole getctx getad_role_id userroles muserroles userroles ad_user_id getad_user_id ad_user_id m_client sendemail ad_user_id ad_user_id get server info return info public string get server info return p runcount last m summary to string getserverinfo p_runcount m_summary tostring get costing of product param ctx context param m product id product param trx name trx return array of costs public static m product costing get of product properties ctx int m product id string trx name string sql select from m product costing where m product id array list m product costing list new array list m product costing prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new m product costing ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m product costing ret value new m product costing list size list to array ret value return ret value m_product_id trxname mproductcosting getofproduct m_product_id trxname m_product_costing m_product_id arraylist mproductcosting arraylist mproductcosting preparedstatement preparestatement trxname setint m_product_id resultset executequery mproductcosting trxname s_log mproductcosting retvalue mproductcosting toarray retvalue retvalue get costing param ctx context param m product id product param c acctschema id as param trx name trx return array of costs public static m product costing get properties ctx int m product id int c acctschema id string trx name m product costing ret value null string sql select from m product costing where m product id and c acctschema id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id pstmt set int 2 c acctschema id result set rs pstmt execute query if rs next ret value new m product costing ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_product_id c_acctschema_id trxname mproductcosting m_product_id c_acctschema_id trxname mproductcosting retvalue m_product_costing m_product_id c_acctschema_id preparedstatement preparestatement trxname setint m_product_id setint c_acctschema_id resultset executequery retvalue mproductcosting trxname s_log retvalue standard constructor param ctx context param ignored multi key public m product costing properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 throw new illegal argument exception multi key else setm product id 0 setc acctschema id 0 set cost average env zero set cost average cum amt env zero set cost average cum qty env zero set cost standard env zero set cost standard cum amt env zero set cost standard cum qty env zero set cost standardpo amt env zero set cost standardpo qty env zero set current cost price env zero set future cost price env zero set price last inv env zero set price lastpo env zero set total inv amt env zero set total inv qty env zero mproductcosting trxname trxname illegalargumentexception setm_product_id setc_acctschema_id setcostaverage setcostaveragecumamt setcostaveragecumqty setcoststandard setcoststandardcumamt setcoststandardcumqty setcoststandardpoamt setcoststandardpoqty setcurrentcostprice setfuturecostprice setpricelastinv setpricelastpo settotalinvamt settotalinvqty parent constructor param product parent param c acctschema id accounting schema public m product costing m product product int c acctschema id super product get ctx 0 product get trxname set client org product setm product id product getm product id setc acctschema id c acctschema id c_acctschema_id mproductcosting mproduct c_acctschema_id getctx get_trxname setclientorg setm_product_id getm_product_id setc_acctschema_id c_acctschema_id load constructor param ctx context param rs result set public m product costing properties ctx result set rs string trx name super ctx rs trx name mproductcosting resultset trxname trxname basic constructor use set methods public bdo basic constructor sets the direction for the element param dir the direction the element should flow ltr rtl public bdo string dir set dir dir setdir sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public bdo add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public bdo add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public bdo add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public bdo add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public bdo remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry basic constructor use the set methods to set the values of the attributes public area use the set methods to set the values of the attributes param shape the shape attribute public area string shape set shape shape setshape use the set methods to set the values of the attributes param shape the shape attribute param coords the coords attribute public area string shape string coords set shape shape set coords coords setshape setcoords use the set methods to set the values of the attributes param shape the shape attribute param coords the coords attribute public area string shape int coords set shape shape set coords coords setshape setcoords use the set methods to set the values of the attributes param shape the shape attribute param coords the coords attribute param href the href attribute public area string shape string coords string href set shape shape set coords coords set href href setshape setcoords sethref use the set methods to set the values of the attributes param shape the shape attribute param coords the coords attribute param href the href attribute public area string shape int coords string href set shape shape set coords coords set href href setshape setcoords sethref sets the shape attribute param shape the shape attribute public area set shape string shape add attribute shape shape return this setshape addattribute sets the coords attribute param coords the coords attribute public area set coords string coords add attribute coords coords return this setcoords addattribute sets the coords attribute param coords the coords attribute public area set coords int coords add attribute coords coords 0 coords 1 coords 2 coords 3 return this setcoords addattribute sets the href attribute param href the href attribute public area set href string href add attribute href href set no href false return this sethref addattribute setnohref sets the alt attribute param alt the alt attribute public area set alt string alt add attribute alt alt return this setalt addattribute sets the tabindex attribute param alt the tabindex attribute public area set tabindex string index add attribute tabindex index return this settabindex addattribute sets the tabindex attribute param alt the tabindex attribute public area set tabindex int index set tabindex integer to string index return this settabindex settabindex tostring sets the nohref param href true or false public area set no href boolean href if href true add attribute nohref nohref else remove attribute nohref return this setnohref addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public area add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public area add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add an element to the element param element a string representation of the element public area add element string element add element to registry element return this addelement addelementtoregistry add an element to the element param element an element to add public area add element element element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public area remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param the script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param the script public void set on blur string script add attribute onblur script setonblur addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w task init servletconfig servletexception webenv initweb servletexception wtask process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w task get not implemented yet web util create response request response this null doc false doget httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wtask webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w task post not implemented yet web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wtask webutil createresponse initialize param config confif throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w login init servletexception servletconfig servletexception webenv initweb servletexception wlogin get servlet information return servlet info public string get servlet info return a dempiere web login getservletinfo adempiere clean up public void destroy log info destroy super destroy process the http get request forward to post param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info do get do post request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception doget dopost process the http post request pre optionally create session check database connection login info from request yes do login success yes return second preferences page no return first user password page no user principal yes do login success yes return second preferences page no return first user password page no return first user password page pre param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info do post create new session http session sess request get session true sess set max inactive interval web env timeout get cookie properties properties c prop web util get cookie proprties request create context web session ctx wsc web session ctx get request page web doc doc null check db connection if db is connected string msg msg get msg wsc ctx w login nodb if msg equals w login nodb msg no database connection doc web doc create window msg login info from request else get parameters user name password string usr web util get parameter request p username string pwd web util get parameter request p password get principle principal user principal request get user principal log info principal user principal user usr login info not from request and not pre authorized if user principal null usr null pwd null doc create first page c prop request login info from request or authorized else key name pair roles null login login new login wsc ctx pre authorized if user principal null roles login get roles user principal usr user principal get name else roles login get roles usr pwd if roles null doc create first page c prop request msg get msg wsc ctx user pwd error else doc create second page request web util convert to option roles null create compiere session user id in ctx m session get wsc ctx request get remote addr request get remote host sess get id can we save cookie if web util get parameter request p store null c prop clear erase all else save cookie parameter c prop set property p username usr c prop set property p store y c prop set property p password pwd for test only web util create response request response this c prop doc true logininfo dologin dologin servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception dopost httpsession getsession setmaxinactiveinterval webenv cprop webutil getcookieproprties websessionctx websessionctx webdoc isconnected getmsg wloginnodb wloginnodb webdoc createwindow username webutil getparameter p_username webutil getparameter p_password userprincipal getuserprincipal userprincipal userprincipal createfirstpage cprop keynamepair userprincipal getroles userprincipal userprincipal getname getroles createfirstpage cprop getmsg userpwderror createsecondpage webutil converttooption msession getremoteaddr getremotehost getid webutil getparameter p_store cprop cprop setproperty p_username cprop setproperty p_store cprop setproperty p_password webutil createresponse cprop first login page param c prop login cookie information for defaults param request request param error message error message return w doc page private web doc create first page properties c prop http servlet request request string error message log info create first page error message string ad language c prop get property env language language getad language request get locale string window title msg get msg ad language login string usr text msg get msg ad language user string pwd text msg get msg ad language password string lng text msg translate ad language ad language string ok text msg get msg ad language ok string cancel text msg get msg ad language cancel string store txt msg get msg ad language save cookie form post to same url string action request get requesturi form my form null my form new form action set name login1 table table new table set align align type center username string user data c prop get property p username tr line new tr label usr label new label set for p username f add element usr text usr label setid p username l line add element new td add element usr label set align align type right input usr new input input type text p username user data set size 20 set maxlength 30 usr setid p username f line add element new td add element usr set align align type left table add element line password string pwd data c prop get property p password line new tr label pwd label new label set for p password f add element pwd text pwd label setid p password l line add element new td add element pwd label set align align type right input pwd new input input type password p password pwd data set size 20 set maxlength 30 pwd setid p password f line add element new td add element pwd set align align type left table add element line language pick string lang data c prop get property ad language line new tr label lang label new label set for env language f add element lng text lang label setid env language l line add element new td add element lang label set align align type right option options new option language get language count for int i 0 i language get language count i language language language get language i options i new option language getad language add element util maskhtml language get name if language getad language equals lang data options i set selected true else options i set selected false line add element new td add element new select env language options setid env language f table add element line store cookie string store data c prop get property p store n line new tr line add element new td input store new input input type checkbox p store y add element store txt set checked store data equals y store setid p store f line add element new td add element store set align align type left table add element line error message if error message null error message length 0 line new tr line add element new td line add element new td set col span 2 add element new font html color red 4 add element new b error message color size table add element line finish line new tr input cancel new input input type reset reset cancel text line add element new td add element cancel line add element new td add element new input input type submit p submit ok text table add element line my form add element table document web doc doc web doc create window window title doc add window center true add element new h3 the html ui is beta functionality add element my form clear menu frame doc get body add element web util get clear frame web env target menu set title window title return doc cprop errormessage wdoc webdoc createfirstpage cprop httpservletrequest errormessage createfirstpage errormessage ad_language cprop getproperty getad_language getlocale windowtitle getmsg ad_language usrtext getmsg ad_language pwdtext getmsg ad_language lngtext ad_language ad_language oktext getmsg ad_language canceltext getmsg ad_language storetxt getmsg ad_language savecookie getrequesturi myform myform setname setalign aligntype userdata cprop getproperty p_username usrlabel setfor p_username addelement usrtext usrlabel p_username addelement addelement usrlabel setalign aligntype type_text p_username userdata setsize setmaxlength p_username addelement addelement setalign aligntype addelement pwddata cprop getproperty p_password pwdlabel setfor p_password addelement pwdtext pwdlabel p_password addelement addelement pwdlabel setalign aligntype type_password p_password pwddata setsize setmaxlength p_password addelement addelement setalign aligntype addelement langdata cprop getproperty ad_language langlabel setfor addelement lngtext langlabel addelement addelement langlabel setalign aligntype getlanguagecount getlanguagecount getlanguage getad_language addelement getname getad_language langdata setselected setselected addelement addelement addelement storedata cprop getproperty p_store addelement type_checkbox p_store addelement storetxt setchecked storedata p_store addelement addelement setalign aligntype addelement errormessage errormessage errormessage addelement addelement setcolspan addelement htmlcolor addelement errormessage addelement type_reset canceltext addelement addelement addelement addelement type_submit p_submit oktext addelement myform addelement webdoc webdoc createwindow windowtitle addwindowcenter addelement addelement myform getbody addelement webutil getclearframe webenv target_menu settitle windowtitle create second page param request request param role options role options param error message error message return w doc page private web doc create second page http servlet request request option role options string error message log info create second page error message web session ctx wsc web session ctx get request string window title msg get msg wsc language login success form get menu string action web env get base directory w menu form my form null my form new form action set name login2 my form set target web env target menu table table new table set align align type center role pick tr line new tr label role label new label set for p role f add element msg translate wsc language ad role id role label setid p role l line add element new td add element role label set align align type right select role new select p role role options role setid p role f role set on click field update this w field update sets client org line add element new td add element role table add element line client pick line new tr label client label new label set for p client f add element msg translate wsc language ad client id client label setid p client l line add element new td add element client label set align align type right select client new select p client client setid p client f client set on click field update this w field update sets org line add element new td add element client table add element line org pick line new tr label org label new label set for p org f add element msg translate wsc language ad org id org label setid p org l line add element new td add element org label set align align type right select org new select p org org setid p org f org set on click field update this w field update sets org line add element new td add element org table add element line warehouse line new tr label wh label new label set for p warehouse f add element msg translate wsc language m warehouse id wh label setid p warehouse l line add element new td add element wh label set align align type right select wh new select p warehouse wh setid p warehouse f line add element new td add element wh table add element line date string date data wsc date format format new java util date line new tr label date label new label set for p date f add element msg get msg wsc language date date label setid p date l line add element new td add element date label set align align type right input date new input input type text p date date data set size 10 set maxlength 10 date setid p date f line add element new td add element date set align align type left table add element line error message if error message null error message length 0 line new tr line add element new td add element new strong error message set col span 2 set align align type center table add element line finish line new tr input cancel new input input type reset reset msg get msg wsc language cancel line add element new td add element cancel input submit new input input type submit submit msg get msg wsc language ok submit set on click show loading menu web env get base directory line add element new td add element submit table add element line my form add element table create document web doc doc web doc create window window title doc add window center true add element new h3 the html ui is beta functionality add element my form string script field update document login2 p role init dependency updates doc get body add element new script script note doc add window footer add element new p msg get msg wsc language w login browser note align type center return doc roleoptions errormessage wdoc webdoc createsecondpage httpservletrequest roleoptions errormessage createsecondpage errormessage websessionctx websessionctx windowtitle getmsg loginsuccess webenv getbasedirectory wmenu myform myform setname myform settarget webenv target_menu setalign aligntype rolelabel setfor p_role addelement ad_role_id rolelabel p_role addelement addelement rolelabel setalign aligntype p_role roleoptions p_role setonclick fieldupdate wfieldupdate addelement addelement addelement clientlabel setfor p_client addelement ad_client_id clientlabel p_client addelement addelement clientlabel setalign aligntype p_client p_client setonclick fieldupdate wfieldupdate addelement addelement addelement orglabel setfor p_org addelement ad_org_id orglabel p_org addelement addelement orglabel setalign aligntype p_org p_org setonclick fieldupdate wfieldupdate addelement addelement addelement whlabel setfor p_warehouse addelement m_warehouse_id whlabel p_warehouse addelement addelement whlabel setalign aligntype p_warehouse p_warehouse addelement addelement addelement datedata dateformat datelabel setfor p_date addelement getmsg datelabel p_date addelement addelement datelabel setalign aligntype type_text p_date datedata setsize setmaxlength p_date addelement addelement setalign aligntype addelement errormessage errormessage errormessage addelement addelement errormessage setcolspan setalign aligntype addelement type_reset getmsg addelement addelement type_submit getmsg setonclick showloadingmenu webenv getbasedirectory addelement addelement addelement myform addelement webdoc webdoc createwindow windowtitle addwindowcenter addelement addelement myform fieldupdate p_role getbody addelement addwindowfooter addelement getmsg wloginbrowsernote aligntype get all tax codes for ad client param ctx context return m tax public static m tax get all properties ctx int ad client id env getad client id ctx integer key new integer ad client id m tax ret value m tax s cacheall get key if ret value null return ret value create it string sql select from c tax where ad client id order by c country id c region id to country id to region id array list m tax list new array list m tax prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next m tax tax new m tax ctx rs null s cache put new integer tax getc tax id tax list add tax rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null create array ret value new m tax list size list to array ret value s cacheall put key ret value return ret value ad_client mtax mtax getall ad_client_id getad_client_id ad_client_id mtax retvalue mtax s_cacheall retvalue retvalue c_tax ad_client_id c_country_id c_region_id to_country_id to_region_id arraylist mtax arraylist mtax preparedstatement preparestatement setint ad_client_id resultset executequery mtax mtax s_cache getc_tax_id s_log retvalue mtax toarray retvalue s_cacheall retvalue retvalue get tax from cache param ctx context param c tax id id return m tax public static m tax get properties ctx int c tax id integer key new integer c tax id m tax ret value m tax s cache get key if ret value null return ret value ret value new m tax ctx c tax id null if ret value get id 0 s cache put key ret value return ret value c_tax_id mtax mtax c_tax_id c_tax_id mtax retvalue mtax s_cache retvalue retvalue retvalue mtax c_tax_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c tax id id public m tax properties ctx int c tax id string trx name super ctx c tax id trx name if c tax id 0 setc tax id 0 pk set is default false set is document level true set is summary false set is tax exempt false set name null set rate env zero set requires tax certificate false setc taxcategory id 0 fk setsopo type sopotype both set valid from time util get day 1990 1 1 set is sales tax false c_tax_id mtax c_tax_id trxname c_tax_id trxname c_tax_id setc_tax_id setisdefault setisdocumentlevel setissummary setistaxexempt setname setrate setrequirestaxcertificate setc_taxcategory_id setsopotype sopotype_both setvalidfrom timeutil getday setissalestax load constructor param ctx context param rs result set public m tax properties ctx result set rs string trx name super ctx rs trx name mtax resultset trxname trxname new constructor param ctx param name param rate param c taxcategory id public m tax properties ctx string name big decimal rate int c taxcategory id string trx name this ctx 0 trx name set name name set rate rate null env zero rate setc taxcategory id c taxcategory id fk c_taxcategory_id mtax bigdecimal c_taxcategory_id trxname trxname setname setrate setc_taxcategory_id c_taxcategory_id get child taxes param requery reload return array of taxes or null public m tax get child taxes boolean requery if is summary return null if m childtaxes null requery return m childtaxes string sql select from c tax where parent tax id array list m tax list new array list m tax prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc tax id result set rs pstmt execute query while rs next list add new m tax get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m childtaxes new m tax list size list to array m childtaxes return m childtaxes mtax getchildtaxes issummary m_childtaxes m_childtaxes c_tax parent_tax_id arraylist mtax arraylist mtax preparedstatement preparestatement get_trxname setint getc_tax_id resultset executequery mtax getctx get_trxname m_childtaxes mtax toarray m_childtaxes m_childtaxes get postal qualifiers param requery requery return array of postal codes public m tax postal get postals boolean requery if m postals null requery return m postals string sql select from c taxpostal where c tax id order by postal postal to array list m tax postal list new array list m tax postal prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc tax id result set rs pstmt execute query while rs next rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m postals new m tax postal list size list to array m postals return m postals mtaxpostal getpostals m_postals m_postals c_taxpostal c_tax_id postal_to arraylist mtaxpostal arraylist mtaxpostal preparedstatement preparestatement get_trxname setint getc_tax_id resultset executequery m_postals mtaxpostal toarray m_postals m_postals do we have postal codes return true if postal codes exist public boolean is postal return get postals false length 0 ispostal getpostals is zero tax return true if tax rate is 0 public boolean is zero tax return env zero compare to get rate 0 iszerotax compareto getrate string representation return info public string to string string buffer sb new string buffer m tax sb append get id append append get name append so po append getsopo type append rate append get rate append c taxcategory id append getc taxcategory id append summary append is summary append parent append getparent tax id append country append getc country id append append getto country id append region append getc region id append append getto region id append return sb to string tostring stringbuffer stringbuffer mtax get_id getname getsopotype getrate c_taxcategory_id getc_taxcategory_id issummary getparent_tax_id getc_country_id getto_country_id getc_region_id getto_region_id tostring calculate tax no rounding param amount amount param tax included if true tax is calculated from gross otherwise from net param scale scale return tax amount public big decimal calculate tax big decimal amount boolean tax included int scale null tax if is zero tax return env zero big decimal multiplier get rate divide onehundred 12 big decimal round half up big decimal tax null if tax included 100 6 100 6 100 0 06 tax amount multiply multiplier else 106 106 100 6 100 6 106 106 1 06 multiplier multiplier add env one big decimal base amount divide multiplier 12 big decimal round half up tax amount subtract base big decimal final tax tax set scale scale big decimal round half up log fine calculate tax amount incl tax included mult multiplier scale scale final tax tax return final tax taxincluded bigdecimal calculatetax bigdecimal taxincluded iszerotax bigdecimal getrate bigdecimal round_half_up bigdecimal taxincluded bigdecimal bigdecimal round_half_up bigdecimal finaltax setscale bigdecimal round_half_up calculatetax taxincluded finaltax finaltax after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting c tax acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_tax_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c tax acct beforedelete delete_accounting c_tax_acct standard constructor public x c invoicebatch properties ctx int c invoicebatch id string trx name super ctx c invoicebatch id trx name if c invoicebatch id 0 setc currency id 0 c currency id setc invoicebatch id 0 set control amt env zero 0 set date doc new timestamp system current time millis date set document amt env zero set document no null set isso trx false n set processed false setsalesrep id 0 x_c_invoicebatch c_invoicebatch_id trxname c_invoicebatch_id trxname c_invoicebatch_id setc_currency_id c_currency_id setc_invoicebatch_id setcontrolamt setdatedoc currenttimemillis setdocumentamt setdocumentno setissotrx setprocessed setsalesrep_id load constructor public x c invoicebatch properties ctx result set rs string trx name super ctx rs trx name x_c_invoicebatch resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoicebatch append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoicebatch get_id tostring set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice batch expense invoice batch header public void setc invoicebatch id int c invoicebatch id if c invoicebatch id 1 throw new illegal argument exception c invoicebatch id is mandatory set valuenocheck c invoicebatch id new integer c invoicebatch id setc_invoicebatch_id c_invoicebatch_id c_invoicebatch_id illegalargumentexception c_invoicebatch_id set_valuenocheck c_invoicebatch_id c_invoicebatch_id get invoice batch expense invoice batch header public int getc invoicebatch id integer ii integer get value c invoicebatch id if ii null return 0 return ii int value getc_invoicebatch_id get_value c_invoicebatch_id intvalue set control amount if not zero the debit amount of the document must be equal this amount public void set control amt big decimal control amt if control amt null throw new illegal argument exception control amt is mandatory set value control amt control amt setcontrolamt bigdecimal controlamt controlamt illegalargumentexception controlamt set_value controlamt controlamt get control amount if not zero the debit amount of the document must be equal this amount public big decimal get control amt big decimal bd big decimal get value control amt if bd null return env zero return bd bigdecimal getcontrolamt bigdecimal bigdecimal get_value controlamt set document date date of the document public void set date doc timestamp date doc if date doc null throw new illegal argument exception date doc is mandatory set value date doc date doc setdatedoc datedoc datedoc illegalargumentexception datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document amt document amount public void set document amt big decimal document amt if document amt null throw new illegal argument exception document amt is mandatory set valuenocheck document amt document amt setdocumentamt bigdecimal documentamt documentamt illegalargumentexception documentamt set_valuenocheck documentamt documentamt get document amt document amount public big decimal get document amt big decimal bd big decimal get value document amt if bd null return env zero return bd bigdecimal getdocumentamt bigdecimal bigdecimal get_value documentamt set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue full constructor param ad pinstance id instance param log id log sequence param p date date param p id id param p number number param p msg msg public mp instance log int ad pinstance id int log id timestamp p date int p id big decimal p number string p msg setad pinstance id ad pinstance id setlog id log id setp date p date setp id p id setp number p number setp msg p msg ad_pinstance_id log_id p_date p_id p_number p_msg mpinstancelog ad_pinstance_id log_id p_date p_id bigdecimal p_number p_msg setad_pinstance_id ad_pinstance_id setlog_id log_id setp_date p_date setp_id p_id setp_number p_number setp_msg p_msg load constructor param rs result set throws sql exception public mp instance log result set rs throws sql exception setad pinstance id rs get int ad pinstance id setlog id rs get int log id setp date rs get timestamp p date setp id rs get int p id setp number rs get big decimal p number setp msg rs get string p msg sqlexception mpinstancelog resultset sqlexception setad_pinstance_id getint ad_pinstance_id setlog_id getint log_id setp_date gettimestamp p_date setp_id getint p_id setp_number getbigdecimal p_number setp_msg getstring p_msg string representation return info public string to string string buffer sb new string buffer ppinstance log sb append m log id if m p date null sb append date append m p date if m p id 0 sb append id append m p id if m p number null sb append number append m p number if m p msg null sb append append m p msg sb append return sb to string tostring stringbuffer stringbuffer ppinstance_log m_log_id m_p_date m_p_date m_p_id m_p_id m_p_number m_p_number m_p_msg m_p_msg tostring save to database return true if saved public boolean save string buffer sql new string buffer insert into ad pinstance log ad pinstance id log id p date p id p number p msg values sql append m ad pinstance id append append m log id append if m p date null sql append null else sql append db to date m p date false append if m p id 0 sql append null else sql append m p id append if m p number null sql append null else sql append m p number append if m p msg null sql append null else sql append db to string m p msg 2000 append int no db execute update sql to string null outside of trx return no 1 stringbuffer stringbuffer ad_pinstance_log ad_pinstance_id log_id p_date p_id p_number p_msg m_ad_pinstance_id m_log_id m_p_date to_date m_p_date m_p_id m_p_id m_p_number m_p_number m_p_msg to_string m_p_msg executeupdate tostring public int getad pinstance id return m ad pinstance id getad_pinstance_id m_ad_pinstance_id public void setad pinstance id int ad pinstance id m ad pinstance id ad pinstance id setad_pinstance_id ad_pinstance_id m_ad_pinstance_id ad_pinstance_id public int getlog id return m log id getlog_id m_log_id public void setlog id int log id m log id log id setlog_id log_id m_log_id log_id public timestamp getp date return m p date getp_date m_p_date public void setp date timestamp p date m p date p date setp_date p_date m_p_date p_date public int getp id return m p id getp_id m_p_id public void setp id int p id m p id p id setp_id p_id m_p_id p_id public big decimal getp number return m p number bigdecimal getp_number m_p_number public void setp number big decimal p number m p number p number setp_number bigdecimal p_number m_p_number p_number public string getp msg return m p msg getp_msg m_p_msg public void setp msg string p msg m p msg p msg setp_msg p_msg m_p_msg p_msg initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame env set context env get ctx m windowno isso trx y try fill picks jb init dyn init frame get content pane add tabbed pane border layout center frame get content pane add status bar border layout south catch exception ex log log level severe init ex windowno windowno formframe m_windowno windowno m_frame setcontext getctx m_windowno issotrx fillpicks jbinit dyninit getcontentpane tabbedpane borderlayout getcontentpane statusbar borderlayout static init pre sel panel tabbed f org fb partner scroll pane mini table gen panel info pre throws exception void jb init throws exception compiere color set background this sel panel set layout sel panel layout l org set label for f org l org set text msg translate env get ctx ad org id lb partner set label for fb partner lb partner set text msg translate env get ctx c bpartner id sel north panel set layout north panel layout north panel layout set alignment flow layout left tabbed pane add sel panel msg get msg env get ctx select sel panel add sel north panel border layout north sel north panel add l org null sel north panel add f org null sel north panel add lb partner null sel north panel add fb partner null sel panel set name sel panel sel panel add confirm panel sel border layout south sel panel add scroll pane border layout center scroll pane get viewport add mini table null confirm panel sel add action listener this tabbed pane add gen panel msg get msg env get ctx generate gen panel set layout gen layout gen panel add info border layout center gen panel set enabled false info set background compiereplaf getfieldbackground inactive info set editable false gen panel add confirm panel gen border layout south confirm panel gen add action listener this selpanel forg fbpartner scrollpane minitable genpanel jbinit compierecolor setbackground selpanel setlayout selpanellayout lorg setlabelfor forg lorg settext getctx ad_org_id lbpartner setlabelfor fbpartner lbpartner settext getctx c_bpartner_id selnorthpanel setlayout northpanellayout northpanellayout setalignment flowlayout tabbedpane selpanel getmsg getctx selpanel selnorthpanel borderlayout selnorthpanel lorg selnorthpanel forg selnorthpanel lbpartner selnorthpanel fbpartner selpanel setname selpanel selpanel confirmpanelsel borderlayout selpanel scrollpane borderlayout scrollpane getviewport minitable confirmpanelsel addactionlistener tabbedpane genpanel getmsg getctx genpanel setlayout genlayout genpanel borderlayout genpanel setenabled setbackground getfieldbackground_inactive seteditable genpanel confirmpanelgen borderlayout confirmpanelgen addactionlistener fill picks column id from c order throws exception if lookups cannot be initialized private void fill picks throws exception m lookup orgl m lookup factory get env get ctx m windowno 0 2163 display type table dir f org new v lookup ad org id false false true orgl l org set text msg translate env get ctx ad org id f org add vetoable change listener this m lookup bpl m lookup factory get env get ctx m windowno 0 2762 display type search fb partner new v lookup c bpartner id false false true bpl lb partner set text msg translate env get ctx c bpartner id fb partner add vetoable change listener this column_id c_order fillpicks mlookup mlookupfactory getctx m_windowno displaytype tabledir forg vlookup ad_org_id lorg settext getctx ad_org_id forg addvetoablechangelistener mlookup mlookupfactory getctx m_windowno displaytype fbpartner vlookup c_bpartner_id lbpartner settext getctx c_bpartner_id fbpartner addvetoablechangelistener dynamic init create grid controller panel ad column id from c order private void dyn init create columns mini table add column c order id mini table add column ad org id mini table add column c doctype id mini table add column document no mini table add column c bpartner id mini table add column date ordered mini table add column total lines mini table set multi selection true mini table set row selection allowed true set details mini table set column class 0 id column class false mini table set column class 1 string class true msg translate env get ctx ad org id mini table set column class 2 string class true msg translate env get ctx c doctype id mini table set column class 3 string class true msg translate env get ctx document no mini table set column class 4 string class true msg translate env get ctx c bpartner id mini table set column class 5 timestamp class true msg translate env get ctx date ordered mini table set column class 6 big decimal class true msg translate env get ctx total lines mini table auto size mini table get model add table model listener this info status bar set status line msg get msg env get ctx inv generate sel status bar set statusdb tabbed pane listener tabbed pane add change listener this gridcontroller ad_column_id c_order dyninit minitable addcolumn c_order_id minitable addcolumn ad_org_id minitable addcolumn c_doctype_id minitable addcolumn documentno minitable addcolumn c_bpartner_id minitable addcolumn dateordered minitable addcolumn totallines minitable setmultiselection minitable setrowselectionallowed minitable setcolumnclass idcolumn minitable setcolumnclass getctx ad_org_id minitable setcolumnclass getctx c_doctype_id minitable setcolumnclass getctx documentno minitable setcolumnclass getctx c_bpartner_id minitable setcolumnclass getctx dateordered minitable setcolumnclass bigdecimal getctx totallines minitable autosize minitable getmodel addtablemodellistener statusbar setstatusline getmsg getctx invgeneratesel statusbar setstatusdb tabbedpane addchangelistener query info private void execute query log info int ad client id env getad client id env get ctx create sql string buffer sql new string buffer select c order id o name dt name document no bp name date ordered total lines from c invoice candidate v ic ad org o c bpartner bp c doctype dt where ic ad org id o ad org id and ic c bpartner id bp c bpartner id and ic c doctype id dt c doctype id and ic ad client id if m ad org id null sql append and ic ad org id append m ad org id if m c bpartner id null sql append and ic c bpartner id append m c bpartner id sql append order by o name bp name date ordered log fine v invoice gen execute query ad client id ad client id sql to string reset table int row 0 mini table set row count row execute try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 ad client id result set rs pstmt execute query while rs next extend table mini table set row count row 1 set values mini table set value at new id column rs get int 1 row 0 c order id mini table set value at rs get string 2 row 1 org mini table set value at rs get string 3 row 2 doc type mini table set value at rs get string 4 row 3 doc no mini table set value at rs get string 5 row 4 b partner mini table set value at rs get timestamp 6 row 5 date ordered mini table set value at rs get big decimal 7 row 6 total lines prepare next row rs close pstmt close catch sql exception e log log level severe sql to string e mini table auto size status bar set statusdb string value of mini table get row count executequery ad_client_id getad_client_id getctx stringbuffer stringbuffer c_order_id documentno dateordered totallines c_invoice_candidate_v ad_org c_bpartner c_doctype ad_org_id ad_org_id c_bpartner_id c_bpartner_id c_doctype_id c_doctype_id ad_client_id m_ad_org_id ad_org_id m_ad_org_id m_c_bpartner_id c_bpartner_id m_c_bpartner_id dateordered vinvoicegen executequery ad_client_id ad_client_id tostring minitable setrowcount preparedstatement preparestatement tostring setint ad_client_id resultset executequery minitable setrowcount minitable setvalueat idcolumn getint c_order_id minitable setvalueat getstring minitable setvalueat getstring doctype minitable setvalueat getstring minitable setvalueat getstring bpartner minitable setvalueat gettimestamp dateordered minitable setvalueat getbigdecimal totallines sqlexception tostring minitable autosize statusbar setstatusdb valueof minitable getrowcount dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e log info cmd e get action command if e get action command equals confirm panel a cancel dispose return m whereclause save selection if m whereclause length 0 m selectionactive generate invoices else dispose actionperformed actionevent getactioncommand getactioncommand confirmpanel a_cancel m_whereclause saveselection m_whereclause m_selectionactive generateinvoices vetoable change listener requery param e event public void vetoable change property change event e log info e get property name e get new value if e get property name equals ad org id m ad org id e get new value if e get property name equals c bpartner id m c bpartner id e get new value fb partner set value m c bpartner id display value execute query vetoablechange propertychangeevent getpropertyname getnewvalue getpropertyname ad_org_id m_ad_org_id getnewvalue getpropertyname c_bpartner_id m_c_bpartner_id getnewvalue fbpartner setvalue m_c_bpartner_id executequery change listener tab changed param e event public void state changed change event e int index tabbed pane get selected index m selectionactive index 0 statechanged changeevent tabbedpane getselectedindex m_selectionactive table model listener param e event public void table changed table model event e int rows selected 0 int rows mini table get row count for int i 0 i rows i id column id id column mini table get value at i 0 id in column 0 if id null id is selected rows selected status bar set statusdb rows selected tablechanged tablemodelevent rowsselected minitable getrowcount idcolumn idcolumn minitable getvalueat isselected rowsselected statusbar setstatusdb rowsselected save selection return selecion query or return where clause like c order id in private string save selection log info id selection may be pending mini table editing stopped new change event this array of integers array list integer results new array list integer get selected entries int rows mini table get row count for int i 0 i rows i id column id id column mini table get value at i 0 id in column 0 log fine row i id if id null id is selected results add id getrecord id if results size 0 return query string string key column c order id string buffer sb new string buffer key column if results size 1 sb append in else sb append add elements for int i 0 i results size i if i 0 sb append if key column ends with id sb append results get i to string else sb append append results get i to string if results size 1 sb append log config sb to string return sb to string c_order_id saveselection minitable editingstopped changeevent arraylist arraylist minitable getrowcount idcolumn idcolumn minitable getvalueat isselected getrecord_id keycolumn c_order_id stringbuffer stringbuffer keycolumn keycolumn endswith _id tostring tostring tostring tostring generate invoices private void generate invoices string trx name trx create trx name ivg trx trx trx get trx name true trx needs to be committed too string trx name null trx trx null reset selection string sql update c order set is selected n where is selected y and ad client id env getad client id env get ctx and ad org id env getad org id env get ctx int no db execute update sql trx name log config reset no set selection sql update c order set is selected y where m whereclause no db execute update sql trx name if no 0 string msg no invoices not translated log config msg info set text msg return log config set no m selectionactive false prevents from being called twice status bar set status line msg get msg env get ctx inv generate gen status bar set statusdb string value of no prepare process int ad process id 134 hardcoded c invoicecreate mp instance instance new mp instance env get ctx ad process id 0 if instance save info set text msg get msg env get ctx process no instance return process info pi new process info ad process id pi setad pinstance id instance getad pinstance id add parameters mp instance para para new mp instance para instance 10 para set parameter selection y if para save string msg no selection parameter added not translated info set text msg log log level severe msg return para new mp instance para instance 20 para set parameter doc action co if para save string msg no doc action parameter added not translated info set text msg log log level severe msg return execute process process ctl worker new process ctl this pi trx worker start complete tasks in unlockui generateinvoice complete generateinvoices trxname createtrxname trxname trxname c_order isselected isselected ad_client_id getad_client_id getctx ad_org_id getad_org_id getctx executeupdate trxname c_order isselected m_whereclause executeupdate trxname settext m_selectionactive statusbar setstatusline getmsg getctx invgenerategen statusbar setstatusdb valueof ad_process_id c_invoicecreate mpinstance mpinstance getctx ad_process_id settext getmsg getctx processnoinstance processinfo processinfo ad_process_id setad_pinstance_id getad_pinstance_id mpinstancepara mpinstancepara setparameter settext mpinstancepara setparameter docaction docaction settext processctl processctl generateinvoice_complete complete generating invoices called from unlock ui param pi process info private void generateinvoice complete process info pi switch tabs tabbed pane set selected index 1 process info util set log fromdb pi string buffer i text new string buffer i text append b append pi get summary append b br append msg get msg env get ctx inv generate info invoices are generated depending on the invoicing rule selection in the order append br append pi get log info true info set text i text to string reset selection string sql update c order set is selected n where m whereclause int no db execute update sql null log config reset no get results int ids pi geti ds if ids null ids length 0 return confirm panel gen getok button set enabled false ok to print invoices if a dialog ask m windowno this print invoices info append n n msg get msg env get ctx print invoices set cursor cursor get predefined cursor cursor wait cursor int ret value a dialog dialog a cancel do loop through all items for int i 0 i ids length i int c invoice id ids i report ctl start document print report engine invoice c invoice id true a dialog dialog d new a dialog dialog m frame env get header env get ctx m windowno msg get msg env get ctx printoutok j option pane question message ret value d get return code while ret value a dialog dialog a cancel set cursor cursor get default cursor ok to print invoices confirm panel gen getok button set enabled true generateinvoice_complete processinfo tabbedpane setselectedindex processinfoutil setlogfromdb stringbuffer itext stringbuffer itext getsummary getmsg getctx invgenerateinfo getloginfo settext itext tostring c_order isselected m_whereclause executeupdate getids confirmpanelgen getokbutton setenabled adialog m_windowno printinvoices getmsg getctx printinvoices setcursor getpredefinedcursor wait_cursor retvalue adialogdialog a_cancel c_invoice_id reportctl startdocumentprint reportengine c_invoice_id adialogdialog adialogdialog m_frame getheader getctx m_windowno getmsg getctx joptionpane question_message retvalue getreturncode retvalue adialogdialog a_cancel setcursor getdefaultcursor confirmpanelgen getokbutton setenabled lock user interface called from the worker before processing param pi process info public void lockui process info pi this set cursor cursor get predefined cursor cursor wait cursor this set enabled false processinfo setcursor getpredefinedcursor wait_cursor setenabled unlock user interface called from the worker when processing is done param pi result of execute a sync call public void unlockui process info pi this set enabled true this set cursor cursor get default cursor generateinvoice complete pi async processinfo setenabled setcursor getdefaultcursor generateinvoice_complete is the ui locked internal method return true if ui is locked public boolean isui locked return this is enabled isuilocked isenabled method to be executed async called from the worker param pi process info public void executea sync process info pi processinfo executeasync processinfo load constructor param ctx context param ad org id id public static m org info get properties ctx int ad org id m org info ret value null string sql select from ad orginfo where ad org id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad org id result set rs pstmt execute query if rs next ret value new m org info ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value ad_org_id morginfo ad_org_id morginfo retvalue ad_orginfo ad_org_id preparedstatement preparestatement setint ad_org_id resultset executequery retvalue morginfo s_log retvalue load constructor param ctx context param rs result set public m org info properties ctx result set rs string trx name super ctx rs trx name morginfo resultset trxname trxname organization constructor param org org public m org info m org org super org get ctx 0 org get trxname set client org org setduns set taxid morginfo morg getctx get_trxname setclientorg settaxid get mgl category from cache param ctx context param gl category id id return mgl category public static mgl category get properties ctx int gl category id integer key new integer gl category id mgl category ret value mgl category s cache get key if ret value null return ret value ret value new mgl category ctx gl category id null if ret value get id 0 s cache put key ret value return ret value mglcategory gl_category_id mglcategory mglcategory gl_category_id gl_category_id mglcategory retvalue mglcategory s_cache retvalue retvalue retvalue mglcategory gl_category_id retvalue get_id s_cache retvalue retvalue get default category param ctx context param category type optional category type ignored if not exists return gl category or null public static mgl category get default properties ctx string category type mgl category ret value null string sql select from gl category where ad client id and is default y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next mgl category temp new mgl category ctx rs null if category type null category type equals temp get category type ret value temp break if ret value null ret value temp rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value categorytype categorytype mglcategory getdefault categorytype mglcategory retvalue gl_category ad_client_id isdefault preparedstatement preparestatement setint getad_client_id resultset executequery mglcategory mglcategory categorytype categorytype getcategorytype retvalue retvalue retvalue retvalue get default system category param ctx context return gl category public static mgl category get default system properties ctx mgl category ret value get default ctx categorytype systemgenerated if ret value null ret value get category type equals categorytype systemgenerated ret value new mgl category ctx 0 null ret value set name default system ret value set category type categorytype systemgenerated ret value set is default true if ret value save throw new illegal state exception could not save default system gl category return ret value mglcategory getdefaultsystem mglcategory retvalue getdefault categorytype_systemgenerated retvalue retvalue getcategorytype categorytype_systemgenerated retvalue mglcategory retvalue setname retvalue setcategorytype categorytype_systemgenerated retvalue setisdefault retvalue illegalstateexception retvalue standard constructor param ctx context param gl category id id public mgl category properties ctx int gl category id string trx name super ctx gl category id trx name if gl category id 0 set name null set category type categorytype manual set is default false gl_category_id mglcategory gl_category_id trxname gl_category_id trxname gl_category_id setname setcategorytype categorytype_manual setisdefault load constructor param ctx context param rs result set public mgl category properties ctx result set rs string trx name super ctx rs trx name mglcategory resultset trxname trxname initialize global variables param config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w field update init servletexception servletconfig servletexception webenv initweb servletexception wfieldupdate clean up resources public void destroy process the http get request param request param response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception do post request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception dopost process the http post request param request param response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception get session info web session ctx wsc web session ctx get request w window status ws w window status get request if wsc null ws null ws can be null for login get parameter string form name web util get parameter request field form string field name web util get parameter request field name string field value web util get parameter request field value log info do post form form name field field name value field value document web doc doc create page wsc ws form name field name field value the form form fu new form request get requesturi fu set name form name fu add element new input input type hidden field form y fu add element new input input type hidden field name y fu add element new input input type hidden field value y doc get body add element fu log trace log l1 user w field update doc to string answer web util create response request response this null doc false servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception websessionctx websessionctx wwindowstatus wwindowstatus formname webutil getparameter field_form fieldname webutil getparameter field_name fieldvalue webutil getparameter field_value dopost formname fieldname fieldvalue webdoc createpage formname fieldname fieldvalue getrequesturi setname form_name addelement type_hidden field_form addelement type_hidden field_name addelement type_hidden field_value getbody addelement l1_user wfieldupdate tostring webutil createresponse create reply p including special handling of login pages param wsc web session context param ws window status param form name param field name param field value private static web doc create page web session ctx wsc w window status ws string form name string field name string field value web doc doc web doc create true plain body body doc get body info string buffer sb new string buffer field update append field form append append form name append append field name append append field name append append field value append append field value body add element new p add element sb to string called manually do nothing if form name null field name null else if form name equals login2 field name equals w login p role reply login2 role body wsc form name field value else if form name equals login2 field name equals w login p client reply login2 client body wsc form name field value else if form name equals login2 field name equals w login p org reply login2 org body wsc ws form name field value return doc formname fieldname fieldvalue webdoc createpage websessionctx wwindowstatus formname fieldname fieldvalue webdoc webdoc getbody stringbuffer stringbuffer fieldupdate field_form formname field_name fieldname field_value fieldvalue addelement addelement tostring formname fieldname formname fieldname wlogin p_role reply_login2_role formname fieldvalue formname fieldname wlogin p_client reply_login2_client formname fieldvalue formname fieldname wlogin p_org reply_login2_org formname fieldvalue login 2nd page response field role p fill client org warehouse param body document body param wsc web session context param form name param field value private static void reply login2 role body body web session ctx wsc string form name string field value formname string form top web env target window document forms form name login login new login wsc ctx get data key name pair clients login get clients new key name pair integer parse int field value field value set client string buffer script new string buffer var a top w window document form name select name options script append var a append form append w login p client append options a length 0 resets options script append a length 0 a 0 new option text value add new oprtion for int i 0 i clients length i key name pair p clients i script append a append i append new option script append p get name text script append script append p get key value script append script append n set organization if clients length 0 var a top w window document form name select name options script append var b append form append w login p org append options a length 0 resets options script append b length 0 a 0 new option text value add new oprtion key name pair orgs login get orgs clients 0 for int i 0 i orgs length i key name pair p orgs i script append b append i append new option script append p get name text script append script append p get key value script append script append n set warehouse if orgs length 0 var a top w window document form name select name options script append var c append form append w login p warehouse append options a length 0 resets options script append c length 0 a 0 new option text value add new oprtion key name pair whs login get warehouses orgs 0 if whs null for int i 0 i whs length i key name pair p whs i script append c append i append new option script append p get name text script append script append p get key value script append we have a org we have a client add script body add element new p add element w login p client body add element new script script to string log trace log l6 database reply login2 role script script to string formname fieldvalue reply_login2_role websessionctx formname fieldvalue webenv target_window formname keynamepair getclients keynamepair parseint fieldvalue fieldvalue stringbuffer stringbuffer wwindow formname selectname wlogin p_client keynamepair getname getkey wwindow formname selectname wlogin p_org keynamepair getorgs keynamepair getname getkey wwindow formname selectname wlogin p_warehouse keynamepair getwarehouses keynamepair getname getkey addelement addelement wlogin p_client addelement tostring l6_database reply_login2_role tostring login 2nd page response field client p fill org warehouse param body body param wsc context param form name form name param field value value private static void reply login2 client body body web session ctx wsc string form name string field value formname string form top web env target window document form name string buffer script new string buffer set organization var a top w window document form name select name options script append var b append form append w login p org append options a length 0 resets options script append b length 0 a 0 new option text value add new oprtion key name pair client new key name pair integer parse int field value field value login login new login wsc ctx key name pair orgs login get orgs client for int i 0 i orgs length i key name pair p orgs i script append b append i append new option script append p get name text script append script append p get key value script append script append n set warehouse var a top w window document form name select name options script append var c append form append w login p warehouse append options a length 0 resets options script append c length 0 a 0 new option text value add new oprtion key name pair whs login get warehouses orgs 0 if whs null for int i 0 i whs length i key name pair p whs i script append c append i append new option script append p get name text script append script append p get key value script append add script body add element new p add element w login p warehouse body add element new script script to string log trace log l6 database login2 client script script to string formname fieldvalue reply_login2_client websessionctx formname fieldvalue webenv target_window formname stringbuffer stringbuffer wwindow formname selectname wlogin p_org keynamepair keynamepair parseint fieldvalue fieldvalue keynamepair getorgs keynamepair getname getkey wwindow formname selectname wlogin p_warehouse keynamepair getwarehouses keynamepair getname getkey addelement addelement wlogin p_warehouse addelement tostring l6_database tostring login 2nd page response field org p fill warehouse param body document body param wsc web session context param form name param field value private static void reply login2 org body body web session ctx wsc w window status ws string form name string field value formname string form top web env target window document form name string buffer script new string buffer set warehouse var a top w window document form name select name options script append var c append form append w login p warehouse append options a length 0 resets options script append c length 0 a 0 new option text value add new oprtion key name pair org new key name pair integer parse int field value field value login login new login wsc ctx string error login validate login org if error null error length 0 log severe error todo graceful dead ws m window null wsc ctx new properties return key name pair whs login get warehouses org if whs null for int i 0 i whs length i key name pair p whs i script append c append i append new option script append p get name text script append script append p get key value script append add script body add element new p add element w login p warehouse body add element new script script to string log trace log l6 database login2 org script script to string formname fieldvalue reply_login2_org websessionctx wwindowstatus formname fieldvalue webenv target_window formname stringbuffer stringbuffer wwindow formname selectname wlogin p_warehouse keynamepair keynamepair parseint fieldvalue fieldvalue validatelogin mwindow keynamepair getwarehouses keynamepair getname getkey addelement addelement wlogin p_warehouse addelement tostring l6_database tostring standard constructor public x ad attachmentnote properties ctx int ad attachmentnote id string trx name super ctx ad attachmentnote id trx name if ad attachmentnote id 0 setad attachmentnote id 0 setad attachment id 0 setad user id 0 set text msg null set title null x_ad_attachmentnote ad_attachmentnote_id trxname ad_attachmentnote_id trxname ad_attachmentnote_id setad_attachmentnote_id setad_attachment_id setad_user_id settextmsg settitle load constructor public x ad attachmentnote properties ctx result set rs string trx name super ctx rs trx name x_ad_attachmentnote resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad attachmentnote append get id append return sb to string tostring stringbuffer stringbuffer x_ad_attachmentnote get_id tostring set attachment note personal attachment note public void setad attachmentnote id int ad attachmentnote id if ad attachmentnote id 1 throw new illegal argument exception ad attachmentnote id is mandatory set valuenocheck ad attachmentnote id new integer ad attachmentnote id setad_attachmentnote_id ad_attachmentnote_id ad_attachmentnote_id illegalargumentexception ad_attachmentnote_id set_valuenocheck ad_attachmentnote_id ad_attachmentnote_id get attachment note personal attachment note public int getad attachmentnote id integer ii integer get value ad attachmentnote id if ii null return 0 return ii int value getad_attachmentnote_id get_value ad_attachmentnote_id intvalue set attachment attachment for the document public void setad attachment id int ad attachment id if ad attachment id 1 throw new illegal argument exception ad attachment id is mandatory set valuenocheck ad attachment id new integer ad attachment id setad_attachment_id ad_attachment_id ad_attachment_id illegalargumentexception ad_attachment_id set_valuenocheck ad_attachment_id ad_attachment_id get attachment attachment for the document public int getad attachment id integer ii integer get value ad attachment id if ii null return 0 return ii int value getad_attachment_id get_value ad_attachment_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set text message text message public void set text msg string text msg if text msg null throw new illegal argument exception text msg is mandatory if text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg illegalargumentexception textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg set title name this entity is referred to as public void set title string title if title null throw new illegal argument exception title is mandatory if title length 60 log warning length 60 truncated title title substring 0 59 set value title title settitle illegalargumentexception set_value get title name this entity is referred to as public string get title return string get value title gettitle get_value return string get value title public key name pair get key name pair return new key name pair get id get title get_value keynamepair getkeynamepair keynamepair get_id gettitle standard constructor param ctx context param c dunningrunentry id id public m dunning run entry properties ctx int c dunningrunentry id string trx name super ctx c dunningrunentry id trx name if c dunningrunentry id 0 setc bpartner id 0 setc bpartner location id 0 setad user id 0 setsalesrep id 0 setc currency id 0 set amt env zero set qty env zero set processed false c_dunningrunentry_id mdunningrunentry c_dunningrunentry_id trxname c_dunningrunentry_id trxname c_dunningrunentry_id setc_bpartner_id setc_bpartner_location_id setad_user_id setsalesrep_id setc_currency_id setamt setqty setprocessed load constructor param ctx context param rs result set public m dunning run entry properties ctx result set rs string trx name super ctx rs trx name mdunningrunentry resultset trxname trxname parent constructor param parent parent public m dunning run entry m dunning run parent this parent get ctx 0 parent get trxname set client org parent setc dunningrun id parent getc dunningrun id m parent parent mdunningrunentry mdunningrun getctx get_trxname setclientorg setc_dunningrun_id getc_dunningrun_id m_parent set b partner param bp partner public void setb partner mb partner bp boolean isso trx setc bpartner id bp getc bpartner id mb partner location locations bp get locations false location if locations length 1 setc bpartner location id locations 0 getc bpartner location id else for int i 0 i locations length i mb partner location location locations i if location is pay from isso trx location is remit to isso trx setc bpartner location id location getc bpartner location id break if getc bpartner location id 0 string msg c bpartner id bp get name if isso trx msg no is pay from else msg no is remit to throw new illegal argument exception msg user with location m user users m user get ofb partner get ctx bp getc bpartner id if users length 1 setad user id users 0 getad user id else for int i 0 i users length i m user user users i if user getc bpartner location id getc bpartner location id setad user id users i getad user id break setsalesrep id bp getsalesrep id bpartner setbpartner mbpartner issotrx setc_bpartner_id getc_bpartner_id mbpartnerlocation getlocations setc_bpartner_location_id getc_bpartner_location_id mbpartnerlocation ispayfrom issotrx isremitto issotrx setc_bpartner_location_id getc_bpartner_location_id getc_bpartner_location_id c_bpartner_id getname issotrx ispayfrom isremitto illegalargumentexception muser muser getofbpartner getctx getc_bpartner_id setad_user_id getad_user_id muser getc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id setsalesrep_id getsalesrep_id standard constructor public x ad role orgaccess properties ctx int ad role orgaccess id string trx name super ctx ad role orgaccess id trx name if ad role orgaccess id 0 setad role id 0 set is read only false x_ad_role_orgaccess ad_role_orgaccess_id trxname ad_role_orgaccess_id trxname ad_role_orgaccess_id setad_role_id setisreadonly load constructor public x ad role orgaccess properties ctx result set rs string trx name super ctx rs trx name x_ad_role_orgaccess resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad role orgaccess append get id append return sb to string tostring stringbuffer stringbuffer x_ad_role_orgaccess get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set text param txt text to be translated public void set txt string txt m txt txt settxt m_txt start tag return skip body throws jsp exception public int do start tag throws jsp exception if m txt null m txt length 0 properties ctx jsp env get ctx http servlet request page context get request string msg msg translate ctx m txt log fine m txt msg try jsp writer out page context get out out print msg catch exception e throw new jsp exception e return skip body skip_body jspexception dostarttag jspexception m_txt m_txt jspenv getctx httpservletrequest pagecontext getrequest m_txt m_txt jspwriter pagecontext getout jspexception skip_body end tag return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page standard constructor public x ad task access properties ctx int ad task access id string trx name super ctx ad task access id trx name if ad task access id 0 setad role id 0 setad task id 0 set is read write false x_ad_task_access ad_task_access_id trxname ad_task_access_id trxname ad_task_access_id setad_role_id setad_task_id setisreadwrite load constructor public x ad task access properties ctx result set rs string trx name super ctx rs trx name x_ad_task_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad task access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_task_access get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set os task operation system task public void setad task id int ad task id if ad task id 1 throw new illegal argument exception ad task id is mandatory set valuenocheck ad task id new integer ad task id setad_task_id ad_task_id ad_task_id illegalargumentexception ad_task_id set_valuenocheck ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue set read write field is read write public void set is read write boolean is read write set value is read write new boolean is read write setisreadwrite isreadwrite set_value isreadwrite isreadwrite get read write field is read write public boolean is read write object oo get value is read write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadwrite get_value isreadwrite booleanvalue standard constructor public x c commission properties ctx int c commission id string trx name super ctx c commission id trx name if c commission id 0 setc bpartner id 0 setc charge id 0 setc commission id 0 setc currency id 0 set doc basis type null i set frequency type null m set list details false set name null x_c_commission c_commission_id trxname c_commission_id trxname c_commission_id setc_bpartner_id setc_charge_id setc_commission_id setc_currency_id setdocbasistype setfrequencytype setlistdetails setname load constructor public x c commission properties ctx result set rs string trx name super ctx rs trx name x_c_commission resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c commission append get id append return sb to string tostring stringbuffer stringbuffer x_c_commission get_id tostring public static final int c bpartner id ad reference id 232 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 1 throw new illegal argument exception c charge id is mandatory set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id illegalargumentexception c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set commission commission public void setc commission id int c commission id if c commission id 1 throw new illegal argument exception c commission id is mandatory set valuenocheck c commission id new integer c commission id setc_commission_id c_commission_id c_commission_id illegalargumentexception c_commission_id set_valuenocheck c_commission_id c_commission_id get commission commission public int getc commission id integer ii integer get value c commission id if ii null return 0 return ii int value getc_commission_id get_value c_commission_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set create lines from process which will generate a new document lines based on an existing document public void set create from string create from if create from null create from length 1 log warning length 1 truncated create from create from substring 0 0 set value create from create from setcreatefrom createfrom createfrom createfrom createfrom createfrom set_value createfrom createfrom get create lines from process which will generate a new document lines based on an existing document public string get create from return string get value create from getcreatefrom get_value createfrom set date last run date the process was last run public void set date last run timestamp date last run set valuenocheck date last run date last run setdatelastrun datelastrun set_valuenocheck datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docbasistype receipt r set calculation basis basis for the calculation the commission public void set doc basis type string doc basis type if doc basis type null throw new illegal argument exception doc basis type is mandatory if doc basis type equals i doc basis type equals o doc basis type equals r else throw new illegal argument exception doc basis type invalid value doc basis type reference id 224 i o r if doc basis type length 1 log warning length 1 truncated doc basis type doc basis type substring 0 0 set value doc basis type doc basis type docbasistype_receipt setdocbasistype docbasistype docbasistype illegalargumentexception docbasistype docbasistype docbasistype docbasistype illegalargumentexception docbasistype docbasistype reference_id docbasistype docbasistype docbasistype set_value docbasistype docbasistype get calculation basis basis for the calculation the commission public string get doc basis type return string get value doc basis type getdocbasistype get_value docbasistype public static final string frequencytype yearly y set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals m frequency type equals q frequency type equals w frequency type equals y else throw new illegal argument exception frequency type invalid value frequency type reference id 225 m q w y if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_yearly setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set list details list document details public void set list details boolean list details set value list details new boolean list details setlistdetails listdetails set_value listdetails listdetails get list details list document details public boolean is list details object oo get value list details if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islistdetails get_value listdetails booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue constructor nop public compiere theme compieretheme return theme name return theme name public string get name return s name getname s_name string representation return info public string to string return s name tostring s_name set default colors protected void set default setdefault set theme to current metal theme and copy it public static void set theme app context context app context get app context metal theme copy from metal theme context get current metal theme boolean flat ini is property bool ini p ui flat set theme copy from flat settheme appcontext appcontext getappcontext metaltheme copyfrom metaltheme currentmetaltheme ispropertybool p_ui_flat settheme copyfrom set theme to current metal theme and copy it param copy from public static void set theme metal theme copy from boolean flat if copy from null copy from instanceof compiere theme return may not be correct if themes overwrites default methods primary1 copy from get primary control dark shadow primary2 copy from get primary control shadow primary3 copy from get primary control secondary1 copy from get control dark shadow secondary2 copy from get control shadow secondary3 copy from get control compiere panelui set default background new compiere color secondary3 flat white copy from get primary control highlight black copy from get primary control info control font copy from get control text font system font copy from get system text font user font copy from get user text font small font copy from get sub text font menu font copy from get menu text font window font copy from get window title font copyfrom settheme metaltheme copyfrom copyfrom copyfrom compieretheme copyfrom getprimarycontroldarkshadow copyfrom getprimarycontrolshadow copyfrom getprimarycontrol copyfrom getcontroldarkshadow copyfrom getcontrolshadow copyfrom getcontrol compierepanelui setdefaultbackground compierecolor copyfrom getprimarycontrolhighlight copyfrom getprimarycontrolinfo controlfont copyfrom getcontroltextfont systemfont copyfrom getsystemtextfont userfont copyfrom getusertextfont smallfont copyfrom getsubtextfont menufont copyfrom getmenutextfont windowfont copyfrom getwindowtitlefont get primary 1 blue in default metal theme return color public colorui resource get primary1 return color blind get dichromat colorui resource primary1 coloruiresource getprimary1 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource primary1 public colorui resource get primary2 return color blind get dichromat colorui resource primary2 colorblind getdichromatcoloruiresource coloruiresource getprimary2 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource primary2 public colorui resource get primary3 return color blind get dichromat colorui resource primary3 colorblind getdichromatcoloruiresource coloruiresource getprimary3 colorblind getdichromatcoloruiresource get seconary 1 gray in default metal theme return color public colorui resource get secondary0 return color blind get dichromat colorui resource secondary0 coloruiresource getsecondary0 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource secondary0 public colorui resource get secondary1 return color blind get dichromat colorui resource secondary1 colorblind getdichromatcoloruiresource coloruiresource getsecondary1 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource secondary1 public colorui resource get secondary2 return color blind get dichromat colorui resource secondary2 colorblind getdichromatcoloruiresource coloruiresource getsecondary2 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource secondary2 public colorui resource get secondary3 return color blind get dichromat colorui resource secondary3 colorblind getdichromatcoloruiresource coloruiresource getsecondary3 colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource secondary3 public colorui resource get secondary4 return color blind get dichromat colorui resource secondary4 colorblind getdichromatcoloruiresource coloruiresource getsecondary4 colorblind getdichromatcoloruiresource public colorui resource get black return color blind get dichromat colorui resource black coloruiresource getblack colorblind getdichromatcoloruiresource return color blind get dichromat colorui resource black public colorui resource get white return color blind get dichromat colorui resource white colorblind getdichromatcoloruiresource coloruiresource getwhite colorblind getdichromatcoloruiresource control font plain return font protected static fontui resource getcontroltextfont if control font null try control font new fontui resource font get font swing plaf metal control font new font font default font plain font size catch exception e control font new fontui resource font default font plain font size return control font fontuiresource _getcontroltextfont controlfont controlfont fontuiresource getfont controlfont font_default font_size controlfont fontuiresource font_default font_size controlfont return control font public fontui resource get control text font return getcontroltextfont controlfont fontuiresource getcontroltextfont _getcontroltextfont system font return font protected static fontui resource getsystemtextfont if system font null try system font new fontui resource font get font swing plaf metal system font new font font default font plain font size catch exception e system font new fontui resource font default font plain font size return system font fontuiresource _getsystemtextfont systemfont systemfont fontuiresource getfont systemfont font_default font_size systemfont fontuiresource font_default font_size systemfont return system font public fontui resource get system text font return getsystemtextfont systemfont fontuiresource getsystemtextfont _getsystemtextfont user font return font protected static fontui resource getusertextfont if user font null try user font new fontui resource font get font swing plaf metal user font new font font default font plain font size catch exception e user font new fontui resource font default font plain font size return user font fontuiresource _getusertextfont userfont userfont fontuiresource getfont userfont font_default font_size userfont fontuiresource font_default font_size userfont return user font public fontui resource get user text font return getusertextfont userfont fontuiresource getusertextfont _getusertextfont menu return font protected static fontui resource getmenutextfont if menu font null try menu font new fontui resource font get font swing plaf metal menu font new font font default font plain font size catch exception e menu font new fontui resource font default font plain font size return menu font fontuiresource _getmenutextfont menufont menufont fontuiresource getfont menufont font_default font_size menufont fontuiresource font_default font_size menufont return menu font public fontui resource get menu text font return getmenutextfont menufont fontuiresource getmenutextfont _getmenutextfont window title return font protected static fontui resource getwindowtitlefont if window font null try window font new fontui resource font get font swing plaf metal window font new font font default font bold font size 2 catch exception e window font new fontui resource font default font bold font size 2 return window font fontuiresource _getwindowtitlefont windowfont windowfont fontuiresource getfont windowfont font_default font_size windowfont fontuiresource font_default font_size windowfont return window font public fontui resource get window title font return getwindowtitlefont windowfont fontuiresource getwindowtitlefont _getwindowtitlefont sub text return font protected static fontui resource getsubtextfont if small font null try small font new fontui resource font get font swing plaf metal small font new font font default font plain font size 2 catch exception e small font new fontui resource font default font plain font size 2 return small font fontuiresource _getsubtextfont smallfont smallfont fontuiresource getfont smallfont font_default font_size smallfont fontuiresource font_default font_size smallfont return small font public fontui resource get sub text font return getsubtextfont smallfont fontuiresource getsubtextfont _getsubtextfont save information in properties public static void save log config compiere color get default background to string ini set property p primary1 get color as string primary1 ini set property p primary2 get color as string primary2 ini set property p primary3 get color as string primary3 ini set property p secondary1 get color as string secondary1 ini set property p secondary2 get color as string secondary2 ini set property p secondary3 get color as string secondary3 ini set property p error get color as string error ini set property p info get color as string info ini set property p mandatory get color as string mandatory ini set property p inactive get color as string inactive ini set property p white get color as string white ini set property p black get color as string black ini set property p txt ok get color as string txt ok ini set property p txt error get color as string txt error ini set property p control font control font to string ini set property p system font system font to string ini set property p user font user font to string ini set property p small font small font to string ini set property p window font window font to string ini set property p menu font menu font to string compiere color cc compiere color get default background ini set property p compierecolor cc to string compierecolor getdefaultbackground tostring setproperty p_primary1 getcolorasstring setproperty p_primary2 getcolorasstring setproperty p_primary3 getcolorasstring setproperty p_secondary1 getcolorasstring setproperty p_secondary2 getcolorasstring setproperty p_secondary3 getcolorasstring setproperty p_error getcolorasstring setproperty p_info getcolorasstring setproperty p_mandatory getcolorasstring setproperty p_inactive getcolorasstring setproperty p_white getcolorasstring setproperty p_black getcolorasstring setproperty p_txt_ok getcolorasstring txt_ok setproperty p_txt_error getcolorasstring txt_error setproperty p_control controlfont tostring setproperty p_system systemfont tostring setproperty p_user userfont tostring setproperty p_small smallfont tostring setproperty p_window windowfont tostring setproperty p_menu menufont tostring compierecolor compierecolor getdefaultbackground setproperty p_compierecolor tostring parses color into string representation required as system colors and alpha colors have different formats param c color return r 102 g 102 b 153 a 255 see parse color public static string get color as string color c if c null c system color control string buffer sb new string buffer r append c get red append g append c get green append b append c get blue append a append c get alpha append system out println sb to string return sb to string systemcolors parsecolor getcolorasstring systemcolor stringbuffer stringbuffer getred getgreen getblue getalpha tostring tostring load properties from ini public static void load primary1 parse color ini get property p primary1 primary1 primary2 parse color ini get property p primary2 primary2 primary3 parse color ini get property p primary3 primary3 secondary1 parse color ini get property p secondary1 secondary1 secondary2 parse color ini get property p secondary2 secondary2 secondary3 parse color ini get property p secondary3 secondary3 error parse color ini get property p error error info parse color ini get property p info info mandatory parse color ini get property p mandatory mandatory inactive parse color ini get property p inactive inactive white parse color ini get property p white white black parse color ini get property p black black txt ok parse color ini get property p txt ok txt ok txt error parse color ini get property p txt error txt error control font parse font ini get property p control control font system font parse font ini get property p system system font user font parse font ini get property p user user font small font parse font ini get property p small small font window font parse font ini get property p window window font menu font parse font ini get property p menu menu font compiere color cc compiere color parse ini get property p compierecolor compiere color set default background cc parsecolor getproperty p_primary1 parsecolor getproperty p_primary2 parsecolor getproperty p_primary3 parsecolor getproperty p_secondary1 parsecolor getproperty p_secondary2 parsecolor getproperty p_secondary3 parsecolor getproperty p_error parsecolor getproperty p_info parsecolor getproperty p_mandatory parsecolor getproperty p_inactive parsecolor getproperty p_white parsecolor getproperty p_black txt_ok parsecolor getproperty p_txt_ok txt_ok txt_error parsecolor getproperty p_txt_error txt_error controlfont parsefont getproperty p_control controlfont systemfont parsefont getproperty p_system systemfont userfont parsefont getproperty p_user userfont smallfont parsefont getproperty p_small smallfont windowfont parsefont getproperty p_window windowfont menufont parsefont getproperty p_menu menufont compierecolor compierecolor getproperty p_compierecolor compierecolor setdefaultbackground reset info in properties public static void reset ini remove p primary1 ini remove p primary2 ini remove p primary3 ini remove p secondary1 ini remove p secondary2 ini remove p secondary3 ini remove p error ini remove p info ini remove p mandatory ini remove p inactive ini remove p white ini remove p black ini remove p txt ok ini remove p txt error ini remove p control ini remove p system ini remove p user ini remove p small ini remove p window ini remove p menu compiere color ini remove p compierecolor initialize ini set property ini p ui look compiere look and feel name ini set property ini p ui theme s name if s theme null s theme set default background compiere color cc new compiere color system color control flat windows 212 208 200 compiere color cc new compiere color secondary3 flat metal 204 204 204 compiere color cc new compiere color secondary3 false compiere color set default background cc save save properties p_primary1 p_primary2 p_primary3 p_secondary1 p_secondary2 p_secondary3 p_error p_info p_mandatory p_inactive p_white p_black p_txt_ok p_txt_error p_control p_system p_user p_small p_window p_menu compierecolor p_compierecolor setproperty p_ui_look compierelookandfeel setproperty p_ui_theme s_name s_theme s_theme setdefault compierecolor compierecolor systemcolor compierecolor compierecolor compierecolor compierecolor compierecolor setdefaultbackground parse color p color r 102 g 102 b 153 a 0 param information string information to be parsed param std color color used if info cannot parsed return color see get color as string protected static colorui resource parse color string information colorui resource std color if information null information length 0 information trim length 0 return std color system out print parse color info try int r integer parse int information substring information index of r 2 information index of g int g integer parse int information substring information index of g 2 information index of b int b 0 int a 255 if information index of a 1 b integer parse int information substring information index of b 2 information index of else b integer parse int information substring information index of b 2 information index of a a integer parse int information substring information index of a 2 information index of colorui resource ret value new colorui resource new color r g b a system out println ret value to string return ret value catch exception e log config information cannot parse e to string return std color stdcolor getcolorasstring coloruiresource parsecolor coloruiresource stdcolor stdcolor parsecolor parseint indexof indexof parseint indexof indexof indexof parseint indexof indexof parseint indexof indexof parseint indexof indexof coloruiresource retvalue coloruiresource retvalue tostring retvalue tostring stdcolor parse font p javax swing plaf fontui resource family dialog bold name dialog style bold size 12 param information string information to be parsed param std font font used if info cannot be parsed return font private static fontui resource parse font string information fontui resource std font if information null information length 0 information trim length 0 return std font system out print parse font info try string name information substring information index of name 5 information index of style string s information substring information index of style 6 information index of size int style font plain if s equals bold style font bold else if s equals italic style font italic else if s equals bolditalic style font bold font italic int size integer parse int information substring information index of size 6 information last index of fontui resource ret value new fontui resource name style size system out println ret value to string return ret value catch exception e log config information cannot parse e to string return std font fontuiresource stdfont fontuiresource parsefont fontuiresource stdfont stdfont parsefont indexof indexof indexof indexof parseint indexof lastindexof fontuiresource retvalue fontuiresource retvalue tostring retvalue tostring stdfont standard constructor public x c projecttype properties ctx int c projecttype id string trx name super ctx c projecttype id trx name if c projecttype id 0 setc projecttype id 0 set name null set project category null n x_c_projecttype c_projecttype_id trxname c_projecttype_id trxname c_projecttype_id setc_projecttype_id setname setprojectcategory load constructor public x c projecttype properties ctx result set rs string trx name super ctx rs trx name x_c_projecttype resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projecttype append get id append return sb to string tostring stringbuffer stringbuffer x_c_projecttype get_id tostring set project type type of the project public void setc projecttype id int c projecttype id if c projecttype id 1 throw new illegal argument exception c projecttype id is mandatory set valuenocheck c projecttype id new integer c projecttype id setc_projecttype_id c_projecttype_id c_projecttype_id illegalargumentexception c_projecttype_id set_valuenocheck c_projecttype_id c_projecttype_id get project type type of the project public int getc projecttype id integer ii integer get value c projecttype id if ii null return 0 return ii int value getc_projecttype_id get_value c_projecttype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string projectcategory workorderjob w set project category project category public void set project category string project category if project category null throw new illegal argument exception project category is mandatory if project category equals a project category equals n project category equals s project category equals w else throw new illegal argument exception project category invalid value project category reference id 288 a n s w if project category length 1 log warning length 1 truncated project category project category substring 0 0 set valuenocheck project category project category projectcategory_workorderjob setprojectcategory projectcategory projectcategory illegalargumentexception projectcategory projectcategory projectcategory projectcategory projectcategory illegalargumentexception projectcategory projectcategory reference_id projectcategory projectcategory projectcategory set_valuenocheck projectcategory projectcategory get project category project category public string get project category return string get value project category getprojectcategory get_value projectcategory standard constructor public x w basket properties ctx int w basket id string trx name super ctx w basket id trx name if w basket id 0 setad user id 0 setsession id 0 setw basket id 0 x_w_basket w_basket_id trxname w_basket_id trxname w_basket_id setad_user_id setsession_id setw_basket_id load constructor public x w basket properties ctx result set rs string trx name super ctx rs trx name x_w_basket resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w basket append get id append return sb to string tostring stringbuffer stringbuffer x_w_basket get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set value m pricelist id null else set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_value m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set session id public void setsession id int session id if session id 1 throw new illegal argument exception session id is mandatory set value session id new integer session id setsession_id session_id session_id illegalargumentexception session_id set_value session_id session_id get session id public int getsession id integer ii integer get value session id if ii null return 0 return ii int value getsession_id get_value session_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getsession id intvalue keynamepair getkeynamepair keynamepair get_id valueof getsession_id set w basket id web basket public void setw basket id int w basket id if w basket id 1 throw new illegal argument exception w basket id is mandatory set valuenocheck w basket id new integer w basket id w_basket_id setw_basket_id w_basket_id w_basket_id illegalargumentexception w_basket_id set_valuenocheck w_basket_id w_basket_id get w basket id web basket public int getw basket id integer ii integer get value w basket id if ii null return 0 return ii int value w_basket_id getw_basket_id get_value w_basket_id intvalue standard constructor public x a asset group properties ctx int a asset group id string trx name super ctx a asset group id trx name if a asset group id 0 seta asset group id 0 set is create as active true y set is depreciated false set is one asset peruom false set is owned false set is track issues false n set name null x_a_asset_group a_asset_group_id trxname a_asset_group_id trxname a_asset_group_id seta_asset_group_id setiscreateasactive setisdepreciated setisoneassetperuom setisowned setistrackissues setname load constructor public x a asset group properties ctx result set rs string trx name super ctx rs trx name x_a_asset_group resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a asset group append get id append return sb to string tostring stringbuffer stringbuffer x_a_asset_group get_id tostring set asset group group of assets public void seta asset group id int a asset group id if a asset group id 1 throw new illegal argument exception a asset group id is mandatory set valuenocheck a asset group id new integer a asset group id seta_asset_group_id a_asset_group_id a_asset_group_id illegalargumentexception a_asset_group_id set_valuenocheck a_asset_group_id a_asset_group_id get asset group group of assets public int geta asset group id integer ii integer get value a asset group id if ii null return 0 return ii int value geta_asset_group_id get_value a_asset_group_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set create as active create asset and activate it public void set is create as active boolean is create as active set value is create as active new boolean is create as active setiscreateasactive iscreateasactive set_value iscreateasactive iscreateasactive get create as active create asset and activate it public boolean is create as active object oo get value is create as active if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreateasactive get_value iscreateasactive booleanvalue set depreciate the asset will be depreciated public void set is depreciated boolean is depreciated set value is depreciated new boolean is depreciated setisdepreciated isdepreciated set_value isdepreciated isdepreciated get depreciate the asset will be depreciated public boolean is depreciated object oo get value is depreciated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdepreciated get_value isdepreciated booleanvalue set one asset per uom create one asset per uom public void set is one asset peruom boolean is one asset peruom set value is one asset peruom new boolean is one asset peruom setisoneassetperuom isoneassetperuom set_value isoneassetperuom isoneassetperuom get one asset per uom create one asset per uom public boolean is one asset peruom object oo get value is one asset peruom if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoneassetperuom get_value isoneassetperuom booleanvalue set owned the asset is owned by the organization public void set is owned boolean is owned set value is owned new boolean is owned setisowned isowned set_value isowned isowned get owned the asset is owned by the organization public boolean is owned object oo get value is owned if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isowned get_value isowned booleanvalue set track issues enable tracking issues for this asset public void set is track issues boolean is track issues set value is track issues new boolean is track issues setistrackissues istrackissues set_value istrackissues istrackissues get track issues enable tracking issues for this asset public boolean is track issues object oo get value is track issues if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istrackissues get_value istrackissues booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set background of component to default color param c component public static void set background j component c set background c compiere panelui get default background setbackground jcomponent setbackground compierepanelui getdefaultbackground set background of component param c component param cc color public static void set background j component c compiere color cc c put client property compiereplaf background cc setbackground jcomponent compierecolor putclientproperty get background color of component param c j component return color public static compiere color get background j component c compiere color bg null try bg compiere color c get client property compiereplaf background catch exception e log severe client property e get message return bg jcomponent compierecolor getbackground jcomponent compierecolor compierecolor getclientproperty clientproperty getmessage set background of window content pane to default color param win window public static void set background window win set background win compiere panelui get default background setbackground setbackground compierepanelui getdefaultbackground set background of window content pane param win window param cc compiere color public static void set background window win compiere color cc if win instanceof j dialog j panel j dialog win get content pane put client property compiereplaf background cc j panel j dialog win get content pane set name content pane else if win instanceof j frame j panel j frame win get content pane put client property compiereplaf background cc j panel j frame win get content pane set name content pane else if win instanceof j window j panel j window win get content pane put client property compiereplaf background cc j panel j window win get content pane set name content pane setbackground compierecolor jdialog jpanel jdialog getcontentpane putclientproperty jpanel jdialog getcontentpane setname contentpane jframe jpanel jframe getcontentpane putclientproperty jpanel jframe getcontentpane setname contentpane jwindow jpanel jwindow getcontentpane putclientproperty jpanel jwindow getcontentpane setname contentpane set default background param bg background color see compiere panelui set default background public static void set default background compiere color bg compiere panelui set default background bg compierepanelui setdefaultbackground setdefaultbackground compierecolor compierepanelui setdefaultbackground get default background return background see compiere panelui get default background public static compiere color get default background return compiere panelui get default background compierepanelui getdefaultbackground compierecolor getdefaultbackground compierepanelui getdefaultbackground set default background param set default if true the background will be set to the default color see compiere panelui set set default public static void set set default boolean set default compiere panelui set set default set default setdefault compierepanelui setsetdefault setsetdefault setdefault compierepanelui setsetdefault setdefault is the default background set by default return true if default background is set see compiere panelui is set default public static boolean is set default return compiere panelui is set default compierepanelui issetdefault issetdefault compierepanelui issetdefault parse attributes and return compiere color param attributes attributes return compiere color public static compiere color parse string attributes compiere color cc new compiere color try if attributes null attributes length 0 cc parse attributres attributes catch exception e log severe attributes e to string return cc compierecolor compierecolor compierecolor compierecolor compierecolor parseattributres tostring create gradient background color window system color white public compiere color this type gradient compierecolor type_gradient create default background colors of type param type background type see constants type public compiere color string type if type null new java lang illegal argument exception exception text if type equals type flat type equals type gradient type equals type texture type equals type lines m type type else new java lang illegal argument exception invalid type type_ compierecolor illegalargumentexception exception_text type_flat type_gradient type_texture type_lines m_type illegalargumentexception create flat background color param bg background public compiere color color bg this bg true compierecolor create background color param bg color param flat if true create flat color otherwise gradient color with white lower color public compiere color color bg boolean flat if bg null new java lang illegal argument exception exception text m type flat type flat type gradient m primarycolor bg compierecolor illegalargumentexception exception_text m_type type_flat type_gradient m_primarycolor set background to gradient colors param upper color upper color param lower color lower color param start point starting point e g south west see swing constants default north west param repeat distance x y distance to repeat gradient in points 0 no repeats public compiere color color upper color color lower color int start point int repeat distance if upper color null lower color null new java lang illegal argument exception exception text m type type gradient m primarycolor upper color m secondarycolor lower color m startpoint start point m repeatdistance repeat distance uppercolor lowercolor startpoint south_west swingconstants north_west repeatdistance compierecolor uppercolor lowercolor startpoint repeatdistance uppercolor lowercolor illegalargumentexception exception_text m_type type_gradient m_primarycolor uppercolor m_secondarycolor lowercolor m_startpoint startpoint m_repeatdistance repeatdistance set background to gradient colors starting in the north repeat after 100 pt param upper color upper color param lower color lower color public compiere color color upper color color lower color this upper color lower color swing constants north west 100 uppercolor lowercolor compierecolor uppercolor lowercolor uppercolor lowercolor swingconstants north_west set background to texture param textureurl url to a gif or jpg graphic file param taint color to taint the texture use white for not tainting it param composite alpha value from 0 no to 1 full taining public compiere color url textureurl color taint float composite alpha if textureurl null taint null new java lang illegal argument exception exception text m type type texture m textureurl textureurl m primarycolor taint m compositealpha composite alpha compositealpha compierecolor compositealpha illegalargumentexception exception_text m_type type_texture m_textureurl m_primarycolor m_compositealpha compositealpha set background to texture param textureurl url to a gif or jpg graphic file param taint color to taint the texture use white for not tainting it param composite alpha tainting value from 0 no full graph to 1 full no graph public compiere color string textureurl color taint float composite alpha if textureurl null taint null new java lang illegal argument exception exception text m type type texture set textureurl textureurl m primarycolor taint m compositealpha composite alpha compositealpha fullgraph nograph compierecolor compositealpha illegalargumentexception exception_text m_type type_texture settextureurl m_primarycolor m_compositealpha compositealpha set background to lines param line color line color param back color background color param line width stroke width in point param line distance distance between lines in points public compiere color color line color color back color float line width int line distance if line color null back color null new java lang illegal argument exception exception text m type type lines m primarycolor back color m secondarycolor line color m linewidth line width m linedistance line distance linecolor backcolor linewidth linedistance compierecolor linecolor backcolor linewidth linedistance linecolor backcolor illegalargumentexception exception_text m_type type_lines m_primarycolor backcolor m_secondarycolor linecolor m_linewidth linewidth m_linedistance linedistance copy color param cc color public compiere color compiere color cc if cc null return set color cc compierecolor compierecolor setcolor get background type flat gradient lines texture return background type see type constants public string get type return m type backgroundtype type_ gettype m_type flat background type default return true if flat background public boolean is flat return type flat equals get type isflat type_flat gettype gradient background type return true if gradient background public boolean is gradient return type gradient equals get type isgradient type_gradient gettype line background type return true if line background public boolean is line return type lines equals get type isline type_lines gettype texture background type return true if texture background public boolean is texture return type texture equals get type istexture type_texture gettype get flat color return primary color public color get flat color return m primarycolor getflatcolor m_primarycolor set flat color param color flat color public void set flat color color color if is flat color null return m primarycolor color m dirty true setflatcolor isflat m_primarycolor m_dirty gradient upper color return color or null public color get gradient upper color if is gradient return null return m primarycolor getgradientuppercolor isgradient m_primarycolor gradient upper color param color upper color public void set gradient upper color color color if is gradient color null return m primarycolor color m dirty true setgradientuppercolor isgradient m_primarycolor m_dirty gradient lower color return color or null public color get gradient lower color if is gradient return null return m secondarycolor getgradientlowercolor isgradient m_secondarycolor gradient lower color param color lower color public void set gradient lower color color color if is gradient color null return m secondarycolor color m dirty true setgradientlowercolor isgradient m_secondarycolor m_dirty gradient starting point return starting point e g north or 0 see swing constants public int get gradient start point if is gradient return 0 return m startpoint swingconstants getgradientstartpoint isgradient m_startpoint gradient starting point param start point starting point e g north see swing constants public void set gradient start point int start point if is gradient return m startpoint start point m dirty true startpoint swingconstants setgradientstartpoint startpoint isgradient m_startpoint startpoint m_dirty gradient repeat distance in point return repeat distance or 0 public int get gradient repeat distance if is gradient return 0 return m repeatdistance getgradientrepeatdistance isgradient m_repeatdistance gradient repeat distance zero stands for no repeats param repeat distance repeat gradient after point x repeat y repeat depending on direction public void set gradient repeat distance int repeat distance if is gradient return m repeatdistance repeat distance m dirty true repeatdistance setgradientrepeatdistance repeatdistance isgradient m_repeatdistance repeatdistance m_dirty gradient repeat distance zero stands for no repeats param repeat distance string repeat gradient after point x repeat y repeat depending on direction public void set gradient repeat distance string repeat distance string if is gradient return try set gradient repeat distance integer parse int repeat distance string catch exception e log severe parsing repeat distance string e get message repeatdistancestring setgradientrepeatdistance repeatdistancestring isgradient setgradientrepeatdistance parseint repeatdistancestring repeatdistancestring getmessage texture url return url if not found org compiere plaf background jpg is used public url get textureurl if is texture return null if m textureurl null m textureurl compiere color class get resource compiere200x100 gif return m textureurl gettextureurl istexture m_textureurl m_textureurl compierecolor getresource m_textureurl get texture image based on texture url return image public buffered image get texture image if m image null url url get textureurl m image compiere utils load buffered image url buffered image type int argb pre return m image bufferedimage gettextureimage m_image gettextureurl m_image compiereutils loadbufferedimage bufferedimage type_int_argb_pre m_image texture url param url url to graphic file jpg public void set textureurl url url if is texture url null return m textureurl url m image null m dirty true settextureurl istexture m_textureurl m_image m_dirty texture url param url string url to graphic file jpg public void set textureurl string url string if is texture url string null return try set textureurl new url url string catch exception e log severe parsing url url string e get message urlstring settextureurl urlstring istexture urlstring settextureurl urlstring urlstring getmessage texture taint color return color or null public color get texture taint color if is texture return null return m primarycolor gettexturetaintcolor istexture m_primarycolor texture taint color param color taint color public void set texture taint color color color if is texture color null return m primarycolor color m dirty true settexturetaintcolor istexture m_primarycolor m_dirty texture composite alpha return composite ampha or 0f public float get texture composite alpha if is texture return 0f return m compositealpha gettexturecompositealpha istexture m_compositealpha texture composite alpha param alpha alpha value public void set texture composite alpha float alpha if is texture return m compositealpha alpha m dirty true settexturecompositealpha istexture m_compositealpha m_dirty texture composite alpha param alpha string string to be parsed public void set texture composite alpha string alpha string if is texture alpha string null return try set texture composite alpha float parse float alpha string catch exception e log severe parsing alpha string e get message alphastring settexturecompositealpha alphastring istexture alphastring settexturecompositealpha parsefloat alphastring alphastring getmessage line color return color or null public color get line color if is line return null return m secondarycolor getlinecolor isline m_secondarycolor line color param color line color public void set line color color color if is line color null return m secondarycolor color m dirty true setlinecolor isline m_secondarycolor m_dirty line background color return color or null public color get line back color if is line return null return m primarycolor getlinebackcolor isline m_primarycolor line background color param color background color public void set line back color color color if is line color null return m primarycolor color m dirty true setlinebackcolor isline m_primarycolor m_dirty background line width return width or 0f public float get line width if is line return 0f return m linewidth getlinewidth isline m_linewidth background line width param width line width public void set line width float width if is line return m linewidth width m dirty true setlinewidth isline m_linewidth m_dirty background line width param width string line width public void set line width string width string if is line width string null return try set line width float parse float width string catch exception e log severe parsing width string e get message widthstring setlinewidth widthstring isline widthstring setlinewidth parsefloat widthstring widthstring getmessage background line distance in pt return distance or 0 public int get line distance if is line return 0 return m linedistance getlinedistance isline m_linedistance background line distance in pt param distance line distance public void set line distance int distance if is line return m linedistance distance m dirty true setlinedistance isline m_linedistance m_dirty background line distance in pt param distance string line distance public void set line distance string distance string if is line return try set line distance integer parse int distance string catch exception e log severe parsing distance string e get message distancestring setlinedistance distancestring isline setlinedistance parseint distancestring distancestring getmessage set prinary color param color primary color protected void set primary color color color if color null m primarycolor color setprimarycolor m_primarycolor set compiere color from compiere color param cc compiere color public void set color compiere color cc if cc null return m type cc get type if cc is flat m primarycolor cc get flat color else if cc is gradient m primarycolor cc get gradient upper color m secondarycolor cc get gradient lower color m startpoint cc get gradient start point m repeatdistance cc get gradient repeat distance else if cc is texture set textureurl cc get textureurl m primarycolor cc get texture taint color m compositealpha cc get texture composite alpha else if cc is line m primarycolor cc get line back color m secondarycolor cc get line color m linewidth cc get line width m linedistance cc get line distance else log severe invalid color m dirty true compierecolor compierecolor compierecolor setcolor compierecolor m_type gettype isflat m_primarycolor getflatcolor isgradient m_primarycolor getgradientuppercolor m_secondarycolor getgradientlowercolor m_startpoint getgradientstartpoint m_repeatdistance getgradientrepeatdistance istexture settextureurl gettextureurl m_primarycolor gettexturetaintcolor m_compositealpha gettexturecompositealpha isline m_primarycolor getlinebackcolor m_secondarycolor getlinecolor m_linewidth getlinewidth m_linedistance getlinedistance m_dirty fill with compiere color background param g the code graphics code context in which to paint param c the component being painted public void paint graphics g j component c get color background c paint g c compierecolor jcomponent getcolorbackground fill with compiere background param g graphics param c component param x x pos param y y pos param w with param h height public void paint rect graphics g j component c int x int y int w int h get color background c paint rect g c x y w h paintrect jcomponent getcolorbackground paintrect get background param c componenr return background private color background get color background j component c if m back null rectangle bounds c get bounds container container c get parent while container null bounds container get bounds bounds container container get parent m back new color background bounds return m back colorbackground getcolorbackground jcomponent m_back getbounds getparent getbounds getparent m_back colorbackground m_back string representation return string representation public string to string string buffer sb new string buffer compiere color if is flat sb append flat append append compiere theme get color as string get flat color else if is gradient sb append gradient append upper append compiere theme get color as string get gradient upper color append lower append compiere theme get color as string get gradient lower color append start append get gradient start point append r distance append get gradient repeat distance else if is line sb append line append color append compiere theme get color as string get line color append back color append compiere theme get color as string get line back color append width append get line width append distance append get line distance else if is texture sb append texture append graphurl append get textureurl append taint append compiere theme get color as string get texture taint color append alpha append get texture composite alpha sb append return sb to string tostring stringbuffer stringbuffer compierecolor isflat compieretheme getcolorasstring getflatcolor isgradient compieretheme getcolorasstring getgradientuppercolor compieretheme getcolorasstring getgradientlowercolor getgradientstartpoint rdistance getgradientrepeatdistance isline compieretheme getcolorasstring getlinecolor backcolor compieretheme getcolorasstring getlinebackcolor getlinewidth getlinedistance istexture gettextureurl compieretheme getcolorasstring gettexturetaintcolor gettexturecompositealpha tostring parse string representation and set attributes param str parse string private void parse attributres string str if str index of flat 1 m type type flat m primarycolor compiere theme parse color str new colorui resource m primarycolor else if str index of gradient 1 m type type gradient m primarycolor compiere theme parse color str substring str index of upper 7 str index of lower new colorui resource m primarycolor m secondarycolor compiere theme parse color str substring str index of lower 7 str index of start new colorui resource m secondarycolor m startpoint integer parse int str substring str index of start 7 str index of r distance set gradient repeat distance str substring str index of r distance 11 str last index of else if str index of line 1 m type type lines m primarycolor compiere theme parse color str substring str index of color 7 str index of back color new colorui resource m primarycolor m secondarycolor compiere theme parse color str substring str index of back color 11 str index of width new colorui resource m secondarycolor set line width str substring str index of width 7 str index of distance set line distance str substring str index of distance 10 str last index of else if str index of texture 1 m type type texture set textureurl str substring str index of graphurl 10 str index of taint m primarycolor compiere theme parse color str substring str index of taint 7 str index of alpha new colorui resource m primarycolor set texture composite alpha str substring str index of alpha 7 str last index of parseattributres indexof m_type type_flat m_primarycolor compieretheme parsecolor coloruiresource m_primarycolor indexof m_type type_gradient m_primarycolor compieretheme parsecolor indexof indexof coloruiresource m_primarycolor m_secondarycolor compieretheme parsecolor indexof indexof coloruiresource m_secondarycolor m_startpoint parseint indexof indexof rdistance setgradientrepeatdistance indexof rdistance lastindexof indexof m_type type_lines m_primarycolor compieretheme parsecolor indexof indexof backcolor coloruiresource m_primarycolor m_secondarycolor compieretheme parsecolor indexof backcolor indexof coloruiresource m_secondarycolor setlinewidth indexof indexof setlinedistance indexof lastindexof indexof m_type type_texture settextureurl indexof indexof m_primarycolor compieretheme parsecolor indexof indexof coloruiresource m_primarycolor settexturecompositealpha indexof lastindexof does the background needs to be redone return true if there were changes boolean is dirty return m dirty isdirty m_dirty set dirty param dirty if true the background will be re painted void set dirty boolean dirty m dirty dirty setdirty m_dirty create color background param bounds rectangle to fit in public color background rectangle bounds create color background bounds fill color background colorbackground createcolorbackground fillcolorbackground create color background param bounds rectangle to fit in private void create color background rectangle bounds m height math max bounds y bounds height m height m width math max bounds x bounds width m width m backimage new buffered image m width m height buffered image type int argb pre createcolorbackground m_height m_height m_width m_width m_backimage bufferedimage m_width m_height bufferedimage type_int_argb_pre fill background with color public void fill color background graphics2d g2d m backimage create graphics if is gradient point start null point end null int r 1 repeats switch m startpoint case swing constants north west start new point 0 0 if m repeatdistance 0 end new point m repeatdistance m repeatdistance end new point math min m repeatdistance m width math min m repeatdistance height else end new point m width r m height r break case swing constants west start new point 0 m height 2 if m repeatdistance 0 end new point m repeatdistance m height 2 end new point math min m repeatdistance m width m height 2 else end new point m width r m height 2 break case swing constants south west start new point 0 m height if m repeatdistance 0 end new point m repeatdistance m height m repeatdistance end new point math min m width m repeatdistance math max 0 m height m repeatdistance else end new point m width r m height m height r break case swing constants south start new point 0 m height if m repeatdistance 0 end new point 0 m height m repeatdistance end new point 0 math max 0 m height m repeatdistance else end new point 0 m height m height r break case swing constants south east start new point m width m height if m repeatdistance 0 end new point m width m repeatdistance m height m repeatdistance end new point math min 0 m width m repeatdistance math max 0 m height m repeatdistance else end new point m width m width r m height m height r break case swing constants east start new point m width m height 2 if m repeatdistance 0 end new point m width m repeatdistance m height 2 end new point math min 0 m width m repeatdistance m height 2 else end new point m width m width r m height 2 break case swing constants north east start new point m width 0 if m repeatdistance 0 end new point m width m repeatdistance m repeatdistance end new point math min 0 m width m repeatdistance math min m height m repeatdistance else end new point m width m width r m height r break default case swing constants north start new point 0 0 if m repeatdistance 0 end new point 0 m repeatdistance end new point 0 math min m height m repeatdistance else end new point 0 m height r gradient paint paint new gradient paint start color blind get dichromat color get gradient upper color end color blind get dichromat color get gradient lower color true cyclic g2d set paint paint g2d fill rect 0 0 m width m height else if is texture buffered image image get texture image if image null g2d set paint color blind get dichromat color get flat color g2d fill rect 0 0 m width m height else rectangle anchor new rectangle 0 0 image get width image get height texture paint texture new texture paint image anchor g2d set paint texture g2d fill rect 0 0 m width m height g2d set composite alpha composite get instance alpha composite src over get texture composite alpha g2d set paint color blind get dichromat color get texture taint color g2d fill rect 0 0 m width m height else if is line background g2d set paint color blind get dichromat color get line back color g2d fill rect 0 0 m width m height lines g2d set paint color blind get dichromat color get line color g2d set stroke new basic stroke get line width for int y 0 y m height y get line distance g2d draw line 0 y m width y else flat g2d set paint color blind get dichromat color get flat color g2d fill rect 0 0 m width m height set dirty false fillcolorbackground m_backimage creategraphics isgradient m_startpoint swingconstants north_west m_repeatdistance m_repeatdistance m_repeatdistance m_repeatdistance m_width m_repeatdistance m_width m_height swingconstants m_height m_repeatdistance m_repeatdistance m_height m_repeatdistance m_width m_height m_width m_height swingconstants south_west m_height m_repeatdistance m_repeatdistance m_height m_repeatdistance m_width m_repeatdistance m_height m_repeatdistance m_width m_height m_height swingconstants m_height m_repeatdistance m_height m_repeatdistance m_height m_repeatdistance m_height m_height swingconstants south_east m_width m_height m_repeatdistance m_width m_repeatdistance m_height m_repeatdistance m_width m_repeatdistance m_height m_repeatdistance m_width m_width m_height m_height swingconstants m_width m_height m_repeatdistance m_width m_repeatdistance m_height m_width m_repeatdistance m_height m_width m_width m_height swingconstants north_east m_width m_repeatdistance m_width m_repeatdistance m_repeatdistance m_width m_repeatdistance m_height m_repeatdistance m_width m_width m_height swingconstants m_repeatdistance m_repeatdistance m_height m_repeatdistance m_height gradientpaint gradientpaint colorblind getdichromatcolor getgradientuppercolor colorblind getdichromatcolor getgradientlowercolor setpaint fillrect m_width m_height istexture bufferedimage gettextureimage setpaint colorblind getdichromatcolor getflatcolor fillrect m_width m_height getwidth getheight texturepaint texturepaint setpaint fillrect m_width m_height setcomposite alphacomposite getinstance alphacomposite src_over gettexturecompositealpha setpaint colorblind getdichromatcolor gettexturetaintcolor fillrect m_width m_height isline setpaint colorblind getdichromatcolor getlinebackcolor fillrect m_width m_height setpaint colorblind getdichromatcolor getlinecolor setstroke basicstroke getlinewidth m_height getlinedistance drawline m_width setpaint colorblind getdichromatcolor getflatcolor fillrect m_width m_height setdirty paint copy background to component param g graphics param c component public void paint graphics g j component c rectangle bounds c get bounds check bounds int h c get height int w c get width copy background g draw image m backimage 0 0 destination start point w h destination end point bounds x bounds y source start bounds x w bounds y h source end c jcomponent getbounds getheight getwidth drawimage m_backimage paint copy background to component rectangle param g graphics param c compnent param x x pos param y y pos param w width param h height public void paint rect graphics g j component c int x int y int w int h rectangle bounds c get bounds check bounds copy background g draw image m backimage x y destination start point x w h y destination end point x y source start x w y h source end c paintrect jcomponent getbounds drawimage m_backimage check size of background and repaint if required param bounds bounds of component private void check rectangle bounds re create if color type changed if color blind get color type m colorblind m colorblind color blind get color type set dirty true we need to create new background if m height bounds y bounds height m width bounds x bounds width create color background bounds fill color background else if is dirty fill color background colorblind getcolortype m_colorblind m_colorblind colorblind getcolortype setdirty m_height m_width createcolorbackground fillcolorbackground isdirty fillcolorbackground detail protected contructor param frame parent frame param modal modal param window no window no param value query value param multi selection multiple selections param where clause where clause protected info invoice frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no i c invoice id multi selection where clause set title msg get msg env get ctx info invoice try stat init p loadedok init info catch exception e return int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if value null value length 0 f document no set value value execute query pack focus f document no request focus windowno multiselection whereclause infoinvoice windowno multiselection whereclause windowno c_invoice_id multiselection whereclause settitle getmsg getctx infoinvoice statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring fdocumentno setvalue executequery fdocumentno requestfocus static setup add fields to parameter panel throws exception private void stat init throws exception l document no set label for f document no f document no set background compiereplaf get info background f document no add action listener this l description set label for f description f description set background compiereplaf get info background f description add action listener this lpo reference set label for lpo reference fpo reference set background compiereplaf get info background fpo reference add action listener this f is paid set selected false f is paid add action listener this f isso trx set selected n equals env get context env get ctx p windowno isso trx f isso trx add action listener this forg id new v lookup ad org id false false true m lookup factory create env get ctx 3486 m windowno display type table dir false display type table dir m windowno lorg id set label for forg id forg id set background compiereplaf get info background c invoice c bpartner id fbpartner id new v lookup c bpartner id false false true m lookup factory get env get ctx p windowno 0 3499 display type search lbpartner id set label for fbpartner id fbpartner id set background compiereplaf get info background c invoice c order id forder id new v lookup c order id false false true m lookup factory get env get ctx p windowno 0 4247 display type search lorder id set label for forder id forder id set background compiereplaf get info background l date from set label for f date from f date from set background compiereplaf get info background f date from set tool tip text msg translate env get ctx date from l date to set label for f date to f date to set background compiereplaf get info background f date to set tool tip text msg translate env get ctx date to l amt from set label for f amt from f amt from set background compiereplaf get info background f amt from set tool tip text msg translate env get ctx amt from l amt to set label for f amt to f amt to set background compiereplaf get info background f amt to set tool tip text msg translate env get ctx amt to parameter panel set layout new a layout first row parameter panel add l document no new a layout constraint 0 0 parameter panel add f document no null parameter panel add lbpartner id null parameter panel add fbpartner id null parameter panel add f isso trx new a layout constraint 0 5 parameter panel add f is paid null 2nd row parameter panel add l description new a layout constraint 1 0 parameter panel add f description null parameter panel add l date from null parameter panel add f date from null parameter panel add l date to null parameter panel add f date to null 3rd row parameter panel add lorder id new a layout constraint 2 0 parameter panel add forder id null parameter panel add l amt from null parameter panel add f amt from null parameter panel add l amt to null parameter panel add f amt to null parameter panel add lorg id null parameter panel add forg id null parameterpanel statinit ldocumentno setlabelfor fdocumentno fdocumentno setbackground getinfobackground fdocumentno addactionlistener ldescription setlabelfor fdescription fdescription setbackground getinfobackground fdescription addactionlistener lporeference setlabelfor lporeference fporeference setbackground getinfobackground fporeference addactionlistener fispaid setselected fispaid addactionlistener fissotrx setselected getcontext getctx p_windowno issotrx fissotrx addactionlistener forg_id vlookup ad_org_id mlookupfactory getctx m_windowno displaytype tabledir displaytype tabledir m_windowno lorg_id setlabelfor forg_id forg_id setbackground getinfobackground c_invoice c_bpartner_id fbpartner_id vlookup c_bpartner_id mlookupfactory getctx p_windowno displaytype lbpartner_id setlabelfor fbpartner_id fbpartner_id setbackground getinfobackground c_invoice c_order_id forder_id vlookup c_order_id mlookupfactory getctx p_windowno displaytype lorder_id setlabelfor forder_id forder_id setbackground getinfobackground ldatefrom setlabelfor fdatefrom fdatefrom setbackground getinfobackground fdatefrom settooltiptext getctx datefrom ldateto setlabelfor fdateto fdateto setbackground getinfobackground fdateto settooltiptext getctx dateto lamtfrom setlabelfor famtfrom famtfrom setbackground getinfobackground famtfrom settooltiptext getctx amtfrom lamtto setlabelfor famtto famtto setbackground getinfobackground famtto settooltiptext getctx amtto parameterpanel setlayout alayout parameterpanel ldocumentno alayoutconstraint parameterpanel fdocumentno parameterpanel lbpartner_id parameterpanel fbpartner_id parameterpanel fissotrx alayoutconstraint parameterpanel fispaid parameterpanel ldescription alayoutconstraint parameterpanel fdescription parameterpanel ldatefrom parameterpanel fdatefrom parameterpanel ldateto parameterpanel fdateto parameterpanel lorder_id alayoutconstraint parameterpanel forder_id parameterpanel lamtfrom parameterpanel famtfrom parameterpanel lamtto parameterpanel famtto parameterpanel lorg_id parameterpanel forg_id general init return true if success private boolean init info set defaults string bp env get context env get ctx p windowno c bpartner id if bp null bp length 0 fbpartner id set value new integer bp prepare table string buffer where new string buffer i is active y if p whereclause length 0 where append and append util replace p whereclause c invoice i prepare table s invoicelayout c invoice v i corrected for cm where to string 2 3 4 m allocation line set is paid env get ctx 0 null return true initinfo getcontext getctx p_windowno c_bpartner_id fbpartner_id setvalue stringbuffer stringbuffer isactive p_whereclause p_whereclause c_invoice preparetable s_invoicelayout c_invoice_v tostring mallocationline setispaid getctx construct sql where clause and define parameters set parameters needs to set parameters includes first and return sql string getsql where string buffer sql new string buffer if f document no get text length 0 sql append and upper i document no like if f description get text length 0 sql append and upper i description like if fpo reference get text length 0 sql append and upper i po reference like if fbpartner id get value null sql append and i c bpartner id if forder id get value null sql append and i c order id if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value if from null to null sql append and trunc i date invoiced else if from null to null sql append and trunc i date invoiced else if from null to null sql append and trunc i date invoiced between and if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value if from null to null sql append and i grand total else if from null to null sql append and i grand total else if from null to null sql append and i grand total between and sql append and i is paid and i isso trx log fine info invoice set where clause sql to string return sql to string setparameters getsqlwhere stringbuffer stringbuffer fdocumentno gettext documentno fdescription gettext fporeference gettext poreference fbpartner_id getvalue c_bpartner_id forder_id getvalue c_order_id fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue dateinvoiced dateinvoiced dateinvoiced famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue grandtotal grandtotal grandtotal ispaid issotrx infoinvoice setwhereclause tostring tostring set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 if f document no get text length 0 pstmt set string index getsql text f document no if f description get text length 0 pstmt set string index getsql text f description if fpo reference get text length 0 pstmt set string index getsql text fpo reference if fbpartner id get value null integer bp integer fbpartner id get value pstmt set int index bp int value log fine b partner bp if forder id get value null integer order integer forder id get value pstmt set int index order int value log fine order order if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value log fine date from from to to if from null to null pstmt set timestamp index to else if from null to null pstmt set timestamp index from else if from null to null pstmt set timestamp index from pstmt set timestamp index to if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value log fine amt from from to to if from null to null pstmt set big decimal index to else if from null to null pstmt set big decimal index from else if from null to null pstmt set big decimal index from pstmt set big decimal index to pstmt set string index f is paid is selected y n pstmt set string index f isso trx is selected y n getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fdocumentno gettext setstring getsqltext fdocumentno fdescription gettext setstring getsqltext fdescription fporeference gettext setstring getsqltext fporeference fbpartner_id getvalue fbpartner_id getvalue setint intvalue bpartner forder_id getvalue forder_id getvalue setint intvalue fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue settimestamp settimestamp settimestamp settimestamp famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue setbigdecimal setbigdecimal setbigdecimal setbigdecimal setstring fispaid isselected setstring fissotrx isselected get sql where parameter param f field return sql private string getsql text c text field f string s f get text to upper case if s ends with s log fine string s return s getsqltext ctextfield gettext touppercase endswith zoom void zoom log info info invoice zoom integer c invoice id get selected row key if c invoice id null return m query query new m query c invoice query add restriction c invoice id m query equal c invoice id query set record count 1 int ad windowno getad window id c invoice f isso trx is selected zoom ad windowno query infoinvoice c_invoice_id getselectedrowkey c_invoice_id mquery mquery c_invoice addrestriction c_invoice_id mquery c_invoice_id setrecordcount ad_windowno getad_window_id c_invoice fissotrx isselected ad_windowno has zoom return true boolean has zoom return true haszoom save selection settings void save selection detail publish for callout to read integer id get selected row key env set context env get ctx env window info env tab info c invoice id id null 0 id to string int c invoicepayschedule id 0 int row p table get selected row if row 0 object value p table get value at row index payschedule if value null value instanceof key name pair c invoicepayschedule id key name pair value get key if c invoicepayschedule id 0 not selected env set context env get ctx env window info env tab info c invoicepayschedule id 0 else env set context env get ctx env window info env tab info c invoicepayschedule id string value of c invoicepayschedule id saveselectiondetail getselectedrowkey setcontext getctx window_info tab_info c_invoice_id tostring c_invoicepayschedule_id p_table getselectedrow p_table getvalueat index_payschedule keynamepair c_invoicepayschedule_id keynamepair getkey c_invoicepayschedule_id setcontext getctx window_info tab_info c_invoicepayschedule_id setcontext getctx window_info tab_info c_invoicepayschedule_id valueof c_invoicepayschedule_id public c field editor cfieldeditor return the component that should be added to the tree hierarchy for this editor public component get editor component return this geteditorcomponent set editor param an object public void set item object an object if an object null set text else set text an object to string anobject setitem anobject anobject settext settext anobject tostring get edited item return edited text public object get item return get text getitem gettext returns format info for popup return format public object get format return null getformat standard constructor public x m rma properties ctx int m rma id string trx name super ctx m rma id trx name if m rma id 0 setc doctype id 0 set doc action null co set doc status null dr set document no null set is approved false setm inout id 0 setm rmatype id 0 setm rma id 0 set name null set processed false setsalesrep id 0 x_m_rma m_rma_id trxname m_rma_id trxname m_rma_id setc_doctype_id setdocaction setdocstatus setdocumentno setisapproved setm_inout_id setm_rmatype_id setm_rma_id setname setprocessed setsalesrep_id load constructor public x m rma properties ctx result set rs string trx name super ctx rs trx name x_m_rma resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m rma append get id append return sb to string tostring stringbuffer stringbuffer x_m_rma get_id tostring set amount amount public void set amt big decimal amt set value amt amt setamt bigdecimal set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c doctype id ad reference id 321 set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id c_doctype_id_ad_reference_id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 1 throw new illegal argument exception m inout id is mandatory set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id illegalargumentexception m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set rma type return material authorization type public void setm rmatype id int m rmatype id if m rmatype id 1 throw new illegal argument exception m rmatype id is mandatory set value m rmatype id new integer m rmatype id setm_rmatype_id m_rmatype_id m_rmatype_id illegalargumentexception m_rmatype_id set_value m_rmatype_id m_rmatype_id get rma type return material authorization type public int getm rmatype id integer ii integer get value m rmatype id if ii null return 0 return ii int value getm_rmatype_id get_value m_rmatype_id intvalue set rma return material authorization public void setm rma id int m rma id if m rma id 1 throw new illegal argument exception m rma id is mandatory set valuenocheck m rma id new integer m rma id setm_rma_id m_rma_id m_rma_id illegalargumentexception m_rma_id set_valuenocheck m_rma_id m_rma_id get rma return material authorization public int getm rma id integer ii integer get value m rma id if ii null return 0 return ii int value getm_rma_id get_value m_rma_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue get contsnts return contents public object get contents return contents getcontents standard constructor public x c order properties ctx int c order id string trx name super ctx c order id trx name if c order id 0 setc bpartner id 0 setc bpartner location id 0 setc currency id 0 c currency id setc doctypetarget id 0 setc doctype id 0 0 setc order id 0 setc paymentterm id 0 set date acct new timestamp system current time millis date set date ordered new timestamp system current time millis date set date promised new timestamp system current time millis date set delivery rule null f set delivery via rule null p set doc action null co set doc status null dr set document no null set freight amt env zero set freight cost rule null i set grand total env zero set invoice rule null i set is approved false is approved set is credit approved false set is delivered false set is discount printed false set is drop ship false n set is invoiced false set is printed false set isso trx false isso trx set is selected false set is self service false set is tax included false set is transferred false setm pricelist id 0 setm warehouse id 0 set payment rule null b set posted false n set priority rule null 5 set processed false setsalesrep id 0 set sende mail false set total lines env zero x_c_order c_order_id trxname c_order_id trxname c_order_id setc_bpartner_id setc_bpartner_location_id setc_currency_id c_currency_id setc_doctypetarget_id setc_doctype_id setc_order_id setc_paymentterm_id setdateacct currenttimemillis setdateordered currenttimemillis setdatepromised currenttimemillis setdeliveryrule setdeliveryviarule setdocaction setdocstatus setdocumentno setfreightamt setfreightcostrule setgrandtotal setinvoicerule setisapproved isapproved setiscreditapproved setisdelivered setisdiscountprinted setisdropship setisinvoiced setisprinted setissotrx issotrx setisselected setisselfservice setistaxincluded setistransferred setm_pricelist_id setm_warehouse_id setpaymentrule setposted setpriorityrule setprocessed setsalesrep_id setsendemail settotallines load constructor public x c order properties ctx result set rs string trx name super ctx rs trx name x_c_order resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c order append get id append return sb to string tostring stringbuffer stringbuffer x_c_order get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue public static final int bill bpartner id ad reference id 138 set invoice partner business partner to be invoiced public void setbill bpartner id int bill bpartner id if bill bpartner id 0 set value bill bpartner id null else set value bill bpartner id new integer bill bpartner id bill_bpartner_id_ad_reference_id setbill_bpartner_id bill_bpartner_id bill_bpartner_id set_value bill_bpartner_id set_value bill_bpartner_id bill_bpartner_id get invoice partner business partner to be invoiced public int getbill bpartner id integer ii integer get value bill bpartner id if ii null return 0 return ii int value getbill_bpartner_id get_value bill_bpartner_id intvalue public static final int bill location id ad reference id 159 set invoice location business partner location for invoicing public void setbill location id int bill location id if bill location id 0 set value bill location id null else set value bill location id new integer bill location id bill_location_id_ad_reference_id setbill_location_id bill_location_id bill_location_id set_value bill_location_id set_value bill_location_id bill_location_id get invoice location business partner location for invoicing public int getbill location id integer ii integer get value bill location id if ii null return 0 return ii int value getbill_location_id get_value bill_location_id intvalue public static final int bill user id ad reference id 110 set invoice contact business partner contact for invoicing public void setbill user id int bill user id if bill user id 0 set value bill user id null else set value bill user id new integer bill user id bill_user_id_ad_reference_id setbill_user_id bill_user_id bill_user_id set_value bill_user_id set_value bill_user_id bill_user_id get invoice contact business partner contact for invoicing public int getbill user id integer ii integer get value bill user id if ii null return 0 return ii int value getbill_user_id get_value bill_user_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set cash journal line cash journal line public void setc cashline id int c cashline id if c cashline id 0 set value c cashline id null else set value c cashline id new integer c cashline id setc_cashline_id c_cashline_id c_cashline_id set_value c_cashline_id set_value c_cashline_id c_cashline_id get cash journal line cash journal line public int getc cashline id integer ii integer get value c cashline id if ii null return 0 return ii int value getc_cashline_id get_value c_cashline_id intvalue public static final int c charge id ad reference id 200 set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id c_charge_id_ad_reference_id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c doctypetarget id ad reference id 170 set target document type target document type for conversing documents public void setc doctypetarget id int c doctypetarget id if c doctypetarget id 1 throw new illegal argument exception c doctypetarget id is mandatory set value c doctypetarget id new integer c doctypetarget id c_doctypetarget_id_ad_reference_id setc_doctypetarget_id c_doctypetarget_id c_doctypetarget_id illegalargumentexception c_doctypetarget_id set_value c_doctypetarget_id c_doctypetarget_id get target document type target document type for conversing documents public int getc doctypetarget id integer ii integer get value c doctypetarget id if ii null return 0 return ii int value getc_doctypetarget_id get_value c_doctypetarget_id intvalue public static final int c doctype id ad reference id 170 set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set valuenocheck c doctype id new integer c doctype id c_doctype_id_ad_reference_id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_valuenocheck c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set order order public void setc order id int c order id if c order id 1 throw new illegal argument exception c order id is mandatory set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id illegalargumentexception c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt set value charge amt charge amt setchargeamt bigdecimal chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set copy from copy from record public void set copy from string copy from if copy from null copy from length 1 log warning length 1 truncated copy from copy from substring 0 0 set value copy from copy from setcopyfrom copyfrom copyfrom copyfrom copyfrom copyfrom set_value copyfrom copyfrom get copy from copy from record public string get copy from return string get value copy from getcopyfrom get_value copyfrom set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date ordered date of order public void set date ordered timestamp date ordered if date ordered null throw new illegal argument exception date ordered is mandatory set value date ordered date ordered setdateordered dateordered dateordered illegalargumentexception dateordered set_value dateordered dateordered get date ordered date of order public timestamp get date ordered return timestamp get value date ordered getdateordered get_value dateordered set date printed date the document was printed public void set date printed timestamp date printed set value date printed date printed setdateprinted dateprinted set_value dateprinted dateprinted get date printed date the document was printed public timestamp get date printed return timestamp get value date printed getdateprinted get_value dateprinted set date promised date order was promised public void set date promised timestamp date promised if date promised null throw new illegal argument exception date promised is mandatory set value date promised date promised setdatepromised datepromised datepromised illegalargumentexception datepromised set_value datepromised datepromised get date promised date order was promised public timestamp get date promised return timestamp get value date promised getdatepromised get_value datepromised public static final string deliveryrule afterreceipt r set delivery rule defines the timing of delivery public void set delivery rule string delivery rule if delivery rule null throw new illegal argument exception delivery rule is mandatory if delivery rule equals a delivery rule equals f delivery rule equals l delivery rule equals m delivery rule equals o delivery rule equals r else throw new illegal argument exception delivery rule invalid value delivery rule reference id 151 a f l m o r if delivery rule length 1 log warning length 1 truncated delivery rule delivery rule substring 0 0 set value delivery rule delivery rule deliveryrule_afterreceipt setdeliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule reference_id deliveryrule deliveryrule deliveryrule set_value deliveryrule deliveryrule get delivery rule defines the timing of delivery public string get delivery rule return string get value delivery rule getdeliveryrule get_value deliveryrule public static final string deliveryviarule shipper s set delivery via how the order will be delivered public void set delivery via rule string delivery via rule if delivery via rule null throw new illegal argument exception delivery via rule is mandatory if delivery via rule equals d delivery via rule equals p delivery via rule equals s else throw new illegal argument exception delivery via rule invalid value delivery via rule reference id 152 d p s if delivery via rule length 1 log warning length 1 truncated delivery via rule delivery via rule substring 0 0 set value delivery via rule delivery via rule deliveryviarule_shipper setdeliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule reference_id deliveryviarule deliveryviarule deliveryviarule set_value deliveryviarule deliveryviarule get delivery via how the order will be delivered public string get delivery via rule return string get value delivery via rule getdeliveryviarule get_value deliveryviarule set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set freight amount freight amount public void set freight amt big decimal freight amt if freight amt null throw new illegal argument exception freight amt is mandatory set value freight amt freight amt setfreightamt bigdecimal freightamt freightamt illegalargumentexception freightamt set_value freightamt freightamt get freight amount freight amount public big decimal get freight amt big decimal bd big decimal get value freight amt if bd null return env zero return bd bigdecimal getfreightamt bigdecimal bigdecimal get_value freightamt public static final string freightcostrule line l set freight cost rule method for charging freight public void set freight cost rule string freight cost rule if freight cost rule null throw new illegal argument exception freight cost rule is mandatory if freight cost rule equals c freight cost rule equals f freight cost rule equals i freight cost rule equals l else throw new illegal argument exception freight cost rule invalid value freight cost rule reference id 153 c f i l if freight cost rule length 1 log warning length 1 truncated freight cost rule freight cost rule substring 0 0 set value freight cost rule freight cost rule freightcostrule_line setfreightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule reference_id freightcostrule freightcostrule freightcostrule set_value freightcostrule freightcostrule get freight cost rule method for charging freight public string get freight cost rule return string get value freight cost rule getfreightcostrule get_value freightcostrule set grand total total amount of document public void set grand total big decimal grand total if grand total null throw new illegal argument exception grand total is mandatory set valuenocheck grand total grand total setgrandtotal bigdecimal grandtotal grandtotal illegalargumentexception grandtotal set_valuenocheck grandtotal grandtotal get grand total total amount of document public big decimal get grand total big decimal bd big decimal get value grand total if bd null return env zero return bd bigdecimal getgrandtotal bigdecimal bigdecimal get_value grandtotal public static final string invoicerule customerscheduleafterdelivery s set invoice rule frequency and method of invoicing public void set invoice rule string invoice rule if invoice rule null throw new illegal argument exception invoice rule is mandatory if invoice rule equals d invoice rule equals i invoice rule equals o invoice rule equals s else throw new illegal argument exception invoice rule invalid value invoice rule reference id 150 d i o s if invoice rule length 1 log warning length 1 truncated invoice rule invoice rule substring 0 0 set value invoice rule invoice rule invoicerule_customerscheduleafterdelivery setinvoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule invoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule reference_id invoicerule invoicerule invoicerule set_value invoicerule invoicerule get invoice rule frequency and method of invoicing public string get invoice rule return string get value invoice rule getinvoicerule get_value invoicerule set approved indicates if this document requires approval public void set is approved boolean is approved set valuenocheck is approved new boolean is approved setisapproved isapproved set_valuenocheck isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set credit approved credit has been approved public void set is credit approved boolean is credit approved set valuenocheck is credit approved new boolean is credit approved setiscreditapproved iscreditapproved set_valuenocheck iscreditapproved iscreditapproved get credit approved credit has been approved public boolean is credit approved object oo get value is credit approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreditapproved get_value iscreditapproved booleanvalue set delivered public void set is delivered boolean is delivered set valuenocheck is delivered new boolean is delivered setisdelivered isdelivered set_valuenocheck isdelivered isdelivered get delivered public boolean is delivered object oo get value is delivered if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdelivered get_value isdelivered booleanvalue set discount printed print discount on invoice and order public void set is discount printed boolean is discount printed set value is discount printed new boolean is discount printed setisdiscountprinted isdiscountprinted set_value isdiscountprinted isdiscountprinted get discount printed print discount on invoice and order public boolean is discount printed object oo get value is discount printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountprinted get_value isdiscountprinted booleanvalue set drop shipment drop shipments are sent from the vendor directly to the customer public void set is drop ship boolean is drop ship set valuenocheck is drop ship new boolean is drop ship setisdropship isdropship set_valuenocheck isdropship isdropship get drop shipment drop shipments are sent from the vendor directly to the customer public boolean is drop ship object oo get value is drop ship if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdropship get_value isdropship booleanvalue set invoiced is this invoiced public void set is invoiced boolean is invoiced set valuenocheck is invoiced new boolean is invoiced setisinvoiced isinvoiced set_valuenocheck isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set valuenocheck is printed new boolean is printed setisprinted isprinted set_valuenocheck isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set selected public void set is selected boolean is selected set value is selected new boolean is selected setisselected isselected set_value isselected isselected get selected public boolean is selected object oo get value is selected if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselected get_value isselected booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set transferred transferred to general ledger i e accounted public void set is transferred boolean is transferred set valuenocheck is transferred new boolean is transferred setistransferred istransferred set_valuenocheck istransferred istransferred get transferred transferred to general ledger i e accounted public boolean is transferred object oo get value is transferred if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istransferred get_value istransferred booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 0 set value m shipper id null else set value m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id set_value m_shipper_id set_value m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set value po reference po reference setporeference poreference poreference poreference poreference poreference set_value poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference set payment b partner business partner responsible for the payment public void setpay bpartner id int pay bpartner id if pay bpartner id 0 set value pay bpartner id null else set value pay bpartner id new integer pay bpartner id bpartner setpay_bpartner_id pay_bpartner_id pay_bpartner_id set_value pay_bpartner_id set_value pay_bpartner_id pay_bpartner_id get payment b partner business partner responsible for the payment public int getpay bpartner id integer ii integer get value pay bpartner id if ii null return 0 return ii int value bpartner getpay_bpartner_id get_value pay_bpartner_id intvalue set payment location location of the business partner responsible for the payment public void setpay location id int pay location id if pay location id 0 set value pay location id null else set value pay location id new integer pay location id setpay_location_id pay_location_id pay_location_id set_value pay_location_id set_value pay_location_id pay_location_id get payment location location of the business partner responsible for the payment public int getpay location id integer ii integer get value pay location id if ii null return 0 return ii int value getpay_location_id get_value pay_location_id intvalue public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue public static final string priorityrule minor 9 set priority priority of a document public void set priority rule string priority rule if priority rule null throw new illegal argument exception priority rule is mandatory if priority rule equals 1 priority rule equals 3 priority rule equals 5 priority rule equals 7 priority rule equals 9 else throw new illegal argument exception priority rule invalid value priority rule reference id 154 1 3 5 7 9 if priority rule length 1 log warning length 1 truncated priority rule priority rule substring 0 0 set value priority rule priority rule priorityrule_minor setpriorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule priorityrule priorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule reference_id priorityrule priorityrule priorityrule set_value priorityrule priorityrule get priority priority of a document public string get priority rule return string get value priority rule getpriorityrule get_value priorityrule set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int ref order id ad reference id 290 set referenced order reference to corresponding sales purchase order public void setref order id int ref order id if ref order id 0 set value ref order id null else set value ref order id new integer ref order id ref_order_id_ad_reference_id setref_order_id ref_order_id ref_order_id set_value ref_order_id set_value ref_order_id ref_order_id get referenced order reference to corresponding sales purchase order public int getref order id integer ii integer get value ref order id if ii null return 0 return ii int value getref_order_id get_value ref_order_id intvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set send e mail enable sending document e mail public void set sende mail boolean sende mail set value sende mail new boolean sende mail email email setsendemail sendemail set_value sendemail sendemail get send e mail enable sending document e mail public boolean is sende mail object oo get value sende mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email issendemail get_value sendemail booleanvalue set total lines total of all document lines public void set total lines big decimal total lines if total lines null throw new illegal argument exception total lines is mandatory set valuenocheck total lines total lines settotallines bigdecimal totallines totallines illegalargumentexception totallines set_valuenocheck totallines totallines get total lines total of all document lines public big decimal get total lines big decimal bd big decimal get value total lines if bd null return env zero return bd bigdecimal gettotallines bigdecimal bigdecimal get_value totallines public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue standard constructor public x ad pinstance properties ctx int ad pinstance id string trx name super ctx ad pinstance id trx name if ad pinstance id 0 setad pinstance id 0 setad process id 0 set is processing false setrecord id 0 x_ad_pinstance ad_pinstance_id trxname ad_pinstance_id trxname ad_pinstance_id setad_pinstance_id setad_process_id setisprocessing setrecord_id load constructor public x ad pinstance properties ctx result set rs string trx name super ctx rs trx name x_ad_pinstance resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad pinstance append get id append return sb to string tostring stringbuffer stringbuffer x_ad_pinstance get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad pinstance id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_pinstance_id set process process or report public void setad process id int ad process id if ad process id 1 throw new illegal argument exception ad process id is mandatory set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id illegalargumentexception ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set error msg public void set error msg string error msg if error msg null error msg length 2000 log warning length 2000 truncated error msg error msg substring 0 1999 set value error msg error msg seterrormsg errormsg errormsg errormsg errormsg errormsg set_value errormsg errormsg get error msg public string get error msg return string get value error msg geterrormsg get_value errormsg set processing public void set is processing boolean is processing set value is processing new boolean is processing setisprocessing isprocessing set_value isprocessing isprocessing get processing public boolean is processing object oo get value is processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value isprocessing booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set result result of the action taken public void set result int result set value result new integer result setresult set_value get result result of the action taken public int get result integer ii integer get value result if ii null return 0 return ii int value getresult get_value intvalue prepare protected void prepare p ad worlflow id getrecord id p_ad_worlflow_id getrecord_id process return info throws exception protected string do it throws exception m workflow wf m workflow get get ctx p ad worlflow id log info wf wf string msg wf validate wf save if msg length 0 throw new compiere user error msg get msg get ctx worflow not valid msg return wf is valid ok error doit mworkflow mworkflow getctx p_ad_worlflow_id compiereusererror getmsg getctx worflownotvalid isvalid this method creates a lt meta gt tag public meta sets the content attribute param content the value that should go into the content attribute public meta set content string content add attribute content content return this setcontent addattribute sets the name attribute param content the value that should go into the name attribute public meta set name string name add attribute name name return this setname addattribute sets the name attribute param content the value that should go into the name attribute public meta set name string name string content add attribute name name add attribute content content return this setname addattribute addattribute sets the scheme attribute param content the value that should go into the scheme attribute public meta set scheme string scheme add attribute scheme scheme return this setscheme addattribute sets the http equiv attribute param content the value that should go into the http equiv attribute public meta set http equiv string http equiv add attribute http equiv http equiv return this sethttpequiv http_equiv addattribute http_equiv sets the http equiv attribute param content the value that should go into the http equiv attribute public meta set http equiv string http equiv string content add attribute content content add attribute http equiv http equiv return this sethttpequiv http_equiv addattribute addattribute http_equiv sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public meta add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public meta add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public meta add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public meta add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public meta remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry standard cosntructor param ctx context param m movementline id id public m movement line properties ctx int m movementline id string trx name super ctx m movementline id trx name if m movementline id 0 setm locatorto id 0 m locatorto id setm locator id 0 m locator id setm movementline id 0 set line 0 setm product id 0 setm attributesetinstance id 0 id set movement qty env zero 1 set target qty env zero 0 set scrapped qty env zero set confirmed qty env zero set processed false m_movementline_id mmovementline m_movementline_id trxname m_movementline_id trxname m_movementline_id setm_locatorto_id m_locatorto_id setm_locator_id m_locator_id setm_movementline_id setline setm_product_id setm_attributesetinstance_id setmovementqty settargetqty setscrappedqty setconfirmedqty setprocessed load constructor param ctx context param rs result set public m movement line properties ctx result set rs string trx name super ctx rs trx name mmovementline resultset trxname trxname parent constructor param parent parent public m movement line m movement parent this parent get ctx 0 parent get trxname set client org parent setm movement id parent getm movement id mmovementline mmovement getctx get_trxname setclientorg setm_movement_id getm_movement_id get attribute set instance to return asi public int getm attributesetinstanceto id int m attributesetinstanceto id super getm attributesetinstanceto id if m attributesetinstanceto id 0 m attributesetinstanceto id super getm attributesetinstance id return m attributesetinstanceto id attributesetinstance getm_attributesetinstanceto_id m_attributesetinstanceto_id getm_attributesetinstanceto_id m_attributesetinstanceto_id m_attributesetinstanceto_id getm_attributesetinstance_id m_attributesetinstanceto_id add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription before save param new record new return true protected boolean before save boolean new record set line no if get line 0 string sql select coalesce max line 0 10 as default value from c m movementline where m movement id int ii db getsql value get trxname sql getm movement id set line ii if getm locator id getm locatorto id log save error error msg parse translation get ctx m locator id m locatorto id return false if get movement qty signum 0 log save error fill mandatory msg get element get ctx movement qty return false return true newrecord beforesave newrecord getline defaultvalue c_m_movementline m_movement_id getsqlvalue get_trxname getm_movement_id setline getm_locator_id getm_locatorto_id saveerror parsetranslation getctx m_locator_id m_locatorto_id getmovementqty saveerror fillmandatory getelement getctx movementqty standard constructor param ctx context param c dunninglevel id id public m dunning level properties ctx int c dunninglevel id string trx name super ctx c dunninglevel id trx name c_dunninglevel_id mdunninglevel c_dunninglevel_id trxname c_dunninglevel_id trxname load constructor param ctx context param rs result set public m dunning level properties ctx result set rs string trx name super ctx rs trx name mdunninglevel resultset trxname trxname standard constructor public x c rfq topicsubscriber properties ctx int c rfq topicsubscriber id string trx name super ctx c rfq topicsubscriber id trx name if c rfq topicsubscriber id 0 setc bpartner id 0 setc bpartner location id 0 setc rfq topicsubscriber id 0 setc rfq topic id 0 x_c_rfq_topicsubscriber c_rfq_topicsubscriber_id trxname c_rfq_topicsubscriber_id trxname c_rfq_topicsubscriber_id setc_bpartner_id setc_bpartner_location_id setc_rfq_topicsubscriber_id setc_rfq_topic_id load constructor public x c rfq topicsubscriber properties ctx result set rs string trx name super ctx rs trx name x_c_rfq_topicsubscriber resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfq topicsubscriber append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfq_topicsubscriber get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set rfq subscriber request for quotation topic subscriber public void setc rfq topicsubscriber id int c rfq topicsubscriber id if c rfq topicsubscriber id 1 throw new illegal argument exception c rfq topicsubscriber id is mandatory set valuenocheck c rfq topicsubscriber id new integer c rfq topicsubscriber id setc_rfq_topicsubscriber_id c_rfq_topicsubscriber_id c_rfq_topicsubscriber_id illegalargumentexception c_rfq_topicsubscriber_id set_valuenocheck c_rfq_topicsubscriber_id c_rfq_topicsubscriber_id get rfq subscriber request for quotation topic subscriber public int getc rfq topicsubscriber id integer ii integer get value c rfq topicsubscriber id if ii null return 0 return ii int value getc_rfq_topicsubscriber_id get_value c_rfq_topicsubscriber_id intvalue set rfq topic topic for request for quotations public void setc rfq topic id int c rfq topic id if c rfq topic id 1 throw new illegal argument exception c rfq topic id is mandatory set valuenocheck c rfq topic id new integer c rfq topic id setc_rfq_topic_id c_rfq_topic_id c_rfq_topic_id illegalargumentexception c_rfq_topic_id set_valuenocheck c_rfq_topic_id c_rfq_topic_id get rfq topic topic for request for quotations public int getc rfq topic id integer ii integer get value c rfq topic id if ii null return 0 return ii int value getc_rfq_topic_id get_value c_rfq_topic_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc rfq topic id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_rfq_topic_id set opt out date date the contact opted out public void set opt out date timestamp opt out date set value opt out date opt out date setoptoutdate optoutdate set_value optoutdate optoutdate get opt out date date the contact opted out public timestamp get opt out date return timestamp get value opt out date getoptoutdate get_value optoutdate set subscribe date date the contact actively subscribed public void set subscribe date timestamp subscribe date set value subscribe date subscribe date setsubscribedate subscribedate set_value subscribedate subscribedate get subscribe date date the contact actively subscribed public timestamp get subscribe date return timestamp get value subscribe date getsubscribedate get_value subscribedate basic constructor use set methods public textarea basic constructor use set methods param rows the rows attribute param cols the cols attribute public textarea int rows int cols set rows rows set cols cols setrows setcols basic constructor use set methods param rows the rows attribute param cols the cols attribute public textarea string rows string cols set rows rows set cols cols setrows setcols basic constructor use set methods param name the name attribute param rows the rows attribute param cols the cols attribute public textarea string name int rows int cols set name name set rows rows set cols cols setname setrows setcols basic constructor use set methods param name the name attribute param rows the rows attribute param cols the cols attribute public textarea string name string rows string cols set name name set rows rows set cols cols setname setrows setcols sets the rows attribute param rows sets the rows attribute public textarea set rows int rows set rows integer to string rows return this setrows setrows tostring sets the rows attribute param rows sets the rows attribute public textarea set rows string rows add attribute rows rows return this setrows addattribute sets the wrap attribute param wrap sets the wrap attribute public textarea set wrap string wrap add attribute wrap wrap return this setwrap addattribute sets the cols attribute param cols sets the cols attribute public textarea set cols int cols set cols integer to string cols return this setcols setcols tostring sets the cols attribute param cols sets the cols attribute public textarea set cols string cols add attribute cols cols return this setcols addattribute sets the name attribute param name sets the name attribute public textarea set name string name add attribute name name return this setname addattribute sets the tabindex attribute param alt the tabindex attribute public textarea set tabindex string index add attribute tabindex index return this settabindex addattribute sets the tabindex attribute param alt the tabindex attribute public textarea set tabindex int index set tabindex integer to string index return this settabindex settabindex tostring sets the readonly value param readonly true or false public textarea set read only boolean readonly if readonly true add attribute readonly readonly else remove attribute readonly return this setreadonly addattribute removeattribute sets the disabled value param disabled true or false public textarea set disabled boolean disabled if disabled true add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public textarea add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public textarea add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public textarea add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public textarea add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public textarea remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param the script public void set on load string script add attribute onload script setonload addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param the script public void set on unload string script add attribute onunload script setonunload addattribute the onsubmit event occurs when a form is submitted it only applies to the form element param the script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param the script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param the script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param the script public void set on change string script add attribute onchange script setonchange addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c tax acct properties ctx int c tax acct id string trx name super ctx c tax acct id trx name if c tax acct id 0 setc acctschema id 0 setc tax id 0 sett credit acct 0 sett due acct 0 sett expense acct 0 sett liability acct 0 sett receivables acct 0 x_c_tax_acct c_tax_acct_id trxname c_tax_acct_id trxname c_tax_acct_id setc_acctschema_id setc_tax_id sett_credit_acct sett_due_acct sett_expense_acct sett_liability_acct sett_receivables_acct load constructor public x c tax acct properties ctx result set rs string trx name super ctx rs trx name x_c_tax_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c tax acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_tax_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set tax credit account for tax you can reclaim public void sett credit acct int t credit acct set value t credit acct new integer t credit acct sett_credit_acct t_credit_acct set_value t_credit_acct t_credit_acct get tax credit account for tax you can reclaim public int gett credit acct integer ii integer get value t credit acct if ii null return 0 return ii int value gett_credit_acct get_value t_credit_acct intvalue set tax due account for tax you have to pay public void sett due acct int t due acct set value t due acct new integer t due acct sett_due_acct t_due_acct set_value t_due_acct t_due_acct get tax due account for tax you have to pay public int gett due acct integer ii integer get value t due acct if ii null return 0 return ii int value gett_due_acct get_value t_due_acct intvalue set tax expense account for paid tax you cannot reclaim public void sett expense acct int t expense acct set value t expense acct new integer t expense acct sett_expense_acct t_expense_acct set_value t_expense_acct t_expense_acct get tax expense account for paid tax you cannot reclaim public int gett expense acct integer ii integer get value t expense acct if ii null return 0 return ii int value gett_expense_acct get_value t_expense_acct intvalue set tax liability account for tax declaration liability public void sett liability acct int t liability acct set value t liability acct new integer t liability acct sett_liability_acct t_liability_acct set_value t_liability_acct t_liability_acct get tax liability account for tax declaration liability public int gett liability acct integer ii integer get value t liability acct if ii null return 0 return ii int value gett_liability_acct get_value t_liability_acct intvalue set tax receivables account for tax credit after tax declaration public void sett receivables acct int t receivables acct set value t receivables acct new integer t receivables acct sett_receivables_acct t_receivables_acct set_value t_receivables_acct t_receivables_acct get tax receivables account for tax credit after tax declaration public int gett receivables acct integer ii integer get value t receivables acct if ii null return 0 return ii int value gett_receivables_acct get_value t_receivables_acct intvalue translation param ctx context public translation properties ctx m ctx ctx m_ctx import translation uses translation handler to update translation param directory file directory param ad client id only certain client if id 0 param ad language language param trl table table return status message public string import trl string directory int ad client id string ad language string trl table string file name directory file separator trl table ad language xml log info file name file in new file file name if in exists string msg file does not exist file name log log level severe msg return msg try translation handler handler new translation handler ad client id sax parser factory factory sax parser factory new instance factory set validating true sax parser parser factory newsax parser parser parse in handler log info updated handler get update count return msg get msg m ctx updated handler get update count catch exception e log log level severe import trl e return e to string translationhandler ad_client_id ad_language trl_table importtrl ad_client_id ad_language trl_table filename trl_table _ ad_language filename filename filename translationhandler translationhandler ad_client_id saxparserfactory saxparserfactory newinstance setvalidating saxparser newsaxparser getupdatecount getmsg m_ctx getupdatecount importtrl tostring import translation param directory file directory param ad client id only certain client if id 0 param ad language language param trl table translation table trl return status message public string export trl string directory int ad client id string ad language string trl table string file name directory file separator trl table ad language xml log info export trl file name file out new file file name boolean is base language language is base language ad language string table name trl table int pos table name index of trl string base table trl table substring 0 pos if is base language table name base table string key column base table id string trl columns get trl columns base table string buffer sql null try document builder factory factory document builder factory new instance system out println factory get class get name document builder builder factory new document builder doctype adempiere trl system http www adempiere org dtd adempiere trl dtd doctype adempiere trl public adempiere dtd adempiere translation 1 0 en http www adempiere org dtd adempiere trl dtd document document builder new document document append child document create comment compiere get summary ascii document append child document create comment dtd root element root document create element xml tag root set attribute xml attribute language ad language root set attribute xml attribute table base table document append child root sql new string buffer select if is base language sql append y 1 else sql append t is translated sql append t append key column 2 for int i 0 i trl columns length i sql append t append trl columns i append o append trl columns i append as append trl columns i append o sql append from append table name append t append inner join append base table append o on t append key column append o append key column append boolean have where false if is base language sql append where t ad language have where true if m iscentrallymaintained sql append have where and where append o is centrally maintained n have where true if ad client id 0 sql append have where and where append o ad client id append ad client id sql append order by t append key column prepared statement pstmt db prepare statement sql to string null if is base language pstmt set string 1 ad language result set rs pstmt execute query int rows 0 while rs next element row document create element xml row tag row set attribute xml row attribute id string value of rs get int 2 key column row set attribute xml row attribute translated rs get string 1 is translated for int i 0 i trl columns length i element value document create element xml value tag value set attribute xml value attribute column trl columns i string orig string rs get string trl columns i o original value if orig string null orig string string value string rs get string trl columns i value if value string null value string value set attribute xml value attribute original orig string value append child document create text node value string row append child value root append child row rows rs close pstmt close log info records rows dtd document get doctype trl table dom source source new dom source document transformer factory t factory transformer factory new instance transformer transformer t factory new transformer output out create new file stream result result new stream result out transform transformer transform source result catch sql exception e log log level severe sql to string e catch exception e log log level severe e return ad_client_id ad_language trl_table _trl exporttrl ad_client_id ad_language trl_table filename trl_table _ ad_language exporttrl filename filename isbaselanguage isbaselanguage ad_language tablename trl_table tablename indexof _trl base_table trl_table isbaselanguage tablename base_table keycolumn base_table _id trlcolumns gettrlcolumns base_table stringbuffer documentbuilderfactory documentbuilderfactory newinstance getclass getname documentbuilder newdocumentbuilder adempieretrl adempieretrl adempieretrl adempieretrl newdocument appendchild createcomment getsummaryascii appendchild createcomment createelement xml_tag setattribute xml_attribute_language ad_language setattribute xml_attribute_table base_table appendchild stringbuffer isbaselanguage istranslated keycolumn trlcolumns trlcolumns trlcolumns trlcolumns tablename base_table keycolumn keycolumn havewhere isbaselanguage ad_language havewhere m_iscentrallymaintained havewhere iscentrallymaintained havewhere ad_client_id havewhere ad_client_id ad_client_id keycolumn preparedstatement preparestatement tostring isbaselanguage setstring ad_language resultset executequery createelement xml_row_tag setattribute xml_row_attribute_id valueof getint keycolumn setattribute xml_row_attribute_translated getstring istranslated trlcolumns createelement xml_value_tag setattribute xml_value_attribute_column trlcolumns origstring getstring trlcolumns origstring origstring valuestring getstring trlcolumns valuestring valuestring setattribute xml_value_attribute_original origstring appendchild createtextnode valuestring appendchild appendchild getdoctype trl_table domsource domsource transformerfactory tfactory transformerfactory newinstance tfactory newtransformer createnewfile streamresult streamresult sqlexception tostring get columns for table param base table table return array of translated columns private string get trl columns string base table m iscentrallymaintained false string sql select table name from ad table t inner join ad column c on c ad table id t ad table id and c column name is centrally maintained where t table name and c is active y try prepared statement pstmt db prepare statement sql null pstmt set string 1 base table result set rs pstmt execute query if rs next m iscentrallymaintained true rs close pstmt close catch sql exception e log log level severe sql e sql select column name from ad column c inner join ad table t on c ad table id t ad table id where t table name and c ad reference id in 10 14 order by is mandatory desc column name array list string list new array list string try prepared statement pstmt db prepare statement sql null pstmt set string 1 base table trl result set rs pstmt execute query while rs next string s rs get string 1 system out println s list add s rs close pstmt close catch sql exception e log log level severe sql e convert to array string ret value new string list size list to array ret value return ret value base_table gettrlcolumns base_table m_iscentrallymaintained tablename ad_table ad_column ad_table_id ad_table_id columnname iscentrallymaintained tablename isactive preparedstatement preparestatement setstring base_table resultset executequery m_iscentrallymaintained sqlexception columnname ad_column ad_table ad_table_id ad_table_id tablename ad_reference_id ismandatory columnname arraylist arraylist preparedstatement preparestatement setstring base_table _trl resultset executequery getstring sqlexception retvalue toarray retvalue retvalue validate language check if ad language record exists check trl table records param ad language language return if validated or error message public string validate language string ad language string sql select from ad language where ad language m language language null try prepared statement pstmt db prepare statement sql null pstmt set string 1 ad language result set rs pstmt execute query if rs next language new m language m ctx rs null rs close pstmt close catch sql exception e log log level severe sql e return e to string no ad language record if language null log log level severe language does not exist ad language return language does not exist ad language language exists if language is active if language is base language return else log log level severe language not active or not system language ad language return language not active or not system language ad language validate translation log info start validating language language maintain true return ad_language ad_language validatelanguage ad_language ad_language ad_language mlanguage preparedstatement preparestatement setstring ad_language resultset executequery mlanguage m_ctx sqlexception tostring ad_language ad_language ad_language isactive isbaselanguage ad_language ad_language process param directory directory param ad language language param mode mode private void process string directory string ad language string mode file dir new file directory if dir exists dir mkdir dir new file directory if dir exists system out println cannot create directory directory system exit 1 string sql select name table name from ad table where table name like trl order by 1 array list string trl tables new array list string try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next trl tables add rs get string 2 rs close pstmt close catch sql exception e log log level severe sql e for int i 0 i trl tables size i string table string trl tables get i if mode starts with i import trl directory 1 ad language table else export trl directory 1 ad language table ad_language ad_language tablename ad_table tablename _trl arraylist trltables arraylist preparedstatement preparestatement resultset executequery trltables getstring sqlexception trltables trltables startswith importtrl ad_language exporttrl ad_language batch interface param args directory ad language import export public static void main string args if args length 3 system out println format java translation directory ad language import export system out println example java translation adempiere data de de de de import system out println example java translation adempiere data fr fr fr fr export system exit 1 login init test false string directory args 0 string ad language args 1 string mode args 2 translation trl new translation env get ctx string msg trl validate language ad language if msg length 0 system err println msg else trl process directory ad language mode system exit 0 ad_language ad_language de_de de_de fr_fr fr_fr inittest ad_language getctx validatelanguage ad_language ad_language constructor public extension file filter this extensionfilefilter constructor param extension extension param description description public extension file filter string extension string description set description description set extension extension extensionfilefilter setdescription setextension description return description public string get description return m description getdescription m_description return m description public void set description string new description m description new description m_description setdescription newdescription m_description newdescription extension param new extension ext public void set extension string new extension m extension new extension newextension setextension newextension m_extension newextension m extension new extension public string get extension return m extension m_extension newextension getextension m_extension accept file param file file to be tested return true if ok public boolean accept file file need to accept directories if file is directory return true string ext file get name int pos ext last index of no extension if pos 1 return false ext ext substring pos 1 if m extension equals ignore case ext return true return false isdirectory getname lastindexof m_extension equalsignorecase verify file name with filer param file file param filter filter return file name public static string get file name file file file filter filter return get file file filter get absolute path getfilename filefilter getfile getabsolutepath verify file with filter param file file param filter filter return file public static file get file file file file filter filter string f name file get absolute path if f name null f name equals f name a dempiere extension file filter eff null if filter instanceof extension file filter eff extension file filter filter else return file int pos f name last index of no extension if pos 1 f name eff get extension return new file f name string ext f name substring pos 1 correct extension if ext equals ignore case eff get extension return file f name eff get extension return new file f name getfile filefilter fname getabsolutepath fname fname fname adempiere extensionfilefilter extensionfilefilter extensionfilefilter fname lastindexof fname getextension fname fname equalsignorecase getextension fname getextension fname standard constructor public x tire storage properties ctx int tire storage id string trx name super ctx tire storage id trx name if tire storage id 0 set date received new timestamp system current time millis date set is returned false set is stored false set name null settire storage id 0 x_tire_storage tire_storage_id trxname tire_storage_id trxname tire_storage_id setdatereceived currenttimemillis setisreturned setisstored setname settire_storage_id load constructor public x tire storage properties ctx result set rs string trx name super ctx rs trx name x_tire_storage resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x tire storage append get id append return sb to string tostring stringbuffer stringbuffer x_tire_storage get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set date received date a product was received public void set date received timestamp date received if date received null throw new illegal argument exception date received is mandatory set value date received date received setdatereceived datereceived datereceived illegalargumentexception datereceived set_value datereceived datereceived get date received date a product was received public timestamp get date received return timestamp get value date received getdatereceived get_value datereceived set date returned date a product was returned public void set date returned timestamp date returned set value date returned date returned setdatereturned datereturned set_value datereturned datereturned get date returned date a product was returned public timestamp get date returned return timestamp get value date returned getdatereturned get_value datereturned set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set returned public void set is returned boolean is returned set value is returned new boolean is returned setisreturned isreturned set_value isreturned isreturned get returned public boolean is returned object oo get value is returned if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreturned get_value isreturned booleanvalue set moved to storage public void set is stored boolean is stored set value is stored new boolean is stored setisstored isstored set_value isstored isstored get moved to storage public boolean is stored object oo get value is stored if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isstored get_value isstored booleanvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set value m locator id null else set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_value m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set registration vehicle registration public void set registration string registration if registration null registration length 20 log warning length 20 truncated registration registration substring 0 19 set value registration registration setregistration set_value get registration vehicle registration public string get registration return string get value registration getregistration get_value set remark public void set remark string remark if remark null remark length 60 log warning length 60 truncated remark remark substring 0 59 set value remark remark setremark set_value get remark public string get remark return string get value remark getremark get_value set rim stored rim public void set rim string rim if rim null rim length 20 log warning length 20 truncated rim rim substring 0 19 set value rim rim setrim set_value get rim stored rim public string get rim return string get value rim getrim get_value set rim back public void setrim b string rim b if rim b null rim b length 20 log warning length 20 truncated rim b rim b substring 0 19 set value rim b rim b setrim_b rim_b rim_b rim_b rim_b rim_b set_value rim_b rim_b get rim back public string getrim b return string get value rim b getrim_b get_value rim_b set tire storage public void settire storage id int tire storage id if tire storage id 1 throw new illegal argument exception tire storage id is mandatory set valuenocheck tire storage id new integer tire storage id settire_storage_id tire_storage_id tire_storage_id illegalargumentexception tire_storage_id set_valuenocheck tire_storage_id tire_storage_id get tire storage public int gettire storage id integer ii integer get value tire storage id if ii null return 0 return ii int value gettire_storage_id get_value tire_storage_id intvalue set tire quality public void set tire quality string tire quality if tire quality null tire quality length 20 log warning length 20 truncated tire quality tire quality substring 0 19 set value tire quality tire quality settirequality tirequality tirequality tirequality tirequality tirequality set_value tirequality tirequality get tire quality public string get tire quality return string get value tire quality gettirequality get_value tirequality set tire quality back public void settirequality b string tirequality b if tirequality b null tirequality b length 20 log warning length 20 truncated tirequality b tirequality b substring 0 19 set value tirequality b tirequality b settirequality_b tirequality_b tirequality_b tirequality_b tirequality_b tirequality_b set_value tirequality_b tirequality_b get tire quality back public string gettirequality b return string get value tirequality b gettirequality_b get_value tirequality_b set tire size l r public void set tire size string tire size if tire size null tire size length 20 log warning length 20 truncated tire size tire size substring 0 19 set value tire size tire size settiresize tiresize tiresize tiresize tiresize tiresize set_value tiresize tiresize get tire size l r public string get tire size return string get value tire size gettiresize get_value tiresize set tire size back public void settiresize b string tiresize b if tiresize b null tiresize b length 20 log warning length 20 truncated tiresize b tiresize b substring 0 19 set value tiresize b tiresize b settiresize_b tiresize_b tiresize_b tiresize_b tiresize_b tiresize_b set_value tiresize_b tiresize_b get tire size back public string gettiresize b return string get value tiresize b gettiresize_b get_value tiresize_b set tire type public void set tire type string tire type if tire type null tire type length 20 log warning length 20 truncated tire type tire type substring 0 19 set value tire type tire type settiretype tiretype tiretype tiretype tiretype tiretype set_value tiretype tiretype get tire type public string get tire type return string get value tire type gettiretype get_value tiretype set tire type back public void settiretype b string tiretype b if tiretype b null tiretype b length 20 log warning length 20 truncated tiretype b tiretype b substring 0 19 set value tiretype b tiretype b settiretype_b tiretype_b tiretype_b tiretype_b tiretype_b tiretype_b set_value tiretype_b tiretype_b get tire type back public string gettiretype b return string get value tiretype b gettiretype_b get_value tiretype_b set vehicle public void set vehicle string vehicle if vehicle null vehicle length 20 log warning length 20 truncated vehicle vehicle substring 0 19 set value vehicle vehicle setvehicle set_value get vehicle public string get vehicle return string get value vehicle getvehicle get_value standard constructor public x m product category acct properties ctx int m product category acct id string trx name super ctx m product category acct id trx name if m product category acct id 0 setc acctschema id 0 setm product category id 0 setp asset acct 0 setp cogs acct 0 setp costadjustment acct 0 setp expense acct 0 setp inventoryclearing acct 0 setp invoicepricevariance acct 0 setp purchasepricevariance acct 0 setp revenue acct 0 setp tradediscountgrant acct 0 setp tradediscountrec acct 0 x_m_product_category_acct m_product_category_acct_id trxname m_product_category_acct_id trxname m_product_category_acct_id setc_acctschema_id setm_product_category_id setp_asset_acct setp_cogs_acct setp_costadjustment_acct setp_expense_acct setp_inventoryclearing_acct setp_invoicepricevariance_acct setp_purchasepricevariance_acct setp_revenue_acct setp_tradediscountgrant_acct setp_tradediscountrec_acct load constructor public x m product category acct properties ctx result set rs string trx name super ctx rs trx name x_m_product_category_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product category acct append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_category_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue public static final string costinglevel organization o set costing level the lowest level to accumulate costing information public void set costing level string costing level if costing level null throw new illegal argument exception costing level is mandatory if costing level null costing level equals b costing level equals c costing level equals o else throw new illegal argument exception costing level invalid value costing level reference id 355 b c o if costing level null costing level length 1 log warning length 1 truncated costing level costing level substring 0 0 set value costing level costing level costinglevel_organization setcostinglevel costinglevel costinglevel illegalargumentexception costinglevel costinglevel costinglevel costinglevel costinglevel illegalargumentexception costinglevel costinglevel reference_id costinglevel costinglevel costinglevel costinglevel set_value costinglevel costinglevel get costing level the lowest level to accumulate costing information public string get costing level return string get value costing level getcostinglevel get_value costinglevel public static final string costingmethod x set costing method indicates how costs will be calculated public void set costing method string costing method if costing method null throw new illegal argument exception costing method is mandatory if costing method null costing method equals a costing method equals f costing method equals i costing method equals l costing method equals s costing method equals u costing method equals i costing method equals p costing method equals x else throw new illegal argument exception costing method invalid value costing method reference id 122 a f i l s u i p x if costing method null costing method length 1 log warning length 1 truncated costing method costing method substring 0 0 set value costing method costing method costingmethod__ setcostingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod reference_id costingmethod costingmethod costingmethod costingmethod set_value costingmethod costingmethod get costing method indicates how costs will be calculated public string get costing method return string get value costing method getcostingmethod get_value costingmethod set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set valuenocheck m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_valuenocheck m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product asset account for product asset inventory public void setp asset acct int p asset acct set value p asset acct new integer p asset acct setp_asset_acct p_asset_acct set_value p_asset_acct p_asset_acct get product asset account for product asset inventory public int getp asset acct integer ii integer get value p asset acct if ii null return 0 return ii int value getp_asset_acct get_value p_asset_acct intvalue set product cogs account for cost of goods sold public void setp cogs acct int p cogs acct set value p cogs acct new integer p cogs acct setp_cogs_acct p_cogs_acct set_value p_cogs_acct p_cogs_acct get product cogs account for cost of goods sold public int getp cogs acct integer ii integer get value p cogs acct if ii null return 0 return ii int value getp_cogs_acct get_value p_cogs_acct intvalue set cost adjustment product cost adjustment account public void setp costadjustment acct int p costadjustment acct set value p costadjustment acct new integer p costadjustment acct setp_costadjustment_acct p_costadjustment_acct set_value p_costadjustment_acct p_costadjustment_acct get cost adjustment product cost adjustment account public int getp costadjustment acct integer ii integer get value p costadjustment acct if ii null return 0 return ii int value getp_costadjustment_acct get_value p_costadjustment_acct intvalue set product expense account for product expense public void setp expense acct int p expense acct set value p expense acct new integer p expense acct setp_expense_acct p_expense_acct set_value p_expense_acct p_expense_acct get product expense account for product expense public int getp expense acct integer ii integer get value p expense acct if ii null return 0 return ii int value getp_expense_acct get_value p_expense_acct intvalue set inventory clearing product inventory clearing account public void setp inventoryclearing acct int p inventoryclearing acct set value p inventoryclearing acct new integer p inventoryclearing acct setp_inventoryclearing_acct p_inventoryclearing_acct set_value p_inventoryclearing_acct p_inventoryclearing_acct get inventory clearing product inventory clearing account public int getp inventoryclearing acct integer ii integer get value p inventoryclearing acct if ii null return 0 return ii int value getp_inventoryclearing_acct get_value p_inventoryclearing_acct intvalue set invoice price variance difference between costs and invoice price ipv public void setp invoicepricevariance acct int p invoicepricevariance acct set value p invoicepricevariance acct new integer p invoicepricevariance acct setp_invoicepricevariance_acct p_invoicepricevariance_acct set_value p_invoicepricevariance_acct p_invoicepricevariance_acct get invoice price variance difference between costs and invoice price ipv public int getp invoicepricevariance acct integer ii integer get value p invoicepricevariance acct if ii null return 0 return ii int value getp_invoicepricevariance_acct get_value p_invoicepricevariance_acct intvalue set purchase price variance difference between standard cost and purchase price ppv public void setp purchasepricevariance acct int p purchasepricevariance acct set value p purchasepricevariance acct new integer p purchasepricevariance acct setp_purchasepricevariance_acct p_purchasepricevariance_acct set_value p_purchasepricevariance_acct p_purchasepricevariance_acct get purchase price variance difference between standard cost and purchase price ppv public int getp purchasepricevariance acct integer ii integer get value p purchasepricevariance acct if ii null return 0 return ii int value getp_purchasepricevariance_acct get_value p_purchasepricevariance_acct intvalue set product revenue account for product revenue sales account public void setp revenue acct int p revenue acct set value p revenue acct new integer p revenue acct setp_revenue_acct p_revenue_acct set_value p_revenue_acct p_revenue_acct get product revenue account for product revenue sales account public int getp revenue acct integer ii integer get value p revenue acct if ii null return 0 return ii int value getp_revenue_acct get_value p_revenue_acct intvalue set trade discount granted trade discount granted account public void setp tradediscountgrant acct int p tradediscountgrant acct set value p tradediscountgrant acct new integer p tradediscountgrant acct setp_tradediscountgrant_acct p_tradediscountgrant_acct set_value p_tradediscountgrant_acct p_tradediscountgrant_acct get trade discount granted trade discount granted account public int getp tradediscountgrant acct integer ii integer get value p tradediscountgrant acct if ii null return 0 return ii int value getp_tradediscountgrant_acct get_value p_tradediscountgrant_acct intvalue set trade discount received trade discount receivable account public void setp tradediscountrec acct int p tradediscountrec acct set value p tradediscountrec acct new integer p tradediscountrec acct setp_tradediscountrec_acct p_tradediscountrec_acct set_value p_tradediscountrec_acct p_tradediscountrec_acct get trade discount received trade discount receivable account public int getp tradediscountrec acct integer ii integer get value p tradediscountrec acct if ii null return 0 return ii int value getp_tradediscountrec_acct get_value p_tradediscountrec_acct intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue get contents return context public object get contents return contents getcontents initialize global variables param config config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w menu init servletexception servletconfig servletexception webenv initweb servletexception wmenu get servlet information return servlet info public string get servlet info return w login web menu getservletinfo wlogin clean up resources public void destroy log fine destroy super destroy process the http get request exit logout ad window id forward to window param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log fine do get process menu request get parameter exit if web util get parameter request exit null web util create login page request response this null exit return get session attributes web session ctx wsc web session ctx get request if wsc ctx null web util create timeout page request response this null return window int ad window id web util get parameter as int request ad window id forward to w window if ad window id 0 log fine do get ad window id ad window id string url web env get base directory w window ad window id ad window id log fine do get forward to url request dispatcher rd get servlet context get request dispatcher url rd forward request response return request not serviceable web util create error page request response this not implemented ad_window_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception doget webutil getparameter webutil createloginpage websessionctx websessionctx webutil createtimeoutpage ad_window_id webutil getparameterasint ad_window_id wwindow ad_window_id doget ad_window_id ad_window_id webenv getbasedirectory wwindow ad_window_id ad_window_id doget requestdispatcher getservletcontext getrequestdispatcher webutil createerrorpage notimplemented process the http post request verify input create menu param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log fine do post create menu get session attributes web session ctx wsc web session ctx get request if wsc null web util create timeout page request response this null return get parameters role client org warehouse date string role web util get parameter request w login p role string client web util get parameter request w login p client string org web util get parameter request w login p org string wh web util get parameter request w login p warehouse if wh null wh get context if role null client null org null web util create timeout page request response this msg get msg wsc ctx parameter missing return get info from context user role client int ad user id env getad user id wsc ctx int ad role id env getad role id wsc ctx int ad client id env getad client id wsc ctx not available in context yet org warehouse int ad org id 1 int m warehouse id 1 get latest info from context try int req role integer parse int role if req role ad role id log fine do post ad role id changed from ad role id ad role id req role env set context wsc ctx ad role id ad role id log fine do post ad role id ad role id int req client integer parse int client if req client ad client id log fine do post ad client id changed from ad client id ad client id req client env set context wsc ctx ad client id ad client id log fine do post ad client id ad client id ad org id integer parse int org log fine do post ad org id ad org id if wh length 0 m warehouse id integer parse int wh log fine do post m warehouse id m warehouse id catch exception e log log level severe do post parameter e web util create timeout page request response this msg get msg wsc ctx parameter missing return check login info and set environment wsc login info check login wsc ctx ad user id ad role id ad client id ad org id m warehouse id if wsc login info null web util create error page request response this msg get msg wsc ctx role inconsistent return set cookie for future defaults properties c prop web util get cookie proprties request c prop set property w login p role string value of ad role id c prop set property w login p client string value of ad client id c prop set property w login p org string value of ad org id if m warehouse id 1 c prop set property w login p warehouse else c prop set property w login p warehouse string value of m warehouse id set date timestamp ts web util get parameter as date request w login p date if ts null ts new timestamp system current time millis env set context wsc ctx date ts jdbc format log print properties system get properties system log print properties c prop cookie log print properties ctx servlet context log print properties env get ctx apps env context can we store cookie if c prop get property w login p store n equals y c prop clear web doc doc create page request wsc ad role id web util create response request response this c prop doc true servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception dopost websessionctx websessionctx webutil createtimeoutpage webutil getparameter wlogin p_role webutil getparameter wlogin p_client webutil getparameter wlogin p_org webutil getparameter wlogin p_warehouse webutil createtimeoutpage getmsg parametermissing ad_user_id getad_user_id ad_role_id getad_role_id ad_client_id getad_client_id ad_org_id m_warehouse_id req_role parseint req_role ad_role_id dopost ad_role_id ad_role_id ad_role_id req_role setcontext ad_role_id ad_role_id dopost ad_role_id ad_role_id req_client parseint req_client ad_client_id dopost ad_client_id ad_client_id ad_client_id req_client setcontext ad_client_id ad_client_id dopost ad_client_id ad_client_id ad_org_id parseint dopost ad_org_id ad_org_id m_warehouse_id parseint dopost m_warehouse_id m_warehouse_id dopost webutil createtimeoutpage getmsg parametermissing logininfo checklogin ad_user_id ad_role_id ad_client_id ad_org_id m_warehouse_id logininfo webutil createerrorpage getmsg roleinconsistent cprop webutil getcookieproprties cprop setproperty wlogin p_role valueof ad_role_id cprop setproperty wlogin p_client valueof ad_client_id cprop setproperty wlogin p_org valueof ad_org_id m_warehouse_id cprop setproperty wlogin p_warehouse cprop setproperty wlogin p_warehouse valueof m_warehouse_id webutil getparameterasdate wlogin p_date currenttimemillis setcontext printproperties getproperties printproperties cprop printproperties printproperties getctx cprop getproperty wlogin p_store cprop webdoc createpage ad_role_id webutil createresponse cprop check login information and set context return true if login info are ok param ctx context param ad user id user param ad role id role param ad client id client param ad org id org param m warehouse id warehouse private string check login properties ctx int ad user id int ad role id int ad client id int ad org id int m warehouse id get login info string login info null verify existance of user client org role and user s acces to client org string sql select u name c name o name initcap user as text from ad user u ad client c ad org o ad user roles ur where u ad user id 1 and c ad client id 2 and o ad org id 3 and ur ad role id 4 and ur ad user id u ad user id and o ad client id 0 or o ad client id c ad client id and c ad client id in select ad client id from ad role orgaccess ca where ca ad role id ur ad role id and o ad org id in select ad org id from ad role orgaccess ca where ca ad role id ur ad role id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad user id pstmt set int 2 ad client id pstmt set int 3 ad org id pstmt set int 4 ad role id result set rs pstmt execute query if rs next login info rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e not verified if login info null return null set preferences key name pair org new key name pair ad org id string value of ad org id key name pair wh null if m warehouse id 0 wh new key name pair m warehouse id string value of m warehouse id timestamp date null string printer null login login new login ctx login load preferences org wh date printer don t show acct trl tabs on html ui env set context ctx show acct n env set context ctx show trl n return login info ad_user_id ad_role_id ad_client_id ad_org_id m_warehouse_id checklogin ad_user_id ad_role_id ad_client_id ad_org_id m_warehouse_id logininfo ad_user ad_client ad_org ad_user_roles ad_user_id ad_client_id ad_org_id ad_role_id ad_user_id ad_user_id ad_client_id ad_client_id ad_client_id ad_client_id ad_client_id ad_role_orgaccess ad_role_id ad_role_id ad_org_id ad_org_id ad_role_orgaccess ad_role_id ad_role_id preparedstatement preparestatement setint ad_user_id setint ad_client_id setint ad_org_id setint ad_role_id resultset executequery logininfo getstring sqlexception logininfo keynamepair keynamepair ad_org_id valueof ad_org_id keynamepair m_warehouse_id keynamepair m_warehouse_id valueof m_warehouse_id loadpreferences setcontext showacct setcontext showtrl logininfo create menu page param request request param wsc context param ad role id role return document private web doc create page http servlet request request web session ctx wsc int ad role id document string window title msg get msg wsc ctx menu web doc doc web doc create window title head head doc get head target head add element new base set target web env target window specific menu script stylesheet head add element new link web env get base directory menu css link rel stylesheet link type css head add element new script element null web env get base directory menu js scripts string status message msg get msg wsc ctx select menu item string script txt top document title window title wsc login info var default status status message head add element new script script txt body body body doc get body body set title status message clear window frame body add element web util get clear frame web env target window header table table doc get table doc set classes menu table menu header doc get top left add element new cite wsc login info load menu structure int ad tree id db getsql value null select coalesce r ad tree menu id ci ad tree menu id from ad clientinfo ci inner join ad role r on ci ad client id r ad client id where ad role id ad role id if ad tree id 0 ad tree id 10 menu log fine do post ad tree id ad tree id env getad language wsc ctx m tree tree new m tree wsc ctx ad tree id false false null language set in w login trim tree m tree node root tree get root enumeration en root preorder enumeration while en has more elements m tree node nd m tree node en next element if nd is task nd is workbench nd is work flow nd getnode id 383 reset cache kills the server m tree node parent m tree node nd get parent parent remove nd tree trim tree print tree string buffer buf new string buffer en root preorder enumeration int old level 0 while en has more elements m tree node nd m tree node en next element level int level nd get level 0 root if level 0 continue while old level level if level 1 buf append ul id main n start first level else buf append ul style display none n start next level old level while old level level old level if old level 1 buf append ul n finish last level else buf append ul li n finish next level print node buf append print node nd wsc ctx final while old level 0 old level if old level 1 buf append ul n finish last level else buf append ul li n finish next level td td new td set col span 2 set no wrap true td set class menu center td add element buf to string table add element new tr add element td exit info td new td set col span 2 td set class menu footer string url request get requesturi exit true td add element new a url msg get msg wsc ctx exit table add element new tr add element td system out println doc return doc ad_role_id webdoc createpage httpservletrequest websessionctx ad_role_id windowtitle getmsg webdoc webdoc windowtitle gethead addelement settarget webenv target_window addelement webenv getbasedirectory rel_stylesheet type_css addelement webenv getbasedirectory statusmessage getmsg selectmenuitem scripttxt windowtitle logininfo defaultstatus statusmessage addelement scripttxt getbody settitle statusmessage addelement webutil getclearframe webenv target_window gettable setclasses menutable menuheader gettopleft addelement logininfo ad_tree_id getsqlvalue ad_tree_menu_id ad_tree_menu_id ad_clientinfo ad_role ad_client_id ad_client_id ad_role_id ad_role_id ad_tree_id ad_tree_id dopost ad_tree_id ad_tree_id getad_language mtree mtree ad_tree_id wlogin mtreenode getroot preorderenumeration hasmoreelements mtreenode mtreenode nextelement istask isworkbench isworkflow getnode_id mtreenode mtreenode getparent trimtree stringbuffer stringbuffer preorderenumeration oldlevel hasmoreelements mtreenode mtreenode nextelement getlevel oldlevel oldlevel oldlevel oldlevel oldlevel printnode oldlevel oldlevel oldlevel setcolspan setnowrap setclass menucenter addelement tostring addelement addelement setcolspan setclass menufooter getrequesturi addelement getmsg addelement addelement print menu item param node node private string buffer print node m tree node node properties ctx string buffer sb new string buffer leaf if node is summary li id menuxxxxx a href on mouse over status menu description return true menu entry a li string css class name string servlet name if node is window css class name menu window servlet name w window else if node is form css class name menu window servlet name w form else if node is report css class name menu report servlet name w process else if node is process css class name menu process servlet name w process else if node is work flow css class name menu workflow servlet name w workflow else if node is task css class name menu process servlet name w task else servlet name w error string name node get name replace replace string description node get description replace replace sb append li class css class name id node getnode id debug a href get url boolean standardurl true if node is form m form form new m form ctx node getnode id null if form getjspurl null form getjspurl length 0 sb append form getjspurl standardurl false if standardurl url appl servlet name ad menu id x sb append web env get base directory servlet name append ad menu id append node getnode id remaining a tag sb append on mouse over status description on click show loading window web env get base directory append name language set in m tree get node details based on ctx append a li n else li class fold header on click change menu this menu entry ul style display none ul li string name node get name replace replace sb append n li class menu summary id node getnode id debug on click change menu event summary node append name append n return sb stringbuffer printnode mtreenode stringbuffer stringbuffer issummary onmouseover cssclassname servletname iswindow cssclassname menuwindow servletname wwindow isform cssclassname menuwindow servletname wform isreport cssclassname menureport servletname wprocess isprocess cssclassname menuprocess servletname wprocess isworkflow cssclassname menuworkflow servletname wworkflow istask cssclassname menuprocess servletname wtask servletname werror getname getdescription cssclassname getnode_id isform mform mform getnode_id servletname ad_menu_id webenv getbasedirectory servletname ad_menu_id getnode_id onmouseover onclick showloadingwindow webenv getbasedirectory mtree getnodedetails foldheader onclick changemenu menuentry getname menusummary getnode_id onclick changemenu constructor param pos panel pos panel public subb partner pos panel pos panel super pos panel pospanel subbpartner pospanel pospanel pospanel initialize public void init title titled border border new titled border msg translate p ctx c bpartner id set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets2 f bnew create button action new null gbc gridx 0 gbc gridheight 2 gbc anchor grid bag constraints west add f bnew gbc f bedit create button action edit null gbc gridx 1 add f bedit gbc f name new c text field f name set name name f name add action listener this f name add focus listener this gbc gridx 2 gbc gridy 0 gbc gridheight 1 gbc gridwidth 2 gbc weightx 0 5 gbc fill grid bag constraints horizontal add f name gbc f location new c combo box gbc gridx 2 gbc gridy 1 gbc weightx 0 gbc fill grid bag constraints none add f location gbc f user new c combo box gbc gridx 3 gbc gridy 1 gbc anchor grid bag constraints east add f user gbc f bsearch create button action b partner key stroke get key stroke key event vk i event shift mask event ctrl mask gbc gridx 4 gbc gridy 0 gbc gridheight 2 gbc fill grid bag constraints none add f bsearch gbc titledborder titledborder p_ctx c_bpartner_id setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_bnew createbuttonaction gridbagconstraints f_bnew f_bedit createbuttonaction f_bedit f_name ctextfield f_name setname f_name addactionlistener f_name addfocuslistener gridbagconstraints f_name f_location ccombobox gridbagconstraints f_location f_user ccombobox gridbagconstraints f_user f_bsearch createbuttonaction bpartner keystroke getkeystroke keyevent vk_i shift_mask ctrl_mask gridbagconstraints f_bsearch get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy 0 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose if f name null f name remove focus listener this f name null remove all super dispose f_name f_name removefocuslistener f_name removeall action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub customer action performed action new if action equals new setc bpartner id 0 edit else if action equals edit f bedit set read write false b partner else if action equals b partner p pospanel open query p pospanel f querybpartner name else if e get source f name findb partner actionperformed actionevent getactioncommand possubcustomer actionperformed setc_bpartner_id f_bedit setreadwrite bpartner bpartner p_pospanel openquery p_pospanel f_querybpartner getsource f_name findbpartner focus gained param e public void focus gained focus event e focusgained focusevent focus lost param e public void focus lost focus event e if e is temporary return log info e to string findb partner focuslost focusevent istemporary tostring findbpartner find set b partner private void findb partner string query f name get text if query null query length 0 return query query to upper case test number boolean all number true boolean no number true char qq query to char array for int i 0 i qq length i if character is digit qq i no number false break try integer parse int query catch exception e all number false string value query string name all number null query string contact all number null query string e mail query index of 1 query null string phone no number null query string city null mb partner info results mb partner info find p ctx value name contact e mail phone city set result if results length 0 setc bpartner id 0 else if results length 1 setc bpartner id results 0 getc bpartner id f name set text results 0 get name else more than one p pospanel f querybpartner set results results p pospanel open query p pospanel f querybpartner bpartner findbpartner f_name gettext touppercase allnumber nonumber tochararray isdigit nonumber parseint allnumber allnumber allnumber email indexof nonumber mbpartnerinfo mbpartnerinfo p_ctx email setc_bpartner_id setc_bpartner_id getc_bpartner_id f_name settext getname p_pospanel f_querybpartner setresults p_pospanel openquery p_pospanel f_querybpartner set b partner param c bpartner id id public void setc bpartner id int c bpartner id log fine pos sub customer setc bpartner id c bpartner id if c bpartner id 0 m bpartner null else m bpartner new mb partner p ctx c bpartner id null if m bpartner get id 0 m bpartner null set info if m bpartner null f name set text m bpartner get name f bedit set read write false else f name set text null f bedit set read write false sets currency m m pricelist version id 0 getm pricelist version id fill combos bpartner c_bpartner_id setc_bpartner_id c_bpartner_id possubcustomer setc_bpartner_id c_bpartner_id c_bpartner_id m_bpartner m_bpartner mbpartner p_ctx c_bpartner_id m_bpartner get_id m_bpartner m_bpartner f_name settext m_bpartner getname f_bedit setreadwrite f_name settext f_bedit setreadwrite m_m_pricelist_version_id getm_pricelist_version_id fillcombos fill combos location user private void fill combos vector key name pair location vector new vector key name pair if m bpartner null mb partner location locations m bpartner get locations false for int i 0 i locations length i location vector add locations i get key name pair default combo box model location model new default combo box model location vector f location set model location model vector key name pair user vector new vector key name pair if m bpartner null m user users m bpartner get contacts false for int i 0 i users length i user vector add users i get key name pair default combo box model user model new default combo box model user vector f user set model user model fillcombos keynamepair locationvector keynamepair m_bpartner mbpartnerlocation m_bpartner getlocations locationvector getkeynamepair defaultcomboboxmodel locationmodel defaultcomboboxmodel locationvector f_location setmodel locationmodel keynamepair uservector keynamepair m_bpartner muser m_bpartner getcontacts uservector getkeynamepair defaultcomboboxmodel usermodel defaultcomboboxmodel uservector f_user setmodel usermodel get b partner return c bpartner id public int getc bpartner id if m bpartner null return m bpartner getc bpartner id return 0 bpartner c_bpartner_id getc_bpartner_id m_bpartner m_bpartner getc_bpartner_id get b partner return b partner public mb partner getb partner return m bpartner bpartner bpartner mbpartner getbpartner m_bpartner get b partner location return c bpartner location id public int getc bpartner location id if m bpartner null key name pair pp key name pair f location get selected item if pp null return pp get key return 0 bpartner c_bpartner_location_id getc_bpartner_location_id m_bpartner keynamepair keynamepair f_location getselecteditem getkey get b partner contact return ad user id public int getad user id if m bpartner null key name pair pp key name pair f user get selected item if pp null return pp get key return 0 bpartner ad_user_id getad_user_id m_bpartner keynamepair keynamepair f_user getselecteditem getkey get m pricelist version id set currency return plv public int getm pricelist version id if m m pricelist version id 0 int m pricelist id p pos getm pricelist id if m bpartner null m bpartner getm pricelist id 0 m pricelist id m bpartner getm pricelist id m price list pl m price list get p ctx m pricelist id null p pospanel f curline set currency m currency getiso code p ctx pl getc currency id f name set tool tip text pl get name m price list version plv pl get price list version p pospanel get today if plv null plv getm pricelist version id 0 m m pricelist version id plv getm pricelist version id return m m pricelist version id m_pricelist_version_id getm_pricelist_version_id m_m_pricelist_version_id m_pricelist_id p_pos getm_pricelist_id m_bpartner m_bpartner getm_pricelist_id m_pricelist_id m_bpartner getm_pricelist_id mpricelist mpricelist p_ctx m_pricelist_id p_pospanel f_curline setcurrency mcurrency getiso_code p_ctx getc_currency_id f_name settooltiptext getname mpricelistversion getpricelistversion p_pospanel gettoday getm_pricelist_version_id m_m_pricelist_version_id getm_pricelist_version_id m_m_pricelist_version_id record info param owner owner param title title param dse data status event public record info frame owner string title data status event dse super owner title true try jb init dyn init dse title catch exception e log log level severe e a env position center window owner this recordinfo datastatusevent jbinit dyninit aenv positioncenterwindow static layout throws exception private void jb init boolean show table throws exception get content pane add main panel c text area info new c text area m info to string info set read write false info set opaque false transparent info set foreground color blue info set border null if show table main panel add info border layout north main panel add scroll pane border layout center scroll pane get viewport add table scroll pane set preferred size new dimension 500 100 else info set preferred size new dimension 400 75 main panel add info border layout center main panel add confirm panel border layout south confirm panel add action listener this jbinit showtable getcontentpane mainpanel ctextarea ctextarea m_info tostring setreadwrite setopaque setforeground setborder showtable mainpanel borderlayout mainpanel scrollpane borderlayout scrollpane getviewport scrollpane setpreferredsize setpreferredsize mainpanel borderlayout mainpanel confirmpanel borderlayout confirmpanel addactionlistener dynamic init param dse data status event param title title return true if table initialized private boolean dyn init data status event dse string title if dse created by null return false info m user user m user get env get ctx dse created by int value m info append append msg translate env get ctx created by append append user get name append append m datetimeformat format dse created append n if dse created equals dse updated dse created by equals dse updated by if dse created by equals dse updated by user m user get env get ctx dse updated by int value m info append append msg translate env get ctx updated by append append user get name append append m datetimeformat format dse updated append n if dse info null dse info length 0 m info append n append dse info append title if dse ad table id 0 m table table m table get env get ctx dse ad table id set title title table get name only client preference can view change log if m role preferencetype client equals m role get default get preference type return false int record id 0 if dse record id instanceof integer record id integer dse record id int value else log info dyn init invalid record id dse record id if record id 0 return false data string sql select ad column id updated updated by old value new value from ad changelog where ad table id and record id order by updated desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 dse ad table id pstmt set int 2 record id result set rs pstmt execute query while rs next add line rs get int 1 rs get timestamp 2 rs get int 3 rs get string 4 rs get string 5 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null vector string column names new vector string column names add msg translate env get ctx ad column id column names add msg translate env get ctx new value column names add msg translate env get ctx old value column names add msg translate env get ctx updated by column names add msg translate env get ctx updated default table model model new default table model m data column names table set model model table auto size false return true dyninit datastatusevent createdby muser muser getctx createdby intvalue m_info getctx createdby getname m_datetimeformat createdby updatedby createdby updatedby muser getctx updatedby intvalue m_info getctx updatedby getname m_datetimeformat m_info ad_table_id m_table m_table getctx ad_table_id settitle getname mrole preferencetype_client mrole getdefault getpreferencetype record_id record_id record_id record_id intvalue dyninit record_id record_id record_id ad_column_id updatedby oldvalue newvalue ad_changelog ad_table_id record_id preparedstatement preparestatement setint ad_table_id setint record_id resultset executequery addline getint gettimestamp getint getstring getstring columnnames columnnames getctx ad_column_id columnnames getctx newvalue columnnames getctx oldvalue columnnames getctx updatedby columnnames getctx defaulttablemodel defaulttablemodel m_data columnnames setmodel autosize add line param ad column id column param updated updated param updated by user param old value old param new value new private void add line int ad column id timestamp updated int updated by string old value string new value vector string line new vector string column m column column m column get env get ctx ad column id line add column get name if old value null old value equals m change log null old value null string show old value old value if new value null new value equals m change log null new value null string show new value new value try if display type is text column getad reference id else if column getad reference id display type yes no if old value null boolean yes old value equals true old value equals y show old value msg get msg env get ctx yes y n if new value null boolean yes new value equals true new value equals y show new value msg get msg env get ctx yes y n else if column getad reference id display type amount if old value null show old value m amtformat format new big decimal old value if new value null show new value m amtformat format new big decimal new value else if column getad reference id display type integer if old value null show old value m intformat format new integer old value if new value null show new value m intformat format new integer new value else if display type is numeric column getad reference id if old value null show old value m numberformat format new big decimal old value if new value null show new value m numberformat format new big decimal new value else if column getad reference id display type date if old value null show old value m dateformat format timestamp value of old value if new value null show new value m dateformat format timestamp value of new value else if column getad reference id display type date time if old value null show old value m datetimeformat format timestamp value of old value if new value null show new value m datetimeformat format timestamp value of new value else if display type is lookup column getad reference id m lookup lookup m lookup factory get env get ctx 0 ad column id column getad reference id env get language env get ctx column get column name column getad reference value id column is parent null if old value null object key old value if column getad reference id display type list key new integer old value name pair pp lookup get key if pp null show old value pp get name if new value null object key new value if column getad reference id display type list key new integer new value name pair pp lookup get key if pp null show new value pp get name else if display type islob column getad reference id catch exception e log log level warning old value new value e line add show new value line add show old value updated by m user user m user get env get ctx updated by line add user get name updated line add m dateformat format updated m data add line ad_column_id updatedby oldvalue newvalue addline ad_column_id updatedby oldvalue newvalue m_column m_column getctx ad_column_id getname oldvalue oldvalue mchangelog oldvalue showoldvalue oldvalue newvalue newvalue mchangelog newvalue shownewvalue newvalue displaytype istext getad_reference_id getad_reference_id displaytype yesno oldvalue oldvalue oldvalue showoldvalue getmsg getctx newvalue newvalue newvalue shownewvalue getmsg getctx getad_reference_id displaytype oldvalue showoldvalue m_amtformat bigdecimal oldvalue newvalue shownewvalue m_amtformat bigdecimal newvalue getad_reference_id displaytype oldvalue showoldvalue m_intformat oldvalue newvalue shownewvalue m_intformat newvalue displaytype isnumeric getad_reference_id oldvalue showoldvalue m_numberformat bigdecimal oldvalue newvalue shownewvalue m_numberformat bigdecimal newvalue getad_reference_id displaytype oldvalue showoldvalue m_dateformat valueof oldvalue newvalue shownewvalue m_dateformat valueof newvalue getad_reference_id displaytype datetime oldvalue showoldvalue m_datetimeformat valueof oldvalue newvalue shownewvalue m_datetimeformat valueof newvalue displaytype islookup getad_reference_id mlookup mlookupfactory getctx ad_column_id getad_reference_id getlanguage getctx getcolumnname getad_reference_value_id isparent oldvalue oldvalue getad_reference_id displaytype oldvalue namepair showoldvalue getname newvalue newvalue getad_reference_id displaytype newvalue namepair shownewvalue getname displaytype getad_reference_id oldvalue newvalue shownewvalue showoldvalue updatedby muser muser getctx updatedby getname m_dateformat m_data action listener param e event public void action performed action event e dispose actionlistener actionperformed actionevent initialize global variables param config servlet configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception info servlet init servletexception servletconfig servletexception webenv initweb servletexception infoservlet get servlet information return info public string get servlet info return compiere interest area servlet getservletinfo clean up resources public void destroy log info destroy process the initial http get request reads the parameter amt and optional c invoice id param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr http session session request get session true session remove attribute web session ctx hdr message w env dump session w env dump request boolean success process parameter request string url info jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response c_invoice_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message wenv wenv processparameter requestdispatcher getservletcontext getrequestdispatcher process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr doget process parameter and check them param request request return true if processed private boolean process parameter http servlet request request http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request mode subscribe string mode web util get parameter request mode if mode null return false boolean subscribe mode starts with un area 101 int r interestarea id web util get parameter as int request area m interest area ia m interest area get ctx r interestarea id contact 1 int ad user id web util get parameter as int request contact log fine subscribe subscribe r interestarea id r interestarea id ad user id ad user id if r interestarea id 0 ad user id 0 return false m contact interest ci m contact interest get ctx r interestarea id ad user id false null ci subscribe subscribe boolean ok ci save if ok log fine success else log log level severe subscribe failed lookup user if direct link web user wu web user session get attribute web user name if wu null wu web user get ctx ad user id session set attribute web user name wu sende mail request wu ia get name subscribe return ok processparameter httpservletrequest httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webutil getparameter startswith r_interestarea_id webutil getparameterasint minterestarea minterestarea r_interestarea_id ad_user_id webutil getparameterasint r_interestarea_id r_interestarea_id ad_user_id ad_user_id r_interestarea_id ad_user_id mcontactinterest mcontactinterest r_interestarea_id ad_user_id webuser webuser getattribute webuser webuser ad_user_id setattribute webuser sendemail getname send subscription e mail param request request param wu web user private void sende mail http servlet request request web user wu string list name boolean subscribe string msg jsp env sende mail request wu subscribe m mail msg mailmsgtype subscribe m mail msg mailmsgtype unsubscribe new object list name wu get name list name email sendemail httpservletrequest webuser listname jspenv sendemail mmailmsg mailmsgtype_subscribe mmailmsg mailmsgtype_unsubscribe listname getname listname create editor for m field the name is set to the column name for dynamic display management param m field m field param table editor true if table editor return grid editor public static v editor get editor m field m field boolean table editor return get editor null m field table editor mfield mfield mfield tableeditor veditor geteditor mfield mfield tableeditor geteditor mfield tableeditor create editor for m field the name is set to the column name for dynamic display management param m tab m tab param m field m field param table editor true if table editor return grid editor public static v editor get editor m tab m tab m field m field boolean table editor if m field null return null v editor editor null int display type m field get display type string column name m field get column name boolean mandatory m field is mandatory false no context check boolean read only m field is read only boolean updateable m field is updateable int window no m field get window no not a field if m field is heading return null string clear password if display type display type string table editor display type display type text display type display type text long if m field is encrypted field v password vs new v password column name mandatory read only updateable m field get display length m field get field length m field getv format vs set name column name vs set field m field editor vs else if m field get column name equals printer name v printer name vs new v printer name column name mandatory read only updateable m field get display length m field get field length m field getv format vs set name column name vs set field m field editor vs else v string vs new v string column name mandatory read only updateable m field get display length m field get field length m field getv format m field get obscure type vs set name column name vs set field m field editor vs lookup else if display type is lookup display type display type display type id v lookup vl new v lookup column name mandatory read only updateable m field get lookup vl set name column name vl set field m field editor vl number else if display type is numeric display type v number vn new v number column name mandatory read only updateable display type m field get header vn set range m field get value min m field get value max vn set name column name vn set field m field editor vn yes no else if display type display type yes no v check box vc new v check box column name mandatory read only updateable m field get header m field get description table editor vc set name column name vc set field m field editor vc text single row else if display type display type text v text vt new v text column name mandatory read only updateable m field get display length m field get field length vt set name column name vt set field m field editor vt memo single row else if display type display type memo v memo vt new v memo column name mandatory read only updateable m field get display length m field get field length vt set name column name vt set field m field editor vt date else if display type is date display type if display type display type date time read only true v date vd new v date column name mandatory read only updateable display type m field get header vd set name column name vd set field m field editor vd location else if display type display type location v location loc new v location column name mandatory read only updateable m location lookup m field get lookup loc set name column name loc set field m field editor loc locator else if display type display type locator v locator loc new v locator column name mandatory read only updateable m locator lookup m field get lookup window no loc set name column name loc set field m field editor loc account else if display type display type account v account acct new v account column name mandatory read only updateable m account lookup m field get lookup m field get header acct set name column name acct set field m field editor acct button else if display type display type button v button button new v button column name mandatory read only updateable m field get header m field get description m field get help m field getad process id button set name column name button set field m field editor button assignment else if display type display type assignment v assignment assign new v assignment mandatory read only updateable assign set name column name assign set field m field editor assign color else if display type display type color v color color new v color m tab mandatory read only color set name column name color set field m field editor color image else if display type display type image v image image new v image window no image set name column name image set field m field editor image p attribute else if display type display type p attribute vp attribute attrib new vp attribute mandatory read only updateable window no mp attribute lookup m field get lookup attrib set name column name attrib set field m field editor attrib long text c lob else if display type display type text long v text long vt new v text long column name mandatory read only updateable m field get display length m field get field length vt set name column name vt set field m field editor vt else log log level severe column name unknown type display type return editor mfield mtab mtab mfield mfield tableeditor veditor geteditor mtab mtab mfield mfield tableeditor mfield veditor displaytype mfield getdisplaytype columnname mfield getcolumnname mfield ismandatory readonly mfield isreadonly mfield isupdateable windowno mfield getwindowno mfield isheading displaytype displaytype tableeditor displaytype displaytype displaytype displaytype textlong mfield isencryptedfield vpassword vpassword columnname readonly mfield getdisplaylength mfield getfieldlength mfield getvformat setname columnname setfield mfield mfield getcolumnname printername vprintername vprintername columnname readonly mfield getdisplaylength mfield getfieldlength mfield getvformat setname columnname setfield mfield vstring vstring columnname readonly mfield getdisplaylength mfield getfieldlength mfield getvformat mfield getobscuretype setname columnname setfield mfield displaytype islookup displaytype displaytype displaytype vlookup vlookup columnname readonly mfield getlookup setname columnname setfield mfield displaytype isnumeric displaytype vnumber vnumber columnname readonly displaytype mfield getheader setrange mfield getvaluemin mfield getvaluemax setname columnname setfield mfield yesno displaytype displaytype yesno vcheckbox vcheckbox columnname readonly mfield getheader mfield getdescription tableeditor setname columnname setfield mfield displaytype displaytype vtext vtext columnname readonly mfield getdisplaylength mfield getfieldlength setname columnname setfield mfield displaytype displaytype vmemo vmemo columnname readonly mfield getdisplaylength mfield getfieldlength setname columnname setfield mfield displaytype isdate displaytype displaytype displaytype datetime readonly vdate vdate columnname readonly displaytype mfield getheader setname columnname setfield mfield displaytype displaytype vlocation vlocation columnname readonly mlocationlookup mfield getlookup setname columnname setfield mfield displaytype displaytype vlocator vlocator columnname readonly mlocatorlookup mfield getlookup windowno setname columnname setfield mfield displaytype displaytype vaccount vaccount columnname readonly maccountlookup mfield getlookup mfield getheader setname columnname setfield mfield displaytype displaytype vbutton vbutton columnname readonly mfield getheader mfield getdescription mfield gethelp mfield getad_process_id setname columnname setfield mfield displaytype displaytype vassignment vassignment readonly setname columnname setfield mfield displaytype displaytype vcolor vcolor mtab readonly setname columnname setfield mfield displaytype displaytype vimage vimage windowno setname columnname setfield mfield pattribute displaytype displaytype pattribute vpattribute vpattribute readonly windowno mpattributelookup mfield getlookup setname columnname setfield mfield clob displaytype displaytype textlong vtextlong vtextlong columnname readonly mfield getdisplaylength mfield getfieldlength setname columnname setfield mfield columnname displaytype create label for m field null for yes no button the name is set to the column name for dynamic display management param m field m field return label public static c label get label m field m field if m field null return null int display type m field get display type no label for field only check box button if m field is field only display type display type yes no display type display type button return null c label label new c label m field get header m field get description label set name m field get column name label set font compiereplaf getfont label label set foreground compiereplaf gettextcolor label return label mfield yesno mfield mfield clabel getlabel mfield mfield mfield displaytype mfield getdisplaytype fieldonly checkbox mfield isfieldonly displaytype displaytype yesno displaytype displaytype clabel clabel mfield getheader mfield getdescription setname mfield getcolumnname setfont getfont_label setforeground gettextcolor_label standard constructor public bank statement match info super bankstatementmatchinfo do we have a match return true if something could be matched public boolean is matched return m c bpartner id 0 m c payment id 0 m c invoice id 0 ismatched m_c_bpartner_id m_c_payment_id m_c_invoice_id get matched b partner return b partner public int getc bpartner id return m c bpartner id bpartner bpartner getc_bpartner_id m_c_bpartner_id set matched b partner param c bpartner id b partner public void setc bpartner id int c bpartner id m c bpartner id c bpartner id bpartner c_bpartner_id bpartner setc_bpartner_id c_bpartner_id m_c_bpartner_id c_bpartner_id get matched payment return payment public int getc payment id return m c payment id getc_payment_id m_c_payment_id set matched payment param c payment id payment public void setc payment id int c payment id m c payment id c payment id c_payment_id setc_payment_id c_payment_id m_c_payment_id c_payment_id get matched invoice return invoice public int getc invoice id return m c invoice id getc_invoice_id m_c_invoice_id set matched invoice param c invoice id invoice public void setc invoice id int c invoice id m c invoice id c invoice id c_invoice_id setc_invoice_id c_invoice_id m_c_invoice_id c_invoice_id constructor param ctx context param window no window public m setup properties ctx int window no m ctx new properties ctx copy m lang env getad language m ctx m windowno window no windowno msetup windowno m_ctx m_lang getad_language m_ctx m_windowno windowno create client info client trees org role user user role param client name client name param org name org name param user client user id client param user org user id org return true if created public boolean create client string client name string org name string user client string user org log info client name m trx start info header m info new string buffer standarc columns string name null string sql null int no 0 create client name client name if name null name length 0 name new client m clientname name m client new m client m ctx 0 true m trx get trx name m client set value m clientname m client set name m clientname if m client save string err client not created log log level severe err m info append err m trx rollback m trx close return false int ad client id m client getad client id env set context m ctx m windowno ad client id ad client id env set context m ctx ad client id ad client id standard values m stdvalues string value of ad client id 0 y sys date 0 sys date 0 info client m info append msg translate m lang ad client id append append name append n setup sequences if m sequence check client sequences m ctx ad client id m trx get trx name string err sequences not created log log level severe err m info append err m trx rollback m trx close return false trees and client info if m client setup client info m lang string err client info not created log log level severe err m info append err m trx rollback m trx close return false m ad tree account id m client getsetup ad tree account id create org name org name if name null name length 0 name new org m org new m org m client name if m org save string err organization not created log log level severe err m info append err m trx rollback m trx close return false env set context m ctx m windowno ad org id getad org id env set context m ctx ad org id getad org id m stdvaluesorg ad client id getad org id y sys date 0 sys date 0 info m info append msg translate m lang ad org id append append name append n create roles admin user name m clientname admin m role admin new m role m ctx 0 m trx get trx name admin set client org m client admin set name name admin set user level m role userlevel clientplusorganization admin set preference type m role preferencetype client admin set is show acct true if admin save string err admin role a not inserted log log level severe err m info append err m trx rollback m trx close return false org access x 0 m role org access admin client access new m role org access admin 0 if admin client access save log log level severe admin role orgaccess 0 not created org access x y m role org access admin org access new m role org access admin m org getad org id if admin org access save log log level severe admin role orgaccess not created info admin role m info append msg translate m lang ad role id append append name append n name m clientname user m role user new m role m ctx 0 m trx get trx name user set client org m client user set name name if user save string err user role a not inserted log log level severe err m info append err m trx rollback m trx close return false org access x y m role org access user org access new m role org access user m org getad org id if user org access save log log level severe user role orgaccess not created info client role m info append msg translate m lang ad role id append append name append n create users client org name user client if name null name length 0 name m clientname client ad user id get nextid ad client id ad user ad user name name name db to string name sql insert into ad user m stdcolumns ad user id name description password values m stdvalues ad user id name name name no db execute update sql m trx get trx name if no 1 string err admin user not inserted ad user name log log level severe err m info append err m trx rollback m trx close return false info m info append msg translate m lang ad user id append append ad user name append append ad user name append n name user org if name null name length 0 name m clientname org ad user u id get nextid ad client id ad user ad user u name name name db to string name sql insert into ad user m stdcolumns ad user id name description password values m stdvalues ad user u id name name name no db execute update sql m trx get trx name if no 1 string err org user not inserted ad user u name log log level severe err m info append err m trx rollback m trx close return false info m info append msg translate m lang ad user id append append ad user u name append append ad user u name append n create user role client user admin user sql insert into ad user roles m stdcolumns ad user id ad role id values m stdvalues ad user id admin getad role id no db execute update sql m trx get trx name if no 1 log log level severe user role client user admin not inserted sql insert into ad user roles m stdcolumns ad user id ad role id values m stdvalues ad user id user getad role id no db execute update sql m trx get trx name if no 1 log log level severe user role client user user not inserted org user user sql insert into ad user roles m stdcolumns ad user id ad role id values m stdvalues ad user u id user getad role id no db execute update sql m trx get trx name if no 1 log log level severe user role org user org not inserted processors m acct processor ap new m acct processor m client ad user id ap save m request processor rp new m request processor m client ad user id rp save log info fini return true user_role clientname orgname userclient userorg createclient clientname orgname userclient userorg clientname m_trx m_info stringbuffer clientname newclient m_clientname m_client mclient m_ctx m_trx gettrxname m_client setvalue m_clientname m_client setname m_clientname m_client m_info m_trx m_trx ad_client_id m_client getad_client_id setcontext m_ctx m_windowno ad_client_id ad_client_id setcontext m_ctx ad_client_id ad_client_id m_stdvalues valueof ad_client_id sysdate sysdate m_info m_lang ad_client_id msequence checkclientsequences m_ctx ad_client_id m_trx gettrxname m_info m_trx m_trx m_client setupclientinfo m_lang m_info m_trx m_trx m_ad_tree_account_id m_client getsetup_ad_tree_account_id orgname neworg m_org morg m_client m_org m_info m_trx m_trx setcontext m_ctx m_windowno ad_org_id getad_org_id setcontext m_ctx ad_org_id getad_org_id m_stdvaluesorg ad_client_id getad_org_id sysdate sysdate m_info m_lang ad_org_id m_clientname mrole mrole m_ctx m_trx gettrxname setclientorg m_client setname setuserlevel mrole userlevel_clientplusorganization setpreferencetype mrole preferencetype_client setisshowacct m_info m_trx m_trx orgaccess mroleorgaccess adminclientaccess mroleorgaccess adminclientaccess role_orgaccess orgaccess mroleorgaccess adminorgaccess mroleorgaccess m_org getad_org_id adminorgaccess role_orgaccess m_info m_lang ad_role_id m_clientname mrole mrole m_ctx m_trx gettrxname setclientorg m_client setname m_info m_trx m_trx orgaccess mroleorgaccess userorgaccess mroleorgaccess m_org getad_org_id userorgaccess role_orgaccess m_info m_lang ad_role_id userclient m_clientname ad_user_id getnextid ad_client_id ad_user ad_user_name to_string ad_user m_stdcolumns ad_user_id m_stdvalues ad_user_id executeupdate m_trx gettrxname ad_user_name m_info m_trx m_trx m_info m_lang ad_user_id ad_user_name ad_user_name userorg m_clientname ad_user_u_id getnextid ad_client_id ad_user ad_user_u_name to_string ad_user m_stdcolumns ad_user_id m_stdvalues ad_user_u_id executeupdate m_trx gettrxname ad_user_u_name m_info m_trx m_trx m_info m_lang ad_user_id ad_user_u_name ad_user_u_name clientuser ad_user_roles m_stdcolumns ad_user_id ad_role_id m_stdvalues ad_user_id getad_role_id executeupdate m_trx gettrxname userrole clientuser ad_user_roles m_stdcolumns ad_user_id ad_role_id m_stdvalues ad_user_id getad_role_id executeupdate m_trx gettrxname userrole clientuser orguser ad_user_roles m_stdcolumns ad_user_id ad_role_id m_stdvalues ad_user_u_id getad_role_id executeupdate m_trx gettrxname userrole orguser macctprocessor macctprocessor m_client ad_user_id mrequestprocessor mrequestprocessor m_client ad_user_id create accounting elements calendar account trees account values accounting schema default accounts param currency currency param has product has product segment param hasb partner has bp segment param has project has project segment param hasm campaign has campaign segment param hass region has sales region segment param accounting file file name of accounting file return true if created public boolean create accounting key name pair currency boolean has product boolean hasb partner boolean has project boolean hasm campaign boolean hass region file accounting file log info m client to string m hasproject has project m hasmcampaign hasm campaign m hassregion hass region standard variables m info new string buffer string name null string buffer sql cmd null int no 0 create calendar m calendar new m calendar m client if m calendar save string err calendar not inserted log log level severe err m info append err m trx rollback m trx close return false info m info append msg translate m lang c calendar id append append m calendar get name append n if m calendar create year m client get locale null log log level severe year not inserted create account elements name m clientname msg translate m lang account id m element element new m element m client name m element elementtype account m ad tree account id if element save string err acct element not inserted log log level severe err m info append err m trx rollback m trx close return false int c element id element getc element id m info append msg translate m lang c element id append append name append n create account values m nap new natural account map string m element value m ctx m trx get trx name string err msg m nap parse file accounting file if err msg length 0 log log level severe err msg m info append err msg m trx rollback m trx close return false if m nap save accounts getad client id getad org id c element id m info append msg translate m lang c elementvalue id append append m nap size append n else string err acct element values not inserted log log level severe err m info append err m trx rollback m trx close return false int c elementvalue id m nap getc elementvalue id default acct log fine c elementvalue id c elementvalue id create accounting schema m as new m acct schema m client currency if m as save string err acct schema not inserted log log level severe err m info append err m trx rollback m trx close return false info m info append msg translate m lang c acctschema id append append m as get name append n create accounting schema elements structure string sql2 null if env is base language m lang ad reference get element types name sql2 select value name from ad ref list where ad reference id 181 else sql2 select l value t name from ad ref list l ad ref list trl t where l ad reference id 181 and l ad ref list id t ad ref list id int element oo 0 element ac 0 element pr 0 element bp 0 element pj 0 element mc 0 element sr 0 try int ad client id m client getad client id prepared statement stmt db prepare statement sql2 m trx get trx name result set rs stmt execute query while rs next string element type rs get string 1 name rs get string 2 string is mandatory null string is balanced n int seq no 0 int c acctschema element id 0 if element type equals oo c acctschema element id get nextid ad client id c acctschema element element oo c acctschema element id is mandatory y is balanced y seq no 10 else if element type equals ac c acctschema element id get nextid ad client id c acctschema element element ac c acctschema element id is mandatory y seq no 20 else if element type equals pr has product c acctschema element id get nextid ad client id c acctschema element element pr c acctschema element id is mandatory n seq no 30 else if element type equals bp hasb partner c acctschema element id get nextid ad client id c acctschema element element bp c acctschema element id is mandatory n seq no 40 else if element type equals pj has project c acctschema element id get nextid ad client id c acctschema element element pj c acctschema element id is mandatory n seq no 50 else if element type equals mc hasm campaign c acctschema element id get nextid ad client id c acctschema element element mc c acctschema element id is mandatory n seq no 60 else if element type equals sr hass region c acctschema element id get nextid ad client id c acctschema element element sr c acctschema element id is mandatory n seq no 70 not ot lf lt u1 u2 ay if is mandatory null sql cmd new string buffer insert into c acctschema element sql cmd append m stdcolumns append c acctschema element id c acctschema id append element type name seq no is mandatory is balanced values sql cmd append m stdvalues append append c acctschema element id append append m as getc acctschema id append append append element type append append name append append seq no append append is mandatory append append is balanced append no db execute update sql cmd to string m trx get trx name if no 1 m info append msg translate m lang c acctschema element id append append name append n default value for mandatory elements oo and ac if element type equals oo sql cmd new string buffer update c acctschema element set org id sql cmd append getad org id append where c acctschema element id append c acctschema element id no db execute update sql cmd to string m trx get trx name if no 1 log log level severe default org in acct schama element not updated if element type equals ac sql cmd new string buffer update c acctschema element set c elementvalue id sql cmd append c elementvalue id append c element id append c element id sql cmd append where c acctschema element id append c acctschema element id no db execute update sql cmd to string m trx get trx name if no 1 log log level severe default account in acct schama element not updated rs close stmt close catch sql exception e1 log log level severe elements e1 m info append e1 get message m trx rollback m trx close return false create acct schema create gl accounts m accountsok true sql cmd new string buffer insert into c acctschema gl sql cmd append m stdcolumns append c acctschema id usesuspensebalancing suspensebalancing acct usesuspenseerror suspenseerror acct usecurrencybalancing currencybalancing acct retainedearning acct incomesummary acct intercompanydueto acct intercompanyduefrom acct ppvoffset acct commitmentoffset acct values sql cmd append m stdvalues append append m as getc acctschema id append append y append get acct suspensebalancing acct append append y append get acct suspenseerror acct append append y append get acct currencybalancing acct append retainedearning acct incomesummary acct sql cmd append get acct retainedearning acct append append get acct incomesummary acct append intercompanydueto acct intercompanyduefrom acct append get acct intercompanydueto acct append append get acct intercompanyduefrom acct append append get acct ppvoffset acct append append get acct commitmentoffset acct append if m accountsok no db execute update sql cmd to string m trx get trx name else no 1 if no 1 string err gl accounts not inserted log log level severe err m info append err m trx rollback m trx close return false create std accounts sql cmd new string buffer insert into c acctschema default sql cmd append m stdcolumns append c acctschema id w inventory acct w differences acct w revaluation acct w invactualadjust acct p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct c receivable acct c receivable services acct c prepayment acct v liability acct v liability services acct v prepayment acct paydiscount exp acct paydiscount rev acct writeoff acct unrealizedgain acct unrealizedloss acct realizedgain acct realizedloss acct withholding acct e prepaymen hasproduct hasbpartner hasproject hasmcampaign hassregion accountingfile createaccounting keynamepair hasproduct hasbpartner hasproject hasmcampaign hassregion accountingfile m_client tostring m_hasproject hasproject m_hasmcampaign hasmcampaign m_hassregion hassregion m_info stringbuffer stringbuffer sqlcmd m_calendar mcalendar m_client m_calendar m_info m_trx m_trx m_info m_lang c_calendar_id m_calendar getname m_calendar createyear m_client getlocale m_clientname m_lang account_id melement melement m_client melement elementtype_account m_ad_tree_account_id m_info m_trx m_trx c_element_id getc_element_id m_info m_lang c_element_id m_nap naturalaccountmap melementvalue m_ctx m_trx gettrxname errmsg m_nap parsefile accountingfile errmsg errmsg m_info errmsg m_trx m_trx m_nap saveaccounts getad_client_id getad_org_id c_element_id m_info m_lang c_elementvalue_id m_nap m_info m_trx m_trx c_elementvalue_id m_nap getc_elementvalue_id default_acct c_elementvalue_id c_elementvalue_id accountingschema m_as macctschema m_client m_as acctschema m_info m_trx m_trx m_info m_lang c_acctschema_id m_as getname accountingschema isbaselanguage m_lang ad_reference elementtypes ad_ref_list ad_reference_id ad_ref_list ad_ref_list_trl ad_reference_id ad_ref_list_id ad_ref_list_id element_oo element_ac element_pr element_bp element_pj element_mc element_sr ad_client_id m_client getad_client_id preparedstatement preparestatement m_trx gettrxname resultset executequery elementtype getstring getstring ismandatory isbalanced seqno c_acctschema_element_id elementtype c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_oo c_acctschema_element_id ismandatory isbalanced seqno elementtype c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_ac c_acctschema_element_id ismandatory seqno elementtype hasproduct c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_pr c_acctschema_element_id ismandatory seqno elementtype hasbpartner c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_bp c_acctschema_element_id ismandatory seqno elementtype hasproject c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_pj c_acctschema_element_id ismandatory seqno elementtype hasmcampaign c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_mc c_acctschema_element_id ismandatory seqno elementtype hassregion c_acctschema_element_id getnextid ad_client_id c_acctschema_element element_sr c_acctschema_element_id ismandatory seqno ismandatory sqlcmd stringbuffer c_acctschema_element sqlcmd m_stdcolumns c_acctschema_element_id c_acctschema_id elementtype seqno ismandatory isbalanced sqlcmd m_stdvalues c_acctschema_element_id m_as getc_acctschema_id elementtype seqno ismandatory isbalanced executeupdate sqlcmd tostring m_trx gettrxname m_info m_lang c_acctschema_element_id elementtype sqlcmd stringbuffer c_acctschema_element org_id sqlcmd getad_org_id c_acctschema_element_id c_acctschema_element_id executeupdate sqlcmd tostring m_trx gettrxname acctschamaelement elementtype sqlcmd stringbuffer c_acctschema_element c_elementvalue_id sqlcmd c_elementvalue_id c_element_id c_element_id sqlcmd c_acctschema_element_id c_acctschema_element_id executeupdate sqlcmd tostring m_trx gettrxname acctschamaelement sqlexception m_info getmessage m_trx m_trx acctschema m_accountsok sqlcmd stringbuffer c_acctschema_gl sqlcmd m_stdcolumns c_acctschema_id suspensebalancing_acct suspenseerror_acct currencybalancing_acct retainedearning_acct incomesummary_acct intercompanydueto_acct intercompanyduefrom_acct ppvoffset_acct commitmentoffset_acct sqlcmd m_stdvalues m_as getc_acctschema_id getacct suspensebalancing_acct getacct suspenseerror_acct getacct currencybalancing_acct retainedearning_acct incomesummary_acct sqlcmd getacct retainedearning_acct getacct incomesummary_acct intercompanydueto_acct intercompanyduefrom_acct getacct intercompanydueto_acct getacct intercompanyduefrom_acct getacct ppvoffset_acct getacct commitmentoffset_acct m_accountsok executeupdate sqlcmd tostring m_trx gettrxname m_info m_trx m_trx sqlcmd stringbuffer c_acctschema_default sqlcmd m_stdcolumns c_acctschema_id w_inventory_acct w_differences_acct w_revaluation_acct w_invactualadjust_acct p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct c_receivable_acct c_receivable_services_acct c_prepayment_acct v_liability_acct v_liability_services_acct v_prepayment_acct paydiscount_exp_acct paydiscount_rev_acct writeoff_acct unrealizedgain_acct unrealizedloss_acct realizedgain_acct realizedloss_acct withholding_acct e_prepaymen get account id for key param key key return c validcombination id private int get acct string key log fine key element int c elementvalue id m nap getc elementvalue id key to upper case if c elementvalue id 0 log severe account not defined key m accountsok false return 0 m account vc m account get default m as true optional null vc setad org id 0 will be overwritten vc setaccount id c elementvalue id if vc save log severe not saved key key c elementvalue id c elementvalue id m accountsok false return 0 int c validcombination id vc getc validcombination id if c validcombination id 0 log severe no account key key c elementvalue id c elementvalue id m accountsok false return c validcombination id c_validcombination_id getacct c_elementvalue_id m_nap getc_elementvalue_id touppercase c_elementvalue_id m_accountsok maccount maccount getdefault m_as setad_org_id setaccount_id c_elementvalue_id c_elementvalue_id c_elementvalue_id m_accountsok c_validcombination_id getc_validcombination_id c_validcombination_id c_elementvalue_id c_elementvalue_id m_accountsok c_validcombination_id create gl category param name name param category type category type mgl category categorytype param is default is default value return gl category id private int creategl category string name string category type boolean is default mgl category cat new mgl category m ctx 0 m trx get trx name cat set name name cat set category type category type cat set is default is default if cat save log log level severe gl category not created name return 0 return cat getgl category id categorytype mglcategory categorytype_ isdefault gl_category_id createglcategory categorytype isdefault mglcategory mglcategory m_ctx m_trx gettrxname setname setcategorytype categorytype setisdefault isdefault getgl_category_id create document types with sequence param name name param print name print name param doc base type document base type param doc sub typeso sales order sub type param c doctypeshipment id shipment doc param c doctypeinvoice id invoice doc param start no start doc no param gl category id gl category return c doctype id doc type or 0 for error private int create doc type string name string print name string doc base type string doc sub typeso int c doctypeshipment id int c doctypeinvoice id int start no int gl category id m sequence sequence null if start no 0 sequence new m sequence m ctx getad client id name start no m trx get trx name if sequence save log log level severe sequence not created name return 0 m doc type dt new m doc type m ctx doc base type name m trx get trx name if print name null print name length 0 dt set print name print name defaults to name if doc sub typeso null dt set doc sub typeso doc sub typeso if c doctypeshipment id 0 dt setc doctypeshipment id c doctypeshipment id if c doctypeinvoice id 0 dt setc doctypeinvoice id c doctypeinvoice id if gl category id 0 dt setgl category id gl category id if sequence null dt set is doc no controlled false else dt set is doc no controlled true dt setdocnosequence id sequence getad sequence id dt set isso trx if dt save log log level severe doc type not created name return 0 return dt getc doctype id printname docbasetype docsubtypeso c_doctypeshipment_id c_doctypeinvoice_id startno gl_category_id c_doctype_id createdoctype printname docbasetype docsubtypeso c_doctypeshipment_id c_doctypeinvoice_id startno gl_category_id msequence startno msequence m_ctx getad_client_id startno m_trx gettrxname mdoctype mdoctype m_ctx docbasetype m_trx gettrxname printname printname setprintname printname docsubtypeso setdocsubtypeso docsubtypeso c_doctypeshipment_id setc_doctypeshipment_id c_doctypeshipment_id c_doctypeinvoice_id setc_doctypeinvoice_id c_doctypeinvoice_id gl_category_id setgl_category_id gl_category_id setisdocnocontrolled setisdocnocontrolled setdocnosequence_id getad_sequence_id setissotrx doctype getc_doctype_id create default main entities dimensions bp group prod category location locator warehouse price list cashbook payment term param c country id country param city city param c region id region return true if created public boolean create entities int c country id string city int c region id int c currency id if m as null log severe no acctountings chema m trx rollback m trx close return false log info c country id c country id city city c region id c region id m info append n n string default name msg translate m lang standard string default entry default name string buffer sql cmd null int no 0 create marketing channel campaign int c channel id get nextid getad client id c channel sql cmd new string buffer insert into c channel sql cmd append c channel id name sql cmd append m stdcolumns append values sql cmd append c channel id append append default entry sql cmd append m stdvalues append no db execute update sql cmd to string m trx get trx name if no 1 log log level severe channel not inserted int c campaign id get nextid getad client id c campaign sql cmd new string buffer insert into c campaign sql cmd append c campaign id c channel id append m stdcolumns append sql cmd append value name costs values sql cmd append c campaign id append append c channel id append append m stdvalues append sql cmd append default entry append default entry append 0 no db execute update sql cmd to string m trx get trx name if no 1 m info append msg translate m lang c campaign id append append default name append n else log log level severe campaign not inserted if m hasmcampaign default sql cmd new string buffer update c acctschema element set sql cmd append c campaign id append c campaign id sql cmd append where c acctschema id append m as getc acctschema id sql cmd append and element type mc no db execute update sql cmd to string m trx get trx name if no 1 log log level severe acct schema e lement campaign not updated create sales region int c salesregion id get nextid getad client id c salesregion sql cmd new string buffer insert into c salesregion sql cmd append c salesregion id append m stdcolumns append sql cmd append value name is summary values sql cmd append c salesregion id append append m stdvalues append sql cmd append default entry append default entry append n no db execute update sql cmd to string m trx get trx name if no 1 m info append msg translate m lang c salesregion id append append default name append n else log log level severe sales region not inserted if m hassregion default sql cmd new string buffer update c acctschema element set sql cmd append c salesregion id append c salesregion id sql cmd append where c acctschema id append m as getc acctschema id sql cmd append and element type sr no db execute update sql cmd to string m trx get trx name if no 1 log log level severe acct schema e lement sales region not updated business partner create bp group mbp group bpg new mbp group m ctx 0 m trx get trx name bpg set value default name bpg set name default name bpg set is default true if bpg save m info append msg translate m lang c bp group id append append default name append n else log log level severe bp group not inserted create b partner mb partner bp new mb partner m ctx 0 m trx get trx name bp set value default name bp set name default name bp setc bp group id bpg getc bp group id if bp save m info append msg translate m lang c bpartner id append append default name append n else log log level severe b partner not inserted location for standard bp m location bp loc new m location m ctx c country id c region id city m trx get trx name bp loc save mb partner location bpl new mb partner location bp bpl setc location id bp loc getc location id if bpl save log log level severe bp location standard not inserted default sql cmd new string buffer update c acctschema element set sql cmd append c bpartner id append bp getc bpartner id sql cmd append where c acctschema id append m as getc acctschema id sql cmd append and element type bp no db execute update sql cmd to string m trx get trx name if no 1 log log level severe acct schema element b partner not updated create preference c bpartner id string value of bp getc bpartner id 143 product create product category m product category pc new m product category m ctx 0 m trx get trx name pc set value default name pc set name default name pc set is default true if pc save m info append msg translate m lang m product category id append append default name append n else log log level severe product category not inserted uom ea int c uom id 100 tax category int c taxcategory id get nextid getad client id c taxcategory sql cmd new string buffer insert into c taxcategory sql cmd append c taxcategory id append m stdcolumns append sql cmd append name is default values sql cmd append c taxcategory id append append m stdvalues append if c country id 100 us sql cmd append sales tax y else sql cmd append default entry append y no db execute update sql cmd to string m trx get trx name if no 1 log log level severe tax category not inserted tax zero rate m tax tax new m tax m ctx standard env zero c taxcategory id m trx get trx name tax set is default true if tax save m info append msg translate m lang c tax id append append tax get name append n else log log level severe tax not inserted create product m product product new m product m ctx 0 m trx get trx name product set value default name product set name default name product setc uom id c uom id product setm product category id pc getm product category id product setc taxcategory id c taxcategory id if product save m info append msg translate m lang m product id append append default name append n else log log level severe product not inserted default sql cmd new string buffer update c acctschema element set sql cmd append m product id append product getm product id sql cmd append where c acctschema id append m as getc acctschema id sql cmd append and element type pr no db execute update sql cmd to string m trx get trx name if no 1 log log level severe acct schema element product not updated location warehouse locator location company m location loc new m location m ctx c country id c region id city m trx get trx name loc save sql cmd new string buffer update ad orginfo set c location id sql cmd append loc getc location id append where ad org id append getad org id no db execute update sql cmd to string m trx get trx name if no 1 log log level severe location not inserted create preference c country id string value of c country id 0 default warehouse m warehouse wh new m warehouse m ctx 0 m trx get trx name wh set value default name wh set name default name wh setc location id loc getc location id if wh save log log level severe warehouse not inserted locator m locator locator new m locator wh default name locator set is default true if locator save log log level severe locator not inserted update client info sql cmd new string buffer update ad clientinfo set sql cmd append c bpartnercashtrx id append bp getc bpartner id sql cmd append m productfreight id append product getm product id sql cmd append c uom volume id sql cmd append c uom weight id sql cmd append c uom length id sql cmd append c uom time id sql cmd append where ad client id append getad client id no db execute update sql cmd to string m trx get trx name if no 1 string err client info not updated log log level severe err m info append err return false other price list m price list pl new m price list m ctx 0 m trx get trx name pl set name default name pl setc currency id c currency id pl set is default true if pl save log log level severe price list not inserted price list m discount schema ds new m discount schema m ctx 0 m trx get trx name ds set name default name ds set discount type m discount schema discounttype pricelist if ds save log log level severe discount schema not inserted price list version m price list version plv new m price list version pl plv set name plv setm discountschema id ds getm discountschema id if plv save log log level severe pricelist version not inserted product price m product price pp new m product price plv product getm product id env one env one env one if pp save log log level severe product price not inser bpgroup pricelist paymentterm c_country_id c_region_id createentities c_country_id c_region_id c_currency_id m_as acctountingschema m_trx m_trx c_country_id c_country_id c_region_id c_region_id m_info defaultname m_lang defaultentry defaultname stringbuffer sqlcmd c_channel_id getnextid getad_client_id c_channel sqlcmd stringbuffer c_channel sqlcmd c_channel_id sqlcmd m_stdcolumns sqlcmd c_channel_id defaultentry sqlcmd m_stdvalues executeupdate sqlcmd tostring m_trx gettrxname c_campaign_id getnextid getad_client_id c_campaign sqlcmd stringbuffer c_campaign sqlcmd c_campaign_id c_channel_id m_stdcolumns sqlcmd sqlcmd c_campaign_id c_channel_id m_stdvalues sqlcmd defaultentry defaultentry executeupdate sqlcmd tostring m_trx gettrxname m_info m_lang c_campaign_id defaultname m_hasmcampaign sqlcmd stringbuffer c_acctschema_element sqlcmd c_campaign_id c_campaign_id sqlcmd c_acctschema_id m_as getc_acctschema_id sqlcmd elementtype executeupdate sqlcmd tostring m_trx gettrxname acctschema element c_salesregion_id getnextid getad_client_id c_salesregion sqlcmd stringbuffer c_salesregion sqlcmd c_salesregion_id m_stdcolumns sqlcmd issummary sqlcmd c_salesregion_id m_stdvalues sqlcmd defaultentry defaultentry executeupdate sqlcmd tostring m_trx gettrxname m_info m_lang c_salesregion_id defaultname salesregion m_hassregion sqlcmd stringbuffer c_acctschema_element sqlcmd c_salesregion_id c_salesregion_id sqlcmd c_acctschema_id m_as getc_acctschema_id sqlcmd elementtype executeupdate sqlcmd tostring m_trx gettrxname acctschema element salesregion mbpgroup mbpgroup m_ctx m_trx gettrxname setvalue defaultname setname defaultname setisdefault m_info m_lang c_bp_group_id defaultname bpartner mbpartner mbpartner m_ctx m_trx gettrxname setvalue defaultname setname defaultname setc_bp_group_id getc_bp_group_id m_info m_lang c_bpartner_id defaultname bpartner mlocation bploc mlocation m_ctx c_country_id c_region_id m_trx gettrxname bploc mbpartnerlocation mbpartnerlocation setc_location_id bploc getc_location_id bp_location sqlcmd stringbuffer c_acctschema_element sqlcmd c_bpartner_id getc_bpartner_id sqlcmd c_acctschema_id m_as getc_acctschema_id sqlcmd elementtype executeupdate sqlcmd tostring m_trx gettrxname acctschema bpartner createpreference c_bpartner_id valueof getc_bpartner_id mproductcategory mproductcategory m_ctx m_trx gettrxname setvalue defaultname setname defaultname setisdefault m_info m_lang m_product_category_id defaultname c_uom_id taxcategory c_taxcategory_id getnextid getad_client_id c_taxcategory sqlcmd stringbuffer c_taxcategory sqlcmd c_taxcategory_id m_stdcolumns sqlcmd isdefault sqlcmd c_taxcategory_id m_stdvalues c_country_id sqlcmd sqlcmd defaultentry executeupdate sqlcmd tostring m_trx gettrxname taxcategory mtax mtax m_ctx c_taxcategory_id m_trx gettrxname setisdefault m_info m_lang c_tax_id getname mproduct mproduct m_ctx m_trx gettrxname setvalue defaultname setname defaultname setc_uom_id c_uom_id setm_product_category_id getm_product_category_id setc_taxcategory_id c_taxcategory_id m_info m_lang m_product_id defaultname sqlcmd stringbuffer c_acctschema_element sqlcmd m_product_id getm_product_id sqlcmd c_acctschema_id m_as getc_acctschema_id sqlcmd elementtype executeupdate sqlcmd tostring m_trx gettrxname acctschema mlocation mlocation m_ctx c_country_id c_region_id m_trx gettrxname sqlcmd stringbuffer ad_orginfo c_location_id sqlcmd getc_location_id ad_org_id getad_org_id executeupdate sqlcmd tostring m_trx gettrxname createpreference c_country_id valueof c_country_id mwarehouse mwarehouse m_ctx m_trx gettrxname setvalue defaultname setname defaultname setc_location_id getc_location_id mlocator mlocator defaultname setisdefault clientinfo sqlcmd stringbuffer ad_clientinfo sqlcmd c_bpartnercashtrx_id getc_bpartner_id sqlcmd m_productfreight_id getm_product_id sqlcmd c_uom_volume_id sqlcmd c_uom_weight_id sqlcmd c_uom_length_id sqlcmd c_uom_time_id sqlcmd ad_client_id getad_client_id executeupdate sqlcmd tostring m_trx gettrxname clientinfo m_info pricelist mpricelist mpricelist m_ctx m_trx gettrxname setname defaultname setc_currency_id c_currency_id setisdefault pricelist mdiscountschema mdiscountschema m_ctx m_trx gettrxname setname defaultname setdiscounttype mdiscountschema discounttype_pricelist discountschema pricelist mpricelistversion mpricelistversion setname setm_discountschema_id getm_discountschema_id pricelist_version productprice mproductprice mproductprice getm_product_id productprice create preference param attribute attribute param value value param ad window id window private void create preference string attribute string value int ad window id int ad preference id get nextid getad client id ad preference string buffer sql cmd new string buffer insert into ad preference sql cmd append ad preference id append m stdcolumns append sql cmd append attribute value ad window id values sql cmd append ad preference id append append m stdvalues append sql cmd append append attribute append append value append if ad window id 0 sql cmd append null else sql cmd append ad window id append int no db execute update sql cmd to string m trx get trx name if no 1 log log level severe preference not inserted attribute ad_window_id createpreference ad_window_id ad_preference_id getnextid getad_client_id ad_preference stringbuffer sqlcmd stringbuffer ad_preference sqlcmd ad_preference_id m_stdcolumns sqlcmd ad_window_id sqlcmd ad_preference_id m_stdvalues sqlcmd ad_window_id sqlcmd sqlcmd ad_window_id executeupdate sqlcmd tostring m_trx gettrxname get next id param ad client id client param table name table name private int get nextid int ad client id string table name todo exception return db get nextid ad client id table name m trx get trx name ad_client_id tablename getnextid ad_client_id tablename getnextid ad_client_id tablename m_trx gettrxname get client return ad client id public int getad client id return m client getad client id ad_client_id getad_client_id m_client getad_client_id return m client getad client id public int getad org id return m org getad org id m_client getad_client_id getad_org_id m_org getad_org_id return m org getad org id public int getad user id return ad user id m_org getad_org_id getad_user_id ad_user_id return ad user id public string get info return m info to string ad_user_id getinfo m_info tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals r interestarea id m r interestarea id para i get parameter as int else if name equals r mailtext id m r mailtext id para i get parameter as int else if name equals c bp group id m c bp group id para i get parameter as int else if name equals ad user id m ad user id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter r_interestarea_id m_r_interestarea_id getparameterasint r_mailtext_id m_r_mailtext_id getparameterasint c_bp_group_id m_c_bp_group_id getparameterasint ad_user_id m_ad_user_id getparameterasint perrform process return message throws exception protected string do it throws exception log info r mailtext id m r mailtext id mail test m mailtext new m mail text get ctx m r mailtext id get trxname if m mailtext getr mailtext id 0 throw new exception not found r mailtext id m r mailtext id client info m client m client get get ctx if m client getad client id 0 throw new exception not found ad client id if m client getsmtp host null m client getsmtp host length 0 throw new exception no smtp host found if m ad user id 0 m from new m user get ctx m ad user id get trxname if m from getad user id 0 throw new exception no found ad user id m ad user id log fine from m from long start system current time millis if m r interestarea id 0 send interest area if m c bp group id 0 sendbp group return created m counter errors m errors system current time millis start ms doit r_mailtext_id m_r_mailtext_id m_mailtext mmailtext getctx m_r_mailtext_id get_trxname m_mailtext getr_mailtext_id r_mailtext_id m_r_mailtext_id m_client mclient getctx m_client getad_client_id ad_client_id m_client getsmtphost m_client getsmtphost m_ad_user_id m_from muser getctx m_ad_user_id get_trxname m_from getad_user_id ad_user_id m_ad_user_id m_from currenttimemillis m_r_interestarea_id sendinterestarea m_c_bp_group_id sendbpgroup m_counter m_errors currenttimemillis send to interest area private void send interest area log info r interestarea id m r interestarea id m ia m interest area get get ctx m r interestarea id string unsubscribe null if m ia is self service unsubscribe n n n msg get element get ctx r interestarea id m ia get name n msg get msg get ctx unsubscribe info n m store wstores m store get of client m client int index 0 for int i 0 i wstores length i if wstores i is default index i break if wstores length 0 unsubscribe wstores index get web context true string sql select u name u e mail u ad user id from r contactinterest ci inner join ad user u on ci ad user id u ad user id where ci is active y and u is active y and ci opt out date is null and u e mail is not null and ci r interestarea id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 m r interestarea id result set rs pstmt execute query while rs next boolean ok send individual mail rs get string 1 rs get int 3 unsubscribe if ok null else if ok boolean value m counter else m errors rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex clean up try if pstmt null pstmt close catch sql exception ex1 pstmt null m ia null interestarea sendinterestarea r_interestarea_id m_r_interestarea_id m_ia minterestarea getctx m_r_interestarea_id m_ia isselfservice getelement getctx r_interestarea_id m_ia getname getmsg getctx unsubscribeinfo mstore mstore getofclient m_client isdefault getwebcontext email ad_user_id r_contactinterest ad_user ad_user_id ad_user_id isactive isactive optoutdate email r_interestarea_id preparedstatement preparestatement get_trxname setint m_r_interestarea_id resultset executequery sendindividualmail getstring getint booleanvalue m_counter m_errors sqlexception sqlexception m_ia send to bp group private void sendbp group log info c bp group id m c bp group id string sql select u name u e mail u ad user id from ad user u inner join c bpartner bp on u c bpartner id bp c bpartner id where u is active y and bp is active y and u e mail is not null and bp c bp group id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 m c bp group id result set rs pstmt execute query while rs next boolean ok send individual mail rs get string 1 rs get int 3 null if ok null else if ok boolean value m counter else m errors rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex clean up try if pstmt null pstmt close catch sql exception ex1 pstmt null bpgroup sendbpgroup c_bp_group_id m_c_bp_group_id email ad_user_id ad_user c_bpartner c_bpartner_id c_bpartner_id isactive isactive email c_bp_group_id preparedstatement preparestatement get_trxname setint m_c_bp_group_id resultset executequery sendindividualmail getstring getint booleanvalue m_counter m_errors sqlexception sqlexception send individual mail param name user name param ad user id user param unsubscribe unsubscribe message return true if mail has been sent private boolean send individual mail string name int ad user id string unsubscribe prevent two email integer ii new integer ad user id if m list contains ii return null m list add ii m user to new m user get ctx ad user id null m mailtext set user ad user id parse context string message m mailtext get mail text true unsubscribe if unsubscribe null message unsubscribe e mail email m client createe mail m from to m mailtext get mail header message if m mailtext is html email set messagehtml m mailtext get mail header message else email set subject m mailtext get mail header email set message text message if email is valid email is valid true log warning not valid email to set is active false to add description invalid e mail to save return boolean false boolean ok e mail sent ok equals email send new m user mail m mailtext ad user id email save if ok log fine to gete mail else log warning failure to gete mail add log 0 null null ok ok error to gete mail return new boolean ok ad_user_id sendindividualmail ad_user_id ad_user_id m_list m_list muser muser getctx ad_user_id m_mailtext setuser ad_user_id m_mailtext getmailtext email m_client createemail m_from m_mailtext getmailheader m_mailtext ishtml setmessagehtml m_mailtext getmailheader setsubject m_mailtext getmailheader setmessagetext isvalid isvalid setisactive adddescription email email sent_ok musermail m_mailtext ad_user_id getemail getemail addlog getemail standard constructor public x rv c invoice productmonth properties ctx int rv c invoice productmonth id string trx name super ctx rv c invoice productmonth id trx name if rv c invoice productmonth id 0 set isso trx false x_rv_c_invoice_productmonth rv_c_invoice_productmonth_id trxname rv_c_invoice_productmonth_id trxname rv_c_invoice_productmonth_id setissotrx load constructor public x rv c invoice productmonth properties ctx result set rs string trx name super ctx rs trx name x_rv_c_invoice_productmonth resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x rv c invoice productmonth append get id append return sb to string tostring stringbuffer stringbuffer x_rv_c_invoice_productmonth get_id tostring set date invoiced date printed on invoice public void set date invoiced timestamp date invoiced set value date invoiced date invoiced setdateinvoiced dateinvoiced set_value dateinvoiced dateinvoiced get date invoiced date printed on invoice public timestamp get date invoiced return timestamp get value date invoiced getdateinvoiced get_value dateinvoiced set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set line discount line discount as a percentage public void set line discount big decimal line discount set value line discount line discount setlinediscount bigdecimal linediscount set_value linediscount linediscount get line discount line discount as a percentage public big decimal get line discount big decimal bd big decimal get value line discount if bd null return env zero return bd bigdecimal getlinediscount bigdecimal bigdecimal get_value linediscount set line discount line discount amount public void set line discount amt big decimal line discount amt set value line discount amt line discount amt setlinediscountamt bigdecimal linediscountamt set_value linediscountamt linediscountamt get line discount line discount amount public big decimal get line discount amt big decimal bd big decimal get value line discount amt if bd null return env zero return bd bigdecimal getlinediscountamt bigdecimal bigdecimal get_value linediscountamt set line limit amount public void set line limit amt big decimal line limit amt set value line limit amt line limit amt setlinelimitamt bigdecimal linelimitamt set_value linelimitamt linelimitamt get line limit amount public big decimal get line limit amt big decimal bd big decimal get value line limit amt if bd null return env zero return bd bigdecimal getlinelimitamt bigdecimal bigdecimal get_value linelimitamt set line list amount public void set line list amt big decimal line list amt set value line list amt line list amt setlinelistamt bigdecimal linelistamt set_value linelistamt linelistamt get line list amount public big decimal get line list amt big decimal bd big decimal get value line list amt if bd null return env zero return bd bigdecimal getlinelistamt bigdecimal bigdecimal get_value linelistamt set line amount line extended amount quantity actual price without freight and charges public void set line net amt big decimal line net amt set value line net amt line net amt setlinenetamt bigdecimal linenetamt set_value linenetamt linenetamt get line amount line extended amount quantity actual price without freight and charges public big decimal get line net amt big decimal bd big decimal get value line net amt if bd null return env zero return bd bigdecimal getlinenetamt bigdecimal bigdecimal get_value linenetamt set gross margin public void set line over limit big decimal line over limit set value line over limit line over limit setlineoverlimit bigdecimal lineoverlimit set_value lineoverlimit lineoverlimit get gross margin public big decimal get line over limit big decimal bd big decimal get value line over limit if bd null return env zero return bd bigdecimal getlineoverlimit bigdecimal bigdecimal get_value lineoverlimit set gross margin public void set line over limit amt big decimal line over limit amt set value line over limit amt line over limit amt setlineoverlimitamt bigdecimal lineoverlimitamt set_value lineoverlimitamt lineoverlimitamt get gross margin public big decimal get line over limit amt big decimal bd big decimal get value line over limit amt if bd null return env zero return bd bigdecimal getlineoverlimitamt bigdecimal bigdecimal get_value lineoverlimitamt set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced basic constructor you need to set the attributes using the set methods public h6 use the set methods to set the values of the attributes param element set the value of lt h6 gt value lt h6 gt public h6 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h6 gt value lt h6 gt public h6 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h6 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h6 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h6 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h6 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h6 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute set color type for color blind view param color type 0 none public static void set color type int color type if color type 0 color type 4 s colortype color type else s colortype 0 if s colortype 0 log config colorblind type color type colortype setcolortype colortype colortype colortype s_colortype colortype s_colortype s_colortype colorblind_type colortype get color type for color blind view return color type 0 none public static int get color type return s colortype colortype getcolortype s_colortype convert normal color to dichromat color based on set color type param color java color object containing values for rgb return dichromat color public static colorui resource get dichromat colorui resource colorui resource color if s colortype normal return color return new colorui resource get dichromat colorui resource color s colortype coloruiresource getdichromatcoloruiresource coloruiresource s_colortype coloruiresource getdichromatcoloruiresource s_colortype convert normal color to dichromat color param color java color object containing values for rgb param color type protanopia 1 deuteranopia 2 or tritanopia 3 as declared above return dichromat color public static color get dichromat colorui resource colorui resource color int color type if s colortype normal return color return new colorui resource get dichromat color color s colortype colortype getdichromatcoloruiresource coloruiresource colortype s_colortype coloruiresource getdichromatcolor s_colortype convert normal color to dichromat color based on set color type param color java color object containing values for rgb return dichromat color public static color get dichromat color color color if s colortype normal return color return get dichromat color color s colortype getdichromatcolor s_colortype getdichromatcolor s_colortype convert normal color to dichromat color param color java color object containing values for rgb param color type protanopia 1 deuteranopia 2 or tritanopia 3 as declared above return dichromat color public static color get dichromat color color color int color type check type return if not valid int type 0 if color type 0 color type 4 type color type no conversion or no color if type 0 color null return color type correct to zero based return white black not converted if color equals color black color equals color white return color double red color get red double green color get green double blue color get blue system out println red red green green blue blue double x rg btoxyz matrix 0 0 math pow red 255 0 gamma rg btoxyz matrix 0 1 math pow green 255 0 gamma rg btoxyz matrix 0 2 math pow blue 255 0 gamma double y rg btoxyz matrix 1 0 math pow red 255 0 gamma rg btoxyz matrix 1 1 math pow green 255 0 gamma rg btoxyz matrix 1 2 math pow blue 255 0 gamma double z rg btoxyz matrix 2 0 math pow red 255 0 gamma rg btoxyz matrix 2 1 math pow green 255 0 gamma rg btoxyz matrix 2 2 math pow blue 255 0 gamma system out println x x y y z z double x 0 0 double y 0 0 if x y z 0 0 x x x y z y y x y z system out println x x y y y y double yn y double xn white point 0 yn white point 1 double zn white point 2 yn white point 1 double xc confusion points type 0 double yc confusion points type 1 double x1 color axes type 0 0 double y1 color axes type 0 1 double x2 color axes type 1 0 double y2 color axes type 1 1 double ap y2 y1 x2 x1 double bp y1 x1 ap system out println ap ap bp bp double a if x xc a yc y xc x else a y yc x xc double b y x a system out println a a b b x bp b a ap y a x b system out println x x y y x 0 0 z 0 0 if y 0 x x y y z 1 x y y y system out println x x y y z z red xy ztorgb matrix 0 0 x xy ztorgb matrix 0 1 y xy ztorgb matrix 0 2 z green xy ztorgb matrix 1 0 x xy ztorgb matrix 1 1 y xy ztorgb matrix 1 2 z blue xy ztorgb matrix 2 0 x xy ztorgb matrix 2 1 y xy ztorgb matrix 2 2 z system out println red red green green blue blue double reddiff xy ztorgb matrix 0 0 xn x xy ztorgb matrix 0 1 yn y xy ztorgb matrix 0 2 zn z double greendiff xy ztorgb matrix 1 0 xn x xy ztorgb matrix 1 1 yn y xy ztorgb matrix 1 2 zn z double bluediff xy ztorgb matrix 2 0 xn x xy ztorgb matrix 2 1 yn y xy ztorgb matrix 2 2 zn z double cr red 0 0 0 0 1 0 red reddiff double cg green 0 0 0 0 1 0 green greendiff double cb blue 0 0 0 0 1 0 blue bluediff system out println cr cr cg cg cb cb double c1 cr 0 cr 1 0 cr double c2 cg 0 cg 1 0 cg double c3 cb 0 cb 1 0 cb double c math max c1 math max c2 c3 system out println c c red red c reddiff green green c greendiff blue blue c bluediff system out println red red green green blue blue red math pow red 1 0 gamma green math pow green 1 0 gamma blue math pow blue 1 0 gamma system out println red red green green blue blue system out println red red 255 0 green green 255 0 blue blue 255 0 color ret value new color float red float green float blue log fine color color get red color get green color get blue ret value get red ret value get green ret value get blue colorblind type color type return ret value colortype getdichromatcolor colortype colortype colortype colortype getred getgreen getblue rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix rgbtoxyzmatrix whitepoint whitepoint whitepoint whitepoint confusionpoints confusionpoints coloraxes coloraxes coloraxes coloraxes xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix xyztorgbmatrix retvalue getred getgreen getblue retvalue getred retvalue getgreen retvalue getblue colorblind_type colortype retvalue migrate download ur ls 2 5 2c param ctx context public static void migrate downloads properties ctx string sql select count from m productdownload int no db getsql value null sql if no 0 return int count 0 sql select ad client id ad org id m product id name downloadurl from m product where downloadurl is not null prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 int m product id rs get int 3 string name rs get string 4 string downloadurl rs get string 5 m product download pdl new m product download ctx 0 null pdl set client org ad client id ad org id pdl setm product id m product id pdl set name name pdl set downloadurl downloadurl if pdl save count string sql update update m product set downloadurl null where m product id m product id int updated db execute update sql update null if updated 1 s log warning product not updated else s log warning product download not created m product id m product id rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log info count urls migratedownloads m_productdownload getsqlvalue ad_client_id ad_org_id m_product_id m_product preparedstatement preparestatement resultset executequery ad_client_id getint ad_org_id getint m_product_id getint getstring getstring mproductdownload mproductdownload setclientorg ad_client_id ad_org_id setm_product_id m_product_id setname setdownloadurl sqlupdate m_product m_product_id m_product_id executeupdate sqlupdate s_log s_log m_product_id m_product_id s_log s_log standard constructor param ctx context param m productdownload id id param trx name trx public m product download properties ctx int m productdownload id string trx name super ctx m productdownload id trx name if m productdownload id 0 setm product id 0 set name null set downloadurl null m_productdownload_id trxname mproductdownload m_productdownload_id trxname m_productdownload_id trxname m_productdownload_id setm_product_id setname setdownloadurl load constructor param ctx context param rs result set param trx name trx public m product download properties ctx result set rs string trx name super ctx rs trx name trxname mproductdownload resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m product download append get id append m product id append getm product id append append get downloadurl append return sb to string tostring stringbuffer stringbuffer mproductdownload get_id m_product_id getm_product_id getdownloadurl tostring get download name return download name last part of name public string get download name string url get downloadurl if url null is active return null int pos math max url last index of url last index of if pos 1 return url substring pos 1 return url getdownloadname getdownloadurl isactive lastindexof lastindexof get download url param directory optional directory return url public url get downloadurl string directory string dl url get downloadurl if dl url null is active return null url url null try if dl url index of 1 url new url dl url else file f get download file directory if f null url f tourl catch exception ex log log level severe dl url ex return null return url getdownloadurl dl_url getdownloadurl dl_url isactive dl_url indexof dl_url getdownloadfile dl_url find download url param directory optional directory return file or null public file get download file string directory file file new file get downloadurl absolute file if file exists return file if directory null directory length 0 log log level severe not found get downloadurl return null string downloadurl2 directory if downloadurl2 ends with file separator downloadurl2 file separator downloadurl2 get downloadurl file new file downloadurl2 if file exists return file log log level severe not found get downloadurl downloadurl2 return null getdownloadfile getdownloadurl getdownloadurl endswith getdownloadurl getdownloadurl get download stream param directory optional directory return input stream public input stream get download stream string directory string dl url get downloadurl if dl url null is active return null input stream in null try if dl url index of 1 url url new url dl url in url open stream else file file file get download file directory if file null return null in new file input stream file catch exception ex log log level severe dl url ex return null return in inputstream getdownloadstream dl_url getdownloadurl dl_url isactive inputstream dl_url indexof dl_url openstream getdownloadfile fileinputstream dl_url web field param wsc session context param column name column param name label param description description param display type display type param field length field length param display length optional display length param long field if true spans 3 columns param read only read only param mandatory mandatory param error erro status param has dependents has dependent fields param has callout has callout functions public web field web session ctx wsc string column name string name string description int display type int field length int display length boolean long field boolean read only boolean mandatory boolean error boolean has dependents boolean has callout super m wsc wsc m columnname column name if name null name length 0 m name column name else m name name if description null description length 0 m description description m displaytype display type m fieldlength field length m displaylength display length if m displaylength 0 m displaylength 20 default length m longfield long field m readonly read only m mandatory mandatory m error error m hasdependents has dependents m hascallout has callout columnname displaytype fieldlength displaylength longfield readonly hasdependents hascallout webfield websessionctx columnname displaytype fieldlength displaylength longfield readonly hasdependents hascallout m_wsc m_columnname columnname m_name columnname m_name m_description m_displaytype displaytype m_fieldlength fieldlength m_displaylength displaylength m_displaylength m_displaylength m_longfield longfield m_readonly readonly m_mandatory m_error m_hasdependents hasdependents m_hascallout hascallout get the field label return label public td get label if m displaytype display type yes no return new td web env nbsp label my label new label m columnname f null util maskhtml m name my label setid m columnname l if m description null my label set title util maskhtml m description td td new td add element my label set align align type right setv align align type top return td getlabel m_displaytype displaytype yesno webenv mylabel m_columnname m_name mylabel m_columnname m_description mylabel settitle m_description addelement mylabel setalign aligntype setvalign aligntype create left top aligned td param element element return td table data private td createtd element element td td new td add element element set align align type left setv align align type top if m longfield td set col span 3 return td addelement setalign aligntype setvalign aligntype m_longfield setcolspan get field param lookup lookup param data data return field public td get field lookup lookup object data string data value data null data to string if m displaytype display type search m displaytype display type location m displaytype display type account string data display if lookup null data null data display lookup get display data return get popup field data display data value if display type is lookup m displaytype m displaytype display type locator return get select field lookup data value if m displaytype display type yes no return get check field data value if m displaytype display type button return get button field if display type is date m displaytype return get date field data else if display type is numeric m displaytype return get number field data strings if m displaytype display type text return get text field data value 3 else if m displaytype display type text long return get text field data value 10 else if m displaytype display type memo return get text field data value 15 return get string field data value getfield datavalue tostring m_displaytype displaytype m_displaytype displaytype m_displaytype displaytype datadisplay datadisplay getdisplay getpopupfield datadisplay datavalue displaytype islookup m_displaytype m_displaytype displaytype getselectfield datavalue m_displaytype displaytype yesno getcheckfield datavalue m_displaytype displaytype getbuttonfield displaytype isdate m_displaytype getdatefield displaytype isnumeric m_displaytype getnumberfield m_displaytype displaytype gettextfield datavalue m_displaytype displaytype textlong gettextfield datavalue m_displaytype displaytype gettextfield datavalue getstringfield datavalue create string field param data initial value return td private td get string field string data input string new input input type text m columnname util maskhtml data string setid m columnname f string set size m displaylength if m fieldlength 0 string set maxlength m fieldlength string set disabled m readonly if m error string set class c error else if m mandatory string set class c mandatory if m hasdependents m hascallout string set on change start update this string set on change dyn display return createtd string getstringfield type_text m_columnname m_columnname setsize m_displaylength m_fieldlength setmaxlength m_fieldlength setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate setonchange dyndisplay create text field param data initial value param rows no of rows return td private td get text field string data int rows textarea text new textarea m columnname rows m displaylength add element util maskhtml data text setid m columnname f text set disabled m readonly if m error text set class c error else if m mandatory text set class c mandatory if m hasdependents m hascallout text set on change start update this return createtd text gettextfield m_columnname m_displaylength addelement m_columnname setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate create date field param data initial value return td private td get date field object data string formatted data if data null else if m displaytype display type date time formatted data m wsc date time format format data else formatted data m wsc date format format data input string new input input type text m columnname formatted data string setid m columnname f string set size m displaylength if m fieldlength 0 string set maxlength m fieldlength string set disabled m readonly if m error string set class c error else if m mandatory string set class c mandatory if m hasdependents m hascallout string set on change start update this return createtd string getdatefield formatteddata m_displaytype displaytype datetime formatteddata m_wsc datetimeformat formatteddata m_wsc dateformat type_text m_columnname formatteddata m_columnname setsize m_displaylength m_fieldlength setmaxlength m_fieldlength setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate create number field param data initial value return td private td get number field object data string formatted data if data null else if m displaytype display type amount formatted data m wsc amount format format data else if m displaytype display type number m displaytype display type cost price formatted data m wsc number format format data else if m displaytype display type quantity formatted data m wsc quantity format format data else if m displaytype display type integer formatted data m wsc integer format format data else formatted data data to string input string new input input type text m columnname formatted data string setid m columnname f string set size m displaylength if m fieldlength 0 string set maxlength m fieldlength string set disabled m readonly if m error string set class c error else if m mandatory string set class c mandatory if m hasdependents m hascallout string set on change start update this return createtd string getnumberfield formatteddata m_displaytype displaytype formatteddata m_wsc amountformat m_displaytype displaytype m_displaytype displaytype costprice formatteddata m_wsc numberformat m_displaytype displaytype formatteddata m_wsc quantityformat m_displaytype displaytype formatteddata m_wsc integerformat formatteddata tostring type_text m_columnname formatteddata m_columnname setsize m_displaylength m_fieldlength setmaxlength m_fieldlength setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate create checkbox field param data initial value return td private td get check field string data boolean check data null data equals true data equals y input cb new input input type checkbox m columnname true set checked check add element m name cb setid m columnname f cb set disabled m readonly if m error cb set class c error else if m mandatory looks odd cb set class c mandatory if m hasdependents m hascallout cb set on change start update this return createtd cb getcheckfield type_checkbox m_columnname setchecked addelement m_name m_columnname setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate get popup field lookup location account param data display data to be displayed param data value data of value field return td private td get popup field string data display string data value the hidden data field name column name input hidden new input input type hidden m columnname data value hidden setid m columnname d the display field name column name id fcolumn name input display new input input type text m columnname util maskhtml data display display set size field get display length set maxlength field get field length display setid m columnname f display set read only true the button name column name id bcolumn name input button new input input type image m columnname x button setid m columnname b string gif pick open10 gif if m displaytype display type location gif location10 gif else if m displaytype display type account gif account10 gif else if m columnname equals c bpartner id gif b partner10 gif else if m columnname equals m product id gif product10 gif button set src web env get image directory gif button set border 1 if m displaytype display type location button set on click start location m columnname return false else if m displaytype display type account button set on click start account m columnname return false else button set on click start lookup m columnname return false if m error display set class c error else if m mandatory display set class c mandatory if m hasdependents m hascallout hidden set on change start update this display set on change start update this return createtd hidden add element display add element button datadisplay datavalue getpopupfield datadisplay datavalue columnname type_hidden m_columnname datavalue m_columnname columnname fcolumnname type_text m_columnname datadisplay setsize getdisplaylength setmaxlength getfieldlength m_columnname setreadonly columnname bcolumnname type_image m_columnname m_columnname pickopen10 m_displaytype displaytype m_displaytype displaytype m_columnname c_bpartner_id bpartner10 m_columnname m_product_id setsrc webenv getimagedirectory setborder m_displaytype displaytype setonclick startlocation m_columnname m_displaytype displaytype setonclick startaccount m_columnname setonclick startlookup m_columnname m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate setonchange startupdate addelement addelement get select field param lookup lookup param data value default value return selction td private td get select field lookup lookup string data value select sel new select m columnname get options lookup data value sel setid m columnname sel set disabled m readonly if m error sel set class c error else if m mandatory sel set class c mandatory if m hasdependents m hascallout sel set on change start update this return createtd sel datavalue getselectfield datavalue m_columnname getoptions datavalue m_columnname setdisabled m_readonly m_error setclass c_error m_mandatory setclass c_mandatory m_hasdependents m_hascallout setonchange startupdate get array of options param lookup lookup param data value default value return selction td private option get options lookup lookup string data value if lookup null return new option 0 object list lookup get data m mandatory true m readonly false to array if r o also inactive int size list length option options new option size for int i 0 i size i boolean is number list 0 instanceof key name pair string key null if m displaytype display type locator m locator loc m locator list i key string value of loc getm locator id string name util maskhtml loc get value options i new option key add element name else if is number key name pair p key name pair list i key string value of p get key string name util maskhtml p get name options i new option key add element name else value name pair p value name pair list i key p get value if key null key length 0 key string name p get name if name null name length 0 name name util maskhtml name options i new option key add element name if data value equals key options i set selected true return options datavalue getoptions datavalue getdata m_mandatory m_readonly toarray isnumber keynamepair m_displaytype displaytype mlocator mlocator valueof getm_locator_id getvalue addelement isnumber keynamepair keynamepair valueof getkey getname addelement valuenamepair valuenamepair getvalue getname addelement datavalue setselected get button field return button private td get button field input button new input input type button m columnname util maskhtml m name button setid m columnname button set disabled m readonly button set on click start button this return createtd button set align align type left overwrite getbuttonfield type_button m_columnname m_name m_columnname setdisabled m_readonly setonclick startbutton setalign aligntype get contsnts return contents public object get contents return contents getcontents create ok button with label text and f4 shortcut param text text return ok button public static final c button createok button string text apps action aa new apps action a ok key stroke get key stroke key event vk f4 0 text c button button c button aa get button button set margin s insets button set default capable true return button cbutton createokbutton appsaction appsaction a_ok keystroke getkeystroke keyevent vk_f4 cbutton cbutton getbutton setmargin s_insets setdefaultcapable create ok button with standard text param with text with text return ok button public static final c button createok button boolean with text if with text return createok button msg get msg env get ctx a ok return createok button withtext cbutton createokbutton withtext withtext createokbutton getmsg getctx a_ok createokbutton create cancel button wlth label text and register esc as key stroke param text text return cancel button public static final c button create cancel button string text apps action aa new apps action a cancel key stroke get key stroke key event vk escape 0 text c button button c button aa get button button set margin s insets return button keystroke cbutton createcancelbutton appsaction appsaction a_cancel keystroke getkeystroke keyevent vk_escape cbutton cbutton getbutton setmargin s_insets create cancel button wlth standard text param with text with text return button public static final c button create cancel button boolean with text if with text return create cancel button msg get msg env get ctx a cancel return create cancel button withtext cbutton createcancelbutton withtext withtext createcancelbutton getmsg getctx a_cancel createcancelbutton create refresh button wlth label text and f5 param text text return button public static final c button create refresh button string text apps action aa new apps action a refresh key stroke get key stroke key event vk f5 0 text c button button c button aa get button button set margin s insets return button cbutton createrefreshbutton appsaction appsaction a_refresh keystroke getkeystroke keyevent vk_f5 cbutton cbutton getbutton setmargin s_insets create refresh button wlth standard text param with text with text return button public static final c button create refresh button boolean with text if with text return create refresh button msg get msg env get ctx a refresh return create refresh button withtext cbutton createrefreshbutton withtext withtext createrefreshbutton getmsg getctx a_refresh createrefreshbutton create reset button wlth label text param text text return button public static final c button create reset button string text apps action aa new apps action a reset null text c button button c button aa get button button set margin s insets return button cbutton createresetbutton appsaction appsaction a_reset cbutton cbutton getbutton setmargin s_insets create reset button wlth standard text param with text with text return button public static final c button create reset button boolean with text if with text return create reset button msg get msg env get ctx a reset return create reset button null withtext cbutton createresetbutton withtext withtext createresetbutton getmsg getctx a_reset createresetbutton create customize button wlth label text param text text return button public static final c button create customize button string text apps action aa new apps action a customize null text c button button c button aa get button button set margin s insets return button env get image icon preference24 gif cbutton createcustomizebutton appsaction appsaction a_customize cbutton cbutton getbutton setmargin s_insets getimageicon create customize button wlth standard text param with text with text return button public static final c button create customize button boolean with text if with text return create customize button msg get msg env get ctx a customize return create customize button null withtext cbutton createcustomizebutton withtext withtext createcustomizebutton getmsg getctx a_customize createcustomizebutton create history button wlth label text param text text return button public static final c button create history button string text apps action aa new apps action a history key stroke get key stroke key event vk f9 0 text c button button c button aa get button button set margin s insets return button env get image icon historyx24 gif cbutton createhistorybutton appsaction appsaction a_history keystroke getkeystroke keyevent vk_f9 cbutton cbutton getbutton setmargin s_insets getimageicon create history button wlth standard text param with text with text return button public static final c button create history button boolean with text if with text return create history button msg get msg env get ctx a history return create history button null withtext cbutton createhistorybutton withtext withtext createhistorybutton getmsg getctx a_history createhistorybutton create zoom button wlth label text param text text return button public static final c button create zoom button string text apps action aa new apps action a zoom null text c button button c button aa get button button set margin s insets return button cbutton createzoombutton appsaction appsaction a_zoom cbutton cbutton getbutton setmargin s_insets create zoom button wlth standard text param with text with text return button public static final c button create zoom button boolean with text if with text return create zoom button msg get msg env get ctx a zoom return create zoom button null withtext cbutton createzoombutton withtext withtext createzoombutton getmsg getctx a_zoom createzoombutton create process button wlth label text shift f4 param text text return button public static final c button create process button string text apps action aa new apps action a process key stroke get key stroke key event vk f4 key event shift mask text c button button c button aa get button button set margin s insets return button cbutton createprocessbutton appsaction appsaction a_process keystroke getkeystroke keyevent vk_f4 keyevent shift_mask cbutton cbutton getbutton setmargin s_insets create process button wlth standard text param with text with text return button public static final c button create process button boolean with text if with text return create process button msg get msg env get ctx a process return create process button null withtext cbutton createprocessbutton withtext withtext createprocessbutton getmsg getctx a_process createprocessbutton create print button wlth label text param text text return button public static final c button create print button string text apps action aa new apps action a print key stroke get key stroke key event vk f12 0 text c button button c button aa get button button set margin s insets return button cbutton createprintbutton appsaction appsaction a_print keystroke getkeystroke keyevent vk_f12 cbutton cbutton getbutton setmargin s_insets create print button wlth standard text param with text with text return button public static final c button create print button boolean with text if with text return create print button msg get msg env get ctx a print return create print button null withtext cbutton createprintbutton withtext withtext createprintbutton getmsg getctx a_print createprintbutton create help button wlth label text param text text return button public static final c button create help button string text apps action aa new apps action a help key stroke get key stroke key event vk f1 0 text c button button c button aa get button button set margin s insets return button cbutton createhelpbutton appsaction appsaction a_help keystroke getkeystroke keyevent vk_f1 cbutton cbutton getbutton setmargin s_insets create help button wlth standard text param with text with text return button public static final c button create help button boolean with text if with text return create help button msg get msg env get ctx a help return create help button null withtext cbutton createhelpbutton withtext withtext createhelpbutton getmsg getctx a_help createhelpbutton create export button wlth label text param text text return button public static final c button create export button string text apps action aa new apps action a export null text c button button c button aa get button button set margin s insets return button cbutton createexportbutton appsaction appsaction a_export cbutton cbutton getbutton setmargin s_insets create export button wlth standard text param with text with text return button public static final c button create export button boolean with text if with text return create export button msg get msg env get ctx a export return create export button null withtext cbutton createexportbutton withtext withtext createexportbutton getmsg getctx a_export createexportbutton create delete button with label text f3 param text text return delete button public static final c button create delete button string text apps action aa new apps action a delete key stroke get key stroke key event vk f3 0 text c button button c button aa get button button set margin s insets return button cbutton createdeletebutton appsaction appsaction a_delete keystroke getkeystroke keyevent vk_f3 cbutton cbutton getbutton setmargin s_insets create delete button with standard text param with text with text return delete button public static final c button create delete button boolean with text if with text return create delete button msg get msg env get ctx a delete return create delete button null withtext cbutton createdeletebutton withtext withtext createdeletebutton getmsg getctx a_delete createdeletebutton create product attribute button with standard text param with text with text return product attribute button public static final c button createp attribute button boolean with text if with text return createp attribute button msg get msg env get ctx a pattribute return createp attribute button null withtext cbutton createpattributebutton withtext withtext createpattributebutton getmsg getctx a_pattribute createpattributebutton create product attribute button with label text param text text return product attribute button public static final c button createp attribute button string text apps action aa new apps action a pattribute null text c button button c button aa get button button set margin s insets return button cbutton createpattributebutton appsaction appsaction a_pattribute cbutton cbutton getbutton setmargin s_insets create new button with standard text param with text with text return new button public static final c button create new button boolean with text if with text return create new button msg get msg env get ctx a new return create new button null withtext cbutton createnewbutton withtext withtext createnewbutton getmsg getctx a_new createnewbutton create new button with label text f2 param text text return product attribute button public static final c button create new button string text apps action aa new apps action a new key stroke get key stroke key event vk f2 0 text c button button c button aa get button button set margin s insets return button cbutton createnewbutton appsaction appsaction a_new keystroke getkeystroke keyevent vk_f2 cbutton cbutton getbutton setmargin s_insets create confirmation panel with ok button public confirm panel this false false false false false false true confirmpanel create confirmation panel with ok and cancel button param with cancel button with cancel public confirm panel boolean with cancel button this with cancel button false false false false false true withcancelbutton confirmpanel withcancelbutton withcancelbutton create confirmation panel with different buttons param with cancel button with cancel param with refresh button with refresh param with reset button with reset param with customize button with customize param with history button with history param with zoom button with zoom param with text with text public confirm panel boolean with cancel button boolean with refresh button boolean with reset button boolean with customize button boolean with history button boolean with zoom button boolean with text super border layout main layout new border layout this set layout main layout this set name confirm panel c panel ok cancel new c panel new flow layout flow layout right ok cancel set opaque false b cancel create cancel button with text ok cancel add b cancel bok createok button with text ok cancel add bok set cancel visible with cancel button this add ok cancel border layout east if with refresh button b refresh create refresh button with text add component b refresh if with reset button b reset create reset button with text add component b reset if with customize button b customize create customize button with text add component b customize if with history button b history create history button with text add component b history if with zoom button b zoom create zoom button with text add component b zoom withcancelbutton withrefreshbutton withresetbutton withcustomizebutton withhistorybutton withzoombutton withtext confirmpanel withcancelbutton withrefreshbutton withresetbutton withcustomizebutton withhistorybutton withzoombutton withtext borderlayout mainlayout borderlayout setlayout mainlayout setname confirmpanel cpanel okcancel cpanel flowlayout flowlayout okcancel setopaque bcancel createcancelbutton withtext okcancel bcancel createokbutton withtext okcancel setcancelvisible withcancelbutton okcancel borderlayout withrefreshbutton brefresh createrefreshbutton withtext addcomponent brefresh withresetbutton breset createresetbutton withtext addcomponent breset withcustomizebutton bcustomize createcustomizebutton withtext addcomponent bcustomize withhistorybutton bhistory createhistorybutton withtext addcomponent bhistory withzoombutton bzoom createzoombutton withtext addcomponent bzoom add button to left side of confirm panel param button button public void add component component button if m addlbuttons null m addlbuttons new c panel new flow layout flow layout left this add m addlbuttons border layout west m addlbuttons add button confirmpanel addcomponent m_addlbuttons m_addlbuttons cpanel flowlayout flowlayout m_addlbuttons borderlayout m_addlbuttons add button to left side of confirm panel param action action command param tool tip text tool tip text param icon icon return j button public c button add button string action string tool tip text icon icon apps action aa new apps action action null tool tip text c button b c button aa get button new dialog button action tool tip text icon add component b return b confirmpanel tooltiptext jbutton cbutton addbutton tooltiptext appsaction appsaction tooltiptext cbutton cbutton getbutton dialogbutton tooltiptext addcomponent add button to left side of confirm panel param button button return j button public j button add button j button button add component button return button confirmpanel jbutton jbutton addbutton jbutton addcomponent get ok button return ok button public c button getok button return bok cbutton getokbutton get cancel button return cancel button public c button get cancel button return b cancel cbutton getcancelbutton bcancel show ok button param value true for visible public void setok visible boolean value bok set visible value bok set enabled value setokvisible setvisible setenabled is ok visible return true of ok visisble public boolean isok visible return bok is visible isokvisible isvisible show cancel button param value trie for visible public void set cancel visible boolean value b cancel set visible value b cancel set enabled value setcancelvisible bcancel setvisible bcancel setenabled is cancel visible return true if canvel is visible public boolean is cancel visible return b cancel is visible iscancelvisible bcancel isvisible get reset button return button public c button get reset button return b reset cbutton getresetbutton breset get customize button return button public c button get customize button return b customize cbutton getcustomizebutton bcustomize get history button return button public c button get history button return b history cbutton gethistorybutton bhistory get zoom button return button public c button get zoom button return b zoom cbutton getzoombutton bzoom get refresh button return button public c button get refresh button return b refresh cbutton getrefreshbutton brefresh add action listener code if e get action command equals confirm panel a ok code param al listener public void add action listener action listener al apps action bok get action set delegate al apps action b cancel get action set delegate al if b refresh null apps action b refresh get action set delegate al if b reset null apps action b reset get action set delegate al if b customize null apps action b customize get action set delegate al if b history null apps action b history get action set delegate al if b zoom null apps action b zoom get action set delegate al set ok as default button j root pane rootpane null if al instanceof j dialog rootpane j dialog al get root pane else if al instanceof j frame rootpane j frame al get root pane if rootpane null rootpane set default button bok getactioncommand confirmpanel a_ok addactionlistener actionlistener appsaction getaction setdelegate appsaction bcancel getaction setdelegate brefresh appsaction brefresh getaction setdelegate breset appsaction breset getaction setdelegate bcustomize appsaction bcustomize getaction setdelegate bhistory appsaction bhistory getaction setdelegate bzoom appsaction bzoom getaction setdelegate jrootpane jdialog jdialog getrootpane jframe jframe getrootpane setdefaultbutton enable all components param enabled trie if enabled public void set enabled boolean enabled super set enabled enabled bok set enabled enabled b cancel set enabled enabled if b refresh null b refresh set enabled enabled if b customize null b customize set enabled enabled if b history null b history set enabled enabled if b zoom null b zoom set enabled enabled setenabled setenabled setenabled bcancel setenabled brefresh brefresh setenabled bcustomize bcustomize setenabled bhistory bhistory setenabled bzoom bzoom setenabled standard constructor public x ad treebar properties ctx int ad treebar id string trx name super ctx ad treebar id trx name if ad treebar id 0 setad tree id 0 setad user id 0 setnode id 0 x_ad_treebar ad_treebar_id trxname ad_treebar_id trxname ad_treebar_id setad_tree_id setad_user_id setnode_id load constructor public x ad treebar properties ctx result set rs string trx name super ctx rs trx name x_ad_treebar resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad treebar append get id append return sb to string tostring stringbuffer stringbuffer x_ad_treebar get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set node id public void setnode id int node id if node id 0 throw new illegal argument exception node id is mandatory set value node id new integer node id node_id setnode_id node_id node_id illegalargumentexception node_id set_value node_id node_id get node id public int getnode id integer ii integer get value node id if ii null return 0 return ii int value node_id getnode_id get_value node_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getnode id intvalue keynamepair getkeynamepair keynamepair get_id valueof getnode_id standard constructor param ctx context param c elementvalue id id or 0 for new public m element value properties ctx int c elementvalue id string trx name super ctx c elementvalue id trx name if c elementvalue id 0 setc element id 0 parent set name null set value null set is summary false set account sign accountsign natural set account type accounttype expense set is doc controlled false set is foreign currency false set is bank account false set post actual true set post budget true set post encumbrance true set post statistical true c_elementvalue_id melementvalue c_elementvalue_id trxname c_elementvalue_id trxname c_elementvalue_id setc_element_id setname setvalue setissummary setaccountsign accountsign_natural setaccounttype accounttype_expense setisdoccontrolled setisforeigncurrency setisbankaccount setpostactual setpostbudget setpostencumbrance setpoststatistical load constructor param ctx context param rs result set public m element value properties ctx result set rs string trx name super ctx rs trx name melementvalue resultset trxname trxname full constructor param ctx context param value value param name name param description description param account type account type param account sign account sign param is doc controlled doc controlled param is summary summary public m element value properties ctx string value string name string description string account type string account sign boolean is doc controlled boolean is summary string trx name this ctx 0 trx name set value value set name name set description description set account type account type set account sign account sign set is doc controlled is doc controlled set is summary is summary accounttype accountsign isdoccontrolled issummary melementvalue accounttype accountsign isdoccontrolled issummary trxname trxname setvalue setname setdescription setaccounttype accounttype setaccountsign accountsign setisdoccontrolled isdoccontrolled setissummary issummary import constructor param imp import public m element value x i elementvalue imp this imp get ctx 0 imp get trxname set client org imp set imp melementvalue x_i_elementvalue getctx get_trxname setclientorg set update settings from import param imp import public void set x i elementvalue imp set value imp get value set name imp get name set description imp get description set account type imp get account type set account sign imp get account sign set is summary imp is summary set is doc controlled imp is doc controlled setc element id imp getc element id set post actual imp is post actual set post budget imp is post budget set post encumbrance imp is post encumbrance set post statistical imp is post statistical setc bankaccount id imp getc bankaccount id set is foreign currency imp is foreign currency setc currency id imp getc currency id set is bank account imp is is bank account set valid from null set valid to null x_i_elementvalue setvalue getvalue setname getname setdescription getdescription setaccounttype getaccounttype setaccountsign getaccountsign setissummary issummary setisdoccontrolled isdoccontrolled setc_element_id getc_element_id setpostactual ispostactual setpostbudget ispostbudget setpostencumbrance ispostencumbrance setpoststatistical ispoststatistical setc_bankaccount_id getc_bankaccount_id setisforeigncurrency isforeigncurrency setc_currency_id getc_currency_id setisbankaccount isisbankaccount setvalidfrom setvalidto is this a balance sheet account return boolean public boolean is balance sheet string account type get account type return accounttype asset equals account type accounttype liability equals account type accounttype ownersequity equals account type isbalancesheet accounttype getaccounttype accounttype_asset accounttype accounttype_liability accounttype accounttype_ownersequity accounttype is this an activa account return boolean public boolean is activa return accounttype asset equals get account type isactiva accounttype_asset getaccounttype is this a passiva account return boolean public boolean is passiva string account type get account type return accounttype liability equals account type accounttype ownersequity equals account type ispassiva accounttype getaccounttype accounttype_liability accounttype accounttype_ownersequity accounttype user string representation return info value name public string to string string buffer sb new string buffer sb append get value append append get name return sb to string tostring stringbuffer stringbuffer getvalue getname tostring extended string representation return info public string to stringx string buffer sb new string buffer m element value sb append get id append append get value append append get name append return sb to string tostringx stringbuffer stringbuffer melementvalue get_id getvalue getname tostring before save param new record return true if ir can be saved protected boolean before save boolean new record if getad org id 0 setad org id 0 if new record is summary is valuechanged is summary string sql select count from fact acct where account id int no db getsql value get trxname sql getc elementvalue id if no 0 log save error error already posted to return false return true newrecord beforesave newrecord getad_org_id setad_org_id newrecord issummary is_valuechanged issummary fact_acct account_id getsqlvalue get_trxname getc_elementvalue_id saveerror after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record insert tree mtree base treetype elementvalue getc element id value name change if new record is valuechanged value is valuechanged name m account update value description get ctx account id getc elementvalue id get trxname if y equals env get context get ctx element u1 m account update value description get ctx user1 id getc elementvalue id get trxname if y equals env get context get ctx element u2 m account update value description get ctx user2 id getc elementvalue id get trxname return success newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_elementvalue getc_element_id newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx account_id getc_elementvalue_id get_trxname getcontext getctx element_u1 maccount updatevaluedescription getctx user1_id getc_elementvalue_id get_trxname getcontext getctx element_u2 maccount updatevaluedescription getctx user2_id getc_elementvalue_id get_trxname after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype elementvalue return success afterdelete delete_tree mtree_base treetype_elementvalue standard constructor public x m changerequest properties ctx int m changerequest id string trx name super ctx m changerequest id trx name if m changerequest id 0 set document no null set is approved false n setm changerequest id 0 set name null set processed false x_m_changerequest m_changerequest_id trxname m_changerequest_id trxname m_changerequest_id setdocumentno setisapproved setm_changerequest_id setname setprocessed load constructor public x m changerequest properties ctx result set rs string trx name super ctx rs trx name x_m_changerequest resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m changerequest append get id append return sb to string tostring stringbuffer stringbuffer x_m_changerequest get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set detail information additional detail information public void set detail info string detail info if detail info null detail info length 4000 log warning length 4000 truncated detail info detail info substring 0 3999 set value detail info detail info setdetailinfo detailinfo detailinfo detailinfo detailinfo detailinfo set_value detailinfo detailinfo get detail information additional detail information public string get detail info return string get value detail info getdetailinfo get_value detailinfo set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set bom bill of material public void setm bom id int m bom id if m bom id 0 set valuenocheck m bom id null else set valuenocheck m bom id new integer m bom id setm_bom_id m_bom_id m_bom_id set_valuenocheck m_bom_id set_valuenocheck m_bom_id m_bom_id get bom bill of material public int getm bom id integer ii integer get value m bom id if ii null return 0 return ii int value getm_bom_id get_value m_bom_id intvalue set change notice bill of materials engineering change notice version public void setm changenotice id int m changenotice id if m changenotice id 0 set valuenocheck m changenotice id null else set valuenocheck m changenotice id new integer m changenotice id setm_changenotice_id m_changenotice_id m_changenotice_id set_valuenocheck m_changenotice_id set_valuenocheck m_changenotice_id m_changenotice_id get change notice bill of materials engineering change notice version public int getm changenotice id integer ii integer get value m changenotice id if ii null return 0 return ii int value getm_changenotice_id get_value m_changenotice_id intvalue set change request bom engineering change request public void setm changerequest id int m changerequest id if m changerequest id 1 throw new illegal argument exception m changerequest id is mandatory set valuenocheck m changerequest id new integer m changerequest id setm_changerequest_id m_changerequest_id m_changerequest_id illegalargumentexception m_changerequest_id set_valuenocheck m_changerequest_id m_changerequest_id get change request bom engineering change request public int getm changerequest id integer ii integer get value m changerequest id if ii null return 0 return ii int value getm_changerequest_id get_value m_changerequest_id intvalue public static final int m fixchangenotice id ad reference id 351 set fixed in fixed in change notice public void setm fixchangenotice id int m fixchangenotice id if m fixchangenotice id 0 set valuenocheck m fixchangenotice id null else set valuenocheck m fixchangenotice id new integer m fixchangenotice id m_fixchangenotice_id_ad_reference_id setm_fixchangenotice_id m_fixchangenotice_id m_fixchangenotice_id set_valuenocheck m_fixchangenotice_id set_valuenocheck m_fixchangenotice_id m_fixchangenotice_id get fixed in fixed in change notice public int getm fixchangenotice id integer ii integer get value m fixchangenotice id if ii null return 0 return ii int value getm_fixchangenotice_id get_value m_fixchangenotice_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue standard constructor public x ad tab properties ctx int ad tab id string trx name super ctx ad tab id trx name if ad tab id 0 setad tab id 0 setad table id 0 setad window id 0 set entity type null u set has tree false set is advanced tab false n set is insert record true y set is read only false set is single row false set is sort tab false n set is translation tab false set name null set seq no 0 sql select coalesce max seq no 0 10 as default value from ad tab where ad window id ad window id set tab level 0 x_ad_tab ad_tab_id trxname ad_tab_id trxname ad_tab_id setad_tab_id setad_table_id setad_window_id setentitytype sethastree setisadvancedtab setisinsertrecord setisreadonly setissinglerow setissorttab setistranslationtab setname setseqno seqno defaultvalue ad_tab ad_window_id ad_window_id settablevel load constructor public x ad tab properties ctx result set rs string trx name super ctx rs trx name x_ad_tab resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad tab append get id append return sb to string tostring stringbuffer stringbuffer x_ad_tab get_id tostring public static final int ad columnsortorder id ad reference id 257 set order column column determining the order public void setad columnsortorder id int ad columnsortorder id if ad columnsortorder id 0 set value ad columnsortorder id null else set value ad columnsortorder id new integer ad columnsortorder id ad_columnsortorder_id_ad_reference_id setad_columnsortorder_id ad_columnsortorder_id ad_columnsortorder_id set_value ad_columnsortorder_id set_value ad_columnsortorder_id ad_columnsortorder_id get order column column determining the order public int getad columnsortorder id integer ii integer get value ad columnsortorder id if ii null return 0 return ii int value getad_columnsortorder_id get_value ad_columnsortorder_id intvalue public static final int ad columnsortyesno id ad reference id 258 set included column column determining if a table column is included in ordering public void setad columnsortyesno id int ad columnsortyesno id if ad columnsortyesno id 0 set value ad columnsortyesno id null else set value ad columnsortyesno id new integer ad columnsortyesno id ad_columnsortyesno_id_ad_reference_id setad_columnsortyesno_id ad_columnsortyesno_id ad_columnsortyesno_id set_value ad_columnsortyesno_id set_value ad_columnsortyesno_id ad_columnsortyesno_id get included column column determining if a table column is included in ordering public int getad columnsortyesno id integer ii integer get value ad columnsortyesno id if ii null return 0 return ii int value getad_columnsortyesno_id get_value ad_columnsortyesno_id intvalue set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set image system image or icon public void setad image id int ad image id if ad image id 0 set value ad image id null else set value ad image id new integer ad image id setad_image_id ad_image_id ad_image_id set_value ad_image_id set_value ad_image_id ad_image_id get image system image or icon public int getad image id integer ii integer get value ad image id if ii null return 0 return ii int value getad_image_id get_value ad_image_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set tab tab within a window public void setad tab id int ad tab id if ad tab id 1 throw new illegal argument exception ad tab id is mandatory set valuenocheck ad tab id new integer ad tab id setad_tab_id ad_tab_id ad_tab_id illegalargumentexception ad_tab_id set_valuenocheck ad_tab_id ad_tab_id get tab tab within a window public int getad tab id integer ii integer get value ad tab id if ii null return 0 return ii int value getad_tab_id get_value ad_tab_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 1 throw new illegal argument exception ad window id is mandatory set valuenocheck ad window id new integer ad window id setad_window_id ad_window_id ad_window_id illegalargumentexception ad_window_id set_valuenocheck ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set commit warning warning displayed when saving public void set commit warning string commit warning if commit warning null commit warning length 2000 log warning length 2000 truncated commit warning commit warning substring 0 1999 set value commit warning commit warning setcommitwarning commitwarning commitwarning commitwarning commitwarning commitwarning set_value commitwarning commitwarning get commit warning warning displayed when saving public string get commit warning return string get value commit warning getcommitwarning get_value commitwarning set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set display logic if the field is displayed the result determines if the field is actually displayed public void set display logic string display logic if display logic null display logic length 2000 log warning length 2000 truncated display logic display logic substring 0 1999 set value display logic display logic setdisplaylogic displaylogic displaylogic displaylogic displaylogic displaylogic set_value displaylogic displaylogic get display logic if the field is displayed the result determines if the field is actually displayed public string get display logic return string get value display logic getdisplaylogic get_value displaylogic public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set has tree window has tree graph public void set has tree boolean has tree set value has tree new boolean has tree sethastree hastree set_value hastree hastree get has tree window has tree graph public boolean is has tree object oo get value has tree if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishastree get_value hastree booleanvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set import fields create fields from table columns public void set import fields string import fields if import fields null import fields length 1 log warning length 1 truncated import fields import fields substring 0 0 set value import fields import fields setimportfields importfields importfields importfields importfields importfields set_value importfields importfields get import fields create fields from table columns public string get import fields return string get value import fields getimportfields get_value importfields public static final int included tab id ad reference id 278 set included tab included tab in this tab master dateail public void setincluded tab id int included tab id if included tab id 0 set value included tab id null else set value included tab id new integer included tab id included_tab_id_ad_reference_id setincluded_tab_id included_tab_id included_tab_id set_value included_tab_id set_value included_tab_id included_tab_id get included tab included tab in this tab master dateail public int getincluded tab id integer ii integer get value included tab id if ii null return 0 return ii int value getincluded_tab_id get_value included_tab_id intvalue set advanced tab this tab contains advanced functionality public void set is advanced tab boolean is advanced tab set value is advanced tab new boolean is advanced tab setisadvancedtab isadvancedtab set_value isadvancedtab isadvancedtab get advanced tab this tab contains advanced functionality public boolean is advanced tab object oo get value is advanced tab if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isadvancedtab get_value isadvancedtab booleanvalue set accounting tab this tab contains accounting information public void set is info tab boolean is info tab set value is info tab new boolean is info tab setisinfotab isinfotab set_value isinfotab isinfotab get accounting tab this tab contains accounting information public boolean is info tab object oo get value is info tab if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinfotab get_value isinfotab booleanvalue set insert record the user can insert a new record public void set is insert record boolean is insert record set value is insert record new boolean is insert record setisinsertrecord isinsertrecord set_value isinsertrecord isinsertrecord get insert record the user can insert a new record public boolean is insert record object oo get value is insert record if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinsertrecord get_value isinsertrecord booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set single row layout default for toggle between single and multi row grid layout public void set is single row boolean is single row set value is single row new boolean is single row setissinglerow issinglerow set_value issinglerow issinglerow get single row layout default for toggle between single and multi row grid layout public boolean is single row object oo get value is single row if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issinglerow get_value issinglerow booleanvalue set order tab the tab determines the order public void set is sort tab boolean is sort tab set value is sort tab new boolean is sort tab setissorttab issorttab set_value issorttab issorttab get order tab the tab determines the order public boolean is sort tab object oo get value is sort tab if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issorttab get_value issorttab booleanvalue set translation tab this tab contains translation information public void set is translation tab boolean is translation tab set value is translation tab new boolean is translation tab translationtab setistranslationtab istranslationtab set_value istranslationtab istranslationtab get translation tab this tab contains translation information public boolean is translation tab object oo get value is translation tab if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false translationtab istranslationtab get_value istranslationtab booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sql order by fully qualified order by clause public void set order by clause string order by clause if order by clause null order by clause length 2000 log warning length 2000 truncated order by clause order by clause substring 0 1999 set value order by clause order by clause setorderbyclause orderbyclause orderbyclause orderbyclause orderbyclause orderbyclause set_value orderbyclause orderbyclause get sql order by fully qualified order by clause public string get order by clause return string get value order by clause getorderbyclause get_value orderbyclause set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set read only logic logic to determine if field is read only applies only when field is read write public void set read only logic string read only logic if read only logic null read only logic length 2000 log warning length 2000 truncated read only logic read only logic substring 0 1999 set value read only logic read only logic setreadonlylogic readonlylogic readonlylogic readonlylogic readonlylogic readonlylogic set_value readonlylogic readonlylogic get read only logic logic to determine if field is read only applies only when field is read write public string get read only logic return string get value read only logic getreadonlylogic get_value readonlylogic set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set tab level hierarchical tab level 0 top public void set tab level int tab level set value tab level new integer tab level settablevel tablevel set_value tablevel tablevel get tab level hierarchical tab level 0 top public int get tab level integer ii integer get value tab level if ii null return 0 return ii int value gettablevel get_value tablevel intvalue set sql where fully qualified sql where clause public void set where clause string where clause if where clause null where clause length 2000 log warning length 2000 truncated where clause where clause substring 0 1999 set value where clause where clause setwhereclause whereclause whereclause whereclause whereclause whereclause set_value whereclause whereclause get sql where fully qualified sql where clause public string get where clause return string get value where clause getwhereclause get_value whereclause basic constructor you need to set the attributes using the set methods public h2 use the set methods to set the values of the attributes param value set the value of lt h2 gt value lt h2 gt public h2 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h1 gt value lt h1 gt public h2 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h2 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h2 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry public h2 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h2 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h2 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x ad session properties ctx int ad session id string trx name super ctx ad session id trx name if ad session id 0 setad session id 0 set processed false x_ad_session ad_session_id trxname ad_session_id trxname ad_session_id setad_session_id setprocessed load constructor public x ad session properties ctx result set rs string trx name super ctx rs trx name x_ad_session resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad session append get id append return sb to string tostring stringbuffer stringbuffer x_ad_session get_id tostring set session user session online or web public void setad session id int ad session id if ad session id 1 throw new illegal argument exception ad session id is mandatory set valuenocheck ad session id new integer ad session id setad_session_id ad_session_id ad_session_id illegalargumentexception ad_session_id set_valuenocheck ad_session_id ad_session_id get session user session online or web public int getad session id integer ii integer get value ad session id if ii null return 0 return ii int value getad_session_id get_value ad_session_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad session id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_session_id set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set valuenocheck remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_valuenocheck remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set valuenocheck remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_valuenocheck remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set web session web session id public void set web session string web session if web session null web session length 40 log warning length 40 truncated web session web session substring 0 39 set valuenocheck web session web session setwebsession websession websession websession websession websession set_valuenocheck websession websession get web session web session id public string get web session return string get value web session getwebsession get_value websession constructor sort entity param new index index param new data data public m sort int new index object new data index new index data new data new_index new_data msort new_index new_data new_index new_data sort ascending param ascending if true sort ascending public void set sort asc boolean ascending if ascending m multiplier 1 else m multiplier 1 setsortasc m_multiplier m_multiplier compare data of two entities param o1 object param o2 object return comparator public int compare object o1 object o2 get objects to compare object cmp1 null if o1 instanceof m sort cmp1 m sort o1 data if cmp1 instanceof name pair cmp1 name pair cmp1 get name object cmp2 o2 if o2 instanceof m sort cmp2 m sort o2 data if cmp2 instanceof name pair cmp2 name pair cmp2 get name comparing null values if cmp1 null cmp1 new string if cmp2 null cmp2 new string compare different data types string if cmp1 instanceof string cmp1 instanceof string string s string cmp1 return s compare to string cmp2 m multiplier date else if cmp1 instanceof timestamp cmp2 instanceof timestamp timestamp t timestamp cmp1 return t compare to timestamp cmp2 m multiplier big decimal else if cmp1 instanceof big decimal cmp2 instanceof big decimal big decimal d big decimal cmp1 return d compare to big decimal cmp2 m multiplier integer else if cmp1 instanceof integer cmp2 instanceof integer integer d integer cmp1 return d compare to integer cmp2 m multiplier string value string s cmp1 to string return s compare to cmp2 to string m multiplier msort msort namepair namepair getname msort msort namepair namepair getname compareto m_multiplier compareto m_multiplier bigdecimal bigdecimal bigdecimal bigdecimal bigdecimal compareto bigdecimal m_multiplier compareto m_multiplier tostring compareto tostring m_multiplier equal based on data ignores index param obj object return true if equal public boolean equals object obj if obj instanceof m sort m sort ms m sort obj if data ms data return true return false msort msort msort string representation return info public string to string string buffer sb new string buffer m sort sb append index append index append data append data sb append return sb to string tostring stringbuffer stringbuffer msort tostring get contents return contents public object get contents return contents getcontents standard constructor public x c rfq topicsubscriberonly properties ctx int c rfq topicsubscriberonly id string trx name super ctx c rfq topicsubscriberonly id trx name if c rfq topicsubscriberonly id 0 setc rfq topicsubscriberonly id 0 setc rfq topicsubscriber id 0 x_c_rfq_topicsubscriberonly c_rfq_topicsubscriberonly_id trxname c_rfq_topicsubscriberonly_id trxname c_rfq_topicsubscriberonly_id setc_rfq_topicsubscriberonly_id setc_rfq_topicsubscriber_id load constructor public x c rfq topicsubscriberonly properties ctx result set rs string trx name super ctx rs trx name x_c_rfq_topicsubscriberonly resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfq topicsubscriberonly append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfq_topicsubscriberonly get_id tostring set rfq topic subscriber restriction include subscriber only for certain products or product categories public void setc rfq topicsubscriberonly id int c rfq topicsubscriberonly id if c rfq topicsubscriberonly id 1 throw new illegal argument exception c rfq topicsubscriberonly id is mandatory set valuenocheck c rfq topicsubscriberonly id new integer c rfq topicsubscriberonly id setc_rfq_topicsubscriberonly_id c_rfq_topicsubscriberonly_id c_rfq_topicsubscriberonly_id illegalargumentexception c_rfq_topicsubscriberonly_id set_valuenocheck c_rfq_topicsubscriberonly_id c_rfq_topicsubscriberonly_id get rfq topic subscriber restriction include subscriber only for certain products or product categories public int getc rfq topicsubscriberonly id integer ii integer get value c rfq topicsubscriberonly id if ii null return 0 return ii int value getc_rfq_topicsubscriberonly_id get_value c_rfq_topicsubscriberonly_id intvalue set rfq subscriber request for quotation topic subscriber public void setc rfq topicsubscriber id int c rfq topicsubscriber id if c rfq topicsubscriber id 1 throw new illegal argument exception c rfq topicsubscriber id is mandatory set valuenocheck c rfq topicsubscriber id new integer c rfq topicsubscriber id setc_rfq_topicsubscriber_id c_rfq_topicsubscriber_id c_rfq_topicsubscriber_id illegalargumentexception c_rfq_topicsubscriber_id set_valuenocheck c_rfq_topicsubscriber_id c_rfq_topicsubscriber_id get rfq subscriber request for quotation topic subscriber public int getc rfq topicsubscriber id integer ii integer get value c rfq topicsubscriber id if ii null return 0 return ii int value getc_rfq_topicsubscriber_id get_value c_rfq_topicsubscriber_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm product category id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_product_category_id set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue get m cash book from cache param ctx context param c cashbook id id return m cash book public static m cash book get properties ctx int c cashbook id integer key new integer c cashbook id m cash book ret value m cash book s cache get key if ret value null return ret value ret value new m cash book ctx c cashbook id null if ret value get id 0 s cache put key ret value return ret value mcashbook c_cashbook_id mcashbook mcashbook c_cashbook_id c_cashbook_id mcashbook retvalue mcashbook s_cache retvalue retvalue retvalue mcashbook c_cashbook_id retvalue get_id s_cache retvalue retvalue get cash book for org and currency param ctx context param ad org id org param c currency id currency return cash book or null public static m cash book get properties ctx int ad org id int c currency id try from cache iterator it s cache values iterator while it has next m cash book cb m cash book it next if cb getad org id ad org id cb getc currency id c currency id return cb get from db m cash book ret value null string sql select from c cashbook where ad org id and c currency id order by is default desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad org id pstmt set int 2 c currency id result set rs pstmt execute query if rs next ret value new m cash book ctx rs null integer key new integer ret value getc cashbook id s cache put key ret value rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value cashbook ad_org_id c_currency_id mcashbook ad_org_id c_currency_id s_cache hasnext mcashbook mcashbook getad_org_id ad_org_id getc_currency_id c_currency_id mcashbook retvalue c_cashbook ad_org_id c_currency_id isdefault preparedstatement preparestatement setint ad_org_id setint c_currency_id resultset executequery retvalue mcashbook retvalue getc_cashbook_id s_cache retvalue s_log retvalue standard constructor param ctx context param c cashbook id id public m cash book properties ctx int c cashbook id string trx name super ctx c cashbook id trx name c_cashbook_id mcashbook c_cashbook_id trxname c_cashbook_id trxname load constructor param ctx context param rs result set public m cash book properties ctx result set rs string trx name super ctx rs trx name mcashbook resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting c cashbook acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_cashbook_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c cashbook acct beforedelete delete_accounting c_cashbook_acct hash checksum number param key key return checksum number public static int hash string key long table size 2147483647 one less than max int long hash value 0 for int i 0 i key length i hash value 37 hash value key char at i 31 hash value table size if hash value 0 hash value table size int ret value int hash value return ret value tablesize hashvalue hashvalue hashvalue charat hashvalue tablesize hashvalue hashvalue tablesize retvalue hashvalue retvalue convert byte array to hex string param bytes bytes return hex string public static string convert to hex string byte bytes see also util to hex int size bytes length string buffer buffer new string buffer size 2 for int i 0 i size i convert byte to an int int x bytes i account for int being a signed type and byte being unsigned if x 0 x 256 string tmp integer to hex string x pad out 1 to 01 etc if tmp length 1 buffer append 0 buffer append tmp return buffer to string hexstring converttohexstring tohex stringbuffer stringbuffer tohexstring tostring convert hex string to byte array param hex string hex string return byte array public static byte convert hex string string hex string if hex string null hex string length 0 return null int size hex string length 2 byte ret value new byte size string in string hex string to lower case try for int i 0 i size i int index i 2 int ii integer parse int in string substring index index 2 16 ret value i byte ii return ret value catch exception e log finest hex string e get localized message return null hexstring converthexstring hexstring hexstring hexstring hexstring retvalue instring hexstring tolowercase parseint instring retvalue retvalue hexstring getlocalizedmessage compiere security public secure init cipher initcipher initialize cipher key private synchronized void init cipher if m cipher null return cipher cc null try cc cipher get instance des ecb pkcs5 padding key if false key generator keygen key generator get instance des m key keygen generate key byte key m key get encoded string buffer sb new string buffer key append m key get algorithm append append key length append for int i 0 i key length i sb append key i append log info sb to string else m key new javax crypto spec secret key spec new byte 100 25 28 122 26 94 3 26 des catch exception ex log log level severe ex m cipher cc initcipher m_cipher getinstance pkcs5padding keygenerator keygenerator getinstance m_key generatekey m_key getencoded stringbuffer stringbuffer m_key getalgorithm tostring m_key secretkeyspec m_cipher encryption param value clear value return encrypted string public string encrypt string value string clear text value if clear text null clear text init if m cipher null init cipher encrypt if m cipher null try m cipher init cipher encrypt mode m key byte enc bytes m cipher do final clear text get bytes string enc string convert to hex string enc bytes globalqss 1577737 security breach show database password log log level all value enc string return enc string catch exception ex log log level info value ex fallback return clearvalue start value clearvalue end cleartext cleartext cleartext m_cipher initcipher m_cipher m_cipher encrypt_mode m_key encbytes m_cipher dofinal cleartext getbytes encstring converttohexstring encbytes encstring encstring clearvalue_start clearvalue_end decryption the methods must recognize clear text values param value encrypted value return decrypted string public string decrypt string value if value null value length 0 return value boolean is encrypted value starts with encryptedvalue start value ends with encryptedvalue end if is encrypted value value substring encryptedvalue start length value length encryptedvalue end length needs to be hex string byte data convert hex string value if data null cannot decrypt if is encrypted log info failed value return null assume not encrypted return value init if m cipher null init cipher encrypt if m cipher null value null value length 0 try algorithm parameters ap m cipher get parameters m cipher init cipher decrypt mode m key ap byte out m cipher do final data string ret value new string out globalqss 1577737 security breach show database password log log level all value ret value return ret value catch exception ex log info failed value ex to string return null isencrypted startswith encryptedvalue_start endswith encryptedvalue_end isencrypted encryptedvalue_start encryptedvalue_end converthexstring isencrypted m_cipher initcipher m_cipher algorithmparameters m_cipher getparameters m_cipher decrypt_mode m_key m_cipher dofinal retvalue retvalue retvalue tostring encryption the methods must recognize clear text values param value clear value return encrypted string public integer encrypt integer value return value decryption the methods must recognize clear text values param value encrypted value return decrypted string public integer decrypt integer value return value encryption the methods must recognize clear text values param value clear value return encrypted string public big decimal encrypt big decimal value return value bigdecimal bigdecimal decryption the methods must recognize clear text values param value encrypted value return decrypted string public big decimal decrypt big decimal value return value bigdecimal bigdecimal encryption the methods must recognize clear text values param value clear value return encrypted string public timestamp encrypt timestamp value return value decryption the methods must recognize clear text values param value encrypted value return decrypted string public timestamp decrypt timestamp value return value convert string to digest java script version see http pajhome org uk crypt md5 index html param value message return hex string of message length 32 characters public string get digest string value if m md null try m md message digest get instance md5 m md message digest get instance sha 1 catch no such algorithm exception nsae nsae print stack trace reset message digest object m md reset convert string to array of bytes byte input value get bytes feed this array of bytes to the message digest object m md update input get the resulting bytes after the encryption process byte output m md digest m md reset return convert to hex string output javascript hexstring getdigest m_md m_md messagedigest getinstance m_md messagedigest getinstance nosuchalgorithmexception printstacktrace messagedigest m_md getbytes messagedigest m_md m_md m_md converttohexstring checks if value is a valid digest param value digest string return true if valid digest public boolean is digest string value if value null value length 32 return false needs to be a hex string so try to convert it return convert hex string value null isdigest converthexstring string representation return info public string to string string buffer sb new string buffer secure sb append m cipher append return sb to string tostring stringbuffer stringbuffer m_cipher tostring standard constructor public x c bp relation properties ctx int c bp relation id string trx name super ctx c bp relation id trx name if c bp relation id 0 setc bp relation id 0 setc bpartnerrelation id 0 setc bpartnerrelation location id 0 setc bpartner id 0 set is bill to false set is pay from false set is remit to false set is ship to false n set name null x_c_bp_relation c_bp_relation_id trxname c_bp_relation_id trxname c_bp_relation_id setc_bp_relation_id setc_bpartnerrelation_id setc_bpartnerrelation_location_id setc_bpartner_id setisbillto setispayfrom setisremitto setisshipto setname load constructor public x c bp relation properties ctx result set rs string trx name super ctx rs trx name x_c_bp_relation resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp relation append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_relation get_id tostring set partner relation business partner relation public void setc bp relation id int c bp relation id if c bp relation id 1 throw new illegal argument exception c bp relation id is mandatory set valuenocheck c bp relation id new integer c bp relation id setc_bp_relation_id c_bp_relation_id c_bp_relation_id illegalargumentexception c_bp_relation_id set_valuenocheck c_bp_relation_id c_bp_relation_id get partner relation business partner relation public int getc bp relation id integer ii integer get value c bp relation id if ii null return 0 return ii int value getc_bp_relation_id get_value c_bp_relation_id intvalue public static final int c bpartnerrelation id ad reference id 138 set related partner related business partner public void setc bpartnerrelation id int c bpartnerrelation id if c bpartnerrelation id 1 throw new illegal argument exception c bpartnerrelation id is mandatory set value c bpartnerrelation id new integer c bpartnerrelation id c_bpartnerrelation_id_ad_reference_id setc_bpartnerrelation_id c_bpartnerrelation_id c_bpartnerrelation_id illegalargumentexception c_bpartnerrelation_id set_value c_bpartnerrelation_id c_bpartnerrelation_id get related partner related business partner public int getc bpartnerrelation id integer ii integer get value c bpartnerrelation id if ii null return 0 return ii int value getc_bpartnerrelation_id get_value c_bpartnerrelation_id intvalue public static final int c bpartnerrelation location id ad reference id 159 set related partner location location of the related business partner public void setc bpartnerrelation location id int c bpartnerrelation location id if c bpartnerrelation location id 1 throw new illegal argument exception c bpartnerrelation location id is mandatory set value c bpartnerrelation location id new integer c bpartnerrelation location id c_bpartnerrelation_location_id_ad_reference_id setc_bpartnerrelation_location_id c_bpartnerrelation_location_id c_bpartnerrelation_location_id illegalargumentexception c_bpartnerrelation_location_id set_value c_bpartnerrelation_location_id c_bpartnerrelation_location_id get related partner location location of the related business partner public int getc bpartnerrelation location id integer ii integer get value c bpartnerrelation location id if ii null return 0 return ii int value getc_bpartnerrelation_location_id get_value c_bpartnerrelation_location_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set invoice address business partner invoice bill address public void set is bill to boolean is bill to set value is bill to new boolean is bill to setisbillto isbillto set_value isbillto isbillto get invoice address business partner invoice bill address public boolean is bill to object oo get value is bill to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbillto get_value isbillto booleanvalue set pay from address business partner pays from that address and we ll send dunning letters there public void set is pay from boolean is pay from set value is pay from new boolean is pay from setispayfrom ispayfrom set_value ispayfrom ispayfrom get pay from address business partner pays from that address and we ll send dunning letters there public boolean is pay from object oo get value is pay from if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispayfrom get_value ispayfrom booleanvalue set remit to address business partner payment address public void set is remit to boolean is remit to set value is remit to new boolean is remit to setisremitto isremitto set_value isremitto isremitto get remit to address business partner payment address public boolean is remit to object oo get value is remit to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isremitto get_value isremitto booleanvalue set ship address business partner shipment address public void set is ship to boolean is ship to set valuenocheck is ship to new boolean is ship to setisshipto isshipto set_valuenocheck isshipto isshipto get ship address business partner shipment address public boolean is ship to object oo get value is ship to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isshipto get_value isshipto booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get distribution dun details param ctx context param m distributionrun id id param orderbp if true ordered by business partner otherwise run line return array of details static public m distribution run detail get properties ctx int m distributionrun id boolean orderbp array list m distribution run detail list new array list m distribution run detail string sql select from t distributionrundetail where m distributionrun id if orderbp sql order by c bpartner id c bpartner location id else sql order by m distributionrunline id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m distributionrun id result set rs pstmt execute query while rs next list add new m distribution run detail ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null m distribution run detail ret value new m distribution run detail list size list to array ret value return ret value m_distributionrun_id mdistributionrundetail m_distributionrun_id arraylist mdistributionrundetail arraylist mdistributionrundetail t_distributionrundetail m_distributionrun_id c_bpartner_id c_bpartner_location_id m_distributionrunline_id preparedstatement preparestatement setint m_distributionrun_id resultset executequery mdistributionrundetail s_log mdistributionrundetail retvalue mdistributionrundetail toarray retvalue retvalue load constructor param ctx context param rs result set public m distribution run detail properties ctx result set rs string trx name super ctx rs trx name mdistributionrundetail resultset trxname trxname round min qty qty param precision precision saved public void round int precision boolean dirty false m precision precision big decimal min get min qty if min scale m precision set min qty min set scale m precision big decimal round half up dirty true big decimal qty get qty if qty scale m precision set qty qty set scale m precision big decimal round half up dirty true if dirty save minqty m_precision bigdecimal getminqty m_precision setminqty setscale m_precision bigdecimal round_half_up bigdecimal getqty m_precision setqty setscale m_precision bigdecimal round_half_up we can adjust allocation qty return true if qty min public boolean is can adjust return get qty compare to get min qty 0 iscanadjust getqty compareto getminqty get actual allocation qty return the greater of the min qty public big decimal get actual allocation if get qty compare to get min qty 0 return get qty else return get min qty bigdecimal getactualallocation getqty compareto getminqty getqty getminqty adjust the quantity maintaining uom precision param difference difference return remaining difference because under min or rounding public big decimal adjust qty big decimal difference big decimal diff difference set scale m precision big decimal round half up big decimal qty get qty big decimal max get min qty subtract qty big decimal remaining env zero if max compare to diff 0 diff max are negative remaining diff subtract max set qty qty add max else set qty qty add diff log fine adjust qty qty qty min get min qty max max diff diff new qty get qty remaining remaining return remaining bigdecimal adjustqty bigdecimal bigdecimal setscale m_precision bigdecimal round_half_up bigdecimal getqty bigdecimal getminqty bigdecimal compareto setqty setqty adjustqty getminqty newqty getqty get singleton return engine public static model validation engine get if s engine null s engine new model validation engine return s engine modelvalidationengine s_engine s_engine modelvalidationengine s_engine constructor creates model validators private model validation engine super go through all clients and start validators m client clients m client get all new properties for int i 0 i clients length i string class names clients i get model validation classes if class names null class names length 0 continue string tokenizer st new string tokenizer class names while st has more tokens string class name null try class name st next token if class name null continue class name class name trim if class name length 0 continue class clazz class for name class name model validator validator model validator clazz new instance initialize validator clients i catch exception e log log level severe class name e get message log config to string modelvalidationengine mclient mclient getall classnames getmodelvalidationclasses classnames classnames stringtokenizer stringtokenizer classnames hasmoretokens classname classname nexttoken classname classname classname classname forname classname modelvalidator modelvalidator newinstance classname getmessage tostring initialize and add validator param validator param client private void initialize model validator validator m client client validator initialize this client m validators add validator modelvalidator mclient m_validators called when login is complete param ad client id client param ad org id org param ad role id role param ad user id user return error message or null public string login complete int ad client id int ad org id int ad role id int ad user id for int i 0 i m validators size i model validator validator model validator m validators get i if ad client id validator getad client id string error validator login ad org id ad role id ad user id if error null error length 0 return error return null ad_client_id ad_org_id ad_role_id ad_user_id logincomplete ad_client_id ad_org_id ad_role_id ad_user_id m_validators modelvalidator modelvalidator m_validators ad_client_id getad_client_id ad_org_id ad_role_id ad_user_id add model change listener param table name table name param listener listener public void add model change string table name model validator listener if table name null listener null return string property name table name listener getad client id array list model validator list array list model validator m modelchangelisteners get property name if list null list new array list model validator list add listener m modelchangelisteners put property name list else list add listener tablename addmodelchange tablename modelvalidator tablename propertyname tablename getad_client_id arraylist modelvalidator arraylist modelvalidator m_modelchangelisteners propertyname arraylist modelvalidator m_modelchangelisteners propertyname remove model change listener param table name table name param listener listener public void remove model change string table name model validator listener if table name null listener null return string property name table name listener getad client id array list list array list m modelchangelisteners get property name if list null return list remove listener if list size 0 m modelchangelisteners remove property name tablename removemodelchange tablename modelvalidator tablename propertyname tablename getad_client_id arraylist arraylist m_modelchangelisteners propertyname m_modelchangelisteners propertyname fire model change call model change method of added validators param po persistent objects param type model validator type return error message or null for no veto public string fire model change po po int type if po null m modelchangelisteners size 0 return null string property name po get tablename po getad client id array list list array list m modelchangelisteners get property name if list null return null for int i 0 i list size i try model validator validator model validator list get i string error validator model change po type if error null error length 0 return error catch exception e string error e get message if error null error e to string return error return null modelchange modelvalidator type_ firemodelchange m_modelchangelisteners propertyname get_tablename getad_client_id arraylist arraylist m_modelchangelisteners propertyname modelvalidator modelvalidator modelchange getmessage tostring add document validation listener param table name table name param listener listener public void add doc validate string table name model validator listener if table name null listener null return string property name table name listener getad client id array list model validator list array list model validator m docvalidatelisteners get property name if list null list new array list model validator list add listener m docvalidatelisteners put property name list else list add listener tablename adddocvalidate tablename modelvalidator tablename propertyname tablename getad_client_id arraylist modelvalidator arraylist modelvalidator m_docvalidatelisteners propertyname arraylist modelvalidator m_docvalidatelisteners propertyname remove document validation listener param table name table name param listener listener public void remove doc validate string table name model validator listener if table name null listener null return string property name table name listener getad client id array list list array list m docvalidatelisteners get property name if list null return list remove listener if list size 0 m docvalidatelisteners remove property name tablename removedocvalidate tablename modelvalidator tablename propertyname tablename getad_client_id arraylist arraylist m_docvalidatelisteners propertyname m_docvalidatelisteners propertyname fire document validation call doc validate method of added validators param po persistent objects param timing see model validator timing constants return error message or null public string fire doc validate po po int timing if po null m docvalidatelisteners size 0 return null string property name po get tablename po getad client id array list list array list m docvalidatelisteners get property name if list null return null for int i 0 i list size i model validator validator null try validator model validator list get i string error validator doc validate po timing if error null error length 0 return error catch exception e log log level severe validator to string e return null docvalidate modelvalidator timing_ firedocvalidate m_docvalidatelisteners propertyname get_tablename getad_client_id arraylist arraylist m_docvalidatelisteners propertyname modelvalidator modelvalidator docvalidate tostring string representation return info public string to string string buffer sb new string buffer model validation engine sb append validators append m validators size append model change append m modelchangelisteners size append doc validate append m docvalidatelisteners size append return sb to string tostring stringbuffer stringbuffer modelvalidationengine m_validators modelchange m_modelchangelisteners docvalidate m_docvalidatelisteners tostring default constructor param ctx context param w advertisement id id public m advertisement properties ctx int w advertisement id string trx name super ctx w advertisement id trx name if w advertisement id 0 setc bpartner id 0 set is self service false set name null setw advertisement id 0 w_advertisement_id madvertisement w_advertisement_id trxname w_advertisement_id trxname w_advertisement_id setc_bpartner_id setisselfservice setname setw_advertisement_id load constructor param ctx context param rs result set public m advertisement properties ctx result set rs string trx name super ctx rs trx name madvertisement resultset trxname trxname get click count return click count public m click count getm click count if getw clickcount id 0 return null if m clickcount null m clickcount new m click count get ctx getw clickcount id get trxname return m clickcount clickcount mclickcount getmclickcount getw_clickcount_id m_clickcount m_clickcount mclickcount getctx getw_clickcount_id get_trxname m_clickcount get click target url from click count return url public string get click targeturl getm click count if m clickcount null return return m clickcount get targeturl clickcount getclicktargeturl getmclickcount m_clickcount m_clickcount gettargeturl set click target url in click count param targeturl url public void set click targeturl string targeturl getm click count if m clickcount null m clickcount new m click count this if m clickcount null m clickcount set targeturl targeturl m clickcount save get trxname clickcount setclicktargeturl getmclickcount m_clickcount m_clickcount mclickcount m_clickcount m_clickcount settargeturl m_clickcount get_trxname get weekly count return weekly count public value name pair get click count week getm click count if m clickcount null return new value name pair 0 return m clickcount get count week valuenamepair getclickcountweek getmclickcount m_clickcount valuenamepair m_clickcount getcountweek get counter count return counter count public m counter count getm counter count if getw countercount id 0 return null if m countercount null m countercount new m counter count get ctx getw countercount id get trxname return m countercount countercount mcountercount getmcountercount getw_countercount_id m_countercount m_countercount mcountercount getctx getw_countercount_id get_trxname m_countercount get sales rep id ad user id of oldest bp user return sales rep id public int getsalesrep id if m salesrep id 0 m salesrep id getad user id if m salesrep id 0 m salesrep id db getsql value null select ad user id from ad user where c bpartner id and is active y order by 1 getc bpartner id return m salesrep id ad_user_id getsalesrep_id m_salesrep_id m_salesrep_id getad_user_id m_salesrep_id m_salesrep_id getsqlvalue ad_user_id ad_user c_bpartner_id isactive getc_bpartner_id m_salesrep_id create new measures for the goal param goal the goal return number created calculate goal actual from unprocessed measures of the goal param goal the goal return new actual measure create new measures for the criteria param criteria the criteria public int create measures msla criteria criteria int counter 0 msla goal goals criteria get goals for int i 0 i goals length i msla goal goal goals i if goal is active counter create measures goal return counter createmeasures mslacriteria mslagoal getgoals mslagoal isactive createmeasures calculate goal actual from unprocessed measures of the goal param criteria sla criteria public void calculate measures msla criteria criteria msla goal goals criteria get goals for int i 0 i goals length i msla goal goal goals i if goal is active goal set measure actual calculate measure goal goal set date last run new timestamp system current time millis goal save calculatemeasures mslacriteria mslagoal getgoals mslagoal isactive setmeasureactual calculatemeasure setdatelastrun currenttimemillis create tab model from value object p m tab provides a property listener for changed rows and a data status listener for communicating changes of the underlying data param vo value object public m tab m tabvo vo m vo vo create m table m mtable new m table m vo ctx m vo ad table id m vo table name m vo window no m vo tab no true m mtable set read only m vo is read only m vo is view m mtable set deleteable m vo is deleteable load tab if vo tab no 0 init tab false else m loader new loader m loader set priority thread min priority m loader start wait load compete mtab datastatuslistener mtab mtabvo m_vo mtable m_mtable mtable m_vo m_vo ad_table_id m_vo tablename m_vo windowno m_vo tabno m_mtable setreadonly m_vo isreadonly m_vo isview m_mtable setdeleteable m_vo isdeleteable tabno inittab m_loader m_loader setpriority min_priority m_loader waitloadcompete async loading of tab 0 public void run init tab true inittab wait until load is complete private void wait load compete if m loadcomplete return m loader set priority thread norm priority log config while m loader is alive try thread sleep 100 1 10 sec catch exception e log log level severe e log config fini waitloadcompete m_loadcomplete m_loader setpriority norm_priority m_loader isalive initialize tab with record from ad tab v param async async return true if correctly initialized ignored protected boolean init tab boolean async log fine m vo tab no async async where m vo where clause m extendedwhere m vo where clause get field data if load fields m loadcomplete true return false order by m mtable set order clause get order by clause m vo only current rows if async log fine m vo tab no async async fini m loadcomplete true return true ad_tab_v inittab m_vo tabno m_vo whereclause m_extendedwhere m_vo whereclause loadfields m_loadcomplete m_mtable setorderclause getorderbyclause m_vo onlycurrentrows m_vo tabno m_loadcomplete dispose clean up resources protected void dispose log fine m vo tab no m orderbys null m parents clear m parents null m mtable close true also disposes fields m mtable null m deponfield clear m deponfield null if m attachment null m attachment clear m attachment null m vo fields clear m vo fields null m vo null m_vo tabno m_orderbys m_parents m_parents m_mtable m_mtable m_deponfield m_deponfield m_attachment m_attachment m_attachment m_vo m_vo m_vo get field data and add to m table if it s required or displayed reqiored fields are keys parents or standard columns return true if fields loaded private boolean load fields log fine m vo tab no if m vo fields null return false add fields for int f 0 f m vo fields size f m fieldvo vof m fieldvo m vo fields get f add fields to table if vof null m field field new m field vof string column name field get column name record info if field is key m keycolumnname column name parent column s if field is parent column m parents add column name order by int sort no field get sort no if sort no 0 else if math abs sort no 1 m orderbys 0 column name if sort no 0 m orderbys 0 desc else if math abs sort no 2 m orderbys 1 column name if sort no 0 m orderbys 1 desc else if math abs sort no 3 m orderbys 2 column name if sort no 0 m orderbys 2 desc add field m mtable add field field list of column names this field is dependent on array list string list field get dependent on for int i 0 i list size i m deponfield put list get i field column name field add fields all fields are dependent on if column name equals is active column name equals processed m deponfield put column name null for all fields add standard fields if m mtable get field created null m field created new m field m fieldvo create std field m vo ctx m vo window no m vo tab no m vo ad window id false true true m mtable add field created if m mtable get field created by null m field created by new m field m fieldvo create std field m vo ctx m vo window no m vo tab no m vo ad window id false true false m mtable add field created by if m mtable get field updated null m field updated new m field m fieldvo create std field m vo ctx m vo window no m vo tab no m vo ad window id false false true m mtable add field updated if m mtable get field updated by null m field updated by new m field m fieldvo create std field m vo ctx m vo window no m vo tab no m vo ad window id false false false m mtable add field updated by return true mtable loadfields m_vo tabno m_vo m_vo mfieldvo mfieldvo m_vo mfield mfield columnname getcolumnname iskey m_keycolumnname columnname isparentcolumn m_parents columnname sortno getsortno sortno sortno m_orderbys columnname sortno m_orderbys sortno m_orderbys columnname sortno m_orderbys sortno m_orderbys columnname sortno m_orderbys m_mtable addfield columnnames arraylist getdependenton m_deponfield columnname columnname isactive columnname m_deponfield columnname m_mtable getfield mfield mfield mfieldvo createstdfield m_vo m_vo windowno m_vo tabno m_vo ad_window_id m_mtable addfield m_mtable getfield createdby mfield createdby mfield mfieldvo createstdfield m_vo m_vo windowno m_vo tabno m_vo ad_window_id m_mtable addfield createdby m_mtable getfield mfield mfield mfieldvo createstdfield m_vo m_vo windowno m_vo tabno m_vo ad_window_id m_mtable addfield m_mtable getfield updatedby mfield updatedby mfield mfieldvo createstdfield m_vo m_vo windowno m_vo tabno m_vo ad_window_id m_mtable addfield updatedby get table model b do not directly communicate with the table model but through the methods of this class b return table model public m table get table model return m mtable tablemodel mtable gettablemodel m_mtable get tab icon return icon public javax swing icon get icon if m vo ad image id 0 return null todo load image return null geticon m_vo ad_image_id has this field dependents param column name column name return true if column has dependent public boolean has dependants string column name m deponfield print to log return m deponfield contains key column name columnname hasdependants columnname m_deponfield printtolog m_deponfield containskey columnname get dependents fields of column name param column name column name return array list with m fields dependent on column name public array list get dependant list string column name return m deponfield get values column name columnname columnname arraylist mfields columnname arraylist getdependantlist columnname m_deponfield getvalues columnname set query param query query public void set query m query query if query null m query new m query else m query query setquery mquery m_query mquery m_query get query return query public m query get query return m query mquery getquery m_query is query active return true if query active public boolean is query active if m query null return m query is active return false isqueryactive m_query m_query isactive is query new record return true if query active public boolean is query new record if m query null return m query is new record query return false isquerynewrecord m_query m_query isnewrecordquery enable events enable data events of tabs add listeners public void enable events setup events m mtable add data status listener this m mtable add table model listener this enableevents m_mtable adddatastatuslistener m_mtable addtablemodellistener assemble where clause and query m table and position to row 0 pre scenarios never opened full query query changed full query detail link value changed full query otherwise refresh all pre param only current rows only current rows 1 day public void query boolean only current rows query only current rows 0 whereclause mtable refreshall onlycurrentrows onlycurrentrows onlycurrentrows assemble where clause and query m table and position to row 0 pre scenarios never opened full query query changed full query detail link value changed full query otherwise refresh all pre param only current rows only current rows param only current days if only current row how many days back public void query boolean only current rows int only current days log fine m vo tab no only current rows only current rows days only current days detail is detail is it same query boolean refresh m oldquery equals m query get where clause m vo only current rows only current rows m vo only current days only current days m oldquery m query get where clause m vo only current rows only current rows m vo only current days only current days set where clause tab where clause string buffer where new string buffer m vo where clause if m vo only current days 0 if where length 0 where append and where append created if db is sybase where append dateadd dd append m vo only current days append getdate else where append sys date append m vo only current days detail query if is detail string lc get link column name if lc equals log severe no link column else string value env get context m vo ctx m vo window no lc same link value if refresh refresh m linkvalue equals value m linkvalue value check validity if value length 0 log severe no value for link column lc else we have column and value if where length 0 where append and where append lc append if lc ends with id where append value else where append append value append is detail m extendedwhere where to string final query if m query is active string q validate query m query if q null if where length 0 where append and where append q query log fine m vo tab no where if m mtable is open if refresh m mtable data refresh all else m mtable data requery where to string m vo only current rows is detail only current days else m mtable set select where clause where to string m vo only current rows is detail only current days m mtable open go to record 0 set current row 0 true whereclause mtable refreshall onlycurrentrows onlycurrentdays onlycurrentrows onlycurrentdays m_vo tabno onlycurrentrows onlycurrentdays isdetail m_oldquery m_query getwhereclause m_vo onlycurrentrows onlycurrentrows m_vo onlycurrentdays onlycurrentdays m_oldquery m_query getwhereclause m_vo onlycurrentrows onlycurrentrows m_vo onlycurrentdays onlycurrentdays stringbuffer stringbuffer m_vo whereclause m_vo onlycurrentdays issybase m_vo onlycurrentdays sysdate m_vo onlycurrentdays isdetail getlinkcolumnname getcontext m_vo m_vo windowno m_linkvalue m_linkvalue endswith _id isdetail m_extendedwhere tostring m_query isactive validatequery m_query m_vo tabno m_mtable isopen m_mtable datarefreshall m_mtable datarequery tostring m_vo onlycurrentrows isdetail onlycurrentdays m_mtable setselectwhereclause tostring m_vo onlycurrentrows isdetail onlycurrentdays m_mtable setcurrentrow validate query if query column is not a tab column create exists query param query query return where clause private string validate query m query query if query null query get restriction count 0 return null check only one restriction if query get restriction count 1 log fine ignored more than 1 restriction query return query get where clause string col name query get column name 0 if col name null log fine ignored no column query return query get where clause a in the name function don t try to resolve if col name index of 1 log fine ignored function col name return query get where clause ok query is valid zooms to the same window parents string ref col name null if col name equals r requestrelated id ref col name r request id else if col name starts with c doctype ref col name c doctype id if ref col name null query set column name 0 ref col name if get field ref col name null log fine column col name replaced with synonym ref col name return query get where clause ref col name null simple query if get field col name null log fine field found col name return query get where clause find refernce column e g billto id c bpartner location id string sql select cc column name from ad column c inner join ad ref table r on c ad reference value id r ad reference id inner join ad column cc on r ad key cc ad column id where c ad reference id in 18 30 table search and c column name try prepared statement pstmt db prepare statement sql null pstmt set string 1 col name result set rs pstmt execute query if rs next ref col name rs get string 1 rs close pstmt close catch sql exception e log log level severe ref column col name e return query get where clause reference column found if ref col name null query set column name 0 ref col name if get field ref col name null log fine column col name replaced with ref col name return query get where clause col name ref col name column not in tab create exists subquery string table name null string tab key column get key column name column salesrep id key ad user id query salesrep id 101 sql select t table name from ad column c inner join ad table t on c ad table id t ad table id where c column name and is key y 1 link column and exists select from ad column cc where cc ad table id t ad table id and cc column name 2 tab key column try prepared statement pstmt db prepare statement sql null pstmt set string 1 col name pstmt set string 2 tab key column result set rs pstmt execute query if rs next table name rs get string 1 rs close pstmt close catch sql exception e log log level severe column col name key tab key column e return null special reference handling if tab key column equals ad reference id column access level key ad reference id query access level 6 sql select ad reference id from ad column where column name int ad reference id db getsql value null sql col name return ad reference id ad reference id causes could be functions in query e g column upper name key ad element id query upper ad element name like customer if table name null log info not successfull column col name key tab key column query query return query get where clause query set table name xx string buffer result new string buffer exists select from append table name append xx where append query get where clause true append and xx append tab key column append append get table name append append tab key column append log fine result to string return result to string validatequery mquery getrestrictioncount getrestrictioncount getwhereclause colname getcolumnname colname getwhereclause colname indexof colname getwhereclause refcolname colname r_requestrelated_id refcolname r_request_id colname startswith c_doctype refcolname c_doctype_id refcolname setcolumnname refcolname getfield refcolname colname refcolname getwhereclause refcolname getfield colname colname getwhereclause billto_id c_bpartner_location_id columnname ad_column ad_ref_table ad_reference_value_id ad_reference_id ad_column ad_key ad_column_id ad_reference_id columnname preparedstatement preparestatement setstring colname resultset executequery refcolname getstring sqlexception colname getwhereclause refcolname setcolumnname refcolname getfield refcolname colname refcolname getwhereclause colname refcolname tablename tabkeycolumn getkeycolumnname salesrep_id ad_user_id salesrep_id tablename ad_column ad_table ad_table_id ad_table_id columnname iskey ad_column ad_table_id ad_table_id columnname preparedstatement preparestatement setstring colname setstring tabkeycolumn resultset executequery tablename getstring sqlexception colname tabkeycolumn tabkeycolumn ad_reference_id accesslevel ad_reference_id accesslevel ad_reference_id ad_column columnname ad_reference_id getsqlvalue colname ad_reference_id ad_reference_id ad_element_id ad_element tablename colname tabkeycolumn getwhereclause settablename stringbuffer stringbuffer tablename getwhereclause tabkeycolumn gettablename tabkeycolumn tostring tostring refresh all data public void data refresh all log fine m vo tab no todo does not work with alpha key int key no m mtable get keyid m currentrow m mtable data refresh all should use rowid not working for tables with multiple keys if key no 1 if key no m mtable get keyid m currentrow something changed int size get row count for int i 0 i size i if key no m mtable get keyid i m currentrow i break set current row m currentrow true datarefreshall m_vo tabno keyno m_mtable getkeyid m_currentrow m_mtable datarefreshall keyno keyno m_mtable getkeyid m_currentrow getrowcount keyno m_mtable getkeyid m_currentrow setcurrentrow m_currentrow refresh current row data public void data refresh data refresh m currentrow datarefresh datarefresh m_currentrow refresh row data param row index public void data refresh int row log fine m vo tab no row row m mtable data refresh row set current row row true datarefresh m_vo tabno m_mtable datarefresh setcurrentrow uncoditionally save data param manual cmd if true no vetoable property change will be fired for save confirmation from m table return true if save complete or nor required public boolean data save boolean manual cmd log fine m vo tab no row m currentrow try boolean ret value m mtable data save manual cmd m table save ok if manual cmd set current row m currentrow false return ret value catch exception e log log level severe m vo tab no row m currentrow e return false manualcmd propertychange mtable datasave manualcmd m_vo tabno m_currentrow retvalue m_mtable datasave manualcmd mtable save_ok manualcmd setcurrentrow m_currentrow retvalue m_vo tabno m_currentrow do we need to save param row change row change param only real change if true the value of a field was actually changed e g for new records which have not been changed default false return true it needs to be saved public boolean need save boolean row change boolean only real change if row change return m mtable need save 2 only real change else if only real change return m mtable need save else return m mtable need save only real change rowchange onlyrealchange needsave rowchange onlyrealchange rowchange m_mtable needsave onlyrealchange onlyrealchange m_mtable needsave m_mtable needsave onlyrealchange ignore data changes public void data ignore log fine m vo tab no m mtable data ignore set current row m currentrow false re load data log fine m vo tab no fini dataignore m_vo tabno m_mtable dataignore setcurrentrow m_currentrow m_vo tabno create copy new row and process callouts param copy copy return true if copied new public boolean data new boolean copy log fine m vo tab no if is insert record log warning inset not allowed in tab no m vo tab no return false prevent new where main record is processed if m vo tab no 0 boolean processed y equals env get context m vo ctx m vo window no processed boolean active y equals env get context m vo ctx m vo window no is active if processed log warning not allowed in tab no m vo tab no processed processed return false log finest processed processed boolean ret value m mtable data new m currentrow copy if ret value return ret value set current row m currentrow 1 true process all callouts no dependency check assumed that settings are valid for int i 0 i get field count i process callout get field i check validity of defaults for int i 0 i get field count i get field i validate value m mtable set changed false return ret value datanew m_vo tabno isinsertrecord tabno m_vo tabno m_vo tabno getcontext m_vo m_vo windowno getcontext m_vo m_vo windowno isactive tabno m_vo tabno retvalue m_mtable datanew m_currentrow retvalue retvalue setcurrentrow m_currentrow getfieldcount processcallout getfield getfieldcount getfield validatevalue m_mtable setchanged retvalue delete current row return true if deleted public boolean data delete log fine m vo tab no row m currentrow boolean ret value m mtable data delete m currentrow set current row m currentrow true return ret value datadelete m_vo tabno m_currentrow retvalue m_mtable datadelete m_currentrow setcurrentrow m_currentrow retvalue get name of tab return name public string get name return m vo name getname m_vo get description of tab return description public string get description return m vo description getdescription m_vo get help of tab return help public string get help return m vo help gethelp m_vo get tab level return tab level public int get tab level return m vo tab level gettablevel m_vo tablevel get commit warning return commit warning public string get commit warning return m vo commit warning getcommitwarning m_vo commitwarning return table model return m table protected m table getm table return m mtable mtable mtable getmtable m_mtable return the name of the key column may be return key column name public string get key column name return m keycolumnname getkeycolumnname m_keycolumnname return name of link column return link column name public string get link column name return m linkcolumnname getlinkcolumnname m_linkcolumnname set name of link column set from m window load tab data used in m tab is curreny set current row query a panel cmd report and m field is editable and is default via context param link column name name of column or sets name to ad column id if exists public void set link column name string link column name if link column name null m linkcolumnname link column name else if m vo ad column id 0 return we have a link column identified primary parent column else string sql select column name from ad column where ad column id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m vo ad column id parent link column result set rs pstmt execute query if rs next m linkcolumnname rs get string 1 rs close pstmt close catch sql exception e log log level severe e log fine ad column id m vo ad column id m linkcolumnname env set context m vo ctx m vo window no m vo tab no link column name m linkcolumnname mwindow loadtabdata mtab iscurreny setcurrentrow apanel cmd_report mfield iseditable isdefault linkcolumnname ad_column_id setlinkcolumnname linkcolumnname linkcolumnname m_linkcolumnname linkcolumnname m_vo ad_column_id columnname ad_column ad_column_id preparedstatement preparestatement setint m_vo ad_column_id resultset executequery m_linkcolumnname getstring sqlexception ad_column_id m_vo ad_column_id m_linkcolumnname setcontext m_vo m_vo windowno m_vo tabno linkcolumnname m_linkcolumnname is the tab current pre yes table must be open query string is the same not detail old link column value is same as current one pre return true if current public boolean is current open if m mtable is open return false same query if m oldquery equals m query get where clause return false detail if is detail return true same link column value string value env get context m vo ctx m vo window no get link column name return m linkvalue equals value iscurrent m_mtable isopen m_oldquery m_query getwhereclause isdetail getcontext m_vo m_vo windowno getlinkcolumnname m_linkvalue is the tab table currently open return true if open public boolean is open open if m mtable null return m mtable is open return false isopen m_mtable m_mtable isopen is tab incluced in other tab return true if included public boolean is included return m included isincluded m_included is tab incluced in other tab param is included true if included public void set included boolean is included m included is included isincluded setincluded isincluded m_included isincluded are only current rows displayed return true if no history public boolean is only current rows return m vo only current rows isonlycurrentrows m_vo onlycurrentrows is only current rows return parent array list return parent column names public array list get parent column names return m parents isonlycurrentrows arraylist arraylist getparentcolumnnames m_parents get tree id of this tab return id private int get treeid log fine m vo table name string sql select from ad clientinfo where ad client env get context m vo ctx m vo window no ad client id order by ad org desc if m vo table name equals ad menu return 10 mm else if m vo table name equals c elementvalue return 20 ev else if m vo table name equals m product return 30 pr else if m vo table name equals c bpartner return 40 bp else if m vo table name equals ad org return 50 oo else if m vo table name equals c project return 60 pj return 0 gettreeid m_vo tablename ad_clientinfo ad_client getcontext m_vo m_vo windowno ad_client_id ad_org m_vo tablename ad_menu m_vo tablename c_elementvalue m_vo tablename m_product m_vo tablename c_bpartner m_vo tablename ad_org m_vo tablename c_project returns true if this is a detail record return true if not parent tab public boolean is detail we have is parent columns and or a link column if m parents size 0 m vo ad column id 0 return true return false isdetail isparent m_parents m_vo ad_column_id is printed document can be printed return true if printing public boolean is printed return m vo ad process id 0 isprinted m_vo ad_process_id get window no return window no public int get window no return m vo window no windowno getwindowno m_vo windowno get tab no return tab no public int get tab no return m vo tab no tabno gettabno m_vo tabno get process id return process id public int getad process id return m vo ad process id getad_process_id m_vo ad_process_id is high volume return true if high volumen table public boolean is high volume return m vo is high volume ishighvolume m_vo ishighvolume is read only return true if read only public boolean is read only if m vo is read only return true no restrictions if m vo read only logic null m vo read only logic equals return m vo is read only dynamic content boolean ret value evaluator evaluate logic this m vo read only logic log finest m vo name m vo read only logic ret value return ret value isreadonly m_vo isreadonly m_vo readonlylogic m_vo readonlylogic m_vo isreadonly retvalue evaluatelogic m_vo readonlylogic m_vo m_vo readonlylogic retvalue retvalue tab contains always update field return true if field with always updateable public boolean is always update field for int i 0 i m mtable get column count i m field field m mtable get field i if field is always updateable return true return false isalwaysupdatefield m_mtable getcolumncount mfield m_mtable getfield isalwaysupdateable can we insert records return true not read only and allowed public boolean is insert record if is read only return false return m vo is insert record isinsertrecord isreadonly m_vo isinsertrecord is the tab visible called when constructing the window return true if displayed public boolean is displayed no restrictions string dl m vo display logic if dl null dl equals return true dynamic content boolean ret value evaluator evaluate logic this dl log config m vo name dl ret value return ret value isdisplayed m_vo displaylogic retvalue evaluatelogic m_vo retvalue retvalue get variable value evaluatee param variable name name return value public string get valueasstring string variable name return env get context m vo ctx m vo window no variable name true variablename get_valueasstring variablename getcontext m_vo m_vo windowno variablename is single row return true if single row public boolean is single row return m vo is single row issinglerow m_vo issinglerow set single row temporary store of current value param is single row toggle public void set single row boolean is single row m vo is single row is single row issinglerow setsinglerow issinglerow m_vo issinglerow issinglerow has tree return true if tree exists public boolean is tree tab return m vo has tree istreetab m_vo hastree get tab id return tab id public int getad tab id return m vo ad tab id getad_tab_id m_vo ad_tab_id get table id return table id public int getad table id return m vo ad table id getad_table_id m_vo ad_table_id get window id return window id public int getad window id return m vo ad window id getad_window_id m_vo ad_window_id get included tab id return included tab id public int getincluded tab id return m vo included tab id included_tab_id getincluded_tab_id m_vo included_tab_id get table name return table name public string get table name return m vo table name tablename gettablename m_vo tablename get tab where clause return where clause public string get where clause return m vo where clause getwhereclause m_vo whereclause is sort tab return true if sort tab public boolean is sort tab return m vo is sort tab issorttab m_vo issorttab get order column for sort tab return ad column id public int getad columnsortorder id return m vo ad columnsortorder id ad_column_id getad_columnsortorder_id m_vo ad_columnsortorder_id get yes no column for sort tab return ad column id public int getad columnsortyesno id return m vo ad columnsortyesno id ad_column_id getad_columnsortyesno_id m_vo ad_columnsortyesno_id get extended where clause parent link return parent link public string get where extended return m extendedwhere getwhereextended m_extendedwhere get order by clause param only current rows only current rows return order by clause private string get order by clause boolean only current rows first prio tab order by if m vo order by clause length 0 return m vo order by clause second prio fields save it m vo order by clause for int i 0 i 3 i string order m orderbys i if order null order length 0 if m vo order by clause length 0 m vo order by clause m vo order by clause order if m vo order by clause length 0 return m vo order by clause third prio only current rows m vo order by clause created if only current rows is detail first tab only m vo order by clause desc return m vo order by clause onlycurrentrows getorderbyclause onlycurrentrows m_vo orderbyclause m_vo orderbyclause m_vo orderbyclause m_orderbys m_vo orderbyclause m_vo orderbyclause m_vo orderbyclause m_vo orderbyclause m_vo orderbyclause onlycurrentrows m_vo orderbyclause onlycurrentrows isdetail m_vo orderbyclause m_vo orderbyclause transaction support depending on table returns transaction info return info public string get trx info invoice batch if m vo table name starts with c invoicebatch int record id env get context as int m vo ctx m vo window no c invoicebatch id log fine m vo table name record id message format mf null try mf new message format msg get msg env getad language m vo ctx invoice batch summary catch exception e log log level severe invoice batch summary msg get msg env getad language m vo ctx invoice batch summary e if mf null return message expense summary 0 line s 1 number 0 00 total 2 number 0 00 0 number of lines 1 toral 2 currency object arguments new object 3 boolean filled false string sql select count nvl sum line net amt 0 nvl sum line total amt 0 from c invoicebatchline where c invoicebatch id and is active y try prepared statement pstmt db prepare statement sql null pstmt set int 1 record id result set rs pstmt execute query if rs next 0 number of lines integer lines new integer rs get int 1 arguments 0 lines 1 line net double net new double rs get double 2 arguments 1 net 2 line net double total new double rs get double 3 arguments 2 total filled true rs close pstmt close catch sql exception e log log level severe m vo table name nsql sql e if filled return mf format arguments return invoice batch order invoice else if m vo table name starts with c order m vo table name starts with c invoice int record id boolean is order m vo table name starts with c order string buffer sql new string buffer select count as lines c iso code o total lines o grand total currency base o grand total o c currency id o date acct o ad client id o ad org id as conv amt if is order record id env get context as int m vo ctx m vo window no c order id sql append from c order o inner join c currency c on o c currency id c c currency id inner join c orderline l on o c order id l c order id where o c order id else record id env get context as int m vo ctx m vo window no c invoice id sql append from c invoice o inner join c currency c on o c currency id c c currency id inner join c invoiceline l on o c invoice id l c invoice id where o c invoice id sql append group by o c currency id c iso code o total lines o grand total o date acct o ad client id o ad org id log fine m vo table name record id message format mf null try mf new message format msg get msg env getad language m vo ctx order summary catch exception e log log level severe order summary msg get msg env getad language m vo ctx order summary e if mf null return message order summary 0 line s 1 number 0 00 toral 2 number 0 00 3 4 number 0 00 0 number of lines 1 line toral 2 grand total including tax etc 3 currency 4 grand total converted to local currency object arguments new object 5 boolean filled false try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 record id result set rs pstmt execute query if rs next 0 number of lines integer lines new integer rs get int 1 arguments 0 lines 1 line toral double line total new double rs get double 3 arguments 1 line total 2 grand total including tax etc double grand total new double rs get double 4 arguments 2 grand total 3 currency string currency rs get string 2 arguments 3 currency 4 grand total converted to euro double grand euro new double rs get double 5 arguments 4 grand euro filled true rs close pstmt close catch sql exception e log log level severe m vo table name nsql sql e if filled return mf format arguments return order invoice expense report else if m vo table name starts with s timeexpense m vo tab no 0 int record id env get context as int m vo ctx m vo window no s timeexpense id log fine m vo table name record id message format mf null try mf new message format msg get msg env getad language m vo ctx expense summary catch exception e log log level severe expense summary msg get msg env getad language m vo ctx expense summary e if mf null return message expense summary 0 line s total 1 number 0 00 2 0 number of lines 1 toral 2 currency object arguments new object 3 boolean filled false string sql select count as lines sum converted amt qty from s timeexpenseline where s timeexpense id try prepared statement pstmt db prepare statement sql null pstmt set int 1 record id result set rs pstmt execute query if rs next 0 number of lines integer lines new integer rs get int 1 arguments 0 lines 1 line toral double total new double rs get double 2 arguments 1 total 3 currency arguments 2 filled true rs close pstmt close catch sql exception e log log level severe m vo table name nsql sql e if filled return mf format arguments return s timeexpense default no trx info return null gettrxinfo invoicebatch m_vo tablename startswith c_invoicebatch record_id getcontextasint m_vo m_vo windowno c_invoicebatch_id m_vo tablename record_id messageformat messageformat getmsg getad_language m_vo invoicebatchsummary invoicebatchsummary getmsg getad_language m_vo invoicebatchsummary expensesummary linenetamt linetotalamt c_invoicebatchline c_invoicebatch_id isactive preparedstatement preparestatement setint record_id resultset executequery getint getdouble getdouble sqlexception m_vo tablename invoicebatch m_vo tablename startswith c_order m_vo tablename startswith c_invoice record_id isorder m_vo tablename startswith c_order stringbuffer stringbuffer iso_code totallines grandtotal currencybase grandtotal c_currency_id dateacct ad_client_id ad_org_id convamt isorder record_id getcontextasint m_vo m_vo windowno c_order_id c_order c_currency c_currency_id c_currency_id c_orderline c_order_id c_order_id c_order_id record_id getcontextasint m_vo m_vo windowno c_invoice_id c_invoice c_currency c_currency_id c_currency_id c_invoiceline c_invoice_id c_invoice_id c_invoice_id c_currency_id iso_code totallines grandtotal dateacct ad_client_id ad_org_id m_vo tablename record_id messageformat messageformat getmsg getad_language m_vo ordersummary ordersummary getmsg getad_language m_vo ordersummary ordersummary preparedstatement preparestatement tostring setint record_id resultset executequery getint linetotal getdouble linetotal grandtotal getdouble grandtotal getstring grandeuro getdouble grandeuro sqlexception m_vo tablename m_vo tablename startswith s_timeexpense m_vo tabno record_id getcontextasint m_vo m_vo windowno s_timeexpense_id m_vo tablename record_id messageformat messageformat getmsg getad_language m_vo expensesummary expensesummary getmsg getad_language m_vo expensesummary expensesummary convertedamt s_timeexpenseline s_timeexpense_id preparedstatement preparestatement setint record_id resultset executequery getint getdouble sqlexception m_vo tablename s_timeexpense load dependant information private void load dependent info load order type from c doctypetarget id if m vo table name equals c order int c doctyp id 0 integer target integer get value c doctypetarget id if target null c doctyp id target int value if c doctyp id 0 return string sql select doc sub typeso from c doctype where c doctype id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c doctyp id result set rs pstmt execute query if rs next env set context m vo ctx m vo window no order type rs get string 1 rs close pstmt close catch sql exception e log log level severe load order type e load order info loaddependentinfo c_doctypetarget_id m_vo tablename c_order c_doctyp_id getvalue c_doctypetarget_id c_doctyp_id intvalue c_doctyp_id docsubtypeso c_doctype c_doctype_id preparedstatement preparestatement setint c_doctyp_id resultset executequery setcontext m_vo m_vo windowno ordertype getstring sqlexception loadordertype loadorderinfo load attachments for this table public void load attachments log fine m vo tab no if can have attachment return string sql select ad attachment id record id from ad attachment where ad table id try if m attachment null m attachment new hash map integer integer else m attachment clear prepared statement pstmt db prepare statement sql null pstmt set int 1 m vo ad table id result set rs pstmt execute query while rs next integer key new integer rs get int 2 integer value new integer rs get int 1 m attachment put key value rs close pstmt close catch sql exception e log log level severe load attachments e log config m attachment size loadattachments m_vo tabno canhaveattachment ad_attachment_id record_id ad_attachment ad_table_id m_attachment m_attachment hashmap m_attachment preparedstatement preparestatement setint m_vo ad_table_id resultset executequery getint getint m_attachment sqlexception loadattachments m_attachment can this tab have attachments p it can have an attachment if it has a key column ending with id the key column is empty if there is no single identifying key return true if record can have attachment public boolean can have attachment if get key column name ends with id return true return false _id canhaveattachment getkeycolumnname endswith _id returns true if current row has an attachment return true if record has attchment public boolean has attachment if m attachment null load attachments if m attachment null m attachment is empty return false integer key new integer m mtable get keyid m currentrow return m attachment contains key key hasattachment m_attachment loadattachments m_attachment m_attachment isempty m_mtable getkeyid m_currentrow m_attachment containskey get attachment id return id or 0 if not found public int getad attachmentid if m attachment null load attachments if m attachment is empty return 0 integer key new integer m mtable get keyid m currentrow integer value integer m attachment get key if value null return 0 else return value int value attachment_id getad_attachmentid m_attachment loadattachments m_attachment isempty m_mtable getkeyid m_currentrow m_attachment intvalue load locks for table and user public void load locks int ad user id env get context as int env get ctx ad user id log fine m vo tab no ad user id ad user id if can have attachment return string sql select record id from ad private access where ad user id and ad table id and is active y order by record id try if m lock null m lock new array list integer else m lock clear prepared statement pstmt db prepare statement sql null pstmt set int 1 ad user id pstmt set int 2 m vo ad table id result set rs pstmt execute query while rs next integer key new integer rs get int 1 m lock add key rs close pstmt close catch sql exception e log log level severe sql e log fine m lock size loadlocks ad_user_id getcontextasint getctx ad_user_id m_vo tabno ad_user_id ad_user_id canhaveattachment record_id ad_private_access ad_user_id ad_table_id isactive record_id m_lock m_lock arraylist m_lock preparedstatement preparestatement setint ad_user_id setint m_vo ad_table_id resultset executequery getint m_lock sqlexception m_lock record is locked public boolean is locked if m role get default m vo ctx false is personal lock return false if m lock null load locks if m lock null m lock is empty return false integer key new integer m mtable get keyid m currentrow return m lock contains key islocked mrole getdefault m_vo ispersonallock m_lock loadlocks m_lock m_lock isempty m_mtable getkeyid m_currentrow m_lock lock record param record id id param lock true if lock otherwise unlock public void lock properties ctx int record id boolean lock int ad user id env get context as int ctx ad user id log fine lock lock ad user id ad user id ad table id m vo ad table id record id record id m private access access m private access get ctx ad user id m vo ad table id record id if access null access new m private access ctx ad user id m vo ad table id record id access set is active lock access save load locks record_id record_id ad_user_id getcontextasint ad_user_id ad_user_id ad_user_id ad_table_id m_vo ad_table_id record_id record_id mprivateaccess mprivateaccess ad_user_id m_vo ad_table_id record_id mprivateaccess ad_user_id m_vo ad_table_id record_id setisactive loadlocks data status listener from m table get raw info and add current row information update the current row redistribute fire data status event param e event public void data status changed data status event e log fine m vo tab no e to string int old current row e get current row m datastatusevent e save it when sorted set current row to 0 string msg m datastatusevent getad message if msg null msg equals sorted set current row 0 true set current row m datastatusevent set current row m currentrow same row update value if old current row m currentrow m field field m mtable get field e get changed column if field null object value m mtable get value at m currentrow e get changed column field set value value m mtable is inserting else redistribute info with current row info fire data status changed m datastatusevent log fine data status changed m vo tab no fini e to string mtable datastatuschanged datastatusevent m_vo tabno tostring oldcurrentrow getcurrentrow m_datastatusevent m_datastatusevent getad_message setcurrentrow m_datastatusevent setcurrentrow m_currentrow oldcurrentrow m_currentrow mfield m_mtable getfield getchangedcolumn m_mtable getvalueat m_currentrow getchangedcolumn setvalue m_mtable isinserting firedatastatuschanged m_datastatusevent datastatuschanged m_vo tabno tostring inform listeners and build who info param e event private void fire data status changed data status event e data status listener listeners m listenerlist get listeners data status listener class if listeners length 0 return log fine e to string who info if e get current row 0 e created timestamp get value created e created by integer get value created by e updated timestamp get value updated e updated by integer get value updated by e record id get value m keycolumnname info string buffer info new string buffer get table name we have a key column if m keycolumnname null m keycolumnname length 0 info append append m keycolumnname append append e record id else we have multiple parents for int i 0 i m parents size i string key col string m parents get i info append append key col append append get value key col e info info to string e set inserting m mtable is inserting distribute fire it for int i 0 i listeners length i listeners i data status changed e log fine fini e to string firedatastatuschanged datastatusevent datastatuslistener m_listenerlist getlisteners datastatuslistener tostring getcurrentrow getvalue createdby getvalue createdby getvalue updatedby getvalue updatedby record_id getvalue m_keycolumnname stringbuffer stringbuffer gettablename m_keycolumnname m_keycolumnname m_keycolumnname record_id m_parents keycol m_parents keycol getvalue keycol tostring setinserting m_mtable isinserting datastatuschanged tostring create and fire data status error event param ad message message param info info param is error if not true it is a warning protected void fire data statuse event string ad message string info boolean is error m mtable fire data statuse event ad message info is error ad_message iserror firedatastatuseevent ad_message iserror m_mtable firedatastatuseevent ad_message iserror create and fire data status error event from error log param error log log protected void fire data statuse event value name pair error log if error log null m mtable fire data statuse event error log errorlog firedatastatuseevent valuenamepair errorlog errorlog m_mtable firedatastatuseevent errorlog get current row return current row public int get current row if m currentrow verify row m currentrow set current row m mtable get row count 1 true return m currentrow getcurrentrow m_currentrow verifyrow m_currentrow setcurrentrow m_mtable getrowcount m_currentrow get current table key id return record id public int getrecord id return m mtable get keyid m currentrow record_id getrecord_id m_mtable getkeyid m_currentrow get key id of row param row row number return the key id of the row or 1 if not found public int get keyid int row return m mtable get keyid row getkeyid m_mtable getkeyid navigate absolute goto row zero based does nothing if in current row saves old row if required param target row target row return current row public int navigate int target row nothing to do if target row m currentrow return m currentrow log info row target row row range check int new row verify row target row check if we have old uncommitted data m mtable data save new row false new position return set current row new row true targetrow targetrow targetrow m_currentrow m_currentrow targetrow newrow verifyrow targetrow m_mtable datasave newrow setcurrentrow newrow navigate relatively i e plus minus from current position param row change row change return current row public int navigate relative int row change return navigate m currentrow row change rowchange navigaterelative rowchange m_currentrow rowchange navigate to current now reload return current row public int navigate current log info row m currentrow return set current row m currentrow true navigatecurrent m_currentrow setcurrentrow m_currentrow row range check param target row target row return checked row private int verify row int target row int new row target row table open if m mtable is open log severe table not open return 1 row count int rows get row count if rows 0 log fine no rows return 1 if new row rows new row rows 1 log fine set to max row new row else if new row 0 new row 0 log fine set to first row return new row targetrow verifyrow targetrow newrow targetrow m_mtable isopen getrowcount newrow newrow newrow newrow newrow newrow set current row and load data into fields if there is no row load nulls param new current row new current row param fire events fire events return current row private int set current row int new current row boolean fire events int old current row m currentrow m currentrow verify row new current row log fine row m currentrow fire fire events update field values int size m mtable get column count for int i 0 i size i m field m field m mtable get field i get value from table if m currentrow 0 object value m mtable get value at m currentrow i m field set value value m mtable is inserting if m mtable is inserting set invalid values to null m field validate value else no rows set to a reasonable value not updateable object value null if m field is key m field is parent m field get column name equals m linkcolumnname value m field get default m field set value load dependent info if fire events prevents informing twice return m currentrow inform v table row changed m propertychangesupport fire property change property old current row m currentrow inform a panel data status with row updated if m datastatusevent null m datastatusevent new data status event this get row count m mtable is inserting changed env is auto commit env get ctx m vo window no m mtable is inserting m datastatusevent set current row m currentrow string status m datastatusevent getad message if status null status length 0 m datastatusevent set info navigate or update null false false fire data status changed m datastatusevent return m currentrow newcurrentrow fireevents setcurrentrow newcurrentrow fireevents oldcurrentrow m_currentrow m_currentrow verifyrow newcurrentrow m_currentrow fireevents m_mtable getcolumncount mfield mfield m_mtable getfield m_currentrow m_mtable getvalueat m_currentrow mfield setvalue m_mtable isinserting m_mtable isinserting mfield validatevalue mfield iskey mfield isparent mfield getcolumnname m_linkcolumnname mfield getdefault mfield setvalue loaddependentinfo fireevents m_currentrow vtable rowchanged m_propertychangesupport firepropertychange oldcurrentrow m_currentrow apanel datastatus m_datastatusevent m_datastatusevent datastatusevent getrowcount m_mtable isinserting isautocommit getctx m_vo windowno m_mtable isinserting m_datastatusevent setcurrentrow m_currentrow m_datastatusevent getad_message m_datastatusevent setinfo navigateorupdate firedatastatuschanged m_datastatusevent m_currentrow get row count return row count public int get row count int count m mtable get row count wait a bit if currently loading if count 0 m mtable is loading try thread sleep 100 1 sec catch exception e count m mtable get row count return count rowcount getrowcount m_mtable getrowcount m_mtable isloading m_mtable getrowcount get column field count return field count public int get field count return m mtable get column count getfieldcount m_mtable getcolumncount get field by index param index index return m field public m field get field int index return m mtable get field index mfield mfield getfield m_mtable getfield get field by db column name param column name column name return m field public m field get field string column name return m mtable get field column name columnname mfield mfield getfield columnname m_mtable getfield columnname get all fields return m fields public m field get fields return m mtable get fields mfields mfield getfields m_mtable getfields set new value call callout param column name database column name param value value return error message or public string set value string column name object value if column name null return no column return set value m mtable get field column name value columnname setvalue columnname columnname nocolumn setvalue m_mtable getfield columnname set new value call callout param field field param value value return error message or public string set value m field field object value if field null return no field log fine field get column name value row m currentrow int col m mtable find column field get column name m mtable set value at value m currentrow col false return process field change field setvalue mfield nofield getcolumnname m_currentrow m_mtable findcolumn getcolumnname m_mtable setvalueat m_currentrow processfieldchange is processed return true if current record is processed public boolean is processed int index m mtable find column processed if index 1 object oo m mtable get value at m currentrow index if oo instanceof string return y equals oo if oo instanceof boolean return boolean oo boolean value return y equals env get context m vo ctx m vo window no processed isprocessed m_mtable findcolumn m_mtable getvalueat m_currentrow booleanvalue getcontext m_vo m_vo windowno process field change evaluate dependencies and process callouts called from m tab set value or grid controller data status changed param changed field changed field return error message or public string process field change m field changed field process dependencies changed field return process callout changed field mtab setvalue gridcontroller datastatuschanged changedfield processfieldchange mfield changedfield processdependencies changedfield processcallout changedfield evaluate dependencies param changed field changed field private void process dependencies m field changed field string column name changed field get column name log trace log l4 data changed column column name when column name is not in list of dependent on fields fini if has dependants column name return get dependent m fields may be because of display or dynamic lookup array list list get dependant list column name for int i 0 i list size i m field dependent field m field list get i log trace log l5 ddata dependent field dependent field null null dependent field get column name if the field has a lookup if dependent field null dependent field get lookup instanceof m lookup m lookup m lookup m lookup dependent field get lookup log trace log l6 database lookup validation m lookup get validation if the lookup is dynamic i e contains this column name as variable if m lookup get validation index of column name 1 log fine column name changed dependent field get column name set to null invalidate current selection set value dependent field null for all dependent fields changedfield processdependencies mfield changedfield columnname changedfield getcolumnname l4_data columnname dependenton hasdependants columnname mfields arraylist getdependantlist columnname mfield dependentfield mfield l5_ddata dependentfield dependentfield getcolumnname dependentfield dependentfield getlookup mlookup mlookup mlookup mlookup dependentfield getlookup l6_database mlookup getvalidation columnname mlookup getvalidation indexof columnname columnname dependentfield getcolumnname setvalue dependentfield process callout s p the callout is in the string of class method class method if there is no class name i e only a method name the class is regarded as callout system the class needs to comply with the interface callout for a limited time the old notation of sx matheod ux menthod is maintained param field field return error message or see org compiere model callout private string process callout m field field string callout field get callout if callout length 0 return if is processed only active records return doc processed object value field get value object old value field get old value log fine field get column name value callout old old value string tokenizer st new string tokenizer callout false while st has more tokens for each callout string cmd st next token trim callout call null string method null int method start cmd last index of try if method start 1 no class class c class class for name cmd substring 0 method start call callout c class new instance method cmd substring method start 1 catch exception e log log level severe class e return callout invalid cmd e to string if call null method null method length 0 return callout invalid method string ret value try ret value call start m vo ctx method m vo window no this field value old value catch exception e log log level severe start e ret value callout invalid e to string return ret value if ret value equals interrupt on first error log severe ret value return ret value for each callout return calloutsystem sx_matheod ux_menthod processcallout mfield getcallout isprocessed docprocessed getvalue oldvalue getoldvalue getcolumnname oldvalue stringtokenizer stringtokenizer hasmoretokens nexttoken methodstart lastindexof methodstart cclass forname methodstart cclass newinstance methodstart tostring retvalue retvalue m_vo m_vo windowno oldvalue retvalue tostring retvalue retvalue retvalue retvalue get value of field with column name param column name column name return value public object get value string column name if column name null return null m field field m mtable get field column name return get value field columnname columnname getvalue columnname columnname mfield m_mtable getfield columnname getvalue get value of field param field field return value public object get value m field field if field null return null return field get value getvalue mfield getvalue get value of field in row param row row param column name column name return value public object get value int row string column name int col m mtable find column column name if col 1 return null return m mtable get value at row col columnname getvalue columnname m_mtable findcolumn columnname m_mtable getvalueat to string return string representation public string to string string ret value m tab m vo tab no if m vo null ret value m vo name m vo ad tab id return ret value tostring tostring retvalue mtab m_vo tabno m_vo retvalue m_vo m_vo ad_tab_id retvalue param l listener public synchronized void remove property change listener property change listener l m propertychangesupport remove property change listener l removepropertychangelistener propertychangelistener m_propertychangesupport removepropertychangelistener param l listener public synchronized void add property change listener property change listener l m propertychangesupport add property change listener l addpropertychangelistener propertychangelistener m_propertychangesupport addpropertychangelistener param l listener public synchronized void remove data status listener data status listener l m listenerlist remove data status listener class l removedatastatuslistener datastatuslistener m_listenerlist datastatuslistener param l listener public synchronized void add data status listener data status listener l m listenerlist add data status listener class l adddatastatuslistener datastatuslistener m_listenerlist datastatuslistener get contents return contents public object get contents return contents getcontents constructor public setup c logger get info compiere get summary ascii enable events awt event window event mask set default close operation j frame exit on close add window listener this try jb init catch exception e e print stack trace system exit 1 init panel a env show center screen this try set cursor cursor get predefined cursor cursor wait cursor configuration panel dyn init a env position center screen this set cursor cursor get default cursor catch exception e e print stack trace system exit 1 clogger getsummaryascii enableevents awtevent window_event_mask setdefaultcloseoperation jframe exit_on_close addwindowlistener jbinit printstacktrace aenv showcenterscreen setcursor getpredefinedcursor wait_cursor configurationpanel dyninit aenv positioncenterscreen setcursor getdefaultcursor printstacktrace static init throws exception private void jb init throws exception this set icon image compiere get image16 content pane j panel this get content pane content pane set layout border layout this set title res get string compiere server setup status bar set border border factory create lowered bevel border status bar set text menu file set text res get string file menu file exit set text res get string exit menu file exit add action listener this menu help set text res get string help menu help info set text res get string help menu help info add action listener this border layout set hgap 5 border layout set vgap 5 menu file add menu file exit menu help add menu help info menu bar add menu file menu bar add menu help this setj menu bar menu bar content pane add status bar border layout south content pane add configuration panel border layout center jbinit seticonimage getimage16 contentpane jpanel getcontentpane contentpane setlayout borderlayout settitle getstring compiereserversetup statusbar setborder borderfactory createloweredbevelborder statusbar settext menufile settext getstring menufileexit settext getstring menufileexit addactionlistener menuhelp settext getstring menuhelpinfo settext getstring menuhelpinfo addactionlistener borderlayout sethgap borderlayout setvgap menufile menufileexit menuhelp menuhelpinfo menubar menufile menubar menuhelp setjmenubar menubar contentpane statusbar borderlayout contentpane configurationpanel borderlayout action listener param e event public void action performed action event e if e get source menu file exit system exit 0 else if e get source menu help info new setup help this actionlistener actionperformed actionevent getsource menufileexit getsource menuhelpinfo setup_help start param args log level e g all fine public static void main string args c log mgt initialize true handler file handler new c log file system get property user dir false false c log mgt add handler file handler log level if args length 0 c log mgt set level args 0 else c log mgt set level level info file loger at least fine if file handler get level int value level fine int value file handler set level level fine new setup clogmgt filehandler clogfile getproperty clogmgt addhandler filehandler clogmgt setlevel clogmgt setlevel filehandler getlevel intvalue intvalue filehandler setlevel get tax line for invoice line param line invoice line param precision currency precision param old tax if true old tax is returned param trx name transaction name return existing or new tax public static m invoice tax get m invoice line line int precision boolean old tax string trx name m invoice tax ret value null if line null line getc invoice id 0 return null int c tax id line getc tax id if old tax line is valuechanged c tax id object old line get valueold c tax id if old null return null c tax id integer old int value if c tax id 0 s log warning get c tax id 0 return null string sql select from c invoicetax where c invoice id and c tax id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 line getc invoice id pstmt set int 2 c tax id result set rs pstmt execute query if rs next ret value new m invoice tax line get ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null ret value set trxname trx name ret value set precision precision s log fine get old old tax ret value return ret value create new ret value new m invoice tax line get ctx 0 trx name ret value set trxname trx name ret value set client org line ret value setc invoice id line getc invoice id ret value setc tax id line getc tax id ret value set precision precision ret value set is tax included line is tax included s log fine get new ret value return ret value oldtax trxname minvoicetax minvoiceline oldtax trxname minvoicetax retvalue getc_invoice_id c_tax_id getc_tax_id oldtax is_valuechanged c_tax_id get_valueold c_tax_id c_tax_id intvalue c_tax_id s_log c_tax_id c_invoicetax c_invoice_id c_tax_id preparedstatement preparestatement trxname setint getc_invoice_id setint c_tax_id resultset executequery retvalue minvoicetax getctx trxname s_log retvalue retvalue set_trxname trxname retvalue setprecision s_log oldtax retvalue retvalue retvalue minvoicetax getctx trxname retvalue set_trxname trxname retvalue setclientorg retvalue setc_invoice_id getc_invoice_id retvalue setc_tax_id getc_tax_id retvalue setprecision retvalue setistaxincluded istaxincluded s_log retvalue retvalue persistency constructor param ctx context param ignored ignored public m invoice tax properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set tax amt env zero set tax base amt env zero set is tax included false minvoicetax trxname trxname illegalargumentexception settaxamt settaxbaseamt setistaxincluded load constructor set precision and tax included for tax calculations param ctx context param rs result set public m invoice tax properties ctx result set rs string trx name super ctx rs trx name taxincluded minvoicetax resultset trxname trxname get precision return returns the precision or 2 private int get precision if m precision null return 2 return m precision int value getprecision m_precision m_precision intvalue set precision param precision the precision to set protected void set precision int precision m precision new integer precision setprecision m_precision get tax return tax protected m tax get tax if m tax null m tax m tax get get ctx getc tax id return m tax mtax gettax m_tax m_tax mtax getctx getc_tax_id m_tax calculate set tax base amt from invoice lines public boolean calculate tax from lines big decimal tax base amt env zero big decimal tax amt env zero boolean document level get tax is document level m tax tax get tax string sql select line net amt coalesce tax amt 0 from c invoiceline where c invoice id and c tax id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoice id pstmt set int 2 getc tax id result set rs pstmt execute query while rs next big decimal base amt rs get big decimal 1 big decimal amt rs get big decimal 2 if amt null amt env zero tax base amt tax base amt add base amt if document level amt signum 0 calculate line tax amt tax calculate tax base amt is tax included get precision tax amt tax amt add amt rs close pstmt close pstmt null catch exception e log log level severe set tax base amt e tax base amt null try if pstmt null pstmt close pstmt null catch exception e pstmt null if tax base amt null return false calculate tax if tax amt signum 0 tax amt tax calculate tax tax base amt is tax included get precision set tax amt tax amt set base if is tax included set tax base amt tax base amt subtract tax amt else set tax base amt tax base amt return true calculatetaxfromlines bigdecimal taxbaseamt bigdecimal taxamt documentlevel gettax isdocumentlevel mtax gettax linenetamt taxamt c_invoiceline c_invoice_id c_tax_id preparedstatement preparestatement get_trxname setint getc_invoice_id setint getc_tax_id resultset executequery bigdecimal baseamt getbigdecimal bigdecimal getbigdecimal taxbaseamt taxbaseamt baseamt documentlevel calculatetax baseamt istaxincluded getprecision taxamt taxamt settaxbaseamt taxbaseamt taxbaseamt taxamt taxamt calculatetax taxbaseamt istaxincluded getprecision settaxamt taxamt istaxincluded settaxbaseamt taxbaseamt taxamt settaxbaseamt taxbaseamt string representation return info public string to string string buffer sb new string buffer m invoice tax sb append c invoice id append getc invoice id append c tax id append getc tax id append base append get tax base amt append tax append get tax amt append return sb to string tostring stringbuffer stringbuffer minvoicetax c_invoice_id getc_invoice_id c_tax_id getc_tax_id gettaxbaseamt gettaxamt tostring standard constructor public x i bpartner properties ctx int i bpartner id string trx name super ctx i bpartner id trx name if i bpartner id 0 seti bpartner id 0 seti isimported false n x_i_bpartner i_bpartner_id trxname i_bpartner_id trxname i_bpartner_id seti_bpartner_id seti_isimported load constructor public x i bpartner properties ctx result set rs string trx name super ctx rs trx name x_i_bpartner resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i bpartner append get id append return sb to string tostring stringbuffer stringbuffer x_i_bpartner get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set address 1 address line 1 for this location public void set address1 string address1 if address1 null address1 length 60 log warning length 60 truncated address1 address1 substring 0 59 set value address1 address1 setaddress1 set_value get address 1 address line 1 for this location public string get address1 return string get value address1 getaddress1 get_value set address 2 address line 2 for this location public void set address2 string address2 if address2 null address2 length 60 log warning length 60 truncated address2 address2 substring 0 59 set value address2 address2 setaddress2 set_value get address 2 address line 2 for this location public string get address2 return string get value address2 getaddress2 get_value set bp contact greeting greeting for business partner contact public void setbp contact greeting string bp contact greeting if bp contact greeting null bp contact greeting length 60 log warning length 60 truncated bp contact greeting bp contact greeting substring 0 59 set value bp contact greeting bp contact greeting setbpcontactgreeting bpcontactgreeting bpcontactgreeting bpcontactgreeting bpcontactgreeting bpcontactgreeting set_value bpcontactgreeting bpcontactgreeting get bp contact greeting greeting for business partner contact public string getbp contact greeting return string get value bp contact greeting getbpcontactgreeting get_value bpcontactgreeting set birthday birthday or anniversary day public void set birthday timestamp birthday set value birthday birthday setbirthday set_value get birthday birthday or anniversary day public timestamp get birthday return timestamp get value birthday getbirthday get_value set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 0 set value c bp group id null else set value c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id set_value c_bp_group_id set_value c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set country country public void setc country id int c country id if c country id 0 set value c country id null else set value c country id new integer c country id setc_country_id c_country_id c_country_id set_value c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set greeting greeting to print on correspondence public void setc greeting id int c greeting id if c greeting id 0 set value c greeting id null else set value c greeting id new integer c greeting id setc_greeting_id c_greeting_id c_greeting_id set_value c_greeting_id set_value c_greeting_id c_greeting_id get greeting greeting to print on correspondence public int getc greeting id integer ii integer get value c greeting id if ii null return 0 return ii int value getc_greeting_id get_value c_greeting_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set city identifies a city public void set city string city if city null city length 60 log warning length 60 truncated city city substring 0 59 set value city city setcity set_value get city identifies a city public string get city return string get value city getcity get_value set comments comments or additional information public void set comments string comments if comments null comments length 2000 log warning length 2000 truncated comments comments substring 0 1999 set value comments comments setcomments set_value get comments comments or additional information public string get comments return string get value comments getcomments get_value set contact description description of contact public void set contact description string contact description if contact description null contact description length 255 log warning length 255 truncated contact description contact description substring 0 254 set value contact description contact description setcontactdescription contactdescription contactdescription contactdescription contactdescription contactdescription set_value contactdescription contactdescription get contact description description of contact public string get contact description return string get value contact description getcontactdescription get_value contactdescription set contact name business partner contact name public void set contact name string contact name if contact name null contact name length 60 log warning length 60 truncated contact name contact name substring 0 59 set value contact name contact name setcontactname contactname contactname contactname contactname contactname set_value contactname contactname get contact name business partner contact name public string get contact name return string get value contact name getcontactname get_value contactname set iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public void set country code string country code if country code null country code length 2 log warning length 2 truncated country code country code substring 0 1 set value country code country code iso_3166 setcountrycode countrycode countrycode countrycode countrycode countrycode set_value countrycode countrycode get iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public string get country code return string get value country code iso_3166 getcountrycode get_value countrycode set d u n s dun bradstreet number public void setduns string duns if duns null duns length 11 log warning length 11 truncated duns duns substring 0 10 set value duns duns set_value get d u n s dun bradstreet number public string getduns return string get value duns get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set fax facsimile number public void set fax string fax if fax null fax length 40 log warning length 40 truncated fax fax substring 0 39 set value fax fax setfax set_value get fax facsimile number public string get fax return string get value fax getfax get_value set group key business partner group key public void set group value string group value if group value null group value length 40 log warning length 40 truncated group value group value substring 0 39 set value group value group value setgroupvalue groupvalue groupvalue groupvalue groupvalue groupvalue set_value groupvalue groupvalue get group key business partner group key public string get group value return string get value group value getgroupvalue get_value groupvalue set import business partner public void seti bpartner id int i bpartner id if i bpartner id 1 throw new illegal argument exception i bpartner id is mandatory set valuenocheck i bpartner id new integer i bpartner id seti_bpartner_id i_bpartner_id i_bpartner_id illegalargumentexception i_bpartner_id set_valuenocheck i_bpartner_id i_bpartner_id get import business partner public int geti bpartner id integer ii integer get value i bpartner id if ii null return 0 return ii int value geti_bpartner_id get_value i_bpartner_id intvalue set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set interest area name of the interest area public void set interest area name string interest area name if interest area name null interest area name length 40 log warning length 40 truncated interest area name interest area name substring 0 39 set value interest area name interest area name setinterestareaname interestareaname interestareaname interestareaname interestareaname interestareaname set_value interestareaname interestareaname get interest area name of the interest area public string get interest area name return string get value interest area name getinterestareaname get_value interestareaname set naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public void setnaics string naics if naics null naics length 6 log warning length 6 truncated naics naics substring 0 5 set value naics naics set_value get naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public string getnaics return string get value naics get_value set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set name 2 additional name public void set name2 string name2 if name2 null name2 length 60 log warning length 60 truncated name2 name2 substring 0 59 set value name2 name2 setname2 set_value get name 2 additional name public string get name2 return string get value name2 getname2 get_value set password password of any length case sensitive public void set password string password if password null password length 20 log warning length 20 truncated password password substring 0 19 set value password password setpassword set_value get password password of any length case sensitive public string get password return string get value password getpassword get_value set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set value phone phone setphone set_value get phone identifies a telephone number public string get phone return string get value phone getphone get_value set 2nd phone identifies an alternate telephone number public void set phone2 string phone2 if phone2 null phone2 length 40 log warning length 40 truncated phone2 phone2 substring 0 39 set value phone2 phone2 setphone2 set_value get 2nd phone identifies an alternate telephone number public string get phone2 return string get value phone2 getphone2 get_value set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal set_value get zip postal code public string get postal return string get value postal getpostal get_value set additional zip or postal code public void setpostal add string postal add if postal add null postal add length 10 log warning length 10 truncated postal add postal add substring 0 9 set value postal add postal add setpostal_add postal_add postal_add postal_add postal_add postal_add set_value postal_add postal_add get additional zip or postal code public string getpostal add return string get value postal add getpostal_add get_value postal_add set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set interest area interest area or topic public void setr interestarea id int r interestarea id if r interestarea id 0 set value r interestarea id null else set value r interestarea id new integer r interestarea id setr_interestarea_id r_interestarea_id r_interestarea_id set_value r_interestarea_id set_value r_interestarea_id r_interestarea_id get interest area interest area or topic public int getr interestarea id integer ii integer get value r interestarea id if ii null return 0 return ii int value getr_interestarea_id get_value r_interestarea_id intvalue set region name of the region public void set region name string region name if region name null region name length 60 log warning length 60 truncated region name region name substring 0 59 set value region name region name setregionname regionname regionname regionname regionname regionname set_value regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname set tax id tax identification public void set taxid string taxid if taxid null taxid length 20 log warning length 20 truncated taxid taxid substring 0 19 set value taxid taxid settaxid set_value get tax id tax identification public string get taxid return string get value taxid gettaxid get_value set title name this entity is referred to as public void set title string title if title null title length 40 log warning length 40 truncated title title substring 0 39 set value title title settitle set_value get title name this entity is referred to as public string get title return string get value title gettitle get_value set search key search key for the record in the format required must be unique public void set value string value if value null value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue default constructor creates the lt applet gt element br use set methods public applet determines the base url for this applet param url base url for this applet public applet set code base string url add attribute codebase url return this setcodebase addattribute comma seperated archive list param url comma seperate archive list public applet set archive string url add attribute archive url return this setarchive addattribute applet class file param code applet class file public applet set code string code add attribute code code return this setcode addattribute suggested height of applet param height suggested link height public applet set height string height add attribute height height return this setheight addattribute suggested height of applet param height suggested link height public applet set height int height add attribute height integer to string height return this setheight addattribute tostring suggested height of applet param height suggested link height public applet set height double height add attribute height double to string height return this setheight addattribute tostring suggested width of applet param height suggested link width public applet set width string width add attribute width width return this setwidth addattribute suggested width of applet param height suggested link width public applet set width int width add attribute width integer to string width return this setwidth addattribute tostring suggested width of object param height suggested link width public applet set width double width add attribute width double to string width return this setwidth addattribute tostring suggested horizontal gutter param hspace suggested horizontal gutter public applet seth space string hspace add attribute hspace hspace return this sethspace addattribute suggested horizontal gutter param hspace suggested horizontal gutter public applet seth space int hspace add attribute hspace integer to string hspace return this sethspace addattribute tostring suggested horizontal gutter param hspace suggested horizontal gutter public applet seth space double hspace add attribute hspace double to string hspace return this sethspace addattribute tostring suggested vertical gutter param hspace suggested vertical gutter public applet setv space string vspace add attribute vspace vspace return this setvspace addattribute suggested vertical gutter param hspace suggested vertical gutter public applet setv space int vspace add attribute vspace integer to string vspace return this setvspace addattribute tostring suggested vertical gutter param hspace suggested vertical gutter public applet setv space double vspace add attribute vspace double to string vspace return this setvspace addattribute tostring set the horizontal or vertical alignment of this applet br convience variables are in the align types interface param alignment set the horizontal or vertical alignment of this applet br convience variables are in the align types interface public applet set align string alignment add attribute align alignment return this aligntypes aligntypes setalign addattribute set the name of this applet param name set the name of this applet public applet set name string name add attribute name name return this setname addattribute serialized applet file param object serialized applet file someone give me a better description of what this does public applet set object string object add attribute object object return this setobject addattribute breif description alternate text for the applet param alt alternat text public applet set alt string alt add attribute alt alt return this setalt addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public applet add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public applet add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add an element to the element param element a string representation of the element public applet add element string element add element to registry element return this addelement addelementtoregistry add an element to the element param element an element to add public applet add element element element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public applet remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry standard constructor public x i invoice properties ctx int i invoice id string trx name super ctx i invoice id trx name if i invoice id 0 seti invoice id 0 seti isimported false x_i_invoice i_invoice_id trxname i_invoice_id trxname i_invoice_id seti_invoice_id seti_isimported load constructor public x i invoice properties ctx result set rs string trx name super ctx rs trx name x_i_invoice resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i invoice append get id append return sb to string tostring stringbuffer stringbuffer x_i_invoice get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set address 1 address line 1 for this location public void set address1 string address1 if address1 null address1 length 60 log warning length 60 truncated address1 address1 substring 0 59 set value address1 address1 setaddress1 set_value get address 1 address line 1 for this location public string get address1 return string get value address1 getaddress1 get_value set address 2 address line 2 for this location public void set address2 string address2 if address2 null address2 length 60 log warning length 60 truncated address2 address2 substring 0 59 set value address2 address2 setaddress2 set_value get address 2 address line 2 for this location public string get address2 return string get value address2 getaddress2 get_value set business partner key key of the business partner public void setb partner value string b partner value if b partner value null b partner value length 40 log warning length 40 truncated b partner value b partner value substring 0 39 set value b partner value b partner value setbpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue set_value bpartnervalue bpartnervalue get business partner key key of the business partner public string getb partner value return string get value b partner value getbpartnervalue get_value bpartnervalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set country country public void setc country id int c country id if c country id 0 set value c country id null else set value c country id new integer c country id setc_country_id c_country_id c_country_id set_value c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set value c invoiceline id null else set value c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_value c_invoiceline_id set_value c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 0 set value c paymentterm id null else set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id set_value c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 0 set value c tax id null else set value c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id set_value c_tax_id set_value c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set city identifies a city public void set city string city if city null city length 60 log warning length 60 truncated city city substring 0 59 set value city city setcity set_value get city identifies a city public string get city return string get value city getcity get_value set contact name business partner contact name public void set contact name string contact name if contact name null contact name length 60 log warning length 60 truncated contact name contact name substring 0 59 set value contact name contact name setcontactname contactname contactname contactname contactname contactname set_value contactname contactname get contact name business partner contact name public string get contact name return string get value contact name getcontactname get_value contactname set iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public void set country code boolean country code set value country code new boolean country code iso_3166 setcountrycode countrycode set_value countrycode countrycode get iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public boolean is country code object oo get value country code if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iso_3166 iscountrycode get_value countrycode booleanvalue set account date accounting date public void set date acct timestamp date acct set value date acct date acct setdateacct dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date invoiced date printed on invoice public void set date invoiced timestamp date invoiced set value date invoiced date invoiced setdateinvoiced dateinvoiced set_value dateinvoiced dateinvoiced get date invoiced date printed on invoice public timestamp get date invoiced return timestamp get value date invoiced getdateinvoiced get_value dateinvoiced set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document type name name of the document type public void set doc type name string doc type name if doc type name null doc type name length 60 log warning length 60 truncated doc type name doc type name substring 0 59 set value doc type name doc type name setdoctypename doctypename doctypename doctypename doctypename doctypename set_value doctypename doctypename get document type name name of the document type public string get doc type name return string get value doc type name getdoctypename get_value doctypename set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set import invoice import invoice public void seti invoice id int i invoice id if i invoice id 1 throw new illegal argument exception i invoice id is mandatory set valuenocheck i invoice id new integer i invoice id seti_invoice_id i_invoice_id i_invoice_id illegalargumentexception i_invoice_id set_valuenocheck i_invoice_id i_invoice_id get import invoice import invoice public int geti invoice id integer ii integer get value i invoice id if ii null return 0 return ii int value geti_invoice_id get_value i_invoice_id intvalue set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set line description description of the line public void set line description string line description if line description null line description length 255 log warning length 255 truncated line description line description substring 0 254 set value line description line description setlinedescription linedescription linedescription linedescription linedescription linedescription set_value linedescription linedescription get line description description of the line public string get line description return string get value line description getlinedescription get_value linedescription set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set value m pricelist id null else set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_value m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set payment term key key of the payment term public void set payment term value string payment term value if payment term value null payment term value length 40 log warning length 40 truncated payment term value payment term value substring 0 39 set value payment term value payment term value setpaymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue set_value paymenttermvalue paymenttermvalue get payment term key key of the payment term public string get payment term value return string get value payment term value getpaymenttermvalue get_value paymenttermvalue set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set value phone phone setphone set_value get phone identifies a telephone number public string get phone return string get value phone getphone get_value set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal set_value get zip postal code public string get postal return string get value postal getpostal get_value set unit price actual price public void set price actual big decimal price actual set value price actual price actual setpriceactual bigdecimal priceactual set_value priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set product key key of the product public void set product value string product value if product value null product value length 40 log warning length 40 truncated product value product value substring 0 39 set value product value product value setproductvalue productvalue productvalue productvalue productvalue productvalue set_value productvalue productvalue get product key key of the product public string get product value return string get value product value getproductvalue get_value productvalue set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered set value qty ordered qty ordered setqtyordered bigdecimal qtyordered set_value qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set region name of the region public void set region name string region name if region name null region name length 60 log warning length 60 truncated region name region name substring 0 59 set value region name region name setregionname regionname regionname regionname regionname regionname set_value regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set value sku sku set_value get sku stock keeping unit public string getsku return string get value sku get_value public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt set value tax amt tax amt settaxamt bigdecimal taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt set tax indicator short form for tax to be printed on documents public void set tax indicator string tax indicator if tax indicator null tax indicator length 5 log warning length 5 truncated tax indicator tax indicator substring 0 4 set value tax indicator tax indicator settaxindicator taxindicator taxindicator taxindicator taxindicator taxindicator set_value taxindicator taxindicator get tax indicator short form for tax to be printed on documents public string get tax indicator return string get value tax indicator gettaxindicator get_value taxindicator set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value standard constructor public x w countercount properties ctx int w countercount id string trx name super ctx w countercount id trx name if w countercount id 0 set name null set pageurl null setw countercount id 0 x_w_countercount w_countercount_id trxname w_countercount_id trxname w_countercount_id setname setpageurl setw_countercount_id load constructor public x w countercount properties ctx result set rs string trx name super ctx rs trx name x_w_countercount resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w countercount append get id append return sb to string tostring stringbuffer stringbuffer x_w_countercount get_id tostring public static final int c bpartner id ad reference id 232 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set counter count value public void set counter int counter throw new illegal argument exception counter is virtual column setcounter illegalargumentexception get counter count value public int get counter integer ii integer get value counter if ii null return 0 return ii int value getcounter get_value intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set page url public void set pageurl string pageurl if pageurl null throw new illegal argument exception pageurl is mandatory if pageurl length 120 log warning length 120 truncated pageurl pageurl substring 0 119 set value pageurl pageurl setpageurl illegalargumentexception set_value get page url public string get pageurl return string get value pageurl getpageurl get_value set counter count web counter count management public void setw countercount id int w countercount id if w countercount id 1 throw new illegal argument exception w countercount id is mandatory set valuenocheck w countercount id new integer w countercount id setw_countercount_id w_countercount_id w_countercount_id illegalargumentexception w_countercount_id set_valuenocheck w_countercount_id w_countercount_id get counter count web counter count management public int getw countercount id integer ii integer get value w countercount id if ii null return 0 return ii int value getw_countercount_id get_value w_countercount_id intvalue prepare get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m pricelist version id p m pricelist version id para i get parameter as int else if name equals date value p datevalue timestamp para i get parameter else if name equals m warehouse id p m warehouse id para i get parameter as int else if name equals c currency id p c currency id para i get parameter as int else if name equals m costelement id p m costelement id para i get parameter as int if p datevalue null p datevalue new timestamp system current time millis processinfoparameter getparameter getparametername getparameter m_pricelist_version_id p_m_pricelist_version_id getparameterasint datevalue p_datevalue getparameter m_warehouse_id p_m_warehouse_id getparameterasint c_currency_id p_c_currency_id getparameterasint m_costelement_id p_m_costelement_id getparameterasint p_datevalue p_datevalue currenttimemillis perrform process pre fill table with qty on hand for warehouse and valuation date perform price calculations pre return message throws exception protected string do it throws exception log info m warehouse id p m warehouse id c currency id p c currency id date value p datevalue m pricelist version id p m pricelist version id m costelement id p m costelement id m warehouse wh m warehouse get get ctx p m warehouse id m client c m client get get ctx wh getad client id m acct schema as c get acct schema delete just to be sure string buffer sql new string buffer delete t inventoryvalue where ad pinstance id sql append getad pinstance id int no db execute update sql to string get trxname insert standard costs sql new string buffer insert into t inventoryvalue ad pinstance id m warehouse id m product id m attributesetinstance id ad client id ad org id cost standard select append getad pinstance id append w m warehouse id c m product id c m attributesetinstance id w ad client id w ad org id c current cost price from m warehouse w inner join ad clientinfo ci on w ad client id ci ad client id inner join c acctschema acs on ci c acctschema1 id acs c acctschema id inner join m cost c on acs c acctschema id c c acctschema id and acs m costtype id c m costtype id and c ad org id in 0 w ad org id inner join m costelement ce on c m costelement id ce m costelement id and ce costing method s and ce cost element type m where w m warehouse id append p m warehouse id int no insert std db execute update sql to string get trxname log fine inserted std no insert std if no insert std 0 return no standard costs found insert addl costs int no insert cost 0 if p m costelement id 0 sql new string buffer insert into t inventoryvalue ad pinstance id m warehouse id m product id m attributesetinstance id ad client id ad org id cost standard cost m costelement id select append getad pinstance id append w m warehouse id c m product id c m attributesetinstance id w ad client id w ad org id 0 c current cost price c m costelement id from m warehouse w inner join ad clientinfo ci on w ad client id ci ad client id inner join c acctschema acs on ci c acctschema1 id acs c acctschema id inner join m cost c on acs c acctschema id c c acctschema id and acs m costtype id c m costtype id and c ad org id in 0 w ad org id where w m warehouse id append p m warehouse id append and c m costelement id append p m costelement id append and not exists select from t inventoryvalue iv where iv ad pinstance id append getad pinstance id append and iv m warehouse id w m warehouse id and iv m product id c m product id and iv m attributesetinstance id c m attributesetinstance id no insert cost db execute update sql to string get trxname log fine inserted cost no insert cost update std cost records sql new string buffer update t inventoryvalue iv set cost m costelement id select c current cost price c m costelement id from m warehouse w inner join ad clientinfo ci on w ad client id ci ad client id inner join c acctschema acs on ci c acctschema1 id acs c acctschema id inner join m cost c on acs c acctschema id c c acctschema id and acs m costtype id c m costtype id and c ad org id in 0 w ad org id where c m costelement id p m costelement id and iv m warehouse id w m warehouse id and iv m product id c m product id and iv m attributesetinstance id c m attributesetinstance id where exists select from t inventoryvalue ivv where ivv ad pinstance id getad pinstance id and ivv m costelement id is null int no updated cost db execute update sql to string get trxname log fine updated cost no updated cost if no insert std no insert cost 0 return no costs found update constants yyyy mm dd hh24 mi ss mmmm jdbc timestamp format string my date p datevalue to string sql new string buffer update t inventoryvalue set append date value to date append my date substring 0 10 append 23 59 59 yyyy mm dd hh24 mi ss append m pricelist version id append p m pricelist version id append append c currency id append p c currency id no db execute update sql to string get trxname log fine constants no get current qty on hand with asi sql new string buffer update t inventoryvalue iv set qty on hand select sum qty on hand from m storage s inner join m locator l on l m locator id s m locator id where iv m product id s m product id and iv m warehouse id l m warehouse id and iv m attributesetinstance id s m attributesetinstance id where ad pinstance id append getad pinstance id append and iv m attributesetinstance id 0 no db execute update sql to string get trxname log fine qt hand with asi no get current qty on hand without asi sql new string buffer update t inventoryvalue iv set qty on hand select sum qty on hand from m storage s inner join m locator l on l m locator id s m locator id where iv m product id s m product id and iv m warehouse id l m warehouse id where ad pinstance id append getad pinstance id append and iv m attributesetinstance id 0 no db execute update sql to string get trxname log fine qt hand w o asi no adjust for valuation date sql new string buffer update t inventoryvalue iv set qty on hand select iv qty on hand nvl sum t movement qty 0 from m transaction t inner join m locator l on t m locator id l m locator id where t m product id iv m product id and t m attributesetinstance id iv m attributesetinstance id and t movement date iv date value and l m warehouse id iv m warehouse id where iv m attributesetinstance id 0 no db execute update sql to string get trxname log fine update with asi no sql new string buffer update t inventoryvalue iv set qty on hand select iv qty on hand nvl sum t movement qty 0 from m transaction t inner join m locator l on t m locator id l m locator id where t m product id iv m product id and t movement date iv date value and l m warehouse id iv m warehouse id where iv m attributesetinstance id 0 no db execute update sql to string get trxname log fine update w o asi no delete records w o on hand qty sql new string buffer delete t inventoryvalue where qty on hand 0 or qty on hand is null and ad pinstance id append getad pinstance id int no qty db execute update sql to string get trxname log fine no qty deleted no qty update prices no db execute update update t inventoryvalue iv set pricepo select currency convert po price list po c currency id iv c currency id iv date value null po ad client id po ad org id from m product po po where po m product id iv m product id and po is current vendor y and row num 1 price list select currency convert pp price list pl c currency id iv c currency id iv date value null pl ad client id pl ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id iv m product id and pp m pricelist version id iv m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id price std select currency convert pp price std pl c currency id iv c currency id iv date value null pl ad client id pl ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id iv m product id and pp m pricelist version id iv m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id price limit select currency convert pp price limit pl c currency id iv c currency id iv date value null pl ad client id pl ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id iv m product id and pp m pricelist version id iv m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id get trxname string msg if no 0 msg no prices convert if different currency if as getc currency id p c currency id sql new string buffer update t inventoryvalue iv set cost standard select currency convert iv cost standard acs c currency id iv c currency id iv date value null iv ad client id iv ad org id from c acctschema acs where acs c acctschema id as getc acctschema id cost select currency convert iv cost acs c currency id iv c currency id iv date value null iv ad client id iv ad org id from c acctschema acs where acs c acctschema id as getc acctschema id where ad pinstance id getad pinstance id no db execute update sql to string get trxname log fine conv qtyonhand doit m_warehouse_id p_m_warehouse_id c_currency_id p_c_currency_id datevalue p_datevalue m_pricelist_version_id p_m_pricelist_version_id m_costelement_id p_m_costelement_id mwarehouse mwarehouse getctx p_m_warehouse_id mclient mclient getctx getad_client_id macctschema getacctschema stringbuffer stringbuffer t_inventoryvalue ad_pinstance_id getad_pinstance_id executeupdate tostring get_trxname stringbuffer t_inventoryvalue ad_pinstance_id m_warehouse_id m_product_id m_attributesetinstance_id ad_client_id ad_org_id coststandard getad_pinstance_id m_warehouse_id m_product_id m_attributesetinstance_id ad_client_id ad_org_id currentcostprice m_warehouse ad_clientinfo ad_client_id ad_client_id c_acctschema c_acctschema1_id c_acctschema_id m_cost c_acctschema_id c_acctschema_id m_costtype_id m_costtype_id ad_org_id ad_org_id m_costelement m_costelement_id m_costelement_id costingmethod costelementtype m_warehouse_id p_m_warehouse_id noinsertstd executeupdate tostring get_trxname noinsertstd noinsertstd noinsertcost p_m_costelement_id stringbuffer t_inventoryvalue ad_pinstance_id m_warehouse_id m_product_id m_attributesetinstance_id ad_client_id ad_org_id coststandard m_costelement_id getad_pinstance_id m_warehouse_id m_product_id m_attributesetinstance_id ad_client_id ad_org_id currentcostprice m_costelement_id m_warehouse ad_clientinfo ad_client_id ad_client_id c_acctschema c_acctschema1_id c_acctschema_id m_cost c_acctschema_id c_acctschema_id m_costtype_id m_costtype_id ad_org_id ad_org_id m_warehouse_id p_m_warehouse_id m_costelement_id p_m_costelement_id t_inventoryvalue ad_pinstance_id getad_pinstance_id m_warehouse_id m_warehouse_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id noinsertcost executeupdate tostring get_trxname noinsertcost stringbuffer t_inventoryvalue m_costelement_id currentcostprice m_costelement_id m_warehouse ad_clientinfo ad_client_id ad_client_id c_acctschema c_acctschema1_id c_acctschema_id m_cost c_acctschema_id c_acctschema_id m_costtype_id m_costtype_id ad_org_id ad_org_id m_costelement_id p_m_costelement_id m_warehouse_id m_warehouse_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id t_inventoryvalue ad_pinstance_id getad_pinstance_id m_costelement_id noupdatedcost executeupdate tostring get_trxname noupdatedcost noinsertstd noinsertcost mydate p_datevalue tostring stringbuffer t_inventoryvalue datevalue to_date mydate m_pricelist_version_id p_m_pricelist_version_id c_currency_id p_c_currency_id executeupdate tostring get_trxname qtyonhand stringbuffer t_inventoryvalue qtyonhand qtyonhand m_storage m_locator m_locator_id m_locator_id m_product_id m_product_id m_warehouse_id m_warehouse_id m_attributesetinstance_id m_attributesetinstance_id ad_pinstance_id getad_pinstance_id m_attributesetinstance_id executeupdate tostring get_trxname qthand qtyonhand stringbuffer t_inventoryvalue qtyonhand qtyonhand m_storage m_locator m_locator_id m_locator_id m_product_id m_product_id m_warehouse_id m_warehouse_id ad_pinstance_id getad_pinstance_id m_attributesetinstance_id executeupdate tostring get_trxname qthand stringbuffer t_inventoryvalue qtyonhand qtyonhand movementqty m_transaction m_locator m_locator_id m_locator_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id movementdate datevalue m_warehouse_id m_warehouse_id m_attributesetinstance_id executeupdate tostring get_trxname stringbuffer t_inventoryvalue qtyonhand qtyonhand movementqty m_transaction m_locator m_locator_id m_locator_id m_product_id m_product_id movementdate datevalue m_warehouse_id m_warehouse_id m_attributesetinstance_id executeupdate tostring get_trxname onhand stringbuffer t_inventoryvalue qtyonhand qtyonhand ad_pinstance_id getad_pinstance_id noqty executeupdate tostring get_trxname noqty noqty executeupdate t_inventoryvalue currencyconvert pricelist c_currency_id c_currency_id datevalue ad_client_id ad_org_id m_product_po m_product_id m_product_id iscurrentvendor rownum pricelist currencyconvert pricelist c_currency_id c_currency_id datevalue ad_client_id ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id m_product_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id pricestd currencyconvert pricestd c_currency_id c_currency_id datevalue ad_client_id ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id m_product_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id pricelimit currencyconvert pricelimit c_currency_id c_currency_id datevalue ad_client_id ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id m_product_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id get_trxname getc_currency_id p_c_currency_id stringbuffer t_inventoryvalue coststandard currencyconvert coststandard c_currency_id c_currency_id datevalue ad_client_id ad_org_id c_acctschema c_acctschema_id getc_acctschema_id currencyconvert c_currency_id c_currency_id datevalue ad_client_id ad_org_id c_acctschema c_acctschema_id getc_acctschema_id ad_pinstance_id getad_pinstance_id executeupdate tostring get_trxname prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad role id p ad role id para i get parameter as int else if name equals ad client id p ad client id para i get parameter as int else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter ad_role_id p_ad_role_id getparameterasint ad_client_id p_ad_client_id getparameterasint process return info throws exception protected string do it throws exception log info do it ad client id p ad client id ad role id p ad role id if p ad role id 0 update role new m role get ctx p ad role id get trxname else string sql select from ad role if p ad client id 0 sql where ad client id sql order by ad client id name prepared statement pstmt null try pstmt db prepare statement sql get trxname if p ad client id 0 pstmt set int 1 p ad client id result set rs pstmt execute query while rs next update role new m role get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe do it e try if pstmt null pstmt close pstmt null catch exception e pstmt null return doit doit ad_client_id p_ad_client_id ad_role_id p_ad_role_id p_ad_role_id updaterole mrole getctx p_ad_role_id get_trxname ad_role p_ad_client_id ad_client_id ad_client_id preparedstatement preparestatement get_trxname p_ad_client_id setint p_ad_client_id resultset executequery updaterole mrole getctx get_trxname doit update role param role role private void update role m role role add log 0 null null role get name role update access records updaterole mrole addlog getname updateaccessrecords standard constructor public x c projectphase properties ctx int c projectphase id string trx name super ctx c projectphase id trx name if c projectphase id 0 setc projectphase id 0 setc project id 0 set committed amt env zero set is commit ceiling false set is complete false set name null set seq no 0 sql select nvl max seq no 0 10 as default value from c projectphase where c project id c project id x_c_projectphase c_projectphase_id trxname c_projectphase_id trxname c_projectphase_id setc_projectphase_id setc_project_id setcommittedamt setiscommitceiling setiscomplete setname setseqno seqno defaultvalue c_projectphase c_project_id c_project_id load constructor public x c projectphase properties ctx result set rs string trx name super ctx rs trx name x_c_projectphase resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projectphase append get id append return sb to string tostring stringbuffer stringbuffer x_c_projectphase get_id tostring set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set standard phase standard phase of the project type public void setc phase id int c phase id if c phase id 0 set valuenocheck c phase id null else set valuenocheck c phase id new integer c phase id setc_phase_id c_phase_id c_phase_id set_valuenocheck c_phase_id set_valuenocheck c_phase_id c_phase_id get standard phase standard phase of the project type public int getc phase id integer ii integer get value c phase id if ii null return 0 return ii int value getc_phase_id get_value c_phase_id intvalue set project phase phase of a project public void setc projectphase id int c projectphase id if c projectphase id 1 throw new illegal argument exception c projectphase id is mandatory set valuenocheck c projectphase id new integer c projectphase id setc_projectphase_id c_projectphase_id c_projectphase_id illegalargumentexception c_projectphase_id set_valuenocheck c_projectphase_id c_projectphase_id get project phase phase of a project public int getc projectphase id integer ii integer get value c projectphase id if ii null return 0 return ii int value getc_projectphase_id get_value c_projectphase_id intvalue set project financial project public void setc project id int c project id if c project id 1 throw new illegal argument exception c project id is mandatory set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id illegalargumentexception c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set committed amount the legal commitment amount public void set committed amt big decimal committed amt if committed amt null throw new illegal argument exception committed amt is mandatory set value committed amt committed amt setcommittedamt bigdecimal committedamt committedamt illegalargumentexception committedamt set_value committedamt committedamt get committed amount the legal commitment amount public big decimal get committed amt big decimal bd big decimal get value committed amt if bd null return env zero return bd bigdecimal getcommittedamt bigdecimal bigdecimal get_value committedamt set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set end date last effective date inclusive public void set end date timestamp end date set value end date end date setenddate enddate set_value enddate enddate get end date last effective date inclusive public timestamp get end date return timestamp get value end date getenddate get_value enddate set generate order generate order public void set generate order string generate order if generate order null generate order length 1 log warning length 1 truncated generate order generate order substring 0 0 set value generate order generate order setgenerateorder generateorder generateorder generateorder generateorder generateorder set_value generateorder generateorder get generate order generate order public string get generate order return string get value generate order getgenerateorder get_value generateorder set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set commitment is ceiling the commitment amount quantity is the chargeable ceiling public void set is commit ceiling boolean is commit ceiling set value is commit ceiling new boolean is commit ceiling setiscommitceiling iscommitceiling set_value iscommitceiling iscommitceiling get commitment is ceiling the commitment amount quantity is the chargeable ceiling public boolean is commit ceiling object oo get value is commit ceiling if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscommitceiling get_value iscommitceiling booleanvalue set complete it is complete public void set is complete boolean is complete set value is complete new boolean is complete setiscomplete iscomplete set_value iscomplete iscomplete get complete it is complete public boolean is complete object oo get value is complete if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscomplete get_value iscomplete booleanvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set unit price actual price public void set price actual big decimal price actual set value price actual price actual setpriceactual bigdecimal priceactual set_value priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno set start date first effective day inclusive public void set start date timestamp start date set value start date start date setstartdate startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate product modified set attribute set instance param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null begin armen 2006 10 01 m product product m product get ctx m product id int value if product is stocked big decimal movement qty big decimal m tab get value movement qty int m warehouse id env get context as int ctx window no m warehouse id int m attributesetinstance id env get context as int ctx window no m attributesetinstance id big decimal available m storage get qty available m warehouse id m product id int value m attributesetinstance id null if available null available env zero if available signum 0 m tab fire data statuse event no qty available 0 false else if available compare to movement qty 0 m tab fire data statuse event insufficient qty available available to string false end armen return windowno mtab mfield windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id mproduct mproduct m_product_id intvalue isstocked bigdecimal movementqty bigdecimal mtab getvalue movementqty m_warehouse_id getcontextasint windowno m_warehouse_id m_attributesetinstance_id getcontextasint windowno m_attributesetinstance_id bigdecimal mstorage getqtyavailable m_warehouse_id m_product_id intvalue m_attributesetinstance_id mtab firedatastatuseevent noqtyavailable compareto movementqty mtab firedatastatuseevent insufficientqtyavailable tostring begin armen 2006 10 01 movement line movement qty modified called from movement qty param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string qty properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true int m product id env get context as int ctx window no m product id log log level warning qty init m product id m product id if m product id 0 m product product m product get ctx m product id if product is stocked big decimal movement qty big decimal value int m warehouse id env get context as int ctx window no m warehouse id int m attributesetinstance id env get context as int ctx window no m attributesetinstance id big decimal available m storage get qty available m warehouse id m product id m attributesetinstance id null if available null available env zero if available signum 0 m tab fire data statuse event no qty available 0 false else if available compare to movement qty 0 m tab fire data statuse event insufficient qty available available to string false set callout active false return movementqty movementqty windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive m_product_id getcontextasint windowno m_product_id m_product_id m_product_id m_product_id mproduct mproduct m_product_id isstocked bigdecimal movementqty bigdecimal m_warehouse_id getcontextasint windowno m_warehouse_id m_attributesetinstance_id getcontextasint windowno m_attributesetinstance_id bigdecimal mstorage getqtyavailable m_warehouse_id m_product_id m_attributesetinstance_id mtab firedatastatuseevent noqtyavailable compareto movementqty mtab firedatastatuseevent insufficientqtyavailable tostring setcalloutactive initialize global variables param config servlet config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception e mail servlet init servletexception servletconfig servletexception webenv initweb servletexception emailservlet get servlet information return info public string get servlet info return a dempiere e mail getservletinfo adempiere email clean up resources public void destroy log info process the http get request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr do post request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr dopost process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message string url web util get parameter request forward to if url null url length 0 url email verify jsp web user web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to url return log info url wu to string string cmd web util get parameter request re send if cmd null cmd length 1 resend code request wu else wu sete mail verify code web util get parameter request verify code request get remote addr url url log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession removeattribute websessionctx hdr_message webutil getparameter forwardto emailverify webuser webuser getattribute webuser sendredirect loginservlet forwardto tostring webutil getparameter resend resendcode setemailverifycode webutil getparameter verifycode getremoteaddr requestdispatcher getservletcontext getrequestdispatcher resend validation code param request request param wu user private void resend code http servlet request request web user wu string msg jsp env sende mail request wu m mail msg mailmsgtype uservalidation new object request get server name wu get name wu gete mail verify code if e mail sent ok equals msg wu set password message e mail sent else wu set password message problem sending e mail msg resendcode httpservletrequest webuser jspenv sendemail mmailmsg mailmsgtype_uservalidation getservername getname getemailverifycode email sent_ok setpasswordmessage email setpasswordmessage email standard constructor public x ad wf process properties ctx int ad wf process id string trx name super ctx ad wf process id trx name if ad wf process id 0 setad table id 0 setad wf process id 0 setad wf responsible id 0 setad workflow id 0 set processed false setrecord id 0 setwf state null x_ad_wf_process ad_wf_process_id trxname ad_wf_process_id trxname ad_wf_process_id setad_table_id setad_wf_process_id setad_wf_responsible_id setad_workflow_id setprocessed setrecord_id setwfstate load constructor public x ad wf process properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_process resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf process append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_process get_id tostring set message system message public void setad message id int ad message id if ad message id 0 set value ad message id null else set value ad message id new integer ad message id setad_message_id ad_message_id ad_message_id set_value ad_message_id set_value ad_message_id ad_message_id get message system message public int getad message id integer ii integer get value ad message id if ii null return 0 return ii int value getad_message_id get_value ad_message_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue public static final int ad user id ad reference id 286 set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id ad_user_id_ad_reference_id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set workflow process actual workflow process instance public void setad wf process id int ad wf process id if ad wf process id 1 throw new illegal argument exception ad wf process id is mandatory set valuenocheck ad wf process id new integer ad wf process id setad_wf_process_id ad_wf_process_id ad_wf_process_id illegalargumentexception ad_wf_process_id set_valuenocheck ad_wf_process_id ad_wf_process_id get workflow process actual workflow process instance public int getad wf process id integer ii integer get value ad wf process id if ii null return 0 return ii int value getad_wf_process_id get_value ad_wf_process_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 1 throw new illegal argument exception ad wf responsible id is mandatory set value ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id illegalargumentexception ad_wf_responsible_id set_value ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set value ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_value ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad workflow id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_workflow_id set priority indicates if this request is of a high medium or low priority public void set priority int priority set value priority new integer priority setpriority set_value get priority indicates if this request is of a high medium or low priority public int get priority integer ii integer get value priority if ii null return 0 return ii int value getpriority get_value intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set value record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg public static final string wfstate suspended os set workflow state state of the execution of the workflow public void setwf state string wf state if wf state null throw new illegal argument exception wf state is mandatory if wf state equals ca wf state equals cc wf state equals ct wf state equals on wf state equals or wf state equals os else throw new illegal argument exception wf state invalid value wf state reference id 305 ca cc ct on or os if wf state length 2 log warning length 2 truncated wf state wf state substring 0 1 set value wf state wf state wfstate_suspended setwfstate wfstate wfstate illegalargumentexception wfstate wfstate wfstate wfstate wfstate wfstate wfstate illegalargumentexception wfstate wfstate reference_id wfstate wfstate wfstate set_value wfstate wfstate get workflow state state of the execution of the workflow public string getwf state return string get value wf state getwfstate get_value wfstate prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p c acctschema id para i get parameter as int else if name equals copy overwrite acct p copyoverwriteacct y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_acctschema_id p_c_acctschema_id getparameterasint copyoverwriteacct p_copyoverwriteacct getparameter process return message throws exception protected string do it throws exception log info c acctschema id p c acctschema id copy overwrite acct p copyoverwriteacct if p c acctschema id 0 throw new compiere system error c acctschema id 0 m acct schema as m acct schema get get ctx p c acctschema id if as get id 0 throw new compiere system error not found c acctschema id p c acctschema id m acct schema default acct m acct schema default get get ctx p c acctschema id if acct null acct get id 0 throw new compiere system error default not found c acctschema id p c acctschema id string sql null int updated 0 int created 0 int updated total 0 int created total 0 update existing product category if p copyoverwriteacct sql update m product category acct pa set p revenue acct acct getp revenue acct p expense acct acct getp expense acct p costadjustment acct acct getp costadjustment acct p inventoryclearing acct acct getp inventoryclearing acct p asset acct acct getp asset acct p cogs acct acct getp cogs acct p purchasepricevariance acct acct getp purchasepricevariance acct p invoicepricevariance acct acct getp invoicepricevariance acct p tradediscountrec acct acct getp tradediscountrec acct p tradediscountgrant acct acct getp tradediscountgrant acct updated sys date updated by 0 where pa c acctschema id p c acctschema id and exists select from m product category p where p m product category id pa m product category id updated db execute update sql get trxname add log 0 null new big decimal updated updated m product category id updated total updated insert new product category sql insert into m product category acct m product category id c acctschema id ad client id ad org id is active created created by updated updated by p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p m product category id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct p revenue acct acct p expense acct acct p costadjustment acct acct p inventoryclearing acct acct p asset acct acct p cogs acct acct p purchasepricevariance acct acct p invoicepricevariance acct acct p tradediscountrec acct acct p tradediscountgrant acct from m product category p inner join c acctschema default acct on p ad client id acct ad client id where acct c acctschema id p c acctschema id and not exists select from m product category acct pa where pa m product category id p m product category id and pa c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created m product category id created total created if p copyoverwriteacct insert new products sql insert into m product acct m product id c acctschema id ad client id ad org id is active created created by updated updated by p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p m product id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct p revenue acct acct p expense acct acct p costadjustment acct acct p inventoryclearing acct acct p asset acct acct p cogs acct acct p purchasepricevariance acct acct p invoicepricevariance acct acct p tradediscountrec acct acct p tradediscountgrant acct from m product p inner join m product category acct acct on acct m product category id p m product category id where acct c acctschema id p c acctschema id and p m product category id acct m product category id and not exists select from m product acct pa where pa m product id p m product id and pa c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created m product id created total created update business partner group if p copyoverwriteacct sql update c bp group acct a set c receivable acct acct getc receivable acct c receivable services acct acct getc receivable services acct c prepayment acct acct getc prepayment acct v liability acct acct getv liability acct v liability services acct acct getv liability services acct v prepayment acct acct getv prepayment acct paydiscount exp acct acct getpaydiscount exp acct paydiscount rev acct acct getpaydiscount rev acct writeoff acct acct getwriteoff acct notinvoicedreceipts acct acct getnotinvoicedreceipts acct unearnedrevenue acct acct getunearnedrevenue acct notinvoicedrevenue acct acct getnotinvoicedrevenue acct notinvoicedreceivables acct acct getnotinvoicedreceivables acct updated sys date updated by 0 where a c acctschema id p c acctschema id and exists select from c bp group acct x where x c bp group id a c bp group id updated db execute update sql get trxname add log 0 null new big decimal updated updated c bp group id updated total updated insert business partner group sql insert into c bp group acct c bp group id c acctschema id ad client id ad org id is active created created by updated updated by c receivable acct c receivable services acct c prepayment acct v liability acct v liability services acct v prepayment acct paydiscount exp acct paydiscount rev acct writeoff acct notinvoicedreceipts acct unearnedrevenue acct notinvoicedrevenue acct notinvoicedreceivables acct select x c bp group id acct c acctschema id x ad client id x ad org id y sys date 0 sys date 0 acct c receivable acct acct c receivable services acct acct c prepayment acct acct v liability acct acct v liability services acct acct v prepayment acct acct paydiscount exp acct acct paydiscount rev acct acct writeoff acct acct notinvoicedreceipts acct acct unearnedrevenue acct acct notinvoicedrevenue acct acct notinvoicedreceivables acct from c bp group x inner join c acctschema default acct on x ad client id acct ad client id where acct c acctschema id p c acctschema id and not exists select from c bp group acct a where a c bp group id x c bp group id and a c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created c bp group id created total created update business partner employee if p copyoverwriteacct sql update c bp employee acct a set e expense acct acct gete expense acct e prepayment acct acct gete prepayment acct updated sys date updated by 0 where a c acctschema id p c acctschema id and exists select from c bp employee acct x where x c bpartner id a c bpartner id updated db execute update sql get trxname add log 0 null new big decimal updated updated c bpartner id is employee updated total updated insert new business partner employee sql insert into c bp employee acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by e expense acct e prepayment acct select x c bpartner id acct c acctschema id x ad client id x ad org id y sys date 0 sys date 0 acct e expense acct acct e prepayment acct from c bpartner x inner join c acctschema default acct on x ad client id acct ad client id where acct c acctschema id p c acctschema id and not exists select from c bp employee acct a where a c bpartner id x c bpartner id and a c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created c bpartner id is employee created total created if p copyoverwriteacct sql insert into c bp customer acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by c receivable acct c receivable services acct c prepayment acct select p c bpartner id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct c receivable acct acct c receivable services acct acct c prepayment acct from c bpartner p inner join c bp group acct acct on acct c bp group id p c bp group id where acct c acctschema id p c acctschema id and p c bp group id acct c bp group id and not exists select from c bp customer acct ca where ca c bpartner id p c bpartner id and ca c acctschema id acct c acctsc doit c_acctschema_id p_c_acctschema_id copyoverwriteacct p_copyoverwriteacct p_c_acctschema_id compieresystemerror c_acctschema_id macctschema macctschema getctx p_c_acctschema_id get_id compieresystemerror c_acctschema_id p_c_acctschema_id macctschemadefault macctschemadefault getctx p_c_acctschema_id get_id compieresystemerror c_acctschema_id p_c_acctschema_id updatedtotal createdtotal p_copyoverwriteacct m_product_category_acct p_revenue_acct getp_revenue_acct p_expense_acct getp_expense_acct p_costadjustment_acct getp_costadjustment_acct p_inventoryclearing_acct getp_inventoryclearing_acct p_asset_acct getp_asset_acct p_cogs_acct getp_cogs_acct p_purchasepricevariance_acct getp_purchasepricevariance_acct p_invoicepricevariance_acct getp_invoicepricevariance_acct p_tradediscountrec_acct getp_tradediscountrec_acct p_tradediscountgrant_acct getp_tradediscountgrant_acct sysdate updatedby c_acctschema_id p_c_acctschema_id m_product_category m_product_category_id m_product_category_id executeupdate get_trxname addlog bigdecimal m_product_category_id updatedtotal m_product_category_acct m_product_category_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_category_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_category c_acctschema_default ad_client_id ad_client_id c_acctschema_id p_c_acctschema_id m_product_category_acct m_product_category_id m_product_category_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal m_product_category_id createdtotal p_copyoverwriteacct m_product_acct m_product_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product m_product_category_acct m_product_category_id m_product_category_id c_acctschema_id p_c_acctschema_id m_product_category_id m_product_category_id m_product_acct m_product_id m_product_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal m_product_id createdtotal p_copyoverwriteacct c_bp_group_acct c_receivable_acct getc_receivable_acct c_receivable_services_acct getc_receivable_services_acct c_prepayment_acct getc_prepayment_acct v_liability_acct getv_liability_acct v_liability_services_acct getv_liability_services_acct v_prepayment_acct getv_prepayment_acct paydiscount_exp_acct getpaydiscount_exp_acct paydiscount_rev_acct getpaydiscount_rev_acct writeoff_acct getwriteoff_acct notinvoicedreceipts_acct getnotinvoicedreceipts_acct unearnedrevenue_acct getunearnedrevenue_acct notinvoicedrevenue_acct getnotinvoicedrevenue_acct notinvoicedreceivables_acct getnotinvoicedreceivables_acct sysdate updatedby c_acctschema_id p_c_acctschema_id c_bp_group_acct c_bp_group_id c_bp_group_id executeupdate get_trxname addlog bigdecimal c_bp_group_id updatedtotal c_bp_group_acct c_bp_group_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby c_receivable_acct c_receivable_services_acct c_prepayment_acct v_liability_acct v_liability_services_acct v_prepayment_acct paydiscount_exp_acct paydiscount_rev_acct writeoff_acct notinvoicedreceipts_acct unearnedrevenue_acct notinvoicedrevenue_acct notinvoicedreceivables_acct c_bp_group_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate c_receivable_acct c_receivable_services_acct c_prepayment_acct v_liability_acct v_liability_services_acct v_prepayment_acct paydiscount_exp_acct paydiscount_rev_acct writeoff_acct notinvoicedreceipts_acct unearnedrevenue_acct notinvoicedrevenue_acct notinvoicedreceivables_acct c_bp_group c_acctschema_default ad_client_id ad_client_id c_acctschema_id p_c_acctschema_id c_bp_group_acct c_bp_group_id c_bp_group_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal c_bp_group_id createdtotal p_copyoverwriteacct c_bp_employee_acct e_expense_acct gete_expense_acct e_prepayment_acct gete_prepayment_acct sysdate updatedby c_acctschema_id p_c_acctschema_id c_bp_employee_acct c_bpartner_id c_bpartner_id executeupdate get_trxname addlog bigdecimal c_bpartner_id isemployee updatedtotal c_bp_employee_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby e_expense_acct e_prepayment_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate e_expense_acct e_prepayment_acct c_bpartner c_acctschema_default ad_client_id ad_client_id c_acctschema_id p_c_acctschema_id c_bp_employee_acct c_bpartner_id c_bpartner_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal c_bpartner_id isemployee createdtotal p_copyoverwriteacct c_bp_customer_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby c_receivable_acct c_receivable_services_acct c_prepayment_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate c_receivable_acct c_receivable_services_acct c_prepayment_acct c_bpartner c_bp_group_acct c_bp_group_id c_bp_group_id c_acctschema_id p_c_acctschema_id c_bp_group_id c_bp_group_id c_bp_customer_acct c_bpartner_id c_bpartner_id c_acctschema_id c_acctsc get contents return context public object get contents return contents getcontents standard constructor public x ad userdef field properties ctx int ad userdef field id string trx name super ctx ad userdef field id trx name if ad userdef field id 0 setad field id 0 setad userdef field id 0 setad userdef tab id 0 set default value null set is displayed false set is read only false set is same line false set name null set seq no 0 x_ad_userdef_field ad_userdef_field_id trxname ad_userdef_field_id trxname ad_userdef_field_id setad_field_id setad_userdef_field_id setad_userdef_tab_id setdefaultvalue setisdisplayed setisreadonly setissameline setname setseqno load constructor public x ad userdef field properties ctx result set rs string trx name super ctx rs trx name x_ad_userdef_field resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad userdef field append get id append return sb to string tostring stringbuffer stringbuffer x_ad_userdef_field get_id tostring set field field on a database table public void setad field id int ad field id if ad field id 1 throw new illegal argument exception ad field id is mandatory set value ad field id new integer ad field id setad_field_id ad_field_id ad_field_id illegalargumentexception ad_field_id set_value ad_field_id ad_field_id get field field on a database table public int getad field id integer ii integer get value ad field id if ii null return 0 return ii int value getad_field_id get_value ad_field_id intvalue set user defined field public void setad userdef field id int ad userdef field id if ad userdef field id 1 throw new illegal argument exception ad userdef field id is mandatory set valuenocheck ad userdef field id new integer ad userdef field id setad_userdef_field_id ad_userdef_field_id ad_userdef_field_id illegalargumentexception ad_userdef_field_id set_valuenocheck ad_userdef_field_id ad_userdef_field_id get user defined field public int getad userdef field id integer ii integer get value ad userdef field id if ii null return 0 return ii int value getad_userdef_field_id get_value ad_userdef_field_id intvalue set user defined tab public void setad userdef tab id int ad userdef tab id if ad userdef tab id 1 throw new illegal argument exception ad userdef tab id is mandatory set valuenocheck ad userdef tab id new integer ad userdef tab id setad_userdef_tab_id ad_userdef_tab_id ad_userdef_tab_id illegalargumentexception ad_userdef_tab_id set_valuenocheck ad_userdef_tab_id ad_userdef_tab_id get user defined tab public int getad userdef tab id integer ii integer get value ad userdef tab id if ii null return 0 return ii int value getad_userdef_tab_id get_value ad_userdef_tab_id intvalue set default logic default value hierarchy separated by public void set default value string default value if default value null throw new illegal argument exception default value is mandatory if default value length 2000 log warning length 2000 truncated default value default value substring 0 1999 set value default value default value setdefaultvalue defaultvalue defaultvalue illegalargumentexception defaultvalue defaultvalue defaultvalue defaultvalue set_value defaultvalue defaultvalue get default logic default value hierarchy separated by public string get default value return string get value default value getdefaultvalue get_value defaultvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set display length length of the display in characters public void set display length int display length set value display length new integer display length setdisplaylength displaylength set_value displaylength displaylength get display length length of the display in characters public int get display length integer ii integer get value display length if ii null return 0 return ii int value getdisplaylength get_value displaylength intvalue set display logic if the field is displayed the result determines if the field is actually displayed public void set display logic string display logic if display logic null display logic length 2000 log warning length 2000 truncated display logic display logic substring 0 1999 set value display logic display logic setdisplaylogic displaylogic displaylogic displaylogic displaylogic displaylogic set_value displaylogic displaylogic get display logic if the field is displayed the result determines if the field is actually displayed public string get display logic return string get value display logic getdisplaylogic get_value displaylogic set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set displayed determines if this field is displayed public void set is displayed boolean is displayed set value is displayed new boolean is displayed setisdisplayed isdisplayed set_value isdisplayed isdisplayed get displayed determines if this field is displayed public boolean is displayed object oo get value is displayed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdisplayed get_value isdisplayed booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set same line displayed on same line as previous field public void set is same line boolean is same line set value is same line new boolean is same line setissameline issameline set_value issameline issameline get same line displayed on same line as previous field public boolean is same line object oo get value is same line if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issameline get_value issameline booleanvalue set updateable determines if the field can be updated public void set is updateable boolean is updateable set value is updateable new boolean is updateable setisupdateable isupdateable set_value isupdateable isupdateable get updateable determines if the field can be updated public boolean is updateable object oo get value is updateable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isupdateable get_value isupdateable booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set record sort no determines in what order the records are displayed public void set sort no int sort no set value sort no new integer sort no setsortno sortno set_value sortno sortno get record sort no determines in what order the records are displayed public int get sort no integer ii integer get value sort no if ii null return 0 return ii int value getsortno get_value sortno intvalue get content return content public object get contents return contents getcontents basic constructor public base basic constructor param href the uri that goes between double quotes public base string href set href href sethref basic constructor param href the uri that goes between double quotes param target the target that goes between double quotes public base string href string target set href target set target target sethref settarget sets the href attribute param href the uri that goes between double quotes public base set href string href add attribute href href return this sethref addattribute sets the target attribute param target the uri that goes between double quotes public base set target string target add attribute target target return this settarget addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public base add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public base add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public base add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public base add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public base remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception basket servlet init servletexception servletconfig servletexception webenv initweb servletexception basketservlet get servlet information return info public string get servlet info return a dempiere web basket getservletinfo adempiere clean up resources public void destroy log fine process the http get request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr request get requesturl properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message create web basket web basket wb web basket session get attribute web basket name if wb null wb new web basket session set attribute web basket name wb sales rep int salesrep id web util get parameter as int request p salesrep id if salesrep id 0 wb setsalesrep id salesrep id log fine salesrep id salesrep id get price list price list pl price list session get attribute price list name if pl null log fine no price list in session pl price list request get attribute price list name log fine pl pl do we delete delete x delete line request wb do we add add x add line request pl wb log info wb to string go back to basket string url basket jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr getrequesturl jspenv getctx httpsession getsession removeattribute websessionctx hdr_message webbasket webbasket webbasket getattribute webbasket webbasket setattribute webbasket salesrep salesrep_id webutil getparameterasint p_salesrep_id salesrep_id setsalesrep_id salesrep_id salesrep_id salesrep_id pricelist pricelist getattribute pricelist pricelist getattribute pricelist delete_x deleteline add_x addline tostring requestdispatcher getservletcontext getrequestdispatcher add line param request request param pl price list param wb web basket private void add line http servlet request request price list pl web basket wb properties ctx jsp env get ctx request http session session request get session true get parameter int m pricelist id web util get parameter as int request m pricelist id int m pricelist version id web util get parameter as int request m pricelist version id wb setm pricelist id m pricelist id wb setm pricelist version id m pricelist version id int m product id web util get parameter as int request p product id string name web util get parameter request name string s quantity web util get parameter request quantity string s price web util get parameter request price search for product id add 134 add enumeration en request get parameter names while m product id 0 en has more elements string parameter string en next element if parameter starts with add if web util exists request parameter to be sure try m product id integer parse int parameter substring 4 log fine found parameter parameter m product id if web util exists s quantity s quantity web util get parameter request qty m product id if web util exists s price s price web util get parameter request price m product id if web util exists name name web util get parameter request name m product id log fine found parameters name qty s quantity price s price catch exception ex log warning parse error for parameter ex to string if m product id 0 return set qty big decimal qty null try if s quantity null s quantity length 0 qty new big decimal s quantity catch exception ex1 log warning qty ex1 to string if qty null qty env one set price big decimal price null find info in current price list if m product id 0 pl null price list product plp pl get price list product m product id if plp null price plp get price name plp get name log fine found in pl name price if not found inpl and exists as parameter try if price null s price null s price length 0 price new big decimal s price catch exception ex1 log warn add line price ex1 to string price not in session price list and not as parameter if price null pl null pl is not all prices create complete price list int ad client id env get context as int ctx ad client id pl price list get ctx ad client id m pricelist id null null true session set attribute price list name pl set on session level price list product plp pl get price list product m product id if plp null price plp get price name plp get name log fine found in complete pl name price if price null web basket line wbl wb add m product id name qty price log fine wbl to string else price not found log warning product price not found m product id m product id name name addline httpservletrequest pricelist webbasket jspenv getctx httpsession getsession m_pricelist_id webutil getparameterasint m_pricelist_id m_pricelist_version_id webutil getparameterasint m_pricelist_version_id setm_pricelist_id m_pricelist_id setm_pricelist_version_id m_pricelist_version_id m_product_id webutil getparameterasint p_product_id webutil getparameter squantity webutil getparameter sprice webutil getparameter add_134 getparameternames m_product_id hasmoreelements nextelement startswith add_ webutil m_product_id parseint m_product_id webutil squantity squantity webutil getparameter qty_ m_product_id webutil sprice sprice webutil getparameter price_ m_product_id webutil webutil getparameter name_ m_product_id squantity sprice parseerror tostring m_product_id bigdecimal squantity squantity bigdecimal squantity tostring bigdecimal m_product_id pricelistproduct getpricelistproduct m_product_id getprice getname sprice sprice bigdecimal sprice addline tostring isnotallprices ad_client_id getcontextasint ad_client_id pricelist ad_client_id m_pricelist_id setattribute pricelist pricelistproduct getpricelistproduct m_product_id getprice getname webbasketline m_product_id tostring m_product_id m_product_id delete line delete x param request request param wb web basket private void delete line http servlet request request web basket wb try string enc request get character encoding if enc null request set character encoding web env encoding catch exception e log log level severe set character encoding web env encoding e enumeration en request get parameter names while en has more elements string parameter string en next element if parameter starts with delete try int line integer parse int parameter substring 7 log fine delete parameter parameter line wb delete line catch number format exception ex log warning parse error for parameter ex to string delete_x deleteline httpservletrequest webbasket getcharacterencoding setcharacterencoding webenv characterencoding webenv getparameternames hasmoreelements nextelement startswith delete_ parseint numberformatexception parseerror tostring process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr doget standard constructor public x c invoiceline properties ctx int c invoiceline id string trx name super ctx c invoiceline id trx name if c invoiceline id 0 setc invoiceline id 0 setc invoice id 0 setc tax id 0 set is description false n set is printed true y set line 0 sql select nvl max line 0 10 as default value from c invoiceline where c invoice id c invoice id set line net amt env zero setm attributesetinstance id 0 set price actual env zero set price entered env zero set price limit env zero set price list env zero set processed false set qty entered env zero 1 set qty invoiced env zero 1 x_c_invoiceline c_invoiceline_id trxname c_invoiceline_id trxname c_invoiceline_id setc_invoiceline_id setc_invoice_id setc_tax_id setisdescription setisprinted setline defaultvalue c_invoiceline c_invoice_id c_invoice_id setlinenetamt setm_attributesetinstance_id setpriceactual setpriceentered setpricelimit setpricelist setprocessed setqtyentered setqtyinvoiced load constructor public x c invoiceline properties ctx result set rs string trx name super ctx rs trx name x_c_invoiceline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoiceline append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoiceline get_id tostring set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 1 throw new illegal argument exception c invoiceline id is mandatory set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id illegalargumentexception c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoice id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoice_id set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set valuenocheck c orderline id null else set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_valuenocheck c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set value c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_value c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set valuenocheck c uom id null else set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_valuenocheck c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set description only if true the line is just description and no transaction public void set is description boolean is description set value is description new boolean is description setisdescription isdescription set_value isdescription isdescription get description only if true the line is just description and no transaction public boolean is description object oo get value is description if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdescription get_value isdescription booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set line amount line extended amount quantity actual price without freight and charges public void set line net amt big decimal line net amt if line net amt null throw new illegal argument exception line net amt is mandatory set valuenocheck line net amt line net amt setlinenetamt bigdecimal linenetamt linenetamt illegalargumentexception linenetamt set_valuenocheck linenetamt linenetamt get line amount line extended amount quantity actual price without freight and charges public big decimal get line net amt big decimal bd big decimal get value line net amt if bd null return env zero return bd bigdecimal getlinenetamt bigdecimal bigdecimal get_value linenetamt set line total total line amount incl tax public void set line total amt big decimal line total amt set value line total amt line total amt setlinetotalamt bigdecimal linetotalamt set_value linetotalamt linetotalamt get line total total line amount incl tax public big decimal get line total amt big decimal bd big decimal get value line total amt if bd null return env zero return bd bigdecimal getlinetotalamt bigdecimal bigdecimal get_value linetotalamt set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set valuenocheck m inoutline id null else set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_valuenocheck m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set unit price actual price public void set price actual big decimal price actual if price actual null throw new illegal argument exception price actual is mandatory set valuenocheck price actual price actual setpriceactual bigdecimal priceactual priceactual illegalargumentexception priceactual set_valuenocheck priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set price price entered the price based on the selected base uom public void set price entered big decimal price entered if price entered null throw new illegal argument exception price entered is mandatory set value price entered price entered setpriceentered bigdecimal priceentered priceentered illegalargumentexception priceentered set_value priceentered priceentered get price price entered the price based on the selected base uom public big decimal get price entered big decimal bd big decimal get value price entered if bd null return env zero return bd bigdecimal getpriceentered bigdecimal bigdecimal get_value priceentered set limit price lowest price for a product public void set price limit big decimal price limit if price limit null throw new illegal argument exception price limit is mandatory set value price limit price limit setpricelimit bigdecimal pricelimit pricelimit illegalargumentexception pricelimit set_value pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set list price list price public void set price list big decimal price list if price list null throw new illegal argument exception price list is mandatory set value price list price list setpricelist bigdecimal pricelist pricelist illegalargumentexception pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity the quantity entered is based on the selected uom public void set qty entered big decimal qty entered if qty entered null throw new illegal argument exception qty entered is mandatory set value qty entered qty entered setqtyentered bigdecimal qtyentered qtyentered illegalargumentexception qtyentered set_value qtyentered qtyentered get quantity the quantity entered is based on the selected uom public big decimal get qty entered big decimal bd big decimal get value qty entered if bd null return env zero return bd bigdecimal getqtyentered bigdecimal bigdecimal get_value qtyentered set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced if qty invoiced null throw new illegal argument exception qty invoiced is mandatory set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced qtyinvoiced illegalargumentexception qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set referenced invoice line public void setref invoiceline id int ref invoiceline id if ref invoiceline id 0 set value ref invoiceline id null else set value ref invoiceline id new integer ref invoiceline id setref_invoiceline_id ref_invoiceline_id ref_invoiceline_id set_value ref_invoiceline_id set_value ref_invoiceline_id ref_invoiceline_id get referenced invoice line public int getref invoiceline id integer ii integer get value ref invoiceline id if ii null return 0 return ii int value getref_invoiceline_id get_value ref_invoiceline_id intvalue set resource assignment resource assignment public void sets resourceassignment id int s resourceassignment id if s resourceassignment id 0 set valuenocheck s resourceassignment id null else set valuenocheck s resourceassignment id new integer s resourceassignment id sets_resourceassignment_id s_resourceassignment_id s_resourceassignment_id set_valuenocheck s_resourceassignment_id set_valuenocheck s_resourceassignment_id s_resourceassignment_id get resource assignment resource assignment public int gets resourceassignment id integer ii integer get value s resourceassignment id if ii null return 0 return ii int value gets_resourceassignment_id get_value s_resourceassignment_id intvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt set value tax amt tax amt settaxamt bigdecimal taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt standard constructor public x ad printcolor properties ctx int ad printcolor id string trx name super ctx ad printcolor id trx name if ad printcolor id 0 setad printcolor id 0 set code null set is default false set name null x_ad_printcolor ad_printcolor_id trxname ad_printcolor_id trxname ad_printcolor_id setad_printcolor_id setcode setisdefault setname load constructor public x ad printcolor properties ctx result set rs string trx name super ctx rs trx name x_ad_printcolor resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printcolor append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printcolor get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 1 throw new illegal argument exception ad printcolor id is mandatory set valuenocheck ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id illegalargumentexception ad_printcolor_id set_valuenocheck ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set validation code validation code public void set code string code if code null throw new illegal argument exception code is mandatory if code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode illegalargumentexception set_value get validation code validation code public string get code return string get value code getcode get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname base constructor you need to set the sql and start the parsing manually public access sql parser accesssqlparser full constructor param sql sql command public access sql parser string sql set sql sql accesssqlparser setsql set sql and parse it param sql sql public void set sql string sql if sql null throw new illegal argument exception no sql m sqloriginal sql int index m sqloriginal index of nfrom if index 1 m sqloriginal m sqloriginal replace nfrom from index m sqloriginal index of nwhere if index 1 m sqloriginal m sqloriginal replace nwhere where parse setsql illegalargumentexception m_sqloriginal m_sqloriginal indexof m_sqloriginal m_sqloriginal m_sqloriginal indexof m_sqloriginal m_sqloriginal get original sql return sql public string get sql return m sqloriginal getsql m_sqloriginal parse original sql called from set sql or constructor public boolean parse if m sqloriginal null m sqloriginal length 0 throw new illegal argument exception no sql if c log mgt is level finest log fine m sqloriginal get select statements analyse each select for int i 0 i m sql length i table info info get table info m sql i trim m tableinfo add info if c log mgt is level finest log fine to string return m tableinfo size 0 setsql m_sqloriginal m_sqloriginal illegalargumentexception clogmgt islevelfinest m_sqloriginal getselectstatements m_sql tableinfo gettableinfo m_sql m_tableinfo clogmgt islevelfinest tostring m_tableinfo parses m sqloriginal and creates array of m sql statements private void get select statements string sql in new string m sqloriginal string sql out null try sql out get subsql sql in catch exception e log log level severe m sqloriginal e throw new illegal argument exception m sqloriginal a sub query was found while sql in length sql out length sql in sql out try sql out get subsql sql in catch exception e log log level severe m sqloriginal e throw new illegal argument exception sql out length m sqloriginal m sql sql out list check for int i 0 i m sql length i if m sql i index of select 2 1 log log level severe i has embedded sql m sql i else log fine i m sql i m_sqloriginal m_sql getselectstatements sqlin m_sqloriginal sqlout sqlout getsubsql sqlin m_sqloriginal illegalargumentexception m_sqloriginal sqlin sqlout sqlin sqlout sqlout getsubsql sqlin m_sqloriginal illegalargumentexception sqlout m_sqloriginal m_sql sqlout m_sql m_sql indexof m_sql m_sql get sub sql of sql statements param sql in array of input sql return array of resulting sql private string get subsql string sql in array list string list new array list string for int sql index 0 sql index sql in length sql index string sql sql in sql index int index sql index of select 7 while index 1 int end index index 1 int parenthesis level 0 search for the end of the sql while end index sql length char c sql char at end index if c if parenthesis level 0 break else parenthesis level else if c parenthesis level string subsql sql substring index end index 1 list add subsql remove inner sql sql sql substring 0 index 1 sql substring end index index sql index of select 7 list add sql last sql string ret value new string list size list to array ret value return ret value sqlin getsubsql sqlin arraylist arraylist sqlindex sqlindex sqlin sqlindex sqlin sqlindex indexof endindex parenthesislevel endindex charat endindex parenthesislevel parenthesislevel parenthesislevel endindex endindex indexof retvalue toarray retvalue retvalue get table info for sql param sql sql return array of table info for sql private table info get table info string sql array list table info list new array list table info remove if sql starts with sql ends with sql sql substring 1 sql length 1 int from index sql index of from if from index sql last index of from log log level warning more than one from clause sql while from index 1 string from sql substring from index from length int index from last index of where end at where if index 1 from from substring 0 index from util replace from as from util replace from as from util replace from inner join from util replace from left outer join from util replace from right outer join from util replace from full join remove on clause assumes that there is no in in the clause index from index of on while index 1 int index close from index of does not catch in 1 2 in on int index next on from index of on index 4 if index next on 1 index close from last index of index next on if index close 1 from from substring 0 index from substring index close 1 else log log level severe could not remove on from break index from index of on log fine get table info from string tokenizer tablest new string tokenizer from while tablest has more tokens string table string tablest next token trim string tokenizer synst new string tokenizer table string table info table info null if synst count tokens 1 table info new table info synst next token synst next token else table info new table info table string log fine get table info table info list add table info sql sql substring 0 from index from index sql last index of from table info ret value new table info list size list to array ret value return ret value tableinfo gettableinfo arraylist tableinfo arraylist tableinfo startswith endswith fromindex indexof fromindex lastindexof fromindex fromindex from_length lastindexof indexof indexclose indexof indexnexton indexof indexnexton indexclose lastindexof indexnexton indexclose indexclose indexof gettableinfo stringtokenizer stringtokenizer hasmoretokens tablestring nexttoken stringtokenizer stringtokenizer tablestring tableinfo tableinfo counttokens tableinfo tableinfo nexttoken nexttoken tableinfo tableinfo tablestring gettableinfo tableinfo tableinfo fromindex fromindex lastindexof tableinfo retvalue tableinfo toarray retvalue retvalue string representation return info public string to string string buffer sb new string buffer access sql parser if m tableinfo null sb append m sqloriginal else for int i 0 i m tableinfo size i if i 0 sb append table info info table info m tableinfo get i for int ii 0 ii info length ii if ii 0 sb append sb append info ii to string sb append append get main sql index sb append return sb to string tostring stringbuffer stringbuffer accesssqlparser m_tableinfo m_sqloriginal m_tableinfo tableinfo tableinfo m_tableinfo tostring getmainsqlindex tostring get table info return table info public table info get table info int index if index 0 index m tableinfo size return null table info ret value table info m tableinfo get index return ret value tableinfo gettableinfo m_tableinfo tableinfo retvalue tableinfo m_tableinfo retvalue get sql statements return index index of query public string get sql statement int index if index 0 index m sql length return null return m sql index getsqlstatement m_sql m_sql get no of sql statements return from clause count public int get no sql statments if m sql null return 0 return m sql length getnosqlstatments m_sql m_sql get index of main statements return index of main statement or 1 if not found public int get main sql index if m sql null return 1 else if m sql length 1 return 0 for int i m sql length 1 i 0 i if m sql i char at 0 return i return 1 getmainsqlindex m_sql m_sql m_sql m_sql charat get main sql statement return main statement public string get main sql if m sql null return m sqloriginal if m sql length 1 return m sql 0 for int i m sql length 1 i 0 i if m sql i char at 0 return m sql i return getmainsql m_sql m_sqloriginal m_sql m_sql m_sql m_sql charat m_sql constructor param table name table param synonym synonym public table info string table name string synonym m tablename table name m synonym synonym tablename tableinfo tablename m_tablename tablename m_synonym short constuctor no syn param table name table public table info string table name this table name null tablename tableinfo tablename tablename get table synonym return synonym public string get synonym if m synonym null return return m synonym getsynonym m_synonym m_synonym get table name return table name public string get table name return m tablename tablename gettablename m_tablename string representation return info public string to string string buffer sb new string buffer m tablename if get synonym length 0 sb append append m synonym return sb to string tostring stringbuffer stringbuffer m_tablename getsynonym m_synonym tostring constructor param ctx context param pa reportsource id id public m report source properties ctx int pa reportsource id string trx name super ctx pa reportsource id trx name if pa reportsource id 0 pa_reportsource_id mreportsource pa_reportsource_id trxname pa_reportsource_id trxname pa_reportsource_id constructor param ctx context param rs result set to load from public m report source properties ctx result set rs string trx name super ctx rs trx name resultset mreportsource resultset trxname trxname get sql where clause param pa hierarchy id hierarchy return where clause public string get where clause int pa hierarchy id string et get element type id for tree leaf value int id 0 if m acct schema element elementtype account equals et id getc elementvalue id else if m acct schema element elementtype activity equals et id getc activity id else if m acct schema element elementtype bpartner equals et id getc bpartner id else if m acct schema element elementtype campaign equals et id getc campaign id else if m acct schema element elementtype locationfrom equals et id getc location id else if m acct schema element elementtype locationto equals et id getc location id else if m acct schema element elementtype organization equals et id getorg id else if m acct schema element elementtype product equals et id getm product id else if m acct schema element elementtype project equals et id getc project id else if m acct schema element elementtype salesregion equals et id getc salesregion id else if m acct schema element elementtype orgtrx equals et id getorg id re uses org id else if m acct schema element elementtype userlist1 equals et id getc elementvalue id else if m acct schema element elementtype userlist2 equals et id getc elementvalue id else if m acct schema element elementtype userelement1 equals et id getuserelement1 id else if m acct schema element elementtype userelement2 equals et id getuserelement2 id return m report tree get where clause get ctx pa hierarchy id et id pa_hierarchy_id getwhereclause pa_hierarchy_id getelementtype macctschemaelement elementtype_account getc_elementvalue_id macctschemaelement elementtype_activity getc_activity_id macctschemaelement elementtype_bpartner getc_bpartner_id macctschemaelement elementtype_campaign getc_campaign_id macctschemaelement elementtype_locationfrom getc_location_id macctschemaelement elementtype_locationto getc_location_id macctschemaelement elementtype_organization getorg_id macctschemaelement elementtype_product getm_product_id macctschemaelement elementtype_project getc_project_id macctschemaelement elementtype_salesregion getc_salesregion_id macctschemaelement elementtype_orgtrx getorg_id org_id macctschemaelement elementtype_userlist1 getc_elementvalue_id macctschemaelement elementtype_userlist2 getc_elementvalue_id macctschemaelement elementtype_userelement1 getuserelement1_id macctschemaelement elementtype_userelement2 getuserelement2_id mreporttree getwhereclause getctx pa_hierarchy_id string representation return info public string to string string buffer sb new string buffer m report source append get id append append get description append append get element type sb append return sb to string tostring stringbuffer stringbuffer mreportsource get_id getdescription getelementtype tostring copy constructor param ctx context param ad client id parent param ad org id parent param pa reportline id parent param source copy source return report source public static m report source copy properties ctx int ad client id int ad org id int pa reportline id m report source source string trx name m report source ret value new m report source ctx 0 trx name m report source copy values source ret value ad client id ad org id ret value setpa reportline id pa reportline id return ret value ad_client_id ad_org_id pa_reportline_id mreportsource ad_client_id ad_org_id pa_reportline_id mreportsource trxname mreportsource retvalue mreportsource trxname mreportsource copyvalues retvalue ad_client_id ad_org_id retvalue setpa_reportline_id pa_reportline_id retvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name log fine prepare para i if para i get parameter null else if name equals m product id p m product id para i get parameter as int else if name equals qty p qty big decimal para i get parameter else if name equals is create single order p iscreatesingleorder y equals para i get parameter else if name equals bill bpartner id p bill bpartner id para i get parameter as int else if name equals p bill location id p bill location id para i get parameter as int else if name equals is test p istest y equals para i get parameter else log log level severe unknown parameter name p m distributionlist id getrecord id processinfoparameter getparameter getparametername getparameter m_product_id p_m_product_id getparameterasint p_qty bigdecimal getparameter iscreatesingleorder p_iscreatesingleorder getparameter bill_bpartner_id p_bill_bpartner_id getparameterasint p_bill_location_id p_bill_location_id getparameterasint istest p_istest getparameter p_m_distributionlist_id getrecord_id perform process return message text with variables throws exception if not successful protected string do it throws exception log info m distributionlist id p m distributionlist id m product id p m product id qty p qty test p istest if p iscreatesingleorder log info single order p iscreatesingleorder bpartner id p bill bpartner id location id p bill location id if p m distributionlist id 0 throw new illegal argument exception no distribution list id m dl new m distribution list get ctx p m distributionlist id get trxname if m dl get id 0 throw new exception distribution list not found m distributionlist id p m distributionlist id if p m product id 0 throw new illegal argument exception no product m product m product get get ctx p m product id if m product get id 0 throw new exception product not found m product id p m product id if p qty null p qty signum 1 throw new illegal argument exception no quantity if p iscreatesingleorder p bill bpartner id 0 throw new illegal argument exception invoice business partner required for single order create single order if p istest p iscreatesingleorder mb partner bp new mb partner get ctx p bill bpartner id get trxname if bp get id 0 throw new illegal argument exception single business partner not found c bpartner id p bill bpartner id m singleorder new m order get ctx 0 get trxname m singleorder set isso trx true m singleorder setc doctypetarget id m order docsubtypeso standard m singleorder setb partner bp if p bill location id 0 m singleorder setc bpartner location id p bill location id if m singleorder save throw new illegal state exception single order not created m distribution list line lines m dl get lines int counter 0 for int i 0 i lines length i if create order lines i counter update qty if m singleorder null m singleorder set description counter m totalqty m singleorder save return created counter qty m totalqty doit m_distributionlist_id p_m_distributionlist_id m_product_id p_m_product_id p_qty p_istest p_iscreatesingleorder singleorder p_iscreatesingleorder bpartner_id p_bill_bpartner_id location_id p_bill_location_id p_m_distributionlist_id illegalargumentexception m_dl mdistributionlist getctx p_m_distributionlist_id get_trxname m_dl get_id m_distributionlist_id p_m_distributionlist_id p_m_product_id illegalargumentexception m_product mproduct getctx p_m_product_id m_product get_id m_product_id p_m_product_id p_qty p_qty illegalargumentexception p_iscreatesingleorder p_bill_bpartner_id illegalargumentexception p_istest p_iscreatesingleorder mbpartner mbpartner getctx p_bill_bpartner_id get_trxname get_id illegalargumentexception c_bpartner_id p_bill_bpartner_id m_singleorder morder getctx get_trxname m_singleorder setissotrx m_singleorder setc_doctypetarget_id morder docsubtypeso_standard m_singleorder setbpartner p_bill_location_id m_singleorder setc_bpartner_location_id p_bill_location_id m_singleorder illegalstateexception mdistributionlistline m_dl getlines createorder m_singleorder m_singleorder setdescription m_totalqty m_singleorder m_totalqty create order for distribution line param dll distribution line return true if created private boolean create order m distribution list line dll mb partner bp new mb partner get ctx dll getc bpartner id get trxname if bp get id 0 throw new illegal argument exception business partner not found c bpartner id dll getc bpartner id create order m order order m singleorder if p istest order null order new m order get ctx 0 get trxname order set isso trx true order setc doctypetarget id m order docsubtypeso standard order setb partner bp if dll getc bpartner location id 0 order setc bpartner location id dll getc bpartner location id if order save log log level severe order not saved return false calculate qty big decimal ratio dll get ratio big decimal qty p qty multiply ratio if qty compare to env zero 0 qty qty divide m dl get ratio total m product get standard precision big decimal round half up big decimal min qty dll get min qty if qty compare to min qty 0 qty min qty m totalqty m totalqty add qty if p istest add log 0 null qty bp get name return false create order line m order line line new m order line order line setc bpartner id dll getc bpartner id if dll getc bpartner location id 0 line setc bpartner location id dll getc bpartner location id line setm product id p m product id true line set qty qty line set price if line save log log level severe order line not saved return false add log 0 null qty order get document no bp get name return true createorder mdistributionlistline mbpartner mbpartner getctx getc_bpartner_id get_trxname get_id illegalargumentexception c_bpartner_id getc_bpartner_id morder m_singleorder p_istest morder getctx get_trxname setissotrx setc_doctypetarget_id morder docsubtypeso_standard setbpartner getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id bigdecimal getratio bigdecimal p_qty compareto m_dl getratiototal m_product getstandardprecision bigdecimal round_half_up bigdecimal minqty getminqty compareto minqty minqty m_totalqty m_totalqty p_istest addlog getname morderline morderline setc_bpartner_id getc_bpartner_id getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id setm_product_id p_m_product_id setqty setprice orderline addlog getdocumentno getname get country cached param ctx context param c country id id return country public static m country get properties ctx int c country id if s countries null s countries size 0 load all countries ctx string key string value of c country id m country c m country s countries get key if c null return c c new m country ctx c country id null if c getc country id c country id s countries put key c return c return null c_country_id mcountry c_country_id s_countries s_countries loadallcountries valueof c_country_id mcountry mcountry s_countries mcountry c_country_id getc_country_id c_country_id s_countries get default country param ctx context return country public static m country get default properties ctx if s countries null s countries size 0 load all countries ctx return s default mcountry getdefault s_countries s_countries loadallcountries s_default return countries as array param ctx context return m country array suppress warnings unchecked public static m country get countries properties ctx if s countries null s countries size 0 load all countries ctx m country ret value new m country s countries size s countries values to array ret value arrays sort ret value new m country ctx 0 null return ret value mcountry suppresswarnings mcountry getcountries s_countries s_countries loadallcountries mcountry retvalue mcountry s_countries s_countries toarray retvalue retvalue mcountry retvalue load countries set default language to client language param ctx context private static void load all countries properties ctx m client client m client get ctx m language lang m language get ctx client getad language m country usa null s countries new c cache string m country c country 250 string sql select from c country where is active y try statement stmt db create statement result set rs stmt execute query sql while rs next m country c new m country ctx rs null s countries put string value of c getc country id c country code of client language if lang null lang get country code equals c get country code s default c if c getc country id 100 usa usa c rs close stmt close catch sql exception e s log log level severe sql e if s default null s default usa s log fine s countries size default s default loadallcountries mclient mclient mlanguage mlanguage getad_language mcountry s_countries ccache mcountry c_country c_country isactive createstatement resultset executequery mcountry mcountry s_countries valueof getc_country_id getcountrycode getcountrycode s_default getc_country_id sqlexception s_log s_default s_default s_log s_countries s_default set the language for display to string param ad language language or null public static void set display language string ad language s ad language ad language if language is base language ad language s ad language null tostring ad_language setdisplaylanguage ad_language s_ad_language ad_language isbaselanguage ad_language s_ad_language create empty country param ctx context param c country id id public m country properties ctx int c country id string trx name super ctx c country id trx name if c country id 0 set name null set country code null set display sequence displaysequence set has region false sethaspostal add false set is address lines local reverse false set is address lines reverse false c_country_id mcountry c_country_id trxname c_country_id trxname c_country_id setname setcountrycode setdisplaysequence sethasregion sethaspostal_add setisaddresslineslocalreverse setisaddresslinesreverse create country from current row in result set param ctx context param rs result set public m country properties ctx result set rs string trx name super ctx rs trx name resultset resultset mcountry resultset trxname trxname return name translated if display language is set return name public string to string if s ad language null string nn get trl name if nn null return nn return get name displaylanguage tostring s_ad_language gettrlname getname get translated name return name public string get trl name if m trlname null s ad language null m trlname get translation name s ad language if m trlname null s ad language null assume that there is no translation return m trlname gettrlname m_trlname s_ad_language m_trlname get_translation s_ad_language m_trlname s_ad_language m_trlname get display sequence return display sequence public string get display sequence string ds super get display sequence if ds null ds length 0 ds displaysequence return ds getdisplaysequence getdisplaysequence get local display sequence if not defined get display sequence return local display sequence public string get display sequence local string ds super get display sequence local if ds null ds length 0 ds get display sequence return ds getdisplaysequencelocal getdisplaysequencelocal getdisplaysequence compare based on name param o1 object 1 param o2 object 2 return 1 0 1 public int compare object o1 object o2 string s1 o1 to string if s1 null s1 string s2 o2 to string if s2 null s2 return s1 compare to s2 tostring tostring compareto is the region valid in the country param c region id region return true if valid public boolean is valid region int c region id if c region id 0 getc country id 0 is has region return false m region regions m region get regions get ctx getc country id for int i 0 i regions length i if c region id regions i getc region id return true return false c_region_id isvalidregion c_region_id c_region_id getc_country_id ishasregion mregion mregion getregions getctx getc_country_id c_region_id getc_region_id insert countries param args none public static void main string args migration before update c country set ad client id 0 ad org id 0 where ad client id 0 or ad org id 0 update c region set ad client id 0 ad org id 0 where ad client id 0 or ad org id 0 i ds migration for c location c city c tax c country c region from http www iso org iso en prods services iso3166ma 02iso 3166 code lists list en1 semic txt string countries afghanistan af albania al algeria dz american samoa as andorra ad angola ao anguilla ai antarctica aq antigua and barbuda ag argentina ar armenia am aruba aw australia au austria at azerbaijan az bahamas bs bahrain bh bangladesh bd barbados bb belarus by belgium be belize bz benin bj bermuda bm bhutan bt bolivia bo bosnia and herzegovina ba botswana bw bouvet island bv brazil br british indian ocean territory io brunei darussalam bn bulgaria bg burkina faso bf burundi bi cambodia kh cameroon cm canada ca cape verde cv cayman islands ky central african republic cf chad td chile cl china cn christmas island cx cocos keeling islands cc colombia co comoros km congo cg congo the democratic republic of the cd cook islands ck costa rica cr cote d ivoire ci croatia hr cuba cu cyprus cy czech republic cz denmark dk djibouti dj dominica dm dominican republic do ecuador ec egypt eg el salvador sv equatorial guinea gq eritrea er estonia ee ethiopia et falkland islands malvinas fk faroe islands fo fiji fj finland fi france fr french guiana gf french polynesia pf french southern territories tf gabon ga gambia gm georgia ge germany de ghana gh gibraltar gi greece gr greenland gl grenada gd guadeloupe gp guam gu guatemala gt guinea gn guinea bissau gw guyana gy haiti ht heard island and mcdonald islands hm holy see vatican city state va honduras hn hong kong hk hungary hu iceland is india in indonesia id iran islamic republic of ir iraq iq ireland ie israel il italy it jamaica jm japan jp jordan jo kazakhstan kz kenya ke kiribati ki korea democratic people s republic of kp korea republic of kr kuwait kw kyrgyzstan kg lao people s democratic republic la latvia lv lebanon lb lesotho ls liberia lr libyan arab jamahiriya ly liechtenstein li lithuania lt luxembourg lu macao mo macedonia former yugoslav republic of mk madagascar mg malawi mw malaysia my maldives mv mali ml malta mt marshall islands mh martinique mq mauritania mr mauritius mu mayotte yt mexico mx micronesia federated states of fm moldova republic of md monaco mc mongolia mn montserrat ms morocco ma mozambique mz myanmar mm namibia na nauru nr nepal np netherlands nl netherlands antilles an new caledonia nc new zealand nz nicaragua ni niger ne nigeria ng niue nu norfolk island nf northern mariana islands mp norway no oman om pakistan pk palau pw palestinian territory occupied ps panama pa papua new guinea pg paraguay py peru pe philippines ph pitcairn pn poland pl portugal pt puerto rico pr qatar qa reunion re romania ro russian federation ru rwanda rw saint helena sh saint kitts and nevis kn saint lucia lc saint pierre and miquelon pm saint vincent and the grenadines vc samoa ws san marino sm sao tome and principe st saudi arabia sa senegal sn seychelles sc sierra leone sl singapore sg slovakia sk slovenia si solomon islands sb somalia so south africa za south georgia and the south sandwich islands gs spain es sri lanka lk sudan sd suriname sr svalbard and jan mayen sj swaziland sz sweden se switzerland ch syrian arab republic sy taiwan tw tajikistan tj tanzania united republic of tz thailand th timor leste tl togo tg tokelau tk tonga to trinidad and tobago tt tunisia tn turkey tr turkmenistan tm turks and caicos islands tc tuvalu tv uganda ug ukraine ua united arab emirates ae united kingdom gb united states us united states minor outlying islands um uruguay uy uzbekistan uz vanuatu vu venezuela ve viet nam vn virgin islands british vg virgin islands u s vi wallis and futuna wf western sahara eh yemen ye yugoslavia yu zambia zm zimbabwe zw org compiere compiere startup client string tokenizer st new string tokenizer countries false while st has more tokens string s st next token trim int pos s index of string name util init cap s substring 0 pos string cc s substring pos 1 system out println cc name m country mc new m country env get ctx 0 mc set country code cc mc set name name mc set description name mc save c_country ad_client_id ad_org_id ad_client_id ad_org_id c_region ad_client_id ad_org_id ad_client_id ad_org_id ids c_location c_city c_tax c_country c_region startupclient stringtokenizer stringtokenizer hasmoretokens nexttoken indexof initcap mcountry mcountry getctx setcountrycode setname setdescription standard constructor public x ad impformat row properties ctx int ad impformat row id string trx name super ctx ad impformat row id trx name if ad impformat row id 0 setad column id 0 setad impformat id 0 setad impformat row id 0 set data type null set decimal point null set divide by100 false set name null set seq no 0 sql select nvl max seq no 0 10 as default value from ad impformat row where ad impformat id ad impformat id x_ad_impformat_row ad_impformat_row_id trxname ad_impformat_row_id trxname ad_impformat_row_id setad_column_id setad_impformat_id setad_impformat_row_id setdatatype setdecimalpoint setdivideby100 setname setseqno seqno defaultvalue ad_impformat_row ad_impformat_id ad_impformat_id load constructor public x ad impformat row properties ctx result set rs string trx name super ctx rs trx name x_ad_impformat_row resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad impformat row append get id append return sb to string tostring stringbuffer stringbuffer x_ad_impformat_row get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set import format public void setad impformat id int ad impformat id if ad impformat id 1 throw new illegal argument exception ad impformat id is mandatory set valuenocheck ad impformat id new integer ad impformat id setad_impformat_id ad_impformat_id ad_impformat_id illegalargumentexception ad_impformat_id set_valuenocheck ad_impformat_id ad_impformat_id get import format public int getad impformat id integer ii integer get value ad impformat id if ii null return 0 return ii int value getad_impformat_id get_value ad_impformat_id intvalue set format field public void setad impformat row id int ad impformat row id if ad impformat row id 1 throw new illegal argument exception ad impformat row id is mandatory set valuenocheck ad impformat row id new integer ad impformat row id setad_impformat_row_id ad_impformat_row_id ad_impformat_row_id illegalargumentexception ad_impformat_row_id set_valuenocheck ad_impformat_row_id ad_impformat_row_id get format field public int getad impformat row id integer ii integer get value ad impformat row id if ii null return 0 return ii int value getad_impformat_row_id get_value ad_impformat_row_id intvalue set callout fully qualified class names and method separated by semicolons public void set callout string callout if callout null callout length 60 log warning length 60 truncated callout callout substring 0 59 set value callout callout setcallout set_value get callout fully qualified class names and method separated by semicolons public string get callout return string get value callout getcallout get_value set constant value constant value public void set constant value string constant value if constant value null constant value length 60 log warning length 60 truncated constant value constant value substring 0 59 set value constant value constant value setconstantvalue constantvalue constantvalue constantvalue constantvalue constantvalue set_value constantvalue constantvalue get constant value constant value public string get constant value return string get value constant value getconstantvalue get_value constantvalue set data format format string in java notation e g ddm myy public void set data format string data format if data format null data format length 20 log warning length 20 truncated data format data format substring 0 19 set value data format data format ddmmyy setdataformat dataformat dataformat dataformat dataformat dataformat set_value dataformat dataformat get data format format string in java notation e g ddm myy public string get data format return string get value data format ddmmyy getdataformat get_value dataformat public static final string datatype string s set data type type of data public void set data type string data type if data type null throw new illegal argument exception data type is mandatory if data type equals c data type equals d data type equals n data type equals s else throw new illegal argument exception data type invalid value data type reference id 210 c d n s if data type length 1 log warning length 1 truncated data type data type substring 0 0 set value data type data type datatype_string setdatatype datatype datatype illegalargumentexception datatype datatype datatype datatype datatype illegalargumentexception datatype datatype reference_id datatype datatype datatype set_value datatype datatype get data type type of data public string get data type return string get value data type getdatatype get_value datatype set decimal point decimal point in the data file if any public void set decimal point string decimal point if decimal point null throw new illegal argument exception decimal point is mandatory if decimal point length 1 log warning length 1 truncated decimal point decimal point substring 0 0 set value decimal point decimal point setdecimalpoint decimalpoint decimalpoint illegalargumentexception decimalpoint decimalpoint decimalpoint decimalpoint set_value decimalpoint decimalpoint get decimal point decimal point in the data file if any public string get decimal point return string get value decimal point getdecimalpoint get_value decimalpoint set divide by 100 divide number by 100 to get correct amount public void set divide by100 boolean divide by100 set value divide by100 new boolean divide by100 setdivideby100 divideby100 set_value divideby100 divideby100 get divide by 100 divide number by 100 to get correct amount public boolean is divide by100 object oo get value divide by100 if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdivideby100 get_value divideby100 booleanvalue set end no public void set end no int end no set value end no new integer end no setendno endno set_value endno endno get end no public int get end no integer ii integer get value end no if ii null return 0 return ii int value getendno get_value endno intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set script dynamic java language script to calculate result public void set script string script if script null script length 2000 log warning length 2000 truncated script script substring 0 1999 set value script script setscript set_value get script dynamic java language script to calculate result public string get script return string get value script getscript get_value set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set start no starting number position public void set start no int start no set value start no new integer start no setstartno startno set_value startno startno get start no starting number position public int get start no integer ii integer get value start no if ii null return 0 return ii int value getstartno get_value startno intvalue get request id from mail text param mail text mail text return id if it contains request tag otherwise 0 public static int getr request id string mail text if mail text null return 0 int index start mail text index of tag start if index start 1 return 0 int index end mail text index of tag end index start if index end 1 return 0 index start 5 string id string mail text substring index start index end int r request id 0 try r request id integer parse int id string catch exception e s log severe cannot parse id string return r request id mailtext getr_request_id mailtext mailtext indexstart mailtext indexof tag_start indexstart indexend mailtext indexof tag_end indexstart indexend indexstart idstring mailtext indexstart indexend r_request_id r_request_id parseint idstring s_log idstring r_request_id constructor param ctx context param r request id request or 0 for new public m request properties ctx int r request id string trx name super ctx r request id trx name if r request id 0 set due type duetype due setsalesrep id 0 set document no null set confidential type confidentialtype customerconfidential a set confidential type entry confidentialtypeentry customerconfidential a set processed false set request amt env zero set priority user priority low setr requesttype id 0 set summary null set is escalated false set is self service false set is invoiced false r_request_id mrequest r_request_id trxname r_request_id trxname r_request_id setduetype duetype_due setsalesrep_id setdocumentno setconfidentialtype confidentialtype_customerconfidential setconfidentialtypeentry confidentialtypeentry_customerconfidential setprocessed setrequestamt setpriorityuser priority_low setr_requesttype_id setsummary setisescalated setisselfservice setisinvoiced self service constructor param ctx context param salesrep id sales rep param r requesttype id request type param summary summary param is self service self service public m request properties ctx int salesrep id int r requesttype id string summary boolean is self service string trx name this ctx 0 trx name set value salesrep id new integer salesrep id could be 0 set value r requesttype id new integer r requesttype id set summary summary set is self service is self service get request type if m requesttype null string ct m requesttype get confidential type if ct null set confidential type ct set confidential type entry ct selfservice salesrep_id salesrep r_requesttype_id isselfservice mrequest salesrep_id r_requesttype_id isselfservice trxname trxname set_value salesrep_id salesrep_id set_value r_requesttype_id r_requesttype_id setsummary setisselfservice isselfservice getrequesttype m_requesttype m_requesttype getconfidentialtype setconfidentialtype setconfidentialtypeentry load constructor param ctx context param rs result set public m request properties ctx result set rs string trx name super ctx rs trx name mrequest resultset trxname trxname set default request type public void setr requesttype id m requesttype m request type get default get ctx if m requesttype null log warning no default found else super setr requesttype id m requesttype getr requesttype id setr_requesttype_id m_requesttype mrequesttype getdefault getctx m_requesttype setr_requesttype_id m_requesttype getr_requesttype_id set default request status public void setr status id m status status m status get default get ctx getr requesttype id if status null log warning no default found if getr status id 0 setr status id 0 else setr status id status getr status id setr_status_id mstatus mstatus getdefault getctx getr_requesttype_id getr_status_id setr_status_id setr_status_id getr_status_id add to result param result public void add to result string result string old result get result if result null result length 0 else if old result null old result length 0 set result result else set result old result n n result addtoresult oldresult getresult oldresult oldresult setresult setresult oldresult set due type based on date next action public void set due type timestamp due get date next action if due null return timestamp overdue time util add days due get request type get due date tolerance timestamp now new timestamp system current time millis string due type duetype due if now before due due type duetype scheduled else if now after overdue due type duetype overdue super set due type due type duetype setduetype getdatenextaction timeutil adddays getrequesttype getduedatetolerance currenttimemillis duetype duetype_due duetype duetype_scheduled duetype duetype_overdue setduetype duetype get action history return array of actions public m request action get actions string sql select from r requestaction where r request id order by created desc array list m request action list new array list m request action prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getr request id result set rs pstmt execute query while rs next list add new m request action get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m request action ret value new m request action list size list to array ret value return ret value mrequestaction getactions r_requestaction r_request_id arraylist mrequestaction arraylist mrequestaction preparedstatement preparestatement get_trxname setint getr_request_id resultset executequery mrequestaction getctx get_trxname mrequestaction retvalue mrequestaction toarray retvalue retvalue get updates param confidential type maximum confidential type null all return updates public m request update get updates string confidential type string sql select from r requestupdate where r request id order by created desc array list m request update list new array list m request update prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getr request id result set rs pstmt execute query while rs next m request update ru new m request update get ctx rs get trxname if confidential type null private only if private if ru get confidential type entry equals confidentialtypeentry privateinformation confidential type equals confidentialtypeentry privateinformation continue internal not if customer public if ru get confidential type entry equals confidentialtypeentry internal confidential type equals confidentialtypeentry customerconfidential confidential type equals confidentialtypeentry publicinformation continue no customer if public if ru get confidential type entry equals confidentialtypeentry customerconfidential confidential type equals confidentialtypeentry publicinformation continue list add ru rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m request update ret value new m request update list size list to array ret value return ret value confidentialtype mrequestupdate getupdates confidentialtype r_requestupdate r_request_id arraylist mrequestupdate arraylist mrequestupdate preparedstatement preparestatement get_trxname setint getr_request_id resultset executequery mrequestupdate mrequestupdate getctx get_trxname confidentialtype getconfidentialtypeentry confidentialtypeentry_privateinformation confidentialtype confidentialtypeentry_privateinformation getconfidentialtypeentry confidentialtypeentry_internal confidentialtype confidentialtypeentry_customerconfidential confidentialtype confidentialtypeentry_publicinformation getconfidentialtypeentry confidentialtypeentry_customerconfidential confidentialtype confidentialtypeentry_publicinformation mrequestupdate retvalue mrequestupdate toarray retvalue retvalue get public updates return public updates public m request update get updates public return get updates confidentialtype publicinformation mrequestupdate getupdatespublic getupdates confidentialtype_publicinformation get customer updates return customer updates public m request update get updates customer return get updates confidentialtype customerconfidential mrequestupdate getupdatescustomer getupdates confidentialtype_customerconfidential get internal updates return internal updates public m request update get updates internal return get updates confidentialtype internal mrequestupdate getupdatesinternal getupdates confidentialtype_internal get request type return request type public m request type get request type if m requesttype null int r requesttype id getr requesttype id if r requesttype id 0 setr requesttype id r requesttype id getr requesttype id m requesttype m request type get get ctx r requesttype id return m requesttype mrequesttype getrequesttype m_requesttype r_requesttype_id getr_requesttype_id r_requesttype_id setr_requesttype_id r_requesttype_id getr_requesttype_id m_requesttype mrequesttype getctx r_requesttype_id m_requesttype get request type text for jsp return request type text public string get request type name if m requesttype null get request type if m requesttype null return return m requesttype get name getrequesttypename m_requesttype getrequesttype m_requesttype m_requesttype getname get request category return category public m request category get category if getr category id 0 return null return m request category get get ctx getr category id mrequestcategory getcategory getr_category_id mrequestcategory getctx getr_category_id get request category name return name public string get category name m request category cat get category if cat null return return cat get name getcategoryname mrequestcategory getcategory getname get request group return group public m group get group if getr group id 0 return null return m group get get ctx getr group id mgroup getgroup getr_group_id mgroup getctx getr_group_id get request group name return name public string get group name m group grp get group if grp null return return grp get name getgroupname mgroup getgroup getname get status return status public m status get status if getr status id 0 return null return m status get get ctx getr status id mstatus getstatus getr_status_id mstatus getctx getr_status_id get request status name return name public string get status name m status sta get status if sta null return return sta get name getstatusname mstatus getstatus getname get request resolution return resolution public m resolution get resolution if getr resolution id 0 return null return m resolution get get ctx getr resolution id mresolution getresolution getr_resolution_id mresolution getctx getr_resolution_id get request resolution name return name public string get resolution name m resolution res get resolution if res null return return res get name getresolutionname mresolution getresolution getname is overdue return true if overdue public boolean is overdue return duetype overdue equals get due type isoverdue duetype_overdue getduetype is due return true if due public boolean is due return duetype due equals get due type isdue duetype_due getduetype get due type text for jsp return text public string get due type text return m ref list get list name get ctx duetype ad reference id get due type duetype getduetypetext mreflist getlistname getctx duetype_ad_reference_id getduetype get priority text for jsp return text public string get priority text return m ref list get list name get ctx priority ad reference id get priority getprioritytext mreflist getlistname getctx priority_ad_reference_id getpriority get importance text for jsp return text public string get priority user text return m ref list get list name get ctx priorityuser ad reference id get priority user getpriorityusertext mreflist getlistname getctx priorityuser_ad_reference_id getpriorityuser get confidential text for jsp return text public string get confidential text return m ref list get list name get ctx confidentialtype ad reference id get confidential type getconfidentialtext mreflist getlistname getctx confidentialtype_ad_reference_id getconfidentialtype get confidential entry text for jsp return text public string get confidential entry text return m ref list get list name get ctx confidentialtypeentry ad reference id get confidential type entry getconfidentialentrytext mreflist getlistname getctx confidentialtypeentry_ad_reference_id getconfidentialtypeentry set date last alert to today public void set date last alert super set date last alert new timestamp system current time millis setdatelastalert setdatelastalert currenttimemillis get sales rep return sales rep user public m user get sales rep if getsalesrep id 0 return null return m user get get ctx getsalesrep id muser getsalesrep getsalesrep_id muser getctx getsalesrep_id get sales rep name return sales rep user public string get sales rep name m user sr get sales rep if sr null return n a return sr get name getsalesrepname muser getsalesrep getname get name of creator return name public string get created by name m user user m user get get ctx get created by return user get name getcreatedbyname muser muser getctx getcreatedby getname get contact may be not defined return sales rep user public m user get user if getad user id 0 return null if m user null m user getad user id getad user id m user null if m user null m user new m user get ctx getad user id get trxname return m user muser getuser getad_user_id m_user m_user getad_user_id getad_user_id m_user m_user m_user muser getctx getad_user_id get_trxname m_user get b partner may be not defined return sales rep user public mb partner getb partner if getc bpartner id 0 return null if m partner null m partner getc bpartner id getc bpartner id m partner null if m partner null m partner new mb partner get ctx getc bpartner id get trxname return m partner bpartner mbpartner getbpartner getc_bpartner_id m_partner m_partner getc_bpartner_id getc_bpartner_id m_partner m_partner m_partner mbpartner getctx getc_bpartner_id get_trxname m_partner web can update request return true if web can update public boolean is web can update if is processed return false if getr status id 0 setr status id if getr status id 0 return false m status status m status get get ctx getr status id if status null return false return status is web can update iswebcanupdate isprocessed getr_status_id setr_status_id getr_status_id mstatus mstatus getctx getr_status_id iswebcanupdate set priority private void set priority if get priority user null set priority user priorityuser low if getb partner null mbp group bpg mbp group get get ctx getb partner getc bp group id string prio base bpg get priority base if prio base null prio base equals mbp group prioritybase same char target prio get priority user char at 0 if prio base equals mbp group prioritybase lower target prio 2 else target prio 2 if target prio priority high char at 0 1 target prio priority high char at 0 if target prio priority low char at 0 9 target prio priority low char at 0 if get priority null set priority string value of target prio else previous priority if target prio get priority char at 0 set priority string value of target prio same if nothing else if get priority null set priority get priority user setpriority getpriorityuser setpriorityuser priorityuser_low getbpartner mbpgroup mbpgroup getctx getbpartner getc_bp_group_id priobase getprioritybase priobase priobase mbpgroup prioritybase_same targetprio getpriorityuser charat priobase mbpgroup prioritybase_lower targetprio targetprio targetprio priority_high charat targetprio priority_high charat targetprio priority_low charat targetprio priority_low charat getpriority setpriority valueof targetprio targetprio getpriority charat setpriority valueof targetprio getpriority setpriority getpriorityuser set confidential type entry param confidential type entry confidentiality public void set confidential type entry string confidential type entry if confidential type entry null confidential type entry get confidential type if confidentialtype internal equals get confidential type super set confidential type entry confidentialtype internal else if confidentialtype privateinformation equals get confidential type if confidentialtype internal equals confidential type entry confidentialtype privateinformation equals confidential type entry super set confidential type entry confidential type entry else super set confidential type entry confidentialtype privateinformation else if confidentialtype customerconfidential equals get confidential type if confidentialtype internal equals confidential type entry confidentialtype privateinformation equals confidential type entry confidentialtype customerconfidential equals confidential type entry super set confidential type entry confidential type entry else super set confidential type entry confidentialtype customerconfidential else if confidentialtype publicinformation equals get confidential type super set confidential type entry confidential type entry confidentialtypeentry setconfidentialtypeentry confidentialtypeentry confidentialtypeentry confidentialtypeentry getconfidentialtype confidentialtype_internal getconfidentialtype setconfidentialtypeentry confidentialtype_internal confidentialtype_privateinformation getconfidentialtype confidentialtype_internal confidentialtypeentry confidentialtype_privateinformation confidentialtypeentry setconfidentialtypeentry confidentialtypeentry setconfidentialtypeentry confidentialtype_privateinformation confidentialtype_customerconfidential getconfidentialtype confidentialtype_internal confidentialtypeentry confidentialtype_privateinformation confidentialtypeentry confidentialtype_customerconfidential confidentialtypeentry setconfidentialtypeentry confidentialtypeentry setconfidentialtypeentry confidentialtype_customerconfidential confidentialtype_publicinformation getconfidentialtype setconfidentialtypeentry confidentialtypeentry web update param result result return true if updated public boolean web update string result m status status m status get get ctx getr status id if status is web can update return false if status getupdate status id 0 setr status id status getupdate status id set result result return true webupdate mstatus mstatus getctx getr_status_id iswebcanupdate getupdate_status_id setr_status_id getupdate_status_id setresult string representation return info public string to string string buffer sb new string buffer m request sb append get id append append get document no append return sb to string tostring stringbuffer stringbuffer mrequest get_id getdocumentno tostring create pdf return pdf or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save param new record new return true protected boolean before save boolean new record request type get request type if new record is valuechanged r requesttype id if m requesttype null if is invoiced m requesttype is invoiced set is invoiced m requesttype is invoiced if get date next action null m requesttype get auto due date days 0 set date next action time util add days new timestamp system current time millis m requesttype get auto due date days is status valid if getr status id 0 m status sta m status get get ctx getr status id m request type rt m request type get get ctx getr requesttype id if sta getr statuscategory id rt getr statuscategory id setr status id set to default request status if getr status id 0 setr status id validate update due type set due type m status status m status get get ctx getr status id close open if status null if status is open if get start date null set start date new timestamp system current time millis if get close date null set close date null if status is closed get close date null set close date new timestamp system current time millis if status is final close set processed true confidential info if get confidential type null get request type if m requesttype null string ct m requesttype get confidential type if ct null set confidential type ct if get confidential type null set confidential type confidentialtypeentry publicinformation if get confidential type entry null set confidential type entry get confidential type else set confidential type entry get confidential type entry importance priority set priority new if new record return true change log m changed false array list string send info new array list string m request action ra new m request action this false if check change ra r requesttype id send info add r requesttype id if check change ra r group id send info add r group id if check change ra r category id send info add r category id if check change ra r status id send info add r status id if check change ra r resolution id send info add r resolution id if check change ra salesrep id sender int ad user id env get context as int p ctx ad user id if ad user id 0 ad user id get updated by old object oo get valueold salesrep id int oldsalesrep id 0 if oo instanceof integer oldsalesrep id integer oo int value if oldsalesrep id 0 request action transfer request 0 was transfered by 1 from 2 to 3 object args new object get document no m user get name of user ad user id m user get name of user oldsalesrep id m user get name of user getsalesrep id string msg msg get msg get ctx request action transfer args add to result msg send info add salesrep id check change ra ad role id check change ra priority if check change ra priority user send info add priority user if check change ra is escalated send info add is escalated check change ra confidential type check change ra summary check change ra is self service check change ra c bpartner id check change ra ad user id check change ra c project id check change ra a asset id check change ra c order id check change ra c invoice id check change ra m product id check change ra c payment id check change ra m inout id check change ra m rma id check change ra c campaign id check change ra request amt check change ra is invoiced check change ra c activity id check change ra date next action check change ra m productspent id check change ra qty spent check change ra qty invoiced check change ra start date check change ra close date check change ra task status check change ra date start plan check change ra date complete plan if m changed ra save current info m request update update new m request update this if update is new info update save else update null m emailto new string buffer if update null send info size 0 send notices send info update set date last action get updated set last result get result set due type reset set confidential type entry get confidential type set start date null set end time null setr standardresponse id 0 setr mailtext id 0 set result null set qty spent null set qty invoiced null return true newrecord beforesave newrecord getrequesttype newrecord is_valuechanged r_requesttype_id m_requesttype isinvoiced m_requesttype isinvoiced setisinvoiced m_requesttype isinvoiced getdatenextaction m_requesttype getautoduedatedays setdatenextaction timeutil adddays currenttimemillis m_requesttype getautoduedatedays getr_status_id mstatus mstatus getctx getr_status_id mrequesttype mrequesttype getctx getr_requesttype_id getr_statuscategory_id getr_statuscategory_id setr_status_id getr_status_id setr_status_id setduetype mstatus mstatus getctx getr_status_id isopen getstartdate setstartdate currenttimemillis getclosedate setclosedate isclosed getclosedate setclosedate currenttimemillis isfinalclose setprocessed getconfidentialtype getrequesttype m_requesttype m_requesttype getconfidentialtype setconfidentialtype getconfidentialtype setconfidentialtype confidentialtypeentry_publicinformation getconfidentialtypeentry setconfidentialtypeentry getconfidentialtype setconfidentialtypeentry getconfidentialtypeentry setpriority newrecord m_changed arraylist sendinfo arraylist mrequestaction mrequestaction checkchange r_requesttype_id sendinfo r_requesttype_id checkchange r_group_id sendinfo r_group_id checkchange r_category_id sendinfo r_category_id checkchange r_status_id sendinfo r_status_id checkchange r_resolution_id sendinfo r_resolution_id checkchange salesrep_id ad_user_id getcontextasint p_ctx ad_user_id ad_user_id ad_user_id getupdatedby get_valueold salesrep_id oldsalesrep_id oldsalesrep_id intvalue oldsalesrep_id requestactiontransfer getdocumentno muser getnameofuser ad_user_id muser getnameofuser oldsalesrep_id muser getnameofuser getsalesrep_id getmsg getctx requestactiontransfer addtoresult sendinfo salesrep_id checkchange ad_role_id checkchange checkchange priorityuser sendinfo priorityuser checkchange isescalated sendinfo isescalated checkchange confidentialtype checkchange checkchange isselfservice checkchange c_bpartner_id checkchange ad_user_id checkchange c_project_id checkchange a_asset_id checkchange c_order_id checkchange c_invoice_id checkchange m_product_id checkchange c_payment_id checkchange m_inout_id checkchange m_rma_id checkchange c_campaign_id checkchange requestamt checkchange isinvoiced checkchange c_activity_id checkchange datenextaction checkchange m_productspent_id checkchange qtyspent checkchange qtyinvoiced checkchange startdate checkchange closedate checkchange taskstatus checkchange datestartplan checkchange datecompleteplan m_changed mrequestupdate mrequestupdate isnewinfo m_emailto stringbuffer sendinfo sendnotices sendinfo setdatelastaction getupdated setlastresult getresult setduetype setconfidentialtypeentry getconfidentialtype setstartdate setendtime setr_standardresponse_id setr_mailtext_id setresult setqtyspent setqtyinvoiced check for changes param ra request action param column name column return true if changes private boolean check change m request action ra string column name if is valuechanged column name object value get valueold column name if value null ra add null column column name else ra set valuenocheck column name value m changed true return true return false columnname checkchange mrequestaction columnname is_valuechanged columnname get_valueold columnname addnullcolumn columnname set_valuenocheck columnname m_changed check the ability to send email return ad message or null if no error private string checke mail mail host m client client m client get get ctx if client null client getsmtp host null client getsmtp host length 0 return request actione mail nosmtp mail to m user to new m user get ctx getad user id get trxname if to null to gete mail null to gete mail length 0 return request actione mail no to mail from real user m user from m user get get ctx env getad user id get ctx if from null from gete mail null from gete mail length 0 return request actione mail no from check that ui user is request user int realsalesrep id env get context as int get ctx ad user id if realsalesrep id getsalesrep id setsalesrep id realsalesrep id request actione mail info e mail from 0 to 1 object args new object email from email to string msg msg get msg get ctx request actione mail info args set last result msg return null ad_message checkemail mclient mclient getctx getsmtphost getsmtphost requestactionemailnosmtp muser muser getctx getad_user_id get_trxname getemail getemail requestactionemailnoto muser muser getctx getad_user_id getctx getemail getemail requestactionemailnofrom realsalesrep_id getcontextasint getctx ad_user_id realsalesrep_id getsalesrep_id setsalesrep_id realsalesrep_id requestactionemailinfo email emailfrom emailto getmsg getctx requestactionemailinfo setlastresult set salesrep id param salesrep id id public void setsalesrep id int salesrep id if salesrep id 0 super setsalesrep id salesrep id else if getsalesrep id 0 log warning ignored tried to set salesrep id to 0 from getsalesrep id salesrep_id salesrep_id setsalesrep_id salesrep_id salesrep_id setsalesrep_id salesrep_id getsalesrep_id salesrep_id getsalesrep_id after save param new record new param success success return success protected boolean after save boolean new record boolean success if success return success create update if new record get result null m request update update new m request update this update save initial mail if new record send notices new array list change request created in request processor if getm changerequest id 0 is valuechanged r group id different ecn assignment int oldid get valueoldasint r group id if getr group id 0 setm changerequest id 0 not effective as in after save else m group oldg m group get get ctx oldid m group newg m group get get ctx getr group id if oldg getm bom id newg getm bom id oldg getm changenotice id newg getm changenotice id m change request ecr new m change request get ctx getm changerequest id get trxname if ecr is processed ecr getm fixchangenotice id 0 ecr setm bom id newg getm bom id ecr setm changenotice id newg getm changenotice id ecr save if m emailto length 0 log save info request actione mailok m emailto to string return success newrecord aftersave newrecord newrecord getresult mrequestupdate mrequestupdate newrecord sendnotices arraylist changerequest getm_changerequest_id is_valuechanged r_group_id get_valueoldasint r_group_id getr_group_id setm_changerequest_id aftersave mgroup mgroup getctx mgroup mgroup getctx getr_group_id getm_bom_id getm_bom_id getm_changenotice_id getm_changenotice_id mchangerequest mchangerequest getctx getm_changerequest_id get_trxname isprocessed getm_fixchangenotice_id setm_bom_id getm_bom_id setm_changenotice_id getm_changenotice_id m_emailto saveinfo requestactionemailok m_emailto tostring send transfer message private void send transfer message sender int ad user id env get context as int p ctx ad user id if ad user id 0 ad user id get updated by old object oo get valueold salesrep id int oldsalesrep id 0 if oo instanceof integer oldsalesrep id integer oo int value request action transfer request 0 was transfered by 1 from 2 to 3 object args new object get document no m user get name of user ad user id m user get name of user oldsalesrep id m user get name of user getsalesrep id string subject msg get msg get ctx request action transfer args string message subject n get summary m client client m client get get ctx m user from m user get get ctx ad user id m user to m user get get ctx getsalesrep id client sende mail from to subject message createpdf sendtransfermessage ad_user_id getcontextasint p_ctx ad_user_id ad_user_id ad_user_id getupdatedby get_valueold salesrep_id oldsalesrep_id oldsalesrep_id intvalue requestactiontransfer getdocumentno muser getnameofuser ad_user_id muser getnameofuser oldsalesrep_id muser getnameofuser getsalesrep_id getmsg getctx requestactiontransfer getsummary mclient mclient getctx muser muser getctx ad_user_id muser muser getctx getsalesrep_id sendemail send update e mail notices param list list of changes public void send notices array list list subject string subject msg translate get ctx r request id msg get msg get ctx updated get document no message string buffer message new string buffer updated by joe int updated by env getad user id get ctx m user from m user get get ctx updated by if from null message append msg translate get ctx updated by append append from get name last action created if get date last action null message append n append msg translate get ctx date last action append append get date last action else message append n append msg translate get ctx created append append get created changes for int i 0 i list size i string column name string list get i message append n append msg get element get ctx column name append append get displayvalue column name false append append get displayvalue column name true next action if get date next action null message append n append msg translate get ctx date next action append append get date next action message append separator append get summary if get result null message append n n append get result message append get mail trailer null file pdf createpdf log finer message to string prepare sending notice mail m client client m client get get ctx reset from if external if from gete mail user null from gete mail userpw null from null int success 0 int failure 0 int notices 0 array list integer user list new array list integer string sql select u ad user id u notification type u e mail u name max r ad role id from rv requestupdates only ru inner join ad user u on ru ad user id u ad user id left outer join ad user roles r on u ad user id r ad user id where ru r request id group by u ad user id u notification type u e mail u name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getr request id result set rs pstmt execute query while rs next int ad user id rs get int 1 string notification type rs get string 2 if notification type null notification type m user notificationtype email string email rs get string 3 string name rs get string 4 role int ad role id rs get int 5 if rs was null ad role id 1 don t send mail to oneself if ad user id updated by continue no confidential to externals if ad role id 1 get confidential type entry equals confidentialtype internal get confidential type entry equals confidentialtype privateinformation continue if m user notificationtype none equals notification type log config opt out name continue if m user notificationtype email equals notification type m user notificationtype emailplusnotice equals notification type email null email length 0 if ad role id 0 notification type m user notificationtype notice else log config no e mail name continue if m user notificationtype notice equals notification type ad role id 0 log config no internal user name continue check duplicate receivers integer ii new integer ad user id if user list contains ii continue user list add ii m user to m user get get ctx ad user id send mail if m user notificationtype email equals notification type m user notificationtype emailplusnotice equals notification type if client sende mail from to subject message to string pdf success if m emailto length 0 m emailto append m emailto append to gete mail else log warning failed name failure notification type m user notificationtype notice send note if m user notificationtype notice equals notification type m user notificationtype emailplusnotice equals notification type int ad message id 834 m note note new m note get ctx ad message id ad user id m request table id getr request id subject message to string get trxname if note save notices rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info e mail success success failure failure notices notices email sendnotices arraylist getctx r_request_id getmsg getctx getdocumentno stringbuffer stringbuffer updatedby updatedby getad_user_id getctx muser muser getctx updatedby getctx updatedby getname lastaction getdatelastaction getctx datelastaction getdatelastaction getctx getcreated columnname getelement getctx columnname get_displayvalue columnname get_displayvalue columnname nextaction getdatenextaction getctx datenextaction getdatenextaction getsummary getresult getresult getmailtrailer tostring mclient mclient getctx getemailuser getemailuserpw arraylist userlist arraylist ad_user_id notificationtype email ad_role_id rv_requestupdates_only ad_user ad_user_id ad_user_id ad_user_roles ad_user_id ad_user_id r_request_id ad_user_id notificationtype email preparedstatement preparestatement setint getr_request_id resultset executequery ad_user_id getint notificationtype getstring notificationtype notificationtype muser notificationtype_email getstring getstring ad_role_id getint wasnull ad_role_id ad_user_id updatedby ad_role_id getconfidentialtypeentry confidentialtype_internal getconfidentialtypeentry confidentialtype_privateinformation muser notificationtype_none notificationtype muser notificationtype_email notificationtype muser notificationtype_emailplusnotice notificationtype ad_role_id notificationtype muser notificationtype_notice email muser notificationtype_notice notificationtype ad_role_id ad_user_id userlist userlist muser muser getctx ad_user_id muser notificationtype_email notificationtype muser notificationtype_emailplusnotice notificationtype sendemail tostring m_emailto m_emailto m_emailto getemail notificationtype muser notificationtype_notice muser notificationtype_notice notificationtype muser notificationtype_emailplusnotice notificationtype ad_message_id mnote mnote getctx ad_message_id ad_user_id mrequest table_id getr_request_id tostring get_trxname email get mailid param server address server address return mail trailer public string get mail trailer string server address string buffer sb new string buffer n append separator append msg translate get ctx r request id append append get document no append append get mail tag append n sent by a dempiere mail if server address null sb append from append server address return sb to string serveraddress getmailtrailer serveraddress stringbuffer stringbuffer getctx r_request_id getdocumentno getmailtag nsent adempieremail serveraddress serveraddress tostring get mail tag return req id public string get mail tag return tag start get id tag end getmailtag tag_start get_id tag_end soft close request must be called after web update public void do close m status status m status get get ctx getr status id if status is closed m status closed m status get closed get ctx m status new status null for int i 0 i closed length i if closed i is final close new status closed i break if new status null closed length 0 new status closed 0 if new status null setr status id new status getr status id webupdate doclose mstatus mstatus getctx getr_status_id isclosed mstatus mstatus getclosed getctx mstatus newstatus isfinalclose newstatus newstatus newstatus newstatus setr_status_id newstatus getr_status_id escalate request param user true if user escalated otherwise system public void do escalate boolean user if user string importance get priority user if priorityuser urgent equals importance high as it goes else if priorityuser high equals importance set priority user priorityuser urgent else if priorityuser medium equals importance set priority user priorityuser high else if priorityuser low equals importance set priority user priorityuser medium else if priorityuser minor equals importance set priority user priorityuser low else string importance get priority if priority urgent equals importance high as it goes else if priority high equals importance set priority priority urgent else if priority medium equals importance set priority priority high else if priority low equals importance set priority priority medium else if priority minor equals importance set priority priority low doescalate getpriorityuser priorityuser_urgent priorityuser_high setpriorityuser priorityuser_urgent priorityuser_medium setpriorityuser priorityuser_high priorityuser_low setpriorityuser priorityuser_medium priorityuser_minor setpriorityuser priorityuser_low getpriority priority_urgent priority_high setpriority priority_urgent priority_medium setpriority priority_high priority_low setpriority priority_medium priority_minor setpriority priority_low get contsnts return contents public object get contents return contents getcontents get panel if user has perfpormance goals return panel pr null public static pa panel get int ad user id env getad user id env get ctx m goal goals m goal get user goals env get ctx ad user id if goals length 0 return null return new pa panel goals papanel ad_user_id getad_user_id getctx mgoal mgoal getusergoals getctx ad_user_id papanel constructor param goals private pa panel m goal goals super m goals goals init papanel mgoal m_goals static dynamic init private void init box layout layout new box layout this box layout page axis for int i 0 i m goals length i performance indicator pi new performance indicator m goals i pi add action listener this add pi boxlayout boxlayout boxlayout page_axis m_goals performanceindicator performanceindicator m_goals addactionlistener action listener for drill down param e event public void action performed action event e if e get source instanceof performance indicator performance indicator pi performance indicator e get source log info pi get name m goal goal pi get goal if goal get measure null new performance detail goal actionperformed actionevent getsource performanceindicator performanceindicator performanceindicator getsource getname mgoal getgoal getmeasure performancedetail prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c order id p c order id big decimal para i get parameter int value else if name equals c doctype id p c doctype id big decimal para i get parameter int value else if name equals date doc p datedoc timestamp para i get parameter else if name equals is close document p isclosedocument y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_order_id p_c_order_id bigdecimal getparameter intvalue c_doctype_id p_c_doctype_id bigdecimal getparameter intvalue datedoc p_datedoc getparameter isclosedocument p_isclosedocument getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception log info c order id p c order id c doctype id p c doctype id close document p isclosedocument if p c order id 0 throw new illegal argument exception no order m doc type dt m doc type get get ctx p c doctype id if dt get id 0 throw new illegal argument exception no doc type if p datedoc null p datedoc new timestamp system current time millis m order from new m order get ctx p c order id get trxname m order new order m order copy from from p datedoc dt getc doctype id dt isso trx false true null copy asi new order setc doctypetarget id p c doctype id boolean ok new order save if ok throw new illegal state exception could not create new order if p isclosedocument m order original new m order get ctx p c order id get trxname original set doc action m order docaction complete original process it m order docaction complete original save original set doc action m order docaction close original process it m order docaction close original save env setso trx get ctx new order isso trx return c order id new order get document no return dt get name new order get document no doit c_order_id p_c_order_id c_doctype_id p_c_doctype_id closedocument p_isclosedocument p_c_order_id illegalargumentexception mdoctype mdoctype getctx p_c_doctype_id get_id illegalargumentexception doctype p_datedoc p_datedoc currenttimemillis morder morder getctx p_c_order_id get_trxname morder neworder morder copyfrom p_datedoc getc_doctype_id issotrx neworder setc_doctypetarget_id p_c_doctype_id neworder illegalstateexception p_isclosedocument morder morder getctx p_c_order_id get_trxname setdocaction morder docaction_complete processit morder docaction_complete setdocaction morder docaction_close processit morder docaction_close setsotrx getctx neworder issotrx c_order_id neworder getdocumentno getname neworder getdocumentno standard constructor public x c rfq properties ctx int c rfq id string trx name super ctx c rfq id trx name if c rfq id 0 setc currency id 0 c currency id setc rfq id 0 setc rfq topic id 0 set date response new timestamp system current time millis set document no null set is invited vendors only false set is quote all qty false set is quote total amt false set is rfq response accepted true y set is self service true y set name null set processed false set quote type null s setsalesrep id 0 x_c_rfq c_rfq_id trxname c_rfq_id trxname c_rfq_id setc_currency_id c_currency_id setc_rfq_id setc_rfq_topic_id setdateresponse currenttimemillis setdocumentno setisinvitedvendorsonly setisquoteallqty setisquotetotalamt setisrfqresponseaccepted setisselfservice setname setprocessed setquotetype setsalesrep_id load constructor public x c rfq properties ctx result set rs string trx name super ctx rs trx name x_c_rfq resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfq append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfq get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set rfq request for quotation public void setc rfq id int c rfq id if c rfq id 1 throw new illegal argument exception c rfq id is mandatory set valuenocheck c rfq id new integer c rfq id setc_rfq_id c_rfq_id c_rfq_id illegalargumentexception c_rfq_id set_valuenocheck c_rfq_id c_rfq_id get rfq request for quotation public int getc rfq id integer ii integer get value c rfq id if ii null return 0 return ii int value getc_rfq_id get_value c_rfq_id intvalue set rfq topic topic for request for quotations public void setc rfq topic id int c rfq topic id if c rfq topic id 1 throw new illegal argument exception c rfq topic id is mandatory set value c rfq topic id new integer c rfq topic id setc_rfq_topic_id c_rfq_topic_id c_rfq_topic_id illegalargumentexception c_rfq_topic_id set_value c_rfq_topic_id c_rfq_topic_id get rfq topic topic for request for quotations public int getc rfq topic id integer ii integer get value c rfq topic id if ii null return 0 return ii int value getc_rfq_topic_id get_value c_rfq_topic_id intvalue set copy lines public void set copy lines string copy lines if copy lines null copy lines length 1 log warning length 1 truncated copy lines copy lines substring 0 0 set value copy lines copy lines setcopylines copylines copylines copylines copylines copylines set_value copylines copylines get copy lines public string get copy lines return string get value copy lines getcopylines get_value copylines set create po create purchase order public void set createpo string createpo if createpo null createpo length 1 log warning length 1 truncated createpo createpo substring 0 0 set value createpo createpo setcreatepo set_value get create po create purchase order public string get createpo return string get value createpo getcreatepo get_value set create so public void set createso string createso if createso null createso length 1 log warning length 1 truncated createso createso substring 0 0 set value createso createso setcreateso set_value get create so public string get createso return string get value createso getcreateso get_value set response date date of the response public void set date response timestamp date response if date response null throw new illegal argument exception date response is mandatory set value date response date response setdateresponse dateresponse dateresponse illegalargumentexception dateresponse set_value dateresponse dateresponse get response date date of the response public timestamp get date response return timestamp get value date response getdateresponse get_value dateresponse set work complete date when work is planned to be complete public void set date work complete timestamp date work complete set value date work complete date work complete setdateworkcomplete dateworkcomplete set_value dateworkcomplete dateworkcomplete get work complete date when work is planned to be complete public timestamp get date work complete return timestamp get value date work complete getdateworkcomplete get_value dateworkcomplete set work start date when work is planned to be started public void set date work start timestamp date work start set value date work start date work start setdateworkstart dateworkstart set_value dateworkstart dateworkstart get work start date when work is planned to be started public timestamp get date work start return timestamp get value date work start getdateworkstart get_value dateworkstart set delivery days number of days planned until delivery public void set delivery days int delivery days set value delivery days new integer delivery days setdeliverydays deliverydays set_value deliverydays deliverydays get delivery days number of days planned until delivery public int get delivery days integer ii integer get value delivery days if ii null return 0 return ii int value getdeliverydays get_value deliverydays intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set invited vendors only only invited vendors can respond to an rfq public void set is invited vendors only boolean is invited vendors only set value is invited vendors only new boolean is invited vendors only setisinvitedvendorsonly isinvitedvendorsonly set_value isinvitedvendorsonly isinvitedvendorsonly get invited vendors only only invited vendors can respond to an rfq public boolean is invited vendors only object oo get value is invited vendors only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvitedvendorsonly get_value isinvitedvendorsonly booleanvalue set quote all quantities suppliers are requested to provide responses for all quantities public void set is quote all qty boolean is quote all qty set value is quote all qty new boolean is quote all qty setisquoteallqty isquoteallqty set_value isquoteallqty isquoteallqty get quote all quantities suppliers are requested to provide responses for all quantities public boolean is quote all qty object oo get value is quote all qty if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isquoteallqty get_value isquoteallqty booleanvalue set quote total amt the respnse can have just the total amount for the rfq public void set is quote total amt boolean is quote total amt set value is quote total amt new boolean is quote total amt setisquotetotalamt isquotetotalamt set_value isquotetotalamt isquotetotalamt get quote total amt the respnse can have just the total amount for the rfq public boolean is quote total amt object oo get value is quote total amt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isquotetotalamt get_value isquotetotalamt booleanvalue set responses accepted are resonses to the request for quotation accepted public void set is rfq response accepted boolean is rfq response accepted set value is rfq response accepted new boolean is rfq response accepted setisrfqresponseaccepted isrfqresponseaccepted set_value isrfqresponseaccepted isrfqresponseaccepted get responses accepted are resonses to the request for quotation accepted public boolean is rfq response accepted object oo get value is rfq response accepted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrfqresponseaccepted get_value isrfqresponseaccepted booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set margin margin for a product as a percentage public void set margin big decimal margin set value margin margin setmargin bigdecimal set_value get margin margin for a product as a percentage public big decimal get margin big decimal bd big decimal get value margin if bd null return env zero return bd bigdecimal getmargin bigdecimal bigdecimal get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set publish rfq public void set publish rfq string publish rfq if publish rfq null publish rfq length 1 log warning length 1 truncated publish rfq publish rfq substring 0 0 set value publish rfq publish rfq setpublishrfq publishrfq publishrfq publishrfq publishrfq publishrfq set_value publishrfq publishrfq get publish rfq public string get publish rfq return string get value publish rfq getpublishrfq get_value publishrfq public static final string quotetype quotetotalonly t set rfq type request for quotation type public void set quote type string quote type if quote type null throw new illegal argument exception quote type is mandatory if quote type equals a quote type equals s quote type equals t else throw new illegal argument exception quote type invalid value quote type reference id 314 a s t if quote type length 1 log warning length 1 truncated quote type quote type substring 0 0 set value quote type quote type quotetype_quotetotalonly setquotetype quotetype quotetype illegalargumentexception quotetype quotetype quotetype quotetype illegalargumentexception quotetype quotetype reference_id quotetype quotetype quotetype set_value quotetype quotetype get rfq type request for quotation type public string get quote type return string get value quote type getquotetype get_value quotetype set rank rfq public void set rank rfq string rank rfq if rank rfq null rank rfq length 1 log warning length 1 truncated rank rfq rank rfq substring 0 0 set value rank rfq rank rfq setrankrfq rankrfq rankrfq rankrfq rankrfq rankrfq set_value rankrfq rankrfq get rank rfq public string get rank rfq return string get value rank rfq getrankrfq get_value rankrfq public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue basic constructor public cite basic constructor param element adds an element to the element public cite element element add element element addelement basic constructor param element adds an element to the element public cite string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public cite add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public cite add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public cite add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public cite add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public cite remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w process init servletconfig servletexception webenv initweb servletexception wprocess process the http get request initial call public void do get http servlet request request http servlet response response throws servlet exception io exception get session attributes web session ctx wsc web session ctx get request if wsc null web util create timeout page request response this null return web doc doc null get parameter menu id int ad menu id web util get parameter as int request ad menu id if ad menu id 0 log info do get ad menu id ad menu id doc create parameter page wsc ad menu id else string file name web util get parameter request file int ad pinstance id web util get parameter as int request ad pinstance id log info do get ad pinstance id ad pinstance id file file name string error stream result request response ad pinstance id file name if error null return doc web doc create window error if doc null doc web doc create window process not found web util create response request response this null doc true doget httpservletrequest httpservletresponse servletexception ioexception websessionctx websessionctx webutil createtimeoutpage webdoc menu_id ad_menu_id webutil getparameterasint ad_menu_id ad_menu_id doget ad_menu_id ad_menu_id createparameterpage ad_menu_id filename webutil getparameter ad_pinstance_id webutil getparameterasint ad_pinstance_id doget ad_pinstance_id ad_pinstance_id filename streamresult ad_pinstance_id filename webdoc createwindow webdoc createwindow webutil createresponse process the http post request get parameters and process public void do post http servlet request request http servlet response response throws servlet exception io exception get session attributes web session ctx wsc web session ctx get request if wsc null web util create timeout page request response this null return int ad process id web util get parameter as int request ad process id log info do get ad process id ad process id if ad process id 0 web util create error page request response this no process return web doc doc create process page request ad process id web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception websessionctx websessionctx webutil createtimeoutpage ad_process_id webutil getparameterasint ad_process_id doget ad_process_id ad_process_id ad_process_id webutil createerrorpage webdoc createprocesspage ad_process_id webutil createresponse create parameter page param ad menu id menu return page private web doc create parameter page web session ctx wsc int ad menu id m process process m process get from menu wsc ctx ad menu id need to check if role can access if process null web doc doc web doc create window process not found return doc web doc doc web doc create window process get name td center doc add window center false if process get description null center add element new p new i process get description if process get help null center add element new p process get help align type left form my form new form w process set name process process getad process id my form set on submit this submit disabled true return true my form add element new input input type hidden ad process id process getad process id table my table new table 0 0 5 100 null my table setid w process parameter m process para parameter process get parameters for int i 0 i parameter length i m process para para parameter i web field w field new web field wsc para get column name para get name para get description no display length para getad reference id para get field length para get field length false not r o not error not dependent false para is mandatory false false false td to field para is range w field get field para get lookup para get default value2 new td web env nbsp add to table my table add element new tr add element w field get label add element w field get field para get lookup para get default value add element to field submit my table add element new tr add element new td null align type left align type middle false new input input type reset reset reset add element new td null align type left align type middle false null add element new td null align type right align type middle false new input input type submit submit submit my form add element my table center add element my form return doc ad_menu_id webdoc createparameterpage websessionctx ad_menu_id mprocess mprocess getfrommenu ad_menu_id webdoc webdoc createwindow webdoc webdoc createwindow getname addwindowcenter getdescription addelement getdescription gethelp addelement gethelp aligntype myform wprocess setname getad_process_id myform setonsubmit myform addelement type_hidden ad_process_id getad_process_id mytable mytable wprocessparameter mprocesspara getparameters mprocesspara webfield wfield webfield getcolumnname getname getdescription getad_reference_id getfieldlength getfieldlength ismandatory tofield isrange wfield getfield getlookup getdefaultvalue2 webenv mytable addelement addelement wfield getlabel addelement wfield getfield getlookup getdefaultvalue addelement tofield mytable addelement addelement aligntype aligntype type_reset addelement aligntype aligntype addelement aligntype aligntype type_submit myform addelement mytable addelement myform create parocess page param ad process id process return page private web doc create process page http servlet request request int ad process id web session ctx wsc web session ctx get request m process process m process get wsc ctx ad process id need to check if role can access if process null web doc doc web doc create window process not found return doc web doc doc web doc create window process get name td center doc add window center false if process get description null center add element new p new i process get description if process get help null center add element new p process get help align type left create process instance mp instance p instance fill parameter request process process info pi new process info process get name process getad process id pi setad user id env getad user id wsc ctx pi setad client id env getad client id wsc ctx pi setad pinstance id p instance getad pinstance id info p p new p p add element msg translate wsc ctx ad pinstance id p instance getad pinstance id center add element p start boolean processok false if process is java process trx trx trx get trx create trx name web prc true try processok process process it pi trx trx commit trx close catch throwable t trx rollback trx close if processok pi is error center add element new p error pi get summary align type left set class cerror processok false center add element new p add element pi get summary center add element pi get log info true report if processok process is report report engine re report engine get wsc ctx pi if re null center add element new p could not start report engine align type left set class cerror else try file file file create temp file w process pdf boolean ok re createpdf file if ok string url w process ad pinstance id p instance getad pinstance id file url encoder encode file get absolute path web env encoding a link new a url null a target blank process get name center add element new p add element report created add element link marker that process is ok wsc ctx put ad pinstance id p instance getad pinstance id ok else center add element new p could not create report align type left set class cerror catch exception e center add element new p could not create report align type left set class cerror center add element e to string return doc ad_process_id webdoc createprocesspage httpservletrequest ad_process_id websessionctx websessionctx mprocess mprocess ad_process_id webdoc webdoc createwindow webdoc webdoc createwindow getname addwindowcenter getdescription addelement getdescription gethelp addelement gethelp aligntype mpinstance pinstance fillparameter processinfo processinfo getname getad_process_id setad_user_id getad_user_id setad_client_id getad_client_id setad_pinstance_id pinstance getad_pinstance_id addelement ad_pinstance_id pinstance getad_pinstance_id addelement isjavaprocess createtrxname webprc processit iserror addelement getsummary aligntype setclass addelement addelement getsummary addelement getloginfo isreport reportengine reportengine addelement reportengine aligntype setclass createtempfile wprocess wprocess ad_pinstance_id pinstance getad_pinstance_id urlencoder getabsolutepath webenv target_blank getname addelement addelement addelement ad_pinstance_id pinstance getad_pinstance_id addelement aligntype setclass addelement aligntype setclass addelement tostring fill parameter param request request param process process private mp instance fill parameter http servlet request request m process process mp instance p instance new mp instance process 0 mp instance para i params p instance get parameters for int pi 0 pi i params length pi mp instance para i para i params pi string key i para get parameter name m process para p para process get parameter key if p para null log log level severe parameter not found key continue string value string web util get parameter request key log fine fill parameter key value string object value value string if value string null value string length 0 value null no value if value null if p para is mandatory log log level warning fill parameter key empty mandatory else convert to type try if display type is numeric p para getad reference id display type isid p para getad reference id big decimal bd null if value instanceof big decimal bd big decimal value else if value instanceof integer bd new big decimal integer value int value else bd new big decimal value to string i para setp number bd log fine fill parameter key value string bd else if display type is date p para getad reference id timestamp ts null if value instanceof timestamp ts timestamp value else ts timestamp value of value to string i para setp date ts log fine fill parameter key value string ts else i para setp string value to string i para save catch exception e log warning fill parameter key value string value value get class get name e get localized message not null instance parameter loop return p instance mpinstance fillparameter httpservletrequest mprocess mpinstance pinstance mpinstance mpinstancepara iparams pinstance getparameters iparams mpinstancepara ipara iparams ipara getparametername mprocesspara ppara getparameter ppara valuestring webutil getparameter fillparameter valuestring valuestring valuestring valuestring ppara ismandatory fillparameter displaytype isnumeric ppara getad_reference_id displaytype ppara getad_reference_id bigdecimal bigdecimal bigdecimal bigdecimal intvalue bigdecimal tostring ipara setp_number fillparameter valuestring displaytype isdate ppara getad_reference_id valueof tostring ipara setp_date fillparameter valuestring ipara setp_string tostring ipara fillparameter valuestring getclass getname getlocalizedmessage pinstance stream result param request request param response response param ad pinstance id instance id param file name file to stream return message private string stream result http servlet request request http servlet response response int ad pinstance id string file name if ad pinstance id 0 return your process not found web session ctx wsc web session ctx get request object value wsc ctx get ad pinstance id ad pinstance id if value null value equals ok return process instance not found if file name null file name length 0 return no process result file file new file file name if file exists return process result not found file ok return web util stream file response file ad_pinstance_id filename streamresult httpservletrequest httpservletresponse ad_pinstance_id filename ad_pinstance_id websessionctx websessionctx ad_pinstance_id ad_pinstance_id filename filename filename webutil streamfile standard constructor public x c withholding properties ctx int c withholding id string trx name super ctx c withholding id trx name if c withholding id 0 set beneficiary 0 setc paymentterm id 0 setc withholding id 0 set is paid to3 party false set is percent withholding false set is tax prorated false set is tax withholding false set name null x_c_withholding c_withholding_id trxname c_withholding_id trxname c_withholding_id setbeneficiary setc_paymentterm_id setc_withholding_id setispaidto3party setispercentwithholding setistaxprorated setistaxwithholding setname load constructor public x c withholding properties ctx result set rs string trx name super ctx rs trx name x_c_withholding resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c withholding append get id append return sb to string tostring stringbuffer stringbuffer x_c_withholding get_id tostring public static final int beneficiary ad reference id 138 set beneficiary business partner to whom payment is made public void set beneficiary int beneficiary set value beneficiary new integer beneficiary beneficiary_ad_reference_id setbeneficiary set_value get beneficiary business partner to whom payment is made public int get beneficiary integer ii integer get value beneficiary if ii null return 0 return ii int value getbeneficiary get_value intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set withholding withholding type defined public void setc withholding id int c withholding id if c withholding id 1 throw new illegal argument exception c withholding id is mandatory set valuenocheck c withholding id new integer c withholding id setc_withholding_id c_withholding_id c_withholding_id illegalargumentexception c_withholding_id set_valuenocheck c_withholding_id c_withholding_id get withholding withholding type defined public int getc withholding id integer ii integer get value c withholding id if ii null return 0 return ii int value getc_withholding_id get_value c_withholding_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set fix amount fix amounted amount to be levied or paid public void set fix amt big decimal fix amt set value fix amt fix amt setfixamt bigdecimal fixamt set_value fixamt fixamt get fix amount fix amounted amount to be levied or paid public big decimal get fix amt big decimal bd big decimal get value fix amt if bd null return env zero return bd bigdecimal getfixamt bigdecimal bigdecimal get_value fixamt set paid to third party amount paid to someone other than the business partner public void set is paid to3 party boolean is paid to3 party set value is paid to3 party new boolean is paid to3 party setispaidto3party ispaidto3party set_value ispaidto3party ispaidto3party get paid to third party amount paid to someone other than the business partner public boolean is paid to3 party object oo get value is paid to3 party if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispaidto3party get_value ispaidto3party booleanvalue set percent withholding withholding amount is a percentage of the invoice amount public void set is percent withholding boolean is percent withholding set value is percent withholding new boolean is percent withholding setispercentwithholding ispercentwithholding set_value ispercentwithholding ispercentwithholding get percent withholding withholding amount is a percentage of the invoice amount public boolean is percent withholding object oo get value is percent withholding if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispercentwithholding get_value ispercentwithholding booleanvalue set prorate tax tax is prorated public void set is tax prorated boolean is tax prorated set value is tax prorated new boolean is tax prorated setistaxprorated istaxprorated set_value istaxprorated istaxprorated get prorate tax tax is prorated public boolean is tax prorated object oo get value is tax prorated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxprorated get_value istaxprorated booleanvalue set tax withholding this is a tax related withholding public void set is tax withholding boolean is tax withholding set value is tax withholding new boolean is tax withholding setistaxwithholding istaxwithholding set_value istaxwithholding istaxwithholding get tax withholding this is a tax related withholding public boolean is tax withholding object oo get value is tax withholding if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxwithholding get_value istaxwithholding booleanvalue set max amount maximum amount in invoice currency public void set max amt big decimal max amt set value max amt max amt setmaxamt bigdecimal maxamt set_value maxamt maxamt get max amount maximum amount in invoice currency public big decimal get max amt big decimal bd big decimal get value max amt if bd null return env zero return bd bigdecimal getmaxamt bigdecimal bigdecimal get_value maxamt set min amount minimum amount in invoice currency public void set min amt big decimal min amt set value min amt min amt setminamt bigdecimal minamt set_value minamt minamt get min amount minimum amount in invoice currency public big decimal get min amt big decimal bd big decimal get value min amt if bd null return env zero return bd bigdecimal getminamt bigdecimal bigdecimal get_value minamt set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set percent percentage public void set percent big decimal percent set value percent percent setpercent bigdecimal set_value get percent percentage public big decimal get percent big decimal bd big decimal get value percent if bd null return env zero return bd bigdecimal getpercent bigdecimal bigdecimal get_value set threshold max maximum gross amount for withholding calculation 0 no limit public void set threshold max big decimal threshold max set value threshold max threshold max setthresholdmax bigdecimal thresholdmax set_value thresholdmax thresholdmax get threshold max maximum gross amount for withholding calculation 0 no limit public big decimal get threshold max big decimal bd big decimal get value threshold max if bd null return env zero return bd bigdecimal getthresholdmax bigdecimal bigdecimal get_value thresholdmax set threshold min minimum gross amount for withholding calculation public void set thresholdmin big decimal thresholdmin set value thresholdmin thresholdmin setthresholdmin bigdecimal set_value get threshold min minimum gross amount for withholding calculation public big decimal get thresholdmin big decimal bd big decimal get value thresholdmin if bd null return env zero return bd bigdecimal getthresholdmin bigdecimal bigdecimal get_value standard constructor public x pa sla criteria properties ctx int pa sla criteria id string trx name super ctx pa sla criteria id trx name if pa sla criteria id 0 set is manual true y set name null setpa sla criteria id 0 x_pa_sla_criteria pa_sla_criteria_id trxname pa_sla_criteria_id trxname pa_sla_criteria_id setismanual setname setpa_sla_criteria_id load constructor public x pa sla criteria properties ctx result set rs string trx name super ctx rs trx name x_pa_sla_criteria resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa sla criteria append get id append return sb to string tostring stringbuffer stringbuffer x_pa_sla_criteria get_id tostring set classname java classname public void set classname string classname if classname null classname length 60 log warning length 60 truncated classname classname substring 0 59 set value classname classname setclassname set_value get classname java classname public string get classname return string get value classname getclassname get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sla criteria service level agreement criteria public void setpa sla criteria id int pa sla criteria id if pa sla criteria id 1 throw new illegal argument exception pa sla criteria id is mandatory set valuenocheck pa sla criteria id new integer pa sla criteria id setpa_sla_criteria_id pa_sla_criteria_id pa_sla_criteria_id illegalargumentexception pa_sla_criteria_id set_valuenocheck pa_sla_criteria_id pa_sla_criteria_id get sla criteria service level agreement criteria public int getpa sla criteria id integer ii integer get value pa sla criteria id if ii null return 0 return ii int value getpa_sla_criteria_id get_value pa_sla_criteria_id intvalue prepare protected void prepare process return throws exception protected string do it throws exception return doit get content return content public object get contents return contents getcontents initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w workflow init servletconfig servletexception webenv initweb servletexception wworkflow process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w workflow get not implemented yet web util create response request response this null doc false doget httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wworkflow webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w workflow post not implemented yet web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wworkflow webutil createresponse get query from parameter param ctx context to determine language param ad pinstance id instance param table name table name return where clause static public m query get properties ctx int ad pinstance id string table name s log info ad pinstance id ad pinstance id table name table name m query query new m query table name temporary tables add qualifier not displayed if table name starts with t query add restriction table name ad pinstance id ad pinstance id how many rows do we have int rows 0 string sql select count from ad pinstance para where ad pinstance id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad pinstance id result set rs pstmt execute query if rs next rows rs get int 1 rs close pstmt close catch sql exception e1 s log log level severe sql e1 if rows 1 return query msg get msg env get ctx parameter boolean trl env is base language ctx ad process para if trl sql select ip parameter name ip p string ip p string to 1 3 ip p number ip p number to 4 5 ip p date ip p date to ip info ip info to 6 9 pp name pp is range 10 11 from ad pinstance para ip ad pinstance i ad process para pp where i ad pinstance id ip ad pinstance id and pp ad process id i ad process id and pp column name ip parameter name and ip ad pinstance id else sql select ip parameter name ip p string ip p string to ip p number ip p number to ip p date ip p date to ip info ip info to ppt name pp is range from ad pinstance para ip ad pinstance i ad process para pp ad process para trl ppt where i ad pinstance id ip ad pinstance id and pp ad process id i ad process id and pp column name ip parameter name and pp ad process para id ppt ad process para id and ip ad pinstance id and ppt ad language try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad pinstance id if trl pstmt set string 2 env getad language ctx result set rs pstmt execute query all records for int row 0 rs next row if row rows s log log level severe parameter more rows than expected break string parameter name rs get string 1 string p string rs get string 2 string p string to rs get string 3 double p number null double d rs get double 4 if rs was null p number new double d double p number to null d rs get double 5 if rs was null p number to new double d timestamp p date rs get timestamp 6 timestamp p date to rs get timestamp 7 string info rs get string 8 string info to rs get string 9 string name rs get string 10 boolean is range y equals rs get string 11 s log fine parameter name s p string p string to n p number p number to d p date p date to name name info info info to range is range if p string null if p string to null if p string index of 1 query add restriction parameter name m query equal p string name info else query add restriction parameter name m query like p string name info else query add range restriction parameter name p string p string to name info info to number else if p number null p number to null if p number to null if is range query add restriction parameter name m query greater equal p number name info else query add restriction parameter name m query equal p number name info else p number to null if p number null query add restriction trunc parameter name m query less equal p number to name info else query add range restriction parameter name p number p number to name info info to date else if p date null p date to null if p date to null if is range query add restriction trunc parameter name m query greater equal p date name info else query add restriction trunc parameter name m query equal p date name info else p date to null if p date null query add restriction trunc parameter name m query less equal p date to name info else query add range restriction trunc parameter name p date p date to name info info to rs close pstmt close catch sql exception e2 s log log level severe sql e2 s log info query to string return query ad_pinstance_id tablename mquery ad_pinstance_id tablename s_log ad_pinstance_id ad_pinstance_id tablename tablename mquery mquery tablename tablename startswith t_ addrestriction tablename ad_pinstance_id ad_pinstance_id ad_pinstance_para ad_pinstance_id preparedstatement preparestatement setint ad_pinstance_id resultset executequery getint sqlexception s_log getmsg getctx isbaselanguage ad_process_para parametername p_string p_string_to p_number p_number_to p_date p_date_to info_to isrange ad_pinstance_para ad_pinstance ad_process_para ad_pinstance_id ad_pinstance_id ad_process_id ad_process_id columnname parametername ad_pinstance_id parametername p_string p_string_to p_number p_number_to p_date p_date_to info_to isrange ad_pinstance_para ad_pinstance ad_process_para ad_process_para_trl ad_pinstance_id ad_pinstance_id ad_process_id ad_process_id columnname parametername ad_process_para_id ad_process_para_id ad_pinstance_id ad_language preparedstatement preparestatement setint ad_pinstance_id setstring getad_language resultset executequery s_log parametername getstring p_string getstring p_string_to getstring p_number getdouble wasnull p_number p_number_to getdouble wasnull p_number_to p_date gettimestamp p_date_to gettimestamp getstring info_to getstring getstring isrange getstring s_log parametername p_string p_string_to p_number p_number_to p_date p_date_to info_to isrange p_string p_string_to p_string indexof addrestriction parametername mquery p_string addrestriction parametername mquery p_string addrangerestriction parametername p_string p_string_to info_to p_number p_number_to p_number_to isrange addrestriction parametername mquery greater_equal p_number addrestriction parametername mquery p_number p_number_to p_number addrestriction parametername mquery less_equal p_number_to addrangerestriction parametername p_number p_number_to info_to p_date p_date_to p_date_to isrange addrestriction parametername mquery greater_equal p_date addrestriction parametername mquery p_date p_date_to p_date addrestriction parametername mquery less_equal p_date_to addrangerestriction parametername p_date p_date_to info_to sqlexception s_log s_log tostring get zoom column name converts synonyms like salesrep id to ad user id param column name column name return column name public static string get zoom column name string column name if column name null return null if column name equals salesrep id return ad user id if column name equals c doctypetarget id return c doctype id if column name equals bill bpartner id return c bpartner id if column name equals bill location id return c bpartner location id if column name equals account id return c elementvalue id see also m tab validate query return column name salesrep_id ad_user_id columnname getzoomcolumnname columnname columnname columnname salesrep_id ad_user_id columnname c_doctypetarget_id c_doctype_id columnname bill_bpartner_id c_bpartner_id columnname bill_location_id c_bpartner_location_id columnname account_id c_elementvalue_id mtab validatequery columnname derive zoom table name from column name e g drop id param column name column name return table name public static string get zoom table name string column name string table name get zoom column name column name int index table name last index of id if index 1 return table name substring 0 index return table name _id columnname getzoomtablename columnname tablename getzoomcolumnname columnname tablename lastindexof _id tablename tablename create simple equal query creates column name value or column name value param column name column name param value value return quary public static m query get equal query string column name object value m query query new m query query add restriction column name equal value query set record count 1 guess return query columnname columnname columnname columnname mquery getequalquery columnname mquery mquery addrestriction columnname setrecordcount create simple equal query creates column name value param column name column name param value value return quary public static m query get equal query string column name int value m query query new m query if column name ends with id query set table name column name substring 0 column name length 3 query add restriction column name equal new integer value query set record count 1 guess return query columnname columnname columnname mquery getequalquery columnname mquery mquery columnname endswith _id settablename columnname columnname addrestriction columnname setrecordcount create no record query param table name table name param new record new record indicator 2 3 return query public static m query get no record query string table name boolean new record m query query new m query table name if new record query add restriction newrecord else query add restriction 1 2 query set record count 0 return query tablename newrecord mquery getnorecordquery tablename newrecord mquery mquery tablename newrecord addrestriction addrestriction setrecordcount constructor w o table name public m query mquery constructor param table name table name public m query string table name m tablename table name tablename mquery tablename m_tablename tablename constructor get tablen ame from table param ad table id table id public m query int ad table id use client context as r o m tablename m table get table name env get ctx ad table id tablename ad_table_id table_id mquery ad_table_id m_tablename m_table gettablename getctx ad_table_id get record count return count default 999999 public int get record count return m recordcount getrecordcount m_recordcount set record count param count count public void set record count int count m recordcount count setrecordcount m_recordcount add restriction param column name column name param operator operator e g param code code e g 0 all param info name display name param info display display of code lookup public void add restriction string column name string operator object code string info name string info display restriction r new restriction column name operator code info name info display m list add r columnname columnname infoname infodisplay addrestriction columnname infoname infodisplay columnname infoname infodisplay m_list add restriction param column name column name param operator operator e g param code code e g 0 all public void add restriction string column name string operator object code restriction r new restriction column name operator code null null m list add r columnname columnname addrestriction columnname columnname m_list add restriction param column name column name param operator operator e g param code code e g 0 public void add restriction string column name string operator int code restriction r new restriction column name operator new integer code null null m list add r columnname columnname addrestriction columnname columnname m_list add range restriction between param column name column name param code code e g 0 all param code to code e g 0 all param info name display name param info display display of code lookup param infodisplay to display of code lookup public void add range restriction string column name object code object code to string info name string info display string infodisplay to restriction r new restriction column name code code to info name info display infodisplay to m list add r columnname columnname code_to infoname infodisplay infodisplay_to addrangerestriction columnname code_to infoname infodisplay infodisplay_to columnname code_to infoname infodisplay infodisplay_to m_list add range restriction between param column name column name param code code e g 0 all param code to code e g 0 all public void add range restriction string column name object code object code to restriction r new restriction column name code code to null null null m list add r columnname columnname code_to addrangerestriction columnname code_to columnname code_to m_list add restriction param r restriction protected void add restriction restriction r m list add r addrestriction m_list add restriction param where clause sql where clause public void add restriction string where clause if where clause null where clause trim length 0 return restriction r new restriction where clause m list add r m newrecord where clause equals newrecord whereclause addrestriction whereclause whereclause whereclause whereclause m_list m_newrecord whereclause new record query return true if new nercord query public boolean is new record query return m newrecord isnewrecordquery m_newrecord create the resulting query where clause return where clause public string get where clause return get where clause false getwhereclause getwhereclause create the resulting query where clause param fully qualified fully qualified table column name return where clause public string get where clause boolean fully qualified boolean qualified fully qualified if qualified m tablename null m tablename length 0 qualified false string buffer sb new string buffer for int i 0 i m list size i restriction r restriction m list get i if i 0 sb append r and condition and or if qualified sb append r getsql m tablename else sb append r getsql null return sb to string fullyqualified columnname getwhereclause fullyqualified fullyqualified m_tablename m_tablename stringbuffer stringbuffer m_list m_list andcondition m_tablename tostring get printable query info return info public string get info string buffer sb new string buffer if m tablename null sb append m tablename append for int i 0 i m list size i restriction r restriction m list get i if i 0 sb append r and condition and or sb append r get info name append r get info operator append r get info display all return sb to string getinfo stringbuffer stringbuffer m_tablename m_tablename m_list m_list andcondition getinfoname getinfooperator getinfodisplayall tostring create query where clause not fully qualified param index restriction index return where clause or if not valid public string get where clause int index string buffer sb new string buffer if index 0 index m list size restriction r restriction m list get index sb append r getsql null return sb to string getwhereclause stringbuffer stringbuffer m_list m_list tostring get restriction count return number of restricctions public int get restriction count return m list size getrestrictioncount m_list is query active return true if number of restricctions 0 public boolean is active return m list size 0 isactive m_list get table name return table name public string get table name return m tablename gettablename m_tablename set table name param table name table name public void set table name string table name m tablename table name tablename settablename tablename m_tablename tablename get column name of index param index index return column name public string get column name int index if index 0 index m list size return null restriction r restriction m list get index return r column name columnname columnname getcolumnname m_list m_list columnname set column name of index param index index param column name new column name protected void set column name int index string column name if index 0 index m list size return restriction r restriction m list get index r column name column name columnname columnname setcolumnname columnname m_list m_list columnname columnname get operator of index param index index return operator public string get operator int index if index 0 index m list size return null restriction r restriction m list get index return r operator getoperator m_list m_list get operator of index param index index return operator public object get code int index if index 0 index m list size return null restriction r restriction m list get index return r code getcode m_list m_list get restriction display of index param index index return restriction display public string get info display int index if index 0 index m list size return null restriction r restriction m list get index return r info display getinfodisplay m_list m_list infodisplay get to restriction display of index param index index return restriction display public string getinfodisplay to int index if index 0 index m list size return null restriction r restriction m list get index return r infodisplay to getinfodisplay_to m_list m_list infodisplay_to get info name param index index return info name public string get info name int index if index 0 index m list size return null restriction r restriction m list get index return r info name getinfoname m_list m_list infoname get info operator param index index return info operator public string get info operator int index if index 0 index m list size return null restriction r restriction m list get index return r get info operator getinfooperator m_list m_list getinfooperator get display with optional to param index index return info display public string get info display all int index if index 0 index m list size return null restriction r restriction m list get index return r get info display all getinfodisplayall m_list m_list getinfodisplayall string representation return info public string to string if is active return get where clause true return m query m tablename restrictions 0 tostring isactive getwhereclause mquery m_tablename get display name param ctx context return display name public string get display name properties ctx string key column null if m tablename null key column m tablename id else key column get column name 0 string ret value msg translate ctx key column if ret value null ret value length 0 return ret value return m tablename getdisplayname keycolumn m_tablename keycolumn m_tablename _id keycolumn getcolumnname retvalue keycolumn retvalue retvalue retvalue m_tablename clone query return query public m query deep copy m query new query new m query m tablename for int i 0 i m list size i new query add restriction restriction m list get i return new query mquery deepcopy mquery newquery mquery m_tablename m_list newquery addrestriction m_list newquery restriction param column name column name param operator operator e g param code code e g 0 all param info name display name param info display display of code lookup restriction string column name string operator object code string info name string info display this column name column name trim if info name null this info name info name else this info name this column name this operator operator boolean if code instanceof boolean this code boolean code boolean value y n else if code instanceof key name pair this code new integer key name pair code get key else if code instanceof value name pair this code value name pair code get value else this code code clean code if this code instanceof string if this code to string starts with this code this code to string substring 1 if this code to string ends with this code this code to string substring 0 this code to string length 2 if info display null this info display info display trim else if this code null this info display this code to string columnname columnname infoname infodisplay columnname infoname infodisplay columnname columnname infoname infoname infoname infoname columnname booleanvalue keynamepair keynamepair getkey valuenamepair valuenamepair getvalue tostring startswith tostring tostring endswith tostring tostring infodisplay infodisplay infodisplay infodisplay tostring range restriction between param column name column name param code code e g 0 all param code to code e g 0 all param info name display name param info display display of code lookup param infodisplay to display of code lookup restriction string column name object code object code to string info name string info display string infodisplay to this column name m query between code info name info display code to this code to code to if this code to instanceof string if this code to to string starts with this code to this code to to string substring 1 if this code to to string ends with this code to this code to to string substring 0 this code to to string length 2 infodisplay to if infodisplay to null this infodisplay to infodisplay to trim else if this code to null this infodisplay to this code to to string columnname columnname code_to infoname infodisplay infodisplay_to columnname code_to infoname infodisplay infodisplay_to columnname mquery infoname infodisplay code_to code_to code_to code_to code_to tostring startswith code_to code_to tostring code_to tostring endswith code_to code_to tostring code_to tostring infodisplay_to infodisplay_to infodisplay_to infodisplay_to code_to infodisplay_to code_to tostring create restriction with dircet where clause param where clause sql where clause restriction string where clause dircet where clause where clause whereclause whereclause dircetwhereclause whereclause return sql construct for this restriction param table name optional table name return sql where construct public string getsql string table name if dircet where clause null return dircet where clause string buffer sb new string buffer if table name null table name length 0 assumes replace initcap variable s x or upper variable int pos column name last index of 1 including int end column name index of we have a function in the column name if pos 1 end 1 sb append column name substring 0 pos append table name append append column name substring pos end append column name substring end else sb append table name append append column name else sb append column name sb append operator if code instanceof string sb append db to string code to string else if code instanceof timestamp sb append db to date timestamp code else sb append code between if code to null infodisplay to null if m query between equals operator sb append and if code to instanceof string sb append db to string code to to string else if code to instanceof timestamp sb append db to date timestamp code to else sb append code to return sb to string tablename tablename dircetwhereclause dircetwhereclause stringbuffer stringbuffer tablename tablename columnname lastindexof columnname indexof columnname columnname tablename columnname columnname tablename columnname columnname to_string tostring to_date code_to infodisplay_to mquery code_to to_string code_to tostring code_to to_date code_to code_to tostring get string representation return info public string to string return getsql null tostring get info name return info name public string get info name return info name getinfoname infoname get info operator return info operator public string get info operator for int i 0 i m query operators length i if m query operators i get value equals operator return m query operators i get name return operator getinfooperator mquery mquery getvalue mquery getname get display with optional to return info display public string get info display all if infodisplay to null return info display string buffer sb new string buffer info display sb append append infodisplay to return sb to string getinfodisplayall infodisplay_to infodisplay stringbuffer stringbuffer infodisplay infodisplay_to tostring standard constructor public x a registrationvalue properties ctx int a registrationvalue id string trx name super ctx a registrationvalue id trx name if a registrationvalue id 0 seta registrationattribute id 0 seta registration id 0 set name null x_a_registrationvalue a_registrationvalue_id trxname a_registrationvalue_id trxname a_registrationvalue_id seta_registrationattribute_id seta_registration_id setname load constructor public x a registrationvalue properties ctx result set rs string trx name super ctx rs trx name x_a_registrationvalue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a registrationvalue append get id append return sb to string tostring stringbuffer stringbuffer x_a_registrationvalue get_id tostring set registration attribute asset registration attribute public void seta registrationattribute id int a registrationattribute id if a registrationattribute id 1 throw new illegal argument exception a registrationattribute id is mandatory set valuenocheck a registrationattribute id new integer a registrationattribute id seta_registrationattribute_id a_registrationattribute_id a_registrationattribute_id illegalargumentexception a_registrationattribute_id set_valuenocheck a_registrationattribute_id a_registrationattribute_id get registration attribute asset registration attribute public int geta registrationattribute id integer ii integer get value a registrationattribute id if ii null return 0 return ii int value geta_registrationattribute_id get_value a_registrationattribute_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geta registrationattribute id intvalue keynamepair getkeynamepair keynamepair get_id valueof geta_registrationattribute_id set registration user asset registration public void seta registration id int a registration id if a registration id 1 throw new illegal argument exception a registration id is mandatory set valuenocheck a registration id new integer a registration id seta_registration_id a_registration_id a_registration_id illegalargumentexception a_registration_id set_valuenocheck a_registration_id a_registration_id get registration user asset registration public int geta registration id integer ii integer get value a registration id if ii null return 0 return ii int value geta_registration_id get_value a_registration_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value standard constructor public x c ordertax properties ctx int c ordertax id string trx name super ctx c ordertax id trx name if c ordertax id 0 setc order id 0 setc tax id 0 set is tax included false set processed false set tax amt env zero set tax base amt env zero x_c_ordertax c_ordertax_id trxname c_ordertax_id trxname c_ordertax_id setc_order_id setc_tax_id setistaxincluded setprocessed settaxamt settaxbaseamt load constructor public x c ordertax properties ctx result set rs string trx name super ctx rs trx name x_c_ordertax resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c ordertax append get id append return sb to string tostring stringbuffer stringbuffer x_c_ordertax get_id tostring set order order public void setc order id int c order id if c order id 1 throw new illegal argument exception c order id is mandatory set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id illegalargumentexception c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt if tax amt null throw new illegal argument exception tax amt is mandatory set valuenocheck tax amt tax amt settaxamt bigdecimal taxamt taxamt illegalargumentexception taxamt set_valuenocheck taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt set tax base amount base for calculating the tax amount public void set tax base amt big decimal tax base amt if tax base amt null throw new illegal argument exception tax base amt is mandatory set valuenocheck tax base amt tax base amt settaxbaseamt bigdecimal taxbaseamt taxbaseamt illegalargumentexception taxbaseamt set_valuenocheck taxbaseamt taxbaseamt get tax base amount base for calculating the tax amount public big decimal get tax base amt big decimal bd big decimal get value tax base amt if bd null return env zero return bd bigdecimal gettaxbaseamt bigdecimal bigdecimal get_value taxbaseamt basic constructor public acronym basic constructor param element adds an element to the element public acronym element element add element element addelement basic constructor param element adds an element to the element public acronym string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public acronym add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public acronym add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public acronym add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public acronym add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public acronym remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute create a statement loader added for compatibility with new po infrastructure bug 968136 param ctx current context param c bankstatementloader id loader to use public m bank statement loader properties ctx int c bankstatementloader id string trx name super ctx c bankstatementloader id trx name init null c_bankstatementloader_id mbankstatementloader c_bankstatementloader_id trxname c_bankstatementloader_id trxname create a statement loader param ctx current context param c bankstatementloader id loader to use param file name input file public m bank statement loader properties ctx int c bankstatementloader id string file name string trx name super ctx c bankstatementloader id trx name init file name c_bankstatementloader_id filename mbankstatementloader c_bankstatementloader_id filename trxname c_bankstatementloader_id trxname filename create a statement loader param ctx current context param rs result set public m bank statement loader properties ctx result set rs string trx name super ctx rs trx name init null resultset mbankstatementloader resultset trxname trxname private void init string file name local file name file name try log info m bank statement loader class name get stmt loader class class bsr class class for name get stmt loader class m loader bank statement loader interface bsr class new instance catch exception e error message class not loaded error description e get message filename localfilename filename mbankstatementloader getstmtloaderclass bsrclass forname getstmtloaderclass m_loader bankstatementloaderinterface bsrclass newinstance errormessage classnotloaded errordescription getmessage return name return name public string to string string buffer sb new string buffer m bank statement loader append get id append append get name append return sb to string tostring stringbuffer stringbuffer mbankstatementloader get_id getname tostring return local file name return name public string get local file name return local file name getlocalfilename localfilename start loading bankstatements return true if loading completed succesfully public boolean load lines boolean result false log info m bank statement loader load lines if m loader null error message class not loaded return result initialize the loader if m loader init this error message m loader get last error message error description m loader get last error description return result verify whether the data structure is valid if m loader is valid error message m loader get last error message error description m loader get last error description return result load statement lines if m loader load lines error message m loader get last error message error description m loader get last error description return result result true return result loadlines mbankstatementloader loadlines m_loader errormessage classnotloaded m_loader errormessage m_loader getlasterrormessage errordescription m_loader getlasterrordescription m_loader isvalid errormessage m_loader getlasterrormessage errordescription m_loader getlasterrordescription m_loader loadlines errormessage m_loader getlasterrormessage errordescription m_loader getlasterrordescription load a bank statement into the i bankstatement table return statement line was loaded succesfully this method is called by the bank statement loadere whenever a complete statement line has been read public boolean save line log info m bank statement loader import line boolean result false x i bankstatement imp new x i bankstatement get ctx 0 get trxname if m loader null error message load error return result bank account fields log config m bank statement loader import line bank account m loader get bank account no imp set bank account no m loader get bank account no log config m bank statement loader import line routing no m loader get routing no imp set routing no m loader get routing no statement fields log config m bank statement loader import line eft statement reference no m loader get statement reference imp set eft statement reference m loader get statement reference log config m bank statement loader import line eft statement date m loader get statement date imp set eft statement date m loader get statement date log config m bank statement loader import line statement date m loader get statement date imp set statement date m loader get statement date statement line fields log config m bank statement loader import line eft transaction id m loader get trxid imp set eft trxid m loader get trxid log config m bank statement loader import line statement line date m loader get statement line date imp set statement line date m loader get statement line date imp set statement line date m loader get statement line date imp set eft statement line date m loader get statement line date log config m bank statement loader import line valuta date m loader get valuta date imp set valuta date m loader get valuta date imp set eft valuta date m loader get valuta date log config m bank statement loader import line statement amount m loader get stmt amt imp set stmt amt m loader get stmt amt imp set eft amt m loader get stmt amt log config m bank statement loader import line transaction amount m loader get trx amt imp set trx amt m loader get trx amt log config m bank statement loader import line interest amount m loader get interest amt imp set interest amt m loader get interest amt log config m bank statement loader import line reference no m loader get reference imp set reference no m loader get reference imp set eft reference m loader get reference log config m bank statement loader import line check no m loader get reference imp set eft check no m loader get check no log config m bank statement loader import line memo m loader get memo imp set memo m loader get memo imp set eft memo m loader get memo log config m bank statement loader import line payee name m loader get payee name imp set eft payee m loader get payee name log config m bank statement loader import line payee account no m loader get payee account no imp set eft payee account m loader get payee account no log config m bank statement loader import line eft transaction type m loader get trx type imp set eft trx type m loader get trx type log config m bank statement loader import line currency m loader get currency imp set eft currency m loader get currency imp setiso code m loader get currency log config m bank statement loader import line charge name m loader get charge name imp set charge name m loader get charge name log config m bank statement loader import line charge amount m loader get charge amt imp set charge amt m loader get charge amt imp set processed false imp seti isimported false result imp save if result load count else error message load error imp null return result i_bankstatement bankstatementloadere saveline mbankstatementloader importline x_i_bankstatement x_i_bankstatement getctx get_trxname m_loader errormessage loaderror mbankstatementloader importline m_loader getbankaccountno setbankaccountno m_loader getbankaccountno mbankstatementloader importline m_loader getroutingno setroutingno m_loader getroutingno mbankstatementloader importline m_loader getstatementreference seteftstatementreference m_loader getstatementreference mbankstatementloader importline m_loader getstatementdate seteftstatementdate m_loader getstatementdate mbankstatementloader importline m_loader getstatementdate setstatementdate m_loader getstatementdate mbankstatementloader importline m_loader gettrxid setefttrxid m_loader gettrxid mbankstatementloader importline m_loader getstatementlinedate setstatementlinedate m_loader getstatementlinedate setstatementlinedate m_loader getstatementlinedate seteftstatementlinedate m_loader getstatementlinedate mbankstatementloader importline m_loader getvalutadate setvalutadate m_loader getvalutadate seteftvalutadate m_loader getvalutadate mbankstatementloader importline m_loader getstmtamt setstmtamt m_loader getstmtamt seteftamt m_loader getstmtamt mbankstatementloader importline m_loader gettrxamt settrxamt m_loader gettrxamt mbankstatementloader importline m_loader getinterestamt setinterestamt m_loader getinterestamt mbankstatementloader importline m_loader getreference setreferenceno m_loader getreference seteftreference m_loader getreference mbankstatementloader importline m_loader getreference seteftcheckno m_loader getcheckno mbankstatementloader importline m_loader getmemo setmemo m_loader getmemo seteftmemo m_loader getmemo mbankstatementloader importline m_loader getpayeename seteftpayee m_loader getpayeename mbankstatementloader importline m_loader getpayeeaccountno seteftpayeeaccount m_loader getpayeeaccountno mbankstatementloader importline m_loader gettrxtype setefttrxtype m_loader gettrxtype mbankstatementloader importline m_loader getcurrency seteftcurrency m_loader getcurrency setiso_code m_loader getcurrency mbankstatementloader importline m_loader getchargename setchargename m_loader getchargename mbankstatementloader importline m_loader getchargeamt setchargeamt m_loader getchargeamt setprocessed seti_isimported loadcount errormessage loaderror return the most recent error return error message this error message will be handled as a compiere message e g it can be translated public string get error message return error message geterrormessage errormessage return the most recent error description return error discription this is an additional error description it can be used to provided descriptive iformation such as a file name or sql error that can not be translated by the compiere message system public string get error description return error description geterrordescription errordescription the total number of statement lines loaded return number of imported statement lines public int get load count return load count getloadcount loadcount standard constructor public x ad ref table properties ctx int ad ref table id string trx name super ctx ad ref table id trx name if ad ref table id 0 setad display 0 setad key 0 setad reference id 0 setad table id 0 set entity type null u set is value displayed false x_ad_ref_table ad_ref_table_id trxname ad_ref_table_id trxname ad_ref_table_id setad_display setad_key setad_reference_id setad_table_id setentitytype setisvaluedisplayed load constructor public x ad ref table properties ctx result set rs string trx name super ctx rs trx name x_ad_ref_table resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad ref table append get id append return sb to string tostring stringbuffer stringbuffer x_ad_ref_table get_id tostring public static final int ad display ad reference id 3 set display column column that will display public void setad display int ad display set value ad display new integer ad display ad_display_ad_reference_id setad_display ad_display set_value ad_display ad_display get display column column that will display public int getad display integer ii integer get value ad display if ii null return 0 return ii int value getad_display get_value ad_display intvalue public static final int ad key ad reference id 3 set key column unique identifier of a record public void setad key int ad key set value ad key new integer ad key ad_key_ad_reference_id setad_key ad_key set_value ad_key ad_key get key column unique identifier of a record public int getad key integer ii integer get value ad key if ii null return 0 return ii int value getad_key get_value ad_key intvalue set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set valuenocheck ad reference id new integer ad reference id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_valuenocheck ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad reference id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_reference_id set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set display value displays value column with the display column public void set is value displayed boolean is value displayed set value is value displayed new boolean is value displayed setisvaluedisplayed isvaluedisplayed set_value isvaluedisplayed isvaluedisplayed get display value displays value column with the display column public boolean is value displayed object oo get value is value displayed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvaluedisplayed get_value isvaluedisplayed booleanvalue set sql order by fully qualified order by clause public void set order by clause string order by clause if order by clause null order by clause length 2000 log warning length 2000 truncated order by clause order by clause substring 0 1999 set value order by clause order by clause setorderbyclause orderbyclause orderbyclause orderbyclause orderbyclause orderbyclause set_value orderbyclause orderbyclause get sql order by fully qualified order by clause public string get order by clause return string get value order by clause getorderbyclause get_value orderbyclause set sql where fully qualified sql where clause public void set where clause string where clause if where clause null where clause length 2000 log warning length 2000 truncated where clause where clause substring 0 1999 set value where clause where clause setwhereclause whereclause whereclause whereclause whereclause whereclause set_value whereclause whereclause get sql where fully qualified sql where clause public string get where clause return string get value where clause getwhereclause get_value whereclause standard constructor public x ad printformatitem properties ctx int ad printformatitem id string trx name super ctx ad printformatitem id trx name if ad printformatitem id 0 setad column id 0 setad printformatchild id 0 setad printformatitem id 0 setad printformat id 0 set field alignment type null d set image is attached false set is averaged false set is centrally maintained false set is counted false set is deviation calc false set is filled rectangle false n set is fixed width false set is group by false set is height one line true y set is image field false set is max calc false set is min calc false set is next line true y set is next page false set is order by false set is page break false set is printed true y set is relative position true y set is running total false set is setnl position false set is summarized false set is suppress null false set is variance calc false set line alignment type null x set max height 0 set max width 0 set name null set print area type null c set print format type null f set seq no 0 sql select nvl max seq no 0 10 as default value from ad printformatitem where ad printformat id ad printformat id set sort no 0 setx position 0 setx space 0 sety position 0 sety space 0 x_ad_printformatitem ad_printformatitem_id trxname ad_printformatitem_id trxname ad_printformatitem_id setad_column_id setad_printformatchild_id setad_printformatitem_id setad_printformat_id setfieldalignmenttype setimageisattached setisaveraged setiscentrallymaintained setiscounted setisdeviationcalc setisfilledrectangle setisfixedwidth setisgroupby setisheightoneline setisimagefield setismaxcalc setismincalc setisnextline setisnextpage setisorderby setispagebreak setisprinted setisrelativeposition setisrunningtotal setissetnlposition setissummarized setissuppressnull setisvariancecalc setlinealignmenttype setmaxheight setmaxwidth setname setprintareatype setprintformattype setseqno seqno defaultvalue ad_printformatitem ad_printformat_id ad_printformat_id setsortno setxposition setxspace setyposition setyspace load constructor public x ad printformatitem properties ctx result set rs string trx name super ctx rs trx name x_ad_printformatitem resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printformatitem append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printformatitem get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set print font maintain print font public void setad printfont id int ad printfont id if ad printfont id 0 set value ad printfont id null else set value ad printfont id new integer ad printfont id setad_printfont_id ad_printfont_id ad_printfont_id set_value ad_printfont_id set_value ad_printfont_id ad_printfont_id get print font maintain print font public int getad printfont id integer ii integer get value ad printfont id if ii null return 0 return ii int value getad_printfont_id get_value ad_printfont_id intvalue public static final int ad printformatchild id ad reference id 259 set included print format print format that is included here public void setad printformatchild id int ad printformatchild id if ad printformatchild id 1 throw new illegal argument exception ad printformatchild id is mandatory set value ad printformatchild id new integer ad printformatchild id ad_printformatchild_id_ad_reference_id setad_printformatchild_id ad_printformatchild_id ad_printformatchild_id illegalargumentexception ad_printformatchild_id set_value ad_printformatchild_id ad_printformatchild_id get included print format print format that is included here public int getad printformatchild id integer ii integer get value ad printformatchild id if ii null return 0 return ii int value getad_printformatchild_id get_value ad_printformatchild_id intvalue set print format item item column in the print format public void setad printformatitem id int ad printformatitem id if ad printformatitem id 1 throw new illegal argument exception ad printformatitem id is mandatory set valuenocheck ad printformatitem id new integer ad printformatitem id setad_printformatitem_id ad_printformatitem_id ad_printformatitem_id illegalargumentexception ad_printformatitem_id set_valuenocheck ad_printformatitem_id ad_printformatitem_id get print format item item column in the print format public int getad printformatitem id integer ii integer get value ad printformatitem id if ii null return 0 return ii int value getad_printformatitem_id get_value ad_printformatitem_id intvalue set print format data print format public void setad printformat id int ad printformat id if ad printformat id 1 throw new illegal argument exception ad printformat id is mandatory set valuenocheck ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id illegalargumentexception ad_printformat_id set_valuenocheck ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set graph graph included in reports public void setad printgraph id int ad printgraph id if ad printgraph id 0 set value ad printgraph id null else set value ad printgraph id new integer ad printgraph id setad_printgraph_id ad_printgraph_id ad_printgraph_id set_value ad_printgraph_id set_value ad_printgraph_id ad_printgraph_id get graph graph included in reports public int getad printgraph id integer ii integer get value ad printgraph id if ii null return 0 return ii int value getad_printgraph_id get_value ad_printgraph_id intvalue set arc diameter arc diameter for rounded rectangles public void set arc diameter int arc diameter set value arc diameter new integer arc diameter setarcdiameter arcdiameter set_value arcdiameter arcdiameter get arc diameter arc diameter for rounded rectangles public int get arc diameter integer ii integer get value arc diameter if ii null return 0 return ii int value getarcdiameter get_value arcdiameter intvalue set below column print this column below the column index entered public void set below column int below column set value below column new integer below column setbelowcolumn belowcolumn set_value belowcolumn belowcolumn get below column print this column below the column index entered public int get below column integer ii integer get value below column if ii null return 0 return ii int value getbelowcolumn get_value belowcolumn intvalue public static final string fieldalignmenttype trailingright t set field alignment field text alignment public void set field alignment type string field alignment type if field alignment type null throw new illegal argument exception field alignment type is mandatory if field alignment type equals b field alignment type equals c field alignment type equals d field alignment type equals l field alignment type equals t else throw new illegal argument exception field alignment type invalid value field alignment type reference id 253 b c d l t if field alignment type length 1 log warning length 1 truncated field alignment type field alignment type substring 0 0 set value field alignment type field alignment type fieldalignmenttype_trailingright setfieldalignmenttype fieldalignmenttype fieldalignmenttype illegalargumentexception fieldalignmenttype fieldalignmenttype fieldalignmenttype fieldalignmenttype fieldalignmenttype fieldalignmenttype illegalargumentexception fieldalignmenttype fieldalignmenttype reference_id fieldalignmenttype fieldalignmenttype fieldalignmenttype set_value fieldalignmenttype fieldalignmenttype get field alignment field text alignment public string get field alignment type return string get value field alignment type getfieldalignmenttype get_value fieldalignmenttype set image attached the image to be printed is attached to the record public void set image is attached boolean image is attached set value image is attached new boolean image is attached setimageisattached imageisattached set_value imageisattached imageisattached get image attached the image to be printed is attached to the record public boolean is image is attached object oo get value image is attached if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isimageisattached get_value imageisattached booleanvalue set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set calculate mean calculate average of numeric content or length public void set is averaged boolean is averaged set value is averaged new boolean is averaged setisaveraged isaveraged set_value isaveraged isaveraged get calculate mean calculate average of numeric content or length public boolean is averaged object oo get value is averaged if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaveraged get_value isaveraged booleanvalue set centrally maintained information maintained in system element table public void set is centrally maintained boolean is centrally maintained set value is centrally maintained new boolean is centrally maintained setiscentrallymaintained iscentrallymaintained set_value iscentrallymaintained iscentrallymaintained get centrally maintained information maintained in system element table public boolean is centrally maintained object oo get value is centrally maintained if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscentrallymaintained get_value iscentrallymaintained booleanvalue set calculate count count number of not empty elements public void set is counted boolean is counted set value is counted new boolean is counted setiscounted iscounted set_value iscounted iscounted get calculate count count number of not empty elements public boolean is counted object oo get value is counted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscounted get_value iscounted booleanvalue set calculate deviation calculate standard deviation public void set is deviation calc boolean is deviation calc set value is deviation calc new boolean is deviation calc setisdeviationcalc isdeviationcalc set_value isdeviationcalc isdeviationcalc get calculate deviation calculate standard deviation public boolean is deviation calc object oo get value is deviation calc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdeviationcalc get_value isdeviationcalc booleanvalue set fill shape fill the shape with the color selected public void set is filled rectangle boolean is filled rectangle set value is filled rectangle new boolean is filled rectangle setisfilledrectangle isfilledrectangle set_value isfilledrectangle isfilledrectangle get fill shape fill the shape with the color selected public boolean is filled rectangle object oo get value is filled rectangle if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfilledrectangle get_value isfilledrectangle booleanvalue set fixed width column has a fixed width public void set is fixed width boolean is fixed width set value is fixed width new boolean is fixed width setisfixedwidth isfixedwidth set_value isfixedwidth isfixedwidth get fixed width column has a fixed width public boolean is fixed width object oo get value is fixed width if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfixedwidth get_value isfixedwidth booleanvalue set group by after a group change totals etc are printed public void set is group by boolean is group by set value is group by new boolean is group by setisgroupby isgroupby set_value isgroupby isgroupby get group by after a group change totals etc are printed public boolean is group by object oo get value is group by if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isgroupby get_value isgroupby booleanvalue set one line only if selected only one line is printed public void set is height one line boolean is height one line set value is height one line new boolean is height one line setisheightoneline isheightoneline set_value isheightoneline isheightoneline get one line only if selected only one line is printed public boolean is height one line object oo get value is height one line if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isheightoneline get_value isheightoneline booleanvalue set image field the image is retrieved from the data column public void set is image field boolean is image field set value is image field new boolean is image field setisimagefield isimagefield set_value isimagefield isimagefield get image field the image is retrieved from the data column public boolean is image field object oo get value is image field if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isimagefield get_value isimagefield booleanvalue set calculate maximim calculate the maximim amount public void set is max calc boolean is max calc set value is max calc new boolean is max calc setismaxcalc ismaxcalc set_value ismaxcalc ismaxcalc get calculate maximim calculate the maximim amount public boolean is max calc object oo get value is max calc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismaxcalc get_value ismaxcalc booleanvalue set calculate minimum calculate the minimum amount public void set is min calc boolean is min calc set value is min calc new boolean is min calc setismincalc ismincalc set_value ismincalc ismincalc get calculate minimum calculate the minimum amount public boolean is min calc object oo get value is min calc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismincalc get_value ismincalc booleanvalue set next line print item on next line public void set is next line boolean is next line set value is next line new boolean is next line setisnextline isnextline set_value isnextline isnextline get next line print item on next line public boolean is next line object oo get value is next line if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isnextline get_value isnextline booleanvalue set next page the column is printed on the next page public void set is next page boolean is next page set value is next page new boolean is next page setisnextpage isnextpage set_value isnextpage isnextpage get next page the column is printed on the next page public boolean is next page object oo get value is next page if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isnextpage get_value isnextpage booleanvalue set order by include in sort order public void set is order by boolean is order by set value is order by new boolean is order by setisorderby isorderby set_value isorderby isorderby get order by include in sort order public boolean is order by object oo get value is order by if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isorderby get_value isorderby booleanvalue set page break start with new page public void set is page break boolean is page break set value is page break new boolean is page break setispagebreak ispagebreak set_value ispagebreak ispagebreak get page break start with new page public boolean is page break object oo get value is page break if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispagebreak get_value ispagebreak booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set relative position the item is relative positioned not absolute public void set is relative position boolean is relative position set value is relative position new boolean is relative position setisrelativeposition isrelativeposition set_value isrelativeposition isrelativeposition get relative position the item is relative positioned not absolute public boolean is relative position object oo get value is relative position if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrelativeposition get_value isrelativeposition booleanvalue set running total create a running total sum public void set is running total boolean is running total set value is running total new boolean is running total setisrunningtotal isrunningtotal set_value isrunningtotal isrunningtotal get running total create a running total sum public boolean is running total object oo get value is running total if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrunningtotal get_value isrunningtotal booleanvalue set set nl position set new line position public void set is setnl position boolean is setnl position set value is setnl position new boolean is setnl position setissetnlposition issetnlposition set_value issetnlposition issetnlposition get set nl position set new line position public boolean is setnl position object oo get value is setnl position if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issetnlposition get_value issetnlposition booleanvalue set calculate sum calculate the sum of numeric content or length public void set is summarized boolean is summarized set value is summarized new boolean is summarized setissummarized issummarized set_value issummarized issummarized get calculate sum calculate the sum of numeric content or length public boolean is summarized object oo get value is summarized if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummarized get_value issummarized booleanvalue set suppress null suppress columns or elements with null value public void set is suppress null boolean is suppress null set value is suppress null new boolean is suppress null setissuppressnull issuppressnull set_value issuppressnull issuppressnull get suppress null suppress columns or elements with null value public boolean is suppress null object oo get value is suppress null if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issuppressnull get_value issuppressnull booleanvalue set calculate variance calculate variance public void set is variance calc boolean is variance calc set value is variance calc new boolean is variance calc setisvariancecalc isvariancecalc set_value isvariancecalc isvariancecalc get calculate variance calculate variance public boolean is variance calc object oo get value is variance calc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvariancecalc get_value isvariancecalc booleanvalue public static final string linealignmenttype none x set line alignment line alignment public void set line alignment type string line alignment type if line alignment type null throw new illegal argument exception line alignment type is mandatory if line alignment type equals c line alignment type equals l line alignment type equals t line alignment type equals x else throw new illegal argument exception line alignment type invalid value line alignment type reference id 254 c l t x if line alignment type length 1 log warning length 1 truncated line alignment type line alignment type substring 0 0 set value line alignment type line alignment type linealignmenttype_none setlinealignmenttype linealignmenttype linealignmenttype illegalargumentexception linealignmenttype linealignmenttype linealignmenttype linealignmenttype linealignmenttype illegalargumentexception linealignmenttype linealignmenttype reference_id linealignmenttype linealignmenttype linealignmenttype set_value linealignmenttype linealignmenttype get line alignment line alignment public string get line alignment type return string get value line alignment type getlinealignmenttype get_value linealignmenttype set line width width of the lines public void set line width int line width set value line width new integer line width setlinewidth linewidth set_value linewidth linewidth get line width width of the lines public int get line width integer ii integer get value line width if ii null return 0 return ii int value getlinewidth get_value linewidth intvalue set max height maximum height in 1 72 if an inch 0 no restriction public void set max height int max height set value max height new integer max height setmaxheight maxheight set_value maxheight maxheight get max height maximum height in 1 72 if an inch 0 no restriction public int get max height integer ii integer get value max height if ii null return 0 return ii int value getmaxheight get_value maxheight intvalue set max width maximum width in 1 72 if an inch 0 no restriction public void set max width int max width set value max width new integer max width setmaxwidth maxwidth set_value maxwidth maxwidth get max width maximum width in 1 72 if an inch 0 no restriction public int get max width integer ii integer get value max width if ii null return 0 return ii int value getmaxwidth get_value maxwidth intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string printareatype header h set area print area public void set print area type string print area type if print area type null throw new illegal argument exception print area type is mandatory if print area type equals c print area type equals f print area type equals h else throw new illegal argument exception print area type invalid value print area type reference id 256 c f h if print area type length 1 log warning length 1 truncated print area type print area type substring 0 0 set value print area type print area type printareatype_header setprintareatype printareatype printareatype illegalargumentexception printareatype printareatype printareatype printareatype illegalargumentexception printareatype printareatype reference_id printareatype printareatype printareatype set_value printareatype printareatype get area print area public string get print area type return string get value print area type getprintareatype get_value printareatype public static final string printformattype text t set format type print format type public void set print format type string print format type if print format type null throw new illegal argument exception print format type is mandatory if print format type equals f print format type equals i print format type equals l print format type equals p print format type equals r print format type equals t else throw new illegal argument exception print format type invalid value print format type reference id 255 f i l p r t if print format type length 1 log warning length 1 truncated print format type print format type substring 0 0 set value print format type print format type printformattype_text setprintformattype printformattype printformattype illegalargumentexception printformattype printformattype printformattype printformattype printformattype printformattype printformattype illegalargumentexception printformattype printformattype reference_id printformattype printformattype printformattype set_value printformattype printformattype get format type print format type public string get print format type return string get value print format type getprintformattype get_value printformattype set print text the label text to be printed on a document or correspondence public void set print name string print name if print name null print name length 2000 log warning length 2000 truncated print name print name substring 0 1999 set value print name print name setprintname printname printname printname printname printname set_value printname printname get print text the label text to be printed on a document or correspondence public string get print name return string get value print name getprintname get_value printname set print label suffix the label text to be printed on a document or correspondence after the field public void set print name suffix string print name suffix if print name suffix null print name suffix length 60 log warning length 60 truncated print name suffix print name suffix substring 0 59 set value print name suffix print name suffix setprintnamesuffix printnamesuffix printnamesuffix printnamesuffix printnamesuffix printnamesuffix set_value printnamesuffix printnamesuffix get print label suffix the label text to be printed on a document or correspondence after the field public string get print name suffix return string get value print name suffix getprintnamesuffix get_value printnamesuffix set running total lines create running total lines page break every x lines public void set running total lines int running total lines set value running total lines new integer running total lines setrunningtotallines runningtotallines set_value runningtotallines runningtotallines get running total lines create running total lines page break every x lines public int get running total lines integer ii integer get value running total lines if ii null return 0 return ii int value getrunningtotallines get_value runningtotallines intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue public static final string shapetype roundrectangle r set shape type type of the shape to be painted public void set shape type string shape type if shape type null throw new illegal argument exception shape type is mandatory if shape type null shape type equals 3 shape type equals n shape type equals o shape type equals r else throw new illegal argument exception shape type invalid value shape type reference id 333 3 n o r if shape type null shape type length 1 log warning length 1 truncated shape type shape type substring 0 0 set value shape type shape type shapetype_roundrectangle setshapetype shapetype shapetype illegalargumentexception shapetype shapetype shapetype shapetype shapetype shapetype illegalargumentexception shapetype shapetype reference_id shapetype shapetype shapetype shapetype set_value shapetype shapetype get shape type type of the shape to be painted public string get shape type return string get value shape type getshapetype get_value shapetype set record sort no determines in what order the records are displayed public void set sort no int sort no set value sort no new integer sort no setsortno sortno set_value sortno sortno get record sort no determines in what order the records are displayed public int get sort no integer ii integer get value sort no if ii null return 0 return ii int value getsortno get_value sortno intvalue set x position absolute x horizontal position in 1 72 of an inch public void setx position int x position set value x position new integer x position setxposition xposition set_value xposition xposition get x position absolute x horizontal position in 1 72 of an inch public int getx position integer ii integer get value x position if ii null return 0 return ii int value getxposition get_value xposition intvalue set x space relative x horizontal space in 1 72 of an inch public void setx space int x space set value x space new integer x space setxspace xspace set_value xspace xspace get x space relative x horizontal space in 1 72 of an inch public int getx space integer ii integer get value x space if ii null return 0 return ii int value getxspace get_value xspace intvalue set y position absolute y vertical position in 1 72 of an inch public void sety position int y position set value y position new integer y position setyposition yposition set_value yposition yposition get y position absolute y vertical position in 1 72 of an inch public int gety position integer ii integer get value y position if ii null return 0 return ii int value getyposition get_value yposition intvalue set y space relative y vertical space in 1 72 of an inch public void sety space int y space set value y space new integer y space setyspace yspace set_value yspace yspace get y space relative y vertical space in 1 72 of an inch public int gety space integer ii integer get value y space if ii null return 0 return ii int value getyspace get_value yspace intvalue standard constructor public x c interorg acct properties ctx int c interorg acct id string trx name super ctx c interorg acct id trx name if c interorg acct id 0 setad orgto id 0 setc acctschema id 0 setintercompanyduefrom acct 0 setintercompanydueto acct 0 x_c_interorg_acct c_interorg_acct_id trxname c_interorg_acct_id trxname c_interorg_acct_id setad_orgto_id setc_acctschema_id setintercompanyduefrom_acct setintercompanydueto_acct load constructor public x c interorg acct properties ctx result set rs string trx name super ctx rs trx name x_c_interorg_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c interorg acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_interorg_acct get_id tostring public static final int ad orgto id ad reference id 130 set inter organization organization valid for intercompany documents public void setad orgto id int ad orgto id if ad orgto id 1 throw new illegal argument exception ad orgto id is mandatory set valuenocheck ad orgto id new integer ad orgto id ad_orgto_id_ad_reference_id setad_orgto_id ad_orgto_id ad_orgto_id illegalargumentexception ad_orgto_id set_valuenocheck ad_orgto_id ad_orgto_id get inter organization organization valid for intercompany documents public int getad orgto id integer ii integer get value ad orgto id if ii null return 0 return ii int value getad_orgto_id get_value ad_orgto_id intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set intercompany due from acct intercompany due from receivables account public void setintercompanyduefrom acct int intercompanyduefrom acct set value intercompanyduefrom acct new integer intercompanyduefrom acct setintercompanyduefrom_acct intercompanyduefrom_acct set_value intercompanyduefrom_acct intercompanyduefrom_acct get intercompany due from acct intercompany due from receivables account public int getintercompanyduefrom acct integer ii integer get value intercompanyduefrom acct if ii null return 0 return ii int value getintercompanyduefrom_acct get_value intercompanyduefrom_acct intvalue set intercompany due to acct intercompany due to payable account public void setintercompanydueto acct int intercompanydueto acct set value intercompanydueto acct new integer intercompanydueto acct setintercompanydueto_acct intercompanydueto_acct set_value intercompanydueto_acct intercompanydueto_acct get intercompany due to acct intercompany due to payable account public int getintercompanydueto acct integer ii integer get value intercompanydueto acct if ii null return 0 return ii int value getintercompanydueto_acct get_value intercompanydueto_acct intvalue standard constructor public x ad column access properties ctx int ad column access id string trx name super ctx ad column access id trx name if ad column access id 0 setad column id 0 setad role id 0 set is exclude true y set is read only false x_ad_column_access ad_column_access_id trxname ad_column_access_id trxname ad_column_access_id setad_column_id setad_role_id setisexclude setisreadonly load constructor public x ad column access properties ctx result set rs string trx name super ctx rs trx name x_ad_column_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad column access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_column_access get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set valuenocheck ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_valuenocheck ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad column id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_column_id set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set exclude exclude access to the data if not selected include access to the data public void set is exclude boolean is exclude set value is exclude new boolean is exclude setisexclude isexclude set_value isexclude isexclude get exclude exclude access to the data if not selected include access to the data public boolean is exclude object oo get value is exclude if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isexclude get_value isexclude booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue get payments of b partner param ctx context param c bpartner id id return array public static m payment get ofb partner properties ctx int c bpartner id string trx name array list m payment list new array list m payment string sql select from c payment where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next list add new m payment ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m payment ret value new m payment list size list to array ret value return ret value bpartner c_bpartner_id mpayment getofbpartner c_bpartner_id trxname arraylist mpayment arraylist mpayment c_payment c_bpartner_id preparedstatement preparestatement trxname setint c_bpartner_id resultset executequery mpayment trxname s_log mpayment retvalue mpayment toarray retvalue retvalue default constructor param ctx context param c payment id payment to load 0 create new payment param trx name trx name public m payment properties ctx int c payment id string trx name super ctx c payment id trx name new if c payment id 0 set doc action docaction complete set doc status docstatus drafted set trx type trxtype sales setr avsaddr r avszip unavailable setr avszip r avszip unavailable set is receipt true set is approved false set is reconciled false set is allocated false set is online false set is self service false set is delayed capture false set is prepayment false set processed false set processing false set posted false set pay amt env zero set discount amt env zero set tax amt env zero set write off amt env zero set is over under payment false set over under amt env zero set date trx new timestamp system current time millis set date acct get date trx set tender type tendertype check c_payment_id trxname mpayment c_payment_id trxname c_payment_id trxname c_payment_id setdocaction docaction_complete setdocstatus docstatus_drafted settrxtype trxtype_sales setr_avsaddr r_avszip_unavailable setr_avszip r_avszip_unavailable setisreceipt setisapproved setisreconciled setisallocated setisonline setisselfservice setisdelayedcapture setisprepayment setprocessed setprocessing setposted setpayamt setdiscountamt settaxamt setwriteoffamt setisoverunderpayment setoverunderamt setdatetrx currenttimemillis setdateacct getdatetrx settendertype tendertype_check load constructor param ctx context param rs result set record public m payment properties ctx result set rs string trx name super ctx rs trx name mpayment resultset trxname trxname reset payment to new status public void reset new setc payment id 0 forces new record set valuenocheck document no null set doc action docaction prepare set doc status docstatus drafted set processed false set posted false set is reconciled false set is allocated false set is online false set is delayed capture false setc bpartner id 0 setc invoice id 0 setc order id 0 setc charge id 0 setc project id 0 set is prepayment false resetnew setc_payment_id set_valuenocheck documentno setdocaction docaction_prepare setdocstatus docstatus_drafted setprocessed setposted setisreconciled setisallocated setisonline setisdelayedcapture setc_bpartner_id setc_invoice_id setc_order_id setc_charge_id setc_project_id setisprepayment is cashbook transfer trx return true if cash trx public boolean is cash trx return x equals get tender type iscashtrx gettendertype set credit card need to set patment processor after amount currency set param trx type transaction type see trx param credit card type cc type param credit card number cc number param credit cardvv cc verification param credit card expmm cc exp mm param credit card expyy cc exp yy return true if valid public boolean set credit card string trx type string credit card type string credit card number string credit cardvv int credit card expmm int credit card expyy set tender type tendertype creditcard set trx type trx type set credit card type credit card type set credit card number credit card number set credit cardvv credit cardvv set credit card expmm credit card expmm set credit card expyy credit card expyy int check m payment validate validate credit card number credit card number credit card type length m payment validate validate credit card exp credit card expmm credit card expyy length if credit cardvv length 0 check m payment validate validate credit cardvv credit cardvv credit card type length return check 0 patmentprocessor trxtype trx_ creditcardtype creditcardnumber creditcardvv creditcardexpmm creditcardexpyy setcreditcard trxtype creditcardtype creditcardnumber creditcardvv creditcardexpmm creditcardexpyy settendertype tendertype_creditcard settrxtype trxtype setcreditcardtype creditcardtype setcreditcardnumber creditcardnumber setcreditcardvv creditcardvv setcreditcardexpmm creditcardexpmm setcreditcardexpyy creditcardexpyy mpaymentvalidate validatecreditcardnumber creditcardnumber creditcardtype mpaymentvalidate validatecreditcardexp creditcardexpmm creditcardexpyy creditcardvv mpaymentvalidate validatecreditcardvv creditcardvv creditcardtype set credit card exp need to set patment processor after amount currency set param trx type transaction type see trx param credit card type cc type param credit card number cc number param credit cardvv cc verification param credit card exp cc exp return true if valid public boolean set credit card string trx type string credit card type string credit card number string credit cardvv string credit card exp return set credit card trx type credit card type credit card number credit cardvv m payment validate get credit card expmm credit card exp m payment validate get credit card expyy credit card exp patmentprocessor trxtype trx_ creditcardtype creditcardnumber creditcardvv creditcardexp setcreditcard trxtype creditcardtype creditcardnumber creditcardvv creditcardexp setcreditcard trxtype creditcardtype creditcardnumber creditcardvv mpaymentvalidate getcreditcardexpmm creditcardexp mpaymentvalidate getcreditcardexpyy creditcardexp set ach bank account info param c bankaccount id bank account param is receipt true if receipt return true if valid public boolean set bankach int c bankaccount id boolean is receipt set bank account details c bankaccount id set is receipt is receipt int check m payment validate validate routing no get routing no length m payment validate validate account no get account no length return check 0 bankaccount c_bankaccount_id isreceipt setbankach c_bankaccount_id isreceipt setbankaccountdetails c_bankaccount_id setisreceipt isreceipt mpaymentvalidate validateroutingno getroutingno mpaymentvalidate validateaccountno getaccountno set ach bank account info param c bankaccount id bank account param is receipt true if receipt param tender type direct debit or direct deposit param routing no routing param account no account return true if valid public boolean set bankach int c bankaccount id boolean is receipt string tender type string routing no string account no set tender type tender type set is receipt is receipt if c bankaccount id 0 routing no null routing no length 0 account no null account no length 0 set bank account details c bankaccount id else setc bankaccount id c bankaccount id set routing no routing no set account no account no set check no int check m payment validate validate routing no routing no length m payment validate validate account no account no length return check 0 bankaccount c_bankaccount_id isreceipt tendertype routingno accountno setbankach c_bankaccount_id isreceipt tendertype routingno accountno settendertype tendertype setisreceipt isreceipt c_bankaccount_id routingno routingno accountno accountno setbankaccountdetails c_bankaccount_id setc_bankaccount_id c_bankaccount_id setroutingno routingno setaccountno accountno setcheckno mpaymentvalidate validateroutingno routingno mpaymentvalidate validateaccountno accountno set check bank account info param c bankaccount id bank account param is receipt true if receipt param check no chack no return true if valid public boolean set bank check int c bankaccount id boolean is receipt string check no return set bank check c bankaccount id is receipt null null check no bankaccount c_bankaccount_id isreceipt checkno setbankcheck c_bankaccount_id isreceipt checkno setbankcheck c_bankaccount_id isreceipt checkno set check bank account info param c bankaccount id bank account param is receipt true if receipt param routing no routing no param account no account no param check no chack no return true if valid public boolean set bank check int c bankaccount id boolean is receipt string routing no string account no string check no set tender type tendertype check set is receipt is receipt if c bankaccount id 0 routing no null routing no length 0 account no null account no length 0 set bank account details c bankaccount id else setc bankaccount id c bankaccount id set routing no routing no set account no account no set check no check no int check m payment validate validate routing no routing no length m payment validate validate account no account no length m payment validate validate check no check no length return check 0 no error message bankaccount c_bankaccount_id isreceipt routingno accountno checkno setbankcheck c_bankaccount_id isreceipt routingno accountno checkno settendertype tendertype_check setisreceipt isreceipt c_bankaccount_id routingno routingno accountno accountno setbankaccountdetails c_bankaccount_id setc_bankaccount_id c_bankaccount_id setroutingno routingno setaccountno accountno setcheckno checkno mpaymentvalidate validateroutingno routingno mpaymentvalidate validateaccountno accountno mpaymentvalidate validatecheckno checkno set bank account details look up routing no bank acct no param c bankaccount id bank account public void set bank account details int c bankaccount id if c bankaccount id 0 return setc bankaccount id c bankaccount id string sql select b routing no ba account no from c bankaccount ba inner join c bank b on ba c bank id b c bank id where c bankaccount id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 c bankaccount id result set rs pstmt execute query if rs next set routing no rs get string 1 set account no rs get string 2 rs close pstmt close catch sql exception e log log level severe setset bank account details e c_bankaccount_id setbankaccountdetails c_bankaccount_id c_bankaccount_id setc_bankaccount_id c_bankaccount_id routingno accountno c_bankaccount c_bank c_bank_id c_bank_id c_bankaccount_id preparedstatement preparestatement get_trxname setint c_bankaccount_id resultset executequery setroutingno getstring setaccountno getstring sqlexception setsetbankaccountdetails set account address param name name param street street param city city param state state param zip zip param country country public void set account address string name string street string city string state string zip string country seta name name seta street street seta city city seta state state seta zip zip seta country country setaccountaddress seta_name seta_street seta_city seta_state seta_zip seta_country process payment return true if approved public boolean process online log info amt get pay amt set is online true set error message null prevent charging twice if is approved log info already processed getr result getr respmsg set error message payment already processed return true if m mpaymentprocessor null set payment processor if m mpaymentprocessor null log log level severe no payment processor model set error message no payment processor model return false boolean approved false process payment on server if db is remote objects server server c connection get get server try if server null see server bean string trx name null unconditionally save save trx name server reads from disk approved server payment online get ctx getc payment id m mpaymentprocessor getc paymentprocessor id trx name if c log mgt is level finest s log fine process online server approved load trx name server saves to disk set is approved approved return approved log log level severe process online apps server not found catch remote exception ex log log level severe process online apps server error ex try locally try payment processor pp payment processor create m mpaymentprocessor this if pp null set error message no payment processor else approved pp processcc if approved set error message null else set error message from get credit card name getr respmsg catch exception e log log level severe process online e set error message payment processor error set is approved approved return approved processonline getpayamt setisonline seterrormessage isapproved getr_result getr_respmsg seterrormessage m_mpaymentprocessor setpaymentprocessor m_mpaymentprocessor seterrormessage isremoteobjects cconnection getserver serverbean trxname trxname paymentonline getctx getc_payment_id m_mpaymentprocessor getc_paymentprocessor_id trxname clogmgt islevelfinest s_log processonline trxname setisapproved processonline appsserver remoteexception processonline appsserver paymentprocessor paymentprocessor m_mpaymentprocessor seterrormessage seterrormessage seterrormessage getcreditcardname getr_respmsg processonline seterrormessage setisapproved process online payment implements process call after standard constructor called when pressing the process online button in c payment param ctx context param pi process info return true if the next process should be performed public boolean start process properties ctx process info pi trx trx log info start process pi getrecord id boolean ret value false if pi getrecord id get id log log level severe start process not same payment pi getrecord id return false process it ret value process online save return ret value payment processed processcall process_online c_payment startprocess processinfo startprocess getrecord_id retvalue getrecord_id get_id startprocess getrecord_id retvalue processonline retvalue before save param new record new return save protected boolean before save boolean new record we have a charge if getc charge id 0 if new record is valuechanged c charge id setc order id 0 setc invoice id 0 set write off amt env zero set discount amt env zero set is over under payment false set over under amt env zero set is prepayment false we need a b partner else if getc bpartner id 0 is cash trx if getc invoice id 0 else if getc order id 0 else log save error error msg parse translation get ctx not found c bpartner id return false prepayment no charge and order or project not as acct dimension if new record is valuechanged c charge id is valuechanged c invoice id is valuechanged c order id is valuechanged c project id set is prepayment getc charge id 0 getc bpartner id 0 getc order id 0 getc project id 0 getc invoice id 0 if is prepayment if new record is valuechanged c order id is valuechanged c project id set write off amt env zero set discount amt env zero set is over under payment false set over under amt env zero document type receipt if getc doctype id 0 setc doctype id else m doc type dt m doc type get get ctx getc doctype id set is receipt dt isso trx set document no if get date acct null set date acct get date trx if is over under payment set over under amt env zero organization if new record is valuechanged c bankaccount id getc charge id 0 allow different org for charge m bank account ba m bank account get get ctx getc bankaccount id if ba getad org id 0 setad org id ba getad org id return true newrecord beforesave newrecord getc_charge_id newrecord is_valuechanged c_charge_id setc_order_id setc_invoice_id setwriteoffamt setdiscountamt setisoverunderpayment setoverunderamt setisprepayment bpartner getc_bpartner_id iscashtrx getc_invoice_id getc_order_id saveerror parsetranslation getctx notfound c_bpartner_id newrecord is_valuechanged c_charge_id is_valuechanged c_invoice_id is_valuechanged c_order_id is_valuechanged c_project_id setisprepayment getc_charge_id getc_bpartner_id getc_order_id getc_project_id getc_invoice_id isprepayment newrecord is_valuechanged c_order_id is_valuechanged c_project_id setwriteoffamt setdiscountamt setisoverunderpayment setoverunderamt getc_doctype_id setc_doctype_id mdoctype mdoctype getctx getc_doctype_id setisreceipt issotrx setdocumentno getdateacct setdateacct getdatetrx isoverunderpayment setoverunderamt newrecord is_valuechanged c_bankaccount_id getc_charge_id mbankaccount mbankaccount getctx getc_bankaccount_id getad_org_id setad_org_id getad_org_id get allocated amt in payment currency return amount or null public big decimal get allocated amt big decimal ret value null if getc charge id 0 return get pay amt string sql select sum currency convert al amount ah c currency id p c currency id ah date trx p c conversiontype id al ad client id al ad org id from c allocationline al inner join c allocationhdr ah on al c allocationhdr id ah c allocationhdr id inner join c payment p on al c payment id p c payment id where al c payment id and ah is active y and al is active y and al c invoice id is not null prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc payment id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe get allocated amt e try if pstmt null pstmt close pstmt null catch exception e pstmt null log fine get allocated amt ret value round nvl v allocatedamt 0 2 return ret value bigdecimal getallocatedamt bigdecimal retvalue getc_charge_id getpayamt currencyconvert c_currency_id c_currency_id datetrx c_conversiontype_id ad_client_id ad_org_id c_allocationline c_allocationhdr c_allocationhdr_id c_allocationhdr_id c_payment c_payment_id c_payment_id c_payment_id isactive isactive c_invoice_id preparedstatement preparestatement get_trxname setint getc_payment_id resultset executequery retvalue getbigdecimal getallocatedamt getallocatedamt retvalue v_allocatedamt retvalue test allocation and set allocated flag return true if updated public boolean test allocation cash trx always allocated if is cash trx if is allocated set is allocated true return true return false big decimal alloc get allocated amt if alloc null alloc env zero big decimal total get pay amt if is receipt total total negate boolean test total compare to alloc 0 boolean change test is allocated if change set is allocated test log fine allocated test alloc total return change testallocation iscashtrx isallocated setisallocated bigdecimal getallocatedamt bigdecimal getpayamt isreceipt compareto isallocated setisallocated set allocated flag for payments param ctx context param c bpartner id if 0 all param trx name trx public static void set is allocated properties ctx int c bpartner id string trx name int counter 0 string sql select from c payment where is allocated n and doc status in co cl if c bpartner id 1 sql and c bpartner id else sql and ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql trx name if c bpartner id 1 pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next m payment pay new m payment ctx rs trx name if pay test allocation if pay save counter rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log config counter c_bpartner_id trxname setisallocated c_bpartner_id trxname c_payment isallocated docstatus c_bpartner_id c_bpartner_id ad_client_id getad_client_id preparedstatement preparestatement trxname c_bpartner_id setint c_bpartner_id resultset executequery mpayment mpayment trxname testallocation s_log s_log set error message param error message error message public void set error message string error message m errormessage error message errormessage seterrormessage errormessage m_errormessage errormessage get error message return error message public string get error message return m errormessage geterrormessage m_errormessage set bank account for payment param c bankaccount id c bankaccount id public void setc bankaccount id int c bankaccount id if c bankaccount id 0 set payment processor if getc bankaccount id 0 throw new illegal argument exception can t find bank account else super setc bankaccount id c bankaccount id c_bankaccount_id c_bankaccount_id setc_bankaccount_id c_bankaccount_id c_bankaccount_id setpaymentprocessor getc_bankaccount_id illegalargumentexception setc_bankaccount_id c_bankaccount_id set bank account and payment processor return true if found public boolean set payment processor return set payment processor get tender type get credit card type bankaccount paymentprocessor setpaymentprocessor setpaymentprocessor gettendertype getcreditcardtype set bank account and payment processor param tender tender type see tender param cc type cc type see cc return true if found public boolean set payment processor string tender string cc type m mpaymentprocessor null get processor list if m mpaymentprocessors null m mpaymentprocessors length 0 m mpaymentprocessors m payment processor find get ctx tender cc type getad client id getc currency id get pay amt get trxname relax amount if m mpaymentprocessors null m mpaymentprocessors length 0 m mpaymentprocessors m payment processor find get ctx tender cc type getad client id getc currency id env zero get trxname if m mpaymentprocessors null m mpaymentprocessors length 0 return false find the first right one for int i 0 i m mpaymentprocessors length i if m mpaymentprocessors i accepts tender cc type m mpaymentprocessor m mpaymentprocessors i if m mpaymentprocessor null setc bankaccount id m mpaymentprocessor getc bankaccount id return m mpaymentprocessor null bankaccount paymentprocessor tendertype tender_ cctype cc_ setpaymentprocessor cctype m_mpaymentprocessor m_mpaymentprocessors m_mpaymentprocessors m_mpaymentprocessors mpaymentprocessor getctx cctype getad_client_id getc_currency_id getpayamt get_trxname m_mpaymentprocessors m_mpaymentprocessors m_mpaymentprocessors mpaymentprocessor getctx cctype getad_client_id getc_currency_id get_trxname m_mpaymentprocessors m_mpaymentprocessors m_mpaymentprocessors m_mpaymentprocessors cctype m_mpaymentprocessor m_mpaymentprocessors m_mpaymentprocessor setc_bankaccount_id m_mpaymentprocessor getc_bankaccount_id m_mpaymentprocessor get accepted credit cards for pay amt default 0 return credit cards public value name pair get credit cards return get credit cards get pay amt payamt valuenamepair getcreditcards getcreditcards getpayamt get accepted credit cards for amount param amt trx amount return credit cards public value name pair get credit cards big decimal amt try if m mpaymentprocessors null m mpaymentprocessors length 0 m mpaymentprocessors m payment processor find get ctx null null getad client id getc currency id amt get trxname hash map string value name pair map new hash map string value name pair to eliminate duplicates for int i 0 i m mpaymentprocessors length i if m mpaymentprocessors i is acceptamex map put creditcardtype amex get credit card pair creditcardtype amex if m mpaymentprocessors i is accept diners map put creditcardtype diners get credit card pair creditcardtype diners if m mpaymentprocessors i is accept discover map put creditcardtype discover get credit card pair creditcardtype discover if m mpaymentprocessors i is acceptmc map put creditcardtype mastercard get credit card pair creditcardtype mastercard if m mpaymentprocessors i is accept corporate map put creditcardtype purchasecard get credit card pair creditcardtype purchasecard if m mpaymentprocessors i is accept visa map put creditcardtype visa get credit card pair creditcardtype visa for all payment processors value name pair ret value new value name pair map size map values to array ret value log fine get credit cards ret value length processors m mpaymentprocessors length return ret value catch exception ex ex print stack trace return null valuenamepair getcreditcards bigdecimal m_mpaymentprocessors m_mpaymentprocessors m_mpaymentprocessors mpaymentprocessor getctx getad_client_id getc_currency_id get_trxname hashmap valuenamepair hashmap valuenamepair m_mpaymentprocessors m_mpaymentprocessors isacceptamex creditcardtype_amex getcreditcardpair creditcardtype_amex m_mpaymentprocessors isacceptdiners creditcardtype_diners getcreditcardpair creditcardtype_diners m_mpaymentprocessors isacceptdiscover creditcardtype_discover getcreditcardpair creditcardtype_discover m_mpaymentprocessors isacceptmc creditcardtype_mastercard getcreditcardpair creditcardtype_mastercard m_mpaymentprocessors isacceptcorporate creditcardtype_purchasecard getcreditcardpair creditcardtype_purchasecard m_mpaymentprocessors isacceptvisa creditcardtype_visa getcreditcardpair creditcardtype_visa valuenamepair retvalue valuenamepair toarray retvalue getcreditcards retvalue m_mpaymentprocessors retvalue printstacktrace get type and name pair param credit card type credit card type return pair private value name pair get credit card pair string credit card type return new value name pair credit card type get credit card name credit card type creditcardtype valuenamepair getcreditcardpair creditcardtype valuenamepair creditcardtype getcreditcardname creditcardtype credit card number param credit card number credit card number public void set credit card number string credit card number super set credit card number m payment validate check numeric credit card number creditcardnumber creditcard setcreditcardnumber creditcardnumber setcreditcardnumber mpaymentvalidate checknumeric creditcardnumber verification code param new credit cardvv cc verification public void set credit cardvv string new credit cardvv super set credit cardvv m payment validate check numeric new credit cardvv newcreditcardvv setcreditcardvv newcreditcardvv setcreditcardvv mpaymentvalidate checknumeric newcreditcardvv two digit credit card mm param credit card expmm exp month public void set credit card expmm int credit card expmm if credit card expmm 1 credit card expmm 12 else super set credit card expmm credit card expmm creditcard creditcardexpmm setcreditcardexpmm creditcardexpmm creditcardexpmm creditcardexpmm setcreditcardexpmm creditcardexpmm two digit credit card yy til 2020 param new credit card expyy 2 or 4 digit year public void set credit card expyy int new credit card expyy int credit card expyy new credit card expyy if new credit card expyy 1999 credit card expyy new credit card expyy 2000 super set credit card expyy credit card expyy creditcard newcreditcardexpyy setcreditcardexpyy newcreditcardexpyy creditcardexpyy newcreditcardexpyy newcreditcardexpyy creditcardexpyy newcreditcardexpyy setcreditcardexpyy creditcardexpyy credit card exp mmyy param mmyy exp in form of mmyy return true if valid public boolean set credit card exp string mmyy if m payment validate validate credit card exp mmyy length 0 return false string exp m payment validate check numeric mmyy string mm str exp substring 0 2 string yy str exp substring 2 4 set credit card expmm integer parse int mm str set credit card expyy integer parse int yy str return true creditcard setcreditcardexp mpaymentvalidate validatecreditcardexp mpaymentvalidate checknumeric mmstr yystr setcreditcardexpmm parseint mmstr setcreditcardexpyy parseint yystr credit card exp mmyy param delimiter or null return exp public string get credit card exp string delimiter string mm string value of get credit card expmm string yy string value of get credit card expyy string buffer ret value new string buffer if mm length 1 ret value append 0 ret value append mm if delimiter null ret value append delimiter if yy length 1 ret value append 0 ret value append yy return ret value to string creditcard getcreditcardexp valueof getcreditcardexpmm valueof getcreditcardexpyy stringbuffer retvalue stringbuffer retvalue retvalue retvalue retvalue retvalue retvalue tostring micr param micr micr public void set micr string micr super set micr m payment validate check numeric micr setmicr setmicr mpaymentvalidate checknumeric routing no param routing no routing no public void set routing no string routing no super set routing no m payment validate check numeric routing no routingno setroutingno routingno setroutingno mpaymentvalidate checknumeric routingno bank account no param account no account no public void set account no string account no super set account no m payment validate check numeric account no accountno accountno setaccountno accountno setaccountno mpaymentvalidate checknumeric accountno check no param check no check no public void set check no string check no super set check no m payment validate check numeric check no checkno setcheckno checkno setcheckno mpaymentvalidate checknumeric checkno set document no to payment info if there is a r pnref that is set automatically private void set document no cash transfer if x equals get tender type return current document no string document no get document no existing reversal if document no null document no index of reverse indicator 0 return if external number exists enforce it if getr pnref null getr pnref length 0 if getr pnref equals document no set document no getr pnref return document no credit card if tendertype creditcard equals get tender type document no get credit card type obscure obscure get credit card number get credit card expmm get credit card expyy own check no else if tendertype check equals get tender type is receipt get check no null get check no length 0 document no get check no customer check routing account check else if tendertype check equals get tender type is receipt if get routing no null document no get routing no if get account no null document no get account no if get check no null if document no length 0 document no document no get check no set document no document no document no trim if document no length 0 set document no document no documentno r_pnref setdocumentno gettendertype documentno getdocumentno documentno documentno indexof reverse_indicator getr_pnref getr_pnref getr_pnref documentno setdocumentno getr_pnref documentno tendertype_creditcard gettendertype documentno getcreditcardtype getcreditcardnumber getcreditcardexpmm getcreditcardexpyy tendertype_check gettendertype isreceipt getcheckno getcheckno documentno getcheckno tendertype_check gettendertype isreceipt getroutingno documentno getroutingno getaccountno documentno getaccountno getcheckno documentno documentno documentno getcheckno documentno documentno documentno setdocumentno documentno set refernce no and document no param r pnref reference public void setr pnref string r pnref super setr pnref r pnref if r pnref null set document no r pnref r_pnref setr_pnref r_pnref setr_pnref r_pnref r_pnref setdocumentno r_pnref set payment amount param pay amt pay amt public void set pay amt big decimal pay amt super set pay amt pay amt null env zero pay amt payamt setpayamt bigdecimal payamt setpayamt payamt payamt set payment amount param c currency id currency param pay amt amount public void set amount int c currency id big decimal pay amt if c currency id 0 c currency id m client get get ctx getc currency id setc currency id c currency id set pay amt pay amt c_currency_id payamt setamount c_currency_id bigdecimal payamt c_currency_id c_currency_id mclient getctx getc_currency_id setc_currency_id c_currency_id setpayamt payamt discount amt param discount amt discount public void set discount amt big decimal discount amt super set discount amt discount amt null env zero discount amt discountamt setdiscountamt bigdecimal discountamt setdiscountamt discountamt discountamt write off amt param write off amt write off public void set write off amt big decimal write off amt super set write off amt write off amt null env zero write off amt writeoff writeoffamt writeoff setwriteoffamt bigdecimal writeoffamt setwriteoffamt writeoffamt writeoffamt over under amt param over under amt over under public void set over under amt big decimal over under amt super set over under amt over under amt null env zero over under amt set is over under payment get over under amt compare to env zero 0 overunder overunderamt overunder setoverunderamt bigdecimal overunderamt setoverunderamt overunderamt overunderamt setisoverunderpayment getoverunderamt compareto tax amt param tax amt tax public void set tax amt big decimal tax amt super set tax amt tax amt null env zero tax amt taxamt settaxamt bigdecimal taxamt settaxamt taxamt taxamt set info from bp bank account param ba bp bank account public void setbp bankaccount mbp bank account ba log fine ba if ba null return setc bpartner id ba getc bpartner id set account address ba geta name ba geta street ba geta city ba geta state ba geta zip ba geta country seta email ba geta email seta ident dl ba geta ident dl seta ident ssn ba geta ident ssn cc if ba get credit card type null set credit card type ba get credit card type if ba get credit card number null set credit card number ba get credit card number if ba get credit card expmm 0 set credit card expmm ba get credit card expmm if ba get credit card expyy 0 set credit card expyy ba get credit card expyy if ba get credit cardvv null set credit cardvv ba get credit cardvv bank if ba get account no null set account no ba get account no if ba get routing no null set routing no ba get routing no setbp_bankaccount mbpbankaccount setc_bpartner_id getc_bpartner_id setaccountaddress geta_name geta_street geta_city geta_state geta_zip geta_country seta_email geta_email seta_ident_dl geta_ident_dl seta_ident_ssn geta_ident_ssn getcreditcardtype setcreditcardtype getcreditcardtype getcreditcardnumber setcreditcardnumber getcreditcardnumber getcreditcardexpmm setcreditcardexpmm getcreditcardexpmm getcreditcardexpyy setcreditcardexpyy getcreditcardexpyy getcreditcardvv setcreditcardvv getcreditcardvv getaccountno setaccountno getaccountno getroutingno setroutingno getroutingno save info from bp bank account param ba bp bank account return true if saved public boolean savetobp bankaccount mbp bank account ba if ba null return false ba seta name geta name ba seta street geta street ba seta city geta city ba seta state geta state ba seta zip geta zip ba seta country geta country ba seta email geta email ba seta ident dl geta ident dl ba seta ident ssn geta ident ssn cc ba set credit card type get credit card type ba set credit card number get credit card number ba set credit card expmm get credit card expmm ba set credit card expyy get credit card expyy ba set credit cardvv get credit cardvv bank if get account no null ba set account no get account no if get routing no null ba set routing no get routing no trx ba setr avsaddr getr avsaddr ba setr avszip getr avszip boolean ok ba save get trxname log fine savetobp bankaccount ba return ok savetobp_bankaccount mbpbankaccount seta_name geta_name seta_street geta_street seta_city geta_city seta_state geta_state seta_zip geta_zip seta_country geta_country seta_email geta_email seta_ident_dl geta_ident_dl seta_ident_ssn geta_ident_ssn setcreditcardtype getcreditcardtype setcreditcardnumber getcreditcardnumber setcreditcardexpmm getcreditcardexpmm setcreditcardexpyy getcreditcardexpyy setcreditcardvv getcreditcardvv getaccountno setaccountno getaccountno getroutingno setroutingno getroutingno setr_avsaddr getr_avsaddr setr_avszip getr_avszip get_trxname savetobp_bankaccount set doc type bases on is receipt private void setc doctype id setc doctype id is receipt isreceipt setc_doctype_id setc_doctype_id isreceipt set doc type param is receipt is receipt public void setc doctype id boolean is receipt set is receipt is receipt string sql select c doctype id from c doctype where ad client id and doc base type order by is default desc try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 getad client id if is receipt pstmt set string 2 m doc type docbasetype arreceipt else pstmt set string 2 m doc type docbasetype appayment result set rs pstmt execute query if rs next setc doctype id rs get int 1 else log warning set doc type not found is receipt is receipt rs close pstmt close catch sql exception e log log level severe sql e isreceipt setc_doctype_id isreceipt setisreceipt isreceipt c_doctype_id c_doctype ad_client_id docbasetype isdefault preparedstatement preparestatement get_trxname setint getad_client_id isreceipt setstring mdoctype docbasetype_arreceipt setstring mdoctype docbasetype_appayment resultset executequery setc_doctype_id getint setdoctype isreceipt isreceipt sqlexception set document type param c doctype id doc type public void setc doctype id int c doctype id if get document no null getc doctype id c doctype id set document no null super setc doctype id c doctype id c_doctype_id setc_doctype_id c_doctype_id getdocumentno getc_doctype_id c_doctype_id setdocumentno setc_doctype_id c_doctype_id verify document type with invoice return true if ok private boolean verify doc type if getc doctype id 0 return false boolean invoiceso null check invoice first if getc invoice id 0 string sql select idt isso trx from c invoice i inner join c doctype idt on i c doctype id idt c doctype id where i c invoice id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoice id result set rs pstmt execute query if rs next invoiceso new boolean y equals rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null invoice document type boolean paymentso null prepared statement pstmt null string sql select isso trx from c doctype where c doctype id try pstmt db prepare statement sql get trxname pstmt set int 1 getc doctype id result set rs pstmt execute query if rs next paymentso new boolean y equals rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null no payment info if paymentso null return false set is receipt paymentso boolean value we have an invoice and it does not match if invoiceso null invoiceso boolean value paymentso boolean value return false ok return true verifydoctype getc_doctype_id getc_invoice_id issotrx c_invoice c_doctype c_doctype_id c_doctype_id c_invoice_id preparedstatement preparestatement get_trxname setint getc_invoice_id resultset executequery getstring documenttype preparedstatement issotrx c_doctype c_doctype_id preparestatement get_trxname setint getc_doctype_id resultset executequery getstring setisreceipt booleanvalue booleanvalue booleanvalue get iso code of currency return currency iso public string get currencyiso return m currency getiso code get ctx getc currency id getcurrencyiso mcurrency getiso_code getctx getc_currency_id get document status return document status clear text public string get doc status name return m ref list get list name get ctx 131 get doc status getdocstatusname mreflist getlistname getctx getdocstatus get name of credit card return name public string get credit card name return get credit card name get credit card type getcreditcardname getcreditcardname getcreditcardtype get name of credit card param credit card type credit card type return name public string get credit card name string credit card type if credit card type null return else if creditcardtype mastercard equals credit card type return master card else if creditcardtype visa equals credit card type return visa else if creditcardtype amex equals credit card type return amex else if creditcardtype atm equals credit card type return atm else if creditcardtype diners equals credit card type return diners else if creditcardtype discover equals credit card type return discover else if creditcardtype purchasecard equals credit card type return purchase card return credit card type creditcardtype getcreditcardname creditcardtype creditcardtype creditcardtype_mastercard creditcardtype mastercard creditcardtype_visa creditcardtype creditcardtype_amex creditcardtype creditcardtype_atm creditcardtype creditcardtype_diners creditcardtype creditcardtype_discover creditcardtype creditcardtype_purchasecard creditcardtype purchasecard creditcardtype add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get pay amt param absolute if true the absolute amount i e negative if payment return amount public big decimal get pay amt boolean absolute if is receipt return super get pay amt return super get pay amt negate bigdecimal getpayamt isreceipt getpayamt getpayamt get pay amt in cents return amount in cents public int get pay amt in cents big decimal bd super get pay amt multiply env onehundred return bd int value getpayamtincents bigdecimal getpayamt intvalue process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get date acct is receipt m doc type docbasetype arreceipt m doc type docbasetype appayment m processmsg period closed return doc action status invalid unsuccessful online payment if is online is approved if getr result null m processmsg online payment failed else m processmsg payment not processed return doc action status invalid waiting payment need to create invoice shipment if getc order id 0 getc invoice id 0 see web order process m order order new m order get ctx getc order id get trxname if docstatus waitingpayment equals order get doc status order setc payment id getc payment id order set doc action m order docaction waitcomplete order set trxname get trxname boolean ok order process it m order docaction waitcomplete m processmsg order get process msg order save get trxname set invoice m invoice invoices order get invoices int length invoices length if length 0 get last invoice setc invoice id invoices length 1 getc invoice id if getc invoice id 0 m processmsg not found c invoice id return doc action status invalid waiting payment consistency of invoice document type and is receipt if verify doc type m processmsg payment doc type invoice inconsistent return doc action status invalid do not pay when credit stop hold if is receipt mb partner bp new mb partner get ctx getc bpartner id get trxname if mb partner socreditstatus creditstop equals bp getso credit status m processmsg b partner credit stop total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid if mb partner socreditstatus credithold equals bp getso credit status m processmsg b partner credit hold total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getdateacct isreceipt mdoctype docbasetype_arreceipt mdoctype docbasetype_appayment m_processmsg periodclosed docaction status_invalid isonline isapproved getr_result m_processmsg onlinepaymentfailed m_processmsg paymentnotprocessed docaction status_invalid getc_order_id getc_invoice_id weborder morder morder getctx getc_order_id get_trxname docstatus_waitingpayment getdocstatus setc_payment_id getc_payment_id setdocaction morder docaction_waitcomplete set_trxname get_trxname processit morder docaction_waitcomplete m_processmsg getprocessmsg get_trxname minvoice getinvoices setc_invoice_id getc_invoice_id getc_invoice_id m_processmsg notfound c_invoice_id docaction status_invalid waitingpayment isreceipt verifydoctype m_processmsg paymentdoctypeinvoiceinconsistent docaction status_invalid isreceipt mbpartner mbpartner getctx getc_bpartner_id get_trxname mbpartner socreditstatus_creditstop getsocreditstatus m_processmsg bpartnercreditstop totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid mbpartner socreditstatus_credithold getsocreditstatus m_processmsg bpartnercredithold totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string charge handling if getc charge id 0 set is allocated true else allocate it create allocation records test allocation project update if getc project id 0 m project project new m project get ctx getc project id update bp for prepayments if getc bpartner id 0 getc invoice id 0 mb partner bp new mb partner get ctx getc bpartner id get trxname bp set total open balance bp save counter doc m payment counter create counter doc if counter null m processmsg counter doc c payment id counter get document no user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring getc_charge_id setisallocated allocateit testallocation getc_project_id mproject mproject getctx getc_project_id getc_bpartner_id getc_invoice_id mbpartner mbpartner getctx getc_bpartner_id get_trxname settotalopenbalance mpayment createcounterdoc m_processmsg counterdoc c_payment_id getdocumentno modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed create counter document private m payment create counter doc is this a counter doc if getref payment id 0 return null org must be linked to b partner m org org m org get get ctx getad org id int counterc bpartner id org getlinkedc bpartner id if counterc bpartner id 0 return null business partner needs to be linked to org mb partner bp new mb partner get ctx getc bpartner id null int counterad org id bp getad orgbp id int if counterad org id 0 return null mb partner counterbp new mb partner get ctx counterc bpartner id null m org info counter org info m org info get get ctx counterad org id log info counter bp counterbp get name document type int c doctypetarget id 0 m doc type counter counterdt m doc type counter get counter doc type get ctx getc doctype id if counterdt null log fine counterdt to string if counterdt is create counter counterdt is valid return null c doctypetarget id counterdt getcounter c doctype id else indirect c doctypetarget id m doc type counter getcounterdoctype id get ctx getc doctype id log fine indirect c doctypetarget id c doctypetarget id if c doctypetarget id 0 return null deep copy m payment counter new m payment get ctx 0 get trxname counter setad org id counterad org id counter setc bpartner id counterbp getc bpartner id counter set is receipt is receipt counter setc doctype id c doctypetarget id counter set trx type get trx type counter set tender type get tender type counter set pay amt get pay amt counter set discount amt get discount amt counter set tax amt get tax amt counter set write off amt get write off amt counter set is over under payment is over under payment counter set over under amt get over under amt counter setc currency id getc currency id counter setc conversiontype id getc conversiontype id counter set date trx get date trx counter set date acct get date acct counter setref payment id getc payment id string sql select c bankaccount id from c bankaccount where c currency id and ad org id in 0 and is active y order by is default desc int c bankaccount id db getsql value get trxname sql getc currency id counterad org id counter setc bankaccount id c bankaccount id refernces counter setc activity id getc activity id counter setc campaign id getc campaign id counter setc project id getc project id counter setuser1 id getuser1 id counter setuser2 id getuser2 id counter save get trxname log fine counter to string setref payment id counter getc payment id document action if counterdt null if counterdt get doc action null counter set doc action counterdt get doc action counter process it counterdt get doc action counter save get trxname return counter mpayment createcounterdoc getref_payment_id bpartner morg morg getctx getad_org_id counterc_bpartner_id getlinkedc_bpartner_id counterc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id counterad_org_id getad_orgbp_id_int counterad_org_id mbpartner mbpartner getctx counterc_bpartner_id morginfo counterorginfo morginfo getctx counterad_org_id getname c_doctypetarget_id mdoctypecounter mdoctypecounter getcounterdoctype getctx getc_doctype_id tostring iscreatecounter isvalid c_doctypetarget_id getcounter_c_doctype_id c_doctypetarget_id mdoctypecounter getcounterdoctype_id getctx getc_doctype_id c_doctypetarget_id c_doctypetarget_id c_doctypetarget_id mpayment mpayment getctx get_trxname setad_org_id counterad_org_id setc_bpartner_id getc_bpartner_id setisreceipt isreceipt setc_doctype_id c_doctypetarget_id settrxtype gettrxtype settendertype gettendertype setpayamt getpayamt setdiscountamt getdiscountamt settaxamt gettaxamt setwriteoffamt getwriteoffamt setisoverunderpayment isoverunderpayment setoverunderamt getoverunderamt setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setdatetrx getdatetrx setdateacct getdateacct setref_payment_id getc_payment_id c_bankaccount_id c_bankaccount c_currency_id ad_org_id isactive isdefault c_bankaccount_id getsqlvalue get_trxname getc_currency_id counterad_org_id setc_bankaccount_id c_bankaccount_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_project_id getc_project_id setuser1_id getuser1_id setuser2_id getuser2_id get_trxname tostring setref_payment_id getc_payment_id getdocaction setdocaction getdocaction processit getdocaction get_trxname allocate it only call when there is no allocation as it will create duplicates if an invoice exists it allocates that otherwise it allocates payment selection return true if allocated public boolean allocate it create invoice allocation see also m cash complete it if getc invoice id 0 return allocate invoice invoices of a ap payment selection if allocate pay selection return true if getc order id 0 return false allocate to multiple payments based on entry m payment allocate p allocs m payment allocate get this if p allocs length 0 return false m allocation hdr alloc new m allocation hdr get ctx false get date trx getc currency id msg translate get ctx c payment id get document no get trxname alloc setad org id getad org id if alloc save log severe p allocations not created return false lines for int i 0 i p allocs length i m payment allocate pa p allocs i m allocation line a line null if is receipt a line new m allocation line alloc pa get amount pa get discount amt pa get write off amt pa get over under amt else a line new m allocation line alloc pa get amount negate pa get discount amt negate pa get write off amt negate pa get over under amt negate a line set doc info pa getc bpartner id 0 pa getc invoice id a line set payment info getc payment id 0 if a line save get trxname log warning p allocations line not saved else pa setc allocationline id a line getc allocationline id pa save should start wf alloc process it doc action action complete m processmsg c allocationhdr id alloc get document no return alloc save get trxname allocateit mcash completeit getc_invoice_id allocateinvoice allocatepayselection getc_order_id mpaymentallocate pallocs mpaymentallocate pallocs mallocationhdr mallocationhdr getctx getdatetrx getc_currency_id getctx c_payment_id getdocumentno get_trxname setad_org_id getad_org_id pallocs mpaymentallocate pallocs mallocationline aline isreceipt aline mallocationline getamount getdiscountamt getwriteoffamt getoverunderamt aline mallocationline getamount getdiscountamt getwriteoffamt getoverunderamt aline setdocinfo getc_bpartner_id getc_invoice_id aline setpaymentinfo getc_payment_id aline get_trxname setc_allocationline_id aline getc_allocationline_id processit docaction action_complete m_processmsg c_allocationhdr_id getdocumentno get_trxname allocate single ap ar invoice private boolean allocate invoice calculate actual allocation big decimal allocation amt get pay amt underpayment if get over under amt signum 0 get pay amt signum 0 allocation amt allocation amt add get over under amt overpayment negative m allocation hdr alloc new m allocation hdr get ctx false get date trx getc currency id msg translate get ctx c payment id get document no 1 get trxname alloc setad org id getad org id if alloc save log log level severe could not create allocation hdr return false m allocation line a line null if is receipt a line new m allocation line alloc allocation amt get discount amt get write off amt get over under amt else a line new m allocation line alloc allocation amt negate get discount amt negate get write off amt negate get over under amt negate a line set doc info getc bpartner id 0 getc invoice id a line setc payment id getc payment id if a line save get trxname log log level severe could not create allocation line return false should start wf alloc process it doc action action complete alloc save get trxname m processmsg c allocationhdr id alloc get document no get project from invoice int c project id db getsql value get trxname select max c project id from c invoice where c invoice id getc invoice id if c project id 0 getc project id 0 setc project id c project id else if c project id 0 getc project id 0 c project id getc project id log warning invoice c project id c project id payment c project id getc project id return true allocateinvoice bigdecimal allocationamt getpayamt getoverunderamt getpayamt allocationamt allocationamt getoverunderamt mallocationhdr mallocationhdr getctx getdatetrx getc_currency_id getctx c_payment_id getdocumentno get_trxname setad_org_id getad_org_id mallocationline aline isreceipt aline mallocationline allocationamt getdiscountamt getwriteoffamt getoverunderamt aline mallocationline allocationamt getdiscountamt getwriteoffamt getoverunderamt aline setdocinfo getc_bpartner_id getc_invoice_id aline setc_payment_id getc_payment_id aline get_trxname processit docaction action_complete get_trxname m_processmsg c_allocationhdr_id getdocumentno c_project_id getsqlvalue get_trxname c_project_id c_invoice c_invoice_id getc_invoice_id c_project_id getc_project_id setc_project_id c_project_id c_project_id getc_project_id c_project_id getc_project_id c_project_id c_project_id c_project_id getc_project_id allocate payment selection private boolean allocate pay selection m allocation hdr alloc new m allocation hdr get ctx false get date trx getc currency id msg translate get ctx c payment id get document no n get trxname alloc setad org id getad org id string sql select psc c bpartner id psl c invoice id psl isso trx 1 3 psl pay amt psl discount amt psl difference amt psl open amt from c payselectionline psl inner join c payselectioncheck psc on psl c payselectioncheck id psc c payselectioncheck id where psc c payment id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc payment id result set rs pstmt execute query while rs next int c bpartner id rs get int 1 int c invoice id rs get int 2 if c bpartner id 0 c invoice id 0 continue boolean isso trx y equals rs get string 3 big decimal pay amt rs get big decimal 4 big decimal discount amt rs get big decimal 5 big decimal write off amt rs get big decimal 6 big decimal open amt rs get big decimal 7 big decimal over under amt open amt subtract pay amt subtract discount amt subtract write off amt if alloc get id 0 alloc save get trxname log log level severe could not create allocation hdr rs close pstmt close return false m allocation line a line null if isso trx a line new m allocation line alloc pay amt discount amt write off amt over under amt else a line new m allocation line alloc pay amt negate discount amt negate write off amt negate over under amt negate a line set doc info c bpartner id 0 c invoice id a line setc payment id getc payment id if a line save get trxname log log level severe could not create allocation line rs close pstmt close pstmt null catch exception e log log level severe allocate pay selection e try if pstmt null pstmt close pstmt null catch exception e pstmt null should start wf boolean ok true if alloc get id 0 log fine no allocation created c payment id getc payment id ok false else alloc process it doc action action complete ok alloc save get trxname m processmsg c allocationhdr id alloc get document no return ok allocatepayselection mallocationhdr mallocationhdr getctx getdatetrx getc_currency_id getctx c_payment_id getdocumentno get_trxname setad_org_id getad_org_id c_bpartner_id c_invoice_id issotrx payamt discountamt differenceamt openamt c_payselectionline c_payselectioncheck c_payselectioncheck_id c_payselectioncheck_id c_payment_id preparedstatement preparestatement get_trxname setint getc_payment_id resultset executequery c_bpartner_id getint c_invoice_id getint c_bpartner_id c_invoice_id issotrx getstring bigdecimal payamt getbigdecimal bigdecimal discountamt getbigdecimal bigdecimal writeoffamt getbigdecimal bigdecimal openamt getbigdecimal bigdecimal overunderamt openamt payamt discountamt writeoffamt get_id get_trxname mallocationline aline issotrx aline mallocationline payamt discountamt writeoffamt overunderamt aline mallocationline payamt discountamt writeoffamt overunderamt aline setdocinfo c_bpartner_id c_invoice_id aline setc_payment_id getc_payment_id aline get_trxname allocatepayselection get_id c_payment_id getc_payment_id processit docaction action_complete get_trxname m_processmsg c_allocationhdr_id getdocumentno de allocate payment unkink invoices and orders and delete allocations private void de allocate if getc order id 0 setc order id 0 if getc invoice id 0 return de allocate all m allocation hdr allocations m allocation hdr get of payment get ctx getc payment id get trxname log fine allocations length for int i 0 i allocations length i allocations i set trxname get trxname allocations i set doc action doc action action reverse correct allocations i process it doc action action reverse correct allocations i save unlink in case allocation did not get it if getc invoice id 0 invoice string sql update c invoice set c payment id null is paid n where c invoice id getc invoice id and c payment id getc payment id int no db execute update sql get trxname if no 0 log fine unlink invoice no order sql update c order o set c payment id null where exists select from c invoice i where o c order id i c order id and i c invoice id getc invoice id and c payment id getc payment id no db execute update sql get trxname if no 0 log fine unlink order no setc invoice id 0 set is allocated false deallocate getc_order_id setc_order_id getc_invoice_id mallocationhdr mallocationhdr getofpayment getctx getc_payment_id get_trxname set_trxname get_trxname setdocaction docaction action_reverse_correct processit docaction action_reverse_correct getc_invoice_id c_invoice c_payment_id ispaid c_invoice_id getc_invoice_id c_payment_id getc_payment_id executeupdate get_trxname c_order c_payment_id c_invoice c_order_id c_order_id c_invoice_id getc_invoice_id c_payment_id getc_payment_id executeupdate get_trxname setc_invoice_id setisallocated void document return true if success public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status set doc action docaction none return false if on bank statement don t void it reverse it if getc bankstatementline id 0 return reverse correct it not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status add description msg get msg get ctx voided get pay amt set pay amt env zero set discount amt env zero set write off amt env zero set over under amt env zero set is allocated false unlink de allocate de allocate else return reverse correct it set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus setdocaction docaction_none getc_bankstatementline_id reversecorrectit docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus adddescription getmsg getctx getpayamt setpayamt setdiscountamt setwriteoffamt setoverunderamt setisallocated deallocate reversecorrectit setprocessed setdocaction docaction_none close document return true if success public boolean close it log info to string set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return true if success public boolean reverse correct it log info to string std period open timestamp date acct get date acct if m period is open get ctx date acct is receipt m doc type docbasetype arreceipt m doc type docbasetype appayment date acct new timestamp system current time millis auto reconcile if not on bank statement boolean reconciled false getc bankstatementline id 0 create reversal m payment reversal new m payment get ctx 0 get trxname copy values this reversal reversal set client org this reversal setc order id 0 reversal setc invoice id 0 reversal set date acct date acct reversal set document no get document no reverse indicator indicate reversals reversal set doc status docstatus drafted reversal set doc action docaction complete reversal set pay amt get pay amt negate reversal set discount amt get discount amt negate reversal set write off amt get write off amt negate reversal set over under amt get over under amt negate reversal set is allocated true reversal set is reconciled reconciled to put on bank statement reversal set is online false reversal set is approved true reversal setr pnref null reversal setr result null reversal setr respmsg null reversal setr authcode null reversal setr info null reversal set processing false reversal seto processing n reversal set processed false reversal set posted false reversal set description get description reversal add description get document no reversal save get trxname post reversal if reversal process it doc action action complete m processmsg reversal error reversal get process msg return false reversal close it reversal set doc status docstatus reversed reversal set doc action docaction none reversal save get trxname unlink de allocate de allocate set is reconciled reconciled set is allocated true the allocation below is overwritten set status add description reversal get document no set doc status docstatus reversed set doc action docaction none set processed true create automatic allocation m allocation hdr alloc new m allocation hdr get ctx false get date trx getc currency id msg translate get ctx c payment id reversal get document no get trxname alloc setad org id getad org id if alloc save log warning automatic allocation hdr not saved else original allocation m allocation line a line new m allocation line alloc get pay amt true env zero env zero env zero a line set doc info getc bpartner id 0 0 a line set payment info getc payment id 0 if a line save get trxname log warning automatic allocation line not saved reversal allocation a line new m allocation line alloc reversal get pay amt true env zero env zero env zero a line set doc info reversal getc bpartner id 0 0 a line set payment info reversal getc payment id 0 if a line save get trxname log warning automatic allocation reversal line not saved alloc process it doc action action complete alloc save get trxname string buffer info new string buffer reversal get document no info append c allocationhdr id append alloc get document no update b partner if getc bpartner id 0 mb partner bp new mb partner get ctx getc bpartner id get trxname bp set total open balance bp save get trxname m processmsg info to string return true reversecorrectit tostring dateacct getdateacct mperiod isopen getctx dateacct isreceipt mdoctype docbasetype_arreceipt mdoctype docbasetype_appayment dateacct currenttimemillis getc_bankstatementline_id mpayment mpayment getctx get_trxname copyvalues setclientorg setc_order_id setc_invoice_id setdateacct dateacct setdocumentno getdocumentno reverse_indicator setdocstatus docstatus_drafted setdocaction docaction_complete setpayamt getpayamt setdiscountamt getdiscountamt setwriteoffamt getwriteoffamt setoverunderamt getoverunderamt setisallocated setisreconciled setisonline setisapproved setr_pnref setr_result setr_respmsg setr_authcode setr_info setprocessing setoprocessing setprocessed setposted setdescription getdescription adddescription getdocumentno get_trxname processit docaction action_complete m_processmsg getprocessmsg closeit setdocstatus docstatus_reversed setdocaction docaction_none get_trxname deallocate setisreconciled setisallocated adddescription getdocumentno setdocstatus docstatus_reversed setdocaction docaction_none setprocessed mallocationhdr mallocationhdr getctx getdatetrx getc_currency_id getctx c_payment_id getdocumentno get_trxname setad_org_id getad_org_id mallocationline aline mallocationline getpayamt aline setdocinfo getc_bpartner_id aline setpaymentinfo getc_payment_id aline get_trxname aline mallocationline getpayamt aline setdocinfo getc_bpartner_id aline setpaymentinfo getc_payment_id aline get_trxname processit docaction action_complete get_trxname stringbuffer stringbuffer getdocumentno c_allocationhdr_id getdocumentno bpartner getc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id get_trxname settotalopenbalance get_trxname m_processmsg tostring get bank statement line of payment or 0 return id or 0 private int getc bankstatementline id string sql select c bankstatementline id from c bankstatementline where c payment id int id db getsql value get trxname sql getc payment id if id 0 return 0 return id getc_bankstatementline_id c_bankstatementline_id c_bankstatementline c_payment_id getsqlvalue get_trxname getc_payment_id reverse accrual none return true if success public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return true if success public boolean re activate it log info to string if reverse correct it return true return false reactivateit tostring reversecorrectit string representation return info public string to string string buffer sb new string buffer m payment sb append get id append append get document no append receipt append is receipt append pay amt append get pay amt append discount append get discount amt append write off append get write off amt append over under append get over under amt return sb to string tostring stringbuffer stringbuffer mpayment get_id getdocumentno isreceipt payamt getpayamt getdiscountamt writeoff getwriteoffamt overunder getoverunderamt tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine payment getc payment id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_payment_id get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx pay amt append append get pay amt append append msg translate get ctx write off amt append append get write off amt description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx payamt getpayamt getctx writeoffamt getwriteoffamt getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby get document approval amount return amount payment ap or write off ar public big decimal get approval amt if is receipt return get write off amt return get pay amt bigdecimal getapprovalamt isreceipt getwriteoffamt getpayamt standard constructor public x pa sla goal properties ctx int pa sla goal id string trx name super ctx pa sla goal id trx name if pa sla goal id 0 setc bpartner id 0 set measure actual env zero set measure target env zero set name null setpa sla criteria id 0 setpa sla goal id 0 set processed false x_pa_sla_goal pa_sla_goal_id trxname pa_sla_goal_id trxname pa_sla_goal_id setc_bpartner_id setmeasureactual setmeasuretarget setname setpa_sla_criteria_id setpa_sla_goal_id setprocessed load constructor public x pa sla goal properties ctx result set rs string trx name super ctx rs trx name x_pa_sla_goal resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa sla goal append get id append return sb to string tostring stringbuffer stringbuffer x_pa_sla_goal get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set measure actual actual value that has been measured public void set measure actual big decimal measure actual if measure actual null throw new illegal argument exception measure actual is mandatory set value measure actual measure actual setmeasureactual bigdecimal measureactual measureactual illegalargumentexception measureactual set_value measureactual measureactual get measure actual actual value that has been measured public big decimal get measure actual big decimal bd big decimal get value measure actual if bd null return env zero return bd bigdecimal getmeasureactual bigdecimal bigdecimal get_value measureactual set measure target target value for measure public void set measure target big decimal measure target if measure target null throw new illegal argument exception measure target is mandatory set value measure target measure target setmeasuretarget bigdecimal measuretarget measuretarget illegalargumentexception measuretarget set_value measuretarget measuretarget get measure target target value for measure public big decimal get measure target big decimal bd big decimal get value measure target if bd null return env zero return bd bigdecimal getmeasuretarget bigdecimal bigdecimal get_value measuretarget set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sla criteria service level agreement criteria public void setpa sla criteria id int pa sla criteria id if pa sla criteria id 1 throw new illegal argument exception pa sla criteria id is mandatory set value pa sla criteria id new integer pa sla criteria id setpa_sla_criteria_id pa_sla_criteria_id pa_sla_criteria_id illegalargumentexception pa_sla_criteria_id set_value pa_sla_criteria_id pa_sla_criteria_id get sla criteria service level agreement criteria public int getpa sla criteria id integer ii integer get value pa sla criteria id if ii null return 0 return ii int value getpa_sla_criteria_id get_value pa_sla_criteria_id intvalue set sla goal service level agreement goal public void setpa sla goal id int pa sla goal id if pa sla goal id 1 throw new illegal argument exception pa sla goal id is mandatory set valuenocheck pa sla goal id new integer pa sla goal id setpa_sla_goal_id pa_sla_goal_id pa_sla_goal_id illegalargumentexception pa_sla_goal_id set_valuenocheck pa_sla_goal_id pa_sla_goal_id get sla goal service level agreement goal public int getpa sla goal id integer ii integer get value pa sla goal id if ii null return 0 return ii int value getpa_sla_goal_id get_value pa_sla_goal_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto standard constructor public x ad process access properties ctx int ad process access id string trx name super ctx ad process access id trx name if ad process access id 0 setad process id 0 setad role id 0 set is read write false x_ad_process_access ad_process_access_id trxname ad_process_access_id trxname ad_process_access_id setad_process_id setad_role_id setisreadwrite load constructor public x ad process access properties ctx result set rs string trx name super ctx rs trx name x_ad_process_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad process access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_process_access get_id tostring set process process or report public void setad process id int ad process id if ad process id 1 throw new illegal argument exception ad process id is mandatory set valuenocheck ad process id new integer ad process id setad_process_id ad_process_id ad_process_id illegalargumentexception ad_process_id set_valuenocheck ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set read write field is read write public void set is read write boolean is read write set value is read write new boolean is read write setisreadwrite isreadwrite set_value isreadwrite isreadwrite get read write field is read write public boolean is read write object oo get value is read write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadwrite get_value isreadwrite booleanvalue get contents return context public object get contents return contents getcontents prepare e g get parameters protected void prepare perform process return message to be translated throws exception protected string do it throws java lang exception log info env reset false not final return cache reset doit validate user param ldapurl provider url e g ldap dc compiere org param domain domain name e g compiere org param user name user name e g jjanke param password password return true if validated with ldap public static boolean validate string ldapurl string domain string user name string password hashtable string string env new hashtable string string env put context initial context factory com sun jndi ldap ldap ctx factory ldap dc compiere org env put context provider url ldapurl env put context security authentication simple jjanke compiere org string buffer principal new string buffer user name append append domain env put context security principal principal to string env put context security credentials password try create the initial context initial ldap context ctx new initial ldap context env null dir context ctx new initial dir context env test get the attributes attributes answer ctx get attributes print the answer dump answer catch authentication exception e log info error principal e get localized message return false catch exception e log log level severe ldapurl principal e return false log info ok principal return true username username initial_context_factory ldapctxfactory provider_url security_authentication stringbuffer stringbuffer username security_principal tostring security_credentials initialldapcontext initialldapcontext dircontext initialdircontext getattributes authenticationexception getlocalizedmessage print attributes to system out param attrs private static void dump attributes attrs if attrs null system out println no attributes else print each attribute try for naming enumeration ae attrs get all ae has more attribute attr attribute ae next system out println attribute attr getid print each value for naming enumeration e attr get all e has more system out println value e next catch naming exception e e print stack trace namingenumeration getall hasmore namingenumeration getall hasmore namingexception printstacktrace test param args ignored public static void main string args try validate ldap dc adempiere org adempiere org red1 ikeepforgetting catch exception e e print stack trace printstacktrace standard constructor public x r interestarea properties ctx int r interestarea id string trx name super ctx r interestarea id trx name if r interestarea id 0 set is self service true y set name null setr interestarea id 0 x_r_interestarea r_interestarea_id trxname r_interestarea_id trxname r_interestarea_id setisselfservice setname setr_interestarea_id load constructor public x r interestarea properties ctx result set rs string trx name super ctx rs trx name x_r_interestarea resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r interestarea append get id append return sb to string tostring stringbuffer stringbuffer x_r_interestarea get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set interest area interest area or topic public void setr interestarea id int r interestarea id if r interestarea id 1 throw new illegal argument exception r interestarea id is mandatory set valuenocheck r interestarea id new integer r interestarea id setr_interestarea_id r_interestarea_id r_interestarea_id illegalargumentexception r_interestarea_id set_valuenocheck r_interestarea_id r_interestarea_id get interest area interest area or topic public int getr interestarea id integer ii integer get value r interestarea id if ii null return 0 return ii int value getr_interestarea_id get_value r_interestarea_id intvalue standard constructor public x c location properties ctx int c location id string trx name super ctx c location id trx name if c location id 0 setc country id 0 setc location id 0 x_c_location c_location_id trxname c_location_id trxname c_location_id setc_country_id setc_location_id load constructor public x c location properties ctx result set rs string trx name super ctx rs trx name x_c_location resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c location append get id append return sb to string tostring stringbuffer stringbuffer x_c_location get_id tostring set address 1 address line 1 for this location public void set address1 string address1 if address1 null address1 length 60 log warning length 60 truncated address1 address1 substring 0 59 set value address1 address1 setaddress1 set_value get address 1 address line 1 for this location public string get address1 return string get value address1 getaddress1 get_value set address 2 address line 2 for this location public void set address2 string address2 if address2 null address2 length 60 log warning length 60 truncated address2 address2 substring 0 59 set value address2 address2 setaddress2 set_value get address 2 address line 2 for this location public string get address2 return string get value address2 getaddress2 get_value set address 3 address line 3 for the location public void set address3 string address3 if address3 null address3 length 60 log warning length 60 truncated address3 address3 substring 0 59 set value address3 address3 setaddress3 set_value get address 3 address line 3 for the location public string get address3 return string get value address3 getaddress3 get_value set address 4 address line 4 for the location public void set address4 string address4 if address4 null address4 length 60 log warning length 60 truncated address4 address4 substring 0 59 set value address4 address4 setaddress4 set_value get address 4 address line 4 for the location public string get address4 return string get value address4 getaddress4 get_value set city city public void setc city id int c city id if c city id 0 set value c city id null else set value c city id new integer c city id setc_city_id c_city_id c_city_id set_value c_city_id set_value c_city_id c_city_id get city city public int getc city id integer ii integer get value c city id if ii null return 0 return ii int value getc_city_id get_value c_city_id intvalue set country country public void setc country id int c country id if c country id 1 throw new illegal argument exception c country id is mandatory set value c country id new integer c country id setc_country_id c_country_id c_country_id illegalargumentexception c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set address location or address public void setc location id int c location id if c location id 1 throw new illegal argument exception c location id is mandatory set valuenocheck c location id new integer c location id setc_location_id c_location_id c_location_id illegalargumentexception c_location_id set_valuenocheck c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set city identifies a city public void set city string city if city null city length 60 log warning length 60 truncated city city substring 0 59 set value city city setcity set_value get city identifies a city public string get city return string get value city getcity get_value return string get value city public key name pair get key name pair return new key name pair get id get city get_value keynamepair getkeynamepair keynamepair get_id getcity set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal set_value get zip postal code public string get postal return string get value postal getpostal get_value set additional zip or postal code public void setpostal add string postal add if postal add null postal add length 10 log warning length 10 truncated postal add postal add substring 0 9 set value postal add postal add setpostal_add postal_add postal_add postal_add postal_add postal_add set_value postal_add postal_add get additional zip or postal code public string getpostal add return string get value postal add getpostal_add get_value postal_add set region name of the region public void set region name string region name if region name null region name length 40 log warning length 40 truncated region name region name substring 0 39 set value region name region name setregionname regionname regionname regionname regionname regionname set_value regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname standard constructor public x r requestprocessor properties ctx int r requestprocessor id string trx name super ctx r requestprocessor id trx name if r requestprocessor id 0 set frequency 0 1 set frequency type null set inactivity alert days 0 0 set keep log days 0 7 set name null set overdue alert days 0 0 set overdue assign days 0 0 setr requestprocessor id 0 set remind days 0 0 setsupervisor id 0 x_r_requestprocessor r_requestprocessor_id trxname r_requestprocessor_id trxname r_requestprocessor_id setfrequency setfrequencytype setinactivityalertdays setkeeplogdays setname setoverduealertdays setoverdueassigndays setr_requestprocessor_id setreminddays setsupervisor_id load constructor public x r requestprocessor properties ctx result set rs string trx name super ctx rs trx name x_r_requestprocessor resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestprocessor append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestprocessor get_id tostring set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run set value date next run date next run setdatenextrun datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set inactivity alert days send alert when there is no activity after days 0 no alert public void set inactivity alert days int inactivity alert days set value inactivity alert days new integer inactivity alert days setinactivityalertdays inactivityalertdays set_value inactivityalertdays inactivityalertdays get inactivity alert days send alert when there is no activity after days 0 no alert public int get inactivity alert days integer ii integer get value inactivity alert days if ii null return 0 return ii int value getinactivityalertdays get_value inactivityalertdays intvalue set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set alert after days due send email alert after number of days due 0 no alerts public void set overdue alert days int overdue alert days set value overdue alert days new integer overdue alert days setoverduealertdays overduealertdays set_value overduealertdays overduealertdays get alert after days due send email alert after number of days due 0 no alerts public int get overdue alert days integer ii integer get value overdue alert days if ii null return 0 return ii int value getoverduealertdays get_value overduealertdays intvalue set escalate after days due escalation to superior after number of due days 0 no public void set overdue assign days int overdue assign days set value overdue assign days new integer overdue assign days setoverdueassigndays overdueassigndays set_value overdueassigndays overdueassigndays get escalate after days due escalation to superior after number of due days 0 no public int get overdue assign days integer ii integer get value overdue assign days if ii null return 0 return ii int value getoverdueassigndays get_value overdueassigndays intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set request processor processor for requests public void setr requestprocessor id int r requestprocessor id if r requestprocessor id 1 throw new illegal argument exception r requestprocessor id is mandatory set valuenocheck r requestprocessor id new integer r requestprocessor id setr_requestprocessor_id r_requestprocessor_id r_requestprocessor_id illegalargumentexception r_requestprocessor_id set_valuenocheck r_requestprocessor_id r_requestprocessor_id get request processor processor for requests public int getr requestprocessor id integer ii integer get value r requestprocessor id if ii null return 0 return ii int value getr_requestprocessor_id get_value r_requestprocessor_id intvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 0 set value r requesttype id null else set value r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id set_value r_requesttype_id set_value r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue set reminder days days between sending reminder emails for a due or inactive document public void set remind days int remind days set value remind days new integer remind days setreminddays reminddays set_value reminddays reminddays get reminder days days between sending reminder emails for a due or inactive document public int get remind days integer ii integer get value remind days if ii null return 0 return ii int value getreminddays get_value reminddays intvalue public static final int supervisor id ad reference id 286 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 1 throw new illegal argument exception supervisor id is mandatory set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id illegalargumentexception supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue constructor for grid param m field field model public v cell renderer m field m field this m field get display type m columnname m field get column name this set name m columnname m lookup m field get lookup m password m field is encrypted field mfield vcellrenderer mfield mfield mfield getdisplaytype m_columnname mfield getcolumnname setname m_columnname m_lookup mfield getlookup m_password mfield isencryptedfield constructor for mini grid param display type display type public v cell renderer int display type super m displaytype display type number if display type is numeric m displaytype m numberformat display type get number format m displaytype set horizontal alignment j label right date else if display type is date m displaytype m dateformat display type get date format m displaytype else if m displaytype display type yes no m check new j check box m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center m check set opaque true minigrid displaytype vcellrenderer displaytype m_displaytype displaytype displaytype isnumeric m_displaytype m_numberformat displaytype getnumberformat m_displaytype sethorizontalalignment jlabel displaytype isdate m_displaytype m_dateformat displaytype getdateformat m_displaytype m_displaytype displaytype yesno m_check jcheckbox m_check setmargin m_check sethorizontalalignment jlabel m_check setopaque get table cell renderer component param table table param value value param is selected selected param has focus focus param row row param col col return component public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int col log finest m columnname value value null null value to string row row col col component c null if m displaytype display type yes no c m check else returns j label c super get table cell renderer component table value is selected has focus row col c set font compiereplaf getfont field background foreground color bg compiereplaf getfieldbackground normal color fg compiereplaf gettextcolor normal inactive background boolean ro table is cell editable row col if ro bg compiereplaf getfieldbackground inactive selected is white on blue in windows if is selected has focus if ro bg table get selection background fg table get selection foreground else row not selected or field has focus foreground int c code 0 grid if table instanceof org compiere grid v table c code org compiere grid v table table get color code row mini grid else if table instanceof org compiere minigrid mini table c code org compiere minigrid mini table table get color code row if c code 0 else if c code 0 fg compiereplaf gettextcolor issue else fg compiereplaf gettextcolor ok set color c set background bg c set foreground fg log fine r row c col c get class get name sel is selected focus has focus edit table is cell editable row col log trace 7 bg bg equals color white white bg to string fg fg equals color black black fg to string format it set value value return c tablecell renderercomponent isselected hasfocus gettablecellrenderercomponent jtable isselected hasfocus m_columnname tostring m_displaytype displaytype yesno m_check jlabel gettablecellrenderercomponent isselected hasfocus setfont getfont_field getfieldbackground_normal gettextcolor_normal iscelleditable getfieldbackground_inactive isselected hasfocus getselectionbackground getselectionforeground ccode vtable ccode vtable getcolorcode minigrid minitable ccode minitable getcolorcode ccode ccode gettextcolor_issue gettextcolor_ok setbackground setforeground getclass getname isselected hasfocus iscelleditable tostring tostring setvalue format display value default is j label param value key value protected void set value object value string ret value null try checkbox if m displaytype display type yes no if value instanceof boolean m check set selected boolean value boolean value else m check set selected y equals value return else if value null number else if display type is numeric m displaytype ret value m numberformat format value date else if display type is date m displaytype ret value m dateformat format value row id else if m displaytype display type rowid ret value lookup else if m lookup null display type is lookup m displaytype m displaytype display type location m displaytype display type account m displaytype display type locator m displaytype display type p attribute ret value m lookup get display value button else if m displaytype display type button if record id equals m columnname ret value value else ret value null password fixed string else if m password ret value other string else super set value value return catch exception e log log level severe value value get class get name e ret value value to string super set value ret value jlabel setvalue retvalue m_displaytype displaytype yesno m_check setselected booleanvalue m_check setselected displaytype isnumeric m_displaytype retvalue m_numberformat displaytype isdate m_displaytype retvalue m_dateformat m_displaytype displaytype retvalue m_lookup displaytype islookup m_displaytype m_displaytype displaytype m_displaytype displaytype m_displaytype displaytype m_displaytype displaytype pattribute retvalue m_lookup getdisplay m_displaytype displaytype record_id m_columnname retvalue retvalue m_password retvalue setvalue getclass getname retvalue tostring setvalue retvalue to string return string representation public string to string return v cell renderer m columnname display type m displaytype m lookup tostring vcellrenderer m_columnname displaytype m_displaytype m_lookup dispose public void dispose if m lookup null m lookup dispose m lookup null m_lookup m_lookup m_lookup translation handler param ad client id only certain client if id 0 public translation handler int ad client id m ad client id ad client id ad_client_id translationhandler ad_client_id m_ad_client_id ad_client_id receive notification of the start of an element param uri namespace param local name simple name param q name qualified name param attributes attributes throws org xml sax sax exception public void start element string uri string local name string q name attributes attributes throws org xml sax sax exception log fine translation handler start element q name uri local name if q name equals translation xml tag m ad language attributes get value translation xml attribute language m isbaselanguage language is base language m ad language m tablename attributes get value translation xml attribute table m updatesql update m tablename if m isbaselanguage m updatesql trl m updatesql set log fine ad language m ad language base m isbaselanguage table name m tablename else if q name equals translation xml row tag m curid attributes get value translation xml row attribute id m trl attributes get value translation xml row attribute translated log finest id m curid m sql new string buffer else if q name equals translation xml value tag m curcolumnname attributes get value translation xml value attribute column log finest column name m curcolname else log severe unknown tag q name m curvalue new string buffer localname qname saxexception startelement localname qname saxexception translationhandler startelement qname localname qname xml_tag m_ad_language getvalue xml_attribute_language m_isbaselanguage isbaselanguage m_ad_language m_tablename getvalue xml_attribute_table m_updatesql m_tablename m_isbaselanguage m_updatesql _trl m_updatesql ad_language m_ad_language m_isbaselanguage tablename m_tablename qname xml_row_tag m_curid getvalue xml_row_attribute_id m_trl getvalue xml_row_attribute_translated m_curid m_sql stringbuffer qname xml_value_tag m_curcolumnname getvalue xml_value_attribute_column columnname m_curcolname qname m_curvalue stringbuffer receive notification of character data inside an element param ch buffer param start start param length length throws sax exception public void characters char ch int start int length throws sax exception m curvalue append ch start length log trace log l6 database 1 translation handler characters m curvalue to string saxexception saxexception m_curvalue l6_database translationhandler m_curvalue tostring receive notification of the end of an element param uri namespace param local name simple name param q name qualified name throws sax exception public void end element string uri string local name string q name throws sax exception log trace log l6 database 1 translation handler end element q name if q name equals translation xml tag else if q name equals translation xml row tag set section if m sql length 0 m sql append m sql append updated append db to date m time false if m isbaselanguage if m trl null y equals m trl n equals m trl m sql append is translated append m trl append else m sql append is translated y where section m sql append where append m tablename append id append m curid if m isbaselanguage m sql append and ad language append m ad language append if m ad client id 0 m sql append and ad client id append m ad client id update section m sql insert 0 m updatesql execute int no db execute update m sql to string null if no 1 if c log mgt is level finest log fine m sql to string m updatecount else if no 0 log warning not found m sql to string else log severe update rows no should be 1 m sql to string else if q name equals translation xml value tag if m sql length 0 m sql append m sql append m curcolumnname append append db to string m curvalue to string localname qname saxexception endelement localname qname saxexception l6_database translationhandler endelement qname qname xml_tag qname xml_row_tag m_sql m_sql m_sql to_date m_time m_isbaselanguage m_trl m_trl m_trl m_sql istranslated m_trl m_sql istranslated m_sql m_tablename _id m_curid m_isbaselanguage m_sql ad_language m_ad_language m_ad_client_id m_sql ad_client_id m_ad_client_id m_sql m_updatesql executeupdate m_sql tostring clogmgt islevelfinest m_sql tostring m_updatecount m_sql tostring m_sql tostring qname xml_value_tag m_sql m_sql m_sql m_curcolumnname to_string m_curvalue tostring get number of updates return update count public int get update count return m updatecount getupdatecount m_updatecount set ui directory to servlet init param public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w start init servletconfig servletexception webenv initweb servletexception wstart process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web util create login page request response this null null doget httpservletrequest httpservletresponse servletexception ioexception webutil createloginpage process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception do get request response dopost httpservletrequest httpservletresponse servletexception ioexception doget standard constructor you must implement this constructor for compiere persistency param ctx context param id the primary key id public my model example properties ctx int id string trx name super ctx id trx name mymodelexample trxname trxname optional load constructor you would use this constructor to load several business objects code select from my model example where code param ctx context param rs result set public my model example properties ctx result set rs string trx name super ctx rs trx name mymodelexample mymodelexample resultset trxname trxname init persistent object you would not create this method as it is created by the persistency class generated by generate model java param ctx context return po information protected po info initpo properties ctx return null generatemodel poinfo get access level return access level protected int get accesslevel return 0 get_accesslevel constructor param ctx context param ad printfont id id private m print font properties ctx int ad printfont id string trx name super ctx ad printfont id trx name if ad printfont id 0 set is default false ad_printfont_id mprintfont ad_printfont_id trxname ad_printfont_id trxname ad_printfont_id setisdefault get font return font public font get font if m cachefont null return m cachefont string code string get value code if code null code equals m cachefont new font null try if code null code equals fontfamilyname style pointsize m cachefont font decode code catch exception e log log level severe m print font get font e if code null m cachefont new font null family dialog name dialog style plain size 12 log fine m print font get font code m cachefont return m cachefont getfont m_cachefont m_cachefont get_value m_cachefont m_cachefont mprintfont getfont m_cachefont mprintfont getfont m_cachefont m_cachefont set font param font font public void set font font font fontfamilyname style pointsize string buffer sb new string buffer sb append font get family append int style font get style if style font plain sb append plain else if style font bold sb append bold else if style font italic sb append italic else if style font bold font italic sb append bolditalic sb append append font get size set code sb to string setfont stringbuffer stringbuffer getfamily getstyle getsize setcode tostring create font in database and save param font font return print font static m print font create font font m print font pf new m print font env get ctx 0 null string buffer name new string buffer font get name if font is bold name append bold if font is italic name append italic name append append font get size pf set name name to string pf set font font pf save return pf printfont mprintfont mprintfont mprintfont getctx stringbuffer stringbuffer getname isbold isitalic getsize setname tostring setfont string representation return info public string to string string buffer sb new string buffer m print font sb append id append get id append name append get name append ps name append get font getps name append get font append return sb to string tostring stringbuffer stringbuffer mprintfont get_id getname psname getfont getpsname getfont tostring get post script level 2 definition e g dialog 12 selectfont return post script command public string tops string buffer sb new string buffer sb append get font getps name if get font is bold sb append bold if get font is italic sb append italic sb append append get font get size append selectfont return sb to string postscript postscript stringbuffer stringbuffer getfont getpsname getfont isbold getfont isitalic getfont getsize tostring dump font param font font static void dump font font system out println family font get family system out println font name font get font name system out println name font get name system out println ps name font getps name system out println style font get style system out println size font get size system out println attributes map map font get attributes iterator keys map key set iterator while keys has next object key keys next object value map get key system out println key value system out println font getfamily fontname getfontname getname psname getpsname getstyle getsize getattributes keyset hasnext get font param ad printfont id id return font static public m print font get int ad printfont id integer key new integer ad printfont id m print font pf m print font s fonts get key if pf null pf new m print font env get ctx ad printfont id null s fonts put key pf return pf ad_printfont_id mprintfont ad_printfont_id ad_printfont_id mprintfont mprintfont s_fonts mprintfont getctx ad_printfont_id s_fonts seed fonts param args args public static void main string args system out println available fonts string family graphics environment get local graphics environment get available font family names for int i 0 i family length i system out println family i org compiere compiere startup true m print font pf new m print font env get ctx 100 null dump pf get font string system locical new string dialog dialog input monospaced serif sans serif for int i 0 i system locical length i create new font system locical i font bold 13 create new font system locical i font plain 11 create new font system locical i font bold 11 create new font system locical i font italic 11 create new font system locical i font plain 10 create new font system locical i font bold 10 create new font system locical i font italic 10 create new font system locical i font plain 9 create new font system locical i font bold 9 create new font system locical i font italic 9 create new font system locical i font plain 8 create new font system locical i font bold 8 create new font system locical i font italic 8 read all fonts int i ds po get alli ds ad printfont null null for int i 0 i i ds length i pf new m print font env get ctx i ds i null system out println i ds i pf get font graphicsenvironment getlocalgraphicsenvironment getavailablefontfamilynames mprintfont mprintfont getctx getfont systemlocical dialoginput sansserif systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical systemlocical ids getallids ad_printfont ids mprintfont getctx ids ids getfont standard constructor public x ad process properties ctx int ad process id string trx name super ctx ad process id trx name if ad process id 0 setad process id 0 set access level null set entity type null u set is beta functionality false set is report false set is server process false set name null set value null x_ad_process ad_process_id trxname ad_process_id trxname ad_process_id setad_process_id setaccesslevel setentitytype setisbetafunctionality setisreport setisserverprocess setname setvalue load constructor public x ad process properties ctx result set rs string trx name super ctx rs trx name x_ad_process resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad process append get id append return sb to string tostring stringbuffer stringbuffer x_ad_process get_id tostring set print format data print format public void setad printformat id int ad printformat id if ad printformat id 0 set value ad printformat id null else set value ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id set_value ad_printformat_id set_value ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set process process or report public void setad process id int ad process id if ad process id 1 throw new illegal argument exception ad process id is mandatory set valuenocheck ad process id new integer ad process id setad_process_id ad_process_id ad_process_id illegalargumentexception ad_process_id set_valuenocheck ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set report view view used to generate this report public void setad reportview id int ad reportview id if ad reportview id 0 set value ad reportview id null else set value ad reportview id new integer ad reportview id setad_reportview_id ad_reportview_id ad_reportview_id set_value ad_reportview_id set_value ad_reportview_id ad_reportview_id get report view view used to generate this report public int getad reportview id integer ii integer get value ad reportview id if ii null return 0 return ii int value getad_reportview_id get_value ad_reportview_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 0 set value ad workflow id null else set value ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id set_value ad_workflow_id set_value ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue public static final string accesslevel all 7 set data access level access level required public void set access level string access level if access level null throw new illegal argument exception access level is mandatory if access level equals 1 access level equals 2 access level equals 3 access level equals 4 access level equals 6 access level equals 7 else throw new illegal argument exception access level invalid value access level reference id 5 1 2 3 4 6 7 if access level length 1 log warning length 1 truncated access level access level substring 0 0 set value access level access level accesslevel_all setaccesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel reference_id accesslevel accesslevel accesslevel set_value accesslevel accesslevel get data access level access level required public string get access level return string get value access level getaccesslevel get_value accesslevel set classname java classname public void set classname string classname if classname null classname length 60 log warning length 60 truncated classname classname substring 0 59 set value classname classname setclassname set_value get classname java classname public string get classname return string get value classname getclassname get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set beta functionality this functionality is considered beta public void set is beta functionality boolean is beta functionality set value is beta functionality new boolean is beta functionality setisbetafunctionality isbetafunctionality set_value isbetafunctionality isbetafunctionality get beta functionality this functionality is considered beta public boolean is beta functionality object oo get value is beta functionality if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbetafunctionality get_value isbetafunctionality booleanvalue set direct print print without dialog public void set is direct print boolean is direct print set value is direct print new boolean is direct print setisdirectprint isdirectprint set_value isdirectprint isdirectprint get direct print print without dialog public boolean is direct print object oo get value is direct print if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdirectprint get_value isdirectprint booleanvalue set report indicates a report record public void set is report boolean is report set value is report new boolean is report setisreport isreport set_value isreport isreport get report indicates a report record public boolean is report object oo get value is report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreport get_value isreport booleanvalue set server process run this process on server only public void set is server process boolean is server process set value is server process new boolean is server process setisserverprocess isserverprocess set_value isserverprocess isserverprocess get server process run this process on server only public boolean is server process object oo get value is server process if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isserverprocess get_value isserverprocess booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set procedure name of the database procedure public void set procedure name string procedure name if procedure name null procedure name length 60 log warning length 60 truncated procedure name procedure name substring 0 59 set value procedure name procedure name setprocedurename procedurename procedurename procedurename procedurename procedurename set_value procedurename procedurename get procedure name of the database procedure public string get procedure name return string get value procedure name getprocedurename get_value procedurename set statistic count internal statistics how often the entity was used public void setstatistic count int statistic count set value statistic count new integer statistic count setstatistic_count statistic_count set_value statistic_count statistic_count get statistic count internal statistics how often the entity was used public int getstatistic count integer ii integer get value statistic count if ii null return 0 return ii int value getstatistic_count get_value statistic_count intvalue set statistic seconds internal statistics how many seconds a process took public void setstatistic seconds int statistic seconds set value statistic seconds new integer statistic seconds setstatistic_seconds statistic_seconds set_value statistic_seconds statistic_seconds get statistic seconds internal statistics how many seconds a process took public int getstatistic seconds integer ii integer get value statistic seconds if ii null return 0 return ii int value getstatistic_seconds get_value statistic_seconds intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue set workflow key key of the workflow to start public void set workflow value string workflow value if workflow value null workflow value length 40 log warning length 40 truncated workflow value workflow value substring 0 39 set value workflow value workflow value setworkflowvalue workflowvalue workflowvalue workflowvalue workflowvalue workflowvalue set_value workflowvalue workflowvalue get workflow key key of the workflow to start public string get workflow value return string get value workflow value getworkflowvalue get_value workflowvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals e mailpdf p emailpdf y equals para i get parameter else if name equals r mailtext id p r mailtext id para i get parameter as int else if name equals c dunningrun id p c dunningrun id para i get parameter as int else if name equals is only ifbp balance p isonlyifbpbalance y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter emailpdf p_emailpdf getparameter r_mailtext_id p_r_mailtext_id getparameterasint c_dunningrun_id p_c_dunningrun_id getparameterasint isonlyifbpbalance p_isonlyifbpbalance getparameter pocess return info throws exception protected string do it throws exception log info c dunningrun id p c dunningrun id r mailtext id p r mailtext id emailpdf p emailpdf is only ifbp balance p isonlyifbpbalance need to have template if p emailpdf p r mailtext id 0 throw new compiere user error not found r mailtext id string subject m mail text m text null if p emailpdf m text new m mail text get ctx p r mailtext id get trxname if p emailpdf m text get id 0 throw new compiere user error not found r mailtext id p r mailtext id subject m text get mail header m dunning run run new m dunning run get ctx p c dunningrun id get trxname if run get id 0 throw new compiere user error not found c dunningrun id p c dunningrun id print format on dunning level m dunning level level new m dunning level get ctx run getc dunninglevel id get trxname m print format format m print format get get ctx level getdunning printformat id false m client client m client get get ctx int count 0 int errors 0 m dunning run entry entries run get entries false for int i 0 i entries length i m dunning run entry entry entries i if p isonlyifbpbalance entry get amt signum 0 continue to b partner mb partner bp new mb partner get ctx entry getc bpartner id get trxname if bp get id 0 add log entry get id null null not found c bpartner id entry getc bpartner id errors continue to user m user to new m user get ctx entry getad user id get trxname if p emailpdf if to get id 0 add log entry get id null null not found ad user id bp get name errors continue else if to gete mail null to gete mail length 0 add log entry get id null null not found e mail to get name errors continue bp language language language language get login language base language string table name c dunning header v if client is multi lingual document table name t string ad language bp getad language if ad language null language language get language ad language format set language language format set translation language language query m query query new m query table name query add restriction c dunningrunentry id m query equal new integer entry getc dunningrunentry id engine print info info new print info bp get name x c dunningrunentry table id entry getc dunningrunentry id entry getc bpartner id info set description bp get name amt entry get amt report engine re new report engine get ctx format query info boolean printed false if p emailpdf e mail email client createe mail to gete mail null null if email is valid add log entry get id null null request actione mail error invalid e mail to errors continue m text set user to variable context m text setb partner bp m text setpo entry string message m text get mail text true if m text is html email set messagehtml m text get mail header message else email set subject m text get mail header email set message text message file attachment re getpdf file create temp file dunning pdf log fine to attachment email add attachment attachment string msg email send m user mail um new m user mail m text entry getad user id email um save if msg equals e mail sent ok add log entry get id null null bp get name request actione mailok count printed true else add log entry get id null null bp get name request actione mail error msg errors else re print count printed true for all dunning letters if p emailpdf return sent count errors errors return printed count doit c_dunningrun_id p_c_dunningrun_id r_mailtext_id p_r_mailtext_id p_emailpdf isonlyifbpbalance p_isonlyifbpbalance p_emailpdf p_r_mailtext_id compiereusererror notfound r_mailtext_id mmailtext mtext p_emailpdf mtext mmailtext getctx p_r_mailtext_id get_trxname p_emailpdf mtext get_id compiereusererror notfound r_mailtext_id p_r_mailtext_id mtext getmailheader mdunningrun mdunningrun getctx p_c_dunningrun_id get_trxname get_id compiereusererror notfound c_dunningrun_id p_c_dunningrun_id mdunninglevel mdunninglevel getctx getc_dunninglevel_id get_trxname mprintformat mprintformat getctx getdunning_printformat_id mclient mclient getctx mdunningrunentry getentries mdunningrunentry p_isonlyifbpbalance getamt bpartner mbpartner mbpartner getctx getc_bpartner_id get_trxname get_id addlog get_id notfound c_bpartner_id getc_bpartner_id muser muser getctx getad_user_id get_trxname p_emailpdf get_id addlog get_id notfound ad_user_id getname getemail getemail addlog get_id notfound email getname getloginlanguage tablename c_dunning_header_v ismultilingualdocument tablename ad_language getad_language ad_language getlanguage ad_language setlanguage settranslationlanguage mquery mquery tablename addrestriction c_dunningrunentry_id mquery getc_dunningrunentry_id printinfo printinfo getname x_c_dunningrunentry table_id getc_dunningrunentry_id getc_bpartner_id setdescription getname getamt reportengine reportengine getctx p_emailpdf email createemail getemail isvalid addlog get_id requestactionemailerror email mtext setuser mtext setbpartner mtext mtext getmailtext mtext ishtml setmessagehtml mtext getmailheader setsubject mtext getmailheader setmessagetext createtempfile addattachment musermail musermail mtext getad_user_id email sent_ok addlog get_id getname requestactionemailok addlog get_id getname requestactionemailerror p_emailpdf standard constructor public x c bp edi properties ctx int c bp edi id string trx name super ctx c bp edi id trx name if c bp edi id 0 setad sequence id 0 setc bp edi id 0 setc bpartner id 0 set customer no null setedi type null setemail error to null setemail info to null set is audited false set is info sent false setm warehouse id 0 set name null set receive inquiry reply false set receive order reply false set send inquiry false set send order false x_c_bp_edi c_bp_edi_id trxname c_bp_edi_id trxname c_bp_edi_id setad_sequence_id setc_bp_edi_id setc_bpartner_id setcustomerno seteditype setemail_error_to setemail_info_to setisaudited setisinfosent setm_warehouse_id setname setreceiveinquiryreply setreceiveorderreply setsendinquiry setsendorder load constructor public x c bp edi properties ctx result set rs string trx name super ctx rs trx name x_c_bp_edi resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp edi append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_edi get_id tostring public static final int ad sequence id ad reference id 128 set sequence document sequence public void setad sequence id int ad sequence id if ad sequence id 1 throw new illegal argument exception ad sequence id is mandatory set value ad sequence id new integer ad sequence id ad_sequence_id_ad_reference_id setad_sequence_id ad_sequence_id ad_sequence_id illegalargumentexception ad_sequence_id set_value ad_sequence_id ad_sequence_id get sequence document sequence public int getad sequence id integer ii integer get value ad sequence id if ii null return 0 return ii int value getad_sequence_id get_value ad_sequence_id intvalue set edi definition electronic data interchange public void setc bp edi id int c bp edi id if c bp edi id 1 throw new illegal argument exception c bp edi id is mandatory set valuenocheck c bp edi id new integer c bp edi id setc_bp_edi_id c_bp_edi_id c_bp_edi_id illegalargumentexception c_bp_edi_id set_valuenocheck c_bp_edi_id c_bp_edi_id get edi definition electronic data interchange public int getc bp edi id integer ii integer get value c bp edi id if ii null return 0 return ii int value getc_bp_edi_id get_value c_bp_edi_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set customer no edi identification number public void set customer no string customer no if customer no null throw new illegal argument exception customer no is mandatory if customer no length 20 log warning length 20 truncated customer no customer no substring 0 19 set value customer no customer no setcustomerno customerno customerno illegalargumentexception customerno customerno customerno customerno set_value customerno customerno get customer no edi identification number public string get customer no return string get value customer no getcustomerno get_value customerno set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string editype ascx12 x set edi type public void setedi type string edi type if edi type null throw new illegal argument exception edi type is mandatory if edi type equals e edi type equals m edi type equals x else throw new illegal argument exception edi type invalid value edi type reference id 201 e m x if edi type length 1 log warning length 1 truncated edi type edi type substring 0 0 set value edi type edi type editype_ascx12 seteditype editype editype illegalargumentexception editype editype editype editype illegalargumentexception editype editype reference_id editype editype editype set_value editype editype get edi type public string getedi type return string get value edi type geteditype get_value editype set error e mail email address to send error messages to public void setemail error to string email error to if email error to null throw new illegal argument exception email error to is mandatory if email error to length 60 log warning length 60 truncated email error to email error to substring 0 59 set value email error to email error to email setemail_error_to email_error_to email_error_to illegalargumentexception email_error_to email_error_to email_error_to email_error_to set_value email_error_to email_error_to get error e mail email address to send error messages to public string getemail error to return string get value email error to email getemail_error_to get_value email_error_to set from e mail full e mail address used to send requests e g edi organization com public void setemail from string email from if email from null email from length 60 log warning length 60 truncated email from email from substring 0 59 set value email from email from email email setemail_from email_from email_from email_from email_from email_from set_value email_from email_from get from e mail full e mail address used to send requests e g edi organization com public string getemail from return string get value email from email email getemail_from get_value email_from set from e mail password password of the sending e mail address public void setemail from pwd string email from pwd if email from pwd null email from pwd length 20 log warning length 20 truncated email from pwd email from pwd substring 0 19 set value email from pwd email from pwd email email setemail_from_pwd email_from_pwd email_from_pwd email_from_pwd email_from_pwd email_from_pwd set_value email_from_pwd email_from_pwd get from e mail password password of the sending e mail address public string getemail from pwd return string get value email from pwd email email getemail_from_pwd get_value email_from_pwd set from e mail user id user id of the sending e mail address on default smtp host e g edi public void setemail from uid string email from uid if email from uid null email from uid length 20 log warning length 20 truncated email from uid email from uid substring 0 19 set value email from uid email from uid email email setemail_from_uid email_from_uid email_from_uid email_from_uid email_from_uid email_from_uid set_value email_from_uid email_from_uid get from e mail user id user id of the sending e mail address on default smtp host e g edi public string getemail from uid return string get value email from uid email email getemail_from_uid get_value email_from_uid set info e mail e mail address to send informational messages and copies public void setemail info to string email info to if email info to null throw new illegal argument exception email info to is mandatory if email info to length 60 log warning length 60 truncated email info to email info to substring 0 59 set value email info to email info to email email setemail_info_to email_info_to email_info_to illegalargumentexception email_info_to email_info_to email_info_to email_info_to set_value email_info_to email_info_to get info e mail e mail address to send informational messages and copies public string getemail info to return string get value email info to email email getemail_info_to get_value email_info_to set to e mail e mail address to send requests to e g edi manufacturer com public void setemail to string email to if email to null email to length 60 log warning length 60 truncated email to email to substring 0 59 set value email to email to email email setemail_to email_to email_to email_to email_to email_to set_value email_to email_to get to e mail e mail address to send requests to e g edi manufacturer com public string getemail to return string get value email to email email getemail_to get_value email_to set activate audit activate audit trail of what numbers are generated public void set is audited boolean is audited set value is audited new boolean is audited setisaudited isaudited set_value isaudited isaudited get activate audit activate audit trail of what numbers are generated public boolean is audited object oo get value is audited if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaudited get_value isaudited booleanvalue set send info send informational messages and copies public void set is info sent boolean is info sent set value is info sent new boolean is info sent setisinfosent isinfosent set_value isinfosent isinfosent get send info send informational messages and copies public boolean is info sent object oo get value is info sent if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinfosent get_value isinfosent booleanvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set received inquiry reply public void set receive inquiry reply boolean receive inquiry reply set value receive inquiry reply new boolean receive inquiry reply setreceiveinquiryreply receiveinquiryreply set_value receiveinquiryreply receiveinquiryreply get received inquiry reply public boolean is receive inquiry reply object oo get value receive inquiry reply if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreceiveinquiryreply get_value receiveinquiryreply booleanvalue set receive order reply public void set receive order reply boolean receive order reply set value receive order reply new boolean receive order reply setreceiveorderreply receiveorderreply set_value receiveorderreply receiveorderreply get receive order reply public boolean is receive order reply object oo get value receive order reply if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreceiveorderreply get_value receiveorderreply booleanvalue set send inquiry quantity availability inquiry public void set send inquiry boolean send inquiry set value send inquiry new boolean send inquiry setsendinquiry sendinquiry set_value sendinquiry sendinquiry get send inquiry quantity availability inquiry public boolean is send inquiry object oo get value send inquiry if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issendinquiry get_value sendinquiry booleanvalue set send order public void set send order boolean send order set value send order new boolean send order setsendorder sendorder set_value sendorder sendorder get send order public boolean is send order object oo get value send order if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issendorder get_value sendorder booleanvalue standard constructor public x a registrationproduct properties ctx int a registrationproduct id string trx name super ctx a registrationproduct id trx name if a registrationproduct id 0 seta registrationattribute id 0 setm product id 0 x_a_registrationproduct a_registrationproduct_id trxname a_registrationproduct_id trxname a_registrationproduct_id seta_registrationattribute_id setm_product_id load constructor public x a registrationproduct properties ctx result set rs string trx name super ctx rs trx name x_a_registrationproduct resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a registrationproduct append get id append return sb to string tostring stringbuffer stringbuffer x_a_registrationproduct get_id tostring set registration attribute asset registration attribute public void seta registrationattribute id int a registrationattribute id if a registrationattribute id 1 throw new illegal argument exception a registrationattribute id is mandatory set valuenocheck a registrationattribute id new integer a registrationattribute id seta_registrationattribute_id a_registrationattribute_id a_registrationattribute_id illegalargumentexception a_registrationattribute_id set_valuenocheck a_registrationattribute_id a_registrationattribute_id get registration attribute asset registration attribute public int geta registrationattribute id integer ii integer get value a registrationattribute id if ii null return 0 return ii int value geta_registrationattribute_id get_value a_registrationattribute_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue constructor public web basket webbasket string representation return info public string to string string buffer sb new string buffer web basket lines sb append m lines size append total append m total append m pricelist id m pricelist id append return sb to string tostring stringbuffer stringbuffer webbasket m_lines m_total m_pricelist_id m_pricelist_id tostring get total return total public big decimal get total return get total false bigdecimal gettotal gettotal get recalculated total return total public big decimal get total boolean recalc if recalc m total env zero for int i 0 i m lines size i web basket line wbl web basket line m lines get i m total m total add wbl get total if m total null return env zero return m total bigdecimal gettotal m_total m_lines webbasketline webbasketline m_lines m_total m_total gettotal m_total m_total get line count return line count public int get line count return m lines size getlinecount m_lines get lines return lines public array list get lines return m lines arraylist getlines m_lines add line param wbl line return added line public web basket line add web basket line wbl wbl set line m lineno m lines add wbl get total true return wbl webbasketline webbasketline setline m_lineno m_lines gettotal add line adds qty to the line if same product param m product id product param name name param qty qty param price price return created modified line public web basket line add int m product id string name big decimal qty big decimal price try adding to existing line for int i 0 i m lines size i web basket line wbl web basket line m lines get i if wbl getm product id m product id wbl add quantity qty get total true return wbl new line web basket line wbl new web basket line m product id name qty price return add wbl m_product_id webbasketline m_product_id bigdecimal bigdecimal m_lines webbasketline webbasketline m_lines getm_product_id m_product_id addquantity gettotal webbasketline webbasketline m_product_id delete line param no line no public void delete int no for int i 0 i m lines size i web basket line wbl web basket line m lines get i if wbl get line no m lines remove i get total true break m_lines webbasketline webbasketline m_lines getline m_lines gettotal public int getm pricelist version id return m pricelist version id getm_pricelist_version_id m_pricelist_version_id public void setm pricelist version id int pricelist version id if pricelist version id 0 m pricelist version id pricelist version id setm_pricelist_version_id pricelist_version_id pricelist_version_id m_pricelist_version_id pricelist_version_id public int getm pricelist id return m pricelist id getm_pricelist_id m_pricelist_id public void setm pricelist id int pricelist id if pricelist id 0 m pricelist id pricelist id setm_pricelist_id pricelist_id pricelist_id m_pricelist_id pricelist_id return returns the salesrep id public int getsalesrep id return m salesrep id salesrep_id getsalesrep_id m_salesrep_id param salesrep id the salesrep id to set public void setsalesrep id int salesrep id m salesrep id salesrep id salesrep_id salesrep_id setsalesrep_id salesrep_id m_salesrep_id salesrep_id standard constructor param ctx context param c projectissue id id public m project issue properties ctx int c projectissue id string trx name super ctx c projectissue id trx name if c projectissue id 0 setc project id 0 set line 0 setm locator id 0 setm product id 0 set movement date new timestamp system current time millis set movement qty env zero set posted false set processed false c_projectissue_id mprojectissue c_projectissue_id trxname c_projectissue_id trxname c_projectissue_id setc_project_id setline setm_locator_id setm_product_id setmovementdate currenttimemillis setmovementqty setposted setprocessed load constructor param ctx context param rs result set public m project issue properties ctx result set rs string trx name super ctx rs trx name mprojectissue resultset trxname trxname new parent constructor param project parent public m project issue m project project this project get ctx 0 project get trxname set client org project getad client id project getad org id setc project id project getc project id parent set line get next line setm locator id 0 setm product id 0 set movement date new timestamp system current time millis set movement qty env zero set posted false set processed false mprojectissue mproject getctx get_trxname setclientorg getad_client_id getad_org_id setc_project_id getc_project_id setline getnextline setm_locator_id setm_product_id setmovementdate currenttimemillis setmovementqty setposted setprocessed get the next line no return next line no private int get next line return db getsql value get trxname select coalesce max line 0 10 from c projectissue where c project id getc project id getnextline getsqlvalue get_trxname c_projectissue c_project_id getc_project_id set mandatory values param m locator id locator param m product id product param movement qty qty public void set mandatory int m locator id int m product id big decimal movement qty setm locator id m locator id setm product id m product id set movement qty movement qty m_locator_id m_product_id movementqty setmandatory m_locator_id m_product_id bigdecimal movementqty setm_locator_id m_locator_id setm_product_id m_product_id setmovementqty movementqty process issue return true if processed public boolean process if save return false if getm product id 0 log log level severe process no product return false m product product m product get get ctx getm product id if not a stocked item nothing to do if product is stocked set processed true return save todo transaction create material transactions m transaction m trx new m transaction get ctx m transaction movementtype workorderplus getm locator id getm product id getm attributesetinstance id get movement qty negate get movement date get trxname m trx setc projectissue id getc projectissue id m locator loc m locator get get ctx getm locator id if m storage add get ctx loc getm warehouse id getm locator id getm product id getm attributesetinstance id getm attributesetinstance id get movement qty negate null null get trxname if m trx save get trxname set processed true if save return true else log log level severe issue not saved requires trx else log log level severe transaction not saved requires trx else log log level severe storage not updated ok return false getm_product_id mproduct mproduct getctx getm_product_id isstocked setprocessed mtransaction mtrx mtransaction getctx mtransaction movementtype_workorderplus getm_locator_id getm_product_id getm_attributesetinstance_id getmovementqty getmovementdate get_trxname mtrx setc_projectissue_id getc_projectissue_id mlocator mlocator getctx getm_locator_id mstorage getctx getm_warehouse_id getm_locator_id getm_product_id getm_attributesetinstance_id getm_attributesetinstance_id getmovementqty get_trxname mtrx get_trxname setprocessed create info column r o and not color column param col header column header param colsql sql select code for column param col class class of column determines display public column info string col header string colsql class col class this col header colsql col class true false null colheader colclass columninfo colheader colclass colheader colclass create info column r o and not color column param col header column header param colsql sql select code for column param col class class of column determines display param key pair colsql sql select for the id of the for the displayed column public column info string col header string colsql class col class string key pair colsql this col header colsql col class true false key pair colsql colheader colclass keypaircolsql columninfo colheader colclass keypaircolsql colheader colclass keypaircolsql create info column param col header column header param colsql sql select code for column param col class class of column determines display param read only column is read only param color column if true value of column determines foreground color param key pair colsql sql select for the id of the for the displayed column public column info string col header string colsql class col class boolean read only boolean color column string key pair colsql set col header col header set colsql colsql set col class col class set read only read only set color column color column set key pair colsql key pair colsql colheader colclass readonly colorcolumn keypaircolsql columninfo colheader colclass readonly colorcolumn keypaircolsql setcolheader colheader setcolsql setcolclass colclass setreadonly readonly setcolorcolumn colorcolumn setkeypaircolsql keypaircolsql private string m keypaircolsql public class get col class return m colclass m_keypaircolsql getcolclass m_colclass return m colclass public string get col header return m colheader m_colclass getcolheader m_colheader return m colheader public string get colsql return m colsql m_colheader getcolsql m_colsql return m colsql public boolean is read only return m readonly m_colsql isreadonly m_readonly return m readonly public void set col class class col class m colclass col class m_readonly setcolclass colclass m_colclass colclass m colclass col class public void set col header string col header m colheader col header m_colclass colclass setcolheader colheader m_colheader colheader m colheader col header public void set colsql string colsql m colsql colsql m_colheader colheader setcolsql m_colsql m colsql colsql public void set read only boolean read only m readonly read only m_colsql setreadonly readonly m_readonly readonly m readonly read only public void set color column boolean color column m colorcolumn color column m_readonly readonly setcolorcolumn colorcolumn m_colorcolumn colorcolumn m colorcolumn color column public boolean is color column return m colorcolumn m_colorcolumn colorcolumn iscolorcolumn m_colorcolumn add id column sql for the displayed column the class for this should be key name pair param key pair colsql public void set key pair colsql string key pair colsql m keypaircolsql key pair colsql if m keypaircolsql null m keypaircolsql keynamepair keypaircolsql setkeypaircolsql keypaircolsql m_keypaircolsql keypaircolsql m_keypaircolsql m_keypaircolsql m keypaircolsql public string get key pair colsql return m keypaircolsql m_keypaircolsql getkeypaircolsql m_keypaircolsql return m keypaircolsql public boolean is key pair col return m keypaircolsql length 0 m_keypaircolsql iskeypaircol m_keypaircolsql standard constructor public x gl distribution properties ctx int gl distribution id string trx name super ctx gl distribution id trx name if gl distribution id 0 set any acct true y set any activity true y set anyb partner true y set any campaign true y set any loc from true y set any loc to true y set any org true y set any org trx true y set any product true y set any project true y set any sales region true y set any user1 true y set any user2 true y setc acctschema id 0 setgl distribution id 0 set is valid false n set name null set percent total env zero x_gl_distribution gl_distribution_id trxname gl_distribution_id trxname gl_distribution_id setanyacct setanyactivity setanybpartner setanycampaign setanylocfrom setanylocto setanyorg setanyorgtrx setanyproduct setanyproject setanysalesregion setanyuser1 setanyuser2 setc_acctschema_id setgl_distribution_id setisvalid setname setpercenttotal load constructor public x gl distribution properties ctx result set rs string trx name super ctx rs trx name x_gl_distribution resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl distribution append get id append return sb to string tostring stringbuffer stringbuffer x_gl_distribution get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue public static final int account id ad reference id 132 set account account used public void setaccount id int account id if account id 0 set value account id null else set value account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id set_value account_id set_value account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set any account match any value of the account segment public void set any acct boolean any acct set value any acct new boolean any acct setanyacct anyacct set_value anyacct anyacct get any account match any value of the account segment public boolean is any acct object oo get value any acct if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyacct get_value anyacct booleanvalue set any activity match any value of the activity segment public void set any activity boolean any activity set value any activity new boolean any activity setanyactivity anyactivity set_value anyactivity anyactivity get any activity match any value of the activity segment public boolean is any activity object oo get value any activity if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyactivity get_value anyactivity booleanvalue set any bus partner match any value of the business partner segment public void set anyb partner boolean anyb partner set value anyb partner new boolean anyb partner setanybpartner anybpartner set_value anybpartner anybpartner get any bus partner match any value of the business partner segment public boolean is anyb partner object oo get value anyb partner if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanybpartner get_value anybpartner booleanvalue set any campaign match any value of the campaign segment public void set any campaign boolean any campaign set value any campaign new boolean any campaign setanycampaign anycampaign set_value anycampaign anycampaign get any campaign match any value of the campaign segment public boolean is any campaign object oo get value any campaign if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanycampaign get_value anycampaign booleanvalue set any location from match any value of the location from segment public void set any loc from boolean any loc from set value any loc from new boolean any loc from setanylocfrom anylocfrom set_value anylocfrom anylocfrom get any location from match any value of the location from segment public boolean is any loc from object oo get value any loc from if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanylocfrom get_value anylocfrom booleanvalue set any location to match any value of the location to segment public void set any loc to boolean any loc to set value any loc to new boolean any loc to setanylocto anylocto set_value anylocto anylocto get any location to match any value of the location to segment public boolean is any loc to object oo get value any loc to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanylocto get_value anylocto booleanvalue set any organization match any value of the organization segment public void set any org boolean any org set value any org new boolean any org setanyorg anyorg set_value anyorg anyorg get any organization match any value of the organization segment public boolean is any org object oo get value any org if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyorg get_value anyorg booleanvalue set any trx organization match any value of the transaction organization segment public void set any org trx boolean any org trx set value any org trx new boolean any org trx setanyorgtrx anyorgtrx set_value anyorgtrx anyorgtrx get any trx organization match any value of the transaction organization segment public boolean is any org trx object oo get value any org trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyorgtrx get_value anyorgtrx booleanvalue set any product match any value of the product segment public void set any product boolean any product set value any product new boolean any product setanyproduct anyproduct set_value anyproduct anyproduct get any product match any value of the product segment public boolean is any product object oo get value any product if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyproduct get_value anyproduct booleanvalue set any project match any value of the project segment public void set any project boolean any project set value any project new boolean any project setanyproject anyproject set_value anyproject anyproject get any project match any value of the project segment public boolean is any project object oo get value any project if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyproject get_value anyproject booleanvalue set any sales region match any value of the sales region segment public void set any sales region boolean any sales region set value any sales region new boolean any sales region setanysalesregion anysalesregion set_value anysalesregion anysalesregion get any sales region match any value of the sales region segment public boolean is any sales region object oo get value any sales region if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanysalesregion get_value anysalesregion booleanvalue set any user 1 match any value of the user 1 segment public void set any user1 boolean any user1 set value any user1 new boolean any user1 setanyuser1 anyuser1 set_value anyuser1 anyuser1 get any user 1 match any value of the user 1 segment public boolean is any user1 object oo get value any user1 if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyuser1 get_value anyuser1 booleanvalue set any user 2 match any value of the user 2 segment public void set any user2 boolean any user2 set value any user2 new boolean any user2 setanyuser2 anyuser2 set_value anyuser2 anyuser2 get any user 2 match any value of the user 2 segment public boolean is any user2 object oo get value any user2 if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isanyuser2 get_value anyuser2 booleanvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set value c locfrom id null else set value c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_value c_locfrom_id set_value c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set value c locto id null else set value c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_value c_locto_id set_value c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gl distribution general ledger distribution public void setgl distribution id int gl distribution id if gl distribution id 1 throw new illegal argument exception gl distribution id is mandatory set valuenocheck gl distribution id new integer gl distribution id setgl_distribution_id gl_distribution_id gl_distribution_id illegalargumentexception gl_distribution_id set_valuenocheck gl_distribution_id gl_distribution_id get gl distribution general ledger distribution public int getgl distribution id integer ii integer get value gl distribution id if ii null return 0 return ii int value getgl_distribution_id get_value gl_distribution_id intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int org id ad reference id 130 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set total percent sum of the percent details public void set percent total big decimal percent total if percent total null throw new illegal argument exception percent total is mandatory set value percent total percent total setpercenttotal bigdecimal percenttotal percenttotal illegalargumentexception percenttotal set_value percenttotal percenttotal get total percent sum of the percent details public big decimal get percent total big decimal bd big decimal get value percent total if bd null return env zero return bd bigdecimal getpercenttotal bigdecimal bigdecimal get_value percenttotal public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type null posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type null posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue construct a new principal associated with the specified realm for the specified username and password with the specified role names as strings param name the username of the user represented by this principal param password credentials used to authenticate this user param roles list of roles must be strings possessed by this user public compiere principal string name string password list string roles super m name name m password password if roles null m roles new string roles size m roles string roles to array m roles if m roles length 0 arrays sort m roles compiereprincipal m_name m_password m_roles m_roles toarray m_roles m_roles m_roles get name return name public string get name return m name getname m_name get password return password string get password return m password getpassword m_password get roles return roles array string get roles return m roles getroles m_roles return a string representation of this object which exposes only information that should be public return info public string to string string buffer sb new string buffer compiere principal sb append m name append for int i 0 i m roles length i sb append m roles i append sb append return sb to string tostring stringbuffer stringbuffer compiereprincipal m_name m_roles m_roles tostring does the user represented by this principal possess the specified role param role role to be tested return true if has role public boolean has role string role if role null return false return arrays binary search m roles role 0 hasrole binarysearch m_roles standard constructor param ctx context param ad wf process id process public mwf process properties ctx int ad wf process id string trx name super ctx ad wf process id trx name if ad wf process id 0 throw new illegal argument exception cannot create new wf process directly m state new state engine getwf state ad_wf_process_id mwfprocess ad_wf_process_id trxname ad_wf_process_id trxname ad_wf_process_id illegalargumentexception m_state stateengine getwfstate load constructor param ctx context param rs result set public mwf process properties ctx result set rs string trx name super ctx rs trx name m state new state engine getwf state mwfprocess resultset trxname trxname m_state stateengine getwfstate new constructor param wf workflow param pi process info record id public mwf process m workflow wf process info pi throws exception super wf get ctx 0 wf get trxname if time util is valid wf get valid from wf get valid to throw new illegal state exception workflow not valid m wf wf m pi pi setad workflow id wf getad workflow id set priority wf get priority super setwf state wfstate notstarted document setad table id wf getad table id setrecord id pi getrecord id if getpo null set text msg no po with id pi getrecord id super setwf state wfstate terminated else set text msg getpo responsible user if wf getad wf responsible id 0 setad wf responsible id else setad wf responsible id wf getad wf responsible id setuser id pi getad user id user starting m state new state engine getwf state set processed false record_id mwfprocess mworkflow processinfo getctx get_trxname timeutil isvalid getvalidfrom getvalidto illegalstateexception m_wf m_pi setad_workflow_id getad_workflow_id setpriority getpriority setwfstate wfstate_notstarted setad_table_id getad_table_id setrecord_id getrecord_id settextmsg getrecord_id setwfstate wfstate_terminated settextmsg getad_wf_responsible_id setad_wf_responsible_id setad_wf_responsible_id getad_wf_responsible_id setuser_id getad_user_id m_state stateengine getwfstate setprocessed get active activities of process param requery if true requery return array of activities public mwf activity get activities boolean requery boolean only active if requery m activities null return m activities array list mwf activity list new array list mwf activity prepared statement pstmt null string sql select from ad wf activity where ad wf process id if only active sql and processed n try pstmt db prepare statement sql get trxname pstmt set int 1 getad wf process id result set rs pstmt execute query while rs next list add new mwf activity get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m activities new mwf activity list size list to array m activities return m activities mwfactivity getactivities onlyactive m_activities m_activities arraylist mwfactivity arraylist mwfactivity preparedstatement ad_wf_activity ad_wf_process_id onlyactive preparestatement get_trxname setint getad_wf_process_id resultset executequery mwfactivity getctx get_trxname m_activities mwfactivity toarray m_activities m_activities get state return state public state engine get state return m state stateengine getstate m_state get action options return array of valid actions public string get action options return m state get action options getactionoptions m_state getactionoptions set process state and update actions param wf state public void setwf state string wf state if m state null m state new state engine getwf state if m state is closed return if getwf state equals wf state return if m state is valid new state wf state log fine wf state super setwf state wf state m state new state engine getwf state if m state is closed set processed true save force close to all activities if m state is closed mwf activity activities get activities true true requery only active for int i 0 i activities length i if activities i is closed activities i set text msg process wf state activities i setwf state wf state if activities i is processed activities i set processed true activities i save closed else log log level severe ignored invalid transformation new wf state current getwf state wfstate setwfstate wfstate m_state m_state stateengine getwfstate m_state isclosed getwfstate wfstate m_state isvalidnewstate wfstate wfstate setwfstate wfstate m_state stateengine getwfstate m_state isclosed setprocessed m_state isclosed mwfactivity getactivities isclosed settextmsg wfstate setwfstate wfstate isprocessed setprocessed wfstate getwfstate check status of activities update process if required start new activity public void check activities log info getad workflow id getwf state if m state is closed return mwf activity activities get activities true true requery active string closed state null boolean suspended false boolean running false for int i 0 i activities length i mwf activity activity activities i state engine activity state activity get state completed start next if activity state is completed if start next activity activities continue string activitywf state activity getwf state if activity state is closed eliminate from active processed activity set processed true activity save if closed state null closed state activitywf state else if closed state equals activity state overwrite if terminated if wfstate terminated equals activity state closed state activitywf state overwrite if activity aborted and no other terminated else if wfstate aborted equals activity state wfstate terminated equals closed state closed state activitywf state else not closed closed state null all need to be closed if activity state is suspended suspended true if activity state is running running true for all activities if activities length 0 set text msg no active processed found closed state wfstate terminated if closed state null setwf state closed state else if suspended setwf state wfstate suspended else if running setwf state wfstate running checkactivities getad_workflow_id getwfstate m_state isclosed mwfactivity getactivities closedstate mwfactivity stateengine activitystate getstate activitystate iscompleted startnext activitywfstate getwfstate activitystate isclosed setprocessed closedstate closedstate activitywfstate closedstate activitystate wfstate_terminated activitystate closedstate activitywfstate wfstate_aborted activitystate wfstate_terminated closedstate closedstate activitywfstate closedstate activitystate issuspended activitystate isrunning settextmsg closedstate wfstate_terminated closedstate setwfstate closedstate setwfstate wfstate_suspended setwfstate wfstate_running start next activity param last last activity param activities all activities return true if there is a next activity private boolean start next mwf activity last mwf activity activities log fine last last transitions from the last processed node mwf node next transitions get workflow get node nexts last getad wf node id last getpo ad client id if transitions null transitions length 0 return false done we need to wait for last activity if mwf node joinelement and equals last get node get join element get previous nodes check if all have closed activities return false for all but the last eliminate from active processed last set processed true last save start next activity string split last get node get split element for int i 0 i transitions length i is this a valid transition if transitions i is valid for last continue start new activity mwf activity activity new mwf activity this transitions i getad wf next id new thread activity start only the first valid if xor if mwf node splitelement xor equals split return true for all transitions return true startnext mwfactivity mwfactivity mwfnodenext getworkflow getnodenexts getad_wf_node_id getpo_ad_client_id mwfnode joinelement_and getnode getjoinelement setprocessed getnode getsplitelement isvalidfor mwfactivity mwfactivity getad_wf_next_id mwfnode splitelement_xor set workflow responsible searches for a invoker public void setad wf responsible id int ad wf responsible id db getsql value null m role get default get ctx false add accesssql select ad wf responsible id from ad wf responsible where responsible type h and coalesce ad user id 0 0 order by ad client id desc ad wf responsible m role sql notqualified m role sql ro setad wf responsible id ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id getsqlvalue mrole getdefault getctx addaccesssql ad_wf_responsible_id ad_wf_responsible responsibletype ad_user_id ad_client_id ad_wf_responsible mrole sql_notqualified mrole sql_ro setad_wf_responsible_id ad_wf_responsible_id set user from 1 responsible 2 document sales rep 3 document updated by 4 process invoker param user id process invoker private void setuser id integer user id responsible mwf responsible resp mwf responsible get get ctx getad wf responsible id 1 user directly responsible int ad user id resp getad user id invoker get sales rep or last updater of document if ad user id 0 resp is invoker getpo 2 doc owner if m po null m po instanceof doc action doc action da doc action m po ad user id da getdoc user id 2 sales rep if ad user id 0 m po null m po get columnindex salesrep id 1 object sr m po get value salesrep id if sr null sr instanceof integer ad user id integer sr int value 3 updated by if ad user id 0 m po null ad user id m po get updated by 4 process owner if ad user id 0 user id null ad user id user id int value fallback if ad user id 0 ad user id env getad user id get ctx setad user id ad user id updatedby user_id setuser_id user_id mwfresponsible mwfresponsible getctx getad_wf_responsible_id ad_user_id getad_user_id ad_user_id isinvoker m_po m_po docaction docaction docaction m_po ad_user_id getdoc_user_id ad_user_id m_po m_po get_columnindex salesrep_id m_po get_value salesrep_id ad_user_id intvalue updatedby ad_user_id m_po ad_user_id m_po getupdatedby ad_user_id user_id ad_user_id user_id intvalue ad_user_id ad_user_id getad_user_id getctx setad_user_id ad_user_id get workflow return workflow private m workflow get workflow if m wf null m wf m workflow get get ctx getad workflow id if m wf get id 0 throw new illegal state exception not found ad workflow id getad workflow id return m wf mworkflow getworkflow m_wf m_wf mworkflow getctx getad_workflow_id m_wf get_id illegalstateexception ad_workflow_id getad_workflow_id m_wf perform action param action state engine action return true if valid public boolean perform string action if m state is valid action action log log level severe ignored invalid transformation action action current state getwf state return false log fine action action is valid if state engine action start equals action return start work set new state setwf state m state get new state if action action return true stateengine action_ m_state isvalidaction currentstate getwfstate stateengine action_start startwork setwfstate m_state getnewstateifaction start wf execution async return true if success public boolean start work if m state is valid action state engine action start log warning state getwf state cannot start return false int ad wf node id get workflow getad wf node id log fine ad wf node id ad wf node id setwf state wfstate running try start first activity with first node mwf activity activity new mwf activity this ad wf node id new thread activity start catch exception e log log level severe ad wf node id ad wf node id e set text msg e to string setwf state state engine state terminated return false return true startwork m_state isvalidaction stateengine action_start getwfstate ad_wf_node_id getworkflow getad_wf_node_id ad_wf_node_id ad_wf_node_id setwfstate wfstate_running mwfactivity mwfactivity ad_wf_node_id ad_wf_node_id ad_wf_node_id settextmsg tostring setwfstate stateengine state_terminated get persistent object return po public po getpo if m po null return m po if getrecord id 0 return null m table table m table get get ctx getad table id m po table getpo getrecord id get trxname return m po m_po m_po getrecord_id m_table m_table getctx getad_table_id m_po getrecord_id get_trxname m_po set text msg add to existing param po base object public void set text msg po po if po null po instanceof doc action set text msg doc action po get summary settextmsg docaction settextmsg docaction getsummary set text msg add to existing param text msg msg public void set text msg string text msg string old text get text msg if old text null old text length 0 super set text msg text msg else if text msg null text msg length 0 super set text msg old text n text msg textmsg settextmsg textmsg oldtext gettextmsg oldtext oldtext settextmsg textmsg textmsg textmsg settextmsg oldtext textmsg set runtime error message param msg message public void set process msg string msg m processmsg msg if msg null msg length 0 set text msg msg setprocessmsg m_processmsg settextmsg get runtime error message return msg public string get process msg return m processmsg getprocessmsg m_processmsg constructor public strip strip a directory and its subdirectories recursively param directory directory param name must contain file name must include characters e g sh do not include wildcards like if null all files are stripped public void strip directory string directory string name must contain if directory null throw new null pointer exception strip directory cannot be null file dir new file directory if dir exists dir is directory throw new illegal argument exception strip directory does not exist or is not a directory dir file list dir list files if list null return if verbose system out println stripping directory dir for int i 0 i list length i string name list i get absolute path if list i is directory strip directory name name must contain else if name must contain null name index of name must contain 1 strip list i null namemustcontain stripdirectory namemustcontain nullpointerexception isdirectory illegalargumentexception listfiles getabsolutepath isdirectory stripdirectory namemustcontain namemustcontain indexof namemustcontain strip infile to outfile param infile input file param outfile can be null return true if copied public boolean strip string infile string outfile if infile null throw new null pointer exception strip infile cannot be null file in new file infile file out null if outfile null out new file outfile return strip in out nullpointerexception strip infile to outfile param infile input file param outfile if the output file is null the infile is renamed to bak return true if copied public boolean strip file infile file outfile if infile null throw new null pointer exception strip infile cannot ne null infile if infile exists infile is file throw new illegal argument exception strip infile does not exist or is not a file infile system out println stripping file infile outfile if infile equals outfile outfile null boolean tempfile false if outfile null try outfile file create temp file strip txt catch io exception ioe system err println ioe return false tempfile true try if verbose system out println creating outfile outfile create new file catch io exception ioe system err println ioe return false if outfile exists outfile can write throw new illegal argument exception strip output file cannot be created or written outfile copy it if copy infile outfile return false rename outfile if tempfile if verbose system out print renaming original infile if infile rename to new file infile get absolute path bak system err println could not rename original file infile if verbose system out println renaming outfile to infile if outfile rename to infile system err println could not rename outfile to infile return true nullpointerexception isfile illegalargumentexception createtempfile ioexception createnewfile ioexception canwrite illegalargumentexception renameto getabsolutepath renameto copy the file and strip param infile input file param outfile output file return true if success private boolean copy file infile file outfile file input stream fis null try fis new file input stream infile catch file not found exception fnfe system err println fnfe return false file output stream fos null try fos new file output stream outfile false no append catch file not found exception fnfe system err println fnfe return false int no in 0 int no out 0 int no lines 1 try int c while c fis read 1 no in if c 10 lf fos write c no out if c 13 cr no lines fis close fos close catch io exception ioe system err println ioe return false system out println read no in written no out lines no lines return true fileinputstream fileinputstream filenotfoundexception fileoutputstream fileoutputstream filenotfoundexception noin noout nolines noin noout nolines ioexception noin noout nolines strip file in args param args infile outfile public static void main string args if args length 0 system err println syntax strip infile outfile system exit 1 string p2 null if args length 1 p2 args 1 new strip strip args 0 p2 prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p c acctschema id para i get parameter as int else if name equals c conversiontypereval id p c conversiontypereval id para i get parameter as int else if name equals date reval p datereval timestamp para i get parameter else if name equals apar p apar string para i get parameter else if name equals is all currencies p isallcurrencies y equals string para i get parameter else if name equals c currency id p c currency id para i get parameter as int else if name equals c doctypereval id p c doctypereval id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_acctschema_id p_c_acctschema_id getparameterasint c_conversiontypereval_id p_c_conversiontypereval_id getparameterasint datereval p_datereval getparameter p_apar getparameter isallcurrencies p_isallcurrencies getparameter c_currency_id p_c_currency_id getparameterasint c_doctypereval_id p_c_doctypereval_id getparameterasint process return info throws exception protected string do it throws exception if p isallcurrencies p c currency id 0 log info c acctschema id p c acctschema id c conversiontypereval id p c conversiontypereval id date reval p datereval apar p apar is all currencies p isallcurrencies c currency id p c currency id c doctype id p c doctypereval id parameter if p datereval null p datereval new timestamp system current time millis delete just to be sure string sql delete t invoicegl where ad pinstance id getad pinstance id int no db execute update sql get trxname if no 0 log info deleted no insert trx string date str db to date p datereval true sql insert into t invoicegl ad client id ad org id is active created created by updated updated by ad pinstance id c invoice id grand total open amt fact acct id amt source balance amt acct balance amt reval dr amt reval cr c doctypereval id is all currencies date reval c conversiontypereval id amt reval dr diff amt reval cr diff apar select i ad client id i ad org id i is active i created i created by i updated i updated by getad pinstance id i c invoice id i grand total invoice open i c invoice id 0 fa fact acct id fa amt source dr fa amt source cr fa amt acct dr fa amt acct cr currency convert fa amt source dr i c currency id a c currency id date str p c conversiontypereval id i ad client id i ad org id currency convert fa amt source cr i c currency id a c currency id date str p c conversiontypereval id i ad client id i ad org id p c doctypereval id 0 null p c doctypereval id p isallcurrencies y n date str p c conversiontypereval id 0 0 p apar from c invoice i inner join fact acct fa on fa ad table id 318 and fa record id i c invoice id and i grand total fa amt source dr or i grand total fa amt source cr inner join c acctschema a on fa c acctschema id a c acctschema id where i is paid n and exists select from c elementvalue ev where ev c elementvalue id fa account id and ev account type a or ev account type l and fa c acctschema id p c acctschema id if p isallcurrencies sql and i c currency id a c currency id if only ar equals p apar sql and i isso trx y else if only ap equals p apar sql and i isso trx n if p isallcurrencies p c currency id 0 sql and i c currency id p c currency id no db execute update sql get trxname if no 0 log info inserted no else if c log mgt is level finer log warning inserted no sql else log warning inserted no calculate difference sql update t invoicegl gl set amt reval dr diff amt reval cr diff select gl amt reval dr fa amt acct dr gl amt reval cr fa amt acct cr from fact acct fa where gl fact acct id fa fact acct id where ad pinstance id getad pinstance id int not db execute update sql get trxname if not 0 log config difference not percentage sql update t invoicegl set percent 100 where grand total open amt and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log info not paid no sql update t invoicegl set percent round open amt grand total 100 0 where grand total open amt and grand total 0 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log info partial paid no sql update t invoicegl set amt reval dr amt reval dr percent amt reval cr amt reval cr percent 100 amt reval dr diff amt reval dr diff percent 100 amt reval cr diff amt reval cr diff percent 100 where percent 100 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log config partial calc no create document string info if p c doctypereval id 0 if p c currency id 0 log warning can create journal only for all currencies else info creategl journal return not info doit p_isallcurrencies p_c_currency_id c_acctschema_id p_c_acctschema_id c_conversiontypereval_id p_c_conversiontypereval_id datereval p_datereval p_apar isallcurrencies p_isallcurrencies c_currency_id p_c_currency_id c_doctype_id p_c_doctypereval_id p_datereval p_datereval currenttimemillis t_invoicegl ad_pinstance_id getad_pinstance_id executeupdate get_trxname datestr to_date p_datereval t_invoicegl ad_client_id ad_org_id isactive createdby updatedby ad_pinstance_id c_invoice_id grandtotal openamt fact_acct_id amtsourcebalance amtacctbalance amtrevaldr amtrevalcr c_doctypereval_id isallcurrencies datereval c_conversiontypereval_id amtrevaldrdiff amtrevalcrdiff ad_client_id ad_org_id isactive createdby updatedby getad_pinstance_id c_invoice_id grandtotal invoiceopen c_invoice_id fact_acct_id amtsourcedr amtsourcecr amtacctdr amtacctcr currencyconvert amtsourcedr c_currency_id c_currency_id datestr p_c_conversiontypereval_id ad_client_id ad_org_id currencyconvert amtsourcecr c_currency_id c_currency_id datestr p_c_conversiontypereval_id ad_client_id ad_org_id p_c_doctypereval_id p_c_doctypereval_id p_isallcurrencies datestr p_c_conversiontypereval_id p_apar c_invoice fact_acct ad_table_id record_id c_invoice_id grandtotal amtsourcedr grandtotal amtsourcecr c_acctschema c_acctschema_id c_acctschema_id ispaid c_elementvalue c_elementvalue_id account_id accounttype accounttype c_acctschema_id p_c_acctschema_id p_isallcurrencies c_currency_id c_currency_id only_ar p_apar issotrx only_ap p_apar issotrx p_isallcurrencies p_c_currency_id c_currency_id p_c_currency_id executeupdate get_trxname clogmgt islevelfiner t_invoicegl amtrevaldrdiff amtrevalcrdiff amtrevaldr amtacctdr amtrevalcr amtacctcr fact_acct fact_acct_id fact_acct_id ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_invoicegl grandtotal openamt ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_invoicegl openamt grandtotal grandtotal openamt grandtotal ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_invoicegl amtrevaldr amtrevaldr amtrevalcr amtrevalcr amtrevaldrdiff amtrevaldrdiff amtrevalcrdiff amtrevalcrdiff ad_pinstance_id getad_pinstance_id executeupdate get_trxname p_c_doctypereval_id p_c_currency_id creategljournal create gl journal return document info private string creategl journal array list x t invoicegl list new array list x t invoicegl string sql select from t invoicegl where ad pinstance id getad pinstance id order by ad org id prepared statement pstmt null try pstmt db prepare statement sql get trxname result set rs pstmt execute query while rs next list add new x t invoicegl get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if list size 0 return no records found m acct schema as m acct schema get get ctx p c acctschema id m acct schema default as default accts m acct schema default get get ctx p c acctschema id mgl category cat mgl category get default system get ctx if cat null m doc type doc type m doc type get get ctx p c doctypereval id cat mgl category get get ctx doc type getgl category id m journal batch batch new m journal batch get ctx 0 get trxname batch set description get name batch setc doctype id p c doctypereval id batch set date doc new timestamp system current time millis batch set date acct p datereval batch setc currency id as getc currency id if batch save return could not create batch m journal journal null big decimal dr total env zero big decimal cr total env zero int ad org id 0 for int i 0 i list size i x t invoicegl gl list get i if gl get amt reval dr diff signum 0 gl get amt reval cr diff signum 0 continue m invoice invoice new m invoice get ctx gl getc invoice id null if invoice getc currency id as getc currency id continue if journal null journal new m journal batch journal setc acctschema id as getc acctschema id journal setc currency id as getc currency id journal setc conversiontype id p c conversiontypereval id m org org m org get get ctx gl getad org id journal set description get name org get name journal setgl category id cat getgl category id if journal save return could not create journal m journal line line new m journal line journal line set line i 1 10 line set description invoice get summary m fact acct fa new m fact acct get ctx gl getfact acct id null line setc validcombination id m account get fa big decimal dr gl get amt reval dr diff big decimal cr gl get amt reval cr diff dr total dr total add dr cr total cr total add cr line set amt source dr dr line set amt acct dr dr line set amt source cr cr line set amt acct cr cr line save if ad org id 0 invoice org id ad org id gl getad org id change in org if ad org id gl getad org id create balancing as default accts journal dr total cr total ad org id i 1 10 ad org id gl getad org id dr total env zero cr total env zero journal null create balancing as default accts journal dr total cr total ad org id list size 1 10 return batch get document no list size creategljournal arraylist x_t_invoicegl arraylist x_t_invoicegl t_invoicegl ad_pinstance_id getad_pinstance_id ad_org_id preparedstatement preparestatement get_trxname resultset executequery x_t_invoicegl getctx get_trxname macctschema macctschema getctx p_c_acctschema_id macctschemadefault asdefaultaccts macctschemadefault getctx p_c_acctschema_id mglcategory mglcategory getdefaultsystem getctx mdoctype doctype mdoctype getctx p_c_doctypereval_id mglcategory getctx doctype getgl_category_id mjournalbatch mjournalbatch getctx get_trxname setdescription getname setc_doctype_id p_c_doctypereval_id setdatedoc currenttimemillis setdateacct p_datereval setc_currency_id getc_currency_id mjournal bigdecimal drtotal bigdecimal crtotal ad_org_id x_t_invoicegl getamtrevaldrdiff getamtrevalcrdiff minvoice minvoice getctx getc_invoice_id getc_currency_id getc_currency_id mjournal setc_acctschema_id getc_acctschema_id setc_currency_id getc_currency_id setc_conversiontype_id p_c_conversiontypereval_id morg morg getctx getad_org_id setdescription getname getname setgl_category_id getgl_category_id mjournalline mjournalline setline setdescription getsummary mfactacct mfactacct getctx getfact_acct_id setc_validcombination_id maccount bigdecimal getamtrevaldrdiff bigdecimal getamtrevalcrdiff drtotal drtotal crtotal crtotal setamtsourcedr setamtacctdr setamtsourcecr setamtacctcr ad_org_id ad_org_id getad_org_id ad_org_id getad_org_id createbalancing asdefaultaccts drtotal crtotal ad_org_id ad_org_id getad_org_id drtotal crtotal createbalancing asdefaultaccts drtotal crtotal ad_org_id getdocumentno create balancing entry param as default accts acct schema default accounts param journal journal param dr total dr param cr total cr param ad org id org param line no base line no private void create balancing m acct schema default as default accts m journal journal big decimal dr total big decimal cr total int ad org id int line no if journal null throw new illegal argument exception jornal is null cr entry gain if dr total signum 0 m journal line line new m journal line journal line set line line no 1 m account base m account get get ctx as default accts getunrealizedgain acct m account acct m account get get ctx as default accts getad client id ad org id as default accts getc acctschema id base getaccount id base getc subacct id base getm product id base getc bpartner id base getad orgtrx id base getc locfrom id base getc locto id base getc salesregion id base getc project id base getc campaign id base getc activity id base getuser1 id base getuser2 id base getuserelement1 id base getuserelement2 id line set description msg get element get ctx unrealizedgain acct line setc validcombination id acct getc validcombination id line set amt source cr dr total line set amt acct cr dr total line save dr entry loss if cr total signum 0 m journal line line new m journal line journal line set line line no 2 m account base m account get get ctx as default accts getunrealizedloss acct m account acct m account get get ctx as default accts getad client id ad org id as default accts getc acctschema id base getaccount id base getc subacct id base getm product id base getc bpartner id base getad orgtrx id base getc locfrom id base getc locto id base getc salesregion id base getc project id base getc campaign id base getc activity id base getuser1 id base getuser2 id base getuserelement1 id base getuserelement2 id line set description msg get element get ctx unrealizedloss acct line setc validcombination id acct getc validcombination id line set amt source dr cr total line set amt acct dr cr total line save asdefaultaccts drtotal crtotal ad_org_id lineno createbalancing macctschemadefault asdefaultaccts mjournal bigdecimal drtotal bigdecimal crtotal ad_org_id lineno illegalargumentexception drtotal mjournalline mjournalline setline lineno maccount maccount getctx asdefaultaccts getunrealizedgain_acct maccount maccount getctx asdefaultaccts getad_client_id ad_org_id asdefaultaccts getc_acctschema_id getaccount_id getc_subacct_id getm_product_id getc_bpartner_id getad_orgtrx_id getc_locfrom_id getc_locto_id getc_salesregion_id getc_project_id getc_campaign_id getc_activity_id getuser1_id getuser2_id getuserelement1_id getuserelement2_id setdescription getelement getctx unrealizedgain_acct setc_validcombination_id getc_validcombination_id setamtsourcecr drtotal setamtacctcr drtotal crtotal mjournalline mjournalline setline lineno maccount maccount getctx asdefaultaccts getunrealizedloss_acct maccount maccount getctx asdefaultaccts getad_client_id ad_org_id asdefaultaccts getc_acctschema_id getaccount_id getc_subacct_id getm_product_id getc_bpartner_id getad_orgtrx_id getc_locfrom_id getc_locto_id getc_salesregion_id getc_project_id getc_campaign_id getc_activity_id getuser1_id getuser2_id getuserelement1_id getuserelement2_id setdescription getelement getctx unrealizedloss_acct setc_validcombination_id getc_validcombination_id setamtsourcedr crtotal setamtacctdr crtotal standard constructor public x ad attachment properties ctx int ad attachment id string trx name super ctx ad attachment id trx name if ad attachment id 0 setad attachment id 0 setad table id 0 setrecord id 0 set title null x_ad_attachment ad_attachment_id trxname ad_attachment_id trxname ad_attachment_id setad_attachment_id setad_table_id setrecord_id settitle load constructor public x ad attachment properties ctx result set rs string trx name super ctx rs trx name x_ad_attachment resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad attachment append get id append return sb to string tostring stringbuffer stringbuffer x_ad_attachment get_id tostring set attachment attachment for the document public void setad attachment id int ad attachment id if ad attachment id 1 throw new illegal argument exception ad attachment id is mandatory set valuenocheck ad attachment id new integer ad attachment id setad_attachment_id ad_attachment_id ad_attachment_id illegalargumentexception ad_attachment_id set_valuenocheck ad_attachment_id ad_attachment_id get attachment attachment for the document public int getad attachment id integer ii integer get value ad attachment id if ii null return 0 return ii int value getad_attachment_id get_value ad_attachment_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set binary data binary data public void set binary data byte binary data set valuenocheck binary data binary data binarydata setbinarydata binarydata set_valuenocheck binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg set title name this entity is referred to as public void set title string title if title null throw new illegal argument exception title is mandatory if title length 60 log warning length 60 truncated title title substring 0 59 set value title title settitle illegalargumentexception set_value get title name this entity is referred to as public string get title return string get value title gettitle get_value return string get value title public key name pair get key name pair return new key name pair get id get title get_value keynamepair getkeynamepair keynamepair get_id gettitle constructor you need to call init grid for instanciation public grid controller try jb init catch exception e log log level severe e initgrid gridcontroller jbinit to string return string representation public string to string return grid controller for m mtab tostring tostring gridcontroller m_mtab static layout init throws exception private void jb init throws exception this set layout main layout this add split pane border layout center split pane set opaque false graph panel set layout graph layout split pane add graph panel j split pane left split pane add card panel j split pane right split pane set border null split pane set name gc splitpane card panel set layout card layout card panel add sr pane sr pane sequence important card panel add mr pane mr pane card panel set border null card panel set name gc cardpanel single row w o x pane it would be centered sr pane set border null sr pane set name gc srpane sr pane set orientation j split pane vertical split sr pane add v pane j split pane top sr pane set top component v pane sr pane set bottom component null otherwise a button is created displayed v pane get viewport add x panel null x panel add v panel v pane set border null x panel set layout x layout x panel set name gc xpanel x layout set alignment flow layout left x layout set hgap 0 x layout set vgap 0 multi row mr pane set border null mr pane get viewport add v table null mr pane set name gc mrpane graph panel set border null graph panel set name gc graphpanel sr pane set divider location 200 jbinit setlayout mainlayout splitpane borderlayout splitpane setopaque graphpanel setlayout graphlayout splitpane graphpanel jsplitpane splitpane cardpanel jsplitpane splitpane setborder splitpane setname gc_splitpane cardpanel setlayout cardlayout cardpanel srpane srpane cardpanel mrpane mrpane cardpanel setborder cardpanel setname gc_cardpanel xpane srpane setborder srpane setname gc_srpane srpane setorientation jsplitpane vertical_split srpane vpane jsplitpane srpane settopcomponent vpane srpane setbottomcomponent vpane getviewport xpanel xpanel vpanel vpane setborder xpanel setlayout xlayout xpanel setname gc_xpanel xlayout setalignment flowlayout xlayout sethgap xlayout setvgap mrpane setborder mrpane getviewport vtable mrpane setname gc_mrpane graphpanel setborder graphpanel setname gc_graphpanel srpane setdividerlocation displose public void dispose log config m mtab to string clear info stop editor false if m mtab need save true false m mtab data ignore v includedgc null listeners m mtab get table model remove data status listener this m mtab get table model remove vetoable change listener this v table get selection model remove list selection listener this m mtab remove property change listener v table editors component comp v panel get components for int i 0 i comp length i if comp i instanceof v editor v editor v editor v editor comp i v editor remove vetoable change listener this string column name comp i get name m field m field m mtab get field column name if m field null m field remove property change listener v editor v editor dispose todo remove a panel button listeners v table remove all v table set model new default table model remove reference v table null v panel remove all v panel null sr pane remove all sr pane null split pane remove all split pane null m mtab null m tree null this remove all m_mtab tostring stopeditor m_mtab needsave m_mtab dataignore vincludedgc m_mtab gettablemodel removedatastatuslistener m_mtab gettablemodel removevetoablechangelistener vtable getselectionmodel removelistselectionlistener m_mtab removepropertychangelistener vtable vpanel getcomponents veditor veditor veditor veditor veditor removevetoablechangelistener columnname getname mfield mfield m_mtab getfield columnname mfield mfield removepropertychangelistener veditor veditor apanel vtable removeall vtable setmodel defaulttablemodel vtable vpanel removeall vpanel srpane removeall srpane splitpane removeall splitpane m_mtab m_tree removeall init grid pre map table to model update multi row table info with renderers editors build single row panel initialize display pre param m tab tab param only multi row only table param window no window no param a panel optional application panel for adding button listeners param m window parent window model return true if initialized public boolean init grid m tab m tab boolean only multi row int window no a panel a panel m window m window log config m tab to string m mtab m tab m windowno window no m onlymultirow only multi row set name gc m tab set up multi row table v table set model m mtab get table model update table info int size setupv table a panel m mtab v table set color on tab level this set background color m tab get color single row if m onlymultirow for int i 0 i size i m field m field m mtab get field i if m field is displayed v editor v editor v editor factory get editor m mtab m field false if v editor null log severe editor not created for m field get column name continue m field v editor new field value to be updated to editor m field add property change listener v editor v editor this new editor value to be updated here m table v editor add vetoable change listener this add to v panel v panel add field v editor m field a panel listen to buttons if m field get display type display type button a panel null j button v editor add action listener a panel for all fields no included grid controller sr pane set resize weight 1 top part gets all sr pane set divider size 0 sr pane set divider location 9999 use sr to size mr mr pane set preferred size v panel get preferred size single row tree graphics layout int ad tree id 0 if m mtab is tree tab ad tree id m tree getdefaultad tree id env getad client id env get ctx m mtab get key column name if m mtab is tree tab ad tree id 0 m tree new v tree panel m windowno false true if m mtab get tab no 0 initialize other tabs later m tree init tree ad tree id m tree add property change listener v tree panel node selection this graph panel add m tree border layout center split pane set divider location 250 split pane reset to preferred sizes else no graphics hide graph panel set preferred size new dimension 0 0 split pane set divider size 0 split pane set divider location 0 receive data status changed info from m tab m mtab add data status listener this receive vetoable change info from m table when saving m mtab get table model add vetoable change listener this selection listener value changed v table get selection model add list selection listener this navigation row changed m mtab add property change listener v table update ui v table auto size true set tab level m mtab get tab level set initial presentation if only multi row m mtab is single row switch multi row else switch single row log config grid controller dyn init m tab to string fini return true mtab onlymultirow windowno apanel mwindow initgrid mtab mtab onlymultirow windowno apanel apanel mwindow mwindow mtab tostring m_mtab mtab m_windowno windowno m_onlymultirow onlymultirow setname mtab vtable setmodel m_mtab gettablemodel setupvtable apanel m_mtab vtable setbackgroundcolor mtab getcolor m_onlymultirow mfield mfield m_mtab getfield mfield isdisplayed veditor veditor veditorfactory geteditor m_mtab mfield veditor mfield getcolumnname mfield veditor mfield addpropertychangelistener veditor veditor mtable veditor addvetoablechangelistener vpanel vpanel addfield veditor mfield apanel mfield getdisplaytype displaytype apanel jbutton veditor addactionlistener apanel srpane setresizeweight srpane setdividersize srpane setdividerlocation mrpane setpreferredsize vpanel getpreferredsize ad_tree_id m_mtab istreetab ad_tree_id mtree getdefaultad_tree_id getad_client_id getctx m_mtab getkeycolumnname m_mtab istreetab ad_tree_id m_tree vtreepanel m_windowno m_mtab gettabno m_tree inittree ad_tree_id m_tree addpropertychangelistener vtreepanel node_selection graphpanel m_tree borderlayout splitpane setdividerlocation splitpane resettopreferredsizes graphpanel setpreferredsize splitpane setdividersize splitpane setdividerlocation datastatuschanged mtab m_mtab adddatastatuslistener vetoablechange mtable m_mtab gettablemodel addvetoablechangelistener valuechanged vtable getselectionmodel addlistselectionlistener rowchanged m_mtab addpropertychangelistener vtable vtable autosize settablevel m_mtab gettablevel onlymultirow m_mtab issinglerow switchmultirow switchsinglerow gridcontroller dyninit mtab tostring include tab param gc grod controller to add return true if included public boolean include tab grid controller gc m tab imcludedm tab gc getm tab if m mtab getincluded tab id imcludedm tab getad tab id return false v includedgc gc v includedgc switch multi row dimension size get preferred size sr pane set resize weight 75 top part gets 75 sr pane add v includedgc j split pane bottom sr pane set bottom component v includedgc sr pane set divider size 5 int height 150 v includedgc set preferred size new dimension 600 height set preferred size new dimension size width size height height sr pane set divider location size height imcludedm tab set included true imcludedm tab query false 0 j root pane rt swing utilities get root pane this if rt null system out println root pane null else system out println root rt rt add mouse listener v includedgc component gp rt get glass pane if gp null system out println no glass pane else system out println glass gp gp add mouse listener v includedgc v includedgc add mouse listener v includedgc v includedgc enable events awt event hierarchy event mask awt event mouse event mask v includedgc split pane add mouse listener v includedgc v includedgc card panel add mouse listener v includedgc v includedgc mr pane add mouse listener v includedgc v includedgc v table add mouse listener v includedgc return true includetab gridcontroller mtab imcludedmtab getmtab m_mtab getincluded_tab_id imcludedmtab getad_tab_id vincludedgc vincludedgc switchmultirow getpreferredsize srpane setresizeweight srpane vincludedgc jsplitpane srpane setbottomcomponent vincludedgc srpane setdividersize vincludedgc setpreferredsize setpreferredsize srpane setdividerlocation imcludedmtab setincluded imcludedmtab jrootpane swingutilities getrootpane addmouselistener vincludedgc getglasspane addmouselistener vincludedgc vincludedgc addmouselistener vincludedgc vincludedgc enableevents awtevent hierarchy_event_mask awtevent mouse_event_mask vincludedgc splitpane addmouselistener vincludedgc vincludedgc cardpanel addmouselistener vincludedgc vincludedgc mrpane addmouselistener vincludedgc vincludedgc vtable addmouselistener vincludedgc get title return title public string get title return m mtab get name gettitle m_mtab getname setup multi row table add fields param a panel panel param m tab model tab param table j table return size private int setupv table a panel a panel m tab m tab v table table if m tab is displayed return 0 int size m tab get field count table column model tcm table get column model if size tcm get column count throw new illegal state exception table column size table model for int i 0 i size i m field m field m tab get field i table column tc tcm get column i tc set min width 30 if m field get column name equals tc get identifier to string if m field get display type display type rowid tc set cell renderer new v rowid renderer false tc set cell editor new v rowid editor false tc set header value tc set max width 2 else need to set cell editor explicitly as default editor based on class causes problem yes no boolean if m field is displayed tc set cell renderer new v cell renderer m field v cell editor ce new v cell editor m field tc set cell editor ce tc set header value m field get header tc set preferred width math max m field get display length 30 tc set header renderer new v header renderer m field get display type enable button actions in grid if m field get display type display type button v editor button ce get editor if button null a panel null j button button add action listener a panel else column not displayed table cell none tcn new table cell none m field get column name tc set cell renderer tcn tc set cell editor tcn tc set header value null tc set min width 0 tc set max width 0 tc set preferred width 0 system out println table columnid tc get identifier renderer tc get cell renderer m field get header found field else log log level severe table column tc get identifier m field m field get column name m field get header for all fields return size apanel mtab jtable setupvtable apanel apanel mtab mtab vtable mtab isdisplayed mtab getfieldcount tablecolumnmodel getcolumnmodel getcolumncount illegalstateexception tablecolumn tablemodel mfield mfield mtab getfield tablecolumn getcolumn setminwidth mfield getcolumnname getidentifier tostring mfield getdisplaytype displaytype setcellrenderer vrowidrenderer setcelleditor vrowideditor setheadervalue setmaxwidth celleditor yesno mfield isdisplayed setcellrenderer vcellrenderer mfield vcelleditor vcelleditor mfield setcelleditor setheadervalue mfield getheader setpreferredwidth mfield getdisplaylength setheaderrenderer vheaderrenderer mfield getdisplaytype mfield getdisplaytype displaytype veditor geteditor apanel jbutton addactionlistener apanel tablecellnone tablecellnone mfield getcolumnname setcellrenderer setcelleditor setheadervalue setminwidth setmaxwidth setpreferredwidth tablecolumnid getidentifier getcellrenderer mfield getheader tablecolumn getidentifier mfield mfield getcolumnname mfield getheader activate grid controller called by a panel when grid controller is displayed foreground public void activate tree to be initiated on second tab if m mtab is tree tab m mtab get tab no 0 int ad tree id env get context as int env get ctx m windowno ad tree id if ad tree id 0 ad tree id m tree getdefaultad tree id env getad client id env get ctx m mtab get key column name m tree init tree ad tree id apanel gridcontroller m_mtab istreetab m_mtab gettabno ad_tree_id getcontextasint getctx m_windowno ad_tree_id ad_tree_id ad_tree_id mtree getdefaultad_tree_id getad_client_id getctx m_mtab getkeycolumnname m_tree inittree ad_tree_id register esc actions overwrite v table s keystroks assigment for esc param a ignore ignore public void registeresc action apps action a ignore int c v table when ancestor of focused component v table get input map c put key stroke get key stroke key event vk escape 0 a ignore get name v table get action map put a ignore get name a ignore a env print action input map v table vtable aignore registerescaction appsaction aignore vtable when_ancestor_of_focused_component vtable getinputmap keystroke getkeystroke keyevent vk_escape aignore getname vtable getactionmap aignore getname aignore aenv printactioninputmap vtable query tab and resize table called from a panel param only current rows only current rows param only current days how many days back public void query boolean only current rows int only current days start loading while building screen m mtab query only current rows only current days update ui if is single row v table auto size true apanel onlycurrentrows onlycurrentdays onlycurrentrows onlycurrentdays m_mtab onlycurrentrows onlycurrentdays issinglerow vtable autosize switch from single to multi vice versa public void switch row presentation stop editor true if m singlerow switch multi row else switch single row switchrowpresentation stopeditor m_singlerow switchmultirow switchsinglerow switch to single row presentation public void switch single row if m onlymultirow return card layout first card panel m singlerow true dynamic display 0 v panel request focus singlerow switchsinglerow m_onlymultirow cardlayout cardpanel m_singlerow dynamicdisplay vpanel requestfocus switch to multi row presentation public void switch multi row card layout last card panel m singlerow false v table auto size true resizes v table request focus multirow switchmultirow cardlayout cardpanel m_singlerow vtable autosize vtable requestfocus is single row presentation return true if single row is displayed public boolean is single row return m singlerow issinglerow m_singlerow remove listener pass on to m tab param l listener public synchronized void remove data status listener data status listener l m mtab remove data status listener l mtab removedatastatuslistener datastatuslistener m_mtab removedatastatuslistener add data status listener pass on to m tab param l listener public synchronized void add data status listener data status listener l m mtab add data status listener l mtab adddatastatuslistener datastatuslistener m_mtab adddatastatuslistener data status listener for m tab events p callouts are processed here for gui changes same as in m tab set value for batch changes p calls dynamic display param e event public void data status changed data status event e if e get changed column 0 return int col e get changed column log config m mtab col col e to string process callout only for specific columns if col 0 m field m field m mtab get field col if m field null m field get callout length 0 string msg m mtab process field change m field dependencies callout if msg length 0 a dialog error m windowno this msg dynamic display col mtab mtab setvalue dynamicdisplay datastatuschanged datastatusevent getchangedcolumn getchangedcolumn m_mtab tostring mfield mfield m_mtab getfield mfield mfield getcallout m_mtab processfieldchange mfield adialog m_windowno dynamicdisplay list selection listener v table row changed param e event public void value changed list selection event e nothing or initiated by mouse wait for real one if e get value is adjusting return no rows if m mtab get row count 0 return v table stop editor graph panel int row table v table get selected row int row current m mtab get current row log config m mtab to string row in table row table in model row current if row table 1 nothing selected if row current 0 v table set row selection interval row current row current causes this method to be called again return else if row table row current m mtab navigate row table dynamic display 0 tree navigation synchronize select node in tree if m tree null m tree set selected node m mtab getrecord id ignores new 1 log config grid controller value changed m mtab to string fini row in table row table in model row current query included tab if v includedgc null v includedgc getm tab query false 0 vtable valuechanged listselectionevent getvalueisadjusting m_mtab getrowcount vtable stopeditor graphpanel rowtable vtable getselectedrow rowcurrent m_mtab getcurrentrow m_mtab tostring rowtable rowcurrent rowtable rowcurrent vtable setrowselectioninterval rowcurrent rowcurrent rowtable rowcurrent m_mtab rowtable dynamicdisplay treenavigation m_tree m_tree setselectednode m_mtab getrecord_id gridcontroller valuechanged m_mtab tostring rowtable rowcurrent vincludedgc vincludedgc getmtab property change listener tree panel node selection param e event public void property change property change event e system out println property change system out println e if e null return object value e get new value if value null return log config e get property name value value get class to string if value instanceof m tree node return we have a tree node int nodeid m tree node value getnode id root of tree selected ignore if nodeid 0 return search all rows for mode id int size m mtab get row count int row 1 for int i 0 i size i if m mtab get keyid i nodeid row i break if row 1 log log level severe tab does not have id with node id nodeid return navigate to node row m mtab navigate row propertychange propertychange propertychangeevent propertychange getnewvalue getpropertyname getclass tostring mtreenode treenode mtreenode getnode_id m_mtab getrowcount m_mtab getkeyid node_id m_mtab dynamic display single row screen layout and update of dynamic lookups p single row layout the components s name is the column name if it matches the m field is displayed true is used to determine if it is visible if the component is a v editor set enabled is set from the m field p multi row layout is not changed v cell renderer calls j table is cell editable checks m field is editable active is displayed v cell editor is cell editable calls m field is editable true br if a column is not displayed the width is set to 0 in dyn init p dynamic update of data is handeled in v lookup focus gained lost when focus is gained the model is temporarily updated with the specific validated data if lost it is switched back to the unvalidated data i e everything this allows that the display methods have a lookup to display br here if the changed field has dependents and the dependent is a lookup and this lookup has a dynamic dependence of the changed field the value of that field is set to null in m tab process dependencies otherwise it would show an invalid value as editors listen for value changed of their m field the display is updated p called from grid controller value changed data status changed a pane state changed unlock cmd param col selective column number or 0 if all public void dynamic display int col log config grid controller dynamic display m mtab to string single row is single row only multi row m onlymultirow don t update if multi row if is single row m onlymultirow return if m mtab is open return selective if col 0 m field changed field m mtab get field col string column name changed field get column name array list dependants m mtab get dependant list column name log config m mtab to string column name dependents dependants size no dependents and no callout set just background if dependants size 0 changed field get callout length 0 component comp v panel get components for int i 0 i comp length i if column name equals comp i get name comp i instanceof v editor v editor ve v editor comp i boolean man missing false boolean no value changed field get value null changed field get value to string length 0 if no value changed field is editable true changed field is mandatory true check context man missing true ve set background man missing changed field is error break return selective complete single row re display boolean no data m mtab get row count 0 log config m mtab to string rows m mtab get row count all components in v panel single row component comp v panel get components for int i 0 i comp length i string column name comp i get name if column name null m field m field m mtab get field column name if m field null if m field is displayed true check context if comp i is visible comp i set visible true visibility if comp i instanceof v editor v editor ve v editor comp i if no data ve set read write false else boolean rw m field is editable true r w check context ve set read write rw log trace 7 grid controller dynamic display rw rw m field boolean man missing false least expensive operations first missing mandatory if rw m field get value null m field is mandatory true check context man missing true ve set background man missing m field is error else if comp i is visible comp i set visible false all components log config m mtab to string fini col 0 complete seletive columnname mfield isdisplayed veditor setenabled mfield vcellrenderer jtable iscelleditable mfield iseditable isdisplayed vcelleditor iscelleditable mfield iseditable dyninit vlookup focusgained mtab processdependencies mfield gridcontroller valuechanged datastatuschanged apane statechanged cmd_ dynamicdisplay gridcontroller dynamicdisplay m_mtab tostring singlerow issinglerow onlymultirow m_onlymultirow issinglerow m_onlymultirow m_mtab isopen mfield changedfield m_mtab getfield columnname changedfield getcolumnname arraylist m_mtab getdependantlist columnname m_mtab tostring columnname changedfield getcallout vpanel getcomponents columnname getname veditor veditor veditor manmissing novalue changedfield getvalue changedfield getvalue tostring novalue changedfield iseditable changedfield ismandatory manmissing setbackground manmissing changedfield iserror nodata m_mtab getrowcount m_mtab tostring m_mtab getrowcount vpanel vpanel getcomponents columnname getname columnname mfield mfield m_mtab getfield columnname mfield mfield isdisplayed isvisible setvisible veditor veditor veditor nodata setreadwrite mfield iseditable setreadwrite gridcontroller dynamicdisplay mfield manmissing mfield getvalue mfield ismandatory manmissing setbackground manmissing mfield iserror isvisible setvisible m_mtab tostring row changed synchronize with tree param save true the row was saved changed added false if the row was deleted param keyid the id of the row changed public void row changed boolean save int keyid if m tree null keyid 0 return string name string m mtab get value name string description string m mtab get value description boolean is summary boolean m mtab get value is summary string image indicator string m mtab get value action menu action m tree node changed save keyid name description is summary boolean value image indicator rowchanged m_tree m_mtab getvalue m_mtab getvalue issummary m_mtab getvalue issummary imageindicator m_mtab getvalue m_tree nodechanged issummary booleanvalue imageindicator vetoable change listener called from v editor pre for save confirmation dialog for single row from v editor update m table pre param e event throws property veto exception public void vetoable change property change event e throws property veto exception if m mtab is processed only active records object source e get source if source instanceof v editor if v editor source is read write log config m mtab to string e get property name return else log config m mtab to string e get property name return log config m mtab to string e get property name e get new value e get old value e get old value null e get old value get class get name save confirmation dialog m table row save if e get property name equals m table property throw new property veto exception calls this method again if m vetoactive m vetoactive false return if env is auto commit env get ctx m windowno m mtab get commit warning length 0 if a dialog ask m windowno this save changes m mtab get commit warning m vetoactive true throw new property veto exception user denied save e return save confirmation get row col info m table m table m mtab get table model int row m mtab get current row int col m table find column e get property name if e get new value null e get old value null e get old value to string length 0 some editors return instead of null m table set changed true else m table set value at e get new value row col true m table set value at e get new value row col data status changed dynamic display force callout if e get property name equals s resourceassignment id m field m field m mtab get field col if m field null m field get callout length 0 m mtab process field change m field dependencies callout log config grid controller vetoable change m mtab to string fini e get property name e get new value veditor veditor mtable propertyvetoexception vetoablechange propertychangeevent propertyvetoexception m_mtab isprocessed getsource veditor veditor isreadwrite m_mtab tostring getpropertyname m_mtab tostring getpropertyname m_mtab tostring getpropertyname getnewvalue getoldvalue getoldvalue getoldvalue getclass getname mtable rowsave getpropertyname mtable propertyvetoexception m_vetoactive m_vetoactive isautocommit getctx m_windowno m_mtab getcommitwarning adialog m_windowno savechanges m_mtab getcommitwarning m_vetoactive propertyvetoexception userdeniedsave saveconfirmation mtable mtable m_mtab gettablemodel m_mtab getcurrentrow mtable findcolumn getpropertyname getnewvalue getoldvalue getoldvalue tostring mtable setchanged mtable setvalueat getnewvalue mtable setvalueat getnewvalue datastatuschanged dynamicdisplay getpropertyname s_resourceassignment_id mfield mfield m_mtab getfield mfield mfield getcallout m_mtab processfieldchange mfield gridcontroller vetoablechange m_mtab tostring getpropertyname getnewvalue get model tab return model tab public m tab getm tab return m mtab mtab getmtab m_mtab get v table return v table public v table get table return v table vtable vtable vtable gettable vtable set window level mnemonics param set true if set otherwise unregiser public void set mnemonics boolean set if v panel null v panel set mnemonics set setmnemonics vpanel vpanel setmnemonics stop table sr editors and move focus to graph panel param save value save value public void stop editor boolean save value log config m mtab to string table editing v table is editing multi row remove editors v table stop editor save value single row stop editors by changing focus if m singlerow v panel transfer focus graph panel request focus log config grid controller stop editor m mtab to string fini editing v table is editing graphpanel savevalue stopeditor savevalue m_mtab tostring tableediting vtable isediting multirow vtable stopeditor savevalue singlerow m_singlerow vpanel transferfocus graphpanel requestfocus gridcontroller stopeditor m_mtab tostring vtable isediting public void mouse clicked mouse event e log finest this e mouseclicked mouseevent log finest this e public void mouse pressed mouse event e log finest this e mousepressed mouseevent log finest this e public void mouse released mouse event e log finest this e mousereleased mouseevent log finest this e public void mouse entered mouse event e log finest this e mouseentered mouseevent log finest this e public void mouse exited mouse event e log finest this e mouseexited mouseevent public static componentui createui j component c return shared instance jcomponent sharedinstance public dimension get preferred size j component c tip j tool tip c return super get preferred size c getpreferredsize jcomponent jtooltip getpreferredsize public void paint graphics g j component c tip j tool tip c super paint g c jcomponent jtooltip get accelerator string return string public string get accelerator string string str super get accelerator string if tip null is accelerator hidden return str j component comp tip get component if comp null comp instanceof j tabbed pane comp instanceof j menu item return str key stroke keys comp get registered key strokes string buffer control key str new string buffer for int i 0 i keys length i int mod keys i get modifiers int condition comp get condition for key stroke keys i if condition j component when in focused window string prefix key event get key modifiers text mod if prefix length 1 if control key str length 0 control key str append control key str append prefix append append key event get key text keys i get key code break just first return control key str to string getacceleratorstring getacceleratorstring isacceleratorhidden jcomponent getcomponent jtabbedpane jmenuitem keystroke getregisteredkeystrokes stringbuffer controlkeystr stringbuffer getmodifiers getconditionforkeystroke jcomponent when_in_focused_window keyevent getkeymodifierstext controlkeystr controlkeystr controlkeystr keyevent getkeytext getkeycode controlkeystr tostring migrate data public migrate data release252c update existing print format print format util pfu new print format util env get ctx pfu add missing columns migratedata printformatutil printformatutil getctx addmissingcolumns release 252c private void release252c string sql select count from m productdownload int no db getsql value null sql if no 0 log finer no need downloads no return int count 0 sql select ad client id ad org id m product id name downloadurl from m product where downloadurl is not null prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 int m product id rs get int 3 string name rs get string 4 string downloadurl rs get string 5 properties ctx new properties env get ctx env set context ctx ad client id ad client id env set context ctx ad client id ad client id env set context ctx ad org id ad org id env set context ctx ad org id ad org id m product download pdl new m product download ctx 0 null pdl setm product id m product id pdl set name name pdl set downloadurl downloadurl if pdl save count string sql update update m product set downloadurl null where m product id m product id int updated db execute update sql update null if updated 1 log warning product not updated else log warning product download not created m product id m product id rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info count m_productdownload getsqlvalue ad_client_id ad_org_id m_product_id m_product preparedstatement preparestatement resultset executequery ad_client_id getint ad_org_id getint m_product_id getint getstring getstring getctx setcontext ad_client_id ad_client_id setcontext ad_client_id ad_client_id setcontext ad_org_id ad_org_id setcontext ad_org_id ad_org_id mproductdownload mproductdownload setm_product_id m_product_id setname setdownloadurl sqlupdate m_product m_product_id m_product_id executeupdate sqlupdate m_product_id m_product_id migrate data param args ignored public static void main string args compiere startup true new migrate data migratedata standard constructor public x ad workbench properties ctx int ad workbench id string trx name super ctx ad workbench id trx name if ad workbench id 0 setad column id 0 setad workbench id 0 set entity type null u set name null x_ad_workbench ad_workbench_id trxname ad_workbench_id trxname ad_workbench_id setad_column_id setad_workbench_id setentitytype setname load constructor public x ad workbench properties ctx result set rs string trx name super ctx rs trx name x_ad_workbench resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workbench append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workbench get_id tostring set system color color for backgrounds or indicators public void setad color id object ad color id set value ad color id ad color id setad_color_id ad_color_id set_value ad_color_id ad_color_id get system color color for backgrounds or indicators public object getad color id return get value ad color id getad_color_id get_value ad_color_id public static final int ad column id ad reference id 244 set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id ad_column_id_ad_reference_id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set image system image or icon public void setad image id byte ad image id set value ad image id ad image id setad_image_id ad_image_id set_value ad_image_id ad_image_id get image system image or icon public byte getad image id return byte get value ad image id getad_image_id get_value ad_image_id set workbench collection of windows reports public void setad workbench id int ad workbench id if ad workbench id 1 throw new illegal argument exception ad workbench id is mandatory set valuenocheck ad workbench id new integer ad workbench id setad_workbench_id ad_workbench_id ad_workbench_id illegalargumentexception ad_workbench_id set_valuenocheck ad_workbench_id ad_workbench_id get workbench collection of windows reports public int getad workbench id integer ii integer get value ad workbench id if ii null return 0 return ii int value getad_workbench_id get_value ad_workbench_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname application action param action base action command used as ad message for text and icon name param accelerator optional keystroke for accelerator param toggle is toggle action maintains state public apps action string action key stroke accelerator boolean toggle this action accelerator null toggle ad_message appsaction keystroke application action param action base action command used as ad message for text and icon name param accelerator optional keystroke for accelerator param text text if null defered from action public apps action string action key stroke accelerator string text this action accelerator text false ad_message appsaction keystroke application action param action base action command used as ad message for text and icon name param accelerator optional keystroke for accelerator param tool tip text text if null defered from action param toggle is toggle action maintains state public apps action string action key stroke accelerator string tool tip text boolean toggle super m action action m accelerator accelerator m toggle toggle data if tool tip text null tool tip text msg get msg env get ctx action int pos tool tip text index of if pos 1 tool tip text length pos we have a nemonic creates alt character ch new character tool tip text to upper case char at pos 1 if ch tool tip text tool tip text substring 0 pos tool tip text substring pos 1 put value action mnemonic key new integer ch hash code icon small get icon action true icon large get icon action false icon large pressed null toggle icons have the pressed name with x if m toggle m smallpressed get icon action x true if m smallpressed null m smallpressed small large pressed get icon action x false if large pressed null large pressed large attributes put value action name tool tip text display put value action small icon small icon put value action short description tool tip text tooltip put value action action command key m action action cammand put value action accelerator key accelerator key stroke put value action mnemonic key new integer 0 mnemonic put value action default text not used create button if toggle m button new c toggle button this m button set selected icon large pressed else m button new c button this m button set name action correcting action items if large null m button set icon large m button set text null m button set action command m action m button set margin button insets m button set size button size if accelerator null m button get input map c button when in focused window put accelerator action m button get action map put action this ad_message tooltiptext appsaction keystroke tooltiptext m_action m_accelerator m_toggle tooltiptext tooltiptext getmsg getctx tooltiptext indexof tooltiptext _ tooltiptext touppercase charat tooltiptext tooltiptext tooltiptext putvalue mnemonic_key hashcode geticon geticon largepressed toggleicons m_toggle m_smallpressed geticon m_smallpressed m_smallpressed largepressed geticon largepressed largepressed putvalue tooltiptext putvalue small_icon putvalue short_description tooltiptext putvalue action_command_key m_action actioncammand putvalue accelerator_key keystroke putvalue mnemonic_key putvalue m_button ctogglebutton m_button setselectedicon largepressed m_button cbutton m_button setname m_button seticon m_button settext m_button setactioncommand m_action m_button setmargin button_insets m_button setsize button_size m_button getinputmap cbutton when_in_focused_window m_button getactionmap get icon with name action param name name param small small return icon private image icon get icon string name boolean small string full name name small 16 gif 24 gif return env get image icon full name imageicon geticon fullname getimageicon fullname get name action command return action name public string get name return m action actioncommand actionname getname m_action return button return button public abstract button get button return m button abstractbutton getbutton m_button return menu item return menu item public j menu item get menu item if m menu null if m toggle m menu new c check box menu item this m menu set selected icon m smallpressed else m menu new c menu item this m menu set accelerator m accelerator m menu set action command m action return m menu menuitem menuitem jmenuitem getmenuitem m_menu m_toggle m_menu ccheckboxmenuitem m_menu setselectedicon m_smallpressed m_menu cmenuitem m_menu setaccelerator m_accelerator m_menu setactioncommand m_action m_menu set delegate to receive the action performed calls param al listener public void set delegate action listener al m delegate al actionperformed setdelegate actionlistener m_delegate toggle param pressed pressed public void set pressed boolean pressed if m toggle return m pressed pressed set button m button set selected pressed set menu m menu set selected pressed setpressed m_toggle m_pressed m_button setselected m_menu setselected is pressed return true if pressed public boolean is pressed return m pressed ispressed ispressed m_pressed get mnemonic character return character public character get mnemonic object oo get value action mnemonic key if oo instanceof integer return char integer oo int value return null getmnemonic getvalue mnemonic_key intvalue action listener param e event public void action performed action event e log info apps action action performed e get action command toggle items if m toggle set pressed m pressed inform if m delegate null m delegate action performed e actionlistener actionperformed actionevent appsaction actionperformed getactioncommand m_toggle setpressed m_pressed m_delegate m_delegate actionperformed dispose public void dispose m button null m menu null m_button m_menu string info return string representation public string to string string buffer sb new string buffer apps action sb append m action object oo get value action accelerator key if oo null sb append accelerator append oo oo get mnemonic if oo null sb append mnemonic key append oo sb append return sb to string tostring stringbuffer stringbuffer appsaction m_action getvalue accelerator_key getmnemonic mnemonickey tostring standard constructor public x pa measure properties ctx int pa measure id string trx name super ctx pa measure id trx name if pa measure id 0 set measure data type null t set measure type null m set name null setpa measure id 0 x_pa_measure pa_measure_id trxname pa_measure_id trxname pa_measure_id setmeasuredatatype setmeasuretype setname setpa_measure_id load constructor public x pa measure properties ctx result set rs string trx name super ctx rs trx name x_pa_measure resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa measure append get id append return sb to string tostring stringbuffer stringbuffer x_pa_measure get_id tostring set project type type of the project public void setc projecttype id int c projecttype id if c projecttype id 0 set value c projecttype id null else set value c projecttype id new integer c projecttype id setc_projecttype_id c_projecttype_id c_projecttype_id set_value c_projecttype_id set_value c_projecttype_id c_projecttype_id get project type type of the project public int getc projecttype id integer ii integer get value c projecttype id if ii null return 0 return ii int value getc_projecttype_id get_value c_projecttype_id intvalue set calculation class java class for calculation implementing interface measure public void set calculation class string calculation class if calculation class null calculation class length 60 log warning length 60 truncated calculation class calculation class substring 0 59 set value calculation class calculation class setcalculationclass calculationclass calculationclass calculationclass calculationclass calculationclass set_value calculationclass calculationclass get calculation class java class for calculation implementing interface measure public string get calculation class return string get value calculation class getcalculationclass get_value calculationclass set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set manual actual manually entered actual value public void set manual actual big decimal manual actual set value manual actual manual actual setmanualactual bigdecimal manualactual set_value manualactual manualactual get manual actual manually entered actual value public big decimal get manual actual big decimal bd big decimal get value manual actual if bd null return env zero return bd bigdecimal getmanualactual bigdecimal bigdecimal get_value manualactual set note note for manual entry public void set manual note string manual note if manual note null manual note length 2000 log warning length 2000 truncated manual note manual note substring 0 1999 set value manual note manual note setmanualnote manualnote manualnote manualnote manualnote manualnote set_value manualnote manualnote get note note for manual entry public string get manual note return string get value manual note getmanualnote get_value manualnote public static final string measuredatatype qtyamountintime t set measure data type type of data status or in time public void set measure data type string measure data type if measure data type null throw new illegal argument exception measure data type is mandatory if measure data type equals s measure data type equals t else throw new illegal argument exception measure data type invalid value measure data type reference id 369 s t if measure data type length 1 log warning length 1 truncated measure data type measure data type substring 0 0 set value measure data type measure data type measuredatatype_qtyamountintime setmeasuredatatype measuredatatype measuredatatype illegalargumentexception measuredatatype measuredatatype measuredatatype illegalargumentexception measuredatatype measuredatatype reference_id measuredatatype measuredatatype measuredatatype set_value measuredatatype measuredatatype get measure data type type of data status or in time public string get measure data type return string get value measure data type getmeasuredatatype get_value measuredatatype public static final string measuretype userdefined u set measure type determines how the actual performance is derived public void set measure type string measure type if measure type null throw new illegal argument exception measure type is mandatory if measure type equals a measure type equals c measure type equals m measure type equals p measure type equals q measure type equals r measure type equals u else throw new illegal argument exception measure type invalid value measure type reference id 231 a c m p q r u if measure type length 1 log warning length 1 truncated measure type measure type substring 0 0 set value measure type measure type measuretype_userdefined setmeasuretype measuretype measuretype illegalargumentexception measuretype measuretype measuretype measuretype measuretype measuretype measuretype measuretype illegalargumentexception measuretype measuretype reference_id measuretype measuretype measuretype set_value measuretype measuretype get measure type determines how the actual performance is derived public string get measure type return string get value measure type getmeasuretype get_value measuretype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set benchmark performance benchmark public void setpa benchmark id int pa benchmark id if pa benchmark id 0 set value pa benchmark id null else set value pa benchmark id new integer pa benchmark id setpa_benchmark_id pa_benchmark_id pa_benchmark_id set_value pa_benchmark_id set_value pa_benchmark_id pa_benchmark_id get benchmark performance benchmark public int getpa benchmark id integer ii integer get value pa benchmark id if ii null return 0 return ii int value getpa_benchmark_id get_value pa_benchmark_id intvalue set reporting hierarchy optional reporting hierarchy if not selected the default hierarchy trees are used public void setpa hierarchy id int pa hierarchy id if pa hierarchy id 0 set value pa hierarchy id null else set value pa hierarchy id new integer pa hierarchy id setpa_hierarchy_id pa_hierarchy_id pa_hierarchy_id set_value pa_hierarchy_id set_value pa_hierarchy_id pa_hierarchy_id get reporting hierarchy optional reporting hierarchy if not selected the default hierarchy trees are used public int getpa hierarchy id integer ii integer get value pa hierarchy id if ii null return 0 return ii int value getpa_hierarchy_id get_value pa_hierarchy_id intvalue set measure calculation calculation method for measuring performance public void setpa measurecalc id int pa measurecalc id if pa measurecalc id 0 set value pa measurecalc id null else set value pa measurecalc id new integer pa measurecalc id setpa_measurecalc_id pa_measurecalc_id pa_measurecalc_id set_value pa_measurecalc_id set_value pa_measurecalc_id pa_measurecalc_id get measure calculation calculation method for measuring performance public int getpa measurecalc id integer ii integer get value pa measurecalc id if ii null return 0 return ii int value getpa_measurecalc_id get_value pa_measurecalc_id intvalue set measure concrete performance measurement public void setpa measure id int pa measure id if pa measure id 1 throw new illegal argument exception pa measure id is mandatory set valuenocheck pa measure id new integer pa measure id setpa_measure_id pa_measure_id pa_measure_id illegalargumentexception pa_measure_id set_valuenocheck pa_measure_id pa_measure_id get measure concrete performance measurement public int getpa measure id integer ii integer get value pa measure id if ii null return 0 return ii int value getpa_measure_id get_value pa_measure_id intvalue set ratio performace ratio public void setpa ratio id int pa ratio id if pa ratio id 0 set value pa ratio id null else set value pa ratio id new integer pa ratio id setpa_ratio_id pa_ratio_id pa_ratio_id set_value pa_ratio_id set_value pa_ratio_id pa_ratio_id get ratio performace ratio public int getpa ratio id integer ii integer get value pa ratio id if ii null return 0 return ii int value getpa_ratio_id get_value pa_ratio_id intvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 0 set value r requesttype id null else set value r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id set_value r_requesttype_id set_value r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue e mail dialog param owner calling window param title title param from from param to to param subject subject param message message param attachment optional attachment public e mail dialog dialog owner string title m user from string to string subject string message file attachment super owner title true common init from to subject message attachment email emaildialog muser commoninit e mail dialog param owner calling window param title title param from from param to to param subject subject param message message param attachment optional attachment public e mail dialog frame owner string title m user from string to string subject string message file attachment super owner title true common init from to subject message attachment email emaildialog muser commoninit common init param from from param to to param subject subject param message message param attachment optional attachment private void common init m user from string to string subject string message file attachment m client m client get env get ctx try int window no 0 int ad column id 0 lookup lookup m lookup factory get env get ctx window no ad column id display type search env get language env get ctx ad user id 0 false e mail is not null f user new v lookup ad user id false false true lookup f user add vetoable change listener this jb init catch exception ex log log level severe e mail dialog ex set from to subject message set attachment attachment a env show center screen this commoninit muser m_client mclient getctx windowno ad_column_id mlookupfactory getctx windowno ad_column_id displaytype getlanguage getctx ad_user_id email fuser vlookup ad_user_id fuser addvetoablechangelistener jbinit emaildialog setattachment aenv showcenterscreen static init void jb init throws exception l from set text msg get msg env get ctx from l to set text msg get msg env get ctx to l subject set text msg get msg env get ctx subject l attachment set text msg get msg env get ctx attachment f from set read write false main panel set layout main layout header panel set layout header layout main layout set hgap 5 main layout set vgap 5 f message set preferred size new dimension 150 150 get content pane add main panel main panel add header panel border layout north header panel add l from new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 10 0 5 0 0 header panel add f from new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 10 0 0 header panel add l to new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 10 0 5 0 0 header panel add f user new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints horizontal new insets 0 0 0 10 0 0 header panel add f to new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 0 10 0 0 header panel add l subject new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 10 0 5 0 0 header panel add f subject new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 10 1 0 header panel add l attachment new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 10 0 5 0 0 header panel add f attachment new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 10 1 0 main panel add f message border layout center main panel add confirm panel border layout south this get content pane add status bar border layout south confirm panel add action listener this status bar set statusdb null jbinit lfrom settext getmsg getctx lto settext getmsg getctx lsubject settext getmsg getctx lattachment settext getmsg getctx ffrom setreadwrite mainpanel setlayout mainlayout headerpanel setlayout headerlayout mainlayout sethgap mainlayout setvgap fmessage setpreferredsize getcontentpane mainpanel mainpanel headerpanel borderlayout headerpanel lfrom gridbagconstraints gridbagconstraints gridbagconstraints headerpanel ffrom gridbagconstraints gridbagconstraints gridbagconstraints headerpanel lto gridbagconstraints gridbagconstraints gridbagconstraints headerpanel fuser gridbagconstraints gridbagconstraints gridbagconstraints headerpanel fto gridbagconstraints gridbagconstraints gridbagconstraints headerpanel lsubject gridbagconstraints gridbagconstraints gridbagconstraints headerpanel fsubject gridbagconstraints gridbagconstraints gridbagconstraints headerpanel lattachment gridbagconstraints gridbagconstraints gridbagconstraints headerpanel fattachment gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fmessage borderlayout mainpanel confirmpanel borderlayout getcontentpane statusbar borderlayout confirmpanel addactionlistener statusbar setstatusdb set all properties public void set m user from string to string subject string message content set from from set to to set subject subject set message message status bar set status line m client getsmtp host muser setfrom setto setsubject setmessage statusbar setstatusline m_client getsmtphost set address public void set to string new to m to new to f to set text m to setto newto m_to newto fto settext m_to get address public string get to m to f to get text return m to getto m_to fto gettext m_to set sender public void set from m user new from m from new from if new from null new from ise mail valid new from is can sende mail confirm panel getok button set enabled false f from set text invalid else f from set text m from gete mail setfrom muser newfrom m_from newfrom newfrom newfrom isemailvalid newfrom iscansendemail confirmpanel getokbutton setenabled ffrom settext ffrom settext m_from getemail get sender public m user get from return m from muser getfrom m_from set subject public void set subject string new subject m subject new subject f subject set text m subject setsubject newsubject m_subject newsubject fsubject settext m_subject get subject public string get subject m subject f subject get text return m subject getsubject m_subject fsubject gettext m_subject set message public void set message string new message m message new message f message set text m message f message set caret position 0 setmessage newmessage m_message newmessage fmessage settext m_message fmessage setcaretposition get message public string get message m message f message get text return m message getmessage m_message fmessage gettext m_message set attachment public void set attachment file attachment m attachfile attachment if attachment null l attachment set visible false f attachment set visible false else l attachment set visible true f attachment set visible true f attachment set text attachment get name f attachment set read write false setattachment m_attachfile lattachment setvisible fattachment setvisible lattachment setvisible fattachment setvisible fattachment settext getname fattachment setreadwrite get attachment public file get attachment return m attachfile getattachment m_attachfile action listener send email public void action performed action event e if get to null get to length 0 return send if e get action command equals confirm panel a ok set cursor cursor get predefined cursor cursor wait cursor confirm panel getok button set enabled false string tokenizer st new string tokenizer get to false string to st next token e mail email m client createe mail get from to get subject get message string status check setup if email null while st has more tokens email add to st next token attachment if m attachfile null m attachfile exists email add attachment m attachfile status email send if m user null new m user mail m user m user getad user id email save if email is sentok a dialog info 0 this message sent dispose else a dialog error 0 this message not sent status else a dialog error 0 this message not sent status confirm panel getok button set enabled false set cursor cursor get default cursor else if e get action command equals confirm panel a cancel dispose actionperformed actionevent getto getto getactioncommand confirmpanel a_ok setcursor getpredefinedcursor wait_cursor confirmpanel getokbutton setenabled stringtokenizer stringtokenizer getto nexttoken email m_client createemail getfrom getsubject getmessage hasmoretokens addto nexttoken m_attachfile m_attachfile addattachment m_attachfile m_user musermail m_user m_user getad_user_id issentok adialog messagesent adialog messagenotsent adialog messagenotsent confirmpanel getokbutton setenabled setcursor getdefaultcursor getactioncommand confirmpanel a_cancel vetoable change user selected param evt throws property veto exception public void vetoable change property change event evt throws property veto exception object value evt get new value log info value value if value null f to set text if value instanceof integer int ad user id integer value int value m user m user get env get ctx ad user id f to set value m user gete mail propertyvetoexception vetoablechange propertychangeevent propertyvetoexception getnewvalue fto settext ad_user_id intvalue m_user muser getctx ad_user_id fto setvalue m_user getemail constructor param ass accounting schemata param rs record parem trx name trx protected doc allocation m acct schema ass result set rs string trx name super ass m allocation hdr class rs doctype allocation trx name trxname doc_allocation macctschema resultset trxname mallocationhdr doctype_allocation trxname load specific document details return error message or null protected string load document details m allocation hdr alloc m allocation hdr getpo set date doc alloc get date trx contained objects p lines load lines alloc return null loaddocumentdetails mallocationhdr mallocationhdr setdatedoc getdatetrx p_lines loadlines load invoice line return doc line array private doc line load lines m allocation hdr alloc array list doc line list new array list doc line m allocation line lines alloc get lines false for int i 0 i lines length i m allocation line line lines i docline allocation doc line new docline allocation line this get payment conversion rate if line getc payment id 0 m payment payment new m payment get ctx line getc payment id get trx name int c conversiontype id payment getc conversiontype id doc line setc conversiontype id c conversiontype id log fine doc line to string list add doc line return array doc line dls new doc line list size list to array dls return dls docline docline loadlines mallocationhdr arraylist docline arraylist docline mallocationline getlines mallocationline docline_allocation docline docline_allocation getc_payment_id mpayment mpayment getctx getc_payment_id gettrxname c_conversiontype_id getc_conversiontype_id docline setc_conversiontype_id c_conversiontype_id docline tostring docline docline docline toarray get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for cma pre ar invoice payment un allocated cash dr or c prepayment discount exp dr write off dr receivables cr ar invoice cash cash transfer dr discount exp dr write off dr receivables cr ap invoice payment liability dr discount rev cr write off cr payment select cr or v prepayment ap invoice cash liability dr discount rev cr write off cr cash transfer cr cash bank transfer realized gain loss ar ap dr cr realized g l dr cr pre tax needs to be corrected for discount write off currency gain loss is realized here param as accounting schema return fact public array list fact create facts m acct schema as m facts new array list fact create fact header fact fact new fact this as fact post actual for int i 0 i p lines length i docline allocation line docline allocation p lines i setc bpartner id line getc bpartner id cash bank transfer all references null and discount write off 0 if line getc payment id 0 line getc invoice id 0 line getc order id 0 line getc cashline id 0 line getc bpartner id 0 env zero compare to line get discount amt 0 env zero compare to line get write off amt 0 continue receivables liability amt big decimal allocation source line get amt source add line get discount amt add line get write off amt big decimal allocation accounted null ar ap balance corrected fact line fl null m account bp acct null liability receivables m payment payment null if line getc payment id 0 payment new m payment get ctx line getc payment id get trx name m invoice invoice null if line getc invoice id 0 invoice new m invoice get ctx line getc invoice id null no invoice if invoice null payment only if line getc invoice id 0 line getc payment id 0 fl fact create line line get payment acct as line getc payment id getc currency id line get amt source null if fl null payment null fl setad org id payment getad org id else p error cannot determine so po log log level severe p error return null sales invoice else if invoice isso trx payment cash dr if line getc payment id 0 fl fact create line line get payment acct as line getc payment id getc currency id line get amt source null if fl null payment null fl setad org id payment getad org id else if line getc cashline id 0 fl fact create line line get cash acct as line getc cashline id getc currency id line get amt source null m cash line cash line new m cash line get ctx line getc cashline id get trx name if fl null cash line get id 0 fl setad org id cash line getad org id discount dr if env zero compare to line get discount amt 0 fl fact create line line get account doc accttype discountexp as getc currency id line get discount amt null if fl null payment null fl setad org id payment getad org id write off dr if env zero compare to line get write off amt 0 fl fact create line line get account doc accttype writeoff as getc currency id line get write off amt null if fl null payment null fl setad org id payment getad org id ar invoice amount cr if as is accrual bp acct get account doc accttype c receivable as fl fact create line line bp acct getc currency id null allocation source payment currency if fl null allocation accounted fl get acct balance negate if fl null invoice null fl setad org id invoice getad org id else cash based allocation accounted create cash based acct as fact invoice allocation source purchase invoice else allocation source allocation source negate allocation is negative ap invoice amount dr if as is accrual bp acct get account doc accttype v liability as fl fact create line line bp acct getc currency id allocation source null payment currency if fl null allocation accounted fl get acct balance if fl null invoice null fl setad org id invoice getad org id else cash based allocation accounted create cash based acct as fact invoice allocation source discount cr if env zero compare to line get discount amt 0 fl fact create line line get account doc accttype discountrev as getc currency id null line get discount amt negate if fl null payment null fl setad org id payment getad org id write off cr if env zero compare to line get write off amt 0 fl fact create line line get account doc accttype writeoff as getc currency id null line get write off amt negate if fl null payment null fl setad org id payment getad org id payment cash cr if line getc payment id 0 fl fact create line line get payment acct as line getc payment id getc currency id null line get amt source negate if fl null payment null fl setad org id payment getad org id else if line getc cashline id 0 fl fact create line line get cash acct as line getc cashline id getc currency id null line get amt source negate m cash line cash line new m cash line get ctx line getc cashline id get trx name if fl null cash line get id 0 fl setad org id cash line getad org id vat tax correction if as is discount corrects tax invoice null big decimal tax correction amt line get discount amt add line get write off amt if as is discount corrects tax env zero compare to tax correction amt 0 if create tax correction as fact line get account invoice isso trx doc accttype discountexp doc accttype discountrev as get account doc accttype writeoff as p error cannot create tax correction return null realized gain loss if invoice null getc currency id as getc currency id payment allocation in foreign currency getc currency id line getinvoicec currency id allocation invoice currency p error create realized gain loss as fact bp acct invoice allocation source allocation accounted if p error null return null for all lines reset line info setc bpartner id 0 m facts add fact return m facts ar_invoice_payment unallocatedcash c_prepayment discountexp writeoff ar_invoice_cash cashtransfer discountexp writeoff ap_invoice_payment discountrev writeoff paymentselect v_prepayment ap_invoice_cash discountrev writeoff cashtransfer cashbanktransfer arraylist createfacts macctschema m_facts arraylist post_actual p_lines docline_allocation docline_allocation p_lines setc_bpartner_id getc_bpartner_id cashbanktransfer writeoff getc_payment_id getc_invoice_id getc_order_id getc_cashline_id getc_bpartner_id compareto getdiscountamt compareto getwriteoffamt bigdecimal allocationsource getamtsource getdiscountamt getwriteoffamt bigdecimal allocationaccounted factline maccount bpacct mpayment getc_payment_id mpayment getctx getc_payment_id gettrxname minvoice getc_invoice_id minvoice getctx getc_invoice_id getc_invoice_id getc_payment_id createline getpaymentacct getc_payment_id getc_currency_id getamtsource setad_org_id getad_org_id p_error p_error issotrx getc_payment_id createline getpaymentacct getc_payment_id getc_currency_id getamtsource setad_org_id getad_org_id getc_cashline_id createline getcashacct getc_cashline_id getc_currency_id getamtsource mcashline cashline mcashline getctx getc_cashline_id gettrxname cashline get_id setad_org_id cashline getad_org_id compareto getdiscountamt createline getaccount accttype_discountexp getc_currency_id getdiscountamt setad_org_id getad_org_id compareto getwriteoffamt createline getaccount accttype_writeoff getc_currency_id getwriteoffamt setad_org_id getad_org_id isaccrual bpacct getaccount accttype_c_receivable createline bpacct getc_currency_id allocationsource allocationaccounted getacctbalance setad_org_id getad_org_id allocationaccounted createcashbasedacct allocationsource allocationsource allocationsource isaccrual bpacct getaccount accttype_v_liability createline bpacct getc_currency_id allocationsource allocationaccounted getacctbalance setad_org_id getad_org_id allocationaccounted createcashbasedacct allocationsource compareto getdiscountamt createline getaccount accttype_discountrev getc_currency_id getdiscountamt setad_org_id getad_org_id compareto getwriteoffamt createline getaccount accttype_writeoff getc_currency_id getwriteoffamt setad_org_id getad_org_id getc_payment_id createline getpaymentacct getc_payment_id getc_currency_id getamtsource setad_org_id getad_org_id getc_cashline_id createline getcashacct getc_cashline_id getc_currency_id getamtsource mcashline cashline mcashline getctx getc_cashline_id gettrxname cashline get_id setad_org_id cashline getad_org_id isdiscountcorrectstax bigdecimal taxcorrectionamt getdiscountamt getwriteoffamt isdiscountcorrectstax compareto taxcorrectionamt createtaxcorrection getaccount issotrx accttype_discountexp accttype_discountrev getaccount accttype_writeoff p_error getc_currency_id getc_currency_id getc_currency_id getinvoicec_currency_id p_error createrealizedgainloss bpacct allocationsource allocationaccounted p_error setc_bpartner_id m_facts m_facts create cash based acct param fact fact param invoice invoice param allocation source allocation amount incl discount writeoff return accounted amt private big decimal create cash based acct m acct schema as fact fact m invoice invoice big decimal allocation source big decimal allocation accounted env zero multiplier double percent invoice get grand total double value allocation source double value if percent 0 99 percent 1 01 percent 1 0 log config multiplier percent grand total invoice get grand total allocation source allocation source get invoice postings doc invoice doc invoice doc invoice doc get new m acct schema as m invoice table id invoice getc invoice id get trx name doc invoice load document details allocation accounted doc invoice create fact cash as fact new big decimal percent log config allocation accounted allocation accounted cash based commitment release if as is create commitment invoice isso trx m invoice line lines invoice get lines for int i 0 i lines length i fact factc doc order get commitment release as this lines i get qty invoiced lines i getc invoiceline id new big decimal percent if factc null return null m facts add factc commitment return allocation accounted allocationsource bigdecimal createcashbasedacct macctschema minvoice bigdecimal allocationsource bigdecimal allocationaccounted getgrandtotal doublevalue allocationsource doublevalue grandtotal getgrandtotal allocationsource doc_invoice docinvoice doc_invoice macctschema minvoice table_id getc_invoice_id gettrxname docinvoice loaddocumentdetails allocationaccounted docinvoice createfactcash bigdecimal allocationaccounted iscreatecommitment issotrx minvoiceline getlines doc_order getcommitmentrelease getqtyinvoiced getc_invoiceline_id bigdecimal m_facts allocationaccounted get payment unallocated payment or payment selection acct of bank account param as accounting schema param c payment id payment return acct private m account get payment acct m acct schema as int c payment id setc bankaccount id 0 doc accttype unallocatedcash ar or c prepayment or doc accttype paymentselect ap or v prepayment int account type doc accttype unallocatedcash string sql select p c bankaccount id d doc base type p is receipt p is prepayment from c payment p inner join c doctype d on p c doctype id d c doctype id where c payment id prepared statement pstmt null try pstmt db prepare statement sql get trx name pstmt set int 1 c payment id result set rs pstmt execute query if rs next setc bankaccount id rs get int 1 if doctype appayment equals rs get string 2 account type doc accttype paymentselect prepayment if y equals rs get string 4 prepayment if y equals rs get string 3 receipt account type doc accttype c prepayment else account type doc accttype v prepayment rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if getc bankaccount id 0 log log level severe none for c payment id c payment id return null return get account account type as c_payment_id maccount getpaymentacct macctschema c_payment_id setc_bankaccount_id accttype_unallocatedcash c_prepayment accttype_paymentselect v_prepayment accounttype accttype_unallocatedcash c_bankaccount_id docbasetype isreceipt isprepayment c_payment c_doctype c_doctype_id c_doctype_id c_payment_id preparedstatement preparestatement gettrxname setint c_payment_id resultset executequery setc_bankaccount_id getint doctype_appayment getstring accounttype accttype_paymentselect getstring getstring accounttype accttype_c_prepayment accounttype accttype_v_prepayment getc_bankaccount_id c_payment_id c_payment_id getaccount accounttype get cash transfer acct of cash book param as accounting schema param c cashline id return acct private m account get cash acct m acct schema as int c cashline id string sql select c c cashbook id from c cash c c cashline cl where c c cash id cl c cash id and cl c cashline id setc cashbook id db getsql value null sql c cashline id if getc cashbook id 0 log log level severe none for c cashline id c cashline id return null return get account doc accttype cashtransfer as cashbook c_cashline_id maccount getcashacct macctschema c_cashline_id c_cashbook_id c_cash c_cashline c_cash_id c_cash_id c_cashline_id setc_cashbook_id getsqlvalue c_cashline_id getc_cashbook_id c_cashline_id c_cashline_id getaccount accttype_cashtransfer create realized gain loss compares the accounted amount of the invoice to the accounted amount of the allocation param as accounting schema param fact fact param invoice invoice param allocation source source amt param allocation accounted acct amt return error message or null if ok private string create realized gain loss m acct schema as fact fact m account acct m invoice invoice big decimal allocation source big decimal allocation accounted big decimal invoice source null big decimal invoice accounted null string sql select invoice isso trx sum amt source dr sum amt acct dr so sum amt source cr sum amt acct cr po from fact acct where ad table id 318 and record id invoice and c acctschema id and posting type a and c currency id 102 prepared statement pstmt null try pstmt db prepare statement sql get trx name pstmt set int 1 invoice getc invoice id pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next invoice source rs get big decimal 1 invoice accounted rs get big decimal 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null requires that invoice is posted if invoice source null invoice accounted null return gain loss invoice not posted yet string description invoice invoice getc currency id invoice source invoice accounted allocation getc currency id allocation source allocation accounted log fine description allocation not invoice currency if getc currency id invoice getc currency id big decimal allocation source new m conversion rate convert get ctx allocation source getc currency id invoice getc currency id get date acct invoice getc conversiontype id invoice getad client id invoice getad org id if allocation source new null return gain loss no conversion from allocation invoice string d2 allocation getc currency id allocation source invoice getc currency id allocation source new log fine d2 description d2 allocation source allocation source new big decimal acct difference null gain is negative full payment in currency if allocation source compare to invoice source 0 acct difference invoice accounted subtract allocation accounted gain is negative string d2 full acct difference log fine d2 description d2 else partial or mc percent of total payment double multiplier allocation source double value invoice source double value reduce orig invoice accounted invoice accounted invoice accounted multiply new big decimal multiplier difference based on percentage of orig invoice acct difference invoice accounted subtract allocation accounted gain is negative ignore tolerance if acct difference abs compare to tolerance 0 acct difference env zero round int precision as get std precision if acct difference scale precision acct difference acct difference set scale precision big decimal round half up string d2 partial acct difference multiplier multiplier log fine d2 description d2 if acct difference signum 0 log fine no difference return null m account gain m account get as get ctx as get acct schema default getrealizedgain acct m account loss m account get as get ctx as get acct schema default getrealizedloss acct if invoice isso trx fact line fl fact create line null loss gain as getc currency id acct difference fl set description description fact create line null acct as getc currency id acct difference negate fl set description description else fact create line null acct as getc currency id acct difference fact line fl fact create line null loss gain as getc currency id acct difference negate return null allocationsource allocationaccounted createrealizedgainloss macctschema maccount minvoice bigdecimal allocationsource bigdecimal allocationaccounted bigdecimal invoicesource bigdecimal invoiceaccounted issotrx amtsourcedr amtacctdr amtsourcecr amtacctcr fact_acct ad_table_id record_id c_acctschema_id postingtype c_currency_id preparedstatement preparestatement gettrxname setint getc_invoice_id setint getc_acctschema_id resultset executequery invoicesource getbigdecimal invoiceaccounted getbigdecimal invoicesource invoiceaccounted getc_currency_id invoicesource invoiceaccounted getc_currency_id allocationsource allocationaccounted getc_currency_id getc_currency_id bigdecimal allocationsourcenew mconversionrate getctx allocationsource getc_currency_id getc_currency_id getdateacct getc_conversiontype_id getad_client_id getad_org_id allocationsourcenew getc_currency_id allocationsource getc_currency_id allocationsourcenew allocationsource allocationsourcenew bigdecimal acctdifference allocationsource compareto invoicesource acctdifference invoiceaccounted allocationaccounted acctdifference allocationsource doublevalue invoicesource doublevalue invoiceaccounted invoiceaccounted bigdecimal acctdifference invoiceaccounted allocationaccounted acctdifference compareto acctdifference getstdprecision acctdifference acctdifference acctdifference setscale bigdecimal round_half_up acctdifference acctdifference maccount maccount getctx getacctschemadefault getrealizedgain_acct maccount maccount getctx getacctschemadefault getrealizedloss_acct issotrx factline createline getc_currency_id acctdifference setdescription createline getc_currency_id acctdifference setdescription createline getc_currency_id acctdifference factline createline getc_currency_id acctdifference create tax correction requirement adjust the tax amount if you did not receive the full amount of the invoice payment discount write off applies to many countries with vat example invoice net 100 tax1 15 tax2 5 total 120 payment 115 i e 5 underpayment tax adjustment tax1 0 63 15 120 5 tax2 0 21 5 120 5 param as accounting schema param fact fact param discount account discount acct param write off accoint write off acct return true if created private boolean create tax correction m acct schema as fact fact docline allocation line m account discount account m account write off accoint log info create tax correction line doc allocationtax tax new doc allocationtax discount account line get discount amt write off accoint line get write off amt get source amounts with account string sql select from fact acct where ad table id 318 and record id invoice and c acctschema id and line id is null header lines like tax or total prepared statement pstmt null try pstmt db prepare statement sql get trx name pstmt set int 1 line getc invoice id pstmt set int 2 as getc acctschema id result set rs pstmt execute query while rs next tax add invoice fact new m fact acct get ctx rs fact get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null invoice not posted if tax get line count 0 log warning invoice not posted yet line return false size 1 if no tax if tax get line count 2 return true return tax create entries as fact line discountaccount writeoffaccoint createtaxcorrection macctschema docline_allocation maccount discountaccount maccount writeoffaccoint createtaxcorrection doc_allocationtax doc_allocationtax discountaccount getdiscountamt writeoffaccoint getwriteoffamt fact_acct ad_table_id record_id c_acctschema_id line_id preparedstatement preparestatement gettrxname setint getc_invoice_id setint getc_acctschema_id resultset executequery addinvoicefact mfactacct getctx get_trxname getlinecount getlinecount createentries allocation tax adjustment param discount account discount acct param discount amt discount amt param write off account write off acct param write off amt write off amt public doc allocationtax m account discount account big decimal discount amt m account write off account big decimal write off amt m discountaccount discount account m discountamt discount amt m writeoffaccount write off account m writeoffamt write off amt discountaccount discountamt writeoffaccount writeoffamt doc_allocationtax maccount discountaccount bigdecimal discountamt maccount writeoffaccount bigdecimal writeoffamt m_discountaccount discountaccount m_discountamt discountamt m_writeoffaccount writeoffaccount m_writeoffamt writeoffamt add invoice fact line param fact fact line public void add invoice fact m fact acct fact m facts add fact addinvoicefact mfactacct m_facts get line count return number of lines public int get line count return m facts size getlinecount m_facts create accounting entries param as account schema param fact fact to add lines return true if created public boolean create entries m acct schema as fact fact doc line line get total index the receivables liabilities line big decimal total env zero for int i 0 i m facts size i m fact acct fact acct m fact acct m facts get i if fact acct get amt source dr compare to total 0 total fact acct get amt source dr m totalindex i if fact acct get amt source cr compare to total 0 total fact acct get amt source cr m totalindex i m fact acct fact acct m fact acct m facts get m totalindex log info create entries total invoice total fact acct int precision as get std precision for int i 0 i m facts size i no tax line if i m totalindex continue fact acct m fact acct m facts get i log info i fact acct create tax account m account tax acct fact acct getm account if tax acct null tax acct get id 0 log severe tax account not found created return false discount amount if env zero compare to m discountamt 0 original tax is dr need to correct it cr if env zero compare to fact acct get amt source dr 0 big decimal amount calc amount fact acct get amt source dr total m discountamt precision if amount signum 0 fact create line line m discountaccount as getc currency id amount null fact create line line tax acct as getc currency id null amount original tax is cr need to correct it dr else big decimal amount calc amount fact acct get amt source cr total m discountamt precision if amount signum 0 fact create line line tax acct as getc currency id amount null fact create line line m discountaccount as getc currency id null amount discount write off amount if env zero compare to m writeoffamt 0 original tax is dr need to correct it cr if env zero compare to fact acct get amt source dr 0 big decimal amount calc amount fact acct get amt source dr total m writeoffamt precision if amount signum 0 fact create line line m writeoffaccount as getc currency id amount null fact create line line tax acct as getc currency id null amount original tax is cr need to correct it dr else big decimal amount calc amount fact acct get amt source cr total m writeoffamt precision if amount signum 0 fact create line line tax acct as getc currency id amount null fact create line line m writeoffaccount as getc currency id null amount write off for all lines return true createentries macctschema docline bigdecimal m_facts mfactacct factacct mfactacct m_facts factacct getamtsourcedr compareto factacct getamtsourcedr m_totalindex factacct getamtsourcecr compareto factacct getamtsourcecr m_totalindex mfactacct factacct mfactacct m_facts m_totalindex createentries factacct getstdprecision m_facts m_totalindex factacct mfactacct m_facts factacct maccount taxacct factacct getmaccount taxacct taxacct get_id compareto m_discountamt compareto factacct getamtsourcedr bigdecimal calcamount factacct getamtsourcedr m_discountamt createline m_discountaccount getc_currency_id createline taxacct getc_currency_id bigdecimal calcamount factacct getamtsourcecr m_discountamt createline taxacct getc_currency_id createline m_discountaccount getc_currency_id writeoff compareto m_writeoffamt compareto factacct getamtsourcedr bigdecimal calcamount factacct getamtsourcedr m_writeoffamt createline m_writeoffaccount getc_currency_id createline taxacct getc_currency_id bigdecimal calcamount factacct getamtsourcecr m_writeoffamt createline taxacct getc_currency_id createline m_writeoffaccount getc_currency_id writeoff calc amount tax total amt param tax tax param total total param amt reduction amt param precision precision return tax total amt private big decimal calc amount big decimal tax big decimal total big decimal amt int precision log fine tax tax total total amt amt if tax signum 0 total signum 0 amt signum 0 return env zero big decimal percentage tax divide total 10 big decimal round half up big decimal ret value percentage multiply amt if ret value scale precision ret value ret value set scale precision big decimal round half up log fine calc amount percentage percentage result ret value big decimal ret value tax multiply amt divide total precision big decimal round half up log fine result ret value return ret value bigdecimal calcamount bigdecimal bigdecimal bigdecimal bigdecimal bigdecimal round_half_up bigdecimal retvalue retvalue retvalue retvalue setscale bigdecimal round_half_up calcamount retvalue bigdecimal retvalue bigdecimal round_half_up retvalue retvalue standard constructor public x m lotctlexclude properties ctx int m lotctlexclude id string trx name super ctx m lotctlexclude id trx name if m lotctlexclude id 0 setad table id 0 set isso trx false setm lotctlexclude id 0 setm lotctl id 0 x_m_lotctlexclude m_lotctlexclude_id trxname m_lotctlexclude_id trxname m_lotctlexclude_id setad_table_id setissotrx setm_lotctlexclude_id setm_lotctl_id load constructor public x m lotctlexclude properties ctx result set rs string trx name super ctx rs trx name x_m_lotctlexclude resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m lotctlexclude append get id append return sb to string tostring stringbuffer stringbuffer x_m_lotctlexclude get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set exclude lot exclude the ability to create lots in attribute sets public void setm lotctlexclude id int m lotctlexclude id if m lotctlexclude id 1 throw new illegal argument exception m lotctlexclude id is mandatory set valuenocheck m lotctlexclude id new integer m lotctlexclude id setm_lotctlexclude_id m_lotctlexclude_id m_lotctlexclude_id illegalargumentexception m_lotctlexclude_id set_valuenocheck m_lotctlexclude_id m_lotctlexclude_id get exclude lot exclude the ability to create lots in attribute sets public int getm lotctlexclude id integer ii integer get value m lotctlexclude id if ii null return 0 return ii int value getm_lotctlexclude_id get_value m_lotctlexclude_id intvalue set lot control product lot control public void setm lotctl id int m lotctl id if m lotctl id 1 throw new illegal argument exception m lotctl id is mandatory set valuenocheck m lotctl id new integer m lotctl id setm_lotctl_id m_lotctl_id m_lotctl_id illegalargumentexception m_lotctl_id set_valuenocheck m_lotctl_id m_lotctl_id get lot control product lot control public int getm lotctl id integer ii integer get value m lotctl id if ii null return 0 return ii int value getm_lotctl_id get_value m_lotctl_id intvalue get organizational access of role param ctx context param ad role id role return array of role org access public static m role org access get of role properties ctx int ad role id return get ctx select from ad role orgaccess where ad role id ad role id ad_role_id mroleorgaccess getofrole ad_role_id ad_role_orgaccess ad_role_id ad_role_id get organizational access of client param ctx context param ad client id client return array of role org access public static m role org access get of client properties ctx int ad client id return get ctx select from ad role orgaccess where ad client id ad client id ad_client_id mroleorgaccess getofclient ad_client_id ad_role_orgaccess ad_client_id ad_client_id get organizational access of org param ctx context param ad org id role return array of role org access public static m role org access get of org properties ctx int ad org id return get ctx select from ad role orgaccess where ad org id ad org id ad_org_id mroleorgaccess getoforg ad_org_id ad_role_orgaccess ad_org_id ad_org_id get organizational info param ctx context param sql sql command param id id return array of role org access private static m role org access get properties ctx string sql int id array list m role org access list new array list m role org access prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 id result set rs pstmt execute query while rs next list add new m role org access ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null m role org access ret value new m role org access list size list to array ret value return ret value mroleorgaccess arraylist mroleorgaccess arraylist mroleorgaccess preparedstatement preparestatement setint resultset executequery mroleorgaccess s_log mroleorgaccess retvalue mroleorgaccess toarray retvalue retvalue create organizational access for all automatic roles param org org return true if created public static boolean create for org m org org int counter 0 m role roles m role get of client org get ctx for int i 0 i roles length i if roles i is manual m role org access org access new m role org access org roles i getad role id if org access save counter s log info org created counter return counter 0 createfororg morg mrole mrole getofclient getctx ismanual mroleorgaccess orgaccess mroleorgaccess getad_role_id orgaccess s_log load constructor param ctx context param rs result set public m role org access properties ctx result set rs string trx name super ctx rs trx name mroleorgaccess resultset trxname trxname persistency constructor param ctx context param ignored ignored public m role org access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set is read only false mroleorgaccess trxname trxname illegalargumentexception setisreadonly organization constructor param org org param ad role id role public m role org access m org org int ad role id this org get ctx 0 org get trxname set client org org setad role id ad role id ad_role_id mroleorgaccess morg ad_role_id getctx get_trxname setclientorg setad_role_id ad_role_id role constructor param role role param ad org id org public m role org access m role role int ad org id this role get ctx 0 role get trxname set client org role getad client id ad org id setad role id role getad role id ad_org_id mroleorgaccess mrole ad_org_id getctx get_trxname setclientorg getad_client_id ad_org_id setad_role_id getad_role_id string representation return info public string to string string buffer sb new string buffer m role org access sb append ad role id append getad role id append ad client id append getad client id append ad org id append getad org id append ro append is read only sb append return sb to string tostring stringbuffer stringbuffer mroleorgaccess ad_role_id getad_role_id ad_client_id getad_client_id ad_org_id getad_org_id isreadonly tostring extended string representation return extended info public string to stringx properties ctx string buffer sb new string buffer sb append msg translate ctx ad client id append append get client name append append msg translate ctx ad org id append append get org name return sb to string tostringx stringbuffer stringbuffer ad_client_id getclientname ad_org_id getorgname tostring get client name return name public string get client name if m clientname null string sql select c name o name from ad client c inner join ad org o on c ad client id o ad client id where o ad org id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad org id result set rs pstmt execute query if rs next m clientname rs get string 1 m orgname rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe get client name e try if pstmt null pstmt close pstmt null catch exception e pstmt null return m clientname getclientname m_clientname ad_client ad_org ad_client_id ad_client_id ad_org_id preparedstatement preparestatement setint getad_org_id resultset executequery m_clientname getstring m_orgname getstring getclientname m_clientname get client name return name public string get org name if m orgname null get client name return m orgname getorgname m_orgname getclientname m_orgname string representation return info public string to string return remote setupvo test test id range id range start id range end ad client id ad client id ad org id ad org id prefix prefix suffix suffix tostring remotesetupvo idrange idrangestart idrangeend ad_client_id ad_client_id ad_org_id ad_org_id constructor public ini dialog super try jb init get license file string where s res get string license htm if where null where length 0 log fine no license pointer in resource where org compiere license htm url url null class loader cl get class get class loader if cl null bootstrap url cl get resource where if url null log fine no license in resource url new url http www adempiere org license htm if url null cmd reject license pane set page url compiereplaf show center screen this catch exception ex log log level severe init ex cmd reject inidialog jbinit s_res getstring license_htm classloader getclass getclassloader getresource cmd_reject licensepane setpage showcenterscreen cmd_reject static layout throws exception private void jb init throws exception set title compiere s res get string compiere license south label set text s res get string do you accept b reject set text s res get string no b accept set text s res get string yes i understand set default close operation j dialog dispose on close set modal true main panel set layout main layout b reject set foreground color red b reject add action listener this b accept add action listener this south panel set layout south layout south layout set alignment flow layout right license pane set editable false license pane set content type text html scroll pane set preferred size new dimension 700 400 south panel add south label null get content pane add main panel main panel add scroll pane border layout center scroll pane get viewport add license pane null main panel add south panel border layout south south panel add b reject null south panel add b accept null jbinit settitle s_res getstring compiere_license southlabel settext s_res getstring do_you_accept breject settext s_res getstring baccept settext s_res getstring yes_i_understand setdefaultcloseoperation jdialog dispose_on_close setmodal mainpanel setlayout mainlayout breject setforeground breject addactionlistener baccept addactionlistener southpanel setlayout southlayout southlayout setalignment flowlayout licensepane seteditable licensepane setcontenttype scrollpane setpreferredsize southpanel southlabel getcontentpane mainpanel mainpanel scrollpane borderlayout scrollpane getviewport licensepane mainpanel southpanel borderlayout southpanel breject southpanel baccept action listener param e event public final void action performed action event e if e get source b accept m accept true dispose actionlistener actionperformed actionevent getsource baccept m_accept dispose public final void dispose super dispose if m accept cmd reject m_accept cmd_reject is accepted return true if accepted public final boolean is accepted return m accept isaccepted m_accept reject license public final void cmd reject string info license rejected or expired try info s res get string license rejected catch exception e log severe info system exit 10 cmd_reject s_res getstring license_rejected display license and exit if rejected return true if acceptes public static final boolean accept ini dialog id new ini dialog if id is accepted log info license accepted return true system exit 10 return false never executed inidialog inidialog isaccepted standard constructor public x gl journalbatch properties ctx int gl journalbatch id string trx name super ctx gl journalbatch id trx name if gl journalbatch id 0 setc doctype id 0 set description null set doc action null co set doc status null dr set document no null setgl journalbatch id 0 set posting type null a set processed false set processing false set total cr env zero set total dr env zero x_gl_journalbatch gl_journalbatch_id trxname gl_journalbatch_id trxname gl_journalbatch_id setc_doctype_id setdescription setdocaction setdocstatus setdocumentno setgl_journalbatch_id setpostingtype setprocessed setprocessing settotalcr settotaldr load constructor public x gl journalbatch properties ctx result set rs string trx name super ctx rs trx name x_gl_journalbatch resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl journalbatch append get id append return sb to string tostring stringbuffer stringbuffer x_gl_journalbatch get_id tostring set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue public static final int c period id ad reference id 275 set period period of the calendar public void setc period id int c period id if c period id 0 set value c period id null else set value c period id new integer c period id c_period_id_ad_reference_id setc_period_id c_period_id c_period_id set_value c_period_id set_value c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue set control amount if not zero the debit amount of the document must be equal this amount public void set control amt big decimal control amt set value control amt control amt setcontrolamt bigdecimal controlamt set_value controlamt controlamt get control amount if not zero the debit amount of the document must be equal this amount public big decimal get control amt big decimal bd big decimal get value control amt if bd null return env zero return bd bigdecimal getcontrolamt bigdecimal bigdecimal get_value controlamt set copy from copy from record public void set copy from string copy from if copy from null copy from length 1 log warning length 1 truncated copy from copy from substring 0 0 set value copy from copy from setcopyfrom copyfrom copyfrom copyfrom copyfrom copyfrom set_value copyfrom copyfrom get copy from copy from record public string get copy from return string get value copy from getcopyfrom get_value copyfrom set account date accounting date public void set date acct timestamp date acct set value date acct date acct setdateacct dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set document date date of the document public void set date doc timestamp date doc set value date doc date doc setdatedoc datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set description optional short description of the record public void set description string description if description null throw new illegal argument exception description is mandatory if description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription illegalargumentexception set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set gl category general ledger category public void setgl category id int gl category id if gl category id 0 set value gl category id null else set value gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id set_value gl_category_id set_value gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set journal batch general ledger journal batch public void setgl journalbatch id int gl journalbatch id if gl journalbatch id 1 throw new illegal argument exception gl journalbatch id is mandatory set valuenocheck gl journalbatch id new integer gl journalbatch id setgl_journalbatch_id gl_journalbatch_id gl_journalbatch_id illegalargumentexception gl_journalbatch_id set_valuenocheck gl_journalbatch_id gl_journalbatch_id get journal batch general ledger journal batch public int getgl journalbatch id integer ii integer get value gl journalbatch id if ii null return 0 return ii int value getgl_journalbatch_id get_value gl_journalbatch_id intvalue set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set total credit total credit in document currency public void set total cr big decimal total cr if total cr null throw new illegal argument exception total cr is mandatory set valuenocheck total cr total cr settotalcr bigdecimal totalcr totalcr illegalargumentexception totalcr set_valuenocheck totalcr totalcr get total credit total credit in document currency public big decimal get total cr big decimal bd big decimal get value total cr if bd null return env zero return bd bigdecimal gettotalcr bigdecimal bigdecimal get_value totalcr set total debit total debit in document currency public void set total dr big decimal total dr if total dr null throw new illegal argument exception total dr is mandatory set valuenocheck total dr total dr settotaldr bigdecimal totaldr totaldr illegalargumentexception totaldr set_valuenocheck totaldr totaldr get total debit total debit in document currency public big decimal get total dr big decimal bd big decimal get value total dr if bd null return env zero return bd bigdecimal gettotaldr bigdecimal bigdecimal get_value totaldr constructor param pos panel pos panel public sub product pos panel pos panel super pos panel pospanel subproduct pospanel pospanel pospanel initialize public void init title titled border border new titled border msg translate p ctx m product id set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets2 f name new c text field f name set name name f name add action listener this f name add focus listener this gbc gridx 0 gbc gridy 0 gbc anchor grid bag constraints east gbc fill grid bag constraints both gbc weightx 0 1 add f name gbc f bsearch create button action product key stroke get key stroke key event vk i event ctrl mask gbc gridx 1 gbc gridy 0 gbc anchor grid bag constraints west gbc fill grid bag constraints none gbc weightx 0 add f bsearch gbc titledborder titledborder p_ctx m_product_id setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_name ctextfield f_name setname f_name addactionlistener f_name addfocuslistener gridbagconstraints gridbagconstraints f_name f_bsearch createbuttonaction keystroke getkeystroke keyevent vk_i ctrl_mask gridbagconstraints gridbagconstraints f_bsearch get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 1 gbc gridy 1 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose if f name null f name remove focus listener this remove all super dispose f_name f_name removefocuslistener removeall action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub product action performed action product if action equals product set parameter p pospanel open query p pospanel f queryproduct name else if e get source f name find product actionperformed actionevent getactioncommand possubproduct actionperformed setparameter p_pospanel openquery p_pospanel f_queryproduct getsource f_name findproduct focus gained param e public void focus gained focus event e focusgained focusevent focus lost param e public void focus lost focus event e if e is temporary return log info pos sub product focus lost find product focuslost focusevent istemporary possubproduct focuslost findproduct set query paramter private void set parameter what price list m m warehouse id p pos getm warehouse id m m pricelist version id p pospanel f bpartner getm pricelist version id p pospanel f queryproduct set query data m m pricelist version id m m warehouse id setparameter pricelist m_m_warehouse_id p_pos getm_warehouse_id m_m_pricelist_version_id p_pospanel f_bpartner getm_pricelist_version_id p_pospanel f_queryproduct setquerydata m_m_pricelist_version_id m_m_warehouse_id find set product price private void find product string query f name get text if query null query length 0 return query query to upper case test number boolean all number true try integer parse int query catch exception e all number false string value query string name query string upc all number query null string sku all number query null m warehouse price results null set parameter results m warehouse price find p ctx m m pricelist version id m m warehouse id value name upc sku null set result if results length 0 setm product id 0 p pospanel f curline set price env zero else if results length 1 setm product id results 0 getm product id f name set text results 0 get name p pospanel f curline set price results 0 get price std else more than one p pospanel f queryproduct set results results p pospanel open query p pospanel f queryproduct findproduct f_name gettext touppercase allnumber parseint allnumber allnumber allnumber mwarehouseprice setparameter mwarehouseprice p_ctx m_m_pricelist_version_id m_m_warehouse_id setm_product_id p_pospanel f_curline setprice setm_product_id getm_product_id f_name settext getname p_pospanel f_curline setprice getpricestd p_pospanel f_queryproduct setresults p_pospanel openquery p_pospanel f_queryproduct set price for defined product public void set price if m product null return set parameter m warehouse price result m warehouse price get m product m m pricelist version id m m warehouse id null if result null p pospanel f curline set price result get price std setprice m_product setparameter mwarehouseprice mwarehouseprice m_product m_m_pricelist_version_id m_m_warehouse_id p_pospanel f_curline setprice getpricestd set product param m product id id public void setm product id int m product id log fine pos sub product setm product id m product id if m product id 0 m product null else m product m product get p ctx m product id if m product get id 0 m product null set string info if m product null f name set text m product get name f name set tool tip text m product get description p pospanel f curline setuom m product getuom symbol else f name set text null f name set tool tip text null p pospanel f curline setuom null m_product_id setm_product_id m_product_id possubproduct setm_product_id m_product_id m_product_id m_product m_product mproduct p_ctx m_product_id m_product get_id m_product m_product f_name settext m_product getname f_name settooltiptext m_product getdescription p_pospanel f_curline m_product getuomsymbol f_name settext f_name settooltiptext p_pospanel f_curline get product return m product id public int getm product id if m product null return m product getm product id return 0 m_product_id getm_product_id m_product m_product getm_product_id get uom return c uom id public int getc uom id if m product null return m product getc uom id return 0 c_uom_id getc_uom_id m_product m_product getc_uom_id get product name return name of product public string get product name if m product null return m product get name return getproductname m_product m_product getname get product return product public m product get product return m product mproduct getproduct m_product standard constructor public x m attributesetinstance properties ctx int m attributesetinstance id string trx name super ctx m attributesetinstance id trx name if m attributesetinstance id 0 setm attributesetinstance id 0 setm attributeset id 0 x_m_attributesetinstance m_attributesetinstance_id trxname m_attributesetinstance_id trxname m_attributesetinstance_id setm_attributesetinstance_id setm_attributeset_id load constructor public x m attributesetinstance properties ctx result set rs string trx name super ctx rs trx name x_m_attributesetinstance resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributesetinstance append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributesetinstance get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set guarantee date date when guarantee expires public void set guarantee date timestamp guarantee date set value guarantee date guarantee date setguaranteedate guaranteedate set_value guaranteedate guaranteedate get guarantee date date when guarantee expires public timestamp get guarantee date return timestamp get value guarantee date getguaranteedate get_value guaranteedate set lot no lot number alphanumeric public void set lot string lot if lot null lot length 40 log warning length 40 truncated lot lot substring 0 39 set value lot lot setlot set_value get lot no lot number alphanumeric public string get lot return string get value lot getlot get_value set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm attributesetinstance id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_attributesetinstance_id set attribute set product attribute set public void setm attributeset id int m attributeset id if m attributeset id 0 throw new illegal argument exception m attributeset id is mandatory set value m attributeset id new integer m attributeset id setm_attributeset_id m_attributeset_id m_attributeset_id illegalargumentexception m_attributeset_id set_value m_attributeset_id m_attributeset_id get attribute set product attribute set public int getm attributeset id integer ii integer get value m attributeset id if ii null return 0 return ii int value getm_attributeset_id get_value m_attributeset_id intvalue set lot product lot definition public void setm lot id int m lot id if m lot id 0 set value m lot id null else set value m lot id new integer m lot id setm_lot_id m_lot_id m_lot_id set_value m_lot_id set_value m_lot_id m_lot_id get lot product lot definition public int getm lot id integer ii integer get value m lot id if ii null return 0 return ii int value getm_lot_id get_value m_lot_id intvalue set serial no product serial number public void set ser no string ser no if ser no null ser no length 40 log warning length 40 truncated ser no ser no substring 0 39 set value ser no ser no setserno serno serno serno serno serno set_value serno serno get serial no product serial number public string get ser no return string get value ser no getserno get_value serno get m interest area from cache param ctx context param r interestarea id id return m interest area public static m interest area get properties ctx int r interestarea id integer key new integer r interestarea id m interest area ret value m interest area s cache get key if ret value null return ret value ret value new m interest area ctx r interestarea id null if ret value get id 0 s cache put key ret value return ret value minterestarea r_interestarea_id minterestarea minterestarea r_interestarea_id r_interestarea_id minterestarea retvalue minterestarea s_cache retvalue retvalue retvalue minterestarea r_interestarea_id retvalue get_id s_cache retvalue retvalue constructor param ctx context param r interestarea id interest area public m interest area properties ctx int r interestarea id string trx name super ctx r interestarea id trx name if r interestarea id 0 set name null setr interestarea id 0 r_interestarea_id minterestarea r_interestarea_id trxname r_interestarea_id trxname r_interestarea_id setname setr_interestarea_id loader constructor param ctx context param rs result set public m interest area properties ctx result set rs string trx name super ctx rs trx name minterestarea resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m interest area append get id append append get name append return sb to string tostring stringbuffer stringbuffer minterestarea get_id getname tostring set subscription info constructor create inactive subscription param ad user id contact public void set subscription info int ad user id m ad user id ad user id m ci m contact interest get get ctx getr interestarea id ad user id false get trxname ad_user_id setsubscriptioninfo ad_user_id m_ad_user_id ad_user_id m_ci mcontactinterest getctx getr_interestarea_id ad_user_id get_trxname set subscription public void setad user id int ad user id m ad user id ad user id setsubscription setad_user_id ad_user_id m_ad_user_id ad_user_id public int getad user id return m ad user id getad_user_id m_ad_user_id public timestamp get subscribe date if m ci null return m ci get subscribe date return null getsubscribedate m_ci m_ci getsubscribedate public timestamp get opt out date if m ci null return m ci get opt out date return null getoptoutdate m_ci m_ci getoptoutdate is subscribed return true if sunscribed public boolean is subscribed if m ad user id 0 m ci null return false we have a b partner contact return m ci is subscribed issubscribed m_ad_user_id m_ci bpartner m_ci issubscribed default constructor param ctx context param c payselection id id public m pay selection properties ctx int c payselection id string trx name super ctx c payselection id trx name if c payselection id 0 setc bankaccount id 0 set name null date set pay date new timestamp system current time millis date set total amt env zero set is approved false set processed false set processing false c_payselection_id mpayselection c_payselection_id trxname c_payselection_id trxname c_payselection_id setc_bankaccount_id setname setpaydate currenttimemillis settotalamt setisapproved setprocessed setprocessing load constructor param ctx context param rs result set public m pay selection properties ctx result set rs string trx name super ctx rs trx name mpayselection resultset trxname trxname get lines param requery requery return lines public m pay selection line get lines boolean requery if m lines null requery return m lines array list m pay selection line list new array list m pay selection line string sql select from c payselectionline where c payselection id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc payselection id result set rs pstmt execute query while rs next list add new m pay selection line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m pay selection line list size list to array m lines return m lines mpayselectionline getlines m_lines m_lines arraylist mpayselectionline arraylist mpayselectionline c_payselectionline c_payselection_id preparedstatement preparestatement get_trxname setint getc_payselection_id resultset executequery mpayselectionline getctx get_trxname getlines m_lines mpayselectionline toarray m_lines m_lines get currency of bank account return c currency id public int getc currency id if m c currency id 0 string sql select c currency id from c bankaccount where c bankaccount id m c currency id db getsql value null sql getc bankaccount id return m c currency id c_currency_id getc_currency_id m_c_currency_id c_currency_id c_bankaccount c_bankaccount_id m_c_currency_id getsqlvalue getc_bankaccount_id m_c_currency_id string representation return info public string to string string buffer sb new string buffer m pay selection sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mpayselection get_id getname tostring basic constructor use set methods public basefont basic constructor param face create new basefont object with this face public basefont string face set face face setface basic constructor param face param color create a new base font object with the face abd color already set convience colors are defined in html color interface public basefont string face string color set face face set color color basefont htmlcolor setface setcolor basic constructor param face param color param size create a new basefont object with the face color and size already set convience colors are defined in html color interface public basefont string face string color int size set face face set color color set size size htmlcolor setface setcolor setsize basic constructor param size create a new basefont object with the size already set public basefont int size string face set size size set face face setsize setface basic constructor param color param size create a new base font object with the size and color already set public basefont string color int size set size size set color color basefont setsize setcolor sets the face attribute param face sets the face attribute public basefont set face string face add attribute face face return this setface addattribute sets the color attribute param color sets the color attribute convience colors are defined in the html colors interface public basefont set color string color add attribute color html color convert color color return this htmlcolors setcolor addattribute htmlcolor convertcolor sets the size attribute param size sets the size attribute public basefont set size int size add attribute size integer to string size return this setsize addattribute tostring sets the size attribute param size sets the size attribute public basefont set size string size add attribute size size return this setsize addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public basefont add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public basefont add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public basefont add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public basefont add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public basefont remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry constructor param v format param field length param tc v password or v string public m doc string string v format int field length j text component tc super m fieldlength field length set format v format m tc tc if tc null m tc add caret listener this vformat fieldlength vpassword vstring mdocstring vformat fieldlength jtextcomponent m_fieldlength fieldlength setformat vformat m_tc m_tc addcaretlistener set format param v format public final void set format string v format m vformat v format if m vformat null m vformat m mask m vformat set length m maxlength m fieldlength if m vformat length 0 return log fine v format if m maxlength m vformat length m maxlength m vformat length create mask m mask m mask replace c space c any letter or digit or space m mask m mask replace c space c any letter or digit or space converted to upper case m mask m mask replace a space a any letters or digits no space m mask m mask replace a space a any letters or digits no space converted to upper case m mask m mask replace l space l any letter a z no space m mask m mask replace l space l any letter a z no space converted to upper case m mask m mask replace o space o any letter a z or space m mask m mask replace o space o any letter a z or space converted to upper case m mask m mask replace 0 space 0 digits 0 9 no space m mask m mask replace 9 space 9 digits 0 9 or space check caret if m tc null m tc get caret instanceof v ovr caret return else m tc set caret new v ovr caret vformat setformat vformat m_vformat vformat m_vformat m_vformat m_mask m_vformat m_maxlength m_fieldlength m_vformat vformat m_maxlength m_vformat m_maxlength m_vformat m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_mask m_tc m_tc getcaret vovrcaret m_tc setcaret vovrcaret insert string param offset param string param attr throws bad location exception public void insert string int offset string string attribute set attr throws bad location exception max length if offset m maxlength return we have no format or inserted not manually assuming correct format if m vformat length 0 string length 1 log finest offset offset string string super insert string offset string attr return formating required log finest offset offset string string max length m maxlength format m vformat mask m mask text get text length get text length string text get text apply mask if not target length if m vformat length text length char result m mask to char array for int i 0 i result length i if result i space text length i result i text char at i else if result i space ind result i space super remove 0 text length super insert string 0 new string result attr m tc set caret position offset text get text positioned before a mask character jump over it if offset 1 text length m mask char at offset 1 space if offset 2 get text length m tc set caret position offset 2 positioned at the mask character if m mask char at offset space if offset 1 m mask length return offset m tc set caret position offset 1 conversion char c string char at 0 char cmd m vformat char at offset log fine char c cmd cmd switch cmd case c c any letter or digits or space if character is letter c character is digit c character is space char c else return break case c c any letter or digits or space converted to upper case if character is letter c character is digit c character is space char c string string to upper case else return break case a a any letter or digits no space if character is letter c character is digit c else return break case a a any letter or digits no space converted to upper case if character is letter c character is digit c string string to upper case else return break case l l any letter a z no space if character is letter c return break case l l any letter a z no space converted to upper case if character is letter c return string string to upper case break case o o any letter a z or space if character is letter c character is space char c else return break case o o any letter a z or space converted to upper case if character is letter c character is space char c string string to upper case else return break case 9 9 digits 0 9 or space if character is digit c character is space char c else return break case 0 0 digits 0 9 no space if character is digit c return break case space any character break default other return switch super remove offset 1 replace current position super insert string offset string attr badlocationexception insertstring attributeset badlocationexception m_maxlength m_vformat insertstring maxlength m_maxlength m_vformat m_mask gettext gettext gettext m_vformat m_mask tochararray charat space_ind insertstring m_tc setcaretposition gettext m_mask charat gettext m_tc setcaretposition m_mask charat m_mask m_tc setcaretposition charat m_vformat charat isletter isdigit isspacechar isletter isdigit isspacechar touppercase isletter isdigit isletter isdigit touppercase isletter isletter touppercase isletter isspacechar isletter isspacechar touppercase isdigit isspacechar isdigit insertstring delete string param offset param length throws bad location exception public void remove int offset int length throws bad location exception no format or non manual entry if m vformat length 0 length 1 log finest offset offset length length super remove offset length return begin of string if offset 0 empty the field if length m mask length super remove offset length return one position behind delimiter if offset 1 0 m mask char at offset 1 space if offset 2 0 m tc set caret position offset 2 else return else m tc set caret position offset 1 badlocationexception badlocationexception m_vformat m_mask m_mask charat m_tc setcaretposition m_tc setcaretposition get full text return text private string get text string str try str get content get string 0 get content length 1 cr at end catch exception e str return str gettext getcontent getstring getcontent caret listener param e public void caret update caret event e no format if m vformat length 0 format error all fixed characters m vformat equals m mask return selection if e get dot e get mark m lastdot e get dot return log fine m doc string caret update m vformat m mask dot e get dot mark e get mark is the current position a fixed character if e get dot 1 m mask length m mask char at e get dot space m lastdot e get dot return direction int new dot 1 if m lastdot e get dot new dot e get dot 1 else or same new dot e get dot 1 if e get dot 0 first new dot 1 else if e get dot m mask length 1 last new dot e get dot 1 log fine on fixed char m mask char at e get dot new dot new dot last m lastdot m lastdot e get dot if new dot 0 new dot get text length m tc set caret position new dot caretupdate caretevent m_vformat m_vformat m_mask getdot getmark m_lastdot getdot mdocstring caretupdate m_vformat m_mask getdot getmark getdot m_mask m_mask charat getdot m_lastdot getdot newdot m_lastdot getdot newdot getdot newdot getdot getdot newdot getdot m_mask newdot getdot onfixedchar m_mask charat getdot newdot newdot m_lastdot m_lastdot getdot newdot newdot gettext m_tc setcaretposition newdot standard constructor param ctx context param c campaign id id public m campaign properties ctx int c campaign id string trx name super ctx c campaign id trx name c_campaign_id mcampaign c_campaign_id trxname c_campaign_id trxname load constructor param ctx context param rs result set public m campaign properties ctx result set rs string trx name super ctx rs trx name mcampaign resultset trxname trxname after save insert create tree param new record insert param success save success protected boolean after save boolean new record boolean success if success return success if new record insert tree mtree base treetype campaign value name change if new record is valuechanged value is valuechanged name m account update value description get ctx c campaign id getc campaign id get trxname return true newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_campaign newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_campaign_id getc_campaign_id get_trxname after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype campaign return success afterdelete delete_tree mtree_base treetype_campaign get contents return contents public object get contents return contents getcontents initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w form init servletconfig servletexception webenv initweb servletexception wform process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create not implemented yet web util create response request response this null doc false doget httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create not implemented yet web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse public html set element type html set case lowercase set attribute quote true add attribute xmlns http www w3 org 1999 xhtml doctype html public w3c dtd xhtml 1 0 transitional en http www w3 org tr xhtml1 dtd xhtml1 transitional dtd setelementtype setcase setattributequote addattribute this method creates a lt html gt tag and sets it value param value the value that goes between lt start tag gt lt end tag gt public html string value set element type html add element value start_tag end_tag setelementtype addelement this method creates a lt html gt tag and sets it value param value the value that goes between lt start tag gt lt end tag gt public html element value set element type html add element value start_tag end_tag setelementtype addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public html add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public html add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public html add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public html add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public html remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry basic constructor public big basic constructor param element adds an element to the element public big element element add element element addelement basic constructor param element adds an element to the element public big string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public big add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public big add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public big add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public big add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public big remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c userremuneration properties ctx int c userremuneration id string trx name super ctx c userremuneration id trx name if c userremuneration id 0 setad user id 0 setc remuneration id 0 setc userremuneration id 0 set grossr amt env zero set grossr cost env zero set overtime amt env zero set overtime cost env zero set valid from new timestamp system current time millis x_c_userremuneration c_userremuneration_id trxname c_userremuneration_id trxname c_userremuneration_id setad_user_id setc_remuneration_id setc_userremuneration_id setgrossramt setgrossrcost setovertimeamt setovertimecost setvalidfrom currenttimemillis load constructor public x c userremuneration properties ctx result set rs string trx name super ctx rs trx name x_c_userremuneration resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c userremuneration append get id append return sb to string tostring stringbuffer stringbuffer x_c_userremuneration get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id set remuneration wage or salary public void setc remuneration id int c remuneration id if c remuneration id 1 throw new illegal argument exception c remuneration id is mandatory set valuenocheck c remuneration id new integer c remuneration id setc_remuneration_id c_remuneration_id c_remuneration_id illegalargumentexception c_remuneration_id set_valuenocheck c_remuneration_id c_remuneration_id get remuneration wage or salary public int getc remuneration id integer ii integer get value c remuneration id if ii null return 0 return ii int value getc_remuneration_id get_value c_remuneration_id intvalue set employee remuneration employee wage or salary overwrite public void setc userremuneration id int c userremuneration id if c userremuneration id 1 throw new illegal argument exception c userremuneration id is mandatory set valuenocheck c userremuneration id new integer c userremuneration id setc_userremuneration_id c_userremuneration_id c_userremuneration_id illegalargumentexception c_userremuneration_id set_valuenocheck c_userremuneration_id c_userremuneration_id get employee remuneration employee wage or salary overwrite public int getc userremuneration id integer ii integer get value c userremuneration id if ii null return 0 return ii int value getc_userremuneration_id get_value c_userremuneration_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gross amount gross remuneration amount public void set grossr amt big decimal grossr amt if grossr amt null throw new illegal argument exception grossr amt is mandatory set value grossr amt grossr amt setgrossramt bigdecimal grossramt grossramt illegalargumentexception grossramt set_value grossramt grossramt get gross amount gross remuneration amount public big decimal get grossr amt big decimal bd big decimal get value grossr amt if bd null return env zero return bd bigdecimal getgrossramt bigdecimal bigdecimal get_value grossramt set gross cost gross remuneration costs public void set grossr cost big decimal grossr cost if grossr cost null throw new illegal argument exception grossr cost is mandatory set value grossr cost grossr cost setgrossrcost bigdecimal grossrcost grossrcost illegalargumentexception grossrcost set_value grossrcost grossrcost get gross cost gross remuneration costs public big decimal get grossr cost big decimal bd big decimal get value grossr cost if bd null return env zero return bd bigdecimal getgrossrcost bigdecimal bigdecimal get_value grossrcost set overtime amount hourly overtime rate public void set overtime amt big decimal overtime amt if overtime amt null throw new illegal argument exception overtime amt is mandatory set value overtime amt overtime amt setovertimeamt bigdecimal overtimeamt overtimeamt illegalargumentexception overtimeamt set_value overtimeamt overtimeamt get overtime amount hourly overtime rate public big decimal get overtime amt big decimal bd big decimal get value overtime amt if bd null return env zero return bd bigdecimal getovertimeamt bigdecimal bigdecimal get_value overtimeamt set overtime cost hourly overtime cost public void set overtime cost big decimal overtime cost if overtime cost null throw new illegal argument exception overtime cost is mandatory set value overtime cost overtime cost setovertimecost bigdecimal overtimecost overtimecost illegalargumentexception overtimecost set_value overtimecost overtimecost get overtime cost hourly overtime cost public big decimal get overtime cost big decimal bd big decimal get value overtime cost if bd null return env zero return bd bigdecimal getovertimecost bigdecimal bigdecimal get_value overtimecost set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto standard constructor public x ad printfont properties ctx int ad printfont id string trx name super ctx ad printfont id trx name if ad printfont id 0 setad printfont id 0 set code null set is default false set name null x_ad_printfont ad_printfont_id trxname ad_printfont_id trxname ad_printfont_id setad_printfont_id setcode setisdefault setname load constructor public x ad printfont properties ctx result set rs string trx name super ctx rs trx name x_ad_printfont resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printfont append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printfont get_id tostring set print font maintain print font public void setad printfont id int ad printfont id if ad printfont id 1 throw new illegal argument exception ad printfont id is mandatory set valuenocheck ad printfont id new integer ad printfont id setad_printfont_id ad_printfont_id ad_printfont_id illegalargumentexception ad_printfont_id set_valuenocheck ad_printfont_id ad_printfont_id get print font maintain print font public int getad printfont id integer ii integer get value ad printfont id if ii null return 0 return ii int value getad_printfont_id get_value ad_printfont_id intvalue set validation code validation code public void set code string code if code null throw new illegal argument exception code is mandatory if code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode illegalargumentexception set_value get validation code validation code public string get code return string get value code getcode get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get content return content public object get contents return contents getcontents get m category from cache param ctx context param r category id id return m category public static m request category get properties ctx int r category id integer key new integer r category id m request category ret value m request category s cache get key if ret value null return ret value ret value new m request category ctx r category id null if ret value get id 0 s cache put key ret value return ret value mcategory r_category_id mcategory mrequestcategory r_category_id r_category_id mrequestcategory retvalue mrequestcategory s_cache retvalue retvalue retvalue mrequestcategory r_category_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param r category id id param trx name trx public m request category properties ctx int r category id string trx name super ctx r category id trx name r_category_id trxname mrequestcategory r_category_id trxname r_category_id trxname load constructor param ctx context param rs result set param trx name trx public m request category properties ctx result set rs string trx name super ctx rs trx name trxname mrequestcategory resultset trxname trxname standard constructor public x b topic properties ctx int b topic id string trx name super ctx b topic id trx name if b topic id 0 setb topiccategory id 0 setb topictype id 0 setb topic id 0 set decision date new timestamp system current time millis set document no null set is published false set name null set processed false set topic action null set topic status null x_b_topic b_topic_id trxname b_topic_id trxname b_topic_id setb_topiccategory_id setb_topictype_id setb_topic_id setdecisiondate currenttimemillis setdocumentno setispublished setname setprocessed settopicaction settopicstatus load constructor public x b topic properties ctx result set rs string trx name super ctx rs trx name x_b_topic resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b topic append get id append return sb to string tostring stringbuffer stringbuffer x_b_topic get_id tostring set topic category auction topic category public void setb topiccategory id int b topiccategory id if b topiccategory id 1 throw new illegal argument exception b topiccategory id is mandatory set valuenocheck b topiccategory id new integer b topiccategory id setb_topiccategory_id b_topiccategory_id b_topiccategory_id illegalargumentexception b_topiccategory_id set_valuenocheck b_topiccategory_id b_topiccategory_id get topic category auction topic category public int getb topiccategory id integer ii integer get value b topiccategory id if ii null return 0 return ii int value getb_topiccategory_id get_value b_topiccategory_id intvalue set topic type auction topic type public void setb topictype id int b topictype id if b topictype id 1 throw new illegal argument exception b topictype id is mandatory set valuenocheck b topictype id new integer b topictype id setb_topictype_id b_topictype_id b_topictype_id illegalargumentexception b_topictype_id set_valuenocheck b_topictype_id b_topictype_id get topic type auction topic type public int getb topictype id integer ii integer get value b topictype id if ii null return 0 return ii int value getb_topictype_id get_value b_topictype_id intvalue set topic auction topic public void setb topic id int b topic id if b topic id 1 throw new illegal argument exception b topic id is mandatory set valuenocheck b topic id new integer b topic id setb_topic_id b_topic_id b_topic_id illegalargumentexception b_topic_id set_valuenocheck b_topic_id b_topic_id get topic auction topic public int getb topic id integer ii integer get value b topic id if ii null return 0 return ii int value getb_topic_id get_value b_topic_id intvalue set decision date public void set decision date timestamp decision date if decision date null throw new illegal argument exception decision date is mandatory set value decision date decision date setdecisiondate decisiondate decisiondate illegalargumentexception decisiondate set_value decisiondate decisiondate get decision date public timestamp get decision date return timestamp get value decision date getdecisiondate get_value decisiondate set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set published the topic is published and can be viewed public void set is published boolean is published set value is published new boolean is published setispublished ispublished set_value ispublished ispublished get published the topic is published and can be viewed public boolean is published object oo get value is published if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublished get_value ispublished booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set details public void set text details string text details if text details null text details length 4000 log warning length 4000 truncated text details text details substring 0 3999 set value text details text details settextdetails textdetails textdetails textdetails textdetails textdetails set_value textdetails textdetails get details public string get text details return string get value text details gettextdetails get_value textdetails set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg set topic action public void set topic action string topic action if topic action null throw new illegal argument exception topic action is mandatory if topic action length 2 log warning length 2 truncated topic action topic action substring 0 1 set value topic action topic action settopicaction topicaction topicaction illegalargumentexception topicaction topicaction topicaction topicaction set_value topicaction topicaction get topic action public string get topic action return string get value topic action gettopicaction get_value topicaction set topic status public void set topic status string topic status if topic status null throw new illegal argument exception topic status is mandatory if topic status length 2 log warning length 2 truncated topic status topic status substring 0 1 set value topic status topic status settopicstatus topicstatus topicstatus illegalargumentexception topicstatus topicstatus topicstatus topicstatus set_value topicstatus topicstatus get topic status public string get topic status return string get value topic status gettopicstatus get_value topicstatus standard constructor public x m attributesearch properties ctx int m attributesearch id string trx name super ctx m attributesearch id trx name if m attributesearch id 0 setm attributesearch id 0 set name null x_m_attributesearch m_attributesearch_id trxname m_attributesearch_id trxname m_attributesearch_id setm_attributesearch_id setname load constructor public x m attributesearch properties ctx result set rs string trx name super ctx rs trx name x_m_attributesearch resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributesearch append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributesearch get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set attribute search common search attribute public void setm attributesearch id int m attributesearch id if m attributesearch id 1 throw new illegal argument exception m attributesearch id is mandatory set valuenocheck m attributesearch id new integer m attributesearch id setm_attributesearch_id m_attributesearch_id m_attributesearch_id illegalargumentexception m_attributesearch_id set_valuenocheck m_attributesearch_id m_attributesearch_id get attribute search common search attribute public int getm attributesearch id integer ii integer get value m attributesearch id if ii null return 0 return ii int value getm_attributesearch_id get_value m_attributesearch_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname exit system param status system exit status usually 0 for no error public static void exit env int status end session m session session m session get env get ctx false finish if session null session logout reset true final cache reset s log info c log mgt shutdown if ini is client system exit status exitenv msession msession getctx s_log clogmgt isclient reset cache param final call everything otherwise login data remains public static void reset boolean final call s log info final call final call close windows dismantle windows for int i 0 i s windows size i container win container s windows get i if win get class get name ends with a menu null pointer else if win instanceof window window win dispose else win remove all s windows clear clear all context if final call s ctx clear else clear window context only object keys s ctx key set to array for int i 0 i keys length i string tag keys i to string if character is digit tag char at 0 s ctx remove keys i cache cache mgt get reset db close target reset role access if final call db setdb target c connection get m role default role m role get default s ctx false if default role null default role load access true reload finalcall finalcall s_log finalcall finalcall closewindows s_windows s_windows getclass getname endswith amenu removeall s_windows finalcall s_ctx s_ctx keyset toarray tostring isdigit charat s_ctx cachemgt closetarget finalcall setdbtarget cconnection mrole defaultrole mrole getdefault s_ctx defaultrole defaultrole loadaccess get context return properties public static final properties get ctx return s ctx getctx s_ctx set context param ctx context public static void set ctx properties ctx if ctx null throw new illegal argument exception require context s ctx clear s ctx ctx setctx illegalargumentexception s_ctx s_ctx set global context to value param ctx context param context context key param value context value public static void set context properties ctx string context string value if ctx null context null return s log finer context context value if value null value length 0 ctx remove context else ctx set property context value setcontext s_log setproperty set global context to value param ctx context param context context key param value context value public static void set context properties ctx string context timestamp value if ctx null context null return if value null ctx remove context s log finer context context value else jdbc format 2005 05 09 00 00 00 0 string string value value to string chop off 0 string value string value substring 0 string value length 2 ctx set property context string value s log finer context context string value setcontext s_log stringvalue tostring stringvalue stringvalue stringvalue setproperty stringvalue s_log stringvalue set global context to int value param ctx context param context context key param value context value public static void set context properties ctx string context int value if ctx null context null return s log finer context context value ctx set property context string value of value setcontext s_log setproperty valueof set global context to y n value param ctx context param context context key param value context value public static void set context properties ctx string context boolean value set context ctx context value y n setcontext setcontext set context for window to value param ctx context param window no window no param context context key param value context value public static void set context properties ctx int window no string context string value if ctx null context null return if window no window find window no window mlookup s log finer context window no context value if value null value equals ctx remove window no context else ctx set property window no context value windowno setcontext windowno windowno window_find windowno window_mlookup s_log windowno windowno setproperty windowno set context for window to value param ctx context param window no window no param context context key param value context value public static void set context properties ctx int window no string context timestamp value if ctx null context null return boolean logit window no window find window no window mlookup if value null ctx remove window no context s log finer context window no context value else jdbc format 2005 05 09 00 00 00 0 string string value value to string chop off 0 string value string value substring 0 string value length 2 ctx set property window no context string value s log finer context window no context string value windowno setcontext windowno windowno window_find windowno window_mlookup windowno s_log windowno stringvalue tostring stringvalue stringvalue stringvalue setproperty windowno stringvalue s_log windowno stringvalue set context for window to int value param ctx context param window no window no param context context key param value context value public static void set context properties ctx int window no string context int value if ctx null context null return if window no window find window no window mlookup s log finer context window no context value ctx set property window no context string value of value windowno setcontext windowno windowno window_find windowno window_mlookup s_log windowno setproperty windowno valueof set context for window to y n value param ctx context param window no window no param context context key param value context value public static void set context properties ctx int window no string context boolean value set context ctx window no context value y n windowno setcontext windowno setcontext windowno set context for window tab to value param ctx context param window no window no param tab no tab no param context context key param value context value public static void set context properties ctx int window no int tab no string context string value if ctx null context null return if window no window find window no window mlookup s log finest context window no tab no context value if value null value equals ctx remove window no tab no context else ctx set property window no tab no context value windowno tabno setcontext windowno tabno windowno window_find windowno window_mlookup s_log windowno tabno windowno tabno setproperty windowno tabno set auto commit param ctx context param auto commit auto commit save public static void set auto commit properties ctx boolean auto commit if ctx null return ctx set property auto commit auto commit y n autocommit setautocommit autocommit setproperty autocommit autocommit set auto commit for window param ctx context param window no window no param auto commit auto commit save public static void set auto commit properties ctx int window no boolean auto commit if ctx null return ctx set property window no auto commit auto commit y n windowno autocommit setautocommit windowno autocommit setproperty windowno autocommit autocommit set auto new record param ctx context param auto new auto new record public static void set auto new properties ctx boolean auto new if ctx null return ctx set property auto new auto new y n autonew setautonew autonew setproperty autonew autonew set auto new record for window param ctx context param window no window no param auto new auto new record public static void set auto new properties ctx int window no boolean auto new if ctx null return ctx set property window no auto new auto new y n windowno autonew setautonew windowno autonew setproperty windowno autonew autonew set so trx param ctx context param isso trx so context public static void setso trx properties ctx boolean isso trx if ctx null return ctx set property isso trx isso trx y n issotrx setsotrx issotrx setproperty issotrx issotrx get global value of context param ctx context param context context key return value or public static string get context properties ctx string context if ctx null context null throw new illegal argument exception require context return ctx get property context getcontext illegalargumentexception getproperty get value of context for window if not found global context if available and enabled param ctx context param window no window param context context key param only window if true no defaults are used unless explicitly asked for return value or public static string get context properties ctx int window no string context boolean only window if ctx null throw new illegal argument exception no ctx if context null throw new illegal argument exception require context string s ctx get property window no context if s null explicit base values if context starts with context starts with return get context ctx context if only window no default values return return get context ctx context return s windowno onlywindow getcontext windowno onlywindow illegalargumentexception illegalargumentexception getproperty windowno startswith startswith getcontext onlywindow getcontext get value of context for window if not found global context if available param ctx context param window no window param context context key return value or public static string get context properties ctx int window no string context return get context ctx window no context false windowno getcontext windowno getcontext windowno get value of context for window tab if not found global context if available param ctx context param window no window no param tab no tab no param context context key return value or public static string get context properties ctx int window no int tab no string context if ctx null context null throw new illegal argument exception require context string s ctx get property window no tab no context if s null return get context ctx window no context false return s windowno tabno getcontext windowno tabno illegalargumentexception getproperty windowno tabno getcontext windowno get context and convert it to an integer 0 if error param ctx context param context context key return value public static int get context as int properties ctx string context if ctx null context null throw new illegal argument exception require context string s get context ctx context if s length 0 s get context ctx 0 context false search 0 and defaults if s length 0 return 0 try return integer parse int s catch number format exception e s log log level severe context s e return 0 getcontextasint illegalargumentexception getcontext getcontext parseint numberformatexception s_log get context and convert it to an integer 0 if error param ctx context param window no window no param context context key return value or 0 public static int get context as int properties ctx int window no string context string s get context ctx window no context false if s length 0 return 0 try return integer parse int s catch number format exception e s log log level severe context s e return 0 windowno getcontextasint windowno getcontext windowno parseint numberformatexception s_log get context and convert it to an integer 0 if error param ctx context param window no window no param tab no tab no param context context key return value or 0 public static int get context as int properties ctx int window no int tab no string context string s get context ctx window no tab no context if s length 0 return 0 try return integer parse int s catch number format exception e s log log level severe context s e return 0 windowno tabno getcontextasint windowno tabno getcontext windowno tabno parseint numberformatexception s_log is auto commit param ctx context return true if auto commit public static boolean is auto commit properties ctx if ctx null throw new illegal argument exception require context string s get context ctx auto commit if s null s equals y return true return false autocommit isautocommit illegalargumentexception getcontext autocommit is window auto commit if not set use default param ctx context param window no window no return true if auto commit public static boolean is auto commit properties ctx int window no if ctx null throw new illegal argument exception require context string s get context ctx window no auto commit false if s null if s equals y return true else return false return is auto commit ctx autocommit windowno isautocommit windowno illegalargumentexception getcontext windowno autocommit isautocommit is auto new record param ctx context return true if auto new public static boolean is auto new properties ctx if ctx null throw new illegal argument exception require context string s get context ctx auto new if s null s equals y return true return false isautonew illegalargumentexception getcontext autonew is window auto new record if not set use default param ctx context param window no window no return true if auto new record public static boolean is auto new properties ctx int window no if ctx null throw new illegal argument exception require context string s get context ctx window no auto new false if s null if s equals y return true else return false return is auto new ctx windowno isautonew windowno illegalargumentexception getcontext windowno autonew isautonew is sales order trx param ctx context return true if so default public static boolean isso trx properties ctx string s get context ctx isso trx if s null s equals n return false return true issotrx getcontext issotrx is sales order trx param ctx context param window no window no return true if so default public static boolean isso trx properties ctx int window no string s get context ctx window no isso trx true if s null s equals n return false return true windowno issotrx windowno getcontext windowno issotrx get context and convert it to a timestamp if error return today s date param ctx context param context context key return timestamp public static timestamp get context as date properties ctx string context return get context as date ctx 0 context getcontextasdate getcontextasdate get context and convert it to a timestamp if error return today s date param ctx context param window no window no param context context key return timestamp public static timestamp get context as date properties ctx int window no string context if ctx null context null throw new illegal argument exception require context string s get context ctx window no context false jdbc format yyyy mm dd example 2000 09 11 00 00 00 0 if s null s equals s log log level severe no value for context return new timestamp system current time millis timestamp requires time if s trim length 10 s s trim 00 00 00 0 else if s index of 1 s s trim 0 return timestamp value of s windowno getcontextasdate windowno illegalargumentexception getcontext windowno s_log currenttimemillis indexof valueof get login ad client id param ctx context return login ad client id public static int getad client id properties ctx return env get context as int ctx ad client id ad_client_id ad_client_id getad_client_id getcontextasint ad_client_id get login ad org id param ctx context return login ad org id public static int getad org id properties ctx return env get context as int ctx ad org id ad_org_id ad_org_id getad_org_id getcontextasint ad_org_id get login ad user id param ctx context return login ad user id public static int getad user id properties ctx return env get context as int ctx ad user id ad_user_id ad_user_id getad_user_id getcontextasint ad_user_id get login ad role id param ctx context return login ad role id public static int getad role id properties ctx return env get context as int ctx ad role id ad_role_id ad_role_id getad_role_id getcontextasint ad_role_id get preference pre 0 current setting 1 window preference 2 global preference 3 login settings 4 accounting settings pre param ctx context param ad window id window no param context entity to search param system system level preferences vs user defined return preference value public static string get preference properties ctx int ad window id string context boolean system if ctx null context null throw new illegal argument exception require context string ret value null if system user preferences ret value ctx get property p ad window id context window pref if ret value null ret value ctx get property p context global pref else system preferences ret value ctx get property context login setting if ret value null ret value ctx get property context accounting setting return ret value null ret value ad_window_id getpreference ad_window_id illegalargumentexception retvalue retvalue getproperty ad_window_id retvalue retvalue getproperty retvalue getproperty retvalue retvalue getproperty retvalue retvalue check base language param ctx context param table name table to be translated return true if base language and table not translated public static boolean is base language properties ctx string table name if is base translation table name return language is base language getad language ctx else no ad table if is multi lingual document ctx return true access base table return language is base language getad language ctx tablename isbaselanguage tablename isbasetranslation tablename isbaselanguage getad_language ismultilingualdocument isbaselanguage getad_language check base language param ad language language param table name table to be translated return true if base language and table not translated public static boolean is base language string ad language string table name if is base translation table name return language is base language ad language else no ad table if is multi lingual document s ctx base context return true access base table return language is base language ad language ad_language tablename isbaselanguage ad_language tablename isbasetranslation tablename isbaselanguage ad_language ismultilingualdocument s_ctx isbaselanguage ad_language check base language param language language param table name table to be translated return true if base language and table not translated public static boolean is base language language language string table name if is base translation table name return language is base language else no ad table if is multi lingual document s ctx base context return true access base table return language is base language tablename isbaselanguage tablename isbasetranslation tablename isbaselanguage ismultilingualdocument s_ctx isbaselanguage table is in base translation ad param table name table return true if base trl public static boolean is base translation string table name if table name starts with ad table name equals c country trl return true return false tablename isbasetranslation tablename tablename startswith tablename c_country_trl do we have multi lingual documents set in db load orgs param ctx context return true if multi lingual documents public static boolean is multi lingual document properties ctx return m client get ctx is multi lingual document loadorgs ismultilingualdocument mclient ismultilingualdocument get system ad language param ctx context return ad language eg en us public static string getad language properties ctx if ctx null string lang get context ctx language if lang null lang length 0 return lang return language getbasead language ad_language ad_language en_us getad_language getcontext getbasead_language get system language param ctx context return language public static language get language properties ctx if ctx null string lang get context ctx language if lang null lang length 0 return language get language lang return language get base language getlanguage getcontext getlanguage getbaselanguage get login language param ctx context return language public static language get login language properties ctx return language get login language getloginlanguage getloginlanguage verify language check that language is supported by the system param ctx might be updated with new ad language param language language public static void verify language properties ctx language language if language is base language return boolean is system language false array list string ad languages new array list string string sql select distinct ad language from ad message trl try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next string ad language rs get string 1 if ad language equals language getad language is system language true break ad languages add ad language rs close pstmt close catch sql exception e s log log level severe e found it if is system language return no language set to system if ad languages size 0 s log warning no system language set to base language getbasead language language setad language language getbasead language return for int i 0 i ad languages size i string ad language string ad languages get i en us string lang ad language substring 0 2 en string lang compare language getad language substring 0 2 if lang equals lang compare s log fine found similar language ad language language setad language ad language return we found same language if 0 equals msg get msg ad language 0 s log warning not system language language set to base language language getbasead language language setad language language getbasead language ad_language verifylanguage isbaselanguage issystemlanguage arraylist ad_languages arraylist ad_language ad_message_trl preparedstatement preparestatement resultset executequery ad_language getstring ad_language getad_language issystemlanguage ad_languages ad_language sqlexception s_log issystemlanguage ad_languages s_log getbasead_language setad_language getbasead_language ad_languages ad_language ad_languages en_us ad_language langcompare getad_language langcompare s_log ad_language setad_language ad_language getmsg ad_language s_log getbasead_language setad_language getbasead_language get context as string array with format key value param ctx context return context string public static string get entire context properties ctx if ctx null throw new illegal argument exception require context iterator key iterator ctx key set iterator string s list new string ctx size int i 0 while key iterator has next object key key iterator next s list i key to string ctx get key to string return s list getentirecontext illegalargumentexception keyiterator keyset slist keyiterator hasnext keyiterator slist tostring tostring slist get header info connection org user param ctx context param window no window return header string public static string get header properties ctx int window no string buffer sb new string buffer if window no 0 sb append get context ctx window no window name false append sb append get context ctx ad user name append append get context ctx ad client name append append get context ctx ad org name append append c connection get to string append return sb to string windowno getheader windowno stringbuffer stringbuffer windowno getcontext windowno windowname getcontext ad_user_name getcontext ad_client_name getcontext ad_org_name cconnection tostring tostring clean up context for window i e delete it param ctx context param window no window public static void clear win context properties ctx int window no if ctx null throw new illegal argument exception require context object keys ctx key set to array for int i 0 i keys length i string tag keys i to string if tag starts with window no ctx remove keys i clear lookup cache m lookup cache cache reset window no m locator cache reset window no remove window window no windowno clearwincontext windowno illegalargumentexception keyset toarray tostring startswith windowno mlookupcache cachereset windowno mlocator cachereset windowno removewindow windowno clean up all context i e delete it param ctx context public static void clear context properties ctx if ctx null throw new illegal argument exception require context ctx clear clearcontext illegalargumentexception parse context replaces global or window context tag with actual value tag are ignored otherwise is returned param ctx context param window no number of window param value message to be parsed param only window if true no defaults are used param ignore unparsable if true unsuccessful return parsed string or if not successful and ignore unparsable public static string parse context properties ctx int window no string value boolean only window boolean ignore unparsable if value null value length 0 return string token string in str new string value string buffer out str new string buffer int i in str index of while i 1 out str append in str substring 0 i up to in str in str substring i 1 in str length from first int j in str index of next if j 0 s log log level severe no second tag in str return no second tag token in str substring 0 j string ctx info get context ctx window no token only window get context if ctx info length 0 token starts with token starts with ctx info get context ctx token get global context if ctx info length 0 s log config no context win window no for token if ignore unparsable return token not found else out str append ctx info replace context with context in str in str substring j 1 in str length from second i in str index of out str append in str add the rest of the string return out str to string windowno onlywindow ignoreunparsable ignoreunparsable parsecontext windowno onlywindow ignoreunparsable instr stringbuffer outstr stringbuffer instr indexof outstr instr instr instr instr instr indexof s_log instr instr ctxinfo getcontext windowno onlywindow ctxinfo startswith startswith ctxinfo getcontext ctxinfo s_log windowno ignoreunparsable outstr ctxinfo instr instr instr instr indexof outstr instr outstr tostring parse context replaces global or window context tag with actual value param ctx context param window no number of window param value message to be parsed param only window if true no defaults are used return parsed string or if not successful public static string parse context properties ctx int window no string value boolean only window return parse context ctx window no value only window false windowno onlywindow parsecontext windowno onlywindow parsecontext windowno onlywindow add container and return window no the container is a a panel a window or j frame j dialog param win window return window no used for context public static int create window no container win int ret value s windows size s windows add win return ret value windowno apanel awindow jframe jdialog windowno createwindowno retvalue s_windows s_windows retvalue search window by comparing the frames param container container return window no of container or 0 public static int get window no container container if container null return 0 j frame win frame get frame container if win frame null return 0 loop through windows for int i 0 i s windows size i container cmp container s windows get i if cmp null j frame cmp frame get frame cmp if win frame equals cmp frame return i return 0 windowno getwindowno jframe winframe getframe winframe s_windows s_windows jframe cmpframe getframe winframe cmpframe return the j frame pointer of window no or null param window no window return j frame of window no public static j frame get window int window no j frame ret value null try ret value get frame container s windows get window no catch exception e s log log level severe e to string return ret value jframe windowno windowno jframe windowno jframe getwindow windowno jframe retvalue retvalue getframe s_windows windowno s_log tostring retvalue remove window from active list param window no window private static void remove window int window no if window no s windows size s windows set window no null windowno removewindow windowno windowno s_windows s_windows windowno clean up context for window i e delete it param window no window public static void clear win context int window no clear win context s ctx window no windowno clearwincontext windowno clearwincontext s_ctx windowno clean up all context i e delete it public static void clear context s ctx clear clearcontext s_ctx get frame of window param container container return j frame of container or null public static j frame get frame container container container element container while element null if element instanceof j frame return j frame element element element get parent return null jframe jframe getframe jframe jframe getparent get graphics of container or its parent the element may not have a graphic if not displayed yet but the parent might have param container container return graphics of container or null public static graphics get graphics container container container element container while element null graphics g element get graphics if g null return g element element get parent return null getgraphics getgraphics getparent return j dialog or j frame parent param container container return j dialog or j frame of container public static window get parent container container container element container while element null if element instanceof j dialog element instanceof j frame return window element if element instanceof window return window element element element get parent return null jdialog jframe jdialog jframe getparent jdialog jframe getparent get image with file name param file name in image dir full file name in imgaes folder e g bean16 gif return image public static image get image string file name in image dir url url compiere class get resource images file name in image dir if url null s log log level severe not found file name in image dir return null toolkit tk toolkit get default toolkit return tk get image url filenameinimagedir getimage filenameinimagedir getresource filenameinimagedir s_log filenameinimagedir getdefaulttoolkit getimage get image icon param file name in image dir full file name in imgaes folder e g bean16 gif return image public static image icon get image icon string file name in image dir url url compiere class get resource images file name in image dir if url null s log log level severe not found file name in image dir return null return new image icon url imageicon filenameinimagedir imageicon getimageicon filenameinimagedir getresource filenameinimagedir s_log filenameinimagedir imageicon start browser param url url public static void start browser string url s log info url os command string cmd explorer if is windows cmd netscape string execute cmd url try runtime get runtime exec execute catch exception e s log severe execute e startbrowser s_log iswindows getruntime s_log do we run on apple return true if mac public static boolean is mac string os name system get property os name os name os name to lower case return os name index of mac 1 ismac osname getproperty osname osname tolowercase osname indexof do we run on windows return true if windows public static boolean is windows string os name system get property os name os name os name to lower case return os name index of windows 1 iswindows osname getproperty osname osname tolowercase osname indexof hide window param window window return true if window is hidden otherwise close it static public boolean hide window c frame window if ini is cache window s closingwindows return false for int i 0 i s hiddenwindows size i c frame hidden s hiddenwindows get i s log info i hidden if hidden getad window id window getad window id return false already there if window getad window id 0 workbench if s hiddenwindows add window window set visible false s log info window to string window dispatch event new window event window window event window iconified if s hiddenwindows size 10 s hiddenwindows remove 0 sort of lru return true return false hidewindow cframe iscachewindow s_closingwindows s_hiddenwindows cframe s_hiddenwindows s_log getad_window_id getad_window_id getad_window_id s_hiddenwindows setvisible s_log tostring dispatchevent windowevent windowevent window_iconified s_hiddenwindows s_hiddenwindows show window param ad window id window return true if window re displayed static public boolean show window int ad window id for int i 0 i s hiddenwindows size i c frame hidden s hiddenwindows get i if hidden getad window id ad window id hidden set visible true s hiddenwindows remove i s log info hidden to string hidden to front return true return false ad_window_id showwindow ad_window_id s_hiddenwindows cframe s_hiddenwindows getad_window_id ad_window_id setvisible s_hiddenwindows s_log tostring tofront clode windows static void close windows s closingwindows true for int i 0 i s hiddenwindows size i c frame hidden s hiddenwindows get i hidden dispose s closingwindows false closewindows s_closingwindows s_hiddenwindows cframe s_hiddenwindows s_closingwindows standard constructor public x m sernoctlexclude properties ctx int m sernoctlexclude id string trx name super ctx m sernoctlexclude id trx name if m sernoctlexclude id 0 setad table id 0 set isso trx false setm sernoctlexclude id 0 setm sernoctl id 0 x_m_sernoctlexclude m_sernoctlexclude_id trxname m_sernoctlexclude_id trxname m_sernoctlexclude_id setad_table_id setissotrx setm_sernoctlexclude_id setm_sernoctl_id load constructor public x m sernoctlexclude properties ctx result set rs string trx name super ctx rs trx name x_m_sernoctlexclude resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m sernoctlexclude append get id append return sb to string tostring stringbuffer stringbuffer x_m_sernoctlexclude get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set exclude ser no exclude the ability to create serial numbers in attribute sets public void setm sernoctlexclude id int m sernoctlexclude id if m sernoctlexclude id 1 throw new illegal argument exception m sernoctlexclude id is mandatory set valuenocheck m sernoctlexclude id new integer m sernoctlexclude id serno setm_sernoctlexclude_id m_sernoctlexclude_id m_sernoctlexclude_id illegalargumentexception m_sernoctlexclude_id set_valuenocheck m_sernoctlexclude_id m_sernoctlexclude_id get exclude ser no exclude the ability to create serial numbers in attribute sets public int getm sernoctlexclude id integer ii integer get value m sernoctlexclude id if ii null return 0 return ii int value serno getm_sernoctlexclude_id get_value m_sernoctlexclude_id intvalue set serial no control product serial number control public void setm sernoctl id int m sernoctl id if m sernoctl id 1 throw new illegal argument exception m sernoctl id is mandatory set valuenocheck m sernoctl id new integer m sernoctl id setm_sernoctl_id m_sernoctl_id m_sernoctl_id illegalargumentexception m_sernoctl_id set_valuenocheck m_sernoctl_id m_sernoctl_id get serial no control product serial number control public int getm sernoctl id integer ii integer get value m sernoctl id if ii null return 0 return ii int value getm_sernoctl_id get_value m_sernoctl_id intvalue standard constructor public x pa benchmark properties ctx int pa benchmark id string trx name super ctx pa benchmark id trx name if pa benchmark id 0 set accumulation type null set name null setpa benchmark id 0 x_pa_benchmark pa_benchmark_id trxname pa_benchmark_id trxname pa_benchmark_id setaccumulationtype setname setpa_benchmark_id load constructor public x pa benchmark properties ctx result set rs string trx name super ctx rs trx name x_pa_benchmark resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa benchmark append get id append return sb to string tostring stringbuffer stringbuffer x_pa_benchmark get_id tostring public static final string accumulationtype sum s set accumulation type how to accumulate data on time axis public void set accumulation type string accumulation type if accumulation type null throw new illegal argument exception accumulation type is mandatory if accumulation type equals a accumulation type equals s else throw new illegal argument exception accumulation type invalid value accumulation type reference id 370 a s if accumulation type length 1 log warning length 1 truncated accumulation type accumulation type substring 0 0 set value accumulation type accumulation type accumulationtype_sum setaccumulationtype accumulationtype accumulationtype illegalargumentexception accumulationtype accumulationtype accumulationtype illegalargumentexception accumulationtype accumulationtype reference_id accumulationtype accumulationtype accumulationtype set_value accumulationtype accumulationtype get accumulation type how to accumulate data on time axis public string get accumulation type return string get value accumulation type getaccumulationtype get_value accumulationtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set benchmark performance benchmark public void setpa benchmark id int pa benchmark id if pa benchmark id 1 throw new illegal argument exception pa benchmark id is mandatory set valuenocheck pa benchmark id new integer pa benchmark id setpa_benchmark_id pa_benchmark_id pa_benchmark_id illegalargumentexception pa_benchmark_id set_valuenocheck pa_benchmark_id pa_benchmark_id get benchmark performance benchmark public int getpa benchmark id integer ii integer get value pa benchmark id if ii null return 0 return ii int value getpa_benchmark_id get_value pa_benchmark_id intvalue standard constructor public x gl budget properties ctx int gl budget id string trx name super ctx gl budget id trx name if gl budget id 0 setgl budget id 0 set is primary false set name null x_gl_budget gl_budget_id trxname gl_budget_id trxname gl_budget_id setgl_budget_id setisprimary setname load constructor public x gl budget properties ctx result set rs string trx name super ctx rs trx name x_gl_budget resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl budget append get id append return sb to string tostring stringbuffer stringbuffer x_gl_budget get_id tostring public static final string budgetstatus draft d set budget status indicates the current status of this budget public void set budget status string budget status if budget status null throw new illegal argument exception budget status is mandatory if budget status null budget status equals a budget status equals d else throw new illegal argument exception budget status invalid value budget status reference id 178 a d if budget status null budget status length 1 log warning length 1 truncated budget status budget status substring 0 0 set value budget status budget status budgetstatus_draft setbudgetstatus budgetstatus budgetstatus illegalargumentexception budgetstatus budgetstatus budgetstatus budgetstatus illegalargumentexception budgetstatus budgetstatus reference_id budgetstatus budgetstatus budgetstatus budgetstatus set_value budgetstatus budgetstatus get budget status indicates the current status of this budget public string get budget status return string get value budget status getbudgetstatus get_value budgetstatus set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 1 throw new illegal argument exception gl budget id is mandatory set valuenocheck gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id illegalargumentexception gl_budget_id set_valuenocheck gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set primary indicates if this is the primary budget public void set is primary boolean is primary set value is primary new boolean is primary setisprimary isprimary set_value isprimary isprimary get primary indicates if this is the primary budget public boolean is primary object oo get value is primary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprimary get_value isprimary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x ad taskinstance properties ctx int ad taskinstance id string trx name super ctx ad taskinstance id trx name if ad taskinstance id 0 setad taskinstance id 0 setad task id 0 x_ad_taskinstance ad_taskinstance_id trxname ad_taskinstance_id trxname ad_taskinstance_id setad_taskinstance_id setad_task_id load constructor public x ad taskinstance properties ctx result set rs string trx name super ctx rs trx name x_ad_taskinstance resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad taskinstance append get id append return sb to string tostring stringbuffer stringbuffer x_ad_taskinstance get_id tostring set task instance public void setad taskinstance id int ad taskinstance id if ad taskinstance id 1 throw new illegal argument exception ad taskinstance id is mandatory set valuenocheck ad taskinstance id new integer ad taskinstance id setad_taskinstance_id ad_taskinstance_id ad_taskinstance_id illegalargumentexception ad_taskinstance_id set_valuenocheck ad_taskinstance_id ad_taskinstance_id get task instance public int getad taskinstance id integer ii integer get value ad taskinstance id if ii null return 0 return ii int value getad_taskinstance_id get_value ad_taskinstance_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad taskinstance id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_taskinstance_id set os task operation system task public void setad task id int ad task id if ad task id 1 throw new illegal argument exception ad task id is mandatory set value ad task id new integer ad task id setad_task_id ad_task_id ad_task_id illegalargumentexception ad_task_id set_value ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else if name equals m pricelist version id p m pricelist version id para i get parameter as int else log log level severe unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername ad_client_id m_ad_client_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter m_pricelist_version_id p_m_pricelist_version_id getparameterasint m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i product where i isimported y append client check no db execute update sql to string get trxname log info delete old impored no set client org ia active created updated product type sql new string buffer update i product set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id 0 is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 product type coalesce product type i i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no set optional b partner sql new string buffer update i product i set c bpartner id select c bpartner id from c bpartner p where i bpartner value p value and i ad client id p ad client id where c bpartner id is null and i isimported y append client check no db execute update sql to string get trxname log info b partner no sql new string buffer update i product set i isimported e i errormsg i errormsg err invalid b partner where c bpartner id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid b partner no find product ean upc sql new string buffer update i product i set m product id select m product id from m product p where i upc p upc and i ad client id p ad client id where m product id is null and i isimported n append client check no db execute update sql to string get trxname log info product existing upc no value sql new string buffer update i product i set m product id select m product id from m product p where i value p value and i ad client id p ad client id where m product id is null and i isimported n append client check no db execute update sql to string get trxname log info product existing value no bp prod no sql new string buffer update i product i set m product id select m product id from m product po p where i c bpartner id p c bpartner id and i vendor product no p vendor product no and i ad client id p ad client id where m product id is null and i isimported n append client check no db execute update sql to string get trxname log info product existing vendor product no no set product category own sql new string buffer update i product set productcategory value select value from m product category where is default y and ad client id append m ad client id append and rownum 1 where productcategory value is null and m product category id is null and i isimported y append client check no db execute update sql to string get trxname log fine set category default no sql new string buffer update i product i set m product category id select m product category id from m product category c where i productcategory value c value and i ad client id c ad client id where productcategory value is not null and m product category id is null and i isimported y append client check no db execute update sql to string get trxname log info set category no copy from product if import does not have value string str fields new string value name description document note help upc sku classification product type discontinued discontinued by imageurl descriptionurl for int i 0 i str fields length i sql new string buffer update i product i set append str fields i append select append str fields i append from m product p where i m product id p m product id and i ad client id p ad client id where m product id is not null and append str fields i append is null and i isimported n append client check no db execute update sql to string get trxname if no 0 log fine str fields i default from existing product no string num fields new string c uom id m product category id volume weight shelf width shelf height shelf depth units per pallet for int i 0 i num fields length i sql new string buffer update i product i set append num fields i append select append num fields i append from m product p where i m product id p m product id and i ad client id p ad client id where m product id is not null and append num fields i append is null or append num fields i append 0 and i isimported n append client check no db execute update sql to string get trxname if no 0 log fine num fields i default from existing product no copy from product po if import does not have value string str fieldspo new string upc price effective vendor product no vendor category manufacturer discontinued discontinued by for int i 0 i str fieldspo length i sql new string buffer update i product i set append str fieldspo i append select append str fieldspo i append from m product po p where i m product id p m product id and i c bpartner id p c bpartner id and i ad client id p ad client id where m product id is not null and c bpartner id is not null and append str fieldspo i append is null and i isimported n append client check no db execute update sql to string get trxname if no 0 log fine str fieldspo i default from existing product po no string num fieldspo new string c uom id c currency id price list pricepo royalty amt order min order pack cost per order deliverytime promised for int i 0 i num fieldspo length i sql new string buffer update i product i set append num fieldspo i append select append num fieldspo i append from m product po p where i m product id p m product id and i c bpartner id p c bpartner id and i ad client id p ad client id where m product id is not null and c bpartner id is not null and append num fieldspo i append is null or append num fieldspo i append 0 and i isimported n append client check no db execute update sql to string get trxname if no 0 log fine num fieldspo i default from existing product po no invalid category sql new string buffer update i product set i isimported e i errormsg i errormsg err invalid prod categorty where m product category id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid category no set uom system own sql new string buffer update i product i set x12de355 select x12de355 from c uom u where u is default y and u ad client id in 0 i ad client id and rownum 1 where x12de355 is null and c uom id is null and i isimported y append client check no db execute update sql to string get trxname log fine set uom default no sql new string buffer update i product i set c uom id select c uom id from c uom u where u x12de355 i x12de355 and u ad client id in 0 i ad client id where c uom id is null and i isimported y append client check no db execute update sql to string get trxname log info set uom no sql new string buffer update i product set i isimported e i errormsg i errormsg err invalid uom where c uom id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid uom no set currency sql new string buffer update i product i set iso code select iso code from c currency c inner join c acctschema a on a c currency id c c currency id inner join ad clientinfo ci on a c acctschema id ci c acctschema1 id where ci ad client id i ad client id where c currency id is null and iso code is null and i isimported y append client check no db execute update sql to string get trxname log fine set currency default no sql new string buffer update i product i set c currency id select c currency id from c currency c where i iso code c iso code and c ad client id in 0 i ad client id where c currency id is null and i isimported y append client check no db execute update sql to string get trxname log info do it set currency no sql new string buffer update i product set i isimported e i errormsg i errormsg err currency where c currency id is null and i isimported y append client check no db doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_product i_isimported clientcheck executeupdate tostring get_trxname iaactive producttype stringbuffer i_product ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby producttype producttype i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname bpartner stringbuffer i_product c_bpartner_id c_bpartner_id c_bpartner bpartner_value ad_client_id ad_client_id c_bpartner_id i_isimported clientcheck executeupdate tostring get_trxname bpartner stringbuffer i_product i_isimported i_errormsg i_errormsg bpartner c_bpartner_id i_isimported clientcheck executeupdate tostring get_trxname bpartner stringbuffer i_product m_product_id m_product_id m_product ad_client_id ad_client_id m_product_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product m_product_id m_product_id m_product ad_client_id ad_client_id m_product_id i_isimported clientcheck executeupdate tostring get_trxname prodno stringbuffer i_product m_product_id m_product_id m_product_po c_bpartner_id c_bpartner_id vendorproductno vendorproductno ad_client_id ad_client_id m_product_id i_isimported clientcheck executeupdate tostring get_trxname productno stringbuffer i_product productcategory_value m_product_category isdefault ad_client_id m_ad_client_id productcategory_value m_product_category_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product m_product_category_id m_product_category_id m_product_category productcategory_value ad_client_id ad_client_id productcategory_value m_product_category_id i_isimported clientcheck executeupdate tostring get_trxname strfields documentnote producttype discontinuedby strfields stringbuffer i_product strfields strfields m_product m_product_id m_product_id ad_client_id ad_client_id m_product_id strfields i_isimported clientcheck executeupdate tostring get_trxname strfields numfields c_uom_id m_product_category_id shelfwidth shelfheight shelfdepth unitsperpallet numfields stringbuffer i_product numfields numfields m_product m_product_id m_product_id ad_client_id ad_client_id m_product_id numfields numfields i_isimported clientcheck executeupdate tostring get_trxname numfields product_po strfieldspo priceeffective vendorproductno vendorcategory discontinuedby strfieldspo stringbuffer i_product strfieldspo strfieldspo m_product_po m_product_id m_product_id c_bpartner_id c_bpartner_id ad_client_id ad_client_id m_product_id c_bpartner_id strfieldspo i_isimported clientcheck executeupdate tostring get_trxname strfieldspo numfieldspo c_uom_id c_currency_id pricelist royaltyamt order_min order_pack costperorder deliverytime_promised numfieldspo stringbuffer i_product numfieldspo numfieldspo m_product_po m_product_id m_product_id c_bpartner_id c_bpartner_id ad_client_id ad_client_id m_product_id c_bpartner_id numfieldspo numfieldspo i_isimported clientcheck executeupdate tostring get_trxname numfieldspo stringbuffer i_product i_isimported i_errormsg i_errormsg prodcategorty m_product_category_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product c_uom isdefault ad_client_id ad_client_id c_uom_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product c_uom_id c_uom_id c_uom ad_client_id ad_client_id c_uom_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product i_isimported i_errormsg i_errormsg c_uom_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product iso_code iso_code c_currency c_acctschema c_currency_id c_currency_id ad_clientinfo c_acctschema_id c_acctschema1_id ad_client_id ad_client_id c_currency_id iso_code i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_product c_currency_id c_currency_id c_currency iso_code iso_code ad_client_id ad_client_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname doit stringbuffer i_product i_isimported i_errormsg i_errormsg c_currency_id i_isimported clientcheck prepare get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad printformat id m ad printformat id big decimal para i get parameter else if name equals ad table id m ad table id big decimal para i get parameter else log equals prepare unknown parameter para i get parameter name processinfoparameter getparameter getparametername getparameter ad_printformat_id m_ad_printformat_id bigdecimal getparameter ad_table_id m_ad_table_id bigdecimal getparameter getparametername perrform process pre if ad table id is not null create from table otherwise copy from ad printformat id pre return message throws exception protected string do it throws exception if m ad table id null m ad table id int value 0 log info create from ad table id m ad table id m print format pf m print format create from table get ctx m ad table id int value getrecord id add log m ad table id int value null new big decimal pf get item count pf get name return pf get name pf get item count else if m ad printformat id null m ad printformat id int value 0 log info m print format process copy from ad printformat id m ad printformat id m print format pf m print format copy get ctx m ad printformat id int value getrecord id add log m ad printformat id int value null new big decimal pf get item count pf get name return pf get name pf get item count else throw new exception msg invalidarguments ad_table_id ad_printformat_id doit m_ad_table_id m_ad_table_id intvalue ad_table_id m_ad_table_id mprintformat mprintformat createfromtable getctx m_ad_table_id intvalue getrecord_id addlog m_ad_table_id intvalue bigdecimal getitemcount getname getname getitemcount m_ad_printformat_id m_ad_printformat_id intvalue mprintformatprocess ad_printformat_id m_ad_printformat_id mprintformat mprintformat getctx m_ad_printformat_id intvalue getrecord_id addlog m_ad_printformat_id intvalue bigdecimal getitemcount getname getname getitemcount msg_invalidarguments get active param ctx context return active processors public static m alert processor get active properties ctx array list m alert processor list new array list m alert processor string sql select from ad alertprocessor where is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m alert processor ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m alert processor ret value new m alert processor list size list to array ret value return ret value malertprocessor getactive arraylist malertprocessor arraylist malertprocessor ad_alertprocessor isactive preparedstatement preparestatement resultset executequery malertprocessor s_log malertprocessor retvalue malertprocessor toarray retvalue retvalue standard constructor param ctx context param ad alertprocessorlog id id public m alert processor properties ctx int ad alertprocessorlog id string trx name super ctx ad alertprocessorlog id trx name ad_alertprocessorlog_id malertprocessor ad_alertprocessorlog_id trxname ad_alertprocessorlog_id trxname load constructor param ctx context param rs result set public m alert processor properties ctx result set rs string trx name super ctx rs trx name malertprocessor resultset trxname trxname get server id return id public string get serverid return alert processor get id getserverid alertprocessor get_id get date next run param requery requery return date next run public timestamp get date next run boolean requery if requery load get trxname return get date next run getdatenextrun get_trxname getdatenextrun get logs return logs public compiere processor log get logs array list m alert processor log list new array list m alert processor log string sql select from ad alertprocessorlog where ad alertprocessor id order by created desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad alertprocessor id result set rs pstmt execute query while rs next list add new m alert processor log get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m alert processor log ret value new m alert processor log list size list to array ret value return ret value compiereprocessorlog getlogs arraylist malertprocessorlog arraylist malertprocessorlog ad_alertprocessorlog ad_alertprocessor_id preparedstatement preparestatement setint getad_alertprocessor_id resultset executequery malertprocessorlog getctx malertprocessorlog retvalue malertprocessorlog toarray retvalue retvalue delete old request log return number of records public int delete log if get keep log days 1 return 0 string sql delete ad alertprocessorlog where ad alertprocessor id getad alertprocessor id and created get keep log days sys date int no db execute update sql get trxname return 0 deletelog getkeeplogdays ad_alertprocessorlog ad_alertprocessor_id getad_alertprocessor_id getkeeplogdays sysdate executeupdate get_trxname get alerts param reload reload data return array of alerts public m alert get alerts boolean reload if m alerts null reload return m alerts string sql select from ad alert where ad alertprocessor id array list m alert list new array list m alert prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad alertprocessor id result set rs pstmt execute query while rs next list add new m alert get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m alerts new m alert list size list to array m alerts return m alerts malert getalerts m_alerts m_alerts ad_alert ad_alertprocessor_id arraylist malert arraylist malert preparedstatement preparestatement setint getad_alertprocessor_id resultset executequery malert getctx m_alerts malert toarray m_alerts m_alerts standard constructor param ctx context param c commissionline id id public m commission line properties ctx int c commissionline id string trx name super ctx c commissionline id trx name if c commissionline id 0 setc commission id 0 set line 0 sql select nvl max line 0 10 as default value from c commissionline where c commission id c commission id set amt multiplier env zero set amt subtract env zero set commission orders false set is positive only false set qty multiplier env zero set qty subtract env zero c_commissionline_id mcommissionline c_commissionline_id trxname c_commissionline_id trxname c_commissionline_id setc_commission_id setline defaultvalue c_commissionline c_commission_id c_commission_id setamtmultiplier setamtsubtract setcommissionorders setispositiveonly setqtymultiplier setqtysubtract load constructor param ctx context param rs result set public m commission line properties ctx result set rs string trx name super ctx rs trx name mcommissionline resultset trxname trxname standard constructor public x c commissiondetail properties ctx int c commissiondetail id string trx name super ctx c commissiondetail id trx name if c commissiondetail id 0 set actual amt env zero set actual qty env zero setc commissionamt id 0 setc commissiondetail id 0 setc currency id 0 set converted amt env zero x_c_commissiondetail c_commissiondetail_id trxname c_commissiondetail_id trxname c_commissiondetail_id setactualamt setactualqty setc_commissionamt_id setc_commissiondetail_id setc_currency_id setconvertedamt load constructor public x c commissiondetail properties ctx result set rs string trx name super ctx rs trx name x_c_commissiondetail resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c commissiondetail append get id append return sb to string tostring stringbuffer stringbuffer x_c_commissiondetail get_id tostring set actual amount the actual amount public void set actual amt big decimal actual amt if actual amt null throw new illegal argument exception actual amt is mandatory set value actual amt actual amt setactualamt bigdecimal actualamt actualamt illegalargumentexception actualamt set_value actualamt actualamt get actual amount the actual amount public big decimal get actual amt big decimal bd big decimal get value actual amt if bd null return env zero return bd bigdecimal getactualamt bigdecimal bigdecimal get_value actualamt set actual quantity the actual quantity public void set actual qty big decimal actual qty if actual qty null throw new illegal argument exception actual qty is mandatory set value actual qty actual qty setactualqty bigdecimal actualqty actualqty illegalargumentexception actualqty set_value actualqty actualqty get actual quantity the actual quantity public big decimal get actual qty big decimal bd big decimal get value actual qty if bd null return env zero return bd bigdecimal getactualqty bigdecimal bigdecimal get_value actualqty set commission amount generated commission amount public void setc commissionamt id int c commissionamt id if c commissionamt id 1 throw new illegal argument exception c commissionamt id is mandatory set valuenocheck c commissionamt id new integer c commissionamt id setc_commissionamt_id c_commissionamt_id c_commissionamt_id illegalargumentexception c_commissionamt_id set_valuenocheck c_commissionamt_id c_commissionamt_id get commission amount generated commission amount public int getc commissionamt id integer ii integer get value c commissionamt id if ii null return 0 return ii int value getc_commissionamt_id get_value c_commissionamt_id intvalue set commission detail supporting information for commission amounts public void setc commissiondetail id int c commissiondetail id if c commissiondetail id 1 throw new illegal argument exception c commissiondetail id is mandatory set valuenocheck c commissiondetail id new integer c commissiondetail id setc_commissiondetail_id c_commissiondetail_id c_commissiondetail_id illegalargumentexception c_commissiondetail_id set_valuenocheck c_commissiondetail_id c_commissiondetail_id get commission detail supporting information for commission amounts public int getc commissiondetail id integer ii integer get value c commissiondetail id if ii null return 0 return ii int value getc_commissiondetail_id get_value c_commissiondetail_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set valuenocheck c orderline id null else set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_valuenocheck c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set converted amount converted amount public void set converted amt big decimal converted amt if converted amt null throw new illegal argument exception converted amt is mandatory set value converted amt converted amt setconvertedamt bigdecimal convertedamt convertedamt illegalargumentexception convertedamt set_value convertedamt convertedamt get converted amount converted amount public big decimal get converted amt big decimal bd big decimal get value converted amt if bd null return env zero return bd bigdecimal getconvertedamt bigdecimal bigdecimal get_value convertedamt set info information public void set info string info if info null info length 60 log warning length 60 truncated info info substring 0 59 set value info info setinfo set_value get info information public string get info return string get value info getinfo get_value set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value return string get value reference public key name pair get key name pair return new key name pair get id get reference get_value keynamepair getkeynamepair keynamepair get_id getreference initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w attachment init servletconfig servletexception webenv initweb servletexception wattachment process the http get request initial display and streaming param request request param response response public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr http session session request get session false w window status ws w window status get request web doc doc null if session null ws null doc web doc create popup no context doc add popup close else string error null int ad attachment id web util get parameter as int request p attachment id if ad attachment id 0 int attachment index web util get parameter as int request p attachment index if attachment index 0 error stream attachment ad attachment id attachment index response ws if error null return doc create page ws ctx ws cur tab getad attachmentid ws cur tab getad table id ws cur tab getrecord id error web util create response request response this null doc false doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession wwindowstatus wwindowstatus webdoc webdoc createpopup addpopupclose ad_attachment_id webutil getparameterasint p_attachment_id ad_attachment_id attachmentindex webutil getparameterasint p_attachment_index attachmentindex streamattachment ad_attachment_id attachmentindex createpage curtab getad_attachmentid curtab getad_table_id curtab getrecord_id webutil createresponse process the http post request update attachment param request request parem response response public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr http session sess request get session false w window status ws w window status get request web doc doc null if ws null doc web doc create help no context else string error process post request response ws doc create page ws ctx ws cur tab getad attachmentid ws cur tab getad table id ws cur tab getrecord id error web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession wwindowstatus wwindowstatus webdoc webdoc processpost createpage curtab getad_attachmentid curtab getad_table_id curtab getrecord_id webutil createresponse create attachment page param ctx context param ad attachment id id for existing attachment param ad table id table for new attachment param record id record for new attachment param error optional error message return web doc private web doc create page properties ctx int ad attachment id int ad table id int record id string error web doc doc web doc create popup msg translate ctx ad attachment id table table doc get table if error null table add element new tr add element new td popup header align type right align type top false null add element new td popup header align type left align type top false new p error align type left set class cerror window css m attachment attachment null if ad attachment id 0 attachment new m attachment ctx ad attachment id null else attachment new m attachment ctx ad table id record id null tr tr new tr td left new td popup center align type right align type top false new label text msg t msg translate ctx text msg td right new td popup center align type left align type top false text message update form text msg new form w attachment text msg add element new input input type hidden p attachment id ad attachment id text msg add element new input input type hidden ad table id ad table id text msg add element new input input type hidden record id record id textarea msg new textarea p textmsg 5 40 msg add element attachment get text msg text msg add element msg text msg add element new br text msg add element new input input type submit submit submit right add element text msg existing links p p new p m attachment entry entries attachment get entries for int i 0 i entries length i m attachment entry entry entries i if i 0 p add element string url w attachment p attachment id ad attachment id p attachment index entry get index p add element new a url null a target blank entry get name right add element p upload form upload file upload create form w attachment upload add element new input input type hidden p attachment id ad attachment id upload add element new input input type hidden ad table id ad table id upload add element new input input type hidden record id record id right add element upload tr add element left tr add element right table add element tr footer doc add popup close system out println doc return doc ad_attachment_id ad_table_id record_id webdoc webdoc createpage ad_attachment_id ad_table_id record_id webdoc webdoc createpopup ad_attachment_id gettable addelement addelement popupheader aligntype aligntype addelement popupheader aligntype aligntype aligntype setclass mattachment ad_attachment_id mattachment ad_attachment_id mattachment ad_table_id record_id popupcenter aligntype aligntype textmsg textmsg popupcenter aligntype aligntype textmsg wattachment textmsg addelement type_hidden p_attachment_id ad_attachment_id textmsg addelement type_hidden ad_table_id ad_table_id textmsg addelement type_hidden record_id record_id p_textmsg addelement gettextmsg textmsg addelement textmsg addelement textmsg addelement type_submit addelement textmsg mattachmententry getentries mattachmententry addelement wattachment p_attachment_id ad_attachment_id p_attachment_index getindex addelement target_blank getname addelement fileupload createform wattachment addelement type_hidden p_attachment_id ad_attachment_id addelement type_hidden ad_table_id ad_table_id addelement type_hidden record_id record_id addelement addelement addelement addelement addpopupclose stream attachment entry param ad attachment id attachment param attachment index index param response response param ws status return error message private string stream attachment int ad attachment id int attachment index http servlet response response w window status ws log info ad attachment id ad attachment id attachment index attachment index m attachment attachment new m attachment ws ctx ad attachment id null if attachment get id 0 log fine no attachment ad attachment id ad attachment id return attachment not found make sure it s the right attachment if ws cur tab getad attachmentid ad attachment id log warning tab ad attachment id ws cur tab getad attachmentid ad attachment id return your attachment not found stream it return web util stream attachment response attachment attachment index ad_attachment_id attachmentindex streamattachment ad_attachment_id attachmentindex httpservletresponse wwindowstatus ad_attachment_id ad_attachment_id attachmentindex attachmentindex mattachment mattachment ad_attachment_id get_id ad_attachment_id ad_attachment_id curtab getad_attachmentid ad_attachment_id ad_attachment_id curtab getad_attachmentid ad_attachment_id webutil streamattachment attachmentindex process post update create attachment upload attachment entry param request request param response response return error message private string process post http servlet request request http servlet response response w window status ws int ad attachment id 0 int ad table id 0 int record id 0 string text msg null file upload upload null url encrypted if request get content type equals form enc default ad attachment id web util get parameter as int request p attachment id ad table id web util get parameter as int request ad table id record id web util get parameter as int request record id text msg web util get parameter request p textmsg else upload new file upload request string error upload get error if error null log warning pocess post error return error ad attachment id upload get parameter as int p attachment id ad table id upload get parameter as int ad table id record id upload get parameter as int record id web env dump request log info process post ad attachment id ad attachment id ad table id ad table id record id record id upload upload check if you own the attachment if ws cur tab getad attachmentid ad attachment id return your attachment not found check if we can save if ad attachment id 0 record id 0 return need to save record first m attachment attachment null if ad attachment id 0 attachment new m attachment ws ctx ad table id record id null else attachment new m attachment ws ctx ad attachment id null update attachment text if text msg null attachment set text msg text msg create attachment if upload null attachment add entry upload get file name upload get data save and update if attachment save ws cur tab load attachments update tab else return attachment not saved ok return null processpost httpservletrequest httpservletresponse wwindowstatus ad_attachment_id ad_table_id record_id textmsg fileupload getcontenttype enc_default ad_attachment_id webutil getparameterasint p_attachment_id ad_table_id webutil getparameterasint ad_table_id record_id webutil getparameterasint record_id textmsg webutil getparameter p_textmsg fileupload geterror pocesspost ad_attachment_id getparameterasint p_attachment_id ad_table_id getparameterasint ad_table_id record_id getparameterasint record_id webenv processpost ad_attachment_id ad_attachment_id ad_table_id ad_table_id record_id record_id curtab getad_attachmentid ad_attachment_id ad_attachment_id record_id mattachment ad_attachment_id mattachment ad_table_id record_id mattachment ad_attachment_id textmsg settextmsg textmsg addentry getfilename getdata curtab loadattachments private string icon mono32x32 filename public mini table bean info iconmono32x32filename minitablebeaninfo public property descriptor get property descriptors property descriptor pds new property descriptor return pds propertydescriptor getpropertydescriptors propertydescriptor propertydescriptor public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename basic constructor public noscript basic constructor param element adds an element to the element public noscript element element add element element addelement basic constructor param element adds an element to the element public noscript string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public noscript add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public noscript add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public noscript add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public noscript add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public noscript remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute basic constructor public b basic constructor param element adds an element to the element public b element element add element element addelement basic constructor param element adds an element to the element public b string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public b add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public b add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public b add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public b add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public b remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param ass accounting schemata param rs record parem trx name trx protected doc bank m acct schema ass result set rs string trx name super ass m bank statement class rs doctype bankstatement trx name trxname doc_bank macctschema resultset trxname mbankstatement doctype_bankstatement trxname load specific document details return error message or null protected string load document details m bank statement bs m bank statement getpo set date doc bs get statement date set date acct bs get statement date overwritten on line level m c bankaccount id bs getc bankaccount id amounts set amount amttype gross bs get statement difference set bank account info currency m bank account ba m bank account get get ctx m c bankaccount id setc currency id ba getc currency id contained objects p lines load lines bs log fine lines p lines length return null loaddocumentdetails mbankstatement mbankstatement setdatedoc getstatementdate setdateacct getstatementdate m_c_bankaccount_id getc_bankaccount_id setamount amttype_gross getstatementdifference mbankaccount mbankaccount getctx m_c_bankaccount_id setc_currency_id getc_currency_id p_lines loadlines p_lines load invoice line 4 amounts amttype payment amttype statement2 amttype charge amttype interest return doc line array private doc line load lines m bank statement bs array list doc line list new array list doc line m bank statement line lines bs get lines false for int i 0 i lines length i m bank statement line line lines i docline bank doc line new docline bank line this set date acct if i 0 set date acct line get date acct m period period m period get get ctx line get date acct if period null period is open doctype bankstatement doc line setc period id period getc period id list add doc line return array doc line dls new doc line list size list to array dls return dls amttype_payment amttype_statement2 amttype_charge amttype_interest docline docline loadlines mbankstatement arraylist docline arraylist docline mbankstatementline getlines mbankstatementline docline_bank docline docline_bank setdateacct getdateacct mperiod mperiod getctx getdateacct isopen doctype_bankstatement docline setc_period_id getc_period_id docline docline docline toarray get source currency balance subtracts line amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value env zero string buffer sb new string buffer total ret value ret value add get amount doc amttype gross sb append get amount doc amttype gross lines for int i 0 i p lines length i big decimal line balance docline bank p lines i get stmt amt ret value ret value subtract line balance sb append append line balance sb append log fine to string balance ret value sb to string return ret value bigdecimal getbalance bigdecimal retvalue stringbuffer stringbuffer retvalue retvalue getamount amttype_gross getamount amttype_gross p_lines bigdecimal linebalance docline_bank p_lines getstmtamt retvalue retvalue linebalance linebalance tostring retvalue tostring retvalue create facts the accounting logic for cmb pre bank asset dr cr statement bank in transit dr cr payment charge dr charge interest dr cr interest pre param as accounting schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual header there may be different currency amounts fact line fl null int ad org id getbank org id bank account org lines for int i 0 i p lines length i docline bank line docline bank p lines i int c bpartner id line getc bpartner id bank asset dr cr statement fl fact create line line get account doc accttype bankasset as line getc currency id line get stmt amt if fl null ad org id 0 fl setad org id ad org id if fl null c bpartner id 0 fl setc bpartner id c bpartner id bank in transit dr cr payment fl fact create line line get account doc accttype bankintransit as line getc currency id line get trx amt negate if fl null if c bpartner id 0 fl setc bpartner id c bpartner id if ad org id 0 fl setad org id ad org id else fl setad org id line getad org id true from payment charge dr charge fl fact create line line line get charge account as line get charge amt negate line getc currency id line get charge amt negate null if fl null c bpartner id 0 fl setc bpartner id c bpartner id interest dr cr interest if line get interest amt signum 0 fl fact create line line get account doc accttype interestexp as get account doc accttype interestexp as line getc currency id line get interest amt negate else fl fact create line line get account doc accttype interestrev as get account doc accttype interestrev as line getc currency id line get interest amt negate if fl null c bpartner id 0 fl setc bpartner id c bpartner id fact create tax correction array list fact facts new array list fact facts add fact return facts bankasset bankintransit arraylist createfacts macctschema post_actual factline ad_org_id getbank_org_id p_lines docline_bank docline_bank p_lines c_bpartner_id getc_bpartner_id bankasset createline getaccount accttype_bankasset getc_currency_id getstmtamt ad_org_id setad_org_id ad_org_id c_bpartner_id setc_bpartner_id c_bpartner_id bankintransit createline getaccount accttype_bankintransit getc_currency_id gettrxamt c_bpartner_id setc_bpartner_id c_bpartner_id ad_org_id setad_org_id ad_org_id setad_org_id getad_org_id createline getchargeaccount getchargeamt getc_currency_id getchargeamt c_bpartner_id setc_bpartner_id c_bpartner_id getinterestamt createline getaccount accttype_interestexp getaccount accttype_interestexp getc_currency_id getinterestamt createline getaccount accttype_interestrev getaccount accttype_interestrev getc_currency_id getinterestamt c_bpartner_id setc_bpartner_id c_bpartner_id createtaxcorrection arraylist arraylist get ad org id from bank account return ad org id or 0 private int getbank org id if m c bankaccount id 0 return 0 m bank account ba m bank account get get ctx m c bankaccount id return ba getad org id ad_org_id ad_org_id getbank_org_id m_c_bankaccount_id mbankaccount mbankaccount getctx m_c_bankaccount_id getad_org_id creates a code j combo box code that takes it s items from an existing code combo box model code since the code combo box model code is provided a combo box created using this constructor does not create a default combo box model and may impact how the insert remove and add methods behave param a model the code combo box model code that provides the displayed list of items see default combo box model public c combo box combo box model a model super a model init jcombobox comboboxmodel comboboxmodel amodel comboboxmodel defaultcomboboxmodel ccombobox comboboxmodel amodel amodel creates a code j combo box code that contains the elements in the specified array by default the first item in the array and therefore the data model becomes selected param items an array of objects to insert into the combo box see default combo box model public c combo box final object items super items init jcombobox defaultcomboboxmodel ccombobox creates a code j combo box code that contains the elements in the specified array by default the first item in the array and therefore the data model becomes selected param items an array of objects to insert into the combo box param key set selected if exists see default combo box model public c combo box final object items string key this items if key null return for int i 0 i 0 i object item items i if item null continue boolean found false if item instanceof name pair found name pair item getid equals key else found item to string equals key if found set selected index i break jcombobox defaultcomboboxmodel ccombobox namepair namepair tostring setselectedindex creates a code j combo box code that contains the elements in the specified vector by default the first item in the vector and therefore the data model becomes selected param items an array of vectors to insert into the combo box see default combo box model public c combo box vector items super items init jcombobox defaultcomboboxmodel ccombobox creates a code j combo box code with a default data model the default data model is an empty list of objects use code add item code to add items by default the first item in the data model becomes selected see default combo box model public c combo box super init jcombobox additem defaultcomboboxmodel ccombobox common init private void init overwrite otherwise label font set font compiereplaf getfont field set foreground compiereplaf gettextcolor normal set background false field hight get preferred size height setfont getfont_field setforeground gettextcolor_normal setbackground field_hight getpreferredsize set icon of arrow button to icon param default icon icon to be displayed public void set icon icon default icon if getui instanceof compiere combo boxui compiere combo boxui getui set icon default icon m icon default icon defaulticon seticon defaulticon compierecomboboxui compierecomboboxui seticon defaulticon m_icon defaulticon set ui and re set icon for arrow button param ui public void setui combo boxui ui super setui ui if m icon null ui instanceof compiere combo boxui compiere combo boxui getui set icon m icon comboboxui m_icon compierecomboboxui compierecomboboxui seticon m_icon display popup called from compiere combo popup and allows to implement alternative actions than showing the popup return if true the popup should be displayed public boolean display popup return true compierecombopopup displaypopup set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is enabled rw super set enabled rw set background false setreadwrite isenabled setenabled setbackground is it possible to edit return true if editable public boolean is read write return super is enabled isreadwrite isenabled set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set background param bg public void set background color bg if bg equals get background return super set background bg setbackground getbackground setbackground set editor to value param value value of the editor public void set value object value super set selected item value setvalue setselecteditem return editor value return current value public object get value return super get selected item getvalue getselecteditem return display value return displayed string value public string get display object o super get selected item if o null return return o to string getdisplay getselecteditem tostring add mouse listener 1 4 0 bug bug in 1 4 0 metal arrow button gets mouse events so add the j combo box mouse listeners to the arrow button no context menu if right click see compiere combo boxui installui j component param ml public void add mouse listener mouse listener ml super add mouse listener ml ignore calls from javax swing plaf basic basic combo boxui install listeners basic combo boxui java 271 if getui instanceof compiere combo boxui trace get caller class 1 starts with javax j button b compiere combo boxui getui get arrow button if b null b add mouse listener ml arrowbutton jcombobox mouselisteners arrowbutton compierecomboboxui jcomponent addmouselistener mouselistener addmouselistener basiccomboboxui installlisteners basiccomboboxui compierecomboboxui getcallerclass startswith jbutton compierecomboboxui getarrowbutton addmouselistener remove mouse listener param ml public void remove mouse listener mouse listener ml super remove mouse listener ml if getui instanceof compiere combo boxui j button b compiere combo boxui getui get arrow button if b null b remove mouse listener ml removemouselistener mouselistener removemouselistener compierecomboboxui jbutton compierecomboboxui getarrowbutton removemouselistener set action command param action command command public void set action command string action command super set action command action command if get name null action command null action command length 0 set name action command actioncommand setactioncommand actioncommand setactioncommand actioncommand getname actioncommand actioncommand setname actioncommand standard constructor public x m inout properties ctx int m inout id string trx name super ctx m inout id trx name if m inout id 0 setc bpartner id 0 setc bpartner location id 0 setc doctype id 0 set date acct new timestamp system current time millis date set delivery rule null a set delivery via rule null p set doc action null co set doc status null dr set document no null set freight cost rule null i set is approved false set is in dispute false set is in transit false set is printed false set isso trx false isso trx setm inout id 0 setm warehouse id 0 set movement date new timestamp system current time millis date set movement type null set posted false set priority rule null 5 set processed false set sende mail false x_m_inout m_inout_id trxname m_inout_id trxname m_inout_id setc_bpartner_id setc_bpartner_location_id setc_doctype_id setdateacct currenttimemillis setdeliveryrule setdeliveryviarule setdocaction setdocstatus setdocumentno setfreightcostrule setisapproved setisindispute setisintransit setisprinted setissotrx issotrx setm_inout_id setm_warehouse_id setmovementdate currenttimemillis setmovementtype setposted setpriorityrule setprocessed setsendemail load constructor public x m inout properties ctx result set rs string trx name super ctx rs trx name x_m_inout resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inout append get id append return sb to string tostring stringbuffer stringbuffer x_m_inout get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c charge id ad reference id 200 set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id c_charge_id_ad_reference_id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue public static final int c doctype id ad reference id 170 set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set valuenocheck c doctype id new integer c doctype id c_doctype_id_ad_reference_id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_valuenocheck c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt set value charge amt charge amt setchargeamt bigdecimal chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set create confirm public void set create confirm string create confirm if create confirm null create confirm length 1 log warning length 1 truncated create confirm create confirm substring 0 0 set value create confirm create confirm setcreateconfirm createconfirm createconfirm createconfirm createconfirm createconfirm set_value createconfirm createconfirm get create confirm public string get create confirm return string get value create confirm getcreateconfirm get_value createconfirm set create lines from process which will generate a new document lines based on an existing document public void set create from string create from if create from null create from length 1 log warning length 1 truncated create from create from substring 0 0 set value create from create from setcreatefrom createfrom createfrom createfrom createfrom createfrom set_value createfrom createfrom get create lines from process which will generate a new document lines based on an existing document public string get create from return string get value create from getcreatefrom get_value createfrom set create package public void set create package string create package if create package null create package length 1 log warning length 1 truncated create package create package substring 0 0 set value create package create package setcreatepackage createpackage createpackage createpackage createpackage createpackage set_value createpackage createpackage get create package public string get create package return string get value create package getcreatepackage get_value createpackage set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date ordered date of order public void set date ordered timestamp date ordered set valuenocheck date ordered date ordered setdateordered dateordered set_valuenocheck dateordered dateordered get date ordered date of order public timestamp get date ordered return timestamp get value date ordered getdateordered get_value dateordered set date printed date the document was printed public void set date printed timestamp date printed set value date printed date printed setdateprinted dateprinted set_value dateprinted dateprinted get date printed date the document was printed public timestamp get date printed return timestamp get value date printed getdateprinted get_value dateprinted set date received date a product was received public void set date received timestamp date received set value date received date received setdatereceived datereceived set_value datereceived datereceived get date received date a product was received public timestamp get date received return timestamp get value date received getdatereceived get_value datereceived public static final string deliveryrule afterreceipt r set delivery rule defines the timing of delivery public void set delivery rule string delivery rule if delivery rule null throw new illegal argument exception delivery rule is mandatory if delivery rule equals a delivery rule equals f delivery rule equals l delivery rule equals m delivery rule equals o delivery rule equals r else throw new illegal argument exception delivery rule invalid value delivery rule reference id 151 a f l m o r if delivery rule length 1 log warning length 1 truncated delivery rule delivery rule substring 0 0 set value delivery rule delivery rule deliveryrule_afterreceipt setdeliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule reference_id deliveryrule deliveryrule deliveryrule set_value deliveryrule deliveryrule get delivery rule defines the timing of delivery public string get delivery rule return string get value delivery rule getdeliveryrule get_value deliveryrule public static final string deliveryviarule shipper s set delivery via how the order will be delivered public void set delivery via rule string delivery via rule if delivery via rule null throw new illegal argument exception delivery via rule is mandatory if delivery via rule equals d delivery via rule equals p delivery via rule equals s else throw new illegal argument exception delivery via rule invalid value delivery via rule reference id 152 d p s if delivery via rule length 1 log warning length 1 truncated delivery via rule delivery via rule substring 0 0 set value delivery via rule delivery via rule deliveryviarule_shipper setdeliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule reference_id deliveryviarule deliveryviarule deliveryviarule set_value deliveryviarule deliveryviarule get delivery via how the order will be delivered public string get delivery via rule return string get value delivery via rule getdeliveryviarule get_value deliveryviarule set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set freight amount freight amount public void set freight amt big decimal freight amt set value freight amt freight amt setfreightamt bigdecimal freightamt set_value freightamt freightamt get freight amount freight amount public big decimal get freight amt big decimal bd big decimal get value freight amt if bd null return env zero return bd bigdecimal getfreightamt bigdecimal bigdecimal get_value freightamt public static final string freightcostrule line l set freight cost rule method for charging freight public void set freight cost rule string freight cost rule if freight cost rule null throw new illegal argument exception freight cost rule is mandatory if freight cost rule equals c freight cost rule equals f freight cost rule equals i freight cost rule equals l else throw new illegal argument exception freight cost rule invalid value freight cost rule reference id 153 c f i l if freight cost rule length 1 log warning length 1 truncated freight cost rule freight cost rule substring 0 0 set value freight cost rule freight cost rule freightcostrule_line setfreightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule reference_id freightcostrule freightcostrule freightcostrule set_value freightcostrule freightcostrule get freight cost rule method for charging freight public string get freight cost rule return string get value freight cost rule getfreightcostrule get_value freightcostrule set generate to generate to public void set generate to string generate to if generate to null generate to length 1 log warning length 1 truncated generate to generate to substring 0 0 set value generate to generate to setgenerateto generateto generateto generateto generateto generateto set_value generateto generateto get generate to generate to public string get generate to return string get value generate to getgenerateto get_value generateto set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set in dispute document is in dispute public void set is in dispute boolean is in dispute set value is in dispute new boolean is in dispute setisindispute isindispute set_value isindispute isindispute get in dispute document is in dispute public boolean is in dispute object oo get value is in dispute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isindispute get_value isindispute booleanvalue set in transit movement is in transit public void set is in transit boolean is in transit set value is in transit new boolean is in transit setisintransit isintransit set_value isintransit isintransit get in transit movement is in transit public boolean is in transit object oo get value is in transit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isintransit get_value isintransit booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 1 throw new illegal argument exception m inout id is mandatory set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id illegalargumentexception m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 0 set value m shipper id null else set value m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id set_value m_shipper_id set_value m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate public static final string movementtype workorder w set movement type method of moving the inventory public void set movement type string movement type if movement type null throw new illegal argument exception movement type is mandatory if movement type equals c movement type equals c movement type equals i movement type equals i movement type equals m movement type equals m movement type equals p movement type equals p movement type equals v movement type equals v movement type equals w movement type equals w else throw new illegal argument exception movement type invalid value movement type reference id 189 c c i i m m p p v v w w if movement type length 2 log warning length 2 truncated movement type movement type substring 0 1 set valuenocheck movement type movement type movementtype_workorder_ setmovementtype movementtype movementtype illegalargumentexception movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype illegalargumentexception movementtype movementtype reference_id movementtype movementtype movementtype set_valuenocheck movementtype movementtype get movement type method of moving the inventory public string get movement type return string get value movement type getmovementtype get_value movementtype set no packages number of packages shipped public void set no packages int no packages set value no packages new integer no packages setnopackages nopackages set_value nopackages nopackages get no packages number of packages shipped public int get no packages integer ii integer get value no packages if ii null return 0 return ii int value getnopackages get_value nopackages intvalue set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set value po reference po reference setporeference poreference poreference poreference poreference poreference set_value poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference set pick date date time when picked for shipment public void set pick date timestamp pick date set value pick date pick date setpickdate pickdate set_value pickdate pickdate get pick date date time when picked for shipment public timestamp get pick date return timestamp get value pick date getpickdate get_value pickdate set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue public static final string priorityrule minor 9 set priority priority of a document public void set priority rule string priority rule if priority rule null throw new illegal argument exception priority rule is mandatory if priority rule equals 1 priority rule equals 3 priority rule equals 5 priority rule equals 7 priority rule equals 9 else throw new illegal argument exception priority rule invalid value priority rule reference id 154 1 3 5 7 9 if priority rule length 1 log warning length 1 truncated priority rule priority rule substring 0 0 set value priority rule priority rule priorityrule_minor setpriorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule priorityrule priorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule reference_id priorityrule priorityrule priorityrule set_value priorityrule priorityrule get priority priority of a document public string get priority rule return string get value priority rule getpriorityrule get_value priorityrule set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set referenced shipment public void setref inout id int ref inout id if ref inout id 0 set value ref inout id null else set value ref inout id new integer ref inout id setref_inout_id ref_inout_id ref_inout_id set_value ref_inout_id set_value ref_inout_id ref_inout_id get referenced shipment public int getref inout id integer ii integer get value ref inout id if ii null return 0 return ii int value getref_inout_id get_value ref_inout_id intvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set send e mail enable sending document e mail public void set sende mail boolean sende mail set value sende mail new boolean sende mail email email setsendemail sendemail set_value sendemail sendemail get send e mail enable sending document e mail public boolean is sende mail object oo get value sende mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email issendemail get_value sendemail booleanvalue set ship date shipment date time public void set ship date timestamp ship date set value ship date ship date setshipdate shipdate set_value shipdate shipdate get ship date shipment date time public timestamp get ship date return timestamp get value ship date getshipdate get_value shipdate set tracking no number to track the shipment public void set tracking no string tracking no if tracking no null tracking no length 60 log warning length 60 truncated tracking no tracking no substring 0 59 set value tracking no tracking no settrackingno trackingno trackingno trackingno trackingno trackingno set_value trackingno trackingno get tracking no number to track the shipment public string get tracking no return string get value tracking no gettrackingno get_value trackingno public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue constructor param ad client id client param trx name transaction public matcher int ad client id string trx name m ad client id ad client id m trxname trx name ad_client_id trxname ad_client_id trxname m_ad_client_id ad_client_id m_trxname trxname matching pre derive invoice receipt match from po invoice and po receipt purchase order 20 invoice1 10 invoice2 10 receipt1 5 receipt2 15 a creates directs invoice1 receipt1 5 invoice2 receipt2 10 b creates indirects invoice1 receipt2 5 not imlemented pre return number of records created public int match int counter 0 a direct matches string sql select m1 ad client id m2 ad org id 1 2 m1 c invoiceline id m2 m inoutline id m1 m product id 3 5 m1 date trx m2 date trx m1 qty m2 qty 6 9 from m matchpo m1 m matchpo m2 where m1 c orderline id m2 c orderline id and m1 m inoutline id is null and m2 c invoiceline id is null and m1 m product id m2 m product id and m1 ad client id 1 not existing inv matches and not exists select from m matchinv mi where mi c invoiceline id m1 c invoiceline id and mi m inoutline id m2 m inoutline id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m ad client id result set rs pstmt execute query while rs next big decimal qty1 rs get big decimal 8 big decimal qty2 rs get big decimal 9 big decimal qty qty1 min qty2 if qty equals env zero continue timestamp date trx1 rs get timestamp 6 timestamp date trx2 rs get timestamp 7 timestamp date trx date trx1 if date trx1 before date trx2 date trx date trx2 int ad client id rs get int 1 int ad org id rs get int 2 int c invoiceline id rs get int 3 int m inoutline id rs get int 4 int m product id rs get int 5 if create match inv ad client id ad org id m inoutline id c invoiceline id m product id date trx qty counter rs close pstmt close catch sql exception e log log level severe match e log fine matcher match client id m ad client id records created counter return counter ad_client_id ad_org_id c_invoiceline_id m_inoutline_id m_product_id datetrx datetrx m_matchpo m_matchpo c_orderline_id c_orderline_id m_inoutline_id c_invoiceline_id m_product_id m_product_id ad_client_id m_matchinv c_invoiceline_id c_invoiceline_id m_inoutline_id m_inoutline_id preparedstatement preparestatement setint m_ad_client_id resultset executequery bigdecimal getbigdecimal bigdecimal getbigdecimal bigdecimal datetrx1 gettimestamp datetrx2 gettimestamp datetrx datetrx1 datetrx1 datetrx2 datetrx datetrx2 ad_client_id getint ad_org_id getint c_invoiceline_id getint m_inoutline_id getint m_product_id getint creatematchinv ad_client_id ad_org_id m_inoutline_id c_invoiceline_id m_product_id datetrx sqlexception client_id m_ad_client_id create match inv record param ad client id client param ad org id org param m inoutline id receipt param c invoiceline id invoice param m product id product param date trx date param qty qty return true if record created private boolean create match inv int ad client id int ad org id int m inoutline id int c invoiceline id int m product id timestamp date trx big decimal qty log fine inv line c invoiceline id rec m inoutline id qty qty date trx m match inv inv new m match inv int m matchinv id db get nextid ad client id m matchinv m trxname string buffer sql new string buffer insert into m matchinv m matchinv id ad client id ad org id is active created created by updated updated by m inoutline id c invoiceline id m product id date trx qty processing processed posted values append m matchinv id append append ad client id append append ad org id append y sys date 0 sys date 0 append m inoutline id append append c invoiceline id append append m product id append append db to date date trx true append append qty append n y n int no db execute update sql to string m trxname return no 1 matchinv ad_client_id ad_org_id m_inoutline_id c_invoiceline_id m_product_id datetrx creatematchinv ad_client_id ad_org_id m_inoutline_id c_invoiceline_id m_product_id datetrx bigdecimal invline c_invoiceline_id m_inoutline_id datetrx mmatchinv mmatchinv m_matchinv_id getnextid ad_client_id m_matchinv m_trxname stringbuffer stringbuffer m_matchinv m_matchinv_id ad_client_id ad_org_id isactive createdby updatedby m_inoutline_id c_invoiceline_id m_product_id datetrx m_matchinv_id ad_client_id ad_org_id sysdate sysdate m_inoutline_id c_invoiceline_id m_product_id to_date datetrx executeupdate tostring m_trxname get paper param ad printpaper id id return paper static public m print paper get int ad printpaper id integer key new integer ad printpaper id m print paper pp m print paper s papers get key if pp null pp new m print paper env get ctx ad printpaper id null s papers put key pp else s log config ad printpaper id ad printpaper id return pp ad_printpaper_id mprintpaper ad_printpaper_id ad_printpaper_id mprintpaper mprintpaper s_papers mprintpaper getctx ad_printpaper_id s_papers s_log ad_printpaper_id ad_printpaper_id create paper and save param name name param landscape landscape return paper static m print paper create string name boolean landscape m print paper pp new m print paper env get ctx 0 null pp set name name pp set is landscape landscape pp save return pp mprintpaper mprintpaper mprintpaper getctx setname setislandscape constructor param ctx context param ad printpaper id id if 0 a4 public m print paper properties ctx int ad printpaper id string trx name super ctx ad printpaper id trx name if ad printpaper id 0 set is default false set is landscape true set code iso a4 set margin top 36 set margin bottom 36 set margin left 36 set margin right 36 ad_printpaper_id mprintpaper ad_printpaper_id trxname ad_printpaper_id trxname ad_printpaper_id setisdefault setislandscape setcode setmargintop setmarginbottom setmarginleft setmarginright load constructor param ctx context param rs result set param trx name trx public m print paper properties ctx result set rs string trx name super ctx rs trx name trxname mprintpaper resultset trxname trxname get media size the search is hard coded as the javax print media size info is private return media size from code public media size get media size if m mediasize null return m mediasize string name code get code if name code null get name media size name name media null c media size name msn new c media size name 4 string names msn get string table for int i 0 i names length i string name names i if name equals ignore case name code name media media size name msn get enum value table i log finer name name media break if name media null m mediasize media size get media size for name name media log fine name size m mediasize create new media size if m mediasize null float x get sizex float value float y get sizey float value if x 0 y 0 m mediasize new media size x y get units int media size name a log fine size m mediasize fallback if m mediasize null m mediasize get media size default return m mediasize mediasize mediasize mediasize getmediasize m_mediasize m_mediasize namecode getcode namecode mediasizename namemedia cmediasizename cmediasizename getstringtable equalsignorecase namecode namemedia mediasizename getenumvaluetable namemedia namemedia m_mediasize mediasize getmediasizeforname namemedia m_mediasize m_mediasize getsizex floatvalue getsizey floatvalue m_mediasize mediasize getunitsint mediasizename m_mediasize m_mediasize m_mediasize getmediasizedefault m_mediasize get media size return default media size based on language public media size get media size default m mediasize language get login language get media size if m mediasize null m mediasize media size iso a4 log fine size m mediasize return m mediasize mediasize getmediasizedefault m_mediasize getloginlanguage getmediasize m_mediasize m_mediasize mediasize m_mediasize m_mediasize get units int return units public int get units int string du get dimension units if du null dimensionunits mm equals du return size2d syntax mm else return size2d syntax inch getunitsint getdimensionunits dimensionunits_mm size2dsyntax size2dsyntax get c paper return c paper public c paper getc paper c paper ret value new c paper get media size is landscape get margin left get margin top get margin right get margin bottom return ret value cpaper cpaper cpaper getcpaper cpaper retvalue cpaper getmediasize islandscape getmarginleft getmargintop getmarginright getmarginbottom retvalue class c media size name extends media size name public c media size name int code super code c media size name cmediasizename mediasizename cmediasizename cmediasizename get string table return string public string get string table return super get string table getstringtable getstringtable get enum value table return media sizes public enum syntax get enum value table return super get enum value table enumsyntax getenumvaluetable getenumvaluetable test param args args public static void main string args org compiere compiere startup environment true create standard landscape true create standard portrait false read all papers int i ds po get alli ds ad printpaper null null for int i 0 i i ds length i system out println m print paper pp new m print paper env get ctx i ds i null pp dump startupenvironment ids getallids ad_printpaper ids mprintpaper mprintpaper getctx ids get existing account or create it return account or null public static m account get properties ctx int ad client id int ad org id int c acctschema id int account id int c subacct id int m product id int c bpartner id int ad orgtrx id int c locfrom id int c locto id int c salesregion id int c project id int c campaign id int c activity id int user1 id int user2 id int userelement1 id int userelement2 id m account existing account null string buffer info new string buffer string buffer sql new string buffer select from c validcombination mandatory fields where ad client id 1 and ad org id and c acctschema id and account id 4 optional fields if c subacct id 0 sql append and c subacct id is null else sql append and c subacct id if m product id 0 sql append and m product id is null else sql append and m product id if c bpartner id 0 sql append and c bpartner id is null else sql append and c bpartner id if ad orgtrx id 0 sql append and ad orgtrx id is null else sql append and ad orgtrx id if c locfrom id 0 sql append and c locfrom id is null else sql append and c locfrom id if c locto id 0 sql append and c locto id is null else sql append and c locto id if c salesregion id 0 sql append and c salesregion id is null else sql append and c salesregion id if c project id 0 sql append and c project id is null else sql append and c project id if c campaign id 0 sql append and c campaign id is null else sql append and c campaign id if c activity id 0 sql append and c activity id is null else sql append and c activity id if user1 id 0 sql append and user1 id is null else sql append and user1 id if user2 id 0 sql append and user2 id is null else sql append and user2 id if userelement1 id 0 sql append and userelement1 id is null else sql append and userelement1 id if userelement2 id 0 sql append and userelement2 id is null else sql append and userelement2 id sql append and is active y sql append order by is fully qualified desc try prepared statement pstmt db prepare statement sql to string null mandatory accounting fields int index 1 pstmt set int index ad client id pstmt set int index ad org id info append ad client id append ad client id append ad org id append ad org id schema pstmt set int index c acctschema id info append c acctschema id append c acctschema id account pstmt set int index account id info append account id append account id append optional accounting fields if c subacct id 0 pstmt set int index c subacct id if m product id 0 pstmt set int index m product id if c bpartner id 0 pstmt set int index c bpartner id if ad orgtrx id 0 pstmt set int index ad orgtrx id if c locfrom id 0 pstmt set int index c locfrom id if c locto id 0 pstmt set int index c locto id if c salesregion id 0 pstmt set int index c salesregion id if c project id 0 pstmt set int index c project id if c campaign id 0 pstmt set int index c campaign id if c activity id 0 pstmt set int index c activity id if user1 id 0 pstmt set int index user1 id if user2 id 0 pstmt set int index user2 id if userelement1 id 0 pstmt set int index userelement1 id if userelement2 id 0 pstmt set int index userelement2 id result set rs pstmt execute query if rs next existing account new m account ctx rs null rs close pstmt close catch sql exception e s log log level severe info n sql e existing if existing account null return existing account new m account new account new m account ctx 0 null new account set client org ad client id ad org id new account setc acctschema id c acctschema id new account setaccount id account id optional accounting fields new account setc subacct id c subacct id new account setm product id m product id new account setc bpartner id c bpartner id new account setad orgtrx id ad orgtrx id new account setc locfrom id c locfrom id new account setc locto id c locto id new account setc salesregion id c salesregion id new account setc project id c project id new account setc campaign id c campaign id new account setc activity id c activity id new account setuser1 id user1 id new account setuser2 id user2 id new account setuserelement1 id userelement1 id new account setuserelement2 id userelement2 id if new account save s log log level severe could not create new account info return null s log fine new new account return new account maccount ad_client_id ad_org_id c_acctschema_id account_id c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_salesregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id userelement1_id userelement2_id maccount existingaccount stringbuffer stringbuffer stringbuffer stringbuffer c_validcombination ad_client_id ad_org_id c_acctschema_id account_id c_subacct_id c_subacct_id c_subacct_id m_product_id m_product_id m_product_id c_bpartner_id c_bpartner_id c_bpartner_id ad_orgtrx_id ad_orgtrx_id ad_orgtrx_id c_locfrom_id c_locfrom_id c_locfrom_id c_locto_id c_locto_id c_locto_id c_salesregion_id c_salesregion_id c_salesregion_id c_project_id c_project_id c_project_id c_campaign_id c_campaign_id c_campaign_id c_activity_id c_activity_id c_activity_id user1_id user1_id user1_id user2_id user2_id user2_id userelement1_id userelement1_id userelement1_id userelement2_id userelement2_id userelement2_id isactive isfullyqualified preparedstatement preparestatement tostring setint ad_client_id setint ad_org_id ad_client_id ad_client_id ad_org_id ad_org_id setint c_acctschema_id c_acctschema_id c_acctschema_id setint account_id account_id account_id c_subacct_id setint c_subacct_id m_product_id setint m_product_id c_bpartner_id setint c_bpartner_id ad_orgtrx_id setint ad_orgtrx_id c_locfrom_id setint c_locfrom_id c_locto_id setint c_locto_id c_salesregion_id setint c_salesregion_id c_project_id setint c_project_id c_campaign_id setint c_campaign_id c_activity_id setint c_activity_id user1_id setint user1_id user2_id setint user2_id userelement1_id setint userelement1_id userelement2_id setint userelement2_id resultset executequery existingaccount maccount sqlexception s_log existingaccount existingaccount maccount newaccount maccount newaccount setclientorg ad_client_id ad_org_id newaccount setc_acctschema_id c_acctschema_id newaccount setaccount_id account_id newaccount setc_subacct_id c_subacct_id newaccount setm_product_id m_product_id newaccount setc_bpartner_id c_bpartner_id newaccount setad_orgtrx_id ad_orgtrx_id newaccount setc_locfrom_id c_locfrom_id newaccount setc_locto_id c_locto_id newaccount setc_salesregion_id c_salesregion_id newaccount setc_project_id c_project_id newaccount setc_campaign_id c_campaign_id newaccount setc_activity_id c_activity_id newaccount setuser1_id user1_id newaccount setuser2_id user2_id newaccount setuserelement1_id userelement1_id newaccount setuserelement2_id userelement2_id newaccount s_log s_log newaccount newaccount get first with alias param ctx context param c acctschema id as param alias alias return account public static m account get properties ctx int c acctschema id string alias m account ret value null string sql select from c validcombination where c acctschema id and alias prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c acctschema id pstmt set string 2 alias result set rs pstmt execute query if rs next ret value new m account ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value c_acctschema_id maccount c_acctschema_id maccount retvalue c_validcombination c_acctschema_id preparedstatement preparestatement setint c_acctschema_id setstring resultset executequery retvalue maccount s_log retvalue get from existing accounting fact param fa accounting fact return account public static m account get x fact acct fa m account acct get fa get ctx fa getad client id fa getad org id fa getc acctschema id fa getaccount id fa getc subacct id fa getm product id fa getc bpartner id fa getad orgtrx id fa getc locfrom id fa getc locto id fa getc salesregion id fa getc project id fa getc campaign id fa getc activity id fa getuser1 id fa getuser2 id fa getuserelement1 id fa getuserelement2 id return acct maccount x_fact_acct maccount getctx getad_client_id getad_org_id getc_acctschema_id getaccount_id getc_subacct_id getm_product_id getc_bpartner_id getad_orgtrx_id getc_locfrom_id getc_locto_id getc_salesregion_id getc_project_id getc_campaign_id getc_activity_id getuser1_id getuser2_id getuserelement1_id getuserelement2_id factory default combination param c acctschema id accounting schema param optional null if true the optional values are null return account public static m account get default properties ctx int c acctschema id boolean optional null string trx name m acct schema acct schema new m acct schema ctx c acctschema id trx name return get default acct schema optional null c_acctschema_id optionalnull maccount getdefault c_acctschema_id optionalnull trxname macctschema acctschema macctschema c_acctschema_id trxname getdefault acctschema optionalnull factory default combination param acct schema accounting schema param optional null if true the optional values are null return account public static m account get default m acct schema acct schema boolean optional null m account vc new m account acct schema active elements m acct schema element elements acct schema get acct schema elements for int i 0 i elements length i m acct schema element ase elements i string element type ase get element type int default value ase get default value boolean set value ase is mandatory ase is mandatory optional null if element type equals m acct schema element elementtype organization vc setad org id default value else if element type equals m acct schema element elementtype account vc setaccount id default value else if element type equals m acct schema element elementtype subaccount set value vc setc subacct id default value else if element type equals m acct schema element elementtype bpartner set value vc setc bpartner id default value else if element type equals m acct schema element elementtype product set value vc setm product id default value else if element type equals m acct schema element elementtype activity set value vc setc activity id default value else if element type equals m acct schema element elementtype locationfrom set value vc setc locfrom id default value else if element type equals m acct schema element elementtype locationto set value vc setc locto id default value else if element type equals m acct schema element elementtype campaign set value vc setc campaign id default value else if element type equals m acct schema element elementtype orgtrx set value vc setad orgtrx id default value else if element type equals m acct schema element elementtype project set value vc setc project id default value else if element type equals m acct schema element elementtype salesregion set value vc setc salesregion id default value else if element type equals m acct schema element elementtype userlist1 set value vc setuser1 id default value else if element type equals m acct schema element elementtype userlist2 set value vc setuser2 id default value else if element type equals m acct schema element elementtype userelement1 set value vc setuserelement1 id default value else if element type equals m acct schema element elementtype userelement2 set value vc setuserelement2 id default value s log fine client id vc getad client id org id vc getad org id acctschema id vc getc acctschema id account id vc getaccount id return vc acctschema optionalnull maccount getdefault macctschema acctschema optionalnull maccount maccount acctschema macctschemaelement acctschema getacctschemaelements macctschemaelement elementtype getelementtype defaultvalue getdefaultvalue setvalue ismandatory ismandatory optionalnull elementtype macctschemaelement elementtype_organization setad_org_id defaultvalue elementtype macctschemaelement elementtype_account setaccount_id defaultvalue elementtype macctschemaelement elementtype_subaccount setvalue setc_subacct_id defaultvalue elementtype macctschemaelement elementtype_bpartner setvalue setc_bpartner_id defaultvalue elementtype macctschemaelement elementtype_product setvalue setm_product_id defaultvalue elementtype macctschemaelement elementtype_activity setvalue setc_activity_id defaultvalue elementtype macctschemaelement elementtype_locationfrom setvalue setc_locfrom_id defaultvalue elementtype macctschemaelement elementtype_locationto setvalue setc_locto_id defaultvalue elementtype macctschemaelement elementtype_campaign setvalue setc_campaign_id defaultvalue elementtype macctschemaelement elementtype_orgtrx setvalue setad_orgtrx_id defaultvalue elementtype macctschemaelement elementtype_project setvalue setc_project_id defaultvalue elementtype macctschemaelement elementtype_salesregion setvalue setc_salesregion_id defaultvalue elementtype macctschemaelement elementtype_userlist1 setvalue setuser1_id defaultvalue elementtype macctschemaelement elementtype_userlist2 setvalue setuser2_id defaultvalue elementtype macctschemaelement elementtype_userelement1 setvalue setuserelement1_id defaultvalue elementtype macctschemaelement elementtype_userelement2 setvalue setuserelement2_id defaultvalue s_log client_id getad_client_id org_id getad_org_id acctschema_id getc_acctschema_id account_id getaccount_id get account param c validcombination id combination return account public static m account get properties ctx int c validcombination id maybe later cache return new m account ctx c validcombination id null c_validcombination_id maccount c_validcombination_id maccount c_validcombination_id update value description after change of account element value description param ctx context param where where clause public static void update value description properties ctx string where string trx name string sql select from c validcombination if where null where length 0 sql where where sql order by c validcombination id int count 0 int errors 0 prepared statement pstmt null try pstmt db prepare statement sql trx name result set rs pstmt execute query while rs next m account account new m account ctx rs trx name account set value description if account save count else errors rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log info where count errors errors updatevaluedescription trxname c_validcombination c_validcombination_id preparedstatement preparestatement trxname resultset executequery maccount maccount trxname setvaluedescription s_log s_log default constructor param ctx context param c validcombination id combination public m account properties ctx int c validcombination id string trx name super ctx c validcombination id trx name if c validcombination id 0 setaccount id 0 setc acctschema id 0 set is fully qualified false c_validcombination_id maccount c_validcombination_id trxname c_validcombination_id trxname c_validcombination_id setaccount_id setc_acctschema_id setisfullyqualified load constructor param ctx context param rs result set public m account properties ctx result set rs string trx name super ctx rs trx name maccount resultset trxname trxname parent constructor param as account schema public m account m acct schema as this as get ctx 0 as get trxname set client org as setc acctschema id as getc acctschema id maccount macctschema getctx get_trxname setclientorg setc_acctschema_id getc_acctschema_id return string representation return string public string to string string buffer sb new string buffer m account sb append getc validcombination id if get combination null sb append append get combination else append client append getad client id sb append schema append getc acctschema id append org append getad org id append acct append getaccount id append if getc subacct id 0 sb append c subacct id append getc subacct id if getm product id 0 sb append m product id append getm product id if getc bpartner id 0 sb append c bpartner id append getc bpartner id if getad orgtrx id 0 sb append ad orgtrx id append getad orgtrx id if getc locfrom id 0 sb append c locfrom id append getc locfrom id if getc locto id 0 sb append c locto id append getc locto id if getc salesregion id 0 sb append c salesregion id append getc salesregion id if getc project id 0 sb append c project id append getc project id if getc campaign id 0 sb append c campaign id append getc campaign id if getc activity id 0 sb append c activity id append getc activity id if getuser1 id 0 sb append user1 id append getuser1 id if getuser2 id 0 sb append user2 id append getuser2 id if getuserelement1 id 0 sb append userelement1 id append getuserelement1 id if getuserelement2 id 0 sb append userelement2 id append getuserelement2 id sb append return sb to string tostring stringbuffer stringbuffer maccount getc_validcombination_id getcombination getcombination getad_client_id getc_acctschema_id getad_org_id getaccount_id getc_subacct_id c_subacct_id getc_subacct_id getm_product_id m_product_id getm_product_id getc_bpartner_id c_bpartner_id getc_bpartner_id getad_orgtrx_id ad_orgtrx_id getad_orgtrx_id getc_locfrom_id c_locfrom_id getc_locfrom_id getc_locto_id c_locto_id getc_locto_id getc_salesregion_id c_salesregion_id getc_salesregion_id getc_project_id c_project_id getc_project_id getc_campaign_id c_campaign_id getc_campaign_id getc_activity_id c_activity_id getc_activity_id getuser1_id user1_id getuser1_id getuser2_id user2_id getuser2_id getuserelement1_id userelement1_id getuserelement1_id getuserelement2_id userelement2_id getuserelement2_id tostring set account id public void setaccount id int account id m accountev null reset super setaccount id account id account_id setaccount_id account_id m_accountev setaccount_id account_id set account id public m element value get account if m accountev null if getaccount id 0 m accountev new m element value get ctx getaccount id get trxname return m accountev account_id melementvalue getaccount m_accountev getaccount_id m_accountev melementvalue getctx getaccount_id get_trxname m_accountev get account type return account type of account element public string get account type if m accountev null get account if m accountev null log log level severe no element value for account id getaccount id return return m accountev get account type getaccounttype m_accountev getaccount m_accountev elementvalue account_id getaccount_id m_accountev getaccounttype is this a balance sheet account return boolean public boolean is balance sheet string account type get account type return m element value accounttype asset equals account type m element value accounttype liability equals account type m element value accounttype ownersequity equals account type isbalancesheet accounttype getaccounttype melementvalue accounttype_asset accounttype melementvalue accounttype_liability accounttype melementvalue accounttype_ownersequity accounttype is this an activa account return boolean public boolean is activa return m element value accounttype asset equals get account type isactiva melementvalue accounttype_asset getaccounttype is this a passiva account return boolean public boolean is passiva string account type get account type return m element value accounttype liability equals account type m element value accounttype ownersequity equals account type ispassiva accounttype getaccounttype melementvalue accounttype_liability accounttype melementvalue accounttype_ownersequity accounttype set value and description and fully qualified flag for combination public void set value description string buffer combi new string buffer string buffer descr new string buffer boolean fully qualified true m acct schema as new m acct schema get ctx getc acctschema id get trxname in trx m acct schema element elements m acct schema element get acct schema elements as for int i 0 i elements length i if i 0 combi append as get separator descr append as get separator m acct schema element element elements i string combi str not defined string descr str if m acct schema element elementtype organization equals element get element type if getad org id 0 m org org new m org get ctx getad org id get trxname in trx combi str org get value descr str org get name else combi str descr str fully qualified false else if m acct schema element elementtype account equals element get element type if getaccount id 0 if m accountev null m accountev new m element value get ctx getaccount id get trxname combi str m accountev get value descr str m accountev get name else if element is mandatory log warning mandatory element missing account fully qualified false else if m acct schema element elementtype subaccount equals element get element type if getc subacct id 0 x c subacct sa new x c subacct get ctx getc subacct id get trxname combi str sa get value descr str sa get name else if m acct schema element elementtype product equals element get element type if getm product id 0 x m product product new x m product get ctx getm product id get trxname combi str product get value descr str product get name else if element is mandatory log warning mandatory element missing product fully qualified false else if m acct schema element elementtype bpartner equals element get element type if getc bpartner id 0 x c bpartner partner new x c bpartner get ctx getc bpartner id get trxname combi str partner get value descr str partner get name else if element is mandatory log warning mandatory element missing business partner fully qualified false else if m acct schema element elementtype orgtrx equals element get element type if getad orgtrx id 0 m org org new m org get ctx getad orgtrx id get trxname in trx combi str org get value descr str org get name else if element is mandatory log warning mandatory element missing trx org fully qualified false else if m acct schema element elementtype locationfrom equals element get element type if getc locfrom id 0 m location loc new m location get ctx getc locfrom id get trxname in trx combi str loc get postal descr str loc get city else if element is mandatory log warning mandatory element missing location from fully qualified false else if m acct schema element elementtype locationto equals element get element type if getc locto id 0 m location loc new m location get ctx getc locfrom id get trxname in trx combi str loc get postal descr str loc get city else if element is mandatory log warning mandatory element missing location to fully qualified false else if m acct schema element elementtype salesregion equals element get element type if getc salesregion id 0 m sales region loc new m sales region get ctx getc salesregion id get trxname combi str loc get value descr str loc get name else if element is mandatory log warning mandatory element missing sales region fully qualified false else if m acct schema element elementtype project equals element get element type if getc project id 0 x c project project new x c project get ctx getc project id get trxname combi str project get value descr str project get name else if element is mandatory log warning mandatory element missing project fully qualified false else if m acct schema element elementtype campaign equals element get element type if getc campaign id 0 x c campaign campaign new x c campaign get ctx getc campaign id get trxname combi str campaign get value descr str campaign get name else if element is mandatory log warning mandatory element missing campaign fully qualified false else if m acct schema element elementtype activity equals element get element type if getc activity id 0 x c activity act new x c activity get ctx getc activity id get trxname combi str act get value descr str act get name else if element is mandatory log warning mandatory element missing campaign fully qualified false else if m acct schema element elementtype userlist1 equals element get element type if getuser1 id 0 m element value ev new m element value get ctx getuser1 id get trxname combi str ev get value descr str ev get name else if m acct schema element elementtype userlist2 equals element get element type if getuser2 id 0 m element value ev new m element value get ctx getuser2 id get trxname combi str ev get value descr str ev get name else if m acct schema element elementtype userelement1 equals element get element type if getuserelement1 id 0 else if m acct schema element elementtype userelement2 equals element get element type if getuserelement2 id 0 combi append combi str descr append descr str set values super set combination combi to string super set description descr to string if fully qualified is fully qualified set is fully qualified fully qualified log fine combination get combination get description fully qualified fully qualified setvaluedescription stringbuffer stringbuffer stringbuffer stringbuffer fullyqualified macctschema macctschema getctx getc_acctschema_id get_trxname macctschemaelement macctschemaelement getacctschemaelements getseparator getseparator macctschemaelement combistr _ descrstr _ macctschemaelement elementtype_organization getelementtype getad_org_id morg morg getctx getad_org_id get_trxname combistr getvalue descrstr getname combistr descrstr fullyqualified macctschemaelement elementtype_account getelementtype getaccount_id m_accountev m_accountev melementvalue getctx getaccount_id get_trxname combistr m_accountev getvalue descrstr m_accountev getname ismandatory fullyqualified macctschemaelement elementtype_subaccount getelementtype getc_subacct_id x_c_subacct x_c_subacct getctx getc_subacct_id get_trxname combistr getvalue descrstr getname macctschemaelement elementtype_product getelementtype getm_product_id x_m_product x_m_product getctx getm_product_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_bpartner getelementtype getc_bpartner_id x_c_bpartner x_c_bpartner getctx getc_bpartner_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_orgtrx getelementtype getad_orgtrx_id morg morg getctx getad_orgtrx_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_locationfrom getelementtype getc_locfrom_id mlocation mlocation getctx getc_locfrom_id get_trxname combistr getpostal descrstr getcity ismandatory fullyqualified macctschemaelement elementtype_locationto getelementtype getc_locto_id mlocation mlocation getctx getc_locfrom_id get_trxname combistr getpostal descrstr getcity ismandatory fullyqualified macctschemaelement elementtype_salesregion getelementtype getc_salesregion_id msalesregion msalesregion getctx getc_salesregion_id get_trxname combistr getvalue descrstr getname ismandatory salesregion fullyqualified macctschemaelement elementtype_project getelementtype getc_project_id x_c_project x_c_project getctx getc_project_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_campaign getelementtype getc_campaign_id x_c_campaign x_c_campaign getctx getc_campaign_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_activity getelementtype getc_activity_id x_c_activity x_c_activity getctx getc_activity_id get_trxname combistr getvalue descrstr getname ismandatory fullyqualified macctschemaelement elementtype_userlist1 getelementtype getuser1_id melementvalue melementvalue getctx getuser1_id get_trxname combistr getvalue descrstr getname macctschemaelement elementtype_userlist2 getelementtype getuser2_id melementvalue melementvalue getctx getuser2_id get_trxname combistr getvalue descrstr getname macctschemaelement elementtype_userelement1 getelementtype getuserelement1_id macctschemaelement elementtype_userelement2 getelementtype getuserelement2_id combistr descrstr setcombination tostring setdescription tostring fullyqualified isfullyqualified setisfullyqualified fullyqualified getcombination getdescription fullyqualified fullyqualified validate combination return true if valid public boolean validate boolean ok true validate sub account if getc subacct id 0 x c subacct sa new x c subacct get ctx getc subacct id get trxname if sa getc elementvalue id getaccount id log save error error c subacct c elementvalue id sa getc elementvalue id account id getaccount id ok false return ok getc_subacct_id x_c_subacct x_c_subacct getctx getc_subacct_id get_trxname getc_elementvalue_id getaccount_id saveerror c_subacct c_elementvalue_id getc_elementvalue_id account_id getaccount_id before save param new record new return true protected boolean before save boolean new record set value description return validate newrecord beforesave newrecord setvaluedescription test param args public static void main string args org compiere compiere startup true m account acct get env get ctx 11 11 101 600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 system out println acct m account acct2 get env get ctx 11 12 101 600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 system out println acct2 maccount getctx maccount getctx constructor called from pa panel viewpi performance indicator param goal goal public performance detail m goal goal super goal get name set icon image compiere get image16 bar panel new bar graph goal init a env show center screen this papanel performancedetail mgoal getname seticonimage getimage16 barpanel bargraph aenv showcenterscreen static init private void init get content pane add bar panel border layout north get content pane add confirm panel border layout south confirm panel add action listener this getcontentpane barpanel borderlayout getcontentpane confirmpanel borderlayout confirmpanel addactionlistener action listener param e event public void action performed action event e if e get action command equals confirm panel a ok dispose actionperformed actionevent getactioncommand confirmpanel a_ok standard constructor public x test properties ctx int test id string trx name super ctx test id trx name if test id 0 set name null settest id 0 x_test test_id trxname test_id trxname test_id setname settest_id load constructor public x test properties ctx result set rs string trx name super ctx rs trx name x_test resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x test append get id append return sb to string tostring stringbuffer stringbuffer x_test get_id tostring set account acct public void setaccount acct int account acct set value account acct new integer account acct account_acct setaccount_acct account_acct set_value account_acct account_acct get account acct public int getaccount acct integer ii integer get value account acct if ii null return 0 return ii int value account_acct getaccount_acct get_value account_acct intvalue set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set character data long character field public void set character data string character data if character data null character data length 4000 log warning length 4000 truncated character data character data substring 0 3999 set value character data character data setcharacterdata characterdata characterdata characterdata characterdata characterdata set_value characterdata characterdata get character data long character field public string get character data return string get value character data getcharacterdata get_value characterdata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set value m locator id null else set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_value m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set amount public void sett amount big decimal t amount set value t amount t amount sett_amount bigdecimal t_amount set_value t_amount t_amount get amount public big decimal gett amount big decimal bd big decimal get value t amount if bd null return env zero return bd bigdecimal gett_amount bigdecimal bigdecimal get_value t_amount set date public void sett date timestamp t date set value t date t date sett_date t_date set_value t_date t_date get date public timestamp gett date return timestamp get value t date gett_date get_value t_date set date time public void sett datetime timestamp t datetime set value t datetime t datetime datetime sett_datetime t_datetime set_value t_datetime t_datetime get date time public timestamp gett datetime return timestamp get value t datetime datetime gett_datetime get_value t_datetime set integer public void sett integer int t integer set value t integer new integer t integer sett_integer t_integer set_value t_integer t_integer get integer public int gett integer integer ii integer get value t integer if ii null return 0 return ii int value gett_integer get_value t_integer intvalue set number public void sett number big decimal t number set value t number t number sett_number bigdecimal t_number set_value t_number t_number get number public big decimal gett number big decimal bd big decimal get value t number if bd null return env zero return bd bigdecimal gett_number bigdecimal bigdecimal get_value t_number set qty public void sett qty big decimal t qty set value t qty t qty sett_qty bigdecimal t_qty set_value t_qty t_qty get qty public big decimal gett qty big decimal bd big decimal get value t qty if bd null return env zero return bd bigdecimal gett_qty bigdecimal bigdecimal get_value t_qty set test id public void settest id int test id if test id 1 throw new illegal argument exception test id is mandatory set valuenocheck test id new integer test id settest_id test_id test_id illegalargumentexception test_id set_valuenocheck test_id test_id get test id public int gettest id integer ii integer get value test id if ii null return 0 return ii int value gettest_id get_value test_id intvalue tab order constructor param window no window no param ad table id table no param ad columnsortorder id sort column param ad columnsortyesno id yes no column public v sort tab int window no int ad table id int ad columnsortorder id int ad columnsortyesno id log config sort order ad columnsortorder id sort yes no ad columnsortyesno id m windowno window no try jb init dyn init ad table id ad columnsortorder id ad columnsortyesno id catch exception e log log level severe e windowno ad_table_id ad_columnsortorder_id ad_columnsortyesno_id yesno vsorttab windowno ad_table_id ad_columnsortorder_id ad_columnsortyesno_id sortorder ad_columnsortorder_id sortyesno ad_columnsortyesno_id m_windowno windowno jbinit dyninit ad_table_id ad_columnsortorder_id ad_columnsortyesno_id static layout throws exception private void jb init throws exception this set layout main layout no label set text no yes label set text yes b add set icon env get image icon detail24 gif b add set margin new insets 2 2 2 2 b add add action listener this b remove set icon env get image icon parent24 gif b remove set margin new insets 2 2 2 2 b remove add action listener this b up set icon env get image icon previous24 gif b up set margin new insets 2 2 2 2 b up add action listener this b down set icon env get image icon next24 gif b down set margin new insets 2 2 2 2 b down add action listener this yes list set border border factory create lowered bevel border yes pane set preferred size new dimension 200 300 yes list set selection mode list selection model multiple interval selection no list set border border factory create lowered bevel border no pane set preferred size new dimension 200 300 no list set selection mode list selection model multiple interval selection this add no label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 this add yes label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 this add b down new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 this add no pane new grid bag constraints 0 1 1 3 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 this add yes pane new grid bag constraints 2 1 1 3 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 this add b up new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 this add b remove new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 this add b add new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 4 4 4 4 0 0 jbinit setlayout mainlayout nolabel settext yeslabel settext badd seticon getimageicon badd setmargin badd addactionlistener bremove seticon getimageicon bremove setmargin bremove addactionlistener bup seticon getimageicon bup setmargin bup addactionlistener bdown seticon getimageicon bdown setmargin bdown addactionlistener yeslist setborder borderfactory createloweredbevelborder yespane setpreferredsize yeslist setselectionmode listselectionmodel multiple_interval_selection nolist setborder borderfactory createloweredbevelborder nopane setpreferredsize nolist setselectionmode listselectionmodel multiple_interval_selection nolabel gridbagconstraints gridbagconstraints gridbagconstraints yeslabel gridbagconstraints gridbagconstraints gridbagconstraints bdown gridbagconstraints gridbagconstraints gridbagconstraints nopane gridbagconstraints gridbagconstraints gridbagconstraints yespane gridbagconstraints gridbagconstraints gridbagconstraints bup gridbagconstraints gridbagconstraints gridbagconstraints bremove gridbagconstraints gridbagconstraints gridbagconstraints badd gridbagconstraints gridbagconstraints gridbagconstraints dyanamic init param ad table id table no param ad columnsortorder id sort column param ad columnsortyesno id yes no column private void dyn init int ad table id int ad columnsortorder id int ad columnsortyesno id string sql select t table name c ad column id c column name e name 1 4 c is parent c is key c is identifier c is translated 4 8 from ad table t ad column c ad element e where t ad table id 1 and t ad table id c ad table id and c ad column id or ad column id 2 3 or c is parent y or c is key y or c is identifier y and c ad element id e ad element id boolean trl env is base language env get ctx ad element if trl sql select t table name c ad column id c column name et name 1 4 c is parent c is key c is identifier c is translated 4 8 from ad table t ad column c ad element trl et where t ad table id 1 and t ad table id c ad table id and c ad column id or ad column id 2 3 or c is parent y or c is key y or c is identifier y and c ad element id et ad element id and et ad language 4 try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id pstmt set int 2 ad columnsortorder id pstmt set int 3 ad columnsortyesno id if trl pstmt set string 4 env getad language env get ctx result set rs pstmt execute query while rs next m tablename rs get string 1 sort column if ad columnsortorder id rs get int 2 log fine sort rs get string 1 rs get string 3 m columnsortname rs get string 3 yes label set text rs get string 4 optional yes no else if ad columnsortyesno id rs get int 2 log fine yes no rs get string 1 rs get string 3 m columnyesnoname rs get string 3 parent2 else if rs get string 5 equals y log fine parent rs get string 1 rs get string 3 m parentcolumnname rs get string 3 key column else if rs get string 6 equals y log fine key rs get string 1 rs get string 3 m keycolumnname rs get string 3 identifier else if rs get string 7 equals y log fine identifier rs get string 1 rs get string 3 m identifiercolumnname rs get string 3 if trl m identifiertranslated y equals rs get string 8 else log fine not used rs get string 1 rs get string 3 rs close pstmt close catch sql exception e log log level severe sql to string e no label set text msg get msg env get ctx available log info m columnsortname ad_table_id ad_columnsortorder_id ad_columnsortyesno_id yesno dyninit ad_table_id ad_columnsortorder_id ad_columnsortyesno_id tablename ad_column_id columnname isparent iskey isidentifier istranslated ad_table ad_column ad_element ad_table_id ad_table_id ad_table_id ad_column_id ad_column_id isparent iskey isidentifier ad_element_id ad_element_id isbaselanguage getctx ad_element tablename ad_column_id columnname isparent iskey isidentifier istranslated ad_table ad_column ad_element_trl ad_table_id ad_table_id ad_table_id ad_column_id ad_column_id isparent iskey isidentifier ad_element_id ad_element_id ad_language preparedstatement preparestatement setint ad_table_id setint ad_columnsortorder_id setint ad_columnsortyesno_id setstring getad_language getctx resultset executequery m_tablename getstring ad_columnsortorder_id getint getstring getstring m_columnsortname getstring yeslabel settext getstring yesno ad_columnsortyesno_id getint yesno getstring getstring m_columnyesnoname getstring getstring getstring getstring m_parentcolumnname getstring keycolumn getstring getstring getstring m_keycolumnname getstring getstring getstring getstring m_identifiercolumnname getstring m_identifiertranslated getstring notused getstring getstring sqlexception tostring nolabel settext getmsg getctx m_columnsortname register a panel param panel panel public void registera panel a panel panel m apanel panel apanel registerapanel apanel m_apanel unregister a panel public void unregister panel save data m apanel null apanel unregisterpanel savedata m_apanel action performed param e event public void action performed action event e add if e get source b add object objects no list get selected values for int i 0 i objects length i if objects i null no model remove element objects i log config add objects i yes model add element objects i yes list set selected value objects i true m savesequence true remove else if e get source b remove object objects yes list get selected values for int i 0 i objects length i if objects i null yes model remove element objects i log config remove objects i no model add element objects i m savesequence true up else if e get source b up int indexes yes list get selected indices object objects yes list get selected values for int i 0 i indexes length i if indexes i 0 object obj yes list get selected value log config up obj if yes model remove element obj yes model insert element at obj indexes i 1 m savesequence true indexes i yes list set selected indices indexes down else if e get source b down int indexes yes list get selected indices for int i 0 i indexes length i if indexes i 1 indexes i yes model size 1 object obj yes list get selected value log config down obj if yes model remove element obj yes model insert element at obj indexes i 1 m savesequence true indexes i yes list set selected indices indexes enable explicit save if m savesequence m apanel null m apanel a save set enabled true actionperformed actionperformed actionevent getsource badd nolist getselectedvalues nomodel removeelement yesmodel addelement yeslist setselectedvalue m_savesequence getsource bremove yeslist getselectedvalues yesmodel removeelement nomodel addelement m_savesequence getsource bup yeslist getselectedindices yeslist getselectedvalues yeslist getselectedvalue yesmodel removeelement yesmodel insertelementat m_savesequence yeslist setselectedindices getsource bdown yeslist getselectedindices yesmodel yeslist getselectedvalue yesmodel removeelement yesmodel insertelementat m_savesequence yeslist setselectedindices m_savesequence m_apanel m_apanel asave setenabled load data public void load data yes model remove all elements no model remove all elements select t ad field id t name t seq no t is displayed from ad field t where t ad tab id order by 4 desc 3 2 select t ad printformatitem id t name t seq no t is printed from ad printformatitem t where t ad printformat id order by 4 desc 3 2 select t ad printformatitem id t name t sort no t is order by from ad printformatitem t where t ad printformat id order by 4 desc 3 2 string buffer sql new string buffer columns sql append select t append m keycolumnname 1 append m identifiertranslated tt t append m identifiercolumnname 2 append t append m columnsortname 3 if m columnyesnoname null sql append t append m columnyesnoname 4 tables sql append from append m tablename append t if m identifiertranslated sql append append m tablename append trl tt where sql append where t append m parentcolumnname append if m identifiertranslated sql append and t append m keycolumnname append tt append m keycolumnname append and tt ad language order sql append order by if m columnyesnoname null sql append 4 desc t is displayed desc sql append 3 2 t seq no tt name int id env get context as int env get ctx m windowno m parentcolumnname log config sql to string id id try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 id if m identifiertranslated pstmt set string 2 env getad language env get ctx result set rs pstmt execute query while rs next int key rs get int 1 string name rs get string 2 int seq rs get int 3 boolean is yes seq 0 if m columnyesnoname null is yes rs get string 4 equals y key name pair pp new key name pair key name if is yes yes model add element pp else no model add element pp rs close pstmt close catch sql exception e log log level severe sql to string e m savesequence false loaddata yesmodel removeallelements nomodel removeallelements ad_field_id seqno isdisplayed ad_field ad_tab_id ad_printformatitem_id seqno isprinted ad_printformatitem ad_printformat_id ad_printformatitem_id sortno isorderby ad_printformatitem ad_printformat_id stringbuffer stringbuffer m_keycolumnname m_identifiertranslated m_identifiercolumnname m_columnsortname m_columnyesnoname m_columnyesnoname m_tablename m_identifiertranslated m_tablename _trl m_parentcolumnname m_identifiertranslated m_keycolumnname m_keycolumnname ad_language m_columnyesnoname isdisplayed seqno getcontextasint getctx m_windowno m_parentcolumnname tostring preparedstatement preparestatement tostring setint m_identifiertranslated setstring getad_language getctx resultset executequery getint getstring getint isyes m_columnyesnoname isyes getstring keynamepair keynamepair isyes yesmodel addelement nomodel addelement sqlexception tostring m_savesequence save data public void save data if m savesequence return log info string buffer sql null no list set sort column to null and optional yes no column to n for int i 0 i no model get size i key name pair pp key name pair no model get element at i sql new string buffer sql append update append m tablename append set append m columnsortname append 0 if m columnyesnoname null sql append append m columnyesnoname append n sql append where append m keycolumnname append append pp get key if db execute update sql to string null 1 log log level severe no model not updated m keycolumnname pp get key yes list set sort column to value and optional yes no column to y for int i 0 i yes model get size i key name pair pp key name pair yes model get element at i sql new string buffer sql append update append m tablename append set append m columnsortname append append i 1 append 0 10 steps if m columnyesnoname null sql append append m columnyesnoname append y sql append where append m keycolumnname append append pp get key if db execute update sql to string null 1 log log level severe yes model not updated m keycolumnname pp get key savedata m_savesequence stringbuffer nolist sortcolumn yesno nomodel getsize keynamepair keynamepair nomodel getelementat stringbuffer m_tablename m_columnsortname m_columnyesnoname m_columnyesnoname m_keycolumnname getkey executeupdate tostring nomodel m_keycolumnname getkey yeslist sortcolumn yesno yesmodel getsize keynamepair keynamepair yesmodel getelementat stringbuffer m_tablename m_columnsortname m_columnyesnoname m_columnyesnoname m_keycolumnname getkey executeupdate tostring yesmodel m_keycolumnname getkey standard constructor param ctx context param c taxcategory id id param trx name trx public m tax category properties ctx int c taxcategory id string trx name super ctx c taxcategory id trx name if c taxcategory id 0 set name null set is default false c_taxcategory_id trxname mtaxcategory c_taxcategory_id trxname c_taxcategory_id trxname c_taxcategory_id setname setisdefault load constructor param ctx context param rs resukt set param trx name trx public m tax category properties ctx result set rs string trx name super ctx rs trx name trxname mtaxcategory resultset trxname trxname ide constructor public v locator this m locator id false false true null 0 vlocator m_locator_id constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param m locator locator lookup model param window no window no public v locator string column name boolean mandatory boolean is read only boolean is updateable m locator lookup m locator int window no super super set name column name m columnname column name m mlocator m locator m windowno window no look and feel install border this text field border this set layout new border layout size this set preferred size m text get preferred size causes r o to be the same length int height m text get preferred size height button text m text set border null m text set editable true m text set focusable true m text add mouse listener new vlocator mouseadapter this popup m text set font compiereplaf getfont field m text set foreground compiereplaf gettextcolor normal m text add action listener this this add m text border layout center m button set icon new image icon org compiere compiere class get resource images locator10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this this add m button border layout east prefereed size this set preferred size this get preferred size causes r o to be the same length read write if is read only is updateable set read write false else set read write true set mandatory mandatory m zoom new c menu item msg get msg env get ctx zoom env get image icon zoom16 gif m zoom add action listener this popup menu add m zoom m refresh new c menu item msg get msg env get ctx refresh env get image icon refresh16 gif m refresh add action listener this popup menu add m refresh columnname columnname isreadonly isupdateable mlocator windowno vlocator columnname isreadonly isupdateable mlocatorlookup mlocator windowno setname columnname m_columnname columnname m_mlocator mlocator m_windowno windowno lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize m_text setborder m_text seteditable m_text setfocusable m_text addmouselistener vlocator_mouseadapter m_text setfont getfont_field m_text setforeground gettextcolor_normal m_text addactionlistener m_text borderlayout m_button seticon imageicon getresource m_button setmargin m_button setpreferredsize m_button addactionlistener m_button borderlayout setpreferredsize getpreferredsize readwrite isreadonly isupdateable setreadwrite setreadwrite setmandatory mzoom cmenuitem getmsg getctx getimageicon mzoom addactionlistener popupmenu mzoom mrefresh cmenuitem getmsg getctx getimageicon mrefresh addactionlistener popupmenu mrefresh dispose public void dispose m text null m button null m mlocator null m_text m_button m_mlocator enable disable param value r w public void set read write boolean value m button set read write value if m button is visible value m button set visible value set background false setreadwrite m_button setreadwrite m_button isvisible m_button setvisible setbackground is read write return true if read write public boolean is read write return m button is read write isreadwrite readwrite isreadwrite m_button isreadwrite set mandatory and back bolor param mandatory true if mandatory public void set mandatory boolean mandatory m button set mandatory mandatory set background false setmandatory m_button setmandatory setbackground is it mandatory return true if mandatory public boolean is mandatory return m button is mandatory ismandatory m_button ismandatory set background param color color public void set background color color if color equals m text get background m text set background color setbackground m_text getbackground m_text setbackground set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if is mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive ismandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set foreground param fg color public void set foreground color fg m text set foreground fg setforeground m_text setforeground request focus public void request focus m text request focus requestfocus m_text requestfocus set editor to value param value integer public void set value object value set value value false setvalue setvalue set value param value value param fire data binding private void set value object value boolean fire if value null m mlocator setonly warehouse id getonly warehouse id if m mlocator is valid value value null m value value m text set text m mlocator get display value loads value data binding try fire vetoable change m columnname null value catch property veto exception pve setvalue m_mlocator setonly_warehouse_id getonly_warehouse_id m_mlocator isvalid m_value m_text settext m_mlocator getdisplay firevetoablechange m_columnname propertyvetoexception property change listener param evt property change event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychangeevent propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value if getm locator id 0 return null return m value getvalue getm_locator_id m_value get m locator id return id public int getm locator id if m value null m value instanceof integer return integer m value int value return 0 m_locator_id getm_locator_id m_value m_value m_value intvalue return display value return display value public string get display return m text get text getdisplay m_text gettext action listener param e action event public void action performed action event e refresh if e get source m refresh m mlocator refresh return zoom to m warehouse if e get source m zoom action zoom return warehouse int only warehouse id getonly warehouse id log config only wharehouse id only warehouse id text entry ok if e get source m text action text only warehouse id return button start dialog int m locator id 0 if m value instanceof integer m locator id integer m value int value m mlocator setonly warehouse id only warehouse id v locator dialog ld new v locator dialog env get frame this msg translate env get ctx m columnname m mlocator m locator id is mandatory only warehouse id display ld set visible true m mlocator setonly warehouse id 0 redisplay if ld is changed return set value ld get value true actionlistener actionevent actionperformed actionevent getsource mrefresh m_mlocator m_warehouse getsource mzoom actionzoom only_warehouse_id getonly_warehouse_id wharehouse_id only_warehouse_id getsource m_text actiontext only_warehouse_id m_locator_id m_value m_locator_id m_value intvalue m_mlocator setonly_warehouse_id only_warehouse_id vlocatordialog vlocatordialog getframe getctx m_columnname m_mlocator m_locator_id ismandatory only_warehouse_id setvisible m_mlocator setonly_warehouse_id ischanged setvalue getvalue hit enter in text field param only warehouse id if not 0 restrict warehouse return true if found private boolean action text int only warehouse id string text m text get text log fine text if text null text length 0 if is mandatory return false else set value null true return true if text ends with text text to upper case else text text to upper case look up int m locator id 0 string sql select m locator id from m locator where upper value like db to string text if only warehouse id 0 sql and m warehouse id prepared statement pstmt null try pstmt db prepare statement sql null if only warehouse id 0 pstmt set int 1 only warehouse id result set rs pstmt execute query if rs next m locator id rs get int 1 if rs next m locator id 0 more than one rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if m locator id 0 return false set value new integer m locator id true return true only_warehouse_id actiontext only_warehouse_id m_text gettext ismandatory setvalue endswith touppercase touppercase m_locator_id m_locator_id m_locator to_string only_warehouse_id m_warehouse_id preparedstatement preparestatement only_warehouse_id setint only_warehouse_id resultset executequery m_locator_id getint m_locator_id sqlexception sqlexception m_locator_id setvalue m_locator_id action listener interface param listener listener public void add action listener action listener listener m text add action listener listener addactionlistener actionlistener m_text addactionlistener action zoom private void action zoom int ad window id 139 hardcoded log info set cursor cursor get predefined cursor cursor wait cursor a window frame new a window if frame init window ad window id null return a env show center screen frame frame null set cursor cursor get default cursor actionzoom ad_window_id setcursor getpredefinedcursor wait_cursor awindow awindow initwindow ad_window_id aenv showcenterscreen setcursor getdefaultcursor set field window no for value preference nop param m field model field public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield get warehouse restriction if any return m warehouse id or 0 private int getonly warehouse id string only warehouse env get context env get ctx m windowno m warehouse id true int only warehouse id 0 try if only warehouse null only warehouse length 0 only warehouse id integer parse int only warehouse catch exception ex return only warehouse id m_warehouse_id getonly_warehouse_id only_warehouse getcontext getctx m_windowno m_warehouse_id only_warehouse_id only_warehouse only_warehouse only_warehouse_id parseint only_warehouse only_warehouse_id constructor param adaptee v locator vlocator mouseadapter v locator adaptee this adaptee adaptee vlocator vlocator_mouseadapter vlocator mouse listener param e mouse event public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseevent mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource standard constructor public x ad labelprinterfunction properties ctx int ad labelprinterfunction id string trx name super ctx ad labelprinterfunction id trx name if ad labelprinterfunction id 0 setad labelprinterfunction id 0 setad labelprinter id 0 set isxy position false set name null x_ad_labelprinterfunction ad_labelprinterfunction_id trxname ad_labelprinterfunction_id trxname ad_labelprinterfunction_id setad_labelprinterfunction_id setad_labelprinter_id setisxyposition setname load constructor public x ad labelprinterfunction properties ctx result set rs string trx name super ctx rs trx name x_ad_labelprinterfunction resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad labelprinterfunction append get id append return sb to string tostring stringbuffer stringbuffer x_ad_labelprinterfunction get_id tostring set label printer function function of label printer public void setad labelprinterfunction id int ad labelprinterfunction id if ad labelprinterfunction id 1 throw new illegal argument exception ad labelprinterfunction id is mandatory set valuenocheck ad labelprinterfunction id new integer ad labelprinterfunction id setad_labelprinterfunction_id ad_labelprinterfunction_id ad_labelprinterfunction_id illegalargumentexception ad_labelprinterfunction_id set_valuenocheck ad_labelprinterfunction_id ad_labelprinterfunction_id get label printer function function of label printer public int getad labelprinterfunction id integer ii integer get value ad labelprinterfunction id if ii null return 0 return ii int value getad_labelprinterfunction_id get_value ad_labelprinterfunction_id intvalue set label printer label printer definition public void setad labelprinter id int ad labelprinter id if ad labelprinter id 1 throw new illegal argument exception ad labelprinter id is mandatory set valuenocheck ad labelprinter id new integer ad labelprinter id setad_labelprinter_id ad_labelprinter_id ad_labelprinter_id illegalargumentexception ad_labelprinter_id set_valuenocheck ad_labelprinter_id ad_labelprinter_id get label printer label printer definition public int getad labelprinter id integer ii integer get value ad labelprinter id if ii null return 0 return ii int value getad_labelprinter_id get_value ad_labelprinter_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set function prefix data sent before the function public void set function prefix string function prefix if function prefix null function prefix length 40 log warning length 40 truncated function prefix function prefix substring 0 39 set value function prefix function prefix setfunctionprefix functionprefix functionprefix functionprefix functionprefix functionprefix set_value functionprefix functionprefix get function prefix data sent before the function public string get function prefix return string get value function prefix getfunctionprefix get_value functionprefix set function suffix data sent after the function public void set function suffix string function suffix if function suffix null function suffix length 40 log warning length 40 truncated function suffix function suffix substring 0 39 set value function suffix function suffix setfunctionsuffix functionsuffix functionsuffix functionsuffix functionsuffix functionsuffix set_value functionsuffix functionsuffix get function suffix data sent after the function public string get function suffix return string get value function suffix getfunctionsuffix get_value functionsuffix set xy position the function is xy position public void set isxy position boolean isxy position set value isxy position new boolean isxy position setisxyposition isxyposition set_value isxyposition isxyposition get xy position the function is xy position public boolean isxy position object oo get value isxy position if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isxyposition get_value isxyposition booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set xy separator the separator between the x and y function public void setxy separator string xy separator if xy separator null xy separator length 20 log warning length 20 truncated xy separator xy separator substring 0 19 set value xy separator xy separator setxyseparator xyseparator xyseparator xyseparator xyseparator xyseparator set_value xyseparator xyseparator get xy separator the separator between the x and y function public string getxy separator return string get value xy separator getxyseparator get_value xyseparator prepare protected void prepare p c doctypecounter id getrecord id p_c_doctypecounter_id getrecord_id do it return message protected string do it throws exception log info c doctypecounter id p c doctypecounter id m counter new m doc type counter get ctx p c doctypecounter id get trxname if m counter null m counter get id 0 throw new illegal argument exception not found c doctypecounter id p c doctypecounter id string error m counter validate m counter save if error null throw new exception error return ok doit c_doctypecounter_id p_c_doctypecounter_id m_counter mdoctypecounter getctx p_c_doctypecounter_id get_trxname m_counter m_counter get_id illegalargumentexception c_doctypecounter_id p_c_doctypecounter_id m_counter m_counter docline allocation param line allocation line param doc header public docline allocation m allocation line line doc doc super line doc m c payment id line getc payment id m c cashline id line getc cashline id m c invoice id line getc invoice id m c order id line getc order id set amount line get amount m discountamt line get discount amt m writeoffamt line get write off amt m overunderamt line get over under amt docline_allocation docline_allocation mallocationline m_c_payment_id getc_payment_id m_c_cashline_id getc_cashline_id m_c_invoice_id getc_invoice_id m_c_order_id getc_order_id setamount getamount m_discountamt getdiscountamt m_writeoffamt getwriteoffamt m_overunderamt getoverunderamt get invoice c currency id return 0 if no invoice 1 if not found public int getinvoicec currency id if m c invoice id 0 return 0 string sql select c currency id from c invoice where c invoice id return db getsql value null sql m c invoice id c_currency_id getinvoicec_currency_id m_c_invoice_id c_currency_id c_invoice c_invoice_id getsqlvalue m_c_invoice_id string representation return info public string to string string buffer sb new string buffer docline allocation sb append get id append amt append get amt source append discount append get discount amt append write off append get write off amt append over under amt append get over under amt append c payment id append m c payment id append c cashline id append m c cashline id append c invoice id append m c invoice id append return sb to string tostring stringbuffer stringbuffer docline_allocation get_id getamtsource getdiscountamt writeoff getwriteoffamt overunderamt getoverunderamt c_payment_id m_c_payment_id c_cashline_id m_c_cashline_id c_invoice_id m_c_invoice_id tostring return returns the c order id public int getc order id return m c order id c_order_id getc_order_id m_c_order_id return returns the discount amt public big decimal get discount amt return m discountamt discountamt bigdecimal getdiscountamt m_discountamt return returns the over under amt public big decimal get over under amt return m overunderamt overunderamt bigdecimal getoverunderamt m_overunderamt return returns the write off amt public big decimal get write off amt return m writeoffamt writeoffamt bigdecimal getwriteoffamt m_writeoffamt return returns the c cashline id public int getc cashline id return m c cashline id c_cashline_id getc_cashline_id m_c_cashline_id return returns the c invoice id public int getc invoice id return m c invoice id c_invoice_id getc_invoice_id m_c_invoice_id return returns the c payment id public int getc payment id return m c payment id c_payment_id getc_payment_id m_c_payment_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals ad org id m ad org id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else if name equals doc action m docaction string para i get parameter else log log level severe unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername ad_client_id m_ad_client_id bigdecimal getparameter intvalue ad_org_id m_ad_org_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter docaction m_docaction getparameter m_datevalue m_datevalue currenttimemillis perrform process return clear message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i invoice where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i invoice set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id append m ad org id append is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no sql new string buffer update i invoice o set i isimported e i errormsg i errormsg err invalid org where ad org id is null or ad org id 0 or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid org no document type po so sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type in api apc and o ad client id d ad client id where c doctype id is null and isso trx n and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set po doc type no sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type in ari arc and o ad client id d ad client id where c doctype id is null and isso trx y and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set so doc type no sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type in api ari apc arc and o ad client id d ad client id where c doctype id is null and isso trx is null and doc type name is not null and i isimported y append client check where c doctype id is null and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set doc type no sql new string buffer update i invoice set i isimported e i errormsg i errormsg err invalid doc type name where c doctype id is null and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid doc type name no doc type default sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d is default y and d doc base type api and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx n and i isimported y append client check no db execute update sql to string get trxname log fine set po default doc type no sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d is default y and d doc base type ari and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx y and i isimported y append client check no db execute update sql to string get trxname log fine set so default doc type no sql new string buffer update i invoice o set c doctype id select c doctype id from c doctype d where d is default y and d doc base type in ari api and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx is null and i isimported y append client check no db execute update sql to string get trxname log fine set default doc type no sql new string buffer update i invoice set i isimported e i errormsg i errormsg err no doc type where c doctype id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no doc type no set isso trx sql new string buffer update i invoice o set isso trx y where exists select from c doctype d where o c doctype id d c doctype id and d doc base type ari and o ad client id d ad client id and c doctype id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set isso trx y no sql new string buffer update i invoice o set isso trx n where exists select from c doctype d where o c doctype id d c doctype id and d doc base type api and o ad client id d ad client id and c doctype id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set isso trx n no price list sql new string buffer update i invoice o set m pricelist id select m pricelist id from m pricelist p where p is default y and p c currency id o c currency id and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname log fine set default currency price list no sql new string buffer update i invoice o set m pricelist id select m pricelist id from m pricelist p where p is default y and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and c currency id is null and i isimported y append client check no db execute update sql to string get trxname log fine set default price list no sql new string buffer update i invoice o set m pricelist id select m pricelist id from m pricelist p where p c currency id o c currency id and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname log fine set currency price list no sql new string buffer update i invoice o set m pricelist id select m pricelist id from m pricelist p where p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and c currency id is null and i isimported y append client check no db execute update sql to string get trxname log fine set price list no sql new string buffer update i invoice set i isimported e i errormsg i errormsg err no price list where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no price list no payment term sql new string buffer update i invoice o set c paymentterm id select c paymentterm id from c paymentterm p where o payment term value p value and o ad client id p ad client id where c paymentterm id is null and payment term value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set payment term no sql new string buffer update i invoice o set c paymentterm id select c paymentterm id from c paymentterm p where p is default y and rownum 1 and o ad client id p ad client id where c paymentterm id is null and o payment term value is null and i isimported y append client check no db execute update sql to string get trxname log fine set default payment term no sql new string buffer update i invoice set i isimported e i errormsg i errormsg err no payment term where c paymentterm id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no payment term no bp from e mail sql new string buffer update i invoice o set c bpartner id ad user id select c bpartner id ad user id from ad user u where o e mail u e mail and o ad client id u ad client id and u c bpartner id is not null where c bpartner id is null and e mail is not null and i isimported y append client check no db execute update sql to string get trxname log fine set bp from e mail no bp from contact name sql new string buffer update i invoice o set c bpartner id ad user id select c bpartner id ad user id from ad user u where o contact name u name and o ad client id u ad client id and u c bpartner id is not null where c bpartner id is null and contact name is not null and exists select doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_invoice i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_invoice ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id m_ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_invoice i_isimported i_errormsg i_errormsg ad_org_id ad_org_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck c_doctype_id doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice i_isimported i_errormsg i_errormsg doctypename c_doctype_id doctypename i_isimported clientcheck executeupdate tostring get_trxname doctypename doctype stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_invoice i_isimported i_errormsg i_errormsg doctype c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname doctype issotrx stringbuffer i_invoice issotrx c_doctype c_doctype_id c_doctype_id docbasetype ad_client_id ad_client_id c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname issotrx stringbuffer i_invoice issotrx c_doctype c_doctype_id c_doctype_id docbasetype ad_client_id ad_client_id c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname issotrx stringbuffer i_invoice m_pricelist_id m_pricelist_id m_pricelist isdefault c_currency_id c_currency_id issopricelist issotrx ad_client_id ad_client_id m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_invoice m_pricelist_id m_pricelist_id m_pricelist isdefault issopricelist issotrx ad_client_id ad_client_id m_pricelist_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_invoice m_pricelist_id m_pricelist_id m_pricelist c_currency_id c_currency_id issopricelist issotrx ad_client_id ad_client_id m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_invoice m_pricelist_id m_pricelist_id m_pricelist issopricelist issotrx ad_client_id ad_client_id m_pricelist_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_invoice i_isimported i_errormsg i_errormsg pricelist m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_invoice c_paymentterm_id c_paymentterm_id c_paymentterm paymenttermvalue ad_client_id ad_client_id c_paymentterm_id paymenttermvalue i_isimported clientcheck executeupdate tostring get_trxname paymentterm stringbuffer i_invoice c_paymentterm_id c_paymentterm_id c_paymentterm isdefault ad_client_id ad_client_id c_paymentterm_id paymenttermvalue i_isimported clientcheck executeupdate tostring get_trxname paymentterm stringbuffer i_invoice i_isimported i_errormsg i_errormsg paymentterm c_paymentterm_id i_isimported clientcheck executeupdate tostring get_trxname paymentterm email stringbuffer i_invoice c_bpartner_id ad_user_id c_bpartner_id ad_user_id ad_user email email ad_client_id ad_client_id c_bpartner_id c_bpartner_id email i_isimported clientcheck executeupdate tostring get_trxname email contactname stringbuffer i_invoice c_bpartner_id ad_user_id c_bpartner_id ad_user_id ad_user contactname ad_client_id ad_client_id c_bpartner_id c_bpartner_id contactname standard constructor public x m attributeset properties ctx int m attributeset id string trx name super ctx m attributeset id trx name if m attributeset id 0 set is guarantee date false set is guarantee date mandatory false set is instance attribute false set is lot false set is lot mandatory false set is ser no false set is ser no mandatory false setm attributeset id 0 set mandatory type null set name null x_m_attributeset m_attributeset_id trxname m_attributeset_id trxname m_attributeset_id setisguaranteedate setisguaranteedatemandatory setisinstanceattribute setislot setislotmandatory setisserno setissernomandatory setm_attributeset_id setmandatorytype setname load constructor public x m attributeset properties ctx result set rs string trx name super ctx rs trx name x_m_attributeset resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributeset append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributeset get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set guarantee days number of days the product is guaranteed or available public void set guarantee days int guarantee days set value guarantee days new integer guarantee days setguaranteedays guaranteedays set_value guaranteedays guaranteedays get guarantee days number of days the product is guaranteed or available public int get guarantee days integer ii integer get value guarantee days if ii null return 0 return ii int value getguaranteedays get_value guaranteedays intvalue set guarantee date product has guarantee or expiry date public void set is guarantee date boolean is guarantee date set value is guarantee date new boolean is guarantee date setisguaranteedate isguaranteedate set_value isguaranteedate isguaranteedate get guarantee date product has guarantee or expiry date public boolean is guarantee date object oo get value is guarantee date if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isguaranteedate get_value isguaranteedate booleanvalue set mandatory guarantee date the entry of a guarantee date is mandatory when creating a product instance public void set is guarantee date mandatory boolean is guarantee date mandatory set value is guarantee date mandatory new boolean is guarantee date mandatory setisguaranteedatemandatory isguaranteedatemandatory set_value isguaranteedatemandatory isguaranteedatemandatory get mandatory guarantee date the entry of a guarantee date is mandatory when creating a product instance public boolean is guarantee date mandatory object oo get value is guarantee date mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isguaranteedatemandatory get_value isguaranteedatemandatory booleanvalue set instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public void set is instance attribute boolean is instance attribute set value is instance attribute new boolean is instance attribute setisinstanceattribute isinstanceattribute set_value isinstanceattribute isinstanceattribute get instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public boolean is instance attribute object oo get value is instance attribute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinstanceattribute get_value isinstanceattribute booleanvalue set lot the product instances have a lot number public void set is lot boolean is lot set value is lot new boolean is lot setislot islot set_value islot islot get lot the product instances have a lot number public boolean is lot object oo get value is lot if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islot get_value islot booleanvalue set mandatory lot the entry of lot info is mandatory when creating a product instance public void set is lot mandatory boolean is lot mandatory set value is lot mandatory new boolean is lot mandatory setislotmandatory islotmandatory set_value islotmandatory islotmandatory get mandatory lot the entry of lot info is mandatory when creating a product instance public boolean is lot mandatory object oo get value is lot mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islotmandatory get_value islotmandatory booleanvalue set serial no the product instances have serial numbers public void set is ser no boolean is ser no set value is ser no new boolean is ser no setisserno isserno set_value isserno isserno get serial no the product instances have serial numbers public boolean is ser no object oo get value is ser no if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isserno get_value isserno booleanvalue set mandatory serial no the entry of a serial no is mandatory when creating a product instance public void set is ser no mandatory boolean is ser no mandatory set value is ser no mandatory new boolean is ser no mandatory setissernomandatory issernomandatory set_value issernomandatory issernomandatory get mandatory serial no the entry of a serial no is mandatory when creating a product instance public boolean is ser no mandatory object oo get value is ser no mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issernomandatory get_value issernomandatory booleanvalue set lot char end overwrite lot batch end indicator overwrite default public void set lot chare overwrite string lot chare overwrite if lot chare overwrite null lot chare overwrite length 1 log warning length 1 truncated lot chare overwrite lot chare overwrite substring 0 0 set value lot chare overwrite lot chare overwrite setlotchareoverwrite lotchareoverwrite lotchareoverwrite lotchareoverwrite lotchareoverwrite lotchareoverwrite set_value lotchareoverwrite lotchareoverwrite get lot char end overwrite lot batch end indicator overwrite default public string get lot chare overwrite return string get value lot chare overwrite getlotchareoverwrite get_value lotchareoverwrite set lot char start overwrite lot batch start indicator overwrite default public void set lot chars overwrite string lot chars overwrite if lot chars overwrite null lot chars overwrite length 1 log warning length 1 truncated lot chars overwrite lot chars overwrite substring 0 0 set value lot chars overwrite lot chars overwrite setlotcharsoverwrite lotcharsoverwrite lotcharsoverwrite lotcharsoverwrite lotcharsoverwrite lotcharsoverwrite set_value lotcharsoverwrite lotcharsoverwrite get lot char start overwrite lot batch start indicator overwrite default public string get lot chars overwrite return string get value lot chars overwrite getlotcharsoverwrite get_value lotcharsoverwrite set attribute set product attribute set public void setm attributeset id int m attributeset id if m attributeset id 0 throw new illegal argument exception m attributeset id is mandatory set valuenocheck m attributeset id new integer m attributeset id setm_attributeset_id m_attributeset_id m_attributeset_id illegalargumentexception m_attributeset_id set_valuenocheck m_attributeset_id m_attributeset_id get attribute set product attribute set public int getm attributeset id integer ii integer get value m attributeset id if ii null return 0 return ii int value getm_attributeset_id get_value m_attributeset_id intvalue set lot control product lot control public void setm lotctl id int m lotctl id if m lotctl id 0 set value m lotctl id null else set value m lotctl id new integer m lotctl id setm_lotctl_id m_lotctl_id m_lotctl_id set_value m_lotctl_id set_value m_lotctl_id m_lotctl_id get lot control product lot control public int getm lotctl id integer ii integer get value m lotctl id if ii null return 0 return ii int value getm_lotctl_id get_value m_lotctl_id intvalue set serial no control product serial number control public void setm sernoctl id int m sernoctl id if m sernoctl id 0 set value m sernoctl id null else set value m sernoctl id new integer m sernoctl id setm_sernoctl_id m_sernoctl_id m_sernoctl_id set_value m_sernoctl_id set_value m_sernoctl_id m_sernoctl_id get serial no control product serial number control public int getm sernoctl id integer ii integer get value m sernoctl id if ii null return 0 return ii int value getm_sernoctl_id get_value m_sernoctl_id intvalue public static final string mandatorytype alwaysmandatory y set mandatory type the specification of a product attribute instance is mandatory public void set mandatory type string mandatory type if mandatory type null throw new illegal argument exception mandatory type is mandatory if mandatory type equals n mandatory type equals s mandatory type equals y else throw new illegal argument exception mandatory type invalid value mandatory type reference id 324 n s y if mandatory type length 1 log warning length 1 truncated mandatory type mandatory type substring 0 0 set value mandatory type mandatory type mandatorytype_alwaysmandatory setmandatorytype mandatorytype mandatorytype illegalargumentexception mandatorytype mandatorytype mandatorytype mandatorytype illegalargumentexception mandatorytype mandatorytype reference_id mandatorytype mandatorytype mandatorytype set_value mandatorytype mandatorytype get mandatory type the specification of a product attribute instance is mandatory public string get mandatory type return string get value mandatory type getmandatorytype get_value mandatorytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set ser no char end overwrite serial number end indicator overwrite default empty public void set ser no chare overwrite string ser no chare overwrite if ser no chare overwrite null ser no chare overwrite length 1 log warning length 1 truncated ser no chare overwrite ser no chare overwrite substring 0 0 set value ser no chare overwrite ser no chare overwrite serno setsernochareoverwrite sernochareoverwrite sernochareoverwrite sernochareoverwrite sernochareoverwrite sernochareoverwrite set_value sernochareoverwrite sernochareoverwrite get ser no char end overwrite serial number end indicator overwrite default empty public string get ser no chare overwrite return string get value ser no chare overwrite serno getsernochareoverwrite get_value sernochareoverwrite set ser no char start overwrite serial number start indicator overwrite default public void set ser no chars overwrite string ser no chars overwrite if ser no chars overwrite null ser no chars overwrite length 1 log warning length 1 truncated ser no chars overwrite ser no chars overwrite substring 0 0 set value ser no chars overwrite ser no chars overwrite serno setsernocharsoverwrite sernocharsoverwrite sernocharsoverwrite sernocharsoverwrite sernocharsoverwrite sernocharsoverwrite set_value sernocharsoverwrite sernocharsoverwrite get ser no char start overwrite serial number start indicator overwrite default public string get ser no chars overwrite return string get value ser no chars overwrite serno getsernocharsoverwrite get_value sernocharsoverwrite constructor param owner param m image public v image dialog frame owner m image m image super owner msg translate env get ctx ad image id true log info m image m image m mimage m image try jb init catch exception ex log log level severe v image dialog ex load data file button set text m mimage get name image label set icon m mimage get image a env position center window owner this mimage vimagedialog mimage mimage getctx ad_image_id mimage mimage m_mimage mimage jbinit vimagedialog filebutton settext m_mimage getname imagelabel seticon m_mimage getimage aenv positioncenterwindow static init throws exception void jb init throws exception main panel set layout main layout file label set text msg get msg env get ctx select file file button set text image label set background color white image label set border border factory create raised bevel border image label set preferred size new dimension 50 50 image label set horizontal alignment swing constants center get content pane add main panel main panel add parameter panel border layout north parameter panel add file label null parameter panel add file button null main panel add image label border layout center main panel add confirm panel border layout south file button add action listener this confirm panel add action listener this jbinit mainpanel setlayout mainlayout filelabel settext getmsg getctx selectfile filebutton settext imagelabel setbackground imagelabel setborder borderfactory createraisedbevelborder imagelabel setpreferredsize imagelabel sethorizontalalignment swingconstants getcontentpane mainpanel mainpanel parameterpanel borderlayout parameterpanel filelabel parameterpanel filebutton mainpanel imagelabel borderlayout mainpanel confirmpanel borderlayout filebutton addactionlistener confirmpanel addactionlistener action listener param e public void action performed action event e if e get source file button cmd file else if e get action command equals confirm panel a ok set cursor cursor get predefined cursor cursor wait cursor if m mimage save dispose else set cursor cursor get default cursor else if e get action command equals confirm panel a cancel dispose actionlistener actionperformed actionevent getsource filebutton cmd_file getactioncommand confirmpanel a_ok setcursor getpredefinedcursor wait_cursor m_mimage setcursor getdefaultcursor getactioncommand confirmpanel a_cancel load file display private void cmd file show file open dialog j file chooser jfc new j file chooser jfc set multi selection enabled false jfc set file selection mode j file chooser files only jfc show open dialog this get file name file image file jfc get selected file if image file null image file is directory image file exists return see if we can load display it try image icon image new image icon image file tourl image label set icon image catch exception e log log level severe cmd file e return ok file button set text image file get absolute path pack save info string file name image file get absolute path m mimage set name file name m mimage set imageurl file name m mimage set image file image file cmd_file jfilechooser jfilechooser setmultiselectionenabled setfileselectionmode jfilechooser files_only showopendialog imagefile getselectedfile imagefile imagefile isdirectory imagefile imageicon imageicon imagefile imagelabel seticon cmd_file filebutton settext imagefile getabsolutepath filename imagefile getabsolutepath m_mimage setname filename m_mimage setimageurl filename m_mimage setimagefile imagefile standard constructor public x ad replication run properties ctx int ad replication run id string trx name super ctx ad replication run id trx name if ad replication run id 0 setad replication id 0 setad replication run id 0 set is replicated false n set name null x_ad_replication_run ad_replication_run_id trxname ad_replication_run_id trxname ad_replication_run_id setad_replication_id setad_replication_run_id setisreplicated setname load constructor public x ad replication run properties ctx result set rs string trx name super ctx rs trx name x_ad_replication_run resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad replication run append get id append return sb to string tostring stringbuffer stringbuffer x_ad_replication_run get_id tostring set replication data replication target public void setad replication id int ad replication id if ad replication id 1 throw new illegal argument exception ad replication id is mandatory set valuenocheck ad replication id new integer ad replication id setad_replication_id ad_replication_id ad_replication_id illegalargumentexception ad_replication_id set_valuenocheck ad_replication_id ad_replication_id get replication data replication target public int getad replication id integer ii integer get value ad replication id if ii null return 0 return ii int value getad_replication_id get_value ad_replication_id intvalue set replication run data replication run public void setad replication run id int ad replication run id if ad replication run id 1 throw new illegal argument exception ad replication run id is mandatory set valuenocheck ad replication run id new integer ad replication run id setad_replication_run_id ad_replication_run_id ad_replication_run_id illegalargumentexception ad_replication_run_id set_valuenocheck ad_replication_run_id ad_replication_run_id get replication run data replication run public int getad replication run id integer ii integer get value ad replication run id if ii null return 0 return ii int value getad_replication_run_id get_value ad_replication_run_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set replicated the data is successfully replicated public void set is replicated boolean is replicated set valuenocheck is replicated new boolean is replicated setisreplicated isreplicated set_valuenocheck isreplicated isreplicated get replicated the data is successfully replicated public boolean is replicated object oo get value is replicated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreplicated get_value isreplicated booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get content return content public object get contents return contents getcontents get material allocations for line param ctx context param m movementline id line param trx name trx return allocations public static m movement linema get properties ctx int m movementline id string trx name array list m movement linema list new array list m movement linema string sql select from m movementlinema where m movementline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m movementline id result set rs pstmt execute query while rs next list add new m movement linema ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m movement linema ret value new m movement linema list size list to array ret value return ret value m_movementline_id trxname mmovementlinema m_movementline_id trxname arraylist mmovementlinema arraylist mmovementlinema m_movementlinema m_movementline_id preparedstatement preparestatement trxname setint m_movementline_id resultset executequery mmovementlinema trxname s_log mmovementlinema retvalue mmovementlinema toarray retvalue retvalue delete all material allocation for movement param m movement id movement return number of rows deleted or 1 for error public static int delete movementma int m movement id string trx name string sql delete from m movementlinema ma where exists select from m movementline l where l m movementline id ma m movementline id and m movement id m movement id return db execute update sql trx name m_movement_id deletemovementma m_movement_id trxname m_movementlinema m_movementline m_movementline_id m_movementline_id m_movement_id m_movement_id executeupdate trxname standard constructor param ctx context param m movementlinema id ignored param trx name trx public m movement linema properties ctx int m movementlinema id string trx name super ctx m movementlinema id trx name if m movementlinema id 0 throw new illegal argument exception multi key m_movementlinema_id trxname mmovementlinema m_movementlinema_id trxname m_movementlinema_id trxname m_movementlinema_id illegalargumentexception load constructor param ctx context param rs result ser param trx name trx public m movement linema properties ctx result set rs string trx name super ctx rs trx name trxname mmovementlinema resultset trxname trxname parent constructor param parent parent param m attributesetinstance id asi param movement qty qty public m movement linema m movement line parent int m attributesetinstance id big decimal movement qty this parent get ctx 0 parent get trxname set client org parent setm movementline id parent getm movementline id setm attributesetinstance id m attributesetinstance id set movement qty movement qty m_attributesetinstance_id movementqty mmovementlinema mmovementline m_attributesetinstance_id bigdecimal movementqty getctx get_trxname setclientorg setm_movementline_id getm_movementline_id setm_attributesetinstance_id m_attributesetinstance_id setmovementqty movementqty string representation return info public string to string string buffer sb new string buffer m movement linema sb append m movementline id append getm movementline id append m attributesetinstance id append getm attributesetinstance id append qty append get movement qty append return sb to string tostring stringbuffer stringbuffer mmovementlinema m_movementline_id getm_movementline_id m_attributesetinstance_id getm_attributesetinstance_id getmovementqty tostring constructor param owner frame owner public compiere theme editor j dialog owner super owner s res get string compiere theme editor true try jb init load theme dyn init compiereplaf show center screen this catch exception e system err println compiere theme editor e print stack trace compierethemeeditor jdialog s_res getstring compierethemeeditor jbinit loadtheme dyninit showcenterscreen compierethemeeditor printstacktrace static init throws exception private void jb init throws exception metal color border new titled border s res get string metal colors compiere color border new titled border s res get string compiere colors font border new titled border s res get string compiere fonts font panel set border font border font panel set opaque false this set default close operation j dialog dispose on close primary1 set tool tip text s res get string primary1 info primary1 set text s res get string primary1 primary1 add action listener this primary2 set tool tip text s res get string primary2 info primary2 set text s res get string primary2 primary2 add action listener this primary3 set tool tip text s res get string primary3 info primary3 set text s res get string primary3 primary3 add action listener this secondary1 set tool tip text s res get string secondary1 info secondary1 set text s res get string secondary1 secondary1 add action listener this secondary2 set tool tip text s res get string secondary2 info secondary2 set text s res get string secondary2 secondary2 add action listener this secondary3 set tool tip text s res get string secondary3 info secondary3 set text s res get string secondary3 secondary3 add action listener this control font set tool tip text s res get string control font info control font set text s res get string control font control font add action listener this system font set tool tip text s res get string system font info system font set text s res get string system font system font add action listener this user font set tool tip text s res get string user font info user font set text s res get string user font user font add action listener this small font set text s res get string small font small font add action listener this mandatory set tool tip text s res get string mandatory info mandatory set text s res get string mandatory mandatory add action listener this error set tool tip text s res get string error info error set text s res get string error error add action listener this info set tool tip text s res get string info info info set text s res get string info info add action listener this window font set text s res get string window title font window font add action listener this menu font set text s res get string menu font menu font add action listener this white set tool tip text s res get string white info white set text s res get string white white add action listener this black set tool tip text s res get string black info black set text s res get string black black add action listener this inactive set tool tip text s res get string inactive info inactive set text s res get string inactive inactive add action listener this txt ok set tool tip text s res get string textok info txt ok set text s res get string textok txt ok add action listener this txt error set tool tip text s res get string text issue info txt error set text s res get string text issue txt error add action listener this confirm panel set layout confirm layout confirm layout set alignment flow layout right center panel set layout center layout metal color panel set border metal color border metal color panel set opaque false metal color panel set layout metal color layout compiere color panel set layout compiere color layout compiere color panel set border compiere color border compiere color panel set opaque false metal color layout set columns 3 metal color layout set hgap 5 metal color layout set rows 3 metal color layout set vgap 5 compiere color layout set columns 4 compiere color layout set hgap 5 compiere color layout set rows 2 compiere color layout set vgap 5 font panel set layout font layout font layout set columns 3 font layout set hgap 5 font layout set rows 2 font layout set vgap 5 center layout set vgap 5 font border set title s res get string fonts confirm panel set opaque false this get content pane add confirm panel border layout south confirm panel add b cancel null confirm panel add bok null this get content pane add center panel border layout center center panel add metal color panel border layout north metal color panel add primary1 null metal color panel add primary2 null metal color panel add primary3 null metal color panel add secondary1 null metal color panel add secondary2 null metal color panel add secondary3 null metal color panel add white null metal color panel add black null center panel add compiere color panel border layout center compiere color panel add txt error null center panel add font panel border layout south font panel add control font null font panel add system font null font panel add menu font null font panel add user font null font panel add window font null font panel add small font null compiere color panel add error null compiere color panel add inactive null compiere color panel add txt ok null compiere color panel add mandatory null compiere color panel add info null b cancel add action listener this bok add action listener this jbinit metalcolorborder titledborder s_res getstring metalcolors compierecolorborder titledborder s_res getstring compierecolors fontborder titledborder s_res getstring compierefonts fontpanel setborder fontborder fontpanel setopaque setdefaultcloseoperation jdialog dispose_on_close settooltiptext s_res getstring primary1info settext s_res getstring addactionlistener settooltiptext s_res getstring primary2info settext s_res getstring addactionlistener settooltiptext s_res getstring primary3info settext s_res getstring addactionlistener settooltiptext s_res getstring secondary1info settext s_res getstring addactionlistener settooltiptext s_res getstring secondary2info settext s_res getstring addactionlistener settooltiptext s_res getstring secondary3info settext s_res getstring addactionlistener controlfont settooltiptext s_res getstring controlfontinfo controlfont settext s_res getstring controlfont controlfont addactionlistener systemfont settooltiptext s_res getstring systemfontinfo systemfont settext s_res getstring systemfont systemfont addactionlistener userfont settooltiptext s_res getstring userfontinfo userfont settext s_res getstring userfont userfont addactionlistener smallfont settext s_res getstring smallfont smallfont addactionlistener settooltiptext s_res getstring mandatoryinfo settext s_res getstring addactionlistener settooltiptext s_res getstring errorinfo settext s_res getstring addactionlistener settooltiptext s_res getstring infoinfo settext s_res getstring addactionlistener windowfont settext s_res getstring windowtitlefont windowfont addactionlistener menufont settext s_res getstring menufont menufont addactionlistener settooltiptext s_res getstring whiteinfo settext s_res getstring addactionlistener settooltiptext s_res getstring blackinfo settext s_res getstring addactionlistener settooltiptext s_res getstring inactiveinfo settext s_res getstring addactionlistener txt_ok settooltiptext s_res getstring textokinfo txt_ok settext s_res getstring txt_ok addactionlistener txt_error settooltiptext s_res getstring textissueinfo txt_error settext s_res getstring textissue txt_error addactionlistener confirmpanel setlayout confirmlayout confirmlayout setalignment flowlayout centerpanel setlayout centerlayout metalcolorpanel setborder metalcolorborder metalcolorpanel setopaque metalcolorpanel setlayout metalcolorlayout compierecolorpanel setlayout compierecolorlayout compierecolorpanel setborder compierecolorborder compierecolorpanel setopaque metalcolorlayout setcolumns metalcolorlayout sethgap metalcolorlayout setrows metalcolorlayout setvgap compierecolorlayout setcolumns compierecolorlayout sethgap compierecolorlayout setrows compierecolorlayout setvgap fontpanel setlayout fontlayout fontlayout setcolumns fontlayout sethgap fontlayout setrows fontlayout setvgap centerlayout setvgap fontborder settitle s_res getstring confirmpanel setopaque getcontentpane confirmpanel borderlayout confirmpanel bcancel confirmpanel getcontentpane centerpanel borderlayout centerpanel metalcolorpanel borderlayout metalcolorpanel metalcolorpanel metalcolorpanel metalcolorpanel metalcolorpanel metalcolorpanel metalcolorpanel metalcolorpanel centerpanel compierecolorpanel borderlayout compierecolorpanel txt_error centerpanel fontpanel borderlayout fontpanel controlfont fontpanel systemfont fontpanel menufont fontpanel userfont fontpanel windowfont fontpanel smallfont compierecolorpanel compierecolorpanel compierecolorpanel txt_ok compierecolorpanel compierecolorpanel bcancel addactionlistener addactionlistener load theme from current setting if metal look and feel private void load theme if ui manager get look and feel instanceof metal look and feel compiere theme set theme else not a metal theme primary1 set enabled false primary2 set enabled false primary3 set enabled false secondary1 set enabled false secondary2 set enabled false secondary3 set enabled false metallookandfeel loadtheme uimanager getlookandfeel metallookandfeel compieretheme settheme setenabled setenabled setenabled setenabled setenabled setenabled dynamic init private void dyn init system out println compiere theme editor dyn init compiere theme ct compiere look and feel get compiere theme colors primary1 set background ct get primary1 primary2 set background ct get primary2 primary3 set background ct get primary3 secondary1 set background ct get secondary1 secondary2 set background ct get secondary2 secondary3 set background ct get secondary3 white set background ct get white black set background ct get secondary3 black set foreground ct get black error set background compiereplaf getfieldbackground error mandatory set background compiereplaf getfieldbackground mandatory inactive set background compiereplaf getfieldbackground inactive info set background compiereplaf get info background txt ok set background compiereplaf getfieldbackground normal txt ok set foreground compiereplaf gettextcolor ok txt error set background compiereplaf getfieldbackground normal txt error set foreground compiereplaf gettextcolor issue fonts control font set font ct get control text font system font set font ct get system text font user font set font ct get user text font small font set font ct get sub text font menu font set font ct get menu text font window font set font ct get window title font dyninit compierethemeeditor dyninit compieretheme compierelookandfeel getcompieretheme setbackground getprimary1 setbackground getprimary2 setbackground getprimary3 setbackground getsecondary1 setbackground getsecondary2 setbackground getsecondary3 setbackground getwhite setbackground getsecondary3 setforeground getblack setbackground getfieldbackground_error setbackground getfieldbackground_mandatory setbackground getfieldbackground_inactive setbackground getinfobackground txt_ok setbackground getfieldbackground_normal txt_ok setforeground gettextcolor_ok txt_error setbackground getfieldbackground_normal txt_error setforeground gettextcolor_issue controlfont setfont getcontroltextfont systemfont setfont getsystemtextfont userfont setfont getusertextfont smallfont setfont getsubtextfont menufont setfont getmenutextfont windowfont setfont getwindowtitlefont action listener param e public void action performed action event e system out println compiere theme editor action performed e confirm if e get source bok compiere theme save dispose return cancel else if e get source b cancel dispose return compiere theme vt new compiere theme blue metal try to capture errors when cancel in j color chooser if e get source primary1 compiere theme primary1 new colorui resource j color chooser show dialog this s res get string primary1 compiere theme primary1 else if e get source primary2 compiere theme primary2 new colorui resource j color chooser show dialog this s res get string primary2 compiere theme primary2 else if e get source primary3 compiere theme primary3 new colorui resource j color chooser show dialog this s res get string primary3 compiere theme primary3 else if e get source secondary1 compiere theme secondary1 new colorui resource j color chooser show dialog this s res get string secondary1 compiere theme secondary1 else if e get source secondary2 compiere theme secondary2 new colorui resource j color chooser show dialog this s res get string secondary2 compiere theme secondary2 else if e get source secondary3 compiere theme secondary3 new colorui resource j color chooser show dialog this s res get string secondary3 compiere theme secondary3 else if e get source error compiere theme error new colorui resource j color chooser show dialog this s res get string error compiere theme error else if e get source mandatory compiere theme mandatory new colorui resource j color chooser show dialog this s res get string mandatory compiere theme mandatory else if e get source inactive compiere theme inactive new colorui resource j color chooser show dialog this s res get string inactive compiere theme inactive else if e get source info compiere theme info new colorui resource j color chooser show dialog this s res get string info compiere theme info else if e get source black compiere theme black new colorui resource j color chooser show dialog this s res get string black compiere theme black else if e get source white compiere theme white new colorui resource j color chooser show dialog this s res get string white compiere theme white else if e get source txt ok compiere theme txt ok new colorui resource j color chooser show dialog this s res get string textok compiere theme txt ok else if e get source txt error compiere theme txt error new colorui resource j color chooser show dialog this s res get string text issue compiere theme txt error else if e get source control font compiere theme control font new fontui resource font chooser show dialog this s res get string control font vt get control text font else if e get source system font compiere theme system font new fontui resource font chooser show dialog this s res get string system font vt get system text font else if e get source user font compiere theme user font new fontui resource font chooser show dialog this s res get string user font vt get user text font else if e get source small font compiere theme small font new fontui resource font chooser show dialog this s res get string small font vt get sub text font else if e get source menu font compiere theme menu font new fontui resource font chooser show dialog this s res get string menu font vt get menu text font else if e get source window font compiere theme window font new fontui resource font chooser show dialog this s res get string window title font vt get window title font catch exception ee to capture errors when cancel in j color chooser dyn init actionperformed actionevent compierethemeeditor actionperformed getsource compieretheme getsource bcancel compieretheme compierethemebluemetal jcolorchooser getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource compieretheme coloruiresource jcolorchooser showdialog s_res getstring compieretheme getsource txt_ok compieretheme txt_ok coloruiresource jcolorchooser showdialog s_res getstring compieretheme txt_ok getsource txt_error compieretheme txt_error coloruiresource jcolorchooser showdialog s_res getstring textissue compieretheme txt_error getsource controlfont compieretheme controlfont fontuiresource fontchooser showdialog s_res getstring controlfont getcontroltextfont getsource systemfont compieretheme systemfont fontuiresource fontchooser showdialog s_res getstring systemfont getsystemtextfont getsource userfont compieretheme userfont fontuiresource fontchooser showdialog s_res getstring userfont getusertextfont getsource smallfont compieretheme smallfont fontuiresource fontchooser showdialog s_res getstring smallfont getsubtextfont getsource menufont compieretheme menufont fontuiresource fontchooser showdialog s_res getstring menufont getmenutextfont getsource windowfont compieretheme windowfont fontuiresource fontchooser showdialog s_res getstring windowtitlefont getwindowtitlefont jcolorchooser dyninit test init set environment for tests param is client client session return context public static properties init test boolean is client logger entering env init test compiere startup environment true test context properties ctx env get ctx login login new login ctx key name pair roles login get roles c connection get system system true load role if roles null roles length 0 key name pair clients login get clients roles 0 load client if clients null clients length 0 key name pair orgs login get orgs clients 0 load org if orgs null orgs length 0 key name pair whs login get warehouses orgs 0 login load preferences orgs 0 null null null env set context ctx date 2000 01 01 logger exiting env init test return ctx isclient inittest isclient inittest startupenvironment getctx keynamepair getroles cconnection keynamepair getclients keynamepair getorgs keynamepair getwarehouses loadpreferences setcontext inittest java version test param is client client connection return true if java version is ok public static boolean is javaok boolean is client java system version check string j version system get property java version if j version starts with 1 5 0 return true warning boolean ok false if j version starts with 1 4 j version starts with 1 5 1 later earlier release ok true error message string buffer msg new string buffer msg append system get property java vm name append append j version if ok msg append untested msg append 1 5 0 if is client j option pane show message dialog null msg to string org compiere compiere get name java version check ok j option pane warning message j option pane error message else log severe msg to string return ok isclient isjavaok isclient jversion getproperty jversion startswith jversion startswith jversion startswith stringbuffer stringbuffer getproperty jversion isclient joptionpane showmessagedialog tostring getname joptionpane warning_message joptionpane error_message tostring login public login properties ctx if ctx null throw new illegal argument exception context missing m ctx ctx illegalargumentexception m_ctx test client login p get connection compare user info p sets conext with login info param cc connection param app user user param app pwd pwd param force ignore pwd return array of role key name pair or null if error the error no database user pwd error db login is saved in the log protected key name pair get roles c connection cc string app user string app pwd boolean force establish connection db setdb target cc env set context m ctx host cc get apps host env set context m ctx database cc get db name if db get connectionro null log save error no database return null if app pwd null return null return get roles app user app pwd force app_user app_pwd keynamepair nodatabase userpwderror dblogin keynamepair getroles cconnection app_user app_pwd setdbtarget setcontext m_ctx getappshost setcontext m_ctx getdbname getconnectionro saveerror nodatabase app_pwd getroles app_user app_pwd web client login p compare user info p sets conext with login info param app user principal return role array or null if in error the error no database user pwd error db login is saved in the log public key name pair get roles principal app user if app user null return null login w o password as previously authorized return get roles app user get name null false app_user nodatabase userpwderror dblogin keynamepair getroles app_user app_user getroles app_user getname client login p compare user info p sets conext with login info param app user user id param app pwd password return role array or null if in error the error no database user pwd error db login is saved in the log public key name pair get roles string app user string app pwd return get roles app user app pwd false app_user app_pwd nodatabase userpwderror dblogin keynamepair getroles app_user app_pwd getroles app_user app_pwd actual db login procedure param app user user param app pwd pwd param force ignore pwd return role array or null if in error the error no database user pwd error db login is saved in the log private key name pair get roles string app user string app pwd boolean force log info user app user long start system current time millis if app user null log warning no apps user return null authentification boolean authenticated false m system system m system get m ctx if system isldap authenticated system isldap app user app pwd if authenticated app pwd null if not authenticated use ad user as backup else if app pwd null app pwd length 0 log warning no apps password return null key name pair ret value null array list key name pair list new array list key name pair string buffer sql new string buffer select u ad user id r ad role id r name append u connection profile append from ad user u append inner join ad user roles ur on u ad user id ur ad user id and ur is active y append inner join ad role r on ur ad role id r ad role id and r is active y append where coalesce u ldap user u name 1 append and u is active y append and exists select from ad client c where u ad client id c ad client id and c is active y if app pwd null sql append and u password or u password 2 3 sql append order by r name prepared statement pstmt null try pstmt db prepare statement sql to string null pstmt set string 1 app user if app pwd null pstmt set string 2 app pwd pstmt set string 3 secure engine encrypt app pwd execute a query result set rs pstmt execute query if rs next no record found if force env set context m ctx ad user name system env set context m ctx ad user id 0 env set context m ctx ad user description system forced login env set context m ctx user level s format sco env set context m ctx user client 0 format c1 c2 env set context m ctx user org 0 format o1 o2 rs close pstmt close ret value new key name pair new key name pair 0 system administrator return ret value else rs close pstmt close log save error user pwd error app user false return null env set context m ctx ad user name app user env set context m ctx ad user id rs get int 1 env set context m ctx salesrep id rs get int 1 ini set property ini p uid app user if ini is property bool ini p store pwd ini set property ini p pwd app pwd m connectionprofile rs get string 4 user based if m connectionprofile null c connection cc c connection get if cc get connection profile equals m connectionprofile cc set connection profile m connectionprofile ini set property ini p connection cc to string long ini save properties false do read all roles int ad role id rs get int 2 if ad role id 0 env set context m ctx sys admin y string name rs get string 3 key name pair p new key name pair ad role id name list add p while rs next rs close pstmt close pstmt null ret value new key name pair list size list to array ret value log fine user app user roles ret value length catch sql exception ex log log level severe sql to string ex log save error db login ex ret value null try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value app_user app_pwd nodatabase userpwderror dblogin keynamepair getroles app_user app_pwd app_user currenttimemillis app_user msystem msystem m_ctx app_user app_pwd app_pwd ad_user app_pwd app_pwd keynamepair retvalue arraylist keynamepair arraylist keynamepair stringbuffer stringbuffer ad_user_id ad_role_id connectionprofile ad_user ad_user_roles ad_user_id ad_user_id isactive ad_role ad_role_id ad_role_id isactive ldapuser isactive ad_client ad_client_id ad_client_id isactive app_pwd preparedstatement preparestatement tostring setstring app_user app_pwd setstring app_pwd setstring secureengine app_pwd resultset executequery setcontext m_ctx ad_user_name setcontext m_ctx ad_user_id setcontext m_ctx ad_user_description setcontext m_ctx user_level setcontext m_ctx user_client setcontext m_ctx user_org retvalue keynamepair keynamepair retvalue saveerror userpwderror app_user setcontext m_ctx ad_user_name app_user setcontext m_ctx ad_user_id getint setcontext m_ctx salesrep_id getint setproperty p_uid app_user ispropertybool p_store_pwd setproperty p_pwd app_pwd m_connectionprofile getstring m_connectionprofile cconnection cconnection getconnectionprofile m_connectionprofile setconnectionprofile m_connectionprofile setproperty p_connection tostringlong saveproperties ad_role_id getint ad_role_id setcontext m_ctx sysadmin getstring keynamepair keynamepair ad_role_id retvalue keynamepair toarray retvalue app_user retvalue sqlexception tostring saveerror dblogin retvalue retvalue load clients p sets role info in context and loads its clients param role role information return list of valid client key node pairs or null if in error public key name pair get clients key name pair role if role null throw new illegal argument exception role missing s log fine load clients role role to stringx array list key name pair list new array list key name pair key name pair ret value null string sql select distinct r user level r connection profile 1 2 c ad client id c name 3 4 from ad role r inner join ad client c on r ad client id c ad client id where r ad role id 1 and r is active y and c is active y prepared statement pstmt null get role details try pstmt db prepare statement sql null pstmt set int 1 role get key result set rs pstmt execute query if rs next rs close pstmt close log log level severe no clients for role role to stringx return null role info env set context m ctx ad role id role get key env set context m ctx ad role name role get name ini set property ini p role role get name user level env set context m ctx user level rs get string 1 format sco connection profile c connection cc c connection get if m connectionprofile null no user based m connectionprofile rs get string 2 role based if m connectionprofile null cc get connection profile equals m connectionprofile cc set connection profile m connectionprofile ini set property ini p connection cc to string long ini save properties false load clients do int ad client id rs get int 3 string name rs get string 4 key name pair p new key name pair ad client id name list add p while rs next rs close pstmt close pstmt null ret value new key name pair list size list to array ret value log fine role role to stringx clients ret value length catch sql exception ex log log level severe sql ex ret value null try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value keynodepairs keynamepair getclients keynamepair illegalargumentexception s_log loadclients tostringx arraylist keynamepair arraylist keynamepair keynamepair retvalue userlevel connectionprofile ad_client_id ad_role ad_client ad_client_id ad_client_id ad_role_id isactive isactive preparedstatement preparestatement setint getkey resultset executequery tostringx setcontext m_ctx ad_role_id getkey setcontext m_ctx ad_role_name getname setproperty p_role getname setcontext m_ctx user_level getstring connectionprofile cconnection cconnection m_connectionprofile m_connectionprofile getstring m_connectionprofile getconnectionprofile m_connectionprofile setconnectionprofile m_connectionprofile setproperty p_connection tostringlong saveproperties ad_client_id getint getstring keynamepair keynamepair ad_client_id retvalue keynamepair toarray retvalue tostringx retvalue sqlexception retvalue retvalue load organizations p sets client info in context and loads its organization the role has access to param client client information return list of valid org key node pairs or null if in error public key name pair get orgs key name pair client if client null throw new illegal argument exception client missing if env get context m ctx ad role id length 0 could be number 0 throw new unsupported operation exception missing context ad role id int ad role id env get context as int m ctx ad role id int ad user id env get context as int m ctx ad user id s log fine client client to stringx ad role id ad role id get client details for role array list key name pair list new array list key name pair key name pair ret value null string sql select o ad org id o name o is summary 1 3 from ad role r ad client c inner join ad org o on c ad client id o ad client id or o ad org id 0 where r ad role id 1 and c ad client id 2 and o is active y and r is access all orgs y or r is use user org access n and o ad org id in select ad org id from ad role orgaccess ra where ra ad role id r ad role id and ra is active y or r is use user org access y and o ad org id in select ad org id from ad user orgaccess ua where ua ad user id and ua is active y 3 order by o name prepared statement pstmt null m role role null try pstmt db prepare statement sql null pstmt set int 1 ad role id pstmt set int 2 client get key pstmt set int 3 ad user id result set rs pstmt execute query load orgs while rs next int ad org id rs get int 1 string name rs get string 2 boolean summary y equals rs get string 3 if summary if role null role m role get m ctx ad role id get orgs add summary list ad org id name role else key name pair p new key name pair ad org id name if list contains p list add p rs close pstmt close pstmt null ret value new key name pair list size list to array ret value log fine client client to stringx ad role id ad role id ad user id ad user id orgs ret value length catch sql exception ex log log level severe sql ex ret value null try if pstmt null pstmt close pstmt null catch exception e pstmt null no orgs if ret value null ret value length 0 log log level warning no org for client client to stringx ad role id ad role id ad user id ad user id return null client info env set context m ctx ad client id client get key env set context m ctx ad client name client get name ini set property ini p client client get name return ret value keynodepairs keynamepair getorgs keynamepair illegalargumentexception getcontext m_ctx ad_role_id unsupportedoperationexception ad_role_id ad_role_id getcontextasint m_ctx ad_role_id ad_user_id getcontextasint m_ctx ad_user_id s_log tostringx ad_role_id ad_role_id arraylist keynamepair arraylist keynamepair keynamepair retvalue ad_org_id issummary ad_role ad_client ad_org ad_client_id ad_client_id ad_org_id ad_role_id ad_client_id isactive isaccessallorgs isuseuserorgaccess ad_org_id ad_org_id ad_role_orgaccess ad_role_id ad_role_id isactive isuseuserorgaccess ad_org_id ad_org_id ad_user_orgaccess ad_user_id isactive preparedstatement mrole preparestatement setint ad_role_id setint getkey setint ad_user_id resultset executequery ad_org_id getint getstring getstring mrole m_ctx ad_role_id getorgsaddsummary ad_org_id keynamepair keynamepair ad_org_id retvalue keynamepair toarray retvalue tostringx ad_role_id ad_role_id ad_user_id ad_user_id retvalue sqlexception retvalue retvalue retvalue tostringx ad_role_id ad_role_id ad_user_id ad_user_id setcontext m_ctx ad_client_id getkey setcontext m_ctx ad_client_name getname setproperty p_client getname retvalue get orgs add summary org param list list param summary org id summary org param summary name name param role role see org compiere model m role load org access add private void get orgs add summary array list key name pair list int summary org id string summary name m role role if role null log warning summary org summary name summary org id no role return do we look for trees if role getad tree org id 0 log config summary org summary name summary org id no org tree role return summary org get dependents mtree base tree mtree base get m ctx role getad tree org id null string sql select ad client id ad org id name is summary from ad org where is active y and ad org id in select node id from tree get node table name where ad tree id and parent id and is active y order by name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 tree getad tree id pstmt set int 2 summary org id result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 string name rs get string 3 boolean summary y equals rs get string 4 if summary get orgs add summary list ad org id name role else key name pair p new key name pair ad org id name if list contains p list add p rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null summary_org_id summary_name mrole loadorgaccessadd getorgsaddsummary arraylist keynamepair summary_org_id summary_name mrole summary_name summary_org_id getad_tree_org_id summary_name summary_org_id mtree_base mtree_base m_ctx getad_tree_org_id ad_client_id ad_org_id issummary ad_org isactive ad_org_id node_id getnodetablename ad_tree_id parent_id isactive preparedstatement preparestatement setint getad_tree_id setint summary_org_id resultset executequery ad_client_id getint ad_org_id getint getstring getstring getorgsaddsummary ad_org_id keynamepair keynamepair ad_org_id load warehouses param org organization return array of warehouse info public key name pair get warehouses key name pair org if org null throw new illegal argument exception org missing s log info load warehouses org org to stringx array list key name pair list new array list key name pair key name pair ret value null string sql select m warehouse id name from m warehouse where ad org id and is active y order by name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 org get key result set rs pstmt execute query if rs next rs close pstmt close log info no warehouses for org org to stringx return null load warehousess do int ad warehouse id rs get int 1 string name rs get string 2 key name pair p new key name pair ad warehouse id name list add p while rs next rs close pstmt close pstmt null ret value new key name pair list size list to array ret value log fine org org to stringx warehouses ret value length catch sql exception ex log log level severe get warehouses ex ret value null try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value keynamepair getwarehouses keynamepair illegalargumentexception s_log loadwarehouses tostringx arraylist keynamepair arraylist keynamepair keynamepair retvalue m_warehouse_id m_warehouse ad_org_id isactive preparedstatement preparestatement setint getkey resultset executequery tostringx ad_warehouse_id getint getstring keynamepair keynamepair ad_warehouse_id retvalue keynamepair toarray retvalue tostringx retvalue sqlexception getwarehouses retvalue retvalue validate login param org log in org return error message public string validate login key name pair org int ad client id env getad client id m ctx int ad org id org get key int ad role id env getad role id m ctx int ad user id env getad user id m ctx string error model validation engine get login complete ad client id ad org id ad role id ad user id if error null error length 0 log severe refused error return error return null validatelogin keynamepair ad_client_id getad_client_id m_ctx ad_org_id getkey ad_role_id getad_role_id m_ctx ad_user_id getad_user_id m_ctx modelvalidationengine logincomplete ad_client_id ad_org_id ad_role_id ad_user_id load preferences into context for selected client p sets org info in context and loads relevant field from ad client info c acctschema c acctschema elements ad preference p assumes that the context is set for ad client id ad user id ad role id param org org information param warehouse optional warehouse information param timestamp optional date param printer name optional printer info return ad message of error no valid acct info or public string load preferences key name pair org key name pair warehouse java sql timestamp timestamp string printer name log info org org to stringx if m ctx null org null throw new illegal argument exception required parameter missing if env get context m ctx ad client id length 0 throw new unsupported operation exception missing comtext ad client id if env get context m ctx ad user id length 0 throw new unsupported operation exception missing comtext ad user id if env get context m ctx ad role id length 0 throw new unsupported operation exception missing comtext ad role id org info assumes that it is valid env set context m ctx ad org id org get key env set context m ctx ad org name org get name ini set property ini p org org get name warehouse info if warehouse null env set context m ctx m warehouse id warehouse get key ini set property ini p warehouse warehouse get name date default today long today system current time millis if timestamp null today timestamp get time env set context m ctx date new java sql timestamp today optional printer if printer name null printer name env set context m ctx printer printer name ini set property ini p printer printer name load role info m role get default m ctx true other env set auto commit m ctx ini is property bool ini p a commit env set auto new m ctx ini is property bool ini p a new if m role get default m ctx false is show acct env set context m ctx show acct ini get property ini p show acct else env set context m ctx show acct n env set context m ctx show trl ini get property ini p show trl env set context m ctx show advanced ini get property ini p show advanced string ret value int ad client id env get context as int m ctx ad client id int ad org id org get key int ad user id env get context as int m ctx ad user id int ad role id env get context as int m ctx ad role id other settings env set context m ctx yyyy y env set context m ctx std precision 2 account schema info first string sql select from c acctschema a ad clientinfo c where a c acctschema id c c acctschema1 id and c ad client id prepared statement pstmt null try int c acctschema id 0 pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next no warning for system if ad role id 0 ret value no valid acct info else accounting info c acctschema id rs get int c acctschema id env set context m ctx c acctschema id c acctschema id env set context m ctx c currency id rs get int c currency id env set context m ctx has alias rs get string has alias rs close pstmt close accounting elements sql select element type from c acctschema element where c acctschema id and is active y pstmt db prepare statement sql null pstmt set int 1 c acctschema id rs pstmt execute query while rs next env set context m ctx element rs get string element type y rs close pstmt close this reads all relevant window neutral defaults overwriting superseeded ones window specific is read in mainain sql select attribute value ad window id from ad preference where ad client id in 0 ad client id and ad org id in 0 ad org id and ad user id is null or ad user id 0 or ad user id ad user id and is active y order by attribute ad client id ad user id desc ad org id the last one overwrites system client user org window sql env parse context m ctx 0 sql false if sql length 0 log log level severe load preferences missing environment else pstmt db prepare statement sql null rs pstmt execute query while rs next int ad window id rs get int 3 string at if rs was null at p rs get string 1 else at p ad window id rs get string 1 string va rs get string 2 env set context m ctx at va rs close pstmt close default values log info default values sql select t table name c column name from ad column c inner join ad table t on c ad table id t ad table id where c is key y and t is active y and exists select from ad column cc where column name is default and t ad table id cc ad table id and cc is active y pstmt db prepare statement sql null rs pstmt execute query while rs next load default rs get string 1 rs get string 2 rs close pstmt close pstmt null catch sql exception e log log level severe load preferences e try if pstmt null pstmt close pstmt null catch exception e pstmt null ini save properties ini is client country env set context m ctx c country id m country get default m ctx getc country id return ret value ad_client c_acctschema c_acctschema_elements ad_preference ad_client_id ad_user_id ad_role_id printername ad_message novalidacctinfo loadpreferences keynamepair keynamepair printername tostringx m_ctx illegalargumentexception getcontext m_ctx ad_client_id unsupportedoperationexception ad_client_id getcontext m_ctx ad_user_id unsupportedoperationexception ad_user_id getcontext m_ctx ad_role_id unsupportedoperationexception ad_role_id setcontext m_ctx ad_org_id getkey setcontext m_ctx ad_org_name getname setproperty p_org getname setcontext m_ctx m_warehouse_id getkey setproperty p_warehouse getname currenttimemillis gettime setcontext m_ctx printername printername setcontext m_ctx printername setproperty p_printer printername mrole getdefault m_ctx setautocommit m_ctx ispropertybool p_a_commit setautonew m_ctx ispropertybool p_a_new mrole getdefault m_ctx isshowacct setcontext m_ctx showacct getproperty p_show_acct setcontext m_ctx showacct setcontext m_ctx showtrl getproperty p_show_trl setcontext m_ctx showadvanced getproperty p_show_advanced retvalue ad_client_id getcontextasint m_ctx ad_client_id ad_org_id getkey ad_user_id getcontextasint m_ctx ad_user_id ad_role_id getcontextasint m_ctx ad_role_id setcontext m_ctx setcontext m_ctx stdprecision accountschema c_acctschema ad_clientinfo c_acctschema_id c_acctschema1_id ad_client_id preparedstatement c_acctschema_id preparestatement setint ad_client_id resultset executequery ad_role_id retvalue novalidacctinfo c_acctschema_id getint c_acctschema_id setcontext m_ctx c_acctschema_id c_acctschema_id setcontext m_ctx c_currency_id getint c_currency_id setcontext m_ctx hasalias getstring hasalias elementtype c_acctschema_element c_acctschema_id isactive preparestatement setint c_acctschema_id executequery setcontext m_ctx element_ getstring elementtype ad_window_id ad_preference ad_client_id ad_client_id ad_org_id ad_org_id ad_user_id ad_user_id ad_user_id ad_user_id isactive ad_client_id ad_user_id ad_org_id parsecontext m_ctx loadpreferences preparestatement executequery ad_window_id getint wasnull getstring ad_window_id getstring getstring setcontext m_ctx tablename columnname ad_column ad_table ad_table_id ad_table_id iskey isactive ad_column columnname isdefault ad_table_id ad_table_id isactive preparestatement executequery loaddefault getstring getstring sqlexception loadpreferences saveproperties isclient setcontext m_ctx c_country_id mcountry getdefault m_ctx getc_country_id retvalue load default value for table into context param table name table name param column name column name private void load default string table name string column name if table name starts with ad window table name starts with ad printformat table name starts with ad workflow return string value null string sql select column name from table name most specific first where is default y and is active y order by ad client id desc ad org id desc sql m role get default m ctx false add accesssql sql table name m role sql notqualified m role sql ro prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next value rs get string 1 rs close pstmt close pstmt null catch sql exception e log log level severe table name sql e return try if pstmt null pstmt close pstmt null catch exception e pstmt null set context value if value null value length 0 if table name equals c doctype env set context m ctx c doctypetarget id value else env set context m ctx column name value tablename columnname loaddefault tablename columnname tablename startswith ad_window tablename startswith ad_printformat tablename startswith ad_workflow columnname tablename isdefault isactive ad_client_id ad_org_id mrole getdefault m_ctx addaccesssql tablename mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery getstring sqlexception tablename tablename c_doctype setcontext m_ctx c_doctypetarget_id setcontext m_ctx columnname batch login using ini values code compiere startup true ini set property ini p uid super user ini set property ini p pwd system ini set property ini p role garden admin ini set property ini p client garden world ini set property ini p org hq ini set property ini p warehouse hq ini set property ini p language english ini set property ini p printer my printer login login new login env get ctx login batch login code param login date optional login date return true if logged in using ini values public boolean batch login java sql timestamp login date user login string uid ini get property ini p uid string pwd ini get property ini p pwd key name pair roles get roles uid pwd if roles null roles length 0 log severe user password invalid uid return false log info user uid role string role ini get property ini p role key name pair rolepp null for int i 0 i roles length i key name pair pair roles i if pair get name equals ignore case role rolepp pair break if rolepp null log severe role invalid role for int i 0 i roles length i log info option roles i return false log info role role clients string client ini get property ini p client key name pair clients get clients rolepp if clients null clients length 0 log severe no clients for role role return false key name pair clientpp null for int i 0 i clients length i key name pair pair clients i if pair get name equals ignore case client clientpp pair break if clientpp null log severe client invalid client for int i 0 i clients length i log info option clients i return false organization string org ini get property ini p org key name pair orgs get orgs clientpp if orgs null orgs length 0 log severe no orgs for client client return false key name pair orgpp null for int i 0 i orgs length i key name pair pair orgs i if pair get name equals ignore case org orgpp pair break if orgpp null log severe org invalid org for int i 0 i orgs length i log info option orgs i return false string error validate login orgpp if error null error length 0 return false warehouse string wh ini get property ini p warehouse key name pair whs get warehouses orgpp if whs null whs length 0 log severe no warehouses for org org return false key name pair whpp null for int i 0 i whs length i key name pair pair whs i if pair get name equals ignore case wh whpp pair break if whpp null log severe warehouse invalid wh for int i 0 i whs length i log info option whs i return false language string lang name ini get property ini p language language language language get language lang name language set login language language env verify language m ctx language env set context m ctx env language language getad language locale loc language get locale locale set default loc msg get msg m ctx 0 preferences string printer name ini get property ini p printer if login date null login date new java sql timestamp system current time millis load preferences orgpp whpp login date printer name log info complete return true setproperty p_uid superuser setproperty p_pwd setproperty p_role gardenadmin setproperty p_client setproperty p_org setproperty p_warehouse setproperty p_language setproperty p_printer myprinter getctx batchlogin logindate batchlogin logindate getproperty p_uid getproperty p_pwd keynamepair getroles getproperty p_role keynamepair keynamepair getname equalsignorecase getproperty p_client keynamepair getclients keynamepair keynamepair getname equalsignorecase getproperty p_org keynamepair getorgs keynamepair keynamepair getname equalsignorecase validatelogin getproperty p_warehouse keynamepair getwarehouses keynamepair keynamepair getname equalsignorecase langname getproperty p_language getlanguage langname setloginlanguage verifylanguage m_ctx setcontext m_ctx getad_language getlocale setdefault getmsg m_ctx printername getproperty p_printer logindate logindate currenttimemillis loadpreferences logindate printername batch login with system date return true if logged in public boolean batch login return batch login new java sql timestamp system current time millis batchlogin batchlogin currenttimemillis create new order by copying param from order param date doc date of the document date param c doctypetarget id target document type param isso trx sales order param counter create counter links param copyasi copy line attributes attribute set instance resaouce assignment param trx name trx return order public static m order copy from m order from timestamp date doc int c doctypetarget id boolean isso trx boolean counter boolean copyasi string trx name m order to new m order from get ctx 0 trx name to set trxname trx name po copy values from to from getad client id from getad org id to set valuenocheck c order id i zero to set valuenocheck document no null to set doc status docstatus drafted draft to set doc action docaction complete to setc doctype id 0 to setc doctypetarget id c doctypetarget id to set isso trx isso trx to set is selected false to set date ordered date doc to set date acct date doc to set date promised date doc assumption to set date printed null to set is printed false to set is approved false to set is credit approved false to setc payment id 0 to setc cashline id 0 amounts are updated when adding lines to set grand total env zero to set total lines env zero to set is delivered false to set is invoiced false to set is self service false to set is transferred false to set posted false to set processed false if counter to setref order id from getc order id else to setref order id 0 if to save trx name throw new illegal state exception could not create order if counter from setref order id to getc order id if to copy lines from from counter copyasi 0 throw new illegal state exception could not create order lines return to datedoc c_doctypetarget_id issotrx trxname morder copyfrom morder datedoc c_doctypetarget_id issotrx trxname morder morder getctx trxname set_trxname trxname copyvalues getad_client_id getad_org_id set_valuenocheck c_order_id i_zero set_valuenocheck documentno setdocstatus docstatus_drafted setdocaction docaction_complete setc_doctype_id setc_doctypetarget_id c_doctypetarget_id setissotrx issotrx setisselected setdateordered datedoc setdateacct datedoc setdatepromised datedoc setdateprinted setisprinted setisapproved setiscreditapproved setc_payment_id setc_cashline_id setgrandtotal settotallines setisdelivered setisinvoiced setisselfservice setistransferred setposted setprocessed setref_order_id getc_order_id setref_order_id trxname illegalstateexception setref_order_id getc_order_id copylinesfrom illegalstateexception default constructor param ctx context param c order id order to load 0 create new order param trx name trx name public m order properties ctx int c order id string trx name super ctx c order id trx name new if c order id 0 set doc status docstatus drafted set doc action docaction prepare set delivery rule deliveryrule availability set freight cost rule freightcostrule freightincluded set invoice rule invoicerule immediate set payment rule paymentrule oncredit set priority rule priorityrule medium set delivery via rule deliveryviarule pickup set is discount printed false set is selected false set is tax included false set isso trx true set is drop ship false set sende mail false set is approved false set is printed false set is credit approved false set is delivered false set is invoiced false set is transferred false set is self service false super set processed false set processing false set posted false set date acct new timestamp system current time millis set date promised new timestamp system current time millis set date ordered new timestamp system current time millis set freight amt env zero set charge amt env zero set total lines env zero set grand total env zero c_order_id trxname morder c_order_id trxname c_order_id trxname c_order_id setdocstatus docstatus_drafted setdocaction docaction_prepare setdeliveryrule deliveryrule_availability setfreightcostrule freightcostrule_freightincluded setinvoicerule invoicerule_immediate setpaymentrule paymentrule_oncredit setpriorityrule priorityrule_medium setdeliveryviarule deliveryviarule_pickup setisdiscountprinted setisselected setistaxincluded setissotrx setisdropship setsendemail setisapproved setisprinted setiscreditapproved setisdelivered setisinvoiced setistransferred setisselfservice setprocessed setprocessing setposted setdateacct currenttimemillis setdatepromised currenttimemillis setdateordered currenttimemillis setfreightamt setchargeamt settotallines setgrandtotal project constructor param project project to create order from param doc sub typeso if so doc type target default docsubtypeso oncredit public m order m project project boolean isso trx string doc sub typeso this project get ctx 0 project get trxname setad client id project getad client id setad org id project getad org id setc campaign id project getc campaign id setsalesrep id project getsalesrep id setc project id project getc project id set description project get name timestamp ts project get date contract if ts null set date ordered ts ts project get date finish if ts null set date promised ts setc bpartner id project getc bpartner id setc bpartner location id project getc bpartner location id setad user id project getad user id setm warehouse id project getm warehouse id setm pricelist id project getm pricelist id setc paymentterm id project getc paymentterm id set isso trx isso trx if isso trx if doc sub typeso null doc sub typeso length 0 setc doctypetarget id docsubtypeso oncredit else setc doctypetarget id doc sub typeso else setc doctypetarget id docsubtypeso doctype docsubtypeso_oncredit morder mproject issotrx docsubtypeso getctx get_trxname setad_client_id getad_client_id setad_org_id getad_org_id setc_campaign_id getc_campaign_id setsalesrep_id getsalesrep_id setc_project_id getc_project_id setdescription getname getdatecontract setdateordered getdatefinish setdatepromised setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id setm_warehouse_id getm_warehouse_id setm_pricelist_id getm_pricelist_id setc_paymentterm_id getc_paymentterm_id setissotrx issotrx issotrx docsubtypeso docsubtypeso setc_doctypetarget_id docsubtypeso_oncredit setc_doctypetarget_id docsubtypeso setc_doctypetarget_id load constructor param ctx context param rs result set record public m order properties ctx result set rs string trx name super ctx rs trx name morder resultset trxname trxname overwrite client org if required param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription set business partner ship bill param c bpartner id bpartner public void setc bpartner id int c bpartner id super setc bpartner id c bpartner id super setbill bpartner id c bpartner id c_bpartner_id setc_bpartner_id c_bpartner_id setc_bpartner_id c_bpartner_id setbill_bpartner_id c_bpartner_id set business partner location ship bill param c bpartner location id bp location public void setc bpartner location id int c bpartner location id super setc bpartner location id c bpartner location id super setbill location id c bpartner location id c_bpartner_location_id setc_bpartner_location_id c_bpartner_location_id setc_bpartner_location_id c_bpartner_location_id setbill_location_id c_bpartner_location_id set business partner contact ship bill param ad user id user public void setad user id int ad user id super setad user id ad user id super setbill user id ad user id ad_user_id setad_user_id ad_user_id setad_user_id ad_user_id setbill_user_id ad_user_id set ship business partner param c bpartner id bpartner public void setship bpartner id int c bpartner id super setc bpartner id c bpartner id c_bpartner_id setship_bpartner_id c_bpartner_id setc_bpartner_id c_bpartner_id set ship business partner location param c bpartner location id bp location public void setship location id int c bpartner location id super setc bpartner location id c bpartner location id c_bpartner_location_id setship_location_id c_bpartner_location_id setc_bpartner_location_id c_bpartner_location_id set ship business partner contact param ad user id user public void setship user id int ad user id super setad user id ad user id ad_user_id setship_user_id ad_user_id setad_user_id ad_user_id set warehouse param m warehouse id warehouse public void setm warehouse id int m warehouse id super setm warehouse id m warehouse id m_warehouse_id setm_warehouse_id m_warehouse_id setm_warehouse_id m_warehouse_id set drop ship param is drop ship drop ship public void set is drop ship boolean is drop ship super set is drop ship is drop ship isdropship setisdropship isdropship setisdropship isdropship set target sales document type param docsubtypeso x so sub type see docsubtypeso public void setc doctypetarget id string docsubtypeso x string sql select c doctype id from c doctype where ad client id and ad org id in 0 getad org id and doc sub typeso order by ad org id desc is default desc int c doctype id db getsql value null sql getad client id docsubtypeso x if c doctype id 0 log severe not found for ad client id getad client id sub type docsubtypeso x else log fine so docsubtypeso x setc doctypetarget id c doctype id set isso trx true docsubtypeso_x docsubtypeso_ setc_doctypetarget_id docsubtypeso_x c_doctype_id c_doctype ad_client_id ad_org_id getad_org_id docsubtypeso ad_org_id isdefault c_doctype_id getsqlvalue getad_client_id docsubtypeso_x c_doctype_id ad_client_id getad_client_id subtype docsubtypeso_x docsubtypeso_x setc_doctypetarget_id c_doctype_id setissotrx set target document type standard order or po public void setc doctypetarget id if isso trx so std order setc doctypetarget id docsubtypeso standard return po string sql select c doctype id from c doctype where ad client id and ad org id in 0 getad org id and doc base type poo order by ad org id desc is default desc int c doctype id db getsql value null sql getad client id if c doctype id 0 log severe no poo found for ad client id getad client id else log fine po c doctype id setc doctypetarget id c doctype id setc_doctypetarget_id issotrx setc_doctypetarget_id docsubtypeso_standard c_doctype_id c_doctype ad_client_id ad_org_id getad_org_id docbasetype ad_org_id isdefault c_doctype_id getsqlvalue getad_client_id c_doctype_id ad_client_id getad_client_id c_doctype_id setc_doctypetarget_id c_doctype_id set business partner defaults details so trx should be set param bp business partner public void setb partner mb partner bp if bp null return setc bpartner id bp getc bpartner id defaults payment term int ii 0 if isso trx ii bp getc paymentterm id else ii bp getpo paymentterm id if ii 0 setc paymentterm id ii default price list if isso trx ii bp getm pricelist id else ii bp getpo pricelist id if ii 0 setm pricelist id ii default delivery via rule string ss bp get delivery rule if ss null set delivery rule ss ss bp get delivery via rule if ss null set delivery via rule ss default invoice payment rule ss bp get invoice rule if ss null set invoice rule ss ss bp get payment rule if ss null set payment rule ss sales rep ii bp getsalesrep id if ii 0 setsalesrep id ii set locations mb partner location locs bp get locations false if locs null for int i 0 i locs length i if locs i is ship to super setc bpartner location id locs i getc bpartner location id if locs i is bill to setbill location id locs i getc bpartner location id set to first if getc bpartner location id 0 locs length 0 super setc bpartner location id locs 0 getc bpartner location id if getbill location id 0 locs length 0 setbill location id locs 0 getc bpartner location id if getc bpartner location id 0 log log level severe m order setb partner has no ship to address bp if getbill location id 0 log log level severe m order setb partner has no bill to address bp set contact m user contacts bp get contacts false if contacts null contacts length 1 setad user id contacts 0 getad user id sotrx setbpartner mbpartner setc_bpartner_id getc_bpartner_id issotrx getc_paymentterm_id getpo_paymentterm_id setc_paymentterm_id issotrx getm_pricelist_id getpo_pricelist_id setm_pricelist_id getdeliveryrule setdeliveryrule getdeliveryviarule setdeliveryviarule getinvoicerule setinvoicerule getpaymentrule setpaymentrule getsalesrep_id setsalesrep_id mbpartnerlocation getlocations isshipto setc_bpartner_location_id getc_bpartner_location_id isbillto setbill_location_id getc_bpartner_location_id getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id getbill_location_id setbill_location_id getc_bpartner_location_id getc_bpartner_location_id morder setbpartner getbill_location_id morder setbpartner muser getcontacts setad_user_id getad_user_id copy lines from other order param other order order param counter set counter info param copyasi copy line attributes attribute set instance resaouce assignment return number of lines copied public int copy lines from m order other order boolean counter boolean copyasi if is processed is posted other order null return 0 m order line from lines other order get lines false null int count 0 for int i 0 i from lines length i m order line line new m order line this po copy values from lines i line getad client id getad org id line setc order id getc order id line set order this line set valuenocheck c orderline id i zero new references if copyasi line setm attributesetinstance id 0 line sets resourceassignment id 0 if counter line setref orderline id from lines i getc orderline id else line setref orderline id 0 line set qty delivered env zero line set qty invoiced env zero line set qty reserved env zero line set date delivered null line set date invoiced null tax if getc bpartner id other order getc bpartner id line set tax recalculate line set processed false if line save get trxname count cross link if counter from lines i setref orderline id line getc orderline id from lines i save get trxname if from lines length count log log level severe line difference from from lines length saved count return count otherorder copylinesfrom morder otherorder isprocessed isposted otherorder morderline fromlines otherorder getlines fromlines morderline morderline copyvalues fromlines getad_client_id getad_org_id setc_order_id getc_order_id setorder set_valuenocheck c_orderline_id i_zero setm_attributesetinstance_id sets_resourceassignment_id setref_orderline_id fromlines getc_orderline_id setref_orderline_id setqtydelivered setqtyinvoiced setqtyreserved setdatedelivered setdateinvoiced getc_bpartner_id otherorder getc_bpartner_id settax setprocessed get_trxname fromlines setref_orderline_id getc_orderline_id fromlines get_trxname fromlines fromlines string representation return info public string to string string buffer sb new string buffer m order append get id append append get document no append isso trx append isso trx append c doctype id append getc doctype id append return sb to string tostring stringbuffer stringbuffer morder get_id getdocumentno issotrx issotrx c_doctype_id getc_doctype_id tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine order getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id set price list and currency tax included when valid param m pricelist id price list public void setm pricelist id int m pricelist id m price list pl m price list get get ctx m pricelist id null if pl get id m pricelist id super setm pricelist id m pricelist id setc currency id pl getc currency id set is tax included pl is tax included taxincluded m_pricelist_id setm_pricelist_id m_pricelist_id mpricelist mpricelist getctx m_pricelist_id get_id m_pricelist_id setm_pricelist_id m_pricelist_id setc_currency_id getc_currency_id setistaxincluded istaxincluded get lines of order param where clause where clause or null starting with and return lines public m order line get lines string where clause string order clause array list m order line list new array list m order line string buffer sql new string buffer select from c orderline where c order id if where clause null sql append where clause if order clause null sql append append order clause prepared statement pstmt null try pstmt db prepare statement sql to string get trxname pstmt set int 1 getc order id result set rs pstmt execute query while rs next m order line ol new m order line get ctx rs get trxname ol set header info this list add ol rs close pstmt close pstmt null catch exception e log log level severe sql to string e finally try if pstmt null pstmt close catch exception e pstmt null m order line lines new m order line list size list to array lines return lines whereclause morderline getlines whereclause orderclause arraylist morderline arraylist morderline stringbuffer stringbuffer c_orderline c_order_id whereclause whereclause orderclause orderclause preparedstatement preparestatement tostring get_trxname setint getc_order_id resultset executequery morderline morderline getctx get_trxname setheaderinfo tostring morderline morderline toarray get lines of order param requery requery param order by optional order by column return lines public m order line get lines boolean requery string order by if m lines null requery return m lines string order clause order by if order by null order by length 0 order clause order by else order clause line m lines get lines null order clause return m lines orderby morderline getlines orderby m_lines m_lines orderclause orderby orderby orderclause orderby orderclause m_lines getlines orderclause m_lines get lines of order useb by web store return lines public m order line get lines return get lines false null morderline getlines getlines renumber lines param step start and step public void renumber lines int step int number step m order line lines get lines true null line is default for int i 0 i lines length i m order line line lines i line set line number line save get trxname number step m lines null renumberlines morderline getlines morderline setline get_trxname m_lines does the order line belong to this order param c orderline id line return true if part of the order public boolean is order line int c orderline id if m lines null get lines for int i 0 i m lines length i if m lines i getc orderline id c orderline id return true return false c_orderline_id isorderline c_orderline_id m_lines getlines m_lines m_lines getc_orderline_id c_orderline_id get taxes of order param requery requery return array of taxes public m order tax get taxes boolean requery if m taxes null requery return m taxes array list m order tax list new array list m order tax string sql select from c ordertax where c order id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc order id result set rs pstmt execute query while rs next list add new m order tax get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get taxes e finally try if pstmt null pstmt close catch exception e pstmt null m taxes new m order tax list size list to array m taxes return m taxes mordertax gettaxes m_taxes m_taxes arraylist mordertax arraylist mordertax c_ordertax c_order_id preparedstatement preparestatement get_trxname setint getc_order_id resultset executequery mordertax getctx get_trxname gettaxes m_taxes mordertax toarray m_taxes m_taxes get invoices of order return invoices public m invoice get invoices array list m invoice list new array list m invoice string sql select from c invoice where c order id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc order id result set rs pstmt execute query while rs next list add new m invoice get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get invoices e finally try if pstmt null pstmt close catch exception e pstmt null m invoice ret value new m invoice list size list to array ret value return ret value minvoice getinvoices arraylist minvoice arraylist minvoice c_invoice c_order_id preparedstatement preparestatement get_trxname setint getc_order_id resultset executequery minvoice getctx get_trxname getinvoices minvoice retvalue minvoice toarray retvalue retvalue get latest invoice of order return invoice id or 0 public int getc invoice id int c invoice id 0 array list list new array list string sql select c invoice id from c invoice where c order id and doc status in co cl order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc order id result set rs pstmt execute query if rs next c invoice id rs get int 1 rs close pstmt close pstmt null catch exception e log log level severe getc invoice id e finally try if pstmt null pstmt close catch exception e pstmt null return c invoice id getc_invoice_id c_invoice_id arraylist arraylist c_invoice_id c_invoice c_order_id docstatus preparedstatement preparestatement get_trxname setint getc_order_id resultset executequery c_invoice_id getint getc_invoice_id c_invoice_id get shipments of order return shipments public m in out get shipments array list m in out list new array list m in out string sql select from m inout where c order id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc order id result set rs pstmt execute query while rs next list add new m in out get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get shipments e finally try if pstmt null pstmt close catch exception e pstmt null m in out ret value new m in out list size list to array ret value return ret value minout getshipments arraylist minout arraylist minout m_inout c_order_id preparedstatement preparestatement get_trxname setint getc_order_id resultset executequery minout getctx get_trxname getshipments minout retvalue minout toarray retvalue retvalue get iso code of currency return currency iso public string get currencyiso return m currency getiso code get ctx getc currency id getcurrencyiso mcurrency getiso_code getctx getc_currency_id get currency precision return precision public int get precision return m currency get std precision get ctx getc currency id getprecision mcurrency getstdprecision getctx getc_currency_id get document status return document status clear text public string get doc status name return m ref list get list name get ctx 131 get doc status getdocstatusname mreflist getlistname getctx getdocstatus set doc action param doc action doc action public void set doc action string doc action set doc action doc action false docaction docaction setdocaction docaction setdocaction docaction set doc action param doc action doc oction param force creation force creation public void set doc action string doc action boolean force creation super set doc action doc action m forcecreation force creation docaction docaction forcecreation setdocaction docaction forcecreation setdocaction docaction m_forcecreation forcecreation set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string set set processed processed y n where c order id getc order id int no line db execute update update c orderline set get trxname int no tax db execute update update c ordertax set get trxname m lines null m taxes null log fine set processed processed lines no line tax no tax setprocessed setprocessed get_id c_order_id getc_order_id noline executeupdate c_orderline get_trxname notax executeupdate c_ordertax get_trxname m_lines m_taxes setprocessed noline notax before save param new record new return save protected boolean before save boolean new record client org check if getad org id 0 int context ad org id env getad org id get ctx if context ad org id 0 setad org id context ad org id log warning changed org to context context ad org id if getad client id 0 m processmsg ad client id 0 return false new record doc type make sure doc type set to 0 if new record getc doctype id 0 setc doctype id 0 default warehouse if getm warehouse id 0 int ii env get context as int get ctx m warehouse id if ii 0 setm warehouse id ii else log save error fill mandatory msg get element get ctx m warehouse id return false warehouse org if new record is valuechanged ad org id is valuechanged m warehouse id m warehouse wh m warehouse get get ctx getm warehouse id if wh getad org id getad org id log save warning warehouse org conflict reservations in warehouse if new record is valuechanged m warehouse id m order line lines get lines false null for int i 0 i lines length i if lines i can change warehouse return false no partner info set template if getc bpartner id 0 setb partner mb partner get template get ctx getad client id if getc bpartner location id 0 setb partner new mb partner get ctx getc bpartner id null no bill get from ship if getbill bpartner id 0 setbill bpartner id getc bpartner id setbill location id getc bpartner location id if getbill location id 0 setbill location id getc bpartner location id default price list if getm pricelist id 0 int ii db getsql value null select m pricelist id from m pricelist where ad client id and isso price list order by is default desc getad client id isso trx y n if ii 0 setm pricelist id ii default currency if getc currency id 0 string sql select c currency id from m pricelist where m pricelist id int ii db getsql value null sql getm pricelist id if ii 0 setc currency id ii else setc currency id env get context as int get ctx c currency id default sales rep if getsalesrep id 0 int ii env get context as int get ctx salesrep id if ii 0 setsalesrep id ii default document type if getc doctypetarget id 0 setc doctypetarget id docsubtypeso standard default payment term if getc paymentterm id 0 int ii env get context as int get ctx c paymentterm id if ii 0 setc paymentterm id ii else string sql select c paymentterm id from c paymentterm where ad client id and is default y ii db getsql value null sql getad client id if ii 0 setc paymentterm id ii return true newrecord beforesave newrecord getad_org_id context_ad_org_id getad_org_id getctx context_ad_org_id setad_org_id context_ad_org_id context_ad_org_id getad_client_id m_processmsg ad_client_id doctype newrecord getc_doctype_id setc_doctype_id getm_warehouse_id getcontextasint getctx m_warehouse_id setm_warehouse_id saveerror fillmandatory getelement getctx m_warehouse_id newrecord is_valuechanged ad_org_id is_valuechanged m_warehouse_id mwarehouse mwarehouse getctx getm_warehouse_id getad_org_id getad_org_id savewarning warehouseorgconflict newrecord is_valuechanged m_warehouse_id morderline getlines canchangewarehouse getc_bpartner_id setbpartner mbpartner gettemplate getctx getad_client_id getc_bpartner_location_id setbpartner mbpartner getctx getc_bpartner_id getbill_bpartner_id setbill_bpartner_id getc_bpartner_id setbill_location_id getc_bpartner_location_id getbill_location_id setbill_location_id getc_bpartner_location_id getm_pricelist_id getsqlvalue m_pricelist_id m_pricelist ad_client_id issopricelist isdefault getad_client_id issotrx setm_pricelist_id getc_currency_id c_currency_id m_pricelist m_pricelist_id getsqlvalue getm_pricelist_id setc_currency_id setc_currency_id getcontextasint getctx c_currency_id getsalesrep_id getcontextasint getctx salesrep_id setsalesrep_id getc_doctypetarget_id setc_doctypetarget_id docsubtypeso_standard getc_paymentterm_id getcontextasint getctx c_paymentterm_id setc_paymentterm_id c_paymentterm_id c_paymentterm ad_client_id isdefault getsqlvalue getad_client_id setc_paymentterm_id after save param new record new param success success protected boolean after save boolean new record boolean success if success new record return success propagate description changes if is valuechanged description is valuechanged po reference string sql update c invoice i set description po reference select description po reference from c order o where i c order id o c order id where doc status not in re cl and c order id getc order id int no db execute update sql get trxname log fine description no propagate changes of payment info to existing not reversed closed invoices if is valuechanged payment rule is valuechanged c paymentterm id is valuechanged date acct is valuechanged c payment id is valuechanged c cashline id string sql update c invoice i set payment rule c paymentterm id date acct c payment id c cashline id select payment rule c paymentterm id date acct c payment id c cashline id from c order o where i c order id o c order id where doc status not in re cl and c order id getc order id don t touch closed reversed entries int no db execute update sql get trxname log fine payment no sync lines after save sync ad org id after save sync c bpartner id after save sync c bpartner location id after save sync date ordered after save sync date promised after save sync m warehouse id after save sync m shipper id after save sync c currency id return true newrecord aftersave newrecord newrecord is_valuechanged is_valuechanged poreference c_invoice poreference poreference c_order c_order_id c_order_id docstatus c_order_id getc_order_id executeupdate get_trxname is_valuechanged paymentrule is_valuechanged c_paymentterm_id is_valuechanged dateacct is_valuechanged c_payment_id is_valuechanged c_cashline_id c_invoice paymentrule c_paymentterm_id dateacct c_payment_id c_cashline_id paymentrule c_paymentterm_id dateacct c_payment_id c_cashline_id c_order c_order_id c_order_id docstatus c_order_id getc_order_id executeupdate get_trxname aftersavesync ad_org_id aftersavesync c_bpartner_id aftersavesync c_bpartner_location_id aftersavesync dateordered aftersavesync datepromised aftersavesync m_warehouse_id aftersavesync m_shipper_id aftersavesync c_currency_id private void after save sync string column name if is valuechanged column name string sql update c orderline ol set column name select column name from c order o where ol c order id o c order id where c order id getc order id int no db execute update sql get trxname log fine column name lines no aftersavesync columnname is_valuechanged columnname c_orderline columnname columnname c_order c_order_id c_order_id c_order_id getc_order_id executeupdate get_trxname columnname before delete return true of it can be deleted protected boolean before delete if is processed return false get lines for int i 0 i m lines length i if m lines i before delete return false return true beforedelete isprocessed getlines m_lines m_lines beforedelete process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctypetarget id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid lines m order line lines get lines true m product id if lines length 0 m processmsg no lines return doc action status invalid bug 1564431 if get delivery rule null get delivery rule equals m order deliveryrule completeorder for int i 0 i lines length i m order line line lines i m product product line get product if product null product is exclude auto delivery m processmsg m product id product get value is exclude auto delivery return doc action status invalid convert doc type to target if getc doctype id getc doctypetarget id cannot change std to anything else if different warehouses if getc doctype id 0 m doc type dt old m doc type get get ctx getc doctype id if m doc type docsubtypeso standardorder equals dt old get doc sub typeso from so m doc type docsubtypeso standardorder equals dt get doc sub typeso to so for int i 0 i lines length i if lines i getm warehouse id getm warehouse id log warning different warehouse lines i m processmsg cannot change doc type return doc action status invalid new or in progress invalid if docstatus drafted equals get doc status docstatus inprogress equals get doc status docstatus invalid equals get doc status getc doctype id 0 setc doctype id getc doctypetarget id else convert only if offer if dt is offer setc doctype id getc doctypetarget id else m processmsg cannot change doc type return doc action status invalid convert doc type mandatory product attribute set instance string mandatory type y in y s string sql select count from c orderline ol inner join m product p on ol m product id p m product id inner join m attributeset pas on p m attributeset id pas m attributeset id where pas mandatory type mandatory type and ol m attributesetinstance id is null and ol c order id int no db getsql value get trxname sql getc order id if no 0 m processmsg lines without product attribute no return doc action status invalid lines explodebom if reserve stock dt lines m processmsg cannot reserve stock return doc action status invalid if calculate tax total m processmsg error calculating tax return doc action status invalid credit check if isso trx mb partner bp new mb partner get ctx getc bpartner id null if mb partner socreditstatus creditstop equals bp getso credit status m processmsg b partner credit stop total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid if mb partner socreditstatus credithold equals bp getso credit status m processmsg b partner credit hold total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid big decimal grand total m conversion rate convert base get ctx get grand total getc currency id get date ordered getc conversiontype id getad client id getad org id if mb partner socreditstatus credithold equals bp getso credit status grand total m processmsg b partner overo credit hold total open balance bp get total open balance grand total grand total so creditlimit bp getso creditlimit return doc action status invalid m justprepared true if docaction complete equals get doc action don t set for just prepare set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctypetarget_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid morderline getlines m_product_id m_processmsg nolines docaction status_invalid getdeliveryrule getdeliveryrule morder deliveryrule_completeorder morderline mproduct getproduct isexcludeautodelivery m_processmsg m_product_id getvalue isexcludeautodelivery docaction status_invalid doctype getc_doctype_id getc_doctypetarget_id getc_doctype_id mdoctype dtold mdoctype getctx getc_doctype_id mdoctype docsubtypeso_standardorder dtold getdocsubtypeso mdoctype docsubtypeso_standardorder getdocsubtypeso getm_warehouse_id getm_warehouse_id m_processmsg cannotchangedoctype docaction status_invalid docstatus_drafted getdocstatus docstatus_inprogress getdocstatus docstatus_invalid getdocstatus getc_doctype_id setc_doctype_id getc_doctypetarget_id isoffer setc_doctype_id getc_doctypetarget_id m_processmsg cannotchangedoctype docaction status_invalid doctype mandatorytype c_orderline m_product m_product_id m_product_id m_attributeset m_attributeset_id m_attributeset_id mandatorytype mandatorytype m_attributesetinstance_id c_order_id getsqlvalue get_trxname getc_order_id m_processmsg lineswithoutproductattribute docaction status_invalid reservestock m_processmsg docaction status_invalid calculatetaxtotal m_processmsg docaction status_invalid issotrx mbpartner mbpartner getctx getc_bpartner_id mbpartner socreditstatus_creditstop getsocreditstatus m_processmsg bpartnercreditstop totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid mbpartner socreditstatus_credithold getsocreditstatus m_processmsg bpartnercredithold totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid bigdecimal grandtotal mconversionrate convertbase getctx getgrandtotal getc_currency_id getdateordered getc_conversiontype_id getad_client_id getad_org_id mbpartner socreditstatus_credithold getsocreditstatus grandtotal m_processmsg bpartneroverocredithold totalopenbalance gettotalopenbalance grandtotal grandtotal so_creditlimit getso_creditlimit docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress explode non stocked bom private void explodebom string where and is active y and exists select from m product p where c orderline m product id p m product id and p isbom y and p is verified y and p is stocked n string sql select count from c orderline where c order id where int count db getsql value get trxname sql getc order id while count 0 renumber lines 1000 max 999 bom items order lines with non stocked bo ms m order line lines get lines where order by line for int i 0 i lines length i m order line line lines i m product product m product get get ctx line getm product id log fine product get name new lines int line no line get line m productbom boms m productbom getbom lines product for int j 0 j boms length j m productbom bom boms j m order line new line new m order line this new line set line line no new line setm product id bom get product getm product id new line setc uom id bom get product getc uom id new line set qty line get qty ordered multiply bom getbom qty if bom get description null new line set description bom get description new line set price new line save get trxname convert into comment line line setm product id 0 line setm attributesetinstance id 0 line set price env zero line set price limit env zero line set price list env zero line set line net amt env zero line set freight amt env zero string description product get name if product get description null description product get description if line get description null description line get description line set description description line save get trxname for all lines with bom m lines null force requery count db getsql value get trxname sql getc invoice id renumber lines 10 while count 0 isactive m_product c_orderline m_product_id m_product_id isverified isstocked c_orderline c_order_id getsqlvalue get_trxname getc_order_id renumberlines boms morderline getlines morderline mproduct mproduct getctx getm_product_id getname lineno getline mproductbom mproductbom getbomlines mproductbom morderline newline morderline newline setline lineno newline setm_product_id getproduct getm_product_id newline setc_uom_id getproduct getc_uom_id newline setqty getqtyordered getbomqty getdescription newline setdescription getdescription newline setprice newline get_trxname setm_product_id setm_attributesetinstance_id setprice setpricelimit setpricelist setlinenetamt setfreightamt getname getdescription getdescription getdescription getdescription setdescription get_trxname m_lines getsqlvalue get_trxname getc_invoice_id renumberlines reserve inventory counterpart m in out complete it param dt document type or null param lines order lines ordered by m product id for deadlock prevention return true if un reserved private boolean reserve stock m doc type dt m order line lines if dt null dt m doc type get get ctx getc doctype id binding boolean binding dt is proposal not binding i e target 0 if docaction void equals get doc action closing binding quotation m doc type docsubtypeso quotation equals dt get doc sub typeso docaction close equals get doc action is drop ship binding false boolean isso trx isso trx log fine binding binding isso trx isso trx force same wh for all but so po int header m warehouse id getm warehouse id if m doc type docsubtypeso standardorder equals dt get doc sub typeso m doc type docbasetype purchaseorder equals dt get doc base type header m warehouse id 0 don t enforce always check and un reserve inventory for int i 0 i lines length i m order line line lines i check set wh org if header m warehouse id 0 enforce wh if header m warehouse id line getm warehouse id line setm warehouse id header m warehouse id if getad org id line getad org id line setad org id getad org id binding big decimal target binding line get qty ordered env zero big decimal difference target subtract line get qty reserved subtract line get qty delivered if difference signum 0 continue log fine line line get line target target difference difference ordered line get qty ordered reserved line get qty reserved delivered line get qty delivered check product stocked and item m product product line get product if product null if product is stocked big decimal ordered isso trx env zero difference big decimal reserved isso trx difference env zero int m locator id 0 get locator to reserve if line getm attributesetinstance id 0 get existing location m locator id m storage getm locator id line getm warehouse id line getm product id line getm attributesetinstance id ordered get trxname get default location if m locator id 0 m warehouse wh m warehouse get get ctx line getm warehouse id m locator id wh get default locator getm locator id update storage if m storage add get ctx line getm warehouse id m locator id line getm product id line getm attributesetinstance id line getm attributesetinstance id env zero reserved ordered get trxname return false stockec update line line set qty reserved line get qty reserved add difference if line save get trxname return false product reverse inventory return true minout completeit m_product_id reservestock mdoctype morderline mdoctype getctx getc_doctype_id isproposal docaction_void getdocaction mdoctype docsubtypeso_quotation getdocsubtypeso docaction_close getdocaction isdropship issotrx issotrx issotrx issotrx header_m_warehouse_id getm_warehouse_id mdoctype docsubtypeso_standardorder getdocsubtypeso mdoctype docbasetype_purchaseorder getdocbasetype header_m_warehouse_id morderline header_m_warehouse_id header_m_warehouse_id getm_warehouse_id setm_warehouse_id header_m_warehouse_id getad_org_id getad_org_id setad_org_id getad_org_id bigdecimal getqtyordered bigdecimal getqtyreserved getqtydelivered getline getqtyordered getqtyreserved getqtydelivered mproduct getproduct isstocked bigdecimal issotrx bigdecimal issotrx m_locator_id getm_attributesetinstance_id m_locator_id mstorage getm_locator_id getm_warehouse_id getm_product_id getm_attributesetinstance_id get_trxname m_locator_id mwarehouse mwarehouse getctx getm_warehouse_id m_locator_id getdefaultlocator getm_locator_id mstorage getctx getm_warehouse_id m_locator_id getm_product_id getm_attributesetinstance_id getm_attributesetinstance_id get_trxname setqtyreserved getqtyreserved get_trxname calculate tax and total private boolean calculate tax total log fine delete taxes db execute update delete c ordertax where c order id getc order id get trxname m taxes null lines big decimal total lines env zero array list integer tax list new array list integer m order line lines get lines for int i 0 i lines length i m order line line lines i integer taxid new integer line getc tax id if tax list contains taxid m order tax o tax m order tax get line get precision false get trxname current tax o tax set is tax included is tax included if o tax calculate tax from lines return false if o tax save get trxname return false tax list add taxid total lines total lines add line get line net amt taxes big decimal grand total total lines m order tax taxes get taxes true for int i 0 i taxes length i m order tax o tax taxes i m tax tax o tax get tax if tax is summary m tax c taxes tax get child taxes false for int j 0 j c taxes length j m tax c tax c taxes j big decimal tax amt c tax calculate tax o tax get tax base amt is tax included get precision m order tax newo tax new m order tax get ctx 0 get trxname newo tax set client org this newo tax setc order id getc order id newo tax setc tax id c tax getc tax id newo tax set precision get precision newo tax set is tax included is tax included newo tax set tax base amt o tax get tax base amt newo tax set tax amt tax amt if newo tax save get trxname return false if is tax included grand total grand total add tax amt if o tax delete true get trxname return false else if is tax included grand total grand total add o tax get tax amt set total lines total lines set grand total grand total return true calculatetaxtotal executeupdate c_ordertax c_order_id getc_order_id get_trxname m_taxes bigdecimal totallines arraylist taxlist arraylist morderline getlines morderline getc_tax_id taxlist mordertax otax mordertax getprecision get_trxname otax setistaxincluded istaxincluded otax calculatetaxfromlines otax get_trxname taxlist totallines totallines getlinenetamt bigdecimal grandtotal totallines mordertax gettaxes mordertax otax mtax otax gettax issummary mtax ctaxes getchildtaxes ctaxes mtax ctax ctaxes bigdecimal taxamt ctax calculatetax otax gettaxbaseamt istaxincluded getprecision mordertax newotax mordertax getctx get_trxname newotax setclientorg newotax setc_order_id getc_order_id newotax setc_tax_id ctax getc_tax_id newotax setprecision getprecision newotax setistaxincluded istaxincluded newotax settaxbaseamt otax gettaxbaseamt newotax settaxamt taxamt newotax get_trxname istaxincluded grandtotal grandtotal taxamt otax get_trxname istaxincluded grandtotal grandtotal otax gettaxamt settotallines totallines setgrandtotal grandtotal approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it m doc type dt m doc type get get ctx getc doctype id string doc sub typeso dt get doc sub typeso just prepare if docaction prepare equals get doc action set processed false return doc action status inprogress offers if m doc type docsubtypeso proposal equals doc sub typeso m doc type docsubtypeso quotation equals doc sub typeso binding if m doc type docsubtypeso quotation equals doc sub typeso reserve stock dt get lines true m product id set processed true set doc action doc action action close 1564472 completed quotation process button should be set to close return doc action status completed waiting payment until we have a payment if m forcecreation m doc type docsubtypeso prepayorder equals doc sub typeso getc payment id 0 getc cashline id 0 set processed true return doc action status waitingpayment re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it get lines true null log info to string string buffer info new string buffer boolean real timepos false create so shipment force shipment m in out shipment null if m doc type docsubtypeso oncreditorder equals doc sub typeso w ill call i nvoice m doc type docsubtypeso warehouseorder equals doc sub typeso w ill call p ickup m doc type docsubtypeso posorder equals doc sub typeso w alk in r eceipt m doc type docsubtypeso prepayorder equals doc sub typeso if deliveryrule force equals get delivery rule set delivery rule deliveryrule force shipment create shipment dt real timepos null get date ordered if shipment null return doc action status invalid info append m inout id append shipment get document no string msg shipment get process msg if msg null msg length 0 info append append msg append shipment create so invoice always invoice complete order if m doc type docsubtypeso posorder equals doc sub typeso m doc type docsubtypeso oncreditorder equals doc sub typeso m doc type docsubtypeso prepayorder equals doc sub typeso m invoice invoice create invoice dt shipment real timepos null get date ordered if invoice null return doc action status invalid info append c invoice id append invoice get document no string msg invoice get process msg if msg null msg length 0 info append append msg append invoice counter documents m order counter create counter doc if counter null info append counter doc order append counter get document no user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null if info length 0 info append info append valid m processmsg info to string return doc action status invalid set processed true m processmsg info to string set doc action docaction close return doc action status completed completeit mdoctype mdoctype getctx getc_doctype_id docsubtypeso getdocsubtypeso docaction_prepare getdocaction setprocessed docaction status_inprogress mdoctype docsubtypeso_proposal docsubtypeso mdoctype docsubtypeso_quotation docsubtypeso mdoctype docsubtypeso_quotation docsubtypeso reservestock getlines m_product_id setprocessed setdocaction docaction action_close docaction status_completed m_forcecreation mdoctype docsubtypeso_prepayorder docsubtypeso getc_payment_id getc_cashline_id setprocessed docaction status_waitingpayment m_justprepared prepareit docaction status_inprogress isapproved approveit getlines tostring stringbuffer stringbuffer realtimepos minout mdoctype docsubtypeso_oncreditorder docsubtypeso illcall mdoctype docsubtypeso_warehouseorder docsubtypeso illcall mdoctype docsubtypeso_posorder docsubtypeso alkin mdoctype docsubtypeso_prepayorder docsubtypeso deliveryrule_force getdeliveryrule setdeliveryrule deliveryrule_force createshipment realtimepos getdateordered docaction status_invalid m_inout_id getdocumentno getprocessmsg mdoctype docsubtypeso_posorder docsubtypeso mdoctype docsubtypeso_oncreditorder docsubtypeso mdoctype docsubtypeso_prepayorder docsubtypeso minvoice createinvoice realtimepos getdateordered docaction status_invalid c_invoice_id getdocumentno getprocessmsg morder createcounterdoc counterdoc getdocumentno modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg tostring docaction status_invalid setprocessed m_processmsg tostring setdocaction docaction_close docaction status_completed create shipment param dt order document type param movement date optional movement date default today return shipment or null private m in out create shipment m doc type dt timestamp movement date log info for dt m in out shipment new m in out this dt getc doctypeshipment id movement date shipment set date acct get date acct if shipment save get trxname m processmsg could not create shipment return null m order line o lines get lines true null for int i 0 i o lines length i m order line o line o lines i m in out line io line new m in out line shipment qty ordered delivered big decimal movement qty o line get qty ordered subtract o line get qty delivered location int m locator id m storage getm locator id o line getm warehouse id o line getm product id o line getm attributesetinstance id movement qty get trxname if m locator id 0 get default location m warehouse wh m warehouse get get ctx o line getm warehouse id m locator id wh get default locator getm locator id io line set order line o line m locator id movement qty io line set qty movement qty if o line get qty entered compare to o line get qty ordered 0 io line set qty entered movement qty multiply o line get qty entered divide o line get qty ordered 6 big decimal round half up if io line save get trxname m processmsg could not create shipment line return null manually process shipment string status shipment complete it shipment set doc status status shipment save get trxname if docstatus completed equals status m processmsg m inout id shipment get process msg return null return shipment movementdate minout createshipment mdoctype movementdate minout minout getc_doctypeshipment_id movementdate setdateacct getdateacct get_trxname m_processmsg morderline olines getlines olines morderline oline olines minoutline ioline minoutline bigdecimal movementqty oline getqtyordered oline getqtydelivered m_locator_id mstorage getm_locator_id oline getm_warehouse_id oline getm_product_id oline getm_attributesetinstance_id movementqty get_trxname m_locator_id mwarehouse mwarehouse getctx oline getm_warehouse_id m_locator_id getdefaultlocator getm_locator_id ioline setorderline oline m_locator_id movementqty ioline setqty movementqty oline getqtyentered compareto oline getqtyordered ioline setqtyentered movementqty oline getqtyentered oline getqtyordered bigdecimal round_half_up ioline get_trxname m_processmsg completeit setdocstatus get_trxname docstatus_completed m_processmsg m_inout_id getprocessmsg create invoice param dt order document type param shipment optional shipment return invoice or null private m invoice create invoice m doc type dt m in out shipment timestamp invoice date log info dt to string m invoice invoice new m invoice this dt getc doctypeinvoice id invoice date if invoice save get trxname m processmsg could not create invoice return null if we have a shipment use that as a base if shipment null if invoicerule afterdelivery equals get invoice rule set invoice rule invoicerule afterdelivery m in out line s lines shipment get lines false for int i 0 i s lines length i m in out line s line s lines i m invoice line i line new m invoice line invoice i line set ship line s line qty delivered i line set qty entered s line get qty entered i line set qty invoiced s line get movement qty if i line save get trxname m processmsg could not create invoice line from shipment line return null s line set is invoiced true if s line save get trxname log warning could not update shipment line s line else create invoice from order if invoicerule immediate equals get invoice rule set invoice rule invoicerule immediate m order line o lines get lines for int i 0 i o lines length i m order line o line o lines i m invoice line i line new m invoice line invoice i line set order line o line qty ordered invoiced i line set qty invoiced o line get qty ordered subtract o line get qty invoiced if o line get qty ordered compare to o line get qty entered 0 i line set qty entered i line get qty invoiced else i line set qty entered i line get qty invoiced multiply o line get qty entered divide o line get qty ordered 12 big decimal round half up if i line save get trxname m processmsg could not create invoice line from order line return null manually process invoice string status invoice complete it invoice set doc status status invoice save get trxname setc cashline id invoice getc cashline id if docstatus completed equals status m processmsg c invoice id invoice get process msg return null return invoice minvoice createinvoice mdoctype minout invoicedate tostring minvoice minvoice getc_doctypeinvoice_id invoicedate get_trxname m_processmsg invoicerule_afterdelivery getinvoicerule setinvoicerule invoicerule_afterdelivery minoutline slines getlines slines minoutline sline slines minvoiceline iline minvoiceline iline setshipline sline iline setqtyentered sline getqtyentered iline setqtyinvoiced sline getmovementqty iline get_trxname m_processmsg sline setisinvoiced sline get_trxname sline invoicerule_immediate getinvoicerule setinvoicerule invoicerule_immediate morderline olines getlines olines morderline oline olines minvoiceline iline minvoiceline iline setorderline oline iline setqtyinvoiced oline getqtyordered oline getqtyinvoiced oline getqtyordered compareto oline getqtyentered iline setqtyentered iline getqtyinvoiced iline setqtyentered iline getqtyinvoiced oline getqtyentered oline getqtyordered bigdecimal round_half_up iline get_trxname m_processmsg completeit setdocstatus get_trxname setc_cashline_id getc_cashline_id docstatus_completed m_processmsg c_invoice_id getprocessmsg create counter document private m order create counter doc is this itself a counter doc if getref order id 0 return null org must be linked to b partner m org org m org get get ctx getad org id int counterc bpartner id org getlinkedc bpartner id if counterc bpartner id 0 return null business partner needs to be linked to org mb partner bp new mb partner get ctx getc bpartner id null int counterad org id bp getad orgbp id int if counterad org id 0 return null mb partner counterbp new mb partner get ctx counterc bpartner id null m org info counter org info m org info get get ctx counterad org id log info counter bp counterbp get name document type int c doctypetarget id 0 m doc type counter counterdt m doc type counter get counter doc type get ctx getc doctype id if counterdt null log fine counterdt to string if counterdt is create counter counterdt is valid return null c doctypetarget id counterdt getcounter c doctype id else indirect c doctypetarget id m doc type counter getcounterdoctype id get ctx getc doctype id log fine indirect c doctypetarget id c doctypetarget id if c doctypetarget id 0 return null deep copy m order counter copy from this get date ordered c doctypetarget id isso trx true false get trxname counter setad org id counterad org id counter setm warehouse id counter org info getm warehouse id counter setb partner counterbp counter set date promised get date promised default is date ordered refernces should not be required counter setsalesrep id getsalesrep id counter save get trxname update copied lines m order line counter lines counter get lines true null for int i 0 i counter lines length i m order line counter line counter lines i counter line set order counter copies header values bp etc counter line set price counter line set tax counter line save get trxname log fine counter to string document action if counterdt null if counterdt get doc action null counter set doc action counterdt get doc action counter process it counterdt get doc action counter save get trxname return counter morder createcounterdoc getref_order_id bpartner morg morg getctx getad_org_id counterc_bpartner_id getlinkedc_bpartner_id counterc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id counterad_org_id getad_orgbp_id_int counterad_org_id mbpartner mbpartner getctx counterc_bpartner_id morginfo counterorginfo morginfo getctx counterad_org_id getname c_doctypetarget_id mdoctypecounter mdoctypecounter getcounterdoctype getctx getc_doctype_id tostring iscreatecounter isvalid c_doctypetarget_id getcounter_c_doctype_id c_doctypetarget_id mdoctypecounter getcounterdoctype_id getctx getc_doctype_id c_doctypetarget_id c_doctypetarget_id c_doctypetarget_id morder copyfrom getdateordered c_doctypetarget_id issotrx get_trxname setad_org_id counterad_org_id setm_warehouse_id counterorginfo getm_warehouse_id setbpartner setdatepromised getdatepromised setsalesrep_id getsalesrep_id get_trxname morderline counterlines getlines counterlines morderline counterline counterlines counterline setorder counterline setprice counterline settax counterline get_trxname tostring getdocaction setdocaction getdocaction processit getdocaction get_trxname void document set qtys to 0 sales reverse all documents return true if success public boolean void it m order line lines get lines true m product id log info to string for int i 0 i lines length i m order line line lines i big decimal old line get qty ordered if old signum 0 line add description msg get msg get ctx voided old line set qty env zero line set line net amt env zero line save get trxname add description msg get msg get ctx voided clear reservations if reserve stock null lines m processmsg cannot unreserve stock void return false if create reversals return false set processed true set doc action docaction none return true voidit morderline getlines m_product_id tostring morderline bigdecimal getqtyordered adddescription getmsg getctx setqty setlinenetamt get_trxname adddescription getmsg getctx reservestock m_processmsg createreversals setprocessed setdocaction docaction_none create shipment invoice reversals return true if success private boolean create reversals cancel only sales if isso trx return true log info create reversals string buffer info new string buffer reverse all shipments info append m inout id m in out shipments get shipments for int i 0 i shipments length i m in out ship shipments i if closed ignore if m in out docstatus closed equals ship get doc status m in out docstatus reversed equals ship get doc status m in out docstatus voided equals ship get doc status continue ship set trxname get trxname if not completed void otherwise reverse it if m in out docstatus completed equals ship get doc status if ship void it ship set doc status m in out docstatus voided else if ship reverse correct it completed shipment ship set doc status m in out docstatus reversed info append append ship get document no else m processmsg could not reverse shipment ship return false ship set doc action m in out docaction none ship save get trxname for all shipments reverse all invoices info append c invoice id m invoice invoices get invoices for int i 0 i invoices length i m invoice invoice invoices i if closed ignore if m invoice docstatus closed equals invoice get doc status m invoice docstatus reversed equals invoice get doc status m invoice docstatus voided equals invoice get doc status continue invoice set trxname get trxname if not compleded void otherwise reverse it if m invoice docstatus completed equals invoice get doc status if invoice void it invoice set doc status m invoice docstatus voided else if invoice reverse correct it completed invoice invoice set doc status m invoice docstatus reversed info append append invoice get document no else m processmsg could not reverse invoice invoice return false invoice set doc action m invoice docaction none invoice save get trxname for all shipments m processmsg info to string return true createreversals issotrx createreversals stringbuffer stringbuffer m_inout_id minout getshipments minout minout docstatus_closed getdocstatus minout docstatus_reversed getdocstatus minout docstatus_voided getdocstatus set_trxname get_trxname minout docstatus_completed getdocstatus voidit setdocstatus minout docstatus_voided reversecorrectit setdocstatus minout docstatus_reversed getdocumentno m_processmsg setdocaction minout docaction_none get_trxname c_invoice_id minvoice getinvoices minvoice minvoice docstatus_closed getdocstatus minvoice docstatus_reversed getdocstatus minvoice docstatus_voided getdocstatus set_trxname get_trxname minvoice docstatus_completed getdocstatus voidit setdocstatus minvoice docstatus_voided reversecorrectit setdocstatus minvoice docstatus_reversed getdocumentno m_processmsg setdocaction minvoice docaction_none get_trxname m_processmsg tostring close document cancel not delivered qunatities return true if success public boolean close it log info to string close not delivered qty so po m order line lines get lines true m product id for int i 0 i lines length i m order line line lines i big decimal old line get qty ordered if old compare to line get qty delivered 0 line set qty lost sales line get qty ordered subtract line get qty delivered line set qty ordered line get qty delivered qty entered unchanged line add description close old line save get trxname clear reservations if reserve stock null lines m processmsg cannot unreserve stock close return false set processed true set doc action docaction none return true closeit tostring morderline getlines m_product_id morderline bigdecimal getqtyordered compareto getqtydelivered setqtylostsales getqtyordered getqtydelivered setqtyordered getqtydelivered qtyentered adddescription get_trxname reservestock m_processmsg setprocessed setdocaction docaction_none reverse correction same void return true if success public boolean reverse correct it log info to string return void it reversecorrectit tostring voidit reverse accrual none return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return true if success public boolean re activate it log info to string m doc type dt m doc type get get ctx getc doctype id string doc sub typeso dt get doc sub typeso po just re open if isso trx log info existing documents not modified dt reverse direct documents else if m doc type docsubtypeso oncreditorder equals doc sub typeso w ill call i nvoice m doc type docsubtypeso warehouseorder equals doc sub typeso w ill call p ickup m doc type docsubtypeso posorder equals doc sub typeso w alk in r eceipt if create reversals return false else log info existing documents not modified sub type doc sub typeso set doc action docaction complete set processed false return true reactivateit tostring mdoctype mdoctype getctx getc_doctype_id docsubtypeso getdocsubtypeso issotrx mdoctype docsubtypeso_oncreditorder docsubtypeso illcall mdoctype docsubtypeso_warehouseorder docsubtypeso illcall mdoctype docsubtypeso_posorder docsubtypeso alkin createreversals subtype docsubtypeso setdocaction docaction_complete setprocessed get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no grand total 123 00 1 sb append append msg translate get ctx grand total append append get grand total if m lines null sb append append m lines length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx grandtotal getgrandtotal m_lines m_lines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return getsalesrep id ad_user_id getdoc_user_id getsalesrep_id get document approval amount return amount public big decimal get approval amt return get grand total bigdecimal getapprovalamt getgrandtotal standard constructor public x c invoicebatchline properties ctx int c invoicebatchline id string trx name super ctx c invoicebatchline id trx name if c invoicebatchline id 0 setc bpartner id 0 c bpartner id setc bpartner location id 0 c bpartner location id setc charge id 0 setc doctype id 0 c doctype id setc invoicebatchline id 0 setc invoicebatch id 0 setc tax id 0 set date acct new timestamp system current time millis date acct date doc set date invoiced new timestamp system current time millis date invoiced date doc set document no null document no set is tax included false is tax included set line 0 sql select nvl max line 0 10 as default value from c invoicebatchline where c invoicebatch id c invoicebatch id set line net amt env zero set line total amt env zero set price entered env zero set processed false set qty entered env zero 1 set tax amt env zero x_c_invoicebatchline c_invoicebatchline_id trxname c_invoicebatchline_id trxname c_invoicebatchline_id setc_bpartner_id c_bpartner_id setc_bpartner_location_id c_bpartner_location_id setc_charge_id setc_doctype_id c_doctype_id setc_invoicebatchline_id setc_invoicebatch_id setc_tax_id setdateacct currenttimemillis dateacct datedoc setdateinvoiced currenttimemillis dateinvoiced datedoc setdocumentno documentno setistaxincluded istaxincluded setline defaultvalue c_invoicebatchline c_invoicebatch_id c_invoicebatch_id setlinenetamt setlinetotalamt setpriceentered setprocessed setqtyentered settaxamt load constructor public x c invoicebatchline properties ctx result set rs string trx name super ctx rs trx name x_c_invoicebatchline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoicebatchline append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoicebatchline get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 1 throw new illegal argument exception c charge id is mandatory set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id illegalargumentexception c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice batch line expense invoice batch line public void setc invoicebatchline id int c invoicebatchline id if c invoicebatchline id 1 throw new illegal argument exception c invoicebatchline id is mandatory set valuenocheck c invoicebatchline id new integer c invoicebatchline id setc_invoicebatchline_id c_invoicebatchline_id c_invoicebatchline_id illegalargumentexception c_invoicebatchline_id set_valuenocheck c_invoicebatchline_id c_invoicebatchline_id get invoice batch line expense invoice batch line public int getc invoicebatchline id integer ii integer get value c invoicebatchline id if ii null return 0 return ii int value getc_invoicebatchline_id get_value c_invoicebatchline_id intvalue set invoice batch expense invoice batch header public void setc invoicebatch id int c invoicebatch id if c invoicebatch id 1 throw new illegal argument exception c invoicebatch id is mandatory set valuenocheck c invoicebatch id new integer c invoicebatch id setc_invoicebatch_id c_invoicebatch_id c_invoicebatch_id illegalargumentexception c_invoicebatch_id set_valuenocheck c_invoicebatch_id c_invoicebatch_id get invoice batch expense invoice batch header public int getc invoicebatch id integer ii integer get value c invoicebatch id if ii null return 0 return ii int value getc_invoicebatch_id get_value c_invoicebatch_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set value c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_value c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date invoiced date printed on invoice public void set date invoiced timestamp date invoiced if date invoiced null throw new illegal argument exception date invoiced is mandatory set value date invoiced date invoiced setdateinvoiced dateinvoiced dateinvoiced illegalargumentexception dateinvoiced set_value dateinvoiced dateinvoiced get date invoiced date printed on invoice public timestamp get date invoiced return timestamp get value date invoiced getdateinvoiced get_value dateinvoiced set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set line amount line extended amount quantity actual price without freight and charges public void set line net amt big decimal line net amt if line net amt null throw new illegal argument exception line net amt is mandatory set valuenocheck line net amt line net amt setlinenetamt bigdecimal linenetamt linenetamt illegalargumentexception linenetamt set_valuenocheck linenetamt linenetamt get line amount line extended amount quantity actual price without freight and charges public big decimal get line net amt big decimal bd big decimal get value line net amt if bd null return env zero return bd bigdecimal getlinenetamt bigdecimal bigdecimal get_value linenetamt set line total total line amount incl tax public void set line total amt big decimal line total amt if line total amt null throw new illegal argument exception line total amt is mandatory set valuenocheck line total amt line total amt setlinetotalamt bigdecimal linetotalamt linetotalamt illegalargumentexception linetotalamt set_valuenocheck linetotalamt linetotalamt get line total total line amount incl tax public big decimal get line total amt big decimal bd big decimal get value line total amt if bd null return env zero return bd bigdecimal getlinetotalamt bigdecimal bigdecimal get_value linetotalamt set price price entered the price based on the selected base uom public void set price entered big decimal price entered if price entered null throw new illegal argument exception price entered is mandatory set value price entered price entered setpriceentered bigdecimal priceentered priceentered illegalargumentexception priceentered set_value priceentered priceentered get price price entered the price based on the selected base uom public big decimal get price entered big decimal bd big decimal get value price entered if bd null return env zero return bd bigdecimal getpriceentered bigdecimal bigdecimal get_value priceentered set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity the quantity entered is based on the selected uom public void set qty entered big decimal qty entered if qty entered null throw new illegal argument exception qty entered is mandatory set value qty entered qty entered setqtyentered bigdecimal qtyentered qtyentered illegalargumentexception qtyentered set_value qtyentered qtyentered get quantity the quantity entered is based on the selected uom public big decimal get qty entered big decimal bd big decimal get value qty entered if bd null return env zero return bd bigdecimal getqtyentered bigdecimal bigdecimal get_value qtyentered set tax amount tax amount for a document public void set tax amt big decimal tax amt if tax amt null throw new illegal argument exception tax amt is mandatory set value tax amt tax amt settaxamt bigdecimal taxamt taxamt illegalargumentexception taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue cash journal line invoice when invoice selected set c currency discount ant amount write off amt public string invoice properties ctx int window no m tab m tab m field m field object value if is callout active assuming it is resetting value return set callout active true integer c invoice id integer value if c invoice id null c invoice id int value 0 m tab set value c currency id null set callout active false return date timestamp ts env get context as date ctx window no date acct from c cash if ts null ts new timestamp system current time millis string sql select c bpartner id c currency id 1 2 invoice open c invoice id 0 isso trx 3 4 payment term discount invoice open c invoice id 0 c currency id c paymentterm id date invoiced from c invoice where c invoice id try prepared statement pstmt db prepare statement sql null pstmt set timestamp 1 ts pstmt set int 2 c invoice id int value result set rs pstmt execute query if rs next m tab set value c currency id new integer rs get int 2 big decimal pay amt rs get big decimal 3 big decimal discount amt rs get big decimal 5 boolean isso trx y equals rs get string 4 if isso trx pay amt pay amt negate discount amt discount amt negate m tab set value amount pay amt subtract discount amt m tab set value discount amt discount amt m tab set value write off amt env zero env set context ctx window no inv total amt pay amt to string rs close pstmt close catch sql exception e log log level severe invoice e set callout active false return e get localized message set callout active false return c_currency discountant writeoffamt windowno mtab mtab mfield mfield iscalloutactive setcalloutactive c_invoice_id c_invoice_id c_invoice_id intvalue mtab setvalue c_currency_id setcalloutactive getcontextasdate windowno dateacct c_cash currenttimemillis c_bpartner_id c_currency_id invoiceopen c_invoice_id issotrx paymenttermdiscount invoiceopen c_invoice_id c_currency_id c_paymentterm_id dateinvoiced c_invoice c_invoice_id preparedstatement preparestatement settimestamp setint c_invoice_id intvalue resultset executequery mtab setvalue c_currency_id getint bigdecimal payamt getbigdecimal bigdecimal discountamt getbigdecimal issotrx getstring issotrx payamt payamt discountamt discountamt mtab setvalue payamt discountamt mtab setvalue discountamt discountamt mtab setvalue writeoffamt setcontext windowno invtotalamt payamt tostring sqlexception setcalloutactive getlocalizedmessage setcalloutactive cash journal line invoice amounts when discount ant amount write off amt change making sure that add up to inv total amt created by cashjournal invoice public string amounts properties ctx int window no m tab m tab m field m field object value needs to be invoice if is callout active i equals m tab get value cash type return check if inv total amt exists string total env get context ctx window no inv total amt if total null total length 0 return big decimal inv total amt new big decimal total set callout active true big decimal pay amt big decimal m tab get value amount big decimal discount amt big decimal m tab get value discount amt big decimal write off amt big decimal m tab get value write off amt string col name m field get column name log fine col name invoice inv total amt amount pay amt discount discount amt write off write off amt amount calculate write off if col name equals amount write off amt inv total amt subtract pay amt subtract discount amt m tab set value write off amt write off amt else calculate pay amt pay amt inv total amt subtract discount amt subtract write off amt m tab set value amount pay amt set callout active false return discountant writeoffamt invtotalamt cashjournal_invoice windowno mtab mtab mfield mfield iscalloutactive mtab getvalue cashtype invtotalamt getcontext windowno invtotalamt bigdecimal invtotalamt bigdecimal setcalloutactive bigdecimal payamt bigdecimal mtab getvalue bigdecimal discountamt bigdecimal mtab getvalue discountamt bigdecimal writeoffamt bigdecimal mtab getvalue writeoffamt colname mfield getcolumnname colname invtotalamt payamt discountamt writeoff writeoffamt colname writeoffamt invtotalamt payamt discountamt mtab setvalue writeoffamt writeoffamt payamt payamt invtotalamt discountamt writeoffamt mtab setvalue payamt setcalloutactive basic constructor public dfn basic constructor param element adds an element to the element public dfn element element add element element addelement basic constructor param element adds an element to the element public dfn string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dfn add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dfn add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dfn add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dfn add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public dfn remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c projectissuema properties ctx int c projectissuema id string trx name super ctx c projectissuema id trx name if c projectissuema id 0 setc projectissue id 0 setm attributesetinstance id 0 set movement qty env zero x_c_projectissuema c_projectissuema_id trxname c_projectissuema_id trxname c_projectissuema_id setc_projectissue_id setm_attributesetinstance_id setmovementqty load constructor public x c projectissuema properties ctx result set rs string trx name super ctx rs trx name x_c_projectissuema resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projectissuema append get id append return sb to string tostring stringbuffer stringbuffer x_c_projectissuema get_id tostring set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 1 throw new illegal argument exception c projectissue id is mandatory set valuenocheck c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id illegalargumentexception c_projectissue_id set_valuenocheck c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc projectissue id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_projectissue_id set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty standard constructor param ctx context param c projectline id id public m project line properties ctx int c projectline id string trx name super ctx c projectline id trx name if c projectline id 0 setc project id 0 setc projectline id 0 set line 0 set is printed true set processed false set invoiced amt env zero set invoiced qty env zero set planned amt env zero set planned margin amt env zero set planned price env zero set planned qty env one c_projectline_id mprojectline c_projectline_id trxname c_projectline_id trxname c_projectline_id setc_project_id setc_projectline_id setline setisprinted setprocessed setinvoicedamt setinvoicedqty setplannedamt setplannedmarginamt setplannedprice setplannedqty load constructor param ctx context param rs result set public m project line properties ctx result set rs string trx name super ctx rs trx name mprojectline resultset trxname trxname parent constructor param project parent public m project line m project project this project get ctx 0 project get trxname set client org project setc project id project getc project id parent set line mprojectline mproject getctx get_trxname setclientorg setc_project_id getc_project_id setline get the next line no private void set line set line db getsql value get trxname select coalesce max line 0 10 from c projectline where c project id getc project id setline setline getsqlvalue get_trxname c_projectline c_project_id getc_project_id set product committed qty etc param pi project issue public void setm project issue m project issue pi setc projectissue id pi getc projectissue id setm product id pi getm product id set committed qty pi get movement qty if get description null set description pi get description setmprojectissue mprojectissue setc_projectissue_id getc_projectissue_id setm_product_id getm_product_id setcommittedqty getmovementqty getdescription setdescription getdescription set po param c orderpo id po id public void setc orderpo id int c orderpo id super setc orderpo id c orderpo id c_orderpo_id setc_orderpo_id c_orderpo_id setc_orderpo_id c_orderpo_id get project return parent public m project get project if m parent null getc project id 0 m parent new m project get ctx getc project id get trxname if get trxname null m parent load get trxname return m parent mproject getproject m_parent getc_project_id m_parent mproject getctx getc_project_id get_trxname get_trxname m_parent get_trxname m_parent get limit price if exists return limit public big decimal get limit price big decimal limit price get planned price if getm product id 0 return limit price if get project null return limit price boolean isso trx true m product pricing pp new m product pricing getm product id m parent getc bpartner id get planned qty isso trx pp setm pricelist id m parent getm pricelist id if pp calculate price limit price pp get price limit return limit price bigdecimal getlimitprice bigdecimal limitprice getplannedprice getm_product_id limitprice getproject limitprice issotrx mproductpricing mproductpricing getm_product_id m_parent getc_bpartner_id getplannedqty issotrx setm_pricelist_id m_parent getm_pricelist_id calculateprice limitprice getpricelimit limitprice before save param new record new return true protected boolean before save boolean new record if get line 0 set line planned amount set planned amt get planned qty multiply get planned price planned margin if is valuechanged m product id is valuechanged m product category id is valuechanged planned qty is valuechanged planned price if getm product id 0 big decimal margin each get planned price subtract get limit price set planned margin amt margin each multiply get planned qty else if getm product category id 0 m product category category m product category get get ctx getm product category id big decimal margin each category get planned margin set planned margin amt margin each multiply get planned qty return true newrecord beforesave newrecord getline setline setplannedamt getplannedqty getplannedprice is_valuechanged m_product_id is_valuechanged m_product_category_id is_valuechanged plannedqty is_valuechanged plannedprice getm_product_id bigdecimal margineach getplannedprice getlimitprice setplannedmarginamt margineach getplannedqty getm_product_category_id mproductcategory mproductcategory getctx getm_product_category_id bigdecimal margineach getplannedmargin setplannedmarginamt margineach getplannedqty after save param new record new param success success return success protected boolean after save boolean new record boolean success update header return success newrecord aftersave newrecord updateheader after delete param success success return success protected boolean after delete boolean success update header return success afterdelete updateheader update header private void update header string sql update c project p set planned amt planned qty planned margin amt committed amt committed qty invoiced amt invoiced qty select coalesce sum pl planned amt 0 coalesce sum pl planned qty 0 coalesce sum pl planned margin amt 0 coalesce sum pl committed amt 0 coalesce sum pl committed qty 0 coalesce sum pl invoiced amt 0 coalesce sum pl invoiced qty 0 from c projectline pl where pl c project id p c project id and pl is active y where c project id getc project id int no db execute update sql get trxname if no 1 log log level severe update header no updateheader c_project plannedamt plannedqty plannedmarginamt committedamt committedqty invoicedamt invoicedqty plannedamt plannedqty plannedmarginamt committedamt committedqty invoicedamt invoicedqty c_projectline c_project_id c_project_id isactive c_project_id getc_project_id executeupdate get_trxname updateheader constructor param ass accounting schemata param rs record parem trx name trx public doc projectissue m acct schema ass result set rs string trx name super ass m project issue class rs doctype projectissue trx name trxname doc_projectissue macctschema resultset trxname mprojectissue doctype_projectissue trxname load document details return error message or null protected string load document details setc currency id no currency m issue m project issue getpo set date doc m issue get movement date set date acct m issue get movement date pseudo line m line new doc line m issue this m line set qty m issue get movement qty true sets trx and storage qty pseudo line check if m line getm product id 0 log warning m line to string no product log fine m line to string return null loaddocumentdetails setc_currency_id no_currency m_issue mprojectissue setdatedoc m_issue getmovementdate setdateacct m_issue getmovementdate m_line docline m_issue m_line setqty m_issue getmovementqty m_line getm_product_id m_line tostring m_line tostring get balance return zero always balanced public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for pji pre issue projectwip dr inventory cr pre project account is either asset or wip depending on project type param as accounting schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual setc currency id as getc currency id m project project new m project get ctx m issue getc project id null string project category project get project category m product product m product get get ctx m issue getm product id line pointers fact line dr null fact line cr null issue cost big decimal cost null if m issue getm inoutline id 0 cost getpo cost as else if m issue gets timeexpenseline id 0 cost get labor cost as if cost null standard product costs cost m line get product costs as getad org id false project dr int acct type accttype projectwip if m project projectcategory assetproject equals project category acct type accttype projectasset dr fact create line m line get account acct type as as getc currency id cost null dr set qty m line get qty negate inventory cr acct type product cost accttype p asset if product is service acct type product cost accttype p expense cr fact create line m line m line get account acct type as as getc currency id null cost cr setm locator id m line getm locator id cr set location from locator m line getm locator id true from loc array list fact facts new array list fact facts add fact return facts arraylist createfacts macctschema post_actual setc_currency_id getc_currency_id mproject mproject getctx m_issue getc_project_id projectcategory getprojectcategory mproduct mproduct getctx m_issue getm_product_id factline factline bigdecimal m_issue getm_inoutline_id getpocost m_issue gets_timeexpenseline_id getlaborcost m_line getproductcosts getad_org_id accttype accttype_projectwip mproject projectcategory_assetproject projectcategory accttype accttype_projectasset createline m_line getaccount accttype getc_currency_id setqty m_line getqty accttype productcost accttype_p_asset isservice accttype productcost accttype_p_expense createline m_line m_line getaccount accttype getc_currency_id setm_locator_id m_line getm_locator_id setlocationfromlocator m_line getm_locator_id arraylist arraylist get po costs in currency of acct schema param as account schema return unit po cost private big decimal getpo cost m acct schema as big decimal ret value null uses po date string sql select currency convert ol price actual o c currency id o date ordered o c conversiontype id from c orderline ol inner join m inoutline iol on iol c orderline id ol c orderline id inner join c order o on o c order id ol c order id where iol m inoutline id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 as getc currency id pstmt set int 2 getad client id pstmt set int 3 getad org id pstmt set int 4 m issue getm inoutline id result set rs pstmt execute query if rs next ret value rs get big decimal 1 log fine po cost ret value else log warning not found for m inoutline id m issue getm inoutline id rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value acctschema bigdecimal getpocost macctschema bigdecimal retvalue currencyconvert priceactual c_currency_id dateordered c_conversiontype_id c_orderline m_inoutline c_orderline_id c_orderline_id c_order c_order_id c_order_id m_inoutline_id preparedstatement preparestatement setint getc_currency_id setint getad_client_id setint getad_org_id setint m_issue getm_inoutline_id resultset executequery retvalue getbigdecimal pocost retvalue m_inoutline_id m_issue getm_inoutline_id retvalue get labor cost from expense report param as account schema return unit labor cost private big decimal get labor cost m acct schema as big decimal ret value null todo labor cost return ret value bigdecimal getlaborcost macctschema bigdecimal retvalue retvalue bug 1564423 no document no neither name of c projectissue public string get document no m project issue pi m project issue p po m project proj new m project get ctx pi getc project id m trxname return proj get name documentno c_projectissue getdocumentno mprojectissue mprojectissue p_po mproject mproject getctx getc_project_id m_trxname getname standard constructor public x c taxdeclarationacct properties ctx int c taxdeclarationacct id string trx name super ctx c taxdeclarationacct id trx name if c taxdeclarationacct id 0 setc acctschema id 0 setc taxdeclarationacct id 0 setc taxdeclaration id 0 setfact acct id 0 x_c_taxdeclarationacct c_taxdeclarationacct_id trxname c_taxdeclarationacct_id trxname c_taxdeclarationacct_id setc_acctschema_id setc_taxdeclarationacct_id setc_taxdeclaration_id setfact_acct_id load constructor public x c taxdeclarationacct properties ctx result set rs string trx name super ctx rs trx name x_c_taxdeclarationacct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c taxdeclarationacct append get id append return sb to string tostring stringbuffer stringbuffer x_c_taxdeclarationacct get_id tostring public static final int account id ad reference id 331 set account account used public void setaccount id int account id throw new illegal argument exception account id is virtual column account_id_ad_reference_id setaccount_id account_id illegalargumentexception account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr throw new illegal argument exception amt acct cr is virtual column setamtacctcr bigdecimal amtacctcr illegalargumentexception amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr throw new illegal argument exception amt acct dr is virtual column setamtacctdr bigdecimal amtacctdr illegalargumentexception amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set source credit source credit amount public void set amt source cr big decimal amt source cr throw new illegal argument exception amt source cr is virtual column setamtsourcecr bigdecimal amtsourcecr illegalargumentexception amtsourcecr get source credit source credit amount public big decimal get amt source cr big decimal bd big decimal get value amt source cr if bd null return env zero return bd bigdecimal getamtsourcecr bigdecimal bigdecimal get_value amtsourcecr set source debit source debit amount public void set amt source dr big decimal amt source dr throw new illegal argument exception amt source dr is virtual column setamtsourcedr bigdecimal amtsourcedr illegalargumentexception amtsourcedr get source debit source debit amount public big decimal get amt source dr big decimal bd big decimal get value amt source dr if bd null return env zero return bd bigdecimal getamtsourcedr bigdecimal bigdecimal get_value amtsourcedr set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id throw new illegal argument exception c bpartner id is virtual column setc_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id throw new illegal argument exception c currency id is virtual column setc_currency_id c_currency_id illegalargumentexception c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set tax declaration accounting tax accounting reconciliation public void setc taxdeclarationacct id int c taxdeclarationacct id if c taxdeclarationacct id 1 throw new illegal argument exception c taxdeclarationacct id is mandatory set valuenocheck c taxdeclarationacct id new integer c taxdeclarationacct id setc_taxdeclarationacct_id c_taxdeclarationacct_id c_taxdeclarationacct_id illegalargumentexception c_taxdeclarationacct_id set_valuenocheck c_taxdeclarationacct_id c_taxdeclarationacct_id get tax declaration accounting tax accounting reconciliation public int getc taxdeclarationacct id integer ii integer get value c taxdeclarationacct id if ii null return 0 return ii int value getc_taxdeclarationacct_id get_value c_taxdeclarationacct_id intvalue set tax declaration define the declaration to the tax authorities public void setc taxdeclaration id int c taxdeclaration id if c taxdeclaration id 1 throw new illegal argument exception c taxdeclaration id is mandatory set valuenocheck c taxdeclaration id new integer c taxdeclaration id setc_taxdeclaration_id c_taxdeclaration_id c_taxdeclaration_id illegalargumentexception c_taxdeclaration_id set_valuenocheck c_taxdeclaration_id c_taxdeclaration_id get tax declaration define the declaration to the tax authorities public int getc taxdeclaration id integer ii integer get value c taxdeclaration id if ii null return 0 return ii int value getc_taxdeclaration_id get_value c_taxdeclaration_id intvalue set tax tax identifier public void setc tax id int c tax id throw new illegal argument exception c tax id is virtual column setc_tax_id c_tax_id illegalargumentexception c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set account date accounting date public void set date acct timestamp date acct throw new illegal argument exception date acct is virtual column setdateacct dateacct illegalargumentexception dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set accounting fact public void setfact acct id int fact acct id if fact acct id 1 throw new illegal argument exception fact acct id is mandatory set valuenocheck fact acct id new integer fact acct id setfact_acct_id fact_acct_id fact_acct_id illegalargumentexception fact_acct_id set_valuenocheck fact_acct_id fact_acct_id get accounting fact public int getfact acct id integer ii integer get value fact acct id if ii null return 0 return ii int value getfact_acct_id get_value fact_acct_id intvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue standard constructor public x k categoryvalue properties ctx int k categoryvalue id string trx name super ctx k categoryvalue id trx name if k categoryvalue id 0 setk categoryvalue id 0 setk category id 0 set name null x_k_categoryvalue k_categoryvalue_id trxname k_categoryvalue_id trxname k_categoryvalue_id setk_categoryvalue_id setk_category_id setname load constructor public x k categoryvalue properties ctx result set rs string trx name super ctx rs trx name x_k_categoryvalue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k categoryvalue append get id append return sb to string tostring stringbuffer stringbuffer x_k_categoryvalue get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set category value the value of the category public void setk categoryvalue id int k categoryvalue id if k categoryvalue id 1 throw new illegal argument exception k categoryvalue id is mandatory set valuenocheck k categoryvalue id new integer k categoryvalue id setk_categoryvalue_id k_categoryvalue_id k_categoryvalue_id illegalargumentexception k_categoryvalue_id set_valuenocheck k_categoryvalue_id k_categoryvalue_id get category value the value of the category public int getk categoryvalue id integer ii integer get value k categoryvalue id if ii null return 0 return ii int value getk_categoryvalue_id get_value k_categoryvalue_id intvalue set knowledge category knowledge category public void setk category id int k category id if k category id 1 throw new illegal argument exception k category id is mandatory set valuenocheck k category id new integer k category id setk_category_id k_category_id k_category_id illegalargumentexception k_category_id set_valuenocheck k_category_id k_category_id get knowledge category knowledge category public int getk category id integer ii integer get value k category id if ii null return 0 return ii int value getk_category_id get_value k_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname constructor see init public pos panel super new grid bag layout m focusmgr new pos keyboard focus manager keyboard focus manager set current keyboard focus manager m focusmgr pospanel gridbaglayout m_focusmgr poskeyboardfocusmanager keyboardfocusmanager setcurrentkeyboardfocusmanager m_focusmgr initialize panel param window no window param frame parent frame public void init int window no form frame frame m salesrep id env getad user id m ctx log info init salesrep id m salesrep id m windowno window no m frame frame try if dyn init dispose frame dispose return frame get content pane add this border layout center frame get content pane add f status border layout south this set preferred size new dimension 800 20 600 20 catch exception e log log level severe init e log config pos panel init get preferred size m focusmgr start windowno windowno formframe m_salesrep_id getad_user_id m_ctx salesrep_id m_salesrep_id m_windowno windowno m_frame dyninit getcontentpane borderlayout getcontentpane f_status borderlayout setpreferredsize pospanel getpreferredsize m_focusmgr dispose free resources public void dispose if m focusmgr null m focusmgr stop m focusmgr null if f bpartner null f bpartner dispose f bpartner null if f salesrep null f salesrep dispose f salesrep null if f curline null f curline dispose f curline null if f product null f product dispose f product null if f lines null f lines dispose f lines null if f functionkeys null f functionkeys dispose f functionkeys null if f checkout null f checkout dispose f checkout null if f basickeys null f basickeys dispose f basickeys null if f queryproduct null f queryproduct dispose f queryproduct null if f querybpartner null f querybpartner dispose f querybpartner null if m frame null m frame dispose m frame null m ctx null m_focusmgr m_focusmgr m_focusmgr f_bpartner f_bpartner f_bpartner f_salesrep f_salesrep f_salesrep f_curline f_curline f_curline f_product f_product f_product f_lines f_lines f_lines f_functionkeys f_functionkeys f_functionkeys f_checkout f_checkout f_checkout f_basickeys f_basickeys f_basickeys f_queryproduct f_queryproduct f_queryproduct f_querybpartner f_querybpartner f_querybpartner m_frame m_frame m_frame m_ctx dynamic init pos panel has a grid bag layout the sub panels return their position private boolean dyn init if setmpos return false create sub panels f bpartner new subb partner this add f bpartner f bpartner get grid bag constraints f salesrep new sub sales rep this add f salesrep f salesrep get grid bag constraints f curline new sub current line this add f curline f curline get grid bag constraints f product new sub product this add f product f product get grid bag constraints f lines new sub lines this add f lines f lines get grid bag constraints f functionkeys new sub function keys this add f functionkeys f functionkeys get grid bag constraints f checkout new sub checkout this add f checkout f checkout get grid bag constraints f basickeys new sub basic keys this add f basickeys f basickeys get grid bag constraints query f queryproduct new query product this add f queryproduct f queryproduct get grid bag constraints f querybpartner new queryb partner this add f querybpartner f querybpartner get grid bag constraints new order return true pospanel gridbaglayout dyninit f_bpartner subbpartner f_bpartner f_bpartner getgridbagconstraints f_salesrep subsalesrep f_salesrep f_salesrep getgridbagconstraints f_curline subcurrentline f_curline f_curline getgridbagconstraints f_product subproduct f_product f_product getgridbagconstraints f_lines sublines f_lines f_lines getgridbagconstraints f_functionkeys subfunctionkeys f_functionkeys f_functionkeys getgridbagconstraints f_checkout subcheckout f_checkout f_checkout getgridbagconstraints f_basickeys subbasickeys f_basickeys f_basickeys getgridbagconstraints f_queryproduct queryproduct f_queryproduct f_queryproduct getgridbagconstraints f_querybpartner querybpartner f_querybpartner f_querybpartner getgridbagconstraints neworder set mpos return true if found set private boolean setmpos mpos poss null if m salesrep id 100 super user poss getpo ss 0 else poss getpo ss m salesrep id if poss length 0 a dialog error m windowno m frame nopos for user return false else if poss length 1 p pos poss 0 return true select pos string msg msg get msg m ctx selectpos string title env get header m ctx m windowno object selection j option pane show input dialog m frame msg title j option pane question message null poss poss 0 if selection null p pos mpos selection return true return false m_salesrep_id superuser getposs getposs m_salesrep_id adialog m_windowno m_frame noposforuser p_pos getmsg m_ctx getheader m_ctx m_windowno joptionpane showinputdialog m_frame joptionpane question_message p_pos get po ss for specific sales rep or all param salesrep id return array of pos private mpos getpo ss int salesrep id array list mpos list new array list mpos string sql select from c pos where salesrep id if salesrep id 0 sql select from c pos where ad client id prepared statement pstmt null try pstmt db prepare statement sql null if salesrep id 0 pstmt set int 1 m salesrep id else pstmt set int 1 env getad client id m ctx result set rs pstmt execute query while rs next list add new mpos m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null mpos ret value new mpos list size list to array ret value return ret value poss salesrep_id getposs salesrep_id arraylist arraylist c_pos salesrep_id salesrep_id c_pos ad_client_id preparedstatement preparestatement salesrep_id setint m_salesrep_id setint getad_client_id m_ctx resultset executequery m_ctx retvalue toarray retvalue retvalue set visible param a flag visible public void set visible boolean a flag super set visible a flag f product f name request focus aflag setvisible aflag setvisible aflag f_product f_name requestfocus open query window param panel public void open query c panel panel f checkout set visible false f basickeys set visible false f lines set visible false f functionkeys set visible false panel set visible true openquery cpanel f_checkout setvisible f_basickeys setvisible f_lines setvisible f_functionkeys setvisible setvisible close query window param panel public void close query c panel panel panel set visible false f checkout set visible true f basickeys set visible true f lines set visible true f functionkeys set visible true closequery cpanel setvisible f_checkout setvisible f_basickeys setvisible f_lines setvisible f_functionkeys setvisible get today s date return date public timestamp get today return m today gettoday m_today new order public void new order log info pos pabel new order f bpartner setc bpartner id 0 f curline new line f product f name request focus neworder pospabel neworder f_bpartner setc_bpartner_id f_curline newline f_product f_name requestfocus obscure clear value obscure digits but last 4 param clear value clear value return obscured value public static string obscure string clear value obscure ob new obscure clear value return ob get obscured value clearvalue clearvalue clearvalue getobscuredvalue obscure clear value param clear value clear value param obscure type obscure type return obscured value public static string obscure string clear value string obscure type obscure ob new obscure clear value obscure type return ob get obscured value clearvalue obscuretype clearvalue obscuretype clearvalue obscuretype getobscuredvalue obscure public obscure obscure obscure digits but last 4 param clear value clear value public obscure string clear value set clear value clear value clearvalue clearvalue setclearvalue clearvalue obscure param clear value clear value param obscure type obscure type public obscure string clear value string obscure type set clear value clear value set type obscure type clearvalue obscuretype clearvalue obscuretype setclearvalue clearvalue settype obscuretype set type param obscure type obscure type public void set type string obscure type if obscure type null obscure type equals 904 obscure type equals 944 obscure type equals a44 obscure type equals a04 m type obscure type m obscuredvalue null return throw new illegal argument exception obscure type invalid value reference id 291 904 944 a44 a04 obscuretype settype obscuretype obscuretype obscuretype obscuretype obscuretype obscuretype m_type obscuretype m_obscuredvalue illegalargumentexception obscuretype reference_id get obscure type return type public string get type return m type gettype m_type get clear value return returns the clear value public string get clear value return m clearvalue getclearvalue m_clearvalue set clear value param clear value the clear value to set public void set clear value string clear value m clearvalue clear value m obscuredvalue null clearvalue clearvalue setclearvalue clearvalue m_clearvalue clearvalue m_obscuredvalue get obscured value param clear value the clear value to set return returns the obscured value public string get obscured value string clear value set clear value clear value return get obscured value clearvalue clearvalue obscuredvalue getobscuredvalue clearvalue setclearvalue clearvalue getobscuredvalue get obscured value return returns the obscured value public string get obscured value if m obscuredvalue null return m obscuredvalue if m clearvalue null m clearvalue length 0 return m clearvalue boolean alpha m type char at 0 a int clear start integer parse int m type substring 1 2 int clear end integer parse int m type substring 2 char chars m clearvalue to char array int length chars length string buffer sb new string buffer length for int i 0 i length i char c chars i if i clear start sb append c else if i length clear end sb append c else if alpha character is digit c sb append c else sb append m obscuredvalue sb to string return m obscuredvalue obscuredvalue getobscuredvalue m_obscuredvalue m_obscuredvalue m_clearvalue m_clearvalue m_clearvalue m_type charat clearstart parseint m_type clearend parseint m_type m_clearvalue tochararray stringbuffer stringbuffer clearstart clearend isdigit m_obscuredvalue tostring m_obscuredvalue test public static void main string args system out println obscure obscure 1a2b3c4d5e6f7g8h9 get invoice line referencing in out line param s line shipment line return first invoice line public static m invoice line get of in out line m in out line s line if s line null return null m invoice line ret value null string sql select from c invoiceline where m inoutline id prepared statement pstmt null try pstmt db prepare statement sql s line get trxname pstmt set int 1 s line getm inoutline id result set rs pstmt execute query if rs next ret value new m invoice line s line get ctx rs s line get trxname if rs next s log warning more than one c invoiceline of s line rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value inout sline minvoiceline getofinoutline minoutline sline sline minvoiceline retvalue c_invoiceline m_inoutline_id preparedstatement preparestatement sline get_trxname setint sline getm_inoutline_id resultset executequery retvalue minvoiceline sline getctx sline get_trxname s_log c_invoiceline sline s_log retvalue invoice line constructor param ctx context param c invoiceline id invoice line or 0 param trx name transaction name public m invoice line properties ctx int c invoiceline id string trx name super ctx c invoiceline id trx name if c invoiceline id 0 set is description false set is printed true set line net amt env zero set price entered env zero set price actual env zero set price limit env zero set price list env zero setm attributesetinstance id 0 set tax amt env zero set qty entered env zero set qty invoiced env zero c_invoiceline_id trxname minvoiceline c_invoiceline_id trxname c_invoiceline_id trxname c_invoiceline_id setisdescription setisprinted setlinenetamt setpriceentered setpriceactual setpricelimit setpricelist setm_attributesetinstance_id settaxamt setqtyentered setqtyinvoiced parent constructor param invoice parent public m invoice line m invoice invoice this invoice get ctx 0 invoice get trxname if invoice get id 0 throw new illegal argument exception header not saved set client org invoice getad client id invoice getad org id setc invoice id invoice getc invoice id set invoice invoice minvoiceline minvoice getctx get_trxname get_id illegalargumentexception setclientorg getad_client_id getad_org_id setc_invoice_id getc_invoice_id setinvoice load constructor param ctx context param rs result set record public m invoice line properties ctx result set rs string trx name super ctx rs trx name minvoiceline resultset trxname trxname set defaults from order called also from copy lines from invoice does not set parent param invoice invoice public void set invoice m invoice invoice m parent invoice m m pricelist id invoice getm pricelist id m dateinvoiced invoice get date invoiced m c bpartner id invoice getc bpartner id m c bpartner location id invoice getc bpartner location id m issotrx invoice isso trx m precision new integer invoice get precision setinvoice minvoice m_parent m_m_pricelist_id getm_pricelist_id m_dateinvoiced getdateinvoiced m_c_bpartner_id getc_bpartner_id m_c_bpartner_location_id getc_bpartner_location_id m_issotrx issotrx m_precision getprecision get parent return parent public m invoice get parent if m parent null m parent new m invoice get ctx getc invoice id get trxname return m parent minvoice getparent m_parent m_parent minvoice getctx getc_invoice_id get_trxname m_parent set values from order line does not set quantity param o line line public void set order line m order line o line setc orderline id o line getc orderline id set line o line get line set is description o line is description set description o line get description setc charge id o line getc charge id setm product id o line getm product id setm attributesetinstance id o line getm attributesetinstance id sets resourceassignment id o line gets resourceassignment id setc uom id o line getc uom id set price entered o line get price entered set price actual o line get price actual set price limit o line get price limit set price list o line get price list setc tax id o line getc tax id set line net amt o line get line net amt oline setorderline morderline oline setc_orderline_id oline getc_orderline_id setline oline getline setisdescription oline isdescription setdescription oline getdescription setc_charge_id oline getc_charge_id setm_product_id oline getm_product_id setm_attributesetinstance_id oline getm_attributesetinstance_id sets_resourceassignment_id oline gets_resourceassignment_id setc_uom_id oline getc_uom_id setpriceentered oline getpriceentered setpriceactual oline getpriceactual setpricelimit oline getpricelimit setpricelist oline getpricelist setc_tax_id oline getc_tax_id setlinenetamt oline getlinenetamt set values from shipment line does not set quantity param s line ship line public void set ship line m in out line s line setm inoutline id s line getm inoutline id setc orderline id s line getc orderline id set line s line get line set is description s line is description set description s line get description setm product id s line getm product id setc uom id s line getc uom id setm attributesetinstance id s line getm attributesetinstance id sets resourceassignment id s line gets resourceassignment id setc charge id s line getc charge id int c orderline id s line getc orderline id if c orderline id 0 m order line o line new m order line get ctx c orderline id get trxname sets resourceassignment id o line gets resourceassignment id set price entered o line get price entered set price actual o line get price actual set price limit o line get price limit set price list o line get price list setc tax id o line getc tax id set line net amt o line get line net amt else set price set tax sline setshipline minoutline sline setm_inoutline_id sline getm_inoutline_id setc_orderline_id sline getc_orderline_id setline sline getline setisdescription sline isdescription setdescription sline getdescription setm_product_id sline getm_product_id setc_uom_id sline getc_uom_id setm_attributesetinstance_id sline getm_attributesetinstance_id sets_resourceassignment_id sline gets_resourceassignment_id setc_charge_id sline getc_charge_id c_orderline_id sline getc_orderline_id c_orderline_id morderline oline morderline getctx c_orderline_id get_trxname sets_resourceassignment_id oline gets_resourceassignment_id setpriceentered oline getpriceentered setpriceactual oline getpriceactual setpricelimit oline getpricelimit setpricelist oline getpricelist setc_tax_id oline getc_tax_id setlinenetamt oline getlinenetamt setprice settax add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription set m attributesetinstance id param m attributesetinstance id id public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 0 is valid id set value m attributesetinstance id new integer 0 else super setm attributesetinstance id m attributesetinstance id m_attributesetinstance_id m_attributesetinstance_id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_value m_attributesetinstance_id setm_attributesetinstance_id m_attributesetinstance_id set price for product and price list uses standard so price list of not set by invoice constructor public void set price if getm product id 0 is description return if m m pricelist id 0 m c bpartner id 0 set invoice get parent if m m pricelist id 0 m c bpartner id 0 throw new illegal state exception set price price list unknown set price m m pricelist id m c bpartner id pricelist setprice getm_product_id isdescription m_m_pricelist_id m_c_bpartner_id setinvoice getparent m_m_pricelist_id m_c_bpartner_id illegalstateexception setprice pricelist setprice m_m_pricelist_id m_c_bpartner_id set price for product and price list param m pricelist id price list param c bpartner id business partner public void set price int m pricelist id int c bpartner id if getm product id 0 is description return log fine m pricelist id m pricelist id m productpricing new m product pricing getm product id c bpartner id get qty invoiced m issotrx m productpricing setm pricelist id m pricelist id m productpricing set price date m dateinvoiced set price actual m productpricing get price std set price list m productpricing get price list set price limit m productpricing get price limit if get qty entered compare to get qty invoiced 0 set price entered get price actual else set price entered get price actual multiply get qty invoiced divide get qty entered 6 big decimal round half up precision if getc uom id 0 setc uom id m productpricing getc uom id m priceset true pricelist m_pricelist_id c_bpartner_id setprice m_pricelist_id c_bpartner_id getm_product_id isdescription m_pricelist_id m_pricelist_id m_productpricing mproductpricing getm_product_id c_bpartner_id getqtyinvoiced m_issotrx m_productpricing setm_pricelist_id m_pricelist_id m_productpricing setpricedate m_dateinvoiced setpriceactual m_productpricing getpricestd setpricelist m_productpricing getpricelist setpricelimit m_productpricing getpricelimit getqtyentered compareto getqtyinvoiced setpriceentered getpriceactual setpriceentered getpriceactual getqtyinvoiced getqtyentered bigdecimal round_half_up getc_uom_id setc_uom_id m_productpricing getc_uom_id m_priceset set price entered actual use this method if the line uom is the product uom param price actual price public void set price big decimal price actual set price entered price actual set price actual price actual priceactual setprice bigdecimal priceactual setpriceentered priceactual setpriceactual priceactual set price actual actual price is not updateable param price actual actual price public void set price actual big decimal price actual if price actual null throw new illegal argument exception price actual is mandatory set valuenocheck price actual price actual priceactual setpriceactual bigdecimal priceactual priceactual illegalargumentexception priceactual set_valuenocheck priceactual priceactual set tax requires warehouse return true if found public boolean set tax if is description return true int m warehouse id env get context as int get ctx m warehouse id int c tax id tax get get ctx getm product id getc charge id m dateinvoiced m dateinvoiced getad org id m warehouse id m c bpartner location id should be bill to m c bpartner location id m issotrx if c tax id 0 log log level severe no tax found return false setc tax id c tax id if m issotrx return true settax isdescription m_warehouse_id getcontextasint getctx m_warehouse_id c_tax_id getctx getm_product_id getc_charge_id m_dateinvoiced m_dateinvoiced getad_org_id m_warehouse_id m_c_bpartner_location_id m_c_bpartner_location_id m_issotrx c_tax_id setc_tax_id c_tax_id m_issotrx calculare tax amt assumes line net is calculated public void set tax amt big decimal tax amt env zero if getc tax id 0 return set line net amt m tax tax m tax get get ctx getc tax id if tax is document level m issotrx ar inv tax return tax amt tax calculate tax get line net amt is tax included get precision if is tax included set line total amt get line net amt else set line total amt get line net amt add tax amt super set tax amt tax amt settaxamt bigdecimal taxamt getc_tax_id setlinenetamt mtax mtax getctx getc_tax_id isdocumentlevel m_issotrx taxamt calculatetax getlinenetamt istaxincluded getprecision istaxincluded setlinetotalamt getlinenetamt setlinetotalamt getlinenetamt taxamt settaxamt taxamt calculate extended amt may or may not include tax public void set line net amt calculations rounding big decimal net get price actual multiply get qty invoiced if net scale get precision net net set scale get precision big decimal round half up super set line net amt net setlinenetamt bigdecimal getpriceactual getqtyinvoiced getprecision setscale getprecision bigdecimal round_half_up setlinenetamt set qty invoiced entered param qty invoiced ordered public void set qty int qty set qty new big decimal qty setqty setqty bigdecimal set qty invoiced param qty invoiced entered public void set qty big decimal qty set qty entered qty set qty invoiced qty setqty bigdecimal setqtyentered setqtyinvoiced set product param product product public void set product m product product m product product if m product null setm product id m product getm product id setc uom id m product getc uom id else setm product id 0 setc uom id 0 setm attributesetinstance id 0 setproduct mproduct m_product m_product setm_product_id m_product getm_product_id setc_uom_id m_product getc_uom_id setm_product_id setc_uom_id setm_attributesetinstance_id set m product id param m product id product public void setm product id int m product id boolean setuom if setuom set product m product get get ctx m product id else super setm product id m product id setm attributesetinstance id 0 m_product_id m_product_id setm_product_id m_product_id setproduct mproduct getctx m_product_id setm_product_id m_product_id setm_attributesetinstance_id set product and uom param m product id product param c uom id uom public void setm product id int m product id int c uom id super setm product id m product id super setc uom id c uom id setm attributesetinstance id 0 m_product_id c_uom_id setm_product_id m_product_id c_uom_id setm_product_id m_product_id setc_uom_id c_uom_id setm_attributesetinstance_id get c project id return project public int getc project id int ii super getc project id if ii 0 ii get parent getc project id return ii c_project_id getc_project_id getc_project_id getparent getc_project_id get c activity id return activity public int getc activity id int ii 0 super getc activity id if ii 0 ii get parent getc activity id return ii c_activity_id getc_activity_id getc_activity_id getparent getc_activity_id get c campaign id return campaign public int getc campaign id int ii 0 super getc campaign id if ii 0 ii get parent getc campaign id return ii c_campaign_id getc_campaign_id getc_campaign_id getparent getc_campaign_id get user2 id return user2 public int getuser1 id int ii 0 super getuser1 id if ii 0 ii get parent getuser1 id return ii user2_id getuser1_id getuser1_id getparent getuser1_id get user2 id return user2 public int getuser2 id int ii 0 super getuser2 id if ii 0 ii get parent getuser2 id return ii user2_id getuser2_id getuser2_id getparent getuser2_id string representation return info public string to string string buffer sb new string buffer m invoice line append get id append append get line append qty invoiced append get qty invoiced append line net amt append get line net amt append return sb to string tostring stringbuffer stringbuffer minvoiceline get_id getline qtyinvoiced getqtyinvoiced linenetamt getlinenetamt tostring get product charge name return name public string get name if m name null string sql select coalesce p name c name from c invoiceline il left outer join m product p on il m product id p m product id left outer join c charge c on il c charge id c c charge id where c invoiceline id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoiceline id result set rs pstmt execute query if rs next m name rs get string 1 rs close pstmt close pstmt null if m name null m name catch exception e log log level severe get name e finally try if pstmt null pstmt close catch exception e pstmt null return m name getname m_name c_invoiceline m_product m_product_id m_product_id c_charge c_charge_id c_charge_id c_invoiceline_id preparedstatement preparestatement get_trxname setint getc_invoiceline_id resultset executequery m_name getstring m_name m_name getname m_name set temporary cached name param temp name cached name public void set name string temp name m name temp name tempname setname tempname m_name tempname get description text for jsp access vs is description return description public string get description text return super get description isdescription getdescriptiontext getdescription get currency precision return precision public int get precision if m precision null return m precision int value string sql select c std precision from c currency c inner join c invoice x on x c currency id c c currency id where x c invoice id int i db getsql value get trxname sql getc invoice id if i 0 log warning get precision i set to 2 i 2 m precision new integer i return m precision int value getprecision m_precision m_precision intvalue stdprecision c_currency c_invoice c_currency_id c_currency_id c_invoice_id getsqlvalue get_trxname getc_invoice_id getprecision m_precision m_precision intvalue is tax included in amount public boolean is tax included if m m pricelist id 0 m m pricelist id db getsql value get trxname select m pricelist id from c invoice where c invoice id getc invoice id m price list pl m price list get get ctx m m pricelist id get trxname return pl is tax included istaxincluded m_m_pricelist_id m_m_pricelist_id getsqlvalue get_trxname m_pricelist_id c_invoice c_invoice_id getc_invoice_id mpricelist mpricelist getctx m_m_pricelist_id get_trxname istaxincluded before save param new record return true if save protected boolean before save boolean new record log fine new new record charge if getc charge id 0 if getm product id 0 setm product id 0 else set product price if m priceset env zero compare to get price actual 0 env zero compare to get price list 0 set price set tax if getc tax id 0 set tax get line no if get line 0 string sql select coalesce max line 0 10 from c invoiceline where c invoice id int ii db getsql value get trxname sql getc invoice id set line ii uom if getc uom id 0 int c uom id muom getdefault uom id get ctx if c uom id 0 setc uom id c uom id calculations rounding set line net amt if get tax amt compare to env zero 0 set tax amt return true newrecord beforesave newrecord newrecord getc_charge_id getm_product_id setm_product_id m_priceset compareto getpriceactual compareto getpricelist setprice getc_tax_id settax getline c_invoiceline c_invoice_id getsqlvalue get_trxname getc_invoice_id setline getc_uom_id c_uom_id getdefault_uom_id getctx c_uom_id setc_uom_id c_uom_id setlinenetamt gettaxamt compareto settaxamt after save param new record new param success success return saved protected boolean after save boolean new record boolean success if success return success if new record is valuechanged c tax id recalculate tax for old tax m invoice tax tax m invoice tax get this get precision true get trxname old tax if tax null if tax calculate tax from lines return false if tax save get trxname return true return update header tax newrecord aftersave newrecord newrecord is_valuechanged c_tax_id minvoicetax minvoicetax getprecision get_trxname calculatetaxfromlines get_trxname updateheadertax after delete param success success return deleted protected boolean after delete boolean success if success return success return update header tax afterdelete updateheadertax update tax header private boolean update header tax recalculate tax for this tax m invoice tax tax m invoice tax get this get precision false get trxname current tax if tax null if tax calculate tax from lines return false if tax save get trxname return false update invoice header string sql update c invoice i set total lines select coalesce sum line net amt 0 from c invoiceline il where i c invoice id il c invoice id where c invoice id getc invoice id int no db execute update sql get trxname if no 1 log warning 1 no if is tax included sql update c invoice i set grand total total lines where c invoice id getc invoice id else sql update c invoice i set grand total total lines select coalesce sum tax amt 0 from c invoicetax it where i c invoice id it c invoice id where c invoice id getc invoice id no db execute update sql get trxname if no 1 log warning 2 no m parent null return no 1 updateheadertax minvoicetax minvoicetax getprecision get_trxname calculatetaxfromlines get_trxname c_invoice totallines linenetamt c_invoiceline c_invoice_id c_invoice_id c_invoice_id getc_invoice_id executeupdate get_trxname istaxincluded c_invoice grandtotal totallines c_invoice_id getc_invoice_id c_invoice grandtotal totallines taxamt c_invoicetax c_invoice_id c_invoice_id c_invoice_id getc_invoice_id executeupdate get_trxname m_parent allocate landed costs return error message or public string allocate landed costs if is processed return processed m landed cost lcs m landed cost get landed costs this if lcs length 0 return string sql delete c landedcostallocation where c invoiceline id getc invoiceline id int no db execute update sql get trxname if no 0 log info deleted no int inserted 0 single criteria if lcs length 1 m landed cost lc lcs 0 if lc getm inout id 0 create list array list m in out line list new array list m in out line m in out ship new m in out get ctx lc getm inout id get trxname m in out line lines ship get lines for int i 0 i lines length i if lines i is description lines i getm product id 0 continue if lc getm product id 0 lc getm product id lines i getm product id list add lines i if list size 0 return no matching lines with product in shipment calculate total base big decimal total env zero for int i 0 i list size i m in out line iol m in out line list get i total total add iol get base lc get landed cost distribution if total signum 0 return total of base values is 0 lc get landed cost distribution create allocations for int i 0 i list size i m in out line iol m in out line list get i m landed cost allocation lca new m landed cost allocation this lc getm costelement id lca setm product id iol getm product id lca setm attributesetinstance id iol getm attributesetinstance id big decimal base iol get base lc get landed cost distribution lca set base base if base signum 0 double result get line net amt multiply base double value result total double value lca set amt result get precision if lca save return cannot save line allocation lca inserted log info inserted inserted allocate landed cost rounding return single line else if lc getm inoutline id 0 m in out line iol new m in out line get ctx lc getm inoutline id get trxname if iol is description iol getm product id 0 return invalid receipt line iol m landed cost allocation lca new m landed cost allocation this lc getm costelement id lca setm product id iol getm product id lca setm attributesetinstance id iol getm attributesetinstance id lca set amt get line net amt if lca save return return cannot save single line allocation lc single product else if lc getm product id 0 m landed cost allocation lca new m landed cost allocation this lc getm costelement id lca setm product id lc getm product id no asi lca set amt get line net amt if lca save return return cannot save product allocation lc else return no reference for lc multiple criteria string landed cost distribution lcs 0 get landed cost distribution int m costelement id lcs 0 getm costelement id for int i 0 i lcs length i m landed cost lc lcs i if landed cost distribution equals lc get landed cost distribution return multiple landed cost rules must have consistent landed cost distribution if lc getm product id 0 lc getm inout id 0 lc getm inoutline id 0 return multiple landed cost rules cannot directly allocate to a product if m costelement id lc getm costelement id return multiple landed cost rules cannot different cost elements create list array list m in out line list new array list m in out line for int ii 0 ii lcs length ii m landed cost lc lcs ii if lc getm inout id 0 lc getm inoutline id 0 entire receipt m in out ship new m in out get ctx lc getm inout id get trxname m in out line lines ship get lines for int i 0 i lines length i if lines i is description decription or no product lines i getm product id 0 continue if lc getm product id 0 no restriction or product match lc getm product id lines i getm product id list add lines i else if lc getm inoutline id 0 receipt line m in out line iol new m in out line get ctx lc getm inoutline id get trxname if iol is description iol getm product id 0 list add iol if list size 0 return no matching lines with product calculate total base big decimal total env zero for int i 0 i list size i m in out line iol m in out line list get i total total add iol get base landed cost distribution if total signum 0 return total of base values is 0 landed cost distribution create allocations for int i 0 i list size i m in out line iol m in out line list get i m landed cost allocation lca new m landed cost allocation this lcs 0 getm costelement id lca setm product id iol getm product id lca setm attributesetinstance id iol getm attributesetinstance id big decimal base iol get base landed cost distribution lca set base base if base signum 0 double result get line net amt multiply base double value result total double value lca set amt result get precision if lca save return cannot save line allocation lca inserted log info inserted inserted allocate landed cost rounding return allocatelandedcosts isprocessed mlandedcost mlandedcost getlandedcosts c_landedcostallocation c_invoiceline_id getc_invoiceline_id executeupdate get_trxname mlandedcost getm_inout_id arraylist minoutline arraylist minoutline minout minout getctx getm_inout_id get_trxname minoutline getlines isdescription getm_product_id getm_product_id getm_product_id getm_product_id bigdecimal minoutline minoutline getbase getlandedcostdistribution getlandedcostdistribution minoutline minoutline mlandedcostallocation mlandedcostallocation getm_costelement_id setm_product_id getm_product_id setm_attributesetinstance_id getm_attributesetinstance_id bigdecimal getbase getlandedcostdistribution setbase getlinenetamt doublevalue doublevalue setamt getprecision allocatelandedcostrounding getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname isdescription getm_product_id mlandedcostallocation mlandedcostallocation getm_costelement_id setm_product_id getm_product_id setm_attributesetinstance_id getm_attributesetinstance_id setamt getlinenetamt getm_product_id mlandedcostallocation mlandedcostallocation getm_costelement_id setm_product_id getm_product_id setamt getlinenetamt landedcostdistribution getlandedcostdistribution m_costelement_id getm_costelement_id mlandedcost landedcostdistribution getlandedcostdistribution getm_product_id getm_inout_id getm_inoutline_id m_costelement_id getm_costelement_id arraylist minoutline arraylist minoutline mlandedcost getm_inout_id getm_inoutline_id minout minout getctx getm_inout_id get_trxname minoutline getlines isdescription getm_product_id getm_product_id getm_product_id getm_product_id getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname isdescription getm_product_id bigdecimal minoutline minoutline getbase landedcostdistribution landedcostdistribution minoutline minoutline mlandedcostallocation mlandedcostallocation getm_costelement_id setm_product_id getm_product_id setm_attributesetinstance_id getm_attributesetinstance_id bigdecimal getbase landedcostdistribution setbase getlinenetamt doublevalue doublevalue setamt getprecision allocatelandedcostrounding allocate landed cost enforce rounding private void allocate landed cost rounding m landed cost allocation allocations m landed cost allocation get of invoice line get ctx getc invoiceline id get trxname m landed cost allocation largest amt allocation null big decimal allocation amt env zero for int i 0 i allocations length i m landed cost allocation allocation allocations i if largest amt allocation null allocation get amt compare to largest amt allocation get amt 0 largest amt allocation allocation allocation amt allocation amt add allocation get amt big decimal difference get line net amt subtract allocation amt if difference signum 0 largest amt allocation set amt largest amt allocation get amt add difference largest amt allocation save log config difference difference c landedcostallocation id largest amt allocation getc landedcostallocation id amt largest amt allocation get amt allocatelandedcostrounding mlandedcostallocation mlandedcostallocation getofinvoiceline getctx getc_invoiceline_id get_trxname mlandedcostallocation largestamtallocation bigdecimal allocationamt mlandedcostallocation largestamtallocation getamt compareto largestamtallocation getamt largestamtallocation allocationamt allocationamt getamt bigdecimal getlinenetamt allocationamt largestamtallocation setamt largestamtallocation getamt largestamtallocation c_landedcostallocation_id largestamtallocation getc_landedcostallocation_id largestamtallocation getamt standard constructor public x ad org properties ctx int ad org id string trx name super ctx ad org id trx name if ad org id 0 set is summary false set name null set value null x_ad_org ad_org_id trxname ad_org_id trxname ad_org_id setissummary setname setvalue load constructor public x ad org properties ctx result set rs string trx name super ctx rs trx name x_ad_org resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad org append get id append return sb to string tostring stringbuffer stringbuffer x_ad_org get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x c charge properties ctx int c charge id string trx name super ctx c charge id trx name if c charge id 0 setc charge id 0 setc taxcategory id 0 set charge amt env zero set is same currency false set is same tax false set is tax included false n set name null x_c_charge c_charge_id trxname c_charge_id trxname c_charge_id setc_charge_id setc_taxcategory_id setchargeamt setissamecurrency setissametax setistaxincluded setname load constructor public x c charge properties ctx result set rs string trx name super ctx rs trx name x_c_charge resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c charge append get id append return sb to string tostring stringbuffer stringbuffer x_c_charge get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 1 throw new illegal argument exception c charge id is mandatory set valuenocheck c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id illegalargumentexception c_charge_id set_valuenocheck c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt if charge amt null throw new illegal argument exception charge amt is mandatory set value charge amt charge amt setchargeamt bigdecimal chargeamt chargeamt illegalargumentexception chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set same currency public void set is same currency boolean is same currency set value is same currency new boolean is same currency setissamecurrency issamecurrency set_value issamecurrency issamecurrency get same currency public boolean is same currency object oo get value is same currency if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issamecurrency get_value issamecurrency booleanvalue set same tax use the same tax as the main transaction public void set is same tax boolean is same tax set value is same tax new boolean is same tax setissametax issametax set_value issametax issametax get same tax use the same tax as the main transaction public boolean is same tax object oo get value is same tax if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issametax get_value issametax booleanvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname string representation return info public string to string return remote updatevo test test table name sql tostring remoteupdatevo tablename private array elements new array public hash public void set size int new size keys set size new size elements set size new size setsize newsize setsize newsize setsize newsize public void set grow int grow by keys set grow grow by elements set grow grow by setgrow growby setgrow growby setgrow growby public synchronized void put string key object element try if contains key key elements add keys location key element else keys add key elements add element catch org apache ecs storage no such object exception nsoe containskey nosuchobjectexception public synchronized void remove string key try if contains key key elements remove keys location key elements remove elements location key catch org apache ecs storage no such object exception nsoe containskey nosuchobjectexception public int size return keys get current size getcurrentsize public boolean contains object element try elements location element return true catch org apache ecs storage no such object exception no such object return false nosuchobjectexception nosuchobject public enumeration keys return keys public boolean contains key string key try keys location key catch org apache ecs storage no such object exception no such object return false return true containskey nosuchobjectexception nosuchobject public enumeration elements return elements public object get string key try if contains key key return elements get keys location key catch org apache ecs storage no such object exception nsoe return null containskey nosuchobjectexception standard constructor public x c revenuerecognition plan properties ctx int c revenuerecognition plan id string trx name super ctx c revenuerecognition plan id trx name if c revenuerecognition plan id 0 setc acctschema id 0 setc currency id 0 setc invoiceline id 0 setc revenuerecognition id 0 setc revenuerecognition plan id 0 setp revenue acct 0 set recognized amt env zero set total amt env zero setunearnedrevenue acct 0 x_c_revenuerecognition_plan c_revenuerecognition_plan_id trxname c_revenuerecognition_plan_id trxname c_revenuerecognition_plan_id setc_acctschema_id setc_currency_id setc_invoiceline_id setc_revenuerecognition_id setc_revenuerecognition_plan_id setp_revenue_acct setrecognizedamt settotalamt setunearnedrevenue_acct load constructor public x c revenuerecognition plan properties ctx result set rs string trx name super ctx rs trx name x_c_revenuerecognition_plan resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c revenuerecognition plan append get id append return sb to string tostring stringbuffer stringbuffer x_c_revenuerecognition_plan get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 1 throw new illegal argument exception c invoiceline id is mandatory set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id illegalargumentexception c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set revenue recognition method for recording revenue public void setc revenuerecognition id int c revenuerecognition id if c revenuerecognition id 1 throw new illegal argument exception c revenuerecognition id is mandatory set valuenocheck c revenuerecognition id new integer c revenuerecognition id setc_revenuerecognition_id c_revenuerecognition_id c_revenuerecognition_id illegalargumentexception c_revenuerecognition_id set_valuenocheck c_revenuerecognition_id c_revenuerecognition_id get revenue recognition method for recording revenue public int getc revenuerecognition id integer ii integer get value c revenuerecognition id if ii null return 0 return ii int value getc_revenuerecognition_id get_value c_revenuerecognition_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc revenuerecognition id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_revenuerecognition_id set revenue recognition plan plan for recognizing or recording revenue public void setc revenuerecognition plan id int c revenuerecognition plan id if c revenuerecognition plan id 1 throw new illegal argument exception c revenuerecognition plan id is mandatory set valuenocheck c revenuerecognition plan id new integer c revenuerecognition plan id setc_revenuerecognition_plan_id c_revenuerecognition_plan_id c_revenuerecognition_plan_id illegalargumentexception c_revenuerecognition_plan_id set_valuenocheck c_revenuerecognition_plan_id c_revenuerecognition_plan_id get revenue recognition plan plan for recognizing or recording revenue public int getc revenuerecognition plan id integer ii integer get value c revenuerecognition plan id if ii null return 0 return ii int value getc_revenuerecognition_plan_id get_value c_revenuerecognition_plan_id intvalue set product revenue account for product revenue sales account public void setp revenue acct int p revenue acct set valuenocheck p revenue acct new integer p revenue acct setp_revenue_acct p_revenue_acct set_valuenocheck p_revenue_acct p_revenue_acct get product revenue account for product revenue sales account public int getp revenue acct integer ii integer get value p revenue acct if ii null return 0 return ii int value getp_revenue_acct get_value p_revenue_acct intvalue set recognized amount public void set recognized amt big decimal recognized amt if recognized amt null throw new illegal argument exception recognized amt is mandatory set valuenocheck recognized amt recognized amt setrecognizedamt bigdecimal recognizedamt recognizedamt illegalargumentexception recognizedamt set_valuenocheck recognizedamt recognizedamt get recognized amount public big decimal get recognized amt big decimal bd big decimal get value recognized amt if bd null return env zero return bd bigdecimal getrecognizedamt bigdecimal bigdecimal get_value recognizedamt set total amount total amount public void set total amt big decimal total amt if total amt null throw new illegal argument exception total amt is mandatory set valuenocheck total amt total amt settotalamt bigdecimal totalamt totalamt illegalargumentexception totalamt set_valuenocheck totalamt totalamt get total amount total amount public big decimal get total amt big decimal bd big decimal get value total amt if bd null return env zero return bd bigdecimal gettotalamt bigdecimal bigdecimal get_value totalamt set unearned revenue account for unearned revenue public void setunearnedrevenue acct int unearnedrevenue acct set valuenocheck unearnedrevenue acct new integer unearnedrevenue acct setunearnedrevenue_acct unearnedrevenue_acct set_valuenocheck unearnedrevenue_acct unearnedrevenue_acct get unearned revenue account for unearned revenue public int getunearnedrevenue acct integer ii integer get value unearnedrevenue acct if ii null return 0 return ii int value getunearnedrevenue_acct get_value unearnedrevenue_acct intvalue set need closing tag true public multi part element setneedclosingtag multipartelement prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals ad table id p ad table id big decimal para i get parameter int value else log log level severe unknown parameter name processinfoparameter getparameter getparametername ad_table_id p_ad_table_id bigdecimal getparameter intvalue perrform process return clear message throws exception protected string do it throws exception log info ad table id p ad table id get table info m table table new m table get ctx p ad table id get trxname if table get id 0 throw new illegal argument exception no ad table id p ad table id string table name table get table name if table name starts with i throw new illegal argument exception not an import table table name delete string sql delete from table name where ad client id getad client id int no db execute update sql get trxname string msg msg translate get ctx table name id no return msg doit ad_table_id p_ad_table_id m_table m_table getctx p_ad_table_id get_trxname get_id illegalargumentexception ad_table_id p_ad_table_id tablename gettablename tablename startswith illegalargumentexception tablename tablename ad_client_id getad_client_id executeupdate get_trxname getctx tablename _id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i log fine prepare para i string name para i get parameter name if para i get parameter null else if name equals due date p duedate timestamp para i get parameter else if name equals isso trx p issotrx y equals para i get parameter else if name equals c currency id p c currency id big decimal para i get parameter int value else if name equals c bp group id p c bp group id big decimal para i get parameter int value else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else if name equals is list invoices p islistinvoices y equals para i get parameter else log log level severe prepare unknown parameter name if p duedate null p duedate new timestamp system current time millis processinfoparameter getparameter getparametername getparameter duedate p_duedate getparameter issotrx p_issotrx getparameter c_currency_id p_c_currency_id bigdecimal getparameter intvalue c_bp_group_id p_c_bp_group_id bigdecimal getparameter intvalue c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue islistinvoices p_islistinvoices getparameter p_duedate p_duedate currenttimemillis do it return message throws exception protected string do it throws exception log info due date p duedate isso trx p issotrx c currency id p c currency id c bp group id p c bp group id c bpartner id p c bpartner id is list invoices p islistinvoices string buffer sql new string buffer sql append select bp c bp group id oi c bpartner id oi c invoice id oi c invoicepayschedule id oi c currency id oi isso trx 5 6 oi date invoiced oi net days oi due date oi days due 7 10 if p c currency id 0 sql append oi grand total oi paid amt oi open amt 11 13 else string s oi c currency id p c currency id oi date invoiced oi c conversiontype id oi ad client id oi ad org id sql append currency convert oi grand total append s 11 append currency convert oi paid amt append s append currency convert oi open amt append s sql append from rv openitem oi inner join c bpartner bp on oi c bpartner id bp c bpartner id where oi is so trx append p issotrx y n if p c bpartner id 0 sql append and oi c bpartner id append p c bpartner id else if p c bp group id 0 sql append and bp c bp group id append p c bp group id sql append order by oi c bpartner id oi c currency id oi c invoice id log finest sql to string string final sql m role get default get ctx false add accesssql sql to string oi m role sql fullyqualified m role sql ro log finer final sql prepared statement pstmt null m aging aging null int counter 0 int rows 0 int ad pinstance id getad pinstance id try pstmt db prepare statement final sql get trxname result set rs pstmt execute query while rs next int c bp group id rs get int 1 int c bpartner id rs get int 2 int c invoice id p islistinvoices rs get int 3 0 int c invoicepayschedule id p islistinvoices rs get int 4 0 int c currency id rs get int 5 boolean isso trx y equals rs get string 6 timestamp date invoiced rs get timestamp 7 int net days rs get int 8 timestamp due date rs get timestamp 9 int days due rs get int 10 big decimal grand total rs get big decimal 11 big decimal paid amt rs get big decimal 12 big decimal open amt rs get big decimal 13 rows new aging row if aging null key ad pinstance id aging getad pinstance id c bpartner id aging getc bpartner id c currency id aging getc currency id c invoice id aging getc invoice id c invoicepayschedule id aging getc invoicepayschedule id if aging null if aging save log fine do it counter aging else log log level severe not saved aging break aging new m aging get ctx ad pinstance id c bpartner id c currency id c invoice id c invoicepayschedule id c bp group id p duedate isso trx get trxname fill buckets aging add days due grand total open amt if aging null if aging save log fine counter aging else log log level severe not saved aging rs close pstmt close pstmt null catch exception e log log level severe final sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info counter rows rows return doit doit duedate p_duedate issotrx p_issotrx c_currency_id p_c_currency_id c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id islistinvoices p_islistinvoices stringbuffer stringbuffer c_bp_group_id c_bpartner_id c_invoice_id c_invoicepayschedule_id c_currency_id issotrx dateinvoiced netdays duedate daysdue p_c_currency_id grandtotal paidamt openamt c_currency_id p_c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id currencyconvert grandtotal currencyconvert paidamt currencyconvert openamt rv_openitem c_bpartner c_bpartner_id c_bpartner_id issotrx p_issotrx p_c_bpartner_id c_bpartner_id p_c_bpartner_id p_c_bp_group_id c_bp_group_id p_c_bp_group_id c_bpartner_id c_currency_id c_invoice_id tostring finalsql mrole getdefault getctx addaccesssql tostring mrole sql_fullyqualified mrole sql_ro finalsql preparedstatement maging ad_pinstance_id getad_pinstance_id preparestatement finalsql get_trxname resultset executequery c_bp_group_id getint c_bpartner_id getint c_invoice_id p_islistinvoices getint c_invoicepayschedule_id p_islistinvoices getint c_currency_id getint issotrx getstring dateinvoiced gettimestamp netdays getint duedate gettimestamp daysdue getint bigdecimal grandtotal getbigdecimal bigdecimal paidamt getbigdecimal bigdecimal openamt getbigdecimal ad_pinstance_id getad_pinstance_id c_bpartner_id getc_bpartner_id c_currency_id getc_currency_id c_invoice_id getc_invoice_id c_invoicepayschedule_id getc_invoicepayschedule_id doit maging getctx ad_pinstance_id c_bpartner_id c_currency_id c_invoice_id c_invoicepayschedule_id c_bp_group_id p_duedate issotrx get_trxname daysdue grandtotal openamt finalsql get param request request param response response throws javax servlet servlet exception throws java io io exception protected void do get http servlet request request http servlet response response throws servlet exception io exception m message null if process log parameter request response return if process trace parameter request response return if processe mail parameter request response return if process cache parameter request response return if process run now parameter request else process action parameter request create summary page request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception m_message processlogparameter processtraceparameter processemailparameter processcacheparameter processrunnowparameter processactionparameter createsummarypage post param request request param response response throws javax servlet servlet exception throws java io io exception protected void do post http servlet request request http servlet response response throws servlet exception io exception do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception doget process log parameter and return log page param request request param response response return true if it was a log request private boolean process log parameter http servlet request request http servlet response response throws servlet exception io exception string serverid web util get parameter request log if serverid null serverid length 0 return false log info serverid serverid compiere server server m servermgr get server serverid if server null m message new p m message add element new strong server not found m message add element serverid return false web doc doc web doc create a dempiere server monitor log body body b doc get body p para new p a link new a compiere monitor serverid return para add element link b add element para b add element new h2 server get name table table new table table set border 1 table set cell spacing 2 table set cell padding 2 header tr line new tr line add element new th add element created line add element new th add element summary line add element new th add element error line add element new th add element reference line add element new th add element text msg line add element new th add element description table add element line compiere processor log logs server get logs for int i 0 i logs length i compiere processor log log logs i line new tr line add element new td add element web env get cell content log get created line add element new td add element web env get cell content log get summary line add element new td add element web env get cell content log get reference line add element new td add element web env get cell content log get text msg table add element line b add element table link new a top top b add element link fini web util create response request response this null doc false return true processlogparameter httpservletrequest httpservletresponse servletexception ioexception webutil getparameter compiereserver m_servermgr getserver m_message m_message addelement m_message addelement webdoc webdoc adempiere getbody compieremonitor addelement addelement addelement getname setborder setcellspacing setcellpadding addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement textmsg addelement addelement addelement compiereprocessorlog getlogs compiereprocessorlog addelement addelement webenv getcellcontent getcreated addelement addelement webenv getcellcontent getsummary addelement addelement webenv getcellcontent getreference addelement addelement webenv getcellcontent gettextmsg addelement addelement addelement webutil createresponse process run parameter param request request return true if it was a run request private boolean process run now parameter http servlet request request throws servlet exception io exception string serverid web util get parameter request run now if serverid null serverid length 0 return false log info serverid serverid compiere server server m servermgr get server serverid if server null m message new p m message add element new strong server not found m message add element serverid return false server run now return true processrunnowparameter httpservletrequest servletexception ioexception webutil getparameter runnow compiereserver m_servermgr getserver m_message m_message addelement m_message addelement runnow process action parameter param request request private void process action parameter http servlet request request string action web util get parameter request action if action null action length 0 return log info action action try boolean start action starts with start m message new p string msg start started stopped m message add element new strong msg string serverid action substring action index of 1 boolean ok false if serverid equals all if start ok m servermgr start all else ok m servermgr stop all m message add element all else compiere server server m servermgr get server serverid if server null m message new p m message add element new strong server not found m message add element serverid return else if start ok m servermgr start serverid else ok m servermgr stop serverid m message add element server get name m message add element ok ok error catch exception e m message new p m message add element new strong error processing parameter action m message add element new br m message add element e to string processactionparameter httpservletrequest webutil getparameter startswith m_message m_message addelement indexof _ m_servermgr startall m_servermgr stopall m_message addelement compiereserver m_servermgr getserver m_message m_message addelement m_message addelement m_servermgr m_servermgr m_message addelement getname m_message addelement m_message m_message addelement m_message addelement m_message addelement tostring process trace parameter param request request param response response return true if it was a trace request with output private boolean process trace parameter http servlet request request http servlet response response throws servlet exception io exception string trace cmd web util get parameter request trace string trace level web util get parameter request trace level if trace level null trace level length 0 log info new level trace level c log mgt set level trace level ini set property ini p tracelevel trace level ini save properties false return false if trace cmd null trace cmd length 0 return false log info command trace cmd c log file file handler c log file get false null false if trace cmd equals rotate if file handler null file handler rotate log return false re display else if trace cmd equals delete file log dir file handler get log directory if log dir null log dir is directory file logs log dir list files for int i 0 i logs length i string file name logs i get absolute path if file name equals file handler get file name continue if logs i delete log warning deleted file name else log warning not deleted file name return false re display display current log file if file handler null file handler get file name equals trace cmd file handler flush spool file file file new file trace cmd if file exists log warning did not find file trace cmd return false if file length 0 log warning file length 0 trace cmd return false stream log log info streaming trace cmd try long time system current time millis timer start int file length int file length int buffer size 2048 2k buffer byte buffer new byte buffer size response set content type text plain response set buffer size buffer size response set content length file length file input stream fis new file input stream file servlet output stream out response get output stream int read 0 while read fis read buffer 0 out write buffer 0 read out flush out close fis close time system current time millis time double speed file length 1024 double time 1000 log info length file length time ms speed kb sec catch io exception ex log log level severe stream ex return true processtraceparameter httpservletrequest httpservletresponse servletexception ioexception tracecmd webutil getparameter tracelevel webutil getparameter tracelevel tracelevel tracelevel tracelevel clogmgt setlevel tracelevel setproperty p_tracelevel tracelevel saveproperties tracecmd tracecmd tracecmd clogfile filehandler clogfile tracecmd filehandler filehandler rotatelog tracecmd logdir filehandler getlogdirectory logdir logdir isdirectory logdir listfiles filename getabsolutepath filename filehandler getfilename filename filename filehandler filehandler getfilename tracecmd filehandler tracecmd tracecmd tracecmd tracecmd currenttimemillis filelength buffersize buffersize setcontenttype setbuffersize buffersize setcontentlength filelength fileinputstream fileinputstream servletoutputstream getoutputstream currenttimemillis filelength filelength ioexception process e mail parameter param request request param response response return true if it was a email request with output private boolean processe mail parameter http servlet request request http servlet response response throws servlet exception io exception string email web util get parameter request e mail if email null email length 0 return false int ad client id 1 try ad client id integer parse int email catch exception e log warning parsing email e to string if ad client id 0 m message new p m message add element no e mail email return false log info test e mail ad client id m client client m client get new properties ad client id log info test client m message new p m message add element client get name client teste mail return false email processemailparameter httpservletrequest httpservletresponse servletexception ioexception webutil getparameter email ad_client_id ad_client_id parseint tostring ad_client_id m_message m_message addelement email email ad_client_id mclient mclient ad_client_id m_message m_message addelement getname testemail process cache parameter param request request param response response return true if it was a email request with output private boolean process cache parameter http servlet request request http servlet response response throws servlet exception io exception string cmd web util get parameter request cache reset if cmd null cmd length 0 return false string table name web util get parameter request cache table name string record id web util get parameter request cacherecord id m message new p try if table name null table name length 0 cache mgt get reset m message add element cache reset all else if record id null record id length 0 cache mgt get reset table name m message add element cache reset table name else cache mgt get reset table name integer parse int record id m message add element cache reset table name record id record id catch exception e log severe e to string m message add element error e to string return false continue processcacheparameter httpservletrequest httpservletresponse servletexception ioexception webutil getparameter cachereset tablename webutil getparameter cachetablename record_id webutil getparameter cacherecord_id m_message tablename tablename cachemgt m_message addelement record_id record_id cachemgt tablename m_message addelement tablename cachemgt tablename parseint record_id m_message addelement tablename record_id record_id tostring m_message addelement tostring create return summary page param request request param response response throws servlet exception throws io exception private void create summary page http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create a dempiere server monitor log info servlet config get servlet config compiere server group get dump body body bb doc get body message if m message null bb add element new hr bb add element m message bb add element new hr summary table table new table table set border 1 table set cell spacing 2 table set cell padding 2 tr line new tr line add element new th add element compiere get name line add element new td add element compiere get version table add element line line new tr line add element new th add element compiere get implementation vendor line add element new td add element compiere get implementation version table add element line line new tr line add element new th add element manager line add element new td add element web env get cell content m servermgr get description table add element line line new tr line add element new th add element start elapsed line add element new td add element web env get cell content m servermgr get start time time util format elapsed m servermgr get start time table add element line line new tr line add element new th add element servers line add element new td add element web env get cell content m servermgr get server count table add element line line new tr line add element new th add element last updated line add element new td add element new timestamp system current time millis to string table add element line bb add element table p para new p a link new a compiere monitor action start all start all para add element link para add element link new a compiere monitor action stop all stop all para add element link para add element link new a compiere monitor refresh para add element link bb add element para server links bb add element new hr para new p compiere server servers m servermgr get all for int i 0 i servers length i if i 0 para add element new br compiere server server servers i link new a server get serverid server get name para add element link font status null if server is alive status new font set color html color green add element running else status new font set color html color red add element stopped para add element status bb add element para log management create log mgt page bb server details for int i 0 i servers length i compiere server server servers i bb add element new hr bb add element new a set name server get serverid bb add element new h2 server get name table new table table set border 1 table set cell spacing 2 table set cell padding 2 status line new tr if server is alive string msg stop if server is interrupted msg interrupted link new a compiere monitor action stop server get serverid msg if server is sleeping line add element new th add element sleeping line add element new td add element link else line add element new th add element running line add element new td add element link table add element line line new tr line add element new th add element start elapsed line add element new td add element web env get cell content server get start time time util format elapsed server get start time else string msg start if server is interrupted msg interrupted line add element new th add element not started link new a compiere monitor action start server get serverid msg line add element new td add element link table add element line line new tr line add element new th add element description line add element new td add element web env get cell content server get description table add element line line new tr line add element new th add element last run line add element new td add element web env get cell content server get date last run table add element line line new tr line add element new th add element info line add element new td add element web env get cell content server get server info table add element line line new tr line add element new th add element next run td td new td td add element web env get cell content server get date next run false td add element link new a compiere monitor run now server get serverid run now td add element link line add element td table add element line line new tr line add element new th add element statistics line add element new td add element server get statistics table add element line add table to body bb add element table link new a top top bb add element link bb add element link new a compiere monitor log server get serverid log bb add element link bb add element link new a compiere monitor refresh bb add element link fini web util create response request response this null doc false servletexception ioexception createsummarypage httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc adempiere servletconfig getservletconfig compiereservergroup getbody m_message addelement addelement m_message addelement setborder setcellspacing setcellpadding addelement addelement getname addelement addelement getversion addelement addelement addelement getimplementationvendor addelement addelement getimplementationversion addelement addelement addelement addelement addelement webenv getcellcontent m_servermgr getdescription addelement addelement addelement addelement addelement webenv getcellcontent m_servermgr getstarttime timeutil formatelapsed m_servermgr getstarttime addelement addelement addelement addelement addelement webenv getcellcontent m_servermgr getservercount addelement addelement addelement addelement addelement currenttimemillis tostring addelement addelement compieremonitor start_all addelement addelement compieremonitor stop_all addelement addelement compieremonitor addelement addelement addelement compiereserver m_servermgr getall addelement compiereserver getserverid getname addelement isalive setcolor htmlcolor addelement setcolor htmlcolor addelement addelement addelement createlogmgtpage compiereserver addelement addelement setname getserverid addelement getname setborder setcellspacing setcellpadding isalive isinterrupted compieremonitor stop_ getserverid issleeping addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement webenv getcellcontent getstarttime timeutil formatelapsed getstarttime isinterrupted addelement addelement compieremonitor start_ getserverid addelement addelement addelement addelement addelement addelement addelement webenv getcellcontent getdescription addelement addelement addelement addelement addelement webenv getcellcontent getdatelastrun addelement addelement addelement addelement addelement webenv getcellcontent getserverinfo addelement addelement addelement addelement webenv getcellcontent getdatenextrun addelement compieremonitor runnow getserverid addelement addelement addelement addelement addelement addelement addelement getstatistics addelement addelement addelement addelement compieremonitor getserverid addelement addelement compieremonitor addelement webutil createresponse add log management to page param bb body private void create log mgt page body bb bb add element new hr ini parameters table table new table table set border 1 table set cell spacing 2 table set cell padding 2 properties ctx new properties m system system m system get ctx tr line new tr line add element new th add element system getdb address line add element new td add element ini get compiere home table add element line os name line new tr string info system get property os name system get property os version string s system get property sun os patch level if s null s length 0 info s line add element new th add element info info system get name if system get custom prefix null info system get custom prefix line add element new td add element info table add element line java email line new tr info system get property java vm name system get property java vm version line add element new th add element info line add element new td add element system get user name table add element line db instance line new tr c connection cc c connection get compiere database db cc get database info db get description line add element new th add element info line add element new td add element cc get connectionurl line add element new td add element system getdb instance table add element line processors support line new tr line add element new th add element processor support line add element new td add element system get no processors system get support units table add element line memory line new tr memorymx bean memory management factory get memorymx bean line add element new th add element vm memory line add element new td add element new c memory usage memory get non heap memory usage to string table add element line line new tr line add element new th add element heap memory line add element new td add element new c memory usage memory get heap memory usage to string table add element line runtime line new tr runtimemx bean rt management factory get runtimemx bean line add element new th add element runtime rt get name line add element new td add element time util format elapsed rt get uptime table add element line threads line new tr threadmx bean th management factory get threadmx bean line add element new th add element threads th get thread count line add element new td add element peak th get peak thread count demons th get daemon thread count total th get total started thread count table add element line cache reset line new tr line add element new th add element cache mgt get to stringx line add element new td add element new a compiere monitor cache reset yes reset cache table add element line trace level line new tr line add element new th add element new label trace level add element trace log level form my form new form compiere monitor form method post form enc default log level selection option options new option c log mgt levels length for int i 0 i options length i options i new option c log mgt levels i get name options i add element c log mgt levels i get name if c log mgt levels i c log mgt get level options i set selected true select sel new select trace level options my form add element sel my form add element new input input type submit set set line add element new td add element my form table add element line line new tr c log file file handler c log file get true null false line add element new th add element trace file line add element new td add element new a compiere monitor trace file handler get file name current table add element line line new tr line add element new td add element new a compiere monitor trace rotate rotate trace log line add element new td add element new a compiere monitor trace delete delete all trace logs table add element line bb add element table list log files p p new p p add element new b all log files all in dir file log dir file handler get log directory if log dir null log dir is directory file logs log dir list files for int i 0 i logs length i if i 0 p add element string file name logs i get absolute path a link new a compiere monitor trace file name file name p add element link int size int logs i length 1024 if size 1024 p add element size k else p add element size 1024 m bb add element p clients and web stores table new table table set border 1 table set cell spacing 2 table set cell padding 2 line new tr m client clients m client get all ctx line add element new th add element client clients length e mail test p new p for int i 0 i clients length i m client client clients i if i 0 p add element p add element new a compiere monitor e mail client getad client id client get name if clients length 0 p add element nbsp line add element new td add element p table add element line line new tr m store wstores m store get active line add element new th add element active web stores wstores length p new p for int i 0 i wstores length i m store store wstores i if i 0 p add element a a new a store get web context store get name a set target t i p add element a if wstores length 0 p add element nbsp line add element new td add element p table add element line bb add element table createlogmgtpage addelement setborder setcellspacing setcellpadding msystem msystem addelement addelement getdbaddress addelement addelement getcompierehome addelement getproperty getproperty getproperty addelement addelement getname getcustomprefix getcustomprefix addelement addelement addelement getproperty getproperty addelement addelement addelement addelement getusername addelement cconnection cconnection compieredatabase getdatabase getdescription addelement addelement addelement addelement getconnectionurl addelement addelement getdbinstance addelement addelement addelement addelement addelement getnoprocessors getsupportunits addelement memorymxbean managementfactory getmemorymxbean addelement addelement addelement addelement cmemoryusage getnonheapmemoryusage tostring addelement addelement addelement addelement addelement cmemoryusage getheapmemoryusage tostring addelement runtimemxbean managementfactory getruntimemxbean addelement addelement getname addelement addelement timeutil formatelapsed getuptime addelement threadmxbean managementfactory getthreadmxbean addelement addelement getthreadcount addelement addelement getpeakthreadcount getdaemonthreadcount gettotalstartedthreadcount addelement addelement addelement cachemgt tostringx addelement addelement compieremonitor cachereset addelement addelement addelement tracelevel addelement myform compieremonitor method_post enc_default loglevel clogmgt clogmgt getname addelement clogmgt getname clogmgt clogmgt getlevel setselected tracelevel myform addelement myform addelement type_submit addelement addelement myform addelement clogfile filehandler clogfile addelement addelement addelement addelement compieremonitor filehandler getfilename addelement addelement addelement compieremonitor addelement addelement compieremonitor addelement addelement addelement logdir filehandler getlogdirectory logdir logdir isdirectory logdir listfiles addelement filename getabsolutepath compieremonitor filename filename addelement addelement addelement addelement setborder setcellspacing setcellpadding mclient mclient getall addelement addelement email mclient addelement addelement compieremonitor email getad_client_id getname addelement addelement addelement addelement mstore mstore getactive addelement addelement mstore addelement getwebcontext getname settarget addelement addelement addelement addelement addelement addelement init param config config throws javax servlet servlet exception public void init servlet config config throws servlet exception web env init web config log info m servermgr compiere server mgr get servletexception servletconfig servletexception webenv initweb m_servermgr compiereservermgr destroy public void destroy log info destroy m servermgr null m_servermgr log error warning param message message param e exception public void log string message throwable e if e null log warning message log log level severe message e log debug param message message public void log string message log fine message get servlet name return servlet name public string get servlet name return compiere monitor getservletname compieremonitor get servlet info return servlet info public string get servlet info return a dempiere server monitor getservletinfo adempiere standard constructor public x ad workflow properties ctx int ad workflow id string trx name super ctx ad workflow id trx name if ad workflow id 0 setad workflow id 0 set access level null set author null set cost 0 set duration 0 set entity type null u set is default false set is valid false set name null set publish status null u set value null set version 0 set waiting time 0 set workflow type null g set working time 0 x_ad_workflow ad_workflow_id trxname ad_workflow_id trxname ad_workflow_id setad_workflow_id setaccesslevel setauthor setcost setduration setentitytype setisdefault setisvalid setname setpublishstatus setvalue setversion setwaitingtime setworkflowtype setworkingtime load constructor public x ad workflow properties ctx result set rs string trx name super ctx rs trx name x_ad_workflow resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workflow append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workflow get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 0 set value ad wf node id null else set value ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id set_value ad_wf_node_id set_value ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 0 set value ad wf responsible id null else set value ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id set_value ad_wf_responsible_id set_value ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set workflow processor workflow processor server public void setad workflowprocessor id int ad workflowprocessor id if ad workflowprocessor id 0 set value ad workflowprocessor id null else set value ad workflowprocessor id new integer ad workflowprocessor id setad_workflowprocessor_id ad_workflowprocessor_id ad_workflowprocessor_id set_value ad_workflowprocessor_id set_value ad_workflowprocessor_id ad_workflowprocessor_id get workflow processor workflow processor server public int getad workflowprocessor id integer ii integer get value ad workflowprocessor id if ii null return 0 return ii int value getad_workflowprocessor_id get_value ad_workflowprocessor_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set valuenocheck ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_valuenocheck ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue public static final string accesslevel all 7 set data access level access level required public void set access level string access level if access level null throw new illegal argument exception access level is mandatory if access level equals 1 access level equals 2 access level equals 3 access level equals 4 access level equals 6 access level equals 7 else throw new illegal argument exception access level invalid value access level reference id 5 1 2 3 4 6 7 if access level length 1 log warning length 1 truncated access level access level substring 0 0 set value access level access level accesslevel_all setaccesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel reference_id accesslevel accesslevel accesslevel set_value accesslevel accesslevel get data access level access level required public string get access level return string get value access level getaccesslevel get_value accesslevel set author author creator of the entity public void set author string author if author null throw new illegal argument exception author is mandatory if author length 20 log warning length 20 truncated author author substring 0 19 set value author author setauthor illegalargumentexception set_value get author author creator of the entity public string get author return string get value author getauthor get_value set cost cost information public void set cost int cost set value cost new integer cost setcost set_value get cost cost information public int get cost integer ii integer get value cost if ii null return 0 return ii int value getcost get_value intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document value logic logic to determine workflow start if true a workflow process is started for the document public void set doc value logic string doc value logic if doc value logic null doc value logic length 2000 log warning length 2000 truncated doc value logic doc value logic substring 0 1999 set value doc value logic doc value logic setdocvaluelogic docvaluelogic docvaluelogic docvaluelogic docvaluelogic docvaluelogic set_value docvaluelogic docvaluelogic get document value logic logic to determine workflow start if true a workflow process is started for the document public string get doc value logic return string get value doc value logic getdocvaluelogic get_value docvaluelogic set duration normal duration in duration unit public void set duration int duration set value duration new integer duration setduration set_value get duration normal duration in duration unit public int get duration integer ii integer get value duration if ii null return 0 return ii int value getduration get_value intvalue public static final string durationunit second s set duration unit unit of duration public void set duration unit string duration unit if duration unit null throw new illegal argument exception duration unit is mandatory if duration unit null duration unit equals d duration unit equals m duration unit equals y duration unit equals h duration unit equals m duration unit equals s else throw new illegal argument exception duration unit invalid value duration unit reference id 299 d m y h m s if duration unit null duration unit length 1 log warning length 1 truncated duration unit duration unit substring 0 0 set value duration unit duration unit durationunit_second setdurationunit durationunit durationunit illegalargumentexception durationunit durationunit durationunit durationunit durationunit durationunit durationunit durationunit illegalargumentexception durationunit durationunit reference_id durationunit durationunit durationunit durationunit set_value durationunit durationunit get duration unit unit of duration public string get duration unit return string get value duration unit getdurationunit get_value durationunit public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set duration limit maximum duration in duration unit public void set limit int limit set value limit new integer limit setlimit set_value get duration limit maximum duration in duration unit public int get limit integer ii integer get value limit if ii null return 0 return ii int value getlimit get_value intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set priority indicates if this request is of a high medium or low priority public void set priority int priority set value priority new integer priority setpriority set_value get priority indicates if this request is of a high medium or low priority public int get priority integer ii integer get value priority if ii null return 0 return ii int value getpriority get_value intvalue public static final string publishstatus void v set publication status status of publication public void set publish status string publish status if publish status null throw new illegal argument exception publish status is mandatory if publish status equals r publish status equals t publish status equals u publish status equals v else throw new illegal argument exception publish status invalid value publish status reference id 310 r t u v if publish status length 1 log warning length 1 truncated publish status publish status substring 0 0 set value publish status publish status publishstatus_void setpublishstatus publishstatus publishstatus illegalargumentexception publishstatus publishstatus publishstatus publishstatus publishstatus illegalargumentexception publishstatus publishstatus reference_id publishstatus publishstatus publishstatus set_value publishstatus publishstatus get publication status status of publication public string get publish status return string get value publish status getpublishstatus get_value publishstatus set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto set validate workflow public void set validate workflow string validate workflow if validate workflow null validate workflow length 1 log warning length 1 truncated validate workflow validate workflow substring 0 0 set value validate workflow validate workflow setvalidateworkflow validateworkflow validateworkflow validateworkflow validateworkflow validateworkflow set_value validateworkflow validateworkflow get validate workflow public string get validate workflow return string get value validate workflow getvalidateworkflow get_value validateworkflow set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set version version of the table definition public void set version int version set value version new integer version setversion set_value get version version of the table definition public int get version integer ii integer get value version if ii null return 0 return ii int value getversion get_value intvalue set waiting time workflow simulation waiting time public void set waiting time int waiting time set value waiting time new integer waiting time setwaitingtime waitingtime set_value waitingtime waitingtime get waiting time workflow simulation waiting time public int get waiting time integer ii integer get value waiting time if ii null return 0 return ii int value getwaitingtime get_value waitingtime intvalue public static final string workflowtype documentvalue v set workflow type type of worflow public void set workflow type string workflow type if workflow type null throw new illegal argument exception workflow type is mandatory if workflow type equals g workflow type equals p workflow type equals v else throw new illegal argument exception workflow type invalid value workflow type reference id 328 g p v if workflow type length 1 log warning length 1 truncated workflow type workflow type substring 0 0 set value workflow type workflow type workflowtype_documentvalue setworkflowtype workflowtype workflowtype illegalargumentexception workflowtype workflowtype workflowtype workflowtype illegalargumentexception workflowtype workflowtype reference_id workflowtype workflowtype workflowtype set_value workflowtype workflowtype get workflow type type of worflow public string get workflow type return string get value workflow type getworkflowtype get_value workflowtype set working time workflow simulation execution time public void set working time int working time set value working time new integer working time setworkingtime workingtime set_value workingtime workingtime get working time workflow simulation execution time public int get working time integer ii integer get value working time if ii null return 0 return ii int value getworkingtime get_value workingtime intvalue standard constructor public x m production properties ctx int m production id string trx name super ctx m production id trx name if m production id 0 set is created false setm production id 0 set movement date new timestamp system current time millis date set name null set posted false set processed false x_m_production m_production_id trxname m_production_id trxname m_production_id setiscreated setm_production_id setmovementdate currenttimemillis setname setposted setprocessed load constructor public x m production properties ctx result set rs string trx name super ctx rs trx name x_m_production resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m production append get id append return sb to string tostring stringbuffer stringbuffer x_m_production get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set records created public void set is created boolean is created set valuenocheck is created new boolean is created setiscreated iscreated set_valuenocheck iscreated iscreated get records created public boolean is created object oo get value is created if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreated get_value iscreated booleanvalue set production plan for producing a product public void setm production id int m production id if m production id 1 throw new illegal argument exception m production id is mandatory set valuenocheck m production id new integer m production id setm_production_id m_production_id m_production_id illegalargumentexception m_production_id set_valuenocheck m_production_id m_production_id get production plan for producing a product public int getm production id integer ii integer get value m production id if ii null return 0 return ii int value getm_production_id get_value m_production_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue constructor param ass accounting schemata param rs record parem trx name trx public doc movement m acct schema ass result set rs string trx name super ass m movement class rs doctype matmovement trx name trxname doc_movement macctschema resultset trxname mmovement doctype_matmovement trxname load document details return error message or null protected string load document details setc currency id no currency m movement move m movement getpo set date doc move get movement date set date acct move get movement date contained objects p lines load lines move log fine lines p lines length return null loaddocumentdetails setc_currency_id no_currency mmovement mmovement setdatedoc getmovementdate setdateacct getmovementdate p_lines loadlines p_lines load invoice line return document lines docline material private doc line load lines m movement move array list doc line list new array list doc line m movement line lines move get lines false for int i 0 i lines length i m movement line line lines i doc line doc line new doc line line this doc line set qty line get movement qty false log fine doc line to string list add doc line return array doc line dls new doc line list size list to array dls return dls docline_material docline loadlines mmovement arraylist docline arraylist docline mmovementline getlines mmovementline docline docline docline docline setqty getmovementqty docline tostring docline docline docline toarray get balance return balance zero always balanced public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for mmm pre movement inventory dr cr inventory to dr cr pre param as account schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual setc currency id as getc currency id line pointers fact line dr null fact line cr null for int i 0 i p lines length i doc line line p lines i big decimal costs line get product costs as line getad org id false inventory dr cr dr fact create line line line get account product cost accttype p asset as as getc currency id costs negate from cr if dr null continue dr setm locator id line getm locator id dr set qty line get qty negate outgoing inventory to dr cr cr fact create line line line get account product cost accttype p asset as as getc currency id costs to dr if cr null continue cr setm locator id line getm locatorto id cr set qty line get qty only for between org movements if dr getad org id cr getad org id string costing level as get costing level m product category acct pca m product category acct get get ctx line get product getm product category id as getc acctschema id get trx name if pca get costing level null costing level pca get costing level if m acct schema costinglevel organization equals costing level continue string description line get description if description null description cost detail from m cost detail create movement as dr getad org id locator org line getm product id line getm attributesetinstance id line get id 0 costs negate line get qty negate true description get trx name cost detail to m cost detail create movement as cr getad org id locator org line getm product id line getm attributesetinstance id line get id 0 costs line get qty false description get trx name array list fact facts new array list fact facts add fact return facts inventoryto arraylist createfacts macctschema post_actual setc_currency_id getc_currency_id factline factline p_lines docline p_lines bigdecimal getproductcosts getad_org_id createline getaccount productcost accttype_p_asset getc_currency_id setm_locator_id getm_locator_id setqty getqty inventoryto createline getaccount productcost accttype_p_asset getc_currency_id setm_locator_id getm_locatorto_id setqty getqty getad_org_id getad_org_id costinglevel getcostinglevel mproductcategoryacct mproductcategoryacct getctx getproduct getm_product_category_id getc_acctschema_id gettrxname getcostinglevel costinglevel getcostinglevel macctschema costinglevel_organization costinglevel getdescription mcostdetail createmovement getad_org_id getm_product_id getm_attributesetinstance_id get_id getqty gettrxname mcostdetail createmovement getad_org_id getm_product_id getm_attributesetinstance_id get_id getqty gettrxname arraylist arraylist standard constructor public x ad workflow access properties ctx int ad workflow access id string trx name super ctx ad workflow access id trx name if ad workflow access id 0 setad role id 0 setad workflow id 0 set is read write false x_ad_workflow_access ad_workflow_access_id trxname ad_workflow_access_id trxname ad_workflow_access_id setad_role_id setad_workflow_id setisreadwrite load constructor public x ad workflow access properties ctx result set rs string trx name super ctx rs trx name x_ad_workflow_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workflow access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workflow_access get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set valuenocheck ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_valuenocheck ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue set read write field is read write public void set is read write boolean is read write set value is read write new boolean is read write setisreadwrite isreadwrite set_value isreadwrite isreadwrite get read write field is read write public boolean is read write object oo get value is read write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadwrite get_value isreadwrite booleanvalue standard constructor public x c bankstatement properties ctx int c bankstatement id string trx name super ctx c bankstatement id trx name if c bankstatement id 0 setc bankaccount id 0 setc bankstatement id 0 set doc action null co set doc status null dr set ending balance env zero set is approved false n set is manual true y set name null date set posted false n set processed false set statement date new timestamp system current time millis date x_c_bankstatement c_bankstatement_id trxname c_bankstatement_id trxname c_bankstatement_id setc_bankaccount_id setc_bankstatement_id setdocaction setdocstatus setendingbalance setisapproved setismanual setname setposted setprocessed setstatementdate currenttimemillis load constructor public x c bankstatement properties ctx result set rs string trx name super ctx rs trx name x_c_bankstatement resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankstatement append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankstatement get_id tostring set beginning balance balance prior to any transactions public void set beginning balance big decimal beginning balance set value beginning balance beginning balance setbeginningbalance bigdecimal beginningbalance set_value beginningbalance beginningbalance get beginning balance balance prior to any transactions public big decimal get beginning balance big decimal bd big decimal get value beginning balance if bd null return env zero return bd bigdecimal getbeginningbalance bigdecimal bigdecimal get_value beginningbalance set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set bank statement bank statement of account public void setc bankstatement id int c bankstatement id if c bankstatement id 1 throw new illegal argument exception c bankstatement id is mandatory set valuenocheck c bankstatement id new integer c bankstatement id setc_bankstatement_id c_bankstatement_id c_bankstatement_id illegalargumentexception c_bankstatement_id set_valuenocheck c_bankstatement_id c_bankstatement_id get bank statement bank statement of account public int getc bankstatement id integer ii integer get value c bankstatement id if ii null return 0 return ii int value getc_bankstatement_id get_value c_bankstatement_id intvalue set create lines from process which will generate a new document lines based on an existing document public void set create from string create from if create from null create from length 1 log warning length 1 truncated create from create from substring 0 0 set value create from create from setcreatefrom createfrom createfrom createfrom createfrom createfrom set_value createfrom createfrom get create lines from process which will generate a new document lines based on an existing document public string get create from return string get value create from getcreatefrom get_value createfrom set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set eft statement date electronic funds transfer statement date public void set eft statement date timestamp eft statement date set value eft statement date eft statement date seteftstatementdate eftstatementdate set_value eftstatementdate eftstatementdate get eft statement date electronic funds transfer statement date public timestamp get eft statement date return timestamp get value eft statement date geteftstatementdate get_value eftstatementdate set eft statement reference electronic funds transfer statement reference public void set eft statement reference string eft statement reference if eft statement reference null eft statement reference length 60 log warning length 60 truncated eft statement reference eft statement reference substring 0 59 set value eft statement reference eft statement reference seteftstatementreference eftstatementreference eftstatementreference eftstatementreference eftstatementreference eftstatementreference set_value eftstatementreference eftstatementreference get eft statement reference electronic funds transfer statement reference public string get eft statement reference return string get value eft statement reference geteftstatementreference get_value eftstatementreference set ending balance ending or closing balance public void set ending balance big decimal ending balance if ending balance null throw new illegal argument exception ending balance is mandatory set value ending balance ending balance setendingbalance bigdecimal endingbalance endingbalance illegalargumentexception endingbalance set_value endingbalance endingbalance get ending balance ending or closing balance public big decimal get ending balance big decimal bd big decimal get value ending balance if bd null return env zero return bd bigdecimal getendingbalance bigdecimal bigdecimal get_value endingbalance set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set match statement public void set match statement string match statement if match statement null match statement length 1 log warning length 1 truncated match statement match statement substring 0 0 set value match statement match statement setmatchstatement matchstatement matchstatement matchstatement matchstatement matchstatement set_value matchstatement matchstatement get match statement public string get match statement return string get value match statement getmatchstatement get_value matchstatement set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set statement date date of the statement public void set statement date timestamp statement date if statement date null throw new illegal argument exception statement date is mandatory set value statement date statement date setstatementdate statementdate statementdate illegalargumentexception statementdate set_value statementdate statementdate get statement date date of the statement public timestamp get statement date return timestamp get value statement date getstatementdate get_value statementdate set statement difference difference between statement ending balance and actual ending balance public void set statement difference big decimal statement difference set value statement difference statement difference setstatementdifference bigdecimal statementdifference set_value statementdifference statementdifference get statement difference difference between statement ending balance and actual ending balance public big decimal get statement difference big decimal bd big decimal get value statement difference if bd null return env zero return bd bigdecimal getstatementdifference bigdecimal bigdecimal get_value statementdifference public m project type task properties ctx int c task id string trx name super ctx c task id trx name if c task id 0 setc task id 0 pk setc phase id 0 parent set name null set seq no 0 set standard qty env zero mprojecttypetask c_task_id trxname c_task_id trxname c_task_id setc_task_id setc_phase_id setname setseqno setstandardqty m project type task public m project type task properties ctx result set rs string trx name super ctx rs trx name m project type task mprojecttypetask mprojecttypetask resultset trxname trxname mprojecttypetask get contsnts return contents public object get contents return contents getcontents show dialog with initial font and return selected font param owner base window param title chooser title param init font initial font return selected font public static font show dialog dialog owner string title font init font font ret value init font font chooser fc new font chooser owner title init font ret value fc get font fc null return ret value initfont showdialog initfont retvalue initfont fontchooser fontchooser initfont retvalue getfont retvalue constructor param owner base window param title chooser title param init font initial font public font chooser dialog owner string title font init font super owner title true try jb init dyn init set font init font compiereplaf show center screen this catch exception ex system err println font chooser ex print stack trace initfont fontchooser initfont jbinit dyninit setfont initfont showcenterscreen fontchooser printstacktrace ide constructor public font chooser this null s res get string font chooser null fontchooser s_res getstring fontchooser static layout throws exception private void jb init throws exception main panel set layout main layout name label set text s res get string name select panel set layout select layout size label set text s res get string size style label set text s res get string style font test set text s res get string test string font test set line wrap true font test set wrap style word true font test set background compiereplaf getfieldbackground inactive font test set border border factory create lowered bevel border font test set preferred size new dimension 220 100 font info set text s res get string font string font info set line wrap true font info set wrap style word true font info set background compiereplaf getfieldbackground inactive font info set opaque false font info set editable false confirm panel set layout confirm layout confirm layout set alignment flow layout right confirm panel set opaque false select panel set opaque false get content pane add main panel main panel add select panel border layout center select panel add name label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 select panel add font name new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 select panel add size label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 select panel add style label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 select panel add font style new grid bag constraints 1 2 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 select panel add font size new grid bag constraints 1 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 select panel add font test new grid bag constraints 0 3 2 1 0 0 0 0 grid bag constraints center grid bag constraints both new insets 20 5 5 5 0 0 select panel add font info new grid bag constraints 0 4 2 1 0 0 0 0 grid bag constraints center grid bag constraints both new insets 10 5 10 5 0 0 main panel add confirm panel border layout south confirm panel add b cancel null confirm panel add bok null b cancel add action listener this bok add action listener this jbinit mainpanel setlayout mainlayout namelabel settext s_res getstring selectpanel setlayout selectlayout sizelabel settext s_res getstring stylelabel settext s_res getstring fonttest settext s_res getstring teststring fonttest setlinewrap fonttest setwrapstyleword fonttest setbackground getfieldbackground_inactive fonttest setborder borderfactory createloweredbevelborder fonttest setpreferredsize fontinfo settext s_res getstring fontstring fontinfo setlinewrap fontinfo setwrapstyleword fontinfo setbackground getfieldbackground_inactive fontinfo setopaque fontinfo seteditable confirmpanel setlayout confirmlayout confirmlayout setalignment flowlayout confirmpanel setopaque selectpanel setopaque getcontentpane mainpanel mainpanel selectpanel borderlayout selectpanel namelabel gridbagconstraints gridbagconstraints gridbagconstraints selectpanel fontname gridbagconstraints gridbagconstraints gridbagconstraints selectpanel sizelabel gridbagconstraints gridbagconstraints gridbagconstraints selectpanel stylelabel gridbagconstraints gridbagconstraints gridbagconstraints selectpanel fontstyle gridbagconstraints gridbagconstraints gridbagconstraints selectpanel fontsize gridbagconstraints gridbagconstraints gridbagconstraints selectpanel fonttest gridbagconstraints gridbagconstraints gridbagconstraints selectpanel fontinfo gridbagconstraints gridbagconstraints gridbagconstraints mainpanel confirmpanel borderlayout confirmpanel bcancel confirmpanel bcancel addactionlistener addactionlistener dynamic init private void dyn init string names graphics environment get local graphics environment get available font family names arrays sort names for int i 0 i names length i font name add item names i font name add action listener this for int i 6 i 32 i font size add item string value of i font size add action listener this for int i 0 i s list length i font style add item s list i font style add action listener this dyninit graphicsenvironment getlocalgraphicsenvironment getavailablefontfamilynames fontname additem fontname addactionlistener fontsize additem valueof fontsize addactionlistener s_list fontstyle additem s_list fontstyle addactionlistener set font sets font for chooser not the component font param font public void set font font font if font null return log trace font chooser set font font to string if m retfont null m retfont font font test set font font font info set font font font info set text font to string m setting true font name set selected item font get name if font name get selected item equals font get name system err println font chooser set font font name get selected item to string font get name font size set selected item string value of font get size if font size get selected item equals string value of font get size system err println font chooser set font font size get selected item font get size find style for int i 0 i s list length i if s list i getid font get style font style set selected item s list i if font style font style get selected item getid font get style system err println font chooser set font font style font style get selected item getid font get style m font font this pack m setting false setfont fontchooser setfont tostring m_retfont m_retfont fonttest setfont fontinfo setfont fontinfo settext tostring m_setting fontname setselecteditem getname fontname getselecteditem getname fontchooser setfont fontname getselecteditem tostring getname fontsize setselecteditem valueof getsize fontsize getselecteditem valueof getsize fontchooser setfont fontsize getselecteditem getsize s_list s_list getstyle fontstyle setselecteditem s_list fontstyle fontstyle getselecteditem getstyle fontchooser setfont fontstyle fontstyle getselecteditem getstyle m_font m_setting return selected font return font public font get font return m retfont getfont m_retfont action listener param e public void action performed action event e if m setting return if e get source bok m retfont m font dispose else if e get source b cancel dispose else if e get source font name string s font name get selected item to string m font new font s m font get style m font get size else if e get source font size string s font size get selected item to string m font new font m font get name m font get style integer parse int s else if e get source font style font style fs font style font style get selected item m font new font m font get name fs getid m font get size system out println new font m font to string set font m font actionlistener actionperformed actionevent m_setting getsource m_retfont m_font getsource bcancel getsource fontname fontname getselecteditem tostring m_font m_font getstyle m_font getsize getsource fontsize fontsize getselecteditem tostring m_font m_font getname m_font getstyle parseint getsource fontstyle fontstyle fontstyle fontstyle getselecteditem m_font m_font getname m_font getsize newfont m_font tostring setfont m_font create font style param name param id public font style string name int id m name name m id id fontstyle fontstyle m_name m_id get name return name public string to string return m name tostring m_name get int value of font style return id public int getid return m id m_id bar graph layout param parent parenr public bar graph layout bar graph parent m parent parent bargraphlayout bargraph m_parent add layout component param name name param comp component public void add layout component string name component comp if comp instanceof bar graph column m list add bar graph column comp else log severe invalid class comp m layoutcomplete false addlayoutcomponent bargraphcolumn m_list bargraphcolumn m_layoutcomplete remove layout component param comp component public void remove layout component component comp m list remove comp m layoutcomplete false removelayoutcomponent m_list m_layoutcomplete preferred layout size param parent parent return size public dimension preferred layout size container parent return parent get preferred size preferredlayoutsize getpreferredsize minimum layout size param parent parent return size public dimension minimum layout size container parent return parent get minimum size minimumlayoutsize getminimumsize layout container param parent public void layout container container parent if m layoutcomplete return find max double max value 0 for int i 0 i m list size i bar graph column column m list get i max value math max max value column get value dimension size m parent get preferred size point point0 0 m parent getpoint0 0 double graph height size height size height point0 0 y 2 ygap double graph width size width point0 0 x xgap double column width graph width xgap m list size m list size column width math min 30 column width font metrics fm m parent get font metrics m parent get font int font height fm get height column width math max font height column width log fine height graph height max value max value width graph width column width column width int x point0 0 x 2 xgap set values for int i 0 i m list size i bar graph column column m list get i double multiplier column get value max value double height graph height multiplier column set col height height column set col width column width dimension ps column get preferred size column set background graph util get background i int y point0 0 y ps height ygap column set location x y column set bounds x y ps width ps height x ps width xgap log finer i int multiplier 100 column get bounds m layoutcomplete true layoutcontainer m_layoutcomplete maxvalue m_list bargraphcolumn m_list maxvalue maxvalue getvalue m_parent getpreferredsize point0_0 m_parent getpoint0_0 graphheight point0_0 graphwidth point0_0 columnwidth graphwidth m_list m_list columnwidth columnwidth fontmetrics m_parent getfontmetrics m_parent getfont fontheight getheight columnwidth fontheight columnwidth graphheight maxvalue maxvalue graphwidth columnwidth columnwidth point0_0 m_list bargraphcolumn m_list getvalue maxvalue graphheight setcolheight setcolwidth columnwidth getpreferredsize setbackground graphutil getbackground point0_0 setlocation setbounds getbounds m_layoutcomplete initialize panel param window no window param frame parent frame public void init int window no form frame frame log info m windowno window no m frame frame try dyn init jb init frame get content pane add this border layout center frame get content pane add confirm panel border layout south m frame set icon image env get image archive16 gif catch exception e log log level severe init e windowno windowno formframe m_windowno windowno m_frame dyninit jbinit getcontentpane borderlayout getcontentpane confirmpanel borderlayout m_frame seticonimage getimage dynamic init private void dyn init int ad role id env getad role id env get ctx processes string sql select distinct p ad process id p name from ad process p inner join ad process access pa on p ad process id pa ad process id where pa ad role id ad role id and p is report y and p is active y and pa is active y order by 2 process field new c combo box db get key name pairs sql true tables sql select distinct t ad table id t name from ad table t inner join ad tab tab on tab ad table id t ad table id inner join ad window access wa on tab ad window id wa ad window id where wa ad role id ad role id and t is active y and tab is active y order by 2 table field new c combo box db get key name pairs sql true internal users sql select ad user id name from ad user u where exists select from ad user roles ur where u ad user id ur ad user id order by 2 created byq field new c combo box db get key name pairs sql true b partner field v lookup createb partner m windowno dyninit ad_role_id getad_role_id getctx ad_process_id ad_process ad_process_access ad_process_id ad_process_id ad_role_id ad_role_id isreport isactive isactive processfield ccombobox getkeynamepairs ad_table_id ad_table ad_tab ad_table_id ad_table_id ad_window_access ad_window_id ad_window_id ad_role_id ad_role_id isactive isactive tablefield ccombobox getkeynamepairs ad_user_id ad_user ad_user_roles ad_user_id ad_user_id createdbyqfield ccombobox getkeynamepairs bpartnerfield vlookup createbpartner m_windowno static init throws exception private void jb init throws exception int line 0 query panel add report field new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 0 0 0 0 0 0 report field add action listener this query panel add process label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add process field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 query panel add b partner label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add b partner field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 query panel add table label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add table field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 query panel add nameq label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 10 0 0 5 0 0 query panel add nameq field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 0 0 0 0 0 query panel add descriptionq label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add descriptionq field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 query panel add helpq label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add helpq field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 query panel add created byq label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 10 0 0 5 0 0 query panel add created byq field new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 0 0 0 0 0 query panel add createdq label new grid bag constraints 0 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 query panel add createdq from new grid bag constraints 1 line 1 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 0 0 0 query panel add createdq to new grid bag constraints 2 line 1 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 0 0 0 this add query panel query line 0 view panel add pdf viewer border layout west b back add action listener this b next add action listener this position info set font bold true position info set horizontal alignment c label center view enter panel add b back new grid bag constraints 0 line 1 1 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 view enter panel add position info new grid bag constraints 1 line 1 1 0 0 grid bag constraints center grid bag constraints none new insets 0 5 0 5 0 0 view enter panel add b next new grid bag constraints 2 line 1 1 0 0 grid bag constraints east grid bag constraints none new insets 0 0 0 5 0 0 created by field set read write false created field set read write false name field add vetoable change listener this description field add vetoable change listener this help field add vetoable change listener this view enter panel add created by label new grid bag constraints 0 line 3 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 view enter panel add created by field new grid bag constraints 0 line 3 1 0 0 grid bag constraints west grid bag constraints horizontal new insets 2 0 0 5 0 0 view enter panel add created label new a layout constraint line 0 view enter panel add created field new grid bag constraints 0 line 3 1 0 0 grid bag constraints east grid bag constraints none new insets 2 0 0 5 0 0 view enter panel add name label new grid bag constraints 0 line 3 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 view enter panel add name field new grid bag constraints 0 line 3 1 1 0 grid bag constraints west grid bag constraints horizontal new insets 2 0 0 5 0 0 view enter panel add description label new grid bag constraints 0 line 3 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 view enter panel add description field new grid bag constraints 0 line 3 1 1 0 grid bag constraints west grid bag constraints horizontal new insets 2 0 0 5 0 0 view enter panel add help label new grid bag constraints 0 line 3 1 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 view enter panel add help field new grid bag constraints 0 line 3 1 1 0 grid bag constraints west grid bag constraints horizontal new insets 2 0 0 5 0 0 view enter panel add update archive new grid bag constraints 0 line 3 1 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 view enter panel set preferred size new dimension 220 500 update archive add action listener this view panel add view enter panel border layout center this add view panel view confirm panel add action listener this updateq display this set preferred size new dimension 720 500 jbinit querypanel reportfield gridbagconstraints gridbagconstraints gridbagconstraints reportfield addactionlistener querypanel processlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel processfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel bpartnerlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel bpartnerfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel tablelabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel tablefield gridbagconstraints gridbagconstraints gridbagconstraints querypanel nameqlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel nameqfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel descriptionqlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel descriptionqfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel helpqlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel helpqfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel createdbyqlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel createdbyqfield gridbagconstraints gridbagconstraints gridbagconstraints querypanel createdqlabel gridbagconstraints gridbagconstraints gridbagconstraints querypanel createdqfrom gridbagconstraints gridbagconstraints gridbagconstraints querypanel createdqto gridbagconstraints gridbagconstraints gridbagconstraints querypanel viewpanel pdfviewer borderlayout bback addactionlistener bnext addactionlistener positioninfo setfontbold positioninfo sethorizontalalignment clabel viewenterpanel bback gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel positioninfo gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel bnext gridbagconstraints gridbagconstraints gridbagconstraints createdbyfield setreadwrite createdfield setreadwrite namefield addvetoablechangelistener descriptionfield addvetoablechangelistener helpfield addvetoablechangelistener viewenterpanel createdbylabel gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel createdbyfield gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel createdlabel alayoutconstraint viewenterpanel createdfield gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel namelabel gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel namefield gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel descriptionlabel gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel descriptionfield gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel helplabel gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel helpfield gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel updatearchive gridbagconstraints gridbagconstraints gridbagconstraints viewenterpanel setpreferredsize updatearchive addactionlistener viewpanel viewenterpanel borderlayout viewpanel confirmpanel addactionlistener updateqdisplay setpreferredsize dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e log info e get action command if e get source update archive cmd updatearchive else if e get action command equals confirm panel a cancel dispose else if e get action command equals confirm panel a ok if get selected index 1 dispose else cmd query else if e get source report field updateq display else if e get source b back updatev display false else if e get source b next updatev display true actionperformed actionevent getactioncommand getsource updatearchive cmd_updatearchive getactioncommand confirmpanel a_cancel getactioncommand confirmpanel a_ok getselectedindex cmd_query getsource reportfield updateqdisplay getsource bback updatevdisplay getsource bnext updatevdisplay field listener param evt event throws property veto exception public void vetoable change property change event evt throws property veto exception if m archives length 0 update archive set enabled true propertyvetoexception vetoablechange propertychangeevent propertyvetoexception m_archives updatearchive setenabled update query display private void updateq display boolean reports report field is selected log config reports reports show process label set visible reports process field set visible reports hide b partner label set visible reports b partner field set visible reports updateqdisplay reportfield isselected processlabel setvisible processfield setvisible bpartnerlabel setvisible bpartnerfield setvisible update view display param next show next archive private void updatev display boolean next if m archives null m archives new m archive 0 if next m index else m index if m index m archives length 1 m index m archives length 1 if m index 0 m index 0 b back set enabled m index 0 b next set enabled m index m archives length 1 update archive set enabled false log info index m index length m archives length if m archives length 0 position info set text no record found created by field set text created field set value null name field set text description field set text help field set text pdf viewer clear document return position info set text m index 1 of m archives length m archive ar m archives m index created by field set text ar get created by name created field set value ar get created name field set text ar get name description field set text ar get description help field set text ar get help try input stream in ar get input stream pdf viewer set scale report field is selected 50 75 if in null pdf viewer loadpdf in else pdf viewer clear document catch exception e log log level severe pdf e pdf viewer clear document updatevdisplay m_archives m_archives marchive m_index m_index m_index m_archives m_index m_archives m_index m_index bback setenabled m_index bnext setenabled m_index m_archives updatearchive setenabled m_index m_archives m_archives positioninfo settext createdbyfield settext createdfield setvalue namefield settext descriptionfield settext helpfield settext pdfviewer cleardocument positioninfo settext m_index m_archives marchive m_archives m_index createdbyfield settext getcreatedbyname createdfield setvalue getcreated namefield settext getname descriptionfield settext getdescription helpfield settext gethelp inputstream getinputstream pdfviewer setscale reportfield isselected pdfviewer pdfviewer cleardocument pdfviewer cleardocument update archive info private void cmd updatearchive m archive ar m archives m index boolean update false if is same name field get text ar get name string new text name field get text if new text null new text length 0 ar set name new text update true if is same description field get text ar get description ar set description description field get text update true if is same help field get text ar get help ar set help help field get text update true log info update update if update ar save m index updatev display false cmd_updatearchive marchive m_archives m_index issame namefield gettext getname newtext namefield gettext newtext newtext setname newtext issame descriptionfield gettext getdescription setdescription descriptionfield gettext issame helpfield gettext gethelp sethelp helpfield gettext m_index updatevdisplay is it the same param s1 s1 param s2 s1 return true if the same private boolean is same string s1 string s2 if s1 null return s2 null else if s2 null return false else return s1 equals s2 issame query directly param is report report param ad table id table param record id tecord public void query boolean is report int ad table id int record id log config report is report ad table id ad table id record id record id report field set selected is report m ad table id ad table id m record id record id cmd query isreport ad_table_id record_id isreport ad_table_id record_id isreport ad_table_id ad_table_id record_id record_id reportfield setselected isreport m_ad_table_id ad_table_id m_record_id record_id cmd_query create query private void cmd query string buffer sql new string buffer boolean reports report field is selected m role role m role get default if role is can report log warning user role cannot report ad user id env getad user id env get ctx return sql append and is report append reports y n process if reports key name pair nn key name pair process field get selected item if nn null nn get key 0 sql append and ad process id append nn get key table if m ad table id 0 sql append and ad table id append m ad table id if m record id 0 sql append and record id append m record id sql append if m ad table id mb partner table id m record id 0 sql append or c bpartner id append m record id sql append reset for query m ad table id 0 m record id 0 else key name pair nn key name pair table field get selected item if nn null nn get key 0 sql append and ad table id append nn get key business partner if reports integer ii integer b partner field get value if ii null sql append and c bpartner id append ii else sql append and c bpartner id is not null name string ss nameq field get text if ss null ss length 0 if ss index of 1 ss index of 1 sql append and name like append db to string ss else sql append and name append db to string ss description ss descriptionq field get text if ss null ss length 0 if ss index of 1 ss index of 1 sql append and description like append db to string ss else sql append and description append db to string ss help ss helpq field get text if ss null ss length 0 if ss index of 1 ss index of 1 sql append and help like append db to string ss else sql append and help append db to string ss created by key name pair nn key name pair created byq field get selected item if nn null nn get key 0 sql append and created by append nn get key created timestamp tt createdq from get timestamp if tt null sql append and created append db to date tt true tt createdq to get timestamp if tt null sql append and created append db to date time util add days tt 1 true log fine sql to string process access sql append and ad process id is null or ad process id in select ad process id from ad process access where ad role id append role getad role id append table access sql append and ad table id is null or ad table id is not null and ad process id is not null menu reports or ad table id in select t ad table id from ad tab t inner join ad window access wa on t ad window id wa ad window id where wa ad role id append role getad role id append log finest sql to string m archives m archive get env get ctx sql to string log info length m archives length display this set selected index 1 m index 1 updatev display false cmd_query stringbuffer stringbuffer reportfield isselected mrole mrole getdefault iscanreport ad_user_id getad_user_id getctx isreport keynamepair keynamepair processfield getselecteditem getkey ad_process_id getkey m_ad_table_id ad_table_id m_ad_table_id m_record_id record_id m_record_id m_ad_table_id mbpartner table_id m_record_id c_bpartner_id m_record_id m_ad_table_id m_record_id keynamepair keynamepair tablefield getselecteditem getkey ad_table_id getkey bpartnerfield getvalue c_bpartner_id c_bpartner_id nameqfield gettext indexof indexof _ to_string to_string descriptionqfield gettext indexof indexof _ to_string to_string helpqfield gettext indexof indexof _ to_string to_string createdby keynamepair keynamepair createdbyqfield getselecteditem getkey createdby getkey createdqfrom gettimestamp to_date createdqto gettimestamp to_date timeutil adddays tostring ad_process_id ad_process_id ad_process_id ad_process_access ad_role_id getad_role_id ad_table_id ad_table_id ad_process_id ad_table_id ad_table_id ad_tab ad_window_access ad_window_id ad_window_id ad_role_id getad_role_id tostring m_archives marchive getctx tostring m_archives setselectedindex m_index updatevdisplay prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter do it return message throws exception protected string do it throws exception int ad registration id getrecord id log info do it ad registration id ad registration id check ststem m system sys m system get get ctx if sys get name equals sys get name length 2 throw new compiere user error set system name in system record if sys get user name equals sys get user name length 2 throw new compiere user error set user name as in web store in system record if sys get password equals sys get password length 2 throw new compiere user error set password as in web store in system record registration m registration reg new m registration get ctx ad registration id get trxname location m location loc null if reg getc location id 0 loc new m location get ctx reg getc location id get trxname if loc get city null loc get city length 2 throw new compiere user error no city in address if loc null throw new compiere user error please enter address with city create query string string enc web env encoding send get request string buffer url string new string buffer http www adempiere com append wstore registration servlet system info url string append name append url encoder encode sys get name enc append user name append url encoder encode sys get user name enc append password append url encoder encode sys get password enc registration info if reg get description null reg get description length 0 url string append description append url encoder encode reg get description enc url string append is in production append reg is in production y n if reg get start production date null url string append start production date append url encoder encode string value of reg get start production date enc url string append is allow publish append reg is allow publish y n append number employees append url encoder encode string value of reg get number employees enc append c currency id append url encoder encode string value of reg getc currency id enc append sales volume append url encoder encode string value of reg get sales volume enc if reg get industry info null reg get industry info length 0 url string append industry info append url encoder encode reg get industry info enc if reg get platform info null reg get platform info length 0 url string append platform info append url encoder encode reg get platform info enc url string append is registered append reg is registered y n append record id append url encoder encode string value of reg getrecord id enc address url string append city append url encoder encode loc get city enc append c country id append url encoder encode string value of loc getc country id enc statistics if reg is allow statistics url string append num client append url encoder encode string value of db getsql value null select count from ad client enc append num org append url encoder encode string value of db getsql value null select count from ad org enc append numb partner append url encoder encode string value of db getsql value null select count from c bpartner enc append num user append url encoder encode string value of db getsql value null select count from ad user enc append num product append url encoder encode string value of db getsql value null select count from m product enc append num invoice append url encoder encode string value of db getsql value null select count from c invoice enc log fine url string to string send it url url new url url string to string string buffer sb new string buffer try url connection uc url open connection input stream reader in new input stream reader uc get input stream int c while c in read 1 sb append char c in close catch exception e log log level severe connect e to string throw new illegal state exception cannot connect to server please try later string info sb to string log info response info record at the end int index sb index of record id if index 1 try int record id integer parse int sb substring index 10 reg setrecord id record id reg set is registered true reg save info info substring 0 index catch exception e log log level severe record e return info doit doit ad_registration_id getrecord_id doit ad_registration_id ad_registration_id msystem msystem getctx getname getname compiereusererror getusername getusername compiereusererror getpassword getpassword compiereusererror m_registration m_registration getctx ad_registration_id get_trxname mlocation getc_location_id mlocation getctx getc_location_id get_trxname getcity getcity compiereusererror compiereusererror webenv stringbuffer urlstring stringbuffer registrationservlet urlstring urlencoder getname username urlencoder getusername urlencoder getpassword getdescription getdescription urlstring urlencoder getdescription urlstring isinproduction isinproduction getstartproductiondate urlstring startproductiondate urlencoder valueof getstartproductiondate urlstring isallowpublish isallowpublish numberemployees urlencoder valueof getnumberemployees c_currency_id urlencoder valueof getc_currency_id salesvolume urlencoder valueof getsalesvolume getindustryinfo getindustryinfo urlstring industryinfo urlencoder getindustryinfo getplatforminfo getplatforminfo urlstring platforminfo urlencoder getplatforminfo urlstring isregistered isregistered record_id urlencoder valueof getrecord_id urlstring urlencoder getcity c_country_id urlencoder valueof getc_country_id isallowstatistics urlstring numclient urlencoder valueof getsqlvalue ad_client numorg urlencoder valueof getsqlvalue ad_org numbpartner urlencoder valueof getsqlvalue c_bpartner numuser urlencoder valueof getsqlvalue ad_user numproduct urlencoder valueof getsqlvalue m_product numinvoice urlencoder valueof getsqlvalue c_invoice urlstring tostring urlstring tostring stringbuffer stringbuffer urlconnection openconnection inputstreamreader inputstreamreader getinputstream tostring illegalstateexception tostring indexof record_id record_id parseint setrecord_id record_id setisregistered standard constructor param ctx context param c commission id id public m commission properties ctx int c commission id string trx name super ctx c commission id trx name if c commission id 0 set name null setc bpartner id 0 setc charge id 0 setc commission id 0 setc currency id 0 set doc basis type docbasistype invoice i set frequency type frequencytype monthly m set list details false c_commission_id mcommission c_commission_id trxname c_commission_id trxname c_commission_id setname setc_bpartner_id setc_charge_id setc_commission_id setc_currency_id setdocbasistype docbasistype_invoice setfrequencytype frequencytype_monthly setlistdetails load constructor param ctx context param rs result set public m commission properties ctx result set rs string trx name super ctx rs trx name mcommission resultset trxname trxname get lines return array of lines public m commission line get lines string sql select from c commissionline where c commission id order by line array list m commission line list new array list m commission line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc commission id result set rs pstmt execute query while rs next list add new m commission line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert m commission line ret value new m commission line list size list to array ret value return ret value mcommissionline getlines c_commissionline c_commission_id arraylist mcommissionline arraylist mcommissionline preparedstatement preparestatement get_trxname setint getc_commission_id resultset executequery mcommissionline getctx get_trxname mcommissionline retvalue mcommissionline toarray retvalue retvalue set date last run param date last run date public void set date last run timestamp date last run if date last run null super set date last run date last run datelastrun setdatelastrun datelastrun datelastrun setdatelastrun datelastrun copy lines from other commission param other com commission return number of lines copied public int copy lines from m commission other com if other com null return 0 m commission line from lines other com get lines int count 0 for int i 0 i from lines length i m commission line line new m commission line get ctx 0 get trxname po copy values from lines i line getad client id getad org id line setc commission id getc commission id line setc commissionline id 0 new if line save count if from lines length count log log level severe copy lines from line difference from from lines length saved count return count othercom copylinesfrom mcommission othercom othercom mcommissionline fromlines othercom getlines fromlines mcommissionline mcommissionline getctx get_trxname copyvalues fromlines getad_client_id getad_org_id setc_commission_id getc_commission_id setc_commissionline_id fromlines copylinesfrom fromlines standard constructor public x ad replicationstrategy properties ctx int ad replicationstrategy id string trx name super ctx ad replicationstrategy id trx name if ad replicationstrategy id 0 setad replicationstrategy id 0 set entity type null u set name null x_ad_replicationstrategy ad_replicationstrategy_id trxname ad_replicationstrategy_id trxname ad_replicationstrategy_id setad_replicationstrategy_id setentitytype setname load constructor public x ad replicationstrategy properties ctx result set rs string trx name super ctx rs trx name x_ad_replicationstrategy resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad replicationstrategy append get id append return sb to string tostring stringbuffer stringbuffer x_ad_replicationstrategy get_id tostring set replication strategy data replication strategy public void setad replicationstrategy id int ad replicationstrategy id if ad replicationstrategy id 1 throw new illegal argument exception ad replicationstrategy id is mandatory set valuenocheck ad replicationstrategy id new integer ad replicationstrategy id setad_replicationstrategy_id ad_replicationstrategy_id ad_replicationstrategy_id illegalargumentexception ad_replicationstrategy_id set_valuenocheck ad_replicationstrategy_id ad_replicationstrategy_id get replication strategy data replication strategy public int getad replicationstrategy id integer ii integer get value ad replicationstrategy id if ii null return 0 return ii int value getad_replicationstrategy_id get_value ad_replicationstrategy_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x m attributeinstance properties ctx int m attributeinstance id string trx name super ctx m attributeinstance id trx name if m attributeinstance id 0 setm attributesetinstance id 0 setm attribute id 0 x_m_attributeinstance m_attributeinstance_id trxname m_attributeinstance_id trxname m_attributeinstance_id setm_attributesetinstance_id setm_attribute_id load constructor public x m attributeinstance properties ctx result set rs string trx name super ctx rs trx name x_m_attributeinstance resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributeinstance append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributeinstance get_id tostring set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set attribute value product attribute value public void setm attributevalue id int m attributevalue id if m attributevalue id 0 set value m attributevalue id null else set value m attributevalue id new integer m attributevalue id setm_attributevalue_id m_attributevalue_id m_attributevalue_id set_value m_attributevalue_id set_value m_attributevalue_id m_attributevalue_id get attribute value product attribute value public int getm attributevalue id integer ii integer get value m attributevalue id if ii null return 0 return ii int value getm_attributevalue_id get_value m_attributevalue_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm attributevalue id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_attributevalue_id set attribute product attribute public void setm attribute id int m attribute id if m attribute id 1 throw new illegal argument exception m attribute id is mandatory set valuenocheck m attribute id new integer m attribute id setm_attribute_id m_attribute_id m_attribute_id illegalargumentexception m_attribute_id set_valuenocheck m_attribute_id m_attribute_id get attribute product attribute public int getm attribute id integer ii integer get value m attribute id if ii null return 0 return ii int value getm_attribute_id get_value m_attribute_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set value numeric value public void set value number big decimal value number set value value number value number setvaluenumber bigdecimal valuenumber set_value valuenumber valuenumber get value numeric value public big decimal get value number big decimal bd big decimal get value value number if bd null return env zero return bd bigdecimal getvaluenumber bigdecimal bigdecimal get_value valuenumber compiere default theme blue metal public compiere theme blue metal set default s theme this s name name compierethemebluemetal setdefault s_theme s_name set defaults protected void set default blue 102 102 153 primary1 new colorui resource 102 102 153 blue 153 153 204 primary2 new colorui resource 153 153 204 blue 204 204 255 primary3 new colorui resource 204 204 255 gray 102 102 102 secondary1 new colorui resource 102 102 102 gray 153 153 153 secondary2 new colorui resource 153 153 153 blue gray 214 224 234 background secondary3 new colorui resource 205 215 231 black black new colorui resource color black white white new colorui resource color white background for mandatory fields mandatory new colorui resource 224 224 255 blue isch background for fields in error error new colorui resource 255 204 204 red isch background for inactive fields inactive new colorui resource 234 234 234 light gray background for info fields info new colorui resource 253 237 207 light yellow foreground text ok txt ok new colorui resource 51 51 102 dark blue foreground text error txt error new colorui resource 204 0 0 dark red control font control font null getcontroltextfont system font system font null getsystemtextfont user font user font null getusertextfont small font small font null getsubtextfont window title font window font null getwindowtitlefont menu font menu font null getmenutextfont setdefault coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource bluegray coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource coloruiresource txt_ok coloruiresource txt_error coloruiresource controlfont _getcontroltextfont systemfont _getsystemtextfont userfont _getusertextfont smallfont _getsubtextfont windowfont _getwindowtitlefont menufont _getmenutextfont constructor param ctx context param c uom id uom id public muom properties ctx int c uom id string trx name super ctx c uom id trx name if c uom id 0 set name null setx12de355 null set is default false set std precision 2 set costing precision 6 c_uom_id c_uom_id trxname c_uom_id trxname c_uom_id setname setisdefault setstdprecision setcostingprecision load constructor param ctx context param rs result set public muom properties ctx result set rs string trx name super ctx rs trx name resultset trxname trxname string representation return info public string to string string buffer sb new string buffer uom sb append id append get id append name append get name return sb to string tostring stringbuffer stringbuffer get_id getname tostring round qty param qty quantity param std precision true if std precisison return rounded quantity public big decimal round big decimal qty boolean std precision int precision get std precision if std precision precision get costing precision if qty scale precision return qty set scale get std precision big decimal round half up return qty stdprecision bigdecimal bigdecimal stdprecision getstdprecision stdprecision getcostingprecision setscale getstdprecision bigdecimal round_half_up public boolean is minute return x12 minute equals getx12de355 isminute x12_minute return x12 minute equals getx12de355 public boolean is hour return x12 hour equals getx12de355 x12_minute ishour x12_hour return x12 hour equals getx12de355 public boolean is day return x12 day equals getx12de355 x12_hour isday x12_day return x12 day equals getx12de355 public boolean is work day return x12 day work equals getx12de355 x12_day isworkday x12_day_work return x12 day work equals getx12de355 public boolean is week return x12 week equals getx12de355 x12_day_work isweek x12_week return x12 week equals getx12de355 public boolean is month return x12 month equals getx12de355 x12_week ismonth x12_month return x12 month equals getx12de355 public boolean is work month return x12 month work equals getx12de355 x12_month isworkmonth x12_month_work return x12 month work equals getx12de355 public boolean is year return x12 year equals getx12de355 x12_month_work isyear x12_year get minute c uom id param ctx context return c uom id for minute public static int getminute uom id properties ctx if ini is client iterator it s cache values iterator while it has next muom uom muom it next if uom is minute return uom getc uom id server int c uom id 0 string sql select c uom id from c uom where is active y and x12de355 mj hard coded try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query if rs next c uom id rs get int 1 rs close pstmt close catch sql exception e s log log level severe sql e return c uom id c_uom_id c_uom_id getminute_uom_id isclient s_cache hasnext isminute getc_uom_id c_uom_id c_uom_id c_uom isactive hardcoded preparedstatement preparestatement resultset executequery c_uom_id getint sqlexception s_log c_uom_id get default c uom id param ctx context for ad client return c uom id public static int getdefault uom id properties ctx string sql select c uom id from c uom where ad client id in 0 order by is default desc ad client id desc c uom id return db getsql value null sql env getad client id ctx c_uom_id ad_client c_uom_id getdefault_uom_id c_uom_id c_uom ad_client_id isdefault ad_client_id c_uom_id getsqlvalue getad_client_id get uom from cache param ctx context param c uom id id return uom public static muom get properties ctx int c uom id if s cache size 0 loaduo ms ctx integer ii new integer c uom id muom uom muom s cache get ii if uom null return uom uom new muom ctx c uom id null s cache put new integer c uom id uom return uom c_uom_id c_uom_id s_cache loaduoms c_uom_id s_cache c_uom_id s_cache c_uom_id load all uo ms param ctx context private static void loaduo ms properties ctx string sql m role get default ctx false add accesssql select from c uom where is active y c uom m role sql notqualified m role sql ro try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next muom uom new muom ctx rs null s cache put new integer uom getc uom id uom rs close pstmt close catch sql exception e s log log level severe sql e uoms loaduoms mrole getdefault addaccesssql c_uom isactive c_uom mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery s_cache getc_uom_id sqlexception s_log standard constructor public x s training class properties ctx int s training class id string trx name super ctx s training class id trx name if s training class id 0 set end date new timestamp system current time millis setm product id 0 sets training class id 0 sets training id 0 set start date new timestamp system current time millis x_s_training_class s_training_class_id trxname s_training_class_id trxname s_training_class_id setenddate currenttimemillis setm_product_id sets_training_class_id sets_training_id setstartdate currenttimemillis load constructor public x s training class properties ctx result set rs string trx name super ctx rs trx name x_s_training_class resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s training class append get id append return sb to string tostring stringbuffer stringbuffer x_s_training_class get_id tostring set end date last effective date inclusive public void set end date timestamp end date if end date null throw new illegal argument exception end date is mandatory set value end date end date setenddate enddate enddate illegalargumentexception enddate set_value enddate enddate get end date last effective date inclusive public timestamp get end date return timestamp get value end date getenddate get_value enddate set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set training class the actual training class instance public void sets training class id int s training class id if s training class id 1 throw new illegal argument exception s training class id is mandatory set valuenocheck s training class id new integer s training class id sets_training_class_id s_training_class_id s_training_class_id illegalargumentexception s_training_class_id set_valuenocheck s_training_class_id s_training_class_id get training class the actual training class instance public int gets training class id integer ii integer get value s training class id if ii null return 0 return ii int value gets_training_class_id get_value s_training_class_id intvalue set training repeated training public void sets training id int s training id if s training id 1 throw new illegal argument exception s training id is mandatory set valuenocheck s training id new integer s training id sets_training_id s_training_id s_training_id illegalargumentexception s_training_id set_valuenocheck s_training_id s_training_id get training repeated training public int gets training id integer ii integer get value s training id if ii null return 0 return ii int value gets_training_id get_value s_training_id intvalue set start date first effective day inclusive public void set start date timestamp start date if start date null throw new illegal argument exception start date is mandatory set value start date start date setstartdate startdate startdate illegalargumentexception startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate return timestamp get value start date public key name pair get key name pair return new key name pair get id string value of get start date get_value startdate keynamepair getkeynamepair keynamepair get_id valueof getstartdate prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message throws exception protected string do it throws exception log info do it record id getrecord id get payment m payment pp new m payment get ctx getrecord id get trxname validate number string msg m payment validate validate credit card number pp get credit card number pp get credit card type if msg null msg length 0 throw new illegal argument exception msg get msg get ctx msg msg m payment validate validate credit card exp pp get credit card expmm pp get credit card expyy if msg null msg length 0 throw new illegal argument exception msg get msg get ctx msg if pp get credit cardvv length 0 msg m payment validate validate credit cardvv pp get credit cardvv pp get credit card type if msg null msg length 0 throw new illegal argument exception msg get msg get ctx msg process it boolean ok pp process online pp save if ok throw new exception pp get error message return ok doit doit record_id getrecord_id mpayment mpayment getctx getrecord_id get_trxname mpaymentvalidate validatecreditcardnumber getcreditcardnumber getcreditcardtype illegalargumentexception getmsg getctx mpaymentvalidate validatecreditcardexp getcreditcardexpmm getcreditcardexpyy illegalargumentexception getmsg getctx getcreditcardvv mpaymentvalidate validatecreditcardvv getcreditcardvv getcreditcardtype illegalargumentexception getmsg getctx processonline geterrormessage prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter perform process return message throws exception if not successful protected string do it throws exception int table id gettable id int record id getrecord id log info table id table id record id record id if table id x i bankstatement table id return create payment new x i bankstatement get ctx record id get trxname else if table id m bank statement line table id return create payment new m bank statement line get ctx record id get trxname throw new compiere system error doit table_id gettable_id record_id getrecord_id table_id table_id record_id record_id table_id x_i_bankstatement table_id createpayment x_i_bankstatement getctx record_id get_trxname table_id mbankstatementline table_id createpayment mbankstatementline getctx record_id get_trxname compieresystemerror create payment for import param ibs import bank statement return message private string create payment x i bankstatement ibs throws exception if ibs null ibs getc payment id 0 return log fine ibs to string if ibs getc invoice id 0 ibs getc bpartner id 0 throw new compiere user error not found c invoice id c bpartner id if ibs getc bankaccount id 0 throw new compiere user error not found c bankaccount id m payment payment create payment ibs getc invoice id ibs getc bpartner id ibs getc currency id ibs get stmt amt ibs get trx amt ibs getc bankaccount id ibs get statement line date null ibs get statement date ibs get statement line date ibs get date acct ibs get description ibs getad org id if payment null throw new compiere system error could not create payment ibs setc payment id payment getc payment id ibs setc currency id payment getc currency id ibs set trx amt payment get pay amt ibs save string ret string c payment id payment get document no if payment get over under amt signum 0 ret string over under amt payment get over under amt return ret string createpayment x_i_bankstatement getc_payment_id tostring getc_invoice_id getc_bpartner_id compiereusererror notfound c_invoice_id c_bpartner_id getc_bankaccount_id compiereusererror notfound c_bankaccount_id mpayment createpayment getc_invoice_id getc_bpartner_id getc_currency_id getstmtamt gettrxamt getc_bankaccount_id getstatementlinedate getstatementdate getstatementlinedate getdateacct getdescription getad_org_id compieresystemerror setc_payment_id getc_payment_id setc_currency_id getc_currency_id settrxamt getpayamt retstring c_payment_id getdocumentno getoverunderamt retstring overunderamt getoverunderamt retstring create payment for bank statement param bsl bank statement line return message private string create payment m bank statement line bsl throws exception if bsl null bsl getc payment id 0 return log fine bsl to string if bsl getc invoice id 0 bsl getc bpartner id 0 throw new compiere user error not found c invoice id c bpartner id m bank statement bs new m bank statement get ctx bsl getc bankstatement id get trxname m payment payment create payment bsl getc invoice id bsl getc bpartner id bsl getc currency id bsl get stmt amt bsl get trx amt bs getc bankaccount id bsl get statement line date bsl get date acct bsl get description bsl getad org id if payment null throw new compiere system error could not create payment update statement bsl set payment payment bsl save string ret string c payment id payment get document no if payment get over under amt signum 0 ret string over under amt payment get over under amt return ret string bankstatement createpayment mbankstatementline getc_payment_id tostring getc_invoice_id getc_bpartner_id compiereusererror notfound c_invoice_id c_bpartner_id mbankstatement mbankstatement getctx getc_bankstatement_id get_trxname mpayment createpayment getc_invoice_id getc_bpartner_id getc_currency_id getstmtamt gettrxamt getc_bankaccount_id getstatementlinedate getdateacct getdescription getad_org_id compieresystemerror setpayment retstring c_payment_id getdocumentno getoverunderamt retstring overunderamt getoverunderamt retstring create actual payment param c invoice id invoice param c bpartner id partner ignored when invoice exists param c currency id currency param stmt amt statement amount param trx amt transaction amt return payment private m payment create payment int c invoice id int c bpartner id int c currency id big decimal stmt amt big decimal trx amt int c bankaccount id timestamp date trx timestamp date acct string description int ad org id trx amount payment overwrites statement amount if defined big decimal pay amt trx amt if pay amt null env zero compare to pay amt 0 pay amt stmt amt if c invoice id 0 pay amt null env zero compare to pay amt 0 throw new illegal state exception pay amt 0 if pay amt null pay amt env zero m payment payment new m payment get ctx 0 get trxname payment setad org id ad org id payment setc bankaccount id c bankaccount id payment set tender type m payment tendertype check if date trx null payment set date trx date trx else if date acct null payment set date trx date acct if date acct null payment set date acct date acct else payment set date acct payment get date trx payment set description description if c invoice id 0 m invoice invoice new m invoice get ctx c invoice id null payment setc doctype id invoice isso trx receipt payment setc invoice id invoice getc invoice id payment setc bpartner id invoice getc bpartner id if pay amt signum 0 explicit amount payment setc currency id c currency id if invoice isso trx payment set pay amt pay amt else payment is likely to be negative payment set pay amt pay amt negate payment set over under amt invoice get grand total true subtract payment get pay amt else set pay amout from invoice payment setc currency id invoice getc currency id payment set pay amt invoice get grand total true else if c bpartner id 0 payment setc bpartner id c bpartner id payment setc currency id c currency id if pay amt signum 0 payment payment set pay amt pay amt abs payment setc doctype id false else receipt payment set pay amt pay amt payment setc doctype id true else return null payment save payment process it m payment docaction complete payment save return payment c_invoice_id c_bpartner_id c_currency_id stmtamt trxamt mpayment createpayment c_invoice_id c_bpartner_id c_currency_id bigdecimal stmtamt bigdecimal trxamt c_bankaccount_id datetrx dateacct ad_org_id bigdecimal payamt trxamt payamt compareto payamt payamt stmtamt c_invoice_id payamt compareto payamt illegalstateexception payamt payamt payamt mpayment mpayment getctx get_trxname setad_org_id ad_org_id setc_bankaccount_id c_bankaccount_id settendertype mpayment tendertype_check datetrx setdatetrx datetrx dateacct setdatetrx dateacct dateacct setdateacct dateacct setdateacct getdatetrx setdescription c_invoice_id minvoice minvoice getctx c_invoice_id setc_doctype_id issotrx setc_invoice_id getc_invoice_id setc_bpartner_id getc_bpartner_id payamt setc_currency_id c_currency_id issotrx setpayamt payamt setpayamt payamt setoverunderamt getgrandtotal getpayamt setc_currency_id getc_currency_id setpayamt getgrandtotal c_bpartner_id setc_bpartner_id c_bpartner_id setc_currency_id c_currency_id payamt setpayamt payamt setc_doctype_id setpayamt payamt setc_doctype_id processit mpayment docaction_complete creates a new metal split paneui instance param x return componentui public static componentui createui j component x return new compiere split paneui metalsplitpaneui jcomponent compieresplitpaneui creates the default divider return split pane divider public basic split pane divider create default divider return new compiere split pane divider this splitpanedivider basicsplitpanedivider createdefaultdivider compieresplitpanedivider installs the ui param c public void installui j component c super installui c c set opaque false basic borders split pane border paints gray border resulting in a 2pt border for the left right components but results in 1pt gray line on top button of divider still a 1 pt shaddow light gay line is painted c set border null jcomponent setopaque basicborders splitpaneborder setborder standard constructor public x c task properties ctx int c task id string trx name super ctx c task id trx name if c task id 0 setc phase id 0 setc task id 0 set name null set seq no 0 sql select nvl max seq no 0 10 as default value from c task where c phase id c phase id set standard qty env zero 1 x_c_task c_task_id trxname c_task_id trxname c_task_id setc_phase_id setc_task_id setname setseqno seqno defaultvalue c_task c_phase_id c_phase_id setstandardqty load constructor public x c task properties ctx result set rs string trx name super ctx rs trx name x_c_task resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c task append get id append return sb to string tostring stringbuffer stringbuffer x_c_task get_id tostring set standard phase standard phase of the project type public void setc phase id int c phase id if c phase id 1 throw new illegal argument exception c phase id is mandatory set valuenocheck c phase id new integer c phase id setc_phase_id c_phase_id c_phase_id illegalargumentexception c_phase_id set_valuenocheck c_phase_id c_phase_id get standard phase standard phase of the project type public int getc phase id integer ii integer get value c phase id if ii null return 0 return ii int value getc_phase_id get_value c_phase_id intvalue set standard task standard project type task public void setc task id int c task id if c task id 1 throw new illegal argument exception c task id is mandatory set valuenocheck c task id new integer c task id setc_task_id c_task_id c_task_id illegalargumentexception c_task_id set_valuenocheck c_task_id c_task_id get standard task standard project type task public int getc task id integer ii integer get value c task id if ii null return 0 return ii int value getc_task_id get_value c_task_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set standard quantity standard quantity public void set standard qty big decimal standard qty if standard qty null throw new illegal argument exception standard qty is mandatory set value standard qty standard qty setstandardqty bigdecimal standardqty standardqty illegalargumentexception standardqty set_value standardqty standardqty get standard quantity standard quantity public big decimal get standard qty big decimal bd big decimal get value standard qty if bd null return env zero return bd bigdecimal getstandardqty bigdecimal bigdecimal get_value standardqty standard constructor public x m costelement properties ctx int m costelement id string trx name super ctx m costelement id trx name if m costelement id 0 set cost element type null set is calculated false setm costelement id 0 set name null x_m_costelement m_costelement_id trxname m_costelement_id trxname m_costelement_id setcostelementtype setiscalculated setm_costelement_id setname load constructor public x m costelement properties ctx result set rs string trx name super ctx rs trx name x_m_costelement resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m costelement append get id append return sb to string tostring stringbuffer stringbuffer x_m_costelement get_id tostring public static final string costelementtype outsideprocessing x set cost element type type of cost element public void set cost element type string cost element type if cost element type null throw new illegal argument exception cost element type is mandatory if cost element type equals b cost element type equals m cost element type equals o cost element type equals r cost element type equals x else throw new illegal argument exception cost element type invalid value cost element type reference id 338 b m o r x if cost element type length 1 log warning length 1 truncated cost element type cost element type substring 0 0 set value cost element type cost element type costelementtype_outsideprocessing setcostelementtype costelementtype costelementtype illegalargumentexception costelementtype costelementtype costelementtype costelementtype costelementtype costelementtype illegalargumentexception costelementtype costelementtype reference_id costelementtype costelementtype costelementtype set_value costelementtype costelementtype get cost element type type of cost element public string get cost element type return string get value cost element type getcostelementtype get_value costelementtype public static final string costingmethod x set costing method indicates how costs will be calculated public void set costing method string costing method if costing method null throw new illegal argument exception costing method is mandatory if costing method null costing method equals a costing method equals f costing method equals i costing method equals l costing method equals s costing method equals u costing method equals i costing method equals p costing method equals x else throw new illegal argument exception costing method invalid value costing method reference id 122 a f i l s u i p x if costing method null costing method length 1 log warning length 1 truncated costing method costing method substring 0 0 set value costing method costing method costingmethod__ setcostingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod reference_id costingmethod costingmethod costingmethod costingmethod set_value costingmethod costingmethod get costing method indicates how costs will be calculated public string get costing method return string get value costing method getcostingmethod get_value costingmethod set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set calculated the value is calculated by the system public void set is calculated boolean is calculated set value is calculated new boolean is calculated setiscalculated iscalculated set_value iscalculated iscalculated get calculated the value is calculated by the system public boolean is calculated object oo get value is calculated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscalculated get_value iscalculated booleanvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 1 throw new illegal argument exception m costelement id is mandatory set valuenocheck m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id illegalargumentexception m_costelement_id set_valuenocheck m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor param ctx context param c acctprocessorlog id id public m acct processor log properties ctx int c acctprocessorlog id string trx name super ctx c acctprocessorlog id trx name c_acctprocessorlog_id macctprocessorlog c_acctprocessorlog_id trxname c_acctprocessorlog_id trxname load constructor param ctx context param rs result set public m acct processor log properties ctx result set rs string trx name super ctx rs trx name macctprocessorlog resultset trxname trxname parent constructor param parent parent param summary summary public m acct processor log m acct processor parent string summary this parent get ctx 0 parent get trxname set client org parent setc acctprocessor id parent getc acctprocessor id set summary summary macctprocessorlog macctprocessor getctx get_trxname setclientorg setc_acctprocessor_id getc_acctprocessor_id setsummary standard constructor param ctx context param c dunningrun id id public m dunning run properties ctx int c dunningrun id string trx name super ctx c dunningrun id trx name if c dunningrun id 0 setc dunninglevel id 0 set dunning date new timestamp system current time millis set processed false c_dunningrun_id mdunningrun c_dunningrun_id trxname c_dunningrun_id trxname c_dunningrun_id setc_dunninglevel_id setdunningdate currenttimemillis setprocessed load constructor param ctx context param rs result set public m dunning run properties ctx result set rs string trx name super ctx rs trx name mdunningrun resultset trxname trxname get dunning level return level public m dunning level get level if m level null m level new m dunning level get ctx getc dunninglevel id get trxname return m level mdunninglevel getlevel m_level m_level mdunninglevel getctx getc_dunninglevel_id get_trxname m_level get entries param requery requery return entries public m dunning run entry get entries boolean requery if m entries null requery return m entries string sql select from c dunningrunentry where c dunningrun id array list m dunning run entry list new array list m dunning run entry prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc dunningrun id result set rs pstmt execute query while rs next list add new m dunning run entry get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get entries e try if pstmt null pstmt close pstmt null catch exception e pstmt null m entries new m dunning run entry list size list to array m entries return m entries mdunningrunentry getentries m_entries m_entries c_dunningrunentry c_dunningrun_id arraylist mdunningrunentry arraylist mdunningrunentry preparedstatement preparestatement get_trxname setint getc_dunningrun_id resultset executequery mdunningrunentry getctx get_trxname getentries m_entries mdunningrunentry toarray m_entries m_entries delete all entries param force delete also processed records return true if deleted public boolean delete entries boolean force get entries true for int i 0 i m entries length i m dunning run entry entry m entries i entry delete force boolean ok get entries true length 0 if ok m entries null return ok deleteentries getentries m_entries mdunningrunentry m_entries getentries m_entries get create entry for b partner param c bpartner id id return entry public m dunning run entry get entry int c bpartner id int c currency id int salesrep id todo related bp int c bpartnerrelated id c bpartner id get entries false for int i 0 i m entries length i m dunning run entry entry m entries i if entry getc bpartner id c bpartnerrelated id return entry new entry m dunning run entry entry new m dunning run entry this mb partner bp new mb partner get ctx c bpartnerrelated id get trxname entry setb partner bp true ar hardcoded if entry getsalesrep id 0 entry setsalesrep id salesrep id entry setc currency id c currency id m entries null return entry bpartner c_bpartner_id mdunningrunentry getentry c_bpartner_id c_currency_id salesrep_id c_bpartnerrelated_id c_bpartner_id getentries m_entries mdunningrunentry m_entries getc_bpartner_id c_bpartnerrelated_id mdunningrunentry mdunningrunentry mbpartner mbpartner getctx c_bpartnerrelated_id get_trxname setbpartner getsalesrep_id setsalesrep_id salesrep_id setc_currency_id c_currency_id m_entries standard constructor public x ad replication log properties ctx int ad replication log id string trx name super ctx ad replication log id trx name if ad replication log id 0 setad replication log id 0 setad replication run id 0 set is replicated false n x_ad_replication_log ad_replication_log_id trxname ad_replication_log_id trxname ad_replication_log_id setad_replication_log_id setad_replication_run_id setisreplicated load constructor public x ad replication log properties ctx result set rs string trx name super ctx rs trx name x_ad_replication_log resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad replication log append get id append return sb to string tostring stringbuffer stringbuffer x_ad_replication_log get_id tostring set replication table data replication strategy table info public void setad replicationtable id int ad replicationtable id if ad replicationtable id 0 set value ad replicationtable id null else set value ad replicationtable id new integer ad replicationtable id setad_replicationtable_id ad_replicationtable_id ad_replicationtable_id set_value ad_replicationtable_id set_value ad_replicationtable_id ad_replicationtable_id get replication table data replication strategy table info public int getad replicationtable id integer ii integer get value ad replicationtable id if ii null return 0 return ii int value getad_replicationtable_id get_value ad_replicationtable_id intvalue set replication log data replication log details public void setad replication log id int ad replication log id if ad replication log id 1 throw new illegal argument exception ad replication log id is mandatory set valuenocheck ad replication log id new integer ad replication log id setad_replication_log_id ad_replication_log_id ad_replication_log_id illegalargumentexception ad_replication_log_id set_valuenocheck ad_replication_log_id ad_replication_log_id get replication log data replication log details public int getad replication log id integer ii integer get value ad replication log id if ii null return 0 return ii int value getad_replication_log_id get_value ad_replication_log_id intvalue set replication run data replication run public void setad replication run id int ad replication run id if ad replication run id 1 throw new illegal argument exception ad replication run id is mandatory set valuenocheck ad replication run id new integer ad replication run id setad_replication_run_id ad_replication_run_id ad_replication_run_id illegalargumentexception ad_replication_run_id set_valuenocheck ad_replication_run_id ad_replication_run_id get replication run data replication run public int getad replication run id integer ii integer get value ad replication run id if ii null return 0 return ii int value getad_replication_run_id get_value ad_replication_run_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad replication run id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_replication_run_id set replicated the data is successfully replicated public void set is replicated boolean is replicated set value is replicated new boolean is replicated setisreplicated isreplicated set_value isreplicated isreplicated get replicated the data is successfully replicated public boolean is replicated object oo get value is replicated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreplicated get_value isreplicated booleanvalue set process message public void setp msg string p msg if p msg null p msg length 2000 log warning length 2000 truncated p msg p msg substring 0 1999 set value p msg p msg setp_msg p_msg p_msg p_msg p_msg p_msg set_value p_msg p_msg get process message public string getp msg return string get value p msg getp_msg get_value p_msg prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad user id p ad user id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter ad_user_id p_ad_user_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception log info do it ad user id p ad user id string sql delete from ad note where ad client id getad client id if p ad user id 0 sql and ad user id p ad user id int no db execute update sql get trxname return deleted no doit doit ad_user_id p_ad_user_id ad_note ad_client_id getad_client_id p_ad_user_id ad_user_id p_ad_user_id executeupdate get_trxname prepare see org compiere process svr process prepare protected void prepare p m discountschema id getrecord id svrprocess p_m_discountschema_id getrecord_id execute return info protected string do it throws exception log info m discountschema id p m discountschema id if p m discountschema id 0 throw new compiere user error m discountschema id 0 m discount schema ds new m discount schema get ctx p m discountschema id get trxname if ds get id 0 throw new compiere user error not found m discountschema id p m discountschema id int updated ds re seq return updated updated doit m_discountschema_id p_m_discountschema_id p_m_discountschema_id compiereusererror m_discountschema_id mdiscountschema mdiscountschema getctx p_m_discountschema_id get_trxname get_id compiereusererror notfound m_discountschema_id p_m_discountschema_id reseq basic constructor public q basic constructor param element adds an element to the element public q element element add element element addelement basic constructor param element adds an element to the element public q string element add element element addelement basic constructor param element adds an element to the element param cite sets the cite attribute public q element element string cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public q string element string cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public q element element element cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public q string element element cite add element element set cite cite addelement setcite sets the cite attribute param cite sets the cite attribute public q set cite string cite add attribute cite cite return this setcite addattribute sets the cite attribute param cite sets the cite attribute public q set cite element cite add attribute cite cite return this setcite addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public q add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public q add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public q add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public q add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public q remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id big decimal para i get parameter int value else if name equals ad table id p ad table id big decimal para i get parameter int value else if name equals delete posting p deleteposting y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id bigdecimal getparameter intvalue ad_table_id p_ad_table_id bigdecimal getparameter intvalue deleteposting p_deleteposting getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception log info ad client id p ad client id ad table id p ad table id delete posting p deleteposting string sql select ad table id table name from ad table t where t is view n if p ad table id 0 sql and t ad table id p ad table id sql and exists select from ad column c where t ad table id c ad table id and c column name posted and c is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname result set rs pstmt execute query while rs next int ad table id rs get int 1 string table name rs get string 2 if p deleteposting delete table name ad table id else reset table name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return updated m countreset deleted m countdelete doit ad_client_id p_ad_client_id ad_table_id p_ad_table_id deleteposting p_deleteposting ad_table_id tablename ad_table isview p_ad_table_id ad_table_id p_ad_table_id ad_column ad_table_id ad_table_id columnname isactive preparedstatement preparestatement get_trxname resultset executequery ad_table_id getint tablename getstring p_deleteposting tablename ad_table_id tablename m_countreset m_countdelete reset accounting table and update count param table name table private void reset string table name string sql update table name set processing n where ad client id p ad client id and processing n or processing is null int unlocked db execute update sql get trxname sql update table name set posted n where ad client id p ad client id and posted not in y n or posted is null and processed y int invalid db execute update sql get trxname if unlocked invalid 0 log fine table name unlocked unlocked invalid invalid m countreset unlocked invalid tablename tablename tablename ad_client_id p_ad_client_id executeupdate get_trxname tablename ad_client_id p_ad_client_id executeupdate get_trxname tablename m_countreset delete accounting table where period status is open and update count param ad table id table private void delete string table name int ad table id reset table name m countreset 0 string doc base type null if ad table id m invoice table id doc base type in m period control docbasetype apinvoice m period control docbasetype arinvoice m period control docbasetype apcreditmemo m period control docbasetype arcreditmemo m period control docbasetype arproformainvoice else if ad table id m in out table id doc base type in m period control docbasetype materialdelivery m period control docbasetype materialreceipt else if ad table id m payment table id doc base type in m period control docbasetype appayment m period control docbasetype arreceipt else if ad table id m order table id doc base type in m period control docbasetype salesorder m period control docbasetype purchaseorder else if ad table id m project issue table id doc base type m period control docbasetype projectissue else if ad table id m bank statement table id doc base type m period control docbasetype bankstatement else if ad table id m cash table id doc base type m period control docbasetype cashjournal else if ad table id m allocation hdr table id doc base type m period control docbasetype paymentallocation else if ad table id m journal table id doc base type m period control docbasetype gljournal else if ad table id m table id doc base type m period control docbasetype gldocument else if ad table id m movement table id doc base type m period control docbasetype materialmovement else if ad table id m requisition table id doc base type m period control docbasetype purchaserequisition else if ad table id m inventory table id doc base type m period control docbasetype materialphysicalinventory else if ad table id x m production table id doc base type m period control docbasetype materialproduction else if ad table id m match inv table id doc base type m period control docbasetype matchinvoice else if ad table id m matchpo table id doc base type m period control docbasetype matchpo if doc base type null log severe unknown doc base type for table table name doc base type else doc base type and pc doc base type doc base type doc string sql update table name doc set posted n processing n where ad client id p ad client id and posted n or posted is null or processing n or processing is null and exists select from c periodcontrol pc inner join fact acct fact on fact c period id pc c period id where pc period status o doc base type and fact ad table id ad table id and fact record id doc table name id int reset db execute update sql get trxname fact sql delete fact acct fact where ad client id p ad client id and ad table id ad table id and exists select from c periodcontrol pc where pc period status o doc base type and fact c period id pc c period id int deleted db execute update sql get trxname balances fin balance update balance client get ctx p ad client id true delete log info table name ad table id reset reset deleted deleted m countreset reset m countdelete deleted ad_table_id tablename ad_table_id tablename m_countreset docbasetype ad_table_id minvoice table_id docbasetype mperiodcontrol docbasetype_apinvoice mperiodcontrol docbasetype_arinvoice mperiodcontrol docbasetype_apcreditmemo mperiodcontrol docbasetype_arcreditmemo mperiodcontrol docbasetype_arproformainvoice ad_table_id minout table_id docbasetype mperiodcontrol docbasetype_materialdelivery mperiodcontrol docbasetype_materialreceipt ad_table_id mpayment table_id docbasetype mperiodcontrol docbasetype_appayment mperiodcontrol docbasetype_arreceipt ad_table_id morder table_id docbasetype mperiodcontrol docbasetype_salesorder mperiodcontrol docbasetype_purchaseorder ad_table_id mprojectissue table_id docbasetype mperiodcontrol docbasetype_projectissue ad_table_id mbankstatement table_id docbasetype mperiodcontrol docbasetype_bankstatement ad_table_id mcash table_id docbasetype mperiodcontrol docbasetype_cashjournal ad_table_id mallocationhdr table_id docbasetype mperiodcontrol docbasetype_paymentallocation ad_table_id mjournal table_id docbasetype mperiodcontrol docbasetype_gljournal ad_table_id table_id docbasetype mperiodcontrol docbasetype_gldocument ad_table_id mmovement table_id docbasetype mperiodcontrol docbasetype_materialmovement ad_table_id mrequisition table_id docbasetype mperiodcontrol docbasetype_purchaserequisition ad_table_id minventory table_id docbasetype mperiodcontrol docbasetype_materialphysicalinventory ad_table_id x_m_production table_id docbasetype mperiodcontrol docbasetype_materialproduction ad_table_id mmatchinv table_id docbasetype mperiodcontrol docbasetype_matchinvoice ad_table_id mmatchpo table_id docbasetype mperiodcontrol docbasetype_matchpo docbasetype docbasetype tablename docbasetype docbasetype docbasetype docbasetype tablename ad_client_id p_ad_client_id c_periodcontrol fact_acct c_period_id c_period_id periodstatus docbasetype ad_table_id ad_table_id record_id tablename _id executeupdate get_trxname fact_acct ad_client_id p_ad_client_id ad_table_id ad_table_id c_periodcontrol periodstatus docbasetype c_period_id c_period_id executeupdate get_trxname finbalance updatebalanceclient getctx p_ad_client_id tablename ad_table_id m_countreset m_countdelete product attribute instance dialog param frame parent frame param m attributesetinstance id product attribute set instance id param m product id product id param product window this is the product window define product instance param ad column id column public vp attribute dialog frame frame int m attributesetinstance id int m product id int c bpartner id boolean product window int ad column id int window no super frame msg translate env get ctx m attributesetinstance id true log config m attributesetinstance id m attributesetinstance id m product id m product id c bpartner id c bpartner id productw product window column ad column id m windowno env create window no this m m attributesetinstance id m attributesetinstance id m m product id m product id m c bpartner id c bpartner id m productwindow product window m ad column id ad column id m windownoparent window no try jb init catch exception ex log log level severe vp attribute dialog ex dynamic init if init attributes dispose return a env show center window frame this m_attributesetinstance_id m_product_id productwindow ad_column_id vpattributedialog m_attributesetinstance_id m_product_id c_bpartner_id productwindow ad_column_id windowno getctx m_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id m_product_id m_product_id c_bpartner_id c_bpartner_id productwindow ad_column_id m_windowno createwindowno m_m_attributesetinstance_id m_attributesetinstance_id m_m_product_id m_product_id m_c_bpartner_id c_bpartner_id m_productwindow productwindow m_ad_column_id ad_column_id m_windownoparent windowno jbinit vpattributedialog initattributes aenv showcenterwindow layout throws exception private void jb init throws exception this get content pane set layout main layout this get content pane add center panel border layout center this get content pane add confirm panel border layout south center panel set layout center layout confirm panel add action listener this jbinit getcontentpane setlayout mainlayout getcontentpane centerpanel borderlayout getcontentpane confirmpanel borderlayout centerpanel setlayout centerlayout confirmpanel addactionlistener dyanmic init return true if initialized private boolean init attributes if m m product id 0 return false get model m masi m attribute set instance get env get ctx m m attributesetinstance id m m product id if m masi null log severe no model for m attributesetinstance id m m attributesetinstance id m product id m m product id return false env set context env get ctx m windowno m attributeset id m masi getm attributeset id get attribute set m attribute set as m masi getm attribute set product has no attribute set if as null a dialog error m windowno this p attribute no attribute set return false product has no instance attributes if m productwindow as is instance attribute a dialog error m windowno this p attribute no instance attribute return false show product attributes if m productwindow m attribute attributes as getm attributes false log fine product attributes attributes length for int i 0 i attributes length i add attribute line attributes i true m productwindow else set instance attributes new edit selection if m m attributesetinstance id 0 new cb new edit set text msg get msg env get ctx new record else cb new edit set text msg get msg env get ctx edit record cb new edit add action listener this center panel add cb new edit new a layout constraint m row 0 b select set text msg get msg env get ctx select existing b select add action listener this center panel add b select null all attributes m attribute attributes as getm attributes true log fine instance attributes attributes length for int i 0 i attributes length i add attribute line attributes i false false lot if m productwindow as is lot c label label new c label msg translate env get ctx lot label set label for field lot string center panel add label new a layout constraint m row 0 center panel add field lot string null field lot string set text m masi get lot m lot id int ad column id 9771 m attributesetinstance m lot id field lot new v lookup m lot id false false true m lookup factory get env get ctx m windowno 0 ad column id display type table dir string sql select m lot id name from m lot l where exists select m product id from m product p where p m attributeset id m masi getm attributeset id and p m product id l m product id field lot new c combo box db get key name pairs sql true label new c label msg translate env get ctx m lot id label set label for field lot center panel add label new a layout constraint m row 0 center panel add field lot null if m masi getm lot id 0 for int i 1 i field lot get item count i key name pair pp key name pair field lot get item at i if pp get key m masi getm lot id field lot set selected index i field lot string set editable false break field lot add action listener this new lot button if m masi getm attribute set getm lotctl id 0 if m role get default is table access m lot table id false m role get default is table access m lot ctl table id false m masi is exclude lot m ad column id env isso trx env get ctx m windownoparent center panel add b lot null b lot add action listener this popup field lot add mouse listener new vpattributedialog mouseadapter this popup m zoom new c menu item msg get msg env get ctx zoom env get image icon zoom16 gif m zoom add action listener this popup menu add m zoom lot ser no if m productwindow as is ser no c label label new c label msg translate env get ctx ser no label set label for field ser no field ser no set text m masi get ser no center panel add label new a layout constraint m row 0 center panel add field ser no null new ser no button if m masi getm attribute set getm sernoctl id 0 if m role get default is table access m ser no ctl table id false m masi is exclude ser no m ad column id env isso trx env get ctx m windownoparent center panel add b ser no null b ser no add action listener this ser no guarantee date if m productwindow as is guarantee date c label label new c label msg translate env get ctx guarantee date label set label for field guarantee date if m m attributesetinstance id 0 field guarantee date set value m masi get guarantee date true else field guarantee date set value m masi get guarantee date center panel add label new a layout constraint m row 0 center panel add field guarantee date null guarantee date if m row 0 a dialog error m windowno this p attribute no info return false new edit window if m productwindow cb new edit set selected m m attributesetinstance id 0 cmd newedit attrribute set instance description c label label new c label msg translate env get ctx description label set label for field description field description set text m masi get description field description set editable false center panel add label new a layout constraint m row 0 center panel add field description null window usually to wide dimension dd center panel get preferred size dd width math min 500 dd width center panel set preferred size dd return true initattributes m_m_product_id m_masi mattributesetinstance getctx m_m_attributesetinstance_id m_m_product_id m_masi m_attributesetinstance_id m_m_attributesetinstance_id m_product_id m_m_product_id setcontext getctx m_windowno m_attributeset_id m_masi getm_attributeset_id mattributeset m_masi getmattributeset adialog m_windowno pattributenoattributeset m_productwindow isinstanceattribute adialog m_windowno pattributenoinstanceattribute m_productwindow mattribute getmattributes addattributeline m_productwindow m_m_attributesetinstance_id cbnewedit settext getmsg getctx newrecord cbnewedit settext getmsg getctx editrecord cbnewedit addactionlistener centerpanel cbnewedit alayoutconstraint m_row bselect settext getmsg getctx selectexisting bselect addactionlistener centerpanel bselect mattribute getmattributes addattributeline m_productwindow islot clabel clabel getctx setlabelfor fieldlotstring centerpanel alayoutconstraint m_row centerpanel fieldlotstring fieldlotstring settext m_masi getlot m_lot_id ad_column_id m_attributesetinstance m_lot_id fieldlot vlookup m_lot_id mlookupfactory getctx m_windowno ad_column_id displaytype tabledir m_lot_id m_lot m_product_id m_product m_attributeset_id m_masi getm_attributeset_id m_product_id m_product_id fieldlot ccombobox getkeynamepairs clabel getctx m_lot_id setlabelfor fieldlot centerpanel alayoutconstraint m_row centerpanel fieldlot m_masi getm_lot_id fieldlot getitemcount keynamepair keynamepair fieldlot getitemat getkey m_masi getm_lot_id fieldlot setselectedindex fieldlotstring seteditable fieldlot addactionlistener m_masi getmattributeset getm_lotctl_id mrole getdefault istableaccess mlot table_id mrole getdefault istableaccess mlotctl table_id m_masi isexcludelot m_ad_column_id issotrx getctx m_windownoparent centerpanel blot blot addactionlistener fieldlot addmouselistener vpattributedialog_mouseadapter mzoom cmenuitem getmsg getctx getimageicon mzoom addactionlistener popupmenu mzoom serno m_productwindow isserno clabel clabel getctx serno setlabelfor fieldserno fieldserno settext m_masi getserno centerpanel alayoutconstraint m_row centerpanel fieldserno serno m_masi getmattributeset getm_sernoctl_id mrole getdefault istableaccess msernoctl table_id m_masi isexcludeserno m_ad_column_id issotrx getctx m_windownoparent centerpanel bserno bserno addactionlistener serno guaranteedate m_productwindow isguaranteedate clabel clabel getctx guaranteedate setlabelfor fieldguaranteedate m_m_attributesetinstance_id fieldguaranteedate setvalue m_masi getguaranteedate fieldguaranteedate setvalue m_masi getguaranteedate centerpanel alayoutconstraint m_row centerpanel fieldguaranteedate guaranteedate m_row adialog m_windowno pattributenoinfo m_productwindow cbnewedit setselected m_m_attributesetinstance_id cmd_newedit clabel clabel getctx setlabelfor fielddescription fielddescription settext m_masi getdescription fielddescription seteditable centerpanel alayoutconstraint m_row centerpanel fielddescription centerpanel getpreferredsize centerpanel setpreferredsize add attribute line param attribute attribute param product product level attribute param read only value is read only private void add attribute line m attribute attribute boolean product boolean read only log fine attribute product product r o read only c label label new c label attribute get name if product label set font new font label get font get font name font bold label get font get size if attribute get description null label set tool tip text attribute get description center panel add label new a layout constraint m row 0 m attribute instance instance attribute getm attribute instance m m attributesetinstance id if m attribute attributevaluetype list equals attribute get attribute value type m attribute value values attribute getm attribute values optional null c combo box editor new c combo box values boolean found false if instance null for int i 0 i values length i if values i null values i getm attributevalue id instance getm attributevalue id editor set selected index i found true break if found log fine attribute attribute get name values length found instance else log warning attribute attribute get name values length not found instance set combo box else log fine attribute attribute get name values length no instance label set label for editor center panel add editor null if read only editor set enabled false else m editors add editor else if m attribute attributevaluetype number equals attribute get attribute value type v number editor new v number attribute get name attribute is mandatory false true display type number attribute get name if instance null editor set value instance get value number else editor set value env zero label set label for editor center panel add editor null if read only editor set enabled false else m editors add editor else text field v string editor new v string attribute get name attribute is mandatory false true 20 instance value length null null if instance null editor set text instance get value label set label for editor center panel add editor null if read only editor set enabled false else m editors add editor readonly addattributeline mattribute readonly readonly clabel clabel getname setfont getfont getfontname getfont getsize getdescription settooltiptext getdescription centerpanel alayoutconstraint m_row mattributeinstance getmattributeinstance m_m_attributesetinstance_id mattribute attributevaluetype_list getattributevaluetype mattributevalue getmattributevalues ccombobox ccombobox getm_attributevalue_id getm_attributevalue_id setselectedindex getname getname setcombobox getname setlabelfor centerpanel readonly setenabled m_editors mattribute attributevaluetype_number getattributevaluetype vnumber vnumber getname ismandatory displaytype getname setvalue getvaluenumber setvalue setlabelfor centerpanel readonly setenabled m_editors vstring vstring getname ismandatory instance_value_length settext getvalue setlabelfor centerpanel readonly setenabled m_editors dispose public void dispose remove all env clear win context m windowno super dispose removeall clearwincontext m_windowno action listener param e event public void action performed action event e select instance if e get source b select if cmd select dispose new edit else if e get source cb new edit cmd newedit select lot from existing else if e get source field lot key name pair pp key name pair field lot get selected item if pp null pp get key 1 field lot string set text pp get name field lot string set editable false m masi setm lot id pp get key else field lot string set editable true m masi setm lot id 0 create new lot else if e get source b lot key name pair pp m masi create lot m m product id if pp null field lot add item pp field lot set selected item pp create new ser no else if e get source b ser no field ser no set text m masi get ser no true ok else if e get action command equals confirm panel a ok if save selection dispose cancel else if e get action command equals confirm panel a cancel m changed false dispose zoom m lot else if e get source m zoom cmd zoom else log log level severe not found e actionlistener actionperformed actionevent getsource bselect cmd_select getsource cbnewedit cmd_newedit getsource fieldlot keynamepair keynamepair fieldlot getselecteditem getkey fieldlotstring settext getname fieldlotstring seteditable m_masi setm_lot_id getkey fieldlotstring seteditable m_masi setm_lot_id getsource blot keynamepair m_masi createlot m_m_product_id fieldlot additem fieldlot setselecteditem serno getsource bserno fieldserno settext m_masi getserno getactioncommand confirmpanel a_ok saveselection getactioncommand confirmpanel a_cancel m_changed m_lot getsource mzoom cmd_zoom instance selection button return true if selected private boolean cmd select log config int m warehouse id env get context as int env get ctx m windownoparent m warehouse id string title get text string sql select p name w name from m product p m warehouse w where p m product id and w m warehouse id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 m warehouse id result set rs pstmt execute query if rs next title rs get string 1 rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null p attribute instance pai new p attribute instance this title m warehouse id 0 m m product id m c bpartner id if pai getm attributesetinstance id 1 m m attributesetinstance id pai getm attributesetinstance id m m attributesetinstancename pai getm attributesetinstancename m changed true return true return false cmd_select m_warehouse_id getcontextasint getctx m_windownoparent m_warehouse_id m_product m_warehouse m_product_id m_warehouse_id preparedstatement preparestatement setint m_m_product_id setint m_warehouse_id resultset executequery getstring getstring pattributeinstance pattributeinstance m_warehouse_id m_m_product_id m_c_bpartner_id getm_attributesetinstance_id m_m_attributesetinstance_id getm_attributesetinstance_id m_m_attributesetinstancename getm_attributesetinstancename m_changed instance new edit private void cmd newedit boolean rw cb new edit is selected log config r w rw m masi field lot string set editable rw m masi getm lot id 0 if field lot null field lot set read write rw b lot set read write rw field ser no set read write rw b ser no set read write rw field guarantee date set read write rw for int i 0 i m editors size i c editor editor c editor m editors get i editor set read write rw cmd_newedit cbnewedit isselected m_masi fieldlotstring seteditable m_masi getm_lot_id fieldlot fieldlot setreadwrite blot setreadwrite fieldserno setreadwrite bserno setreadwrite fieldguaranteedate setreadwrite m_editors ceditor ceditor m_editors setreadwrite zoom m lot private void cmd zoom int m lot id 0 key name pair pp key name pair field lot get selected item if pp null m lot id pp get key m query zoom query new m query m lot zoom query add restriction m lot id m query equal m lot id log info zoom query to string set cursor cursor get predefined cursor cursor wait cursor int ad window id 257 lot a window frame new a window if frame init window ad window id zoom query this set visible false this set modal false otherwise blocked this set visible true a env show screen frame swing constants east async window not able to get feedback frame null set cursor cursor get default cursor m_lot cmd_zoom m_lot_id keynamepair keynamepair fieldlot getselecteditem m_lot_id getkey mquery zoomquery mquery m_lot zoomquery addrestriction m_lot_id mquery m_lot_id zoomquery tostring setcursor getpredefinedcursor wait_cursor ad_window_id awindow awindow initwindow ad_window_id zoomquery setvisible setmodal setvisible aenv showscreen swingconstants setcursor getdefaultcursor save selection return true if saved private boolean save selection log info save selection m attribute set as m masi getm attribute set if as null return true m changed false string mandatory if m productwindow as is lot log fine lot field lot string get text string text field lot string get text m masi set lot text if as is lot mandatory text null text length 0 mandatory msg translate env get ctx lot m changed true lot if m productwindow as is ser no log fine ser no field ser no get text string text field ser no get text m masi set ser no text if as is ser no mandatory text null text length 0 mandatory msg translate env get ctx ser no m changed true ser no if m productwindow as is guarantee date log fine guarantee date field guarantee date get value timestamp ts timestamp field guarantee date get value m masi set guarantee date ts if as is guarantee date mandatory ts null mandatory msg translate env get ctx guarantee date m changed true guarantee date save attributes new instance if m changed m masi getm attributesetinstance id 0 m masi save m m attributesetinstance id m masi getm attributesetinstance id m m attributesetinstancename m masi get description save instance attributes m attribute attributes as getm attributes m productwindow for int i 0 i attributes length i if m attribute attributevaluetype list equals attributes i get attribute value type c combo box editor c combo box m editors get i m attribute value value m attribute value editor get selected item log fine attributes i get name value if attributes i is mandatory value null mandatory attributes i get name attributes i setm attribute instance m m attributesetinstance id value else if m attribute attributevaluetype number equals attributes i get attribute value type v number editor v number m editors get i big decimal value big decimal editor get value log fine attributes i get name value if attributes i is mandatory value null mandatory attributes i get name attributes i setm attribute instance m m attributesetinstance id value else v string editor v string m editors get i string value editor get text log fine attributes i get name value if attributes i is mandatory value null value length 0 mandatory attributes i get name attributes i setm attribute instance m m attributesetinstance id value m changed true for all attributes save model if m changed m masi set description m masi save m m attributesetinstance id m masi getm attributesetinstance id m m attributesetinstancename m masi get description if mandatory length 0 a dialog error m windowno this fill mandatory mandatory return false return true saveselection saveselection mattributeset m_masi getmattributeset m_changed m_productwindow islot fieldlotstring gettext fieldlotstring gettext m_masi setlot islotmandatory getctx m_changed m_productwindow isserno serno fieldserno gettext fieldserno gettext m_masi setserno issernomandatory getctx serno m_changed serno m_productwindow isguaranteedate guaranteedate fieldguaranteedate getvalue fieldguaranteedate getvalue m_masi setguaranteedate isguaranteedatemandatory getctx guaranteedate m_changed guaranteedate m_changed m_masi getm_attributesetinstance_id m_masi m_m_attributesetinstance_id m_masi getm_attributesetinstance_id m_m_attributesetinstancename m_masi getdescription mattribute getmattributes m_productwindow mattribute attributevaluetype_list getattributevaluetype ccombobox ccombobox m_editors mattributevalue mattributevalue getselecteditem getname ismandatory getname setmattributeinstance m_m_attributesetinstance_id mattribute attributevaluetype_number getattributevaluetype vnumber vnumber m_editors bigdecimal bigdecimal getvalue getname ismandatory getname setmattributeinstance m_m_attributesetinstance_id vstring vstring m_editors gettext getname ismandatory getname setmattributeinstance m_m_attributesetinstance_id m_changed m_changed m_masi setdescription m_masi m_m_attributesetinstance_id m_masi getm_attributesetinstance_id m_m_attributesetinstancename m_masi getdescription adialog m_windowno fillmandatory get instance id return instance id public int getm attributesetinstance id return m m attributesetinstance id getm_attributesetinstance_id m_m_attributesetinstance_id get instance name return instance name public string getm attributesetinstancename return m m attributesetinstancename getm_attributesetinstancename m_m_attributesetinstancename value changed return true if changed public boolean is changed return m changed ischanged m_changed constructor param adaptee adaptee vpattributedialog mouseadapter vp attribute dialog adaptee this adaptee adaptee vpattributedialog_mouseadapter vpattributedialog mouse listener param e mouse event public void mouse clicked mouse event e system out println mouse clicked e getid e get source get class to string popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseevent mouseclicked mouseevent mouseclicked getsource getclass tostring swingutilities isrightmousebutton popupmenu getsource start tag return skip body public int do start tag jsp writer out page context get out select select get request type select output out return skip body skip_body dostarttag jspwriter pagecontext getout getrequesttype skip_body create select list return select list private select get request type select select new select request servlet p requesttype id get options select setid id request servlet p requesttype id return select getrequesttype requestservlet p_requesttype_id getoptions id_ requestservlet p_requesttype_id get the request type options return array of options private option get options properties ctx jsp env get ctx http servlet request page context get request int ad client id env getad client id ctx if ad client id 0 log log level severe ad client id not found else log config ad client id ad client id array list option list new array list option string sql select r requesttype id name from r requesttype where ad client id and is active y and is self service y order by is default desc name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next option o new option rs get string 1 o add element util maskhtml rs get string 2 list add o rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null return to array and return option options new option list size list to array options log fine options length return options getoptions jspenv getctx httpservletrequest pagecontext getrequest ad_client_id getad_client_id ad_client_id ad_client_id ad_client_id ad_client_id arraylist arraylist r_requesttype_id r_requesttype ad_client_id isactive isselfservice isdefault preparedstatement preparestatement setint ad_client_id resultset executequery getstring addelement getstring toarray standard constructor public x m distributionrunline properties ctx int m distributionrunline id string trx name super ctx m distributionrunline id trx name if m distributionrunline id 0 set line 0 sql select nvl max line 0 10 as default value from m distributionrunline where m distributionrun id m distributionrun id setm distributionlist id 0 setm distributionrunline id 0 setm distributionrun id 0 setm product id 0 set min qty env zero 0 set total qty env zero x_m_distributionrunline m_distributionrunline_id trxname m_distributionrunline_id trxname m_distributionrunline_id setline defaultvalue m_distributionrunline m_distributionrun_id m_distributionrun_id setm_distributionlist_id setm_distributionrunline_id setm_distributionrun_id setm_product_id setminqty settotalqty load constructor public x m distributionrunline properties ctx result set rs string trx name super ctx rs trx name x_m_distributionrunline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m distributionrunline append get id append return sb to string tostring stringbuffer stringbuffer x_m_distributionrunline get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set distribution list distribution lists allow to distribute products to a selected list of partners public void setm distributionlist id int m distributionlist id if m distributionlist id 1 throw new illegal argument exception m distributionlist id is mandatory set value m distributionlist id new integer m distributionlist id setm_distributionlist_id m_distributionlist_id m_distributionlist_id illegalargumentexception m_distributionlist_id set_value m_distributionlist_id m_distributionlist_id get distribution list distribution lists allow to distribute products to a selected list of partners public int getm distributionlist id integer ii integer get value m distributionlist id if ii null return 0 return ii int value getm_distributionlist_id get_value m_distributionlist_id intvalue set distribution run line distribution run lines define distribution list the product and quantiries public void setm distributionrunline id int m distributionrunline id if m distributionrunline id 1 throw new illegal argument exception m distributionrunline id is mandatory set valuenocheck m distributionrunline id new integer m distributionrunline id setm_distributionrunline_id m_distributionrunline_id m_distributionrunline_id illegalargumentexception m_distributionrunline_id set_valuenocheck m_distributionrunline_id m_distributionrunline_id get distribution run line distribution run lines define distribution list the product and quantiries public int getm distributionrunline id integer ii integer get value m distributionrunline id if ii null return 0 return ii int value getm_distributionrunline_id get_value m_distributionrunline_id intvalue set distribution run distribution run create orders to distribute products to a selected list of partners public void setm distributionrun id int m distributionrun id if m distributionrun id 1 throw new illegal argument exception m distributionrun id is mandatory set valuenocheck m distributionrun id new integer m distributionrun id setm_distributionrun_id m_distributionrun_id m_distributionrun_id illegalargumentexception m_distributionrun_id set_valuenocheck m_distributionrun_id m_distributionrun_id get distribution run distribution run create orders to distribute products to a selected list of partners public int getm distributionrun id integer ii integer get value m distributionrun id if ii null return 0 return ii int value getm_distributionrun_id get_value m_distributionrun_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm distributionrun id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_distributionrun_id set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set minimum quantity minimum quantity for the business partner public void set min qty big decimal min qty if min qty null throw new illegal argument exception min qty is mandatory set value min qty min qty setminqty bigdecimal minqty minqty illegalargumentexception minqty set_value minqty minqty get minimum quantity minimum quantity for the business partner public big decimal get min qty big decimal bd big decimal get value min qty if bd null return env zero return bd bigdecimal getminqty bigdecimal bigdecimal get_value minqty set total quantity total quantity public void set total qty big decimal total qty if total qty null throw new illegal argument exception total qty is mandatory set value total qty total qty settotalqty bigdecimal totalqty totalqty illegalargumentexception totalqty set_value totalqty totalqty get total quantity total quantity public big decimal get total qty big decimal bd big decimal get value total qty if bd null return env zero return bd bigdecimal gettotalqty bigdecimal bigdecimal get_value totalqty standard constructor public x r requesttype properties ctx int r requesttype id string trx name super ctx r requesttype id trx name if r requesttype id 0 set confidential type null c set due date tolerance 0 7 set is auto change request false set is confidential info false n set is default false n set ise mail when due false set ise mail when overdue false set is self service true y set name null setr requesttype id 0 setr statuscategory id 0 x_r_requesttype r_requesttype_id trxname r_requesttype_id trxname r_requesttype_id setconfidentialtype setduedatetolerance setisautochangerequest setisconfidentialinfo setisdefault setisemailwhendue setisemailwhenoverdue setisselfservice setname setr_requesttype_id setr_statuscategory_id load constructor public x r requesttype properties ctx result set rs string trx name super ctx rs trx name x_r_requesttype resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requesttype append get id append return sb to string tostring stringbuffer stringbuffer x_r_requesttype get_id tostring set auto due date days automatic due date days public void set auto due date days int auto due date days set value auto due date days new integer auto due date days setautoduedatedays autoduedatedays set_value autoduedatedays autoduedatedays get auto due date days automatic due date days public int get auto due date days integer ii integer get value auto due date days if ii null return 0 return ii int value getautoduedatedays get_value autoduedatedays intvalue public static final string confidentialtype privateinformation p set confidentiality type of confidentiality public void set confidential type string confidential type if confidential type null throw new illegal argument exception confidential type is mandatory if confidential type equals a confidential type equals c confidential type equals i confidential type equals p else throw new illegal argument exception confidential type invalid value confidential type reference id 340 a c i p if confidential type length 1 log warning length 1 truncated confidential type confidential type substring 0 0 set value confidential type confidential type confidentialtype_privateinformation setconfidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype confidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype reference_id confidentialtype confidentialtype confidentialtype set_value confidentialtype confidentialtype get confidentiality type of confidentiality public string get confidential type return string get value confidential type getconfidentialtype get_value confidentialtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set due date tolerance tolerance in days between the date next action and the date the request is regarded as overdue public void set due date tolerance int due date tolerance set value due date tolerance new integer due date tolerance setduedatetolerance duedatetolerance set_value duedatetolerance duedatetolerance get due date tolerance tolerance in days between the date next action and the date the request is regarded as overdue public int get due date tolerance integer ii integer get value due date tolerance if ii null return 0 return ii int value getduedatetolerance get_value duedatetolerance intvalue set create change request automatically create bom engineering change request public void set is auto change request boolean is auto change request set value is auto change request new boolean is auto change request setisautochangerequest isautochangerequest set_value isautochangerequest isautochangerequest get create change request automatically create bom engineering change request public boolean is auto change request object oo get value is auto change request if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isautochangerequest get_value isautochangerequest booleanvalue set confidential info can enter confidential information public void set is confidential info boolean is confidential info set value is confidential info new boolean is confidential info setisconfidentialinfo isconfidentialinfo set_value isconfidentialinfo isconfidentialinfo get confidential info can enter confidential information public boolean is confidential info object oo get value is confidential info if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isconfidentialinfo get_value isconfidentialinfo booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set e mail when due send e mail when request becomes due public void set ise mail when due boolean ise mail when due set value ise mail when due new boolean ise mail when due email email setisemailwhendue isemailwhendue set_value isemailwhendue isemailwhendue get e mail when due send e mail when request becomes due public boolean ise mail when due object oo get value ise mail when due if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email isemailwhendue get_value isemailwhendue booleanvalue set e mail when overdue send e mail when request becomes overdue public void set ise mail when overdue boolean ise mail when overdue set value ise mail when overdue new boolean ise mail when overdue email email setisemailwhenoverdue isemailwhenoverdue set_value isemailwhenoverdue isemailwhenoverdue get e mail when overdue send e mail when request becomes overdue public boolean ise mail when overdue object oo get value ise mail when overdue if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email isemailwhenoverdue get_value isemailwhenoverdue booleanvalue set invoiced is this invoiced public void set is invoiced boolean is invoiced set value is invoiced new boolean is invoiced setisinvoiced isinvoiced set_value isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 1 throw new illegal argument exception r requesttype id is mandatory set valuenocheck r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id illegalargumentexception r_requesttype_id set_valuenocheck r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue set status category request status category public void setr statuscategory id int r statuscategory id if r statuscategory id 1 throw new illegal argument exception r statuscategory id is mandatory set value r statuscategory id new integer r statuscategory id setr_statuscategory_id r_statuscategory_id r_statuscategory_id illegalargumentexception r_statuscategory_id set_value r_statuscategory_id r_statuscategory_id get status category request status category public int getr statuscategory id integer ii integer get value r statuscategory id if ii null return 0 return ii int value getr_statuscategory_id get_value r_statuscategory_id intvalue get price list cached param ctx context param m pricelist id id return price list public static m price list get properties ctx int m pricelist id string trx name integer key new integer m pricelist id m price list ret value m price list s cache get key if ret value null ret value new m price list ctx m pricelist id trx name s cache put key ret value return ret value m_pricelist_id pricelist mpricelist m_pricelist_id trxname m_pricelist_id mpricelist retvalue mpricelist s_cache retvalue retvalue mpricelist m_pricelist_id trxname s_cache retvalue retvalue get default price list for client cached param ctx context param isso price list so or po return price list or null public static m price list get default properties ctx boolean isso price list int ad client id env getad client id ctx m price list ret value null search for it in cache iterator it s cache values iterator while it has next ret value m price list it next if ret value is default ret value getad client id ad client id return ret value get from db ret value null string sql select from m pricelist where ad client id and is default y and isso price list y order by m pricelist id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next ret value new m price list ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return value if ret value null integer key new integer ret value getm pricelist id s cache put key ret value return ret value issopricelist pricelist mpricelist getdefault issopricelist ad_client_id getad_client_id mpricelist retvalue s_cache hasnext retvalue mpricelist retvalue isdefault retvalue getad_client_id ad_client_id retvalue retvalue m_pricelist ad_client_id isdefault issopricelist m_pricelist_id preparedstatement preparestatement setint ad_client_id resultset executequery retvalue mpricelist s_log retvalue retvalue getm_pricelist_id s_cache retvalue retvalue get standard currency precision param ctx context param m pricelist id price list return precision public static int get standard precision properties ctx int m pricelist id m price list pl m price list get ctx m pricelist id null return pl get standard precision m_pricelist_id getstandardprecision m_pricelist_id mpricelist mpricelist m_pricelist_id getstandardprecision get price precision param ctx context param m pricelist id price list return precision public static int get price precision properties ctx int m pricelist id m price list pl m price list get ctx m pricelist id null return pl get price precision int m_pricelist_id getpriceprecision m_pricelist_id mpricelist mpricelist m_pricelist_id getpriceprecisionint standard constructor param ctx context param m pricelist id id public m price list properties ctx int m pricelist id string trx name super ctx m pricelist id trx name if m pricelist id 0 set enforce price limit false set is default false set isso price list false set is tax included false set price precision 2 2 set name null setc currency id 0 m_pricelist_id mpricelist m_pricelist_id trxname m_pricelist_id trxname m_pricelist_id setenforcepricelimit setisdefault setissopricelist setistaxincluded setpriceprecision setname setc_currency_id load cosntructor param ctx context param rs result set public m price list properties ctx result set rs string trx name super ctx rs trx name mpricelist resultset trxname trxname get price list version param valid date where plv must be valid or today if null return plv public m price list version get price list version timestamp valid if valid null valid new timestamp system current time millis assume there is no later if m plv null m plv get valid from before valid return m plv string sql select from m pricelist version where m pricelist id and trunc valid from and is active y order by valid from desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm pricelist id pstmt set timestamp 2 valid result set rs pstmt execute query if rs next m plv new m price list version get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if m plv null log warning none found m pricelist id getm pricelist id valid sql else log fine m plv to string return m plv mpricelistversion getpricelistversion currenttimemillis m_plv m_plv getvalidfrom m_plv m_pricelist_version m_pricelist_id validfrom isactive validfrom preparedstatement preparestatement get_trxname setint getm_pricelist_id settimestamp resultset executequery m_plv mpricelistversion getctx get_trxname m_plv m_pricelist_id getm_pricelist_id m_plv tostring m_plv get standard currency precision return precision public int get standard precision if m precision null m currency c m currency get get ctx getc currency id m precision new integer c get std precision return m precision int value getstandardprecision m_precision mcurrency mcurrency getctx getc_currency_id m_precision getstdprecision m_precision intvalue set price precision param price precision precision public void set price precision int price precision set price precision new big decimal price precision priceprecision setpriceprecision priceprecision setpriceprecision bigdecimal priceprecision get price precision as int return precision 1 for none public int get price precision int big decimal bd get price precision if bd null return 1 return bd int value getpriceprecisionint bigdecimal getpriceprecision intvalue basic constructor you need to set the attributes using the set methods public h1 use the set methods to set the values of the attributes param element set the value of lt h1 gt value lt h1 gt public h1 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h1 gt value lt h1 gt public h1 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h1 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h1 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h1 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h1 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h1 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c subscriptiontype properties ctx int c subscriptiontype id string trx name super ctx c subscriptiontype id trx name if c subscriptiontype id 0 setc subscriptiontype id 0 set frequency 0 set frequency type null set name null x_c_subscriptiontype c_subscriptiontype_id trxname c_subscriptiontype_id trxname c_subscriptiontype_id setc_subscriptiontype_id setfrequency setfrequencytype setname load constructor public x c subscriptiontype properties ctx result set rs string trx name super ctx rs trx name x_c_subscriptiontype resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c subscriptiontype append get id append return sb to string tostring stringbuffer stringbuffer x_c_subscriptiontype get_id tostring set subscription type type of subscription public void setc subscriptiontype id int c subscriptiontype id if c subscriptiontype id 1 throw new illegal argument exception c subscriptiontype id is mandatory set valuenocheck c subscriptiontype id new integer c subscriptiontype id setc_subscriptiontype_id c_subscriptiontype_id c_subscriptiontype_id illegalargumentexception c_subscriptiontype_id set_valuenocheck c_subscriptiontype_id c_subscriptiontype_id get subscription type type of subscription public int getc subscriptiontype id integer ii integer get value c subscriptiontype id if ii null return 0 return ii int value getc_subscriptiontype_id get_value c_subscriptiontype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname constructor read only public result table cell editor resulttablecelleditor constructor public result table cell editor r column rc m rc rc resulttablecelleditor rcolumn m_rc return editor public component get table cell editor component j table table object value boolean is selected int row int col if m rc null return null return null gettablecelleditorcomponent jtable isselected m_rc get value public object get cell editor value if m rc null return null return null getcelleditorvalue m_rc is cell editable public boolean is cell editable event object an event if m rc null return false return m rc is read only iscelleditable eventobject anevent m_rc m_rc isreadonly should cell be selected public boolean should select cell event object an event if m rc null return false return m rc is read only shouldselectcell eventobject anevent m_rc m_rc isreadonly compiere service param processor processor instance param server class server class public compiere service po processor class server class super m processor processor m serverclass server class serverclass compiereservice serverclass m_processor m_serverclass serverclass get compier server return compiere server public compiere server get compier server get state return m server compiereserver getcompierserver getstate m_server get check state return state public string get state if is running if m server null m server is alive terminate return super get state getstate isrunning m_server m_server isalive getstate start not started running return true if set to running public boolean start if super start return false boolean ok false try m server compiere server m serverclass new instance m server set processor m processor m server start ok true catch exception e log log level severe start e ok false if ok return abort log info start ok get state return ok m_server compiereserver m_serverclass newinstance m_server setprocessor m_processor m_server getstate resume suspended running return true if set to sunning public boolean resume if super resume return false boolean ok false try m server compiere server m serverclass new instance m server set processor m processor m server start ok true catch exception e log log level severe resume e ok false if ok return abort log info resume ok get state return ok m_server compiereserver m_serverclass newinstance m_server setprocessor m_processor m_server getstate complete running completed return true if set to completed public boolean complete if super complete return false boolean ok false if m server null m server is alive try m server interrupt m server join ok true catch exception e return abort log info complete ok return ok m_server m_server isalive m_server m_server suspend running suspended return true if suspended public boolean suspend if super suspend return false boolean ok false if m server null m server is alive try m server interrupt m server join ok true catch exception e return abort log info suspend ok return ok m_server m_server isalive m_server m_server abort open aborted return true if set to aborted public boolean abort raises cannot stop not running if super abort if m server null m server is alive try m server interrupt catch exception e log info abort done return true return false cannotstop notrunning m_server m_server isalive m_server terminate system error open terminated return true if set to terminated public boolean terminate if super terminate if m server null m server is alive try m server interrupt catch exception e log info terminate done return true return false m_server m_server isalive m_server string representation return info public string to string string buffer sb new string buffer compiere service sb append get state info append append m server sb append return sb to string tostring stringbuffer stringbuffer compiereservice getstateinfo m_server tostring standard constructor param ctx context param ad window id public m window properties ctx int ad window id string trx name super ctx ad window id trx name if ad window id 0 set window type windowtype maintain m set entity type entitytype usermaintained u set is beta functionality false set is default false set isso trx true y ad_window_id m_window ad_window_id trxname ad_window_id trxname ad_window_id setwindowtype windowtype_maintain setentitytype entitytype_usermaintained setisbetafunctionality setisdefault setissotrx koad constructor param ctx context param rs result set public m window properties ctx result set rs string trx name super ctx rs trx name m_window resultset trxname trxname set window size param size size public void set window size dimension size if size null set win width size width set win height size height setwindowsize setwinwidth setwinheight get fields param reload reload data return array of lines public m tab get tabs boolean reload string trx name if m tabs null reload return m tabs string sql select from ad tab where ad window id order by seq no array list m tab list new array list m tab prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 getad window id result set rs pstmt execute query while rs next list add new m tab get ctx rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m tabs new m tab list size list to array m tabs return m tabs m_tab gettabs trxname m_tabs m_tabs ad_tab ad_window_id seqno arraylist m_tab arraylist m_tab preparedstatement preparestatement trxname setint getad_window_id resultset executequery m_tab getctx trxname m_tabs m_tab toarray m_tabs m_tabs after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record add to all automatic roles m role roles m role get of get ctx is manual n for int i 0 i roles length i m window access wa new m window access this roles i getad role id wa save menu workflow else if is valuechanged is active is valuechanged name is valuechanged description is valuechanged help m menu menues m menu get get ctx ad window id getad window id for int i 0 i menues length i menues i set name get name menues i set description get description menues i set is active is active menues i save x ad wf node nodes getwf nodes get ctx ad window id getad window id for int i 0 i nodes length i boolean changed false if nodes i is active is active nodes i set is active is active changed true if nodes i is centrally maintained nodes i set name get name nodes i set description get description nodes i set help get help changed true if changed nodes i save return success newrecord aftersave newrecord newrecord mrole mrole getof getctx ismanual mwindowaccess mwindowaccess getad_role_id is_valuechanged isactive is_valuechanged is_valuechanged is_valuechanged mmenu mmenu getctx ad_window_id getad_window_id setname getname setdescription getdescription setisactive isactive x_ad_wf_node getwfnodes getctx ad_window_id getad_window_id isactive isactive setisactive isactive iscentrallymaintained setname getname setdescription getdescription sethelp gethelp get workflow nodes with where clause is here as mwf node is in base param ctx context param where clause where clause w o the actual where return nodes public static x ad wf node getwf nodes properties ctx string where clause string sql select from ad wf node if where clause null where clause length 0 sql where where clause array list x ad wf node list new array list x ad wf node prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new x ad wf node ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null x ad wf node ret value new x ad wf node list size list to array ret value return ret value mwfnode whereclause x_ad_wf_node getwfnodes whereclause ad_wf_node whereclause whereclause whereclause arraylist x_ad_wf_node arraylist x_ad_wf_node preparedstatement preparestatement resultset executequery x_ad_wf_node s_log x_ad_wf_node retvalue x_ad_wf_node toarray retvalue retvalue create calculator param frame parent param title title param display type date or datetime or time param format display format param number initial amount public calculator frame frame string title int display type decimal format format big decimal number super frame title true set default close operation j dialog dispose on close get window no for currency m windowno env get window no frame m displaytype display type if display type is numeric m displaytype m displaytype display type number m format format if m format null m format display type get number format m displaytype m number number if m number null m number new big decimal 0 0 try jb init finish setup catch exception ex log log level severe calculator ex displaytype displaytype decimalformat bigdecimal setdefaultcloseoperation jdialog dispose_on_close windowno m_windowno getwindowno m_displaytype displaytype displaytype isnumeric m_displaytype m_displaytype displaytype m_format m_format m_format displaytype getnumberformat m_displaytype m_number m_number m_number bigdecimal jbinit finishsetup abbreviated constructor param frame parent public calculator frame frame this frame msg get msg env get ctx calculator display type number null null getmsg getctx displaytype abbreviated constructor param frame parent param number initial amount public calculator frame frame big decimal number this frame msg get msg env get ctx calculator display type number null number bigdecimal getmsg getctx displaytype static init throws exception void jb init throws exception main panel set layout main layout display panel set layout display layout key panel set layout key layout main layout set hgap 2 main layout set vgap 2 main panel set border border factory create lowered bevel border main panel add key listener this display set background color white display set font new java awt font sans serif 0 14 display set border border factory create lowered bevel border display set text 0 display set horizontal alignment swing constants right b7 set text 7 b8 set text 8 b9 set text 9 b4 set text 4 b5 set text 5 b6 set text 6 b1 set text 1 b2 set text 2 b3 set text 3 key layout set columns 5 key layout set hgap 3 key layout set rows 4 key layout set vgap 3 b cur set foreground color yellow b cur set tool tip text msg get msg env get ctx currency conversion b cur set text bc set foreground color red bc set text c b div set foreground color blue b div set text bm set foreground color blue bm set text b min set foreground color blue b min set text b proc set foreground color blue b proc set text bac set foreground color red bac set text ac b result set foreground color green b result set text b dec set text b0 set text 0 b plus set foreground color blue b plus set text bord panel set layout bord layout cur label set horizontal alignment swing constants center cur label set horizontal text position swing constants center cur label set text currency panel set layout currency layout bord layout set hgap 2 bord layout set vgap 2 display layout set hgap 2 display layout set vgap 2 currency layout set hgap 3 currency layout set vgap 2 display panel set background color white get content pane add main panel main panel add display panel border layout north display panel add display border layout center main panel add bord panel border layout center bord panel add currency panel border layout north currency panel add cur from null currency panel add cur label null currency panel add cur to null bord panel add key panel border layout center key panel add bac null key panel add b7 null key panel add b8 null key panel add b9 null key panel add bm null key panel add bc null key panel add b4 null key panel add b5 null key panel add b6 null key panel add b div null key panel add b proc null key panel add b1 null key panel add b2 null key panel add b3 null key panel add b min null key panel add b cur null key panel add b0 null key panel add b dec null key panel add b result null key panel add b plus null jbinit mainpanel setlayout mainlayout displaypanel setlayout displaylayout keypanel setlayout keylayout mainlayout sethgap mainlayout setvgap mainpanel setborder borderfactory createloweredbevelborder mainpanel addkeylistener setbackground setfont sansserif setborder borderfactory createloweredbevelborder settext sethorizontalalignment swingconstants settext settext settext settext settext settext settext settext settext keylayout setcolumns keylayout sethgap keylayout setrows keylayout setvgap bcur setforeground bcur settooltiptext getmsg getctx currencyconversion bcur settext setforeground settext bdiv setforeground bdiv settext setforeground settext bmin setforeground bmin settext bproc setforeground bproc settext setforeground settext bresult setforeground bresult settext bdec settext settext bplus setforeground bplus settext bordpanel setlayout bordlayout curlabel sethorizontalalignment swingconstants curlabel sethorizontaltextposition swingconstants curlabel settext currencypanel setlayout currencylayout bordlayout sethgap bordlayout setvgap displaylayout sethgap displaylayout setvgap currencylayout sethgap currencylayout setvgap displaypanel setbackground getcontentpane mainpanel mainpanel displaypanel borderlayout displaypanel borderlayout mainpanel bordpanel borderlayout bordpanel currencypanel borderlayout currencypanel curfrom currencypanel curlabel currencypanel curto bordpanel keypanel borderlayout keypanel keypanel keypanel keypanel keypanel keypanel keypanel keypanel keypanel keypanel bdiv keypanel bproc keypanel keypanel keypanel keypanel bmin keypanel bcur keypanel keypanel bdec keypanel bresult keypanel bplus finish setup private void finish setup insets in new insets 2 2 2 2 for all buttons component comp key panel get components for int i 0 i comp length i if comp i instanceof j button j button b j button comp i b set margin in b add action listener this b add key listener this currency toggle currency format setting m decimal m format get decimal format symbols get decimal separator display start number m display m format format m number display set text m display finishsetup keypanel getcomponents jbutton jbutton jbutton setmargin addactionlistener addkeylistener togglecurrency m_decimal m_format getdecimalformatsymbols getdecimalseparator m_display m_format m_number settext m_display action listener param e event public void action performed action event e handle button input if e get source instanceof j button string cmd e get action command if cmd null cmd length 0 handle input cmd char at 0 convert amount else if e get source cur to key name pair p key name pair cur from get selected item int cur fromid p get key p key name pair cur to get selected item int cur toid p get key convert int ad client id env getad client id env get ctx int ad org id env getad org id env get ctx m number m conversion rate convert env get ctx evaluate cur fromid cur toid ad client id ad org id m display m format format m number display set text m display cur from set selected item p actionperformed actionevent getsource jbutton getactioncommand handleinput charat getsource curto keynamepair keynamepair curfrom getselecteditem curfromid getkey keynamepair curto getselecteditem curtoid getkey ad_client_id getad_client_id getctx ad_org_id getad_org_id getctx m_number mconversionrate getctx curfromid curtoid ad_client_id ad_org_id m_display m_format m_number settext m_display curfrom setselecteditem handle input param c input character public void handle input char c system out println input c switch c number case 0 case 1 case 2 case 3 case 4 case 5 case 6 case 7 case 8 case 9 m display c break decimal case case m display m decimal break commands case case case case case if m display length 1 char last m display char at m display length 1 if operands index of last 1 m display c else m display m display substring 0 m display length 1 c m display m format format evaluate if c m display c break clear last char case c if m display length 0 m display m display substring 0 m display length 1 break clear all case a m display break currency convert toggle case m display m format format evaluate toggle currency break fini case m display m format format evaluate m abort false dispose break error default a dialog beep break switch if m display equals m display 0 eliminate leading zeroes if m display length 1 m display starts with 0 if m display char at 1 m display char at 1 m display m display substring 1 display it display set text m display handleinput m_display m_display m_decimal m_display m_display charat m_display indexof m_display m_display m_display m_display m_display m_format m_display m_display m_display m_display m_display m_display m_display m_format togglecurrency m_display m_format m_abort adialog m_display m_display m_display m_display startswith m_display charat m_display charat m_display m_display settext m_display evaluate evaluate info in display and set number return result private big decimal evaluate nothing or zero if m display null m display equals m display equals 0 m number new big decimal 0 0 return m number string tokenizer st new string tokenizer m display operands true first token string token st next token do we have a negative number if token equals if st has more tokens token st next token else m number new big decimal 0 0 return m number first number number first number try first number m format parse token catch parse exception pe1 log log level severe calculator evaluate token token pe1 m number new big decimal 0 0 return m number big decimal first no new big decimal first number to string intermediate result m number first no only one number if st has more tokens return m number now we should get an operand token st next token if operands index of token 1 log log level severe calculator evaluate unknown token token return m number get operand char op token char at 0 no second number if st has more tokens return m number token st next token number second number try second number m format parse token catch parse exception pe2 log log level severe calculator evaluate token token pe2 m number new big decimal 0 0 return m number big decimal second no new big decimal second number to string check the next operant char op2 0 if st has more tokens token st next token if operands index of token 1 log log level severe calculator evaluate unknown token token return m number get operand op2 token char at 0 percent operation if op2 second no first no multiply second no divide new big decimal 100 0 m format get maximum fraction digits big decimal round half up switch op case m number first no divide second no m format get maximum fraction digits big decimal round half up break case m number first no multiply second no break case m number first no subtract second no break case m number first no add second no break default break return m number set scale m format get maximum fraction digits big decimal round half up bigdecimal m_display m_display m_display m_number bigdecimal m_number stringtokenizer stringtokenizer m_display nexttoken hasmoretokens nexttoken m_number bigdecimal m_number firstnumber firstnumber m_format parseexception m_number bigdecimal m_number bigdecimal firstno bigdecimal firstnumber tostring m_number firstno hasmoretokens m_number nexttoken indexof m_number charat hasmoretokens m_number nexttoken secondnumber secondnumber m_format parseexception m_number bigdecimal m_number bigdecimal secondno bigdecimal secondnumber tostring hasmoretokens nexttoken indexof m_number charat secondno firstno secondno bigdecimal m_format getmaximumfractiondigits bigdecimal round_half_up m_number firstno secondno m_format getmaximumfractiondigits bigdecimal round_half_up m_number firstno secondno m_number firstno secondno m_number firstno secondno m_number setscale m_format getmaximumfractiondigits bigdecimal round_half_up display or don t display currency private void toggle currency if currency panel is visible currency panel set visible false else if m currencyok load currency currency panel set visible true pack togglecurrency currencypanel isvisible currencypanel setvisible m_currencyok loadcurrency currencypanel setvisible load currency private void load currency get default int c currency id env get context as int env get ctx m windowno c currency id if c currency id 0 c currency id env get context as int env get ctx c currency id string sql select c currency id iso code from c currency where is active y order by 2 key name pair default value null try statement stmt db create statement result set rs stmt execute query sql while rs next int id rs get int c currency id string s rs get string iso code key name pair p new key name pair id s cur from add item p cur to add item p default if id c currency id default value p rs close stmt close catch sql exception e log log level severe calculator load currency e set defaults if default value null cur from set selected item default value cur to set selected item default value set listener cur to add action listener this m currencyok true loadcurrency c_currency_id getcontextasint getctx m_windowno c_currency_id c_currency_id c_currency_id getcontextasint getctx c_currency_id c_currency_id iso_code c_currency isactive keynamepair defaultvalue createstatement resultset executequery getint c_currency_id getstring iso_code keynamepair keynamepair curfrom additem curto additem c_currency_id defaultvalue sqlexception loadcurrency defaultvalue curfrom setselecteditem defaultvalue curto setselecteditem defaultvalue curto addactionlistener m_currencyok return number return result public big decimal get number if m abort return null return m number bigdecimal getnumber m_abort m_number key pressed listener param e event public void key pressed key event e sequence pressed typed no key code released char input e get key char int code e get key code e consume does not work on j text field if code key event vk delete input a else if code key event vk back space input c else if code key event vk enter input abort else if code key event vk cancel code key event vk escape m abort true dispose return handle input input keypressed keypressed keyevent keycode getkeychar getkeycode jtextfield keyevent vk_delete keyevent vk_back_space keyevent vk_enter keyevent vk_cancel keyevent vk_escape m_abort handleinput key typed listener nop param e event keytyped public void key typed key event e key released listener nop param e event keytyped keyevent keyreleased basic constructor you need to set the attributes using the set methods public pre use the set methods to set the values of the attributes param element set the value of lt pre gt value lt pre gt public pre element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt pre gt value lt pre gt param width set the value of width public pre string value int width set width width add element value setwidth addelement use the set methods to set the values of the attributes param element set the value of lt pre gt value lt pre gt param width set the value of width public pre element element int width set width width add element element setwidth addelement use the set methods to set the values of the attributes param element set the value of lt pre gt value lt pre gt param width set the value of width public pre element element string width set width width add element element setwidth addelement use the set methods to set the values of the attributes param value set the value of lt pre gt value lt pre gt public pre string value add element value addelement sets the width attribute param width the width attribute public pre set width int width add attribute width integer to string width return this setwidth addattribute tostring sets the width attribute param width the width attribute public pre set width string width add attribute width width return this setwidth addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public pre add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public pre add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public pre add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public pre add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public pre remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute load system environment variables into system properies p prints error messages on system err param prefix string to prefix variable names return true if success public static boolean load string prefix properties prop get env prefix if prop null return false load object pp prop key set to array for int i 0 i pp length i string key pp i to string string value prop get property key system set property key value c log mgt print properties system get properties system with environment false return true getenv keyset toarray tostring getproperty setproperty clogmgt printproperties getproperties ger environment variables param prefix string to prefix variable names return properties with prefixed system environment variables or null if not successful public static properties get env string prefix string cmd cmd c set windows if system get property os name starts with win cmd set unix linux string result exec command cmd if result null result length 0 return null if prefix null prefix return parse env result prefix getenv getproperty startswith execcommand parseenv execute command and return output private static string exec command string command process cmd try cmd runtime get runtime exec command catch exception e system err println error executing command command e to string return null if debug system out println command executed command string buffer buf out new string buffer string buffer buf err new string buffer try input stream in cmd get input stream input stream err cmd get error stream int c while c in read 1 buf out append char c in close while c err read 1 buf err append char c err close catch exception e system err println error reading output e to string return null if debug system out println command result buf out to string system out println command error buf err to string return buf out to string execcommand getruntime tostring stringbuffer bufout stringbuffer stringbuffer buferr stringbuffer inputstream getinputstream inputstream geterrorstream bufout buferr tostring bufout tostring buferr tostring bufout tostring parse env and return it in properties private static properties parse env string input string prefix properties prop new properties string separator system get property line separator n string tokenizer st new string tokenizer input separator while st has more tokens string s st next token system out println s int pos s index of first if pos 0 prop set property prefix s substring 0 pos s substring pos 1 if debug system out println loaded prop size properties return prop parseenv getproperty stringtokenizer stringtokenizer hasmoretokens nexttoken indexof setproperty create document line param po line persistent object param doc header public doc line po po doc doc if po null throw new illegal argument exception po is null p po po m doc doc document consistency if p po getad org id 0 p po setad org id m doc getad org id docline illegalargumentexception p_po m_doc p_po getad_org_id p_po setad_org_id m_doc getad_org_id get currency return c currency id public int getc currency id if m c currency id 1 int index p po get columnindex c currency id if index 1 integer ii integer p po get value index if ii null m c currency id ii int value if m c currency id 0 m c currency id m doc getc currency id return m c currency id c_currency_id getc_currency_id m_c_currency_id p_po get_columnindex c_currency_id p_po get_value m_c_currency_id intvalue m_c_currency_id m_c_currency_id m_doc getc_currency_id m_c_currency_id get conversion type return c conversiontype id public int getc conversiontype id if m c conversiontype id 1 int index p po get columnindex c conversiontype id if index 1 integer ii integer p po get value index if ii null m c conversiontype id ii int value if m c conversiontype id 0 m c conversiontype id m doc getc conversiontype id return m c conversiontype id c_conversiontype_id getc_conversiontype_id m_c_conversiontype_id p_po get_columnindex c_conversiontype_id p_po get_value m_c_conversiontype_id intvalue m_c_conversiontype_id m_c_conversiontype_id m_doc getc_conversiontype_id m_c_conversiontype_id set c conversiontype id param c conversiontype id id protected void setc conversiontype id int c conversiontype id m c conversiontype id c conversiontype id c_conversiontype_id c_conversiontype_id setc_conversiontype_id c_conversiontype_id m_c_conversiontype_id c_conversiontype_id set amount dr param source amt source amt public void set amount big decimal source amt m amtsourcedr source amt null env zero source amt m amtsourcecr env zero sourceamt setamount bigdecimal sourceamt m_amtsourcedr sourceamt sourceamt m_amtsourcecr set amounts param amt source dr source amount dr param amt source cr source amount cr public void set amount big decimal amt source dr big decimal amt source cr m amtsourcedr amt source dr null env zero amt source dr m amtsourcecr amt source cr null env zero amt source cr amtsourcedr amtsourcecr setamount bigdecimal amtsourcedr bigdecimal amtsourcecr m_amtsourcedr amtsourcedr amtsourcedr m_amtsourcecr amtsourcecr amtsourcecr set converted amounts param c acctschema id acct schema param amt acct dr acct amount dr param amt acct cr acct amount cr public void set converted amt int c acctschema id big decimal amt acct dr big decimal amt acct cr m c acctschema id c acctschema id m amtacctdr amt acct dr m amtacctcr amt acct cr c_acctschema_id amtacctdr amtacctcr setconvertedamt c_acctschema_id bigdecimal amtacctdr bigdecimal amtacctcr m_c_acctschema_id c_acctschema_id m_amtacctdr amtacctdr m_amtacctcr amtacctcr line net amount or dr cr return balance public big decimal get amt source return m amtsourcedr subtract m amtsourcecr bigdecimal getamtsource m_amtsourcedr m_amtsourcecr get journal line source dr amount return dr source amount public big decimal get amt source dr return m amtsourcedr bigdecimal getamtsourcedr m_amtsourcedr get journal line source cr amount return cr source amount public big decimal get amt source cr return m amtsourcecr bigdecimal getamtsourcecr m_amtsourcecr line journal accounted dr amount return dr accounted amount public big decimal get amt acct dr return m amtacctdr bigdecimal getamtacctdr m_amtacctdr line journal accounted cr amount return cr accounted amount public big decimal get amt acct cr return m amtacctcr bigdecimal getamtacctcr m_amtacctcr charge amount return charge amount public big decimal get charge amt int index p po get columnindex charge amt if index 1 big decimal bd big decimal p po get value index if bd null return bd return env zero bigdecimal getchargeamt p_po get_columnindex chargeamt bigdecimal bigdecimal p_po get_value set product amounts param line net amt line net amt param price list price list param qty qty for discount calc public void set amount big decimal line net amt big decimal price list big decimal qty m linenetamt line net amt null env zero line net amt if price list null qty null m listamt price list multiply qty if m listamt equals env zero m listamt m linenetamt m discountamt m listamt subtract m linenetamt set amount m listamt m discountamt log trace this log l6 database docline invoice set amount line net m linenetamt list m listamt discount m discountamt amount get amount linenetamt pricelist setamount bigdecimal linenetamt bigdecimal pricelist bigdecimal m_linenetamt linenetamt linenetamt pricelist m_listamt pricelist m_listamt m_listamt m_linenetamt m_discountamt m_listamt m_linenetamt setamount m_listamt m_discountamt l6_database docline_invoice setamount linenet m_linenetamt m_listamt m_discountamt getamount line discount return discount amount public big decimal get discount return m discountamt bigdecimal getdiscount m_discountamt line list amount return list amount public big decimal get list amount return m listamt bigdecimal getlistamount m_listamt set line net amt difference param diff difference to be subtracted public void set line net amt difference big decimal diff string msg diff diff line net amt m linenetamt m linenetamt m linenetamt subtract diff m discountamt m listamt subtract m linenetamt set amount m listamt m discountamt msg m linenetamt log fine msg setlinenetamtdifference bigdecimal linenetamt m_linenetamt m_linenetamt m_linenetamt m_discountamt m_listamt m_linenetamt setamount m_listamt m_discountamt m_linenetamt set accounting date param date acct acct date public void set date acct timestamp date acct m dateacct date acct dateacct setdateacct dateacct m_dateacct dateacct get accounting date return accounting date public timestamp get date acct if m dateacct null return m dateacct int index p po get columnindex date acct if index 1 m dateacct timestamp p po get value index if m dateacct null return m dateacct m dateacct m doc get date acct return m dateacct getdateacct m_dateacct m_dateacct p_po get_columnindex dateacct m_dateacct p_po get_value m_dateacct m_dateacct m_dateacct m_doc getdateacct m_dateacct set document date param date doc doc date public void set date doc timestamp date doc m datedoc date doc datedoc setdatedoc datedoc m_datedoc datedoc get document date return document date public timestamp get date doc if m datedoc null return m datedoc int index p po get columnindex date doc if index 1 m datedoc timestamp p po get value index if m datedoc null return m datedoc m datedoc m doc get date doc return m datedoc getdatedoc m_datedoc m_datedoc p_po get_columnindex datedoc m_datedoc p_po get_value m_datedoc m_datedoc m_datedoc m_doc getdatedoc m_datedoc set gl journal account param acct account public void set account m account acct m account acct setaccount maccount m_account get gl journal account return account public m account get account return m account maccount getaccount m_account line account from product or charge param acct type see product cost accttype 0 3 param as accounting schema return requested product account public m account get account int acct type m acct schema as charge account if getm product id 0 getc charge id 0 big decimal amt new big decimal 1 revenue if m doc isso trx amt new big decimal 1 expense m account acct get charge account as amt if acct null return acct product account return get product cost get account acct type as accttype productcost accttype_ maccount getaccount accttype macctschema getm_product_id getc_charge_id bigdecimal bigdecimal m_doc issotrx bigdecimal maccount getchargeaccount getproductcost getaccount accttype get charge return c charge id protected int getc charge id int index p po get columnindex c charge id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_charge_id getc_charge_id p_po get_columnindex c_charge_id p_po get_value intvalue get charge account param as account schema param amount amount for expense revenue return charge account or null public m account get charge account m acct schema as big decimal amount int c charge id getc charge id if c charge id 0 return null return m charge get account c charge id as amount maccount getchargeaccount macctschema bigdecimal c_charge_id getc_charge_id c_charge_id mcharge getaccount c_charge_id get period return c period id protected int getc period id if m c period id 1 int index p po get columnindex c period id if index 1 integer ii integer p po get value index if ii null m c period id ii int value if m c period id 1 m c period id 0 return m c period id c_period_id getc_period_id m_c_period_id p_po get_columnindex c_period_id p_po get_value m_c_period_id intvalue m_c_period_id m_c_period_id m_c_period_id set c period id param c period id id protected void setc period id int c period id m c period id c period id c_period_id c_period_id setc_period_id c_period_id m_c_period_id c_period_id get journal acct schema return c acctschema id public int getc acctschema id return m c acctschema id acctschema c_acctschema_id getc_acctschema_id m_c_acctschema_id get line id return id public int get id return p po get id get_id p_po get_id get ad org id return org public int getad org id return p po getad org id ad_org_id getad_org_id p_po getad_org_id get order ad org id return order org if defined public int getorder org id int c orderline id getc orderline id if c orderline id 0 string sql select ad org id from c orderline where c orderline id int ad org id db getsql value null sql c orderline id if ad org id 0 return ad org id return getad org id ad_org_id getorder_org_id c_orderline_id getc_orderline_id c_orderline_id ad_org_id c_orderline c_orderline_id ad_org_id getsqlvalue c_orderline_id ad_org_id ad_org_id getad_org_id product return m product id public int getm product id int index p po get columnindex m product id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_product_id getm_product_id p_po get_columnindex m_product_id p_po get_value intvalue is this an item product vs not a service a charge return true if product public boolean is item if m isitem null return m isitem boolean value m isitem boolean false if getm product id 0 m product product m product get env get ctx getm product id if product get id getm product id product is item m isitem boolean true return m isitem boolean value isitem m_isitem m_isitem booleanvalue m_isitem getm_product_id mproduct mproduct getctx getm_product_id get_id getm_product_id isitem m_isitem m_isitem booleanvalue asi return m attributesetinstance id public int getm attributesetinstance id int index p po get columnindex m attributesetinstance id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_attributesetinstance_id getm_attributesetinstance_id p_po get_columnindex m_attributesetinstance_id p_po get_value intvalue get warehouse locator from return m locator id public int getm locator id int index p po get columnindex m locator id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_locator_id getm_locator_id p_po get_columnindex m_locator_id p_po get_value intvalue get warehouse locator to return m locator id public int getm locatorto id int index p po get columnindex m locatorto id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_locator_id getm_locatorto_id p_po get_columnindex m_locatorto_id p_po get_value intvalue set production bom flag param productionbom flag public void set productionbom boolean productionbom m productionbom productionbom setproductionbom m_productionbom is this the bom to be produced return true if bom public boolean is productionbom return m productionbom isproductionbom m_productionbom get production plan return m productionplan id public int getm productionplan id int index p po get columnindex m productionplan id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_productionplan_id getm_productionplan_id p_po get_columnindex m_productionplan_id p_po get_value intvalue get order line reference return c orderline id public int getc orderline id int index p po get columnindex c orderline id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_orderline_id getc_orderline_id p_po get_columnindex c_orderline_id p_po get_value intvalue get c locfrom id return loc from public int getc locfrom id return m c locfrom id c_locfrom_id getc_locfrom_id m_c_locfrom_id set c locfrom id param c locfrom id loc from public void setc locfrom id int c locfrom id m c locfrom id c locfrom id c_locfrom_id c_locfrom_id setc_locfrom_id c_locfrom_id m_c_locfrom_id c_locfrom_id get c locto id return loc to public int getc locto id return m c locto id c_locto_id getc_locto_id m_c_locto_id set c locto id param c locto id loc to public void setc locto id int c locto id m c locto id c locto id c_locto_id c_locto_id setc_locto_id c_locto_id m_c_locto_id c_locto_id get product cost info return product cost public product cost get product cost if m productcost null m productcost new product cost env get ctx getm product id getm attributesetinstance id p po get trxname return m productcost productcost getproductcost m_productcost m_productcost productcost getctx getm_product_id getm_attributesetinstance_id p_po get_trxname m_productcost get total product costs param as accounting schema param ad org id trx org param zero costsok zero no costs are ok return costs public big decimal get product costs m acct schema as int ad org id boolean zero costsok product cost pc get product cost int c orderline id getc orderline id string costing method null big decimal costs pc get product costs as ad org id costing method c orderline id zero costsok if costs null return costs return env zero ad_org_id zerocostsok bigdecimal getproductcosts macctschema ad_org_id zerocostsok productcost getproductcost c_orderline_id getc_orderline_id costingmethod bigdecimal getproductcosts ad_org_id costingmethod c_orderline_id zerocostsok get product return product or null if no product public m product get product if m productcost null m productcost new product cost env get ctx getm product id getm attributesetinstance id p po get trxname if m productcost null return m productcost get product return null mproduct getproduct m_productcost m_productcost productcost getctx getm_product_id getm_attributesetinstance_id p_po get_trxname m_productcost m_productcost getproduct get revenue recognition return c revenuerecognition id or 0 public int getc revenuerecognition id m product product get product if product null return product getc revenuerecognition id return 0 c_revenuerecognition_id getc_revenuerecognition_id mproduct getproduct getc_revenuerecognition_id quantity uom return transaction or storage m uom id public int getc uom id trx uom int index p po get columnindex c uom id if index 1 integer ii integer p po get value index if ii null return ii int value storage uom m product product get product if product null return product getc uom id return 0 m_uom_id getc_uom_id p_po get_columnindex c_uom_id p_po get_value intvalue mproduct getproduct getc_uom_id quantity param qty transaction qty param isso trx sl order trx i e negative qty public void set qty big decimal qty boolean isso trx if qty null m qty env zero else if isso trx m qty qty negate else m qty qty get product cost set qty qty issotrx setqty bigdecimal issotrx m_qty issotrx m_qty m_qty getproductcost setqty quantity return transaction qty public big decimal get qty return m qty bigdecimal getqty m_qty description return doc line description public string get description int index p po get columnindex description if index 1 return string p po get value index return null getdescription p_po get_columnindex p_po get_value line tax return c tax id public int getc tax id int index p po get columnindex c tax id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_tax_id getc_tax_id p_po get_columnindex c_tax_id p_po get_value intvalue get line number return line no public int get line int index p po get columnindex line if index 1 integer ii integer p po get value index if ii null return ii int value return 0 getline p_po get_columnindex p_po get_value intvalue get b partner return c bpartner id public int getc bpartner id if m c bpartner id 1 int index p po get columnindex c bpartner id if index 1 integer ii integer p po get value index if ii null m c bpartner id ii int value if m c bpartner id 0 m c bpartner id m doc getc bpartner id return m c bpartner id bpartner c_bpartner_id getc_bpartner_id m_c_bpartner_id p_po get_columnindex c_bpartner_id p_po get_value m_c_bpartner_id intvalue m_c_bpartner_id m_c_bpartner_id m_doc getc_bpartner_id m_c_bpartner_id set c bpartner id param c bpartner id id protected void setc bpartner id int c bpartner id m c bpartner id c bpartner id c_bpartner_id c_bpartner_id setc_bpartner_id c_bpartner_id m_c_bpartner_id c_bpartner_id get c bpartner location id return b partner location public int getc bpartner location id int index p po get columnindex c bpartner location id if index 1 integer ii integer p po get value index if ii null return ii int value return m doc getc bpartner location id c_bpartner_location_id bpartner getc_bpartner_location_id p_po get_columnindex c_bpartner_location_id p_po get_value intvalue m_doc getc_bpartner_location_id get trx org return ad orgtrx id public int getad orgtrx id int index p po get columnindex ad orgtrx id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 trxorg ad_orgtrx_id getad_orgtrx_id p_po get_columnindex ad_orgtrx_id p_po get_value intvalue get sales region get sales region from b partner return c salesregion id public int getc salesregion id if m c salesregion id 1 never tried if getc bpartner location id 0 m acctschema is acct schema element m acct schema element elementtype salesregion string sql select coalesce c salesregion id 0 from c bpartner location where c bpartner location id m c salesregion id db getsql value null sql getc bpartner location id log fine c salesregion id m c salesregion id from bpl if m c salesregion id 0 m c salesregion id 2 don t try again else m c salesregion id 2 don t try again if m c salesregion id 0 invalid return 0 return m c salesregion id salesregion bpartner c_salesregion_id getc_salesregion_id m_c_salesregion_id getc_bpartner_location_id m_acctschema isacctschemaelement macctschemaelement elementtype_salesregion c_salesregion_id c_bpartner_location c_bpartner_location_id m_c_salesregion_id getsqlvalue getc_bpartner_location_id c_salesregion_id m_c_salesregion_id m_c_salesregion_id m_c_salesregion_id m_c_salesregion_id m_c_salesregion_id m_c_salesregion_id get project return c project id public int getc project id int index p po get columnindex c project id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_project_id getc_project_id p_po get_columnindex c_project_id p_po get_value intvalue get campaign return c campaign id public int getc campaign id int index p po get columnindex c campaign id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_campaign_id getc_campaign_id p_po get_columnindex c_campaign_id p_po get_value intvalue get activity return c activity id public int getc activity id int index p po get columnindex c activity id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_activity_id getc_activity_id p_po get_columnindex c_activity_id p_po get_value intvalue get user 1 return user defined 1 public int getuser1 id int index p po get columnindex user1 id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 getuser1_id p_po get_columnindex user1_id p_po get_value intvalue get user 2 return user defined 2 public int getuser2 id int index p po get columnindex user2 id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 getuser2_id p_po get_columnindex user2_id p_po get_value intvalue string representation return string public string to string string buffer sb new string buffer doc line sb append p po get id append append get description append qty append m qty append amt append get amt source append return sb to string tostring stringbuffer stringbuffer docline p_po get_id getdescription m_qty getamtsource tostring prepare protected void prepare p m matchinv id getrecord id p_m_matchinv_id getrecord_id process return message throws exception protected string do it throws exception log info m matchinv id p m matchinv id m match inv inv new m match inv get ctx p m matchinv id get trxname if inv get id 0 throw new compiere user error not found m matchinv id p m matchinv id if inv delete true return ok inv save return error doit m_matchinv_id p_m_matchinv_id mmatchinv mmatchinv getctx p_m_matchinv_id get_trxname get_id compiereusererror notfound m_matchinv_id p_m_matchinv_id basic constructor public blockquote basic constructor param element adds an element to the element public blockquote element element add element element addelement basic constructor param element adds an element to the element public blockquote string element add element element addelement basic constructor param element adds an element to the element param cite sets the cite attribute public blockquote element element string cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public blockquote string element string cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public blockquote element element element cite add element element set cite cite addelement setcite basic constructor param element adds an element to the element param cite sets the cite attribute public blockquote string element element cite add element element set cite cite addelement setcite sets the cite attribute param cite sets the cite attribute public blockquote set cite string cite add attribute cite cite return this setcite addattribute sets the cite attribute param cite sets the cite attribute public blockquote set cite element cite add attribute cite cite return this setcite addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public blockquote add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public blockquote add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public blockquote add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public blockquote add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public blockquote remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x r issuerecommendation properties ctx int r issuerecommendation id string trx name super ctx r issuerecommendation id trx name if r issuerecommendation id 0 set name null setr issuerecommendation id 0 x_r_issuerecommendation r_issuerecommendation_id trxname r_issuerecommendation_id trxname r_issuerecommendation_id setname setr_issuerecommendation_id load constructor public x r issuerecommendation properties ctx result set rs string trx name super ctx rs trx name x_r_issuerecommendation resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issuerecommendation append get id append return sb to string tostring stringbuffer stringbuffer x_r_issuerecommendation get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set issue recommendation recommendations how to fix an issue public void setr issuerecommendation id int r issuerecommendation id if r issuerecommendation id 1 throw new illegal argument exception r issuerecommendation id is mandatory set valuenocheck r issuerecommendation id new integer r issuerecommendation id setr_issuerecommendation_id r_issuerecommendation_id r_issuerecommendation_id illegalargumentexception r_issuerecommendation_id set_valuenocheck r_issuerecommendation_id r_issuerecommendation_id get issue recommendation recommendations how to fix an issue public int getr issuerecommendation id integer ii integer get value r issuerecommendation id if ii null return 0 return ii int value getr_issuerecommendation_id get_value r_issuerecommendation_id intvalue get content return content public object get contents return contents getcontents public html code set need closing tag false set tag text set start tag char set end tag char htmlcode setneedclosingtag settagtext setstarttagchar setendtagchar adds an element to the element param hashcode name of element for hash table param element adds an element to the element return this public html code add element string hashcode element element add element to registry hashcode element return this htmlcode addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element return this public html code add element string hashcode string element add element to registry hashcode element return this htmlcode addelement addelementtoregistry adds an element to the element param element adds an element to the element return this public html code add element element element add element to registry element return this htmlcode addelement addelementtoregistry adds an element to the element param element adds an element to the element return this public html code add element string element add element to registry element return this htmlcode addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed return this public html code remove element string hashcode remove element from registry hashcode return this htmlcode removeelement removeelementfromregistry standard constructor public x ad printlabelline properties ctx int ad printlabelline id string trx name super ctx ad printlabelline id trx name if ad printlabelline id 0 setad labelprinterfunction id 0 setad printlabelline id 0 setad printlabel id 0 set label format type null f set name null set seq no 0 setx position 0 sety position 0 x_ad_printlabelline ad_printlabelline_id trxname ad_printlabelline_id trxname ad_printlabelline_id setad_labelprinterfunction_id setad_printlabelline_id setad_printlabel_id setlabelformattype setname setseqno setxposition setyposition load constructor public x ad printlabelline properties ctx result set rs string trx name super ctx rs trx name x_ad_printlabelline resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printlabelline append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printlabelline get_id tostring set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set label printer function function of label printer public void setad labelprinterfunction id int ad labelprinterfunction id if ad labelprinterfunction id 1 throw new illegal argument exception ad labelprinterfunction id is mandatory set value ad labelprinterfunction id new integer ad labelprinterfunction id setad_labelprinterfunction_id ad_labelprinterfunction_id ad_labelprinterfunction_id illegalargumentexception ad_labelprinterfunction_id set_value ad_labelprinterfunction_id ad_labelprinterfunction_id get label printer function function of label printer public int getad labelprinterfunction id integer ii integer get value ad labelprinterfunction id if ii null return 0 return ii int value getad_labelprinterfunction_id get_value ad_labelprinterfunction_id intvalue set print label line print label line format public void setad printlabelline id int ad printlabelline id if ad printlabelline id 1 throw new illegal argument exception ad printlabelline id is mandatory set valuenocheck ad printlabelline id new integer ad printlabelline id setad_printlabelline_id ad_printlabelline_id ad_printlabelline_id illegalargumentexception ad_printlabelline_id set_valuenocheck ad_printlabelline_id ad_printlabelline_id get print label line print label line format public int getad printlabelline id integer ii integer get value ad printlabelline id if ii null return 0 return ii int value getad_printlabelline_id get_value ad_printlabelline_id intvalue set print label label format to print public void setad printlabel id int ad printlabel id if ad printlabel id 1 throw new illegal argument exception ad printlabel id is mandatory set valuenocheck ad printlabel id new integer ad printlabel id setad_printlabel_id ad_printlabel_id ad_printlabel_id illegalargumentexception ad_printlabel_id set_valuenocheck ad_printlabel_id ad_printlabel_id get print label label format to print public int getad printlabel id integer ii integer get value ad printlabel id if ii null return 0 return ii int value getad_printlabel_id get_value ad_printlabel_id intvalue public static final string labelformattype text t set label format type label format type public void set label format type string label format type if label format type null throw new illegal argument exception label format type is mandatory if label format type equals f label format type equals t else throw new illegal argument exception label format type invalid value label format type reference id 280 f t if label format type length 1 log warning length 1 truncated label format type label format type substring 0 0 set value label format type label format type labelformattype_text setlabelformattype labelformattype labelformattype illegalargumentexception labelformattype labelformattype labelformattype illegalargumentexception labelformattype labelformattype reference_id labelformattype labelformattype labelformattype set_value labelformattype labelformattype get label format type label format type public string get label format type return string get value label format type getlabelformattype get_value labelformattype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set print text the label text to be printed on a document or correspondence public void set print name string print name if print name null print name length 60 log warning length 60 truncated print name print name substring 0 59 set value print name print name setprintname printname printname printname printname printname set_value printname printname get print text the label text to be printed on a document or correspondence public string get print name return string get value print name getprintname get_value printname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno set x position absolute x horizontal position in 1 72 of an inch public void setx position int x position set value x position new integer x position setxposition xposition set_value xposition xposition get x position absolute x horizontal position in 1 72 of an inch public int getx position integer ii integer get value x position if ii null return 0 return ii int value getxposition get_value xposition intvalue set y position absolute y vertical position in 1 72 of an inch public void sety position int y position set value y position new integer y position setyposition yposition set_value yposition yposition get y position absolute y vertical position in 1 72 of an inch public int gety position integer ii integer get value y position if ii null return 0 return ii int value getyposition get_value yposition intvalue get contents return contents public object get contents return contents getcontents default constructor param ctx context param ad registration id id public m registration properties ctx int ad registration id string trx name super ctx ad registration id trx name setad client id 0 setad org id 0 setad system id 0 ad_registration_id m_registration ad_registration_id trxname ad_registration_id trxname setad_client_id setad_org_id setad_system_id load cosntructor param ctx context param rs result set public m registration properties ctx result set rs string trx name super ctx rs trx name m_registration resultset trxname trxname before save param new record new return true false protected boolean before save boolean new record m system system m system get get ctx if system get name equals system get user name equals log save error error define system first return false return true newrecord beforesave newrecord msystem msystem getctx getname getusername saveerror standard constructor public x ad column properties ctx int ad column id string trx name super ctx ad column id trx name if ad column id 0 setad column id 0 setad element id 0 setad reference id 0 setad table id 0 set column name null set entity type null u set is always updateable false n set is encrypted null n set is identifier false set is key false set is mandatory false set is parent false set is selection column false set is translated false set is updateable true y set name null set version env zero x_ad_column ad_column_id trxname ad_column_id trxname ad_column_id setad_column_id setad_element_id setad_reference_id setad_table_id setcolumnname setentitytype setisalwaysupdateable setisencrypted setisidentifier setiskey setismandatory setisparent setisselectioncolumn setistranslated setisupdateable setname setversion load constructor public x ad column properties ctx result set rs string trx name super ctx rs trx name x_ad_column resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad column append get id append return sb to string tostring stringbuffer stringbuffer x_ad_column get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set valuenocheck ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_valuenocheck ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set system element system element enables the central maintenance of column description and help public void setad element id int ad element id if ad element id 1 throw new illegal argument exception ad element id is mandatory set value ad element id new integer ad element id setad_element_id ad_element_id ad_element_id illegalargumentexception ad_element_id set_value ad_element_id ad_element_id get system element system element enables the central maintenance of column description and help public int getad element id integer ii integer get value ad element id if ii null return 0 return ii int value getad_element_id get_value ad_element_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue public static final int ad reference id ad reference id 1 set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set value ad reference id new integer ad reference id ad_reference_id_ad_reference_id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_value ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue public static final int ad reference value id ad reference id 4 set reference key required to specify if data type is table or list public void setad reference value id int ad reference value id if ad reference value id 0 set value ad reference value id null else set value ad reference value id new integer ad reference value id ad_reference_value_id_ad_reference_id setad_reference_value_id ad_reference_value_id ad_reference_value_id set_value ad_reference_value_id set_value ad_reference_value_id ad_reference_value_id get reference key required to specify if data type is table or list public int getad reference value id integer ii integer get value ad reference value id if ii null return 0 return ii int value getad_reference_value_id get_value ad_reference_value_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set dynamic validation dynamic validation rule public void setad val rule id int ad val rule id if ad val rule id 0 set value ad val rule id null else set value ad val rule id new integer ad val rule id setad_val_rule_id ad_val_rule_id ad_val_rule_id set_value ad_val_rule_id set_value ad_val_rule_id ad_val_rule_id get dynamic validation dynamic validation rule public int getad val rule id integer ii integer get value ad val rule id if ii null return 0 return ii int value getad_val_rule_id get_value ad_val_rule_id intvalue set callout fully qualified class names and method separated by semicolons public void set callout string callout if callout null callout length 255 log warning length 255 truncated callout callout substring 0 254 set value callout callout setcallout set_value get callout fully qualified class names and method separated by semicolons public string get callout return string get value callout getcallout get_value set db column name name of the column in the database public void set column name string column name if column name null throw new illegal argument exception column name is mandatory if column name length 40 log warning length 40 truncated column name column name substring 0 39 set value column name column name setcolumnname columnname columnname illegalargumentexception columnname columnname columnname columnname set_value columnname columnname get db column name name of the column in the database public string get column name return string get value column name getcolumnname get_value columnname return string get value column name public key name pair get key name pair return new key name pair get id get column name get_value columnname keynamepair getkeynamepair keynamepair get_id getcolumnname set column sql virtual column r o public void set columnsql string columnsql if columnsql null columnsql length 255 log warning length 255 truncated columnsql columnsql substring 0 254 set value columnsql columnsql setcolumnsql set_value get column sql virtual column r o public string get columnsql return string get value columnsql getcolumnsql get_value set default logic default value hierarchy separated by public void set default value string default value if default value null default value length 2000 log warning length 2000 truncated default value default value substring 0 1999 set value default value default value setdefaultvalue defaultvalue defaultvalue defaultvalue defaultvalue defaultvalue set_value defaultvalue defaultvalue get default logic default value hierarchy separated by public string get default value return string get value default value getdefaultvalue get_value defaultvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set length length of the column in the database public void set field length int field length set value field length new integer field length setfieldlength fieldlength set_value fieldlength fieldlength get length length of the column in the database public int get field length integer ii integer get value field length if ii null return 0 return ii int value getfieldlength get_value fieldlength intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set always updateable the column is always updateable even if the record is not active or processed public void set is always updateable boolean is always updateable set value is always updateable new boolean is always updateable setisalwaysupdateable isalwaysupdateable set_value isalwaysupdateable isalwaysupdateable get always updateable the column is always updateable even if the record is not active or processed public boolean is always updateable object oo get value is always updateable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isalwaysupdateable get_value isalwaysupdateable booleanvalue public static final string isencrypted encrypted y set encrypted display or storage is encrypted public void set is encrypted string is encrypted if is encrypted null throw new illegal argument exception is encrypted is mandatory if is encrypted equals n is encrypted equals y else throw new illegal argument exception is encrypted invalid value is encrypted reference id 354 n y if is encrypted length 1 log warning length 1 truncated is encrypted is encrypted substring 0 0 set value is encrypted is encrypted isencrypted_encrypted setisencrypted isencrypted isencrypted illegalargumentexception isencrypted isencrypted isencrypted illegalargumentexception isencrypted isencrypted reference_id isencrypted isencrypted isencrypted set_value isencrypted isencrypted get encrypted display or storage is encrypted public string get is encrypted return string get value is encrypted getisencrypted get_value isencrypted set identifier this column is part of the record identifier public void set is identifier boolean is identifier set value is identifier new boolean is identifier setisidentifier isidentifier set_value isidentifier isidentifier get identifier this column is part of the record identifier public boolean is identifier object oo get value is identifier if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isidentifier get_value isidentifier booleanvalue set key column this column is the key in this table public void set is key boolean is key set value is key new boolean is key setiskey iskey set_value iskey iskey get key column this column is the key in this table public boolean is key object oo get value is key if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iskey get_value iskey booleanvalue set mandatory data entry is required in this column public void set is mandatory boolean is mandatory set value is mandatory new boolean is mandatory setismandatory ismandatory set_value ismandatory ismandatory get mandatory data entry is required in this column public boolean is mandatory object oo get value is mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatory get_value ismandatory booleanvalue set parent link column this column is a link to the parent table e g header from lines incl association key columns public void set is parent boolean is parent set value is parent new boolean is parent setisparent isparent set_value isparent isparent get parent link column this column is a link to the parent table e g header from lines incl association key columns public boolean is parent object oo get value is parent if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isparent get_value isparent booleanvalue set selection column is this column used for finding rows in windows public void set is selection column boolean is selection column set value is selection column new boolean is selection column setisselectioncolumn isselectioncolumn set_value isselectioncolumn isselectioncolumn get selection column is this column used for finding rows in windows public boolean is selection column object oo get value is selection column if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselectioncolumn get_value isselectioncolumn booleanvalue set synchronize database change database table definition when changing dictionary definition public void set is sync database string is sync database if is sync database null is sync database length 1 log warning length 1 truncated is sync database is sync database substring 0 0 set value is sync database is sync database setissyncdatabase issyncdatabase issyncdatabase issyncdatabase issyncdatabase issyncdatabase set_value issyncdatabase issyncdatabase get synchronize database change database table definition when changing dictionary definition public string get is sync database return string get value is sync database getissyncdatabase get_value issyncdatabase set translated this column is translated public void set is translated boolean is translated set value is translated new boolean is translated setistranslated istranslated set_value istranslated istranslated get translated this column is translated public boolean is translated object oo get value is translated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istranslated get_value istranslated booleanvalue set updateable determines if the field can be updated public void set is updateable boolean is updateable set value is updateable new boolean is updateable setisupdateable isupdateable set_value isupdateable isupdateable get updateable determines if the field can be updated public boolean is updateable object oo get value is updateable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isupdateable get_value isupdateable booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set read only logic logic to determine if field is read only applies only when field is read write public void set read only logic string read only logic if read only logic null read only logic length 2000 log warning length 2000 truncated read only logic read only logic substring 0 1999 set value read only logic read only logic setreadonlylogic readonlylogic readonlylogic readonlylogic readonlylogic readonlylogic set_value readonlylogic readonlylogic get read only logic logic to determine if field is read only applies only when field is read write public string get read only logic return string get value read only logic getreadonlylogic get_value readonlylogic set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 60 log warning length 60 truncated v format v format substring 0 59 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat set max value maximum value for a field public void set value max string value max if value max null value max length 20 log warning length 20 truncated value max value max substring 0 19 set value value max value max setvaluemax valuemax valuemax valuemax valuemax valuemax set_value valuemax valuemax get max value maximum value for a field public string get value max return string get value value max getvaluemax get_value valuemax set min value minimum value for a field public void set value min string value min if value min null value min length 20 log warning length 20 truncated value min value min substring 0 19 set value value min value min setvaluemin valuemin valuemin valuemin valuemin valuemin set_value valuemin valuemin get min value minimum value for a field public string get value min return string get value value min getvaluemin get_value valuemin set version version of the table definition public void set version big decimal version if version null throw new illegal argument exception version is mandatory set value version version setversion bigdecimal illegalargumentexception set_value get version version of the table definition public big decimal get version big decimal bd big decimal get value version if bd null return env zero return bd bigdecimal getversion bigdecimal bigdecimal get_value standard constructor public x ad wf processdata properties ctx int ad wf processdata id string trx name super ctx ad wf processdata id trx name if ad wf processdata id 0 setad wf processdata id 0 setad wf process id 0 set attribute name null x_ad_wf_processdata ad_wf_processdata_id trxname ad_wf_processdata_id trxname ad_wf_processdata_id setad_wf_processdata_id setad_wf_process_id setattributename load constructor public x ad wf processdata properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_processdata resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf processdata append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_processdata get_id tostring set workflow process data workflow process context public void setad wf processdata id int ad wf processdata id if ad wf processdata id 1 throw new illegal argument exception ad wf processdata id is mandatory set valuenocheck ad wf processdata id new integer ad wf processdata id setad_wf_processdata_id ad_wf_processdata_id ad_wf_processdata_id illegalargumentexception ad_wf_processdata_id set_valuenocheck ad_wf_processdata_id ad_wf_processdata_id get workflow process data workflow process context public int getad wf processdata id integer ii integer get value ad wf processdata id if ii null return 0 return ii int value getad_wf_processdata_id get_value ad_wf_processdata_id intvalue set workflow process actual workflow process instance public void setad wf process id int ad wf process id if ad wf process id 1 throw new illegal argument exception ad wf process id is mandatory set valuenocheck ad wf process id new integer ad wf process id setad_wf_process_id ad_wf_process_id ad_wf_process_id illegalargumentexception ad_wf_process_id set_valuenocheck ad_wf_process_id ad_wf_process_id get workflow process actual workflow process instance public int getad wf process id integer ii integer get value ad wf process id if ii null return 0 return ii int value getad_wf_process_id get_value ad_wf_process_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf process id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_process_id set attribute name name of the attribute public void set attribute name string attribute name if attribute name null throw new illegal argument exception attribute name is mandatory if attribute name length 60 log warning length 60 truncated attribute name attribute name substring 0 59 set value attribute name attribute name setattributename attributename attributename illegalargumentexception attributename attributename attributename attributename set_value attributename attributename get attribute name name of the attribute public string get attribute name return string get value attribute name getattributename get_value attributename set attribute value value of the attribute public void set attribute value string attribute value if attribute value null attribute value length 60 log warning length 60 truncated attribute value attribute value substring 0 59 set value attribute value attribute value setattributevalue attributevalue attributevalue attributevalue attributevalue attributevalue set_value attributevalue attributevalue get attribute value value of the attribute public string get attribute value return string get value attribute value getattributevalue get_value attributevalue standard constructor param ctx context param m packageline id id public m package line properties ctx int m packageline id string trx name super ctx m packageline id trx name if m packageline id 0 setm package id 0 setm inoutline id 0 set qty env zero m_packageline_id mpackageline m_packageline_id trxname m_packageline_id trxname m_packageline_id setm_package_id setm_inoutline_id setqty load constructor param ctx context param rs result set public m package line properties ctx result set rs string trx name super ctx rs trx name mpackageline resultset trxname trxname parent constructor param parent header public m package line m package parent this parent get ctx 0 parent get trxname set client org parent setm package id parent getm package id mpackageline mpackage getctx get_trxname setclientorg setm_package_id getm_package_id set shipment line param line line public void set in out line m in out line line setm inoutline id line getm inoutline id set qty line get movement qty setinoutline minoutline setm_inoutline_id getm_inoutline_id setqty getmovementqty standard constructor public x c project properties ctx int c project id string trx name super ctx c project id trx name if c project id 0 setc currency id 0 setc project id 0 set committed amt env zero set committed qty env zero set invoiced amt env zero set invoiced qty env zero set is commit ceiling false set is commitment false set is summary false set name null set planned amt env zero set planned margin amt env zero set planned qty env zero set processed false set project balance amt env zero set value null x_c_project c_project_id trxname c_project_id trxname c_project_id setc_currency_id setc_project_id setcommittedamt setcommittedqty setinvoicedamt setinvoicedqty setiscommitceiling setiscommitment setissummary setname setplannedamt setplannedmarginamt setplannedqty setprocessed setprojectbalanceamt setvalue load constructor public x c project properties ctx result set rs string trx name super ctx rs trx name x_c_project resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c project append get id append return sb to string tostring stringbuffer stringbuffer x_c_project get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue public static final int c bpartnersr id ad reference id 353 set b partner agent business partner agent or sales rep public void setc bpartnersr id int c bpartnersr id if c bpartnersr id 0 set value c bpartnersr id null else set value c bpartnersr id new integer c bpartnersr id c_bpartnersr_id_ad_reference_id bpartner setc_bpartnersr_id c_bpartnersr_id c_bpartnersr_id set_value c_bpartnersr_id set_value c_bpartnersr_id c_bpartnersr_id get b partner agent business partner agent or sales rep public int getc bpartnersr id integer ii integer get value c bpartnersr id if ii null return 0 return ii int value bpartner getc_bpartnersr_id get_value c_bpartnersr_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 0 set value c paymentterm id null else set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id set_value c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set standard phase standard phase of the project type public void setc phase id int c phase id if c phase id 0 set value c phase id null else set value c phase id new integer c phase id setc_phase_id c_phase_id c_phase_id set_value c_phase_id set_value c_phase_id c_phase_id get standard phase standard phase of the project type public int getc phase id integer ii integer get value c phase id if ii null return 0 return ii int value getc_phase_id get_value c_phase_id intvalue set project type type of the project public void setc projecttype id string c projecttype id if c projecttype id null c projecttype id length 22 log warning length 22 truncated c projecttype id c projecttype id substring 0 21 set value c projecttype id c projecttype id setc_projecttype_id c_projecttype_id c_projecttype_id c_projecttype_id c_projecttype_id c_projecttype_id set_value c_projecttype_id c_projecttype_id get project type type of the project public string getc projecttype id return string get value c projecttype id getc_projecttype_id get_value c_projecttype_id set project financial project public void setc project id int c project id if c project id 1 throw new illegal argument exception c project id is mandatory set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id illegalargumentexception c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set committed amount the legal commitment amount public void set committed amt big decimal committed amt if committed amt null throw new illegal argument exception committed amt is mandatory set value committed amt committed amt setcommittedamt bigdecimal committedamt committedamt illegalargumentexception committedamt set_value committedamt committedamt get committed amount the legal commitment amount public big decimal get committed amt big decimal bd big decimal get value committed amt if bd null return env zero return bd bigdecimal getcommittedamt bigdecimal bigdecimal get_value committedamt set committed quantity the legal commitment quantity public void set committed qty big decimal committed qty if committed qty null throw new illegal argument exception committed qty is mandatory set value committed qty committed qty setcommittedqty bigdecimal committedqty committedqty illegalargumentexception committedqty set_value committedqty committedqty get committed quantity the legal commitment quantity public big decimal get committed qty big decimal bd big decimal get value committed qty if bd null return env zero return bd bigdecimal getcommittedqty bigdecimal bigdecimal get_value committedqty set copy from copy from record public void set copy from string copy from if copy from null copy from length 1 log warning length 1 truncated copy from copy from substring 0 0 set value copy from copy from setcopyfrom copyfrom copyfrom copyfrom copyfrom copyfrom set_value copyfrom copyfrom get copy from copy from record public string get copy from return string get value copy from getcopyfrom get_value copyfrom set contract date the planned effective date of this document public void set date contract timestamp date contract set value date contract date contract setdatecontract datecontract set_value datecontract datecontract get contract date the planned effective date of this document public timestamp get date contract return timestamp get value date contract getdatecontract get_value datecontract set finish date finish or planned completion date public void set date finish timestamp date finish set value date finish date finish setdatefinish datefinish set_value datefinish datefinish get finish date finish or planned completion date public timestamp get date finish return timestamp get value date finish getdatefinish get_value datefinish set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set generate to generate to public void set generate to string generate to if generate to null generate to length 1 log warning length 1 truncated generate to generate to substring 0 0 set value generate to generate to setgenerateto generateto generateto generateto generateto generateto set_value generateto generateto get generate to generate to public string get generate to return string get value generate to getgenerateto get_value generateto set invoiced amount the amount invoiced public void set invoiced amt big decimal invoiced amt if invoiced amt null throw new illegal argument exception invoiced amt is mandatory set valuenocheck invoiced amt invoiced amt setinvoicedamt bigdecimal invoicedamt invoicedamt illegalargumentexception invoicedamt set_valuenocheck invoicedamt invoicedamt get invoiced amount the amount invoiced public big decimal get invoiced amt big decimal bd big decimal get value invoiced amt if bd null return env zero return bd bigdecimal getinvoicedamt bigdecimal bigdecimal get_value invoicedamt set quantity invoiced the quantity invoiced public void set invoiced qty big decimal invoiced qty if invoiced qty null throw new illegal argument exception invoiced qty is mandatory set valuenocheck invoiced qty invoiced qty setinvoicedqty bigdecimal invoicedqty invoicedqty illegalargumentexception invoicedqty set_valuenocheck invoicedqty invoicedqty get quantity invoiced the quantity invoiced public big decimal get invoiced qty big decimal bd big decimal get value invoiced qty if bd null return env zero return bd bigdecimal getinvoicedqty bigdecimal bigdecimal get_value invoicedqty set commitment is ceiling the commitment amount quantity is the chargeable ceiling public void set is commit ceiling boolean is commit ceiling set value is commit ceiling new boolean is commit ceiling setiscommitceiling iscommitceiling set_value iscommitceiling iscommitceiling get commitment is ceiling the commitment amount quantity is the chargeable ceiling public boolean is commit ceiling object oo get value is commit ceiling if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscommitceiling get_value iscommitceiling booleanvalue set commitment is this document a legal commitment public void set is commitment boolean is commitment set value is commitment new boolean is commitment setiscommitment iscommitment set_value iscommitment iscommitment get commitment is this document a legal commitment public boolean is commitment object oo get value is commitment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscommitment get_value iscommitment booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set price list version identifies a unique instance of a price list public void setm pricelist version id int m pricelist version id if m pricelist version id 0 set value m pricelist version id null else set value m pricelist version id new integer m pricelist version id setm_pricelist_version_id m_pricelist_version_id m_pricelist_version_id set_value m_pricelist_version_id set_value m_pricelist_version_id m_pricelist_version_id get price list version identifies a unique instance of a price list public int getm pricelist version id integer ii integer get value m pricelist version id if ii null return 0 return ii int value getm_pricelist_version_id get_value m_pricelist_version_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set value po reference po reference setporeference poreference poreference poreference poreference poreference set_value poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference set planned amount planned amount for this project public void set planned amt big decimal planned amt if planned amt null throw new illegal argument exception planned amt is mandatory set value planned amt planned amt setplannedamt bigdecimal plannedamt plannedamt illegalargumentexception plannedamt set_value plannedamt plannedamt get planned amount planned amount for this project public big decimal get planned amt big decimal bd big decimal get value planned amt if bd null return env zero return bd bigdecimal getplannedamt bigdecimal bigdecimal get_value plannedamt set planned margin project s planned margin amount public void set planned margin amt big decimal planned margin amt if planned margin amt null throw new illegal argument exception planned margin amt is mandatory set value planned margin amt planned margin amt setplannedmarginamt bigdecimal plannedmarginamt plannedmarginamt illegalargumentexception plannedmarginamt set_value plannedmarginamt plannedmarginamt get planned margin project s planned margin amount public big decimal get planned margin amt big decimal bd big decimal get value planned margin amt if bd null return env zero return bd bigdecimal getplannedmarginamt bigdecimal bigdecimal get_value plannedmarginamt set planned quantity planned quantity for this project public void set planned qty big decimal planned qty if planned qty null throw new illegal argument exception planned qty is mandatory set value planned qty planned qty setplannedqty bigdecimal plannedqty plannedqty illegalargumentexception plannedqty set_value plannedqty plannedqty get planned quantity planned quantity for this project public big decimal get planned qty big decimal bd big decimal get value planned qty if bd null return env zero return bd bigdecimal getplannedqty bigdecimal bigdecimal get_value plannedqty set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set project balance total project balance public void set project balance amt big decimal project balance amt if project balance amt null throw new illegal argument exception project balance amt is mandatory set valuenocheck project balance amt project balance amt setprojectbalanceamt bigdecimal projectbalanceamt projectbalanceamt illegalargumentexception projectbalanceamt set_valuenocheck projectbalanceamt projectbalanceamt get project balance total project balance public big decimal get project balance amt big decimal bd big decimal get value project balance amt if bd null return env zero return bd bigdecimal getprojectbalanceamt bigdecimal bigdecimal get_value projectbalanceamt public static final string projectcategory workorderjob w set project category project category public void set project category string project category if project category null throw new illegal argument exception project category is mandatory if project category null project category equals a project category equals n project category equals s project category equals w else throw new illegal argument exception project category invalid value project category reference id 288 a n s w if project category null project category length 1 log warning length 1 truncated project category project category substring 0 0 set value project category project category projectcategory_workorderjob setprojectcategory projectcategory projectcategory illegalargumentexception projectcategory projectcategory projectcategory projectcategory projectcategory projectcategory illegalargumentexception projectcategory projectcategory reference_id projectcategory projectcategory projectcategory projectcategory set_value projectcategory projectcategory get project category project category public string get project category return string get value project category getprojectcategory get_value projectcategory public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue standard constructor public x m rmatype properties ctx int m rmatype id string trx name super ctx m rmatype id trx name if m rmatype id 0 setm rmatype id 0 set name null x_m_rmatype m_rmatype_id trxname m_rmatype_id trxname m_rmatype_id setm_rmatype_id setname load constructor public x m rmatype properties ctx result set rs string trx name super ctx rs trx name x_m_rmatype resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m rmatype append get id append return sb to string tostring stringbuffer stringbuffer x_m_rmatype get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set rma type return material authorization type public void setm rmatype id int m rmatype id if m rmatype id 1 throw new illegal argument exception m rmatype id is mandatory set valuenocheck m rmatype id new integer m rmatype id setm_rmatype_id m_rmatype_id m_rmatype_id illegalargumentexception m_rmatype_id set_valuenocheck m_rmatype_id m_rmatype_id get rma type return material authorization type public int getm rmatype id integer ii integer get value m rmatype id if ii null return 0 return ii int value getm_rmatype_id get_value m_rmatype_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname add node to correct tree param ctx cpntext param tree type tree type param record id id public static boolean add node properties ctx string tree type int record id string trx name get tree int ad tree id 0 m client client m client get ctx m client info ci client get info if treetype activity equals tree type ad tree id ci getad tree activity id else if treetype bom equals tree type throw new illegal argument exception bom trees not supported else if treetype bpartner equals tree type ad tree id ci getad tree bpartner id else if treetype campaign equals tree type ad tree id ci getad tree campaign id else if treetype elementvalue equals tree type throw new illegal argument exception element value cannot use this api else if treetype menu equals tree type ad tree id ci getad tree menu id else if treetype organization equals tree type ad tree id ci getad tree org id else if treetype product equals tree type ad tree id ci getad tree product id else if treetype productcategory equals tree type throw new illegal argument exception product category trees not supported else if treetype project equals tree type ad tree id ci getad tree project id else if treetype salesregion equals tree type ad tree id ci getad tree salesregion id if ad tree id 0 throw new illegal argument exception no tree found mtree base tree mtree base get ctx ad tree id trx name if tree get id ad tree id throw new illegal argument exception tree found ad tree id ad tree id insert tree in correct tree boolean saved false if treetype menu equals tree type mtree nodemm node new mtree nodemm tree record id saved node save else if treetype bpartner equals tree type mtree nodebp node new mtree nodebp tree record id saved node save else if treetype product equals tree type mtree nodepr node new mtree nodepr tree record id saved node save else mtree node node new mtree node tree record id saved node save return saved treetype record_id addnode treetype record_id trxname ad_tree_id mclient mclient mclientinfo getinfo treetype_activity treetype ad_tree_id getad_tree_activity_id treetype_bom treetype illegalargumentexception treetype_bpartner treetype ad_tree_id getad_tree_bpartner_id treetype_campaign treetype ad_tree_id getad_tree_campaign_id treetype_elementvalue treetype illegalargumentexception elementvalue treetype_menu treetype ad_tree_id getad_tree_menu_id treetype_organization treetype ad_tree_id getad_tree_org_id treetype_product treetype ad_tree_id getad_tree_product_id treetype_productcategory treetype illegalargumentexception treetype_project treetype ad_tree_id getad_tree_project_id treetype_salesregion treetype ad_tree_id getad_tree_salesregion_id ad_tree_id illegalargumentexception mtree_base mtree_base ad_tree_id trxname get_id ad_tree_id illegalargumentexception ad_tree_id ad_tree_id treetype_menu treetype mtree_nodemm mtree_nodemm record_id treetype_bpartner treetype mtree_nodebp mtree_nodebp record_id treetype_product treetype mtree_nodepr mtree_nodepr record_id mtree_node mtree_node record_id get node table name param tree type tree type return node table name e g ad treenode public static string get node table name string tree type string node table name ad treenode if treetype menu equals tree type node table name mm else if treetype bpartner equals tree type node table name bp else if treetype product equals tree type node table name pr return node table name tablename treetype ad_treenode getnodetablename treetype nodetablename ad_treenode treetype_menu treetype nodetablename treetype_bpartner treetype nodetablename treetype_product treetype nodetablename nodetablename get source table name param tree type tree typw return source table name e g ad org or null public static string get source table name string tree type if tree type null return null string source table null if tree type equals treetype menu source table ad menu else if tree type equals treetype organization source table ad org else if tree type equals treetype product source table m product else if tree type equals treetype productcategory source table m product category else if tree type equals treetype bom source table m bom else if tree type equals treetype elementvalue source table c elementvalue else if tree type equals treetype bpartner source table c bpartner else if tree type equals treetype campaign source table c campaign else if tree type equals treetype project source table c project else if tree type equals treetype activity source table c activity else if tree type equals treetype salesregion source table c salesregion return source table tablename treetype ad_org getsourcetablename treetype treetype sourcetable treetype treetype_menu sourcetable ad_menu treetype treetype_organization sourcetable ad_org treetype treetype_product sourcetable m_product treetype treetype_productcategory sourcetable m_product_category treetype treetype_bom sourcetable m_bom treetype treetype_elementvalue sourcetable c_elementvalue treetype treetype_bpartner sourcetable c_bpartner treetype treetype_campaign sourcetable c_campaign treetype treetype_project sourcetable c_project treetype treetype_activity sourcetable c_activity treetype treetype_salesregion sourcetable c_salesregion sourcetable get mtree base from cache param ctx context param ad tree id id return mtree base public static mtree base get properties ctx int ad tree id string trx name integer key new integer ad tree id mtree base ret value mtree base s cache get key if ret value null return ret value ret value new mtree base ctx ad tree id trx name if ret value get id 0 s cache put key ret value return ret value mtree_base ad_tree_id mtree_base mtree_base ad_tree_id trxname ad_tree_id mtree_base retvalue mtree_base s_cache retvalue retvalue retvalue mtree_base ad_tree_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param ad tree id id public mtree base properties ctx int ad tree id string trx name super ctx ad tree id trx name if ad tree id 0 set name null set tree type null set is all nodes true complete tree set is default false ad_tree_id mtree_base ad_tree_id trxname ad_tree_id trxname ad_tree_id setname settreetype setisallnodes setisdefault load constructor param ctx context param rs result set public mtree base properties ctx result set rs string trx name super ctx rs trx name mtree_base resultset trxname trxname parent constructor param client client public mtree base m client client string name string tree type this client get ctx 0 client get trxname set client org client set name name set tree type tree type mtree_base mclient treetype getctx get_trxname setclientorg setname settreetype treetype get node table name return node table name e g ad treenode public string get node table name return get node table name get tree type tablename ad_treenode getnodetablename getnodetablename gettreetype get source table name i e where to get the name and color param table name only if false return from clause alias t return source table name e g ad org or null public string get source table name boolean table name only string table name get source table name get tree type if table name only return table name if m product equals table name return m product t inner join m product category x on t m product category id x m product category id if c bpartner equals table name return c bpartner t inner join c bp group x on t c bp group id x c bp group id if ad org equals table name return ad org t inner join ad orginfo i on t ad org id i ad org id left outer join ad orgtype x on i ad orgtype id x ad orgtype id if c campaign equals table name return c campaign t left outer join c channel x on t c channel id x c channel id if table name null table name t return table name tablename tablenameonly ad_org getsourcetablename tablenameonly tablename getsourcetablename gettreetype tablenameonly tablename m_product tablename m_product m_product_category m_product_category_id m_product_category_id c_bpartner tablename c_bpartner c_bp_group c_bp_group_id c_bp_group_id ad_org tablename ad_org ad_orginfo ad_org_id ad_org_id ad_orgtype ad_orgtype_id ad_orgtype_id c_campaign tablename c_campaign c_channel c_channel_id c_channel_id tablename tablename tablename get fully qualified name of action color column return null or action or color public string get action color name string table name get source table name get tree type if ad menu equals table name return t action if m product equals table name c bpartner equals table name ad org equals table name c campaign equals table name return x ad printcolor id return null globalqss saca error en postgresql return 0 getactioncolorname tablename getsourcetablename gettreetype ad_menu tablename m_product tablename c_bpartner tablename ad_org tablename c_campaign tablename ad_printcolor_id before save param new record new return true protected boolean before save boolean new record if is active is all nodes set is default false return true newrecord beforesave newrecord isactive isallnodes setisdefault after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record base node if treetype bpartner equals get tree type mtree nodebp ndbp new mtree nodebp this 0 ndbp save else if treetype menu equals get tree type mtree nodemm ndmm new mtree nodemm this 0 ndmm save else if treetype product equals get tree type mtree nodepr ndpr new mtree nodepr this 0 ndpr save else mtree node nd new mtree node this 0 nd save return success newrecord aftersave newrecord newrecord treetype_bpartner gettreetype mtree_nodebp mtree_nodebp treetype_menu gettreetype mtree_nodemm mtree_nodemm treetype_product gettreetype mtree_nodepr mtree_nodepr mtree_node mtree_node static create ui param c component return compiere tabbed paneui public static componentui createui j component c return new compiere tabbed paneui tabbedpaneui jcomponent compieretabbedpaneui install defaults protected void install defaults super install defaults tab pane set opaque false installdefaults installdefaults tabpane setopaque update this method is invoked by code j component code when the specified component is being painted by default this method will fill the specified component with its background color if its code opaque code property is code true code and then immediately call code paint code param g the code graphics code context in which to paint param c the component being painted see paint see javax swing j component paint component public void update graphics g j component c system out println c get class get name c is opaque container container c get parent while container null system out println container get class container is opaque container container get parent system out println tab bounds c get bounds c get class get name if c is opaque compiere panelui update it g c tab area background paint g c jcomponent jcomponent paintcomponent jcomponent getclass getname isopaque getparent getclass isopaque getparent getbounds getclass getname isopaque compierepanelui updateit tabareabackground paint it param g graphics param c component public void paint graphics g j component c int tab placement tab pane get tab placement insets insets c get insets dimension size c get size if tab pane is opaque g set color c get background todo printing of area behind tabs switch tab placement case left g fill rect insets left insets top calculate tab area width tab placement run count max tab width size height insets bottom insets top break case bottom int total tab height calculate tab area height tab placement run count max tab height g fill rect insets left size height insets bottom total tab height size width insets left insets right total tab height break case right int total tab width calculate tab area width tab placement run count max tab width g fill rect size width insets right total tab width insets top total tab width size height insets top insets bottom break case top default g fill rect insets left insets top size width insets right insets left calculate tab area height tab placement run count max tab height paint highlight below tab else super paint g c jcomponent tabplacement tabpane gettabplacement getinsets getsize tabpane isopaque setcolor getbackground tabplacement fillrect calculatetabareawidth tabplacement runcount maxtabwidth totaltabheight calculatetabareaheight tabplacement runcount maxtabheight fillrect totaltabheight totaltabheight totaltabwidth calculatetabareawidth tabplacement runcount maxtabwidth fillrect totaltabwidth totaltabwidth fillrect calculatetabareaheight tabplacement runcount maxtabheight painthighlightbelowtab paint the actual tab background called from basic paint tab basic paint tab area basic paint p based on metal tabbed paneui paint tab background differences color based on primary background of tab selected tab is painted pre selected not sel top lighter flat darker bottom flat lighter darker sides flat ligher flat darker pre param g graphics param tab placement tab placement param tab index tab index param x x param y y param w width param h height param is selected selected protected void paint tab background graphics g int tab placement int tab index int x int y int w int h boolean is selected graphics2d g2d graphics2d g get background color of tab component comp tab pane get component at tab index system out println tab tab index comp comp get name comp get class get name x x y y w w h h g2d set paint comp get background compiere color bg compiere color get default background if comp instanceof j panel j panel jp j panel comp try bg compiere color jp get client property compiereplaf background catch exception e system err println compiere tabbed paneui client property e get message if bg null no background if compiere utils is left to right tab pane switch tab placement case left g2d fill rect x 5 y 1 w 5 h 1 g2d fill rect x 2 y 4 3 h 4 break case bottom g2d fill rect x 2 y w 2 h 4 g2d fill rect x 5 y h 1 3 w 5 3 break case right g2d fill rect x 1 y 1 w 5 h 1 g2d fill rect x w 1 3 y 5 3 h 5 break case top default g2d fill rect x 4 y 2 w 1 3 h 1 1 g2d fill rect x 2 y 5 2 h 5 else switch tab placement case left g2d fill rect x 5 y 1 w 5 h 1 g2d fill rect x 2 y 4 3 h 4 break case bottom g2d fill rect x y w 5 h 1 g2d fill rect x w 1 4 y 4 h 5 g2d fill rect x w 1 4 y h 1 4 2 2 break case right g2d fill rect x 1 y 1 w 5 h 1 g2d fill rect x w 1 3 y 5 3 h 5 break case top default g2d fill rect x y 2 w 1 3 h 1 1 g2d fill rect x w 1 3 y 4 3 h 4 else we have a background if compiere utils is left to right tab pane switch tab placement case left bg paint rect g2d tab pane x 5 y 1 w 5 h 1 bg paint rect g2d tab pane x 2 y 4 3 h 4 break case bottom bg paint rect g2d tab pane x 2 y w 2 h 4 bg paint rect g2d tab pane x 5 y h 1 3 w 5 3 break case right bg paint rect g2d tab pane x 1 y 1 w 5 h 1 bg paint rect g2d tab pane x y 2 w 4 h 2 changed bg paint rect g2d tab pane x w 1 3 y 5 3 h 5 break case top default bg paint rect g2d tab pane x 4 y 2 w 1 3 h 1 1 bg paint rect g2d tab pane x 2 y 5 2 h 5 else switch tab placement case left bg paint rect g2d tab pane x 5 y 1 w 5 h 1 bg paint rect g2d tab pane x 2 y 4 3 h 4 break case bottom bg paint rect g2d tab pane x y w 5 h 1 bg paint rect g2d tab pane x w 1 4 y 4 h 5 bg paint rect g2d tab pane x w 1 4 y h 1 4 2 2 break case right bg paint rect g2d tab pane x 1 y 1 w 5 h 1 bg paint rect g2d tab pane x w 1 3 y 5 3 h 5 break case top default bg paint rect g2d tab pane x y 2 w 1 3 h 1 1 bg paint rect g2d tab pane x w 1 3 y 4 3 h 4 upper part not when selected and r l b if is selected tab placement right tab placement left tab placement bottom shape top new rectangle x y w h 2 upper half if tab placement top tab placement left top new polygon top left triangle new int x 6 x w x w x x new int y y y h 2 y h 2 y 6 5 else if tab placement right top new polygon top right triangle new int x x w 6 x w x w x new int y y y 6 y h 2 y h 2 5 lighter gradient paint paint new gradient paint x y compiere utils col 1top x y h 2 compiere utils col 1end g2d set paint paint g2d fill top lower part not when selected and t r l if is selected tab placement top tab placement right tab placement left shape end new rectangle x y h 2 w h 2 lower half if tab placement bottom end new polygon bottom left triangle new int x x w x w x 6 x new int y h 2 y h 2 y h y h y h 6 5 darker gradient paint paint new gradient paint x y h 2 compiere utils col 2top x y h compiere utils col 2end g2d set paint paint g2d fill end painttab painttabarea metaltabbedpaneui painttabbackground tabplacement tabindex isselected painttabbackground tabplacement tabindex isselected tabpane getcomponentat tabindex tabindex getname getclass getname setpaint getbackground compierecolor compierecolor getdefaultbackground jpanel jpanel jpanel compierecolor getclientproperty compieretabbedpaneui clientproperty getmessage compiereutils islefttoright tabpane tabplacement fillrect fillrect fillrect fillrect fillrect fillrect fillrect fillrect tabplacement fillrect fillrect fillrect fillrect fillrect fillrect fillrect fillrect fillrect compiereutils islefttoright tabpane tabplacement paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane tabplacement paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane paintrect tabpane isselected tabplacement tabplacement tabplacement tabplacement tabplacement tabplacement gradientpaint gradientpaint compiereutils col_1top compiereutils col_1end setpaint isselected tabplacement tabplacement tabplacement tabplacement gradientpaint gradientpaint compiereutils col_2top compiereutils col_2end setpaint paint content border overwriting basic tabbed panelui uses color from actual tab not from tabbed pane param g graphics param tab placement tab placement param selected index index protected void paint content border graphics g int tab placement int selected index system out println tab content border int width tab pane get width int height tab pane get height insets insets tab pane get insets int x insets left int y insets top int w width insets right insets left int h height insets top insets bottom switch tab placement case left x calculate tab area width tab placement run count max tab width w x insets left break case right w calculate tab area width tab placement run count max tab width break case bottom h calculate tab area height tab placement run count max tab height break case top default y calculate tab area height tab placement run count max tab height h y insets top fill region behind content area basically a border component comp null if selected index 1 comp tab pane get component at selected index if comp null comp instanceof j component j component jc j component comp compiere color bg null try if jc null bg compiere color jc get client property compiereplaf background catch exception e system err println compiere tabbed paneui client property e get message if bg null bg new compiere color jc get background jc put client property compiereplaf background bg bg paint rect g jc x y w h not a j component paint flat else if comp null g set color comp get background g fill rect x y w h paint content border top edge g tab placement selected index x y w h paint content border left edge g tab placement selected index x y w h paint content border bottom edge g tab placement selected index x y w h paint content border right edge g tab placement selected index x y w h basictabbedpanelui tabbedpane tabplacement selectedindex paintcontentborder tabplacement selectedindex tabcontentborder tabpane getwidth tabpane getheight tabpane getinsets tabplacement calculatetabareawidth tabplacement runcount maxtabwidth calculatetabareawidth tabplacement runcount maxtabwidth calculatetabareaheight tabplacement runcount maxtabheight calculatetabareaheight tabplacement runcount maxtabheight selectedindex tabpane getcomponentat selectedindex jcomponent jcomponent jcomponent compierecolor compierecolor getclientproperty compieretabbedpaneui clientproperty getmessage compierecolor getbackground putclientproperty paintrect jcomponent setcolor getbackground fillrect paintcontentbordertopedge tabplacement selectedindex paintcontentborderleftedge tabplacement selectedindex paintcontentborderbottomedge tabplacement selectedindex paintcontentborderrightedge tabplacement selectedindex paint left content border edge param g graphics param tab placement tab placement param selected index index param x x param y y param w width param h height protected void paint content border left edge graphics g int tab placement int selected index int x int y int w int h rectangle sel rect selected index 0 null get tab bounds selected index calc rect g set color select highlight draw unbroken line if tabs are not on left or selected tab is not in run adjacent to content or selected tab is not visible scroll tab layout if tab placement left selected index 0 sel rect x sel rect width 1 x sel rect y y sel rect y y h g draw line x y x y h 2 else break line to show visual connection to selected tab g draw line x y x sel rect y 1 if sel rect y sel rect height y h 2 g draw line x sel rect y sel rect height 1 x y h 2 bug tabplacement selectedindex paintcontentborderleftedge tabplacement selectedindex selrect selectedindex gettabbounds selectedindex calcrect setcolor selecthighlight scroll_tab_layout tabplacement selectedindex selrect selrect selrect selrect drawline drawline selrect selrect selrect drawline selrect selrect paint bottom content area edge param g graphics param tab placement tab placement param selected index index param x x param y y param w width param h height protected void paint content border bottom edge graphics g int tab placement int selected index int x int y int w int h boolean left to right compiere utils is left to right tab pane int bottom y h 1 int right x w 1 rectangle sel rect selected index 0 null get tab bounds selected index calc rect g set color shadow draw unbroken line if tabs are not on bottom or selected tab is not in run adjacent to content or selected tab is not visible scroll tab layout if tab placement bottom selected index 0 sel rect y 1 h bug sel rect x x sel rect x x w g set color dark shadow g draw line x y h 1 x w 1 y h 1 else break line to show visual connection to selected tab boolean last in run is last in run selected index g set color dark shadow if left to right last in run g draw line x bottom sel rect x bottom else g draw line x bottom sel rect x 1 bottom if sel rect x sel rect width x w 2 if left to right last in run g draw line sel rect x sel rect width bottom right bottom else g draw line sel rect x sel rect width 1 bottom right bottom tabplacement selectedindex paintcontentborderbottomedge tabplacement selectedindex lefttoright compiereutils islefttoright tabpane selrect selectedindex gettabbounds selectedindex calcrect setcolor scroll_tab_layout tabplacement selectedindex selrect selrect selrect setcolor darkshadow drawline lastinrun islastinrun selectedindex setcolor darkshadow lefttoright lastinrun drawline selrect drawline selrect selrect selrect lefttoright lastinrun drawline selrect selrect drawline selrect selrect paint right contenr border edge param g graphics param tab placement tab placement param selected index index param x x param y y param w width param h height protected void paint content border right edge graphics g int tab placement int selected index int x int y int w int h rectangle sel rect selected index 0 null get tab bounds selected index calc rect g set color shadow draw unbroken line if tabs are not on right or selected tab is not in run adjacent to content or selected tab is not visible scroll tab layout if tab placement right selected index 0 sel rect x 1 w bug sel rect y y sel rect y y h g set color dark shadow g draw line x w 1 y x w 1 y h 1 else break line to show visual connection to selected tab g set color dark shadow g draw line x w 1 y x w 1 sel rect y if sel rect y sel rect height y h 2 g set color dark shadow g draw line x w 1 sel rect y sel rect height x w 1 y h 2 tabplacement selectedindex paintcontentborderrightedge tabplacement selectedindex selrect selectedindex gettabbounds selectedindex calcrect setcolor scroll_tab_layout tabplacement selectedindex selrect selrect selrect setcolor darkshadow drawline setcolor darkshadow drawline selrect selrect selrect setcolor darkshadow drawline selrect selrect is last run param tab index index return true if last tab run private boolean is last in run int tab index int run get run for tab tab pane get tab count tab index int last index last tab in run tab pane get tab count run return tab index last index tabindex islastinrun tabindex getrunfortab tabpane gettabcount tabindex lastindex lasttabinrun tabpane gettabcount tabindex lastindex fill tab gap triangle no param current run current run param tab index tab index param x x param y y return false protected boolean should fill gap int current run int tab index int x int y return false currentrun tabindex shouldfillgap currentrun tabindex paint top tab border param tab index index param g graphics param x x param y y param w width param h height param btm bottom param rght right param is selected selected protected void paint top tab border int tab index graphics g int x int y int w int h int btm int rght boolean is selected int current run get run for tab tab pane get tab count tab index int last index last tab in run tab pane get tab count current run int first index tab runs current run boolean left to right compiere utils is left to right tab pane int bottom h 1 int right w 1 paint gap if should fill gap current run tab index x y g translate x y if left to right g set color get color for gap current run x y 1 g fill rect 1 0 5 3 g fill rect 1 3 2 2 else g set color get color for gap current run x w 1 y 1 g fill rect right 5 0 5 3 g fill rect right 2 3 2 2 g translate x y g translate x y paint border g set color dark shadow if left to right paint slant g draw line 1 5 6 0 paint top g draw line 6 0 right 0 paint right if tab index last index last tab in run g draw line right 1 right bottom paint left if tab index tab runs run count 1 not the first tab in the last run g draw line 0 0 0 bottom else the first tab in the last run g draw line 0 6 0 bottom else paint slant g draw line right 1 5 right 6 0 paint top g draw line right 6 0 0 0 paint right if tab index tab runs run count 1 not the first tab in the last run g draw line right 0 right bottom else the first tab in the last run g draw line right 6 right bottom paint left if tab index last index last tab in run g draw line 0 1 0 bottom paint button if is selected g draw line 0 bottom right bottom added paint highlight g set color is selected select highlight highlight if left to right paint slant g draw line 1 6 6 1 paint top if tab index last index g draw line 6 1 right 1 1 else g draw line 6 1 right 1 bug paint left g draw line 1 6 1 bottom paint highlight in the gap on tab behind this one on the left end where they all line up if tab index first index tab index tab runs run count 1 first tab in run but not first tab in last run if tab pane get selected index tab runs current run 1 tab in front of selected tab g set color select highlight else tab in front of normal tab g set color highlight g draw line 1 0 1 4 else paint slant g draw line right 1 6 right 6 1 paint top g draw line right 6 1 1 1 paint left if tab index last index last tab in run g draw line 1 1 1 bottom else g draw line 0 1 0 bottom g translate x y tabindex isselected painttoptabborder tabindex isselected currentrun getrunfortab tabpane gettabcount tabindex lastindex lasttabinrun tabpane gettabcount currentrun firstindex tabruns currentrun lefttoright compiereutils islefttoright tabpane shouldfillgap currentrun tabindex lefttoright setcolor getcolorforgap currentrun fillrect fillrect setcolor getcolorforgap currentrun fillrect fillrect setcolor darkshadow lefttoright drawline drawline tabindex lastindex drawline tabindex tabruns runcount drawline drawline drawline drawline tabindex tabruns runcount drawline drawline tabindex lastindex drawline isselected drawline setcolor isselected selecthighlight lefttoright drawline tabindex lastindex drawline drawline drawline tabindex firstindex tabindex tabruns runcount tabpane getselectedindex tabruns currentrun setcolor selecthighlight setcolor drawline drawline drawline tabindex lastindex drawline drawline paint border of left tab does not fill triangle param tab index index param g graphics param x x param y y param w width param h height param btm bottom param rght right param is selected selected protected void paint left tab border int tab index graphics g int x int y int w int h int btm int rght boolean is selected int tab count tab pane get tab count int current run get run for tab tab count tab index int last index last tab in run tab count current run int first index tab runs current run g translate x y int bottom h 1 int right w 1 paint highlight g set color is selected select highlight highlight paint slant g draw line 1 6 6 1 paint top g draw line 6 1 right 1 paint left g draw line 1 6 1 bottom paint right if is selected g draw line right 1 0 right 1 bottom paint border g set color dark shadow paint slant g draw line 1 5 6 0 paint top g draw line 6 0 right 0 paint left g draw line 0 6 0 bottom paint bottom g draw line 0 bottom right bottom paint right if is selected g draw line right 0 right bottom g translate x y tabindex isselected paintlefttabborder tabindex isselected tabcount tabpane gettabcount currentrun getrunfortab tabcount tabindex lastindex lasttabinrun tabcount currentrun firstindex tabruns currentrun setcolor isselected selecthighlight drawline drawline drawline isselected drawline setcolor darkshadow drawline drawline drawline drawline isselected drawline paint border of right tab does not fill triangle param tab index index param g graphics param x x param y y param w width param h height param btm bottom param rght right param is selected selected protected void paint right tab border int tab index graphics g int x int y int w int h int btm int rght boolean is selected int tab count tab pane get tab count int current run get run for tab tab count tab index int last index last tab in run tab count current run int first index tab runs current run g translate x y int bottom h 1 int right w 1 paint highlight g set color is selected select highlight highlight paint slant g draw line right 6 1 right 1 6 paint top g draw line 0 1 right 6 1 paint right g draw line right 1 6 right 1 bottom 1 paint left if is selected g draw line 0 1 0 bottom 1 paint border g set color dark shadow paint slant g draw line right 6 0 right 6 paint top g draw line 0 0 right 6 0 paint right g draw line right 6 right bottom paint bottom g draw line 0 bottom right bottom g translate x y tabindex isselected paintrighttabborder tabindex isselected tabcount tabpane gettabcount currentrun getrunfortab tabcount tabindex lastindex lasttabinrun tabcount currentrun firstindex tabruns currentrun setcolor isselected selecthighlight drawline drawline drawline isselected drawline setcolor darkshadow drawline drawline drawline drawline calculate tab width we may have to overwrite to adjust width for tab hirarchy level param tab placement tab placement param tab index tab index param metrics metcics return tab width protected int calculate tab width int tab placement int tab index font metrics metrics boolean calculate tab placement top tab placement bottom html if get text view for tab tab index null calculate false no spaces in title string title tab pane get title at tab index int pos title index of if calculate pos 1 calculate false if calculate return super calculate tab width tab placement tab index metrics icon icon get icon for tab tab index insets tab insets local get tab insets tab placement tab index int width tab insets local left tab insets local right 3 if icon null width icon get icon width text icon gap string first line title substring 0 pos string second line title substring pos 1 width math max swing utilities compute string width metrics first line swing utilities compute string width metrics second line return width tabhirarchylevel tabplacement tabindex calculatetabwidth tabplacement tabindex fontmetrics tabplacement tabplacement gettextviewfortab tabindex tabpane gettitleat tabindex indexof calculatetabwidth tabplacement tabindex geticonfortab tabindex tabinsetslocal gettabinsets tabplacement tabindex tabinsetslocal tabinsetslocal geticonwidth texticongap firstline secondline swingutilities computestringwidth firstline swingutilities computestringwidth secondline calculate tab height param tab placement tab placement param tab index tab index param font height font height return tab height protected int calculate tab height int tab placement int tab index int font height boolean calculate tab placement top tab placement bottom html if get text view for tab tab index null calculate false no spaces in title string title tab pane get title at tab index int pos title index of if calculate pos 1 calculate false if calculate return super calculate tab height tab placement tab index font height int height font height 2 icon icon get icon for tab tab index insets tab insets local get tab insets tab placement tab index if icon null height math max height icon get icon height height tab insets local top tab insets local bottom 2 return height tabheight tabplacement tabindex fontheight calculatetabheight tabplacement tabindex fontheight tabplacement tabplacement gettextviewfortab tabindex tabpane gettitleat tabindex indexof calculatetabheight tabplacement tabindex fontheight fontheight geticonfortab tabindex tabinsetslocal gettabinsets tabplacement tabindex geticonheight tabinsetslocal tabinsetslocal layout label param tab placement tab placement param metrics fint metrics param tab index tab index param title title param icon icon param tab rect tab bounds param icon rect icon bounds param text rect text bounds param is selected selected protected void layout label int tab placement font metrics metrics int tab index string title icon icon rectangle tab rect rectangle icon rect rectangle text rect boolean is selected boolean calculate tab placement top tab placement bottom html if get text view for tab tab index null calculate false if calculate super layout label tab placement metrics tab index title icon tab rect icon rect text rect is selected system out println 1 tab rect tab rect text rect text rect title return text rect x text rect y icon rect x icon rect y 0 swing utilities layout compound label tab pane metrics title icon swing utilities top vert swing utilities left horiz swing utilities center vert text swing utilities trailing horiz text tab rect icon rect text rect text icon gap tab pane put client property html null int x nudge get tab label shiftx tab placement tab index is selected int y nudge get tab label shifty tab placement tab index is selected positioned top left add gap insets tab insets local get tab insets tab placement tab index x nudge tab insets local left y nudge tab insets local top 1 icon rect x x nudge icon rect y y nudge text rect x x nudge text rect y y nudge system out println 2 tab rect tab rect text rect text rect title tabplacement tabindex tabrect iconrect textrect isselected layoutlabel tabplacement fontmetrics tabindex tabrect iconrect textrect isselected tabplacement tabplacement gettextviewfortab tabindex layoutlabel tabplacement tabindex tabrect iconrect textrect isselected tabrect tabrect textrect textrect textrect textrect iconrect iconrect swingutilities layoutcompoundlabel tabpane swingutilities swingutilities swingutilities swingutilities tabrect iconrect textrect texticongap tabpane putclientproperty xnudge gettablabelshiftx tabplacement tabindex isselected ynudge gettablabelshifty tabplacement tabindex isselected tabinsetslocal gettabinsets tabplacement tabindex xnudge tabinsetslocal ynudge tabinsetslocal iconrect xnudge iconrect ynudge textrect xnudge textrect ynudge tabrect tabrect textrect textrect paint tab param g graphics param tab placement tab placement param font font param metrics font metrics param tab index tab index param title title param text rect text bounds param is selected selected protected void paint text graphics g int tab placement font font font metrics metrics int tab index string title rectangle text rect boolean is selected boolean calculate tab placement top tab placement bottom html if get text view for tab tab index null calculate false if calculate super paint text g tab placement font metrics tab index title text rect is selected return system out println 3 text rect text rect title string first line title string second line null int pos title index of if pos 1 first line title substring 0 pos second line title substring pos 1 g set font font int mnem index tab pane get displayed mnemonic index at tab index if tab pane is enabled tab pane is enabled at tab index color c tab pane get foreground at tab index if is selected if c equals color black c color dark gray else c c brighter g set color c first line basic graphics utils draw string underline char at g first line mnem index text rect x text rect y metrics get ascent second line if second line null basic graphics utils draw string underline char at g second line mnem index first line length text rect x text rect y metrics get ascent metrics get height else tab disabled g set color tab pane get background at tab index brighter basic graphics utils draw string underline char at g first line mnem index text rect x text rect y metrics get ascent second line if second line null basic graphics utils draw string underline char at g second line mnem index first line length text rect x text rect y metrics get ascent metrics get height g set color tab pane get background at tab index darker basic graphics utils draw string underline char at g first line mnem index text rect x 1 text rect y metrics get ascent 1 second line if second line null basic graphics utils draw string underline char at g second line mnem index first line length text rect x 1 text rect y metrics get ascent metrics get height 1 tabplacement tabindex textrect isselected painttext tabplacement fontmetrics tabindex textrect isselected tabplacement tabplacement gettextviewfortab tabindex painttext tabplacement tabindex textrect isselected textrect textrect firstline secondline indexof firstline secondline setfont mnemindex tabpane getdisplayedmnemonicindexat tabindex tabpane isenabled tabpane isenabledat tabindex tabpane getforegroundat tabindex isselected darkgray setcolor basicgraphicsutils drawstringunderlinecharat firstline mnemindex textrect textrect getascent secondline secondline basicgraphicsutils drawstringunderlinecharat secondline mnemindex firstline textrect textrect getascent getheight setcolor tabpane getbackgroundat tabindex basicgraphicsutils drawstringunderlinecharat firstline mnemindex textrect textrect getascent secondline secondline basicgraphicsutils drawstringunderlinecharat secondline mnemindex firstline textrect textrect getascent getheight setcolor tabpane getbackgroundat tabindex basicgraphicsutils drawstringunderlinecharat firstline mnemindex textrect textrect getascent secondline secondline basicgraphicsutils drawstringunderlinecharat secondline mnemindex firstline textrect textrect getascent getheight create layout manager to size position tabs return layout manager protected layout manager create layout manager return new tabbed pane layout layoutmanager createlayoutmanager tabbedpanelayout calculate tab rectangle size param tab placement tab placement param tab count no of tabs protected void calculate tab rects int tab placement int tab count super calculate tab rects tab placement tab count if tab placement top tab placement bottom return system out println calculate tab rects tab count int tab height calculate max tab height tab placement for int i 0 i rects length i int level 0 component comp tab pane get component at i if comp instanceof j component j component jc j component comp try integer ll integer jc get client property compiereplaf tablevel if ll null level ll int value catch exception e system err println compiere tabbed paneui client property e get message if level 0 if tab placement left rects i x level 5 rects i width level 5 height rects i height tab height if i 0 rects i y rects i 1 y tab height rects i 1 height for all rects tabplacement tabcount calculatetabrects tabplacement tabcount calculatetabrects tabplacement tabcount tabplacement tabplacement calculatetabrects tabcount tabheight calculatemaxtabheight tabplacement tabpane getcomponentat jcomponent jcomponent jcomponent getclientproperty intvalue compieretabbedpaneui clientproperty getmessage tabplacement tabheight tabheight standard constructor public x m inoutline properties ctx int m inoutline id string trx name super ctx m inoutline id trx name if m inoutline id 0 setc uom id 0 c uom id set is description false n set is invoiced false set line 0 sql select nvl max line 0 10 as default value from m inoutline where m inout id m inout id setm attributesetinstance id 0 setm inoutline id 0 setm inout id 0 setm locator id 0 m locator id set movement qty env zero 1 set processed false set qty entered env zero 1 x_m_inoutline m_inoutline_id trxname m_inoutline_id trxname m_inoutline_id setc_uom_id c_uom_id setisdescription setisinvoiced setline defaultvalue m_inoutline m_inout_id m_inout_id setm_attributesetinstance_id setm_inoutline_id setm_inout_id setm_locator_id m_locator_id setmovementqty setprocessed setqtyentered load constructor public x m inoutline properties ctx result set rs string trx name super ctx rs trx name x_m_inoutline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inoutline append get id append return sb to string tostring stringbuffer stringbuffer x_m_inoutline get_id tostring set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set valuenocheck c orderline id null else set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_valuenocheck c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set confirmed quantity confirmation of a received quantity public void set confirmed qty big decimal confirmed qty set value confirmed qty confirmed qty setconfirmedqty bigdecimal confirmedqty set_value confirmedqty confirmedqty get confirmed quantity confirmation of a received quantity public big decimal get confirmed qty big decimal bd big decimal get value confirmed qty if bd null return env zero return bd bigdecimal getconfirmedqty bigdecimal bigdecimal get_value confirmedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set description only if true the line is just description and no transaction public void set is description boolean is description set value is description new boolean is description setisdescription isdescription set_value isdescription isdescription get description only if true the line is just description and no transaction public boolean is description object oo get value is description if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdescription get_value isdescription booleanvalue set invoiced is this invoiced public void set is invoiced boolean is invoiced set value is invoiced new boolean is invoiced setisinvoiced isinvoiced set_value isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 1 throw new illegal argument exception m inout id is mandatory set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id illegalargumentexception m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty set picked quantity public void set picked qty big decimal picked qty set value picked qty picked qty setpickedqty bigdecimal pickedqty set_value pickedqty pickedqty get picked quantity public big decimal get picked qty big decimal bd big decimal get value picked qty if bd null return env zero return bd bigdecimal getpickedqty bigdecimal bigdecimal get_value pickedqty set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity the quantity entered is based on the selected uom public void set qty entered big decimal qty entered if qty entered null throw new illegal argument exception qty entered is mandatory set value qty entered qty entered setqtyentered bigdecimal qtyentered qtyentered illegalargumentexception qtyentered set_value qtyentered qtyentered get quantity the quantity entered is based on the selected uom public big decimal get qty entered big decimal bd big decimal get value qty entered if bd null return env zero return bd bigdecimal getqtyentered bigdecimal bigdecimal get_value qtyentered set referenced shipment line public void setref inoutline id int ref inoutline id if ref inoutline id 0 set value ref inoutline id null else set value ref inoutline id new integer ref inoutline id setref_inoutline_id ref_inoutline_id ref_inoutline_id set_value ref_inoutline_id set_value ref_inoutline_id ref_inoutline_id get referenced shipment line public int getref inoutline id integer ii integer get value ref inoutline id if ii null return 0 return ii int value getref_inoutline_id get_value ref_inoutline_id intvalue set scrapped quantity the quantity scrapped due to qa issues public void set scrapped qty big decimal scrapped qty set value scrapped qty scrapped qty setscrappedqty bigdecimal scrappedqty set_value scrappedqty scrappedqty get scrapped quantity the quantity scrapped due to qa issues public big decimal get scrapped qty big decimal bd big decimal get value scrapped qty if bd null return env zero return bd bigdecimal getscrappedqty bigdecimal bigdecimal get_value scrappedqty set target quantity target movement quantity public void set target qty big decimal target qty set value target qty target qty settargetqty bigdecimal targetqty set_value targetqty targetqty get target quantity target movement quantity public big decimal get target qty big decimal bd big decimal get value target qty if bd null return env zero return bd bigdecimal gettargetqty bigdecimal bigdecimal get_value targetqty doc engine drafted param po document public document engine doc action po this po status drafted documentengine docaction status_drafted doc engine param po document param doc status initial document status public document engine doc action po string doc status m document po if doc status null m status doc status docstatus documentengine docaction docstatus m_document docstatus m_status docstatus get doc status return document status public string get doc status return m status getdocstatus m_status set doc status ignored param ignored status is not set directly see org compiere process doc action set doc status string public void set doc status string ignored docaction setdocstatus setdocstatus document is drafted return true if drafted public boolean is drafted return status drafted equals m status isdrafted status_drafted m_status document is invalid return true if invalid public boolean is invalid return status invalid equals m status isinvalid status_invalid m_status document is in progress return true if in progress public boolean is in progress return status inprogress equals m status isinprogress status_inprogress m_status document is approved return true if approved public boolean is approved return status approved equals m status isapproved status_approved m_status document is not approved return true if not approved public boolean is not approved return status notapproved equals m status isnotapproved status_notapproved m_status document is waiting payment or confirmation return true if waiting payment public boolean is waiting return status waitingpayment equals m status status waitingconfirmation equals m status iswaiting status_waitingpayment m_status status_waitingconfirmation m_status document is completed return true if completed public boolean is completed return status completed equals m status iscompleted status_completed m_status document is reversed return true if reversed public boolean is reversed return status reversed equals m status isreversed status_reversed m_status document is closed return true if closed public boolean is closed return status closed equals m status isclosed status_closed m_status document is voided return true if voided public boolean is voided return status voided equals m status isvoided status_voided m_status document status is unknown return true if unknown public boolean is unknown return status unknown equals m status is drafted is invalid is in progress is not approved is approved is waiting is completed is reversed is closed is voided isunknown status_unknown m_status isdrafted isinvalid isinprogress isnotapproved isapproved iswaiting iscompleted isreversed isclosed isvoided process actual document checks if user document action is valid and then process action calls the individual actions which call the document action param process action document action based on workflow param doc action document action based on document return true if performed public boolean process it string process action string doc action m message null m action null std user workflows see mwf node next is valid for if is valid action process action wf selection first m action process action else if is valid action doc action user selection second m action doc action nothing to do else if process action equals action none doc action equals action none if m document null m document get logger info no action prc process action doc doc action m document return true else throw new illegal state exception status get doc status invalid actions process process action doc doc action if m document null m document get logger info action m action prc process action doc doc action m document boolean success process it m action if m document null m document get logger fine action m action success success return success processaction docaction processit processaction docaction m_message m_action mwfnodenext isvalidfor isvalidaction processaction m_action processaction isvalidaction docaction m_action docaction processaction action_none docaction action_none m_document m_document get_logger processaction docaction m_document illegalstateexception getdocstatus processaction docaction m_document m_document get_logger m_action processaction docaction m_document processit m_action m_document m_document get_logger m_action process actual document do not call directly calls the individual actions which call the document action param action document action return true if performed public boolean process it string action m message null m action action if action unlock equals m action return unlock it if action invalidate equals m action return invalidate it if action prepare equals m action return status inprogress equals prepare it if action approve equals m action return approve it if action reject equals m action return reject it if action complete equals m action action waitcomplete equals m action string status null if is drafted is invalid prepare if not prepared yet status prepare it if status inprogress equals status return false status complete it if m document null ini is client post immediate if on server m client client m client get m document get ctx m document getad client id if status completed equals status client is post immediate m document save post it return status completed equals status status inprogress equals status status waitingpayment equals status status waitingconfirmation equals status if action reactivate equals m action return re activate it if action reverse accrual equals m action return reverse accrual it if action reverse correct equals m action return reverse correct it if action close equals m action return close it if action void equals m action return void it if action post equals m action return post it return false processit m_message m_action action_unlock m_action unlockit action_invalidate m_action invalidateit action_prepare m_action status_inprogress prepareit action_approve m_action approveit action_reject m_action rejectit action_complete m_action action_waitcomplete m_action isdrafted isinvalid prepareit status_inprogress completeit m_document isclient mclient mclient m_document getctx m_document getad_client_id status_completed ispostimmediate m_document postit status_completed status_inprogress status_waitingpayment status_waitingconfirmation action_reactivate m_action reactivateit action_reverse_accrual m_action reverseaccrualit action_reverse_correct m_action reversecorrectit action_close m_action closeit action_void m_action voidit action_post m_action postit unlock document status drafted return true if success see org compiere process doc action unlock it public boolean unlock it if is valid action action unlock return false if m document null if m document unlock it m status status drafted m document set doc status m status return true return false m status status drafted return true docaction unlockit unlockit isvalidaction action_unlock m_document m_document unlockit m_status status_drafted m_document setdocstatus m_status m_status status_drafted invalidate document status invalid return true if success see org compiere process doc action invalidate it public boolean invalidate it if is valid action action invalidate return false if m document null if m document invalidate it m status status invalid m document set doc status m status return true return false m status status invalid return true docaction invalidateit invalidateit isvalidaction action_invalidate m_document m_document invalidateit m_status status_invalid m_document setdocstatus m_status m_status status_invalid process document status is set by process return new status in progress or invalid see org compiere process doc action prepare it public string prepare it if is valid action action prepare return m status if m document null m status m document prepare it m document set doc status m status return m status docaction prepareit prepareit isvalidaction action_prepare m_status m_document m_status m_document prepareit m_document setdocstatus m_status m_status approve document status approved return true if success see org compiere process doc action approve it public boolean approve it if is valid action action approve return false if m document null if m document approve it m status status approved m document set doc status m status return true return false m status status approved return true docaction approveit approveit isvalidaction action_approve m_document m_document approveit m_status status_approved m_document setdocstatus m_status m_status status_approved reject approval status not approved return true if success see org compiere process doc action reject it public boolean reject it if is valid action action reject return false if m document null if m document reject it m status status notapproved m document set doc status m status return true return false m status status notapproved return true docaction rejectit rejectit isvalidaction action_reject m_document m_document rejectit m_status status_notapproved m_document setdocstatus m_status m_status status_notapproved complete document status is set by process return new document status complete in progress invalid waiting see org compiere process doc action complete it public string complete it if is valid action action complete return m status if m document null m status m document complete it m document set doc status m status return m status docaction completeit completeit isvalidaction action_complete m_status m_document m_status m_document completeit m_document setdocstatus m_status m_status post document does not change status return true if success public boolean post it if is valid action action post m document null return false try should work on client and server initial context ctx c connection get get initial context true server home server home server home ctx lookup server home jndi name if server home null server server server home create if server null string error server post immediate env get ctx m document getad client id m document get table id m document get id true m document get trxname m document get logger config server error null ok error return error null else m document get logger config no server home catch exception e m document get logger config ex e get message return false postit isvalidaction action_post m_document initialcontext cconnection getinitialcontext serverhome serverhome serverhome serverhome jndi_name serverhome serverhome postimmediate getctx m_document getad_client_id m_document get_table_id m_document get_id m_document get_trxname m_document get_logger m_document get_logger noserverhome m_document get_logger getmessage void document status voided return true if success see org compiere process doc action void it public boolean void it if is valid action action void return false if m document null if m document void it m status status voided m document set doc status m status return true return false m status status voided return true docaction voidit voidit isvalidaction action_void m_document m_document voidit m_status status_voided m_document setdocstatus m_status m_status status_voided close document status closed return true if success see org compiere process doc action close it public boolean close it if m document null orders can be closed any time m document get table id x c order table id else if is valid action action close return false if m document null if m document close it m status status closed m document set doc status m status return true return false m status status closed return true docaction closeit closeit m_document m_document get_table_id x_c_order table_id isvalidaction action_close m_document m_document closeit m_status status_closed m_document setdocstatus m_status m_status status_closed reverse correct document status reversed return true if success see org compiere process doc action reverse correct it public boolean reverse correct it if is valid action action reverse correct return false if m document null if m document reverse correct it m status status reversed m document set doc status m status return true return false m status status reversed return true docaction reversecorrectit reversecorrectit isvalidaction action_reverse_correct m_document m_document reversecorrectit m_status status_reversed m_document setdocstatus m_status m_status status_reversed reverse accrual document status reversed return true if success see org compiere process doc action reverse accrual it public boolean reverse accrual it if is valid action action reverse accrual return false if m document null if m document reverse accrual it m status status reversed m document set doc status m status return true return false m status status reversed return true docaction reverseaccrualit reverseaccrualit isvalidaction action_reverse_accrual m_document m_document reverseaccrualit m_status status_reversed m_document setdocstatus m_status m_status status_reversed re activate document status in progress return true if success see org compiere process doc action re activate it public boolean re activate it if is valid action action reactivate return false if m document null if m document re activate it m status status inprogress m document set doc status m status return true return false m status status inprogress return true docaction reactivateit reactivateit isvalidaction action_reactivate m_document m_document reactivateit m_status status_inprogress m_document setdocstatus m_status m_status status_inprogress set document status to new status param new status new status void set status string new status m status new status newstatus setstatus newstatus m_status newstatus get action options based on current status return array of actions public string get action options if is invalid return new string action prepare action invalidate action unlock action void if is drafted return new string action prepare action invalidate action complete action unlock action void if is in progress is approved return new string action complete action waitcomplete action approve action reject action unlock action void action prepare if is not approved return new string action reject action prepare action unlock action void if is waiting return new string action complete action waitcomplete action reactivate action void action close if is completed return new string action close action reactivate action reverse accrual action reverse correct action post action void if is closed return new string action post action reopen if is reversed is voided return new string action post return new string getactionoptions isinvalid action_prepare action_invalidate action_unlock action_void isdrafted action_prepare action_invalidate action_complete action_unlock action_void isinprogress isapproved action_complete action_waitcomplete action_approve action_reject action_unlock action_void action_prepare isnotapproved action_reject action_prepare action_unlock action_void iswaiting action_complete action_waitcomplete action_reactivate action_void action_close iscompleted action_close action_reactivate action_reverse_accrual action_reverse_correct action_post action_void isclosed action_post action_reopen isreversed isvoided action_post is the action valid based on current state param action action return true if valid public boolean is valid action string action string options get action options for int i 0 i options length i if options i equals action return true return false isvalidaction getactionoptions get process message return clear text error message public string get process msg return m message getprocessmsg m_message get process message param msg clear text error message public void set process msg string msg m message msg setprocessmsg m_message get summary return throw exception public string get summary throw new illegal state exception exception msg getsummary illegalstateexception exception_msg get document no return throw exception public string get document no throw new illegal state exception exception msg getdocumentno illegalstateexception exception_msg get document info return throw exception public string get document info throw new illegal state exception exception msg getdocumentinfo illegalstateexception exception_msg get document owner return throw exception public int getdoc user id throw new illegal state exception exception msg getdoc_user_id illegalstateexception exception_msg get document currency return throw exception public int getc currency id throw new illegal state exception exception msg getc_currency_id illegalstateexception exception_msg get document approval amount return throw exception public big decimal get approval amt throw new illegal state exception exception msg bigdecimal getapprovalamt illegalstateexception exception_msg get document client return throw exception public int getad client id throw new illegal state exception exception msg getad_client_id illegalstateexception exception_msg get document organization return throw exception public int getad org id throw new illegal state exception exception msg getad_org_id illegalstateexception exception_msg get doc action return document action public string get doc action return m action getdocaction m_action save document return throw exception public boolean save throw new illegal state exception exception msg illegalstateexception exception_msg get context return context public properties get ctx if m document null return m document get ctx throw new illegal state exception exception msg getctx m_document m_document getctx illegalstateexception exception_msg get id of record return id public int get id if m document null return m document get id throw new illegal state exception exception msg get_id m_document m_document get_id illegalstateexception exception_msg get ad table id return ad table id public int get table id if m document null return m document get table id throw new illegal state exception exception msg ad_table_id ad_table_id get_table_id m_document m_document get_table_id illegalstateexception exception_msg get logger return logger public c logger get logger if m document null return m document get logger throw new illegal state exception exception msg clogger get_logger m_document m_document get_logger illegalstateexception exception_msg get transaction return trx name public string get trxname return null get_trxname createpdf return null public file createpdf return null box element param item item public box element m print format item item color color super if item null item is type box m item item m color color boxelement boxelement mprintformatitem istypebox m_item m_color calculate size return true if calculated protected boolean calculate size p width 0 p height 0 if m item null return true return true calculatesize p_width p_height m_item paint param g2d graphics param page no page param page start page start param ctx context param is view true if java public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view if m item null return g2d set color m color basic stroke s new basic stroke m item get line width g2d set stroke s point2d double location get absolute location page start int x int location x int y int location y int width m item get max width int height m item get max height if m item get print format type equals m print format item printformattype line g2d draw line x y x width y height else string type m item get shape type if type null type if m item is filled rectangle if type equals m print format item shapetype 3drectangle g2d fill3d rect x y width height true else if type equals m print format item shapetype oval g2d fill oval x y width height else if type equals m print format item shapetype roundrectangle g2d fill round rect x y width height m item get arc diameter m item get arc diameter else g2d fill rect x y width height else if type equals m print format item shapetype 3drectangle g2d draw3d rect x y width height true else if type equals m print format item shapetype oval g2d draw oval x y width height else if type equals m print format item shapetype roundrectangle g2d draw round rect x y width height m item get arc diameter m item get arc diameter else g2d draw rect x y width height pageno pagestart isview pageno pagestart isview m_item setcolor m_color basicstroke basicstroke m_item getlinewidth setstroke getabsolutelocation pagestart m_item getmaxwidth m_item getmaxheight m_item getprintformattype mprintformatitem printformattype_line drawline m_item getshapetype m_item isfilledrectangle mprintformatitem shapetype_3drectangle fill3drect mprintformatitem shapetype_oval filloval mprintformatitem shapetype_roundrectangle fillroundrect m_item getarcdiameter m_item getarcdiameter fillrect mprintformatitem shapetype_3drectangle draw3drect mprintformatitem shapetype_oval drawoval mprintformatitem shapetype_roundrectangle drawroundrect m_item getarcdiameter m_item getarcdiameter drawrect get contents return contents public object get contents return contents getcontents get contents return context public object get contents return contents getcontents standard constructor public x ad alertrecipient properties ctx int ad alertrecipient id string trx name super ctx ad alertrecipient id trx name if ad alertrecipient id 0 setad alertrecipient id 0 setad alert id 0 x_ad_alertrecipient ad_alertrecipient_id trxname ad_alertrecipient_id trxname ad_alertrecipient_id setad_alertrecipient_id setad_alert_id load constructor public x ad alertrecipient properties ctx result set rs string trx name super ctx rs trx name x_ad_alertrecipient resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad alertrecipient append get id append return sb to string tostring stringbuffer stringbuffer x_ad_alertrecipient get_id tostring set alert recipient recipient of the alert notification public void setad alertrecipient id int ad alertrecipient id if ad alertrecipient id 1 throw new illegal argument exception ad alertrecipient id is mandatory set valuenocheck ad alertrecipient id new integer ad alertrecipient id setad_alertrecipient_id ad_alertrecipient_id ad_alertrecipient_id illegalargumentexception ad_alertrecipient_id set_valuenocheck ad_alertrecipient_id ad_alertrecipient_id get alert recipient recipient of the alert notification public int getad alertrecipient id integer ii integer get value ad alertrecipient id if ii null return 0 return ii int value getad_alertrecipient_id get_value ad_alertrecipient_id intvalue set alert compiere alert public void setad alert id int ad alert id if ad alert id 1 throw new illegal argument exception ad alert id is mandatory set valuenocheck ad alert id new integer ad alert id setad_alert_id ad_alert_id ad_alert_id illegalargumentexception ad_alert_id set_valuenocheck ad_alert_id ad_alert_id get alert compiere alert public int getad alert id integer ii integer get value ad alert id if ii null return 0 return ii int value getad_alert_id get_value ad_alert_id intvalue set role responsibility role public void setad role id int ad role id if ad role id 0 set value ad role id null else set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_value ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id standard constructor public x m forecast properties ctx int m forecast id string trx name super ctx m forecast id trx name if m forecast id 0 setc calendar id 0 setc year id 0 set is default false setm forecast id 0 set name null x_m_forecast m_forecast_id trxname m_forecast_id trxname m_forecast_id setc_calendar_id setc_year_id setisdefault setm_forecast_id setname load constructor public x m forecast properties ctx result set rs string trx name super ctx rs trx name x_m_forecast resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m forecast append get id append return sb to string tostring stringbuffer stringbuffer x_m_forecast get_id tostring set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set valuenocheck c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_valuenocheck c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set year calendar year public void setc year id int c year id if c year id 1 throw new illegal argument exception c year id is mandatory set valuenocheck c year id new integer c year id setc_year_id c_year_id c_year_id illegalargumentexception c_year_id set_valuenocheck c_year_id c_year_id get year calendar year public int getc year id integer ii integer get value c year id if ii null return 0 return ii int value getc_year_id get_value c_year_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set forecast material forecast public void setm forecast id int m forecast id if m forecast id 1 throw new illegal argument exception m forecast id is mandatory set valuenocheck m forecast id new integer m forecast id setm_forecast_id m_forecast_id m_forecast_id illegalargumentexception m_forecast_id set_valuenocheck m_forecast_id m_forecast_id get forecast material forecast public int getm forecast id integer ii integer get value m forecast id if ii null return 0 return ii int value getm_forecast_id get_value m_forecast_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue initialize security param ctx context with compiere secure class name public static void init properties ctx if s engine null string class name ctx get property secure interface compiere secure s engine new secure engine class name compiere_secure s_engine classname getproperty secureinterface compiere_secure s_engine secureengine classname initialize test security param class name class name public static void init string class name if s engine null s engine new secure engine class name else if class name null class name equals get class name string msg requested security class class name is not the same as the active class get class name n make sure to set the security class in the start script log severe msg system err println msg system exit 10 classname classname s_engine s_engine secureengine classname classname classname getclassname classname getclassname nmake get class name return class name public static string get class name if s engine null return null return s engine implementation get class get name getclassname s_engine s_engine getclass getname convert string to digest java script version see http pajhome org uk crypt md5 index html param value message return hex string of message length 32 characters public static string get digest string value if s engine null init system get properties return s engine implementation get digest value javascript hexstring getdigest s_engine getproperties s_engine getdigest encryption the methods must recognize clear text values param value clear value return encrypted string public static string encrypt string value if value null value length 0 return value if s engine null init system get properties boolean in quotes value starts with value ends with if in quotes value value substring 1 value length 1 string ret value s engine implementation encrypt value if in quotes return ret value return ret value s_engine getproperties inquotes startswith endswith inquotes retvalue s_engine inquotes retvalue retvalue decryption the methods must recognize clear text values param value encrypted value return decrypted string public static string decrypt string value if value null return null if s engine null init system get properties boolean in quotes value starts with value ends with if in quotes value value substring 1 value length 1 string ret value null if value starts with secure interface clearvalue start value ends with secure interface clearvalue end ret value value substring secure interface clearvalue start length value length secure interface clearvalue end length else ret value s engine implementation decrypt value if in quotes return ret value return ret value s_engine getproperties inquotes startswith endswith inquotes retvalue startswith secureinterface clearvalue_start endswith secureinterface clearvalue_end retvalue secureinterface clearvalue_start secureinterface clearvalue_end retvalue s_engine inquotes retvalue retvalue encryption the methods must recognize clear values param value clear value return encrypted string public static object encrypt object value return value decryption the methods must recognize clear values param value encrypted value return decrypted string public static object decrypt object value return value secure engine constructor param class name class name if null defaults to org compiere util secure private secure engine string class name string real class class name if real class null real class length 0 real class secure interface compiere secure default exception cause null try class clazz class for name real class implementation secure interface clazz new instance catch exception e cause e if implementation null string msg could not initialize real class cause to string n check start script parameter compiere secure log severe msg system err println msg system exit 10 see if it works string teste implementation encrypt test string testc implementation decrypt teste if testc equals test throw new illegal state exception real class test teste testc log config real class initialized implementation secureengine classname secureengine classname realclass classname realclass realclass realclass secureinterface compiere_secure_default forname realclass secureinterface newinstance realclass tostring ncheck compiere_secure illegalstateexception realclass realclass test output param test test value param should target value return info private static string test object test object should string buffer sb new string buffer sb append test if test null if should null sb append ok else sb append should append should append error else if test equals should sb append ok else sb append should append should append error return sb to string stringbuffer stringbuffer tostring main param args public static void main string args init system get properties ini test string ini1 secure interface clearvalue start test secure interface clearvalue end log info decrypt clear test test decrypt ini1 test log info decrypt clear test test decrypt ini1 test log info decrypt test decrypt log info decrypt test decrypt log info decrypt null test decrypt null null log info decrypt test test decrypt test test log info decrypt test test decrypt af2309f390afed74 test log info decrypt test test decrypt secure interface encryptedvalue start af2309f390afed74 secure interface encryptedvalue end test log info encrypt test test encrypt test af2309f390afed74 string test string new string this is a test this is a verly long test string 1624 string digest result new string 702edca0b2181c15d457eacac39de39b d41d8cd98f00b204e9800998ecf8427e 934e7c5c6f5508ff50bc425770a10f45 for int i 0 i test string length i string digest string get digest test string i if digest result i equals digest string log info ok digest else log severe digest digest string digest result i log info is digest true is digest digest result 0 log info is digest false is digest 702edca0b2181c15d457eacac39de39j log info is digest false is digest 702e log info convert to hex string new byte byte min value 1 1 byte max value string in 4115da655707807f00ff byte bb convert hex string in string out convert to hex string bb if in equals ignore case out log info ok conversion else log severe conversion error in out string test this is a test string result 28bd14203bcefba1c5eaef976e44f1746dc2facaa9e0623c string test 1 decrypt result if test equals test 1 log info ok dec 1 else log info test dec test 1 test string test enc encrypt test if result equals test enc log info ok enc else log severe test enc test enc result string test dec decrypt test enc if test equals test dec log info ok dec else log info test dec test dec test getproperties secureinterface clearvalue_start secureinterface clearvalue_end secureinterface encryptedvalue_start secureinterface encryptedvalue_end teststring digestresult teststring digeststring getdigest teststring digestresult digeststring digeststring digestresult isdigest isdigest digestresult isdigest isdigest isdigest isdigest converttohexstring min_value max_value converthexstring converttohexstring equalsignorecase test_1 test_1 dec_1 testdec test_1 testenc testenc testenc testenc testdec testenc testdec testdec testdec accounting processor param model model public acct processor m acct processor model super model 30 30 seconds delay m model model m client m client get model get ctx model getad client id acctprocessor macctprocessor m_model m_client mclient getctx getad_client_id work protected void do work m summary new string buffer get schemata if m model getc acctschema id 0 m ass m acct schema get client acct schema get ctx m model getad client id else only specific accounting schema m ass new m acct schema new m acct schema get ctx m model getc acctschema id null post session int no m model delete log m summary append logs deleted append no m acct processor log p log new m acct processor log m model m summary to string p log set reference string value of p runcount time util format elapsed new timestamp p startwork p log save dowork m_summary stringbuffer m_model getc_acctschema_id m_ass macctschema getclientacctschema getctx m_model getad_client_id m_ass macctschema macctschema getctx m_model getc_acctschema_id postsession m_model deletelog m_summary macctprocessorlog plog macctprocessorlog m_model m_summary tostring plog setreference valueof p_runcount timeutil formatelapsed p_startwork plog post session private void post session for int i 0 i doc documents tableid length i int ad table id doc documents tableid i string table name doc documents table name i post only special documents if m model getad table id 0 m model getad table id ad table id continue select id from table string buffer sql new string buffer select from append table name append where ad client id append and processed y and posted n and is active y sql append order by created int count 0 int count error 0 prepared statement pstmt null try pstmt db prepare statement sql to string null pstmt set int 1 m model getad client id result set rs pstmt execute query while is interrupted rs next count boolean ok true try doc doc doc get m ass ad table id rs null if doc null log severe get name no doc for table name ok false else string error doc post false false post no force repost ok error null catch exception e log log level severe get name table name e ok false if ok count error rs close pstmt close pstmt null catch exception e log log level severe sql to string e if pstmt null try pstmt close catch exception e if count 0 m summary append table name append append count if count error 0 m summary append errors append count error append m summary append log finer get name m summary to string else log finer get name table name no work postsession documentstableid ad_table_id documentstableid tablename documentstablename m_model getad_table_id m_model getad_table_id ad_table_id stringbuffer stringbuffer tablename ad_client_id isactive counterror preparedstatement preparestatement tostring setint m_model getad_client_id resultset executequery isinterrupted m_ass ad_table_id getname tablename getname tablename counterror tostring m_summary tablename counterror m_summary counterror m_summary getname m_summary tostring getname tablename get server info return info public string get server info return p runcount last m summary to string getserverinfo p_runcount m_summary tostring standard constructor param ctx context param ad field id id public m field properties ctx int ad field id string trx name super ctx ad field id trx name if ad field id 0 setad tab id 0 parent setad column id 0 set name null set entity type entitytype usermaintained u set is centrally maintained true y set is displayed true y set is encrypted false set is field only false set is heading false set is read only false set is same line false set obscure type obscuretype obscuredigitsbutlast4 ad_field_id m_field ad_field_id trxname ad_field_id trxname ad_field_id setad_tab_id setad_column_id setname setentitytype entitytype_usermaintained setiscentrallymaintained setisdisplayed setisencrypted setisfieldonly setisheading setisreadonly setissameline setobscuretype obscuretype_obscuredigitsbutlast4 load constructor param ctx context param rs result set public m field properties ctx result set rs string trx name super ctx rs trx name m_field resultset trxname trxname parent constructor param parent parent public m field m tab parent this parent get ctx 0 parent get trxname set client org parent setad tab id parent getad tab id m_field m_tab getctx get_trxname setclientorg setad_tab_id getad_tab_id copy constructor param parent parent param from copy from public m field m tab parent m field from this parent get ctx 0 parent get trxname copy values from this set client org parent setad tab id parent getad tab id set entity type parent get entity type m_field m_tab m_field getctx get_trxname copyvalues setclientorg setad_tab_id getad_tab_id setentitytype getentitytype set column values param column column public void set column m column column setad column id column getad column id set name column get name set description column get description set help column get help set display length column get field length set entity type column get entity type setcolumn m_column setad_column_id getad_column_id setname getname setdescription getdescription sethelp gethelp setdisplaylength getfieldlength setentitytype getentitytype get contents return context public object get contents return contents getcontents standard constructor public x b topictype properties ctx int b topictype id string trx name super ctx b topictype id trx name if b topictype id 0 set auction type null setb topictype id 0 setm pricelist id 0 setm productmember id 0 setm product id 0 set name null x_b_topictype b_topictype_id trxname b_topictype_id trxname b_topictype_id setauctiontype setb_topictype_id setm_pricelist_id setm_productmember_id setm_product_id setname load constructor public x b topictype properties ctx result set rs string trx name super ctx rs trx name x_b_topictype resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b topictype append get id append return sb to string tostring stringbuffer stringbuffer x_b_topictype get_id tostring set auction type public void set auction type string auction type if auction type null throw new illegal argument exception auction type is mandatory if auction type length 1 log warning length 1 truncated auction type auction type substring 0 0 set value auction type auction type setauctiontype auctiontype auctiontype illegalargumentexception auctiontype auctiontype auctiontype auctiontype set_value auctiontype auctiontype get auction type public string get auction type return string get value auction type getauctiontype get_value auctiontype set topic type auction topic type public void setb topictype id int b topictype id if b topictype id 1 throw new illegal argument exception b topictype id is mandatory set valuenocheck b topictype id new integer b topictype id setb_topictype_id b_topictype_id b_topictype_id illegalargumentexception b_topictype_id set_valuenocheck b_topictype_id b_topictype_id get topic type auction topic type public int getb topictype id integer ii integer get value b topictype id if ii null return 0 return ii int value getb_topictype_id get_value b_topictype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue public static final int m productmember id ad reference id 162 set membership product used to deternine the price of the membership for the topic type public void setm productmember id int m productmember id if m productmember id 1 throw new illegal argument exception m productmember id is mandatory set value m productmember id new integer m productmember id m_productmember_id_ad_reference_id setm_productmember_id m_productmember_id m_productmember_id illegalargumentexception m_productmember_id set_value m_productmember_id m_productmember_id get membership product used to deternine the price of the membership for the topic type public int getm productmember id integer ii integer get value m productmember id if ii null return 0 return ii int value getm_productmember_id get_value m_productmember_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname image editor param window no public v image int window no super m windowno window no super add action listener this windowno vimage windowno m_windowno windowno addactionlistener dispose public void dispose m mimage null m_mimage set value param value public void set value object value log config value int new value 0 if value null value instanceof integer new value integer value int value get create image if m mimage null new value m mimage get id m mimage new m image env get ctx new value null log fine m mimage to string super set icon m mimage get image super set tool tip text m mimage get name setvalue newvalue newvalue intvalue m_mimage newvalue m_mimage get_id m_mimage mimage getctx newvalue m_mimage tostring seticon m_mimage getimage settooltiptext m_mimage getname get value return value public object get value if m mimage get id 0 return null return new integer m mimage get id getvalue m_mimage get_id m_mimage get_id get display value return image name public string get display return m mimage get name getdisplay m_mimage getname set read write param rw public void set read write boolean rw if is enabled rw set enabled rw readwrite setreadwrite isenabled setenabled get read write return true if rw public boolean is read write return super is enabled readwrite isreadwrite isenabled set mandatory param mandatory public void set mandatory boolean mandatory m mandatory mandatory setmandatory m_mandatory get mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set background nop param color public void set background color color setbackground set background nop public void set background setbackground set background nop param error public void set background boolean error setbackground property change param evt public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue action listener start dialog and set value param e public void action performed action event e v image dialog vid new v image dialog env get window m windowno m mimage vid set visible true m mimage is updated integer value null if m mimage get id 0 value new integer m mimage get id try fire vetoable change column name null value catch property veto exception pve actionlistener actionperformed actionevent vimagedialog vimagedialog getwindow m_windowno m_mimage setvisible m_mimage m_mimage get_id m_mimage get_id firevetoablechange column_name propertyvetoexception set field window no for value preference nop param m field public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield wf content panel public wf content panel wf panel parent super new wf layout manager m parent parent set border border factory create empty border 5 5 5 5 set background color red set background new color 236 236 236 set opaque false m newpopupmenu add m newmenunode m newmenunode add action listener this wfcontentpanel wfcontentpanel wfpanel wflayoutmanager m_parent setborder borderfactory createemptyborder setbackground setbackground setopaque m_newpopupmenu m_newmenunode m_newmenunode addactionlistener set read write param read write read write public void set read write boolean read write m readwrite read write if m readwrite add mouse listener this else remove mouse listener this readwrite setreadwrite readwrite m_readwrite readwrite m_readwrite addmouselistener removemouselistener set workflow param wf workflow public void set workflow m workflow wf m wf wf setworkflow mworkflow m_wf remove all and their listeners public void remove all m nodes clear m lines clear component components get components for int i 0 i components length i component component components i component remove mouse listener this component remove mouse motion listener this super remove all removeall m_nodes m_lines getcomponents removemouselistener removemousemotionlistener removeall add component and add mouse listener param comp component param rw read write return component public component add component comp boolean rw line if comp instanceof wf line m lines add wf line comp return comp node if comp instanceof wf node m nodes add wf node comp comp add mouse listener this if m readwrite rw can be moved comp add mouse motion listener this return super add comp wfline m_lines wfline wfnode m_nodes wfnode addmouselistener m_readwrite addmousemotionlistener create lines called by wf layout manager protected void create lines log fine lines m lines size for int i 0 i m lines size i wf line line wf line m lines get i rectangle from find bounds line getad wf node id rectangle to find bounds line getad wf next id line set from to from to same bounds as parent line set bounds 0 0 width height for all lines createlines m_lines m_lines wfline wfline m_lines findbounds getad_wf_node_id findbounds getad_wf_next_id setfromto setbounds get bounds of wf node icon param ad wf node id node id return bounds of node with id or null private rectangle find bounds int ad wf node id for int i 0 i m nodes size i wf node node wf node m nodes get i if node getad wf node id ad wf node id return node get bounds return null ad_wf_node_id findbounds ad_wf_node_id m_nodes wfnode wfnode m_nodes getad_wf_node_id ad_wf_node_id getbounds get component at point param p point return node ignore lines public component get component at point p return get component at p x p y getcomponentat getcomponentat get node at x y param x x param y y return node ignore lines public component get component at int x int y component comp super get component at x y if comp instanceof wf node return comp for int i 0 i m nodes size i wf node node wf node m nodes get i int xx x node getx int yy y node gety if node contains xx yy return node return comp getcomponentat getcomponentat wfnode m_nodes wfnode wfnode m_nodes mouse clicked pressed released clicked param e event public void mouse clicked mouse event e if m readwrite swing utilities is right mouse button e int ad client id env getad client id env get ctx if e get source this m wf null m newpopupmenu show this e getx e gety else if e get source instanceof wf node mwf node node wf node e get source get model m linepopupmenu new j popup menu node get name if node getad client id ad client id string title msg get msg env get ctx delete node node get name add menu item m linepopupmenu title node 1 m linepopupmenu add separator mwf node nodes m wf get nodes true ad client id mwf node next lines node get transitions ad client id add new line for int n 0 n nodes length n mwf node nn nodes n if nn getad wf node id node getad wf node id continue same boolean found false for int i 0 i lines length i mwf node next line lines i if nn getad wf node id line getad wf next id found true break if found string title msg get msg env get ctx add line node get name nn get name add menu item m linepopupmenu title node nn getad wf node id m linepopupmenu add separator delete lines for int i 0 i lines length i mwf node next line lines i if line getad client id ad client id continue mwf node next mwf node get env get ctx line getad wf next id string title msg get msg env get ctx delete line node get name next get name add menu item m linepopupmenu title line m linepopupmenu show this e getx e gety selection else if e get source instanceof wf node wf node selected wf node e get source log fine selected to string for int i 0 i m nodes size i wf node node wf node m nodes get i if selected getad wf node id node getad wf node id node set selected true else node set selected false m dragged false mouseclicked mouseevent m_readwrite swingutilities isrightmousebutton ad_client_id getad_client_id getctx getsource m_wf m_newpopupmenu getsource wfnode mwfnode wfnode getsource getmodel m_linepopupmenu jpopupmenu getname getad_client_id ad_client_id getmsg getctx deletenode getname addmenuitem m_linepopupmenu m_linepopupmenu addseparator mwfnode m_wf getnodes ad_client_id mwfnodenext gettransitions ad_client_id mwfnode getad_wf_node_id getad_wf_node_id mwfnodenext getad_wf_node_id getad_wf_next_id getmsg getctx addline getname getname addmenuitem m_linepopupmenu getad_wf_node_id m_linepopupmenu addseparator mwfnodenext getad_client_id ad_client_id mwfnode mwfnode getctx getad_wf_next_id getmsg getctx deleteline getname getname addmenuitem m_linepopupmenu m_linepopupmenu getsource wfnode wfnode wfnode getsource tostring m_nodes wfnode wfnode m_nodes getad_wf_node_id getad_wf_node_id setselected setselected m_dragged mouse entered param e event public void mouse entered mouse event e mouseentered mouseevent mouse exited param e event public void mouse exited mouse event e mouseexited mouseevent mouse pressed initial drag param e event public void mouse pressed mouse event e if e get source instanceof wf node wf node node wf node e get source if node is editable m draggednode node m draggedstart swing utilities convert point m draggednode e getx e gety this else m dragged false m draggednode null m draggedstart null mousepressed mouseevent getsource wfnode wfnode wfnode getsource iseditable m_draggednode m_draggedstart swingutilities convertpoint m_draggednode m_dragged m_draggednode m_draggedstart mouse dragged param e event public void mouse dragged mouse event e nothing selected if m draggednode null e get source m draggednode if e get source instanceof wf node wf node node wf node e get source if node is editable m draggednode node m draggedstart null move node if m draggednode null m dragged true if m draggedstart null m draggedstart swing utilities convert point m draggednode e getx e gety this if not converted to coordinate system of parent it gets jumpy point mouse position swing utilities convert point m draggednode e getx e gety this int x delta mouse position x m draggedstart x int y delta mouse position y m draggedstart y point new location m draggednode get location new location x x delta if new location x 0 new location x 0 new location y y delta if new location y 0 new location y 0 m draggednode set location new location x new location y log fine mouse dragged m draggednode e log fine mouse dragged delta x delta y delta m draggedstart mouse position invalidate validate repaint mousedragged mouseevent m_draggednode getsource m_draggednode getsource wfnode wfnode wfnode getsource iseditable m_draggednode m_draggedstart m_draggednode m_dragged m_draggedstart m_draggedstart swingutilities convertpoint m_draggednode mouseposition swingutilities convertpoint m_draggednode xdelta mouseposition m_draggedstart ydelta mouseposition m_draggedstart newlocation m_draggednode getlocation newlocation xdelta newlocation newlocation newlocation ydelta newlocation newlocation m_draggednode setlocation newlocation newlocation mousedragged m_draggednode mousedragged xdelta ydelta m_draggedstart mouseposition mouse released finals dragging param e event public void mouse released mouse event e log fine mouse released m draggednode m dragged false m draggednode null m draggedstart null repaint mousereleased mouseevent mousereleased m_draggednode m_dragged m_draggednode m_draggedstart mouse moved param e event public void mouse moved mouse event e mousemoved mouseevent paint component paint lines directly as not added param g graphics protected void paint component graphics g super paint component g paint lines for int i 0 i m lines size i wf line line wf line m lines get i line paint g paint position right next to the box if m dragged m draggednode null point loc m draggednode get location string text loc x loc y graphics2d g2d graphics2d g font font new font dialog font plain 10 g2d set color color magenta text layout layout new text layout text font g2d get font render context loc x m draggednode get width loc y layout get ascent layout draw g2d loc x loc y paintcomponent paintcomponent m_lines wfline wfline m_lines m_dragged m_draggednode m_draggednode getlocation setcolor textlayout textlayout getfontrendercontext m_draggednode getwidth getascent add menu item to add new line to node param menu base menu param title title private void add menu item j popup menu menu string title mwf node node int ad wf nodeto id wf popup item item new wf popup item title node ad wf nodeto id menu add item item add action listener this addmenuitem jpopupmenu mwfnode ad_wf_nodeto_id wfpopupitem wfpopupitem ad_wf_nodeto_id addactionlistener add menu item to delete line param menu base menu param title title private void add menu item j popup menu menu string title mwf node next line wf popup item item new wf popup item title line menu add item item add action listener this addmenuitem jpopupmenu mwfnodenext wfpopupitem wfpopupitem addactionlistener action listener param e event public void action performed action event e log info e to string add new node if e get source m newmenunode log info create new node string name j option pane show input dialog this msg get msg env get ctx name message msg get msg env get ctx create new node title j option pane question message if name null name length 0 int ad client id env getad client id env get ctx mwf node node new mwf node m wf name name node set client org ad client id 0 node save m parent load m wf getad workflow id true add delete line else if e get source instanceof wf popup item wf popup item item wf popup item e get source item execute actionperformed actionevent tostring getsource m_newmenunode joptionpane showinputdialog getmsg getctx getmsg getctx createnewnode joptionpane question_message ad_client_id getad_client_id getctx mwfnode mwfnode m_wf setclientorg ad_client_id m_parent m_wf getad_workflow_id getsource wfpopupitem wfpopupitem wfpopupitem getsource add line item param title title param node node param ad wf nodeto id line to public wf popup item string title mwf node node int ad wf nodeto id super title m node node m ad wf nodeto id ad wf nodeto id ad_wf_nodeto_id wfpopupitem mwfnode ad_wf_nodeto_id m_node m_ad_wf_nodeto_id ad_wf_nodeto_id delete line item param title title param line line to be deleted public wf popup item string title mwf node next line super title m line line wfpopupitem mwfnodenext m_line execute public void execute add line if m node null m ad wf nodeto id 0 int ad client id env getad client id env get ctx mwf node next new line new mwf node next m node m ad wf nodeto id new line set client org ad client id 0 new line save log info add line to m node new line m parent load m wf getad workflow id true delete node else if m node null m ad wf nodeto id 1 log info delete node m node m node delete false m parent load m wf getad workflow id true delete line else if m line null log info delete line m line m line delete false m parent load m wf getad workflow id true else log severe no action m_node m_ad_wf_nodeto_id ad_client_id getad_client_id getctx mwfnodenext newline mwfnodenext m_node m_ad_wf_nodeto_id newline setclientorg ad_client_id newline m_node newline m_parent m_wf getad_workflow_id m_node m_ad_wf_nodeto_id m_node m_node m_parent m_wf getad_workflow_id m_line m_line m_line m_parent m_wf getad_workflow_id standard constructor public x m movement properties ctx int m movement id string trx name super ctx m movement id trx name if m movement id 0 setc doctype id 0 set doc action null co set doc status null dr set document no null set is approved false set is in transit false setm movement id 0 set movement date new timestamp system current time millis date set posted false set processed false x_m_movement m_movement_id trxname m_movement_id trxname m_movement_id setc_doctype_id setdocaction setdocstatus setdocumentno setisapproved setisintransit setm_movement_id setmovementdate currenttimemillis setposted setprocessed load constructor public x m movement properties ctx result set rs string trx name super ctx rs trx name x_m_movement resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m movement append get id append return sb to string tostring stringbuffer stringbuffer x_m_movement get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set approval amount document approval amount public void set approval amt big decimal approval amt set value approval amt approval amt setapprovalamt bigdecimal approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set date received date a product was received public void set date received timestamp date received set value date received date received setdatereceived datereceived set_value datereceived datereceived get date received date a product was received public timestamp get date received return timestamp get value date received getdatereceived get_value datereceived set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set in transit movement is in transit public void set is in transit boolean is in transit set value is in transit new boolean is in transit setisintransit isintransit set_value isintransit isintransit get in transit movement is in transit public boolean is in transit object oo get value is in transit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isintransit get_value isintransit booleanvalue set inventory move movement of inventory public void setm movement id int m movement id if m movement id 1 throw new illegal argument exception m movement id is mandatory set valuenocheck m movement id new integer m movement id setm_movement_id m_movement_id m_movement_id illegalargumentexception m_movement_id set_valuenocheck m_movement_id m_movement_id get inventory move movement of inventory public int getm movement id integer ii integer get value m movement id if ii null return 0 return ii int value getm_movement_id get_value m_movement_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue standard constructor param ctx context param ad impformat row id id public m imp format row properties ctx int ad impformat row id string trx name super ctx ad impformat row id trx name if ad impformat row id 0 setad impformat id 0 parent setad column id 0 set data type null set name null set seq no 10 set decimal point set divide by100 false ad_impformat_row_id mimpformatrow ad_impformat_row_id trxname ad_impformat_row_id trxname ad_impformat_row_id setad_impformat_id setad_column_id setdatatype setname setseqno setdecimalpoint setdivideby100 load construcor param ctx context param rs result set public m imp format row properties ctx result set rs string trx name super ctx rs trx name mimpformatrow resultset trxname trxname parent construcor param format format parent public m imp format row m imp format format this format get ctx 0 format get trxname setad impformat id format getad impformat id mimpformatrow mimpformat getctx get_trxname setad_impformat_id getad_impformat_id parent copy construcor param parent format parent param original to copy public m imp format row m imp format parent m imp format row original this parent get ctx 0 parent get trxname copy values original this set client org parent setad impformat id parent getad impformat id mimpformatrow mimpformat mimpformatrow getctx get_trxname copyvalues setclientorg setad_impformat_id getad_impformat_id generate po class param ad table id table id param directory directory with or at the end param package name package name public generate model int ad table id string directory string package name create column access methods string buffer mandatory new string buffer string buffer sb create columns ad table id mandatory add header stuff string table name create header ad table id sb mandatory package name save it write to file sb directory table name java ad_table_id packagename generatemodel ad_table_id packagename stringbuffer stringbuffer stringbuffer createcolumns ad_table_id tablename createheader ad_table_id packagename writetofile tablename add header info to buffer param ad table id table param sb buffer param mandatory init call for mandatory columns param package name package name return class name private string create header int ad table id string buffer sb string buffer mandatory string package name string table name int access level 0 string sql select table name access level from ad table where ad table id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query if rs next table name rs get string 1 access level rs get int 2 rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null if table name null throw new runtime exception table name not found for id ad table id string access level info access level if access level 4 access level info system if access level 2 access level 3 access level 6 access level 7 access level info client if access level 1 access level 3 access level 5 access level 7 access level info org string key column table name id string class name x table name string buffer start new string buffer append generated model do not change copyright c 1999 2005 jorg janke n package package name if package name equals org compiere model start append import org compiere model start append import java util import java sql import java math import org compiere util class generated model for append table name append n author jorg janke generated n version append compiere main version append append s run append n public class append class name append extends po standard constructor standard constructor n public append class name append properties ctx int append key column append string trx name super ctx append key column append trx name if append key column append 0 append mandatory append n constructor end short constructor short constructor n public append class name append properties ctx int append key column append this ctx append key column append null constructor end load constructor load constructor n public append class name append properties ctx result set rs string trx name super ctx rs trx name load constructor end ad table id append ad table id append n public static final int table id append ad table id append n table name append table name append n public static final string table name append table name append n protected static key name pair model new key name pair append ad table id append append table name append n protected big decimal access level new big decimal append access level append access level append access level info append n protected int get accesslevel return access level int value load meta data n protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi initpo public string to string string buffer sb new string buffer append class name append append get id append return sb to string string buffer end new string buffer sb insert 0 start sb append end return class name ad_table_id packagename createheader ad_table_id stringbuffer stringbuffer packagename tablename accesslevel tablename accesslevel ad_table ad_table_id preparedstatement preparestatement setint ad_table_id resultset executequery tablename getstring accesslevel getint tablename runtimeexception tablename ad_table_id accesslevelinfo accesslevel accesslevel accesslevelinfo accesslevel accesslevel accesslevel accesslevel accesslevelinfo accesslevel accesslevel accesslevel accesslevel accesslevelinfo keycolumn tablename _id classname x_ tablename stringbuffer stringbuffer packagename packagename tablename main_version s_run classname classname keycolumn trxname keycolumn trxname keycolumn classname keycolumn keycolumn classname resultset trxname trxname ad_table_id ad_table_id table_id ad_table_id tablename tablename table_name tablename keynamepair keynamepair ad_table_id tablename bigdecimal accesslevel bigdecimal accesslevel accesslevel accesslevelinfo get_accesslevel accesslevel intvalue poinfo poinfo poinfo getpoinfo table_id tostring stringbuffer stringbuffer classname get_id tostring stringbuffer stringbuffer classname create column access methods param ad table id table param mandatory init call for mandatory columns return set get method private string buffer create columns int ad table id string buffer mandatory string buffer sb new string buffer string sql select c column name c is updateable c is mandatory 1 3 c ad reference id c ad reference value id default value seq no 4 7 c field length c value min c value max c v format c callout 8 12 c name c description c columnsql c is encrypted from ad column c where c ad table id and c is active y and c column name ad client id and c column name ad org id and c column name is active and c column name not like created and c column name not like updated order by c column name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query while rs next string column name rs get string 1 boolean is updateable y equals rs get string 2 boolean is mandatory y equals rs get string 3 int display type rs get int 4 int ad reference value id rs get int 5 string default value rs get string 6 int seq no rs get int 7 int field length rs get int 8 string value min rs get string 9 string value max rs get string 10 string v format rs get string 11 string callout rs get string 12 string name rs get string 13 string description rs get string 14 string columnsql rs get string 15 boolean virtual column columnsql null columnsql length 0 boolean is encrypted y equals rs get string 16 sb append create column methods mandatory column name is updateable is mandatory display type ad reference value id field length default value value min value max v format callout name description virtual column is encrypted if seq no 1 sb append create key name pair column name display type rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null return sb ad_table_id stringbuffer createcolumns ad_table_id stringbuffer stringbuffer stringbuffer columnname isupdateable ismandatory ad_reference_id ad_reference_value_id defaultvalue seqno fieldlength valuemin valuemax vformat isencrypted ad_column ad_table_id isactive columnname ad_client_id columnname ad_org_id columnname isactive columnname columnname columnname preparedstatement preparestatement setint ad_table_id resultset executequery columnname getstring isupdateable getstring ismandatory getstring displaytype getint ad_reference_value_id getint defaultvalue getstring seqno getint fieldlength getint valuemin getstring valuemax getstring vformat getstring getstring getstring getstring getstring virtualcolumn isencrypted getstring createcolumnmethods columnname isupdateable ismandatory displaytype ad_reference_value_id fieldlength defaultvalue valuemin valuemax vformat virtualcolumn isencrypted seqno createkeynamepair columnname displaytype create set get methods for column param mandatory init call for mandatory columns param column name column name param is updateable updateable param is mandatory mandatory param display type display type param ad reference id validation reference param field length int param default value default value param value min string param value max string param v format string param callout string param name string param description string param virtual column virtual column param is encrypted stored encrypted return set get method private string create column methods string buffer mandatory string column name boolean is updateable boolean is mandatory int display type int ad reference id int field length string default value string value min string value max string v format string callout string name string description boolean virtual column boolean is encrypted class clazz display type get class display type true if default value null default value handle posted if column name equals ignore case posted column name equals ignore case processed column name equals ignore case processing clazz boolean class ad reference id 0 record id else if column name equals ignore case record id clazz integer class ad reference id 0 string key else if column name equals ignore case ad language clazz string class data type string data type clazz get name data type data type substring data type last index of 1 if data type equals boolean data type boolean else if data type equals integer data type int else if display type display type binary display type display type image data type byte string buffer sb new string buffer set comment sb append set append name if description null description length 0 sb append n append description sb append n set string set value set value if is encrypted set value set valuee public void set column xxx variable sb append public if is updateable set value set valuenocheck if is encrypted set value set valuenochecke sb append void set append column name append append data type append append column name append list validation if ad reference id 0 string static var add list validation sb ad reference id column name is mandatory sb insert 0 static var first check set value column name xx if virtual column sb append throw new illegal argument exception append column name append is virtual column else if clazz equals integer class if column name ends with id if is mandatory check mandatory id int firstok 1 valid id 0 if column name equals ad client id column name equals ad org id column name equals record id column name equals c doctype id column name equals node id column name equals ad role id column name equals m attributeset id column name equals m attributesetinstance id firstok 0 sb append if append column name append append firstok append throw new illegal argument exception append column name append is mandatory else set optional id to null if 0 sb append if append column name append 0 append set value append append column name append null else n sb append set value append append column name append new integer append column name append else if clazz equals boolean class sb append set value append append column name append new boolean append column name append else if is mandatory ad reference id 0 does not apply to int boolean sb append if append column name append null throw new illegal argument exception append column name append is mandatory string length check if clazz equals string class field length 0 sb append if if is mandatory sb append column name append null sb append column name append length append field length append log warning length append field length append truncated append column name append append column name append substring 0 append field length 1 append sb append set value append append column name append append column name append sb append mandatory call in constructor if is mandatory mandatory append set append column name append if clazz equals integer class mandatory append 0 else if clazz equals boolean class if default value index of y 1 mandatory append true else mandatory append false else if clazz equals big decimal class mandatory append env zero else if clazz equals timestamp class mandatory append new timestamp system current time millis else mandatory append null mandatory append if default value length 0 mandatory append append default value append env nl get comment sb append get append name if description null description length 0 sb append n append description sb append n get string get value get value if is encrypted get value get valuee sb append public append data type if clazz equals boolean class sb append is if column name to lower case starts with is sb append column name substring 2 else sb append column name else sb append get append column name sb append if clazz equals integer class sb append integer ii integer append get value append append column name append if ii null return 0 return ii int value else if clazz equals big decimal class sb append big decimal bd big decimal append get value append append column name append if bd null return env zero return bd else if clazz equals boolean class sb append object oo append get value append append column name append if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false else if data type equals object sb append return append get value append append column name append else sb append return append data type append append get value append append column name append sb append return sb to string columnname isupdateable ismandatory displaytype ad_reference_id fieldlength defaultvalue valuemin valuemax vformat virtualcolumn isencrypted createcolumnmethods stringbuffer columnname isupdateable ismandatory displaytype ad_reference_id fieldlength defaultvalue valuemin valuemax vformat virtualcolumn isencrypted displaytype getclass displaytype defaultvalue defaultvalue columnname equalsignorecase columnname equalsignorecase columnname equalsignorecase ad_reference_id record_id columnname equalsignorecase record_id ad_reference_id columnname equalsignorecase ad_language datatype getname datatype datatype datatype lastindexof datatype datatype datatype datatype displaytype displaytype displaytype displaytype datatype stringbuffer stringbuffer setvalue set_value isencrypted setvalue set_valuee setcolumn isupdateable setvalue set_valuenocheck isencrypted setvalue set_valuenochecke columnname datatype columnname ad_reference_id staticvar addlistvalidation ad_reference_id columnname ismandatory staticvar setvalue columnname virtualcolumn illegalargumentexception columnname columnname endswith _id ismandatory columnname ad_client_id columnname ad_org_id columnname record_id columnname c_doctype_id columnname node_id columnname ad_role_id columnname m_attributeset_id columnname m_attributesetinstance_id columnname illegalargumentexception columnname _id columnname setvalue columnname setvalue columnname columnname setvalue columnname columnname ismandatory ad_reference_id columnname illegalargumentexception columnname fieldlength ismandatory columnname columnname fieldlength fieldlength columnname columnname fieldlength setvalue columnname columnname ismandatory columnname defaultvalue indexof bigdecimal currenttimemillis defaultvalue defaultvalue getvalue get_value isencrypted getvalue get_valuee datatype columnname tolowercase startswith columnname columnname columnname getvalue columnname intvalue bigdecimal bigdecimal bigdecimal getvalue columnname getvalue columnname booleanvalue datatype getvalue columnname datatype getvalue columnname tostring add list validation param sb buffer example if next action equals n next action equals f else throw new illegal argument exception next action invalid value reference id 219 n f param ad reference id reference param column name column param nullable the validation must allow null values return static parameter example public static final int nextaction ad reference id 219 public static final string nextaction none n public static final string nextaction followup f private string add list validation string buffer sb int ad reference id string column name boolean nullable string buffer ret value new string buffer ret value append n append column name append ad reference id append ad reference id append n append public static final int append column name to upper case append ad reference id append ad reference id append boolean found false string buffer values new string buffer reference id append ad reference id string buffer statement new string buffer if nullable statement append if append column name append null string sql select value name from ad ref list where ad reference id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad reference id result set rs pstmt execute query while rs next string value rs get string 1 values append append value if statement length 0 statement append if append column name append equals append value append else statement append append column name append equals append value append if found found true sb append if append column name append null throw new illegal argument exception append column name append is mandatory name small talk notation string name rs get string 2 char name array name to char array string buffer name clean new string buffer boolean init cap true for int i 0 i name array length i char c name array i if character is java identifier part c if init cap name clean append character to upper case c else name clean append c init cap false else if c name clean append plus else if c name clean append else if c if name index of 1 ignore xx name clean append gt else if c if name index of 1 ignore xx name clean append le else if c name clean append not else if c name clean append eq else if c name clean append like init cap true ret value append append name append append value append n ret value append public static final string append column name to upper case append append name clean append append value append rs close pstmt close pstmt null catch exception e log log level severe sql e found false finally try if pstmt null pstmt close catch exception e pstmt null statement append else throw new illegal argument exception append column name append invalid value append column name append append values append if found column name equals entity type sb append statement return ret value to string nextaction nextaction illegalargumentexception nextaction reference_id ad_reference_id columnname nextaction_ad_reference_id nextaction_none nextaction_followup addlistvalidation stringbuffer ad_reference_id columnname stringbuffer retvalue stringbuffer retvalue columnname ad_reference_id ad_reference_id columnname touppercase _ad_reference_id ad_reference_id stringbuffer stringbuffer reference_id ad_reference_id stringbuffer stringbuffer columnname ad_ref_list ad_reference_id preparedstatement preparestatement setint ad_reference_id resultset executequery getstring columnname columnname columnname illegalargumentexception columnname smalltalknotation getstring namearray tochararray stringbuffer nameclean stringbuffer initcap namearray namearray isjavaidentifierpart initcap nameclean touppercase nameclean initcap nameclean nameclean _ indexof nameclean indexof nameclean nameclean nameclean nameclean initcap retvalue retvalue columnname touppercase _ nameclean illegalargumentexception columnname columnname columnname entitytype retvalue tostring create get key name pair method with first identifier param column name name param display type int return method code private string buffer create key name pair string column name int display type string method get column name if display type display type string method string value of method string buffer sb new string buffer public key name pair get key name pair return new key name pair get id append method append return sb getkeynamepair columnname displaytype stringbuffer createkeynamepair columnname displaytype columnname displaytype displaytype valueof stringbuffer stringbuffer keynamepair getkeynamepair keynamepair get_id write to file param sb string buffer param file name file name private void write to file string buffer sb string file name try file out new file file name file writer fw new file writer out for int i 0 i sb length i char c sb char at i after if c c fw write c if sb substring i 1 starts with fw write t else fw write env nl before after else if c fw write env nl fw write c fw write env nl else fw write c fw flush fw close float size out length size 1024 log info out get absolute path size kb catch exception ex log log level severe file name ex filename writetofile stringbuffer filename filename filewriter filewriter charat startswith getabsolutepath filename string representation return string representation public string to string string buffer sb new string buffer generate model append return sb to string tostring stringbuffer stringbuffer generatemodel tostring generate po model class pre example java generate model class mydirectory my package u a would generate entity type user and application classes into mydirectory without parameters the default is used c compiere compiere all extend src compiere model compiere model u a pre param args directory package entity type directory where to save the generated file package of the classes to be generated entity type to be generated public static void main string args org compiere compiere startup environment true c log mgt set level level fine c log mgt set level level all log info generate model revision 1 52 log info first parameter string directory c compiere compiere all extend src compiere model if args length 0 directory args 0 if directory null directory length 0 system err println no directory system exit 1 log info directory directory second parameter string package name compiere model if args length 1 package name args 1 if package name null package name length 0 system err println no package system exit 1 log info package package name third parameter string entity type u a user application if args length 2 entity type args 2 if entity type null entity type length 0 system err println no entity type system exit 1 string buffer sql new string buffer entity type in append entity type append log info sql to string log info complete sql sql insert 0 select ad table id from ad table where table name in rv warehouseprice rv bpartner special views or is view n and table name not like trl and sql append order by table name int count 0 prepared statement pstmt null try pstmt db prepare statement sql to string null result set rs pstmt execute query while rs next new generate model rs get int 1 directory package name count rs close pstmt close pstmt null catch exception e log severe main e finally try if pstmt null pstmt close catch exception e pstmt null log info generated count generatemodel mypackage entitytype entitytype startupenvironment clogmgt setlevel clogmgt setlevel packagename packagename packagename packagename packagename entitytype entitytype entitytype entitytype entitytype stringbuffer stringbuffer entitytype entitytype tostring ad_table_id ad_table tablename rv_warehouseprice rv_bpartner isview tablename _trl tablename preparedstatement preparestatement tostring resultset executequery generatemodel getint packagename constructor param pos panel pos panel public sub lines pos panel pos panel super pos panel pospanel sublines pospanel pospanel pospanel initialize public void init title titled border border new titled border msg translate env get ctx c orderline id set border border content set layout new border layout 5 5 m table new mini table c scroll pane scroll new c scroll pane m table m sql m table prepare table s layout s sqlfrom s sqlwhere false c order linetax v order by line m table set row selection allowed true m table set column selection allowed false m table set multi selection false m table add mouse listener this m table get selection model add list selection listener this scroll set preferred size new dimension 100 100 add scroll border layout center right side c panel right new c panel add right border layout east right set layout new box layout right box layout y axis right add box create glue f up create button action previous key stroke get key stroke key event vk up 0 right add f up right add box create glue f delete create button action delete key stroke get key stroke key event vk delete event shift mask right add f delete right add box create glue f down create button action next key stroke get key stroke key event vk down 0 right add f down right add box create glue summary flow layout summary layout new flow layout flow layout leading 2 0 c panel summary new c panel summary layout add summary border layout south c label l net new c label msg translate env get ctx total lines summary add l net f net new v number total lines false true false display type amount total lines f net set columns 6 22 l net set label for f net summary add f net f net set value env zero c label l tax new c label msg translate env get ctx tax amt summary add l tax f tax new v number tax amt false true false display type amount tax amt f tax set columns 6 22 l tax set label for f tax summary add f tax f tax set value env zero c label l total new c label msg translate env get ctx grand total summary add l total f total new v number grand total false true false display type amount grand total f total set columns 6 22 l total set label for f total summary add f total f total set value env zero f delete set read write false titledborder titledborder getctx c_orderline_id setborder setlayout borderlayout m_table minitable cscrollpane cscrollpane m_table m_sql m_table preparetable s_layout s_sqlfrom s_sqlwhere c_order_linetax_v m_table setrowselectionallowed m_table setcolumnselectionallowed m_table setmultiselection m_table addmouselistener m_table getselectionmodel addlistselectionlistener setpreferredsize borderlayout cpanel cpanel borderlayout setlayout boxlayout boxlayout y_axis createglue f_up createbuttonaction keystroke getkeystroke keyevent vk_up f_up createglue f_delete createbuttonaction keystroke getkeystroke keyevent vk_delete shift_mask f_delete createglue f_down createbuttonaction keystroke getkeystroke keyevent vk_down f_down createglue flowlayout summarylayout flowlayout flowlayout cpanel cpanel summarylayout borderlayout clabel lnet clabel getctx totallines lnet f_net vnumber totallines displaytype totallines f_net setcolumns lnet setlabelfor f_net f_net f_net setvalue clabel ltax clabel getctx taxamt ltax f_tax vnumber taxamt displaytype taxamt f_tax setcolumns ltax setlabelfor f_tax f_tax f_tax setvalue clabel ltotal clabel getctx grandtotal ltotal f_total vnumber grandtotal displaytype grandtotal f_total setcolumns ltotal setlabelfor f_total f_total f_total setvalue f_delete setreadwrite get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy 2 gbc weightx 0 7 gbc weighty 0 7 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub all lines action performed action if previous equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row 0 row 0 m table get selection model set selection interval row row f delete set read write true else if next equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row rows row rows 1 m table get selection model set selection interval row row f delete set read write true delete else if action equals delete actionperformed actionevent getactioncommand possuballlines actionperformed equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval f_delete setreadwrite equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval f_delete setreadwrite update table param order order public void update table m order order int c order id 0 if order null c order id order getc order id if c order id 0 m table load table new po 0 set sums order prepared statement pstmt null try pstmt db prepare statement m sql null pstmt set int 1 c order id result set rs pstmt execute query m table load table rs rs close pstmt close pstmt null catch exception e log log level severe m sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null set sums order updatetable morder c_order_id c_order_id getc_order_id c_order_id m_table loadtable setsums preparedstatement preparestatement m_sql setint c_order_id resultset executequery m_table loadtable m_sql setsums set sums from table private void set sums m order order int no lines m table get row count p pospanel f status set statusdb no lines if order null f net set value env zero f total set value env zero f tax set value env zero else order prepare it f net set value order get total lines f total set value order get grand total f tax set value order get grand total subtract order get total lines setsums morder nolines m_table getrowcount p_pospanel f_status setstatusdb nolines f_net setvalue f_total setvalue f_tax setvalue prepareit f_net setvalue gettotallines f_total setvalue getgrandtotal f_tax setvalue getgrandtotal gettotallines get tax id converts parameters to call get tax pre m product id c charge id c taxcategory id bill date ship date bill date ship date ad org id billfromc location id m warehouse id shipfromc location id billc bpartner location id billtoc location id shipc bpartner location id shiptoc location id if isso trx is false bill and ship are reversed pre param ctx context param m product id product param c charge id product param bill date invoice date param ship date ship date param ad org id org param m warehouse id warehouse param billc bpartner location id invoice location param shipc bpartner location id ship location param isso trx is a sales trx return c tax id if error it returns 0 and sets error log tax criteria not found public static int get properties ctx int m product id int c charge id timestamp bill date timestamp ship date int ad org id int m warehouse id int billc bpartner location id int shipc bpartner location id boolean isso trx if m product id 0 return get product ctx m product id bill date ship date ad org id m warehouse id billc bpartner location id shipc bpartner location id isso trx else if c charge id 0 return get charge ctx c charge id bill date ship date ad org id m warehouse id billc bpartner location id shipc bpartner location id isso trx else return get exempt tax ctx ad org id m_product_id c_charge_id c_taxcategory_id billdate shipdate billdate shipdate ad_org_id billfromc_location_id m_warehouse_id shipfromc_location_id billc_bpartner_location_id billtoc_location_id shipc_bpartner_location_id shiptoc_location_id issotrx m_product_id c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx c_tax_id taxcriterianotfound m_product_id c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx m_product_id getproduct m_product_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx c_charge_id getcharge c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx getexempttax ad_org_id get tax id converts parameters to call get tax pre c charge id c taxcategory id bill date ship date bill date ship date ad org id billfromc location id m warehouse id shipfromc location id billc bpartner location id billtoc location id shipc bpartner location id shiptoc location id if isso trx is false bill and ship are reversed pre param ctx context param c charge id product param bill date invoice date param ship date ship date param ad org id org param m warehouse id warehouse param billc bpartner location id invoice location param shipc bpartner location id ship location param isso trx is a sales trx return c tax id if error it returns 0 and sets error log tax criteria not found public static int get charge properties ctx int c charge id timestamp bill date timestamp ship date int ad org id int m warehouse id int billc bpartner location id int shipc bpartner location id boolean isso trx if m warehouse id 0 m warehouse id env get context as int ctx m warehouse id if m warehouse id 0 log warning no warehouse c charge id c charge id return 0 string variable int c taxcategory id 0 int shipfromc location id 0 int shiptoc location id 0 int billfromc location id 0 int billtoc location id 0 string is tax exempt null get all at once string sql select c c taxcategory id o c location id il c location id b is tax exempt w c location id sl c location id from c charge c ad orginfo o c bpartner location il inner join c bpartner b on il c bpartner id b c bpartner id m warehouse w c bpartner location sl where c c charge id and o ad org id and il c bpartner location id and w m warehouse id and sl c bpartner location id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c charge id pstmt set int 2 ad org id pstmt set int 3 billc bpartner location id pstmt set int 4 m warehouse id pstmt set int 5 shipc bpartner location id result set rs pstmt execute query boolean found false if rs next c taxcategory id rs get int 1 billfromc location id rs get int 2 billtoc location id rs get int 3 is tax exempt rs get string 4 shipfromc location id rs get int 5 shiptoc location id rs get int 6 found true rs close pstmt close if found log warning not found for c charge id c charge id ad org id ad org id m warehouse id m warehouse id c bpartner location id billc bpartner location id shipc bpartner location id return 0 else if y equals is tax exempt return get exempt tax ctx ad org id catch exception e log log level severe sql e return 0 reverese for po if isso trx int temp billfromc location id billfromc location id billtoc location id billtoc location id temp temp shipfromc location id shipfromc location id shiptoc location id shiptoc location id temp log fine get charge c taxcategory id c taxcategory id billfromc location id billfromc location id billtoc location id billtoc location id shipfromc location id shipfromc location id shiptoc location id shiptoc location id return get ctx c taxcategory id isso trx ship date shipfromc location id shiptoc location id bill date billfromc location id billtoc location id c_charge_id c_taxcategory_id billdate shipdate billdate shipdate ad_org_id billfromc_location_id m_warehouse_id shipfromc_location_id billc_bpartner_location_id billtoc_location_id shipc_bpartner_location_id shiptoc_location_id issotrx c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx c_tax_id taxcriterianotfound getcharge c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx m_warehouse_id m_warehouse_id getcontextasint m_warehouse_id m_warehouse_id c_charge_id c_charge_id c_taxcategory_id shipfromc_location_id shiptoc_location_id billfromc_location_id billtoc_location_id istaxexempt c_taxcategory_id c_location_id c_location_id istaxexempt c_location_id c_location_id c_charge ad_orginfo c_bpartner_location c_bpartner c_bpartner_id c_bpartner_id m_warehouse c_bpartner_location c_charge_id ad_org_id c_bpartner_location_id m_warehouse_id c_bpartner_location_id preparedstatement preparestatement setint c_charge_id setint ad_org_id setint billc_bpartner_location_id setint m_warehouse_id setint shipc_bpartner_location_id resultset executequery c_taxcategory_id getint billfromc_location_id getint billtoc_location_id getint istaxexempt getstring shipfromc_location_id getint shiptoc_location_id getint c_charge_id c_charge_id ad_org_id ad_org_id m_warehouse_id m_warehouse_id c_bpartner_location_id billc_bpartner_location_id shipc_bpartner_location_id istaxexempt getexempttax ad_org_id issotrx billfromc_location_id billfromc_location_id billtoc_location_id billtoc_location_id shipfromc_location_id shipfromc_location_id shiptoc_location_id shiptoc_location_id getcharge c_taxcategory_id c_taxcategory_id billfromc_location_id billfromc_location_id billtoc_location_id billtoc_location_id shipfromc_location_id shipfromc_location_id shiptoc_location_id shiptoc_location_id c_taxcategory_id issotrx shipdate shipfromc_location_id shiptoc_location_id billdate billfromc_location_id billtoc_location_id get tax id converts parameters to call get tax pre m product id c taxcategory id bill date ship date bill date ship date ad org id billfromc location id m warehouse id shipfromc location id billc bpartner location id billtoc location id shipc bpartner location id shiptoc location id if isso trx is false bill and ship are reversed pre param ctx context param m product id product param bill date invoice date param ship date ship date param ad org id org param m warehouse id warehouse param billc bpartner location id invoice location param shipc bpartner location id ship location param isso trx is a sales trx return c tax id if error it returns 0 and sets error log tax criteria not found public static int get product properties ctx int m product id timestamp bill date timestamp ship date int ad org id int m warehouse id int billc bpartner location id int shipc bpartner location id boolean isso trx string variable int c taxcategory id 0 int shipfromc location id 0 int shiptoc location id 0 int billfromc location id 0 int billtoc location id 0 string is tax exempt null try get all at once string sql select p c taxcategory id o c location id il c location id b is tax exempt w c location id sl c location id from m product p ad orginfo o c bpartner location il inner join c bpartner b on il c bpartner id b c bpartner id m warehouse w c bpartner location sl where p m product id and o ad org id and il c bpartner location id and w m warehouse id and sl c bpartner location id prepared statement pstmt db prepare statement sql null pstmt set int 1 m product id pstmt set int 2 ad org id pstmt set int 3 billc bpartner location id pstmt set int 4 m warehouse id pstmt set int 5 shipc bpartner location id result set rs pstmt execute query boolean found false if rs next c taxcategory id rs get int 1 billfromc location id rs get int 2 billtoc location id rs get int 3 is tax exempt rs get string 4 shipfromc location id rs get int 5 shiptoc location id rs get int 6 found true rs close pstmt close if found y equals is tax exempt log fine get product business partner is tax exempt return get exempt tax ctx ad org id else if found if isso trx int temp billfromc location id billfromc location id billtoc location id billtoc location id temp temp shipfromc location id shipfromc location id shiptoc location id shiptoc location id temp log fine get product c taxcategory id c taxcategory id billfromc location id billfromc location id billtoc location id billtoc location id shipfromc location id shipfromc location id shiptoc location id shiptoc location id return get ctx c taxcategory id isso trx ship date shipfromc location id shiptoc location id bill date billfromc location id billtoc location id detail for error isolation m product id c taxcategory id sql select c taxcategory id from m product where m product id variable m product id pstmt db prepare statement sql null pstmt set int 1 m product id rs pstmt execute query found false if rs next c taxcategory id rs get int 1 found true rs close pstmt close if c taxcategory id 0 log save error tax criteria not found msg translate ctx variable found product m product id not found return 0 log fine get product c taxcategory id c taxcategory id ad org id billfromc location id sql select c location id from ad orginfo where ad org id variable ad org id pstmt db prepare statement sql null pstmt set int 1 ad org id rs pstmt execute query found false if rs next billfromc location id rs get int 1 found true rs close pstmt close if billfromc location id 0 log save error tax criteria not found msg translate env getad language ctx variable found info org ad org id not found return 0 billc bpartner location id billtoc location id sql select l c location id b is tax exempt from c bpartner location l inner join c bpartner b on l c bpartner id b c bpartner id where c bpartner location id variable billto id pstmt db prepare statement sql null pstmt set int 1 billc bpartner location id rs pstmt execute query found false if rs next billtoc location id rs get int 1 is tax exempt rs get string 2 found true rs close pstmt close if billtoc location id 0 log save error tax criteria not found msg translate env getad language ctx variable found bp location billc bpartner location id not found return 0 if y equals is tax exempt return get exempt tax ctx ad org id reverse for po if isso trx int temp billfromc location id billfromc location id billtoc location id billtoc location id temp log fine get product billfromc location id billfromc location id log fine get product billtoc location id billtoc location id m warehouse id shipfromc location id sql select c location id from m warehouse where m warehouse id variable m warehouse id pstmt db prepare statement sql null pstmt set int 1 m warehouse id rs pstmt execute query found false if rs next shipfromc location id rs get int 1 found true rs close pstmt close if shipfromc location id 0 log save error tax criteria not found msg translate env getad language ctx variable found warehouse m warehouse id not found return 0 shipc bpartner location id shiptoc location id sql select c location id from c bpartner location where c bpartner location id variable c bpartner location id pstmt db prepare statement sql null pstmt set int 1 shipc bpartner location id rs pstmt execute query found false if rs next shiptoc location id rs get int 1 found true rs close pstmt close if shiptoc location id 0 log save error tax criteria not found msg translate env getad language ctx variable found bp location shipc bpartner location id not found return 0 reverse for po if isso trx int temp shipfromc location id shipfromc location id shiptoc location id shiptoc location id temp log fine get product shipfromc location id shipfromc location id log fine get product shiptoc location id shiptoc location id catch sql exception e log log level severe get product variable e return get ctx c taxcategory id isso trx ship date shipfromc location id shiptoc location id bill date billfromc location id billtoc location id m_product_id c_taxcategory_id billdate shipdate billdate shipdate ad_org_id billfromc_location_id m_warehouse_id shipfromc_location_id billc_bpartner_location_id billtoc_location_id shipc_bpartner_location_id shiptoc_location_id issotrx m_product_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx c_tax_id taxcriterianotfound getproduct m_product_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id issotrx c_taxcategory_id shipfromc_location_id shiptoc_location_id billfromc_location_id billtoc_location_id istaxexempt c_taxcategory_id c_location_id c_location_id istaxexempt c_location_id c_location_id m_product ad_orginfo c_bpartner_location c_bpartner c_bpartner_id c_bpartner_id m_warehouse c_bpartner_location m_product_id ad_org_id c_bpartner_location_id m_warehouse_id c_bpartner_location_id preparedstatement preparestatement setint m_product_id setint ad_org_id setint billc_bpartner_location_id setint m_warehouse_id setint shipc_bpartner_location_id resultset executequery c_taxcategory_id getint billfromc_location_id getint billtoc_location_id getint istaxexempt getstring shipfromc_location_id getint shiptoc_location_id getint istaxexempt getproduct getexempttax ad_org_id issotrx billfromc_location_id billfromc_location_id billtoc_location_id billtoc_location_id shipfromc_location_id shipfromc_location_id shiptoc_location_id shiptoc_location_id getproduct c_taxcategory_id c_taxcategory_id billfromc_location_id billfromc_location_id billtoc_location_id billtoc_location_id shipfromc_location_id shipfromc_location_id shiptoc_location_id shiptoc_location_id c_taxcategory_id issotrx shipdate shipfromc_location_id shiptoc_location_id billdate billfromc_location_id billtoc_location_id m_product_id c_taxcategory_id c_taxcategory_id m_product m_product_id m_product_id preparestatement setint m_product_id executequery c_taxcategory_id getint c_taxcategory_id saveerror taxcriterianotfound m_product_id getproduct c_taxcategory_id c_taxcategory_id ad_org_id billfromc_location_id c_location_id ad_orginfo ad_org_id ad_org_id preparestatement setint ad_org_id executequery billfromc_location_id getint billfromc_location_id saveerror taxcriterianotfound getad_language ad_org_id billc_bpartner_location_id billtoc_location_id c_location_id istaxexempt c_bpartner_location c_bpartner c_bpartner_id c_bpartner_id c_bpartner_location_id billto_id preparestatement setint billc_bpartner_location_id executequery billtoc_location_id getint istaxexempt getstring billtoc_location_id saveerror taxcriterianotfound getad_language bplocation billc_bpartner_location_id istaxexempt getexempttax ad_org_id issotrx billfromc_location_id billfromc_location_id billtoc_location_id billtoc_location_id getproduct billfromc_location_id billfromc_location_id getproduct billtoc_location_id billtoc_location_id m_warehouse_id shipfromc_location_id c_location_id m_warehouse m_warehouse_id m_warehouse_id preparestatement setint m_warehouse_id executequery shipfromc_location_id getint shipfromc_location_id saveerror taxcriterianotfound getad_language m_warehouse_id shipc_bpartner_location_id shiptoc_location_id c_location_id c_bpartner_location c_bpartner_location_id c_bpartner_location_id preparestatement setint shipc_bpartner_location_id executequery shiptoc_location_id getint shiptoc_location_id saveerror taxcriterianotfound getad_language bplocation shipc_bpartner_location_id issotrx shipfromc_location_id shipfromc_location_id shiptoc_location_id shiptoc_location_id getproduct shipfromc_location_id shipfromc_location_id getproduct shiptoc_location_id shiptoc_location_id sqlexception getproduct c_taxcategory_id issotrx shipdate shipfromc_location_id shiptoc_location_id billdate billfromc_location_id billtoc_location_id get exempt tax code param ctx context param ad org id org to find client return c tax id private static int get exempt tax properties ctx int ad org id int c tax id 0 string sql select t c tax id from c tax t inner join ad org o on t ad client id o ad client id where t is tax exempt y and o ad org id order by t rate desc boolean found false try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad org id result set rs pstmt execute query if rs next c tax id rs get int 1 found true rs close pstmt close catch sql exception e log log level severe get exempt tax e log fine get exempt tax tax exempt y c tax id c tax id if c tax id 0 log save error tax criteria not found msg get msg ctx tax no exempt found found tax org ad org id not found return c tax id ad_org_id c_tax_id getexempttax ad_org_id c_tax_id c_tax_id c_tax ad_org ad_client_id ad_client_id istaxexempt ad_org_id preparedstatement preparestatement setint ad_org_id resultset executequery c_tax_id getint sqlexception getexempttax getexempttax taxexempt c_tax_id c_tax_id c_tax_id saveerror taxcriterianotfound getmsg taxnoexemptfound ad_org_id c_tax_id get tax id detail if error return 0 and set error log tax not found param c taxcategory id tax category param isso trx sales order trx param ship date ship date ignored param shipfromc locction id ship from ignored param shiptoc location id ship to ignored param bill date invoice date param billfromc location id invoice from param billtoc location id invoice to return c tax id protected static int get properties ctx int c taxcategory id boolean isso trx timestamp ship date int shipfromc locction id int shiptoc location id timestamp bill date int billfromc location id int billtoc location id c taxcategory contains commodity code api to tax vendor comes here if c log mgt is level fine log info get detail category c taxcategory id so trx isso trx log config get detail bill from billfromc location id bill to billtoc location id bill date bill date m tax taxes m tax get all ctx m location l from new m location ctx billfromc location id null m location l to new m location ctx billtoc location id null log finer from l from log finer to l to for int i 0 i taxes length i m tax tax taxes i log finest tax to string if tax getc taxcategory id c taxcategory id tax is active tax getparent tax id 0 user parent tax continue if isso trx m tax sopotype purchasetax equals tax getsopo type continue if isso trx m tax sopotype salestax equals tax getsopo type continue log finest from country tax getc country id l from getc country id tax getc country id 0 log finest from region tax getc region id l from getc region id tax getc region id 0 log finest to country tax getto country id l to getc country id tax getto country id 0 log finest to region tax getto region id l to getc region id tax getto region id 0 log finest date valid tax get valid from after bill date from country if tax getc country id l from getc country id tax getc country id 0 from region tax getc region id l from getc region id tax getc region id 0 to country tax getto country id l to getc country id tax getto country id 0 to region tax getto region id l to getc region id tax getto region id 0 date tax get valid from after bill date if tax is postal return tax getc tax id m tax postal postals tax get postals false for int j 0 j postals length j m tax postal postal postals j if postal is active postal from is mandatory postal get postal starts with l from get postal postal to is optional postal getpostal to null postal getpostal to starts with l to get postal return tax getc tax id for all postals for all taxes default tax for int i 0 i taxes length i m tax tax taxes i if tax is default tax is active tax getparent tax id 0 user parent tax continue if isso trx m tax sopotype purchasetax equals tax getsopo type continue if isso trx m tax sopotype salestax equals tax getsopo type continue log fine get default tax return tax getc tax id for all taxes log save error tax not found return 0 taxnotfound c_taxcategory_id issotrx shipdate shipfromc_locction_id shiptoc_location_id billdate billfromc_location_id billtoc_location_id c_tax_id c_taxcategory_id issotrx shipdate shipfromc_locction_id shiptoc_location_id billdate billfromc_location_id billtoc_location_id c_taxcategory commoditycode clogmgt islevelfine c_taxcategory_id sotrx issotrx billfrom billfromc_location_id billto billtoc_location_id billdate billdate mtax mtax getall mlocation lfrom mlocation billfromc_location_id mlocation lto mlocation billtoc_location_id lfrom lto mtax tostring getc_taxcategory_id c_taxcategory_id isactive getparent_tax_id issotrx mtax sopotype_purchasetax getsopotype issotrx mtax sopotype_salestax getsopotype getc_country_id lfrom getc_country_id getc_country_id getc_region_id lfrom getc_region_id getc_region_id getto_country_id lto getc_country_id getto_country_id getto_region_id lto getc_region_id getto_region_id getvalidfrom billdate getc_country_id lfrom getc_country_id getc_country_id getc_region_id lfrom getc_region_id getc_region_id getto_country_id lto getc_country_id getto_country_id getto_region_id lto getc_region_id getto_region_id getvalidfrom billdate ispostal getc_tax_id mtaxpostal getpostals mtaxpostal isactive getpostal startswith lfrom getpostal getpostal_to getpostal_to startswith lto getpostal getc_tax_id mtax isdefault isactive getparent_tax_id issotrx mtax sopotype_purchasetax getsopotype issotrx mtax sopotype_salestax getsopotype getc_tax_id saveerror taxnotfound standard constructor public x m attributeuse properties ctx int m attributeuse id string trx name super ctx m attributeuse id trx name if m attributeuse id 0 setm attributeset id 0 setm attribute id 0 set seq no 0 sql select nvl max seq no 0 10 as default value from m attributeuse where m attributeset id m attributeset id x_m_attributeuse m_attributeuse_id trxname m_attributeuse_id trxname m_attributeuse_id setm_attributeset_id setm_attribute_id setseqno seqno defaultvalue m_attributeuse m_attributeset_id m_attributeset_id load constructor public x m attributeuse properties ctx result set rs string trx name super ctx rs trx name x_m_attributeuse resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributeuse append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributeuse get_id tostring set attribute set product attribute set public void setm attributeset id int m attributeset id if m attributeset id 0 throw new illegal argument exception m attributeset id is mandatory set valuenocheck m attributeset id new integer m attributeset id setm_attributeset_id m_attributeset_id m_attributeset_id illegalargumentexception m_attributeset_id set_valuenocheck m_attributeset_id m_attributeset_id get attribute set product attribute set public int getm attributeset id integer ii integer get value m attributeset id if ii null return 0 return ii int value getm_attributeset_id get_value m_attributeset_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm attributeset id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_attributeset_id set attribute product attribute public void setm attribute id int m attribute id if m attribute id 1 throw new illegal argument exception m attribute id is mandatory set valuenocheck m attribute id new integer m attribute id setm_attribute_id m_attribute_id m_attribute_id illegalargumentexception m_attribute_id set_valuenocheck m_attribute_id m_attribute_id get attribute product attribute public int getm attribute id integer ii integer get value m attribute id if ii null return 0 return ii int value getm_attribute_id get_value m_attribute_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor param ctx context param m costtype id id param trx name trx public m cost type properties ctx int m costtype id string trx name super ctx m costtype id trx name m_costtype_id trxname mcosttype m_costtype_id trxname m_costtype_id trxname load constructor param ctx context param rs result set param trx name trx public m cost type properties ctx result set rs string trx name super ctx rs trx name trxname mcosttype resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m cost type sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mcosttype get_id getname tostring before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id before delete return true if it can be deleted protected boolean before delete m acct schema ass m acct schema get client acct schema get ctx getad client id for int i 0 i ass length i if ass i getm costtype id getm costtype id log save error cannot delete msg get element get ctx c acctschema id ass i get name return false return true beforedelete macctschema macctschema getclientacctschema getctx getad_client_id getm_costtype_id getm_costtype_id saveerror cannotdelete getelement getctx c_acctschema_id getname standard constructor public x c payselection properties ctx int c payselection id string trx name super ctx c payselection id trx name if c payselection id 0 setc bankaccount id 0 setc payselection id 0 set is approved false set name null date set pay date new timestamp system current time millis date set processed false set processing false set total amt env zero x_c_payselection c_payselection_id trxname c_payselection_id trxname c_payselection_id setc_bankaccount_id setc_payselection_id setisapproved setname setpaydate currenttimemillis setprocessed setprocessing settotalamt load constructor public x c payselection properties ctx result set rs string trx name super ctx rs trx name x_c_payselection resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c payselection append get id append return sb to string tostring stringbuffer stringbuffer x_c_payselection get_id tostring set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set payment selection payment selection public void setc payselection id int c payselection id if c payselection id 1 throw new illegal argument exception c payselection id is mandatory set valuenocheck c payselection id new integer c payselection id setc_payselection_id c_payselection_id c_payselection_id illegalargumentexception c_payselection_id set_valuenocheck c_payselection_id c_payselection_id get payment selection payment selection public int getc payselection id integer ii integer get value c payselection id if ii null return 0 return ii int value getc_payselection_id get_value c_payselection_id intvalue set create lines from process which will generate a new document lines based on an existing document public void set create from string create from if create from null create from length 1 log warning length 1 truncated create from create from substring 0 0 set value create from create from setcreatefrom createfrom createfrom createfrom createfrom createfrom set_value createfrom createfrom get create lines from process which will generate a new document lines based on an existing document public string get create from return string get value create from getcreatefrom get_value createfrom set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set payment date date payment made public void set pay date timestamp pay date if pay date null throw new illegal argument exception pay date is mandatory set value pay date pay date setpaydate paydate paydate illegalargumentexception paydate set_value paydate paydate get payment date date payment made public timestamp get pay date return timestamp get value pay date getpaydate get_value paydate set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set total amount total amount public void set total amt big decimal total amt if total amt null throw new illegal argument exception total amt is mandatory set value total amt total amt settotalamt bigdecimal totalamt totalamt illegalargumentexception totalamt set_value totalamt totalamt get total amount total amount public big decimal get total amt big decimal bd big decimal get value total amt if bd null return env zero return bd bigdecimal gettotalamt bigdecimal bigdecimal get_value totalamt standard constructor public x pa reportcolumn properties ctx int pa reportcolumn id string trx name super ctx pa reportcolumn id trx name if pa reportcolumn id 0 set column type null r set is printed true y set name null setpa reportcolumnset id 0 setpa reportcolumn id 0 set posting type null a set seq no 0 sql select nvl max seq no 0 10 as default value from pa reportcolumn where pa reportcolumnset id pa reportcolumnset id x_pa_reportcolumn pa_reportcolumn_id trxname pa_reportcolumn_id trxname pa_reportcolumn_id setcolumntype setisprinted setname setpa_reportcolumnset_id setpa_reportcolumn_id setpostingtype setseqno seqno defaultvalue pa_reportcolumn pa_reportcolumnset_id pa_reportcolumnset_id load constructor public x pa reportcolumn properties ctx result set rs string trx name super ctx rs trx name x_pa_reportcolumn resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa reportcolumn append get id append return sb to string tostring stringbuffer stringbuffer x_pa_reportcolumn get_id tostring public static final string amounttype yearquantity qy set amount type type of amount to report public void set amount type string amount type if amount type null throw new illegal argument exception amount type is mandatory if amount type null amount type equals bp amount type equals bt amount type equals by amount type equals cp amount type equals ct amount type equals cy amount type equals dp amount type equals dt amount type equals dy amount type equals qp amount type equals qt amount type equals qy else throw new illegal argument exception amount type invalid value amount type reference id 235 bp bt by cp ct cy dp dt dy qp qt qy if amount type null amount type length 2 log warning length 2 truncated amount type amount type substring 0 1 set value amount type amount type amounttype_yearquantity setamounttype amounttype amounttype illegalargumentexception amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype illegalargumentexception amounttype amounttype reference_id amounttype amounttype amounttype amounttype set_value amounttype amounttype get amount type type of amount to report public string get amount type return string get value amount type getamounttype get_value amounttype set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 0 set value c elementvalue id null else set value c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id set_value c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue public static final string calculationtype subtractop1 op2 s set calculation public void set calculation type string calculation type if calculation type null throw new illegal argument exception calculation type is mandatory if calculation type null calculation type equals a calculation type equals p calculation type equals r calculation type equals s else throw new illegal argument exception calculation type invalid value calculation type reference id 236 a p r s if calculation type null calculation type length 1 log warning length 1 truncated calculation type calculation type substring 0 0 set value calculation type calculation type calculationtype_subtractop1_op2 setcalculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype calculationtype calculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype reference_id calculationtype calculationtype calculationtype calculationtype set_value calculationtype calculationtype get calculation public string get calculation type return string get value calculation type getcalculationtype get_value calculationtype public static final string columntype segmentvalue s set column type public void set column type string column type if column type null throw new illegal argument exception column type is mandatory if column type equals c column type equals r column type equals s else throw new illegal argument exception column type invalid value column type reference id 237 c r s if column type length 1 log warning length 1 truncated column type column type substring 0 0 set value column type column type columntype_segmentvalue setcolumntype columntype columntype illegalargumentexception columntype columntype columntype columntype illegalargumentexception columntype columntype reference_id columntype columntype columntype set_value columntype columntype get column type public string get column type return string get value column type getcolumntype get_value columntype public static final string currencytype sourcecurrency s set currency type public void set currency type string currency type if currency type null throw new illegal argument exception currency type is mandatory if currency type null currency type equals a currency type equals s else throw new illegal argument exception currency type invalid value currency type reference id 238 a s if currency type null currency type length 1 log warning length 1 truncated currency type currency type substring 0 0 set value currency type currency type currencytype_sourcecurrency setcurrencytype currencytype currencytype illegalargumentexception currencytype currencytype currencytype currencytype illegalargumentexception currencytype currencytype reference_id currencytype currencytype currencytype currencytype set_value currencytype currencytype get currency type public string get currency type return string get value currency type getcurrencytype get_value currencytype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string elementtype userelement2 x2 set type element type account or user defined public void set element type string element type if element type null throw new illegal argument exception element type is mandatory if element type null element type equals ac element type equals ay element type equals bp element type equals lf element type equals lt element type equals mc element type equals oo element type equals ot element type equals pj element type equals pr element type equals sa element type equals sr element type equals u1 element type equals u2 element type equals x1 element type equals x2 else throw new illegal argument exception element type invalid value element type reference id 181 ac ay bp lf lt mc oo ot pj pr sa sr u1 u2 x1 x2 if element type null element type length 2 log warning length 2 truncated element type element type substring 0 1 set value element type element type elementtype_userelement2 setelementtype elementtype elementtype illegalargumentexception elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype illegalargumentexception elementtype elementtype reference_id elementtype elementtype elementtype elementtype set_value elementtype elementtype get type element type account or user defined public string get element type return string get value element type getelementtype get_value elementtype set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set value gl budget id null else set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_value gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set adhoc conversion perform conversion for all amounts to currency public void set is adhoc conversion boolean is adhoc conversion set value is adhoc conversion new boolean is adhoc conversion setisadhocconversion isadhocconversion set_value isadhocconversion isadhocconversion get adhoc conversion perform conversion for all amounts to currency public boolean is adhoc conversion object oo get value is adhoc conversion if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isadhocconversion get_value isadhocconversion booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int oper 1 id ad reference id 239 set operand 1 first operand for calculation public void setoper 1 id int oper 1 id if oper 1 id 0 set value oper 1 id null else set value oper 1 id new integer oper 1 id oper_1_id_ad_reference_id setoper_1_id oper_1_id oper_1_id set_value oper_1_id set_value oper_1_id oper_1_id get operand 1 first operand for calculation public int getoper 1 id integer ii integer get value oper 1 id if ii null return 0 return ii int value getoper_1_id get_value oper_1_id intvalue public static final int oper 2 id ad reference id 239 set operand 2 second operand for calculation public void setoper 2 id int oper 2 id if oper 2 id 0 set value oper 2 id null else set value oper 2 id new integer oper 2 id oper_2_id_ad_reference_id setoper_2_id oper_2_id oper_2_id set_value oper_2_id set_value oper_2_id oper_2_id get operand 2 second operand for calculation public int getoper 2 id integer ii integer get value oper 2 id if ii null return 0 return ii int value getoper_2_id get_value oper_2_id intvalue public static final int org id ad reference id 130 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set report column set collection of columns for report public void setpa reportcolumnset id int pa reportcolumnset id if pa reportcolumnset id 1 throw new illegal argument exception pa reportcolumnset id is mandatory set valuenocheck pa reportcolumnset id new integer pa reportcolumnset id setpa_reportcolumnset_id pa_reportcolumnset_id pa_reportcolumnset_id illegalargumentexception pa_reportcolumnset_id set_valuenocheck pa_reportcolumnset_id pa_reportcolumnset_id get report column set collection of columns for report public int getpa reportcolumnset id integer ii integer get value pa reportcolumnset id if ii null return 0 return ii int value getpa_reportcolumnset_id get_value pa_reportcolumnset_id intvalue set report column column in report public void setpa reportcolumn id int pa reportcolumn id if pa reportcolumn id 1 throw new illegal argument exception pa reportcolumn id is mandatory set valuenocheck pa reportcolumn id new integer pa reportcolumn id setpa_reportcolumn_id pa_reportcolumn_id pa_reportcolumn_id illegalargumentexception pa_reportcolumn_id set_valuenocheck pa_reportcolumn_id pa_reportcolumn_id get report column column in report public int getpa reportcolumn id integer ii integer get value pa reportcolumn id if ii null return 0 return ii int value getpa_reportcolumn_id get_value pa_reportcolumn_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set relative period period offset 0 is current public void set relative period big decimal relative period set value relative period relative period setrelativeperiod bigdecimal relativeperiod set_value relativeperiod relativeperiod get relative period period offset 0 is current public big decimal get relative period big decimal bd big decimal get value relative period if bd null return env zero return bd bigdecimal getrelativeperiod bigdecimal bigdecimal get_value relativeperiod set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue tree panel for browsing and editing of a tree need to call init tree param window no window no param editable if true you can edit it param has bar has outlook bar public v tree panel int window no boolean has bar boolean editable super log config bar has bar editable editable m windowno window no m hasbar has bar m editable editable static init jb init if has bar bar set preferred size new dimension 0 0 center split pane set divider location 0 center split pane set divider size 0 pop menu tree remove m bar add else center split pane set divider location 80 base settings if editable tree set drop target drop target else pop menu tree remove m from pop menu tree remove m to inittree windowno windowno hasbar outlookbar vtreepanel windowno hasbar hasbar m_windowno windowno m_hasbar hasbar m_editable jbinit hasbar setpreferredsize centersplitpane setdividerlocation centersplitpane setdividersize popmenutree mbaradd centersplitpane setdividerlocation setdroptarget droptarget popmenutree mfrom popmenutree mto tree initialization may be called several times param ad tree id tree to load return true if loaded ok public boolean init tree int ad tree id log config ad tree id ad tree id m ad tree id ad tree id get tree m tree v tree new m tree env get ctx ad tree id m editable true null m root v tree get root log config root m root m nodetablename v tree get node table name tree model new default tree model m root true tree set model tree model shortcut bar if m hasbar bar remove all remove all existing buttons enumeration en m root preorder enumeration while en has more elements m tree node nd m tree node en next element if nd is on bar add to bar nd return true ad_tree_id inittree ad_tree_id ad_tree_id ad_tree_id m_ad_tree_id ad_tree_id mtree vtree mtree getctx ad_tree_id m_editable m_root vtree getroot m_root m_nodetablename vtree getnodetablename treemodel defaulttreemodel m_root setmodel treemodel m_hasbar removeall m_root preorderenumeration hasmoreelements mtreenode mtreenode nextelement isonbar addtobar static component initialization pre center split pane tree pane tree bar south panel pre private void jb init this set layout main layout main layout set vgap 5 only one node to be selected tree select set selection mode default tree selection model single tree selection tree set selection model tree select tree set editable false allows to change the text tree add mouse listener mouse listener tree add key listener key listener tree set cell renderer new v tree cell renderer tree pane get viewport add tree null tree pane set preferred size new dimension 50 200 tree set preferred size new dimension 100 150 tree expand set text msg get msg env get ctx expand tree tree expand set action command expand tree expand add mouse listener mouse listener tree expand add action listener this tree search label set text msg get msg env get ctx tree search tree search label set label for tree search tree search label set tool tip text msg get msg env get ctx tree search text tree search set background compiereplaf get info background tree search add key listener key listener south panel set layout south layout south panel add tree expand border layout west south panel add tree search label border layout center south panel add tree search border layout east this add south panel border layout south center split pane add tree pane j split pane right center split pane add bar j split pane left this add center split pane border layout center m from set text msg get msg env get ctx item move m from set action command from m from add action listener this m to set enabled false m to set text msg get msg env get ctx item insert m to set action command to m to add action listener this bar set layout new box layout bar box layout y axis bar set minimum size new dimension 50 50 m bar add set text msg get msg env get ctx bar add m bar add set action command bar add m bar add add action listener this m bar remove set text msg get msg env get ctx bar remove m bar remove set action command bar remove m bar remove add action listener this pop menu tree set light weight popup enabled false pop menu tree add m bar add pop menu tree add separator pop menu tree add m from pop menu tree add m to pop menu bar set light weight popup enabled false pop menu bar add m bar remove centersplitpane treepane southpanel jbinit setlayout mainlayout mainlayout setvgap treeselect setselectionmode defaulttreeselectionmodel single_tree_selection setselectionmodel treeselect seteditable addmouselistener mouselistener addkeylistener keylistener setcellrenderer vtreecellrenderer treepane getviewport treepane setpreferredsize setpreferredsize treeexpand settext getmsg getctx expandtree treeexpand setactioncommand treeexpand addmouselistener mouselistener treeexpand addactionlistener treesearchlabel settext getmsg getctx treesearch treesearchlabel setlabelfor treesearch treesearchlabel settooltiptext getmsg getctx treesearchtext treesearch setbackground getinfobackground treesearch addkeylistener keylistener southpanel setlayout southlayout southpanel treeexpand borderlayout southpanel treesearchlabel borderlayout southpanel treesearch borderlayout southpanel borderlayout centersplitpane treepane jsplitpane centersplitpane jsplitpane centersplitpane borderlayout mfrom settext getmsg getctx itemmove mfrom setactioncommand mfrom addactionlistener mto setenabled mto settext getmsg getctx iteminsert mto setactioncommand mto addactionlistener setlayout boxlayout boxlayout y_axis setminimumsize mbaradd settext getmsg getctx baradd mbaradd setactioncommand baradd mbaradd addactionlistener mbarremove settext getmsg getctx barremove mbarremove setactioncommand barremove mbarremove addactionlistener popmenutree setlightweightpopupenabled popmenutree mbaradd popmenutree addseparator popmenutree mfrom popmenutree mto popmenubar setlightweightpopupenabled popmenubar mbarremove set divider location param location location 80 default public void set divider location int location center split pane set divider location location setdividerlocation centersplitpane setdividerlocation get divider location return divider location public int get divider location return center split pane get divider location getdividerlocation centersplitpane getdividerlocation drag gesture interface start param e event public void drag gesture recognized drag gesture event e if m editable return try m movenode m tree node tree get selection path get last path component catch exception ex nothing selected return start moving string selection content new string selection m movenode to string e start drag drag source default move drop cursor content transferable this log fine drag m movenode to string draggesturerecognized draggestureevent m_editable m_movenode mtreenode getselectionpath getlastpathcomponent stringselection stringselection m_movenode tostring startdrag dragsource defaultmovedrop m_movenode tostring drag source listener interface param e event dragsourcelistener public void drag drop end drag source drop event e public void drag enter drag source drag event e dragdropend dragsourcedropevent dragenter dragsourcedragevent public void drag drop end drag source drop event e public void drag enter drag source drag event e public void drag exit drag source event e dragdropend dragsourcedropevent dragenter dragsourcedragevent dragexit dragsourceevent public void drag enter drag source drag event e public void drag exit drag source event e public void drag over drag source drag event e dragenter dragsourcedragevent dragexit dragsourceevent dragover dragsourcedragevent public void drag exit drag source event e public void drag over drag source drag event e public void drop action changed drag source drag event e dragexit dragsourceevent dragover dragsourcedragevent dropactionchanged dragsourcedragevent drop target listener interface param e event public void drag enter drop target drag event e e accept drag dnd constants action move droptargetlistener dragenter droptargetdragevent acceptdrag dndconstants action_move e accept drag dnd constants action move public void drop action changed drop target drag event e acceptdrag dndconstants action_move dropactionchanged droptargetdragevent public void drop action changed drop target drag event e public void drag exit drop target event e dropactionchanged droptargetdragevent dragexit droptargetevent drag over between param e event public void drag over drop target drag event e point mouse loc e get location where are we tree path path tree get closest path for location mouse loc x mouse loc y tree set selection path path show it by selecting m tree node to node m tree node path get last path component log fine move to node if m movenode null nothing to move to node null nothing to drop on e reject drag else e accept drag dnd constants action move dragover droptargetdragevent mouseloc getlocation treepath getclosestpathforlocation mouseloc mouseloc setselectionpath mtreenode tonode mtreenode getlastpathcomponent tonode m_movenode tonode rejectdrag acceptdrag dndconstants action_move drop end param e event public void drop drop target drop event e point mouse loc e get location where are we tree path path tree get closest path for location mouse loc x mouse loc y tree set selection path path show it by selecting m tree node to node m tree node path get last path component log fine drop to node if m movenode null nothing to move to node null nothing to drop on e reject drop return e accept drop dnd constants action move move node m movenode to node e drop complete true m movenode null droptargetdropevent mouseloc getlocation treepath getclosestpathforlocation mouseloc mouseloc setselectionpath mtreenode tonode mtreenode getlastpathcomponent tonode m_movenode tonode rejectdrop acceptdrop dndconstants action_move movenode m_movenode tonode dropcomplete m_movenode move tree node param moving node the node to be moved param to node the target node private void move node m tree node moving node m tree node to node log info moving node to string to to node to string if moving node to node return remove m tree node old parent m tree node moving node get parent moving node remove from parent tree model node structure changed old parent insert m tree node new parent int index if to node is summary drop on a child node new parent m tree node to node get parent index new parent get index to node 1 the next node else drop on a summary node new parent to node index 0 the first node new parent insert moving node index tree model node structure changed new parent save changes to disk set cursor cursor get predefined cursor cursor wait cursor trx trx trx get v tree panel true try begin vpj cd e evolution 07 12 2005 postgresql statement stmt trx get connection create statement end vpj cd e evolution 07 12 2005 postgresql start transaction for int i 0 i old parent get child count i m tree node nd m tree node old parent get child at i string buffer sql new string buffer update sql append m nodetablename append set parent id append old parent getnode id append seq no append i append updated sys date append where ad tree id append m ad tree id append and node id append nd getnode id log fine sql to string begin vpj cd e evolution 07 12 2005 postgresql stmt execute update sql to string db execute update sql to string trx get trx name end vpj cd e evolution 07 12 2005 postgresql if old parent new parent for int i 0 i new parent get child count i m tree node nd m tree node new parent get child at i string buffer sql new string buffer update sql append m nodetablename append set parent id append new parent getnode id append seq no append i append updated sys date append where ad tree id append m ad tree id append and node id append nd getnode id begin vpj cd e evolution 07 12 2005 postgresql stmt execute update sql to string db execute update sql to string trx get trx name end vpj cd e evolution 07 12 2005 postgresql commit trx commit begin vpj cd e evolution 07 12 2005 postgresql stmt close end vpj cd e evolution 07 12 2005 postgresql begin vpj cd e evolution 07 12 2005 postgresql catch sql exception e catch exception e end vpj cd e evolution 07 12 2005 postgresql trx rollback log log level severe move e a dialog error m windowno this tree update error e get localized message trx close trx null set cursor cursor get default cursor log config complete treenode movingnode tonode movenode mtreenode movingnode mtreenode tonode movingnode tostring tonode tostring movingnode tonode mtreenode oldparent mtreenode movingnode getparent movingnode removefromparent treemodel nodestructurechanged oldparent mtreenode newparent tonode issummary newparent mtreenode tonode getparent newparent getindex tonode newparent tonode newparent movingnode treemodel nodestructurechanged newparent setcursor getpredefinedcursor wait_cursor vtreepanel getconnection createstatement oldparent getchildcount mtreenode mtreenode oldparent getchildat stringbuffer stringbuffer m_nodetablename parent_id oldparent getnode_id seqno sysdate ad_tree_id m_ad_tree_id node_id getnode_id tostring executeupdate tostring executeupdate tostring gettrxname oldparent newparent newparent getchildcount mtreenode mtreenode newparent getchildat stringbuffer stringbuffer m_nodetablename parent_id newparent getnode_id seqno sysdate ad_tree_id m_ad_tree_id node_id getnode_id executeupdate tostring executeupdate tostring gettrxname sqlexception adialog m_windowno treeupdateerror getlocalizedmessage setcursor getdefaultcursor enter key param e event protected void key pressed key event e tree if e get source instanceof j tree e get source tree search e get modifiers 0 input event ctrl mask tree path tp tree get selection path if tp null a dialog beep else m tree node tn m tree node tp get last path component set selected node tn tree search else if e get source tree search string search tree search get text boolean found false at the end try from top if m nodeen null m nodeen has more elements m search this is the first time if search equals m search get enumeration of all nodes m nodeen m root preorder enumeration m search search search the nodes while found m nodeen null m nodeen has more elements m tree node nd m tree node m nodeen next element compare in upper case if nd to string to upper case index of search to upper case 1 found true tree path tree path new tree path nd get path tree set selection path tree path tree make visible tree path expand it tree scroll path to visible tree path if found a dialog beep tree search keypressed keyevent getsource jtree getsource treesearch getmodifiers inputevent ctrl_mask treepath getselectionpath adialog mtreenode mtreenode getlastpathcomponent setselectednode treesearch getsource treesearch treesearch gettext m_nodeen m_nodeen hasmoreelements m_search m_search m_nodeen m_root preorderenumeration m_search m_nodeen m_nodeen hasmoreelements mtreenode mtreenode m_nodeen nextelement tostring touppercase indexof touppercase treepath treepath treepath getpath setselectionpath treepath makevisible treepath scrollpathtovisible treepath adialog treesearch mouse clicked param e event protected void mouse clicked mouse event e j tree if e get source instanceof j tree left double click if swing utilities is left mouse button e e get click count 0 int sel row tree get row for location e getx e gety if sel row 1 m tree node tn m tree node tree get path for location e getx e gety get last path component set selected node tn right click for pop up else if m editable m hasbar swing utilities is right mouse button e tree get selection path null need select first m tree node nd m tree node tree get selection path get last path component if nd is leaf only leaves rectangle r tree get path bounds tree get selection path pop menu tree show tree int r get maxx int r gety j tree j button else if e get source instanceof j button if swing utilities is right mouse button e m buttonselected c button e get source pop menu bar show m buttonselected e getx e gety j button mouseclicked mouseevent jtree getsource jtree swingutilities isleftmousebutton getclickcount selrow getrowforlocation selrow mtreenode mtreenode getpathforlocation getlastpathcomponent setselectednode popup m_editable m_hasbar swingutilities isrightmousebutton getselectionpath mtreenode mtreenode getselectionpath getlastpathcomponent isleaf getpathbounds getselectionpath popmenutree getmaxx jtree jbutton getsource jbutton swingutilities isrightmousebutton m_buttonselected cbutton getsource popmenubar m_buttonselected jbutton get currently selected node return m tree node public m tree node get selected node return m selectednode mtreenode mtreenode getselectednode m_selectednode search field return search field public j component get search field return tree search jcomponent getsearchfield treesearch set selection to node in event param nodeid node id return true if selected public boolean set selected node int nodeid log config id nodeid if nodeid 1 new is 1 return selectid nodeid true show selection return false setselectednode select id in tree param nodeid node id param show scroll to node return true if selected private boolean selectid int nodeid boolean show if m root null return false log config nodeid nodeid show show root m root try to find the node m tree node node m root find node nodeid if node null tree path tree path new tree path node get path log config node node path tree path to string tree set selection path tree path if show tree make visible tree path expand it tree scroll path to visible tree path return true log info node not found id nodeid return false m_root m_root mtreenode m_root findnode treepath treepath treepath getpath treepath tostring setselectionpath treepath makevisible treepath scrollpathtovisible treepath set the selected node initiate all listeners param nd node private void set selected node m tree node nd log config node nd m selectednode nd fire property change node selection null nd setselectednode mtreenode m_selectednode firepropertychange node_selection node changed synchromize node param save true the node was saved changed added false if the row was deleted param keyid the id of the row changed param name name param description description param is summary summary node param image indicator image indicator public void node changed boolean save int keyid string name string description boolean is summary string image indicator log config save save keyid keyid name name description description is summary is summary image ind image indicator root m root if id 0 root don t update it if keyid 0 return try to find the node m tree node node m root find node keyid node not found and saved new if node null save node new m tree node keyid 0 name description m root getnode id is summary image indicator false null m root add node node found and saved change else if node null save node set name name node set allows children is summary node found and not saved delete else if node null save m tree node parent m tree node node get parent node remove from parent node parent select parent error else log log level severe save save keyid keyid node node node null nothing to display if node null return re display node tree updateui tree path tree path new tree path node get path tree set selection path tree path tree make visible tree path expand it tree scroll path to visible tree path issummary imageindicator nodechanged issummary imageindicator issummary issummary imageind imageindicator m_root mtreenode m_root findnode mtreenode m_root getnode_id issummary imageindicator m_root setname setallowschildren issummary mtreenode mtreenode getparent removefromparent treepath treepath treepath getpath setselectionpath treepath makevisible treepath scrollpathtovisible treepath action listener param e event public void action performed action event e bar button pressed if e get source instanceof j button find node don t show selectid integer parse int e get action command false select it m tree node tn m tree node tree get selection path get last path component set selected node tn popup menu commands else if e get source instanceof j menu item if e get action command equals from move from else if e get action command equals to move to else if e get action command equals bar add bar add else if e get action command equals bar remove bar remove else if e get source instanceof j check box if e get action command equals expand expand tree actionlistener actionperformed actionevent getsource jbutton parseint getactioncommand mtreenode mtreenode getselectionpath getlastpathcomponent setselectednode getsource jmenuitem getactioncommand movefrom getactioncommand moveto getactioncommand baradd baradd getactioncommand barremove barremove getsource jcheckbox getactioncommand expandtree copy node into buffer private void move from m movenode m tree node tree get selection path get last path component if m movenode null m to set enabled true enable menu movefrom m_movenode mtreenode getselectionpath getlastpathcomponent m_movenode mto setenabled move node private void move to m from set enabled true m to set enabled false if m movenode null return m tree node to node m tree node tree get selection path get last path component move node m movenode to node cleanup m movenode null moveto mfrom setenabled mto setenabled m_movenode mtreenode tonode mtreenode getselectionpath getlastpathcomponent movenode m_movenode tonode m_movenode add selected tree node to bar private void bar add m tree node nd m tree node tree get selection path get last path component if bard bupdate true nd getnode id add to bar nd treenode baradd mtreenode mtreenode getselectionpath getlastpathcomponent bardbupdate getnode_id addtobar add tree node to bar param nd node private void add to bar m tree node nd only first word of label string label nd to string trim int space label index of if space 1 label label substring 0 space c button button new c button label create the button button set tool tip text nd get description button set action command string value of nd getnode id button set margin new insets 0 0 0 0 button set icon nd get icon button set border painted false button set focus painted false button set request focus enabled false button add action listener this button add mouse listener mouse listener bar add button bar validate if center split pane get divider location 1 center split pane set divider location button get preferred size width bar repaint treenode addtobar mtreenode tostring indexof cbutton cbutton settooltiptext getdescription setactioncommand valueof getnode_id setmargin seticon geticon setborderpainted setfocuspainted setrequestfocusenabled addactionlistener addmouselistener mouselistener centersplitpane getdividerlocation centersplitpane setdividerlocation getpreferredsize remove from bar private void bar remove bar remove m buttonselected bar validate bar repaint bard bupdate false integer parse int m buttonselected get action command barremove m_buttonselected bardbupdate parseint m_buttonselected getactioncommand make bar add remove persistent param add true if add otherwise remove param node id node id private boolean bard bupdate boolean add int node id int ad client id env getad client id env get ctx int ad org id env get context as int env get ctx ad org id int ad user id env get context as int env get ctx ad user id string buffer sql new string buffer if add sql append insert into ad treebar ad tree id ad user id node id ad client id ad org id is active created created by updated updated by values append m ad tree id append append ad user id append append node id append append ad client id append append ad org id append append y sys date append ad user id append sys date append ad user id append if already exist will result in ora 00001 unique constraint compiere ad treebar key else sql append delete ad treebar where ad tree id append m ad tree id append and ad user id append ad user id append and node id append node id int no db execute update sql to string true null return no 1 node_id bardbupdate node_id ad_client_id getad_client_id getctx ad_org_id getcontextasint getctx ad_org_id ad_user_id getcontextasint getctx ad_user_id stringbuffer stringbuffer ad_treebar ad_tree_id ad_user_id node_id ad_client_id ad_org_id isactive createdby updatedby m_ad_tree_id ad_user_id node_id ad_client_id ad_org_id sysdate ad_user_id sysdate ad_user_id ad_treebar_key ad_treebar ad_tree_id m_ad_tree_id ad_user_id ad_user_id node_id node_id executeupdate tostring clicked on expand all private void expand tree if tree expand is selected for int row 0 row tree get row count row tree expand row row else for int row 0 row tree get row count row tree collapse row row expandtree treeexpand isselected getrowcount expandrow getrowcount collapserow v tree panel adaptee vtreepanel mouseadapter v tree panel adaptee this adaptee adaptee vtreepanel vtreepanel_mouseadapter vtreepanel public void mouse clicked mouse event e adaptee mouse clicked e mouseclicked mouseevent mouseclicked v tree panel adaptee vtreepanel keyadapter v tree panel adaptee this adaptee adaptee vtreepanel vtreepanel_keyadapter vtreepanel public void key pressed key event e if e get key code key event vk enter adaptee key pressed e keypressed keyevent getkeycode keyevent vk_enter keypressed protected constructor param m tab m tab v create from statement m tab m tab super m tab log info mtab mtab vcreatefromstatement mtab mtab mtab dynamic init throws exception if lookups cannot be initialized return true if initialized protected boolean dyn init throws exception if p mtab get value c bankstatement id null a dialog error 0 this save error row not found return false set title msg translate env get ctx c bankstatement id msg translate env get ctx create from parameter std panel set visible false int ad column id 4917 c bankstatement c bankaccount id m lookup lookup m lookup factory get env get ctx p windowno 0 ad column id display type table dir bank account field new v lookup c bankaccount id true false true lookup bank account field add vetoable change listener this set default int c bankaccount id env get context as int env get ctx p windowno c bankaccount id bank account field set value new integer c bankaccount id initial loading load bank account c bankaccount id return true dyninit p_mtab getvalue c_bankstatement_id adialog saveerrorrownotfound settitle getctx c_bankstatement_id getctx createfrom parameterstdpanel setvisible ad_column_id c_bankstatement c_bankaccount_id mlookup mlookupfactory getctx p_windowno ad_column_id displaytype tabledir bankaccountfield vlookup c_bankaccount_id bankaccountfield addvetoablechangelistener c_bankaccount_id getcontextasint getctx p_windowno c_bankaccount_id bankaccountfield setvalue c_bankaccount_id loadbankaccount c_bankaccount_id init details never called param c bpartner id b partner protected void initbp details int c bpartner id c_bpartner_id bpartner initbpdetails c_bpartner_id change listener param e event public void vetoable change property change event e log config e get property name e get new value bank account if e get property name c bankaccount id int c bankaccount id integer e get new value int value load bank account c bankaccount id table changed null vetoablechange propertychangeevent getpropertyname getnewvalue bankaccount getpropertyname c_bankaccount_id c_bankaccount_id getnewvalue intvalue loadbankaccount c_bankaccount_id tablechanged load data bank account param c bankaccount id bank account private void load bank account int c bankaccount id log config c bankaccount id c bankaccount id selected 0 date 1 c payment id 2 c currenncy 3 amt 4 vector vector object data new vector vector object string sql select p date trx p c payment id p document no p c currency id c iso code p pay amt currency convert p pay amt p c currency id ba c currency id null p ad client id p ad org id 1 bp name from c bankaccount ba inner join c payment v p on p c bankaccount id ba c bankaccount id inner join c currency c on p c currency id c c currency id inner join c bpartner bp on p c bpartner id bp c bpartner id where p processed y and p is reconciled n and p doc status in co cl re vo and p pay amt 0 bug 1564453 added voided payment to bank statement payement selection and p c bankaccount id 2 and not exists select from c bankstatementline l voided bank statements have 0 stmt amt where p c payment id l c payment id and l stmt amt 0 get statement date timestamp ts timestamp p mtab get value statement date if ts null ts new timestamp system current time millis try prepared statement pstmt db prepare statement sql to string null pstmt set timestamp 1 ts pstmt set int 2 c bankaccount id result set rs pstmt execute query while rs next vector object line new vector object 6 line add new boolean false 0 selection line add rs get timestamp 1 1 date trx key name pair pp new key name pair rs get int 2 rs get string 3 line add pp 2 c payment id pp new key name pair rs get int 4 rs get string 5 line add pp 3 currency line add rs get big decimal 6 4 pay amt line add rs get big decimal 7 5 conv amt line add rs get string 8 6 b parner data add line rs close pstmt close catch sql exception e log log level severe sql e header info vector string column names new vector string 6 column names add msg get msg env get ctx select column names add msg translate env get ctx date column names add msg get element env get ctx c payment id column names add msg translate env get ctx c currency id column names add msg translate env get ctx amount column names add msg translate env get ctx converted amount column names add msg translate env get ctx c bpartner id remove previous listeners data table get model remove table model listener this set model default table model model new default table model data column names model add table model listener this data table set model model data table set column class 0 boolean class false 0 selection data table set column class 1 timestamp class true 1 trx date data table set column class 2 string class true 2 payment data table set column class 3 string class true 3 currency data table set column class 4 big decimal class true 4 amount data table set column class 5 big decimal class true 5 conv amount data table set column class 6 string class true 6 b partner table ui data table auto size c_bankaccount_id loadbankaccount c_bankaccount_id c_bankaccount_id c_bankaccount_id c_payment_id c_currenncy datetrx c_payment_id documentno c_currency_id iso_code payamt currencyconvert payamt c_currency_id c_currency_id ad_client_id ad_org_id c_bankaccount c_payment_v c_bankaccount_id c_bankaccount_id c_currency c_currency_id c_currency_id c_bpartner c_bpartner_id c_bpartner_id isreconciled docstatus payamt c_bankaccount_id c_bankstatementline stmtamt c_payment_id c_payment_id stmtamt statementdate p_mtab getvalue statementdate currenttimemillis preparedstatement preparestatement tostring settimestamp setint c_bankaccount_id resultset executequery gettimestamp datetrx keynamepair keynamepair getint getstring c_payment_id keynamepair getint getstring getbigdecimal payamt getbigdecimal getstring bparner sqlexception columnnames columnnames getmsg getctx columnnames getctx columnnames getelement getctx c_payment_id columnnames getctx c_currency_id columnnames getctx columnnames getctx convertedamount columnnames getctx c_bpartner_id datatable getmodel removetablemodellistener defaulttablemodel defaulttablemodel columnnames addtablemodellistener datatable setmodel datatable setcolumnclass datatable setcolumnclass trxdate datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass bigdecimal datatable setcolumnclass bigdecimal convamount datatable setcolumnclass bpartner datatable autosize list total amount protected void info decimal format format display type get number format display type amount table model model data table get model big decimal total new big decimal 0 0 int rows model get row count int count 0 for int i 0 i rows i if boolean model get value at i 0 boolean value total total add big decimal model get value at i 4 count status bar set status line string value of count msg get msg env get ctx sum format format total decimalformat displaytype getnumberformat displaytype tablemodel datatable getmodel bigdecimal bigdecimal getrowcount getvalueat booleanvalue bigdecimal getvalueat statusbar setstatusline valueof getmsg getctx save statement insert data return true if saved protected boolean save log config table model model data table get model int rows model get row count if rows 0 return false fixed values int c bankstatement id integer p mtab get value c bankstatement id int value m bank statement bs new m bank statement env get ctx c bankstatement id null log config bs to string lines for int i 0 i rows i if boolean model get value at i 0 boolean value timestamp trx date timestamp model get value at i 1 1 date trx key name pair pp key name pair model get value at i 2 2 c payment id int c payment id pp get key pp key name pair model get value at i 3 3 currency int c currency id pp get key big decimal trx amt big decimal model get value at i 4 4 pay amt big decimal stmt amt big decimal model get value at i 5 5 conv amt log fine line date trx date payment c payment id currency c currency id amt trx amt m bank statement line bsl new m bank statement line bs bsl set statement line date trx date bsl set payment new m payment env get ctx c payment id null if bsl save log log level severe line not created i if selected for all rows return true tablemodel datatable getmodel getrowcount c_bankstatement_id p_mtab getvalue c_bankstatement_id intvalue mbankstatement mbankstatement getctx c_bankstatement_id tostring getvalueat booleanvalue trxdate getvalueat datetrx keynamepair keynamepair getvalueat c_payment_id c_payment_id getkey keynamepair getvalueat c_currency_id getkey bigdecimal trxamt bigdecimal getvalueat payamt bigdecimal stmtamt bigdecimal getvalueat trxdate c_payment_id c_currency_id trxamt mbankstatementline mbankstatementline setstatementlinedate trxdate setpayment mpayment getctx c_payment_id get m measure from cache param ctx context param pa measure id id return m measure public static m measure get properties ctx int pa measure id integer key new integer pa measure id m measure ret value m measure s cache get key if ret value null return ret value ret value new m measure ctx pa measure id null if ret value get id 0 s cache put key ret value return ret value mmeasure pa_measure_id mmeasure mmeasure pa_measure_id pa_measure_id mmeasure retvalue mmeasure s_cache retvalue retvalue retvalue mmeasure pa_measure_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param pa measure id id param trx name trx public m measure properties ctx int pa measure id string trx name super ctx pa measure id trx name pa_measure_id trxname mmeasure pa_measure_id trxname pa_measure_id trxname load constructor param ctx context param rs result set param trx name trx public m measure properties ctx result set rs string trx name super ctx rs trx name trxname mmeasure resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m measure sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mmeasure get_id getname tostring before save param new record new return true protected boolean before save boolean new record if measuretype calculated equals get measure type getpa measurecalc id 0 log save error fill mandatory msg get element get ctx pa measurecalc id return false else if measuretype ratio equals get measure type getpa ratio id 0 log save error fill mandatory msg get element get ctx pa ratio id return false else if measuretype userdefined equals get measure type get calculation class null get calculation class length 0 log save error fill mandatory msg get element get ctx calculation class return false else if measuretype request equals get measure type getr requesttype id 0 log save error fill mandatory msg get element get ctx r requesttype id return false else if measuretype project equals get measure type getc projecttype id 0 log save error fill mandatory msg get element get ctx c projecttype id return false return true newrecord beforesave newrecord measuretype_calculated getmeasuretype getpa_measurecalc_id saveerror fillmandatory getelement getctx pa_measurecalc_id measuretype_ratio getmeasuretype getpa_ratio_id saveerror fillmandatory getelement getctx pa_ratio_id measuretype_userdefined getmeasuretype getcalculationclass getcalculationclass saveerror fillmandatory getelement getctx calculationclass measuretype_request getmeasuretype getr_requesttype_id saveerror fillmandatory getelement getctx r_requesttype_id measuretype_project getmeasuretype getc_projecttype_id saveerror fillmandatory getelement getctx c_projecttype_id after save param new record new param success success return succes protected boolean after save boolean new record boolean success update goals with manual measure if success measuretype manual equals get measure type update manual goals return success newrecord aftersave newrecord measuretype_manual getmeasuretype updatemanualgoals update save goals return true if updated public boolean update goals string mt get measure type try if measuretype manual equals mt return update manual goals else if measuretype achievements equals mt return update achievement goals else if measuretype calculated equals mt return update calculated goals else if measuretype ratio equals mt return update ratios else if measuretype request equals mt return update requests else if measuretype project equals mt return update projects projects catch exception e log log level severe measure type mt e return false updategoals getmeasuretype measuretype_manual updatemanualgoals measuretype_achievements updateachievementgoals measuretype_calculated updatecalculatedgoals measuretype_ratio updateratios measuretype_request updaterequests measuretype_project updateprojects measuretype update save manual goals return true if updated private boolean update manual goals if measuretype manual equals get measure type return false m goal goals m goal get measure goals get ctx getpa measure id for int i 0 i goals length i m goal goal goals i goal set measure actual get manual actual goal save return true updatemanualgoals measuretype_manual getmeasuretype mgoal mgoal getmeasuregoals getctx getpa_measure_id mgoal setmeasureactual getmanualactual update save goals with achievement return true if updated private boolean update achievement goals if measuretype achievements equals get measure type return false timestamp today new timestamp system current time millis m goal goals m goal get measure goals get ctx getpa measure id for int i 0 i goals length i m goal goal goals i string measure scope goal get measure scope string trunc time util trunc day if m goal measuredisplay year equals measure scope trunc time util trunc year else if m goal measuredisplay quarter equals measure scope trunc time util trunc quarter else if m goal measuredisplay month equals measure scope trunc time util trunc month else if m goal measuredisplay week equals measure scope trunc time util trunc week timestamp compare time util trunc today trunc m achievement achievements m achievement get of measure get ctx getpa measure id big decimal manual actual env zero for int j 0 j achievements length j m achievement achievement achievements j if achievement is achieved achievement get date doc null timestamp ach time util trunc achievement get date doc trunc if compare equals ach manual actual manual actual add achievement get manual actual goal set measure actual manual actual goal save return true updateachievementgoals measuretype_achievements getmeasuretype currenttimemillis mgoal mgoal getmeasuregoals getctx getpa_measure_id mgoal measurescope getmeasurescope timeutil trunc_day mgoal measuredisplay_year measurescope timeutil trunc_year mgoal measuredisplay_quarter measurescope timeutil trunc_quarter mgoal measuredisplay_month measurescope timeutil trunc_month mgoal measuredisplay_week measurescope timeutil trunc_week timeutil machievement machievement getofmeasure getctx getpa_measure_id bigdecimal manualactual machievement isachieved getdatedoc timeutil getdatedoc manualactual manualactual getmanualactual setmeasureactual manualactual update save goals with calculation return true if updated private boolean update calculated goals if measuretype calculated equals get measure type return false m goal goals m goal get measure goals get ctx getpa measure id for int i 0 i goals length i m goal goal goals i find role m role role null if goal getad role id 0 role m role get get ctx goal getad role id else if goal getad user id 0 m user user m user get get ctx goal getad user id m role roles user get roles goal getad org id if roles length 0 role roles 0 if role null role m role get default get ctx false could result in wrong data m measure calc mc m measure calc get get ctx getpa measurecalc id if mc null mc get id 0 mc get id getpa measurecalc id log log level severe not found pa measurecalc id getpa measurecalc id return false big decimal manual actual null string sql mc get sqlpi goal get restrictions false goal get measure scope get measure data type null role prepared statement pstmt null try sql statement could be wrong pstmt db prepare statement sql null result set rs pstmt execute query if rs next manual actual rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null sql may return no rows or null if manual actual null manual actual env zero log fine no value sql goal set measure actual manual actual goal save return true updatecalculatedgoals measuretype_calculated getmeasuretype mgoal mgoal getmeasuregoals getctx getpa_measure_id mgoal mrole getad_role_id mrole getctx getad_role_id getad_user_id muser muser getctx getad_user_id mrole getroles getad_org_id mrole getdefault getctx mmeasurecalc mmeasurecalc getctx getpa_measurecalc_id get_id get_id getpa_measurecalc_id pa_measurecalc_id getpa_measurecalc_id bigdecimal manualactual getsqlpi getrestrictions getmeasurescope getmeasuredatatype preparedstatement preparestatement resultset executequery manualactual getbigdecimal manualactual manualactual setmeasureactual manualactual update save goals with ratios return true if updated private boolean update ratios if measuretype ratio equals get measure type return false return false updateratios measuretype_ratio getmeasuretype update save goals with requests return true if updated private boolean update requests if measuretype request equals get measure type getr requesttype id 0 return false m goal goals m goal get measure goals get ctx getpa measure id for int i 0 i goals length i m goal goal goals i find role m role role null if goal getad role id 0 role m role get get ctx goal getad role id else if goal getad user id 0 m user user m user get get ctx goal getad user id m role roles user get roles goal getad org id if roles length 0 role roles 0 if role null role m role get default get ctx false could result in wrong data big decimal manual actual null m request type rt m request type get get ctx getr requesttype id string sql rt get sqlpi goal get restrictions false goal get measure scope get measure data type null role prepared statement pstmt null try sql statement could be wrong pstmt db prepare statement sql null result set rs pstmt execute query if rs next manual actual rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null sql may return no rows or null if manual actual null manual actual env zero log fine no value sql goal set measure actual manual actual goal save return true updaterequests measuretype_request getmeasuretype getr_requesttype_id mgoal mgoal getmeasuregoals getctx getpa_measure_id mgoal mrole getad_role_id mrole getctx getad_role_id getad_user_id muser muser getctx getad_user_id mrole getroles getad_org_id mrole getdefault getctx bigdecimal manualactual mrequesttype mrequesttype getctx getr_requesttype_id getsqlpi getrestrictions getmeasurescope getmeasuredatatype preparedstatement preparestatement resultset executequery manualactual getbigdecimal manualactual manualactual setmeasureactual manualactual update save goals with projects return true if updated private boolean update projects if measuretype project equals get measure type getc projecttype id 0 return false m goal goals m goal get measure goals get ctx getpa measure id for int i 0 i goals length i m goal goal goals i find role m role role null if goal getad role id 0 role m role get get ctx goal getad role id else if goal getad user id 0 m user user m user get get ctx goal getad user id m role roles user get roles goal getad org id if roles length 0 role roles 0 if role null role m role get default get ctx false could result in wrong data big decimal manual actual null m project type pt m project type get get ctx getc projecttype id string sql pt get sqlpi goal get restrictions false goal get measure scope get measure data type null role prepared statement pstmt null try sql statement could be wrong pstmt db prepare statement sql null result set rs pstmt execute query if rs next manual actual rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null sql may return no rows or null if manual actual null manual actual env zero log fine no value sql goal set measure actual manual actual goal save return true updateprojects measuretype_project getmeasuretype getc_projecttype_id mgoal mgoal getmeasuregoals getctx getpa_measure_id mgoal mrole getad_role_id mrole getctx getad_role_id getad_user_id muser muser getctx getad_user_id mrole getroles getad_org_id mrole getdefault getctx bigdecimal manualactual mprojecttype mprojecttype getctx getc_projecttype_id getsqlpi getrestrictions getmeasurescope getmeasuredatatype preparedstatement preparestatement resultset executequery manualactual getbigdecimal manualactual manualactual setmeasureactual manualactual basic constructor public u basic constructor param element adds an element to the element public u element element add element element addelement basic constructor param element adds an element to the element public u string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public u add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public u add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public u add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public u add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public u remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get contents return contents public object get contents return contents getcontents get contents return context public object get contents return contents getcontents requisition line product price std param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set callout active true set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null int c bpartner id env get context as int ctx window no window no c bpartner id big decimal qty big decimal m tab get value qty boolean isso trx false m product pricing pp new m product pricing m product id int value c bpartner id qty isso trx int m pricelist id env get context as int ctx window no m pricelist id pp setm pricelist id m pricelist id int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp order date timestamp m tab get value date required pp set price date order date m tab set value price actual pp get price std env set context ctx window no enforce price limit pp is enforce price limit y n not used env set context ctx window no discount schema pp is discount schema y n set callout active false return pricestd windowno mtab mfield windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue setcalloutactive getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id c_bpartner_id getcontextasint windowno windowno c_bpartner_id bigdecimal bigdecimal mtab getvalue issotrx mproductpricing mproductpricing m_product_id intvalue c_bpartner_id issotrx m_pricelist_id getcontextasint windowno m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id orderdate mtab getvalue daterequired setpricedate orderdate mtab setvalue priceactual getpricestd setcontext windowno enforcepricelimit isenforcepricelimit setcontext windowno discountschema isdiscountschema setcalloutactive order line amount called from qty price actual calculates line net amt param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string amt properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true qty changed recalc price if m field get column name equals qty y equals env get context ctx window no discount schema int m product id env get context as int ctx window no window no m product id int c bpartner id env get context as int ctx window no window no c bpartner id big decimal qty big decimal value boolean isso trx false m product pricing pp new m product pricing m product id c bpartner id qty isso trx int m pricelist id env get context as int ctx window no m pricelist id pp setm pricelist id m pricelist id int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp order date timestamp m tab get value date invoiced pp set price date order date m tab set value price actual pp get price std int std precision env get context as int ctx window no std precision big decimal qty big decimal m tab get value qty big decimal price actual big decimal m tab get value price actual get values log fine amt qty qty price price actual precision std precision multiply big decimal line net amt qty multiply price actual if line net amt scale std precision line net amt line net amt set scale std precision big decimal round half up m tab set value line net amt line net amt log info amt line net amt line net amt set callout active false return priceactual linenetamt windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive mfield getcolumnname getcontext windowno discountschema m_product_id getcontextasint windowno windowno m_product_id c_bpartner_id getcontextasint windowno windowno c_bpartner_id bigdecimal bigdecimal issotrx mproductpricing mproductpricing m_product_id c_bpartner_id issotrx m_pricelist_id getcontextasint windowno m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id orderdate mtab getvalue dateinvoiced setpricedate orderdate mtab setvalue priceactual getpricestd stdprecision getcontextasint windowno stdprecision bigdecimal bigdecimal mtab getvalue bigdecimal priceactual bigdecimal mtab getvalue priceactual priceactual stdprecision bigdecimal linenetamt priceactual linenetamt stdprecision linenetamt linenetamt setscale stdprecision bigdecimal round_half_up mtab setvalue linenetamt linenetamt linenetamt linenetamt setcalloutactive standard constructor public x s timeexpense properties ctx int s timeexpense id string trx name super ctx s timeexpense id trx name if s timeexpense id 0 setc bpartner id 0 set date report new timestamp system current time millis date set doc action null co set doc status null dr set document no null set is approved false setm pricelist id 0 setm warehouse id 0 set processed false sets timeexpense id 0 x_s_timeexpense s_timeexpense_id trxname s_timeexpense_id trxname s_timeexpense_id setc_bpartner_id setdatereport currenttimemillis setdocaction setdocstatus setdocumentno setisapproved setm_pricelist_id setm_warehouse_id setprocessed sets_timeexpense_id load constructor public x s timeexpense properties ctx result set rs string trx name super ctx rs trx name x_s_timeexpense resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s timeexpense append get id append return sb to string tostring stringbuffer stringbuffer x_s_timeexpense get_id tostring set approval amount document approval amount public void set approval amt big decimal approval amt set value approval amt approval amt setapprovalamt bigdecimal approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt public static final int c bpartner id ad reference id 277 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set report date expense time report date public void set date report timestamp date report if date report null throw new illegal argument exception date report is mandatory set value date report date report setdatereport datereport datereport illegalargumentexception datereport set_value datereport datereport get report date expense time report date public timestamp get date report return timestamp get value date report getdatereport get_value datereport set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set expense report time and expense report public void sets timeexpense id int s timeexpense id if s timeexpense id 1 throw new illegal argument exception s timeexpense id is mandatory set valuenocheck s timeexpense id new integer s timeexpense id sets_timeexpense_id s_timeexpense_id s_timeexpense_id illegalargumentexception s_timeexpense_id set_valuenocheck s_timeexpense_id s_timeexpense_id get expense report time and expense report public int gets timeexpense id integer ii integer get value s timeexpense id if ii null return 0 return ii int value gets_timeexpense_id get_value s_timeexpense_id intvalue constructor prevent instance private report ctl reportctl create report called from process ctl check special reports first if not create standard report param pi process info param is direct print if true prints directly otherwise view return true if created static public boolean start process info pi boolean is direct print s log info start pi order print if pi getad process id 110 c order return start document print report engine order pi getrecord id is direct print else if pi getad process id 116 c invoice return start document print report engine invoice pi getrecord id is direct print else if pi getad process id 117 m inout return start document print report engine shipment pi getrecord id is direct print else if pi getad process id 217 c project return start document print report engine project pi getrecord id is direct print else if pi getad process id 276 c rfqresponse return start document print report engine rfq pi getrecord id is direct print else if pi getad process id 313 c payment return start check print pi getrecord id is direct print else if pi ad process id 9999999 pay selection return start document print check pi is direct print else if pi ad process id 9999999 pay selection return start document print remittance pi is direct print else if pi getad process id 159 dunning return start document print report engine dunning pi getrecord id is direct print else if pi getad process id 202 financial report pi getad process id 204 financial statement return start fin report pi standard report return start standard report pi is direct print processctl isdirectprint processinfo isdirectprint s_log getad_process_id c_order startdocumentprint reportengine getrecord_id isdirectprint getad_process_id c_invoice startdocumentprint reportengine getrecord_id isdirectprint getad_process_id m_inout startdocumentprint reportengine getrecord_id isdirectprint getad_process_id c_project startdocumentprint reportengine getrecord_id isdirectprint getad_process_id c_rfqresponse startdocumentprint reportengine getrecord_id isdirectprint getad_process_id c_payment startcheckprint getrecord_id isdirectprint ad_process_id payselection startdocumentprint isdirectprint ad_process_id payselection startdocumentprint isdirectprint getad_process_id startdocumentprint reportengine getrecord_id isdirectprint getad_process_id getad_process_id startfinreport startstandardreport isdirectprint start standard report get table info submit param pi process info param is direct print if true prints directly otherwise view return true if ok static public boolean start standard report process info pi boolean is direct print report engine re report engine get env get ctx pi if re null pi set summary no report engine return false if is direct print re print else new viewer re return true isdirectprint startstandardreport processinfo isdirectprint reportengine reportengine getctx setsummary reportengine isdirectprint start financial report param pi process info return true if ok static public boolean start fin report process info pi int ad client id env getad client id env get ctx create query from parameters string table name pi getad process id 202 t report t reportstatement m query query m query get env get ctx pi getad pinstance id table name get print format m print format format m print format pi get transient object if format null format m print format pi get serializable object if format null s log log level severe start fin report no print format return false print info info new print info pi report engine re new report engine env get ctx format query info new viewer re return true startfinreport processinfo ad_client_id getad_client_id getctx tablename getad_process_id t_report t_reportstatement mquery mquery getctx getad_pinstance_id tablename printformat mprintformat mprintformat gettransientobject mprintformat getserializableobject s_log startfinreport printformat printinfo printinfo reportengine reportengine getctx start document print for type called also directly from process dialog v in out gen v invoice gen v pay print param type document type in report engine param record id id param is direct print if true prints directly otherwise view return true if success public static boolean start document print int type int record id boolean is direct print report engine re report engine get env get ctx type record id if re null a dialog error 0 null no doc print format return false if is direct print re print report engine print confirm type record id else new viewer re return true processdialog vinoutgen vinvoicegen vpayprint reportengine record_id isdirectprint startdocumentprint record_id isdirectprint reportengine reportengine getctx record_id adialog nodocprintformat isdirectprint reportengine printconfirm record_id start check print find create param c payment id payment param is direct print if true prints directly otherwise view return true if success public static boolean start check print int c payment id boolean is direct print int c payselectioncheck id 0 m pay selection check psc m pay selection check get of payment env get ctx c payment id null if psc null c payselectioncheck id psc getc payselectioncheck id else psc m pay selection check create for payment env get ctx c payment id null if psc null c payselectioncheck id psc getc payselectioncheck id return start document print report engine check c payselectioncheck id is direct print c_payment_id isdirectprint startcheckprint c_payment_id isdirectprint c_payselectioncheck_id mpayselectioncheck mpayselectioncheck getofpayment getctx c_payment_id c_payselectioncheck_id getc_payselectioncheck_id mpayselectioncheck createforpayment getctx c_payment_id c_payselectioncheck_id getc_payselectioncheck_id startdocumentprint reportengine c_payselectioncheck_id isdirectprint get contents return contents public object get contents return contents getcontents get content return content public object get contents return contents getcontents standard constructor public x c nonbusinessday properties ctx int c nonbusinessday id string trx name super ctx c nonbusinessday id trx name if c nonbusinessday id 0 setc calendar id 0 setc nonbusinessday id 0 set date1 new timestamp system current time millis x_c_nonbusinessday c_nonbusinessday_id trxname c_nonbusinessday_id trxname c_nonbusinessday_id setc_calendar_id setc_nonbusinessday_id setdate1 currenttimemillis load constructor public x c nonbusinessday properties ctx result set rs string trx name super ctx rs trx name x_c_nonbusinessday resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c nonbusinessday append get id append return sb to string tostring stringbuffer stringbuffer x_c_nonbusinessday get_id tostring set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set valuenocheck c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_valuenocheck c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set non business day day on which business is not transacted public void setc nonbusinessday id int c nonbusinessday id if c nonbusinessday id 1 throw new illegal argument exception c nonbusinessday id is mandatory set valuenocheck c nonbusinessday id new integer c nonbusinessday id setc_nonbusinessday_id c_nonbusinessday_id c_nonbusinessday_id illegalargumentexception c_nonbusinessday_id set_valuenocheck c_nonbusinessday_id c_nonbusinessday_id get non business day day on which business is not transacted public int getc nonbusinessday id integer ii integer get value c nonbusinessday id if ii null return 0 return ii int value getc_nonbusinessday_id get_value c_nonbusinessday_id intvalue set date date when business is not conducted public void set date1 timestamp date1 if date1 null throw new illegal argument exception date1 is mandatory set value date1 date1 setdate1 illegalargumentexception set_value get date date when business is not conducted public timestamp get date1 return timestamp get value date1 getdate1 get_value set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname constructor param frame parent param title title field name param location model location public v location dialog frame frame string title m location location super frame title true try jb init catch exception ex log log level severe ex get message m location location if m location null m location new m location env get ctx 0 null overwrite title if m location getc location id 0 set title msg get msg env get ctx location new else set title msg get msg env get ctx location update current country m country set display language env getad language env get ctx f country new c combo box m country get countries env get ctx f country set selected item m location get country m origcountry id m location getc country id current region f region new c combo box m region get regions env get ctx m origcountry id if m location get country is has region l region set text m location get country get region name name for region f region set selected item m location get region init location f country add action listener this a env position center window frame this vlocationdialog mlocation jbinit getmessage m_location m_location m_location mlocation getctx m_location getc_location_id settitle getmsg getctx locationnew settitle getmsg getctx locationupdate mcountry setdisplaylanguage getad_language getctx fcountry ccombobox mcountry getcountries getctx fcountry setselecteditem m_location getcountry m_origcountry_id m_location getc_country_id fregion ccombobox mregion getregions getctx m_origcountry_id m_location getcountry ishasregion lregion settext m_location getcountry getregionname fregion setselecteditem m_location getregion initlocation fcountry addactionlistener aenv positioncenterwindow static component init throws exception void jb init throws exception panel set layout panel layout south panel set layout south layout main panel set layout grid bag layout panel layout set hgap 5 panel layout set vgap 10 get content pane add panel panel add main panel border layout center panel add south panel border layout south south panel add confirm panel border layout north confirm panel add action listener this jbinit setlayout panellayout southpanel setlayout southlayout mainpanel setlayout gridbaglayout panellayout sethgap panellayout setvgap getcontentpane mainpanel borderlayout southpanel borderlayout southpanel confirmpanel borderlayout confirmpanel addactionlistener dynanmic init fill fields called when country changes private void init location m country country m location get country log fine country get name region country is has region country get display sequence c location id m location getc location id new region if m location getc country id s oldcountry id country is has region f region new c combo box m region get regions env get ctx country getc country id if m location get region null f region set selected item m location get region l region set text country get region name s oldcountry id m location getc country id gbc anchor grid bag constraints northwest gbc gridy 0 line gbc gridx 0 gbc gridwidth 1 gbc insets field insets gbc fill grid bag constraints horizontal gbc weightx 0 gbc weighty 0 main panel add box create vertical strut 5 gbc top gap int line 1 add line line l address1 f address1 add line line l address2 f address2 add line line l address3 f address3 add line line l address4 f address4 sequence of city postal region p c c r p string ds country get display sequence if ds null ds length 0 log log level severe display sequence empty country ds c p string tokenizer st new string tokenizer ds false while st has more tokens string s st next token if s starts with c add line line l city f city else if s starts with p add line line l postal f postal else if s starts with a add line line l postal add f postal add else if s starts with r m location get country is has region add line line l region f region country last add line line l country f country fill it if m location getc location id 0 f address1 set text m location get address1 f address2 set text m location get address2 f address3 set text m location get address3 f address4 set text m location get address4 f city set text m location get city f postal set text m location get postal f postal add set text m location getpostal add if m location get country is has region l region set text m location get country get region name f region set selected item m location get region f country set selected item country update ui pack initlocation mcountry m_location getcountry getname ishasregion getdisplaysequence c_location_id m_location getc_location_id m_location getc_country_id s_oldcountry_id ishasregion fregion ccombobox mregion getregions getctx getc_country_id m_location getregion fregion setselecteditem m_location getregion lregion settext getregionname s_oldcountry_id m_location getc_country_id gridbagconstraints fieldinsets gridbagconstraints mainpanel createverticalstrut addline laddress1 faddress1 addline laddress2 faddress2 addline laddress3 faddress3 addline laddress4 faddress4 getdisplaysequence displaysequence stringtokenizer stringtokenizer hasmoretokens nexttoken startswith addline lcity fcity startswith addline lpostal fpostal startswith addline lpostaladd fpostaladd startswith m_location getcountry ishasregion addline lregion fregion addline lcountry fcountry m_location getc_location_id faddress1 settext m_location getaddress1 faddress2 settext m_location getaddress2 faddress3 settext m_location getaddress3 faddress4 settext m_location getaddress4 fcity settext m_location getcity fpostal settext m_location getpostal fpostaladd settext m_location getpostal_add m_location getcountry ishasregion lregion settext m_location getcountry getregionname fregion setselecteditem m_location getregion fcountry setselecteditem add line to screen param line line number zero based param label label param field field private void add line int line j label label j component field gbc gridy line label gbc insets label insets gbc gridx 0 gbc weightx 0 0 gbc fill grid bag constraints horizontal label set horizontal alignment swing constants right main panel add label gbc field gbc insets field insets gbc gridx 1 gbc weightx 1 0 gbc fill grid bag constraints none main panel add field gbc addline jlabel jcomponent labelinsets gridbagconstraints sethorizontalalignment swingconstants mainpanel fieldinsets gridbagconstraints mainpanel action listener param e action event public void action performed action event e if e get action command equals confirm panel a ok action ok m change true dispose else if e get action command equals confirm panel a cancel m change false dispose country changed display in new format else if e get source f country modifier for mouse selection is 16 for any key selection 0 m country c m country f country get selected item m location set country c refrseh main panel remove all init location f country request focus allows to use keybord selection actionlistener actionevent actionperformed actionevent getactioncommand confirmpanel a_ok action_ok m_change getactioncommand confirmpanel a_cancel m_change getsource fcountry mcountry mcountry fcountry getselecteditem m_location setcountry mainpanel removeall initlocation fcountry requestfocus ok check for changes save them exit private void action ok m location set address1 f address1 get text m location set address2 f address2 get text m location set address3 f address3 get text m location set address4 f address4 get text m location set city f city get text m location set postal f postal get text m location setpostal add f postal add get text country region m country c m country f country get selected item m location set country c if m location get country is has region m region r m region f region get selected item m location set region r else m location setc region id 0 save chnages m location save action_ok m_location setaddress1 faddress1 gettext m_location setaddress2 faddress2 gettext m_location setaddress3 faddress3 gettext m_location setaddress4 faddress4 gettext m_location setcity fcity gettext m_location setpostal fpostal gettext m_location setpostal_add fpostaladd gettext mcountry mcountry fcountry getselecteditem m_location setcountry m_location getcountry ishasregion mregion mregion fregion getselecteditem m_location setregion m_location setc_region_id m_location get result return true if changed public boolean is changed return m change ischanged m_change get edited value m location return location public m location get value return m location mlocation mlocation getvalue m_location get view from html string param html html string return renderer view public static html renderer get string html html editor kit kit new html editor kit html document doc html document kit create default document try doc remove 0 doc get length reader r new string reader html kit read r doc 0 catch exception e log log level severe e create renderer element element doc get default root element view factory factory kit get view factory view view factory create element y axis is main html renderer renderer new html renderer factory view renderer preference changed null true true return renderer htmlrenderer htmleditorkit htmleditorkit htmldocument htmldocument createdefaultdocument getlength stringreader getdefaultrootelement viewfactory getviewfactory y_axis htmlrenderer htmlrenderer preferencechanged constructor param f factory param v root view public html renderer view factory f view v super null m factory f m view v m view set parent this initially layout to the preferred size set size m view get preferred span x axis m view get preferred span y axis htmlrenderer viewfactory m_factory m_view m_view setparent setsize m_view getpreferredspan x_axis m_view getpreferredspan y_axis get width return width public float get width return get preferred span javax swing text view x axis getwidth getpreferredspan x_axis get height return height public float get height return get preferred span javax swing text view y axis getheight getpreferredspan y_axis get height for one line return height public float get height one line return 30f hardcoded getheightoneline set allocation actual print size param width actual print width param height actual print height public void set allocation int width int height set allocation new rectangle width height setallocation setallocation set allocation actual size param allocation actual print size public void set allocation rectangle allocation m allocation allocation setallocation m_allocation get allocation return actual print size or if not defined the renderer size public rectangle get allocation if m allocation null return new rectangle int get width int get height return m allocation getallocation m_allocation getwidth getheight m_allocation fetches the attributes to use when rendering at the root level there are no attributes if an attribute is resolved up the view hierarchy this is the end of the line public attribute set get attributes return null attributeset getattributes determines the preferred span for this view along an axis param axis may be either x axis or y axis return the span the view would like to be rendered into typically the view is told to render into the span that is returned although there is no guarantee the parent may choose to resize or break the view public float get preferred span int axis if axis x axis width currently laid out to return m width return m view get preferred span axis x_axis y_axis getpreferredspan x_axis m_width m_view getpreferredspan determines the minimum span for this view along an axis param axis may be either x axis or y axis return the span the view would like to be rendered into typically the view is told to render into the span that is returned although there is no guarantee the parent may choose to resize or break the view public float get minimum span int axis return m view get minimum span axis x_axis y_axis getminimumspan m_view getminimumspan determines the maximum span for this view along an axis param axis may be either x axis or y axis return the span the view would like to be rendered into typically the view is told to render into the span that is returned although there is no guarantee the parent may choose to resize or break the view public float get maximum span int axis return integer max value x_axis y_axis getmaximumspan max_value determines the desired alignment for this view along an axis param axis may be either x axis or y axis return the desired alignment where 0 0 indicates the origin and 1 0 the full span away from the origin public float get alignment int axis return m view get alignment axis x_axis y_axis getalignment m_view getalignment renders the view param g the graphics context param allocation the region to render into public void paint graphics g shape allocation rectangle alloc allocation get bounds m view set size alloc width alloc height layout shape old clip g get clip g set clip alloc limit print m view paint g allocation g set clip old clip getbounds m_view setsize oldclip getclip setclip m_view setclip oldclip sets the view parent param parent the parent view public void set parent view parent throw new error can t set parent on root view setparent returns the number of views in this view since this view simply wraps the root of the view hierarchy it has exactly one child return the number of views see get view public int get view count return 1 getview getviewcount gets the n th view in this container param n the number of the view to get return the view public view get view int n return m view getview m_view provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it param pos the position to convert param a the allocated region to render into return the bounding box of the given position public shape model to view int pos shape a position bias b throws bad location exception return m view model to view pos a b modeltoview badlocationexception m_view modeltoview provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it param p0 the position to convert 0 param b0 the bias toward the previous character or the next character represented by p0 in case the position is a boundary of two views param p1 the position to convert 0 param b1 the bias toward the previous character or the next character represented by p1 in case the position is a boundary of two views param a the allocated region to render into return the bounding box of the given position is returned exception bad location exception if the given position does not represent a valid location in the associated document exception illegal argument exception for an invalid bias argument see javax swing text view view to model float float java awt shape javax swing text position bias public shape model to view int p0 position bias b0 int p1 position bias b1 shape a throws bad location exception return m view model to view p0 b0 p1 b1 a badlocationexception illegalargumentexception viewtomodel modeltoview badlocationexception m_view modeltoview provides a mapping from the view coordinate space to the logical coordinate space of the model param x x coordinate of the view location to convert param y y coordinate of the view location to convert param a the allocated region to render into return the location within the model that best represents the given point in the view public int view to model float x float y shape a position bias bias return m view view to model x y a bias viewtomodel m_view viewtomodel returns the document model underlying the view return the model public document get document return m view get document getdocument m_view getdocument returns the starting offset into the model for this view return the starting offset public int get start offset return m view get start offset getstartoffset m_view getstartoffset returns the ending offset into the model for this view return the ending offset public int get end offset return m view get end offset getendoffset m_view getendoffset gets the element that this view is mapped to return the view public element get element return m view get element getelement m_view getelement sets the view size param width the width param height the height public void set size float width float height this m width int width m view set size width height setsize m_width m_view setsize fetches the factory to be used for building the various view fragments that make up the view that represents the model this is what determines how the model will be represented this is implemented to fetch the factory provided by the associated editor kit return the factory public view factory get view factory return m factory editorkit viewfactory getviewfactory m_factory web basket line param m product id product param name name param qty qty param price price public web basket line int m product id string name big decimal qty big decimal price setm product id m product id set name name set quantity qty set price price m_product_id webbasketline m_product_id bigdecimal bigdecimal setm_product_id m_product_id setname setquantity setprice extended string representation return info public string to stringx string buffer sb new string buffer web basket line sb append m line append m product id append m m product id append qty append m quantity append price append m price append total append get total append return sb to string tostringx stringbuffer stringbuffer webbasketline m_line m_product_id m_m_product_id m_quantity m_price gettotal tostring extended string representation return info public string to string string buffer sb new string buffer sb append m quantity append append m name append append get total return sb to string tostring stringbuffer stringbuffer m_quantity m_name gettotal tostring get line number return line no public int get line return m line getline m_line set line number param line no protected void set line int line m line line setline m_line get m product id product return product public int getm product id return m m product id m_product_id getm_product_id m_m_product_id set m product id param m product id id protected void setm product id int m product id m m product id m product id m_product_id m_product_id setm_product_id m_product_id m_m_product_id m_product_id get name return name or public string get name if m name null return return m name getname m_name m_name set product name param name protected void set name string name m name name setname m_name get price return price public big decimal get price if m price null return env zero return m price bigdecimal getprice m_price m_price set price param price protected void set price big decimal price if price null m price env zero else m price price m total null setprice bigdecimal m_price m_price m_total get quantity return quantity public big decimal get quantity if m quantity null return env zero return m quantity bigdecimal getquantity m_quantity m_quantity set quantity param quantity quantity public void set quantity big decimal quantity if quantity null m quantity env zero else m quantity quantity m total null setquantity bigdecimal m_quantity m_quantity m_total add quantity param added quantity return new quantity public big decimal add quantity big decimal added quantity if added quantity null return get quantity m quantity get quantity m quantity m quantity add added quantity m total null return m quantity addedquantity bigdecimal addquantity bigdecimal addedquantity addedquantity getquantity m_quantity getquantity m_quantity m_quantity addedquantity m_total m_quantity get total calculate return total price public big decimal get total if m total null m total get quantity multiply get price return m total bigdecimal gettotal m_total m_total getquantity getprice m_total standard constructor public x pa reportline properties ctx int pa reportline id string trx name super ctx pa reportline id trx name if pa reportline id 0 set is printed true y set line type null set name null setpa reportlineset id 0 setpa reportline id 0 set seq no 0 sql select nvl max seq no 0 10 as default value from pa reportline where pa reportlineset id pa reportlineset id x_pa_reportline pa_reportline_id trxname pa_reportline_id trxname pa_reportline_id setisprinted setlinetype setname setpa_reportlineset_id setpa_reportline_id setseqno seqno defaultvalue pa_reportline pa_reportlineset_id pa_reportlineset_id load constructor public x pa reportline properties ctx result set rs string trx name super ctx rs trx name x_pa_reportline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa reportline append get id append return sb to string tostring stringbuffer stringbuffer x_pa_reportline get_id tostring public static final string amounttype yearquantity qy set amount type type of amount to report public void set amount type string amount type if amount type null throw new illegal argument exception amount type is mandatory if amount type null amount type equals bp amount type equals bt amount type equals by amount type equals cp amount type equals ct amount type equals cy amount type equals dp amount type equals dt amount type equals dy amount type equals qp amount type equals qt amount type equals qy else throw new illegal argument exception amount type invalid value amount type reference id 235 bp bt by cp ct cy dp dt dy qp qt qy if amount type null amount type length 2 log warning length 2 truncated amount type amount type substring 0 1 set value amount type amount type amounttype_yearquantity setamounttype amounttype amounttype illegalargumentexception amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype illegalargumentexception amounttype amounttype reference_id amounttype amounttype amounttype amounttype set_value amounttype amounttype get amount type type of amount to report public string get amount type return string get value amount type getamounttype get_value amounttype public static final string calculationtype subtractop1 op2 s set calculation public void set calculation type string calculation type if calculation type null throw new illegal argument exception calculation type is mandatory if calculation type null calculation type equals a calculation type equals p calculation type equals r calculation type equals s else throw new illegal argument exception calculation type invalid value calculation type reference id 236 a p r s if calculation type null calculation type length 1 log warning length 1 truncated calculation type calculation type substring 0 0 set value calculation type calculation type calculationtype_subtractop1_op2 setcalculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype calculationtype calculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype reference_id calculationtype calculationtype calculationtype calculationtype set_value calculationtype calculationtype get calculation public string get calculation type return string get value calculation type getcalculationtype get_value calculationtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set value gl budget id null else set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_value gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue public static final string linetype segmentvalue s set line type public void set line type string line type if line type null throw new illegal argument exception line type is mandatory if line type equals c line type equals s else throw new illegal argument exception line type invalid value line type reference id 241 c s if line type length 1 log warning length 1 truncated line type line type substring 0 0 set value line type line type linetype_segmentvalue setlinetype linetype linetype illegalargumentexception linetype linetype linetype illegalargumentexception linetype linetype reference_id linetype linetype linetype set_value linetype linetype get line type public string get line type return string get value line type getlinetype get_value linetype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int oper 1 id ad reference id 240 set operand 1 first operand for calculation public void setoper 1 id int oper 1 id if oper 1 id 0 set value oper 1 id null else set value oper 1 id new integer oper 1 id oper_1_id_ad_reference_id setoper_1_id oper_1_id oper_1_id set_value oper_1_id set_value oper_1_id oper_1_id get operand 1 first operand for calculation public int getoper 1 id integer ii integer get value oper 1 id if ii null return 0 return ii int value getoper_1_id get_value oper_1_id intvalue public static final int oper 2 id ad reference id 240 set operand 2 second operand for calculation public void setoper 2 id int oper 2 id if oper 2 id 0 set value oper 2 id null else set value oper 2 id new integer oper 2 id oper_2_id_ad_reference_id setoper_2_id oper_2_id oper_2_id set_value oper_2_id set_value oper_2_id oper_2_id get operand 2 second operand for calculation public int getoper 2 id integer ii integer get value oper 2 id if ii null return 0 return ii int value getoper_2_id get_value oper_2_id intvalue set report line set public void setpa reportlineset id int pa reportlineset id if pa reportlineset id 1 throw new illegal argument exception pa reportlineset id is mandatory set valuenocheck pa reportlineset id new integer pa reportlineset id setpa_reportlineset_id pa_reportlineset_id pa_reportlineset_id illegalargumentexception pa_reportlineset_id set_valuenocheck pa_reportlineset_id pa_reportlineset_id get report line set public int getpa reportlineset id integer ii integer get value pa reportlineset id if ii null return 0 return ii int value getpa_reportlineset_id get_value pa_reportlineset_id intvalue set report line public void setpa reportline id int pa reportline id if pa reportline id 1 throw new illegal argument exception pa reportline id is mandatory set valuenocheck pa reportline id new integer pa reportline id setpa_reportline_id pa_reportline_id pa_reportline_id illegalargumentexception pa_reportline_id set_valuenocheck pa_reportline_id pa_reportline_id get report line public int getpa reportline id integer ii integer get value pa reportline id if ii null return 0 return ii int value getpa_reportline_id get_value pa_reportline_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type null posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type null posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue base class for defining all elements public generic element genericelement do we want to do pretty printing public boolean get pretty print return pretty print getprettyprint pretty_print do we want to pretty print param pretty print turn pretty printing on or off public element set pretty print boolean pretty print this pretty print pretty print return this pretty_print setprettyprint pretty_print pretty_print pretty_print get the hashtable representation of an element protected hashtable get element hash entry return element getelementhashentry set the filter state of the element param filter state true false do we want to use a filter default true public element set filter state boolean filter state this filter state filter state return this filter_state setfilterstate filter_state filter_state filter_state get the filter state of the element public boolean get filter state return filter state getfilterstate filter_state get the filter that is currently in use public filter get filter return filter getfilter override the default filter with a user supplied filter public void set filter filter filter this filter filter setfilter what version of html gen is this public string get version return version htmlgen getversion determine what case the html element should be rendered default is mixedcase public void set case int case type this case type case type setcase case_type case_type case_type find out what case the element is supposed to be rendered in public int get case return case type getcase case_type determine what type of element this is a br em acronym public void set element type string element type this element type element type setelementtype element_type element_type element_type find out what type of element this is public string get element type return element type getelementtype element_type determine what codeset should be used public void set code set string codeset this codeset codeset setcodeset find out what the current codeset is public string get code set return codeset getcodeset does this element need a closing tag default is true public void set need closing tag boolean close end element close setneedclosingtag end_element determine if this element needs to be closed public boolean get need closing tag return end element getneedclosingtag end_element determine if this element needs a line break if pretty printing public boolean get need line break return true getneedlinebreak set the position of the tag to be rendered at in relation to start element char public void set tag position int position this position position start_element_char settagposition get the position the tag is to be rendered at public int get tag position return position gettagposition alter the case of this element so that it is rendered according to whatever the value of case type is default is mixedcase protected string alter case string value switch get case case uppercase return value to upper case case lowercase return value to lower case default return value case_type altercase getcase touppercase tolowercase set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set begin modifier char modifier set begin start modifier modifier set begin end modifier modifier set begin start modifier defined true set begin end modifier defined true return this setbeginmodifier setbeginstartmodifier setbeginendmodifier setbeginstartmodifierdefined setbeginendmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set begin start modifier char modifier this begin start modifier modifier set begin start modifier defined true return this setbeginstartmodifier begin_start_modifier setbeginstartmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set begin end modifier char modifier this begin end modifier modifier set begin end modifier defined true return this setbeginendmodifier begin_end_modifier setbeginendmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set begin modifier char start modifier char end modifier this begin start modifier start modifier this begin end modifier end modifier set begin start modifier defined true set begin end modifier defined true return this setbeginmodifier start_modifier end_modifier begin_start_modifier start_modifier begin_end_modifier end_modifier setbeginstartmodifierdefined setbeginendmodifierdefined what is the element modifier for this tag public char get begin start modifier return begin start modifier getbeginstartmodifier begin_start_modifier what is the element modifier for this tag public char get begin end modifier return begin end modifier getbeginendmodifier begin_end_modifier remove the element modifier for this tag public element remove begin start modifier set begin start modifier defined false return this removebeginstartmodifier setbeginstartmodifierdefined remove the element modifier for this tag public element remove begin end modifier set begin end modifier defined false return this removebeginendmodifier setbeginendmodifierdefined modifier optimization private void set begin start modifier defined boolean val this begin start modifier defined val setbeginstartmodifierdefined begin_start_modifier_defined modifier optimization private void set begin end modifier defined boolean val this begin end modifier defined val setbeginendmodifierdefined begin_end_modifier_defined modifier optimization protected boolean get end start modifier defined return this end start modifier defined getendstartmodifierdefined end_start_modifier_defined modifier optimization protected boolean get end end modifier defined return this end end modifier defined getendendmodifierdefined end_end_modifier_defined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set end modifier char modifier set end start modifier modifier set end end modifier modifier set end start modifier defined true set end end modifier defined true return this setendmodifier setendstartmodifier setendendmodifier setendstartmodifierdefined setendendmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set end start modifier char modifier this end start modifier modifier set end start modifier defined true return this setendstartmodifier end_start_modifier setendstartmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set end end modifier char modifier this end end modifier modifier set end end modifier defined true return this setendendmodifier end_end_modifier setendendmodifierdefined set the element modifier the default is no modifier param modifier the modifier for the element a would result br in lt gt public element set end modifier char start modifier char end modifier this end start modifier start modifier this end end modifier end modifier set end start modifier defined true set end end modifier defined true return this setendmodifier start_modifier end_modifier end_start_modifier start_modifier end_end_modifier end_modifier setendstartmodifierdefined setendendmodifierdefined what is the element modifier for this tag public char get end start modifier return end start modifier getendstartmodifier end_start_modifier what is the element modifier for this tag public char get end end modifier return end end modifier getendendmodifier end_end_modifier remove the element modifier for this tag public element remove end start modifier set end start modifier defined false return this removeendstartmodifier setendstartmodifierdefined remove the element modifier for this tag public element remove end end modifier set end end modifier defined false return this removeendendmodifier setendendmodifierdefined modifier optimization private void set end start modifier defined boolean val this end start modifier defined val setendstartmodifierdefined end_start_modifier_defined modifier optimization private void set end end modifier defined boolean val this end end modifier defined val setendendmodifierdefined end_end_modifier_defined modifier optimization protected boolean get begin start modifier defined return this begin start modifier defined getbeginstartmodifierdefined begin_start_modifier_defined modifier optimization protected boolean get begin end modifier defined return this begin end modifier defined getbeginendmodifierdefined begin_end_modifier_defined set the start tag character public void set start tag char char start tag this start tag start tag setstarttagchar start_tag start_tag start_tag get the start tag character public char get start tag char return start tag getstarttagchar start_tag set the end tag character public void set end tag char char end tag this end tag end tag setendtagchar end_tag end_tag end_tag get the end tag character public char get end tag char return end tag getendtagchar end_tag public string get tag text return text gettagtext __text public element set tag text string text this text text return this settagtext __text protected string create start tag string buffer sb new string buffer sb append get start tag char if get begin start modifier defined sb append get begin start modifier sb append get element type if get begin end modifier defined sb append get begin end modifier sb append get end tag char return sb to string createstarttag stringbuffer stringbuffer getstarttagchar getbeginstartmodifierdefined getbeginstartmodifier getelementtype getbeginendmodifierdefined getbeginendmodifier getendtagchar tostring protected string create end tag set end start modifier string buffer sb new string buffer sb append get start tag char if get end start modifier defined sb append get end start modifier sb append get element type if get end end modifier defined sb append get end end modifier sb append get end tag char return sb to string createendtag setendstartmodifier stringbuffer stringbuffer getstarttagchar getendstartmodifierdefined getendstartmodifier getelementtype getendendmodifierdefined getendendmodifier getendtagchar tostring override to string method to print something meaningful public final string to string string out null try byte array output stream baos new byte array output stream buffered output stream bos new buffered output stream baos output bos bos flush if get code set null out baos to string get code set else out baos to string bos close baos close catch io exception ioe return out tostring tostring bytearrayoutputstream bytearrayoutputstream bufferedoutputstream bufferedoutputstream getcodeset tostring getcodeset tostring ioexception override to string encode method to print something meaningful public final string to string string codeset byte array output stream baos new byte array output stream buffered output stream bos new buffered output stream baos string out null try output bos bos flush out baos to string codeset bos close baos close catch unsupported encoding exception use catch io exception ioe return out tostring tostring bytearrayoutputstream bytearrayoutputstream bufferedoutputstream bufferedoutputstream tostring unsupportedencodingexception ioexception add the element to the designated output stream public void output output stream out string encoding null if get code set null encoding get code set else by default use big endian unicode in this way we will not loose any information encoding utf 16be try out write create start tag get bytes encoding if get filter state out write get filter process get tag text get bytes encoding else out write get tag text get bytes encoding if get need closing tag out write create end tag get bytes encoding catch unsupported encoding exception uee uee print stack trace new print writer out catch io exception ioe ioe print stack trace new print writer out outputstream outputstream getcodeset getcodeset createstarttag getbytes getfilterstate getfilter gettagtext getbytes gettagtext getbytes getneedclosingtag createendtag getbytes unsupportedencodingexception printstacktrace printwriter ioexception printstacktrace printwriter add element to the designated print writer public void output print writer out out write create start tag if get filter state out write get filter process get tag text else out write get tag text if get need closing tag out write create end tag printwriter printwriter createstarttag getfilterstate getfilter gettagtext gettagtext getneedclosingtag createendtag set the tab level for pretty printing public void set tab level int tab level this tab level tab level settablevel tablevel tablevel tablevel public int get tab level return tab level gettablevel tablevel protected void put tabs int tab count output stream out throws io exception for int i 0 i tab count i out write t puttabs tabcount outputstream ioexception tabcount protected void put tabs int tab count print writer out for int i 0 i tab count i out print t puttabs tabcount printwriter tabcount get message object return mag private static msg get if s msg null s msg new msg return s msg s_msg s_msg s_msg constructor private msg get language specific message map param ad language language key return hash map of language private c cache string string get msg map string ad language string ad language ad language if ad language null ad language length 0 ad language language getbasead language do we have the language c cache string string ret value c cache string string m languages get ad language if ret value null ret value size 0 return ret value load language ret value init msg ad language if ret value null m languages put ad language ret value return ret value return ret value ad_language hashmap ccache getmsgmap ad_language ad_language ad_language ad_language ad_language ad_language getbasead_language ccache retvalue ccache m_languages ad_language retvalue retvalue retvalue retvalue initmsg ad_language retvalue m_languages ad_language retvalue retvalue retvalue init message hash map the initial call is from a login confirm panel init the second from env verify language param ad language language return cache hash map private c cache string string init msg string ad language trace print stack c cache string string msg new c cache string string ad message map size 0 if db is connected s log log level severe no db connection return null try prepared statement pstmt null if ad language null ad language length 0 env is base language ad language ad language pstmt db prepare statement select value msg text msg tip from ad message null else pstmt db prepare statement select m value t msg text t msg tip from ad message trl t ad message m where m ad message id t ad message id and t ad language null pstmt set string 1 ad language result set rs pstmt execute query get values while rs next string ad message rs get string 1 string buffer msg text new string buffer msg text append rs get string 2 string msg tip rs get string 3 if msg tip null message tip on next line if exists msg text append append separator append msg tip msg put ad message msg text to string rs close pstmt close catch sql exception e s log log level severe init msg e return null if msg size 100 s log log level severe too few msg size records found for ad language return null s log info records msg size ad language return msg hashmap alogin confirmpanel verifylanguage ad_language hashmap ccache initmsg ad_language printstack ccache ccache ad_message map_size isconnected s_log preparedstatement ad_language ad_language isbaselanguage ad_language ad_language preparestatement msgtext msgtip ad_message preparestatement msgtext msgtip ad_message_trl ad_message ad_message_id ad_message_id ad_language setstring ad_language resultset executequery ad_message getstring stringbuffer msgtext stringbuffer msgtext getstring msgtip getstring msgtip messagetip msgtext msgtip ad_message msgtext tostring sqlexception s_log initmsg s_log ad_language s_log ad_language reset message cache public void reset if m languages null return clear all languages iterator iterator m languages values iterator while iterator has next hash map hm hash map iterator next hm clear m languages clear m_languages m_languages hasnext hashmap hashmap m_languages return an array of the installed languages return array of loaded languages or null public string get languages if m languages null return null string ret value new string m languages size m languages key set to array ret value return ret value getlanguages m_languages retvalue m_languages m_languages keyset toarray retvalue retvalue check if language is loaded param language language code return true if language is loaded public boolean is loaded string language if m languages null return false return m languages contains key language isloaded m_languages m_languages containskey lookup term param ad language language param text text return translated term or null private string lookup string ad language string text if text null return null if ad language null ad language length 0 return text hardcoded trl if text equals text equals return file separator if text equals text equals return file path separator if text equals compiere home return compiere get compiere home if text equals bat text equals sh if system get property os name starts with win return bat return sh if text equals copy right return compiere copyright hash map lang map get msg map ad language if lang map null return null return string lang map get text ad_language ad_language ad_language ad_language pathseparator compiere_home getcompierehome getproperty startswith copyright hashmap langmap getmsgmap ad_language langmap langmap get translated text for ad message param ad language language param ad message message key return translated text public static string get msg string ad language string ad message if ad message null ad message length 0 return string ad language ad language if ad language null ad language length 0 ad language language getbasead language string ret str get lookup ad language ad message if ret str null ret str length 0 s log warning not found ad message return ad message return ret str ad_message ad_language ad_message getmsg ad_language ad_message ad_message ad_message ad_language ad_language ad_language ad_language ad_language getbasead_language retstr ad_language ad_message retstr retstr s_log ad_message ad_message retstr get translated text message for ad message param ctx context to retrieve language param ad message message key return translated text public static string get msg properties ctx string ad message return get msg env getad language ctx ad message ad_message ad_message getmsg ad_message getmsg getad_language ad_message get translated text message for ad message param language language param ad message message key return translated text public static string get msg language language string ad message return get msg language getad language ad message ad_message ad_message getmsg ad_message getmsg getad_language ad_message get translated text message for ad message param ad language language param ad message message key param get text if true only return text if false only return tip return translated text public static string get msg string ad language string ad message boolean get text string ret str get msg ad language ad message int pos ret str index of separator no tip if pos 1 if get text return ret str else return else with tip if get text ret str ret str substring 0 pos else int start pos separator length int end ret str length ret str ret str substring start return ret str ad_message ad_language ad_message gettext getmsg ad_language ad_message gettext retstr getmsg ad_language ad_message retstr indexof gettext retstr gettext retstr retstr retstr retstr retstr retstr get translated text message for ad message param ctx context to retrieve language param ad message message key param get text if true only return text if false only return tip return translated text public static string get msg properties ctx string ad message boolean get text return get msg env getad language ctx ad message get text ad_message ad_message gettext getmsg ad_message gettext getmsg getad_language ad_message gettext get translated text message for ad message param language language param ad message message key param get text if true only return text if false only return tip return translated text public static string get msg language language string ad message boolean get text return get msg language getad language ad message get text ad_message ad_message gettext getmsg ad_message gettext getmsg getad_language ad_message gettext get clear text for ad message with parameters param ctx context to retrieve language param ad message message yey param args message format arguments return translated text see java text message format for formatting options public static string get msg properties ctx string ad message object args return get msg env getad language ctx ad message args ad_message ad_message messageformat messageformat getmsg ad_message getmsg getad_language ad_message get clear text for ad message with parameters param language language param ad message message yey param args message format arguments return translated text see java text message format for formatting options public static string get msg language language string ad message object args return get msg language getad language ad message args ad_message ad_message messageformat messageformat getmsg ad_message getmsg getad_language ad_message get clear text for ad message with parameters param ad language language param ad message message yey param args message format arguments return translated text see java text message format for formatting options public static string get msg string ad language string ad message object args string msg get msg ad language ad message string ret str msg try ret str message format format msg args format string catch exception e s log log level severe msg e return ret str ad_message ad_language ad_message messageformat messageformat getmsg ad_language ad_message getmsg ad_language ad_message retstr retstr messageformat s_log retstr get amount in words param language language param amount numeric amount 352 80 return amount in words three five two 80 100 public static string get amt in words language language string amount if amount null language null return amount try to find class string class name org compiere util amtinwords try class name language get language code to upper case class clazz class for name class name amt in words aiw amt in words clazz new instance return aiw get amt in words amount catch class not found exception e s log log level finer class not found class name catch exception e s log log level severe class name e fallback string buffer sb new string buffer int pos amount last index of int pos2 amount last index of if pos2 pos pos pos2 for int i 0 i amount length i if pos i we are done string cents amount substring i 1 sb append append cents append 100 break else char c amount char at i if c c skip thousand separator continue if sb length 0 sb append sb append get msg language string value of c return sb to string getamtinwords classname amtinwords_ classname getlanguagecode touppercase forname classname amtinwords amtinwords newinstance getamtinwords classnotfoundexception s_log classname s_log classname stringbuffer stringbuffer lastindexof lastindexof charat getmsg valueof tostring get translation for element param ad language language param column name column name param isso trx if false po terminology is used if exists return name of the column or if not found public static string get element string ad language string column name boolean isso trx if column name null column name equals return string ad language ad language if ad language null ad language length 0 ad language language getbasead language check ad element string ret str try prepared statement pstmt null try if ad language null ad language length 0 env is base language ad language ad element pstmt db prepare statement select name po name from ad element where upper column name null else pstmt db prepare statement select t name t po name from ad element trl t ad element e where t ad element id e ad element id and upper e column name and t ad language null pstmt set string 2 ad language catch exception e return column name pstmt set string 1 column name to upper case result set rs pstmt execute query if rs next ret str rs get string 1 if isso trx string temp rs get string 2 if temp null temp length 0 ret str temp rs close pstmt close catch sql exception e s log log level severe get element e return if ret str null return ret str trim return ret str ad_language columnname issotrx getelement ad_language columnname issotrx columnname columnname ad_language ad_language ad_language ad_language ad_language getbasead_language ad_element retstr preparedstatement ad_language ad_language isbaselanguage ad_language ad_element preparestatement po_name ad_element columnname preparestatement po_name ad_element_trl ad_element ad_element_id ad_element_id columnname ad_language setstring ad_language columnname setstring columnname touppercase resultset executequery retstr getstring issotrx getstring retstr sqlexception s_log getelement retstr retstr retstr get translation for element using sales terminology param ctx context param column name column name return name of the column or if not found public static string get element properties ctx string column name return get element env getad language ctx column name true columnname getelement columnname getelement getad_language columnname get translation for element param ctx context param column name column name param isso trx sales transaction return name of the column or if not found public static string get element properties ctx string column name boolean isso trx return get element env getad language ctx column name isso trx columnname issotrx getelement columnname issotrx getelement getad_language columnname issotrx translate text pre check ad message ad message msg text check ad element column name name pre if checking ad element the so terminology is used param ad language language param isso trx sales order context param text text msg text or element name return translated text or original text if not found public static string translate string ad language boolean isso trx string text if text null text equals return string ad language ad language if ad language null ad language length 0 ad language language getbasead language check ad message string ret str get lookup ad language text if ret str null return ret str check ad element ret str get element ad language text isso trx if ret str equals return ret str trim nothing found if text starts with s log fine not found text return text ad_message ad_message msgtext ad_element columnname ad_element ad_language issotrx msgtext ad_language issotrx ad_language ad_language ad_language ad_language ad_language getbasead_language ad_message retstr ad_language retstr retstr ad_element retstr getelement ad_language issotrx retstr retstr startswith s_log translate text so context pre check ad message ad message msg text check ad element column name name pre if checking ad element the so terminology is used param ad language language param text text msg text or element name return translated text or original text if not found public static string translate string ad language string text return translate ad language true text ad_message ad_message msgtext ad_element columnname ad_element ad_language msgtext ad_language ad_language translate text pre check ad message ad message msg text check ad element column name name pre param ctx context param text text msg text or element name return translated text or original text if not found public static string translate properties ctx string text if text null text length 0 return text string s string ctx get text if s null s length 0 return s return translate env getad language ctx env isso trx ctx text ad_message ad_message msgtext ad_element columnname msgtext getad_language issotrx translate text pre check ad message ad message msg text check ad element column name name pre param language language param text text return translated text or original text if not found public static string translate language language string text return translate language getad language false text ad_message ad_message msgtext ad_element columnname getad_language translate elements enclosed in at sign param ctx context param text text return translated text or original text if not found public static string parse translation properties ctx string text if text null text length 0 return text string in str text string token string buffer out str new string buffer int i in str index of while i 1 out str append in str substring 0 i up to in str in str substring i 1 in str length from first int j in str index of next if j 0 no second tag in str in str break token in str substring 0 j out str append translate ctx token replace context in str in str substring j 1 in str length from second i in str index of out str append in str add remainder return out str to string parsetranslation instr stringbuffer outstr stringbuffer instr indexof outstr instr instr instr instr instr indexof instr instr instr outstr instr instr instr instr indexof outstr instr outstr tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bp group id p c bp group id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals allocate oldest p allocateoldest y equals para i get parameter else if name equals apar p apar string para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bp_group_id p_c_bp_group_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint allocateoldest p_allocateoldest getparameter p_apar getparameter process return message throws exception protected string do it throws exception log info c bp group id p c bp group id c bpartner id p c bpartner id oldest p allocateoldest int countbp 0 int count alloc 0 if p c bpartner id 0 count alloc allocatebp p c bpartner id if count alloc 0 countbp else if p c bp group id 0 string sql select c bpartner id from c bpartner where c bp group id order by value prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 p c bp group id result set rs pstmt execute query while rs next int c bpartner id rs get int 1 int count allocatebp c bpartner id if count 0 countbp count alloc count commit rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null else string sql select c bpartner id from c bpartner where ad client id order by value prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 env getad client id get ctx result set rs pstmt execute query while rs next int c bpartner id rs get int 1 int count allocatebp c bpartner id if count 0 countbp count alloc count commit rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return created countbp count alloc doit c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id p_allocateoldest countalloc p_c_bpartner_id countalloc p_c_bpartner_id countalloc p_c_bp_group_id c_bpartner_id c_bpartner c_bp_group_id preparedstatement preparestatement get_trxname setint p_c_bp_group_id resultset executequery c_bpartner_id getint c_bpartner_id countalloc c_bpartner_id c_bpartner ad_client_id preparedstatement preparestatement get_trxname setint getad_client_id getctx resultset executequery c_bpartner_id getint c_bpartner_id countalloc countalloc allocate bp param c bpartner id return number of allocations private int allocatebp int c bpartner id throws exception get payments c bpartner id get invoices c bpartner id log info 1 c bpartner id c bpartner id payments m payments length invoices m invoices length if m payments length m invoices length 2 return 0 payment info invoice or pay selection int count allocatebp payment with info if count 0 get payments c bpartner id for next get invoices c bpartner id log info 2 c bpartner id c bpartner id payments m payments length invoices m invoices length if m payments length m invoices length 2 return count all int new count allocateb partner all if new count 0 count new count get payments c bpartner id for next get invoices c bpartner id process allocation log info 3 c bpartner id c bpartner id payments m payments length invoices m invoices length if m payments length m invoices length 2 return count one one new count allocatebp one to one if new count 0 count new count get payments c bpartner id for next get invoices c bpartner id process allocation log info 4 c bpartner id c bpartner id payments m payments length invoices m invoices length if m payments length m invoices length 2 return count oldest first if p allocateoldest new count allocatebp oldest first if new count 0 count new count get payments c bpartner id for next get invoices c bpartner id process allocation log info 5 c bpartner id c bpartner id payments m payments length invoices m invoices length if m payments length m invoices length 2 return count other e g allocation if close and return count c_bpartner_id c_bpartner_id getpayments c_bpartner_id getinvoices c_bpartner_id c_bpartner_id c_bpartner_id m_payments m_invoices m_payments m_invoices allocatebppaymentwithinfo getpayments c_bpartner_id getinvoices c_bpartner_id c_bpartner_id c_bpartner_id m_payments m_invoices m_payments m_invoices newcount allocatebpartnerall newcount newcount getpayments c_bpartner_id getinvoices c_bpartner_id processallocation c_bpartner_id c_bpartner_id m_payments m_invoices m_payments m_invoices newcount allocatebponetoone newcount newcount getpayments c_bpartner_id getinvoices c_bpartner_id processallocation c_bpartner_id c_bpartner_id m_payments m_invoices m_payments m_invoices p_allocateoldest newcount allocatebpoldestfirst newcount newcount getpayments c_bpartner_id getinvoices c_bpartner_id processallocation c_bpartner_id c_bpartner_id m_payments m_invoices m_payments m_invoices get payments of bp param c bpartner id id return unallocated payments private m payment get payments int c bpartner id array list m payment list new array list m payment string sql select from c payment where is allocated n and processed y and c bpartner id and is prepayment n and c charge id is null if only ap equals p apar sql and is receipt n else if only ar equals p apar sql and is receipt y sql order by date trx prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next m payment payment new m payment get ctx rs get trxname big decimal allocated payment get allocated amt if allocated null allocated compare to payment get pay amt 0 payment set is allocated true payment save else list add payment rs close pstmt close pstmt null catch exception e log log level severe get payments e try if pstmt null pstmt close pstmt null catch exception e pstmt null m payments new m payment list size list to array m payments return m payments c_bpartner_id mpayment getpayments c_bpartner_id arraylist mpayment arraylist mpayment c_payment isallocated c_bpartner_id isprepayment c_charge_id only_ap p_apar isreceipt only_ar p_apar isreceipt datetrx preparedstatement preparestatement get_trxname setint c_bpartner_id resultset executequery mpayment mpayment getctx get_trxname bigdecimal getallocatedamt compareto getpayamt setisallocated getpayments m_payments mpayment toarray m_payments m_payments get invoices of bp param c bpartner id id return unallocated invoices private m invoice get invoices int c bpartner id array list m invoice list new array list m invoice string sql select from c invoice where is paid n and processed y and c bpartner id if only ap equals p apar sql and isso trx n else if only ar equals p apar sql and isso trx y sql order by date invoiced prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next m invoice invoice new m invoice get ctx rs get trxname if invoice get open amt false null signum 0 invoice set is paid true invoice save else list add invoice rs close pstmt close pstmt null catch exception e log log level severe get invoicess e try if pstmt null pstmt close pstmt null catch exception e pstmt null m invoices new m invoice list size list to array m invoices return m invoices c_bpartner_id minvoice getinvoices c_bpartner_id arraylist minvoice arraylist minvoice c_invoice ispaid c_bpartner_id only_ap p_apar issotrx only_ar p_apar issotrx dateinvoiced preparedstatement preparestatement get_trxname setint c_bpartner_id resultset executequery minvoice minvoice getctx get_trxname getopenamt setispaid getinvoicess m_invoices minvoice toarray m_invoices m_invoices allocate individual payments with payment references return number of allocations private int allocatebp payment with info int count 0 see if there is a direct link invoice or pay selection for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue big decimal allocated amt payment get allocated amt log info allocate payment with info payment allocated allocated amt if allocated amt null allocated amt signum 0 continue big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate log fine allocate payment with info available available amt if payment getc invoice id 0 for int i 0 i m invoices length i m invoice invoice m invoices i if invoice is paid continue log fine allocate individual payments invoice if payment getc invoice id invoice getc invoice id if payment getc currency id invoice getc currency id big decimal open amt invoice get open amt true null if invoice isso trx open amt open amt negate log fine allocate payment with info invoice open open amt with discount etc if available amt compare to open amt 0 if payment allocate it add log 0 payment get date acct open amt payment get document no 1 count break else mixed currency invoice found for all invoices payment has invoice else no direct invoice m pay selection check ps check m pay selection check get of payment get ctx payment getc payment id get trxname if ps check null continue big decimal total invoice env zero m pay selection line ps lines ps check get pay selection lines false for int i 0 i ps lines length i m pay selection line line ps lines i m invoice invoice line get invoice if payment getc currency id invoice getc currency id big decimal invoice amt invoice get open amt true null big decimal over under line get open amt subtract line get pay amt subtract line get discount amt subtract line get difference amt invoice amt invoice amt subtract line get discount amt subtract line get difference amt subtract over under if invoice isso trx invoice amt invoice amt negate log fine allocate payment with info invoice invoice invoice amt total invoice total invoice add invoice amt else multi currency if available amt compare to total invoice 0 if payment allocate it add log 0 payment get date acct available amt payment get document no n count no direct invoice see if there is a direct link return count allocatebppaymentwithinfo m_payments mpayment m_payments isallocated bigdecimal allocatedamt getallocatedamt allocatepaymentwithinfo allocatedamt allocatedamt allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt allocatepaymentwithinfo availableamt getc_invoice_id m_invoices minvoice m_invoices ispaid allocateindividualpayments getc_invoice_id getc_invoice_id getc_currency_id getc_currency_id bigdecimal openamt getopenamt issotrx openamt openamt allocatepaymentwithinfo openamt availableamt compareto openamt allocateit addlog getdateacct openamt getdocumentno mpayselectioncheck pscheck mpayselectioncheck getofpayment getctx getc_payment_id get_trxname pscheck bigdecimal totalinvoice mpayselectionline pslines pscheck getpayselectionlines pslines mpayselectionline pslines minvoice getinvoice getc_currency_id getc_currency_id bigdecimal invoiceamt getopenamt bigdecimal overunder getopenamt getpayamt getdiscountamt getdifferenceamt invoiceamt invoiceamt getdiscountamt getdifferenceamt overunder issotrx invoiceamt invoiceamt allocatepaymentwithinfo invoiceamt totalinvoice totalinvoice invoiceamt availableamt compareto totalinvoice allocateit addlog getdateacct availableamt getdocumentno allocate payment invoice 1 1 return allocations private int allocatebp one to one throws exception int count 0 for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue big decimal allocated amt payment get allocated amt log info allocate one to one payment allocated allocated amt if allocated amt null allocated amt signum 0 continue big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate log fine allocate one to one available available amt for int i 0 i m invoices length i m invoice invoice m invoices i if invoice null invoice is paid continue if payment getc currency id invoice getc currency id log fine allocateb partner all invoice big decimal open amt invoice get open amt true null if invoice isso trx open amt open amt negate big decimal difference available amt subtract open amt abs log fine allocate one to one invoice open open amt difference difference if difference signum 0 timestamp date acct payment get date acct if invoice get date acct after date acct date acct invoice get date acct if create allocation payment getc currency id 1 1 available amt date acct available amt null null null invoice getc bpartner id payment getc payment id invoice getc invoice id invoice getad org id throw new compiere system error cannot create allocation process allocation count m invoices i null remove invoice m payments p null payment null break else multi currency for all invoices for all payments return count allocatebponetoone m_payments mpayment m_payments isallocated bigdecimal allocatedamt getallocatedamt allocateonetoone allocatedamt allocatedamt allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt allocateonetoone availableamt m_invoices minvoice m_invoices ispaid getc_currency_id getc_currency_id allocatebpartnerall bigdecimal openamt getopenamt issotrx openamt openamt bigdecimal availableamt openamt allocateonetoone openamt dateacct getdateacct getdateacct dateacct dateacct getdateacct createallocation getc_currency_id availableamt dateacct availableamt getc_bpartner_id getc_payment_id getc_invoice_id getad_org_id compieresystemerror processallocation m_invoices m_payments allocate all payments invoices using accounting currency return allocations private int allocateb partner all throws exception int c currency id m client get get ctx getc currency id timestamp date acct null payments big decimal total payments env zero for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue big decimal allocated amt payment get allocated amt log info allocateb partner all payment allocated allocated amt if allocated amt null allocated amt signum 0 continue big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate foreign currency if payment getc currency id c currency id continue log fine allocateb partner all available available amt if date acct null payment get date acct after date acct date acct payment get date acct total payments total payments add available amt invoices big decimal total invoices env zero for int i 0 i m invoices length i m invoice invoice m invoices i if invoice is paid continue log info allocateb partner all invoice big decimal open amt invoice get open amt true null if invoice isso trx open amt open amt negate foreign currency if invoice getc currency id c currency id continue log fine allocateb partner all open open amt if date acct null invoice get date acct after date acct date acct invoice get date acct total invoices total invoices add open amt big decimal difference total invoices subtract total payments log info allocateb partner all invoices total invoices payments total payments difference difference if difference signum 0 for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue big decimal allocated amt payment get allocated amt if allocated amt null allocated amt signum 0 continue big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate foreign currency if payment getc currency id c currency id continue if create allocation c currency id bp all date acct available amt null null null payment getc bpartner id payment getc payment id 0 payment getad org id throw new compiere system error cannot create allocation for all payments for int i 0 i m invoices length i m invoice invoice m invoices i if invoice is paid continue big decimal open amt invoice get open amt true null if invoice isso trx open amt open amt negate foreign currency if invoice getc currency id c currency id continue if create allocation c currency id bp all date acct open amt null null null invoice getc bpartner id 0 invoice getc invoice id invoice getad org id throw new compiere system error cannot create allocation for all invoices process allocation return 1 difference ok return 0 allocatebpartnerall c_currency_id mclient getctx getc_currency_id dateacct bigdecimal totalpayments m_payments mpayment m_payments isallocated bigdecimal allocatedamt getallocatedamt allocatebpartnerall allocatedamt allocatedamt allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt getc_currency_id c_currency_id allocatebpartnerall availableamt dateacct getdateacct dateacct dateacct getdateacct totalpayments totalpayments availableamt bigdecimal totalinvoices m_invoices minvoice m_invoices ispaid allocatebpartnerall bigdecimal openamt getopenamt issotrx openamt openamt getc_currency_id c_currency_id allocatebpartnerall openamt dateacct getdateacct dateacct dateacct getdateacct totalinvoices totalinvoices openamt bigdecimal totalinvoices totalpayments allocatebpartnerall totalinvoices totalpayments m_payments mpayment m_payments isallocated bigdecimal allocatedamt getallocatedamt allocatedamt allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt getc_currency_id c_currency_id createallocation c_currency_id dateacct availableamt getc_bpartner_id getc_payment_id getad_org_id compieresystemerror m_invoices minvoice m_invoices ispaid bigdecimal openamt getopenamt issotrx openamt openamt getc_currency_id c_currency_id createallocation c_currency_id dateacct openamt getc_bpartner_id getc_invoice_id getad_org_id compieresystemerror processallocation allocate oldest first using accounting currency return allocations private int allocatebp oldest first throws exception int c currency id m client get get ctx getc currency id timestamp date acct null payments big decimal total payments env zero for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue if payment getc currency id c currency id continue big decimal allocated amt payment get allocated amt log info allocatebp oldest first payment allocated allocated amt big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate log fine allocatebp oldest first available available amt if date acct null payment get date acct after date acct date acct payment get date acct total payments total payments add available amt invoices big decimal total invoices env zero for int i 0 i m invoices length i m invoice invoice m invoices i if invoice is paid continue if invoice getc currency id c currency id continue big decimal open amt invoice get open amt true null log fine allocatebp oldest first invoice if invoice isso trx open amt open amt negate foreign currency log fine allocatebp oldest first open open amt if date acct null invoice get date acct after date acct date acct invoice get date acct total invoices total invoices add open amt must be either ap or ar balance if total invoices signum total payments signum log fine allocateb partner all signum invoices total invoices signum payments total payments signum return 0 big decimal difference total invoices subtract total payments big decimal max amt total invoices abs min total payments abs if total invoices signum 0 max amt max amt negate log info allocateb partner all invoices total invoices payments total payments difference difference max max amt allocate payments up to max big decimal allocated payments env zero for int p 0 p m payments length p m payment payment m payments p if payment is allocated continue if payment getc currency id c currency id continue big decimal allocated amt payment get allocated amt if allocated amt null allocated amt signum 0 continue big decimal available amt payment get pay amt add payment get discount amt add payment get write off amt add payment get over under amt if payment is receipt available amt available amt negate allocated payments allocated payments add available amt if total invoices signum 0 allocated payments compare to max amt 0 total invoices signum 0 allocated payments compare to max amt 0 big decimal diff allocated payments subtract max amt available amt available amt subtract diff allocated payments allocated payments subtract diff log fine allocatebp oldest first payment allocated available amt if create allocation c currency id bp oldest difference abs date acct available amt null null null payment getc bpartner id payment getc payment id 0 payment getad org id throw new compiere system error cannot create allocation if allocated payments compare to max amt 0 break for all payments allocated invoices up to max big decimal allocated invoices env zero for int i 0 i m invoices length i m invoice invoice m invoices i if invoice is paid continue if invoice getc currency id c currency id continue big decimal open amt invoice get open amt true null if invoice isso trx open amt open amt negate allocated invoices allocated invoices add open amt if total invoices signum 0 allocated invoices compare to max amt 0 total invoices signum 0 allocated invoices compare to max amt 0 big decimal diff allocated invoices subtract max amt open amt open amt subtract diff allocated invoices allocated invoices subtract diff if open amt signum 0 break log fine allocatebp oldest first invoice allocated open amt if create allocation c currency id bp oldest difference abs date acct open amt null null null invoice getc bpartner id 0 invoice getc invoice id invoice getad org id throw new compiere system error cannot create allocation if allocated invoices compare to max amt 0 break for all invoices if allocated payments compare to allocated invoices 0 throw new compiere system error allocated payments allocated payments invoices allocated invoices process allocation return 1 allocatebpoldestfirst c_currency_id mclient getctx getc_currency_id dateacct bigdecimal totalpayments m_payments mpayment m_payments isallocated getc_currency_id c_currency_id bigdecimal allocatedamt getallocatedamt allocatebpoldestfirst allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt allocatebpoldestfirst availableamt dateacct getdateacct dateacct dateacct getdateacct totalpayments totalpayments availableamt bigdecimal totalinvoices m_invoices minvoice m_invoices ispaid getc_currency_id c_currency_id bigdecimal openamt getopenamt allocatebpoldestfirst issotrx openamt openamt allocatebpoldestfirst openamt dateacct getdateacct dateacct dateacct getdateacct totalinvoices totalinvoices openamt totalinvoices totalpayments allocatebpartnerall totalinvoices totalpayments bigdecimal totalinvoices totalpayments bigdecimal maxamt totalinvoices totalpayments totalinvoices maxamt maxamt allocatebpartnerall totalinvoices totalpayments maxamt bigdecimal allocatedpayments m_payments mpayment m_payments isallocated getc_currency_id c_currency_id bigdecimal allocatedamt getallocatedamt allocatedamt allocatedamt bigdecimal availableamt getpayamt getdiscountamt getwriteoffamt getoverunderamt isreceipt availableamt availableamt allocatedpayments allocatedpayments availableamt totalinvoices allocatedpayments compareto maxamt totalinvoices allocatedpayments compareto maxamt bigdecimal allocatedpayments maxamt availableamt availableamt allocatedpayments allocatedpayments allocatebpoldestfirst availableamt createallocation c_currency_id dateacct availableamt getc_bpartner_id getc_payment_id getad_org_id compieresystemerror allocatedpayments compareto maxamt bigdecimal allocatedinvoices m_invoices minvoice m_invoices ispaid getc_currency_id c_currency_id bigdecimal openamt getopenamt issotrx openamt openamt allocatedinvoices allocatedinvoices openamt totalinvoices allocatedinvoices compareto maxamt totalinvoices allocatedinvoices compareto maxamt bigdecimal allocatedinvoices maxamt openamt openamt allocatedinvoices allocatedinvoices openamt allocatebpoldestfirst openamt createallocation c_currency_id dateacct openamt getc_bpartner_id getc_invoice_id getad_org_id compieresystemerror allocatedinvoices compareto maxamt allocatedpayments compareto allocatedinvoices compieresystemerror allocatedpayments allocatedinvoices processallocation create allocation allocation param c currency id currency param description decription param amount amount param discount amt discount param write off amt write off param over under amt over under param c bpartner id partner param c payment id payment param c invoice id invoice return true if created private boolean create allocation int c currency id string description timestamp date acct big decimal amount big decimal discount amt big decimal write off amt big decimal over under amt int c bpartner id int c payment id int c invoice id int ad org id process old allocation if m allocation null m allocation getc currency id c currency id process allocation new allocation if m allocation null m allocation new m allocation hdr get ctx false date acct automatic c currency id auto description get trxname m allocation setad org id ad org id if m allocation save return false new allocation line m allocation line a line new m allocation line m allocation amount discount amt write off amt over under amt a line setc bpartner id c bpartner id a line setc payment id c payment id a line setc invoice id c invoice id return a line save c_currency_id discountamt writeoffamt overunderamt c_bpartner_id c_payment_id c_invoice_id createallocation c_currency_id dateacct bigdecimal bigdecimal discountamt bigdecimal writeoffamt bigdecimal overunderamt c_bpartner_id c_payment_id c_invoice_id ad_org_id m_allocation m_allocation getc_currency_id c_currency_id processallocation m_allocation m_allocation mallocationhdr getctx dateacct c_currency_id get_trxname m_allocation setad_org_id ad_org_id m_allocation mallocationline aline mallocationline m_allocation discountamt writeoffamt overunderamt aline setc_bpartner_id c_bpartner_id aline setc_payment_id c_payment_id aline setc_invoice_id c_invoice_id aline process allocation return true if processes saved or none private boolean process allocation if m allocation null return true boolean success m allocation process it m allocation hdr docaction complete if success success m allocation save else m allocation save add log 0 m allocation get date acct null m allocation get description m allocation null return success processallocation m_allocation m_allocation processit mallocationhdr docaction_complete m_allocation m_allocation addlog m_allocation getdateacct m_allocation getdescription m_allocation set to one line param var y or something else public void set one line string var m oneline y equals var setoneline m_oneline start tag return skip body throws jsp exception public int do start tag throws jsp exception http session session page context get session http servlet request request http servlet request page context get request web basket wb web basket session get attribute web basket name log fine do start tag web basket wb if wb null wb get line count 0 log fine do start tag web basket exists jsp writer out page context get out html code html new html code if m oneline html add element new hr 90 left img img new img basket gif img set border 0 a a new a basket jsp a set class menu main if m oneline a add element img a add element basket html add element a html add element nbsp else a add element basket a add element img html add element a list content p p new p p set class cbasket array list lines wb get lines for int i 0 i lines size i p add element br object line lines get i p add element line to string p add element br br html add element p html add element new br img new img checkout gif img set border 0 string url check out servlet name if request is secure url https request get server name request get context path check out servlet name a new a url a set class menu main a add element create order a add element img html add element a html output out return skip body skip_body jspexception dostarttag jspexception httpsession pagecontext getsession httpservletrequest httpservletrequest pagecontext getrequest webbasket webbasket getattribute webbasket dostarttag webbasket getlinecount dostarttag webbasket jspwriter pagecontext getout htmlcode htmlcode m_oneline addelement setborder setclass menumain m_oneline addelement addelement addelement addelement addelement addelement addelement setclass arraylist getlines addelement addelement tostring addelement addelement addelement setborder checkoutservlet issecure getservername getcontextpath checkoutservlet setclass menumain addelement addelement addelement skip_body end tag return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page create jpeg file from window param window window param file name optional file name return true if created public static boolean createjpeg window window string file name if window null file name null new illegal argument exception screen shot createjpeg window os null get file file file getjpg file window if file null return false log config file file if file exists file delete get writer iterator writers imageio get image writers by format name jpg image writer writer image writer writers next if writer null log log level severe no image writer return false get image buffered image bi get image window write image try image output stream ios imageio create image output stream file writer set output ios writer write bi ios flush ios close catch io exception ex log log level severe ex ex return false return true filename filename filename illegalargumentexception screenshot getjpgfile getimagewritersbyformatname imagewriter imagewriter imagewriter bufferedimage getimage imageoutputstream createimageoutputstream setoutput ioexception get jpeg file param parent parent return file protected static file getjpg file component parent j file chooser fc new j file chooser fc add choosable file filter new extension file filter jpg msg get msg env get ctx filejpeg if fc show save dialog parent j file chooser approve option return null file file fc get selected file if file null return null string file name file get absolute path if file name to upper case equals jpg file name to upper case equals jpeg file name jpg return new file file name getjpgfile jfilechooser jfilechooser addchoosablefilefilter extensionfilefilter getmsg getctx showsavedialog jfilechooser approve_option getselectedfile filename getabsolutepath filename touppercase filename touppercase filename filename get image of window param window window return image protected static buffered image get image window window buffered image bi new buffered image window get width window get height buffered image type int rgb type int argb is tinted red window paint all bi create graphics return bi bufferedimage getimage bufferedimage bufferedimage getwidth getheight bufferedimage type_int_rgb type_int_argb paintall creategraphics configj boss public config tomcat configuration data data super data configjboss configtomcat configurationdata initialize public void init p data set apps server deploy dir get deploy dir p data set apps server deploy dir true p data set apps serverjnp port 1099 p data set apps serverjnp port false p data set apps server web port 80 p data set apps server web port true p data set apps serverssl port 443 p data set apps serverssl port true p_data setappsserverdeploydir getdeploydir p_data setappsserverdeploydir p_data setappsserverjnpport p_data setappsserverjnpport p_data setappsserverwebport p_data setappsserverwebport p_data setappsserversslport p_data setappsserversslport get notes return notes public string get notes return a dempiere requires tomcat 5 5 9 n please set the web port in catalina home conf server xml c program files apache software foundation tomcat 5 5 conf server xml n getnotes adempiere nplease catalina_home get deployment dir return deployment dir private string get deploy dir return c file separator program files file separator apache software foundation file separator tomcat 5 5 getdeploydir test return error message or null if ok public string test apps server string server p data get apps server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 inet address apps server null string error not correct apps server server try if pass apps server inet address get by name server catch exception e error e get message pass false signalok get panel ok apps server error apps server pass true error if pass return error log info ok apps server apps server set property configuration data compiere apps server apps server get host name set property configuration data compiere apps type p data get apps server type deployment dir file deploy new file p data get apps server deploy dir pass deploy exists error catalina home not found deploy signalok get panel ok deploy dir error deploy dir pass true error if pass return error set property configuration data compiere apps deploy p data get apps server deploy dir log info ok deploy directory deploy string base dir p data get apps server deploy dir if base dir ends with file separator base dir file separator need to have shared lib string shared lib base dir shared file separator lib file shared lib dir new file shared lib pass shared lib dir exists error not found shared library shared lib signalok get panel ok deploy dir error deploy dir pass true error if pass return error need to have webapps string web apps base dir webapps file web apps dir new file web apps pass web apps dir exists error not found webapps shared lib signalok get panel ok deploy dir error deploy dir pass true error if pass return error return null appsserver p_data getappsserver tolowercase indexof inetaddress appsserver appsserver appsserver inetaddress getbyname getmessage getpanel okappsserver errorappsserver appsserver appsserver setproperty configurationdata compiere_apps_server appsserver gethostname setproperty configurationdata compiere_apps_type p_data getappsservertype p_data getappsserverdeploydir catalina_home getpanel okdeploydir errordeploydir setproperty configurationdata compiere_apps_deploy p_data getappsserverdeploydir basedir p_data getappsserverdeploydir basedir endswith basedir sharedlib basedir sharedlibdir sharedlib sharedlibdir sharedlib getpanel okdeploydir errordeploydir webapps basedir webappsdir webapps webappsdir sharedlib getpanel okdeploydir errordeploydir connection editor creating new connection public c connection editor super set name connection editor cconnectioneditor mouselistener ml new cconnectioneditor mouselistener layout m text set editable false m text set border null m text add mouse listener ml m server set icon new image icon get class get resource server16 gif m server set focusable false m server set border null m server set opaque true m server add mouse listener ml m db set icon new image icon get class get resource database16 gif m db set focusable false m db set border null m db set opaque true m db add mouse listener ml look and feel install border this text field border set layout new border layout 0 0 add m server border layout west add m text border layout center add m db border layout east cconnectioneditor setname connectioneditor cconnectioneditor_mouselistener cconnectioneditor_mouselistener m_text seteditable m_text setborder m_text addmouselistener m_server seticon imageicon getclass getresource m_server setfocusable m_server setborder m_server setopaque m_server addmouselistener m_db seticon imageicon getclass getresource m_db setfocusable m_db setborder m_db setopaque m_db addmouselistener lookandfeel installborder textfield setlayout borderlayout m_server borderlayout m_text borderlayout m_db borderlayout enable editor param rw true if you can enter select data public void set read write boolean rw m rw rw set background false setreadwrite m_rw setbackground is it possible to edit return true if editable public boolean is read write return m rw isreadwrite m_rw set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory setmandatory m_mandatory is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error color c null if error c compiereplaf getfieldbackground error else if m rw c compiereplaf getfieldbackground inactive else if m mandatory c compiereplaf getfieldbackground mandatory else c compiereplaf getfieldbackground normal set background c setbackground getfieldbackground_error m_rw getfieldbackground_inactive m_mandatory getfieldbackground_mandatory getfieldbackground_normal setbackground set background color param color public void set background color color m server set background color m text set background color m db set background color setbackground m_server setbackground m_text setbackground m_db setbackground set visible param visible true if field is to be shown public void set visible boolean visible this set visible visible setvisible setvisible set editor to value param value value of the editor public void set value object value if value null value instanceof c connection m value c connection value set display setvalue cconnection m_value cconnection setdisplay return editor value return current value public object get value return m value getvalue m_value return display value return displayed string value public string get display if m value null return return m value get name getdisplay m_value m_value getname update display with connection info public void set display m text set text get display if m value null return text if m value is apps serverok false m value is databaseok m text set foreground compiereplaf gettextcolor ok set background false if m value is apps serverok false m server set background compiereplaf getfieldbackground error if m value is databaseok m db set background compiereplaf getfieldbackground error else m text set foreground compiereplaf gettextcolor issue set background true setdisplay m_text settext getdisplay m_value m_value isappsserverok m_value isdatabaseok m_text setforeground gettextcolor_ok setbackground m_value isappsserverok m_server setbackground getfieldbackground_error m_value isdatabaseok m_db setbackground getfieldbackground_error m_text setforeground gettextcolor_issue setbackground remove action listener param l public synchronized void remove action listener action listener l listener list remove action listener class l removeactionlistener actionlistener listenerlist actionlistener add action listener param l public synchronized void add action listener action listener l listener list add action listener class l addactionlistener actionlistener listenerlist actionlistener fire action performed private void fire action performed action event e null action listener listeners listener list get listeners action listener class for int i 0 i listeners length i if e null e new action event this action event action performed action performed listeners i action performed e fireactionperformed actionevent actionlistener listenerlist getlisteners actionlistener actionevent actionevent action_performed actionperformed actionperformed test method param args public static void main string args system out println c connection editor j frame frame new j frame c connection editor frame set default close operation j frame exit on close frame get root pane get content pane add new c connection editor compiereplaf show center screen frame cconnectioneditor jframe jframe cconnectioneditor setdefaultcloseoperation jframe exit_on_close getrootpane getcontentpane cconnectioneditor showcenterscreen mouse clicked open dialog param e public void mouse clicked mouse event e if is enabled m rw m active return m active true set cursor cursor get predefined cursor cursor wait cursor c connection dialog cd new c connection dialog m value set value cd get connection fire action performed set cursor cursor get default cursor m active false mouseclicked mouseevent isenabled m_rw m_active m_active setcursor getpredefinedcursor wait_cursor cconnectiondialog cconnectiondialog m_value setvalue getconnection fireactionperformed setcursor getdefaultcursor m_active factory return array list of account schema elements param as accounting schema return array list with elements public static m acct schema element get acct schema elements m acct schema as integer key new integer as getc acctschema id m acct schema element ret value m acct schema element s cache get key if ret value null return ret value s log fine c acctschema id as getc acctschema id array list m acct schema element list new array list m acct schema element string sql select from c acctschema element where c acctschema id and is active y order by seq no try prepared statement pstmt db prepare statement sql as get trxname pstmt set int 1 as getc acctschema id result set rs pstmt execute query while rs next m acct schema element ase new m acct schema element as get ctx rs as get trxname s log fine ase if ase is mandatory ase get default value 0 s log log level severe no default value for ase get name list add ase rs close pstmt close catch sql exception e s log log level severe sql e ret value new m acct schema element list size list to array ret value s cache put key ret value return ret value arraylist arraylist macctschemaelement getacctschemaelements macctschema getc_acctschema_id macctschemaelement retvalue macctschemaelement s_cache retvalue retvalue s_log c_acctschema_id getc_acctschema_id arraylist macctschemaelement arraylist macctschemaelement c_acctschema_element c_acctschema_id isactive seqno preparedstatement preparestatement get_trxname setint getc_acctschema_id resultset executequery macctschemaelement macctschemaelement getctx get_trxname s_log ismandatory getdefaultvalue s_log getname sqlexception s_log retvalue macctschemaelement toarray retvalue s_cache retvalue retvalue get column name of elementtype param element type elementtype return column name public static string get column name string element type if element type equals elementtype organization return ad org id else if element type equals elementtype account return account id else if element type equals elementtype bpartner return c bpartner id else if element type equals elementtype product return m product id else if element type equals elementtype activity return c activity id else if element type equals elementtype locationfrom return c locfrom id else if element type equals elementtype locationto return c locto id else if element type equals elementtype campaign return c campaign id else if element type equals elementtype orgtrx return ad orgtrx id else if element type equals elementtype project return c project id else if element type equals elementtype salesregion return c salesregion id else if element type equals elementtype userlist1 return user1 id else if element type equals elementtype userlist2 return user2 id else if element type equals elementtype userelement1 return userelement1 id else if element type equals elementtype userelement2 return userelement2 id return elementtype getcolumnname elementtype elementtype elementtype_organization ad_org_id elementtype elementtype_account account_id elementtype elementtype_bpartner c_bpartner_id elementtype elementtype_product m_product_id elementtype elementtype_activity c_activity_id elementtype elementtype_locationfrom c_locfrom_id elementtype elementtype_locationto c_locto_id elementtype elementtype_campaign c_campaign_id elementtype elementtype_orgtrx ad_orgtrx_id elementtype elementtype_project c_project_id elementtype elementtype_salesregion c_salesregion_id elementtype elementtype_userlist1 user1_id elementtype elementtype_userlist2 user2_id elementtype elementtype_userelement1 userelement1_id elementtype elementtype_userelement2 userelement2_id get value query for elementtype type param element type elementtype type return query select value name from table where id public static string get value query string element type if element type equals elementtype organization return select value name from ad org where ad org id else if element type equals elementtype account return select value name from c elementvalue where c elementvalue id else if element type equals elementtype subaccount return select value name from c subaccount where c subaccount id else if element type equals elementtype bpartner return select value name from c bpartner where c bpartner id else if element type equals elementtype product return select value name from m product where m product id else if element type equals elementtype activity return select value name from c activity where c activity id else if element type equals elementtype locationfrom return select city address1 from c location where c location id else if element type equals elementtype locationto return select city address1 from c location where c location id else if element type equals elementtype campaign return select value name from c campaign where c campaign id else if element type equals elementtype orgtrx return select value name from ad org where ad org id else if element type equals elementtype project return select value name from c project where c project id else if element type equals elementtype salesregion return select value name from c salesregion where c salesregion id else if element type equals elementtype userlist1 return select value name from c elementvalue where c elementvalue id else if element type equals elementtype userlist2 return select value name from c elementvalue where c elementvalue id else if element type equals elementtype userelement1 return null else if element type equals elementtype userelement2 return null return elementtype getvaluequery elementtype elementtype elementtype_organization ad_org ad_org_id elementtype elementtype_account c_elementvalue c_elementvalue_id elementtype elementtype_subaccount c_subaccount c_subaccount_id elementtype elementtype_bpartner c_bpartner c_bpartner_id elementtype elementtype_product m_product m_product_id elementtype elementtype_activity c_activity c_activity_id elementtype elementtype_locationfrom c_location c_location_id elementtype elementtype_locationto c_location c_location_id elementtype elementtype_campaign c_campaign c_campaign_id elementtype elementtype_orgtrx ad_org ad_org_id elementtype elementtype_project c_project c_project_id elementtype elementtype_salesregion c_salesregion c_salesregion_id elementtype elementtype_userlist1 c_elementvalue c_elementvalue_id elementtype elementtype_userlist2 c_elementvalue c_elementvalue_id elementtype elementtype_userelement1 elementtype elementtype_userelement2 standard constructor param ctx context param c acctschema element id id public m acct schema element properties ctx int c acctschema element id string trx name super ctx c acctschema element id trx name if c acctschema element id 0 setc acctschema element id 0 setc acctschema id 0 setc element id 0 set element type null set is balanced false set is mandatory false set name null setorg id 0 set seq no 0 c_acctschema_element_id macctschemaelement c_acctschema_element_id trxname c_acctschema_element_id trxname c_acctschema_element_id setc_acctschema_element_id setc_acctschema_id setc_element_id setelementtype setisbalanced setismandatory setname setorg_id setseqno load constructor param ctx context param rs result set public m acct schema element properties ctx result set rs string trx name super ctx rs trx name macctschemaelement resultset trxname trxname parent constructor param as accounting schema public m acct schema element m acct schema as this as get ctx 0 as get trxname set client org as setc acctschema id as getc acctschema id setc element id 0 set element type null set name null set seq no 0 macctschemaelement macctschema getctx get_trxname setclientorg setc_acctschema_id getc_acctschema_id setc_element_id setelementtype setname setseqno set organization type param seq no sequence param name name param org id id public void set type org int seq no string name int org id set element type elementtype organization set seq no seq no set name name setorg id org id seqno org_id settypeorg seqno org_id setelementtype elementtype_organization setseqno seqno setname setorg_id org_id public void set type account int seq no string name int c element id int c elementvalue id set element type elementtype account set seq no seq no set name name setc element id c element id setc elementvalue id c elementvalue id settypeaccount seqno c_element_id c_elementvalue_id setelementtype elementtype_account setseqno seqno setname setc_element_id c_element_id setc_elementvalue_id c_elementvalue_id public void set typeb partner int seq no string name int c bpartner id set element type elementtype bpartner set seq no seq no set name name setc bpartner id c bpartner id settypebpartner seqno c_bpartner_id setelementtype elementtype_bpartner setseqno seqno setname setc_bpartner_id c_bpartner_id public void set type product int seq no string name int m product id set element type elementtype product set seq no seq no set name name setm product id m product id settypeproduct seqno m_product_id setelementtype elementtype_product setseqno seqno setname setm_product_id m_product_id public void set type project int seq no string name int c project id set element type elementtype project set seq no seq no set name name setc project id c project id settypeproject seqno c_project_id setelementtype elementtype_project setseqno seqno setname setc_project_id c_project_id is element type param element type type return elementtype type public boolean is element type string element type if element type null return false return element type equals get element type elementtype iselementtype elementtype elementtype elementtype getelementtype get default element value return default public int get default value string element type get element type int default value 0 if element type equals elementtype organization default value getorg id else if element type equals elementtype account default value getc elementvalue id else if element type equals elementtype bpartner default value getc bpartner id else if element type equals elementtype product default value getm product id else if element type equals elementtype activity default value getc activity id else if element type equals elementtype locationfrom default value getc location id else if element type equals elementtype locationto default value getc location id else if element type equals elementtype campaign default value getc campaign id else if element type equals elementtype orgtrx default value getorg id else if element type equals elementtype project default value getc project id else if element type equals elementtype salesregion default value getc salesregion id else if element type equals elementtype userlist1 default value getc elementvalue id else if element type equals elementtype userlist2 default value getc elementvalue id else if element type equals elementtype userelement1 default value 0 else if element type equals elementtype userelement2 default value 0 return default value getdefaultvalue elementtype getelementtype defaultvalue elementtype elementtype_organization defaultvalue getorg_id elementtype elementtype_account defaultvalue getc_elementvalue_id elementtype elementtype_bpartner defaultvalue getc_bpartner_id elementtype elementtype_product defaultvalue getm_product_id elementtype elementtype_activity defaultvalue getc_activity_id elementtype elementtype_locationfrom defaultvalue getc_location_id elementtype elementtype_locationto defaultvalue getc_location_id elementtype elementtype_campaign defaultvalue getc_campaign_id elementtype elementtype_orgtrx defaultvalue getorg_id elementtype elementtype_project defaultvalue getc_project_id elementtype elementtype_salesregion defaultvalue getc_salesregion_id elementtype elementtype_userlist1 defaultvalue getc_elementvalue_id elementtype elementtype_userlist2 defaultvalue getc_elementvalue_id elementtype elementtype_userelement1 defaultvalue elementtype elementtype_userelement2 defaultvalue defaultvalue get column name return column name public string get column name string et get element type if elementtype userelement1 equals et elementtype userelement2 equals et if m columnname null m columnname m column get column name get ctx getad column id return m columnname return get column name et columnname getcolumnname getelementtype elementtype_userelement1 elementtype_userelement2 m_columnname m_columnname m_column getcolumnname getctx getad_column_id m_columnname getcolumnname string representation return info public string to string return acct schema element get id get name get element type get default value pos get seq no tostring acctschemaelement get_id getname getelementtype getdefaultvalue getseqno before save param new record new return true if it can be saved protected boolean before save boolean new record if getad org id 0 setad org id 0 string et get element type if is mandatory elementtype userlist1 equals et elementtype userlist2 equals et elementtype userelement1 equals et elementtype userelement2 equals et set is mandatory false else if is mandatory string error field null if elementtype account equals et getc elementvalue id 0 error field c elementvalue id else if elementtype activity equals et getc activity id 0 error field c activity id else if elementtype bpartner equals et getc bpartner id 0 error field c bpartner id else if elementtype campaign equals et getc campaign id 0 error field c campaign id else if elementtype locationfrom equals et getc location id 0 error field c location id else if elementtype locationto equals et getc location id 0 error field c location id else if elementtype organization equals et getorg id 0 error field org id else if elementtype orgtrx equals et getorg id 0 error field org id else if elementtype product equals et getm product id 0 error field m product id else if elementtype project equals et getc project id 0 error field c project id else if elementtype salesregion equals et getc salesregion id 0 error field c salesregion id if error field null log save error error msg parse translation get ctx is mandatory error field return false if getad column id 0 elementtype userelement1 equals et elementtype userelement2 equals et log save error error msg parse translation get ctx is mandatory ad column id return false return true newrecord beforesave newrecord getad_org_id setad_org_id getelementtype ismandatory elementtype_userlist1 elementtype_userlist2 elementtype_userelement1 elementtype_userelement2 setismandatory ismandatory errorfield elementtype_account getc_elementvalue_id errorfield c_elementvalue_id elementtype_activity getc_activity_id errorfield c_activity_id elementtype_bpartner getc_bpartner_id errorfield c_bpartner_id elementtype_campaign getc_campaign_id errorfield c_campaign_id elementtype_locationfrom getc_location_id errorfield c_location_id elementtype_locationto getc_location_id errorfield c_location_id elementtype_organization getorg_id errorfield org_id elementtype_orgtrx getorg_id errorfield org_id elementtype_product getm_product_id errorfield m_product_id elementtype_project getc_project_id errorfield c_project_id elementtype_salesregion getc_salesregion_id errorfield c_salesregion_id errorfield saveerror parsetranslation getctx ismandatory errorfield getad_column_id elementtype_userelement1 elementtype_userelement2 saveerror parsetranslation getctx ismandatory ad_column_id after save param new record new param success success return success protected boolean after save boolean new record boolean success default value if is mandatory is valuechanged is mandatory if elementtype activity equals get element type update data c activity id getc activity id else if elementtype bpartner equals get element type update data c bpartner id getc bpartner id else if elementtype product equals get element type update data m product id getm product id else if elementtype project equals get element type update data c project id getc project id resequence if new record is valuechanged seq no m account update value description get ctx ad client id getad client id get trxname clear cache s cache clear return success newrecord aftersave newrecord ismandatory is_valuechanged ismandatory elementtype_activity getelementtype updatedata c_activity_id getc_activity_id elementtype_bpartner getelementtype updatedata c_bpartner_id getc_bpartner_id elementtype_product getelementtype updatedata m_product_id getm_product_id elementtype_project getelementtype updatedata c_project_id getc_project_id newrecord is_valuechanged seqno maccount updatevaluedescription getctx ad_client_id getad_client_id get_trxname s_cache update valid combination and fact with mandatory value param element element param id new default private void update data string element int id m account update value description get ctx element id get trxname string sql update c validcombination set element id where element is null and ad client id getad client id int noc db execute update sql get trxname sql update fact acct set element id where element is null and c acctschema id getc acctschema id int nof db execute update sql get trxname log fine valid combination noc fact nof validcombination updatedata maccount updatevaluedescription getctx get_trxname c_validcombination ad_client_id getad_client_id executeupdate get_trxname fact_acct c_acctschema_id getc_acctschema_id executeupdate get_trxname validcombination after delete param success success return success protected boolean after delete boolean success update account info m account update value description get ctx ad client id getad client id get trxname s cache clear return success afterdelete maccount updatevaluedescription getctx ad_client_id getad_client_id get_trxname s_cache get tax line for order line param line order line param precision currenct precision param old tax get old tax return existing or new tax public static m order tax get m order line line int precision boolean old tax string trx name m order tax ret value null if line null line getc order id 0 s log fine get no order return null int c tax id line getc tax id if old tax line is valuechanged c tax id object old line get valueold c tax id if old null s log fine get no old tax return null c tax id integer old int value if c tax id 0 s log fine get no tax return null string sql select from c ordertax where c order id and c tax id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 line getc order id pstmt set int 2 c tax id result set rs pstmt execute query if rs next ret value new m order tax line get ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null ret value set precision precision ret value set trxname trx name s log fine get old old tax ret value return ret value create new ret value new m order tax line get ctx 0 trx name ret value set trxname trx name ret value set client org line ret value setc order id line getc order id ret value setc tax id line getc tax id ret value set precision precision ret value set is tax included line is tax included s log fine get new ret value return ret value oldtax mordertax morderline oldtax trxname mordertax retvalue getc_order_id s_log c_tax_id getc_tax_id oldtax is_valuechanged c_tax_id get_valueold c_tax_id s_log c_tax_id intvalue c_tax_id s_log c_ordertax c_order_id c_tax_id preparedstatement preparestatement trxname setint getc_order_id setint c_tax_id resultset executequery retvalue mordertax getctx trxname s_log retvalue retvalue setprecision retvalue set_trxname trxname s_log oldtax retvalue retvalue retvalue mordertax getctx trxname retvalue set_trxname trxname retvalue setclientorg retvalue setc_order_id getc_order_id retvalue setc_tax_id getc_tax_id retvalue setprecision retvalue setistaxincluded istaxincluded s_log retvalue retvalue persistency constructor param ctx context param ignored ignored public m order tax properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set tax amt env zero set tax base amt env zero set is tax included false mordertax trxname trxname illegalargumentexception settaxamt settaxbaseamt setistaxincluded load constructor set precision and tax included for tax calculations param ctx context param rs result set public m order tax properties ctx result set rs string trx name super ctx rs trx name taxincluded mordertax resultset trxname trxname get precision return returns the precision or 2 private int get precision if m precision null return 2 return m precision int value getprecision m_precision m_precision intvalue set precision param precision the precision to set protected void set precision int precision m precision new integer precision setprecision m_precision get tax return tax protected m tax get tax if m tax null m tax m tax get get ctx getc tax id return m tax mtax gettax m_tax m_tax mtax getctx getc_tax_id m_tax calculate set tax amt from order lines public boolean calculate tax from lines big decimal tax base amt env zero big decimal tax amt env zero boolean document level get tax is document level m tax tax get tax string sql select line net amt from c orderline where c order id and c tax id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc order id pstmt set int 2 getc tax id result set rs pstmt execute query while rs next big decimal base amt rs get big decimal 1 tax base amt tax base amt add base amt if document level calculate line tax tax amt tax amt add tax calculate tax base amt is tax included get precision rs close pstmt close pstmt null catch exception e log log level severe get trxname e tax base amt null try if pstmt null pstmt close pstmt null catch exception e pstmt null if tax base amt null return false calculate tax if document level document level tax amt tax calculate tax tax base amt is tax included get precision set tax amt tax amt set base if is tax included set tax base amt tax base amt subtract tax amt else set tax base amt tax base amt log fine to string return true calculatetaxfromlines bigdecimal taxbaseamt bigdecimal taxamt documentlevel gettax isdocumentlevel mtax gettax linenetamt c_orderline c_order_id c_tax_id preparedstatement preparestatement get_trxname setint getc_order_id setint getc_tax_id resultset executequery bigdecimal baseamt getbigdecimal taxbaseamt taxbaseamt baseamt documentlevel taxamt taxamt calculatetax baseamt istaxincluded getprecision get_trxname taxbaseamt taxbaseamt documentlevel taxamt calculatetax taxbaseamt istaxincluded getprecision settaxamt taxamt istaxincluded settaxbaseamt taxbaseamt taxamt settaxbaseamt taxbaseamt tostring string representation return info public string to string string buffer sb new string buffer m order tax sb append c order id append getc order id append c tax id append getc tax id append base append get tax base amt append tax append get tax amt append return sb to string tostring stringbuffer stringbuffer mordertax c_order_id getc_order_id c_tax_id getc_tax_id gettaxbaseamt gettaxamt tostring standard constructor public x ad impformat properties ctx int ad impformat id string trx name super ctx ad impformat id trx name if ad impformat id 0 setad impformat id 0 setad table id 0 set format type null set name null set processing false x_ad_impformat ad_impformat_id trxname ad_impformat_id trxname ad_impformat_id setad_impformat_id setad_table_id setformattype setname setprocessing load constructor public x ad impformat properties ctx result set rs string trx name super ctx rs trx name x_ad_impformat resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad impformat append get id append return sb to string tostring stringbuffer stringbuffer x_ad_impformat get_id tostring set import format public void setad impformat id int ad impformat id if ad impformat id 1 throw new illegal argument exception ad impformat id is mandatory set valuenocheck ad impformat id new integer ad impformat id setad_impformat_id ad_impformat_id ad_impformat_id illegalargumentexception ad_impformat_id set_valuenocheck ad_impformat_id ad_impformat_id get import format public int getad impformat id integer ii integer get value ad impformat id if ii null return 0 return ii int value getad_impformat_id get_value ad_impformat_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string formattype xml x set format format of the data public void set format type string format type if format type null throw new illegal argument exception format type is mandatory if format type equals c format type equals f format type equals t format type equals x else throw new illegal argument exception format type invalid value format type reference id 209 c f t x if format type length 1 log warning length 1 truncated format type format type substring 0 0 set value format type format type formattype_xml setformattype formattype formattype illegalargumentexception formattype formattype formattype formattype formattype illegalargumentexception formattype formattype reference_id formattype formattype formattype set_value formattype formattype get format format of the data public string get format type return string get value format type getformattype get_value formattype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public no such object exception super no such object found nosuchobjectexception translation dialog constructor initiated via init public translation dialog translationdialog translationdialog static init throws exception private void jb init throws exception this set layout main layout l client set text msg translate env get ctx ad client id l language set text msg translate env get ctx ad language l language set tool tip text msg translate env get ctx is system language l table set text msg translate env get ctx ad table id b export set text msg get msg env get ctx export b export add action listener this b import set text msg get msg env get ctx import b import add action listener this this add cb language new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 this add l language new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add l table new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add cb table new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 this add b export new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add b import new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 this add l client new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add cb client new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 jbinit setlayout mainlayout lclient settext getctx ad_client_id llanguage settext getctx ad_language llanguage settooltiptext getctx issystemlanguage ltable settext getctx ad_table_id bexport settext getmsg getctx bexport addactionlistener bimport settext getmsg getctx bimport addactionlistener cblanguage gridbagconstraints gridbagconstraints gridbagconstraints llanguage gridbagconstraints gridbagconstraints gridbagconstraints ltable gridbagconstraints gridbagconstraints gridbagconstraints cbtable gridbagconstraints gridbagconstraints gridbagconstraints bexport gridbagconstraints gridbagconstraints gridbagconstraints bimport gridbagconstraints gridbagconstraints gridbagconstraints lclient gridbagconstraints gridbagconstraints gridbagconstraints cbclient gridbagconstraints gridbagconstraints gridbagconstraints dynamic init fill language table private void dyn init fill client cb client add item new key name pair 1 string sql select name ad client id from ad client where is active y order by 2 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next key name pair kp new key name pair rs get int 2 rs get string 1 cb client add item kp rs close pstmt close catch sql exception e log log level severe sql e fill language sql select name ad language from ad language where is active y and is system language y or is base language y order by 1 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next value name pair vp new value name pair rs get string 2 rs get string 1 cb language add item vp rs close pstmt close catch sql exception e log log level severe sql e fill table cb table add item new value name pair sql select name table name from ad table where table name like trl order by 1 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next value name pair vp new value name pair rs get string 2 rs get string 1 cb table add item vp rs close pstmt close catch sql exception e log log level severe sql e info status bar set status line status bar set statusdb dyninit cbclient additem keynamepair ad_client_id ad_client isactive preparedstatement preparestatement resultset executequery keynamepair keynamepair getint getstring cbclient additem sqlexception ad_language ad_language isactive issystemlanguage isbaselanguage preparedstatement preparestatement resultset executequery valuenamepair valuenamepair getstring getstring cblanguage additem sqlexception cbtable additem valuenamepair tablename ad_table tablename _trl preparedstatement preparestatement resultset executequery valuenamepair valuenamepair getstring getstring cbtable additem sqlexception statusbar setstatusline statusbar setstatusdb initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame env set context env get ctx m windowno isso trx y try jb init dyn init frame get content pane add this border layout center frame get content pane add status bar border layout south catch exception ex log log level severe ex windowno windowno formframe m_windowno windowno m_frame setcontext getctx m_windowno issotrx jbinit dyninit getcontentpane borderlayout getcontentpane statusbar borderlayout dispose public void dispose m frame dispose m_frame action listener param e event public void action performed action event e value name pair ad language value name pair cb language get selected item if ad language null status bar set status line msg get msg env get ctx language setup error true return value name pair ad table value name pair cb table get selected item if ad table null return boolean imp e get source b import key name pair ad client key name pair cb client get selected item int ad client id 1 if ad client null ad client id ad client get key string start dir ini get compiere home file separator data j file chooser chooser new j file chooser start dir chooser set multi selection enabled false chooser set file selection mode j file chooser directories only int return val imp chooser show open dialog this chooser show save dialog this if return val j file chooser approve option return string directory chooser get selected file get absolute path status bar set status line directory this set cursor cursor get predefined cursor cursor wait cursor translation t new translation env get ctx string msg t validate language ad language get value if msg length 0 a dialog error m windowno this language setup error msg return all tables if ad table get value equals for int i 1 i cb table get item count i ad table value name pair cb table get item at i msg null msg imp t import trl directory ad client id ad language get value ad table get value t export trl directory ad client id ad language get value ad table get value status bar set status line msg status bar set status line directory else single table msg null msg imp t import trl directory ad client id ad language get value ad table get value t export trl directory ad client id ad language get value ad table get value status bar set status line msg this set cursor cursor get default cursor actionperformed actionevent valuenamepair ad_language valuenamepair cblanguage getselecteditem ad_language statusbar setstatusline getmsg getctx languagesetuperror valuenamepair ad_table valuenamepair cbtable getselecteditem ad_table getsource bimport keynamepair ad_client keynamepair cbclient getselecteditem ad_client_id ad_client ad_client_id ad_client getkey startdir getcompierehome jfilechooser jfilechooser startdir setmultiselectionenabled setfileselectionmode jfilechooser directories_only returnval showopendialog showsavedialog returnval jfilechooser approve_option getselectedfile getabsolutepath statusbar setstatusline setcursor getpredefinedcursor wait_cursor getctx validatelanguage ad_language getvalue adialog m_windowno languagesetuperror ad_table getvalue cbtable getitemcount ad_table valuenamepair cbtable getitemat importtrl ad_client_id ad_language getvalue ad_table getvalue exporttrl ad_client_id ad_language getvalue ad_table getvalue statusbar setstatusline statusbar setstatusline importtrl ad_client_id ad_language getvalue ad_table getvalue exporttrl ad_client_id ad_language getvalue ad_table getvalue statusbar setstatusline setcursor getdefaultcursor get set user for issue param issue issue return user static public m issue user get m issue issue if issue get user name null return null m issue user user null find issue user string sql select from r issueuser where user name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 issue get user name result set rs pstmt execute query if rs next user new m issue user issue get ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null new if user null user new m issue user issue get ctx 0 null user set user name issue get user name user setad user id if user save return null issue setr issueuser id user getr issueuser id return user missueuser missue getusername missueuser r_issueuser username preparedstatement preparestatement setstring getusername resultset executequery missueuser getctx s_log missueuser getctx setusername getusername setad_user_id setr_issueuser_id getr_issueuser_id standard constructor param ctx context param r issueuser id id param trx name trx public m issue user properties ctx int r issueuser id string trx name super ctx r issueuser id trx name r_issueuser_id trxname missueuser r_issueuser_id trxname r_issueuser_id trxname load constructor param ctx context param rs result set param trx name trx public m issue user properties ctx result set rs string trx name super ctx rs trx name trxname missueuser resultset trxname trxname set ad user id public void setad user id int ad user id db getsql value null select ad user id from ad user where e mail get user name if ad user id 0 super setad user id ad user id ad_user_id setad_user_id ad_user_id getsqlvalue ad_user_id ad_user email getusername ad_user_id setad_user_id ad_user_id string representation return info public string to string string buffer sb new string buffer m issue user sb append get id append append get user name append ad user id append getad user id append return sb to string tostring stringbuffer stringbuffer missueuser get_id getusername ad_user_id getad_user_id tostring detail protected contructor param frame parent frame param modal modal param window no window no param value query value param multi selection multiple selections param where clause where clause protected info in out frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no i m inout id multi selection where clause log info info in out set title msg get msg env get ctx info in out try stat init p loadedok init info catch exception e return int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if value null value length 0 f document no set value value execute query pack focus f document no request focus windowno multiselection whereclause infoinout windowno multiselection whereclause windowno m_inout_id multiselection whereclause infoinout settitle getmsg getctx infoinout statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring fdocumentno setvalue executequery fdocumentno requestfocus static setup add fields to parameter panel throws exception if lookups cannot be initialized private void stat init throws exception l document no set label for f document no f document no set background compiereplaf get info background f document no add action listener this l description set label for f description f description set background compiereplaf get info background f description add action listener this lpo reference set label for lpo reference fpo reference set background compiereplaf get info background fpo reference add action listener this f isso trx set selected n equals env get context env get ctx p windowno isso trx f isso trx add action listener this forg id new v lookup ad org id false false true m lookup factory create env get ctx 3486 m windowno display type table dir false display type table dir m windowno lorg id set label for forg id forg id set background compiereplaf get info background fbpartner id new v lookup c bpartner id false false true m lookup factory get env get ctx p windowno 0 3499 display type search lbpartner id set label for fbpartner id fbpartner id set background compiereplaf get info background l date from set label for f date from f date from set background compiereplaf get info background f date from set tool tip text msg translate env get ctx date from l date to set label for f date to f date to set background compiereplaf get info background f date to set tool tip text msg translate env get ctx date to parameter panel set layout new a layout first row parameter panel add l document no new a layout constraint 0 0 parameter panel add f document no null parameter panel add lbpartner id null parameter panel add fbpartner id null parameter panel add f isso trx new a layout constraint 0 5 2nd row parameter panel add l description new a layout constraint 1 0 parameter panel add f description null parameter panel add l date from null parameter panel add f date from null parameter panel add l date to null parameter panel add f date to null 3rd row parameter panel add lpo reference new a layout constraint 2 0 parameter panel add fpo reference null parameter panel add lorg id null parameter panel add forg id null parameterpanel statinit ldocumentno setlabelfor fdocumentno fdocumentno setbackground getinfobackground fdocumentno addactionlistener ldescription setlabelfor fdescription fdescription setbackground getinfobackground fdescription addactionlistener lporeference setlabelfor lporeference fporeference setbackground getinfobackground fporeference addactionlistener fissotrx setselected getcontext getctx p_windowno issotrx fissotrx addactionlistener forg_id vlookup ad_org_id mlookupfactory getctx m_windowno displaytype tabledir displaytype tabledir m_windowno lorg_id setlabelfor forg_id forg_id setbackground getinfobackground fbpartner_id vlookup c_bpartner_id mlookupfactory getctx p_windowno displaytype lbpartner_id setlabelfor fbpartner_id fbpartner_id setbackground getinfobackground ldatefrom setlabelfor fdatefrom fdatefrom setbackground getinfobackground fdatefrom settooltiptext getctx datefrom ldateto setlabelfor fdateto fdateto setbackground getinfobackground fdateto settooltiptext getctx dateto parameterpanel setlayout alayout parameterpanel ldocumentno alayoutconstraint parameterpanel fdocumentno parameterpanel lbpartner_id parameterpanel fbpartner_id parameterpanel fissotrx alayoutconstraint parameterpanel ldescription alayoutconstraint parameterpanel fdescription parameterpanel ldatefrom parameterpanel fdatefrom parameterpanel ldateto parameterpanel fdateto parameterpanel lporeference alayoutconstraint parameterpanel fporeference parameterpanel lorg_id parameterpanel forg_id general init return true if success private boolean init info set defaults string bp env get context env get ctx p windowno c bpartner id if bp null bp length 0 fbpartner id set value new integer bp prepare table string buffer where new string buffer i is active y if p whereclause length 0 where append and append util replace p whereclause m inout i prepare table s invoicelayout m inout i where to string 2 3 4 return true initinfo getcontext getctx p_windowno c_bpartner_id fbpartner_id setvalue stringbuffer stringbuffer isactive p_whereclause p_whereclause m_inout preparetable s_invoicelayout m_inout tostring construct sql where clause and define parameters set parameters needs to set parameters includes first and return where clause string getsql where string buffer sql new string buffer if f document no get text length 0 sql append and upper i document no like if f description get text length 0 sql append and upper i description like if fpo reference get text length 0 sql append and upper i po reference like if fbpartner id get value null sql append and i c bpartner id if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value if from null to null sql append and trunc i movement date else if from null to null sql append and trunc i movement date else if from null to null sql append and trunc i movement date between and sql append and i isso trx log fine info in out set where clause sql to string return sql to string setparameters getsqlwhere stringbuffer stringbuffer fdocumentno gettext documentno fdescription gettext fporeference gettext poreference fbpartner_id getvalue c_bpartner_id fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue movementdate movementdate movementdate issotrx infoinout setwhereclause tostring tostring set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 if f document no get text length 0 pstmt set string index getsql text f document no if f description get text length 0 pstmt set string index getsql text f description if fpo reference get text length 0 pstmt set string index getsql text fpo reference if fbpartner id get value null integer bp integer fbpartner id get value pstmt set int index bp int value log fine b partner bp if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value log fine date from from to to if from null to null pstmt set timestamp index to else if from null to null pstmt set timestamp index from else if from null to null pstmt set timestamp index from pstmt set timestamp index to pstmt set string index f isso trx is selected y n getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fdocumentno gettext setstring getsqltext fdocumentno fdescription gettext setstring getsqltext fdescription fporeference gettext setstring getsqltext fporeference fbpartner_id getvalue fbpartner_id getvalue setint intvalue bpartner fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue settimestamp settimestamp settimestamp settimestamp setstring fissotrx isselected get sql where parameter param f field return sql part private string getsql text c text field f string s f get text to upper case if s ends with s log fine string s return s getsqltext ctextfield gettext touppercase endswith zoom void zoom log info info in out zoom integer m inout id get selected row key if m inout id null return m query query new m query m inout query add restriction m inout id m query equal m inout id query set record count 1 int ad windowno getad window id m inout f isso trx is selected zoom ad windowno query infoinout m_inout_id getselectedrowkey m_inout_id mquery mquery m_inout addrestriction m_inout_id mquery m_inout_id setrecordcount ad_windowno getad_window_id m_inout fissotrx isselected ad_windowno has zoom return true boolean has zoom return true haszoom standard constructor public x ad record access properties ctx int ad record access id string trx name super ctx ad record access id trx name if ad record access id 0 setad role id 0 setad table id 0 set is dependent entities false n set is exclude true y set is read only false setrecord id 0 x_ad_record_access ad_record_access_id trxname ad_record_access_id trxname ad_record_access_id setad_role_id setad_table_id setisdependententities setisexclude setisreadonly setrecord_id load constructor public x ad record access properties ctx result set rs string trx name super ctx rs trx name x_ad_record_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad record access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_record_access get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad table id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_table_id set dependent entities also check access in dependent entities public void set is dependent entities boolean is dependent entities set value is dependent entities new boolean is dependent entities setisdependententities isdependententities set_value isdependententities isdependententities get dependent entities also check access in dependent entities public boolean is dependent entities object oo get value is dependent entities if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdependententities get_value isdependententities booleanvalue set exclude exclude access to the data if not selected include access to the data public void set is exclude boolean is exclude set value is exclude new boolean is exclude setisexclude isexclude set_value isexclude isexclude get exclude exclude access to the data if not selected include access to the data public boolean is exclude object oo get value is exclude if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isexclude get_value isexclude booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue public mk category properties ctx int k category id string trx name super ctx k category id trx name mkcategory k_category_id trxname k_category_id trxname public mk category properties ctx result set rs string trx name super ctx rs trx name mkcategory resultset trxname trxname standard constructor public x pa reportcolumnset properties ctx int pa reportcolumnset id string trx name super ctx pa reportcolumnset id trx name if pa reportcolumnset id 0 set name null setpa reportcolumnset id 0 set processing false x_pa_reportcolumnset pa_reportcolumnset_id trxname pa_reportcolumnset_id trxname pa_reportcolumnset_id setname setpa_reportcolumnset_id setprocessing load constructor public x pa reportcolumnset properties ctx result set rs string trx name super ctx rs trx name x_pa_reportcolumnset resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa reportcolumnset append get id append return sb to string tostring stringbuffer stringbuffer x_pa_reportcolumnset get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set report column set collection of columns for report public void setpa reportcolumnset id int pa reportcolumnset id if pa reportcolumnset id 1 throw new illegal argument exception pa reportcolumnset id is mandatory set valuenocheck pa reportcolumnset id new integer pa reportcolumnset id setpa_reportcolumnset_id pa_reportcolumnset_id pa_reportcolumnset_id illegalargumentexception pa_reportcolumnset_id set_valuenocheck pa_reportcolumnset_id pa_reportcolumnset_id get report column set collection of columns for report public int getpa reportcolumnset id integer ii integer get value pa reportcolumnset id if ii null return 0 return ii int value getpa_reportcolumnset_id get_value pa_reportcolumnset_id intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x c elementvalue properties ctx int c elementvalue id string trx name super ctx c elementvalue id trx name if c elementvalue id 0 set account sign null n set account type null e setc elementvalue id 0 setc element id 0 set is summary false set name null set post actual true y set post budget true y set post encumbrance true y set post statistical true y set value null x_c_elementvalue c_elementvalue_id trxname c_elementvalue_id trxname c_elementvalue_id setaccountsign setaccounttype setc_elementvalue_id setc_element_id setissummary setname setpostactual setpostbudget setpostencumbrance setpoststatistical setvalue load constructor public x c elementvalue properties ctx result set rs string trx name super ctx rs trx name x_c_elementvalue resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c elementvalue append get id append return sb to string tostring stringbuffer stringbuffer x_c_elementvalue get_id tostring public static final string accountsign natural n set account sign indicates the natural sign of the account as a debit or credit public void set account sign string account sign if account sign null throw new illegal argument exception account sign is mandatory if account sign equals c account sign equals d account sign equals n else throw new illegal argument exception account sign invalid value account sign reference id 118 c d n if account sign length 1 log warning length 1 truncated account sign account sign substring 0 0 set value account sign account sign accountsign_natural setaccountsign accountsign accountsign illegalargumentexception accountsign accountsign accountsign accountsign illegalargumentexception accountsign accountsign reference_id accountsign accountsign accountsign set_value accountsign accountsign get account sign indicates the natural sign of the account as a debit or credit public string get account sign return string get value account sign getaccountsign get_value accountsign public static final string accounttype revenue r set account type indicates the type of account public void set account type string account type if account type null throw new illegal argument exception account type is mandatory if account type equals a account type equals e account type equals l account type equals m account type equals o account type equals r else throw new illegal argument exception account type invalid value account type reference id 117 a e l m o r if account type length 1 log warning length 1 truncated account type account type substring 0 0 set value account type account type accounttype_revenue setaccounttype accounttype accounttype illegalargumentexception accounttype accounttype accounttype accounttype accounttype accounttype accounttype illegalargumentexception accounttype accounttype reference_id accounttype accounttype accounttype set_value accounttype accounttype get account type indicates the type of account public string get account type return string get value account type getaccounttype get_value accounttype set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 0 set value c bankaccount id null else set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id set_value c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 1 throw new illegal argument exception c elementvalue id is mandatory set valuenocheck c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id illegalargumentexception c_elementvalue_id set_valuenocheck c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set element accounting element public void setc element id int c element id if c element id 1 throw new illegal argument exception c element id is mandatory set valuenocheck c element id new integer c element id setc_element_id c_element_id c_element_id illegalargumentexception c_element_id set_valuenocheck c_element_id c_element_id get element accounting element public int getc element id integer ii integer get value c element id if ii null return 0 return ii int value getc_element_id get_value c_element_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set bank account indicates if this is the bank account public void set is bank account boolean is bank account set value is bank account new boolean is bank account setisbankaccount isbankaccount set_value isbankaccount isbankaccount get bank account indicates if this is the bank account public boolean is bank account object oo get value is bank account if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbankaccount get_value isbankaccount booleanvalue set document controlled control account if an account is controlled by a document you cannot post manually to it public void set is doc controlled boolean is doc controlled set value is doc controlled new boolean is doc controlled setisdoccontrolled isdoccontrolled set_value isdoccontrolled isdoccontrolled get document controlled control account if an account is controlled by a document you cannot post manually to it public boolean is doc controlled object oo get value is doc controlled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdoccontrolled get_value isdoccontrolled booleanvalue set foreign currency account balances in foreign currency accounts are held in the nominated currency public void set is foreign currency boolean is foreign currency set value is foreign currency new boolean is foreign currency setisforeigncurrency isforeigncurrency set_value isforeigncurrency isforeigncurrency get foreign currency account balances in foreign currency accounts are held in the nominated currency public boolean is foreign currency object oo get value is foreign currency if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isforeigncurrency get_value isforeigncurrency booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set post actual actual values can be posted public void set post actual boolean post actual set value post actual new boolean post actual setpostactual postactual set_value postactual postactual get post actual actual values can be posted public boolean is post actual object oo get value post actual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostactual get_value postactual booleanvalue set post budget budget values can be posted public void set post budget boolean post budget set value post budget new boolean post budget setpostbudget postbudget set_value postbudget postbudget get post budget budget values can be posted public boolean is post budget object oo get value post budget if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostbudget get_value postbudget booleanvalue set post encumbrance post commitments to this account public void set post encumbrance boolean post encumbrance set value post encumbrance new boolean post encumbrance setpostencumbrance postencumbrance set_value postencumbrance postencumbrance get post encumbrance post commitments to this account public boolean is post encumbrance object oo get value post encumbrance if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostencumbrance get_value postencumbrance booleanvalue set post statistical post statistical quantities to this account public void set post statistical boolean post statistical set value post statistical new boolean post statistical setpoststatistical poststatistical set_value poststatistical poststatistical get post statistical post statistical quantities to this account public boolean is post statistical object oo get value post statistical if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispoststatistical get_value poststatistical booleanvalue set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue constructs a new code j password field code with a default document code null code starting text string and 0 column width public c password super init jpasswordfield cpassword constructs a new code j password field code initialized with the specified text the document model is set to the default and the number of columns to 0 param text the text to be displayed code null code if none public c password string text super text init jpasswordfield cpassword constructs a new empty code j password field code with the specified number of columns a default model is created and the initial string is set to code null code param columns the number of columns 0 public c password int columns super columns init jpasswordfield cpassword constructs a new code j password field code initialized with the specified text and columns the document model is set to the default param text the text to be displayed code null code if none param columns the number of columns 0 public c password string text int columns super text columns init jpasswordfield cpassword constructs a new code j password field code that uses the given text storage model and the given number of columns this is the constructor through which the other constructors feed the echo character is set to if the document model is code null code a default one will be created param doc the text storage to use param txt the text to be displayed code null code if none param columns the number of columns to use to calculate the preferred width 0 if columns is set to zero the preferred width will be whatever naturally results from the component implementation public c password document doc string txt int columns super doc txt columns init jpasswordfield cpassword common init private void init set font compiereplaf getfont field set foreground compiereplaf gettextcolor normal setfont getfont_field setforeground gettextcolor_normal set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is editable rw super set editable rw set background false setreadwrite iseditable seteditable setbackground is it possible to edit return true if editable public boolean is read write return super is editable isreadwrite iseditable set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set background param bg public void set background color bg if bg equals get background return super set background bg setbackground getbackground setbackground set editor to value param value value of the editor public void set value object value if value null set text else set text value to string setvalue settext settext tostring return editor value return current value public object get value return new string super get password getvalue getpassword return display value return displayed string value public string get display return new string super get password getdisplay getpassword get check for payment param ctx context param c payment id id return pay selection check for payment or null public static m pay selection check get of payment properties ctx int c payment id string trx name m pay selection check ret value null string sql select from c payselectioncheck where c payment id int count 0 prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c payment id result set rs pstmt execute query while rs next m pay selection check psc new m pay selection check ctx rs trx name if ret value null ret value psc else if ret value is processed psc is processed ret value psc count rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if count 1 s log warning more then one for c payment id c payment id return ret value c_payment_id mpayselectioncheck getofpayment c_payment_id trxname mpayselectioncheck retvalue c_payselectioncheck c_payment_id preparedstatement preparestatement trxname setint c_payment_id resultset executequery mpayselectioncheck mpayselectioncheck trxname retvalue retvalue retvalue isprocessed isprocessed retvalue s_log s_log c_payment_id c_payment_id retvalue create check for payment param ctx context param c payment id id return pay selection check for payment or null public static m pay selection check create for payment properties ctx int c payment id string trx name if c payment id 0 return null m payment payment new m payment ctx c payment id null map payment rule tender type string payment rule m pay selection check paymentrule check if payment get tender type equals m payment tendertype creditcard payment rule m pay selection check paymentrule creditcard else if payment get tender type equals m payment tendertype directdebit payment rule m pay selection check paymentrule directdebit else if payment get tender type equals m payment tendertype directdeposit payment rule m pay selection check paymentrule directdeposit else if payment get tender type equals m payment tendertype check payment rule m pay selection check paymentrule check create new pay selection m pay selection ps new m pay selection ctx 0 trx name ps setc bankaccount id payment getc bankaccount id ps set name msg translate ctx c payment id payment get document no ps set description payment get description ps set pay date payment get date trx ps set total amt payment get pay amt ps set is approved true ps save create new pay selection line m pay selection line psl null if payment getc invoice id 0 psl new m pay selection line ps 10 payment rule psl setc invoice id payment getc invoice id psl set isso trx payment is receipt psl set open amt payment get pay amt add payment get discount amt psl set pay amt payment get pay amt psl set discount amt payment get discount amt psl set difference amt env zero psl save create new pay selection check m pay selection check psc psc new m pay selection check ps payment rule psc setc bpartner id payment getc bpartner id psc setc payment id payment getc payment id psc set is receipt payment is receipt psc set pay amt payment get pay amt psc set discount amt payment get discount amt psc set qty 1 psc set document no payment get document no psc set processed true psc save update optional line if psl null psl setc payselectioncheck id psc getc payselectioncheck id psl set processed true psl save indicate done ps set processed true ps save return psc c_payment_id mpayselectioncheck createforpayment c_payment_id trxname c_payment_id mpayment mpayment c_payment_id paymentrule mpayselectioncheck paymentrule_check gettendertype mpayment tendertype_creditcard paymentrule mpayselectioncheck paymentrule_creditcard gettendertype mpayment tendertype_directdebit paymentrule mpayselectioncheck paymentrule_directdebit gettendertype mpayment tendertype_directdeposit paymentrule mpayselectioncheck paymentrule_directdeposit gettendertype mpayment tendertype_check paymentrule mpayselectioncheck paymentrule_check payselection mpayselection mpayselection trxname setc_bankaccount_id getc_bankaccount_id setname c_payment_id getdocumentno setdescription getdescription setpaydate getdatetrx settotalamt getpayamt setisapproved payselection mpayselectionline getc_invoice_id mpayselectionline paymentrule setc_invoice_id getc_invoice_id setissotrx isreceipt setopenamt getpayamt getdiscountamt setpayamt getpayamt setdiscountamt getdiscountamt setdifferenceamt payselection mpayselectioncheck mpayselectioncheck paymentrule setc_bpartner_id getc_bpartner_id setc_payment_id getc_payment_id setisreceipt isreceipt setpayamt getpayamt setdiscountamt getdiscountamt setqty setdocumentno getdocumentno setprocessed setc_payselectioncheck_id getc_payselectioncheck_id setprocessed setprocessed get checks of payment selection param c payselection id payment selection param payment rule payment rule param start document no start document no return array of checks static public m pay selection check get int c payselection id string payment rule int start document no string trx name s log fine c payselection id c payselection id payment rule payment rule start document no start document no array list m pay selection check list new array list m pay selection check int doc no start document no string sql select from c payselectioncheck where c payselection id and payment rule try prepared statement pstmt db prepare statement sql trx name pstmt set int 1 c payselection id pstmt set string 2 payment rule result set rs pstmt execute query while rs next m pay selection check check new m pay selection check env get ctx rs trx name set new check document no saved in confirm print check set document no string value of doc no list add check rs close pstmt close catch sql exception e s log log level severe sql e convert to array m pay selection check ret value new m pay selection check list size list to array ret value return ret value c_payselection_id paymentrule startdocumentno mpayselectioncheck c_payselection_id paymentrule startdocumentno trxname s_log c_payselection_id c_payselection_id paymentrule paymentrule startdocumentno startdocumentno arraylist mpayselectioncheck arraylist mpayselectioncheck docno startdocumentno c_payselectioncheck c_payselection_id paymentrule preparedstatement preparestatement trxname setint c_payselection_id setstring paymentrule resultset executequery mpayselectioncheck mpayselectioncheck getctx trxname confirmprint setdocumentno valueof docno sqlexception s_log mpayselectioncheck retvalue mpayselectioncheck toarray retvalue retvalue export to file param checks array of checks param file file to export checks return number of lines public static int export to file m pay selection check checks file file if checks null checks length 0 return 0 must be a file if file is directory s log log level severe export to file file is directory file get absolute path return 0 delete if exists try if file exists file delete catch exception e s log log level severe export to file could not delete file get absolute path e char x ease int no lines 0 string buffer line null try file writer fw new file writer file write header line new string buffer line append x append value append x append append x append name append x append append x append contact append x append append x append addr1 append x append append x append addr2 append x append append x append city append x append append x append state append x append append x append zip append x append append x append country append x append append x append reference no append x append append x append document no append x append append x append pay date append x append append x append currency append x append append x append pay amount append x append append x append comment append x append env nl fw write line to string no lines write lines for int i 0 i checks length i m pay selection check mpp checks i if mpp null continue b partner info string bp getb partner info mpp getc bpartner id comment list of invoice document no string buffer comment new string buffer m pay selection line psls mpp get pay selection lines false for int l 0 l psls length l if l 0 comment append comment append psls l get invoice get document no line new string buffer line append x append bp bp value append x append value append x append bp bp name append x append name append x append bp bp contact append x append contact append x append bp bp addr1 append x append addr1 append x append bp bp addr2 append x append addr2 append x append bp bp city append x append city append x append bp bp region append x append state append x append bp bp postal append x append zip append x append bp bp country append x append country append x append bp bp refno append x append reference no payment info append x append mpp get document no append x append document no append mpp get parent get pay date append pay date append x append m currency getiso code env get ctx mpp get parent getc currency id append x append currency append mpp get pay amt append pay amount append x append comment to string append x comment append env nl fw write line to string no lines write line fw flush fw close catch exception e s log log level severe e return no lines exporttofile mpayselectioncheck isdirectory s_log exporttofile getabsolutepath s_log exporttofile getabsolutepath nolines stringbuffer filewriter filewriter stringbuffer referenceno documentno paydate payamount tostring nolines mpayselectioncheck bpartner getbpartnerinfo getc_bpartner_id stringbuffer stringbuffer mpayselectionline getpayselectionlines getinvoice getdocumentno stringbuffer bp_value bp_name bp_contact bp_addr1 bp_addr2 bp_city bp_region bp_postal bp_country bp_refno referenceno getdocumentno documentno getparent getpaydate paydate mcurrency getiso_code getctx getparent getc_currency_id getpayamt payamount tostring tostring nolines s_log nolines get customer vendor info based on bp static variables param c bpartner id b partner return info array private static string getb partner info int c bpartner id string bp new string 10 string sql select bp value bp name c name as contact a address1 a address2 a city r name as region a postal cc name as country bp reference no from c bpartner bp ad user c c bpartner location l c location a c region r c country cc where bp c bpartner id 1 and bp c bpartner id c c bpartner id and bp c bpartner id l c bpartner id and l c location id a c location id and a c region id r c region id and a c country id cc c country id order by l is bill to desc try prepared statement pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query if rs next bp bp value rs get string 1 if bp bp value null bp bp value bp bp name rs get string 2 if bp bp name null bp bp name bp bp contact rs get string 3 if bp bp contact null bp bp contact bp bp addr1 rs get string 4 if bp bp addr1 null bp bp addr1 bp bp addr2 rs get string 5 if bp bp addr2 null bp bp addr2 bp bp city rs get string 6 if bp bp city null bp bp city bp bp region rs get string 7 if bp bp region null bp bp region bp bp postal rs get string 8 if bp bp postal null bp bp postal bp bp country rs get string 9 if bp bp country null bp bp country bp bp refno rs get string 10 if bp bp refno null bp bp refno rs close pstmt close catch sql exception e s log log level severe getb partner info e return bp bp_ c_bpartner_id bpartner getbpartnerinfo c_bpartner_id referenceno c_bpartner ad_user c_bpartner_location c_location c_region c_country c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id c_location_id c_location_id c_region_id c_region_id c_country_id c_country_id isbillto preparedstatement preparestatement setint c_bpartner_id resultset executequery bp_value getstring bp_value bp_value bp_name getstring bp_name bp_name bp_contact getstring bp_contact bp_contact bp_addr1 getstring bp_addr1 bp_addr1 bp_addr2 getstring bp_addr2 bp_addr2 bp_city getstring bp_city bp_city bp_region getstring bp_region bp_region bp_postal getstring bp_postal bp_postal bp_country getstring bp_country bp_country bp_refno getstring bp_refno bp_refno sqlexception s_log getbpartnerinfo confirm print create payments the first time param checks checks return last document number or 0 if nothing printed public static int confirm print m pay selection check checks m payment batch batch int last document no 0 for int i 0 i checks length i m pay selection check check checks i m payment payment new m payment check get ctx check getc payment id null existing payment if check getc payment id 0 update check number if check get payment rule equals paymentrule check payment set check no check get document no if payment save s log log level severe payment not saved payment else new payment payment new m payment check get ctx 0 null payment setad org id check getad org id if check get payment rule equals paymentrule check payment set bank check check get parent getc bankaccount id false check get document no else if check get payment rule equals paymentrule creditcard payment set tender type m payment tendertype creditcard else if check get payment rule equals paymentrule directdeposit check get payment rule equals paymentrule directdeposit payment set bankach check get parent getc bankaccount id false else s log log level severe unsupported payment rule check get payment rule continue payment set trx type m payment trxtype creditpayment payment set amount check get parent getc currency id check get pay amt payment set discount amt check get discount amt payment set date trx check get parent get pay date payment setc bpartner id check getc bpartner id link to batch if batch null if batch getc paymentbatch id 0 batch save new payment setc paymentbatch id batch getc paymentbatch id link to invoice m pay selection line psls check get pay selection lines false s log fine confirm print check selection lines psls length if check get qty 1 psls null psls length 1 m pay selection line psl psls 0 s log fine map to invoice psl payment setc invoice id psl getc invoice id payment set discount amt psl get discount amt payment set write off amt psl get difference amt big decimal over under psl get open amt subtract psl get pay amt subtract psl get discount amt subtract psl get difference amt payment set over under amt over under else payment set discount amt env zero payment set write off amt env zero if payment save s log log level severe payment not saved payment int c payment id payment get id if c payment id 1 s log log level severe payment not created check else check setc payment id c payment id check save payment process needs it should start wf payment process it doc action action complete if payment save s log log level severe payment not saved payment new payment get check document no try int no integer parse int check get document no if last document no no last document no no catch number format exception ex s log log level severe document no check get document no ex check set is printed true check set processed true if check save s log log level severe check not saved check all checks s log fine last document no last document no return last document no confirmprint mpayselectioncheck mpaymentbatch lastdocumentno mpayselectioncheck mpayment mpayment getctx getc_payment_id getc_payment_id getpaymentrule paymentrule_check setcheckno getdocumentno s_log mpayment getctx setad_org_id getad_org_id getpaymentrule paymentrule_check setbankcheck getparent getc_bankaccount_id getdocumentno getpaymentrule paymentrule_creditcard settendertype mpayment tendertype_creditcard getpaymentrule paymentrule_directdeposit getpaymentrule paymentrule_directdeposit setbankach getparent getc_bankaccount_id s_log getpaymentrule settrxtype mpayment trxtype_creditpayment setamount getparent getc_currency_id getpayamt setdiscountamt getdiscountamt setdatetrx getparent getpaydate setc_bpartner_id getc_bpartner_id getc_paymentbatch_id setc_paymentbatch_id getc_paymentbatch_id mpayselectionline getpayselectionlines s_log confirmprint selectionlines getqty mpayselectionline s_log setc_invoice_id getc_invoice_id setdiscountamt getdiscountamt setwriteoffamt getdifferenceamt bigdecimal overunder getopenamt getpayamt getdiscountamt getdifferenceamt setoverunderamt overunder setdiscountamt setwriteoffamt s_log c_payment_id get_id c_payment_id s_log setc_payment_id c_payment_id processit docaction action_complete s_log parseint getdocumentno lastdocumentno lastdocumentno numberformatexception s_log documentno getdocumentno setisprinted setprocessed s_log s_log lastdocumentno lastdocumentno constructor param ctx context param c payselectioncheck id c payselectioncheck id public m pay selection check properties ctx int c payselectioncheck id string trx name super ctx c payselectioncheck id trx name if c payselectioncheck id 0 setc payselection id 0 setc bpartner id 0 set payment rule null set pay amt env zero set discount amt env zero set is printed false set is receipt false set qty 0 c_payselectioncheck_id c_payselectioncheck_id mpayselectioncheck c_payselectioncheck_id trxname c_payselectioncheck_id trxname c_payselectioncheck_id setc_payselection_id setc_bpartner_id setpaymentrule setpayamt setdiscountamt setisprinted setisreceipt setqty load constructor param ctx context param rs result set public m pay selection check properties ctx result set rs string trx name super ctx rs trx name mpayselectioncheck resultset trxname trxname create from line param line payment selection public m pay selection check m pay selection line line string payment rule this line get ctx 0 line get trxname set client org line setc payselection id line getc payselection id setc bpartner id line get invoice getc bpartner id set payment rule payment rule set is receipt line isso trx set pay amt line get pay amt set discount amt line get discount amt set qty 1 mpayselectioncheck mpayselectionline paymentrule getctx get_trxname setclientorg setc_payselection_id getc_payselection_id setc_bpartner_id getinvoice getc_bpartner_id setpaymentrule paymentrule setisreceipt issotrx setpayamt getpayamt setdiscountamt getdiscountamt setqty create from pay selection param ps payment selection public m pay selection check m pay selection ps string payment rule this ps get ctx 0 ps get trxname set client org ps setc payselection id ps getc payselection id set payment rule payment rule mpayselectioncheck mpayselection paymentrule getctx get_trxname setclientorg setc_payselection_id getc_payselection_id setpaymentrule paymentrule add payment selection line param line line public void add line m pay selection line line if getc bpartner id line get invoice getc bpartner id throw new illegal argument exception line for fifferent b partner if is receipt line isso trx set pay amt get pay amt add line get pay amt set discount amt get discount amt add line get discount amt else set pay amt get pay amt subtract line get pay amt set discount amt get discount amt subtract line get discount amt set qty get qty 1 addline mpayselectionline getc_bpartner_id getinvoice getc_bpartner_id illegalargumentexception bpartner isreceipt issotrx setpayamt getpayamt getpayamt setdiscountamt getdiscountamt getdiscountamt setpayamt getpayamt getpayamt setdiscountamt getdiscountamt getdiscountamt setqty getqty get parent return parent public m pay selection get parent if m parent null m parent new m pay selection get ctx getc payselection id get trxname return m parent mpayselection getparent m_parent m_parent mpayselection getctx getc_payselection_id get_trxname m_parent string representation return info public string to string string buffer sb new string buffer m payment check sb append get id append append get document no append append get pay amt append paymet rule append get payment rule append qty append get qty append return sb to string tostring stringbuffer stringbuffer mpaymentcheck get_id getdocumentno getpayamt paymetrule getpaymentrule getqty tostring get payment selection lines of this check param requery requery return array of peyment selection lines public m pay selection line get pay selection lines boolean requery if m lines null requery return m lines array list m pay selection line list new array list m pay selection line string sql select from c payselectionline where c payselectioncheck id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc payselectioncheck id result set rs pstmt execute query while rs next list add new m pay selection line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m pay selection line list size list to array m lines return m lines mpayselectionline getpayselectionlines m_lines m_lines arraylist mpayselectionline arraylist mpayselectionline c_payselectionline c_payselectioncheck_id preparedstatement preparestatement get_trxname setint getc_payselectioncheck_id resultset executequery mpayselectionline getctx get_trxname m_lines mpayselectionline toarray m_lines m_lines get contents return contents public object get contents return contents getcontents start menu item param id id param is menu false if workflow param name name param menu menu public a menu start item int id boolean is menu string name a menu menu m id id m ismenu is menu m name name m menu menu if menu null m increment menu progress bar get maximum menu progress bar get minimum 5 ismenu amenustartitem ismenu amenu m_id m_ismenu ismenu m_name m_menu m_increment progressbar getmaximum progressbar getminimum public void run m value 0 if m menu null m menu progress bar set value 0 m_value m_menu m_menu progressbar setvalue public void run if m menu null return 100 5 20 ticks every 5 sec 10 seconds loadtime final int tick 5 if m menu progress bar get value m menu progress bar get maximum tick m menu progress bar set value m menu progress bar get value tick m_menu m_menu progressbar getvalue m_menu progressbar getmaximum m_menu progressbar setvalue m_menu progressbar getvalue public void run if m menu null return m value m increment if m menu progress bar get value m value max value m menu progress bar set value m value m_menu m_value m_increment m_menu progressbar getvalue m_value m_menu progressbar setvalue m_value start menu item public void run if m menu null m menu set busy true swing utilities invoke later m resetpb m timer start swing utilities invoke later m updatepb try string sql select from ad menu where ad menu id if m ismenu sql select from ad wf node where ad wf node id prepared statement pstmt db prepare statement sql null pstmt set int 1 m id result set rs pstmt execute query swing utilities invoke later m updatepb if rs next should only be one string action rs get string action string isso trx y if m ismenu isso trx rs get string isso trx int cmd if action equals w window cmd rs get int ad window id start window 0 cmd else if action equals p action equals r process report cmd rs get int ad process id start process cmd isso trx else if action equals b workbench cmd rs get int ad workbench id start window cmd 0 else if action equals f work flow if m ismenu cmd rs get int ad workflow id else cmd rs get int workflow id if m menu null m menu start work flow cmd else if action equals t task cmd rs get int ad task id start task cmd else if action equals x form cmd rs get int ad form id start form cmd else log log level severe no valid action in id m id for all records swing utilities invoke later m updatepb rs close pstmt close catch exception e log log level severe id m id e a dialog error 0 null error msg parse translation env get ctx e get message try thread sleep 1000 1 sec catch interrupted exception ie ready for next m timer stop swing utilities invoke later m resetpb if m menu null m menu update info m menu set busy false m_menu m_menu setbusy swingutilities invokelater m_resetpb m_timer swingutilities invokelater m_updatepb ad_menu ad_menu_id m_ismenu ad_wf_node ad_wf_node_id preparedstatement preparestatement setint m_id resultset executequery swingutilities invokelater m_updatepb getstring issotrx m_ismenu issotrx getstring issotrx getint ad_window_id startwindow getint ad_process_id startprocess issotrx getint ad_workbench_id startwindow workflow m_ismenu getint ad_workflow_id getint workflow_id m_menu m_menu startworkflow getint ad_task_id starttask getint ad_form_id startform m_id swingutilities invokelater m_updatepb m_id adialog parsetranslation getctx getmessage interruptedexception m_timer swingutilities invokelater m_resetpb m_menu m_menu updateinfo m_menu setbusy actlion listener for timer param e event public void action performed action event e swing utilities invoke later m tickpb actionperformed actionevent swingutilities invokelater m_tickpb start window param ad workbench id workbench param ad window id window private void start window int ad workbench id int ad window id if env show window ad window id return swing utilities invoke later m updatepb 1 a window frame new a window boolean ok false if ad workbench id 0 ok frame init workbench ad workbench id else ok frame init window ad window id null no query value if ok return swing utilities invoke later m updatepb 2 frame pack center the window swing utilities invoke later m updatepb 3 a env show center screen frame if wf panel is visible m wf window frame maintain one reference frame null ad_workbench_id ad_window_id startwindow ad_workbench_id ad_window_id showwindow ad_window_id swingutilities invokelater m_updatepb awindow awindow ad_workbench_id initworkbench ad_workbench_id initwindow ad_window_id swingutilities invokelater m_updatepb swingutilities invokelater m_updatepb aenv showcenterscreen wfpanel isvisible m_wf_window start process start show process dialog which calls process ctl param ad process id process param isso trx is so trx private void start process int ad process id string isso trx swing utilities invoke later m updatepb 1 boolean isso false if isso trx null isso trx equals y isso true m timer stop process dialog pd new process dialog ad process id isso if pd init return m timer start swing utilities invoke later m updatepb 2 pd pack center the window swing utilities invoke later m updatepb 3 a env show center screen pd processctl ad_process_id issotrx startprocess ad_process_id issotrx swingutilities invokelater m_updatepb issotrx issotrx m_timer processdialog processdialog ad_process_id m_timer swingutilities invokelater m_updatepb swingutilities invokelater m_updatepb aenv showcenterscreen start os task param ad task id task private void start task int ad task id swing utilities invoke later m updatepb 1 get command m task task null string sql select from ad task where ad task id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad task id result set rs pstmt execute query if rs next task new m task env get ctx rs null rs close pstmt close catch sql exception e log log level severe sql e if task null return swing utilities invoke later m updatepb 2 new a task m name task a task start m name task ad_task_id starttask ad_task_id swingutilities invokelater m_updatepb mtask ad_task ad_task_id preparedstatement preparestatement setint ad_task_id resultset executequery mtask getctx sqlexception swingutilities invokelater m_updatepb atask m_name atask m_name start form param ad form id form private void start form int ad form id form frame ff new form frame swing utilities invoke later m updatepb 1 ff open form ad form id swing utilities invoke later m updatepb 2 ff pack center the window swing utilities invoke later m updatepb 3 a env show center screen ff ad_form_id startform ad_form_id formframe formframe swingutilities invokelater m_updatepb openform ad_form_id swingutilities invokelater m_updatepb swingutilities invokelater m_updatepb aenv showcenterscreen standard constructor param ctx context param ignored id 0 param trx name trx public m form access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key else setad form id 0 setad role id 0 set is read write true trxname mformaccess trxname trxname illegalargumentexception setad_form_id setad_role_id setisreadwrite load constructor param ctx context param rs result set public m form access properties ctx result set rs string trx name super ctx rs trx name mformaccess resultset trxname trxname parent constructor param parent parent param ad role id role id public m form access m form parent int ad role id super parent get ctx 0 parent get trxname set client org parent setad form id parent getad form id setad role id ad role id ad_role_id mformaccess mform ad_role_id getctx get_trxname setclientorg setad_form_id getad_form_id setad_role_id ad_role_id get a parameter value public string get parameter string key string def return is standalone system get property key def get parameter key null get parameter key def getparameter isstandalone getproperty getparameter getparameter construct the applet public a start astart initialize the applet public void init try jb init catch exception e e print stack trace jbinit printstacktrace component initialization private void jb init throws exception this set size new dimension 400 300 jbinit setsize start the applet public void start stop the applet public void stop destroy the applet public void destroy get applet information public string get applet info return start applet getappletinfo get parameter info public string get parameter info return null getparameterinfo main method public static void main string args a start applet new a start applet is standalone true j frame frame new j frame exit on close 3 frame set default close operation 3 frame set title start applet frame get content pane add applet border layout center applet init applet start frame set size 400 320 dimension d toolkit get default toolkit get screen size frame set location d width frame get size width 2 d height frame get size height 2 frame set visible true astart astart isstandalone jframe jframe exit_on_close setdefaultcloseoperation settitle getcontentpane borderlayout setsize getdefaulttoolkit getscreensize setlocation getsize getsize setvisible default constructor use set methods public param sets the name of this parameter param name sets the name of this parameter public param set name string name add attribute name name return this setname addattribute sets the value of this attribute param value sets the value attribute public param set value string value add attribute value value return this setvalue addattribute sets the valuetype of this parameter param valuetype sets the name of this parameter br ref data object convience varaibles provided as param ref param data param object public param set value type string valuetype add attribute value valuetype return this setvaluetype addattribute sets the mime type of this object param the mime type of this object public param set type string cdata add attribute type cdata return this settype addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public param add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public param add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public param add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public param add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public param remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception check out servlet init servletexception servletconfig servletexception webenv initweb servletexception checkoutservlet get servlet information return info public string get servlet info return a dempiere web check out servlet getservletinfo adempiere checkout clean up resources public void destroy log fine destroy process the http get request logout delete cookie sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr http session session request get session true session remove attribute web session ctx hdr message web user basket web user wu web user session get attribute web user name web basket wb web basket session get attribute web basket name string url login jsp nothing in basket if wb null wb get line count 0 url basket jsp else session set attribute attr checkout y indicate checkout if wu null wu is logged in url address info jsp if request is secure log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response else switch to secure url https request get server name request get context path url log info do get secure forward to url w util create forward page response secure access url deletecookie servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message webuser webuser getattribute webuser webbasket webbasket getattribute webbasket getlinecount setattribute attr_checkout isloggedin addressinfo issecure requestdispatcher getservletcontext getrequestdispatcher getservername getcontextpath doget wutil createforwardpage process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr http session session request get session false servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession construct parameter param parameter name parameter name param parameter parameter param parameter to to parameter param info info param info to to info public process info parameter string parameter name object parameter object parameter to string info string info to set parameter name parameter name set parameter parameter setparameter to parameter to set info info setinfo to info to parametername parameter_to info_to processinfoparameter parametername parameter_to info_to setparametername parametername setparameter setparameter_to parameter_to setinfo setinfo_to info_to string representation return info public string to string from to if m parameter to null m info to length 0 return process info parameter m parametername m parameter m parameter null m parameter get class get name m info m parameter to m parameter to null m parameter to get class get name m info to value return process info parameter m parametername m parameter m parameter null m parameter get class get name m info tostring m_parameter_to m_info_to processinfoparameter m_parametername m_parameter m_parameter m_parameter getclass getname m_info m_parameter_to m_parameter_to m_parameter_to getclass getname m_info_to processinfoparameter m_parametername m_parameter m_parameter m_parameter getclass getname m_info method get info return string public string get info return m info getinfo getinfo m_info method getinfo to return string public string getinfo to return m info to getinfo_to getinfo_to m_info_to method get parameter return object public object get parameter return m parameter getparameter getparameter m_parameter method get parameter as int return object public int get parameter as int if m parameter null return 0 if m parameter instanceof number return number m parameter int value big decimal bd new big decimal m parameter to string return bd int value getparameter getparameterasint m_parameter m_parameter m_parameter intvalue bigdecimal bigdecimal m_parameter tostring intvalue method getparameter to return object public object getparameter to return m parameter to getparameter_to getparameter_to m_parameter_to method get parameter as int return object public int getparameter toasint if m parameter to null return 0 if m parameter to instanceof number return number m parameter to int value big decimal bd new big decimal m parameter to to string return bd int value getparameter getparameter_toasint m_parameter_to m_parameter_to m_parameter_to intvalue bigdecimal bigdecimal m_parameter_to tostring intvalue method get parameter name return string public string get parameter name return m parametername getparametername getparametername m_parametername method set info param info string public void set info string info if info null m info else m info info setinfo setinfo m_info m_info method setinfo to param info to string public void setinfo to string info to if info to null m info to else m info to info to setinfo_to info_to setinfo_to info_to info_to m_info_to m_info_to info_to method set parameter param parameter object public void set parameter object parameter m parameter parameter setparameter setparameter m_parameter method setparameter to param parameter to object public void setparameter to object parameter to m parameter to parameter to setparameter_to parameter_to setparameter_to parameter_to m_parameter_to parameter_to method set parameter name param parameter name string public void set parameter name string parameter name m parametername parameter name setparametername parametername setparametername parametername m_parametername parametername print data element constructor param column name name param value display value param display type optional display type param isp key is primary key param is page break if true force page break public print data element string column name object value int display type boolean isp key boolean is page break if column name null throw new illegal argument exception print data element name cannot be null m columnname column name m value value m displaytype display type m ispkey isp key m ispagebreak is page break columnname displaytype displaytype ispkey ispagebreak printdataelement columnname displaytype ispkey ispagebreak columnname illegalargumentexception printdataelement m_columnname columnname m_value m_displaytype displaytype m_ispkey ispkey m_ispagebreak ispagebreak print data element constructor param column name name param value display value param display type optional display type public print data element string column name object value int display type this column name value display type false false columnname displaytype displaytype printdataelement columnname displaytype columnname displaytype get name return name public string get column name return m columnname getcolumnname m_columnname get node value return value public object get value return m value getvalue m_value get function value return length or numeric value public big decimal get function value if m value null return env zero numbers return number value if m value instanceof big decimal return big decimal m value if m value instanceof number return new big decimal number m value double value boolean return 1 for true 0 for false if m value instanceof boolean if boolean m value boolean value return env one else return env zero return length string s m value to string return new big decimal s length bigdecimal getfunctionvalue m_value m_value bigdecimal bigdecimal m_value m_value bigdecimal m_value doublevalue m_value m_value booleanvalue m_value tostring bigdecimal get node value display param language optional language if null nubers dates are not formatted return display value optionally formatted public string get value display language language if m value null return string ret value m value to string if m displaytype display type location return getvaluedisplay location else if m columnname equals c bpartner location id m columnname equals bill location id return getvaluedisplay bplocation else if m displaytype 0 m value instanceof string m value instanceof name pair else if language null optional formatting of numbers and dates if display type is numeric m displaytype ret value display type get number format m displaytype language format m value else if display type is date m displaytype ret value display type get date format m displaytype language format m value return ret value getvaluedisplay m_value retvalue m_value tostring m_displaytype displaytype getvaluedisplay_location m_columnname c_bpartner_location_id m_columnname bill_location_id getvaluedisplay_bplocation m_displaytype m_value m_value namepair displaytype isnumeric m_displaytype retvalue displaytype getnumberformat m_displaytype m_value displaytype isdate m_displaytype retvalue displaytype getdateformat m_displaytype m_value retvalue get node data value as string return data value public string get value as string if m value null return string ret value m value to string if m value instanceof name pair ret value name pair m value getid return ret value getvalueasstring m_value retvalue m_value tostring m_value namepair retvalue namepair m_value retvalue return address string not just name return address string private string getvaluedisplay bplocation try int c bpartner location id integer parse int get value key if c bpartner location id 0 m location loc m location getbp location env get ctx c bpartner location id null if loc null return loc to stringcr catch exception ex return m value to string getvaluedisplay_bplocation c_bpartner_location_id parseint getvaluekey c_bpartner_location_id mlocation mlocation getbplocation getctx c_bpartner_location_id tostringcr m_value tostring return address string not just city return address string private string getvaluedisplay location try int c location id integer parse int get value key if c location id 0 m location loc new m location env get ctx c location id null if loc null return loc to stringcr catch exception ex return m value to string getvaluedisplay_location c_location_id parseint getvaluekey c_location_id mlocation mlocation getctx c_location_id tostringcr m_value tostring get node value key return key public string get value key if m value null return if m value instanceof name pair return name pair m value getid return getvaluekey m_value m_value namepair namepair m_value is value null return true if value is null public boolean is null return m value null isnull m_value get display type return display type public int get display type return m displaytype getdisplaytype m_displaytype is value numeric return true if value is a numeric public boolean is numeric if m displaytype 0 return m value instanceof big decimal return display type is numeric m displaytype isnumeric m_displaytype m_value bigdecimal displaytype isnumeric m_displaytype is value a date return true if value is a date public boolean is date if m displaytype 0 return m value instanceof timestamp return display type is date m displaytype isdate m_displaytype m_value displaytype isdate m_displaytype is value an id return true if value is an id public boolean isid return display type isid m displaytype displaytype m_displaytype is value boolean return true if value is a boolean public boolean is yes no if m displaytype 0 return m value instanceof boolean return display type yes no m displaytype isyesno m_displaytype m_value displaytype yesno m_displaytype is value the primary key of row return true if value is the pk public boolean isp key return m ispkey ispkey m_ispkey column value forces page break return true if page break public boolean is page break return m ispagebreak ispagebreak m_ispagebreak hash code return hash code public int hash code if m value null return m columnname hash code return m columnname hash code m value hash code hashcode hashcode m_value m_columnname hashcode m_columnname hashcode m_value hashcode equals param compare compare object return true if equals public boolean equals object compare if compare instanceof print data element print data element pde print data element compare if pde get column name equals m columnname if pde get value null pde get value equals m value return true if pde get value null m value null return true return false printdataelement printdataelement printdataelement getcolumnname m_columnname getvalue getvalue m_value getvalue m_value string representation return info public string to string string buffer sb new string buffer m columnname append append m value if m ispkey sb append pk return sb to string tostring stringbuffer stringbuffer m_columnname m_value m_ispkey tostring value has key return true if value has a key public boolean has key return m value instanceof name pair haskey m_value namepair string representation with key info return info public string to stringx if m value instanceof name pair name pair pp name pair m value string buffer sb new string buffer m columnname sb append append pp getid append append append pp get name if m ispkey sb append pk return sb to string else return to string tostringx m_value namepair namepair namepair m_value stringbuffer stringbuffer m_columnname getname m_ispkey tostring tostring initialize panel param window no window param frame frame public void init int window no form frame frame log info vsql process init m windowno window no m frame frame try jb init frame get content pane add this border layout center frame get content pane add confirm panel border layout south catch exception e log log level severe vsql process init e windowno windowno formframe vsqlprocess m_windowno windowno m_frame jbinit getcontentpane borderlayout getcontentpane confirmpanel borderlayout vsqlprocess dispose free resources public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame static init throws exception void jb init throws exception this set layout main layout main layout set hgap 5 main layout set vgap 5 this add north panel border layout north north layout set hgap 5 north layout set vgap 5 north panel set layout north layout sql label set text sql north panel add sql label border layout west north panel add sql field border layout center sql button add action listener this north panel add sql button border layout east this add center panel border layout center center panel set layout center layout center layout set hgap 0 result field set read write false center panel add result field border layout center jbinit setlayout mainlayout mainlayout sethgap mainlayout setvgap northpanel borderlayout northlayout sethgap northlayout setvgap northpanel setlayout northlayout sqllabel settext northpanel sqllabel borderlayout northpanel sqlfield borderlayout sqlbutton addactionlistener northpanel sqlbutton borderlayout centerpanel borderlayout centerpanel setlayout centerlayout centerlayout sethgap resultfield setreadwrite centerpanel resultfield borderlayout action listener param e event public void action performed action event e result field set text process statements sql field get text false actionperformed actionevent resultfield settext processstatements sqlfield gettext process sql statements param sql statements one or more statements separated by param allowdml allow dml statements return result public static string process statements string sql statements boolean allowdml if sql statements null sql statements length 0 return string buffer result new string buffer string tokenizer st new string tokenizer sql statements false while st has more tokens result append process statement st next token allowdml result append env nl return result to string sqlstatements processstatements sqlstatements sqlstatements sqlstatements stringbuffer stringbuffer stringtokenizer stringtokenizer sqlstatements hasmoretokens processstatement nexttoken tostring process sql statements param sql statement one statement param allowdml allow dml statements return result public static string process statement string sql statement boolean allowdml if sql statement null return string buffer sb new string buffer char chars sql statement to char array for int i 0 i chars length i char c chars i if character is whitespace c sb append else sb append c string sql sb to string trim if sql length 0 return string buffer result new string buffer sql append sql append env nl if allowdml boolean error false string sql sql to upper case for int i 0 i dml keywords length i if sql starts with dml keywords i sql index of dml keywords i 1 sql index of dml keywords i 1 result append error not allowed keyword append dml keywords i append env nl error true if error return result to string allowdml process connection conn db create connection true connection transaction read committed statement stmt null try stmt conn create statement boolean ok stmt execute sql int count stmt get update count if count 1 result append result set else result append result append count catch sql exception e log log level severe process statement sql e to string result append append e to string clean up try stmt close catch sql exception e1 log log level severe process statement close statement e1 stmt null try conn close catch sql exception e2 log log level severe process statement close connection e2 conn null result append env nl return result to string sqlstatement processstatement sqlstatement sqlstatement stringbuffer stringbuffer sqlstatement tochararray iswhitespace tostring stringbuffer stringbuffer touppercase dml_keywords startswith dml_keywords indexof dml_keywords indexof dml_keywords dml_keywords tostring createconnection transaction_read_committed createstatement getupdatecount resultset sqlexception tostring tostring sqlexception processstatement sqlexception processstatement tostring constructor protected print element printelement get calculated width return width public float get width if p sizecalculated p sizecalculated calculate size return p width getwidth p_sizecalculated p_sizecalculated calculatesize p_width get calculated height return height public float get height if p sizecalculated p sizecalculated calculate size return p height getheight p_sizecalculated p_sizecalculated calculatesize p_height get calculated height on page param page no page number return height public float get height int page no return get height pageno getheight pageno getheight get number of pages return page count 1 public int get page count return 1 getpagecount layout and calculate size set p width p height return true if calculated p_width p_height layout element param max width max width param max height max height param is height one line just one line param field alignment type alignment type m print format item field align public void layout float max width float max height boolean is height one line string field alignment type if is height one line p maxheight 1f else if max height 0f p maxheight max height p maxwidth max width p fieldalignmenttype field alignment type if p fieldalignmenttype null p fieldalignmenttype m print format item fieldalignmenttype default p fieldalignmenttype m print format item fieldalignmenttype leadingleft p sizecalculated calculate size maxwidth maxheight isheightoneline fieldalignmenttype mprintformatitem field_align_ maxwidth maxheight isheightoneline fieldalignmenttype isheightoneline p_maxheight maxheight p_maxheight maxheight p_maxwidth maxwidth p_fieldalignmenttype fieldalignmenttype p_fieldalignmenttype p_fieldalignmenttype mprintformatitem fieldalignmenttype_default p_fieldalignmenttype mprintformatitem fieldalignmenttype_leadingleft p_sizecalculated calculatesize set maximum height param max height maximum height 0 is no limit public void set max height float max height p maxheight max height maxheight setmaxheight maxheight p_maxheight maxheight set maximum width param max width maximum width 0 is no limit public void set max width float max width p maxwidth max width maxwidth setmaxwidth maxwidth p_maxwidth maxwidth set location within page called from layout engine layout form lauout create standard footer header param page location location within page public void set location point2d page location p pagelocation new point2d double page location getx page location gety layoutengine layoutform createstandardfooterheader pagelocation setlocation pagelocation p_pagelocation pagelocation pagelocation get location within page return location within page public point2d get location return p pagelocation getlocation p_pagelocation return absolute position param page start start of page return absolite position protected point2d double get absolute location point2d page start point2d double ret value new point2d double p pagelocation x page start getx p pagelocation y page start gety log finest print element get absolute location page start page start getx page start gety page locaton p pagelocation x p pagelocation y ret value x ret value y return ret value pagestart getabsolutelocation pagestart retvalue p_pagelocation pagestart p_pagelocation pagestart printelement getabsolutelocation pagestart pagestart pagestart pagelocaton p_pagelocation p_pagelocation retvalue retvalue retvalue get relative bounds of element return bounds relative position on page public rectangle get bounds if p pagelocation null return new rectangle 0 0 int p width int p height return new rectangle int p pagelocation x int p pagelocation y int p width int p height getbounds p_pagelocation p_width p_height p_pagelocation p_pagelocation p_width p_height get drill down value param relative point relative point param page no page number return null subclasses overwrite public m query get drill down point relative point int page no return null relativepoint pageno mquery getdrilldown relativepoint pageno get drill across value param relative point relative point param page no page number return null subclasses overwrite public m query get drill across point relative point int page no return null relativepoint pageno mquery getdrillacross relativepoint pageno translate context if required if content is translated the element needs to stay in the bounds of the originally calculated size and need to align the field param ctx context public void translate properties ctx noop content is translated return false public boolean is translated return false istranslated paint print param g2d graphics param page no page number for multi page support 0 header footer param page start top left location of page param ctx context param is view true if online view i ds are links pageno pagestart isview ids image observer param img image param infoflags observer flags param x x coordinate param y y coordinate param width image width param height image height return false if the infoflags indicate that the image is completely loaded true otherwise public boolean image update image img int infoflags int x int y int width int height copied from java awt component m imagenotloaded infoflags allbits abort 0 if c log mgt is level finest log finest flags infoflags x x y y width width height height not loaded m imagenotloaded return m imagenotloaded imageupdate m_imagenotloaded clogmgt islevelfinest notloaded m_imagenotloaded m_imagenotloaded wait until image is loaded param image image return true if loaded public boolean wait for load image image long start system current time millis thread yield int count 0 try toolkit toolkit toolkit get default toolkit while toolkit prepare image image 1 1 this image observer calls image update timeout if count 1000 about 20 sec overall log severe this timeout system current time millis start ms count return false try if count 10 thread sleep 10 else if count 100 thread sleep 15 else thread sleep 20 catch interrupted exception ex log log level severe ex break count catch exception e java lang security exception log log level severe e return false if count 0 log fine system current time millis start ms count return true waitforload currenttimemillis getdefaulttoolkit prepareimage imageobserver imageupdate currenttimemillis interruptedexception securityexception currenttimemillis get detail info from sub class return detail info protected string get detail info return getdetailinfo string representation return info public string to string string cn get class get name string buffer sb new string buffer sb append cn substring cn last index of 1 append sb append bounds append get bounds append height append p height append append p maxheight append width append p width append append p maxheight append page location append p pagelocation sb append return sb to string tostring getclass getname stringbuffer stringbuffer lastindexof getbounds p_height p_maxheight p_width p_maxheight pagelocation p_pagelocation tostring get contents return contents public object get contents return contents getcontents default constructor creates the lt object gt element br use set methods public object sets the declare attribute declare this object but don t instantiate it param declare declare on or off public object set declare boolean declare if declare add attribute declare declare else remove attribute declare return this setdeclare addattribute removeattribute identifies an implementation param url location of classid public object set class id string url add attribute classid url return this setclassid addattribute sets the internet content type for the code param codetype sets the internet content type for the code public object set code type string codetype add attribute codetype codetype return this setcodetype addattribute determines the base path to resolve relative urls specified by classid param url base path to resolve relative urls specified by classid public object set code base string url add attribute codebase url return this setcodebase addattribute this attribute specifies the location of the data to be rendered param url this attribute specifies the location of the data to be rendered public object set data string url add attribute data url return this setdata addattribute this attribute specifies the internet media type for the data specified by data br this should be a mime type param type a mime type for the data specifed by the data attribute public object set type string type add attribute type type return this settype addattribute space seperated archive list param url space seperate archive list anyone know what the hell this is the spec is rather vague in its definition public object set archive string url add attribute archive url return this setarchive addattribute message to show while the object is loading param cdata the message to show while the object is loading public object set stand by string cdata add attribute standby cdata return this setstandby addattribute suggested link border width param border suggested link border width public object set border string border add attribute border border return this setborder addattribute suggested link border width param border suggested link border width public object set border int border add attribute border integer to string border return this setborder addattribute tostring suggested link border width param border suggested link border width public object set border double border add attribute border double to string border return this setborder addattribute tostring suggested height of object param height suggested link height public object set height string height add attribute height height return this setheight addattribute suggested height of object param height suggested link height public object set height int height add attribute height integer to string height return this setheight addattribute tostring suggested height of object param height suggested link height public object set height double height add attribute height double to string height return this setheight addattribute tostring suggested width of object param height suggested link width public object set width string width add attribute width width return this setwidth addattribute suggested width of object param height suggested link width public object set width int width add attribute width integer to string width return this setwidth addattribute tostring suggested width of object param height suggested link width public object set width double width add attribute width double to string width return this setwidth addattribute tostring suggested horizontal gutter param hspace suggested horizontal gutter public object seth space string hspace add attribute hspace hspace return this sethspace addattribute suggested horizontal gutter param hspace suggested horizontal gutter public object seth space int hspace add attribute hspace integer to string hspace return this sethspace addattribute tostring suggested horizontal gutter param hspace suggested horizontal gutter public object seth space double hspace add attribute hspace double to string hspace return this sethspace addattribute tostring suggested vertical gutter param hspace suggested vertical gutter public object setv space string vspace add attribute vspace vspace return this setvspace addattribute suggested vertical gutter param hspace suggested vertical gutter public object setv space int vspace add attribute vspace integer to string vspace return this setvspace addattribute tostring suggested vertical gutter param hspace suggested vertical gutter public object setv space double vspace add attribute vspace double to string vspace return this setvspace addattribute tostring set the horizontal or vertical alignment of this object br convience variables are in the align types interface param alignment set the horizontal or vertical alignment of this object br convience variables are in the align types interface public object set align string alignment add attribute align alignment return this aligntypes aligntypes setalign addattribute location of image map to use param url location of image map to use public object set use map string url add attribute usemap url return this setusemap addattribute object has shaped hypertext links param shape does the object have shaped hypertext links public object set shapes boolean shape if shape add attribute shapes shapes else remove attribute shapes return this setshapes addattribute removeattribute set the name of this object param name set the name of this object public object set name string name add attribute name name return this setname addattribute set the elements position in the tabbing order param number set the elements position in the tabbing order public object set tab index int number add attribute tabindex integer to string number return this settabindex addattribute tostring set the elements position in the tabbing order param number set the elements position in the tabbing order public object set tab index string number add attribute tabindex number return this settabindex addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public object add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public object add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add an element to the element param element a string representation of the element public object add element string element add element to registry element return this addelement addelementtoregistry add an element to the element param element an element to add public object add element element element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public object remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c rfqline properties ctx int c rfqline id string trx name super ctx c rfqline id trx name if c rfqline id 0 setc rfqline id 0 setc rfq id 0 set line 0 sql select coalesce max line 0 10 as default value from c rfqline where c rfq id c rfq id setm attributesetinstance id 0 x_c_rfqline c_rfqline_id trxname c_rfqline_id trxname c_rfqline_id setc_rfqline_id setc_rfq_id setline defaultvalue c_rfqline c_rfq_id c_rfq_id setm_attributesetinstance_id load constructor public x c rfqline properties ctx result set rs string trx name super ctx rs trx name x_c_rfqline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfqline append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfqline get_id tostring set rfq line request for quotation line public void setc rfqline id int c rfqline id if c rfqline id 1 throw new illegal argument exception c rfqline id is mandatory set valuenocheck c rfqline id new integer c rfqline id setc_rfqline_id c_rfqline_id c_rfqline_id illegalargumentexception c_rfqline_id set_valuenocheck c_rfqline_id c_rfqline_id get rfq line request for quotation line public int getc rfqline id integer ii integer get value c rfqline id if ii null return 0 return ii int value getc_rfqline_id get_value c_rfqline_id intvalue set rfq request for quotation public void setc rfq id int c rfq id if c rfq id 1 throw new illegal argument exception c rfq id is mandatory set valuenocheck c rfq id new integer c rfq id setc_rfq_id c_rfq_id c_rfq_id illegalargumentexception c_rfq_id set_valuenocheck c_rfq_id c_rfq_id get rfq request for quotation public int getc rfq id integer ii integer get value c rfq id if ii null return 0 return ii int value getc_rfq_id get_value c_rfq_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc rfq id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_rfq_id set work complete date when work is planned to be complete public void set date work complete timestamp date work complete set value date work complete date work complete setdateworkcomplete dateworkcomplete set_value dateworkcomplete dateworkcomplete get work complete date when work is planned to be complete public timestamp get date work complete return timestamp get value date work complete getdateworkcomplete get_value dateworkcomplete set work start date when work is planned to be started public void set date work start timestamp date work start set value date work start date work start setdateworkstart dateworkstart set_value dateworkstart dateworkstart get work start date when work is planned to be started public timestamp get date work start return timestamp get value date work start getdateworkstart get_value dateworkstart set delivery days number of days planned until delivery public void set delivery days int delivery days set value delivery days new integer delivery days setdeliverydays deliverydays set_value deliverydays deliverydays get delivery days number of days planned until delivery public int get delivery days integer ii integer get value delivery days if ii null return 0 return ii int value getdeliverydays get_value deliverydays intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue constructor param vo value object public m window m windowvo vo m vo vo if load tab data enable events mwindow mwindowvo m_vo loadtabdata enableevents dispose public void dispose log info ad window id m vo ad window id for int i 0 i get tab count i get tab i dispose m tabs clear m tabs null ad_window_id m_vo ad_window_id gettabcount gettab m_tabs m_tabs load is complete return when async load is complete used for performance tests base test public void load compete for all tabs for int i 0 i get tab count i get tab i getm table load complete loadcompete gettabcount gettab getmtable loadcomplete get tab data and create m tab s return true if tab loaded private boolean load tab data log config if m vo tabs null return false for int t 0 t m vo tabs size t m tabvo m tabvo m tabvo m vo tabs get t if m tabvo null m tab m tab new m tab m tabvo env set context m tabvo ctx m tabvo window no m tabvo tab no key column name m tab get key column name set link column if m tab get link column name length 0 array list parents m tab get parent column names no parent no link if parents size 0 standard case else if parents size 1 m tab set link column name string parents get 0 else more than one parent search prior tabs for the right parent for all previous tabs for int i 0 i m tabs size i we have a tab m tab tab m tab m tabs get i string tab key tab get key column name may be look if one of our parents is the key of that tab for int j 0 j parents size j string parent string parents get j if parent equals tab key m tab set link column name parent break the tab could have more than one key look into their parents if tab key equals for int k 0 k tab get parent column names size k if parent equals tab get parent column names get k m tab set link column name parent break for all parents for all previous tabs parents size 1 set link column m tab set link column name null overwrites if ad column id exists m tabs add m tab for all tabs return true mtab loadtabdata m_vo m_vo mtabvo mtabvo mtabvo m_vo mtabvo mtab mtab mtab mtabvo setcontext mtabvo mtabvo windowno mtabvo tabno keycolumnname mtab getkeycolumnname mtab getlinkcolumnname arraylist mtab getparentcolumnnames mtab setlinkcolumnname m_tabs mtab mtab m_tabs tabkey getkeycolumnname tabkey mtab setlinkcolumnname tabkey getparentcolumnnames getparentcolumnnames mtab setlinkcolumnname mtab setlinkcolumnname ad_column_id m_tabs mtab get window icon return icon for window public image get image if m vo ad image id 0 return null m image m image m image get env get ctx m vo ad image id return m image get image getimage m_vo ad_image_id mimage mimage mimage getctx m_vo ad_image_id mimage getimage get window icon return icon for window public icon get icon if m vo ad image id 0 return null m image m image m image get env get ctx m vo ad image id return m image get icon geticon m_vo ad_image_id mimage mimage mimage getctx m_vo ad_image_id mimage geticon get color return compiere color or null public compiere color get color if m vo ad color id 0 return null m color mc new m color m vo ctx m vo ad color id null return mc get compiere color compierecolor compierecolor getcolor m_vo ad_color_id mcolor mcolor m_vo m_vo ad_color_id getcompierecolor so trx window return true if so trx public boolean isso trx return m vo isso trx issotrx m_vo issotrx open and query first tab events should be enabled and get first row public void query log info m tab tab get tab 0 tab query false 0 if tab get row count 0 tab navigate 0 mtab gettab getrowcount enable events enable data events of tabs add listeners private void enable events for int i 0 i get tab count i get tab i enable events enableevents gettabcount gettab enableevents get number of tabs return number of tabs public int get tab count return m tabs size gettabcount m_tabs get i th m tab null if not valid param i index return m tab public m tab get tab int i if i 0 i 1 m tabs size return null return m tab m tabs get i mtab mtab mtab gettab m_tabs mtab m_tabs get window id return ad window id public int getad window id return m vo ad window id window_id ad_window_id getad_window_id m_vo ad_window_id get window no return window no public int get window no return m vo window no windowno windowno getwindowno m_vo windowno get name return name public string get name return m vo name getname m_vo get description return description public string get description return m vo description getdescription m_vo get help return help public string get help return m vo help gethelp m_vo get window type return window type see windowtype public string get window type return m vo window type windowtype_ getwindowtype m_vo windowtype is transaction window return true if transaction public boolean is transaction return m vo window type equals m windowvo windowtype trx istransaction m_vo windowtype mwindowvo windowtype_trx get window size return window size or null if not set public dimension get window size if m vo win width 0 m vo win height 0 return new dimension m vo win width m vo win height return null getwindowsize m_vo winwidth m_vo winheight m_vo winwidth m_vo winheight to string return string representation public string to string return m window m vo window no m vo name m vo ad window id tostring mwindow m_vo windowno m_vo m_vo ad_window_id get help html document param java client true if java client false for browser return help public web doc get help doc boolean java client string title msg get msg env get ctx window get name web doc doc null if java client doc web doc create false title java client else html doc web doc create popup title doc add popup close body add element copy nbsp compiere nbsp body add element new a http www compiere org help online help td center doc add popup center false window if get description length 0 center add element new p add element new i get description if get help length 0 center add element new p add element get help links to tabs int size get tab count p p new p for int i 0 i size i m tab tab get tab i if i 0 p add element p add element new a tab i add element tab get name center add element p add element new p add element web doc nbsp for all tabs for int i 0 i size i table table new table 1 5 5 100 null m tab tab get tab i tr tr new tr add element new th add element new a set name tab i add element new h2 msg get msg env get ctx tab tab get name if tab get description length 0 tr add element new th add element new i tab get description else tr add element new th add element web doc nbsp table add element tr desciption td td new td set col span 2 if tab get help length 0 td add element new p add element tab get help links to fields p new p for int j 0 j tab get field count j m field field tab get field j string hdr field get header if hdr null hdr length 0 if j 0 p add element p add element new a field i j hdr td add element p table add element new tr add element td for all fields for int j 0 j tab get field count j m field field tab get field j string hdr field get header if hdr null hdr length 0 td new td set col span 2 add element new a set name field i j add element new h3 msg get msg env get ctx field hdr if field get description length 0 td add element new i field get description if field get help length 0 td add element new p add element field get help table add element new tr add element td for all fields center add element table center add element new p add element web doc nbsp for all tabs if java client doc add popup close system out println doc to string return doc javaclient webdoc gethelpdoc javaclient getmsg getctx getname webdoc javaclient webdoc javaclient webdoc createpopup addpopupclose addelement addelement addpopupcenter getdescription addelement addelement getdescription gethelp addelement addelement gethelp gettabcount mtab gettab addelement addelement addelement getname addelement addelement addelement webdoc mtab gettab addelement addelement setname addelement getmsg getctx getname getdescription addelement addelement getdescription addelement addelement webdoc addelement setcolspan gethelp addelement addelement gethelp getfieldcount mfield getfield getheader addelement addelement addelement addelement addelement getfieldcount mfield getfield getheader setcolspan addelement setname addelement getmsg getctx getdescription addelement getdescription gethelp addelement addelement gethelp addelement addelement addelement addelement addelement webdoc javaclient addpopupclose tostring standard constructor public x m locator properties ctx int m locator id string trx name super ctx m locator id trx name if m locator id 0 set is default false setm locator id 0 setm warehouse id 0 set priority no 0 50 set value null setx null sety null setz null x_m_locator m_locator_id trxname m_locator_id trxname m_locator_id setisdefault setm_locator_id setm_warehouse_id setpriorityno setvalue load constructor public x m locator properties ctx result set rs string trx name super ctx rs trx name x_m_locator resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m locator append get id append return sb to string tostring stringbuffer stringbuffer x_m_locator get_id tostring set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set valuenocheck m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_valuenocheck m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set relative priority where inventory should be picked from first public void set priority no int priority no set value priority no new integer priority no setpriorityno priorityno set_value priorityno priorityno get relative priority where inventory should be picked from first public int get priority no integer ii integer get value priority no if ii null return 0 return ii int value getpriorityno get_value priorityno intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue set aisle x x dimension e g aisle public void setx string x if x null throw new illegal argument exception x is mandatory if x length 60 log warning length 60 truncated x x substring 0 59 set value x x illegalargumentexception set_value get aisle x x dimension e g aisle public string getx return string get value x get_value set bin y y dimension e g bin public void sety string y if y null throw new illegal argument exception y is mandatory if y length 60 log warning length 60 truncated y y substring 0 59 set value y y illegalargumentexception set_value get bin y y dimension e g bin public string gety return string get value y get_value set level z z dimension e g level public void setz string z if z null throw new illegal argument exception z is mandatory if z length 60 log warning length 60 truncated z z substring 0 59 set value z z illegalargumentexception set_value get level z z dimension e g level public string getz return string get value z get_value initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception login servlet init servletexception servletconfig servletexception webenv initweb servletexception loginservlet get servlet information return info public string get servlet info return a dempiere web login servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request logout delete cookie sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr http session session request get session true session remove attribute web session ctx hdr message w env dump request save forward parameter string forward web util get parameter request p forwardto get forward from request if forward null session set attribute p forwardto forward string sales rep web util get parameter request p salesrep id get sales rep from request if sales rep null session set attribute p salesrep id sales rep string url login jsp mode string mode web util get parameter request mode boolean delete cookie delete cookie equals mode if delete cookie log fine delete cookie jsp env delete cookie web user request response boolean logout logout equals mode if logout delete cookie log fine logout if session null properties ctx jsp env get ctx request m session c session m session get ctx false if c session null c session logout web user wu web user session get attribute web user name if wu null wu logout session set max inactive interval 1 session invalidate forward to unsecure web util create forward page response logout http request get server name 2 return if url starts with url url log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response return deletecookie servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message wenv webutil getparameter p_forwardto setattribute p_forwardto salesrep webutil getparameter p_salesrep_id salesrep salesrep setattribute p_salesrep_id salesrep login_jsp webutil getparameter deletecookie deletecookie deletecookie deletecookie jspenv deletecookiewebuser deletecookie jspenv getctx msession csession msession csession csession webuser webuser getattribute webuser setmaxinactiveinterval webutil createforwardpage getservername startswith requestdispatcher getservletcontext getrequestdispatcher process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message w env dump session w env dump request forward url string url web util get parameter request p forwardto get forward from request string sales rep web util get parameter request p salesrep id get sales rep from request if sales rep null session set attribute p salesrep id sales rep boolean check out y equals session get attribute check out servlet attr checkout set in login jsp address info jsp boolean address confirm y equals web util get parameter request address confirm if check out if address confirm url order servlet else url address info jsp else address confirm false if url null url length 0 url string session get attribute p forwardto get from session if url null url length 0 url index jsp else if url starts with url url session set attribute p forwardto url save for log in issues sales rep parameter sales rep string session get attribute p salesrep id get sales rep from session if sales rep null url salesrep id sales rep string mode web util get parameter request mode log fine targeting url url mode mode web user web user wu web user get request get base info string email web util get parameter request e mail if email null email email email trim string password web util get parameter request password if password null password null loads w o check password password trim send e mail send password e mail request if sende mail equals mode log info send mail wu web user get ctx email find it if wu ise mail valid wu set password message e mail not found in system else wu set password set password to current string msg jsp env sende mail request wu m mail msg mailmsgtype userpassword new object request get server name wu get name jsp env get from request wu get password if e mail sent ok equals msg wu set password message e mail sent else wu set password message problem sending e mail msg url login jsp sende mail login else if login equals mode log info login email password add cookie jsp env add cookie web user request response email always re query wu web user get ctx email password false wu login password password valid if wu is logged in if url equals login jsp url index jsp create session with user id m session c session m session get ctx request get remote addr request get remote host session get id if c session null c session set web store session true else url login jsp log fine password message wu get password message session set attribute info name new info ctx wu login login new else if login new equals mode log info login new jsp env add cookie web user request response wu web user get ctx url login jsp submit update new contact else if submit equals mode log info submit email password addr conf address confirm we have a record for address update if wu null wu is logged in address confirm address update else submit always re load user record wu web user get ctx email null false load w o password check direct if wu getad user id 0 existing bpc string password new web util get parameter request password new if password new null password new boolean password change password new length 0 password new equals password if address confirm wu login password create set session if wu is logged in m session c session m session get ctx request get remote addr request get remote host session get id if c session null c session set web store session true if password change log fine update pwd email old password db wu get password new password new if update fields request wu password change if password change session set attribute web session ctx hdr message password changed session set attribute info name new info ctx wu else url login jsp log warning update not done else url login jsp session set attribute web session ctx hdr message email password not correct log warning update not confirmed else new log fine new email password wu set email email wu set password password if update fields request wu true if wu login password session set attribute info name new info ctx wu create set session m session c session m session get ctx request get remote addr request get remote host session get id if c session null c session set web store session true else url login jsp else log fine failed wu get save error message wu get password message url login jsp new submit else log log level warning unknown request mode session set attribute web user name wu if url starts with url url log info do post forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession removeattribute websessionctx hdr_message wenv wenv webutil getparameter p_forwardto salesrep webutil getparameter p_salesrep_id salesrep salesrep setattribute p_salesrep_id salesrep checkout getattribute checkoutservlet attr_checkout addressinfo addressconfirm webutil getparameter addressconfirm checkout addressconfirm orderservlet addressinfo addressconfirm getattribute p_forwardto startswith setattribute p_forwardto salesrep salesrep getattribute p_salesrep_id salesrep salesrep salesrep_id salesrep webutil getparameter webuser webuser webutil getparameter email webutil getparameter email email sendemail webuser isemailvalid setpasswordmessage email setpassword jspenv sendemail mmailmsg mailmsgtype_userpassword getservername getname jspenv getfrom getpassword email sent_ok setpasswordmessage email setpasswordmessage email login_jsp sendemail jspenv addcookiewebuser webuser isloggedin login_jsp msession csession msession getremoteaddr getremotehost getid csession csession setwebstoresession login_jsp passwordmessage getpasswordmessage setattribute loginnew loginnew jspenv addcookiewebuser webuser login_jsp addrconf addressconfirm isloggedin addressconfirm webuser getad_user_id passwordnew webutil getparameter passwordnew passwordnew passwordnew passwordchange passwordnew passwordnew addressconfirm isloggedin msession csession msession getremoteaddr getremotehost getid csession csession setwebstoresession passwordchange getpassword passwordnew updatefields passwordchange passwordchange setattribute websessionctx hdr_message setattribute login_jsp login_jsp setattribute websessionctx hdr_message setemail setpassword updatefields setattribute msession csession msession getremoteaddr getremotehost getid csession csession setwebstoresession login_jsp getsaveerrormessage getpasswordmessage login_jsp setattribute webuser startswith dopost requestdispatcher getservletcontext getrequestdispatcher update web user param request request param wu user param updatee mail pwd if true change email password return true if saved private boolean update fields http servlet request request web user wu boolean updatee mail pwd if updatee mail pwd string s web util get parameter request password new wu set password message null wu set password s if wu get password message null return false s web util get parameter request e mail if web util is email valid s wu set password message e mail invalid return false wu set email s trim string buffer mandatory new string buffer string s web util get parameter request name if s null s length 0 wu set name s trim else mandatory append name s web util get parameter request company if s null s length 0 wu set company s s web util get parameter request title if s null s length 0 wu set title s s web util get parameter request address if s null s length 0 wu set address s else mandatory append address s web util get parameter request address2 if s null s length 0 wu set address2 s s web util get parameter request city if s null s length 0 wu set city s else mandatory append city s web util get parameter request postal if s null s length 0 wu set postal s else mandatory append postal set country before region for validation s web util get parameter request c country id if s null s length 0 wu setc country id s s web util get parameter request c region id if s null s length 0 wu setc region id s s web util get parameter request region name if s null s length 0 wu set region name s s web util get parameter request phone if s null s length 0 wu set phone s s web util get parameter request phone2 if s null s length 0 wu set phone2 s s web util get parameter request fax if s null s length 0 wu set fax s if mandatory length 0 mandatory insert 0 enter mandatory wu set save error message mandatory to string return false return wu save updateemailpwd updatefields httpservletrequest webuser updateemailpwd updateemailpwd webutil getparameter passwordnew setpasswordmessage setpassword getpasswordmessage webutil getparameter email webutil isemailvalid setpasswordmessage email setemail stringbuffer stringbuffer webutil getparameter setname webutil getparameter setcompany webutil getparameter settitle webutil getparameter setaddress webutil getparameter setaddress2 webutil getparameter setcity webutil getparameter setpostal webutil getparameter c_country_id setc_country_id webutil getparameter c_region_id setc_region_id webutil getparameter regionname setregionname webutil getparameter setphone webutil getparameter setphone2 webutil getparameter setfax setsaveerrormessage tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bp group id c bp group id para i get parameter as int else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter c_bp_group_id c_bp_group_id getparameterasint p_record_id getrecord_id process return message throws exception protected string do it throws exception string sql string sqlupd string sqlins int cntu 0 int cnti 0 int totu 0 int toti 0 log info copy and overwrite accounts to products of this category sql select c receivable acct c prepayment acct c acctschema id c bp group id v prepayment acct v liability acct v liability services acct from c bp group acct where c bp group id c bp group id prepared statement pstmt null try pstmt db prepare statement sql result set rs pstmt execute query while rs next update existing customers sqlupd update c bp customer acct set c receivable acct rs get int c receivable acct c prepayment acct rs get int c prepayment acct updated sys date updated by 0 where c bp customer acct c acctschema id rs get int c acctschema id and exists select from c bpartner p where p c bpartner id c bp customer acct c bpartner id and p c bp group id rs get int c bp group id cntu db execute update sqlupd totu cntu insert new customer sqlins insert into c bp customer acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by c receivable acct c prepayment acct select p c bpartner id rs get int c acctschema id p ad client id p ad org id y sys date 0 sys date 0 rs get int c receivable acct rs get int c prepayment acct from c bpartner p where p c bp group id rs get int c bp group id and not exists select from c bp customer acct ca where ca c bpartner id p c bpartner id and ca c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info customers cntu cnti update existing vendors sqlupd update c bp vendor acct set v liability acct rs get int v liability acct v liability services acct rs get int v liability services acct v prepayment acct rs get int v prepayment acct updated sys date updated by 0 where c bp vendor acct c acctschema id rs get int c acctschema id and exists select from c bpartner p where p c bpartner id c bp vendor acct c bpartner id and p c bp group id rs get int c bp group id cntu db execute update sqlupd totu cntu insert new vendors sqlins insert into c bp vendor acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by v liability acct v liability services acct v prepayment acct select p c bpartner id rs get int c acctschema id p ad client id p ad org id y sys date 0 sys date 0 rs get int v liability acct rs get int v liability services acct rs get int v prepayment acct from c bpartner p where p c bp group id rs get int c bp group id and not exists select from c bp vendor acct va where va c bpartner id p c bpartner id and va c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info vendors cntu cnti rs close pstmt close pstmt null log fine committing db commit true get trxname catch exception e log log level severe adding missing elements e try if pstmt null pstmt close pstmt null catch exception e pstmt null return created cnti 2 updated cntu 2 doit c_receivable_acct c_prepayment_acct c_acctschema_id c_bp_group_id v_prepayment_acct v_liability_acct v_liability_services_acct c_bp_group_acct c_bp_group_id c_bp_group_id preparedstatement preparestatement resultset executequery c_bp_customer_acct c_receivable_acct getint c_receivable_acct c_prepayment_acct getint c_prepayment_acct sysdate updatedby c_bp_customer_acct c_acctschema_id getint c_acctschema_id c_bpartner c_bpartner_id c_bp_customer_acct c_bpartner_id c_bp_group_id getint c_bp_group_id executeupdate c_bp_customer_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby c_receivable_acct c_prepayment_acct c_bpartner_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint c_receivable_acct getint c_prepayment_acct c_bpartner c_bp_group_id getint c_bp_group_id c_bp_customer_acct c_bpartner_id c_bpartner_id c_acctschema_id getint c_acctschema_id executeupdate c_bp_vendor_acct v_liability_acct getint v_liability_acct v_liability_services_acct getint v_liability_services_acct v_prepayment_acct getint v_prepayment_acct sysdate updatedby c_bp_vendor_acct c_acctschema_id getint c_acctschema_id c_bpartner c_bpartner_id c_bp_vendor_acct c_bpartner_id c_bp_group_id getint c_bp_group_id executeupdate c_bp_vendor_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby v_liability_acct v_liability_services_acct v_prepayment_acct c_bpartner_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint v_liability_acct getint v_liability_services_acct getint v_prepayment_acct c_bpartner c_bp_group_id getint c_bp_group_id c_bp_vendor_acct c_bpartner_id c_bpartner_id c_acctschema_id getint c_acctschema_id executeupdate get_trxname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals ad org id m ad org id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else if name equals doc action m docaction string para i get parameter else log log level severe prepare unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername ad_client_id m_ad_client_id bigdecimal getparameter intvalue ad_org_id m_ad_org_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter docaction m_docaction getparameter m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i order where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i order set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id append m ad org id append is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no sql new string buffer update i order o set i isimported e i errormsg i errormsg err invalid org where ad org id is null or ad org id 0 or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid org no document type po so sql new string buffer update i order o po document type name set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type poo and o ad client id d ad client id where c doctype id is null and isso trx n and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set po doc type no sql new string buffer update i order o so document type name set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type soo and o ad client id d ad client id where c doctype id is null and isso trx y and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set so doc type no sql new string buffer update i order o set c doctype id select c doctype id from c doctype d where d name o doc type name and d doc base type in soo poo and o ad client id d ad client id where c doctype id is null and isso trx is null and doc type name is not null and i isimported y append client check where c doctype id is null and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set doc type no sql new string buffer update i order error invalid doc type name set i isimported e i errormsg i errormsg err invalid doc type name where c doctype id is null and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid doc type name no doc type default sql new string buffer update i order o default po set c doctype id select c doctype id from c doctype d where d is default y and d doc base type poo and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx n and i isimported y append client check no db execute update sql to string get trxname log fine set po default doc type no sql new string buffer update i order o default so set c doctype id select c doctype id from c doctype d where d is default y and d doc base type soo and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx y and i isimported y append client check no db execute update sql to string get trxname log fine set so default doc type no sql new string buffer update i order o set c doctype id select c doctype id from c doctype d where d is default y and d doc base type in soo poo and rownum 1 and o ad client id d ad client id where c doctype id is null and isso trx is null and i isimported y append client check no db execute update sql to string get trxname log fine set default doc type no sql new string buffer update i order no doc type set i isimported e i errormsg i errormsg err no doc type where c doctype id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no doc type no set isso trx sql new string buffer update i order o set isso trx y where exists select from c doctype d where o c doctype id d c doctype id and d doc base type soo and o ad client id d ad client id and c doctype id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set isso trx y no sql new string buffer update i order o set isso trx n where exists select from c doctype d where o c doctype id d c doctype id and d doc base type poo and o ad client id d ad client id and c doctype id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set isso trx n no price list sql new string buffer update i order o set m pricelist id select m pricelist id from m pricelist p where p is default y and p c currency id o c currency id and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname log fine set default currency price list no sql new string buffer update i order o set m pricelist id select m pricelist id from m pricelist p where p is default y and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and c currency id is null and i isimported y append client check no db execute update sql to string get trxname log fine set default price list no sql new string buffer update i order o set m pricelist id select m pricelist id from m pricelist p where p c currency id o c currency id and p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname log fine set currency price list no sql new string buffer update i order o set m pricelist id select m pricelist id from m pricelist p where p isso price list o isso trx and rownum 1 and o ad client id p ad client id where m pricelist id is null and c currency id is null and i isimported y append client check no db execute update sql to string get trxname log fine set price list no sql new string buffer update i order set i isimported e i errormsg i errormsg err no price list where m pricelist id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no price list no payment term sql new string buffer update i order o set c paymentterm id select c paymentterm id from c paymentterm p where o payment term value p value and o ad client id p ad client id where c paymentterm id is null and payment term value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set payment term no sql new string buffer update i order o set c paymentterm id select c paymentterm id from c paymentterm p where p is default y and rownum 1 and o ad client id p ad client id where c paymentterm id is null and o payment term value is null and i isimported y append client check no db execute update sql to string get trxname log fine set default payment term no sql new string buffer update i order set i isimported e i errormsg i errormsg err no payment term where c paymentterm id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no payment term no warehouse sql new string buffer update i order o set m warehouse id select m warehouse id from m warehouse w where rownum 1 and o ad client id w ad client id and o ad org id w ad org id where m warehouse id is null and i isimported y append client check no db execute update sql to string get trxname warehouse for org if no 0 log fine set warehouse no sql new string buffer update i order o set m warehouse id select m warehouse id from m warehouse w where o ad client id w ad client id where m warehouse id is null and exists select ad client id from m warehouse w where w ad client id o ad client id group by ad client id having count 1 an doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_order i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_order ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id m_ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_order i_isimported i_errormsg i_errormsg ad_org_id ad_org_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_order c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id issotrx doctypename i_isimported clientcheck c_doctype_id doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order i_isimported i_errormsg i_errormsg doctypename c_doctype_id doctypename i_isimported clientcheck executeupdate tostring get_trxname doctypename doctype stringbuffer i_order c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order c_doctype_id c_doctype_id c_doctype isdefault docbasetype ad_client_id ad_client_id c_doctype_id issotrx i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_order doctype i_isimported i_errormsg i_errormsg doctype c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname doctype issotrx stringbuffer i_order issotrx c_doctype c_doctype_id c_doctype_id docbasetype ad_client_id ad_client_id c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname issotrx stringbuffer i_order issotrx c_doctype c_doctype_id c_doctype_id docbasetype ad_client_id ad_client_id c_doctype_id i_isimported clientcheck executeupdate tostring get_trxname issotrx stringbuffer i_order m_pricelist_id m_pricelist_id m_pricelist isdefault c_currency_id c_currency_id issopricelist issotrx ad_client_id ad_client_id m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_order m_pricelist_id m_pricelist_id m_pricelist isdefault issopricelist issotrx ad_client_id ad_client_id m_pricelist_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_order m_pricelist_id m_pricelist_id m_pricelist c_currency_id c_currency_id issopricelist issotrx ad_client_id ad_client_id m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_order m_pricelist_id m_pricelist_id m_pricelist issopricelist issotrx ad_client_id ad_client_id m_pricelist_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_order i_isimported i_errormsg i_errormsg pricelist m_pricelist_id i_isimported clientcheck executeupdate tostring get_trxname pricelist stringbuffer i_order c_paymentterm_id c_paymentterm_id c_paymentterm paymenttermvalue ad_client_id ad_client_id c_paymentterm_id paymenttermvalue i_isimported clientcheck executeupdate tostring get_trxname paymentterm stringbuffer i_order c_paymentterm_id c_paymentterm_id c_paymentterm isdefault ad_client_id ad_client_id c_paymentterm_id paymenttermvalue i_isimported clientcheck executeupdate tostring get_trxname paymentterm stringbuffer i_order i_isimported i_errormsg i_errormsg paymentterm c_paymentterm_id i_isimported clientcheck executeupdate tostring get_trxname paymentterm stringbuffer i_order m_warehouse_id m_warehouse_id m_warehouse ad_client_id ad_client_id ad_org_id ad_org_id m_warehouse_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_order m_warehouse_id m_warehouse_id m_warehouse ad_client_id ad_client_id m_warehouse_id ad_client_id m_warehouse ad_client_id ad_client_id ad_client_id standard constructor public x m productprice properties ctx int m productprice id string trx name super ctx m productprice id trx name if m productprice id 0 setm pricelist version id 0 setm product id 0 set price limit env zero set price list env zero set price std env zero x_m_productprice m_productprice_id trxname m_productprice_id trxname m_productprice_id setm_pricelist_version_id setm_product_id setpricelimit setpricelist setpricestd load constructor public x m productprice properties ctx result set rs string trx name super ctx rs trx name x_m_productprice resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productprice append get id append return sb to string tostring stringbuffer stringbuffer x_m_productprice get_id tostring set price list version identifies a unique instance of a price list public void setm pricelist version id int m pricelist version id if m pricelist version id 1 throw new illegal argument exception m pricelist version id is mandatory set valuenocheck m pricelist version id new integer m pricelist version id setm_pricelist_version_id m_pricelist_version_id m_pricelist_version_id illegalargumentexception m_pricelist_version_id set_valuenocheck m_pricelist_version_id m_pricelist_version_id get price list version identifies a unique instance of a price list public int getm pricelist version id integer ii integer get value m pricelist version id if ii null return 0 return ii int value getm_pricelist_version_id get_value m_pricelist_version_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set limit price lowest price for a product public void set price limit big decimal price limit if price limit null throw new illegal argument exception price limit is mandatory set value price limit price limit setpricelimit bigdecimal pricelimit pricelimit illegalargumentexception pricelimit set_value pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set list price list price public void set price list big decimal price list if price list null throw new illegal argument exception price list is mandatory set value price list price list setpricelist bigdecimal pricelist pricelist illegalargumentexception pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set standard price standard price public void set price std big decimal price std if price std null throw new illegal argument exception price std is mandatory set value price std price std setpricestd bigdecimal pricestd pricestd illegalargumentexception pricestd set_value pricestd pricestd get standard price standard price public big decimal get price std big decimal bd big decimal get value price std if bd null return env zero return bd bigdecimal getpricestd bigdecimal bigdecimal get_value pricestd prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p c rfq id getrecord id processinfoparameter getparameter getparametername getparameter p_c_rfq_id getrecord_id process pre ignore 0 or invalid responses rank among qty for selected po qty select winner if all lines are winner select that pre return message protected string do it throws exception m rfq rfq new m rfq get ctx p c rfq id get trxname if rfq get id 0 throw new illegal argument exception no rfq found log info rfq to string string error rfq check quote total amt only if error null error length 0 throw new exception error get completed active responses m rfq response responses rfq get responses true true log fine do it responses responses length if responses length 0 throw new illegal argument exception no completed rfq responses found if responses length 1 responses 0 set is selected winner true responses 0 save throw new illegal argument exception only one completed rfq response found rank if rfq is quote total amt only rank responses rfq responses else rank lines rfq responses return responses length doit mrfq mrfq getctx p_c_rfq_id get_trxname get_id illegalargumentexception tostring checkquotetotalamtonly mrfqresponse getresponses doit illegalargumentexception setisselectedwinner illegalargumentexception isquotetotalamtonly rankresponses ranklines rank lines param rfq rfq param responses responses suppress warnings unchecked private void rank lines m rfq rfq m rfq response responses m rfq line rfq lines rfq get lines if rfq lines length 0 throw new illegal argument exception no rfq lines found for all lines for int i 0 i rfq lines length i rfq line m rfq line rfq line rfq lines i if rfq line is active continue log fine rank lines rfq line m rfq line qty rfq qtys rfq line get qtys for int j 0 j rfq qtys length j rfq line qty m rfq line qty rfq qty rfq qtys j if rfq qty is active rfq qty is rfq qty continue log fine rank lines qty rfq qty m rfq response line qty resp qtys rfq qty get response qtys false for int kk 0 kk resp qtys length kk response line qty m rfq response line qty resp qty resp qtys kk if resp qty is active resp qty is valid amt resp qty set ranking 999 resp qty save log fine ignored resp qty for all respones line qtys rank rfq line qtys resp qtys rfq qty get response qtys false if resp qtys length 0 log fine no qtys with valid amounts else arrays sort resp qtys resp qtys 0 int last rank 1 multiple rank 1 big decimal last amt env zero for int rank 0 rank resp qtys length rank m rfq response line qty qty resp qtys rank if qty is active qty get ranking 999 continue big decimal net amt qty get net amt if net amt null qty set ranking 999 log fine rank 999 qty else if last amt compare to net amt 0 last rank rank 1 last amt qty get net amt qty set ranking last rank log fine rank last rank qty qty save if rank 0 update rfq rfq qty set best response amt qty get net amt rfq qty save for all rfq line qtys for all rfq lines select winner based on line ranking m rfq response winner null for int ii 0 ii responses length ii m rfq response response responses ii if response is selected winner response set is selected winner false int ranking 0 m rfq response line resp lines response get lines false for int jj 0 jj resp lines length jj response line m rfq response line resp line resp lines jj if resp line is active continue if resp line is selected winner resp line set is selected winner false m rfq response line qty resp qtys resp line get qtys false for int kk 0 kk resp qtys length kk response line qty m rfq response line qty resp qty resp qtys kk if resp qty is active continue ranking resp qty get ranking if resp qty get ranking 1 resp qty get rfq line qty is purchase qty resp line set is selected winner true resp line save break response set ranking ranking response save log fine response ranking ranking response if rfq is quote selected lines no total selected winner if not all lines if winner null ranking 0 winner response if winner null response get ranking 0 response get ranking winner get ranking winner response if winner null winner set is selected winner true winner save log fine response winner winner suppresswarnings ranklines mrfq mrfqresponse mrfqline rfqlines getlines rfqlines illegalargumentexception rfqlines mrfqline rfqline rfqlines rfqline isactive ranklines rfqline mrfqlineqty rfqqtys rfqline getqtys rfqqtys mrfqlineqty rfqqty rfqqtys rfqqty isactive rfqqty isrfqqty ranklines rfqqty mrfqresponselineqty respqtys rfqqty getresponseqtys respqtys mrfqresponselineqty respqty respqtys respqty isactive respqty isvalidamt respqty setranking respqty respqty respqtys rfqqty getresponseqtys respqtys respqtys respqtys lastrank bigdecimal lastamt respqtys mrfqresponselineqty respqtys isactive getranking bigdecimal netamt getnetamt netamt setranking lastamt compareto netamt lastrank lastamt getnetamt setranking lastrank lastrank rfqqty setbestresponseamt getnetamt rfqqty mrfqresponse mrfqresponse isselectedwinner setisselectedwinner mrfqresponseline resplines getlines resplines mrfqresponseline respline resplines respline isactive respline isselectedwinner respline setisselectedwinner mrfqresponselineqty respqtys respline getqtys respqtys mrfqresponselineqty respqty respqtys respqty isactive respqty getranking respqty getranking respqty getrfqlineqty ispurchaseqty respline setisselectedwinner respline setranking isquoteselectedlines getranking getranking getranking setisselectedwinner rank response based on header param rfq rfq param responses responses private void rank responses m rfq rfq m rfq response responses int ranking 1 responses ordered by price for int ii 0 ii responses length ii m rfq response response responses ii if response get price null response get price compare to env zero 0 if response is selected winner ranking 1 response set is selected winner ranking 1 response set ranking ranking ranking else response set ranking 999 if response is selected winner response set is selected winner false response save log fine rank response response rankresponses mrfq mrfqresponse mrfqresponse getprice getprice compareto isselectedwinner setisselectedwinner setranking setranking isselectedwinner setisselectedwinner rankresponse standard constructor public x c bpartner properties ctx int c bpartner id string trx name super ctx c bpartner id trx name if c bpartner id 0 setc bp group id 0 setc bpartner id 0 set is customer false set is employee false set is one time false set is prospect false set is sales rep false set is summary false set is vendor false set name null setso creditlimit env zero setso creditused env zero set sende mail false set value null x_c_bpartner c_bpartner_id trxname c_bpartner_id trxname c_bpartner_id setc_bp_group_id setc_bpartner_id setiscustomer setisemployee setisonetime setisprospect setissalesrep setissummary setisvendor setname setso_creditlimit setso_creditused setsendemail setvalue load constructor public x c bpartner properties ctx result set rs string trx name super ctx rs trx name x_c_bpartner resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bpartner append get id append return sb to string tostring stringbuffer stringbuffer x_c_bpartner get_id tostring public static final int ad language ad reference id 327 set language language for this entity public void setad language string ad language if ad language null ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set linked organization the business partner is another organization for explicit inter org transactions public void setad orgbp id string ad orgbp id if ad orgbp id null ad orgbp id length 22 log warning length 22 truncated ad orgbp id ad orgbp id substring 0 21 set value ad orgbp id ad orgbp id setad_orgbp_id ad_orgbp_id ad_orgbp_id ad_orgbp_id ad_orgbp_id ad_orgbp_id set_value ad_orgbp_id ad_orgbp_id get linked organization the business partner is another organization for explicit inter org transactions public string getad orgbp id return string get value ad orgbp id getad_orgbp_id get_value ad_orgbp_id set acquisition cost the cost of gaining the prospect as a customer public void set acqusition cost big decimal acqusition cost set value acqusition cost acqusition cost setacqusitioncost bigdecimal acqusitioncost set_value acqusitioncost acqusitioncost get acquisition cost the cost of gaining the prospect as a customer public big decimal get acqusition cost big decimal bd big decimal get value acqusition cost if bd null return env zero return bd bigdecimal getacqusitioncost bigdecimal bigdecimal get_value acqusitioncost set actual life time value actual life time revenue public void set actual life time value big decimal actual life time value set value actual life time value actual life time value setactuallifetimevalue bigdecimal actuallifetimevalue set_value actuallifetimevalue actuallifetimevalue get actual life time value actual life time revenue public big decimal get actual life time value big decimal bd big decimal get value actual life time value if bd null return env zero return bd bigdecimal getactuallifetimevalue bigdecimal bigdecimal get_value actuallifetimevalue set partner parent business partner parent public void setbpartner parent id int bpartner parent id if bpartner parent id 0 set value bpartner parent id null else set value bpartner parent id new integer bpartner parent id setbpartner_parent_id bpartner_parent_id bpartner_parent_id set_value bpartner_parent_id set_value bpartner_parent_id bpartner_parent_id get partner parent business partner parent public int getbpartner parent id integer ii integer get value bpartner parent id if ii null return 0 return ii int value getbpartner_parent_id get_value bpartner_parent_id intvalue set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 1 throw new illegal argument exception c bp group id is mandatory set value c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id illegalargumentexception c_bp_group_id set_value c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set dunning dunning rules for overdue invoices public void setc dunning id int c dunning id if c dunning id 0 set value c dunning id null else set value c dunning id new integer c dunning id setc_dunning_id c_dunning_id c_dunning_id set_value c_dunning_id set_value c_dunning_id c_dunning_id get dunning dunning rules for overdue invoices public int getc dunning id integer ii integer get value c dunning id if ii null return 0 return ii int value getc_dunning_id get_value c_dunning_id intvalue set greeting greeting to print on correspondence public void setc greeting id int c greeting id if c greeting id 0 set value c greeting id null else set value c greeting id new integer c greeting id setc_greeting_id c_greeting_id c_greeting_id set_value c_greeting_id set_value c_greeting_id c_greeting_id get greeting greeting to print on correspondence public int getc greeting id integer ii integer get value c greeting id if ii null return 0 return ii int value getc_greeting_id get_value c_greeting_id intvalue set invoice schedule schedule for generating invoices public void setc invoiceschedule id int c invoiceschedule id if c invoiceschedule id 0 set value c invoiceschedule id null else set value c invoiceschedule id new integer c invoiceschedule id setc_invoiceschedule_id c_invoiceschedule_id c_invoiceschedule_id set_value c_invoiceschedule_id set_value c_invoiceschedule_id c_invoiceschedule_id get invoice schedule schedule for generating invoices public int getc invoiceschedule id integer ii integer get value c invoiceschedule id if ii null return 0 return ii int value getc_invoiceschedule_id get_value c_invoiceschedule_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 0 set value c paymentterm id null else set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id set_value c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set d u n s dun bradstreet number public void setduns string duns if duns null duns length 11 log warning length 11 truncated duns duns substring 0 10 set value duns duns set_value get d u n s dun bradstreet number public string getduns return string get value duns get_value public static final string deliveryrule afterreceipt r set delivery rule defines the timing of delivery public void set delivery rule string delivery rule if delivery rule null throw new illegal argument exception delivery rule is mandatory if delivery rule null delivery rule equals a delivery rule equals f delivery rule equals l delivery rule equals m delivery rule equals o delivery rule equals r else throw new illegal argument exception delivery rule invalid value delivery rule reference id 151 a f l m o r if delivery rule null delivery rule length 1 log warning length 1 truncated delivery rule delivery rule substring 0 0 set value delivery rule delivery rule deliveryrule_afterreceipt setdeliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule reference_id deliveryrule deliveryrule deliveryrule deliveryrule set_value deliveryrule deliveryrule get delivery rule defines the timing of delivery public string get delivery rule return string get value delivery rule getdeliveryrule get_value deliveryrule public static final string deliveryviarule shipper s set delivery via how the order will be delivered public void set delivery via rule string delivery via rule if delivery via rule null throw new illegal argument exception delivery via rule is mandatory if delivery via rule null delivery via rule equals d delivery via rule equals p delivery via rule equals s else throw new illegal argument exception delivery via rule invalid value delivery via rule reference id 152 d p s if delivery via rule null delivery via rule length 1 log warning length 1 truncated delivery via rule delivery via rule substring 0 0 set value delivery via rule delivery via rule deliveryviarule_shipper setdeliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule deliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule reference_id deliveryviarule deliveryviarule deliveryviarule deliveryviarule set_value deliveryviarule deliveryviarule get delivery via how the order will be delivered public string get delivery via rule return string get value delivery via rule getdeliveryviarule get_value deliveryviarule set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document copies number of copies to be printed public void set document copies int document copies set value document copies new integer document copies setdocumentcopies documentcopies set_value documentcopies documentcopies get document copies number of copies to be printed public int get document copies integer ii integer get value document copies if ii null return 0 return ii int value getdocumentcopies get_value documentcopies intvalue set first sale date of first sale public void set first sale timestamp first sale set value first sale first sale setfirstsale firstsale set_value firstsale firstsale get first sale date of first sale public timestamp get first sale return timestamp get value first sale getfirstsale get_value firstsale set flat discount flat discount percentage public void set flat discount big decimal flat discount set value flat discount flat discount setflatdiscount bigdecimal flatdiscount set_value flatdiscount flatdiscount get flat discount flat discount percentage public big decimal get flat discount big decimal bd big decimal get value flat discount if bd null return env zero return bd bigdecimal getflatdiscount bigdecimal bigdecimal get_value flatdiscount public static final string freightcostrule line l set freight cost rule method for charging freight public void set freight cost rule string freight cost rule if freight cost rule null throw new illegal argument exception freight cost rule is mandatory if freight cost rule null freight cost rule equals c freight cost rule equals f freight cost rule equals i freight cost rule equals l else throw new illegal argument exception freight cost rule invalid value freight cost rule reference id 153 c f i l if freight cost rule null freight cost rule length 1 log warning length 1 truncated freight cost rule freight cost rule substring 0 0 set value freight cost rule freight cost rule freightcostrule_line setfreightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule reference_id freightcostrule freightcostrule freightcostrule freightcostrule set_value freightcostrule freightcostrule get freight cost rule method for charging freight public string get freight cost rule return string get value freight cost rule getfreightcostrule get_value freightcostrule public static final string invoicerule customerscheduleafterdelivery s set invoice rule frequency and method of invoicing public void set invoice rule string invoice rule if invoice rule null throw new illegal argument exception invoice rule is mandatory if invoice rule null invoice rule equals d invoice rule equals i invoice rule equals o invoice rule equals s else throw new illegal argument exception invoice rule invalid value invoice rule reference id 150 d i o s if invoice rule null invoice rule length 1 log warning length 1 truncated invoice rule invoice rule substring 0 0 set value invoice rule invoice rule invoicerule_customerscheduleafterdelivery setinvoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule invoicerule invoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule reference_id invoicerule invoicerule invoicerule invoicerule set_value invoicerule invoicerule get invoice rule frequency and method of invoicing public string get invoice rule return string get value invoice rule getinvoicerule get_value invoicerule public static final int invoice printformat id ad reference id 261 set invoice print format print format for printing invoices public void setinvoice printformat id int invoice printformat id if invoice printformat id 0 set value invoice printformat id null else set value invoice printformat id new integer invoice printformat id invoice_printformat_id_ad_reference_id setinvoice_printformat_id invoice_printformat_id invoice_printformat_id set_value invoice_printformat_id set_value invoice_printformat_id invoice_printformat_id get invoice print format print format for printing invoices public int getinvoice printformat id integer ii integer get value invoice printformat id if ii null return 0 return ii int value getinvoice_printformat_id get_value invoice_printformat_id intvalue set customer indicates if this business partner is a customer public void set is customer boolean is customer set value is customer new boolean is customer setiscustomer iscustomer set_value iscustomer iscustomer get customer indicates if this business partner is a customer public boolean is customer object oo get value is customer if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscustomer get_value iscustomer booleanvalue set discount printed print discount on invoice and order public void set is discount printed boolean is discount printed set value is discount printed new boolean is discount printed setisdiscountprinted isdiscountprinted set_value isdiscountprinted isdiscountprinted get discount printed print discount on invoice and order public boolean is discount printed object oo get value is discount printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountprinted get_value isdiscountprinted booleanvalue set employee indicates if this business partner is an employee public void set is employee boolean is employee set value is employee new boolean is employee setisemployee isemployee set_value isemployee isemployee get employee indicates if this business partner is an employee public boolean is employee object oo get value is employee if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isemployee get_value isemployee booleanvalue set one time transaction public void set is one time boolean is one time set value is one time new boolean is one time setisonetime isonetime set_value isonetime isonetime get one time transaction public boolean is one time object oo get value is one time if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonetime get_value isonetime booleanvalue set prospect indicates this is a prospect public void set is prospect boolean is prospect set value is prospect new boolean is prospect setisprospect isprospect set_value isprospect isprospect get prospect indicates this is a prospect public boolean is prospect object oo get value is prospect if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprospect get_value isprospect booleanvalue set sales representative indicates if the business partner is a sales representative or company agent public void set is sales rep boolean is sales rep set value is sales rep new boolean is sales rep setissalesrep issalesrep set_value issalesrep issalesrep get sales representative indicates if the business partner is a sales representative or company agent public boolean is sales rep object oo get value is sales rep if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issalesrep get_value issalesrep booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set tax exempt business partner is exempt from tax public void set is tax exempt boolean is tax exempt set value is tax exempt new boolean is tax exempt setistaxexempt istaxexempt set_value istaxexempt istaxexempt get tax exempt business partner is exempt from tax public boolean is tax exempt object oo get value is tax exempt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxexempt get_value istaxexempt booleanvalue set vendor indicates if this business partner is a vendor public void set is vendor boolean is vendor set value is vendor new boolean is vendor setisvendor isvendor set_value isvendor isvendor get vendor indicates if this business partner is a vendor public boolean is vendor object oo get value is vendor if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvendor get_value isvendor booleanvalue public static final int m discountschema id ad reference id 325 set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 0 set value m discountschema id null else set value m discountschema id new integer m discountschema id m_discountschema_id_ad_reference_id setm_discountschema_id m_discountschema_id m_discountschema_id set_value m_discountschema_id set_value m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set value m pricelist id null else set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_value m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public void setnaics string naics if naics null naics length 6 log warning length 6 truncated naics naics substring 0 5 set value naics naics set_value get naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public string getnaics return string get value naics get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set name 2 additional name public void set name2 string name2 if name2 null name2 length 60 log warning length 60 truncated name2 name2 substring 0 59 set value name2 name2 setname2 set_value get name 2 additional name public string get name2 return string get value name2 getname2 get_value set employees number of employees public void set number employees int number employees set value number employees new integer number employees setnumberemployees numberemployees set_value numberemployees numberemployees get employees number of employees public int get number employees integer ii integer get value number employees if ii null return 0 return ii int value getnumberemployees get_value numberemployees intvalue set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set value po reference po reference setporeference poreference poreference poreference poreference poreference set_value poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference public static final int po discountschema id ad reference id 325 set po discount schema schema to calculate the purchase trade discount percentage public void setpo discountschema id int po discountschema id if po discountschema id 0 set value po discountschema id null else set value po discountschema id new integer po discountschema id po_discountschema_id_ad_reference_id setpo_discountschema_id po_discountschema_id po_discountschema_id set_value po_discountschema_id set_value po_discountschema_id po_discountschema_id get po discount schema schema to calculate the purchase trade discount percentage public int getpo discountschema id integer ii integer get value po discountschema id if ii null return 0 return ii int value getpo_discountschema_id get_value po_discountschema_id intvalue public static final int po paymentterm id ad reference id 227 set po payment term payment rules for a purchase order public void setpo paymentterm id int po paymentterm id if po paymentterm id 0 set value po paymentterm id null else set value po paymentterm id new integer po paymentterm id po_paymentterm_id_ad_reference_id setpo_paymentterm_id po_paymentterm_id po_paymentterm_id set_value po_paymentterm_id set_value po_paymentterm_id po_paymentterm_id get po payment term payment rules for a purchase order public int getpo paymentterm id integer ii integer get value po paymentterm id if ii null return 0 return ii int value getpo_paymentterm_id get_value po_paymentterm_id intvalue public static final int po pricelist id ad reference id 166 set purchase pricelist price list used by this business partner public void setpo pricelist id int po pricelist id if po pricelist id 0 set value po pricelist id null else set value po pricelist id new integer po pricelist id po_pricelist_id_ad_reference_id setpo_pricelist_id po_pricelist_id po_pricelist_id set_value po_pricelist_id set_value po_pricelist_id po_pricelist_id get purchase pricelist price list used by this business partner public int getpo pricelist id integer ii integer get value po pricelist id if ii null return 0 return ii int value getpo_pricelist_id get_value po_pricelist_id intvalue public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule null payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule null payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule public static final string paymentrulepo directdeposit t set payment rule purchase payment option public void set payment rulepo string payment rulepo if payment rulepo null throw new illegal argument exception payment rulepo is mandatory if payment rulepo null payment rulepo equals b payment rulepo equals d payment rulepo equals k payment rulepo equals p payment rulepo equals s payment rulepo equals t else throw new illegal argument exception payment rulepo invalid value payment rulepo reference id 195 b d k p s t if payment rulepo null payment rulepo length 1 log warning length 1 truncated payment rulepo payment rulepo substring 0 0 set value payment rulepo payment rulepo paymentrulepo_directdeposit setpaymentrulepo paymentrulepo paymentrulepo illegalargumentexception paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo illegalargumentexception paymentrulepo paymentrulepo reference_id paymentrulepo paymentrulepo paymentrulepo paymentrulepo set_value paymentrulepo paymentrulepo get payment rule purchase payment option public string get payment rulepo return string get value payment rulepo getpaymentrulepo get_value paymentrulepo set potential life time value total revenue expected public void set potential life time value big decimal potential life time value set value potential life time value potential life time value setpotentiallifetimevalue bigdecimal potentiallifetimevalue set_value potentiallifetimevalue potentiallifetimevalue get potential life time value total revenue expected public big decimal get potential life time value big decimal bd big decimal get value potential life time value if bd null return env zero return bd bigdecimal getpotentiallifetimevalue bigdecimal bigdecimal get_value potentiallifetimevalue set rating classification or importance public void set rating string rating if rating null rating length 1 log warning length 1 truncated rating rating substring 0 0 set value rating rating setrating set_value get rating classification or importance public string get rating return string get value rating getrating get_value set reference no your customer or vendor number at the business partner s site public void set reference no string reference no if reference no null reference no length 40 log warning length 40 truncated reference no reference no substring 0 39 set value reference no reference no setreferenceno referenceno referenceno referenceno referenceno referenceno set_value referenceno referenceno get reference no your customer or vendor number at the business partner s site public string get reference no return string get value reference no getreferenceno get_value referenceno public static final string socreditstatus nocreditcheck x set credit status business partner credit status public void setso credit status string so credit status if so credit status null throw new illegal argument exception so credit status is mandatory if so credit status null so credit status equals h so credit status equals o so credit status equals s so credit status equals w so credit status equals x else throw new illegal argument exception so credit status invalid value so credit status reference id 289 h o s w x if so credit status null so credit status length 1 log warning length 1 truncated so credit status so credit status substring 0 0 set value so credit status so credit status socreditstatus_nocreditcheck setsocreditstatus socreditstatus socreditstatus illegalargumentexception socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus illegalargumentexception socreditstatus socreditstatus reference_id socreditstatus socreditstatus socreditstatus socreditstatus set_value socreditstatus socreditstatus get credit status business partner credit status public string getso credit status return string get value so credit status getsocreditstatus get_value socreditstatus set credit limit total outstanding invoice amounts allowed public void setso creditlimit big decimal so creditlimit if so creditlimit null throw new illegal argument exception so creditlimit is mandatory set value so creditlimit so creditlimit setso_creditlimit bigdecimal so_creditlimit so_creditlimit illegalargumentexception so_creditlimit set_value so_creditlimit so_creditlimit get credit limit total outstanding invoice amounts allowed public big decimal getso creditlimit big decimal bd big decimal get value so creditlimit if bd null return env zero return bd bigdecimal getso_creditlimit bigdecimal bigdecimal get_value so_creditlimit set credit used current open balance public void setso creditused big decimal so creditused if so creditused null throw new illegal argument exception so creditused is mandatory set valuenocheck so creditused so creditused setso_creditused bigdecimal so_creditused so_creditused illegalargumentexception so_creditused set_valuenocheck so_creditused so_creditused get credit used current open balance public big decimal getso creditused big decimal bd big decimal get value so creditused if bd null return env zero return bd bigdecimal getso_creditused bigdecimal bigdecimal get_value so_creditused set order description description to be used on orders public void setso description string so description if so description null so description length 255 log warning length 255 truncated so description so description substring 0 254 set value so description so description setso_description so_description so_description so_description so_description so_description set_value so_description so_description get order description description to be used on orders public string getso description return string get value so description getso_description get_value so_description public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set sales volume in 1 000 total volume of sales in thousands of currency public void set sales volume int sales volume set value sales volume new integer sales volume setsalesvolume salesvolume set_value salesvolume salesvolume get sales volume in 1 000 total volume of sales in thousands of currency public int get sales volume integer ii integer get value sales volume if ii null return 0 return ii int value getsalesvolume get_value salesvolume intvalue set send e mail enable sending document e mail public void set sende mail boolean sende mail set value sende mail new boolean sende mail email email setsendemail sendemail set_value sendemail sendemail get send e mail enable sending document e mail public boolean is sende mail object oo get value sende mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email issendemail get_value sendemail booleanvalue set share share of customer s business as a percentage public void set share of customer int share of customer set value share of customer new integer share of customer setshareofcustomer shareofcustomer set_value shareofcustomer shareofcustomer get share share of customer s business as a percentage public int get share of customer integer ii integer get value share of customer if ii null return 0 return ii int value getshareofcustomer get_value shareofcustomer intvalue set min shelf life minimum shelf life in percent based on product instance guarantee date public void set shelf life min pct int shelf life min pct set value shelf life min pct new integer shelf life min pct setshelflifeminpct shelflifeminpct set_value shelflifeminpct shelflifeminpct get min shelf life minimum shelf life in percent based on product instance guarantee date public int get shelf life min pct integer ii integer get value shelf life min pct if ii null return 0 return ii int value getshelflifeminpct get_value shelflifeminpct intvalue set tax id tax identification public void set taxid string taxid if taxid null taxid length 20 log warning length 20 truncated taxid taxid substring 0 19 set value taxid taxid settaxid set_value get tax id tax identification public string get taxid return string get value taxid gettaxid get_value set open balance total open balance amount in primary accounting currency public void set total open balance big decimal total open balance set value total open balance total open balance settotalopenbalance bigdecimal totalopenbalance set_value totalopenbalance totalopenbalance get open balance total open balance amount in primary accounting currency public big decimal get total open balance big decimal bd big decimal get value total open balance if bd null return env zero return bd bigdecimal gettotalopenbalance bigdecimal bigdecimal get_value totalopenbalance set url full url address e g http www compiere org public void seturl string url if url null url length 120 log warning length 120 truncated url url substring 0 119 set value url url set_value get url full url address e g http www compiere org public string geturl return string get value url get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value full constructor param client the client param from sender s e mail address param to recipient e mail address param subject subject of message param message the message public e mail m client client string from string to string subject string message this client get ctx client getsmtp host from to subject message email email email mclient getctx getsmtphost full constructor param smtp host the mail server param from sender s e mail address param to recipient e mail address param subject subject of message param message the message public e mail properties ctx string smtp host string from string to string subject string message set smtp host smtp host set from from add to to m ctx ctx if subject null subject length 0 set subject pass validation else set subject subject if message null message length 0 set message text message m valid is valid true smtphost email email email smtphost setsmtphost smtphost setfrom addto m_ctx setsubject setsubject setmessagetext m_valid isvalid send mail direct return ok or error message public string send log info m smtphost m from m to m sentmsg null if is valid true m sentmsg invalid data return m sentmsg properties props system get properties props put mail store protocol smtp props put mail transport protocol smtp props put mail host m smtphost if c log mgt is level finest props put mail debug true session session null try if m auth null create authenticator was called props put mail smtp auth true session session get instance props m auth session set debug c log mgt is level finest catch security exception se log log level warning auth m auth se to string m sentmsg se to string return se to string catch exception e log log level severe auth m auth e m sentmsg e to string return e to string try m msg new mime message session m msg new smtp message session addresses m msg set from m from internet address rec get tos if rec length 1 m msg set recipient message recipient type to rec 0 else m msg set recipients message recipient type to rec rec get ccs if rec null rec length 0 m msg set recipients message recipient type cc rec rec get bccs if rec null rec length 0 m msg set recipients message recipient type bcc rec if m replyto null m msg set reply to new address m replyto m msg set sent date new java util date m msg set header comments a dempiere mail m msg set description description smtp specifics m msg set allow8bitmime true send notification on failure success no way to set envid in java yet m msg set notify options smtp message notify failure smtp message notify success bounce only header m msg set return option smtp message return hdrs m msg set header x mailer msgsend set content m msg save changes log fine message m msg transport send msg transport t session get transport smtp log fine transport t t connect t connect m smtphost user password log fine transport connected transport send m msg t send message msg msg get all recipients log fine success messageid m msg get messageid catch messaging exception me exception ex me string buffer sb new string buffer me boolean printed false do if ex instanceof send failed exception send failed exception sfex send failed exception ex address invalid sfex get invalid addresses if printed if invalid null invalid length 0 sb append invalid for int i 0 i invalid length i sb append append invalid i address valid unsent sfex get valid unsent addresses if valid unsent null valid unsent length 0 sb append valid unsent for int i 0 i valid unsent length i sb append append valid unsent i address valid sent sfex get valid sent addresses if valid sent null valid sent length 0 sb append valid sent for int i 0 i valid sent length i sb append append valid sent i printed true if sfex get next exception null sb append append sfex get localized message else if ex instanceof authentication failed exception sb append invalid username password m auth else other messaging exception string msg ex get localized message if msg null sb append append ex to string else if msg index of could not connect to smtp host 1 int index msg index of n if index 1 msg msg substring 0 index string cc if m ctx null cc m ctx get property ad client id msg ad client id cc string class name ex get class get name if class name index of messaging exception 1 sb append append msg else sb append append class name append append msg next exception if ex instanceof messaging exception ex messaging exception ex get next exception else ex null while ex null error loop if c log mgt is level finest log log level warning sb to string me else log log level warning sb to string m sentmsg sb to string return sb to string catch exception e log log level severe e m sentmsg e get localized message return e get localized message if c log mgt is level finest dump message m sentmsg sent ok return m sentmsg m_smtphost m_from m_to m_sentmsg isvalid m_sentmsg m_sentmsg getproperties m_smtphost clogmgt islevelfinest m_auth createauthenticator getinstance m_auth setdebug clogmgt islevelfinest securityexception m_auth tostring m_sentmsg tostring tostring m_auth m_sentmsg tostring tostring m_msg mimemessage m_msg smtpmessage m_msg setfrom m_from internetaddress gettos m_msg setrecipient recipienttype m_msg setrecipients recipienttype getccs m_msg setrecipients recipienttype getbccs m_msg setrecipients recipienttype m_replyto m_msg setreplyto m_replyto m_msg setsentdate m_msg setheader adempieremail m_msg setdescription m_msg setallow8bitmime m_msg setnotifyoptions smtpmessage notify_failure smtpmessage notify_success m_msg setreturnoption smtpmessage return_hdrs m_msg setheader setcontent m_msg savechanges m_msg gettransport m_smtphost m_msg sendmessage getallrecipients m_msg getmessageid messagingexception stringbuffer stringbuffer sendfailedexception sendfailedexception sendfailedexception getinvalidaddresses validunsent getvalidunsentaddresses validunsent validunsent validunsent validunsent validunsent validsent getvalidsentaddresses validsent validsent validsent validsent validsent getnextexception getlocalizedmessage authenticationfailedexception m_auth messagingexception getlocalizedmessage tostring indexof indexof m_ctx m_ctx getproperty ad_client_id ad_client_id classname getclass getname classname indexof messagingexception classname messagingexception messagingexception getnextexception clogmgt islevelfinest tostring tostring m_sentmsg tostring tostring m_sentmsg getlocalizedmessage getlocalizedmessage clogmgt islevelfinest dumpmessage m_sentmsg sent_ok m_sentmsg get send result msg return msg public string get sent msg return m sentmsg getsentmsg m_sentmsg was sending the msg ok return msg ok public boolean is sentok return m sentmsg null sent ok equals m sentmsg issentok m_sentmsg sent_ok m_sentmsg dump message info private void dump message if m msg null return try enumeration e m msg get all header lines while e has more elements log fine e next element catch messaging exception ex log log level warning m msg to string ex dumpmessage m_msg m_msg getallheaderlines hasmoreelements nextelement messagingexception m_msg tostring get the message directly return mail message protected mime message get mime message return m msg mimemessage getmimemessage m_msg get message id or null return message id e g 20030130004739 15377 qmail web13506 mail yahoo com 25699763 1043887247538 java mail jjanke main public string get messageid try if m msg null return m msg get messageid catch messaging exception ex log log level severe ex return null javamail getmessageid m_msg m_msg getmessageid messagingexception create authenticator for user param username user name param password user password return authenticator or null public e mail authenticator create authenticator string username string password if username null password null log warning ignored username password m auth null else log fine sete mail user username password m auth new e mail authenticator username password return m auth emailauthenticator createauthenticator m_auth setemailuser m_auth emailauthenticator m_auth get sender return sender s internet address public internet address get from return m from internetaddress getfrom m_from set sender param new from sender s email address public void set from string new from if new from null m valid false return try m from new internet address new from true catch exception e log log level warning new from e to string m valid false newfrom setfrom newfrom newfrom m_valid m_from internetaddress newfrom newfrom tostring m_valid add to recipient param new to recipient s email address return true if valid public boolean add to string new to if new to null new to length 0 m valid false return false internet address ia null try ia new internet address new to true catch exception e log log level warning new to e to string m valid false return false if m to null m to new array list internet address m to add ia return true newto addto newto newto newto m_valid internetaddress internetaddress newto newto tostring m_valid m_to m_to arraylist internetaddress m_to get recipient return recipient s internet address public internet address get to if m to null m to size 0 return null internet address ia internet address m to get 0 return ia internetaddress getto m_to m_to internetaddress internetaddress m_to get to recipients return recipient s internet address public internet address get tos if m to null m to size 0 return null internet address ias new internet address m to size m to to array ias return ias internetaddress gettos m_to m_to internetaddress internetaddress m_to m_to toarray add cc recipient param new cc e mail cc recipient return true if valid public boolean add cc string new cc if new cc null new cc length 0 return false internet address ia null try ia new internet address new cc true catch exception e log log level warning new cc e to string return false if m cc null m cc new array list internet address m cc add ia return true newcc email addcc newcc newcc newcc internetaddress internetaddress newcc newcc tostring m_cc m_cc arraylist internetaddress m_cc get cc recipients return recipient s internet address public internet address get ccs if m cc null m cc size 0 return null internet address ias new internet address m cc size m cc to array ias return ias internetaddress getccs m_cc m_cc internetaddress internetaddress m_cc m_cc toarray add bcc recipient param new bcc e mail cc recipient return true if valid public boolean add bcc string new bcc if new bcc null new bcc length 0 return false internet address ia null try ia new internet address new bcc true catch exception e log log level warning new bcc e get message return false if m bcc null m bcc new array list internet address m bcc add ia return true newbcc email addbcc newbcc newbcc newbcc internetaddress internetaddress newbcc newbcc getmessage m_bcc m_bcc arraylist internetaddress m_bcc get bcc recipients return recipient s internet address public internet address get bccs if m bcc null m bcc size 0 return null internet address ias new internet address m bcc size m bcc to array ias return ias internetaddress getbccs m_bcc m_bcc internetaddress internetaddress m_bcc m_bcc toarray set reply to address param new to email address return true if valid public boolean set reply to string new to if new to null new to length 0 return false internet address ia null try ia new internet address new to true catch exception e log log level warning new to e to string return false m replyto ia return true newto setreplyto newto newto newto internetaddress internetaddress newto newto tostring m_replyto get reply to return reoly to internet address public internet address get reply to return m replyto internetaddress getreplyto m_replyto set subject param new subject subject public void set subject string new subject if new subject null new subject length 0 m valid false else m subject new subject newsubject setsubject newsubject newsubject newsubject m_valid m_subject newsubject get subject return subject public string get subject return m subject getsubject m_subject set message param new message message public void set message text string new message if new message null new message length 0 m valid false else m messagetext new message if m messagetext ends with n m messagetext n newmessage setmessagetext newmessage newmessage newmessage m_valid m_messagetext newmessage m_messagetext endswith m_messagetext get mime string message line ending with crlf return message public string get messagecrlf if m messagetext null return char chars m messagetext to char array string buffer sb new string buffer for int i 0 i chars length i char c chars i if c n int previous i 1 if previous 0 chars previous r sb append c else sb append r n else sb append c log fine in m messagetext log fine out sb return sb to string getmessagecrlf m_messagetext m_messagetext tochararray stringbuffer stringbuffer m_messagetext tostring set html message param html message public void set messagehtml string html if html null html length 0 m valid false else m messagehtml html if m messagehtml ends with n m messagehtml n setmessagehtml m_valid m_messagehtml m_messagehtml endswith m_messagehtml set html message param subject subject repeated in message as h2 param message message public void set messagehtml string subject string message m subject subject string buffer sb new string buffer html n append head n append title n append subject n append title n append head n sb append body n append h2 subject h2 n append message append n append body n sb append html n m messagehtml sb to string setmessagehtml m_subject stringbuffer stringbuffer m_messagehtml tostring get html message return message public string get messagehtml return m messagehtml getmessagehtml m_messagehtml add file attachment param file file to attach public void add attachment file file if file null return if m attachments null m attachments new array list object m attachments add file addattachment m_attachments m_attachments arraylist m_attachments add url based file attachment param url url content to attach public void add attachment url url if url null return if m attachments null m attachments new array list object m attachments add url addattachment m_attachments m_attachments arraylist m_attachments add attachment converted to byte array data source param data data param type mime type param name name of attachment public void add attachment byte data string type string name byte array data source byte array new byte array data source data type set name name add attachment byte array bytearraydatasource addattachment bytearraydatasource bytearray bytearraydatasource setname addattachment bytearray add arbitary attachment param data source content to attach public void add attachment data source data source if data source null return if m attachments null m attachments new array list object m attachments add data source datasource addattachment datasource datasource datasource m_attachments m_attachments arraylist m_attachments datasource set the message content throws messaging exception throws io exception private void set content throws messaging exception io exception m msg set subject get subject simple message if m attachments null m attachments size 0 if m messagehtml null m messagehtml length 0 m msg set content get messagecrlf text plain else m msg set data handler new data handler new byte array data source m messagehtml text html log fine simple get subject else multi part message first part message mime body part mbp 1 new mime body part mbp 1 set text if m messagehtml null m messagehtml length 0 mbp 1 set content get messagecrlf text plain else mbp 1 set data handler new data handler new byte array data source m messagehtml text html create multipart and its parts to it multipart mp new mime multipart mp add body part mbp 1 log fine multi get subject mbp 1 for all attachments for int i 0 i m attachments size i object attachment m attachments get i data source ds null if attachment instanceof file file file file attachment if file exists ds new file data source file else log log level warning file does not exist file continue else if attachment instanceof url url url url attachment ds new url data source url else if attachment instanceof data source ds data source attachment else log log level warning attachement type unknown attachment continue attachment part mime body part mbp 2 new mime body part mbp 2 set data handler new data handler ds mbp 2 set file name ds get name log fine added attachment ds get name mbp 2 mp add body part mbp 2 add to message m msg set content mp multi part messagingexception ioexception setcontent messagingexception ioexception m_msg setsubject getsubject m_attachments m_attachments m_messagehtml m_messagehtml m_msg setcontent getmessagecrlf m_msg setdatahandler datahandler bytearraydatasource m_messagehtml getsubject mimebodypart mbp_1 mimebodypart mbp_1 settext m_messagehtml m_messagehtml mbp_1 setcontent getmessagecrlf mbp_1 setdatahandler datahandler bytearraydatasource m_messagehtml mimemultipart addbodypart mbp_1 getsubject mbp_1 m_attachments m_attachments datasource filedatasource urldatasource datasource datasource mimebodypart mbp_2 mimebodypart mbp_2 setdatahandler datahandler mbp_2 setfilename getname getname mbp_2 addbodypart mbp_2 m_msg setcontent set smtp host or address param new smtp host mail server public void set smtp host string new smtp host if new smtp host null new smtp host length 0 m valid false else m smtphost new smtp host newsmtphost setsmtphost newsmtphost newsmtphost newsmtphost m_valid m_smtphost newsmtphost get mail server name or address return mail server public string get smtp host return m smtphost getsmtphost m_smtphost is info valid to send e mail return true if email is valid and can be sent public boolean is valid return m valid email isvalid m_valid re check info if valid to send e mail param recheck if true check main variables return true if email is valid and can be sent public boolean is valid boolean recheck if recheck return m valid from if m from null m from get address length 0 m from get address index of 1 log warning from is invalid m from return false to internet address ias get tos if ias null log warning no to return false for int i 0 i ias length i if ias i null ias i get address length 0 ias i get address index of 1 log warning to i is invalid ias i return false host if m smtphost null m smtphost length 0 log warning smtp host is invalid m smtphost return false subject if m subject null m subject length 0 log warning subject is invalid m subject return false return true email isvalid m_valid m_from m_from getaddress m_from getaddress indexof m_from internetaddress gettos getaddress getaddress indexof m_smtphost m_smtphost m_smtphost m_subject m_subject m_subject string representation return info public string to string string buffer sb new string buffer e mail sb append from append m from append to append get to append subject append get subject append return sb to string tostring stringbuffer stringbuffer email m_from getto getsubject tostring test java cp c tools jar c client jar org compiere util e mail main info compiere org jjanke compiere org my subject my message if you get send failed exception 550 5 7 1 unable to relay for check does the smtp server allow you to relay exchange smtp server access did you authenticate set email user param args array of arguments public static void main string args org compiere compiere startup true if args length 5 system out println parameters smtp host from to subject message system out println example java org compiere util e mail mail acme com joe acme com sue acme com hi there cheers joe system exit 1 e mail email new e mail system get properties args 0 args 1 args 2 args 3 args 4 email send ctools cclient email sendfailedexception setemailuser smtphost email hithere cheersjoe email email getproperties standard constructor public x c subscription properties ctx int c subscription id string trx name super ctx c subscription id trx name if c subscription id 0 setc bpartner id 0 setc subscriptiontype id 0 setc subscription id 0 set is due false setm product id 0 set name null set paid until date new timestamp system current time millis set renewal date new timestamp system current time millis set start date new timestamp system current time millis x_c_subscription c_subscription_id trxname c_subscription_id trxname c_subscription_id setc_bpartner_id setc_subscriptiontype_id setc_subscription_id setisdue setm_product_id setname setpaiduntildate currenttimemillis setrenewaldate currenttimemillis setstartdate currenttimemillis load constructor public x c subscription properties ctx result set rs string trx name super ctx rs trx name x_c_subscription resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c subscription append get id append return sb to string tostring stringbuffer stringbuffer x_c_subscription get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set subscription type type of subscription public void setc subscriptiontype id int c subscriptiontype id if c subscriptiontype id 1 throw new illegal argument exception c subscriptiontype id is mandatory set value c subscriptiontype id new integer c subscriptiontype id setc_subscriptiontype_id c_subscriptiontype_id c_subscriptiontype_id illegalargumentexception c_subscriptiontype_id set_value c_subscriptiontype_id c_subscriptiontype_id get subscription type type of subscription public int getc subscriptiontype id integer ii integer get value c subscriptiontype id if ii null return 0 return ii int value getc_subscriptiontype_id get_value c_subscriptiontype_id intvalue set subscription subscription of a business partner of a product to renew public void setc subscription id int c subscription id if c subscription id 1 throw new illegal argument exception c subscription id is mandatory set valuenocheck c subscription id new integer c subscription id setc_subscription_id c_subscription_id c_subscription_id illegalargumentexception c_subscription_id set_valuenocheck c_subscription_id c_subscription_id get subscription subscription of a business partner of a product to renew public int getc subscription id integer ii integer get value c subscription id if ii null return 0 return ii int value getc_subscription_id get_value c_subscription_id intvalue set due subscription renewal is due public void set is due boolean is due set value is due new boolean is due setisdue isdue set_value isdue isdue get due subscription renewal is due public boolean is due object oo get value is due if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdue get_value isdue booleanvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set paid until subscription is paid valid until this date public void set paid until date timestamp paid until date if paid until date null throw new illegal argument exception paid until date is mandatory set value paid until date paid until date setpaiduntildate paiduntildate paiduntildate illegalargumentexception paiduntildate set_value paiduntildate paiduntildate get paid until subscription is paid valid until this date public timestamp get paid until date return timestamp get value paid until date getpaiduntildate get_value paiduntildate set renewal date public void set renewal date timestamp renewal date if renewal date null throw new illegal argument exception renewal date is mandatory set value renewal date renewal date setrenewaldate renewaldate renewaldate illegalargumentexception renewaldate set_value renewaldate renewaldate get renewal date public timestamp get renewal date return timestamp get value renewal date getrenewaldate get_value renewaldate set start date first effective day inclusive public void set start date timestamp start date if start date null throw new illegal argument exception start date is mandatory set value start date start date setstartdate startdate startdate illegalargumentexception startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate standard constructor param ctx ctx param m movementlineconfirm id id public m movement line confirm properties ctx int m movementlineconfirm id string trx name super ctx m movementlineconfirm id trx name if m movementlineconfirm id 0 setm movementconfirm id 0 parent setm movementline id 0 set confirmed qty env zero set difference qty env zero set scrapped qty env zero set target qty env zero set processed false m_movementlineconfirm_id mmovementlineconfirm m_movementlineconfirm_id trxname m_movementlineconfirm_id trxname m_movementlineconfirm_id setm_movementconfirm_id setm_movementline_id setconfirmedqty setdifferenceqty setscrappedqty settargetqty setprocessed m movementlineconfirm param ctx param rs public m movement line confirm properties ctx result set rs string trx name super ctx rs trx name m_movementlineconfirm mmovementlineconfirm resultset trxname trxname parent constructor param parent parent public m movement line confirm m movement confirm parent this parent get ctx 0 parent get trxname set client org parent setm movementconfirm id parent getm movementconfirm id mmovementlineconfirm mmovementconfirm getctx get_trxname setclientorg setm_movementconfirm_id getm_movementconfirm_id set movement line param line line public void set movement line m movement line line setm movementline id line getm movementline id set target qty line get movement qty set confirmed qty get target qty suggestion m line line setmovementline mmovementline setm_movementline_id getm_movementline_id settargetqty getmovementqty setconfirmedqty gettargetqty m_line get movement line return line public m movement line get line if m line null m line new m movement line get ctx getm movementline id get trxname return m line mmovementline getline m_line m_line mmovementline getctx getm_movementline_id get_trxname m_line process confirmation line update movement line return success public boolean process line m movement line line get line line set target qty get target qty line set movement qty get confirmed qty line set confirmed qty get confirmed qty line set scrapped qty get scrapped qty return line save get trxname processline mmovementline getline settargetqty gettargetqty setmovementqty getconfirmedqty setconfirmedqty getconfirmedqty setscrappedqty getscrappedqty get_trxname is fully confirmed return true if target confirmed qty public boolean is fully confirmed return get target qty compare to get confirmed qty 0 isfullyconfirmed gettargetqty compareto getconfirmedqty before delete do not delete return false protected boolean before delete return false beforedelete before save param new record new return true protected boolean before save boolean new record calculate difference target confirmed scrapped big decimal difference get target qty difference difference subtract get confirmed qty difference difference subtract get scrapped qty set difference qty difference return true newrecord beforesave newrecord bigdecimal gettargetqty getconfirmedqty getscrappedqty setdifferenceqty get contents return contents public object get contents return contents getcontents standard constructor public x ad userdef tab properties ctx int ad userdef tab id string trx name super ctx ad userdef tab id trx name if ad userdef tab id 0 setad tab id 0 setad userdef tab id 0 setad userdef win id 0 set is multi row only false set is read only false set is single row false set name null x_ad_userdef_tab ad_userdef_tab_id trxname ad_userdef_tab_id trxname ad_userdef_tab_id setad_tab_id setad_userdef_tab_id setad_userdef_win_id setismultirowonly setisreadonly setissinglerow setname load constructor public x ad userdef tab properties ctx result set rs string trx name super ctx rs trx name x_ad_userdef_tab resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad userdef tab append get id append return sb to string tostring stringbuffer stringbuffer x_ad_userdef_tab get_id tostring set tab tab within a window public void setad tab id int ad tab id if ad tab id 1 throw new illegal argument exception ad tab id is mandatory set value ad tab id new integer ad tab id setad_tab_id ad_tab_id ad_tab_id illegalargumentexception ad_tab_id set_value ad_tab_id ad_tab_id get tab tab within a window public int getad tab id integer ii integer get value ad tab id if ii null return 0 return ii int value getad_tab_id get_value ad_tab_id intvalue set user defined tab public void setad userdef tab id int ad userdef tab id if ad userdef tab id 1 throw new illegal argument exception ad userdef tab id is mandatory set valuenocheck ad userdef tab id new integer ad userdef tab id setad_userdef_tab_id ad_userdef_tab_id ad_userdef_tab_id illegalargumentexception ad_userdef_tab_id set_valuenocheck ad_userdef_tab_id ad_userdef_tab_id get user defined tab public int getad userdef tab id integer ii integer get value ad userdef tab id if ii null return 0 return ii int value getad_userdef_tab_id get_value ad_userdef_tab_id intvalue set user defined window public void setad userdef win id int ad userdef win id if ad userdef win id 1 throw new illegal argument exception ad userdef win id is mandatory set valuenocheck ad userdef win id new integer ad userdef win id setad_userdef_win_id ad_userdef_win_id ad_userdef_win_id illegalargumentexception ad_userdef_win_id set_valuenocheck ad_userdef_win_id ad_userdef_win_id get user defined window public int getad userdef win id integer ii integer get value ad userdef win id if ii null return 0 return ii int value getad_userdef_win_id get_value ad_userdef_win_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set multi row only this applies to multi row view only public void set is multi row only boolean is multi row only set value is multi row only new boolean is multi row only setismultirowonly ismultirowonly set_value ismultirowonly ismultirowonly get multi row only this applies to multi row view only public boolean is multi row only object oo get value is multi row only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismultirowonly get_value ismultirowonly booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set single row layout default for toggle between single and multi row grid layout public void set is single row boolean is single row set value is single row new boolean is single row setissinglerow issinglerow set_value issinglerow issinglerow get single row layout default for toggle between single and multi row grid layout public boolean is single row object oo get value is single row if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issinglerow get_value issinglerow booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname default constructor param ctx context param ad form id id public m form properties ctx int ad form id string trx name super ctx ad form id trx name ad_form_id mform ad_form_id trxname ad_form_id trxname load constructor param ctx context param rs result set public m form properties ctx result set rs string trx name super ctx rs trx name mform resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record int ad role id env getad role id get ctx m form access pa new m form access this ad role id pa save return success newrecord aftersave newrecord newrecord ad_role_id getad_role_id getctx mformaccess mformaccess ad_role_id constructor param m product id product param c bpartner id partner param qty quantity param isso trx so or po public m product pricing int m product id int c bpartner id big decimal qty boolean isso trx m m product id m product id m c bpartner id c bpartner id if qty null env zero compare to qty 0 m qty qty m issotrx isso trx m_product_id c_bpartner_id issotrx mproductpricing m_product_id c_bpartner_id bigdecimal issotrx m_m_product_id m_product_id m_c_bpartner_id c_bpartner_id compareto m_qty m_issotrx issotrx calculate price return true if calculated public boolean calculate price if m m product id 0 m found null m found boolean value previously not found return false price list version known if m calculated m calculated calculateplv price list known if m calculated m calculated calculatepl base price list used if m calculated m calculated calculatebpl set uom prod category if m calculated set base info user based discount if m calculated calculate discount set precision from price list m found new boolean m calculated return m calculated calculateprice m_m_product_id m_found m_found booleanvalue m_calculated m_calculated m_calculated m_calculated m_calculated m_calculated m_calculated setbaseinfo m_calculated calculatediscount setprecision m_found m_calculated m_calculated calculate price based on price list version return true if calculated private boolean calculateplv if m m product id 0 m m pricelist version id 0 return false string sql select bom price std p m product id pv m pricelist version id as price std 1 bom price list p m product id pv m pricelist version id as price list 2 bom price limit p m product id pv m pricelist version id as price limit 3 p c uom id pv valid from pl c currency id p m product category id 4 7 pl enforce price limit pl is tax included 8 9 from m product p inner join m productprice pp on p m product id pp m product id inner join m pricelist version pv on pp m pricelist version id pv m pricelist version id inner join m pricelist pl on pv m pricelist id pl m pricelist id where pv is active y and p m product id 1 and pv m pricelist version id 2 m calculated false try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 m m pricelist version id result set rs pstmt execute query if rs next prices m pricestd rs get big decimal 1 if rs was null m pricestd env zero m pricelist rs get big decimal 2 if rs was null m pricelist env zero m pricelimit rs get big decimal 3 if rs was null m pricelimit env zero m c uom id rs get int 4 m c currency id rs get int 6 m m product category id rs get int 7 m enforcepricelimit y equals rs get string 8 m istaxincluded y equals rs get string 9 log fine m pricelist version id m m pricelist version id m pricestd m calculated true rs close pstmt close catch exception e log log level severe sql e m calculated false return m calculated m_m_product_id m_m_pricelist_version_id bompricestd m_product_id m_pricelist_version_id pricestd bompricelist m_product_id m_pricelist_version_id pricelist bompricelimit m_product_id m_pricelist_version_id pricelimit c_uom_id validfrom c_currency_id m_product_category_id enforcepricelimit istaxincluded m_product m_productprice m_product_id m_product_id m_pricelist_version m_pricelist_version_id m_pricelist_version_id m_pricelist m_pricelist_id m_pricelist_id isactive m_product_id m_pricelist_version_id m_calculated preparedstatement preparestatement setint m_m_product_id setint m_m_pricelist_version_id resultset executequery m_pricestd getbigdecimal wasnull m_pricestd m_pricelist getbigdecimal wasnull m_pricelist m_pricelimit getbigdecimal wasnull m_pricelimit m_c_uom_id getint m_c_currency_id getint m_m_product_category_id getint m_enforcepricelimit getstring m_istaxincluded getstring m_pricelist_version_id m_m_pricelist_version_id m_pricestd m_calculated m_calculated m_calculated calculate price based on price list return true if calculated private boolean calculatepl if m m product id 0 return false get price list if m m pricelist id 0 string sql select m pricelist id is tax included from m pricelist pl inner join m product p on pl ad client id p ad client id where m product id order by is default desc prepared statement pstmt null try pstmt db prepare statement sql pstmt set int 1 m m product id result set rs pstmt execute query if rs next m m pricelist id rs get int 1 m istaxincluded y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe calculatepl pl e finally try if pstmt null pstmt close catch exception e pstmt null if m m pricelist id 0 log log level severe no price list trace print stack return false get prices for price list string sql select bom price std p m product id pv m pricelist version id as price std 1 bom price list p m product id pv m pricelist version id as price list 2 bom price limit p m product id pv m pricelist version id as price limit 3 p c uom id pv valid from pl c currency id p m product category id pl enforce price limit 4 8 from m product p inner join m productprice pp on p m product id pp m product id inner join m pricelist version pv on pp m pricelist version id pv m pricelist version id inner join m pricelist pl on pv m pricelist id pl m pricelist id where pv is active y and p m product id 1 and pv m pricelist id 2 order by pv valid from desc m calculated false if m pricedate null m pricedate new timestamp system current time millis try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 m m pricelist id result set rs pstmt execute query while m calculated rs next timestamp pl date rs get timestamp 5 we have the price list if order date is after or equal price list valid from if pl date null m pricedate before pl date prices m pricestd rs get big decimal 1 if rs was null m pricestd env zero m pricelist rs get big decimal 2 if rs was null m pricelist env zero m pricelimit rs get big decimal 3 if rs was null m pricelimit env zero m c uom id rs get int 4 m c currency id rs get int 6 m m product category id rs get int 7 m enforcepricelimit y equals rs get string 8 log fine m pricelist id m m pricelist id pl date m pricestd m calculated true break rs close pstmt close catch exception e log log level severe sql e m calculated false if m calculated log finer not found pl return m calculated m_m_product_id m_m_pricelist_id m_pricelist_id istaxincluded m_pricelist m_product ad_client_id ad_client_id m_product_id isdefault preparedstatement preparestatement setint m_m_product_id resultset executequery m_m_pricelist_id getint m_istaxincluded getstring m_m_pricelist_id pricelist printstack bompricestd m_product_id m_pricelist_version_id pricestd bompricelist m_product_id m_pricelist_version_id pricelist bompricelimit m_product_id m_pricelist_version_id pricelimit c_uom_id validfrom c_currency_id m_product_category_id enforcepricelimit m_product m_productprice m_product_id m_product_id m_pricelist_version m_pricelist_version_id m_pricelist_version_id m_pricelist m_pricelist_id m_pricelist_id isactive m_product_id m_pricelist_id validfrom m_calculated m_pricedate m_pricedate currenttimemillis preparedstatement preparestatement setint m_m_product_id setint m_m_pricelist_id resultset executequery m_calculated pldate gettimestamp pricelist validfrom pldate m_pricedate pldate m_pricestd getbigdecimal wasnull m_pricestd m_pricelist getbigdecimal wasnull m_pricelist m_pricelimit getbigdecimal wasnull m_pricelimit m_c_uom_id getint m_c_currency_id getint m_m_product_category_id getint m_enforcepricelimit getstring m_pricelist_id m_m_pricelist_id pldate m_pricestd m_calculated m_calculated m_calculated m_calculated calculate price based on base price list return true if calculated private boolean calculatebpl if m m product id 0 m m pricelist id 0 return false string sql select bom price std p m product id pv m pricelist version id as price std 1 bom price list p m product id pv m pricelist version id as price list 2 bom price limit p m product id pv m pricelist version id as price limit 3 p c uom id pv valid from pl c currency id p m product category id 4 7 pl enforce price limit pl is tax included 8 9 from m product p inner join m productprice pp on p m product id pp m product id inner join m pricelist version pv on pp m pricelist version id pv m pricelist version id inner join m pricelist bpl on pv m pricelist id bpl m pricelist id inner join m pricelist pl on bpl m pricelist id pl basepricelist id where pv is active y and p m product id 1 and pl m pricelist id 2 order by pv valid from desc m calculated false if m pricedate null m pricedate new timestamp system current time millis try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 m m pricelist id result set rs pstmt execute query while m calculated rs next timestamp pl date rs get timestamp 5 we have the price list if order date is after or equal price list valid from if pl date null m pricedate before pl date prices m pricestd rs get big decimal 1 if rs was null m pricestd env zero m pricelist rs get big decimal 2 if rs was null m pricelist env zero m pricelimit rs get big decimal 3 if rs was null m pricelimit env zero m c uom id rs get int 4 m c currency id rs get int 6 m m product category id rs get int 7 m enforcepricelimit y equals rs get string 8 m istaxincluded y equals rs get string 9 log fine m pricelist id m m pricelist id pl date m pricestd m calculated true break rs close pstmt close catch exception e log log level severe sql e m calculated false if m calculated log finer not found bpl return m calculated m_m_product_id m_m_pricelist_id bompricestd m_product_id m_pricelist_version_id pricestd bompricelist m_product_id m_pricelist_version_id pricelist bompricelimit m_product_id m_pricelist_version_id pricelimit c_uom_id validfrom c_currency_id m_product_category_id enforcepricelimit istaxincluded m_product m_productprice m_product_id m_product_id m_pricelist_version m_pricelist_version_id m_pricelist_version_id m_pricelist m_pricelist_id m_pricelist_id m_pricelist m_pricelist_id basepricelist_id isactive m_product_id m_pricelist_id validfrom m_calculated m_pricedate m_pricedate currenttimemillis preparedstatement preparestatement setint m_m_product_id setint m_m_pricelist_id resultset executequery m_calculated pldate gettimestamp pricelist validfrom pldate m_pricedate pldate m_pricestd getbigdecimal wasnull m_pricestd m_pricelist getbigdecimal wasnull m_pricelist m_pricelimit getbigdecimal wasnull m_pricelimit m_c_uom_id getint m_c_currency_id getint m_m_product_category_id getint m_enforcepricelimit getstring m_istaxincluded getstring m_pricelist_id m_m_pricelist_id pldate m_pricestd m_calculated m_calculated m_calculated m_calculated set base info uom private void set base info if m m product id 0 return string sql select c uom id m product category id from m product where m product id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id result set rs pstmt execute query if rs next m c uom id rs get int 1 m m product category id rs get int 2 rs close pstmt close catch exception e log log level severe sql e setbaseinfo m_m_product_id c_uom_id m_product_category_id m_product m_product_id preparedstatement preparestatement setint m_m_product_id resultset executequery m_c_uom_id getint m_m_product_category_id getint is tax included return tax included public boolean is tax included return m istaxincluded istaxincluded m_istaxincluded calculate business partner discount private void calculate discount m discountschema false if m c bpartner id 0 m m product id 0 return int m discountschema id 0 big decimal flat discount null string sql select coalesce p m discountschema id g m discountschema id coalesce p po discountschema id g po discountschema id p flat discount from c bpartner p inner join c bp group g on p c bp group id g c bp group id where p c bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m c bpartner id result set rs pstmt execute query if rs next m discountschema id rs get int m issotrx 1 2 flat discount rs get big decimal 3 if flat discount null flat discount env zero rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null no discount schema if m discountschema id 0 return m discount schema sd m discount schema get env get ctx m discountschema id not correct if sd get id 0 return m discountschema true m pricestd sd calculate price m qty m pricestd m m product id m m product category id flat discount calculatediscount m_discountschema m_c_bpartner_id m_m_product_id m_discountschema_id bigdecimal flatdiscount m_discountschema_id m_discountschema_id po_discountschema_id po_discountschema_id flatdiscount c_bpartner c_bp_group c_bp_group_id c_bp_group_id c_bpartner_id preparedstatement preparestatement setint m_c_bpartner_id resultset executequery m_discountschema_id getint m_issotrx flatdiscount getbigdecimal flatdiscount flatdiscount m_discountschema_id mdiscountschema mdiscountschema getctx m_discountschema_id get_id m_discountschema m_pricestd calculateprice m_qty m_pricestd m_m_product_id m_m_product_category_id flatdiscount calculate discount percentage based on standard list price return discount public big decimal get discount big decimal discount env zero if m pricelist int value 0 discount new big decimal m pricelist double value m pricestd double value m pricelist double value 100 0 if discount scale 2 discount discount set scale 2 big decimal round half up return discount bigdecimal getdiscount bigdecimal m_pricelist intvalue bigdecimal m_pricelist doublevalue m_pricestd doublevalue m_pricelist doublevalue setscale bigdecimal round_half_up get product id return id public int getm product id return m m product id getm_product_id m_m_product_id get price list id return pl public int getm pricelist id return m m pricelist id pricelist getm_pricelist_id m_m_pricelist_id set price list param m pricelist id pl public void setm pricelist id int m pricelist id m m pricelist id m pricelist id m calculated false pricelist m_pricelist_id setm_pricelist_id m_pricelist_id m_m_pricelist_id m_pricelist_id m_calculated get price list version return plv public int getm pricelist version id return m m pricelist version id pricelist getm_pricelist_version_id m_m_pricelist_version_id set price list version param m pricelist version id plv public void setm pricelist version id int m pricelist version id m m pricelist version id m pricelist version id m calculated false pricelist m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id m_m_pricelist_version_id m_pricelist_version_id m_calculated get price date return date public timestamp get price date return m pricedate getpricedate m_pricedate set price date param price date date public void set price date timestamp price date m pricedate price date m calculated false pricedate setpricedate pricedate m_pricedate pricedate m_calculated set precision private void set precision if m m pricelist id 0 m precision m price list get price precision env get ctx getm pricelist id setprecision m_m_pricelist_id m_precision mpricelist getpriceprecision getctx getm_pricelist_id get precision return precision 1 no rounding public int get precision return m precision getprecision m_precision round param bd number return rounded number private big decimal round big decimal bd if m precision 0 1 no rounding bd scale m precision return bd set scale m precision big decimal round half up return bd bigdecimal bigdecimal m_precision m_precision setscale m_precision bigdecimal round_half_up get c uom id return uom public int getc uom id if m calculated calculate price return m c uom id c_uom_id getc_uom_id m_calculated calculateprice m_c_uom_id get price list return list public big decimal get price list if m calculated calculate price return round m pricelist bigdecimal getpricelist m_calculated calculateprice m_pricelist get price std return std public big decimal get price std if m calculated calculate price return round m pricestd bigdecimal getpricestd m_calculated calculateprice m_pricestd get price limit return limit public big decimal get price limit if m calculated calculate price return round m pricelimit bigdecimal getpricelimit m_calculated calculateprice m_pricelimit get price list currency return currency public int getc currency id if m calculated calculate price return m c currency id getc_currency_id m_calculated calculateprice m_c_currency_id is price list enforded return enforce limit public boolean is enforce price limit if m calculated calculate price return m enforcepricelimit isenforcepricelimit m_calculated calculateprice m_enforcepricelimit is a discount schema active return active discount schema public boolean is discount schema return m discountschema discountschema isdiscountschema m_discountschema is the price calculated i e found return calculated public boolean is calculated return m calculated iscalculated m_calculated standard constructor public x a registrationattribute properties ctx int a registrationattribute id string trx name super ctx a registrationattribute id trx name if a registrationattribute id 0 setad reference id 0 seta registrationattribute id 0 set is self service true y set name null set seq no 0 x_a_registrationattribute a_registrationattribute_id trxname a_registrationattribute_id trxname a_registrationattribute_id setad_reference_id seta_registrationattribute_id setisselfservice setname setseqno load constructor public x a registrationattribute properties ctx result set rs string trx name super ctx rs trx name x_a_registrationattribute resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a registrationattribute append get id append return sb to string tostring stringbuffer stringbuffer x_a_registrationattribute get_id tostring public static final int ad reference id ad reference id 1 set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set value ad reference id new integer ad reference id ad_reference_id_ad_reference_id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_value ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue public static final int ad reference value id ad reference id 4 set reference key required to specify if data type is table or list public void setad reference value id int ad reference value id if ad reference value id 0 set value ad reference value id null else set value ad reference value id new integer ad reference value id ad_reference_value_id_ad_reference_id setad_reference_value_id ad_reference_value_id ad_reference_value_id set_value ad_reference_value_id set_value ad_reference_value_id ad_reference_value_id get reference key required to specify if data type is table or list public int getad reference value id integer ii integer get value ad reference value id if ii null return 0 return ii int value getad_reference_value_id get_value ad_reference_value_id intvalue set registration attribute asset registration attribute public void seta registrationattribute id int a registrationattribute id if a registrationattribute id 1 throw new illegal argument exception a registrationattribute id is mandatory set valuenocheck a registrationattribute id new integer a registrationattribute id seta_registrationattribute_id a_registrationattribute_id a_registrationattribute_id illegalargumentexception a_registrationattribute_id set_valuenocheck a_registrationattribute_id a_registrationattribute_id get registration attribute asset registration attribute public int geta registrationattribute id integer ii integer get value a registrationattribute id if ii null return 0 return ii int value geta_registrationattribute_id get_value a_registrationattribute_id intvalue set db column name name of the column in the database public void set column name string column name if column name null column name length 40 log warning length 40 truncated column name column name substring 0 39 set value column name column name setcolumnname columnname columnname columnname columnname columnname set_value columnname columnname get db column name name of the column in the database public string get column name return string get value column name getcolumnname get_value columnname set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue constructor param invoker component to display popup optional param table name table name param query query public a zoom across j component invoker string table name m query query log config table name table name query m query query see what is there get zoom targets invoker table name tablename azoomacross jcomponent tablename mquery tablename tablename m_query getzoomtargets tablename get the zomm targets for the table fill the list and the popup menu param invoker component to display popup optional param table name table private void get zoom targets j component invoker string table name string sql select distinct ws ad window id ws name wp ad window id wp name t table name from ad table t boolean base language env is base language env get ctx ad window if base language sql inner join ad window ws on t ad window id ws ad window id left outer join ad window wp on t po window id wp ad window id else sql inner join ad window trl ws on t ad window id ws ad window id and ws ad language left outer join ad window trl wp on t po window id wp ad window id and wp ad language sql where t table name not like i no import and exists select from ad tab tt first tab where tt ad window id ws ad window id or tt ad window id wp ad window id and tt ad table id t ad table id and tt seq no 10 and t ad table id in select ad table id from ad column where column name and is key n and is parent n x order by 2 key name pair pp null try prepared statement pstmt db prepare statement sql null int index 1 if base language pstmt set string index env getad language env get ctx pstmt set string index env getad language env get ctx pstmt set string index table name id result set rs pstmt execute query while rs next int ad window id rs get int 1 string name rs get string 2 int po window id rs get int 3 string target table name rs get string 5 if po window id 0 add target target table name ad window id name null else add target target table name ad window id name boolean true po if po window id 0 name rs get string 4 add target target table name po window id name boolean false rs close pstmt close catch sql exception e log log level severe sql e no zoom if m list size 0 a dialog info 0 invoker no zoom target log info base language base language else if invoker is showing m popup show invoker 0 invoker get height below button tablename getzoomtargets jcomponent tablename ad_window_id ad_window_id tablename ad_table baselanguage isbaselanguage getctx ad_window baselanguage ad_window ad_window_id ad_window_id ad_window po_window_id ad_window_id ad_window_trl ad_window_id ad_window_id ad_language ad_window_trl po_window_id ad_window_id ad_language tablename ad_tab ad_window_id ad_window_id ad_window_id ad_window_id ad_table_id ad_table_id seqno ad_table_id ad_table_id ad_column columnname iskey isparent keynamepair preparedstatement preparestatement baselanguage setstring getad_language getctx setstring getad_language getctx setstring tablename _id resultset executequery ad_window_id getint getstring po_window_id getint targettablename getstring po_window_id addtarget targettablename ad_window_id addtarget targettablename ad_window_id po_window_id getstring addtarget targettablename po_window_id sqlexception m_list adialog nozoomtarget baselanguage baselanguage isshowing m_popup getheight check target and add to popup param target table name table name param ad window id window param name name param isso has po so window return true if there is a record private boolean add target string target table name int ad window id string name boolean isso string sql select count from target table name where m query get where clause false string sql add if isso null sql add and isso trx isso boolean value y n int count db getsql value null sql sql add if count 0 isso null error try again w o so db getsql value null sql if count 0 return false key name pair pp new key name pair ad window id name m list add pp m popup add pp to string add action listener this return true targettablename ad_window_id addtarget targettablename ad_window_id targettablename m_query getwhereclause sqladd sqladd issotrx booleanvalue getsqlvalue sqladd getsqlvalue keynamepair keynamepair ad_window_id m_list m_popup tostring addactionlistener action listener param e event public void action performed action event e m popup set cursor cursor get predefined cursor cursor wait cursor string cmd e get action command for int i 0 i m list size i key name pair pp key name pair m list get i if cmd equals pp get name launch zoom pp return actionperformed actionevent m_popup setcursor getpredefinedcursor wait_cursor getactioncommand m_list keynamepair keynamepair m_list getname launchzoom launch zoom param pp key pair private void launch zoom key name pair pp int ad window id pp get key log info ad window id ad window id m query a window frame new a window if frame init window ad window id m query return a env show center screen frame frame null keypair launchzoom keynamepair ad_window_id getkey ad_window_id ad_window_id m_query awindow awindow initwindow ad_window_id m_query aenv showcenterscreen factory param m field field param a value value return value preference or null public static value preference start m field m field object a value return start m field a value null mfield avalue valuepreference valuepreference mfield mfield avalue mfield avalue factory param m field field param a value value param a display value display value return value preference or null public static value preference start m field m field object a value string a display value if m field is editable false log info field not editable r o return null set value display value string value null string display value null if a value null value a value to string display value a display value null value a display value get from m field ad window id display attribute attribute display type ad referenece id int ad window id m field getad window id string attribute m field get column name string display attribute m field get header int display type m field get display type int ad reference id 0 int window no m field get window no get from environment window no ad client id ad org id ad user id frame int ad client id env getad client id env get ctx int ad org id env get context as int env get ctx window no ad org id int ad user id env getad user id env get ctx frame frame env get window window no create editor value preference vp new value preference frame window no ad client id ad org id ad user id ad window id attribute display attribute value display value display type ad reference id return vp mfield avalue adisplayvalue valuepreference valuepreference mfield mfield avalue adisplayvalue mfield iseditable displayvalue displayvalue avalue avalue tostring displayvalue adisplayvalue adisplayvalue mfield ad_window_id displayattribute displaytype ad_referenece_id ad_window_id mfield getad_window_id mfield getcolumnname displayattribute mfield getheader displaytype mfield getdisplaytype ad_reference_id windowno mfield getwindowno windowno ad_client_id ad_org_id ad_user_id ad_client_id getad_client_id getctx ad_org_id getcontextasint getctx windowno ad_org_id ad_user_id getad_user_id getctx getwindow windowno valuepreference valuepreference windowno ad_client_id ad_org_id ad_user_id ad_window_id displayattribute displayvalue displaytype ad_reference_id create the popup menu item to start the value preference editor code add method public void set field m field m field m mfield m field if m mfield null value preference add menu this m popupmenu set field in action performed add if e get action command equals value preference name value preference start m mfield get value display value return code param l listener param popup menu menu return j menu item public static c menu item add menu action listener l j popup menu popup menu c menu item mi new c menu item msg get msg env get ctx name s icon mi set action command name mi add action listener l popup menu add mi return mi valuepreference setfield mfield mfield m_mfield mfield m_mfield valuepreference addmenu m_popupmenu setfield actionperformed getactioncommand valuepreference valuepreference m_mfield getvalue displayvalue popupmenu jmenuitem cmenuitem addmenu actionlistener jpopupmenu popupmenu cmenuitem cmenuitem getmsg getctx s_icon setactioncommand addactionlistener popupmenu constructor param frame parent param window no window no param ad client id client param ad org id org param ad user id user param ad window id window id param attribute attribute param display attribute attribute display param value value param display value calue display param display type display type param ad reference id reference public value preference frame frame int window no int ad client id int ad org id int ad user id int ad window id string attribute string display attribute string value string display value int display type int ad reference id super frame msg get msg env get ctx name display attribute true log config window no window no client id ad client id org id ad org id user id ad user id window id ad window id attribute attribute display attribute value value display value display type display type reference id ad reference id m ctx env get ctx m windowno window no m ad client id ad client id m ad org id ad org id m ad user id ad user id m ad window id ad window id m attribute attribute m displayattribute display attribute m value value m displayvalue display value m displaytype display type m ad reference id ad reference id m role m role get default try jb init dyn init catch exception ex log log level severe ex a env show center screen this windowno ad_client_id ad_org_id ad_user_id ad_window_id displayattribute displayvalue displaytype ad_reference_id valuepreference windowno ad_client_id ad_org_id ad_user_id ad_window_id displayattribute displayvalue displaytype ad_reference_id getmsg getctx displayattribute windowno windowno client_id ad_client_id org_id ad_org_id user_id ad_user_id window_id ad_window_id displayattribute displayvalue displaytype displaytype reference_id ad_reference_id m_ctx getctx m_windowno windowno m_ad_client_id ad_client_id m_ad_org_id ad_org_id m_ad_user_id ad_user_id m_ad_window_id ad_window_id m_attribute m_displayattribute displayattribute m_value m_displayvalue displayvalue m_displaytype displaytype m_ad_reference_id ad_reference_id m_role mrole getdefault jbinit dyninit aenv showcenterscreen static layout throws exception void jb init throws exception set default close operation j dialog dispose on close titled border new titled border border factory create etched border color white new color 148 145 140 msg get msg m ctx current settings l attribute set text msg translate m ctx attribute l value set text msg translate m ctx value l set for set text msg get msg m ctx value preference set for cb client set text msg translate m ctx ad client id cb org set text msg translate m ctx ad org id cb user set text msg translate m ctx ad user id cb user set selected true cb window set text msg translate m ctx ad window id cb window set selected true set panel set layout set layout f attribute set editable false f value set editable false this get content pane add set panel border layout north set panel add l attribute new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 set panel add f attribute new grid bag constraints 1 0 4 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 set panel add l value new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 set panel add f value new grid bag constraints 1 1 4 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 set panel add l set for new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 set panel add cb client new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 set panel add cb org new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 set panel add cb user new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 set panel add cb window new grid bag constraints 4 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 set panel add l attribute value new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 set panel add l value value new grid bag constraints 5 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 set panel add l explanation new grid bag constraints 1 3 4 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 current panel set border titled border current panel set layout current layout this get content pane add current panel border layout center current panel add scroll pane border layout center scroll pane get viewport add table null this get content pane add confirm panel border layout south jbinit setdefaultcloseoperation jdialog dispose_on_close titledborder titledborder borderfactory createetchedborder getmsg m_ctx currentsettings lattribute settext m_ctx lvalue settext m_ctx lsetfor settext getmsg m_ctx valuepreferencesetfor cbclient settext m_ctx ad_client_id cborg settext m_ctx ad_org_id cbuser settext m_ctx ad_user_id cbuser setselected cbwindow settext m_ctx ad_window_id cbwindow setselected setpanel setlayout setlayout fattribute seteditable fvalue seteditable getcontentpane setpanel borderlayout setpanel lattribute gridbagconstraints gridbagconstraints gridbagconstraints setpanel fattribute gridbagconstraints gridbagconstraints gridbagconstraints setpanel lvalue gridbagconstraints gridbagconstraints gridbagconstraints setpanel fvalue gridbagconstraints gridbagconstraints gridbagconstraints setpanel lsetfor gridbagconstraints gridbagconstraints gridbagconstraints setpanel cbclient gridbagconstraints gridbagconstraints gridbagconstraints setpanel cborg gridbagconstraints gridbagconstraints gridbagconstraints setpanel cbuser gridbagconstraints gridbagconstraints gridbagconstraints setpanel cbwindow gridbagconstraints gridbagconstraints gridbagconstraints setpanel lattributevalue gridbagconstraints gridbagconstraints gridbagconstraints setpanel lvaluevalue gridbagconstraints gridbagconstraints gridbagconstraints setpanel lexplanation gridbagconstraints gridbagconstraints gridbagconstraints currentpanel setborder titledborder currentpanel setlayout currentlayout getcontentpane currentpanel borderlayout currentpanel scrollpane borderlayout scrollpane getviewport getcontentpane confirmpanel borderlayout dynamic init private void dyn init set attribute value f attribute set text m displayattribute l attribute value set text m attribute f value set text m displayvalue l value value set text m value if c log mgt is level fine l attribute value set visible false l value value set visible false action listener cb client set enabled false cb client set selected true cb client add action listener this can change org if m role preferencetype client equals m role get preference type cb org add action listener this else cb org set enabled false cb org set selected true can change user if m role preferencetype client equals m role get preference type m role preferencetype organization equals m role get preference type cb user add action listener this else cb user set enabled false cb user set selected true can change all specific cb window add action listener this other confirm panel add action listener this b delete confirm panel add button confirm panel create delete button true b delete add action listener this set explanation dyninit fattribute settext m_displayattribute lattributevalue settext m_attribute fvalue settext m_displayvalue lvaluevalue settext m_value clogmgt islevelfine lattributevalue setvisible lvaluevalue setvisible actionlistener cbclient setenabled cbclient setselected cbclient addactionlistener mrole preferencetype_client m_role getpreferencetype cborg addactionlistener cborg setenabled cborg setselected mrole preferencetype_client m_role getpreferencetype mrole preferencetype_organization m_role getpreferencetype cbuser addactionlistener cbuser setenabled cbuser setselected cbwindow addactionlistener confirmpanel addactionlistener bdelete confirmpanel addbutton confirmpanel createdeletebutton bdelete addactionlistener setexplanation action listener param e event public void action performed action event e if e get action command equals confirm panel a cancel dispose else if e get action command equals confirm panel a ok insert dispose else if e get source b delete int no delete if no 0 a dialog warn m windowno this value preference not found else a dialog info m windowno this value preference deleted string value of no dispose else set explanation actionperformed actionevent getactioncommand confirmpanel a_cancel getactioncommand confirmpanel a_ok getsource bdelete adialog m_windowno valuepreferencenotfound adialog m_windowno valuepreferencedeleted valueof setexplanation set explanation private void set explanation todo translation string buffer expl new string buffer for if cb client is selected cb org is selected expl append this client and organization else if cb client is selected cb org is selected expl append all organizations of this client else if cb client is selected cb org is selected cb org set selected false expl append entire system else expl append entire system if cb user is selected expl append this user else expl append all users if cb window is selected expl append and this window else expl append and all windows if env get language env get ctx is base language l explanation set text expl to string this pack setexplanation stringbuffer stringbuffer cbclient isselected cborg isselected cbclient isselected cborg isselected cbclient isselected cborg isselected cborg setselected cbuser isselected cbwindow isselected getlanguage getctx isbaselanguage lexplanation settext tostring delete preference return number of rows deleted public int delete log info string buffer sql new string buffer delete from ad preference where sql append ad client id append cb client is selected m ad client id 0 sql append and ad org id append cb org is selected m ad org id 0 if cb user is selected sql append and ad user id append m ad user id else sql append and ad user id is null if cb window is selected sql append and ad window id append m ad window id else sql append and ad window id is null sql append and attribute append m attribute append log fine sql to string int no db execute update sql to string null if no 0 env set context m ctx get context key string null return no stringbuffer stringbuffer ad_preference ad_client_id cbclient isselected m_ad_client_id ad_org_id cborg isselected m_ad_org_id cbuser isselected ad_user_id m_ad_user_id ad_user_id cbwindow isselected ad_window_id m_ad_window_id ad_window_id m_attribute tostring executeupdate tostring setcontext m_ctx getcontextkey get context key return context key private string get context key if cb window is selected return p m ad window id m attribute else return p m attribute getcontextkey cbwindow isselected m_ad_window_id m_attribute m_attribute save to disk public void insert log info delete first int no delete handle null if m value null m value length 0 if display type is lookup m displaytype m value 1 1 may cause problems b partner m discountschema else if display type is date m displaytype m value else a dialog warn m windowno this value preference not inserted return inserting int client id cb client is selected m ad client id 0 int org id cb org is selected m ad org id 0 int ad preference id db get nextid m ctx ad preference null string buffer sql new string buffer insert into ad preference ad preference id ad client id ad org id is active created created by updated updated by ad window id ad user id attribute value values sql append ad preference id append append client id append append org id append y sys date append m ad user id append sys date append m ad user id append if cb window is selected sql append m ad window id append else sql append null if cb user is selected sql append m ad user id append else sql append null sql append append m attribute append append m value append log fine sql to string no db execute update sql to string null if no 1 env set context m ctx get context key m value a dialog info m windowno this value preference inserted else a dialog warn m windowno this value preference not inserted m_value m_value displaytype islookup m_displaytype m_value bpartner m_discountschema displaytype isdate m_displaytype m_value adialog m_windowno valuepreferencenotinserted client_id cbclient isselected m_ad_client_id org_id cborg isselected m_ad_org_id ad_preference_id getnextid m_ctx ad_preference stringbuffer stringbuffer ad_preference ad_preference_id ad_client_id ad_org_id isactive createdby updatedby ad_window_id ad_user_id ad_preference_id client_id org_id sysdate m_ad_user_id sysdate m_ad_user_id cbwindow isselected m_ad_window_id cbuser isselected m_ad_user_id m_attribute m_value tostring executeupdate tostring setcontext m_ctx getcontextkey m_value adialog m_windowno valuepreferenceinserted adialog m_windowno valuepreferencenotinserted standard constructor public x c uom properties ctx int c uom id string trx name super ctx c uom id trx name if c uom id 0 setc uom id 0 set costing precision 0 set is default false set name null set std precision 0 setx12de355 null x_c_uom c_uom_id trxname c_uom_id trxname c_uom_id setc_uom_id setcostingprecision setisdefault setname setstdprecision load constructor public x c uom properties ctx result set rs string trx name super ctx rs trx name x_c_uom resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c uom append get id append return sb to string tostring stringbuffer stringbuffer x_c_uom get_id tostring set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set costing precision rounding used costing calculations public void set costing precision int costing precision set value costing precision new integer costing precision setcostingprecision costingprecision set_value costingprecision costingprecision get costing precision rounding used costing calculations public int get costing precision integer ii integer get value costing precision if ii null return 0 return ii int value getcostingprecision get_value costingprecision intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set standard precision rule for rounding calculated amounts public void set std precision int std precision set value std precision new integer std precision setstdprecision stdprecision set_value stdprecision stdprecision get standard precision rule for rounding calculated amounts public int get std precision integer ii integer get value std precision if ii null return 0 return ii int value getstdprecision get_value stdprecision intvalue set symbol symbol for a unit of measure public void setuom symbol string uom symbol if uom symbol null uom symbol length 10 log warning length 10 truncated uom symbol uom symbol substring 0 9 set value uom symbol uom symbol setuomsymbol uomsymbol uomsymbol uomsymbol uomsymbol uomsymbol set_value uomsymbol uomsymbol get symbol symbol for a unit of measure public string getuom symbol return string get value uom symbol getuomsymbol get_value uomsymbol set uom code uom edi x12 code public void setx12de355 string x12de355 if x12de355 null throw new illegal argument exception x12de355 is mandatory if x12de355 length 4 log warning length 4 truncated x12de355 x12de355 substring 0 3 set value x12de355 x12de355 illegalargumentexception set_value get uom code uom edi x12 code public string getx12de355 return string get value x12de355 get_value basic constructor public script basic constructor param element adds an element to the element public script element element add element element addelement basic constructor param element optionally adds an element to the element param src sets the src attribute public script element element string src if element null add element element set src src addelement setsrc basic constructor param element optionally adds an element to the element param src sets the src attribute param type sets the type attribute public script element element string src string type if element null add element element set src src set type type addelement setsrc settype basic constructor param element optionally adds an element to the element param src sets the src attribute param type sets the type attribute param lang sets the language attribute public script element element string src string type string lang if element null add element element set src src set type type set language lang addelement setsrc settype setlanguage basic constructor param element adds an element to the element public script string element add element element addelement basic constructor param element adds an element to the element param src sets the src attribute public script string element string src add element element set src src addelement setsrc basic constructor param element adds an element to the element param src sets the src attribute param type sets the type attribute public script string element string src string type add element element set src src set type type addelement setsrc settype basic constructor param element adds an element to the element param src sets the src attribute param type sets the type attribute param lang sets the language attribute public script string element string src string type string lang add element element set src src set type type set language lang addelement setsrc settype setlanguage sets the src attribute param src the src attribute public script set src string src add attribute src src return this setsrc addattribute sets the type attribute param type the type attribute public script set type string type add attribute type type return this settype addattribute sets the language attribute param language the language attribute public script set language string language add attribute language language return this setlanguage addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public script add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public script add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public script add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public script add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public script remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry get product price param ctx ctx param m pricelist version id id param m product id id param trx name trx return product price or null public static m product price get properties ctx int m pricelist version id int m product id string trx name m product price ret value null string sql select from m productprice where m pricelist version id and m product id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m pricelist version id pstmt set int 2 m product id result set rs pstmt execute query if rs next ret value new m product price ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_pricelist_version_id m_product_id trxname mproductprice m_pricelist_version_id m_product_id trxname mproductprice retvalue m_productprice m_pricelist_version_id m_product_id preparedstatement preparestatement trxname setint m_pricelist_version_id setint m_product_id resultset executequery retvalue mproductprice trxname s_log retvalue persistency constructor param ctx context param ignored ignored public m product price properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set price limit env zero set price list env zero set price std env zero mproductprice trxname trxname illegalargumentexception setpricelimit setpricelist setpricestd load constructor param ctx context param rs result set public m product price properties ctx result set rs string trx name super ctx rs trx name mproductprice resultset trxname trxname new constructor param ctx context param m pricelist version id price list version param m product id product public m product price properties ctx int m pricelist version id int m product id string trx name this ctx 0 trx name setm pricelist version id m pricelist version id fk setm product id m product id fk m_pricelist_version_id m_product_id mproductprice m_pricelist_version_id m_product_id trxname trxname setm_pricelist_version_id m_pricelist_version_id setm_product_id m_product_id new constructor param ctx context param m pricelist version id price list version param m product id product param price list list price param price std standard price param price limit limit price public m product price properties ctx int m pricelist version id int m product id big decimal price list big decimal price std big decimal price limit string trx name this ctx m pricelist version id m product id trx name set prices price list price std price limit m_pricelist_version_id m_product_id pricelist pricestd pricelimit mproductprice m_pricelist_version_id m_product_id bigdecimal pricelist bigdecimal pricestd bigdecimal pricelimit trxname m_pricelist_version_id m_product_id trxname setprices pricelist pricestd pricelimit parent constructor param plv price list version param m product id product param price list list price param price std standard price param price limit limit price public m product price m price list version plv int m product id big decimal price list big decimal price std big decimal price limit this plv get ctx 0 plv get trxname set client org plv setm pricelist version id plv getm pricelist version id setm product id m product id set prices price list price std price limit m_product_id pricelist pricestd pricelimit mproductprice mpricelistversion m_product_id bigdecimal pricelist bigdecimal pricestd bigdecimal pricelimit getctx get_trxname setclientorg setm_pricelist_version_id getm_pricelist_version_id setm_product_id m_product_id setprices pricelist pricestd pricelimit set prices param price list list price param price std standard price param price limit limit price public void set prices big decimal price list big decimal price std big decimal price limit set price limit price limit set price list price list set price std price std pricelist pricestd pricelimit setprices bigdecimal pricelist bigdecimal pricestd bigdecimal pricelimit setpricelimit pricelimit setpricelist pricelist setpricestd pricestd constructor param line statement line param doc header public docline bank m bank statement line line doc bank doc super line doc m c payment id line getc payment id m isreversal line is reversal m stmtamt line get stmt amt m interestamt line get interest amt m trxamt line get trx amt set date doc line get valuta date setc bpartner id line getc bpartner id docline_bank mbankstatementline doc_bank m_c_payment_id getc_payment_id m_isreversal isreversal m_stmtamt getstmtamt m_interestamt getinterestamt m_trxamt gettrxamt setdatedoc getvalutadate setc_bpartner_id getc_bpartner_id get payment return c paymnet id public int getc payment id return m c payment id c_paymnet_id getc_payment_id m_c_payment_id get ad org id param payment if true get org from payment return org public int getad org id boolean payment if payment getc payment id 0 string sql select ad org id from c payment where c payment id int id db getsql value null sql getc payment id if id 0 return id return super getad org id ad_org_id getad_org_id getc_payment_id ad_org_id c_payment c_payment_id getsqlvalue getc_payment_id getad_org_id is reversal return true if reversal public boolean is reversal return m isreversal isreversal m_isreversal get interest return interest amount public big decimal get interest amt return m interestamt interestamount bigdecimal getinterestamt m_interestamt get statement return starement amount public big decimal get stmt amt return m stmtamt bigdecimal getstmtamt m_stmtamt get transaction return transaction amount public big decimal get trx amt return m trxamt bigdecimal gettrxamt m_trxamt create ui param b return componentui public static componentui createui j component b return s checkboxui jcomponent s_checkboxui install defaults param b public void install defaults abstract button b super install defaults b b set opaque false installdefaults abstractbutton installdefaults setopaque create button listener param b button return listener protected basic button listener create button listener abstract button b return new compiere button listener b basicbuttonlistener createbuttonlistener abstractbutton compierebuttonlistener color model param ctx context param ad color id color public m color properties ctx int ad color id string trx name super ctx ad color id trx name if ad color id 0 set name ad_color_id mcolor ad_color_id trxname ad_color_id trxname ad_color_id setname string representation return string public string to string return m color id get id get name tostring mcolor get_id getname load special data images to be extended by sub classes param rs result set param index zero based index return value throws sql exception protected object load special result set rs int index throws sql exception log config p info get column name index if index get columnindex color type return rs get string index 1 return null sqlexception loadspecial resultset sqlexception p_info getcolumnname get_columnindex colortype getstring save special data ad image id background param value value param index index return sql code for insert values clause protected string save new special object value int index string col name p info get column name index string col value value null null value get class to string log fine col name col value if value null return null return value to string ad_image_id savenewspecial colname p_info getcolumnname colvalue getclass tostring colname colvalue tostring get compiere color see org compiere grid ed v color get compiere color return compiere color public compiere color get compiere color if get id 0 return null color type string color type string get color type if color type null log log level severe m color get compiere color no color type return null compiere color cc null if color type equals compiere color type flat cc new compiere color get color true true else if color type equals compiere color type gradient int repeat distance get repeat distance string start point get start point int start point start point null 0 integer parse int start point cc new compiere color get color true get color false start point repeat distance else if color type equals compiere color type lines int line width get line width int line distance get line distance cc new compiere color get color false get color true line width line distance else if color type equals compiere color type texture int ad image id getad image id string url geturl ad image id if url null return null big decimal image alpha get image alpha float composite alpha image alpha null 0 7f image alpha float value cc new compiere color url get color true composite alpha return cc compierecolor vcolor getcompierecolor compierecolor compierecolor getcompierecolor get_id colortype getcolortype colortype mcolor getcompierecolor colortype compierecolor colortype compierecolor type_flat compierecolor getcolor colortype compierecolor type_gradient repeatdistance getrepeatdistance startpoint getstartpoint startpoint startpoint parseint startpoint compierecolor getcolor getcolor startpoint repeatdistance colortype compierecolor type_lines linewidth getlinewidth linedistance getlinedistance compierecolor getcolor getcolor linewidth linedistance colortype compierecolor type_texture ad_image_id getad_image_id ad_image_id bigdecimal imagealpha getimagealpha compositealpha imagealpha imagealpha floatvalue compierecolor getcolor compositealpha get color param primary true if primary false if secondary return color private color get color boolean primary int red primary get red getred 1 int green primary get green getgreen 1 int blue primary get blue getblue 1 return new color red green blue getcolor getred getred_1 getgreen getgreen_1 getblue getblue_1 get url from image param ad image id image return url as string or null private string geturl int ad image id if ad image id 0 return null string ret value null string sql select imageurl from ad image where ad image id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad image id result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value ad_image_id ad_image_id ad_image_id retvalue ad_image ad_image_id preparedstatement preparestatement setint ad_image_id resultset executequery retvalue getstring sqlexception retvalue constructor param ass accounting schemata param rs record parem trx name trx protected doc matchinv m acct schema ass result set rs string trx name super ass m match inv class rs doctype matmatchinv trx name trxname doc_matchinv macctschema resultset trxname mmatchinv doctype_matmatchinv trxname load specific document details return error message or null protected string load document details setc currency id doc no currency m match inv match inv m match inv getpo set date doc match inv get date trx set qty match inv get qty invoice info int c invoiceline id match inv getc invoiceline id m invoiceline new m invoice line get ctx c invoiceline id null bp for not invoiced receipts int c bpartner id m invoiceline get parent getc bpartner id setc bpartner id c bpartner id int m inoutline id match inv getm inoutline id m receiptline new m in out line get ctx m inoutline id null m pc new product cost env get ctx getm product id match inv getm attributesetinstance id null m pc set qty get qty return null loaddocumentdetails setc_currency_id no_currency mmatchinv matchinv mmatchinv setdatedoc matchinv getdatetrx setqty matchinv getqty c_invoiceline_id matchinv getc_invoiceline_id m_invoiceline minvoiceline getctx c_invoiceline_id notinvoicedreceipts c_bpartner_id m_invoiceline getparent getc_bpartner_id setc_bpartner_id c_bpartner_id m_inoutline_id matchinv getm_inoutline_id m_receiptline minoutline getctx m_inoutline_id m_pc productcost getctx getm_product_id matchinv getm_attributesetinstance_id m_pc setqty getqty get source currency balance subtracts line and tax amounts from total no rounding return zero always balanced public big decimal get balance return env zero bigdecimal getbalance create facts the accounting logic for mxi single line pre not invoiced receipts dr receipt org inventory clearing cr invoicepv dr cr difference commitment expense cr offset dr pre param as accounting schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact nothing to do if getm product id 0 no product get qty signum 0 m receiptline get movement qty signum 0 qty 0 log fine no product qty m product id getm product id qty get qty in out qty m receiptline get movement qty return facts m match inv match inv m match inv getpo create fact header fact fact new fact this as fact post actual setc currency id as getc currency id needs to be handeled in po matching as no receipt info if m pc is service log fine service skipped return fact not invoiced receipt dr from receipt big decimal multiplier get qty divide m receiptline get movement qty 12 big decimal round half up abs fact line dr fact create line null get account doc accttype notinvoicedreceipts as as getc currency id env one null updated below if dr null p error no product costs return null dr set qty get qty dr setm locator id m receiptline getm locator id m in out receipt m receiptline get parent dr set location fromb partner receipt getc bpartner location id true from loc dr set location from locator m receiptline getm locator id false to loc big decimal temp dr get acct balance set amt acct cr dr from receipt sets also project if dr update reverse line m in out table id amt updated m receiptline getm inout id m receiptline getm inoutline id multiplier p error mat receipt not posted yet return null log fine cr amt temp dr get acct balance dr to string inventory clearing cr from invoice m account expense m pc get account product cost accttype p inventoryclearing as if m pc is service expense m pc get account product cost accttype p expense as big decimal line net amt m invoiceline get line net amt multiplier get qty divide m invoiceline get qty invoiced 12 big decimal round half up abs if multiplier compare to env one 0 line net amt line net amt multiply multiplier if m pc is service line net amt dr get acct balance book out exact receipt amt fact line cr null if as is accrual cr fact create line null expense as getc currency id null line net amt updated below if cr null log fine line net amt 0 m product id getm product id qty get qty in out qty m receiptline get movement qty facts add fact return facts cr set qty get qty negate temp cr get acct balance set amt acct cr dr from invoice sets also project if as is accrual cr update reverse line m invoice table id amt updated m invoiceline getc invoice id m invoiceline getc invoiceline id multiplier p error invoice not posted yet return null log fine dr amt temp cr get acct balance cr to string else cash acct m invoice invoice m invoiceline get parent if as getc currency id invoice getc currency id line net amt m conversion rate convert get ctx line net amt invoice getc currency id as getc currency id invoice get date acct invoice getc conversiontype id invoice getad client id invoice getad org id cr fact create line null expense as getc currency id null line net amt cr set qty get qty multiply multiplier negate cr setc activity id m invoiceline getc activity id cr setc campaign id m invoiceline getc campaign id cr setc project id m invoiceline getc project id cr setc uom id m invoiceline getc uom id cr setuser1 id m invoiceline getuser1 id cr setuser2 id m invoiceline getuser2 id invoice price variance difference big decimal ipv cr get acct balance add dr get acct balance negate if ipv signum 0 fact line pv fact create line null m pc get account product cost accttype p ipv as as getc currency id ipv pv setc activity id m invoiceline getc activity id pv setc campaign id m invoiceline getc campaign id pv setc project id m invoiceline getc project id pv setc uom id m invoiceline getc uom id pv setuser1 id m invoiceline getuser1 id pv setuser2 id m invoiceline getuser2 id log fine ipv ipv balance fact get source balance cost detail record data from expense inc clearing cr record m cost detail create invoice as getad org id getm product id match inv getm attributesetinstance id m invoiceline getc invoiceline id 0 no cost element cr get acct balance negate get qty correcting get description get trx name update costing update product info as getc acctschema id m acct schema costingmethod standardcosting equals as get costing method facts add fact commitment release if as is accrual as is create commitment fact doc order get commitment release as this get qty m invoiceline getc invoiceline id env one if fact null return null facts add fact commitment return facts notinvoicedreceipts inventoryclearing arraylist createfacts macctschema arraylist arraylist getm_product_id getqty m_receiptline getmovementqty m_product_id getm_product_id getqty inoutqty m_receiptline getmovementqty mmatchinv matchinv mmatchinv post_actual setc_currency_id getc_currency_id m_pc isservice notinvoicedreceipt bigdecimal getqty m_receiptline getmovementqty bigdecimal round_half_up factline createline getaccount accttype_notinvoicedreceipts getc_currency_id p_error setqty getqty setm_locator_id m_receiptline getm_locator_id minout m_receiptline getparent setlocationfrombpartner getc_bpartner_location_id setlocationfromlocator m_receiptline getm_locator_id bigdecimal getacctbalance amtacctcr updatereverseline minout table_id m_receiptline getm_inout_id m_receiptline getm_inoutline_id p_error getacctbalance tostring inventoryclearing maccount m_pc getaccount productcost accttype_p_inventoryclearing m_pc isservice m_pc getaccount productcost accttype_p_expense bigdecimal linenetamt m_invoiceline getlinenetamt getqty m_invoiceline getqtyinvoiced bigdecimal round_half_up compareto linenetamt linenetamt m_pc isservice linenetamt getacctbalance factline isaccrual createline getc_currency_id linenetamt m_product_id getm_product_id getqty inoutqty m_receiptline getmovementqty setqty getqty getacctbalance amtacctcr isaccrual updatereverseline minvoice table_id m_invoiceline getc_invoice_id m_invoiceline getc_invoiceline_id p_error getacctbalance tostring minvoice m_invoiceline getparent getc_currency_id getc_currency_id linenetamt mconversionrate getctx linenetamt getc_currency_id getc_currency_id getdateacct getc_conversiontype_id getad_client_id getad_org_id createline getc_currency_id linenetamt setqty getqty setc_activity_id m_invoiceline getc_activity_id setc_campaign_id m_invoiceline getc_campaign_id setc_project_id m_invoiceline getc_project_id setc_uom_id m_invoiceline getc_uom_id setuser1_id m_invoiceline getuser1_id setuser2_id m_invoiceline getuser2_id bigdecimal getacctbalance getacctbalance factline createline m_pc getaccount productcost accttype_p_ipv getc_currency_id setc_activity_id m_invoiceline getc_activity_id setc_campaign_id m_invoiceline getc_campaign_id setc_project_id m_invoiceline getc_project_id setc_uom_id m_invoiceline getc_uom_id setuser1_id m_invoiceline getuser1_id setuser2_id m_invoiceline getuser2_id getsourcebalance incclearing mcostdetail createinvoice getad_org_id getm_product_id matchinv getm_attributesetinstance_id m_invoiceline getc_invoiceline_id getacctbalance getqty getdescription gettrxname updateproductinfo getc_acctschema_id macctschema costingmethod_standardcosting getcostingmethod isaccrual iscreatecommitment doc_order getcommitmentrelease getqty m_invoiceline getc_invoiceline_id update product info old costing cost standard cum qty cost standard cum amt cost average cum qty cost average cum amt param c acctschema id accounting schema param standard costing true if std costing deprecated old costing private boolean update product info int c acctschema id boolean standard costing log fine m matchinv id get id update product costing qty amt requires existence of currency conversion string buffer sql new string buffer update m product costing pc set cost standard cum qty cost standard cum amt cost average cum qty cost average cum amt select pc cost standard cum qty m qty pc cost standard cum amt currency convert il price actual i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id m qty pc cost average cum qty m qty pc cost average cum amt currency convert il price actual i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id m qty from m matchinv m inner join c invoiceline il on m c invoiceline id il c invoiceline id inner join c invoice i on il c invoice id i c invoice id c acctschema a where pc c acctschema id a c acctschema id and pc m product id m m product id and m m matchinv id append get id append where pc c acctschema id append c acctschema id append and exists select from m matchinv m where pc m product id m m product id and m m matchinv id append get id append int no db execute update sql to string get trx name log fine m product costing qty amt updated no update average cost sql new string buffer update m product costing set cost average cost average cum amt decode cost average cum qty 0 1 cost average cum qty where c acctschema id append c acctschema id append and m product id append getm product id no db execute update sql to string get trx name log fine m product costing avg cost updated no update current cost if standard costing sql new string buffer update m product costing set current cost price cost average where c acctschema id append c acctschema id append and m product id append getm product id no db execute update sql to string get trx name log fine m product costing current cost updated no return true coststandardcumqty coststandardcumamt costaveragecumqty costaveragecumamt c_acctschema_id standardcosting updateproductinfo c_acctschema_id standardcosting m_matchinv_id get_id stringbuffer stringbuffer m_product_costing coststandardcumqty coststandardcumamt costaveragecumqty costaveragecumamt coststandardcumqty coststandardcumamt currencyconvert priceactual c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id costaveragecumqty costaveragecumamt currencyconvert priceactual c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id m_matchinv c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice c_invoice_id c_invoice_id c_acctschema c_acctschema_id c_acctschema_id m_product_id m_product_id m_matchinv_id get_id c_acctschema_id c_acctschema_id m_matchinv m_product_id m_product_id m_matchinv_id get_id executeupdate tostring gettrxname m_product_costing stringbuffer m_product_costing costaverage costaveragecumamt costaveragecumqty costaveragecumqty c_acctschema_id c_acctschema_id m_product_id getm_product_id executeupdate tostring gettrxname m_product_costing avgcost standardcosting stringbuffer m_product_costing currentcostprice costaverage c_acctschema_id c_acctschema_id m_product_id getm_product_id executeupdate tostring gettrxname m_product_costing currentcost journal period check that selected period is in date acct range or adjusting period called when c period id or date acct date doc changed public string period properties ctx int window no m tab m tab m field m field object value string col name m field get column name if value null is callout active return set callout active true int ad client id env get context as int ctx window no ad client id timestamp date acct null if col name equals date acct date acct timestamp value else date acct timestamp m tab get value date acct int c period id 0 if col name equals c period id c period id integer value int value when date doc is changed update date acct if col name equals date doc m tab set value date acct value when date acct is changed set c period id else if col name equals date acct string sql select c period id from c period where c year id in select c year id from c year where c calendar id select c calendar id from ad clientinfo where ad client id and between start date and end date globalqss cruiz bug 1577712 financial period bug and is active y and period type s try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set timestamp 2 date acct result set rs pstmt execute query if rs next c period id rs get int 1 rs close pstmt close pstmt null catch sql exception e log log level severe sql e set callout active false return e get localized message if c period id 0 m tab set value c period id new integer c period id when c period id is changed check if in date acct range and set to end date if not else string sql select period type start date end date from c period where c period id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c period id result set rs pstmt execute query if rs next string period type rs get string 1 timestamp start date rs get timestamp 2 timestamp end date rs get timestamp 3 if period type equals s standard periods out of range set to last day if date acct null date acct before start date date acct after end date m tab set value date acct end date rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message set callout active false return dateacct c_period_id dateacct datedoc windowno mtab mtab mfield mfield colname mfield getcolumnname iscalloutactive setcalloutactive ad_client_id getcontextasint windowno ad_client_id dateacct colname dateacct dateacct dateacct mtab getvalue dateacct c_period_id colname c_period_id c_period_id intvalue datedoc dateacct colname datedoc mtab setvalue dateacct dateacct c_period_id colname dateacct c_period_id c_period c_year_id c_year_id c_year c_calendar_id c_calendar_id ad_clientinfo ad_client_id startdate enddate isactive periodtype preparedstatement preparestatement setint ad_client_id settimestamp dateacct resultset executequery c_period_id getint sqlexception setcalloutactive getlocalizedmessage c_period_id mtab setvalue c_period_id c_period_id c_period_id dateacct periodtype startdate enddate c_period c_period_id preparedstatement preparestatement setint c_period_id resultset executequery periodtype getstring startdate gettimestamp enddate gettimestamp periodtype dateacct dateacct startdate dateacct enddate mtab setvalue dateacct enddate sqlexception setcalloutactive getlocalizedmessage setcalloutactive journal line rate set currency rate from date acct c conversiontype id c currency id public string rate properties ctx int window no m tab m tab m field m field object value if value null return source info integer currency id integer m tab get value c currency id int c currency id currency id int value integer conversiontype id integer m tab get value c conversiontype id int c conversiontype id conversiontype id int value timestamp date acct timestamp m tab get value date acct if date acct null date acct new timestamp system current time millis int c acctschema id env get context as int ctx window no c acctschema id m acct schema as m acct schema get ctx c acctschema id int ad client id env get context as int ctx window no ad client id int ad org id env get context as int ctx window no ad org id big decimal currency rate m conversion rate get rate c currency id as getc currency id date acct c conversiontype id ad client id ad org id log fine rate currency rate if currency rate null currency rate env zero m tab set value currency rate currency rate return currencyrate dateacct c_conversiontype_id c_currency_id windowno mtab mtab mfield mfield currency_id mtab getvalue c_currency_id c_currency_id currency_id intvalue conversiontype_id mtab getvalue c_conversiontype_id c_conversiontype_id conversiontype_id intvalue dateacct mtab getvalue dateacct dateacct dateacct currenttimemillis c_acctschema_id getcontextasint windowno c_acctschema_id macctschema macctschema c_acctschema_id ad_client_id getcontextasint windowno ad_client_id ad_org_id getcontextasint windowno ad_org_id bigdecimal currencyrate mconversionrate getrate c_currency_id getc_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id currencyrate currencyrate currencyrate mtab setvalue currencyrate currencyrate journal line amt convert the source amount to accounted amount amt acct dr cr called when source amount amt source cr dr or rate changes public string amt properties ctx int window no m tab m tab m field m field object value string col name m field get column name if value null is callout active return set callout active true get target currency precision from c acctschema c currency id int c acctschema id env get context as int ctx window no c acctschema id m acct schema as m acct schema get ctx c acctschema id int precision as get std precision big decimal currency rate big decimal m tab get value currency rate if currency rate null currency rate env one m tab set value currency rate currency rate amt acct amt source currency rate precision big decimal amt source dr big decimal m tab get value amt source dr if amt source dr null amt source dr env zero big decimal amt source cr big decimal m tab get value amt source cr if amt source cr null amt source cr env zero big decimal amt acct dr amt source dr multiply currency rate amt acct dr amt acct dr set scale precision big decimal round half up m tab set value amt acct dr amt acct dr big decimal amt acct cr amt source cr multiply currency rate amt acct cr amt acct cr set scale precision big decimal round half up m tab set value amt acct cr amt acct cr set callout active false return journalline amtacctdr amtsourcecr windowno mtab mtab mfield mfield colname mfield getcolumnname iscalloutactive setcalloutactive c_acctschema c_currency_id c_acctschema_id getcontextasint windowno c_acctschema_id macctschema macctschema c_acctschema_id getstdprecision bigdecimal currencyrate bigdecimal mtab getvalue currencyrate currencyrate currencyrate mtab setvalue currencyrate currencyrate amtacct amtsource currencyrate bigdecimal amtsourcedr bigdecimal mtab getvalue amtsourcedr amtsourcedr amtsourcedr bigdecimal amtsourcecr bigdecimal mtab getvalue amtsourcecr amtsourcecr amtsourcecr bigdecimal amtacctdr amtsourcedr currencyrate amtacctdr amtacctdr setscale bigdecimal round_half_up mtab setvalue amtacctdr amtacctdr bigdecimal amtacctcr amtsourcecr currencyrate amtacctcr amtacctcr setscale bigdecimal round_half_up mtab setvalue amtacctcr amtacctcr setcalloutactive standard constructor public x m bom properties ctx int m bom id string trx name super ctx m bom id trx name if m bom id 0 setbom type null a setbom use null a setm bom id 0 setm product id 0 set name null x_m_bom m_bom_id trxname m_bom_id trxname m_bom_id setbomtype setbomuse setm_bom_id setm_product_id setname load constructor public x m bom properties ctx result set rs string trx name super ctx rs trx name x_m_bom resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m bom append get id append return sb to string tostring stringbuffer stringbuffer x_m_bom get_id tostring public static final string bomtype previousspare s set bom type type of bom public void setbom type string bom type if bom type null throw new illegal argument exception bom type is mandatory if bom type equals a bom type equals f bom type equals m bom type equals o bom type equals p bom type equals r bom type equals s else throw new illegal argument exception bom type invalid value bom type reference id 347 a f m o p r s if bom type length 1 log warning length 1 truncated bom type bom type substring 0 0 set value bom type bom type bomtype_previousspare setbomtype bomtype bomtype illegalargumentexception bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype illegalargumentexception bomtype bomtype reference_id bomtype bomtype bomtype set_value bomtype bomtype get bom type type of bom public string getbom type return string get value bom type getbomtype get_value bomtype public static final string bomuse planning p set bom use the use of the bill of material public void setbom use string bom use if bom use null throw new illegal argument exception bom use is mandatory if bom use equals a bom use equals e bom use equals m bom use equals p else throw new illegal argument exception bom use invalid value bom use reference id 348 a e m p if bom use length 1 log warning length 1 truncated bom use bom use substring 0 0 set value bom use bom use bomuse_planning setbomuse bomuse bomuse illegalargumentexception bomuse bomuse bomuse bomuse bomuse illegalargumentexception bomuse bomuse reference_id bomuse bomuse bomuse set_value bomuse bomuse get bom use the use of the bill of material public string getbom use return string get value bom use getbomuse get_value bomuse set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set bom bill of material public void setm bom id int m bom id if m bom id 1 throw new illegal argument exception m bom id is mandatory set valuenocheck m bom id new integer m bom id setm_bom_id m_bom_id m_bom_id illegalargumentexception m_bom_id set_valuenocheck m_bom_id m_bom_id get bom bill of material public int getm bom id integer ii integer get value m bom id if ii null return 0 return ii int value getm_bom_id get_value m_bom_id intvalue set change notice bill of materials engineering change notice version public void setm changenotice id int m changenotice id if m changenotice id 0 set value m changenotice id null else set value m changenotice id new integer m changenotice id setm_changenotice_id m_changenotice_id m_changenotice_id set_value m_changenotice_id set_value m_changenotice_id m_changenotice_id get change notice bill of materials engineering change notice version public int getm changenotice id integer ii integer get value m changenotice id if ii null return 0 return ii int value getm_changenotice_id get_value m_changenotice_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x m pricelist version properties ctx int m pricelist version id string trx name super ctx m pricelist version id trx name if m pricelist version id 0 setm discountschema id 0 setm pricelist id 0 setm pricelist version id 0 set name null date set valid from new timestamp system current time millis date x_m_pricelist_version m_pricelist_version_id trxname m_pricelist_version_id trxname m_pricelist_version_id setm_discountschema_id setm_pricelist_id setm_pricelist_version_id setname setvalidfrom currenttimemillis load constructor public x m pricelist version properties ctx result set rs string trx name super ctx rs trx name x_m_pricelist_version resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m pricelist version append get id append return sb to string tostring stringbuffer stringbuffer x_m_pricelist_version get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 1 throw new illegal argument exception m discountschema id is mandatory set value m discountschema id new integer m discountschema id setm_discountschema_id m_discountschema_id m_discountschema_id illegalargumentexception m_discountschema_id set_value m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set valuenocheck m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_valuenocheck m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set price list version identifies a unique instance of a price list public void setm pricelist version id int m pricelist version id if m pricelist version id 1 throw new illegal argument exception m pricelist version id is mandatory set valuenocheck m pricelist version id new integer m pricelist version id setm_pricelist_version_id m_pricelist_version_id m_pricelist_version_id illegalargumentexception m_pricelist_version_id set_valuenocheck m_pricelist_version_id m_pricelist_version_id get price list version identifies a unique instance of a price list public int getm pricelist version id integer ii integer get value m pricelist version id if ii null return 0 return ii int value getm_pricelist_version_id get_value m_pricelist_version_id intvalue public static final int m pricelist version base id ad reference id 188 set base price list source for price list calculations public void setm pricelist version base id int m pricelist version base id if m pricelist version base id 0 set value m pricelist version base id null else set value m pricelist version base id new integer m pricelist version base id m_pricelist_version_base_id_ad_reference_id setm_pricelist_version_base_id m_pricelist_version_base_id m_pricelist_version_base_id set_value m_pricelist_version_base_id set_value m_pricelist_version_base_id m_pricelist_version_base_id get base price list source for price list calculations public int getm pricelist version base id integer ii integer get value m pricelist version base id if ii null return 0 return ii int value getm_pricelist_version_base_id get_value m_pricelist_version_base_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set create public void set proc create string proc create if proc create null proc create length 1 log warning length 1 truncated proc create proc create substring 0 0 set value proc create proc create setproccreate proccreate proccreate proccreate proccreate proccreate set_value proccreate proccreate get create public string get proc create return string get value proc create getproccreate get_value proccreate set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom standard constructor public x c landedcostallocation properties ctx int c landedcostallocation id string trx name super ctx c landedcostallocation id trx name if c landedcostallocation id 0 set amt env zero set base env zero setc invoiceline id 0 setc landedcostallocation id 0 setm costelement id 0 setm product id 0 set qty env zero x_c_landedcostallocation c_landedcostallocation_id trxname c_landedcostallocation_id trxname c_landedcostallocation_id setamt setbase setc_invoiceline_id setc_landedcostallocation_id setm_costelement_id setm_product_id setqty load constructor public x c landedcostallocation properties ctx result set rs string trx name super ctx rs trx name x_c_landedcostallocation resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c landedcostallocation append get id append return sb to string tostring stringbuffer stringbuffer x_c_landedcostallocation get_id tostring set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set base calculation base public void set base big decimal base if base null throw new illegal argument exception base is mandatory set value base base setbase bigdecimal illegalargumentexception set_value get base calculation base public big decimal get base big decimal bd big decimal get value base if bd null return env zero return bd bigdecimal getbase bigdecimal bigdecimal get_value set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 1 throw new illegal argument exception c invoiceline id is mandatory set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id illegalargumentexception c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoiceline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoiceline_id set landed cost allocation allocation for land costs public void setc landedcostallocation id int c landedcostallocation id if c landedcostallocation id 1 throw new illegal argument exception c landedcostallocation id is mandatory set valuenocheck c landedcostallocation id new integer c landedcostallocation id setc_landedcostallocation_id c_landedcostallocation_id c_landedcostallocation_id illegalargumentexception c_landedcostallocation_id set_valuenocheck c_landedcostallocation_id c_landedcostallocation_id get landed cost allocation allocation for land costs public int getc landedcostallocation id integer ii integer get value c landedcostallocation id if ii null return 0 return ii int value getc_landedcostallocation_id get_value c_landedcostallocation_id intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 set valuenocheck m attributesetinstance id null else set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 1 throw new illegal argument exception m costelement id is mandatory set value m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id illegalargumentexception m_costelement_id set_value m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value returns true if numeric id table search account stored as integer param display type display type return true if id public static boolean isid int display type if display type id display type table display type table dir display type search display type location display type locator display type account display type assignment display type p attribute return true return false displaytype displaytype displaytype displaytype displaytype tabledir displaytype displaytype displaytype displaytype displaytype displaytype pattribute returns true if display type is numeric amount number quantity integer stored as big decimal param display type display type return true if numeric public static boolean is numeric int display type if display type amount display type number display type cost price display type integer display type quantity return true return false displaytype bigdecimal displaytype isnumeric displaytype displaytype displaytype displaytype costprice displaytype displaytype get default precision used for databases who cannot handle dynamic number precision param display type display type return scale decimal precision public static int get default precision int display type if display type amount return 2 if display type number return 6 if display type cost price display type quantity return 4 return 0 displaytype getdefaultprecision displaytype displaytype displaytype displaytype costprice displaytype returns true if display type is text string text text long memo param display type display type return true if text public static boolean is text int display type if display type string display type text display type text long display type memo display type yes no globalqss patch to avoid error column y does not exist in column sync return true return false displaytype textlong displaytype istext displaytype displaytype displaytype displaytype textlong displaytype displaytype yesno columnsync returns truem if display type is a date stored as timestamp param display type display type return true if date public static boolean is date int display type if display type date display type date time display type time return true return false displaytype displaytype isdate displaytype displaytype displaytype datetime displaytype returns true if display type is a v lookup list table table dir search stored as integer param display type display type return true if lookup public static boolean is lookup int display type if display type list display type table display type table dir display type search return true return false displaytype vlookup tabledir displaytype islookup displaytype displaytype displaytype displaytype tabledir displaytype returns true if display type is a large object param display type display type return true if lob public static boolean islob int display type if display type binary display type text long display type image return true return false displaytype displaytype displaytype displaytype displaytype textlong displaytype return format for numeric display type param display type display type default number param language language return number format public static decimal format get number format int display type language language language my language language if my language null my language language get login language locale locale my language get locale decimal format format null if locale null format decimal format number format get number instance locale else format decimal format number format get number instance locale us if display type integer format set parse integer only true format set maximum integer digits integer digits format set maximum fraction digits 0 else if display type quantity format set maximum integer digits max digits format set maximum fraction digits max fraction else if display type amount format set maximum integer digits max digits format set maximum fraction digits amount fraction format set minimum fraction digits amount fraction else if display type cost price format set maximum integer digits max digits format set maximum fraction digits max fraction format set minimum fraction digits amount fraction else if display type number format set maximum integer digits max digits format set maximum fraction digits max fraction format set minimum fraction digits 1 return format displaytype displaytype decimalformat getnumberformat displaytype mylanguage mylanguage mylanguage getloginlanguage mylanguage getlocale decimalformat decimalformat numberformat getnumberinstance decimalformat numberformat getnumberinstance displaytype setparseintegeronly setmaximumintegerdigits integer_digits setmaximumfractiondigits displaytype setmaximumintegerdigits max_digits setmaximumfractiondigits max_fraction displaytype setmaximumintegerdigits max_digits setmaximumfractiondigits amount_fraction setminimumfractiondigits amount_fraction displaytype costprice setmaximumintegerdigits max_digits setmaximumfractiondigits max_fraction setminimumfractiondigits amount_fraction displaytype setmaximumintegerdigits max_digits setmaximumfractiondigits max_fraction setminimumfractiondigits return format for numeric display type param display type display type return number format public static decimal format get number format int display type return get number format display type null displaytype displaytype decimalformat getnumberformat displaytype getnumberformat displaytype return date format return date format public static simple date format get date format return get date format display type date null simpledateformat getdateformat getdateformat displaytype return date format param language language return date format public static simple date format get date format language language return get date format display type date language simpledateformat getdateformat getdateformat displaytype return format for date display type param display type display type return date format public static simple date format get date format int display type return get date format display type null displaytype displaytype simpledateformat getdateformat displaytype getdateformat displaytype return format for date display type param display type display type default date param language language return date format public static simple date format get date format int display type language language language my language language if my language null my language language get login language if display type date time return my language get date time format else if display type time return my language get time format else if display type date return my language get date format default displaytype displaytype simpledateformat getdateformat displaytype mylanguage mylanguage mylanguage getloginlanguage displaytype datetime mylanguage getdatetimeformat displaytype mylanguage gettimeformat displaytype mylanguage getdateformat jdbc date format yyyy mm dd return date format static public simple date format getdateformat jdbc return new simple date format yyyy mm dd simpledateformat getdateformat_jdbc simpledateformat return storage class used for mini table param display type display type param yes no as boolean yes or no as boolean return class integer big decimal timestamp string boolean public static class get class int display type boolean yes no as boolean if display type string display type text display type text long display type list display type memo return string class else if isid display type display type integer note that integer is stored as bd return integer class else if is numeric display type return java math big decimal class else if is date display type return java sql timestamp class else if display type yes no return yes no as boolean boolean class string class else if display type button return string class else if islob display type clob is string return byte class return object class minitable displaytype yesnoasboolean bigdecimal getclass displaytype yesnoasboolean displaytype displaytype displaytype textlong displaytype displaytype displaytype displaytype isnumeric displaytype bigdecimal isdate displaytype displaytype yesno yesnoasboolean displaytype displaytype standard constructor public x c element properties ctx int c element id string trx name super ctx c element id trx name if c element id 0 setad tree id 0 setc element id 0 set element type null a set is balancing false set is natural account false set name null x_c_element c_element_id trxname c_element_id trxname c_element_id setad_tree_id setc_element_id setelementtype setisbalancing setisnaturalaccount setname load constructor public x c element properties ctx result set rs string trx name super ctx rs trx name x_c_element resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c element append get id append return sb to string tostring stringbuffer stringbuffer x_c_element get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set element accounting element public void setc element id int c element id if c element id 1 throw new illegal argument exception c element id is mandatory set valuenocheck c element id new integer c element id setc_element_id c_element_id c_element_id illegalargumentexception c_element_id set_valuenocheck c_element_id c_element_id get element accounting element public int getc element id integer ii integer get value c element id if ii null return 0 return ii int value getc_element_id get_value c_element_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string elementtype userdefined u set type element type account or user defined public void set element type string element type if element type null throw new illegal argument exception element type is mandatory if element type equals a element type equals u else throw new illegal argument exception element type invalid value element type reference id 116 a u if element type length 1 log warning length 1 truncated element type element type substring 0 0 set valuenocheck element type element type elementtype_userdefined setelementtype elementtype elementtype illegalargumentexception elementtype elementtype elementtype illegalargumentexception elementtype elementtype reference_id elementtype elementtype elementtype set_valuenocheck elementtype elementtype get type element type account or user defined public string get element type return string get value element type getelementtype get_value elementtype set balancing all transactions within an element value must balance e g cost centers public void set is balancing boolean is balancing set value is balancing new boolean is balancing setisbalancing isbalancing set_value isbalancing isbalancing get balancing all transactions within an element value must balance e g cost centers public boolean is balancing object oo get value is balancing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbalancing get_value isbalancing booleanvalue set natural account the primary natural account public void set is natural account boolean is natural account set value is natural account new boolean is natural account setisnaturalaccount isnaturalaccount set_value isnaturalaccount isnaturalaccount get natural account the primary natural account public boolean is natural account object oo get value is natural account if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isnaturalaccount get_value isnaturalaccount booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 40 log warning length 40 truncated v format v format substring 0 39 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat standard constructor public x ad userdef win properties ctx int ad userdef win id string trx name super ctx ad userdef win id trx name if ad userdef win id 0 setad language null setad userdef win id 0 setad window id 0 set is default false set is read only false set is user updateable false set name null x_ad_userdef_win ad_userdef_win_id trxname ad_userdef_win_id trxname ad_userdef_win_id setad_language setad_userdef_win_id setad_window_id setisdefault setisreadonly setisuserupdateable setname load constructor public x ad userdef win properties ctx result set rs string trx name super ctx rs trx name x_ad_userdef_win resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad userdef win append get id append return sb to string tostring stringbuffer stringbuffer x_ad_userdef_win get_id tostring public static final int ad language ad reference id 106 set language language for this entity public void setad language string ad language if ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set role responsibility role public void setad role id int ad role id if ad role id 0 set value ad role id null else set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_value ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set user defined window public void setad userdef win id int ad userdef win id if ad userdef win id 1 throw new illegal argument exception ad userdef win id is mandatory set valuenocheck ad userdef win id new integer ad userdef win id setad_userdef_win_id ad_userdef_win_id ad_userdef_win_id illegalargumentexception ad_userdef_win_id set_valuenocheck ad_userdef_win_id ad_userdef_win_id get user defined window public int getad userdef win id integer ii integer get value ad userdef win id if ii null return 0 return ii int value getad_userdef_win_id get_value ad_userdef_win_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 1 throw new illegal argument exception ad window id is mandatory set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id illegalargumentexception ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set user updateable the field can be updated by the user public void set is user updateable boolean is user updateable set value is user updateable new boolean is user updateable setisuserupdateable isuserupdateable set_value isuserupdateable isuserupdateable get user updateable the field can be updated by the user public boolean is user updateable object oo get value is user updateable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isuserupdateable get_value isuserupdateable booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname connection dialog using current connection public c connection dialog this null cconnectiondialog connection dialog param cc compiere connection public c connection dialog c connection cc super frame null true try jb init set connection cc catch exception e log log level severe e compiereplaf show center screen this cconnectiondialog cconnection jbinit setconnection showcenterscreen static layout throws exception private void jb init throws exception this set title res get string c connection dialog main panel set layout main layout south panel set layout south layout south layout set alignment flow layout right center panel set layout center layout name label set text res get string name name field set columns 30 name field set read write false host label set text res get string db host host field set columns 30 port label set text res get string db port db port field set columns 10 sid label set text res get string db name cb firewall set tool tip text cb firewall set text res get string via firewall fw host label set text res get string fw host fw host field set columns 30 fw port label set text res get string fw port b testdb set text res get string test connection b testdb set horizontal alignment j label left db type label set text res get string type sid field set columns 30 fw port field set columns 10 cb bequeath set text res get string bequeath connection apps host label set text res get string apps host apps host field set columns 30 apps port label set text res get string apps port apps port field set columns 10 b test apps set text res get string test apps b test apps set horizontal alignment j label left cb overwrite set text res get string overwrite db uid label set text res get string db uid pwd db uid field set columns 10 connection profile label set text res get string connection profile connection profile field add action listener this this get content pane add main panel border layout center main panel add center panel border layout center main panel add south panel border layout south south panel add b cancel null south panel add bok null center panel add name label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 12 5 5 0 0 center panel add name field new grid bag constraints 1 0 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 12 0 0 center panel add apps host label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 center panel add apps host field new grid bag constraints 1 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 center panel add apps port label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add apps port field new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 0 0 0 0 center panel add connection profile label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 center panel add connection profile field new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 0 0 0 0 center panel add b test apps new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints southwest grid bag constraints horizontal new insets 5 0 12 0 0 0 center panel add cb overwrite new grid bag constraints 2 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints vertical new insets 0 5 0 12 0 0 db center panel add db type label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 center panel add db type field new grid bag constraints 1 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 center panel add cb bequeath new grid bag constraints 2 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 12 0 0 center panel add host label new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 center panel add host field new grid bag constraints 1 6 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 center panel add port label new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add db port field new grid bag constraints 1 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 center panel add sid label new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add sid field new grid bag constraints 1 8 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add db uid label new grid bag constraints 0 9 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add db uid field new grid bag constraints 1 9 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 center panel add db pwd field new grid bag constraints 2 9 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 5 5 12 0 0 center panel add cb firewall new grid bag constraints 1 10 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 12 0 0 center panel add fw host label new grid bag constraints 0 11 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add fw host field new grid bag constraints 1 11 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add fw port label new grid bag constraints 0 12 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add fw port field new grid bag constraints 1 12 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 center panel add b testdb new grid bag constraints 1 13 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 12 0 0 0 name field add action listener this apps host field add action listener this apps port field add action listener this cb overwrite add action listener this b test apps add action listener this db type field add action listener this host field add action listener this db port field add action listener this sid field add action listener this cb bequeath add action listener this cb firewall add action listener this fw host field add action listener this fw port field add action listener this b testdb add action listener this bok add action listener this b cancel add action listener this server if ini is client apps host label set visible false apps host field set visible false apps port label set visible false apps port field set visible false b test apps set visible false connection profile label set visible false connection profile field set visible false else client cb bequeath set visible false jbinit settitle getstring cconnectiondialog mainpanel setlayout mainlayout southpanel setlayout southlayout southlayout setalignment flowlayout centerpanel setlayout centerlayout namelabel settext getstring namefield setcolumns namefield setreadwrite hostlabel settext getstring dbhost hostfield setcolumns portlabel settext getstring dbport dbportfield setcolumns sidlabel settext getstring dbname cbfirewall settooltiptext cbfirewall settext getstring viafirewall fwhostlabel settext getstring fwhost fwhostfield setcolumns fwportlabel settext getstring fwport btestdb settext getstring testconnection btestdb sethorizontalalignment jlabel dbtypelabel settext getstring sidfield setcolumns fwportfield setcolumns cbbequeath settext getstring bequeathconnection appshostlabel settext getstring appshost appshostfield setcolumns appsportlabel settext getstring appsport appsportfield setcolumns btestapps settext getstring testapps btestapps sethorizontalalignment jlabel cboverwrite settext getstring dbuidlabel settext getstring dbuidpwd dbuidfield setcolumns connectionprofilelabel settext getstring connectionprofile connectionprofilefield addactionlistener getcontentpane mainpanel borderlayout mainpanel centerpanel borderlayout mainpanel southpanel borderlayout southpanel bcancel southpanel centerpanel namelabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel namefield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel appshostlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel appshostfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel appsportlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel appsportfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel connectionprofilelabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel connectionprofilefield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel btestapps gridbagconstraints gridbagconstraints gridbagconstraints centerpanel cboverwrite gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbtypelabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbtypefield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel cbbequeath gridbagconstraints gridbagconstraints gridbagconstraints centerpanel hostlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel hostfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel portlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbportfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel sidlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel sidfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbuidlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbuidfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel dbpwdfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel cbfirewall gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fwhostlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fwhostfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fwportlabel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fwportfield gridbagconstraints gridbagconstraints gridbagconstraints centerpanel btestdb gridbagconstraints gridbagconstraints gridbagconstraints namefield addactionlistener appshostfield addactionlistener appsportfield addactionlistener cboverwrite addactionlistener btestapps addactionlistener dbtypefield addactionlistener hostfield addactionlistener dbportfield addactionlistener sidfield addactionlistener cbbequeath addactionlistener cbfirewall addactionlistener fwhostfield addactionlistener fwportfield addactionlistener btestdb addactionlistener addactionlistener bcancel addactionlistener isclient appshostlabel setvisible appshostfield setvisible appsportlabel setvisible appsportfield setvisible btestapps setvisible connectionprofilelabel setvisible connectionprofilefield setvisible cbbequeath setvisible set busy lock ui param busy busy private void set busy boolean busy if busy this set cursor cursor get predefined cursor cursor wait cursor else this set cursor cursor get default cursor m updating busy setbusy setcursor getpredefinedcursor wait_cursor setcursor getdefaultcursor m_updating set connection param cc if null use current connection public void set connection c connection cc m cc cc if m cc null m cc c connection get m cc set name should copy values m ccresult m cc string type m cc get type if type null type length 0 db type field set selected item null else m cc set type m cc get type sets defaults update info setconnection cconnection m_cc m_cc m_cc cconnection m_cc setname m_ccresult m_cc m_cc gettype dbtypefield setselecteditem m_cc settype m_cc gettype updateinfo get connection return c connection public c connection get connection return m ccresult cconnection cconnection getconnection m_ccresult action listener param e event public void action performed action event e if m updating return object src e get source if src bok m cc set name m ccresult m cc dispose return else if src b cancel m cc set name dispose return else if src connection profile field value name pair pp value name pair connection profile field get selected item m cc set connection profile pp get value if m cc isrm ioverhttp apps port field set text apps port http else apps port field set text apps port jnp return else if src db type field if db type field get selected item null return if ini is client m cc set apps host apps host field get text m cc set apps port apps port field get text else m cc set apps host localhost value name pair pp value name pair connection profile field get selected item m cc set connection profile pp get value m cc set type string db type field get selected item m cc set db host host field get text m cc set db port db port field get text m cc set db name sid field get text m cc set db uid db uid field get text m cc set db pwd string value of db pwd field get password m cc set bequeath cb bequeath is selected m cc set via firewall cb firewall is selected m cc set fw host fw host field get text m cc set fw port fw port field get text if src b test apps cmd testapps database selection changed else if src db type field m cc set type string db type field get selected item db port field set text string value of m cc get db port cb bequeath set selected m cc is bequeath fw port field set text string value of m cc get fw port else if src b testdb cmd testdb name if src name field m cc set name name field get text update info actionlistener actionperformed actionevent m_updating getsource m_cc setname m_ccresult m_cc bcancel m_cc setname connectionprofilefield valuenamepair valuenamepair connectionprofilefield getselecteditem m_cc setconnectionprofile getvalue m_cc isrmioverhttp appsportfield settext apps_port_http appsportfield settext apps_port_jnp dbtypefield dbtypefield getselecteditem isclient m_cc setappshost appshostfield gettext m_cc setappsport appsportfield gettext m_cc setappshost valuenamepair valuenamepair connectionprofilefield getselecteditem m_cc setconnectionprofile getvalue m_cc settype dbtypefield getselecteditem m_cc setdbhost hostfield gettext m_cc setdbport dbportfield gettext m_cc setdbname sidfield gettext m_cc setdbuid dbuidfield gettext m_cc setdbpwd valueof dbpwdfield getpassword m_cc setbequeath cbbequeath isselected m_cc setviafirewall cbfirewall isselected m_cc setfwhost fwhostfield gettext m_cc setfwport fwportfield gettext btestapps cmd_testapps dbtypefield m_cc settype dbtypefield getselecteditem dbportfield settext valueof m_cc getdbport cbbequeath setselected m_cc isbequeath fwportfield settext valueof m_cc getfwport btestdb cmd_testdb namefield m_cc setname namefield gettext updateinfo update fields from connection private void update info m updating true name field set text m cc get name apps host field set text m cc get apps host apps port field set text string value of m cc get apps port string cp m cc get connection profile value name pair cppp null for int i 0 i c connection connection profiles length i if cp equals c connection connection profiles i get value cppp c connection connection profiles i break if cppp null lan cppp c connection connection profiles 0 connection profile field set selected item cppp b test apps set icon get status icon m cc is apps serverok false b test apps set tool tip text m cc get rmi uri cb overwrite set visible m cc is apps serverok false boolean rw cb overwrite is selected m cc is apps serverok false db type label set read write rw db type field set read write rw db type field set selected item m cc get type host label set read write rw host field set read write rw host field set text m cc get db host port label set read write rw db port field set read write rw db port field set text string value of m cc get db port sid label set read write rw sid field set read write rw sid field set text m cc get db name db uid label set read write rw db uid field set read write rw db uid field set text m cc get db uid db pwd field set editable rw db pwd field set text m cc get db pwd cb bequeath set read write rw cb bequeath set enabled m cc is oracle cb bequeath set selected m cc is bequeath boolean fw enabled rw m cc is via firewall m cc is oracle cb firewall set read write rw m cc is oracle cb firewall set selected m cc is via firewall fw host label set read write fw enabled fw host field set read write fw enabled fw host field set text m cc get fw host fw port label set read write fw enabled fw port field set read write fw enabled fw port field set text string value of m cc get fw port b testdb set tool tip text m cc get connectionurl b testdb set icon get status icon m cc is databaseok m updating false updateinfo m_updating namefield settext m_cc getname appshostfield settext m_cc getappshost appsportfield settext valueof m_cc getappsport m_cc getconnectionprofile valuenamepair cconnection connectionprofiles cconnection connectionprofiles getvalue cconnection connectionprofiles cconnection connectionprofiles connectionprofilefield setselecteditem btestapps seticon getstatusicon m_cc isappsserverok btestapps settooltiptext m_cc getrmiuri cboverwrite setvisible m_cc isappsserverok cboverwrite isselected m_cc isappsserverok dbtypelabel setreadwrite dbtypefield setreadwrite dbtypefield setselecteditem m_cc gettype hostlabel setreadwrite hostfield setreadwrite hostfield settext m_cc getdbhost portlabel setreadwrite dbportfield setreadwrite dbportfield settext valueof m_cc getdbport sidlabel setreadwrite sidfield setreadwrite sidfield settext m_cc getdbname dbuidlabel setreadwrite dbuidfield setreadwrite dbuidfield settext m_cc getdbuid dbpwdfield seteditable dbpwdfield settext m_cc getdbpwd cbbequeath setreadwrite cbbequeath setenabled m_cc isoracle cbbequeath setselected m_cc isbequeath fwenabled m_cc isviafirewall m_cc isoracle cbfirewall setreadwrite m_cc isoracle cbfirewall setselected m_cc isviafirewall fwhostlabel setreadwrite fwenabled fwhostfield setreadwrite fwenabled fwhostfield settext m_cc getfwhost fwportlabel setreadwrite fwenabled fwportfield setreadwrite fwenabled fwportfield settext valueof m_cc getfwport btestdb settooltiptext m_cc getconnectionurl btestdb seticon getstatusicon m_cc isdatabaseok m_updating get status icon ok or not param ok ok return icon private icon get status icon boolean ok if ok return bok get icon else return b cancel get icon getstatusicon geticon bcancel geticon test database connection private void cmd testdb set busy true exception e m cc test database true if e null j option pane show message dialog this e message res get string connection error m cc get connectionurl j option pane error message set busy false cmd_testdb setbusy m_cc testdatabase joptionpane showmessagedialog getstring connectionerror m_cc getconnectionurl joptionpane error_message setbusy test application connection private void cmd testapps set busy true exception e m cc test apps server if e null j option pane show message dialog this e get localized message res get string server not active m cc get apps host j option pane error message set busy false cmd_testapps setbusy m_cc testappsserver joptionpane showmessagedialog getlocalizedmessage getstring servernotactive m_cc getappshost joptionpane error_message setbusy factory called from a panel param m tab model tab for the trx return j dialog public static v create from create m tab m tab dynamic init preparation int ad table id env get context as int env get ctx m tab get window no basetable id v create from ret value null if ad table id 392 c bankstatement ret value new v create from statement m tab else if ad table id 318 c invoice ret value new v create from invoice m tab else if ad table id 319 m inout ret value new v create from shipment m tab else if ad table id 426 c payselection return null ignore will call process c payselection createfrom else not supported create from log info unsupported ad table id ad table id return null return ret value apanel mtab jdialog vcreatefrom mtab mtab ad_table_id getcontextasint getctx mtab getwindowno basetable_id vcreatefrom retvalue ad_table_id c_bankstatement retvalue vcreatefromstatement mtab ad_table_id c_invoice retvalue vcreatefrominvoice mtab ad_table_id m_inout retvalue vcreatefromshipment mtab ad_table_id c_payselection c_payselection_createfrom createfrom ad_table_id ad_table_id retvalue protected super class constructor param m tab m tab v create from m tab m tab super env get window m tab get window no true log info m tab to string p windowno m tab get window no p mtab m tab try if dyn init return jb init confirm panel add action listener this set status status bar set statusdb table changed null p initok true catch exception e log log level severe e p initok false a env position center window env get window p windowno this mtab mtab vcreatefrom mtab mtab getwindow mtab getwindowno mtab tostring p_windowno mtab getwindowno p_mtab mtab dyninit jbinit confirmpanel addactionlistener statusbar setstatusdb tablechanged p_initok p_initok aenv positioncenterwindow getwindow p_windowno static init pre parameter panel parameter bank panel parameter std panel b partner order invoice shopment licator label field data pane south panel confirm panel status bar pre throws exception private void jb init throws exception parameter panel set layout parameter layout parameter std panel set layout parameter std layout parameter bank panel set layout parameter bank layout bank account label set text msg translate env get ctx c bankaccount id b partner label set text msg get element env get ctx c bpartner id order label set text msg get element env get ctx c order id false invoice label set text msg get element env get ctx c invoice id false shipment label set text msg get element env get ctx m inout id false locator label set text msg translate env get ctx m locator id this get content pane add parameter panel border layout north parameter panel add parameter bank panel border layout north parameter bank panel add bank account label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 if bank account field null parameter bank panel add bank account field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 parameter panel add parameter std panel border layout center parameter std panel add b partner label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 if b partner field null parameter std panel add b partner field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 parameter std panel add order label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter std panel add order field new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 parameter std panel add invoice label new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter std panel add invoice field new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 parameter std panel add shipment label new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter std panel add shipment field new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 parameter std panel add locator label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter std panel add locator field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 5 0 0 this get content pane add data pane border layout center data pane get viewport add data table null this get content pane add south panel border layout south south panel set layout south layout south panel add confirm panel border layout center south panel add status bar border layout south parameterpanel parameterbankpanel parameterstdpanel bpartner datapane southpanel confirmpanel statusbar jbinit parameterpanel setlayout parameterlayout parameterstdpanel setlayout parameterstdlayout parameterbankpanel setlayout parameterbanklayout bankaccountlabel settext getctx c_bankaccount_id bpartnerlabel settext getelement getctx c_bpartner_id orderlabel settext getelement getctx c_order_id invoicelabel settext getelement getctx c_invoice_id shipmentlabel settext getelement getctx m_inout_id locatorlabel settext getctx m_locator_id getcontentpane parameterpanel borderlayout parameterpanel parameterbankpanel borderlayout parameterbankpanel bankaccountlabel gridbagconstraints gridbagconstraints gridbagconstraints bankaccountfield parameterbankpanel bankaccountfield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel parameterstdpanel borderlayout parameterstdpanel bpartnerlabel gridbagconstraints gridbagconstraints gridbagconstraints bpartnerfield parameterstdpanel bpartnerfield gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel orderlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel orderfield gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel invoicelabel gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel invoicefield gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel shipmentlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel shipmentfield gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel locatorlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterstdpanel locatorfield gridbagconstraints gridbagconstraints gridbagconstraints getcontentpane datapane borderlayout datapane getviewport datatable getcontentpane southpanel borderlayout southpanel setlayout southlayout southpanel confirmpanel borderlayout southpanel statusbar borderlayout init ok to be able to make changes return on if initialized public boolean is initok return p initok isinitok p_initok dynamic init throws exception if lookups cannot be initialized return true if initialized init business partner details param c bpartner id b partner c_bpartner_id bpartner abstract void initbp details int c bpartner id add info abstract void info initbpdetails c_bpartner_id save insert data return true if saved action listener param e event public void action performed action event e log config action e get action command if m action return m action true ok save if e get action command equals confirm panel a ok if save dispose cancel else if e get action command equals confirm panel a cancel dispose m action false actionperformed actionevent getactioncommand m_action m_action getactioncommand confirmpanel a_ok getactioncommand confirmpanel a_cancel m_action table model listener param e event public void table changed table model event e int type 1 if e null type e get type if type table model event update return log config type type info tablechanged tablemodelevent gettype tablemodelevent load b partner field param for invoice true if invoices are to be created false receipts throws exception if lookups cannot be initialized protected void initb partner boolean for invoice throws exception load b partner int ad column id 3499 c invoice c bpartner id m lookup lookup m lookup factory get env get ctx p windowno 0 ad column id display type search b partner field new v lookup c bpartner id true false true lookup int c bpartner id env get context as int env get ctx p windowno c bpartner id b partner field set value new integer c bpartner id initial loading initb partnerois c bpartner id for invoice bpartner forinvoice initbpartner forinvoice bpartner ad_column_id c_invoice c_bpartner_id mlookup mlookupfactory getctx p_windowno ad_column_id displaytype bpartnerfield vlookup c_bpartner_id c_bpartner_id getcontextasint getctx p_windowno c_bpartner_id bpartnerfield setvalue c_bpartner_id initbpartnerois c_bpartner_id forinvoice load p bartner dependent order invoice shipment field param c bpartner id b partner param for invoice for invoice protected void initb partnerois int c bpartner id boolean for invoice log config c bpartner id c bpartner id key name pair pp new key name pair 0 load po orders closed completed order field remove action listener this order field remove all items order field add item pp display string buffer display new string buffer o document no append db to char o date ordered display type date env getad language env get ctx append append db to char o grand total display type amount env getad language env get ctx string column m m inoutline id if for invoice column m c invoiceline id string buffer sql new string buffer select o c order id append display append from c order o where o c bpartner id and o isso trx n and o doc status in cl co and o c order id in select ol c order id from c orderline ol left outer join m matchpo m on ol c orderline id m c orderline id group by ol c order id ol c orderline id ol qty ordered append column append having ol qty ordered sum m qty and append column append is not null or append column append is null order by o date ordered try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 order field add item pp rs close pstmt close catch sql exception e log log level severe sql to string e order field set selected index 0 order field add action listener this initbp details c bpartner id pbartner c_bpartner_id bpartner forinvoice initbpartnerois c_bpartner_id forinvoice c_bpartner_id c_bpartner_id keynamepair keynamepair orderfield removeactionlistener orderfield removeallitems orderfield additem stringbuffer stringbuffer documentno to_char dateordered displaytype getad_language getctx to_char grandtotal displaytype getad_language getctx m_inoutline_id forinvoice c_invoiceline_id stringbuffer stringbuffer c_order_id c_order c_bpartner_id issotrx docstatus c_order_id c_order_id c_orderline m_matchpo c_orderline_id c_orderline_id c_order_id c_orderline_id qtyordered qtyordered dateordered preparedstatement preparestatement tostring setint c_bpartner_id resultset executequery keynamepair getint getstring orderfield additem sqlexception tostring orderfield setselectedindex orderfield addactionlistener initbpdetails c_bpartner_id load data order param c order id order param for invoice true if for invoice vs delivery qty protected void load order int c order id boolean for invoice selected 0 qty 1 c uom id 2 m product id 3 order line 4 shipment line 5 invoice line 6 log config c order id c order id p order new m order env get ctx c order id null save vector vector data new vector vector string buffer sql new string buffer select l qty ordered sum coalesce m qty 0 1 case when l qty ordered 0 then 0 else l qty entered l qty ordered end 2 l c uom id coalesce uom uom symbol uom name 3 4 coalesce l m product id 0 coalesce p name c name 5 6 l c orderline id l line 7 8 from c orderline l left outer join m matchpo m on l c orderline id m c orderline id and sql append for invoice m c invoiceline id m m inoutline id sql append is not null append left outer join m product p on l m product id p m product id left outer join c charge c on l c charge id c c charge id if env is base language env get ctx c uom sql append left outer join c uom uom on l c uom id uom c uom id else sql append left outer join c uom trl uom on l c uom id uom c uom id and uom ad language append env getad language env get ctx append sql append where l c order id 1 group by l qty ordered case when l qty ordered 0 then 0 else l qty entered l qty ordered end l c uom id coalesce uom uom symbol uom name l m product id coalesce p name c name l line l c orderline id order by l line log finer sql to string try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 c order id result set rs pstmt execute query while rs next vector object line new vector object line add new boolean false 0 selection big decimal qty ordered rs get big decimal 1 big decimal multiplier rs get big decimal 2 big decimal qty entered qty ordered multiply multiplier line add new double qty entered double value 1 qty key name pair pp new key name pair rs get int 3 rs get string 4 trim line add pp 2 uom pp new key name pair rs get int 5 rs get string 6 line add pp 3 product pp new key name pair rs get int 7 rs get string 8 line add pp 4 order line line add null 5 ship line add null 6 invoice data add line rs close pstmt close catch exception e log log level severe sql to string e load tableois data c_order_id forinvoice loadorder c_order_id forinvoice c_uom_id m_product_id orderline shipmentline invoiceline c_order_id c_order_id p_order morder getctx c_order_id stringbuffer stringbuffer qtyordered qtyordered qtyentered qtyordered c_uom_id uomsymbol m_product_id c_orderline_id c_orderline m_matchpo c_orderline_id c_orderline_id forinvoice c_invoiceline_id m_inoutline_id m_product m_product_id m_product_id c_charge c_charge_id c_charge_id isbaselanguage getctx c_uom c_uom c_uom_id c_uom_id c_uom_trl c_uom_id c_uom_id ad_language getad_language getctx c_order_id qtyordered qtyordered qtyentered qtyordered c_uom_id uomsymbol m_product_id c_orderline_id tostring preparedstatement preparestatement tostring setint c_order_id resultset executequery bigdecimal qtyordered getbigdecimal bigdecimal getbigdecimal bigdecimal qtyentered qtyordered qtyentered doublevalue keynamepair keynamepair getint getstring keynamepair getint getstring keynamepair getint getstring orderline tostring loadtableois load order invoice shipment data into table param data data protected void load tableois vector data header info vector string column names new vector string 7 column names add msg get msg env get ctx select column names add msg translate env get ctx quantity column names add msg translate env get ctx c uom id column names add msg translate env get ctx m product id column names add msg get element env get ctx c order id false column names add msg get element env get ctx m inout id false column names add msg get element env get ctx c invoice id false remove previous listeners data table get model remove table model listener this set model default table model model new default table model data column names model add table model listener this data table set model model data table set column class 0 boolean class false 0 selection data table set column class 1 double class true 1 qty data table set column class 2 string class true 2 uom data table set column class 3 string class true 3 product data table set column class 4 string class true 4 order data table set column class 5 string class true 5 ship data table set column class 6 string class true 6 invoice table ui data table auto size loadtableois columnnames columnnames getmsg getctx columnnames getctx columnnames getctx c_uom_id columnnames getctx m_product_id columnnames getelement getctx c_order_id columnnames getelement getctx m_inout_id columnnames getelement getctx c_invoice_id datatable getmodel removetablemodellistener defaulttablemodel defaulttablemodel columnnames addtablemodellistener datatable setmodel datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable autosize prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals include in dispute p includeindispute y equals para i get parameter else if name equals onlyso trx p onlysotrx y equals para i get parameter else if name equals salesrep id p salesrep id para i get parameter as int else if name equals c currency id p c currency id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c bp group id p c bp group id para i get parameter as int else log log level severe unknown parameter name p c dunningrun id getrecord id processinfoparameter getparameter getparametername getparameter includeindispute p_includeindispute getparameter onlysotrx p_onlysotrx getparameter salesrep_id p_salesrep_id getparameterasint c_currency_id p_c_currency_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint c_bp_group_id p_c_bp_group_id getparameterasint p_c_dunningrun_id getrecord_id process return message throws exception protected string do it throws exception log info c dunningrun id p c dunningrun id c bp group id p c bp group id c bpartner id p c bpartner id m run new m dunning run get ctx p c dunningrun id get trxname if m run get id 0 throw new illegal argument exception not found m dunning run if m run delete entries true throw new illegal argument exception cannot delete existing entries if p salesrep id 0 throw new illegal argument exception no sales rep if p c currency id 0 throw new illegal argument exception no currency int inv add invoices int pay add payments return c invoice id inv c payment id pay doit c_dunningrun_id p_c_dunningrun_id c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id m_run mdunningrun getctx p_c_dunningrun_id get_trxname m_run get_id illegalargumentexception mdunningrun m_run deleteentries illegalargumentexception p_salesrep_id illegalargumentexception salesrep p_c_currency_id illegalargumentexception addinvoices addpayments c_invoice_id c_payment_id add invoices to run return no of invoices private int add invoices int count 0 string sql select i c invoice id i c currency id i grand total i multiplierap invoice open i c invoice id i c invoicepayschedule id multiplierap coalesce days between ips due date payment term due days i c paymentterm id i date invoiced 1 2 i is in dispute i c bpartner id from c invoice v i left outer join c invoicepayschedule ips on i c invoicepayschedule id ips c invoicepayschedule id where i is paid n and i ad client id 3 and i doc status in co cl only bp with dunning defined and exists select from c bpartner bp where i c bpartner id bp c bpartner id and bp c dunning id select c dunning id from c dunninglevel where c dunninglevel id 4 if p c bpartner id 0 sql and i c bpartner id 5 else if p c bp group id 0 sql and exists select from c bpartner bp where i c bpartner id bp c bpartner id and bp c bp group id 5 if p onlysotrx sql and i isso trx y log info sql sub query string sql2 select count coalesce trunc sys date max dr dunning date 0 from c dunningrun dr inner join c dunningrunentry dre on dr c dunningrun id dre c dunningrun id inner join c dunningrunline drl on dre c dunningrunentry id drl c dunningrunentry id where drl processed y and drl c invoice id big decimal days after due m run get level get days after due int days between dunning m run get level get days between dunning prepared statement pstmt null prepared statement pstmt2 null try pstmt db prepare statement sql get trxname pstmt set timestamp 1 m run get dunning date pstmt set timestamp 2 m run get dunning date pstmt set int 3 m run getad client id pstmt set int 4 m run getc dunninglevel id if p c bpartner id 0 pstmt set int 5 p c bpartner id else if p c bp group id 0 pstmt set int 5 p c bp group id pstmt2 db prepare statement sql2 get trxname result set rs pstmt execute query while rs next int c invoice id rs get int 1 int c currency id rs get int 2 big decimal grand total rs get big decimal 3 big decimal open rs get big decimal 4 int days due rs get int 5 boolean is in dispute y equals rs get string 6 int c bpartner id rs get int 7 if p includeindispute is in dispute continue if days due days after due int value continue if env zero compare to open 0 continue int times dunned 0 int days after last 0 sub query pstmt2 set int 1 c invoice id result set rs2 pstmt2 execute query if rs2 next times dunned rs2 get int 1 days after last rs2 get int 2 rs2 close sub query if days between dunning 0 days after last days between dunning continue create invoice line c invoice id c currency id grand total open days due is in dispute c bpartner id times dunned days after last count rs close pstmt close pstmt null pstmt2 close pstmt2 null catch exception e log log level severe add invoices e try if pstmt null pstmt close if pstmt2 null pstmt2 close pstmt null pstmt2 null catch exception e pstmt null pstmt2 null return count addinvoices c_invoice_id c_currency_id grandtotal invoiceopen c_invoice_id c_invoicepayschedule_id daysbetween duedate paymenttermduedays c_paymentterm_id dateinvoiced isindispute c_bpartner_id c_invoice_v c_invoicepayschedule c_invoicepayschedule_id c_invoicepayschedule_id ispaid ad_client_id docstatus c_bpartner c_bpartner_id c_bpartner_id c_dunning_id c_dunning_id c_dunninglevel c_dunninglevel_id p_c_bpartner_id c_bpartner_id p_c_bp_group_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_onlysotrx issotrx sysdate dunningdate c_dunningrun c_dunningrunentry c_dunningrun_id c_dunningrun_id c_dunningrunline c_dunningrunentry_id c_dunningrunentry_id c_invoice_id bigdecimal daysafterdue m_run getlevel getdaysafterdue daysbetweendunning m_run getlevel getdaysbetweendunning preparedstatement preparedstatement preparestatement get_trxname settimestamp m_run getdunningdate settimestamp m_run getdunningdate setint m_run getad_client_id setint m_run getc_dunninglevel_id p_c_bpartner_id setint p_c_bpartner_id p_c_bp_group_id setint p_c_bp_group_id preparestatement get_trxname resultset executequery c_invoice_id getint c_currency_id getint bigdecimal grandtotal getbigdecimal bigdecimal getbigdecimal daysdue getint isindispute getstring c_bpartner_id getint p_includeindispute isindispute daysdue daysafterdue intvalue compareto timesdunned daysafterlast subquery setint c_invoice_id resultset executequery timesdunned getint daysafterlast getint subquery daysbetweendunning daysafterlast daysbetweendunning createinvoiceline c_invoice_id c_currency_id grandtotal daysdue isindispute c_bpartner_id timesdunned daysafterlast addinvoices create invoice line param c invoice id param c currency id param grand total param open param days due param is in dispute param c bpartner id param times dunned param days after last private void create invoice line int c invoice id int c currency id big decimal grand total big decimal open int days due boolean is in dispute int c bpartner id int times dunned int days after last m dunning run entry entry m run get entry c bpartner id p c currency id p salesrep id if entry get id 0 if entry save throw new illegal state exception cannot save m dunning run entry m dunning run line line new m dunning run line entry line set invoice c invoice id c currency id grand total open days due is in dispute times dunned days after last if line save throw new illegal state exception cannot save m dunning run line c_invoice_id c_currency_id grandtotal daysdue isindispute c_bpartner_id timesdunned daysafterlast createinvoiceline c_invoice_id c_currency_id bigdecimal grandtotal bigdecimal daysdue isindispute c_bpartner_id timesdunned daysafterlast mdunningrunentry m_run getentry c_bpartner_id p_c_currency_id p_salesrep_id get_id illegalstateexception mdunningrunentry mdunningrunline mdunningrunline setinvoice c_invoice_id c_currency_id grandtotal daysdue isindispute timesdunned daysafterlast illegalstateexception mdunningrunline add payments to run return no of payments private int add payments string sql select c payment id c currency id pay amt payment available c payment id c bpartner id from c payment v p where ad client id 1 and is allocated n and c bpartner id is not null and c charge id is null and doc status in co cl only bp with dunning defined and exists select from c bpartner bp where p c bpartner id bp c bpartner id and bp c dunning id select c dunning id from c dunninglevel where c dunninglevel id 2 if p c bpartner id 0 sql and c bpartner id 3 else if p c bp group id 0 sql and exists select from c bpartner bp where p c bpartner id bp c bpartner id and bp c bp group id 3 if p onlysotrx sql and is receipt y int count 0 prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad client id pstmt set int 2 m run getc dunninglevel id if p c bpartner id 0 pstmt set int 3 p c bpartner id else if p c bp group id 0 pstmt set int 3 p c bp group id if p onlysotrx sql and i isso trx y result set rs pstmt execute query while rs next int c payment id rs get int 1 int c currency id rs get int 2 big decimal pay amt rs get big decimal 3 negate big decimal open amt rs get big decimal 4 negate int c bpartner id rs get int 5 if env zero compare to open amt 0 continue create payment line c payment id c currency id pay amt open amt c bpartner id count rs close pstmt close pstmt null catch exception e log log level severe add payments sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return count addpayments c_payment_id c_currency_id payamt paymentavailable c_payment_id c_bpartner_id c_payment_v ad_client_id isallocated c_bpartner_id c_charge_id docstatus c_bpartner c_bpartner_id c_bpartner_id c_dunning_id c_dunning_id c_dunninglevel c_dunninglevel_id p_c_bpartner_id c_bpartner_id p_c_bp_group_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_onlysotrx isreceipt preparedstatement preparestatement get_trxname setint getad_client_id setint m_run getc_dunninglevel_id p_c_bpartner_id setint p_c_bpartner_id p_c_bp_group_id setint p_c_bp_group_id p_onlysotrx issotrx resultset executequery c_payment_id getint c_currency_id getint bigdecimal payamt getbigdecimal bigdecimal openamt getbigdecimal c_bpartner_id getint compareto openamt createpaymentline c_payment_id c_currency_id payamt openamt c_bpartner_id addpayments create payment line param c payment id param c currency id param pay amt param open amt param c bpartner id private void create payment line int c payment id int c currency id big decimal pay amt big decimal open amt int c bpartner id m dunning run entry entry m run get entry c bpartner id p c currency id p salesrep id if entry get id 0 if entry save throw new illegal state exception cannot save m dunning run entry m dunning run line line new m dunning run line entry line set payment c payment id c currency id pay amt open amt if line save throw new illegal state exception cannot save m dunning run line c_payment_id c_currency_id payamt openamt c_bpartner_id createpaymentline c_payment_id c_currency_id bigdecimal payamt bigdecimal openamt c_bpartner_id mdunningrunentry m_run getentry c_bpartner_id p_c_currency_id p_salesrep_id get_id illegalstateexception mdunningrunentry mdunningrunline mdunningrunline setpayment c_payment_id c_currency_id payamt openamt illegalstateexception mdunningrunline standard constructor param ctx context param s timeexpenseline id id public m time expense line properties ctx int s timeexpenseline id string trx name super ctx s timeexpenseline id trx name if s timeexpenseline id 0 sets timeexpenseline id 0 pk sets timeexpense id 0 parent set qty env one set qty invoiced env zero set qty reimbursed env zero set expense amt env zero set converted amt env zero set price reimbursed env zero set invoice price env zero set price invoiced env zero set date expense new timestamp system current time millis set is invoiced false set is time report false set line 10 set processed false s_timeexpenseline_id mtimeexpenseline s_timeexpenseline_id trxname s_timeexpenseline_id trxname s_timeexpenseline_id sets_timeexpenseline_id sets_timeexpense_id setqty setqtyinvoiced setqtyreimbursed setexpenseamt setconvertedamt setpricereimbursed setinvoiceprice setpriceinvoiced setdateexpense currenttimemillis setisinvoiced setistimereport setline setprocessed load constructor param ctx context param rs result set public m time expense line properties ctx result set rs string trx name super ctx rs trx name mtimeexpenseline resultset trxname trxname get qty invoiced return entered or qty public big decimal get qty invoiced big decimal bd super get qty invoiced if env zero compare to bd 0 return get qty return bd bigdecimal getqtyinvoiced bigdecimal getqtyinvoiced compareto getqty get qty reimbursed return entered or qty public big decimal get qty reimbursed big decimal bd super get qty reimbursed if env zero compare to bd 0 return get qty return bd bigdecimal getqtyreimbursed bigdecimal getqtyreimbursed compareto getqty get price invoiced return entered or invoice price public big decimal get price invoiced big decimal bd super get price invoiced if env zero compare to bd 0 return get invoice price return bd bigdecimal getpriceinvoiced bigdecimal getpriceinvoiced compareto getinvoiceprice get price reimbursed return entered or converted amt public big decimal get price reimbursed big decimal bd super get price reimbursed if env zero compare to bd 0 return get converted amt return bd bigdecimal getpricereimbursed bigdecimal getpricereimbursed compareto getconvertedamt get approval amt return qty converted amt public big decimal get approval amt return get qty multiply get converted amt bigdecimal getapprovalamt getqty getconvertedamt get c currency id of report price list return currency public int getc currency report id if m c currency report id 0 return m c currency report id get it from header m time expense te new m time expense get ctx gets timeexpense id get trxname m c currency report id te getc currency id return m c currency report id c_currency_id getc_currency_report_id m_c_currency_report_id m_c_currency_report_id mtimeexpense mtimeexpense getctx gets_timeexpense_id get_trxname m_c_currency_report_id getc_currency_id m_c_currency_report_id set c currency id of report price list param c currency id currency protected void setc currency report id int c currency id m c currency report id c currency id c_currency_id c_currency_id setc_currency_report_id c_currency_id m_c_currency_report_id c_currency_id before save calculate converted amt param new record new return true protected boolean before save boolean new record calculate converted amount if new record is valuechanged expense amt is valuechanged c currency id if getc currency id getc currency report id set converted amt get expense amt else set converted amt m conversion rate convert get ctx get expense amt getc currency id getc currency report id get date expense 0 getad client id getad org id if is time report set expense amt env zero set converted amt env zero return true newrecord beforesave newrecord newrecord is_valuechanged expenseamt is_valuechanged c_currency_id getc_currency_id getc_currency_report_id setconvertedamt getexpenseamt setconvertedamt mconversionrate getctx getexpenseamt getc_currency_id getc_currency_report_id getdateexpense getad_client_id getad_org_id istimereport setexpenseamt setconvertedamt after save param new record new param success success return success protected boolean after save boolean new record boolean success update header return success newrecord aftersave newrecord updateheader after delete param success success return success protected boolean after delete boolean success update header return success afterdelete updateheader update header set approved amount private void update header string sql update s timeexpense te set approval amt select sum qty converted amt from s timeexpenseline tel where te s timeexpense id tel s timeexpense id where s timeexpense id gets timeexpense id int no db execute update sql get trxname updateheader s_timeexpense approvalamt convertedamt s_timeexpenseline s_timeexpense_id s_timeexpense_id s_timeexpense_id gets_timeexpense_id executeupdate get_trxname get contents return contents public object get contents return contents getcontents invoice batch line date invoiced updates date acct param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string date properties ctx int window no m tab m tab m field m field object value if value null return m tab set value date acct value set document no ctx window no m tab return dateinvoiced dateacct windowno mtab mfield windowno mtab mtab mfield mfield mtab setvalue dateacct setdocumentno windowno mtab invoice batch line b partner c bpartner location id ad user id payment rule c paymentterm id param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string b partner properties ctx int window no m tab m tab m field m field object value integer c bpartner id integer value if c bpartner id null c bpartner id int value 0 return string sql select p ad language p c paymentterm id coalesce p m pricelist id g m pricelist id as m pricelist id p payment rule p po reference p so description p is discount printed p so creditlimit p so creditlimit p so creditused as credit available l c bpartner location id c ad user id coalesce p po pricelist id g po pricelist id as po pricelist id p payment rulepo p po paymentterm id from c bpartner p inner join c bp group g on p c bp group id g c bp group id left outer join c bpartner location l on p c bpartner id l c bpartner id and l is bill to y and l is active y left outer join ad user c on p c bpartner id c c bpartner id where p c bpartner id and p is active y 1 boolean isso trx env get context ctx window no isso trx equals y try prepared statement pstmt db prepare statement sql null pstmt set int 1 c bpartner id int value result set rs pstmt execute query if rs next payment rule string s rs get string isso trx payment rule payment rulepo if s null s length 0 if env get context ctx window no doc base type ends with c credits are payment term s p else if isso trx s equals s s equals u no check transfer for so trx s p payment term m tab set value payment rule s payment term integer ii new integer rs get int isso trx c paymentterm id po paymentterm id if rs was null m tab set value c paymentterm id ii location int locid rs get int c bpartner location id overwritten by infobp selection works only if info window was used otherwise creates error uses last value may belong to differnt bp if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string loc env get context ctx env window info env tab info c bpartner location id if loc length 0 locid integer parse int loc if locid 0 m tab set value c bpartner location id null else m tab set value c bpartner location id new integer locid contact overwritten by infobp selection int contid rs get int ad user id if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string cont env get context ctx env window info env tab info ad user id if cont length 0 contid integer parse int cont if contid 0 m tab set value ad user id null else m tab set value ad user id new integer contid credit available if isso trx double credit limit rs get double so creditlimit if credit limit 0 double credit available rs get double credit available if rs was null credit available 0 m tab fire data statuse event credit limit over display type get number format display type amount format credit available false rs close pstmt close catch sql exception e log log level severe sql e return e get localized message set document no ctx window no m tab return tax ctx window no m tab m field value bpartner c_bpartner_location_id ad_user_id paymentrule c_paymentterm_id windowno mtab mfield bpartner windowno mtab mtab mfield mfield c_bpartner_id c_bpartner_id c_bpartner_id intvalue ad_language c_paymentterm_id m_pricelist_id m_pricelist_id m_pricelist_id paymentrule poreference so_description isdiscountprinted so_creditlimit so_creditlimit so_creditused creditavailable c_bpartner_location_id ad_user_id po_pricelist_id po_pricelist_id po_pricelist_id paymentrulepo po_paymentterm_id c_bpartner c_bp_group c_bp_group_id c_bp_group_id c_bpartner_location c_bpartner_id c_bpartner_id isbillto isactive ad_user c_bpartner_id c_bpartner_id c_bpartner_id isactive issotrx getcontext windowno issotrx preparedstatement preparestatement setint c_bpartner_id intvalue resultset executequery paymentrule getstring issotrx paymentrule paymentrulepo getcontext windowno docbasetype endswith issotrx so_trx mtab setvalue paymentrule getint issotrx c_paymentterm_id po_paymentterm_id wasnull mtab setvalue c_paymentterm_id getint c_bpartner_location_id infowindow c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info c_bpartner_location_id parseint mtab setvalue c_bpartner_location_id mtab setvalue c_bpartner_location_id getint ad_user_id c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info ad_user_id parseint mtab setvalue ad_user_id mtab setvalue ad_user_id creditavailable issotrx creditlimit getdouble so_creditlimit creditlimit creditavailable getdouble creditavailable wasnull creditavailable mtab firedatastatuseevent creditlimitover displaytype getnumberformat displaytype creditavailable sqlexception getlocalizedmessage setdocumentno windowno mtab windowno mtab mfield document type called from doc type param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string doc type properties ctx int window no m tab m tab m field m field object value set document no ctx window no m tab return doctype windowno mtab mfield doctype windowno mtab mtab mfield mfield setdocumentno windowno mtab set document no increase existing param ctx context param window no current window no param m tab model tab private void set document no properties ctx int window no m tab m tab get last line int c invoicebatch id env get context as int ctx window no c invoicebatch id string sql select coalesce max c invoicebatchline id 0 from c invoicebatchline where c invoicebatch id int c invoicebatchline id db getsql value null sql c invoicebatch id if c invoicebatchline id 0 return m invoice batch line last new m invoice batch line env get ctx c invoicebatchline id null need to increase when different doc type or bp int c doctype id env get context as int ctx window no c doctype id int c bpartner id env get context as int ctx window no c bpartner id if c doctype id last getc doctype id c bpartner id last getc bpartner id return new number string old doc no last get document no if old doc no null return int doc no 0 try doc no integer parse int old doc no catch exception e if doc no 0 return string new doc no string value of doc no 1 m tab set value document no new doc no windowno mtab setdocumentno windowno mtab mtab c_invoicebatch_id getcontextasint windowno c_invoicebatch_id c_invoicebatchline_id c_invoicebatchline c_invoicebatch_id c_invoicebatchline_id getsqlvalue c_invoicebatch_id c_invoicebatchline_id minvoicebatchline minvoicebatchline getctx c_invoicebatchline_id doctype c_doctype_id getcontextasint windowno c_doctype_id c_bpartner_id getcontextasint windowno c_bpartner_id c_doctype_id getc_doctype_id c_bpartner_id getc_bpartner_id olddocno getdocumentno olddocno docno docno parseint olddocno docno newdocno valueof docno mtab setvalue documentno newdocno invoice batch line charge updates price entered from charge calles tax param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string charge properties ctx int window no m tab m tab m field m field object value integer c charge id integer value if c charge id null c charge id int value 0 return string sql select charge amt from c charge where c charge id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c charge id int value result set rs pstmt execute query if rs next m tab set value price entered rs get big decimal 1 rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return tax ctx window no m tab m field value priceentered windowno mtab mfield windowno mtab mtab mfield mfield c_charge_id c_charge_id c_charge_id intvalue chargeamt c_charge c_charge_id preparedstatement preparestatement setint c_charge_id intvalue resultset executequery mtab setvalue priceentered getbigdecimal sqlexception getlocalizedmessage windowno mtab mfield invoice line tax basis charge b partner location sets c tax id calles amount param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string tax properties ctx int window no m tab m tab m field m field object value string column m field get column name if value null return int c charge id 0 if column equals c charge id c charge id integer value int value else c charge id env get context as int ctx window no c charge id log fine c charge id c charge id if c charge id 0 return amt ctx window no m tab m field value check partner location int c bpartner location id env get context as int ctx window no c bpartner location id if c bpartner location id 0 return amt ctx window no m tab m field value log fine bp location c bpartner location id dates timestamp bill date env get context as date ctx window no date invoiced log fine bill date bill date timestamp ship date bill date log fine ship date ship date int ad org id env get context as int ctx window no ad org id log fine org ad org id int m warehouse id env get context as int ctx m warehouse id log fine warehouse m warehouse id int c tax id tax get ctx 0 c charge id bill date ship date ad org id m warehouse id c bpartner location id c bpartner location id env get context ctx window no isso trx equals y log info tax id c tax id if c tax id 0 m tab fire data statuse event c logger retrieve error else m tab set value c tax id new integer c tax id return amt ctx window no m tab m field value bpartner c_tax_id windowno mtab mfield windowno mtab mtab mfield mfield mfield getcolumnname c_charge_id c_charge_id c_charge_id intvalue c_charge_id getcontextasint windowno c_charge_id c_charge_id c_charge_id c_charge_id windowno mtab mfield c_bpartner_location_id getcontextasint windowno c_bpartner_location_id c_bpartner_location_id windowno mtab mfield bp_location c_bpartner_location_id billdate getcontextasdate windowno dateinvoiced billdate shipdate billdate shipdate ad_org_id getcontextasint windowno ad_org_id ad_org_id m_warehouse_id getcontextasint m_warehouse_id m_warehouse_id c_tax_id c_charge_id billdate shipdate ad_org_id m_warehouse_id c_bpartner_location_id c_bpartner_location_id getcontext windowno issotrx c_tax_id c_tax_id mtab firedatastatuseevent clogger retrieveerror mtab setvalue c_tax_id c_tax_id windowno mtab mfield invoice amount called from qty entered price entered calculates line net amt param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string amt properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true int std precision 2 temporary get values big decimal qty entered big decimal m tab get value qty entered big decimal price entered big decimal m tab get value price entered log fine qty entered qty entered price entered price entered if qty entered null qty entered env zero if price entered null price entered env zero line net amt big decimal line net amt qty entered multiply price entered if line net amt scale std precision line net amt line net amt set scale std precision big decimal round half up calculate tax amount boolean isso trx y equals env get context env get ctx window no isso trx boolean is tax included y equals env get context env get ctx window no is tax included big decimal tax amt null if m field get column name equals tax amt tax amt big decimal m tab get value tax amt else integer taxid integer m tab get value c tax id if taxid null int c tax id taxid int value m tax tax new m tax ctx c tax id null tax amt tax calculate tax line net amt is tax included std precision m tab set value tax amt tax amt if is tax included m tab set value line total amt line net amt m tab set value line net amt line net amt subtract tax amt else m tab set value line net amt line net amt m tab set value line total amt line net amt add tax amt set callout active false return qtyentered priceentered linenetamt windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive stdprecision bigdecimal qtyentered bigdecimal mtab getvalue qtyentered bigdecimal priceentered bigdecimal mtab getvalue priceentered qtyentered qtyentered priceentered priceentered qtyentered qtyentered priceentered priceentered bigdecimal linenetamt qtyentered priceentered linenetamt stdprecision linenetamt linenetamt setscale stdprecision bigdecimal round_half_up issotrx getcontext getctx windowno issotrx istaxincluded getcontext getctx windowno istaxincluded bigdecimal taxamt mfield getcolumnname taxamt taxamt bigdecimal mtab getvalue taxamt mtab getvalue c_tax_id c_tax_id intvalue mtax mtax c_tax_id taxamt calculatetax linenetamt istaxincluded stdprecision mtab setvalue taxamt taxamt istaxincluded mtab setvalue linetotalamt linenetamt mtab setvalue linenetamt linenetamt taxamt mtab setvalue linenetamt linenetamt mtab setvalue linetotalamt linenetamt taxamt setcalloutactive standard constructor public x t distributionrundetail properties ctx int t distributionrundetail id string trx name super ctx t distributionrundetail id trx name if t distributionrundetail id 0 setc bpartner id 0 setc bpartner location id 0 setm distributionlistline id 0 setm distributionlist id 0 setm distributionrunline id 0 setm distributionrun id 0 setm product id 0 set min qty env zero set qty env zero set ratio env zero x_t_distributionrundetail t_distributionrundetail_id trxname t_distributionrundetail_id trxname t_distributionrundetail_id setc_bpartner_id setc_bpartner_location_id setm_distributionlistline_id setm_distributionlist_id setm_distributionrunline_id setm_distributionrun_id setm_product_id setminqty setqty setratio load constructor public x t distributionrundetail properties ctx result set rs string trx name super ctx rs trx name x_t_distributionrundetail resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t distributionrundetail append get id append return sb to string tostring stringbuffer stringbuffer x_t_distributionrundetail get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set distribution list line distribution list line with business partner and quantity percentage public void setm distributionlistline id int m distributionlistline id if m distributionlistline id 1 throw new illegal argument exception m distributionlistline id is mandatory set valuenocheck m distributionlistline id new integer m distributionlistline id setm_distributionlistline_id m_distributionlistline_id m_distributionlistline_id illegalargumentexception m_distributionlistline_id set_valuenocheck m_distributionlistline_id m_distributionlistline_id get distribution list line distribution list line with business partner and quantity percentage public int getm distributionlistline id integer ii integer get value m distributionlistline id if ii null return 0 return ii int value getm_distributionlistline_id get_value m_distributionlistline_id intvalue set distribution list distribution lists allow to distribute products to a selected list of partners public void setm distributionlist id int m distributionlist id if m distributionlist id 1 throw new illegal argument exception m distributionlist id is mandatory set valuenocheck m distributionlist id new integer m distributionlist id setm_distributionlist_id m_distributionlist_id m_distributionlist_id illegalargumentexception m_distributionlist_id set_valuenocheck m_distributionlist_id m_distributionlist_id get distribution list distribution lists allow to distribute products to a selected list of partners public int getm distributionlist id integer ii integer get value m distributionlist id if ii null return 0 return ii int value getm_distributionlist_id get_value m_distributionlist_id intvalue set distribution run line distribution run lines define distribution list the product and quantiries public void setm distributionrunline id int m distributionrunline id if m distributionrunline id 1 throw new illegal argument exception m distributionrunline id is mandatory set valuenocheck m distributionrunline id new integer m distributionrunline id setm_distributionrunline_id m_distributionrunline_id m_distributionrunline_id illegalargumentexception m_distributionrunline_id set_valuenocheck m_distributionrunline_id m_distributionrunline_id get distribution run line distribution run lines define distribution list the product and quantiries public int getm distributionrunline id integer ii integer get value m distributionrunline id if ii null return 0 return ii int value getm_distributionrunline_id get_value m_distributionrunline_id intvalue set distribution run distribution run create orders to distribute products to a selected list of partners public void setm distributionrun id int m distributionrun id if m distributionrun id 1 throw new illegal argument exception m distributionrun id is mandatory set valuenocheck m distributionrun id new integer m distributionrun id setm_distributionrun_id m_distributionrun_id m_distributionrun_id illegalargumentexception m_distributionrun_id set_valuenocheck m_distributionrun_id m_distributionrun_id get distribution run distribution run create orders to distribute products to a selected list of partners public int getm distributionrun id integer ii integer get value m distributionrun id if ii null return 0 return ii int value getm_distributionrun_id get_value m_distributionrun_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm distributionrun id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_distributionrun_id set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set minimum quantity minimum quantity for the business partner public void set min qty big decimal min qty if min qty null throw new illegal argument exception min qty is mandatory set value min qty min qty setminqty bigdecimal minqty minqty illegalargumentexception minqty set_value minqty minqty get minimum quantity minimum quantity for the business partner public big decimal get min qty big decimal bd big decimal get value min qty if bd null return env zero return bd bigdecimal getminqty bigdecimal bigdecimal get_value minqty set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set ratio relative ratio for distributions public void set ratio big decimal ratio if ratio null throw new illegal argument exception ratio is mandatory set value ratio ratio setratio bigdecimal illegalargumentexception set_value get ratio relative ratio for distributions public big decimal get ratio big decimal bd big decimal get value ratio if bd null return env zero return bd bigdecimal getratio bigdecimal bigdecimal get_value standard constructor public x ad clientshare properties ctx int ad clientshare id string trx name super ctx ad clientshare id trx name if ad clientshare id 0 setad clientshare id 0 setad table id 0 set name null set share type null x_ad_clientshare ad_clientshare_id trxname ad_clientshare_id trxname ad_clientshare_id setad_clientshare_id setad_table_id setname setsharetype load constructor public x ad clientshare properties ctx result set rs string trx name super ctx rs trx name x_ad_clientshare resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad clientshare append get id append return sb to string tostring stringbuffer stringbuffer x_ad_clientshare get_id tostring set client share force not sharing of client org entities public void setad clientshare id int ad clientshare id if ad clientshare id 1 throw new illegal argument exception ad clientshare id is mandatory set valuenocheck ad clientshare id new integer ad clientshare id setad_clientshare_id ad_clientshare_id ad_clientshare_id illegalargumentexception ad_clientshare_id set_valuenocheck ad_clientshare_id ad_clientshare_id get client share force not sharing of client org entities public int getad clientshare id integer ii integer get value ad clientshare id if ii null return 0 return ii int value getad_clientshare_id get_value ad_clientshare_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string sharetype clientororg x set share type type of sharing public void set share type string share type if share type null throw new illegal argument exception share type is mandatory if share type equals c share type equals o share type equals x else throw new illegal argument exception share type invalid value share type reference id 365 c o x if share type length 1 log warning length 1 truncated share type share type substring 0 0 set value share type share type sharetype_clientororg setsharetype sharetype sharetype illegalargumentexception sharetype sharetype sharetype sharetype illegalargumentexception sharetype sharetype reference_id sharetype sharetype sharetype set_value sharetype sharetype get share type type of sharing public string get share type return string get value share type getsharetype get_value sharetype get balance based on account sign and type acct balance acct balance if an account is specified and found if the account sign is natural it sets it based on account type param p account id account param p amtdr debit param p amtcr credit return cr or dr balance public static big decimal balance int p account id big decimal p amtdr big decimal p amtcr throws sql exception big decimal amt dr p amtdr if amt dr null amt dr compiere zero big decimal amt cr p amtcr if amt cr null amt cr compiere zero big decimal balance amt dr subtract amt cr if p account id 0 string sql select account type account sign from c elementvalue where c elementvalue id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p account id result set rs pstmt execute query if rs next string account type rs get string 1 string account sign rs get string 2 natural account sign d c if account sign equals n if account type equals a account type equals e account sign d else account sign c debit balance if account sign equals c balance amt cr subtract amt dr rs close pstmt close return balance acct_balance acctbalance p_account_id p_amtdr p_amtcr bigdecimal p_account_id bigdecimal p_amtdr bigdecimal p_amtcr sqlexception bigdecimal amtdr p_amtdr amtdr amtdr bigdecimal amtcr p_amtcr amtcr amtcr bigdecimal amtdr amtcr p_account_id accounttype accountsign c_elementvalue c_elementvalue_id preparedstatement preparestatement setint p_account_id resultset executequery accounttype getstring accountsign getstring accountsign accounttype accounttype accountsign accountsign accountsign amtcr amtdr assignment product called from s resourceassignment id sets m product id description qty public string product properties ctx int window no m tab m tab m field m field object value if is callout active value null return get value int s resourceassignment id integer value int value if s resourceassignment id 0 return set callout active true int m product id 0 string name null string description null big decimal qty null string sql select p m product id ra name ra description ra qty from s resourceassignment ra inner join m product p on p s resource id ra s resource id where ra s resourceassignment id try prepared statement pstmt db prepare statement sql null pstmt set int 1 s resourceassignment id result set rs pstmt execute query if rs next m product id rs get int 1 name rs get string 2 description rs get string 3 qty rs get big decimal 4 rs close pstmt close catch sql exception e log log level severe product e log fine s resourceassignment id s resourceassignment id m product id m product id if m product id 0 m tab set value m product id new integer m product id if description null name description if equals name m tab set value description name string variable qty time expense line if m tab get table name starts with c order variable qty ordered else if m tab get table name starts with c invoice variable qty invoiced if qty null m tab set value variable qty set callout active false return assignment_product s_resourceassignment_id m_product_id windowno mtab mtab mfield mfield iscalloutactive s_resourceassignment_id intvalue s_resourceassignment_id setcalloutactive m_product_id bigdecimal m_product_id s_resourceassignment m_product s_resource_id s_resource_id s_resourceassignment_id preparedstatement preparestatement setint s_resourceassignment_id resultset executequery m_product_id getint getstring getstring getbigdecimal sqlexception s_resourceassignment_id s_resourceassignment_id m_product_id m_product_id m_product_id mtab setvalue m_product_id m_product_id mtab setvalue timeexpenseline mtab gettablename startswith c_order qtyordered mtab gettablename startswith c_invoice qtyinvoiced mtab setvalue setcalloutactive get tree node param tree tree param node id node return node or null public static mtree node get mtree base tree int node id mtree node ret value null string sql select from ad treenode where ad tree id and node id prepared statement pstmt null try pstmt db prepare statement sql tree get trxname pstmt set int 1 tree getad tree id pstmt set int 2 node id result set rs pstmt execute query if rs next ret value new mtree node tree get ctx rs tree get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value node_id mtree_node mtree_base node_id mtree_node retvalue ad_treenode ad_tree_id node_id preparedstatement preparestatement get_trxname setint getad_tree_id setint node_id resultset executequery retvalue mtree_node getctx get_trxname s_log retvalue load constructor param ctx context param rs result set public mtree node properties ctx result set rs string trx name super ctx rs trx name mtree_node resultset trxname trxname full constructor param tree tree param node id node public mtree node mtree base tree int node id super tree get ctx 0 tree get trxname set client org tree setad tree id tree getad tree id setnode id node id add to root setparent id 0 set seq no 0 node_id mtree_node mtree_base node_id getctx get_trxname setclientorg setad_tree_id getad_tree_id setnode_id node_id setparent_id setseqno standard constructor param ctx context param m distributionlistline id id public m distribution list line properties ctx int m distributionlistline id string trx name super ctx m distributionlistline id trx name m_distributionlistline_id mdistributionlistline m_distributionlistline_id trxname m_distributionlistline_id trxname load constructor param ctx context param rs result set public m distribution list line properties ctx result set rs string trx name super ctx rs trx name mdistributionlistline resultset trxname trxname get min qty return min qty or 0 public big decimal get min qty big decimal min qty super get min qty if min qty null return env zero return min qty bigdecimal getminqty bigdecimal minqty getminqty minqty minqty get ratio return ratio or 0 public big decimal get ratio big decimal ratio super get ratio if ratio null return env zero return ratio bigdecimal getratio bigdecimal getratio get contents return contents public object get contents return contents getcontents standard constructor public x r group properties ctx int r group id string trx name super ctx r group id trx name if r group id 0 set name null setr group id 0 x_r_group r_group_id trxname r_group_id trxname r_group_id setname setr_group_id load constructor public x r group properties ctx result set rs string trx name super ctx rs trx name x_r_group resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r group append get id append return sb to string tostring stringbuffer stringbuffer x_r_group get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set bom bill of material public void setm bom id int m bom id if m bom id 0 set value m bom id null else set value m bom id new integer m bom id setm_bom_id m_bom_id m_bom_id set_value m_bom_id set_value m_bom_id m_bom_id get bom bill of material public int getm bom id integer ii integer get value m bom id if ii null return 0 return ii int value getm_bom_id get_value m_bom_id intvalue set change notice bill of materials engineering change notice version public void setm changenotice id int m changenotice id if m changenotice id 0 set value m changenotice id null else set value m changenotice id new integer m changenotice id setm_changenotice_id m_changenotice_id m_changenotice_id set_value m_changenotice_id set_value m_changenotice_id m_changenotice_id get change notice bill of materials engineering change notice version public int getm changenotice id integer ii integer get value m changenotice id if ii null return 0 return ii int value getm_changenotice_id get_value m_changenotice_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set group request group public void setr group id int r group id if r group id 1 throw new illegal argument exception r group id is mandatory set valuenocheck r group id new integer r group id setr_group_id r_group_id r_group_id illegalargumentexception r_group_id set_valuenocheck r_group_id r_group_id get group request group public int getr group id integer ii integer get value r group id if ii null return 0 return ii int value getr_group_id get_value r_group_id intvalue constructor param ctx context param m product id product param m attributesetinstance id asi param trx name trx public product cost properties ctx int m product id int m attributesetinstance id string trx name m m product id m product id if m m product id 0 m product m product get ctx m product id m m attributesetinstance id m attributesetinstance id m trxname trx name m_product_id m_attributesetinstance_id trxname productcost m_product_id m_attributesetinstance_id trxname m_m_product_id m_product_id m_m_product_id m_product mproduct m_product_id m_m_attributesetinstance_id m_attributesetinstance_id m_trxname trxname get product return product might be null public m product get product return m product mproduct getproduct m_product is this a service return true if service public boolean is service if m product null return m product is service return false isservice m_product m_product isservice set quantity in storage uom param qty quantity public void set qty big decimal qty m qty qty setqty bigdecimal m_qty set quantity in uom param qty quantity param c uom id uom public void set qty big decimal qty int c uom id m qty muom conversion convert c uom id m c uom id qty true std precision if qty null m qty null conversion error log severe conversion error set to qty m qty qty else m c uom id c uom id c_uom_id setqty bigdecimal c_uom_id m_qty muomconversion c_uom_id m_c_uom_id stdprecision m_qty m_qty m_c_uom_id c_uom_id line account from product param acct type see accttype 1 8 param as accounting schema return requested product account public m account get account int acct type m acct schema as if acct type 1 acct type 10 return null no product get default from product category if m m product id 0 return get account default acct type as string sql select p revenue acct p expense acct p asset acct p cogs acct 1 4 p purchasepricevariance acct p invoicepricevariance acct 5 6 p tradediscountrec acct p tradediscountgrant acct 7 8 p costadjustment acct p inventoryclearing acct 9 10 from m product acct where m product id and c acctschema id int validcombination id 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next validcombination id rs get int acct type rs close pstmt close catch sql exception e log log level severe sql e if validcombination id 0 return null return m account get as get ctx validcombination id accttype accttype_ maccount getaccount accttype macctschema accttype accttype m_m_product_id getaccountdefault accttype p_revenue_acct p_expense_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct p_costadjustment_acct p_inventoryclearing_acct m_product_acct m_product_id c_acctschema_id validcombination_id preparedstatement preparestatement setint m_m_product_id setint getc_acctschema_id resultset executequery validcombination_id getint accttype sqlexception validcombination_id maccount getctx validcombination_id account from default product category param acct type see accttype 1 8 param as accounting schema return requested product account public m account get account default int acct type m acct schema as if acct type 1 acct type 10 return null string sql select p revenue acct p expense acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct p costadjustment acct p inventoryclearing acct from m product category pc m product category acct pca where pc m product category id pca m product category id and pca c acctschema id order by pc is default desc pc created int validcombination id 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 as getc acctschema id result set rs pstmt execute query if rs next validcombination id rs get int acct type rs close pstmt close catch sql exception e log log level severe sql e if validcombination id 0 return null return m account get as get ctx validcombination id accttype accttype_ maccount getaccountdefault accttype macctschema accttype accttype p_revenue_acct p_expense_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct p_costadjustment_acct p_inventoryclearing_acct m_product_category m_product_category_acct m_product_category_id m_product_category_id c_acctschema_id isdefault validcombination_id preparedstatement preparestatement setint getc_acctschema_id resultset executequery validcombination_id getint accttype sqlexception validcombination_id maccount getctx validcombination_id get total costs amt qty in accounting schema currency param as accounting schema param ad org id trx org param costing method if null uses accounting schema acct schema costingmethod param c orderline id optional order line param zero costsok zero no costs are ok return cost or null if qty or costs cannot be determined public big decimal get product costs m acct schema as int ad org id string costing method int c orderline id boolean zero costsok if m qty null log fine no qty return null old costing m client client m client get as get ctx as getad client id if client is use beta functions big decimal item cost get product item cost old as costing method big decimal cost m qty multiply item cost cost cost set scale as get costing precision big decimal round half up log fine qty m qty cost item cost cost return cost no product if m product null log fine no product return null big decimal cost m cost get current cost m product m m attributesetinstance id as ad org id costing method m qty c orderline id zero costsok m trxname if cost null log fine no costs return null return cost ad_org_id costingmethod acctschema costingmethod_ c_orderline_id zerocostsok bigdecimal getproductcosts macctschema ad_org_id costingmethod c_orderline_id zerocostsok m_qty mclient mclient getctx getad_client_id isusebetafunctions bigdecimal itemcost getproductitemcostold costingmethod bigdecimal m_qty itemcost setscale getcostingprecision bigdecimal round_half_up m_qty itemcost m_product bigdecimal mcost getcurrentcost m_product m_m_attributesetinstance_id ad_org_id costingmethod m_qty c_orderline_id zerocostsok m_trxname get product costs per uom for accounting schema in accounting schema currency if cost type defined cost else current costs param as accounting schema param cost type if null uses accounting schema costs see acct schema costing return product costs private big decimal get product item cost old m acct schema as string cost type big decimal current null big decimal cost null string cm as get costing method string buffer sql new string buffer select current cost price 1 if cost type null m acct schema costingmethod averagepo equals cm m acct schema costingmethod averagepo equals cost type sql append costaverage 2 else if acct schema costing fifo equals cm sql append costfifo else if acct schema costing lifo equals cm sql append costlifo else if cost type null m acct schema costingmethod lastpoprice equals cm m acct schema costingmethod lastpoprice equals cost type sql append pricelastpo else acct schema costing standard sql append coststandard sql append from m product costing where m product id and c acctschema id try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m m product id pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next current rs get big decimal 1 cost rs get big decimal 2 rs close pstmt close catch sql exception e log log level severe sql to string e return costs if cost type null cost null cost equals env zero log fine costs cost return cost else if current null current equals env zero log fine current current return current create update cost record boolean create cost null current null return update costs old as create costtype currentcosts costtype acctschema costing_ bigdecimal getproductitemcostold macctschema costtype bigdecimal bigdecimal getcostingmethod stringbuffer stringbuffer currentcostprice costtype macctschema costingmethod_averagepo macctschema costingmethod_averagepo costtype acctschema costing_fifo acctschema costing_lifo costtype macctschema costingmethod_lastpoprice macctschema costingmethod_lastpoprice costtype acctschema costing_standard m_product_costing m_product_id c_acctschema_id preparedstatement preparestatement tostring setint m_m_product_id setint getc_acctschema_id resultset executequery getbigdecimal getbigdecimal sqlexception tostring costtype updatecostsold update create initial cost record check first for purchase price list then product purchase costs and then price list param as accounting schema param create create record return costs private big decimal update costs old m acct schema as boolean create create zero record if create string buffer sql new string buffer insert into m product costing m product id c acctschema id ad client id ad org id is active created created by updated updated by current cost price cost standard future cost price cost standardpo qty cost standardpo amt cost standard cum qty cost standard cum amt cost average cost average cum qty cost average cum amt price lastpo price last inv total inv qty total inv amt values sql append m m product id append append as getc acctschema id append append as getad client id append append as getad org id append append y sys date 0 sys date 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 int no db execute update sql to string m trxname if no 1 log fine costing created try to find non zero price string cost source price list po big decimal costs get price list as true if costs null costs equals env zero cost source po cost costs getpo cost as if costs null costs equals env zero cost source price list costs get price list as false if not found use 1 to be able to do material transactions if costs null costs equals env zero cost source not found costs new big decimal 1 update current costs string buffer sql new string buffer update m product costing sql append set current cost price append costs append where m product id append m m product id append and c acctschema id append as getc acctschema id int no db execute update sql to string m trxname if no 1 log fine cost source costs return costs bigdecimal updatecostsold macctschema stringbuffer stringbuffer m_product_costing m_product_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby currentcostprice coststandard futurecostprice coststandardpoqty coststandardpoamt coststandardcumqty coststandardcumamt costaverage costaveragecumqty costaveragecumamt pricelastpo pricelastinv totalinvqty totalinvamt m_m_product_id getc_acctschema_id getad_client_id getad_org_id sysdate sysdate executeupdate tostring m_trxname costingcreated costsource pricelist bigdecimal getpricelist costsource getpocost costsource pricelist getpricelist costsource bigdecimal stringbuffer stringbuffer m_product_costing currentcostprice m_product_id m_m_product_id c_acctschema_id getc_acctschema_id executeupdate tostring m_trxname costsource get po price from price list and convert it to acct schema currency param as accounting schema param onlypo price list use only po price list return po price private big decimal get price list m acct schema as boolean onlypo price list string buffer sql new string buffer select pl c currency id pp price list pp price std pp price limit from m pricelist pl m pricelist version plv m productprice pp where pl m pricelist id plv m pricelist id and plv m pricelist version id pp m pricelist version id and pp m product id if onlypo price list sql append and pl isso price list n sql append order by pl isso price list asc plv valid from desc int c currency id 0 big decimal price list null big decimal price std null big decimal price limit null try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m m product id result set rs pstmt execute query if rs next c currency id rs get int 1 price list rs get big decimal 2 price std rs get big decimal 3 price limit rs get big decimal 4 rs close pstmt close catch sql exception e log log level severe sql to string e nothing found if c currency id 0 return null big decimal price price limit best bet if price null price equals env zero price price std if price null price equals env zero price price list convert if price null price equals env zero price m conversion rate convert as get ctx price c currency id as getc currency id as getad client id 0 return price pricelist acctschema onlypopricelist bigdecimal getpricelist macctschema onlypopricelist stringbuffer stringbuffer c_currency_id pricelist pricestd pricelimit m_pricelist m_pricelist_version m_productprice m_pricelist_id m_pricelist_id m_pricelist_version_id m_pricelist_version_id m_product_id onlypopricelist issopricelist issopricelist validfrom c_currency_id bigdecimal pricelist bigdecimal pricestd bigdecimal pricelimit preparedstatement preparestatement tostring setint m_m_product_id resultset executequery c_currency_id getint pricelist getbigdecimal pricestd getbigdecimal pricelimit getbigdecimal sqlexception tostring c_currency_id bigdecimal pricelimit pricestd pricelist mconversionrate getctx c_currency_id getc_currency_id getad_client_id get po cost from purchase info and convert it to acct schema currency param as accounting schema return po cost private big decimal getpo cost m acct schema as string sql select c currency id price list pricepo price lastpo from m product po where m product id order by is current vendor desc int c currency id 0 big decimal price list null big decimal pricepo null big decimal price lastpo null try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id result set rs pstmt execute query if rs next c currency id rs get int 1 price list rs get big decimal 2 pricepo rs get big decimal 3 price lastpo rs get big decimal 4 rs close pstmt close catch sql exception e log log level severe sql e nothing found if c currency id 0 return null big decimal cost price lastpo best bet if cost null cost equals env zero cost pricepo if cost null cost equals env zero cost price list convert standard precision should be costing precision if cost null cost equals env zero cost m conversion rate convert as get ctx cost c currency id as getc currency id as getad client id as getad org id return cost acctschema bigdecimal getpocost macctschema c_currency_id pricelist pricelastpo m_product_po m_product_id iscurrentvendor c_currency_id bigdecimal pricelist bigdecimal bigdecimal pricelastpo preparedstatement preparestatement setint m_m_product_id resultset executequery c_currency_id getint pricelist getbigdecimal getbigdecimal pricelastpo getbigdecimal sqlexception c_currency_id bigdecimal pricelastpo pricelist mconversionrate getctx c_currency_id getc_currency_id getad_client_id getad_org_id standard constructor public x m demandline properties ctx int m demandline id string trx name super ctx m demandline id trx name if m demandline id 0 setc period id 0 setm demandline id 0 setm demand id 0 setm product id 0 set qty env zero set qty calculated env zero x_m_demandline m_demandline_id trxname m_demandline_id trxname m_demandline_id setc_period_id setm_demandline_id setm_demand_id setm_product_id setqty setqtycalculated load constructor public x m demandline properties ctx result set rs string trx name super ctx rs trx name x_m_demandline resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m demandline append get id append return sb to string tostring stringbuffer stringbuffer x_m_demandline get_id tostring set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc period id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_period_id set demand line material demand line public void setm demandline id int m demandline id if m demandline id 1 throw new illegal argument exception m demandline id is mandatory set valuenocheck m demandline id new integer m demandline id setm_demandline_id m_demandline_id m_demandline_id illegalargumentexception m_demandline_id set_valuenocheck m_demandline_id m_demandline_id get demand line material demand line public int getm demandline id integer ii integer get value m demandline id if ii null return 0 return ii int value getm_demandline_id get_value m_demandline_id intvalue set demand material demand public void setm demand id int m demand id if m demand id 1 throw new illegal argument exception m demand id is mandatory set valuenocheck m demand id new integer m demand id setm_demand_id m_demand_id m_demand_id illegalargumentexception m_demand_id set_valuenocheck m_demand_id m_demand_id get demand material demand public int getm demand id integer ii integer get value m demand id if ii null return 0 return ii int value getm_demand_id get_value m_demand_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set calculated quantity calculated quantity public void set qty calculated big decimal qty calculated if qty calculated null throw new illegal argument exception qty calculated is mandatory set value qty calculated qty calculated setqtycalculated bigdecimal qtycalculated qtycalculated illegalargumentexception qtycalculated set_value qtycalculated qtycalculated get calculated quantity calculated quantity public big decimal get qty calculated big decimal bd big decimal get value qty calculated if bd null return env zero return bd bigdecimal getqtycalculated bigdecimal bigdecimal get_value qtycalculated initialize global variables param config servlet configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception issue report servlet init servletexception servletconfig servletexception webenv initweb servletexception issuereportservlet get servlet information return info public string get servlet info return a dempiere issue reporting getservletinfo adempiere clean up resources public void destroy log info process the initial http get request reads the parameter amt and optional c invoice id param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true w env dump session w env dump request int ad issue id web util get parameter as int request recordid string db address web util get parameter request dbaddress string comments web util get parameter request comments string issue string web util get parameter request issue string buffer response text new string buffer a dempiere support append new date to string append n m issue issue null if ad issue id 0 issue new m issue ctx ad issue id null if issue get id ad issue id response text append issue unknown request ignored else if issue getdb address equals db address response text append not issue owner request ignored else issue add comments comments response text append issue create answer else if issue string null issue string length 0 response text append unknown request else issue m issue create ctx issue string if issue null issue save response text append could not save issue else response text append issue process string buffer answer new string buffer if issue null issue get id 0 answer append recordid append issue get id append m issue delimiter answer append documentno append append m issue delimiter answer append response append response text response set header cache control no cache response set content type text html charset utf 8 print writer out response get writer with character encoding support out write url encoder encode answer to string utf 8 out flush if out check error log log level severe error writing out close c_invoice_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession wenv wenv ad_issue_id webutil getparameterasint dbaddress webutil getparameter webutil getparameter issuestring webutil getparameter stringbuffer responsetext stringbuffer adempiere tostring missue ad_issue_id missue ad_issue_id get_id ad_issue_id responsetext getdbaddress dbaddress responsetext addcomments responsetext createanswer issuestring issuestring responsetext missue issuestring responsetext responsetext stringbuffer stringbuffer get_id get_id missue missue responsetext setheader setcontenttype printwriter getwriter urlencoder tostring checkerror process the http post request the actual payment processing param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr doget get contents return contents public object get contents return contents getcontents get asset from shipment param ctx context param m inoutline id shipment line return asset or null public static m asset get from shipment properties ctx int m inoutline id string trx name m asset ret value null string sql select from a asset where m inoutline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inoutline id result set rs pstmt execute query if rs next ret value new m asset ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_inoutline_id masset getfromshipment m_inoutline_id trxname masset retvalue a_asset m_inoutline_id preparedstatement preparestatement trxname setint m_inoutline_id resultset executequery retvalue masset trxname s_log retvalue asset constructor param ctx context param a asset id asset param trx name transaction name public m asset properties ctx int a asset id string trx name super ctx a asset id trx name if a asset id 0 set is depreciated false set is fully depreciated false set value null set name null set is in posession false set is owned false seta asset group id 0 set is disposed false setm attributesetinstance id 0 set qty env one a_asset_id trxname masset a_asset_id trxname a_asset_id trxname a_asset_id setisdepreciated setisfullydepreciated setvalue setname setisinposession setisowned seta_asset_group_id setisdisposed setm_attributesetinstance_id setqty discontinued asset constructor do not use but don t delete either param ctx context param a asset id asset public m asset properties ctx int a asset id this ctx a asset id null a_asset_id masset a_asset_id a_asset_id load constructor param ctx context param rs result set record public m asset properties ctx result set rs string trx name super ctx rs trx name masset resultset trxname trxname shipment constructor param ship line shipment line param delivery count 0 or number of delivery public m asset m in out shipment m in out line ship line int delivery count this shipment get ctx 0 shipment get trxname set client org shipment set value name description shipment ship line delivery count header set asset service date shipment get movement date set is owned false setc bpartner id shipment getc bpartner id setc bpartner location id shipment getc bpartner location id setad user id shipment getad user id line m product product ship line get product setm product id product getm product id seta asset group id product geta asset group id guarantee version set guarantee date time util add days shipment get movement date product get guarantee days set version no product get version no if ship line getm attributesetinstance id 0 m attribute set instance asi new m attribute set instance get ctx ship line getm attributesetinstance id get trxname setm attributesetinstance id asi getm attributesetinstance id set lot asi get lot set ser no asi get ser no set help ship line get description if delivery count 0 set qty ship line get movement qty setm inoutline id ship line getm inoutline id activate m asset group ag m asset group get get ctx geta asset group id if ag is create as active set is active false shipline deliverycount masset minout minoutline shipline deliverycount getctx get_trxname setclientorg setvaluenamedescription shipline deliverycount setassetservicedate getmovementdate setisowned setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id mproduct shipline getproduct setm_product_id getm_product_id seta_asset_group_id geta_asset_group_id setguaranteedate timeutil adddays getmovementdate getguaranteedays setversionno getversionno shipline getm_attributesetinstance_id mattributesetinstance mattributesetinstance getctx shipline getm_attributesetinstance_id get_trxname setm_attributesetinstance_id getm_attributesetinstance_id setlot getlot setserno getserno sethelp shipline getdescription deliverycount setqty shipline getmovementqty setm_inoutline_id shipline getm_inoutline_id massetgroup massetgroup getctx geta_asset_group_id iscreateasactive setisactive set value name description param shipment shipment param line line param delivery count public void set value name description m in out shipment m in out line line int delivery count m product product line get product mb partner partner shipment getb partner set value name description shipment delivery count product partner deliverycount setvaluenamedescription minout minoutline deliverycount mproduct getproduct mbpartner getbpartner setvaluenamedescription deliverycount set value name description param shipment shipment param delivery count count param product product param partner partner public void set value name description m in out shipment int delivery count m product product mb partner partner string document no shipment get document no if delivery count 1 document no delivery count value string value partner get value product get value if value length 40 document no length value value substring 0 40 document no length document no set value value name m product after save string name partner get name product get name if name length 60 name name substring 0 60 set name name description string description product get description set description description deliverycount setvaluenamedescription minout deliverycount mproduct mbpartner documentno _ getdocumentno deliverycount documentno _ deliverycount getvalue _ getvalue documentno documentno documentno setvalue mproduct aftersave getname getname setname getdescription setdescription add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get qty return 1 or qty public big decimal get qty big decimal qty super get qty if qty null qty equals env zero set qty env one return super get qty bigdecimal getqty bigdecimal getqty setqty getqty string representation return info public string to string string buffer sb new string buffer m asset append get id append append get value append return sb to string tostring stringbuffer stringbuffer masset get_id getvalue tostring get deliveries return deliveries public m asset delivery get deliveries array list m asset delivery list new array list m asset delivery string sql select from a asset delivery where a asset id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 geta asset id result set rs pstmt execute query while rs next list add new m asset delivery get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m asset delivery ret value new m asset delivery list size list to array ret value return ret value massetdelivery getdeliveries arraylist massetdelivery arraylist massetdelivery a_asset_delivery a_asset_id preparedstatement preparestatement get_trxname setint geta_asset_id resultset executequery massetdelivery getctx get_trxname massetdelivery retvalue massetdelivery toarray retvalue retvalue get delivery count return delivery count public int get delivery count string sql select count from a asset delivery where a asset id return db getsql value get trxname sql geta asset id getdeliverycount a_asset_delivery a_asset_id getsqlvalue get_trxname geta_asset_id can we download based on guarantee date and availability of download return true if downloadable public boolean is downloadable if is active return false guarantee date timestamp guarantee get guarantee date if guarantee null return false guarantee time util get day guarantee timestamp now time util get day system current time millis valid if now after guarantee not after guarantee date get product return m product null m product has downloads return false isdownloadable isactive getguaranteedate timeutil getday timeutil getday currenttimemillis getproduct m_product m_product hasdownloads get product version no return version no public string get product version no return get product get version no versionno getproductversionno getproduct getversionno get product r mailtext id return r mailtext id public int getproductr mailtext id return get product getr mailtext id r_mailtext_id r_mailtext_id getproductr_mailtext_id getproduct getr_mailtext_id get product info private m product get product if m product null m product m product get get ctx getm product id return m product mproduct getproduct m_product m_product mproduct getctx getm_product_id m_product get active addl product downloads return array of downloads public m product download get product downloads if m product null get product if m product null return m product get product downloads false return null mproductdownload getproductdownloads m_product getproduct m_product m_product getproductdownloads get additional download names return names public string get download names m product download dls get product downloads if dls null dls length 0 string ret value new string dls length for int i 0 i ret value length i ret value i dls i get name log fine dls length return ret value return new string getdownloadnames mproductdownload getproductdownloads retvalue retvalue retvalue getname retvalue get additional download ur ls return ur ls public string get downloadur ls m product download dls get product downloads if dls null dls length 0 string ret value new string dls length for int i 0 i ret value length i string url dls i get downloadurl int pos math max url last index of url last index of if pos 1 url url substring pos 1 ret value i url return ret value return new string urls urls getdownloadurls mproductdownload getproductdownloads retvalue retvalue getdownloadurl lastindexof lastindexof retvalue retvalue before save param new record new return true protected boolean before save boolean new record get qty set to 1 return true newrecord beforesave newrecord getqty confirm asset e mail delivery param email email sent param ad user id recipient public m asset delivery confirm delivery e mail email int ad user id set version no get product version no m asset delivery ad new m asset delivery this email ad user id return ad email ad_user_id massetdelivery confirmdelivery email ad_user_id setversionno getproductversionno massetdelivery massetdelivery ad_user_id confirm asset download delivery param request request param ad user id recipient public m asset delivery confirm delivery http servlet request request int ad user id set version no get product version no set life use units get life use units 1 m asset delivery ad new m asset delivery this request ad user id return ad ad_user_id massetdelivery confirmdelivery httpservletrequest ad_user_id setversionno getproductversionno setlifeuseunits getlifeuseunits massetdelivery massetdelivery ad_user_id initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception rfq servlet init servletexception servletconfig servletexception webenv initweb servletexception rfqservlet get servlet information return info public string get servlet info return a dempiere web rfq servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info do get from request get remote host request get remote addr string url rfqs jsp http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter note id if is valid create pdf stream it string msg stream attachment request response if msg null msg length 0 return if info null info set message msg log info do get forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception doget getremotehost getremoteaddr httpsession getsession getattribute removeattribute websessionctx hdr_message getattribute setmessage note_id streamattachment setmessage doget requestdispatcher getservletcontext getrequestdispatcher stream attachment param request request param response response return or error message private string stream attachment http servlet request request http servlet response response get note id int c rfq id web util get parameter as int request c rfq id if c rfq id 0 log fine stream attachment no id return no rfq id get note properties ctx jsp env get ctx request m rfq doc new m rfq ctx c rfq id null if doc getc rfq id c rfq id log fine stream attachment rfq not found id c rfq id return rfq not found if doc is pdf attachment return no pdf attachment found byte data doc get pdf attachment if data null return no pdf attachment send pdf try int buffer size 2048 2k buffer int file length data length response set content type application pdf response set buffer size buffer size response set content length file length log fine stream attachment length file length long time system current time millis timer start servlet output stream out response get output stream out write data out flush out close time system current time millis time double speed file length 1024 double time 1000 log fine stream invoice length file length time ms speed kb sec catch io exception ex log log level severe stream attachment ex return streaming error return null streamattachment httpservletrequest httpservletresponse c_rfq_id webutil getparameterasint c_rfq_id c_rfq_id streamattachment jspenv getctx mrfq mrfq c_rfq_id getc_rfq_id c_rfq_id streamattachment c_rfq_id ispdfattachment getpdfattachment buffersize filelength setcontenttype setbuffersize buffersize setcontentlength filelength streamattachment filelength currenttimemillis servletoutputstream getoutputstream currenttimemillis filelength streaminvoice filelength ioexception streamattachment process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr log set trace level 9 web env dump request web env dump request get session get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning do post no web user response send redirect login servlet forward to note jsp entry return int c rfqresponse id web util get parameter as int request p rfqresponse id int c rfq id web util get parameter as int request c rfq id m rfq response rfq response new m rfq response ctx c rfqresponse id null if c rfqresponse id 0 rfq response null rfq response get id c rfqresponse id web util create forward page response rfq response not found rfqs jsp 5 return if wu getc bpartner id rfq response getc bpartner id web util create forward page response your rfq response not found rfqs jsp 5 return update data string msg update response request rfq response session set attribute web session ctx hdr message msg string url rfq details jsp c rfq id c rfq id log info do get forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr settracelevel webenv webenv getsession httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser dopost sendredirect loginservlet forwardto c_rfqresponse_id webutil getparameterasint p_rfqresponse_id c_rfq_id webutil getparameterasint c_rfq_id mrfqresponse rfqresponse mrfqresponse c_rfqresponse_id c_rfqresponse_id rfqresponse rfqresponse get_id c_rfqresponse_id webutil createforwardpage getc_bpartner_id rfqresponse getc_bpartner_id webutil createforwardpage updateresponse rfqresponse setattribute websessionctx hdr_message rfqdetails c_rfq_id c_rfq_id doget requestdispatcher getservletcontext getrequestdispatcher update response param request request param rfq response response return msg private string update response http servlet request request m rfq response rfq response log fine update response rfq response string save error rfq not updated string msg rfq updated rfq response rfq response set name web util get parameter request name rfq response set description web util get parameter request description rfq response set help web util get parameter request help rfq response set date work start web util get parameter as date request date work start rfq response set date work complete web util get parameter as date request date work complete rfq response set delivery days web util get parameter as int request delivery days rfq response set price web util get parameter asbd request price rfq response set is self service true rfq response set date response new timestamp system current time millis check for completeness if web util get parameter as boolean request is complete string msg complete rfq response check complete if msg complete null msg complete length 0 msg msg complete if rfq response save return save error rfq response line m rfq response line lines rfq response get lines false for int i 0 i lines length i m rfq response line line lines i if line is active continue string para add line getc rfqresponseline id line set description web util get parameter request description para add line set help web util get parameter request help para add line set date work start web util get parameter as date request date work start para add line set date work complete web util get parameter as date request date work complete para add line set delivery days web util get parameter as int request delivery days para add line set is self service true if line save return save error rfq response line qty m rfq response line qty qtys line get qtys true for int j 0 j qtys length j m rfq response line qty qty qtys j if qty is active continue para add qty getc rfqresponselineqty id qty set discount web util get parameter asbd request discount para add qty set price web util get parameter asbd request price para add if qty save return save error log fine complete rfq response return msg rfqresponse updateresponse httpservletrequest mrfqresponse rfqresponse updateresponse rfqresponse saveerror rfqresponse setname webutil getparameter rfqresponse setdescription webutil getparameter rfqresponse sethelp webutil getparameter rfqresponse setdateworkstart webutil getparameterasdate dateworkstart rfqresponse setdateworkcomplete webutil getparameterasdate dateworkcomplete rfqresponse setdeliverydays webutil getparameterasint deliverydays rfqresponse setprice webutil getparameterasbd rfqresponse setisselfservice rfqresponse setdateresponse currenttimemillis webutil getparameterasboolean iscomplete msgcomplete rfqresponse checkcomplete msgcomplete msgcomplete msgcomplete rfqresponse saveerror mrfqresponseline rfqresponse getlines mrfqresponseline isactive paraadd _ getc_rfqresponseline_id setdescription webutil getparameter paraadd sethelp webutil getparameter paraadd setdateworkstart webutil getparameterasdate dateworkstart paraadd setdateworkcomplete webutil getparameterasdate dateworkcomplete paraadd setdeliverydays webutil getparameterasint deliverydays paraadd setisselfservice saveerror mrfqresponselineqty getqtys mrfqresponselineqty isactive paraadd _ getc_rfqresponselineqty_id setdiscount webutil getparameterasbd paraadd setprice webutil getparameterasbd paraadd saveerror rfqresponse persistency constructor param ctx context param ignored ignored public m record access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mrecordaccess trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m record access properties ctx result set rs string trx name super ctx rs trx name mrecordaccess resultset trxname trxname full new constructor param ctx context param ad role id role param ad table id table param record id record public m record access properties ctx int ad role id int ad table id int record id string trx name super ctx 0 trx name setad role id ad role id setad table id ad table id setrecord id record id set is exclude true set is read only false set is dependent entities false ad_role_id ad_table_id record_id mrecordaccess ad_role_id ad_table_id record_id trxname trxname setad_role_id ad_role_id setad_table_id ad_table_id setrecord_id record_id setisexclude setisreadonly setisdependententities get key column name return key column name public string get key column name if m keycolumnname null return m keycolumnname string sql select column name from ad column where ad table id and is key y and is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad table id result set rs pstmt execute query while rs next string s rs get string 1 if m keycolumnname null m keycolumnname s else log log level severe more than one key s rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if m keycolumnname null log log level severe record access requires table with one key column return m keycolumnname getkeycolumnname m_keycolumnname m_keycolumnname columnname ad_column ad_table_id iskey isactive preparedstatement preparestatement setint getad_table_id resultset executequery getstring m_keycolumnname m_keycolumnname m_keycolumnname m_keycolumnname get synonym of column return synonym column name public string get synonym if ad user id equals get key column name return salesrep id else if c elementvalue id equals get key column name return account id return null getsynonym ad_user_id getkeycolumnname salesrep_id c_elementvalue_id getkeycolumnname account_id key column has a synonym return true if key column has synonym public boolean is synonym return get synonym null issynonym getsynonym is read write return rw false if exclude public boolean is read write if is exclude return false return super is read only isreadwrite isexclude isreadonly get key column name with consideration of synonym param table info return key column name public string get key column name access sql parser table info table info string column syn get synonym if column syn null return m keycolumnname we have a synonym ignore it if base table inquired for int i 0 i table info length i if m keycolumnname equals ad user id list of tables where not to use salesrep id if table info i get table name equals ad user return m keycolumnname else if m keycolumnname equals ad elementvalue id list of tables where not to use account id if table info i get table name equals ad elementvalue return m keycolumnname tables to be ignored return column syn tableinfo getkeycolumnname accesssqlparser tableinfo tableinfo columnsyn getsynonym columnsyn m_keycolumnname tableinfo m_keycolumnname ad_user_id salesrep_id tableinfo gettablename ad_user m_keycolumnname m_keycolumnname ad_elementvalue_id account_id tableinfo gettablename ad_elementvalue m_keycolumnname columnsyn string representation return info public string to string string buffer sb new string buffer m record access ad role id append getad role id append ad table id append getad table id append record id append getrecord id append active append is active append exclude append is exclude append read only append super is read only append dependent append is dependent entities append return sb to string tostring stringbuffer stringbuffer mrecordaccess ad_role_id getad_role_id ad_table_id getad_table_id record_id getrecord_id isactive isexclude readonly isreadonly isdependententities tostring extended string representation return extended info public string to stringx properties ctx string in msg get msg ctx include string ex msg get msg ctx exclude string buffer sb new string buffer sb append msg translate ctx ad table id append append get table name ctx append append msg translate ctx record id append append getrecord id append append msg translate ctx is dependent entities append append is dependent entities append append msg translate ctx is read only append append super is read only append append is exclude ex in return sb to string tostringx getmsg getmsg stringbuffer stringbuffer ad_table_id gettablename record_id getrecord_id isdependententities isdependententities isreadonly isreadonly isexclude tostring get table name param ctx context return table name public string get table name properties ctx if m tablename null string sql select table name from ad table where ad table id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad table id result set rs pstmt execute query if rs next m tablename rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null get clear text string real name msg translate ctx m tablename id if real name equals m tablename id m tablename real name return m tablename gettablename m_tablename tablename ad_table ad_table_id preparedstatement preparestatement setint getad_table_id resultset executequery m_tablename getstring realname m_tablename _id realname m_tablename _id m_tablename realname m_tablename prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals period action p periodaction string para i get parameter else log log level severe unknown parameter name p c period id getrecord id processinfoparameter getparameter getparametername getparameter periodaction p_periodaction getparameter p_c_period_id getrecord_id process return message throws exception protected string do it throws exception log info c period id p c period id period action p periodaction m period period new m period get ctx p c period id get trxname if period get id 0 throw new illegal argument exception not found c period id p c period id string buffer sql new string buffer update c periodcontrol sql append set period status open if m period control periodaction openperiod equals p periodaction sql append m period control periodstatus open close else if m period control periodaction closeperiod equals p periodaction sql append m period control periodstatus closed close permanently else if m period control periodaction permanentlycloseperiod equals p periodaction sql append m period control periodstatus permanentlyclosed else return sql append period action n updated sys date updated by append getad user id where sql append where c period id append period getc period id append and period status p append and period status append p periodaction append int no db execute update sql to string get trxname cache mgt get reset c periodcontrol 0 cache mgt get reset c period p c period id return updated no doit c_period_id p_c_period_id periodaction p_periodaction mperiod mperiod getctx p_c_period_id get_trxname get_id illegalargumentexception notfound c_period_id p_c_period_id stringbuffer stringbuffer c_periodcontrol periodstatus mperiodcontrol periodaction_openperiod p_periodaction mperiodcontrol periodstatus_open mperiodcontrol periodaction_closeperiod p_periodaction mperiodcontrol periodstatus_closed mperiodcontrol periodaction_permanentlycloseperiod p_periodaction mperiodcontrol periodstatus_permanentlyclosed periodaction sysdate updatedby getad_user_id c_period_id getc_period_id periodstatus periodstatus p_periodaction executeupdate tostring get_trxname cachemgt c_periodcontrol cachemgt c_period p_c_period_id get contents return context public object get contents return contents getcontents standard constructor public x ad role properties ctx int ad role id string trx name super ctx ad role id trx name if ad role id 0 setad role id 0 set confirm query records 0 0 set is access all orgs false n set is can approve own doc false set is can export true y set is can report true y set is change log false n set is manual false set is personal access false n set is personal lock false n set is show acct false n set is use user org access false n set max query records 0 0 set name null set overwrite price limit false n set preference type null o set user level null o x_ad_role ad_role_id trxname ad_role_id trxname ad_role_id setad_role_id setconfirmqueryrecords setisaccessallorgs setiscanapproveowndoc setiscanexport setiscanreport setischangelog setismanual setispersonalaccess setispersonallock setisshowacct setisuseuserorgaccess setmaxqueryrecords setname setoverwritepricelimit setpreferencetype setuserlevel load constructor public x ad role properties ctx result set rs string trx name super ctx rs trx name x_ad_role resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad role append get id append return sb to string tostring stringbuffer stringbuffer x_ad_role get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue public static final int ad tree menu id ad reference id 184 set menu tree tree of the menu public void setad tree menu id int ad tree menu id if ad tree menu id 0 set value ad tree menu id null else set value ad tree menu id new integer ad tree menu id ad_tree_menu_id_ad_reference_id setad_tree_menu_id ad_tree_menu_id ad_tree_menu_id set_value ad_tree_menu_id set_value ad_tree_menu_id ad_tree_menu_id get menu tree tree of the menu public int getad tree menu id integer ii integer get value ad tree menu id if ii null return 0 return ii int value getad_tree_menu_id get_value ad_tree_menu_id intvalue public static final int ad tree org id ad reference id 184 set organization tree tree to determine organizational hierarchy public void setad tree org id int ad tree org id if ad tree org id 0 set value ad tree org id null else set value ad tree org id new integer ad tree org id ad_tree_org_id_ad_reference_id setad_tree_org_id ad_tree_org_id ad_tree_org_id set_value ad_tree_org_id set_value ad_tree_org_id ad_tree_org_id get organization tree tree to determine organizational hierarchy public int getad tree org id integer ii integer get value ad tree org id if ii null return 0 return ii int value getad_tree_org_id get_value ad_tree_org_id intvalue set approval amount the approval amount limit for this role public void set amt approval big decimal amt approval set value amt approval amt approval setamtapproval bigdecimal amtapproval set_value amtapproval amtapproval get approval amount the approval amount limit for this role public big decimal get amt approval big decimal bd big decimal get value amt approval if bd null return env zero return bd bigdecimal getamtapproval bigdecimal bigdecimal get_value amtapproval set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set confirm query records require confirmation if more records will be returned by the query if not defined 500 public void set confirm query records int confirm query records set value confirm query records new integer confirm query records setconfirmqueryrecords confirmqueryrecords set_value confirmqueryrecords confirmqueryrecords get confirm query records require confirmation if more records will be returned by the query if not defined 500 public int get confirm query records integer ii integer get value confirm query records if ii null return 0 return ii int value getconfirmqueryrecords get_value confirmqueryrecords intvalue public static final string connectionprofile wan w set connection profile how a java client connects to the server s public void set connection profile string connection profile if connection profile null throw new illegal argument exception connection profile is mandatory if connection profile null connection profile equals l connection profile equals t connection profile equals v connection profile equals w else throw new illegal argument exception connection profile invalid value connection profile reference id 364 l t v w if connection profile null connection profile length 1 log warning length 1 truncated connection profile connection profile substring 0 0 set value connection profile connection profile connectionprofile_wan setconnectionprofile connectionprofile connectionprofile illegalargumentexception connectionprofile connectionprofile connectionprofile connectionprofile connectionprofile connectionprofile illegalargumentexception connectionprofile connectionprofile reference_id connectionprofile connectionprofile connectionprofile connectionprofile set_value connectionprofile connectionprofile get connection profile how a java client connects to the server s public string get connection profile return string get value connection profile getconnectionprofile get_value connectionprofile set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set access all orgs access all organizations no org access control of the client public void set is access all orgs boolean is access all orgs set value is access all orgs new boolean is access all orgs setisaccessallorgs isaccessallorgs set_value isaccessallorgs isaccessallorgs get access all orgs access all organizations no org access control of the client public boolean is access all orgs object oo get value is access all orgs if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaccessallorgs get_value isaccessallorgs booleanvalue set approve own documents users with this role can approve their own documents public void set is can approve own doc boolean is can approve own doc set value is can approve own doc new boolean is can approve own doc setiscanapproveowndoc iscanapproveowndoc set_value iscanapproveowndoc iscanapproveowndoc get approve own documents users with this role can approve their own documents public boolean is can approve own doc object oo get value is can approve own doc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscanapproveowndoc get_value iscanapproveowndoc booleanvalue set can export users with this role can export data public void set is can export boolean is can export set value is can export new boolean is can export setiscanexport iscanexport set_value iscanexport iscanexport get can export users with this role can export data public boolean is can export object oo get value is can export if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscanexport get_value iscanexport booleanvalue set can report users with this role can create reports public void set is can report boolean is can report set value is can report new boolean is can report setiscanreport iscanreport set_value iscanreport iscanreport get can report users with this role can create reports public boolean is can report object oo get value is can report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscanreport get_value iscanreport booleanvalue set maintain change log maintain a log of changes public void set is change log boolean is change log set value is change log new boolean is change log setischangelog ischangelog set_value ischangelog ischangelog get maintain change log maintain a log of changes public boolean is change log object oo get value is change log if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ischangelog get_value ischangelog booleanvalue set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set personal access allow access to all personal records public void set is personal access boolean is personal access set value is personal access new boolean is personal access setispersonalaccess ispersonalaccess set_value ispersonalaccess ispersonalaccess get personal access allow access to all personal records public boolean is personal access object oo get value is personal access if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispersonalaccess get_value ispersonalaccess booleanvalue set personal lock allow users with role to lock access to personal records public void set is personal lock boolean is personal lock set value is personal lock new boolean is personal lock setispersonallock ispersonallock set_value ispersonallock ispersonallock get personal lock allow users with role to lock access to personal records public boolean is personal lock object oo get value is personal lock if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispersonallock get_value ispersonallock booleanvalue set show accounting users with this role can see accounting information public void set is show acct boolean is show acct set value is show acct new boolean is show acct setisshowacct isshowacct set_value isshowacct isshowacct get show accounting users with this role can see accounting information public boolean is show acct object oo get value is show acct if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isshowacct get_value isshowacct booleanvalue set use user org access use org access defined by user instead of role org access public void set is use user org access boolean is use user org access set value is use user org access new boolean is use user org access setisuseuserorgaccess isuseuserorgaccess set_value isuseuserorgaccess isuseuserorgaccess get use user org access use org access defined by user instead of role org access public boolean is use user org access object oo get value is use user org access if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isuseuserorgaccess get_value isuseuserorgaccess booleanvalue set max query records if defined you cannot query more records as defined the query criteria needs to be changed to query less records public void set max query records int max query records set value max query records new integer max query records setmaxqueryrecords maxqueryrecords set_value maxqueryrecords maxqueryrecords get max query records if defined you cannot query more records as defined the query criteria needs to be changed to query less records public int get max query records integer ii integer get value max query records if ii null return 0 return ii int value getmaxqueryrecords get_value maxqueryrecords intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set overwrite price limit overwrite price limit if the price list enforces the price limit public void set overwrite price limit boolean overwrite price limit set value overwrite price limit new boolean overwrite price limit setoverwritepricelimit overwritepricelimit set_value overwritepricelimit overwritepricelimit get overwrite price limit overwrite price limit if the price list enforces the price limit public boolean is overwrite price limit object oo get value overwrite price limit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritepricelimit get_value overwritepricelimit booleanvalue public static final string preferencetype user u set preference level determines what preferences the user can set public void set preference type string preference type if preference type null throw new illegal argument exception preference type is mandatory if preference type equals c preference type equals n preference type equals o preference type equals u else throw new illegal argument exception preference type invalid value preference type reference id 330 c n o u if preference type length 1 log warning length 1 truncated preference type preference type substring 0 0 set value preference type preference type preferencetype_user setpreferencetype preferencetype preferencetype illegalargumentexception preferencetype preferencetype preferencetype preferencetype preferencetype illegalargumentexception preferencetype preferencetype reference_id preferencetype preferencetype preferencetype set_value preferencetype preferencetype get preference level determines what preferences the user can set public string get preference type return string get value preference type getpreferencetype get_value preferencetype public static final int supervisor id ad reference id 286 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 0 set value supervisor id null else set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id set_value supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue public static final string userlevel system s set user level system client organization public void set user level string user level if user level null throw new illegal argument exception user level is mandatory if user level equals o user level equals c user level equals co user level equals s else throw new illegal argument exception user level invalid value user level reference id 226 o c co s if user level length 3 log warning length 3 truncated user level user level substring 0 2 set value user level user level userlevel_system setuserlevel userlevel userlevel illegalargumentexception userlevel userlevel userlevel userlevel userlevel illegalargumentexception userlevel userlevel reference_id userlevel userlevel userlevel set_value userlevel userlevel get user level system client organization public string get user level return string get value user level getuserlevel get_value userlevel constructor public v rowid editor boolean select super m select select m cb set margin new insets 0 0 0 0 m cb set horizontal alignment j label center vrowideditor m_select m_cb setmargin m_cb sethorizontalalignment jlabel enable selection to be displayed public void set enable selection boolean show selection m select show selection setenableselection showselection m_select showselection ask the editor if it can start editing using an event this method is intended for the use of client to avoid the cost of setting up and installing the editor component if editing is not possible if editing can be started this method returns true public boolean is cell editable event object an event return m select anevent iscelleditable eventobject anevent m_select sets an initial value for the editor this will cause the editor to stop editing and lose any partially edited value if the editor is editing when this method is called returns the component that should be added to the client s component hierarchy once installed in the client s hierarchy this component will then be able to draw and receive user input public component get table cell editor component j table table object value boolean is selected int row int col log fine value value row row col col m rid object value if m rid null m rid 1 null m cb set selected false else boolean sel boolean m rid 1 m cb set selected sel boolean value return m cb stopediting gettablecelleditorcomponent jtable isselected m_rid m_rid m_rid m_cb setselected m_rid m_cb setselected booleanvalue m_cb the editing cell should be selected or not public boolean should select cell event object an event return m select shouldselectcell eventobject anevent m_select returns the value contained in the editor public object get cell editor value log fine m cb is selected if m rid null return null m rid 1 new boolean m cb is selected return m rid getcelleditorvalue m_cb isselected m_rid m_rid m_cb isselected m_rid basic constructor you need to set the attributes using the set methods public link full constructor param href href param rel rel param type type public link string href string rel string type this set href href set rel rel set type type sethref setrel settype set href param href href return this public link set href string href add attribute href href return this sethref addattribute sets the target attribute param target the target attribute public link set target string target add attribute target target return this settarget addattribute sets the rel attribute param rel the rel attribute public link set rel string rel add attribute rel rel return this setrel addattribute sets the rev attribute param rev the rev attribute public link set rev string rev add attribute rev rev return this setrev addattribute sets the charset attribute param charset the charset attribute public link set charset string charset add attribute charset charset return this setcharset addattribute sets the type attribute param type set the mime type of this link public link set type string type add attribute type type return this settype addattribute sets the media attribute param media the media attribute public link set media string media add attribute media media return this setmedia addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public link add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public link add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public link add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public link add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public link remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get m group from cache param ctx context param r group id id return m group public static m group get properties ctx int r group id integer key new integer r group id m group ret value m group s cache get key if ret value null return ret value ret value new m group ctx r group id null if ret value get id 0 s cache put key ret value return ret value mgroup r_group_id mgroup mgroup r_group_id r_group_id mgroup retvalue mgroup s_cache retvalue retvalue retvalue mgroup r_group_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param r group id group param trx name trx public m group properties ctx int r group id string trx name super ctx r group id trx name r_group_id trxname mgroup r_group_id trxname r_group_id trxname load constructor param ctx context param rs result set param trx name trx public m group properties ctx result set rs string trx name super ctx rs trx name trxname mgroup resultset trxname trxname get tree node param tree tree param node id node return node or null public static mtree nodemm get mtree base tree int node id mtree nodemm ret value null string sql select from ad treenodemm where ad tree id and node id prepared statement pstmt null try pstmt db prepare statement sql tree get trxname pstmt set int 1 tree getad tree id pstmt set int 2 node id result set rs pstmt execute query if rs next ret value new mtree nodemm tree get ctx rs tree get trxname rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value node_id mtree_nodemm mtree_base node_id mtree_nodemm retvalue ad_treenodemm ad_tree_id node_id preparedstatement preparestatement get_trxname setint getad_tree_id setint node_id resultset executequery retvalue mtree_nodemm getctx get_trxname s_log retvalue load constructor param ctx context param rs result set public mtree nodemm properties ctx result set rs string trx name super ctx rs trx name mtree_nodemm resultset trxname trxname full constructor param tree tree param node id node public mtree nodemm mtree base tree int node id super tree get ctx 0 tree get trxname set client org tree setad tree id tree getad tree id setnode id node id add to root setparent id 0 set seq no 0 node_id mtree_nodemm mtree_base node_id getctx get_trxname setclientorg setad_tree_id getad_tree_id setnode_id node_id setparent_id setseqno standard constructor public x m product costing properties ctx int m product costing id string trx name super ctx m product costing id trx name if m product costing id 0 setc acctschema id 0 set cost average env zero set cost average cum amt env zero set cost average cum qty env zero set cost standard env zero set cost standard cum amt env zero set cost standard cum qty env zero set cost standardpo amt env zero set cost standardpo qty env zero set current cost price env zero set future cost price env zero setm product id 0 set price last inv env zero set price lastpo env zero set total inv amt env zero set total inv qty env zero x_m_product_costing m_product_costing_id trxname m_product_costing_id trxname m_product_costing_id setc_acctschema_id setcostaverage setcostaveragecumamt setcostaveragecumqty setcoststandard setcoststandardcumamt setcoststandardcumqty setcoststandardpoamt setcoststandardpoqty setcurrentcostprice setfuturecostprice setm_product_id setpricelastinv setpricelastpo settotalinvamt settotalinvqty load constructor public x m product costing properties ctx result set rs string trx name super ctx rs trx name x_m_product_costing resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product costing append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_costing get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set average cost weighted average costs public void set cost average big decimal cost average if cost average null throw new illegal argument exception cost average is mandatory set valuenocheck cost average cost average setcostaverage bigdecimal costaverage costaverage illegalargumentexception costaverage set_valuenocheck costaverage costaverage get average cost weighted average costs public big decimal get cost average big decimal bd big decimal get value cost average if bd null return env zero return bd bigdecimal getcostaverage bigdecimal bigdecimal get_value costaverage set average cost amount sum cumulative average cost amounts internal public void set cost average cum amt big decimal cost average cum amt if cost average cum amt null throw new illegal argument exception cost average cum amt is mandatory set valuenocheck cost average cum amt cost average cum amt setcostaveragecumamt bigdecimal costaveragecumamt costaveragecumamt illegalargumentexception costaveragecumamt set_valuenocheck costaveragecumamt costaveragecumamt get average cost amount sum cumulative average cost amounts internal public big decimal get cost average cum amt big decimal bd big decimal get value cost average cum amt if bd null return env zero return bd bigdecimal getcostaveragecumamt bigdecimal bigdecimal get_value costaveragecumamt set average cost quantity sum cumulative average cost quantities internal public void set cost average cum qty big decimal cost average cum qty if cost average cum qty null throw new illegal argument exception cost average cum qty is mandatory set valuenocheck cost average cum qty cost average cum qty setcostaveragecumqty bigdecimal costaveragecumqty costaveragecumqty illegalargumentexception costaveragecumqty set_valuenocheck costaveragecumqty costaveragecumqty get average cost quantity sum cumulative average cost quantities internal public big decimal get cost average cum qty big decimal bd big decimal get value cost average cum qty if bd null return env zero return bd bigdecimal getcostaveragecumqty bigdecimal bigdecimal get_value costaveragecumqty set standard cost standard costs public void set cost standard big decimal cost standard if cost standard null throw new illegal argument exception cost standard is mandatory set valuenocheck cost standard cost standard setcoststandard bigdecimal coststandard coststandard illegalargumentexception coststandard set_valuenocheck coststandard coststandard get standard cost standard costs public big decimal get cost standard big decimal bd big decimal get value cost standard if bd null return env zero return bd bigdecimal getcoststandard bigdecimal bigdecimal get_value coststandard set std cost amount sum standard cost invoice amount sum internal public void set cost standard cum amt big decimal cost standard cum amt if cost standard cum amt null throw new illegal argument exception cost standard cum amt is mandatory set valuenocheck cost standard cum amt cost standard cum amt setcoststandardcumamt bigdecimal coststandardcumamt coststandardcumamt illegalargumentexception coststandardcumamt set_valuenocheck coststandardcumamt coststandardcumamt get std cost amount sum standard cost invoice amount sum internal public big decimal get cost standard cum amt big decimal bd big decimal get value cost standard cum amt if bd null return env zero return bd bigdecimal getcoststandardcumamt bigdecimal bigdecimal get_value coststandardcumamt set std cost quantity sum standard cost invoice quantity sum internal public void set cost standard cum qty big decimal cost standard cum qty if cost standard cum qty null throw new illegal argument exception cost standard cum qty is mandatory set valuenocheck cost standard cum qty cost standard cum qty setcoststandardcumqty bigdecimal coststandardcumqty coststandardcumqty illegalargumentexception coststandardcumqty set_valuenocheck coststandardcumqty coststandardcumqty get std cost quantity sum standard cost invoice quantity sum internal public big decimal get cost standard cum qty big decimal bd big decimal get value cost standard cum qty if bd null return env zero return bd bigdecimal getcoststandardcumqty bigdecimal bigdecimal get_value coststandardcumqty set std po cost amount sum standard cost purchase order amount sum internal public void set cost standardpo amt big decimal cost standardpo amt if cost standardpo amt null throw new illegal argument exception cost standardpo amt is mandatory set valuenocheck cost standardpo amt cost standardpo amt setcoststandardpoamt bigdecimal coststandardpoamt coststandardpoamt illegalargumentexception coststandardpoamt set_valuenocheck coststandardpoamt coststandardpoamt get std po cost amount sum standard cost purchase order amount sum internal public big decimal get cost standardpo amt big decimal bd big decimal get value cost standardpo amt if bd null return env zero return bd bigdecimal getcoststandardpoamt bigdecimal bigdecimal get_value coststandardpoamt set std po cost quantity sum standard cost purchase order quantity sum internal public void set cost standardpo qty big decimal cost standardpo qty if cost standardpo qty null throw new illegal argument exception cost standardpo qty is mandatory set valuenocheck cost standardpo qty cost standardpo qty setcoststandardpoqty bigdecimal coststandardpoqty coststandardpoqty illegalargumentexception coststandardpoqty set_valuenocheck coststandardpoqty coststandardpoqty get std po cost quantity sum standard cost purchase order quantity sum internal public big decimal get cost standardpo qty big decimal bd big decimal get value cost standardpo qty if bd null return env zero return bd bigdecimal getcoststandardpoqty bigdecimal bigdecimal get_value coststandardpoqty set current cost price the currently used cost price public void set current cost price big decimal current cost price if current cost price null throw new illegal argument exception current cost price is mandatory set value current cost price current cost price setcurrentcostprice bigdecimal currentcostprice currentcostprice illegalargumentexception currentcostprice set_value currentcostprice currentcostprice get current cost price the currently used cost price public big decimal get current cost price big decimal bd big decimal get value current cost price if bd null return env zero return bd bigdecimal getcurrentcostprice bigdecimal bigdecimal get_value currentcostprice set future cost price public void set future cost price big decimal future cost price if future cost price null throw new illegal argument exception future cost price is mandatory set value future cost price future cost price setfuturecostprice bigdecimal futurecostprice futurecostprice illegalargumentexception futurecostprice set_value futurecostprice futurecostprice get future cost price public big decimal get future cost price big decimal bd big decimal get value future cost price if bd null return env zero return bd bigdecimal getfuturecostprice bigdecimal bigdecimal get_value futurecostprice set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set last invoice price price of the last invoice for the product public void set price last inv big decimal price last inv if price last inv null throw new illegal argument exception price last inv is mandatory set valuenocheck price last inv price last inv setpricelastinv bigdecimal pricelastinv pricelastinv illegalargumentexception pricelastinv set_valuenocheck pricelastinv pricelastinv get last invoice price price of the last invoice for the product public big decimal get price last inv big decimal bd big decimal get value price last inv if bd null return env zero return bd bigdecimal getpricelastinv bigdecimal bigdecimal get_value pricelastinv set last po price price of the last purchase order for the product public void set price lastpo big decimal price lastpo if price lastpo null throw new illegal argument exception price lastpo is mandatory set valuenocheck price lastpo price lastpo setpricelastpo bigdecimal pricelastpo pricelastpo illegalargumentexception pricelastpo set_valuenocheck pricelastpo pricelastpo get last po price price of the last purchase order for the product public big decimal get price lastpo big decimal bd big decimal get value price lastpo if bd null return env zero return bd bigdecimal getpricelastpo bigdecimal bigdecimal get_value pricelastpo set total invoice amount cumulative total lifetime invoice amount public void set total inv amt big decimal total inv amt if total inv amt null throw new illegal argument exception total inv amt is mandatory set valuenocheck total inv amt total inv amt settotalinvamt bigdecimal totalinvamt totalinvamt illegalargumentexception totalinvamt set_valuenocheck totalinvamt totalinvamt get total invoice amount cumulative total lifetime invoice amount public big decimal get total inv amt big decimal bd big decimal get value total inv amt if bd null return env zero return bd bigdecimal gettotalinvamt bigdecimal bigdecimal get_value totalinvamt set total invoice quantity cumulative total lifetime invoice quantity public void set total inv qty big decimal total inv qty if total inv qty null throw new illegal argument exception total inv qty is mandatory set valuenocheck total inv qty total inv qty settotalinvqty bigdecimal totalinvqty totalinvqty illegalargumentexception totalinvqty set_valuenocheck totalinvqty totalinvqty get total invoice quantity cumulative total lifetime invoice quantity public big decimal get total inv qty big decimal bd big decimal get value total inv qty if bd null return env zero return bd bigdecimal gettotalinvqty bigdecimal bigdecimal get_value totalinvqty standard constructor public x c rfqlineqty properties ctx int c rfqlineqty id string trx name super ctx c rfqlineqty id trx name if c rfqlineqty id 0 set benchmark price env zero setc rfqlineqty id 0 setc rfqline id 0 setc uom id 0 set is offer qty false set is purchase qty false set is rfq qty true y set qty env zero 1 x_c_rfqlineqty c_rfqlineqty_id trxname c_rfqlineqty_id trxname c_rfqlineqty_id setbenchmarkprice setc_rfqlineqty_id setc_rfqline_id setc_uom_id setisofferqty setispurchaseqty setisrfqqty setqty load constructor public x c rfqlineqty properties ctx result set rs string trx name super ctx rs trx name x_c_rfqlineqty resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfqlineqty append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfqlineqty get_id tostring set benchmark price price to compare responses to public void set benchmark price big decimal benchmark price if benchmark price null throw new illegal argument exception benchmark price is mandatory set value benchmark price benchmark price setbenchmarkprice bigdecimal benchmarkprice benchmarkprice illegalargumentexception benchmarkprice set_value benchmarkprice benchmarkprice get benchmark price price to compare responses to public big decimal get benchmark price big decimal bd big decimal get value benchmark price if bd null return env zero return bd bigdecimal getbenchmarkprice bigdecimal bigdecimal get_value benchmarkprice set best response amount best response amount public void set best response amt big decimal best response amt set value best response amt best response amt setbestresponseamt bigdecimal bestresponseamt set_value bestresponseamt bestresponseamt get best response amount best response amount public big decimal get best response amt big decimal bd big decimal get value best response amt if bd null return env zero return bd bigdecimal getbestresponseamt bigdecimal bigdecimal get_value bestresponseamt set rfq line quantity request for quotation line quantity public void setc rfqlineqty id int c rfqlineqty id if c rfqlineqty id 1 throw new illegal argument exception c rfqlineqty id is mandatory set valuenocheck c rfqlineqty id new integer c rfqlineqty id setc_rfqlineqty_id c_rfqlineqty_id c_rfqlineqty_id illegalargumentexception c_rfqlineqty_id set_valuenocheck c_rfqlineqty_id c_rfqlineqty_id get rfq line quantity request for quotation line quantity public int getc rfqlineqty id integer ii integer get value c rfqlineqty id if ii null return 0 return ii int value getc_rfqlineqty_id get_value c_rfqlineqty_id intvalue set rfq line request for quotation line public void setc rfqline id int c rfqline id if c rfqline id 1 throw new illegal argument exception c rfqline id is mandatory set valuenocheck c rfqline id new integer c rfqline id setc_rfqline_id c_rfqline_id c_rfqline_id illegalargumentexception c_rfqline_id set_valuenocheck c_rfqline_id c_rfqline_id get rfq line request for quotation line public int getc rfqline id integer ii integer get value c rfqline id if ii null return 0 return ii int value getc_rfqline_id get_value c_rfqline_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc uom id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_uom_id set offer quantity this quantity is used in the offer to the customer public void set is offer qty boolean is offer qty set value is offer qty new boolean is offer qty setisofferqty isofferqty set_value isofferqty isofferqty get offer quantity this quantity is used in the offer to the customer public boolean is offer qty object oo get value is offer qty if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isofferqty get_value isofferqty booleanvalue set purchase quantity this quantity is used in the purchase order to the supplier public void set is purchase qty boolean is purchase qty set value is purchase qty new boolean is purchase qty setispurchaseqty ispurchaseqty set_value ispurchaseqty ispurchaseqty get purchase quantity this quantity is used in the purchase order to the supplier public boolean is purchase qty object oo get value is purchase qty if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispurchaseqty get_value ispurchaseqty booleanvalue set rfq quantity the quantity is used when generating rfq responses public void set is rfq qty boolean is rfq qty set value is rfq qty new boolean is rfq qty setisrfqqty isrfqqty set_value isrfqqty isrfqqty get rfq quantity the quantity is used when generating rfq responses public boolean is rfq qty object oo get value is rfq qty if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrfqqty get_value isrfqqty booleanvalue set margin margin for a product as a percentage public void set margin big decimal margin set value margin margin setmargin bigdecimal set_value get margin margin for a product as a percentage public big decimal get margin big decimal bd big decimal get value margin if bd null return env zero return bd bigdecimal getmargin bigdecimal bigdecimal get_value set offer amount amount of the offer public void set offer amt big decimal offer amt set value offer amt offer amt setofferamt bigdecimal offeramt set_value offeramt offeramt get offer amount amount of the offer public big decimal get offer amt big decimal bd big decimal get value offer amt if bd null return env zero return bd bigdecimal getofferamt bigdecimal bigdecimal get_value offeramt set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value standard constructor public x r request properties ctx int r request id string trx name super ctx r request id trx name if r request id 0 set confidential type null c set confidential type entry null c set document no null set due type null 5 set is escalated false set is invoiced false set is self service false n set priority null 5 set processed false setr requesttype id 0 setr request id 0 set request amt env zero setsalesrep id 0 ad user id set summary null x_r_request r_request_id trxname r_request_id trxname r_request_id setconfidentialtype setconfidentialtypeentry setdocumentno setduetype setisescalated setisinvoiced setisselfservice setpriority setprocessed setr_requesttype_id setr_request_id setrequestamt setsalesrep_id ad_user_id setsummary load constructor public x r request properties ctx result set rs string trx name super ctx rs trx name x_r_request resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r request append get id append return sb to string tostring stringbuffer stringbuffer x_r_request get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 set value ad role id null else set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_value ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set valuenocheck ad table id null else set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_valuenocheck ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c invoicerequest id ad reference id 336 set request invoice the generated invoice for this request public void setc invoicerequest id int c invoicerequest id if c invoicerequest id 0 set valuenocheck c invoicerequest id null else set valuenocheck c invoicerequest id new integer c invoicerequest id c_invoicerequest_id_ad_reference_id setc_invoicerequest_id c_invoicerequest_id c_invoicerequest_id set_valuenocheck c_invoicerequest_id set_valuenocheck c_invoicerequest_id c_invoicerequest_id get request invoice the generated invoice for this request public int getc invoicerequest id integer ii integer get value c invoicerequest id if ii null return 0 return ii int value getc_invoicerequest_id get_value c_invoicerequest_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set close date close date public void set close date timestamp close date set value close date close date setclosedate closedate set_value closedate closedate get close date close date public timestamp get close date return timestamp get value close date getclosedate get_value closedate public static final string confidentialtype privateinformation p set confidentiality type of confidentiality public void set confidential type string confidential type if confidential type null throw new illegal argument exception confidential type is mandatory if confidential type equals a confidential type equals c confidential type equals i confidential type equals p else throw new illegal argument exception confidential type invalid value confidential type reference id 340 a c i p if confidential type length 1 log warning length 1 truncated confidential type confidential type substring 0 0 set value confidential type confidential type confidentialtype_privateinformation setconfidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype confidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype reference_id confidentialtype confidentialtype confidentialtype set_value confidentialtype confidentialtype get confidentiality type of confidentiality public string get confidential type return string get value confidential type getconfidentialtype get_value confidentialtype public static final string confidentialtypeentry privateinformation p set entry confidentiality confidentiality of the individual entry public void set confidential type entry string confidential type entry if confidential type entry null throw new illegal argument exception confidential type entry is mandatory if confidential type entry equals a confidential type entry equals c confidential type entry equals i confidential type entry equals p else throw new illegal argument exception confidential type entry invalid value confidential type entry reference id 340 a c i p if confidential type entry length 1 log warning length 1 truncated confidential type entry confidential type entry substring 0 0 set value confidential type entry confidential type entry confidentialtypeentry_privateinformation setconfidentialtypeentry confidentialtypeentry confidentialtypeentry illegalargumentexception confidentialtypeentry confidentialtypeentry confidentialtypeentry confidentialtypeentry confidentialtypeentry illegalargumentexception confidentialtypeentry confidentialtypeentry reference_id confidentialtypeentry confidentialtypeentry confidentialtypeentry set_value confidentialtypeentry confidentialtypeentry get entry confidentiality confidentiality of the individual entry public string get confidential type entry return string get value confidential type entry getconfidentialtypeentry get_value confidentialtypeentry set complete plan planned completion date public void set date complete plan timestamp date complete plan set value date complete plan date complete plan setdatecompleteplan datecompleteplan set_value datecompleteplan datecompleteplan get complete plan planned completion date public timestamp get date complete plan return timestamp get value date complete plan getdatecompleteplan get_value datecompleteplan set date last action date this request was last acted on public void set date last action timestamp date last action set valuenocheck date last action date last action setdatelastaction datelastaction set_valuenocheck datelastaction datelastaction get date last action date this request was last acted on public timestamp get date last action return timestamp get value date last action getdatelastaction get_value datelastaction set last alert date when last alert were sent public void set date last alert timestamp date last alert set value date last alert date last alert setdatelastalert datelastalert set_value datelastalert datelastalert get last alert date when last alert were sent public timestamp get date last alert return timestamp get value date last alert getdatelastalert get_value datelastalert set date next action date that this request should be acted on public void set date next action timestamp date next action set value date next action date next action setdatenextaction datenextaction set_value datenextaction datenextaction get date next action date that this request should be acted on public timestamp get date next action return timestamp get value date next action getdatenextaction get_value datenextaction set start plan planned start date public void set date start plan timestamp date start plan set value date start plan date start plan setdatestartplan datestartplan set_value datestartplan datestartplan get start plan planned start date public timestamp get date start plan return timestamp get value date start plan getdatestartplan get_value datestartplan set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno public static final string duetype scheduled 7 set due type status of the next action for this request public void set due type string due type if due type null throw new illegal argument exception due type is mandatory if due type equals 3 due type equals 5 due type equals 7 else throw new illegal argument exception due type invalid value due type reference id 222 3 5 7 if due type length 1 log warning length 1 truncated due type due type substring 0 0 set value due type due type duetype_scheduled setduetype duetype duetype illegalargumentexception duetype duetype duetype duetype illegalargumentexception duetype duetype reference_id duetype duetype duetype set_value duetype duetype get due type status of the next action for this request public string get due type return string get value due type getduetype get_value duetype set end time end of the time span public void set end time timestamp end time set value end time end time setendtime endtime set_value endtime endtime get end time end of the time span public timestamp get end time return timestamp get value end time getendtime get_value endtime set escalated this request has been escalated public void set is escalated boolean is escalated set value is escalated new boolean is escalated setisescalated isescalated set_value isescalated isescalated get escalated this request has been escalated public boolean is escalated object oo get value is escalated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isescalated get_value isescalated booleanvalue set invoiced is this invoiced public void set is invoiced boolean is invoiced set value is invoiced new boolean is invoiced setisinvoiced isinvoiced set_value isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set valuenocheck is self service new boolean is self service setisselfservice isselfservice set_valuenocheck isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set last result result of last contact public void set last result string last result if last result null last result length 2000 log warning length 2000 truncated last result last result substring 0 1999 set value last result last result setlastresult lastresult lastresult lastresult lastresult lastresult set_value lastresult lastresult get last result result of last contact public string get last result return string get value last result getlastresult get_value lastresult set change request bom engineering change request public void setm changerequest id int m changerequest id if m changerequest id 0 set value m changerequest id null else set value m changerequest id new integer m changerequest id setm_changerequest_id m_changerequest_id m_changerequest_id set_value m_changerequest_id set_value m_changerequest_id m_changerequest_id get change request bom engineering change request public int getm changerequest id integer ii integer get value m changerequest id if ii null return 0 return ii int value getm_changerequest_id get_value m_changerequest_id intvalue public static final int m fixchangenotice id ad reference id 351 set fixed in fixed in change notice public void setm fixchangenotice id int m fixchangenotice id if m fixchangenotice id 0 set value m fixchangenotice id null else set value m fixchangenotice id new integer m fixchangenotice id m_fixchangenotice_id_ad_reference_id setm_fixchangenotice_id m_fixchangenotice_id m_fixchangenotice_id set_value m_fixchangenotice_id set_value m_fixchangenotice_id m_fixchangenotice_id get fixed in fixed in change notice public int getm fixchangenotice id integer ii integer get value m fixchangenotice id if ii null return 0 return ii int value getm_fixchangenotice_id get_value m_fixchangenotice_id intvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 0 set value m inout id null else set value m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id set_value m_inout_id set_value m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue public static final int m productspent id ad reference id 162 set product used product resource service used in request public void setm productspent id int m productspent id if m productspent id 0 set value m productspent id null else set value m productspent id new integer m productspent id m_productspent_id_ad_reference_id setm_productspent_id m_productspent_id m_productspent_id set_value m_productspent_id set_value m_productspent_id m_productspent_id get product used product resource service used in request public int getm productspent id integer ii integer get value m productspent id if ii null return 0 return ii int value getm_productspent_id get_value m_productspent_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set rma return material authorization public void setm rma id int m rma id if m rma id 0 set value m rma id null else set value m rma id new integer m rma id setm_rma_id m_rma_id m_rma_id set_value m_rma_id set_value m_rma_id m_rma_id get rma return material authorization public int getm rma id integer ii integer get value m rma id if ii null return 0 return ii int value getm_rma_id get_value m_rma_id intvalue public static final string nextaction none n set next action next action to be taken public void set next action string next action if next action null throw new illegal argument exception next action is mandatory if next action null next action equals f next action equals n else throw new illegal argument exception next action invalid value next action reference id 219 f n if next action null next action length 1 log warning length 1 truncated next action next action substring 0 0 set value next action next action nextaction_none setnextaction nextaction nextaction illegalargumentexception nextaction nextaction nextaction nextaction illegalargumentexception nextaction nextaction reference_id nextaction nextaction nextaction nextaction set_value nextaction nextaction get next action next action to be taken public string get next action return string get value next action getnextaction get_value nextaction public static final string priority minor 9 set priority indicates if this request is of a high medium or low priority public void set priority string priority if priority null throw new illegal argument exception priority is mandatory if priority equals 1 priority equals 3 priority equals 5 priority equals 7 priority equals 9 else throw new illegal argument exception priority invalid value priority reference id 154 1 3 5 7 9 if priority length 1 log warning length 1 truncated priority priority substring 0 0 set value priority priority priority_minor setpriority illegalargumentexception illegalargumentexception reference_id set_value get priority indicates if this request is of a high medium or low priority public string get priority return string get value priority getpriority get_value public static final string priorityuser minor 9 set user importance priority of the issue for the user public void set priority user string priority user if priority user null throw new illegal argument exception priority user is mandatory if priority user null priority user equals 1 priority user equals 3 priority user equals 5 priority user equals 7 priority user equals 9 else throw new illegal argument exception priority user invalid value priority user reference id 154 1 3 5 7 9 if priority user null priority user length 1 log warning length 1 truncated priority user priority user substring 0 0 set value priority user priority user priorityuser_minor setpriorityuser priorityuser priorityuser illegalargumentexception priorityuser priorityuser priorityuser priorityuser priorityuser priorityuser priorityuser illegalargumentexception priorityuser priorityuser reference_id priorityuser priorityuser priorityuser priorityuser set_value priorityuser priorityuser get user importance priority of the issue for the user public string get priority user return string get value priority user getpriorityuser get_value priorityuser set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set quantity plan planned quantity public void set qty plan big decimal qty plan set value qty plan qty plan setqtyplan bigdecimal qtyplan set_value qtyplan qtyplan get quantity plan planned quantity public big decimal get qty plan big decimal bd big decimal get value qty plan if bd null return env zero return bd bigdecimal getqtyplan bigdecimal bigdecimal get_value qtyplan set quantity used quantity used for this event public void set qty spent big decimal qty spent set value qty spent qty spent setqtyspent bigdecimal qtyspent set_value qtyspent qtyspent get quantity used quantity used for this event public big decimal get qty spent big decimal bd big decimal get value qty spent if bd null return env zero return bd bigdecimal getqtyspent bigdecimal bigdecimal get_value qtyspent set category request category public void setr category id int r category id if r category id 0 set value r category id null else set value r category id new integer r category id setr_category_id r_category_id r_category_id set_value r_category_id set_value r_category_id r_category_id get category request category public int getr category id integer ii integer get value r category id if ii null return 0 return ii int value getr_category_id get_value r_category_id intvalue set group request group public void setr group id int r group id if r group id 0 set value r group id null else set value r group id new integer r group id setr_group_id r_group_id r_group_id set_value r_group_id set_value r_group_id r_group_id get group request group public int getr group id integer ii integer get value r group id if ii null return 0 return ii int value getr_group_id get_value r_group_id intvalue set mail template text templates for mailings public void setr mailtext id int r mailtext id if r mailtext id 0 set value r mailtext id null else set value r mailtext id new integer r mailtext id setr_mailtext_id r_mailtext_id r_mailtext_id set_value r_mailtext_id set_value r_mailtext_id r_mailtext_id get mail template text templates for mailings public int getr mailtext id integer ii integer get value r mailtext id if ii null return 0 return ii int value getr_mailtext_id get_value r_mailtext_id intvalue public static final int r requestrelated id ad reference id 341 set related request related request master issue public void setr requestrelated id int r requestrelated id if r requestrelated id 0 set value r requestrelated id null else set value r requestrelated id new integer r requestrelated id r_requestrelated_id_ad_reference_id setr_requestrelated_id r_requestrelated_id r_requestrelated_id set_value r_requestrelated_id set_value r_requestrelated_id r_requestrelated_id get related request related request master issue public int getr requestrelated id integer ii integer get value r requestrelated id if ii null return 0 return ii int value getr_requestrelated_id get_value r_requestrelated_id intvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 1 throw new illegal argument exception r requesttype id is mandatory set value r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id illegalargumentexception r_requesttype_id set_value r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue set request request from a business partner or prospect public void setr request id int r request id if r request id 1 throw new illegal argument exception r request id is mandatory set valuenocheck r request id new integer r request id setr_request_id r_request_id r_request_id illegalargumentexception r_request_id set_valuenocheck r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue set resolution request resolution public void setr resolution id int r resolution id if r resolution id 0 set value r resolution id null else set value r resolution id new integer r resolution id setr_resolution_id r_resolution_id r_resolution_id set_value r_resolution_id set_value r_resolution_id r_resolution_id get resolution request resolution public int getr resolution id integer ii integer get value r resolution id if ii null return 0 return ii int value getr_resolution_id get_value r_resolution_id intvalue set standard response request standard response public void setr standardresponse id int r standardresponse id if r standardresponse id 0 set value r standardresponse id null else set value r standardresponse id new integer r standardresponse id setr_standardresponse_id r_standardresponse_id r_standardresponse_id set_value r_standardresponse_id set_value r_standardresponse_id r_standardresponse_id get standard response request standard response public int getr standardresponse id integer ii integer get value r standardresponse id if ii null return 0 return ii int value getr_standardresponse_id get_value r_standardresponse_id intvalue set status request status public void setr status id int r status id if r status id 0 set value r status id null else set value r status id new integer r status id setr_status_id r_status_id r_status_id set_value r_status_id set_value r_status_id r_status_id get status request status public int getr status id integer ii integer get value r status id if ii null return 0 return ii int value getr_status_id get_value r_status_id intvalue set record id direct internal record id public void setrecord id int record id if record id 0 set valuenocheck record id null else set valuenocheck record id new integer record id setrecord_id record_id record_id set_valuenocheck record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set request amount amount associated with this request public void set request amt big decimal request amt if request amt null throw new illegal argument exception request amt is mandatory set value request amt request amt setrequestamt bigdecimal requestamt requestamt illegalargumentexception requestamt set_value requestamt requestamt get request amount amount associated with this request public big decimal get request amt big decimal bd big decimal get value request amt if bd null return env zero return bd bigdecimal getrequestamt bigdecimal bigdecimal get_value requestamt set result result of the action taken public void set result string result if result null result length 2000 log warning length 2000 truncated result result substring 0 1999 set value result result setresult set_value get result result of the action taken public string get result return string get value result getresult get_value public static final int salesrep id ad reference id 286 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set start date first effective day inclusive public void set start date timestamp start date set value start date start date setstartdate startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate set start time time started public void set start time timestamp start time set value start time start time setstarttime starttime set_value starttime starttime get start time time started public timestamp get start time return timestamp get value start time getstarttime get_value starttime set summary textual summary of this request public void set summary string summary if summary null throw new illegal argument exception summary is mandatory if summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary illegalargumentexception set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value public static final string taskstatus 100complete d set task status status of the task public void set task status string task status if task status null throw new illegal argument exception task status is mandatory if task status null task status equals 0 task status equals 2 task status equals 4 task status equals 6 task status equals 8 task status equals 9 task status equals a task status equals c task status equals d else throw new illegal argument exception task status invalid value task status reference id 366 0 2 4 6 8 9 a c d if task status null task status length 1 log warning length 1 truncated task status task status substring 0 0 set value task status task status taskstatus_100complete settaskstatus taskstatus taskstatus illegalargumentexception taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus illegalargumentexception taskstatus taskstatus reference_id taskstatus taskstatus taskstatus taskstatus set_value taskstatus taskstatus get task status status of the task public string get task status return string get value task status gettaskstatus get_value taskstatus prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c order id p c order id big decimal para i get parameter int value else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_order_id p_c_order_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception int to c order id getrecord id log info from c order id p c order id to to c order id if to c order id 0 throw new illegal argument exception target c order id 0 if p c order id 0 throw new illegal argument exception source c order id 0 m order from new m order get ctx p c order id get trxname m order to new m order get ctx to c order id get trxname int no to copy lines from from false false no attributes return copied no doit to_c_order_id getrecord_id c_order_id p_c_order_id to_c_order_id to_c_order_id illegalargumentexception c_order_id p_c_order_id illegalargumentexception c_order_id morder morder getctx p_c_order_id get_trxname morder morder getctx to_c_order_id get_trxname copylinesfrom standard constructor public x pa sla measure properties ctx int pa sla measure id string trx name super ctx pa sla measure id trx name if pa sla measure id 0 set date trx new timestamp system current time millis set measure actual env zero setpa sla goal id 0 setpa sla measure id 0 set processed false x_pa_sla_measure pa_sla_measure_id trxname pa_sla_measure_id trxname pa_sla_measure_id setdatetrx currenttimemillis setmeasureactual setpa_sla_goal_id setpa_sla_measure_id setprocessed load constructor public x pa sla measure properties ctx result set rs string trx name super ctx rs trx name x_pa_sla_measure resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa sla measure append get id append return sb to string tostring stringbuffer stringbuffer x_pa_sla_measure get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set value date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_value datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx return timestamp get value date trx public key name pair get key name pair return new key name pair get id string value of get date trx get_value datetrx keynamepair getkeynamepair keynamepair get_id valueof getdatetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set measure actual actual value that has been measured public void set measure actual big decimal measure actual if measure actual null throw new illegal argument exception measure actual is mandatory set value measure actual measure actual setmeasureactual bigdecimal measureactual measureactual illegalargumentexception measureactual set_value measureactual measureactual get measure actual actual value that has been measured public big decimal get measure actual big decimal bd big decimal get value measure actual if bd null return env zero return bd bigdecimal getmeasureactual bigdecimal bigdecimal get_value measureactual set sla goal service level agreement goal public void setpa sla goal id int pa sla goal id if pa sla goal id 1 throw new illegal argument exception pa sla goal id is mandatory set valuenocheck pa sla goal id new integer pa sla goal id setpa_sla_goal_id pa_sla_goal_id pa_sla_goal_id illegalargumentexception pa_sla_goal_id set_valuenocheck pa_sla_goal_id pa_sla_goal_id get sla goal service level agreement goal public int getpa sla goal id integer ii integer get value pa sla goal id if ii null return 0 return ii int value getpa_sla_goal_id get_value pa_sla_goal_id intvalue set sla measure service level agreement measure public void setpa sla measure id int pa sla measure id if pa sla measure id 1 throw new illegal argument exception pa sla measure id is mandatory set valuenocheck pa sla measure id new integer pa sla measure id setpa_sla_measure_id pa_sla_measure_id pa_sla_measure_id illegalargumentexception pa_sla_measure_id set_valuenocheck pa_sla_measure_id pa_sla_measure_id get sla measure service level agreement measure public int getpa sla measure id integer ii integer get value pa sla measure id if ii null return 0 return ii int value getpa_sla_measure_id get_value pa_sla_measure_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 set value record id null else set value record id new integer record id setrecord_id record_id record_id set_value record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue prepare get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals doc action p docaction string para i get parameter p c invoicebatch id getrecord id processinfoparameter getparameter getparametername getparameter docaction p_docaction getparameter p_c_invoicebatch_id getrecord_id process invoice batch return message throws exception protected string do it throws exception log info c invoicebatch id p c invoicebatch id doc action p docaction if p c invoicebatch id 0 throw new compiere user error c invoicebatch id 0 m invoice batch batch new m invoice batch get ctx p c invoicebatch id get trxname if batch get id 0 throw new compiere user error not found c invoicebatch id p c invoicebatch id if batch is processed throw new compiere user error processed if batch get control amt signum 0 batch get control amt compare to batch get document amt 0 throw new compiere user error control amt document amt m invoice batch line lines batch get lines false for int i 0 i lines length i m invoice batch line line lines i if line getc invoice id 0 line getc invoiceline id 0 continue if m olddocumentno null m olddocumentno equals line get document no m oldc bpartner id line getc bpartner id m oldc bpartner location id line getc bpartner location id complete invoice new invoice if m invoice null m invoice new m invoice batch line if m invoice save throw new compiere user error cannot save invoice m olddocumentno line get document no m oldc bpartner id line getc bpartner id m oldc bpartner location id line getc bpartner location id if line is tax included m invoice is tax included rollback throw new compiere user error line line get line tax included inconsistent add line m invoice line invoice line new m invoice line m invoice invoice line set description line get description invoice line setc charge id line getc charge id invoice line set qty line get qty entered entered invoiced invoice line set price line get price entered invoice line setc tax id line getc tax id invoice line set tax amt line get tax amt invoice line set line net amt line get line net amt invoice line set line total amt line get line total amt if invoice line save rollback throw new compiere user error cannot save invoice line update batch line line setc invoice id m invoice getc invoice id line setc invoiceline id invoice line getc invoiceline id line save for all lines complete invoice batch set processed true batch save return m count doit c_invoicebatch_id p_c_invoicebatch_id docaction p_docaction p_c_invoicebatch_id compiereusererror c_invoicebatch_id minvoicebatch minvoicebatch getctx p_c_invoicebatch_id get_trxname get_id compiereusererror notfound c_invoicebatch_id p_c_invoicebatch_id isprocessed compiereusererror getcontrolamt getcontrolamt compareto getdocumentamt compiereusererror controlamt documentamt minvoicebatchline getlines minvoicebatchline getc_invoice_id getc_invoiceline_id m_olddocumentno m_olddocumentno getdocumentno m_oldc_bpartner_id getc_bpartner_id m_oldc_bpartner_location_id getc_bpartner_location_id completeinvoice m_invoice m_invoice minvoice m_invoice compiereusererror m_olddocumentno getdocumentno m_oldc_bpartner_id getc_bpartner_id m_oldc_bpartner_location_id getc_bpartner_location_id istaxincluded m_invoice istaxincluded compiereusererror getline taxincluded minvoiceline invoiceline minvoiceline m_invoice invoiceline setdescription getdescription invoiceline setc_charge_id getc_charge_id invoiceline setqty getqtyentered invoiceline setprice getpriceentered invoiceline setc_tax_id getc_tax_id invoiceline settaxamt gettaxamt invoiceline setlinenetamt getlinenetamt invoiceline setlinetotalamt getlinetotalamt invoiceline compiereusererror setc_invoice_id m_invoice getc_invoice_id setc_invoiceline_id invoiceline getc_invoiceline_id completeinvoice setprocessed m_count complete invoice private void complete invoice if m invoice null return m invoice set doc action p docaction m invoice process it p docaction m invoice save add log 0 m invoice get date invoiced m invoice get grand total m invoice get document no m count m invoice null completeinvoice m_invoice m_invoice setdocaction p_docaction m_invoice processit p_docaction m_invoice addlog m_invoice getdateinvoiced m_invoice getgrandtotal m_invoice getdocumentno m_count m_invoice standard constructor public x m requisition properties ctx int m requisition id string trx name super ctx m requisition id trx name if m requisition id 0 setad user id 0 setc doctype id 0 set date doc new timestamp system current time millis date set date required new timestamp system current time millis set doc action null co set doc status null dr set document no null set is approved false setm pricelist id 0 setm requisition id 0 set posted false set priority rule null 5 set processed false set total lines env zero x_m_requisition m_requisition_id trxname m_requisition_id trxname m_requisition_id setad_user_id setc_doctype_id setdatedoc currenttimemillis setdaterequired currenttimemillis setdocaction setdocstatus setdocumentno setisapproved setm_pricelist_id setm_requisition_id setposted setpriorityrule setprocessed settotallines load constructor public x m requisition properties ctx result set rs string trx name super ctx rs trx name x_m_requisition resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m requisition append get id append return sb to string tostring stringbuffer stringbuffer x_m_requisition get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set document date date of the document public void set date doc timestamp date doc if date doc null throw new illegal argument exception date doc is mandatory set value date doc date doc setdatedoc datedoc datedoc illegalargumentexception datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set date required date when required public void set date required timestamp date required if date required null throw new illegal argument exception date required is mandatory set value date required date required setdaterequired daterequired daterequired illegalargumentexception daterequired set_value daterequired daterequired get date required date when required public timestamp get date required return timestamp get value date required getdaterequired get_value daterequired set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set requisition material requisition public void setm requisition id int m requisition id if m requisition id 1 throw new illegal argument exception m requisition id is mandatory set valuenocheck m requisition id new integer m requisition id setm_requisition_id m_requisition_id m_requisition_id illegalargumentexception m_requisition_id set_valuenocheck m_requisition_id m_requisition_id get requisition material requisition public int getm requisition id integer ii integer get value m requisition id if ii null return 0 return ii int value getm_requisition_id get_value m_requisition_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue public static final string priorityrule minor 9 set priority priority of a document public void set priority rule string priority rule if priority rule null throw new illegal argument exception priority rule is mandatory if priority rule equals 1 priority rule equals 3 priority rule equals 5 priority rule equals 7 priority rule equals 9 else throw new illegal argument exception priority rule invalid value priority rule reference id 154 1 3 5 7 9 if priority rule length 1 log warning length 1 truncated priority rule priority rule substring 0 0 set value priority rule priority rule priorityrule_minor setpriorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule priorityrule priorityrule priorityrule priorityrule illegalargumentexception priorityrule priorityrule reference_id priorityrule priorityrule priorityrule set_value priorityrule priorityrule get priority priority of a document public string get priority rule return string get value priority rule getpriorityrule get_value priorityrule set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set total lines total of all document lines public void set total lines big decimal total lines if total lines null throw new illegal argument exception total lines is mandatory set value total lines total lines settotallines bigdecimal totallines totallines illegalargumentexception totallines set_value totallines totallines get total lines total of all document lines public big decimal get total lines big decimal bd big decimal get value total lines if bd null return env zero return bd bigdecimal gettotallines bigdecimal bigdecimal get_value totallines constructor for modal about dialog param parent parent public about box j frame parent super parent true try jb init catch exception e system out println e get message label version set text compiere main version compiere date version label copyright set text compiere copyright info area set text c log mgt get info null to string create 5 pt border dimension d image control get preferred size image control set preferred size new dimension d width 10 d height 10 a env position center window parent this aboutbox jframe jbinit getmessage labelversion settext main_version date_version labelcopyright settext infoarea settext clogmgt getinfo tostring imagecontrol getpreferredsize imagecontrol setpreferredsize aenv positioncenterwindow init throws exception private void jb init throws exception this set title msg translate env get ctx about set resizable false label heading set font new java awt font dialog 1 14 label heading set horizontal alignment swing constants center label heading set horizontal text position swing constants center label heading set text smart erp crm business solution label version set horizontal alignment swing constants center label version set horizontal text position swing constants center label version set text label copyright set horizontal alignment swing constants center label copyright set horizontal text position swing constants center label copyright set text label description set foreground color blue label description set horizontal alignment swing constants center label description set horizontal text position swing constants center label description set text compiere geturl image control set font new java awt font serif 2 10 image control set foreground color blue image control set alignmentx float 0 5 image control set horizontal alignment swing constants center image control set horizontal text position swing constants center image control set icon compiere get image icon logo image control set text compiere get subtitle image control set vertical text position swing constants bottom main panel set layout main layout main layout set hgap 10 main layout set vgap 10 north panel set layout north layout north layout set hgap 10 north layout set vgap 10 panel set layout panel layout panel layout set hgap 10 panel layout set vgap 10 header panel set layout header layout header layout set columns 1 header layout set rows 4 info area set read write false this get content pane add panel null panel add north panel border layout north north panel add image control border layout west north panel add header panel border layout center header panel add label heading null header panel add label copyright null header panel add label version null header panel add label description null panel add main panel border layout center main panel add info area border layout center main panel add confirm panel border layout south confirm panel add action listener this jbinit settitle getctx setresizable labelheading setfont labelheading sethorizontalalignment swingconstants labelheading sethorizontaltextposition swingconstants labelheading settext labelversion sethorizontalalignment swingconstants labelversion sethorizontaltextposition swingconstants labelversion settext labelcopyright sethorizontalalignment swingconstants labelcopyright sethorizontaltextposition swingconstants labelcopyright settext labeldescription setforeground labeldescription sethorizontalalignment swingconstants labeldescription sethorizontaltextposition swingconstants labeldescription settext imagecontrol setfont imagecontrol setforeground imagecontrol setalignmentx imagecontrol sethorizontalalignment swingconstants imagecontrol sethorizontaltextposition swingconstants imagecontrol seticon getimageiconlogo imagecontrol settext getsubtitle imagecontrol setverticaltextposition swingconstants mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap northpanel setlayout northlayout northlayout sethgap northlayout setvgap setlayout panellayout panellayout sethgap panellayout setvgap headerpanel setlayout headerlayout headerlayout setcolumns headerlayout setrows infoarea setreadwrite getcontentpane northpanel borderlayout northpanel imagecontrol borderlayout northpanel headerpanel borderlayout headerpanel labelheading headerpanel labelcopyright headerpanel labelversion headerpanel labeldescription mainpanel borderlayout mainpanel infoarea borderlayout mainpanel confirmpanel borderlayout confirmpanel addactionlistener action listener param e event public void action performed action event e if e get action command equals confirm panel a ok dispose actionlistener actionperformed actionevent getactioncommand confirmpanel a_ok constructor param ctx context public m schedule properties ctx m ctx ctx mschedule m_ctx get assignments for timeframe pre resource is active and available resource un availability non business day resource type available pre param s resource id resource param start date start date param end date optional end date need to provide qty to calculate it param qty optional qty in resource type uom ignored if end date is not null param get all if true return all errors return array of existing assigments or null if free suppress warnings unchecked public m assignment slot get assignment slots int s resource id timestamp start date timestamp end date big decimal qty boolean get all string trx name log config start date to string if m s resource id s resource id get base info s resource id array list m assignment slot list new array list m assignment slot m assignment slot ma null if m isavailable ma new m assignment slot earliest latest msg get msg m ctx resource not available m assignment slot status notavailable if get all return new m assignment slot ma list add ma m startdate start date m enddate end date if m enddate null m enddate muom conversion get end date m ctx m startdate m c uom id qty log fine end date m enddate resource unavailability log fine unavailability string sql select description date from date to from s resourceunavailable where s resource id 1 and date to 2 start and date from 3 end and is active y try log fine sql id s resource id start m startdate end m enddate prepared statement pstmt db prepare statement sql trx name pstmt set int 1 m s resource id pstmt set timestamp 2 m startdate pstmt set timestamp 3 m enddate result set rs pstmt execute query while rs next ma new m assignment slot time util get day rs get timestamp 2 time util get next day rs get timestamp 3 user entered date need to convert to not including end time msg get msg m ctx resource un available rs get string 1 m assignment slot status unavailable log fine unavailable ma if get all create day slot list ma else list add ma rs close pstmt close catch sql exception e log log level severe sql e ma new m assignment slot earliest latest msg get msg m ctx resource un available e to string m assignment slot status unavailable if ma null get all return new m assignment slot ma non business day log fine non business day where trunc date1 between trunc and trunc causes ora 00932 inconsistent datatypes expected number got timestamp sql m role get default m ctx false add accesssql select name date1 from c nonbusinessday where trunc date1 between and c nonbusinessday false false not qualified ro try timestamp start day time util get day m startdate timestamp end day time util get day m enddate log fine sql start start day end end day prepared statement pstmt db prepare statement sql trx name pstmt set timestamp 1 start day pstmt set timestamp 2 end day result set rs pstmt execute query while rs next ma new m assignment slot time util get day rs get timestamp 2 time util get next day rs get timestamp 2 user entered date need to convert to not including end time msg get msg m ctx non business day rs get string 1 m assignment slot status nonbusinessday log finer non business day ma list add ma rs close pstmt close catch sql exception e log log level severe sql e ma new m assignment slot earliest latest msg get msg m ctx non business day e to string m assignment slot status nonbusinessday if ma null get all return new m assignment slot ma resource type available log fine resource type availability sql select name is time slot time slot start time slot end 1 4 is date slot on monday on tuesday on wednesday 5 8 on thursday on friday on saturday on sunday 9 12 from s resourcetype where s resourcetype id try prepared statement pstmt db prepare statement sql trx name pstmt set int 1 m s resourcetype id result set rs pstmt execute query if rs next m typename rs get string 1 time slot if y equals rs get string 2 m slotstarttime time util get day time m startdate rs get timestamp 3 m slotendtime time util get day time m enddate rs get timestamp 4 if time util in range m startdate m enddate m slotstarttime m slotendtime ma new m assignment slot m slotstarttime m slotendtime msg get msg m ctx resource not in slot time m typename m assignment slot status notinslottime if get all create time slot list rs get timestamp 3 rs get timestamp 4 time slot day slot if y equals rs get string 5 if time util in range m startdate m enddate y equals rs get string 6 y equals rs get string 7 mo tu y equals rs get string 8 y equals rs get string 9 y equals rs get string 10 we fr y equals rs get string 11 y equals rs get string 12 ma new m assignment slot m startdate m enddate msg get msg m ctx resource not in slot day m typename m assignment slot status notinslotday if get all create day slot list y equals rs get string 6 y equals rs get string 7 mo tu y equals rs get string 8 y equals rs get string 9 y equals rs get string 10 we fr y equals rs get string 11 y equals rs get string 12 day slot rs close pstmt close catch sql exception e log log level severe sql e ma new m assignment slot earliest latest msg get msg m ctx resource not in slot day e to string m assignment slot status nonbusinessday if ma null get all return new m assignment slot ma assignments sql select s resourceassignment id from s resourceassignment where s resource id 1 and assign date to 2 start and assign date from 3 end and is active y try prepared statement pstmt db prepare statement sql trx name pstmt set int 1 m s resource id pstmt set timestamp 2 m startdate pstmt set timestamp 3 m enddate result set rs pstmt execute query while rs next m resource assignment m assignment new m resource assignment env get ctx rs get int 1 trx name ma new m assignment slot m assignment if get all break list add ma rs close pstmt close catch sql exception e log log level severe sql e ma new m assignment slot earliest latest msg translate m ctx s r e to string m assignment slot status notconfirmed if ma null get all return new m assignment slot ma fill m timeslots required for layout create time slots clean list date range array list m assignment slot clean new array list m assignment slot list size for int i 0 i list size i m assignment slot mas m assignment slot list get i if mas get start time equals m startdate mas get start time after m startdate mas get end time equals m enddate mas get end time before m enddate clean add mas delete unavailability time slots when all day assigments exist m assignment slot sorted new m assignment slot clean size clean to array sorted arrays sort sorted new m assignment slot sorted by start end date list clear used as day list clean clear cleaned days timestamp sorted day null for int i 0 i sorted length i if sorted day null sorted day time util get day sorted i get start time if sorted day equals time util get day sorted i get start time list add sorted i else process info list clean layout slots list clean prepare next list clear list add sorted i sorted day time util get day sorted i get start time process info list clean layout slots list clean return m assignment slot ret value new m assignment slot clean size clean to array ret value arrays sort ret value new m assignment slot sorted by start end date return ret value unavailability nonbusinessday resourcetype s_resource_id start_date end_date resourcetype getall suppresswarnings massignmentslot getassignmentslots s_resource_id start_date end_date bigdecimal getall trxname start_date tostring m_s_resource_id s_resource_id getbaseinfo s_resource_id arraylist massignmentslot arraylist massignmentslot massignmentslot m_isavailable massignmentslot getmsg m_ctx resourcenotavailable massignmentslot status_notavailable getall massignmentslot m_startdate start_date m_enddate end_date m_enddate m_enddate muomconversion getenddate m_ctx m_startdate m_c_uom_id enddate m_enddate datefrom dateto s_resourceunavailable s_resource_id dateto datefrom isactive s_resource_id m_startdate m_enddate preparedstatement preparestatement trxname setint m_s_resource_id settimestamp m_startdate settimestamp m_enddate resultset executequery massignmentslot timeutil getday gettimestamp timeutil getnextday gettimestamp getmsg m_ctx resourceunavailable getstring massignmentslot status_unavailable getall createdayslot sqlexception massignmentslot getmsg m_ctx resourceunavailable tostring massignmentslot status_unavailable getall massignmentslot nonbusinessday nonbusinessday mrole getdefault m_ctx addaccesssql c_nonbusinessday c_nonbusinessday startday timeutil getday m_startdate endday timeutil getday m_enddate startday endday preparedstatement preparestatement trxname settimestamp startday settimestamp endday resultset executequery massignmentslot timeutil getday gettimestamp timeutil getnextday gettimestamp getmsg m_ctx nonbusinessday getstring massignmentslot status_nonbusinessday nonbusinessday sqlexception massignmentslot getmsg m_ctx nonbusinessday tostring massignmentslot status_nonbusinessday getall massignmentslot resourcetype resourcetypeavailability istimeslot timeslotstart timeslotend isdateslot onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday s_resourcetype s_resourcetype_id preparedstatement preparestatement trxname setint m_s_resourcetype_id resultset executequery m_typename getstring timeslot getstring m_slotstarttime timeutil getdaytime m_startdate gettimestamp m_slotendtime timeutil getdaytime m_enddate gettimestamp timeutil inrange m_startdate m_enddate m_slotstarttime m_slotendtime massignmentslot m_slotstarttime m_slotendtime getmsg m_ctx resourcenotinslottime m_typename massignmentslot status_notinslottime getall createtimeslot gettimestamp gettimestamp timeslot dayslot getstring timeutil inrange m_startdate m_enddate getstring getstring getstring getstring getstring getstring getstring massignmentslot m_startdate m_enddate getmsg m_ctx resourcenotinslotday m_typename massignmentslot status_notinslotday getall createdayslot getstring getstring getstring getstring getstring getstring getstring dayslot sqlexception massignmentslot getmsg m_ctx resourcenotinslotday tostring massignmentslot status_nonbusinessday getall massignmentslot s_resourceassignment_id s_resourceassignment s_resource_id assigndateto assigndatefrom isactive preparedstatement preparestatement trxname setint m_s_resource_id settimestamp m_startdate settimestamp m_enddate resultset executequery mresourceassignment massignment mresourceassignment getctx getint trxname massignmentslot massignment getall sqlexception massignmentslot m_ctx s_r tostring massignmentslot status_notconfirmed getall massignmentslot m_timeslots createtimeslots arraylist massignmentslot arraylist massignmentslot massignmentslot massignmentslot getstarttime m_startdate getstarttime m_startdate getendtime m_enddate getendtime m_enddate timeslots massignmentslot massignmentslot toarray massignmentslot sortedday sortedday sortedday timeutil getday getstarttime sortedday timeutil getday getstarttime layoutslots sortedday timeutil getday getstarttime layoutslots massignmentslot retvalue massignmentslot toarray retvalue retvalue massignmentslot retvalue copy valid slots of a day from list to clear and layout param list list with slos of the day param clean list with only valid slots suppress warnings unchecked private void layout slots array list m assignment slot list array list m assignment slot clean int size list size system out println start list size clean clean size if size 0 return else if size 1 m assignment slot mas m assignment slot list get 0 layouty mas clean add mas return delete unavailability time slots when all day assigments exist boolean all day false for int i 0 all day i size i m assignment slot mas m assignment slot list get i if mas get status m assignment slot status notavailable mas get status m assignment slot status unavailable mas get status m assignment slot status nonbusinessday mas get status m assignment slot status notinslotday all day true if all day delete time slot for int i 0 i list size i m assignment slot mas m assignment slot list get i if mas get status m assignment slot status notinslottime list remove i copy y layout remaining for int i 0 i list size i m assignment slot mas m assignment slot list get i layouty mas clean add mas x layout int max yslots m timeslots length int x slots new int max yslots number of parallel slots for int i 0 i list size i m assignment slot mas m assignment slot list get i for int y mas gety start y mas gety end y x slots y max parallel x slots int max xslots 0 for int y 0 y x slots length y if x slots y max xslots max xslots x slots y only one column if max xslots 2 for int i 0 i list size i m assignment slot mas m assignment slot list get i mas setx 0 1 return create xy matrix array list matrix new array list max xslots max yslots populate matrix first column for int y 0 y max yslots y array list object xy list new array list object matrix 0 y xy list see if one assignment fits into slot for int i 0 i list size i m assignment slot mas m assignment slot list get i if y mas gety start y mas gety end xy list add mas initiate right columns for int x 1 x max xslots x matrix x y new array list object for all y slots ab b a b a bc bc b c if the row above is empty move the first one right else check col 1 x above and move any content if the same if size 0 if the element is is not the same as above move to the first empty column on the right if in one column cell there is more than one move it to the right for int y 0 y max yslots y if an element is the same as the line above move it there if y 0 matrix 0 y size 0 for int x 1 x max xslots x if matrix x y 1 size 0 above slot is not empty object above matrix x y 1 get 0 for int i 0 i matrix x y size i if above equals matrix 0 y get i same move it matrix x y add matrix 0 y get i matrix 0 y remove i if an element is the same as the line above move it there we need to move items to the right if matrix 0 y size 1 object above null if y 0 matrix 0 y 1 size 0 above matrix 0 y 1 get 0 for int i 0 matrix 0 y size 1 i object move matrix 0 y get i if move equals above we can move it for int x 1 move null x max xslots x if matrix x y size 0 found an empty slot matrix x y add move matrix 0 y remove i move null we need to move items to the right for all y slots go through the matrix and assign the x position for int y 0 y max yslots y for int x 0 x max xslots x if matrix x y size 0 m assignment slot mas m assignment slot matrix x y get 0 mas setx x x slots y clean up matrix null suppresswarnings layoutslots arraylist massignmentslot arraylist massignmentslot massignmentslot massignmentslot timeslots allday allday massignmentslot massignmentslot getstatus massignmentslot status_notavailable getstatus massignmentslot status_unavailable getstatus massignmentslot status_nonbusinessday getstatus massignmentslot status_notinslotday allday allday massignmentslot massignmentslot getstatus massignmentslot status_notinslottime massignmentslot massignmentslot maxyslots m_timeslots xslots maxyslots massignmentslot massignmentslot getystart getyend xslots maxxslots xslots xslots maxxslots maxxslots xslots maxxslots massignmentslot massignmentslot arraylist arraylist maxxslots maxyslots maxyslots arraylist xylist arraylist xylist massignmentslot massignmentslot getystart getyend xylist maxxslots arraylist col_1 maxyslots maxxslots maxxslots maxyslots maxxslots massignmentslot massignmentslot xslots layout y axis param mas assignment slot private void layouty m assignment slot mas int time slot start get time slot index mas get start time false int time slot end get time slot index mas get end time true if time util is all day mas get start time mas get end time time slot end m timeslots length 1 mas sety time slot start time slot end massignmentslot timeslotstart gettimeslotindex getstarttime timeslotend gettimeslotindex getendtime timeutil isallday getstarttime getendtime timeslotend m_timeslots timeslotstart timeslotend return the time slot index for the time based on start time and not including end time param time time day is ignored param end time if true the end time is included return slot index private int get time slot index timestamp time boolean end time just one slot if m timeslots length 1 return 0 search for it for int i 0 i m timeslots length i if m timeslots i in slot time end time return i log log level severe m schedule get time slot index did not find slot for time end end time return 0 endtime gettimeslotindex endtime m_timeslots m_timeslots m_timeslots inslot endtime mschedule gettimeslotindex endtime get basic info param s resource id resource private void get base info int s resource id resource is active and available string sql m role get default m ctx false add accesssql select r is active r is available null r is single assignment r s resourcetype id rt c uom id from s resource r s resourcetype rt where r s resource id and r s resourcetype id rt s resourcetype id r m role sql fullyqualified m role sql ro try prepared statement pstmt db prepare statement sql null pstmt set int 1 s resource id result set rs pstmt execute query if rs next if y equals rs get string 1 active m isavailable false if m isavailable y equals rs get string 2 available m isavailable false m issingleassignment y equals rs get string 3 m s resourcetype id rs get int 4 m c uom id rs get int 5 log fine resource id m s resourcetype id is available m isavailable else m isavailable false rs close pstmt close catch sql exception e log log level severe sql e m isavailable false m s resource id s resource id s_resource_id getbaseinfo s_resource_id mrole getdefault m_ctx addaccesssql isactive isavailable issingleassignment s_resourcetype_id c_uom_id s_resource s_resourcetype s_resource_id s_resourcetype_id s_resourcetype_id mrole sql_fullyqualified mrole sql_ro preparedstatement preparestatement setint s_resource_id resultset executequery getstring m_isavailable m_isavailable getstring m_isavailable m_issingleassignment getstring m_s_resourcetype_id getint m_c_uom_id getint resource_id m_s_resourcetype_id isavailable m_isavailable m_isavailable sqlexception m_isavailable m_s_resource_id s_resource_id create unavailable timeslots for every day from start day end day create unavailable slots for 00 00 start time and end time 24 00 param list list to add time slots to param start time start time in day param end time end time in day private void create time slot array list m assignment slot list timestamp start time timestamp end time log fine m schedule create time slot gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis m startdate get time end date for comparison gregorian calendar cal end new gregorian calendar language get login language get locale cal end set time in millis m enddate get time while cal before cal end 00 00 start time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 timestamp start new timestamp cal get time in millis gregorian calendar cal 1 new gregorian calendar language get login language get locale cal 1 set time in millis start time get time cal set calendar hour of day cal 1 get calendar hour of day cal set calendar minute cal 1 get calendar minute cal set calendar second cal 1 get calendar second timestamp end new timestamp cal get time in millis m assignment slot ma new m assignment slot start end msg get msg m ctx resource not in slot time m assignment slot status notinslottime list add ma end time 00 00 next day cal 1 set time in millis end time get time cal set calendar hour of day cal 1 get calendar hour of day cal set calendar minute cal 1 get calendar minute cal set calendar second cal 1 get calendar second start new timestamp cal get time in millis cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal add calendar day of year 1 end new timestamp cal get time in millis ma new m assignment slot start end msg get msg m ctx resource not in slot time m assignment slot status notinslottime list add ma startday endday starttime endtime starttime endtime createtimeslot arraylist massignmentslot starttime endtime mschedule createtimeslot gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis m_startdate gettime gregoriancalendar calend gregoriancalendar getloginlanguage getlocale calend settimeinmillis m_enddate gettime calend starttime hour_of_day gettimeinmillis gregoriancalendar cal_1 gregoriancalendar getloginlanguage getlocale cal_1 settimeinmillis starttime gettime hour_of_day cal_1 hour_of_day cal_1 cal_1 gettimeinmillis massignmentslot massignmentslot getmsg m_ctx resourcenotinslottime massignmentslot status_notinslottime endtime cal_1 settimeinmillis endtime gettime hour_of_day cal_1 hour_of_day cal_1 cal_1 gettimeinmillis hour_of_day day_of_year gettimeinmillis massignmentslot getmsg m_ctx resourcenotinslottime massignmentslot status_notinslottime create unavailable dayslots for every day from start day end day create unavailable slots param list list to add day slots to param on monday true if ok to have appointments i e blocked if false param on tuesday true if ok param on wednesday true if ok param on thursday true if ok param on friday true if ok param on saturday true if ok param on sunday true if ok private void create day slot array list m assignment slot list boolean on monday boolean on tuesday boolean on wednesday boolean on thursday boolean on friday boolean on saturday boolean on sunday log fine m schedule create day slot gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis m startdate get time end date for comparison gregorian calendar cal end new gregorian calendar language get login language get locale cal end set time in millis m enddate get time while cal before cal end int weekday cal get calendar day of week if on saturday weekday calendar saturday on sunday weekday calendar sunday on monday weekday calendar monday on tuesday weekday calendar tuesday on wednesday weekday calendar wednesday on thursday weekday calendar thursday on friday weekday calendar friday 00 00 00 00 next day cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 timestamp start new timestamp cal get time in millis cal add calendar day of year 1 timestamp end new timestamp cal get time in millis m assignment slot ma new m assignment slot start end msg get msg m ctx resource not in slot day m assignment slot status notinslotday list add ma else next day cal add calendar day of year 1 startday endday onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday createdayslot arraylist massignmentslot onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday mschedule createdayslot gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis m_startdate gettime gregoriancalendar calend gregoriancalendar getloginlanguage getlocale calend settimeinmillis m_enddate gettime calend day_of_week onsaturday onsunday onmonday ontuesday onwednesday onthursday onfriday hour_of_day gettimeinmillis day_of_year gettimeinmillis massignmentslot massignmentslot getmsg m_ctx resourcenotinslotday massignmentslot status_notinslotday day_of_year create a day slot for range param list list param ma assignment private void create day slot array list m assignment slot list m assignment slot ma log fine m schedule create day slot ma timestamp start ma get start time gregorian calendar cal start new gregorian calendar cal start set time start cal start set calendar hour of day 0 cal start set calendar minute 0 cal start set calendar second 0 cal start set calendar millisecond 0 timestamp end ma get end time gregorian calendar cal end new gregorian calendar cal end set time end cal end set calendar hour of day 0 cal end set calendar minute 0 cal end set calendar second 0 cal end set calendar millisecond 0 while cal start before cal end timestamp x start new timestamp cal start get time in millis cal start add calendar day of year 1 timestamp x end new timestamp cal start get time in millis m assignment slot my ma new m assignment slot x start x end ma get name ma get description ma get status list add my ma createdayslot arraylist massignmentslot massignmentslot mschedule createdayslot getstarttime gregoriancalendar calstart gregoriancalendar calstart settime calstart hour_of_day calstart calstart calstart getendtime gregoriancalendar calend gregoriancalendar calend settime calend hour_of_day calend calend calend calstart calend xstart calstart gettimeinmillis calstart day_of_year xend calstart gettimeinmillis massignmentslot myma massignmentslot xstart xend getname getdescription getstatus myma get day time slots for date return heading or null public m assignment slot get day time slots return m timeslots massignmentslot getdaytimeslots m_timeslots create time slots private void create time slots development error if m typename null throw new illegal state exception resource type name not set array list m assignment slot list new array list m assignment slot muom uom muom get m ctx m c uom id int minutes muom conversion convert to minutes m ctx m c uom id env one log config minutes minutes if minutes 0 minutes 60 24 set start time gregorian calendar cal new gregorian calendar cal set time m startdate cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 we have slots create first if m slotstarttime null long start cal get time in millis cal set time time util get day time m startdate m slotstarttime set to start time cal set calendar second 0 cal set calendar millisecond 0 list add new m assignment slot start cal get time in millis set end time gregorian calendar cal end new gregorian calendar if m slotendtime null cal end set time time util get day time m startdate m slotendtime cal end set calendar second 0 cal end set calendar millisecond 0 else no slot all day cal end set time m startdate cal end set calendar hour of day 0 cal end set calendar minute 0 cal end set calendar second 0 cal end set calendar millisecond 0 cal end add calendar day of year 1 system out println start new timestamp cal get time in millis system out println endt new timestamp cal end get time in millis set end slot time gregorian calendar cal end slot new gregorian calendar cal end slot set time cal get time cal end slot add calendar minute minutes while cal before cal end list add new m assignment slot cal get time in millis cal end slot get time in millis next slot cal add calendar minute minutes cal end slot add calendar minute minutes create last slot cal end slot set time cal get time cal end slot set calendar hour of day 0 cal end slot set calendar minute 0 cal end slot set calendar second 0 cal end slot set calendar millisecond 0 cal end slot add calendar day of year 1 00 00 next day list add new m assignment slot cal get time in millis cal end slot get time in millis else day list add new m assignment slot time util get day m startdate time util get next day m startdate m timeslots new m assignment slot list size list to array m timeslots createtimeslots m_typename illegalstateexception resourcetypename arraylist massignmentslot arraylist massignmentslot m_ctx m_c_uom_id muomconversion converttominutes m_ctx m_c_uom_id gregoriancalendar gregoriancalendar settime m_startdate hour_of_day m_slotstarttime gettimeinmillis settime timeutil getdaytime m_startdate m_slotstarttime massignmentslot gettimeinmillis gregoriancalendar calend gregoriancalendar m_slotendtime calend settime timeutil getdaytime m_startdate m_slotendtime calend calend calend settime m_startdate calend hour_of_day calend calend calend calend day_of_year gettimeinmillis calend gettimeinmillis gregoriancalendar calendslot gregoriancalendar calendslot settime gettime calendslot calend massignmentslot gettimeinmillis calendslot gettimeinmillis calendslot calendslot settime gettime calendslot hour_of_day calendslot calendslot calendslot calendslot day_of_year massignmentslot gettimeinmillis calendslot gettimeinmillis massignmentslot timeutil getday m_startdate timeutil getnextday m_startdate m_timeslots massignmentslot toarray m_timeslots get resource id set by get assignment slots return current resource public int gets resource id return m s resource id getassignmentslots gets_resource_id m_s_resource_id return start date set by get assignment slots return start date public timestamp get start date return m startdate getassignmentslots getstartdate m_startdate return end date set by get assignment slots return end date public timestamp get end date return m enddate getassignmentslots getenddate m_enddate get contents return context public object get contents return contents getcontents standard constructor public x k comment properties ctx int k comment id string trx name super ctx k comment id trx name if k comment id 0 set is public true y setk comment id 0 setk entry id 0 set rating 0 set text msg null x_k_comment k_comment_id trxname k_comment_id trxname k_comment_id setispublic setk_comment_id setk_entry_id setrating settextmsg load constructor public x k comment properties ctx result set rs string trx name super ctx rs trx name x_k_comment resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k comment append get id append return sb to string tostring stringbuffer stringbuffer x_k_comment get_id tostring set session user session online or web public void setad session id int ad session id if ad session id 0 set valuenocheck ad session id null else set valuenocheck ad session id new integer ad session id setad_session_id ad_session_id ad_session_id set_valuenocheck ad_session_id set_valuenocheck ad_session_id ad_session_id get session user session online or web public int getad session id integer ii integer get value ad session id if ii null return 0 return ii int value getad_session_id get_value ad_session_id intvalue set public public can read entry public void set is public boolean is public set value is public new boolean is public setispublic ispublic set_value ispublic ispublic get public public can read entry public boolean is public object oo get value is public if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublic get_value ispublic booleanvalue set entry comment knowledge entry comment public void setk comment id int k comment id if k comment id 1 throw new illegal argument exception k comment id is mandatory set valuenocheck k comment id new integer k comment id setk_comment_id k_comment_id k_comment_id illegalargumentexception k_comment_id set_valuenocheck k_comment_id k_comment_id get entry comment knowledge entry comment public int getk comment id integer ii integer get value k comment id if ii null return 0 return ii int value getk_comment_id get_value k_comment_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getk comment id intvalue keynamepair getkeynamepair keynamepair get_id valueof getk_comment_id set entry knowledge entry public void setk entry id int k entry id if k entry id 1 throw new illegal argument exception k entry id is mandatory set valuenocheck k entry id new integer k entry id setk_entry_id k_entry_id k_entry_id illegalargumentexception k_entry_id set_valuenocheck k_entry_id k_entry_id get entry knowledge entry public int getk entry id integer ii integer get value k entry id if ii null return 0 return ii int value getk_entry_id get_value k_entry_id intvalue set rating classification or importance public void set rating int rating set value rating new integer rating setrating set_value get rating classification or importance public int get rating integer ii integer get value rating if ii null return 0 return ii int value getrating get_value intvalue set text message text message public void set text msg string text msg if text msg null throw new illegal argument exception text msg is mandatory if text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg illegalargumentexception textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg create own instance param c compoment return compiere menu barui public static componentui createui j component c return new compiere menu itemui compieremenubarui jcomponent compieremenuitemui install ui param c public void installui j component c super installui c c set opaque false use menu barui background jcomponent setopaque menubarui standard constructor public x r requesttypeupdates properties ctx int r requesttypeupdates id string trx name super ctx r requesttypeupdates id trx name if r requesttypeupdates id 0 setad user id 0 set is self service false setr requesttype id 0 x_r_requesttypeupdates r_requesttypeupdates_id trxname r_requesttypeupdates_id trxname r_requesttypeupdates_id setad_user_id setisselfservice setr_requesttype_id load constructor public x r requesttypeupdates properties ctx result set rs string trx name super ctx rs trx name x_r_requesttypeupdates resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requesttypeupdates append get id append return sb to string tostring stringbuffer stringbuffer x_r_requesttypeupdates get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 1 throw new illegal argument exception r requesttype id is mandatory set valuenocheck r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id illegalargumentexception r_requesttype_id set_valuenocheck r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue get content return content public object get contents return contents getcontents do we track changes for this table param ad table id table return true if changes are tracked public static boolean is logged int ad table id if s changelog null s changelog length 0 fill change log int index arrays binary search s changelog ad table id return index 0 ad_table_id islogged ad_table_id s_changelog s_changelog fillchangelog binarysearch s_changelog ad_table_id fill log with tables to be logged private static void fill change log array list integer list new array list integer 40 string sql select t ad table id from ad table t where t is change log y also inactive or exists select from ad column c where t ad table id c ad table id and c column name entity type order by t ad table id prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new integer rs get int 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert to array s changelog new int list size for int i 0 i s changelog length i integer id integer list get i s changelog i id int value s log info s changelog length fillchangelog arraylist arraylist ad_table_id ad_table ischangelog ad_column ad_table_id ad_table_id columnname entitytype ad_table_id preparedstatement preparestatement resultset executequery getint s_log s_changelog s_changelog s_changelog intvalue s_log s_changelog load constructor param ctx context param rs result set public m change log properties ctx result set rs string trx name super ctx rs trx name mchangelog resultset trxname trxname standard constructor param ctx context param ad changelog id id param trx name trx public m change log properties ctx int ad changelog id string trx name super ctx 0 trx name ad_changelog_id trxname mchangelog ad_changelog_id trxname trxname full constructor param ctx context param ad changelog id 0 for new change log param ad session id session param ad table id table param ad column id column param record id record param ad client id client param ad org id org param old value old param new value new public m change log properties ctx int ad changelog id string trx name int ad session id int ad table id int ad column id int record id int ad client id int ad org id object old value object new value this ctx 0 null out of trx if ad changelog id 0 ad changelog id db get nextid ad client id table name null if ad changelog id 0 log severe no nextid ad changelog id setad changelog id ad changelog id set trx name trx name setad session id ad session id setad table id ad table id setad column id ad column id setrecord id record id set client org ad client id ad org id set old value old value set new value new value r2 5 2f 2005 09 25 2 5 2f 20050925 2201 set description compiere main version compiere date version compiere get implementation version ad_changelog_id ad_session_id ad_table_id ad_column_id record_id ad_client_id ad_org_id oldvalue newvalue mchangelog ad_changelog_id trxname ad_session_id ad_table_id ad_column_id record_id ad_client_id ad_org_id oldvalue newvalue ad_changelog_id ad_changelog_id getnextid ad_client_id table_name ad_changelog_id ad_changelog_id setad_changelog_id ad_changelog_id settrxname trxname setad_session_id ad_session_id setad_table_id ad_table_id setad_column_id ad_column_id setrecord_id record_id setclientorg ad_client_id ad_org_id setoldvalue oldvalue setnewvalue newvalue 2f_2005 2f_20050925 setdescription main_version _ date_version getimplementationversion set old value param old value old public void set old value object old value if old value null super set old value null else super set old value old value to string oldvalue setoldvalue oldvalue oldvalue setoldvalue setoldvalue oldvalue tostring is old value null return true if null public boolean is old null string value get old value return value null value equals null isoldnull getoldvalue set new value param new value new public void set new value object new value if new value null super set new value null else super set new value new value to string newvalue setnewvalue newvalue newvalue setnewvalue setnewvalue newvalue tostring is new value null return true if null public boolean is new null string value get new value return value null value equals null isnewnull getnewvalue standard constructor public x ad color properties ctx int ad color id string trx name super ctx ad color id trx name if ad color id 0 setad color id 0 set alpha 0 set blue 0 set color type null set green 0 set image alpha env zero set is default false set name null set red 0 x_ad_color ad_color_id trxname ad_color_id trxname ad_color_id setad_color_id setalpha setblue setcolortype setgreen setimagealpha setisdefault setname setred load constructor public x ad color properties ctx result set rs string trx name super ctx rs trx name x_ad_color resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad color append get id append return sb to string tostring stringbuffer stringbuffer x_ad_color get_id tostring set system color color for backgrounds or indicators public void setad color id int ad color id if ad color id 1 throw new illegal argument exception ad color id is mandatory set valuenocheck ad color id new integer ad color id setad_color_id ad_color_id ad_color_id illegalargumentexception ad_color_id set_valuenocheck ad_color_id ad_color_id get system color color for backgrounds or indicators public int getad color id integer ii integer get value ad color id if ii null return 0 return ii int value getad_color_id get_value ad_color_id intvalue set image system image or icon public void setad image id int ad image id if ad image id 0 set value ad image id null else set value ad image id new integer ad image id setad_image_id ad_image_id ad_image_id set_value ad_image_id set_value ad_image_id ad_image_id get image system image or icon public int getad image id integer ii integer get value ad image id if ii null return 0 return ii int value getad_image_id get_value ad_image_id intvalue set alpha color alpha value 0 255 public void set alpha int alpha set value alpha new integer alpha setalpha set_value get alpha color alpha value 0 255 public int get alpha integer ii integer get value alpha if ii null return 0 return ii int value getalpha get_value intvalue set 2nd alpha alpha value for second color public void setalpha 1 int alpha 1 set value alpha 1 new integer alpha 1 setalpha_1 alpha_1 set_value alpha_1 alpha_1 get 2nd alpha alpha value for second color public int getalpha 1 integer ii integer get value alpha 1 if ii null return 0 return ii int value getalpha_1 get_value alpha_1 intvalue set blue color rgb blue value public void set blue int blue set value blue new integer blue setblue set_value get blue color rgb blue value public int get blue integer ii integer get value blue if ii null return 0 return ii int value getblue get_value intvalue set 2nd blue rgb value for second color public void setblue 1 int blue 1 set value blue 1 new integer blue 1 setblue_1 blue_1 set_value blue_1 blue_1 get 2nd blue rgb value for second color public int getblue 1 integer ii integer get value blue 1 if ii null return 0 return ii int value getblue_1 get_value blue_1 intvalue public static final string colortype texturepicture t set color type color presentation for this color public void set color type object color type if color type null throw new illegal argument exception color type is mandatory if color type equals f color type equals g color type equals l color type equals t else throw new illegal argument exception color type invalid value color type reference id 243 f g l t set value color type color type colortype_texturepicture setcolortype colortype colortype illegalargumentexception colortype colortype colortype colortype colortype illegalargumentexception colortype colortype reference_id set_value colortype colortype get color type color presentation for this color public object get color type return get value color type getcolortype get_value colortype set green rgb value public void set green int green set value green new integer green setgreen set_value get green rgb value public int get green integer ii integer get value green if ii null return 0 return ii int value getgreen get_value intvalue set 2nd green rgb value for second color public void setgreen 1 int green 1 set value green 1 new integer green 1 setgreen_1 green_1 set_value green_1 green_1 get 2nd green rgb value for second color public int getgreen 1 integer ii integer get value green 1 if ii null return 0 return ii int value getgreen_1 get_value green_1 intvalue set image alpha image texture composite alpha public void set image alpha big decimal image alpha if image alpha null throw new illegal argument exception image alpha is mandatory set value image alpha image alpha setimagealpha bigdecimal imagealpha imagealpha illegalargumentexception imagealpha set_value imagealpha imagealpha get image alpha image texture composite alpha public big decimal get image alpha big decimal bd big decimal get value image alpha if bd null return env zero return bd bigdecimal getimagealpha bigdecimal bigdecimal get_value imagealpha set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set line distance distance between lines public void set line distance int line distance set value line distance new integer line distance setlinedistance linedistance set_value linedistance linedistance get line distance distance between lines public int get line distance integer ii integer get value line distance if ii null return 0 return ii int value getlinedistance get_value linedistance intvalue set line width width of the lines public void set line width int line width set value line width new integer line width setlinewidth linewidth set_value linewidth linewidth get line width width of the lines public int get line width integer ii integer get value line width if ii null return 0 return ii int value getlinewidth get_value linewidth intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set red rgb value public void set red int red set value red new integer red setred set_value get red rgb value public int get red integer ii integer get value red if ii null return 0 return ii int value getred get_value intvalue set 2nd red rgb value for second color public void setred 1 int red 1 set value red 1 new integer red 1 setred_1 red_1 set_value red_1 red_1 get 2nd red rgb value for second color public int getred 1 integer ii integer get value red 1 if ii null return 0 return ii int value getred_1 get_value red_1 intvalue set repeat distance distance in points to repeat gradient color or zero public void set repeat distance int repeat distance set value repeat distance new integer repeat distance setrepeatdistance repeatdistance set_value repeatdistance repeatdistance get repeat distance distance in points to repeat gradient color or zero public int get repeat distance integer ii integer get value repeat distance if ii null return 0 return ii int value getrepeatdistance get_value repeatdistance intvalue public static final string startpoint northwest 8 set start point start point of the gradient colors public void set start point string start point if start point null throw new illegal argument exception start point is mandatory if start point null start point equals 1 start point equals 2 start point equals 3 start point equals 4 start point equals 5 start point equals 6 start point equals 7 start point equals 8 else throw new illegal argument exception start point invalid value start point reference id 248 1 2 3 4 5 6 7 8 if start point null start point length 22 log warning length 22 truncated start point start point substring 0 21 set value start point start point startpoint_northwest setstartpoint startpoint startpoint illegalargumentexception startpoint startpoint startpoint startpoint startpoint startpoint startpoint startpoint startpoint startpoint illegalargumentexception startpoint startpoint reference_id startpoint startpoint startpoint startpoint set_value startpoint startpoint get start point start point of the gradient colors public string get start point return string get value start point getstartpoint get_value startpoint detail protected contructor param frame parent frame param modal modal param window no window no param value query value param multi selection multiple selections param where clause whwre clause protected info payment frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no p c payment id multi selection where clause log info info payment set title msg get msg env get ctx info payment try stat init p loadedok init info catch exception e return int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if value null value length 0 f document no set value value execute query pack focus f document no request focus windowno multiselection whereclause infopayment windowno multiselection whereclause windowno c_payment_id multiselection whereclause infopayment settitle getmsg getctx infopayment statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring fdocumentno setvalue executequery fdocumentno requestfocus static setup add fields to parameter panel throws exception if lookups cannot be created private void stat init throws exception l document no set label for f document no f document no set background compiereplaf get info background f document no add action listener this f is receipt set selected n equals env get context env get ctx p windowno isso trx f is receipt add action listener this forg id new v lookup ad org id false false true m lookup factory create env get ctx 3486 m windowno display type table dir false display type table dir m windowno lorg id set label for forg id forg id set background compiereplaf get info background fbpartner id new v lookup c bpartner id false false true m lookup factory get env get ctx p windowno 0 3499 display type search lbpartner id set label for fbpartner id fbpartner id set background compiereplaf get info background l date from set label for f date from f date from set background compiereplaf get info background f date from set tool tip text msg translate env get ctx date from l date to set label for f date to f date to set background compiereplaf get info background f date to set tool tip text msg translate env get ctx date to l amt from set label for f amt from f amt from set background compiereplaf get info background f amt from set tool tip text msg translate env get ctx amt from l amt to set label for f amt to f amt to set background compiereplaf get info background f amt to set tool tip text msg translate env get ctx amt to parameter panel set layout new a layout first row parameter panel add l document no new a layout constraint 0 0 parameter panel add f document no null parameter panel add lbpartner id null parameter panel add fbpartner id null parameter panel add f is receipt new a layout constraint 0 5 2nd row parameter panel add l date from new a layout constraint 1 2 parameter panel add f date from null parameter panel add l date to null parameter panel add f date to null 3rd row parameter panel add l amt from new a layout constraint 2 2 parameter panel add f amt from null parameter panel add l amt to null parameter panel add f amt to null parameter panel add lorg id null parameter panel add forg id null parameterpanel statinit ldocumentno setlabelfor fdocumentno fdocumentno setbackground getinfobackground fdocumentno addactionlistener fisreceipt setselected getcontext getctx p_windowno issotrx fisreceipt addactionlistener forg_id vlookup ad_org_id mlookupfactory getctx m_windowno displaytype tabledir displaytype tabledir m_windowno lorg_id setlabelfor forg_id forg_id setbackground getinfobackground fbpartner_id vlookup c_bpartner_id mlookupfactory getctx p_windowno displaytype lbpartner_id setlabelfor fbpartner_id fbpartner_id setbackground getinfobackground ldatefrom setlabelfor fdatefrom fdatefrom setbackground getinfobackground fdatefrom settooltiptext getctx datefrom ldateto setlabelfor fdateto fdateto setbackground getinfobackground fdateto settooltiptext getctx dateto lamtfrom setlabelfor famtfrom famtfrom setbackground getinfobackground famtfrom settooltiptext getctx amtfrom lamtto setlabelfor famtto famtto setbackground getinfobackground famtto settooltiptext getctx amtto parameterpanel setlayout alayout parameterpanel ldocumentno alayoutconstraint parameterpanel fdocumentno parameterpanel lbpartner_id parameterpanel fbpartner_id parameterpanel fisreceipt alayoutconstraint parameterpanel ldatefrom alayoutconstraint parameterpanel fdatefrom parameterpanel ldateto parameterpanel fdateto parameterpanel lamtfrom alayoutconstraint parameterpanel famtfrom parameterpanel lamtto parameterpanel famtto parameterpanel lorg_id parameterpanel forg_id general init return true if success private boolean init info set defaults string bp env get context env get ctx p windowno c bpartner id if bp null bp length 0 fbpartner id set value new integer bp prepare table string buffer where new string buffer p is active y if p whereclause length 0 where append and append util replace p whereclause c payment p prepare table s paymentlayout c payment v p where to string 2 3 4 m payment set is allocated env get ctx 0 null return true initinfo getcontext getctx p_windowno c_bpartner_id fbpartner_id setvalue stringbuffer stringbuffer isactive p_whereclause p_whereclause c_payment preparetable s_paymentlayout c_payment_v tostring mpayment setisallocated getctx construct sql where clause and define parameters set parameters needs to set parameters includes first and return sql where clause string getsql where string buffer sql new string buffer if f document no get text length 0 sql append and upper p document no like if fbpartner id get value null sql append and p c bpartner id if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value if from null to null sql append and trunc p date trx else if from null to null sql append and trunc p date trx else if from null to null sql append and trunc p date trx between and if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value if from null to null sql append and p pay amt else if from null to null sql append and p pay amt else if from null to null sql append and p pay amt between and sql append and p is receipt log fine sql to string return sql to string setparameters getsqlwhere stringbuffer stringbuffer fdocumentno gettext documentno fbpartner_id getvalue c_bpartner_id fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue datetrx datetrx datetrx famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue payamt payamt payamt isreceipt tostring tostring set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 if f document no get text length 0 pstmt set string index getsql text f document no if fbpartner id get value null integer bp integer fbpartner id get value pstmt set int index bp int value log fine b partner bp if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value log fine date from from to to if from null to null pstmt set timestamp index to else if from null to null pstmt set timestamp index from else if from null to null pstmt set timestamp index from pstmt set timestamp index to if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value log fine amt from from to to if from null to null pstmt set big decimal index to else if from null to null pstmt set big decimal index from else if from null to null pstmt set big decimal index from pstmt set big decimal index to pstmt set string index f is receipt is selected y n getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fdocumentno gettext setstring getsqltext fdocumentno fbpartner_id getvalue fbpartner_id getvalue setint intvalue bpartner fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue settimestamp settimestamp settimestamp settimestamp famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue setbigdecimal setbigdecimal setbigdecimal setbigdecimal setstring fisreceipt isselected get sql where parameter param f field return upper case text with at the end private string getsql text c text field f string s f get text to upper case if s ends with s log fine string s return s getsqltext ctextfield gettext touppercase endswith zoom void zoom log info info payment zoom integer c payment id get selected row key if c payment id null return m query query new m query c payment query add restriction c payment id m query equal c payment id query set record count 1 int ad windowno getad window id c payment f is receipt is selected zoom ad windowno query infopayment c_payment_id getselectedrowkey c_payment_id mquery mquery c_payment addrestriction c_payment_id mquery c_payment_id setrecordcount ad_windowno getad_window_id c_payment fisreceipt isselected ad_windowno has zoom return true boolean has zoom return true haszoom find products in warehouse with price param ctx context param m pricelist version id mandatory price list param m warehouse id mandatory warehouse param value optional value param name optional name param upc optional full match upc param sku optional full match ski return array of product prices and warehouse availability public static m warehouse price find properties ctx int m pricelist version id int m warehouse id string value string name string upc string sku string trx name string buffer sql new string buffer select from rv warehouseprice where m pricelist version id and m warehouse id string buffer sb new string buffer value get find parameter value if value null sb append upper value like name get find parameter name if name null if sb length 0 sb append or sb append upper name like if upc null upc length 0 if sb length 0 sb append or sb append upc if sku null sku length 0 if sb length 0 sb append or sb append sku if sb length 0 sql append and append sb append sql append order by value string finalsql m role get default add accesssql sql to string rv warehouseprice m role sql notqualified m role sql ro s log fine find m pricelist version id m pricelist version id m warehouse id m warehouse id finalsql array list m warehouse price list new array list m warehouse price prepared statement pstmt null try pstmt db prepare statement finalsql trx name int index 1 pstmt set int index m pricelist version id pstmt set int index m warehouse id if value null pstmt set string index value if name null pstmt set string index name if upc null upc length 0 pstmt set string index upc if sku null sku length 0 pstmt set string index sku result set rs pstmt execute query while rs next list add new m warehouse price ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe finalsql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log fine find list size m warehouse price ret value new m warehouse price list size list to array ret value return ret value m_pricelist_version_id m_warehouse_id mwarehouseprice m_pricelist_version_id m_warehouse_id trxname stringbuffer stringbuffer rv_warehouseprice m_pricelist_version_id m_warehouse_id stringbuffer stringbuffer getfindparameter getfindparameter mrole getdefault addaccesssql tostring rv_warehouseprice mrole sql_notqualified mrole sql_ro s_log m_pricelist_version_id m_pricelist_version_id m_warehouse_id m_warehouse_id arraylist mwarehouseprice arraylist mwarehouseprice preparedstatement preparestatement trxname setint m_pricelist_version_id setint m_warehouse_id setstring setstring setstring setstring resultset executequery mwarehouseprice trxname s_log s_log mwarehouseprice retvalue mwarehouseprice toarray retvalue retvalue find products in warehouse with price for customer param b partner business partner param isso trx if true so param valid the date the price must be valid param m warehouse id mandatory warehouse param value optional value param name optional name param upc optional upc param sku optional ski return array of product prices and warehouse availability or null public static m warehouse price find mb partner b partner boolean isso trx timestamp valid int m warehouse id string value string name string upc string sku string trx name int m pricelist id isso trx b partner getm pricelist id b partner getpo pricelist id m price list pl null if m pricelist id 0 pl m price list get default b partner get ctx isso trx else pl m price list get b partner get ctx m pricelist id trx name if pl null s log severe no price list found return null m price list version plv pl get price list version valid if plv null s log severe no price list version found for m pricelist id pl getm pricelist id return null return find b partner get ctx plv getm pricelist version id m warehouse id value name upc sku trx name bpartner issotrx m_warehouse_id mwarehouseprice mbpartner bpartner issotrx m_warehouse_id trxname m_pricelist_id issotrx bpartner getm_pricelist_id bpartner getpo_pricelist_id mpricelist m_pricelist_id mpricelist getdefault bpartner getctx issotrx mpricelist bpartner getctx m_pricelist_id trxname s_log pricelist mpricelistversion getpricelistversion s_log pricelistversion m_pricelist_id getm_pricelist_id bpartner getctx getm_pricelist_version_id m_warehouse_id trxname get m warehouse price param product product param m pricelist version id plv param m warehouse id wh return warehouse price public static m warehouse price get m product product int m pricelist version id int m warehouse id string trx name m warehouse price ret value null string sql select from rv warehouseprice where m product id and m pricelist version id and m warehouse id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 product getm product id pstmt set int 2 m pricelist version id pstmt set int 3 m warehouse id result set rs pstmt execute query if rs next ret value new m warehouse price product get ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value mwarehouse m_pricelist_version_id m_warehouse_id mwarehouseprice mproduct m_pricelist_version_id m_warehouse_id trxname mwarehouseprice retvalue rv_warehouseprice m_product_id m_pricelist_version_id m_warehouse_id preparedstatement preparestatement trxname setint getm_product_id setint m_pricelist_version_id setint m_warehouse_id resultset executequery retvalue mwarehouseprice getctx trxname s_log retvalue load constructor param ctx context param rs result set public m warehouse price properties ctx result set rs string trx name super ctx rs trx name mwarehouseprice resultset trxname trxname is product available return true if available qty 0 public boolean is available return get qty available signum 1 0 isavailable getqtyavailable prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals is abort p isabort y equals para i get parameter else if name equals ad user id p ad user id para i get parameter as int else if name equals ad wf responsible id p ad wf responsible id para i get parameter as int else log log level severe unknown parameter name p ad wf process id getrecord id processinfoparameter getparameter getparametername getparameter isabort p_isabort getparameter ad_user_id p_ad_user_id getparameterasint ad_wf_responsible_id p_ad_wf_responsible_id getparameterasint p_ad_wf_process_id getrecord_id perform process return message variables are parsed throws exception if not successful protected string do it throws exception mwf process process new mwf process get ctx p ad wf process id get trxname log info do it process m user user m user get get ctx getad user id abort if p isabort string msg user get name abort process set text msg msg process setad user id getad user id process setwf state state engine state aborted return msg string msg null change user if p ad user id 0 process getad user id p ad user id m user from m user get get ctx process getad user id m user to m user get get ctx p ad user id msg user get name from get name to get name process set text msg msg process setad user id p ad user id change responsible if p ad wf responsible id 0 process getad wf responsible id p ad wf responsible id mwf responsible from mwf responsible get get ctx process getad wf responsible id mwf responsible to mwf responsible get get ctx p ad wf responsible id string msg1 user get name from get name to get name process set text msg msg1 process setad wf responsible id p ad wf responsible id if msg null msg msg1 else msg msg1 process save return ok doit mwfprocess mwfprocess getctx p_ad_wf_process_id get_trxname doit muser muser getctx getad_user_id p_isabort getname settextmsg setad_user_id getad_user_id setwfstate stateengine state_aborted p_ad_user_id getad_user_id p_ad_user_id muser muser getctx getad_user_id muser muser getctx p_ad_user_id getname getname getname settextmsg setad_user_id p_ad_user_id p_ad_wf_responsible_id getad_wf_responsible_id p_ad_wf_responsible_id mwfresponsible mwfresponsible getctx getad_wf_responsible_id mwfresponsible mwfresponsible getctx p_ad_wf_responsible_id getname getname getname settextmsg setad_wf_responsible_id p_ad_wf_responsible_id get m rfq line qty from cache param ctx context param c rfqlineqty id id return m rfq line qty public static m rfq line qty get properties ctx int c rfqlineqty id string trx name integer key new integer c rfqlineqty id m rfq line qty ret value m rfq line qty s cache get key if ret value null return ret value ret value new m rfq line qty ctx c rfqlineqty id trx name if ret value get id 0 s cache put key ret value return ret value mrfqlineqty c_rfqlineqty_id mrfqlineqty mrfqlineqty c_rfqlineqty_id trxname c_rfqlineqty_id mrfqlineqty retvalue mrfqlineqty s_cache retvalue retvalue retvalue mrfqlineqty c_rfqlineqty_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c rfqlineqty id id public m rfq line qty properties ctx int c rfqlineqty id string trx name super ctx c rfqlineqty id trx name if c rfqlineqty id 0 setc rfqline id 0 setc uom id 0 set is offer qty false set is purchase qty false set qty env one 1 c_rfqlineqty_id mrfqlineqty c_rfqlineqty_id trxname c_rfqlineqty_id trxname c_rfqlineqty_id setc_rfqline_id setc_uom_id setisofferqty setispurchaseqty setqty load constructor param ctx context param rs result set public m rfq line qty properties ctx result set rs string trx name super ctx rs trx name if get id 0 s cache put new integer get id this mrfqlineqty resultset trxname trxname get_id s_cache get_id parent constructor param line rfq line public m rfq line qty m rfq line line this line get ctx 0 line get trxname set client org line setc rfqline id line getc rfqline id mrfqlineqty mrfqline getctx get_trxname setclientorg setc_rfqline_id getc_rfqline_id get uom name return uom public string get uom name if m uom null m uom muom get get ctx getc uom id return m uom get name getuomname m_uom m_uom getctx getc_uom_id m_uom getname get active response qtys of this rfq qty param only valid amounts only valid amounts return array of response line qtys public m rfq response line qty get response qtys boolean only valid amounts array list m rfq response line qty list new array list m rfq response line qty prepared statement pstmt null string sql select from c rfqresponselineqty where c rfqlineqty id and is active y try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfqlineqty id result set rs pstmt execute query while rs next m rfq response line qty qty new m rfq response line qty get ctx rs get trxname if only valid amounts qty is valid amt else list add qty rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rfq response line qty ret value new m rfq response line qty list size list to array ret value return ret value onlyvalidamounts mrfqresponselineqty getresponseqtys onlyvalidamounts arraylist mrfqresponselineqty arraylist mrfqresponselineqty preparedstatement c_rfqresponselineqty c_rfqlineqty_id isactive preparestatement get_trxname setint getc_rfqlineqty_id resultset executequery mrfqresponselineqty mrfqresponselineqty getctx get_trxname onlyvalidamounts isvalidamt mrfqresponselineqty retvalue mrfqresponselineqty toarray retvalue retvalue string representation return info public string to string string buffer sb new string buffer m rfq line qty sb append get id append qty append get qty append offer append is offer qty append purchase append is purchase qty append return sb to string tostring stringbuffer stringbuffer mrfqlineqty get_id getqty isofferqty ispurchaseqty tostring basic constructor use set methods public label basic constructor use set methods param set for sets the for attribute public label string set for set for set for setfor setfor setfor setfor basic constructor use set methods param set for sets the for attribute param accesskey sets the accesskey attribute public label string set for string accesskey set for set for set access key accesskey setfor setfor setfor setfor setaccesskey basic constructor use set methods param set for sets the for attribute param accesskey sets the optional accesskey attribute param value adds an element public label string set for string accesskey string value set for set for if accesskey null set access key accesskey add element value setfor setfor setfor setfor setaccesskey addelement sets the for attribute param value sets the for attribute public label set for string value add attribute for value return this setfor addattribute sets the accesskey attribute param accesskey sets the accesskey attribute public label set access key string accesskey add attribute accesskey accesskey return this setaccesskey addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public label add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public label add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public label add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public label add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public label remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param script the script public void set on load string script add attribute onload script setonload addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param script the script public void set on unload string script add attribute onunload script setonunload addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get wf node from cache param ctx context param ad wf node id id return mwf node public static mwf node get properties ctx int ad wf node id integer key new integer ad wf node id mwf node ret value mwf node s cache get key if ret value null return ret value ret value new mwf node ctx ad wf node id null if ret value get id 0 s cache put key ret value return ret value ad_wf_node_id mwfnode mwfnode ad_wf_node_id ad_wf_node_id mwfnode retvalue mwfnode s_cache retvalue retvalue retvalue mwfnode ad_wf_node_id retvalue get_id s_cache retvalue retvalue standard constructor save to cache param ctx context param ad wf node id id public mwf node properties ctx int ad wf node id string trx name super ctx ad wf node id trx name if ad wf node id 0 setad wf node id 0 setad workflow id 0 set value null set name null set action action waitsleep set cost env zero set duration 0 set entity type entitytype usermaintained u set is centrally maintained true y set join element joinelement xor x set limit 0 set split element splitelement xor x set waiting time 0 setx position 0 sety position 0 save to cache if get id 0 s cache put new integer getad wf node id this ad_wf_node_id mwfnode ad_wf_node_id trxname ad_wf_node_id trxname ad_wf_node_id setad_wf_node_id setad_workflow_id setvalue setname setaction action_waitsleep setcost setduration setentitytype entitytype_usermaintained setiscentrallymaintained setjoinelement joinelement_xor setlimit setsplitelement splitelement_xor setwaitingtime setxposition setyposition get_id s_cache getad_wf_node_id parent constructor param wf workflow parent param value value param name name public mwf node m workflow wf string value string name this wf get ctx 0 wf get trxname set client org wf setad workflow id wf getad workflow id set value value set name name m durationbasems wf get duration base sec 1000 mwfnode mworkflow getctx get_trxname setclientorg setad_workflow_id getad_workflow_id setvalue setname m_durationbasems getdurationbasesec load constructor save to cache param ctx context param rs result set to load info from public mwf node properties ctx result set rs string trx name super ctx rs trx name load next load trl save to cache s cache put new integer getad wf node id this mwfnode resultset trxname trxname loadnext loadtrl s_cache getad_wf_node_id set client org param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id load next private void load next string sql select from ad wf nodenext where ad wf node id and is active y order by seq no boolean split and splitelement and equals get split element try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 get id result set rs pstmt execute query while rs next mwf node next next new mwf node next get ctx rs get trxname next set from split and split and m next add next rs close pstmt close catch sql exception e log log level severe sql e log fine m next size loadnext ad_wf_nodenext ad_wf_node_id isactive seqno splitand splitelement_and getsplitelement preparedstatement preparestatement get_trxname setint get_id resultset executequery mwfnodenext mwfnodenext getctx get_trxname setfromsplitand splitand m_next sqlexception m_next load translation private void load trl if env is base language get ctx ad workflow get id 0 return string sql select name description help from ad wf node trl where ad wf node id and ad language try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 get id pstmt set string 2 env getad language get ctx result set rs pstmt execute query if rs next m name trl rs get string 1 m description trl rs get string 2 m help trl rs get string 3 m translated true rs close pstmt close catch sql exception e log log level severe sql e log fine trl m translated loadtrl isbaselanguage getctx ad_workflow get_id ad_wf_node_trl ad_wf_node_id ad_language preparedstatement preparestatement get_trxname setint get_id setstring getad_language getctx resultset executequery m_name_trl getstring m_description_trl getstring m_help_trl getstring m_translated sqlexception m_translated get number of next nodes return number of next nodes public int get next node count return m next size getnextnodecount m_next get the transitions param ad client id for client return array of next nodes public mwf node next get transitions int ad client id array list mwf node next list new array list mwf node next for int i 0 i m next size i mwf node next next m next get i if next getad client id 0 next getad client id ad client id list add next mwf node next ret value new mwf node next list size list to array ret value return ret value ad_client_id mwfnodenext gettransitions ad_client_id arraylist mwfnodenext arraylist mwfnodenext m_next mwfnodenext m_next getad_client_id getad_client_id ad_client_id mwfnodenext retvalue mwfnodenext toarray retvalue retvalue get name param translated translated return name public string get name boolean translated if translated m translated return m name trl return get name getname m_translated m_name_trl getname get description param translated translated return description public string get description boolean translated if translated m translated return m description trl return get description getdescription m_translated m_description_trl getdescription get help param translated translated return name public string get help boolean translated if translated m translated return m help trl return get help gethelp m_translated m_help_trl gethelp set position param position point public void set position point position set position position x position y setposition setposition set position param x x param y y public void set position int x int y setx position x sety position y setposition setxposition setyposition get position return position point public point get position return new point getx position gety position getposition getxposition getyposition get action info return info public string get action info string action get action if action appsprocess equals action return process ad process id getad process id else if action documentaction equals action return document action get doc action else if action appsreport equals action return report ad process id getad process id else if action appstask equals action return task ad task id getad task id else if action setvariable equals action return set variable ad column id getad column id else if action subworkflow equals action return workflow ad workflow id getad workflow id else if action userchoice equals action return user choice ad column id getad column id else if action userworkbench equals action return workbench else if action userform equals action return form ad form id getad form id else if action userwindow equals action return window ad window id getad window id else if action waitsleep equals action return sleep wait time get wait time return getactioninfo getaction action_appsprocess ad_process_id getad_process_id action_documentaction documentaction getdocaction action_appsreport ad_process_id getad_process_id action_appstask ad_task_id getad_task_id action_setvariable setvariable ad_column_id getad_column_id action_subworkflow ad_workflow_id getad_workflow_id action_userchoice userchoice ad_column_id getad_column_id action_userworkbench action_userform ad_form_id getad_form_id action_userwindow ad_window_id getad_window_id action_waitsleep waittime getwaittime get attribute name see org compiere model x ad wf node get attribute name return attribute name public string get attribute name if getad column id 0 return super get attribute name we have a column string attribute super get attribute name if attribute null attribute length 0 return attribute set attribute name get column get column name return super get attribute name x_ad_wf_node getattributename getattributename getad_column_id getattributename getattributename setattributename getcolumn getcolumnname getattributename get column return column if valid public m column get column if getad column id 0 return null if m column null m column m column get get ctx getad column id return m column m_column getcolumn getad_column_id m_column m_column m_column getctx getad_column_id m_column is this an approval setp return true if user approval public boolean is user approval if action userchoice equals get action return false return get column null is approved equals get column get column name isuserapproval action_userchoice getaction getcolumn isapproved getcolumn getcolumnname is this a user choice step return true if user choice public boolean is user choice return action userchoice equals get action isuserchoice action_userchoice getaction is this a manual user step return true if window form workbench public boolean is user manual if action userform equals get action action userwindow equals get action action userworkbench equals get action return true return false isusermanual action_userform getaction action_userwindow getaction action_userworkbench getaction get duration in ms return duration in ms public long get durationms long duration super get duration if duration 0 return 0 if m durationbasems 1 m durationbasems get workflow get duration base sec 1000 return duration m durationbasems getdurationms getduration m_durationbasems m_durationbasems getworkflow getdurationbasesec m_durationbasems get duration limit in ms return duration limit in ms public long get limitms long limit super get limit if limit 0 return 0 if m durationbasems 1 m durationbasems get workflow get duration base sec 1000 return limit m durationbasems getlimitms getlimit m_durationbasems m_durationbasems getworkflow getdurationbasesec m_durationbasems get duration calendar field return calendar minute etc public int get duration calendar field return get workflow get duration calendar field calendarfield getdurationcalendarfield getworkflow getdurationcalendarfield calculate dynamic priority param seconds second after created return dyn prio public int calculate dynamic priority int seconds if seconds 0 get dyn priority unit null get dyn priority change null env zero compare to get dyn priority change 0 return 0 big decimal divide env zero if dynpriorityunit minute equals get dyn priority unit divide new big decimal 60 else if dynpriorityunit hour equals get dyn priority unit divide new big decimal 3600 else if dynpriorityunit day equals get dyn priority unit divide new big decimal 86400 else return 0 big decimal change new big decimal seconds divide divide big decimal round down multiply get dyn priority change return change int value calculatedynamicpriority getdynpriorityunit getdynprioritychange compareto getdynprioritychange bigdecimal dynpriorityunit_minute getdynpriorityunit bigdecimal dynpriorityunit_hour getdynpriorityunit bigdecimal dynpriorityunit_day getdynpriorityunit bigdecimal bigdecimal bigdecimal bigdecimal round_down getdynprioritychange intvalue get parameters return array of parameters public mwf node para get parameters if m paras null m paras mwf node para get parameters get ctx getad wf node id return m paras mwfnodepara getparameters m_paras m_paras mwfnodepara getparameters getctx getad_wf_node_id m_paras get workflow return workflow public m workflow get workflow return m workflow get get ctx getad workflow id mworkflow getworkflow mworkflow getctx getad_workflow_id string representation return info public string to string string buffer sb new string buffer mwf node sb append get id append append get name append action append get action info append return sb to string tostring stringbuffer stringbuffer mwfnode get_id getname getactioninfo tostring user string representation return info public string to stringx string buffer sb new string buffer mwf node sb append get name append append get action info return sb to string tostringx stringbuffer stringbuffer mwfnode getname getactioninfo tostring before save param new record new return true if can be saved protected boolean before save boolean new record string action get action if action equals action waitsleep else if action equals action appsprocess action equals action appsreport if getad process id 0 log save error fill mandatory msg get element get ctx ad process id return false else if action equals action appstask if getad task id 0 log save error fill mandatory msg get element get ctx ad task id return false else if action equals action documentaction if get doc action null get doc action length 0 log save error fill mandatory msg get element get ctx doc action return false else if action equals action email if getr mailtext id 0 log save error fill mandatory msg get element get ctx r mailtext id return false else if action equals action setvariable if get attribute value null log save error fill mandatory msg get element get ctx attribute value return false else if action equals action subworkflow if getad workflow id 0 log save error fill mandatory msg get element get ctx ad workflow id return false else if action equals action userchoice if getad column id 0 log save error fill mandatory msg get element get ctx ad column id return false else if action equals action userform if getad form id 0 log save error fill mandatory msg get element get ctx ad form id return false else if action equals action userwindow if getad window id 0 log save error fill mandatory msg get element get ctx ad window id return false else if action equals action userworkbench getad workbench id 0 log save error fill mandatory msg get element get ctx ad workbench id return false return true newrecord beforesave newrecord getaction action_waitsleep action_appsprocess action_appsreport getad_process_id saveerror fillmandatory getelement getctx ad_process_id action_appstask getad_task_id saveerror fillmandatory getelement getctx ad_task_id action_documentaction getdocaction getdocaction saveerror fillmandatory getelement getctx docaction action_email getr_mailtext_id saveerror fillmandatory getelement getctx r_mailtext_id action_setvariable getattributevalue saveerror fillmandatory getelement getctx attributevalue action_subworkflow getad_workflow_id saveerror fillmandatory getelement getctx ad_workflow_id action_userchoice getad_column_id saveerror fillmandatory getelement getctx ad_column_id action_userform getad_form_id saveerror fillmandatory getelement getctx ad_form_id action_userwindow getad_window_id saveerror fillmandatory getelement getctx ad_window_id action_userworkbench getad_workbench_id saveerror fillmandatory getelement getctx ad_workbench_id after save param new record new param success success return saved protected boolean after save boolean new record boolean success if success return success translation table save this new record return true newrecord aftersave newrecord translationtable newrecord after delete param success success return deleted protected boolean after delete boolean success if translation table is active languages false translation table delete this return success afterdelete translationtable isactivelanguages translationtable standard constructor param ctx context param m distributionrunline id id public m distribution run line properties ctx int m distributionrunline id string trx name super ctx m distributionrunline id trx name m_distributionrunline_id mdistributionrunline m_distributionrunline_id trxname m_distributionrunline_id trxname load constructor param ctx context param rs result set public m distribution run line properties ctx result set rs string trx name super ctx rs trx name mdistributionrunline resultset trxname trxname get actual qty return actual qty public big decimal get actual qty return m actualqty bigdecimal getactualqty m_actualqty add to actual qty param add number to add public void add actual qty big decimal add m actualqty m actualqty add add addactualqty bigdecimal m_actualqty m_actualqty get actual min qty return actual min qty public big decimal get actual min return m actualmin bigdecimal getactualmin m_actualmin add to actual min qty param add number to add public void add actual min big decimal add m actualmin m actualmin add add addactualmin bigdecimal m_actualmin m_actualmin is actual min greater than total return true if act min total public boolean is actual min gt total return m actualmin compare to get total qty 0 isactualmingttotal m_actualmin compareto gettotalqty get actual allocation qty return actual allocation qty public big decimal get actual allocation return m actualallocation bigdecimal getactualallocation m_actualallocation add to actual min qty param add number to add public void add actual allocation big decimal add m actualallocation m actualallocation add add addactualallocation bigdecimal m_actualallocation m_actualallocation is actual allocation equals total return true if act allocation total public boolean is actual allocation eq total return m actualallocation compare to get total qty 0 isactualallocationeqtotal m_actualallocation compareto gettotalqty get allocation difference return total allocation qty public big decimal get actual allocation diff return get total qty subtract m actualallocation bigdecimal getactualallocationdiff gettotalqty m_actualallocation get last allocation difference return difference public big decimal get last difference return m lastdifference bigdecimal getlastdifference m_lastdifference set last allocation difference param difference difference public void set last difference big decimal difference m lastdifference difference setlastdifference bigdecimal m_lastdifference get max allocation return max allocation public big decimal get max allocation return m maxallocation bigdecimal getmaxallocation m_maxallocation set max allocation if greater param max allocation param set set to max public void set max allocation big decimal max boolean set if set max compare to m maxallocation 0 m maxallocation max setmaxallocation bigdecimal compareto m_maxallocation m_maxallocation reset calculations public void reset calculations m actualqty env zero m actualmin env zero m actualallocation env zero m lastdifference env zero m maxallocation env zero resetcalculations m_actualqty m_actualmin m_actualallocation m_lastdifference m_maxallocation get product return product public m product get product if m product null m product m product get get ctx getm product id return m product mproduct getproduct m_product m_product mproduct getctx getm_product_id m_product get product standard precision return standard precision public int get standard precision return get product get standard precision getstandardprecision getproduct getstandardprecision string representation return info public string to string string buffer sb new string buffer m distribution run line sb append get id append get info append return sb to string tostring stringbuffer stringbuffer mdistributionrunline get_id getinfo tostring get info return info public string get info string buffer sb new string buffer sb append line append get line append total qty append get total qty append sum min append get actual min append sum qty append get actual qty append sum allocation append get actual allocation append max allocation append get max allocation append last diff append get last difference return sb to string getinfo stringbuffer stringbuffer getline totalqty gettotalqty summin getactualmin sumqty getactualqty sumallocation getactualallocation maxallocation getmaxallocation lastdiff getlastdifference tostring ide constructor public v assignment this false false true vassignment create resource assigment pre resource date time from qty uom button pre param mandatory mandatory param is read only read only param is updateable updateable public v assignment boolean mandatory boolean is read only boolean is updateable super super set name column name look and feel install border this text field border this set layout new border layout size this set preferred size m text get preferred size int height m text get preferred size height text m text set editable false m text set focusable false m text set border null m text set horizontal alignment j text field leading background set mandatory mandatory this add m text border layout center button m button set icon env get image icon assignment10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this m button set focusable true this add m button border layout east prefereed size this set preferred size this get preferred size causes r o to be the same length read write if is read only is updateable set read write false else set read write true popup m text add mouse listener new vassignment mouseadapter this menu editor new c menu item msg get msg env get ctx info resource env get image icon zoom16 gif menu editor add action listener this popup menu add menu editor datetimefrom isreadonly isupdateable vassignment isreadonly isupdateable setname columnname lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize m_text seteditable m_text setfocusable m_text setborder m_text sethorizontalalignment jtextfield setmandatory m_text borderlayout m_button seticon getimageicon m_button setmargin m_button setpreferredsize m_button addactionlistener m_button setfocusable m_button borderlayout setpreferredsize getpreferredsize readwrite isreadonly isupdateable setreadwrite setreadwrite m_text addmouselistener vassignment_mouseadapter menueditor cmenuitem getmsg getctx inforesource getimageicon menueditor addactionlistener popupmenu menueditor dispose resources public void dispose try if m pstmt null m pstmt close catch exception e log log level severe v assignment dispose m text null m button null m_pstmt m_pstmt vassignment m_text m_button set mandatory param mandatory mandatory public void set mandatory boolean mandatory m mandatory mandatory m button set mandatory mandatory set background false setmandatory m_mandatory m_button setmandatory setbackground get mandatory return mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set read write param rw read rwite public void set read write boolean rw m readwrite rw m button set read write rw set background false readwrite setreadwrite m_readwrite m_button setreadwrite setbackground is read write return read write public boolean is read write return m readwrite isreadwrite m_readwrite set foreground param color color public void set foreground color color m text set foreground color setforeground m_text setforeground set background param error error public void set background boolean error if error set background compiereplaf getfieldbackground error else if m readwrite set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf get info background setbackground setbackground getfieldbackground_error m_readwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getinfobackground set background param color color public void set background color color m text set background color setbackground m_text setbackground request focus public void request focus m text request focus requestfocus m_text requestfocus set lookup value param value value public void set value object value if value m value return m value value int s resourceassignment id 0 if m value null m value instanceof integer s resourceassignment id integer m value int value set empty if s resourceassignment id 0 m text set text return statement if m pstmt null m pstmt db prepare statement select r name ra assign date from ra qty uom uom symbol from s resourceassignment ra s resource r s resourcetype rt c uom uom where ra s resourceassignment id and ra s resource id r s resource id and r s resourcetype id rt s resourcetype id and rt c uom id uom c uom id null try m pstmt set int 1 s resourceassignment id result set rs m pstmt execute query if rs next string buffer sb new string buffer rs get string 1 sb append append m dateformat format rs get timestamp 2 append append m qtyformat format rs get big decimal 3 append append rs get string 4 trim m text set text sb to string else m text set text s resourceassignment id rs close catch exception e log log level severe e setvalue m_value m_value s_resourceassignment_id m_value m_value s_resourceassignment_id m_value intvalue s_resourceassignment_id m_text settext m_pstmt m_pstmt preparestatement assigndatefrom uomsymbol s_resourceassignment s_resource s_resourcetype c_uom s_resourceassignment_id s_resource_id s_resource_id s_resourcetype_id s_resourcetype_id c_uom_id c_uom_id m_pstmt setint s_resourceassignment_id resultset m_pstmt executequery stringbuffer stringbuffer getstring m_dateformat gettimestamp m_qtyformat getbigdecimal getstring m_text settext tostring m_text settext s_resourceassignment_id get value return value public object get value return m value getvalue m_value get display value return info public string get display return m text get text getdisplay m_text gettext set field nop param m field m field public void set field m field m field mfield mfield setfield mfield mfield action listener interface param listener listener public void add action listener action listener listener m text add action listener listener addactionlistener actionlistener m_text addactionlistener action listener start dialog param e event public void action performed action event e if m button is enabled return m button set enabled false integer old value integer get value int s resourceassignment id old value null 0 old value int value m resource assignment ma new m resource assignment env get ctx s resourceassignment id null start v assignment dialog if s resourceassignment id 0 v assignment dialog vad new v assignment dialog env get frame this ma true true ma vad getm resource assignment start info schedule directly else info schedule is new info schedule env get frame this ma true ma is getm resource assignment set value if ma null ma gets resourceassignment id 0 set value new integer ma gets resourceassignment id try fire vetoable change s resourceassignment id new object get value catch property veto exception pve log log level severe pve m button set enabled true request focus actionperformed actionevent m_button isenabled m_button setenabled oldvalue getvalue s_resourceassignment_id oldvalue oldvalue intvalue mresourceassignment mresourceassignment getctx s_resourceassignment_id vassignment s_resourceassignment_id vassignmentdialog vassignmentdialog getframe getmresourceassignment infoschedule infoschedule infoschedule getframe getmresourceassignment gets_resourceassignment_id setvalue gets_resourceassignment_id firevetoablechange s_resourceassignment_id getvalue propertyvetoexception m_button setenabled requestfocus property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue constructor param adaptee adaptee vassignment mouseadapter v assignment adaptee this adaptee adaptee vassignment_mouseadapter vassignment mouse listener param e event public void mouse clicked mouse event e double click if e get click count 1 adaptee action performed new action event e get source e getid mouse popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent getclickcount actionperformed actionevent getsource swingutilities isrightmousebutton popupmenu getsource standard constructor param ctx context param pa sla measure id id public msla measure properties ctx int pa sla measure id string trx name super ctx pa sla measure id trx name if pa sla measure id 0 setpa sla goal id 0 set date trx new timestamp system current time millis set measure actual env zero set processed false pa_sla_measure_id mslameasure pa_sla_measure_id trxname pa_sla_measure_id trxname pa_sla_measure_id setpa_sla_goal_id setdatetrx currenttimemillis setmeasureactual setprocessed load constructor param ctx context param rs result set public msla measure properties ctx result set rs string trx name super ctx rs trx name mslameasure resultset trxname trxname parent constructor param goal parent param date trx optional date param measure actual optional measure param description optional description public msla measure msla goal goal timestamp date trx big decimal measure actual string description super goal get ctx 0 goal get trxname set client org goal setpa sla goal id goal getpa sla goal id if date trx null set date trx date trx else set date trx new timestamp system current time millis if measure actual null set measure actual measure actual else set measure actual env zero if description null set description description datetrx measureactual mslameasure mslagoal datetrx bigdecimal measureactual getctx get_trxname setclientorg setpa_sla_goal_id getpa_sla_goal_id datetrx setdatetrx datetrx setdatetrx currenttimemillis measureactual setmeasureactual measureactual setmeasureactual setdescription set link to source param ad table id table param record id record public void set link int ad table id int record id setad table id ad table id setrecord id record id ad_table_id record_id setlink ad_table_id record_id setad_table_id ad_table_id setrecord_id record_id string representation return info public string to string string buffer sb new string buffer msla measure sb append get id append pa sla goal id append getpa sla goal id append append get date trx append actual append get measure actual append return sb to string tostring stringbuffer stringbuffer mslameasure get_id pa_sla_goal_id getpa_sla_goal_id getdatetrx getmeasureactual tostring get contents return context public object get contents return contents getcontents workbench model constructor public m workbench properties ctx m ctx ctx mworkbench m_ctx no workbench just frame for window public m workbench properties ctx int ad window id m ctx ctx m windows add new wb window type window ad window id mworkbench ad_window_id m_ctx m_windows wbwindow type_window ad_window_id init workbench public boolean init workbench int ad workbench id ad workbench id ad workbench id get wb info string sql null if env is base language m ctx ad workbench sql select w name w description w help 1 3 w ad column id w ad image id w ad color id w pa goal id 4 7 c column name 8 from ad workbench w ad column c where w ad workbench id 1 and w is active y and w ad column id c ad column id else sql select t name t description t help w ad column id w ad image id w ad color id w pa goal id c column name from ad workbench w ad workbench trl t ad column c where w ad workbench id 1 and w is active y and w ad workbench id t ad workbench id and t ad language env getad language m ctx and w ad column id c ad column id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad workbench id result set rs pstmt execute query if rs next name rs get string 1 description rs get string 2 if description null description help rs get string 3 if help null help ad column id rs get int 4 ad image id rs get int 5 ad color id rs get int 6 pa goal id rs get int 7 column name rs get string 8 else ad workbench id 0 rs close pstmt close catch sql exception e log log level severe sql e if ad workbench id 0 return false return init workbench windows initworkbench ad_workbench_id ad_workbench_id ad_workbench_id isbaselanguage m_ctx ad_workbench ad_column_id ad_image_id ad_color_id pa_goal_id columnname ad_workbench ad_column ad_workbench_id isactive ad_column_id ad_column_id ad_column_id ad_image_id ad_color_id pa_goal_id columnname ad_workbench ad_workbench_trl ad_column ad_workbench_id isactive ad_workbench_id ad_workbench_id ad_language getad_language m_ctx ad_column_id ad_column_id preparedstatement preparestatement setint ad_workbench_id resultset executequery getstring getstring getstring ad_column_id getint ad_image_id getint ad_color_id getint pa_goal_id getint columnname getstring ad_workbench_id sqlexception ad_workbench_id initworkbenchwindows string representation public string to string return m workbench id ad workbench id name windows m windows size link column column name tostring mworkbench ad_workbench_id m_windows linkcolumn columnname dispose public void dispose for int i 0 i m windows size i dispose i m windows clear m windows null m_windows m_windows m_windows get workbench query column name column name public m query get query return m query get equal query column name column name columnname columnname mquery getquery mquery getequalquery columnname columnname public int getad workbench id return ad workbench id getad_workbench_id ad_workbench_id return ad workbench id public string get name return name ad_workbench_id getname return name public string get description return description getdescription return description public string get help return help gethelp return help public int getad column id return ad column id getad_column_id ad_column_id return ad column id public int getad image id return ad image id ad_column_id getad_image_id ad_image_id return ad image id public int getad color id return ad color id ad_image_id getad_color_id ad_color_id return ad color id public int getpa goal id return pa goal id ad_color_id getpa_goal_id pa_goal_id init workbench windows private boolean init workbench windows string sql select ad window id ad form id ad process id ad task id from ad workbenchwindow where ad workbench id and is active y order by seq no try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad workbench id result set rs pstmt execute query while rs next int ad window id rs get int 1 int ad form id rs get int 2 int ad process id rs get int 3 int ad task id rs get int 4 if ad window id 0 m windows add new wb window type window ad window id else if ad form id 0 m windows add new wb window type form ad form id else if ad process id 0 m windows add new wb window type process ad process id else if ad task id 0 m windows add new wb window type task ad task id rs close pstmt close catch sql exception e log log level severe sql e return false return true initworkbenchwindows ad_window_id ad_form_id ad_process_id ad_task_id ad_workbenchwindow ad_workbench_id isactive seqno preparedstatement preparestatement setint ad_workbench_id resultset executequery ad_window_id getint ad_form_id getint ad_process_id getint ad_task_id getint ad_window_id m_windows wbwindow type_window ad_window_id ad_form_id m_windows wbwindow type_form ad_form_id ad_process_id m_windows wbwindow type_process ad_process_id ad_task_id m_windows wbwindow type_task ad_task_id sqlexception get window count public int get window count return m windows size getwindowcount m_windows get window type of window return 1 if not valid public int get window type int index if index 0 index m windows size return 1 wb window win wb window m windows get index return win type getwindowtype m_windows wbwindow wbwindow m_windows get id for window return 1 if not valid public int get windowid int index if index 0 index m windows size return 1 wb window win wb window m windows get index return win id getwindowid m_windows wbwindow wbwindow m_windows set window model of window public void setm window int index m window mw if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win type type window throw new illegal argument exception not a m window index win m window mw setmwindow mwindow m_windows illegalargumentexception wbwindow wbwindow m_windows type_window illegalargumentexception mwindow mwindow get window model of window public m window getm window int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win type type window throw new illegal argument exception not a m window index return win m window mwindow getmwindow m_windows illegalargumentexception wbwindow wbwindow m_windows type_window illegalargumentexception mwindow mwindow get name of window return window name or null if not set public string get name int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win type type window return win m window get name return null getname m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow type_window mwindow getname get description of window return window description or null if not set public string get description int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win type type window return win m window get description return null getdescription m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow type_window mwindow getdescription get help of window return window help or null if not set public string get help int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win type type window return win m window get help return null gethelp m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow type_window mwindow gethelp get icon of window return window icon or null if not set public icon get icon int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win type type window return win m window get icon return null geticon m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow type_window mwindow geticon get image icon of window return window icon or null if not set public image get image int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win type type window return win m window get image return null getimage m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow type_window mwindow getimage get ad color id of window return window color or workbench color if not set public int getad color id int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index int ret value 1 if win m window null win type type window return win m window getad color id if ret value 1 return getad color id return ret value ad_color_id getad_color_id m_windows illegalargumentexception wbwindow wbwindow m_windows retvalue mwindow type_window mwindow getad_color_id retvalue getad_color_id retvalue set window no of window public void set window no int index int window no if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index win window no window no windowno setwindowno windowno m_windows illegalargumentexception wbwindow wbwindow m_windows windowno windowno get window no of window return window no of window if previously set otherwise 1 public int get window no int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index return win window no windowno windowno getwindowno m_windows illegalargumentexception wbwindow wbwindow m_windows windowno dispose of window public void dispose int index if index 0 index m windows size throw new illegal argument exception index invalid index wb window win wb window m windows get index if win m window null win m window dispose win m window null m_windows illegalargumentexception wbwindow wbwindow m_windows mwindow mwindow mwindow get window size return window size or null if not set public dimension get window size return null getwindowsize public wb window int type int id type type id id wbwindow prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p sourceacctschema id para i get parameter as int else log log level severe unknown parameter name p targetacctschema id getrecord id processinfoparameter getparameter getparametername getparameter c_acctschema_id p_sourceacctschema_id getparameterasint p_targetacctschema_id getrecord_id process return info throws exception protected string do it throws exception log info sourceacctschema id p sourceacctschema id targetacctschema id p targetacctschema id if p sourceacctschema id 0 p targetacctschema id 0 throw new compiere system error id 0 if p sourceacctschema id p targetacctschema id throw new compiere user error must be different m acct schema source m acct schema get get ctx p sourceacctschema id null if source get id 0 throw new compiere system error not found source c acctschema id p sourceacctschema id m acct schema target new m acct schema get ctx p targetacctschema id get trxname if source get id 0 throw new compiere system error not found target c acctschema id p targetacctschema id m acct schema element source elements source get acct schema elements m acct schema element target elements target get acct schema elements if target elements length 0 throw new compiere user error not found target c acctschema element accounting element must be the same m acct schema element source acct element source get acct schema element m acct schema element elementtype account if source acct element null throw new compiere user error not found source ac c acctschema element m acct schema element target acct element target get acct schema element m acct schema element elementtype account if target acct element null throw new compiere user error not found target ac c acctschema element if source acct element getc element id target acct element getc element id throw new compiere user error c element id different if m acct schemagl get get ctx p targetacctschema id null copygl target if m acct schema default get get ctx p targetacctschema id null copy default target return ok doit sourceacctschema_id p_sourceacctschema_id targetacctschema_id p_targetacctschema_id p_sourceacctschema_id p_targetacctschema_id compieresystemerror p_sourceacctschema_id p_targetacctschema_id compiereusererror macctschema macctschema getctx p_sourceacctschema_id get_id compieresystemerror notfound c_acctschema_id p_sourceacctschema_id macctschema macctschema getctx p_targetacctschema_id get_trxname get_id compieresystemerror notfound c_acctschema_id p_targetacctschema_id macctschemaelement sourceelements getacctschemaelements macctschemaelement targetelements getacctschemaelements targetelements compiereusererror notfound c_acctschema_element macctschemaelement sourceacctelement getacctschemaelement macctschemaelement elementtype_account sourceacctelement compiereusererror notfound c_acctschema_element macctschemaelement targetacctelement getacctschemaelement macctschemaelement elementtype_account targetacctelement compiereusererror notfound c_acctschema_element sourceacctelement getc_element_id targetacctelement getc_element_id compiereusererror c_element_id macctschemagl getctx p_targetacctschema_id macctschemadefault getctx p_targetacctschema_id copydefault copy gl param targetas target throws exception private void copygl m acct schema targetas throws exception m acct schemagl source m acct schemagl get get ctx p sourceacctschema id m acct schemagl target new m acct schemagl get ctx 0 get trxname target setc acctschema id p targetacctschema id array list key name pair list source get acct info for int i 0 i list size i key name pair pp list get i int sourcec validcombination id pp get key string column name pp get name m account source account m account get get ctx sourcec validcombination id m account target account create account targetas source account target set value column name new integer target account getc validcombination id if target save throw new compiere system error could not save gl macctschema macctschemagl macctschemagl getctx p_sourceacctschema_id macctschemagl macctschemagl getctx get_trxname setc_acctschema_id p_targetacctschema_id arraylist keynamepair getacctinfo keynamepair sourcec_validcombination_id getkey columnname getname maccount sourceaccount maccount getctx sourcec_validcombination_id maccount targetaccount createaccount sourceaccount setvalue columnname targetaccount getc_validcombination_id compieresystemerror copy default param targetas target private void copy default m acct schema targetas throws exception m acct schema default source m acct schema default get get ctx p sourceacctschema id m acct schema default target new m acct schema default get ctx 0 get trxname target setc acctschema id p targetacctschema id target setc acctschema id p targetacctschema id array list key name pair list source get acct info for int i 0 i list size i key name pair pp list get i int sourcec validcombination id pp get key string column name pp get name m account source account m account get get ctx sourcec validcombination id m account target account create account targetas source account target set value column name new integer target account getc validcombination id if target save throw new compiere system error could not save default copydefault macctschema macctschemadefault macctschemadefault getctx p_sourceacctschema_id macctschemadefault macctschemadefault getctx get_trxname setc_acctschema_id p_targetacctschema_id setc_acctschema_id p_targetacctschema_id arraylist keynamepair getacctinfo keynamepair sourcec_validcombination_id getkey columnname getname maccount sourceaccount maccount getctx sourcec_validcombination_id maccount targetaccount createaccount sourceaccount setvalue columnname targetaccount getc_validcombination_id compieresystemerror create account param targetas target as param source acct source account return target account private m account create account m acct schema targetas m account source acct int ad client id targetas getad client id int c acctschema id targetas getc acctschema id int ad org id 0 int account id 0 int c subacct id 0 int m product id 0 int c bpartner id 0 int ad orgtrx id 0 int c locfrom id 0 int c locto id 0 int c salesregion id 0 int c project id 0 int c campaign id 0 int c activity id 0 int user1 id 0 int user2 id 0 int userelement1 id 0 int userelement2 id 0 active elements m acct schema element elements targetas get acct schema elements for int i 0 i elements length i m acct schema element ase elements i string element type ase get element type if element type equals m acct schema element elementtype organization ad org id source acct getad org id else if element type equals m acct schema element elementtype account account id source acct getaccount id else if element type equals m acct schema element elementtype subaccount c subacct id source acct getc subacct id else if element type equals m acct schema element elementtype bpartner c bpartner id source acct getc bpartner id else if element type equals m acct schema element elementtype product m product id source acct getm product id else if element type equals m acct schema element elementtype activity c activity id source acct getc activity id else if element type equals m acct schema element elementtype locationfrom c locfrom id source acct getc locfrom id else if element type equals m acct schema element elementtype locationto c locto id source acct getc locto id else if element type equals m acct schema element elementtype campaign c campaign id source acct getc campaign id else if element type equals m acct schema element elementtype orgtrx ad orgtrx id source acct getad orgtrx id else if element type equals m acct schema element elementtype project c project id source acct getc project id else if element type equals m acct schema element elementtype salesregion c salesregion id source acct getc salesregion id else if element type equals m acct schema element elementtype userlist1 user1 id source acct getuser1 id else if element type equals m acct schema element elementtype userlist2 user2 id source acct getuser2 id else if element type equals m acct schema element elementtype userelement1 userelement1 id source acct getuserelement1 id else if element type equals m acct schema element elementtype userelement2 userelement2 id source acct getuserelement2 id no user element return m account get get ctx ad client id ad org id c acctschema id account id c subacct id m product id c bpartner id ad orgtrx id c locfrom id c locto id c salesregion id c project id c campaign id c activity id user1 id user2 id userelement1 id userelement2 id sourceacct maccount createaccount macctschema maccount sourceacct ad_client_id getad_client_id c_acctschema_id getc_acctschema_id ad_org_id account_id c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_salesregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id userelement1_id userelement2_id macctschemaelement getacctschemaelements macctschemaelement elementtype getelementtype elementtype macctschemaelement elementtype_organization ad_org_id sourceacct getad_org_id elementtype macctschemaelement elementtype_account account_id sourceacct getaccount_id elementtype macctschemaelement elementtype_subaccount c_subacct_id sourceacct getc_subacct_id elementtype macctschemaelement elementtype_bpartner c_bpartner_id sourceacct getc_bpartner_id elementtype macctschemaelement elementtype_product m_product_id sourceacct getm_product_id elementtype macctschemaelement elementtype_activity c_activity_id sourceacct getc_activity_id elementtype macctschemaelement elementtype_locationfrom c_locfrom_id sourceacct getc_locfrom_id elementtype macctschemaelement elementtype_locationto c_locto_id sourceacct getc_locto_id elementtype macctschemaelement elementtype_campaign c_campaign_id sourceacct getc_campaign_id elementtype macctschemaelement elementtype_orgtrx ad_orgtrx_id sourceacct getad_orgtrx_id elementtype macctschemaelement elementtype_project c_project_id sourceacct getc_project_id elementtype macctschemaelement elementtype_salesregion c_salesregion_id sourceacct getc_salesregion_id elementtype macctschemaelement elementtype_userlist1 user1_id sourceacct getuser1_id elementtype macctschemaelement elementtype_userlist2 user2_id sourceacct getuser2_id elementtype macctschemaelement elementtype_userelement1 userelement1_id sourceacct getuserelement1_id elementtype macctschemaelement elementtype_userelement2 userelement2_id sourceacct getuserelement2_id userelement maccount getctx ad_client_id ad_org_id c_acctschema_id account_id c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_salesregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id userelement1_id userelement2_id standard constructor public x w mailmsg properties ctx int w mailmsg id string trx name super ctx w mailmsg id trx name if w mailmsg id 0 set mail msg type null set message null set name null set subject null setw mailmsg id 0 setw store id 0 x_w_mailmsg w_mailmsg_id trxname w_mailmsg_id trxname w_mailmsg_id setmailmsgtype setmessage setname setsubject setw_mailmsg_id setw_store_id load constructor public x w mailmsg properties ctx result set rs string trx name super ctx rs trx name x_w_mailmsg resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w mailmsg append get id append return sb to string tostring stringbuffer stringbuffer x_w_mailmsg get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string mailmsgtype request wr set message type mail message type public void set mail msg type string mail msg type if mail msg type null throw new illegal argument exception mail msg type is mandatory if mail msg type equals ls mail msg type equals lu mail msg type equals oa mail msg type equals pa mail msg type equals pe mail msg type equals ua mail msg type equals up mail msg type equals uv mail msg type equals wr else throw new illegal argument exception mail msg type invalid value mail msg type reference id 342 ls lu oa pa pe ua up uv wr if mail msg type length 2 log warning length 2 truncated mail msg type mail msg type substring 0 1 set value mail msg type mail msg type mailmsgtype_request setmailmsgtype mailmsgtype mailmsgtype illegalargumentexception mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype mailmsgtype illegalargumentexception mailmsgtype mailmsgtype reference_id mailmsgtype mailmsgtype mailmsgtype set_value mailmsgtype mailmsgtype get message type mail message type public string get mail msg type return string get value mail msg type getmailmsgtype get_value mailmsgtype set message e mail message public void set message string message if message null throw new illegal argument exception message is mandatory if message length 2000 log warning length 2000 truncated message message substring 0 1999 set value message message email setmessage illegalargumentexception set_value get message e mail message public string get message return string get value message email getmessage get_value set message 2 optional second part of the e mail message public void set message2 string message2 if message2 null message2 length 2000 log warning length 2000 truncated message2 message2 substring 0 1999 set value message2 message2 email setmessage2 set_value get message 2 optional second part of the e mail message public string get message2 return string get value message2 email getmessage2 get_value set message 3 optional third part of the e mail message public void set message3 string message3 if message3 null message3 length 2000 log warning length 2000 truncated message3 message3 substring 0 1999 set value message3 message3 email setmessage3 set_value get message 3 optional third part of the e mail message public string get message3 return string get value message3 email getmessage3 get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set subject email message subject public void set subject string subject if subject null throw new illegal argument exception subject is mandatory if subject length 255 log warning length 255 truncated subject subject substring 0 254 set value subject subject setsubject illegalargumentexception set_value get subject email message subject public string get subject return string get value subject getsubject get_value set mail message web store mail message template public void setw mailmsg id int w mailmsg id if w mailmsg id 1 throw new illegal argument exception w mailmsg id is mandatory set valuenocheck w mailmsg id new integer w mailmsg id setw_mailmsg_id w_mailmsg_id w_mailmsg_id illegalargumentexception w_mailmsg_id set_valuenocheck w_mailmsg_id w_mailmsg_id get mail message web store mail message template public int getw mailmsg id integer ii integer get value w mailmsg id if ii null return 0 return ii int value getw_mailmsg_id get_value w_mailmsg_id intvalue set web store a web store of the client public void setw store id int w store id if w store id 1 throw new illegal argument exception w store id is mandatory set value w store id new integer w store id setw_store_id w_store_id w_store_id illegalargumentexception w_store_id set_value w_store_id w_store_id get web store a web store of the client public int getw store id integer ii integer get value w store id if ii null return 0 return ii int value getw_store_id get_value w_store_id intvalue constructor param pos panel pos panel public sub checkout pos panel pos panel super pos panel pospanel subcheckout pospanel pospanel pospanel initialize public void init title titled border border new titled border msg get msg env get ctx checkout set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets2 0 gbc gridx 0 f register create button action register null gbc gridy 0 add f register gbc f summary create button action summary null gbc gridy 1 add f summary gbc f process create button action process null gbc gridy 2 add f process gbc f print create button action print null gbc gridy 3 add f print gbc 1 cash gbc gridx 1 gbc gridheight 2 gbc fill grid bag constraints both gbc weightx 1 c panel cash new c panel new grid bag layout cash set border new titled border msg get msg env get ctx cash gbc gridy 0 add cash gbc grid bag constraints gbc0 new grid bag constraints gbc0 insets insets2 gbc0 anchor grid bag constraints west f lcashgiven new c label msg get msg env get ctx cash given cash add f lcashgiven gbc0 f cashgiven new v number cash given false false true display type amount msg translate env get ctx cash given f cashgiven set columns 10 25 cash add f cashgiven gbc0 f cashgiven set value env zero f lcashreturn new c label msg get msg env get ctx cash return cash add f lcashreturn gbc0 f cashreturn new v number cash return false true false display type amount cash return f cashreturn set columns 10 25 cash add f cashreturn gbc0 f cashreturn set value env zero f cashpayment create button action payment null f cashpayment set action command cash gbc0 anchor grid bag constraints east gbc0 weightx 0 1 cash add f cashpayment gbc0 1 creditcard c panel creditcard new c panel new grid bag layout creditcard set border new titled border msg translate env get ctx credit card type gbc gridy 2 add creditcard gbc grid bag constraints gbc1 new grid bag constraints gbc1 insets insets2 gbc1 anchor grid bag constraints west gbc1 gridx 0 gbc1 gridy 0 f lcreditcardnumber new c label msg translate env get ctx credit card number creditcard add f lcreditcardnumber gbc1 gbc1 gridy 1 f creditcardnumber new c text field 18 creditcard add f creditcardnumber gbc1 gbc1 gridx 1 gbc1 gridy 0 f lcreditcardexp new c label msg translate env get ctx credit card exp creditcard add f lcreditcardexp gbc1 gbc1 gridy 1 f creditcardexp new c text field 5 creditcard add f creditcardexp gbc1 gbc1 gridx 2 gbc1 gridy 0 f lcreditcardvv new c label msg translate env get ctx credit cardvv creditcard add f lcreditcardvv gbc1 gbc1 gridy 1 f creditcardvv new c text field 5 creditcard add f creditcardvv gbc1 gbc1 gridx 3 gbc1 gridy 0 gbc1 gridheight 2 f creditpayment create button action payment null f creditpayment set action command credit card gbc1 anchor grid bag constraints east gbc1 weightx 0 1 creditcard add f creditpayment gbc1 titledborder titledborder getmsg getctx setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_register createbuttonaction f_register f_summary createbuttonaction f_summary f_process createbuttonaction f_process f_print createbuttonaction f_print gridbagconstraints cpanel cpanel gridbaglayout setborder titledborder getmsg getctx gridbagconstraints gridbagconstraints gridbagconstraints f_lcashgiven clabel getmsg getctx cashgiven f_lcashgiven f_cashgiven vnumber cashgiven displaytype getctx cashgiven f_cashgiven setcolumns f_cashgiven f_cashgiven setvalue f_lcashreturn clabel getmsg getctx cashreturn f_lcashreturn f_cashreturn vnumber cashreturn displaytype cashreturn f_cashreturn setcolumns f_cashreturn f_cashreturn setvalue f_cashpayment createbuttonaction f_cashpayment setactioncommand gridbagconstraints f_cashpayment cpanel cpanel gridbaglayout setborder titledborder getctx creditcardtype gridbagconstraints gridbagconstraints gridbagconstraints f_lcreditcardnumber clabel getctx creditcardnumber f_lcreditcardnumber f_creditcardnumber ctextfield f_creditcardnumber f_lcreditcardexp clabel getctx creditcardexp f_lcreditcardexp f_creditcardexp ctextfield f_creditcardexp f_lcreditcardvv clabel getctx creditcardvv f_lcreditcardvv f_creditcardvv ctextfield f_creditcardvv f_creditpayment createbuttonaction f_creditpayment setactioncommand creditcard gridbagconstraints f_creditpayment get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy 3 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub checkout action performed action register summary print cash payment credit card payment actionperformed actionevent getactioncommand possubcheckout actionperformed creditcard get singleton return a focus traversal policy public static a focus traversal policy get if s policy null s policy new a focus traversal policy return s policy afocustraversalpolicy afocustraversalpolicy s_policy s_policy afocustraversalpolicy s_policy constructor public a focus traversal policy super afocustraversalpolicy get default component param a container container return default or null public component get default component container a container info root a container m default true component c super get default component a container info default c m default false return c acontainer getdefaultcomponent acontainer acontainer m_default getdefaultcomponent acontainer m_default determines whether the specified code component code is an acceptable choice as the new focus owner this method performs the following sequence of operations ol li checks whether code a component code is visible displayable enabled and focusable if any of these properties is code false code this method returns code false code li if code a component code is an instance of code j table code returns code true code li if code a component code is an instance of code j combo box code then returns the value of code a component getui is focus traversable a component code li if code a component code is a code j component code with a code j component when focused code code input map code that is neither code null code nor empty returns code true code li returns the value of code default focus traversal policy accept a component code ol param a component the code component code whose fitness as a focus owner is to be tested see java awt component is visible see java awt component is displayable see java awt component is enabled see java awt component is focusable see javax swing plaf combo boxui is focus traversable see javax swing j component get input map see java awt default focus traversal policy accept return code true code if code a component code is a valid choice for a focus owner otherwise code false code protected boolean accept component a component if super accept a component return false tabbed pane if a component instanceof j tabbed pane return false r o editors if a component instanceof c editor c editor ed c editor a component if ed is read write return false if m default get default focus ad client id equals a component get name ad org id equals a component get name return false toolbar buttons if a component get parent instanceof j tool bar return false return true acomponent acomponent jtable acomponent jcombobox acomponent isfocustraversable acomponent acomponent jcomponent jcomponent when_focused inputmap defaultfocustraversalpolicy acomponent acomponent isvisible isdisplayable isenabled isfocusable comboboxui isfocustraversable jcomponent getinputmap defaultfocustraversalpolicy acomponent acomponent acomponent tabbedpane acomponent jtabbedpane acomponent ceditor ceditor ceditor acomponent isreadwrite m_default ad_client_id acomponent getname ad_org_id acomponent getname acomponent getparent jtoolbar dump info param title param c private void info string title component c system out print title if c null system out println null else system out print c get class get name system out println c get name getclass getname getname private vector string registry list new vector string 2 public concrete element registrylist concreteelement if the object is in the registry return otherwise return null param element the name of the object to locate public concrete element get element string element if registry contains key element return concrete element registry get element return null concreteelement getelement containskey concreteelement registers an element in the head element list param element element to be added to the registry public element add element to registry element element if element null return this int hc element hash code causes error when compiles in 1 4 string s integer to string hc add element to registry s element return this addelementtoregistry hashcode tostring addelementtoregistry registers an element in the head element list param hashcode internal name of element param element element to be added to the registry public element add element to registry string hashcode element element if hashcode null element null return this element set filter state get filter state if ecs defaults get default pretty print element get pretty print element set pretty print get pretty print registry put hashcode element if registry list contains hashcode registry list add element hashcode return this addelementtoregistry setfilterstate getfilterstate ecsdefaults getdefaultprettyprint getprettyprint setprettyprint getprettyprint registrylist registrylist addelement registers an element in the head element list hashcode named element for hashcode param element element to be added to the registry param filter does this need to be filtered public element add element to registry element element boolean filter if element null return this set filter state filter add element to registry integer to string element hash code element return this addelementtoregistry setfilterstate addelementtoregistry tostring hashcode registers an element in the head element list param element element to be added to the registry param filter should we filter this element public element add element to registry string hashcode element element boolean filter if hashcode null return this set filter state filter add element to registry hashcode element return this addelementtoregistry setfilterstate addelementtoregistry registers an element in the head element list param value element to be added to the registry param filter does this need to be filtered public element add element to registry string value boolean filter if value null return this set filter state filter add element to registry integer to string value hash code value return this addelementtoregistry setfilterstate addelementtoregistry tostring hashcode registers an element in the head element list hashcode named element for hashcode param value element to be added to the registry param filter does this need to be filtered public element add element to registry string hashcode string value boolean filter if hashcode null return this set filter state filter add element to registry hashcode value return this addelementtoregistry setfilterstate addelementtoregistry registers an element in the head element list param value element to be added to the registry public element add element to registry string value if value null return this add element to registry new string element value return this addelementtoregistry addelementtoregistry stringelement registers an element in the head element list param value element to be added to the registry public element add element to registry string hashcode string value if hashcode null return this we do it this way so that filtering will work 1 create a new string element element this is the only way that set text tag will get called 2 copy the filter state of this string element to this child 3 copy the pretty print state of the element to this child 4 copy the filter for this string element to this child string element se new string element value se set filter state get filter state se set filter get filter se set pretty print get pretty print add element to registry hashcode se return this addelementtoregistry stringelement settexttag prettyprint stringelement stringelement setfilterstate getfilterstate setfilter getfilter setprettyprint getprettyprint addelementtoregistry removes an element from the element registry param element element to be added to the registry public element remove element from registry element element remove element from registry integer to string element hash code return this removeelementfromregistry removeelementfromregistry tostring hashcode removes an element from the head element registry param hashcode element to be added to the registry public element remove element from registry string hashcode registry remove hashcode registry list remove element hashcode return this removeelementfromregistry registrylist removeelement find out if this element is in the element registry param element find out if this element is in the registry public boolean registry has element element element return registry contains element registryhaselement get the keys of this element public enumeration keys return registry list elements registrylist get an enumeration of the elements that this element contains public enumeration elements return registry elements find out if this element is in the element registry param hashcode find out if this element is in the registry public boolean registry has element string hashcode return registry contains key hashcode registryhaselement containskey override output output stream incase any elements are in the registry param out output stream to write to public void output output stream out boolean pretty print get pretty print int tab level get tab level try if registry size 0 if pretty print this instanceof printable tab level 0 put tabs tab level out super output out else if pretty print this instanceof printable tab level 0 put tabs tab level out out write create start tag get bytes if this is a string element that has child elements still print the tag text if get tag text null out write get tag text get bytes enumeration en registry list elements while en has more elements object obj registry get en next element if obj instanceof generic element element e element obj if pretty print this instanceof printable if get need line break out write n e set tab level tab level 1 e output out else if pretty print this instanceof printable if get need line break out write n put tabs tab level 1 out string string obj to string out write string get bytes if get need closing tag if pretty print this instanceof printable if get need line break out write n if tab level 0 put tabs tab level out out write create end tag get bytes catch io exception ioe ioe print stack trace new print writer out outputstream outputstream outputstream prettyprint getprettyprint tablevel gettablevel prettyprint tablevel puttabs tablevel prettyprint tablevel puttabs tablevel createstarttag getbytes stringelement childelements tagtext gettagtext gettagtext getbytes registrylist hasmoreelements nextelement genericelement prettyprint getneedlinebreak settablevel tablevel prettyprint getneedlinebreak puttabs tablevel tostring getbytes getneedclosingtag prettyprint getneedlinebreak tablevel puttabs tablevel createendtag getbytes ioexception printstacktrace printwriter writer version of this method public void output writer out output new print writer out printwriter override output buffered writer incase any elements are in the registry param out output stream to write to public void output print writer out boolean pretty print get pretty print int tab level get tab level if registry size 0 if pretty print this instanceof printable tab level 0 put tabs tab level out super output out else if pretty print this instanceof printable tab level 0 put tabs tab level out out write create start tag if this is a string element that has child elements still print the tag text if get tag text null out write get tag text enumeration en registry list elements while en has more elements object obj registry get en next element if obj instanceof generic element element e element obj if pretty print this instanceof printable if get need line break out write n e set tab level tab level 1 e output out else if pretty print this instanceof printable if get need line break out write n put tabs tab level 1 out string string obj to string if get filter state out write get filter process string else out write string if get need closing tag if pretty print this instanceof printable if get need line break out write n if tab level 0 put tabs tab level out out write create end tag bufferedwriter outputstream printwriter prettyprint getprettyprint tablevel gettablevel prettyprint tablevel puttabs tablevel prettyprint tablevel puttabs tablevel createstarttag stringelement childelements tagtext gettagtext gettagtext registrylist hasmoreelements nextelement genericelement prettyprint getneedlinebreak settablevel tablevel prettyprint getneedlinebreak puttabs tablevel tostring getfilterstate getfilter getneedclosingtag prettyprint getneedlinebreak tablevel puttabs tablevel createendtag allows all elements the ability to be cloned public object clone try byte array output stream baos new byte array output stream object output stream out new object output stream baos out write object this out close byte array input stream bin new byte array input stream baos to byte array object input stream in new object input stream bin object clone in read object in close return clone catch class not found exception cnfe throw new internal error cnfe to string catch stream corrupted exception sce throw new internal error sce to string catch io exception ioe throw new internal error ioe to string bytearrayoutputstream bytearrayoutputstream objectoutputstream objectoutputstream writeobject bytearrayinputstream bytearrayinputstream tobytearray objectinputstream objectinputstream readobject classnotfoundexception internalerror tostring streamcorruptedexception internalerror tostring ioexception internalerror tostring get contsnts return contents public object get contents return contents getcontents compiere user error param message message public compiere user error string message super message compiereusererror compiere user error param message message param fix hint fix hint public compiere user error string message string fix hint super message set fix hint fix hint fixhint compiereusererror fixhint setfixhint fixhint compiere user error param message param cause public compiere user error string message throwable cause super message cause compiereusererror compiereusererror return returns the fix hint public string get fix hint return m fixhint fixhint getfixhint m_fixhint set fix hint param fix hint fix hint public void set fix hint string fix hint m fixhint fix hint fixhint setfixhint fixhint m_fixhint fixhint string representation return info public string to string super to string string buffer sb new string buffer user error sb append get localized message if m fixhint null m fixhint length 0 sb append append m fixhint append return sb to string tostring tostring stringbuffer stringbuffer usererror getlocalizedmessage m_fixhint m_fixhint m_fixhint tostring constructor param invoker invoker button param ad table id table param record id record param c bpartner id optional bp public a request j component invoker int ad table id int record id int c bpartner id super log config ad table id ad table id record id record id m ad table id ad table id m record id record id m c bpartner id c bpartner id get requests invoker ad_table_id record_id c_bpartner_id arequest jcomponent ad_table_id record_id c_bpartner_id ad_table_id ad_table_id record_id record_id m_ad_table_id ad_table_id m_record_id record_id m_c_bpartner_id c_bpartner_id getrequests display request options new existing param invoker button private void get requests j component invoker m new new c menu item msg get msg env get ctx request new m new set icon env get image icon new16 gif m popup add m new add action listener this int active count 0 int inactive count 0 m where new string buffer m where append ad table id append m ad table id append and record id append m record id append if m ad table id m user table id m where append or ad user id append m record id append or salesrep id append m record id else if m ad table id mb partner table id m where append or c bpartner id append m record id else if m ad table id m order table id m where append or c order id append m record id else if m ad table id m invoice table id m where append or c invoice id append m record id else if m ad table id m payment table id m where append or c payment id append m record id else if m ad table id m product table id m where append or m product id append m record id else if m ad table id m project table id m where append or c project id append m record id else if m ad table id m campaign table id m where append or c campaign id append m record id else if m ad table id m asset table id m where append or a asset id append m record id string sql select processed count from r request where m where group by processed order by processed desc prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next if y equals rs get string 1 inactive count rs get int 2 else active count rs get int 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if active count 0 m active new c menu item msg get msg env get ctx request active active count m popup add m active add action listener this if inactive count 0 m all new c menu item msg get msg env get ctx request all active count inactive count m popup add m all add action listener this if invoker is showing m popup show invoker 0 invoker get height below button getrequests jcomponent m_new cmenuitem getmsg getctx requestnew m_new seticon getimageicon m_popup m_new addactionlistener activecount inactivecount m_where stringbuffer m_where ad_table_id m_ad_table_id record_id m_record_id m_ad_table_id muser table_id m_where ad_user_id m_record_id salesrep_id m_record_id m_ad_table_id mbpartner table_id m_where c_bpartner_id m_record_id m_ad_table_id morder table_id m_where c_order_id m_record_id m_ad_table_id minvoice table_id m_where c_invoice_id m_record_id m_ad_table_id mpayment table_id m_where c_payment_id m_record_id m_ad_table_id mproduct table_id m_where m_product_id m_record_id m_ad_table_id mproject table_id m_where c_project_id m_record_id m_ad_table_id mcampaign table_id m_where c_campaign_id m_record_id m_ad_table_id masset table_id m_where a_asset_id m_record_id r_request m_where preparedstatement preparestatement resultset executequery getstring inactivecount getint activecount getint activecount m_active cmenuitem getmsg getctx requestactive activecount m_popup m_active addactionlistener inactivecount m_all cmenuitem getmsg getctx requestall activecount inactivecount m_popup m_all addactionlistener isshowing m_popup getheight listner param e event public void action performed action event e m query query null if e get source m active query new m query string where m where and processed n query add restriction where else if e get source m all query new m query query add restriction m where to string int ad window id 232 232 all 201 my a window frame new a window if frame init window ad window id query return new set table record if e get source m new m tab tab frame geta panel get current tab tab data new false tab set value ad table id new integer m ad table id tab set value record id new integer m record id if m c bpartner id 0 tab set value c bpartner id new integer m c bpartner id if m ad table id mb partner table id tab set value c bpartner id new integer m record id else if m ad table id m user table id tab set value ad user id new integer m record id else if m ad table id m project table id tab set value c project id new integer m record id else if m ad table id m asset table id tab set value a asset id new integer m record id else if m ad table id m order table id tab set value c order id new integer m record id else if m ad table id m invoice table id tab set value c invoice id new integer m record id else if m ad table id m product table id tab set value m product id new integer m record id else if m ad table id m payment table id tab set value c payment id new integer m record id else if m ad table id m in out table id tab set value m inout id new integer m record id else if m ad table id mrma table id tab set value m rma id new integer m record id else if m ad table id m campaign table id tab set value c campaign id new integer m record id a env show center screen frame frame null actionperformed actionevent mquery getsource m_active mquery m_where addrestriction getsource m_all mquery addrestriction m_where tostring ad_window_id awindow awindow initwindow ad_window_id getsource m_new mtab getapanel getcurrenttab datanew setvalue ad_table_id m_ad_table_id setvalue record_id m_record_id m_c_bpartner_id setvalue c_bpartner_id m_c_bpartner_id m_ad_table_id mbpartner table_id setvalue c_bpartner_id m_record_id m_ad_table_id muser table_id setvalue ad_user_id m_record_id m_ad_table_id mproject table_id setvalue c_project_id m_record_id m_ad_table_id masset table_id setvalue a_asset_id m_record_id m_ad_table_id morder table_id setvalue c_order_id m_record_id m_ad_table_id minvoice table_id setvalue c_invoice_id m_record_id m_ad_table_id mproduct table_id setvalue m_product_id m_record_id m_ad_table_id mpayment table_id setvalue c_payment_id m_record_id m_ad_table_id minout table_id setvalue m_inout_id m_record_id m_ad_table_id table_id setvalue m_rma_id m_record_id m_ad_table_id mcampaign table_id setvalue c_campaign_id m_record_id aenv showcenterscreen constructor with 10 initial capacity same as array list public multi map this 10 arraylist multimap constructor public multi map int initial capacity m keys new array list k initial capacity m values new array list v initial capacity multimap initialcapacity m_keys arraylist initialcapacity m_values arraylist initialcapacity return number of elements public int size return m keys size m_keys is empty public boolean is empty return m keys size 0 isempty m_keys contains key public boolean contains key object key return m keys contains key containskey m_keys contains value public boolean contains value object value return m values contains value containsvalue m_values return array list of values of key suppress warnings unchecked public v get object key return v get values key arraylist suppresswarnings getvalues return array list of values of key public array list get values object key array list v list new array list v we don t have it if m keys contains key return list go through keys int size m keys size for int i 0 i size i if m keys get i equals key if list contains m values get i list add m values get i return list arraylist arraylist getvalues arraylist arraylist m_keys m_keys m_keys m_values m_values return array list of keys with value public array list get keys object value array list k list new array list k we don t have it if m values contains value return list go through keys int size m values size for int i 0 i size i if m values get i equals value if list contains m keys get i list add m keys get i return list arraylist arraylist getkeys arraylist arraylist m_values m_values m_values m_keys m_keys put key value return always null public v put k key v value m keys add key m values add value return null m_keys m_values remove key public v remove object key throw new java lang unsupported operation exception method remove not implemented unsupportedoperationexception put all public void put all map t throw new java lang unsupported operation exception method put all not implemented putall unsupportedoperationexception putall clear content public void clear m keys clear m values clear m_keys m_values return hash set of keys public set k key set hash set k keys new hash set k m keys return keys hashset keyset hashset hashset m_keys return collection of values public collection v values return m values m_values public set map entry k v entry set throw new java lang unsupported operation exception method entry set not implemented entryset unsupportedoperationexception entryset public boolean equals object o throw new java lang unsupported operation exception method equals not implemented unsupportedoperationexception returns class name and number of entries public string to string return multi map m keys size tostring multimap m_keys dump all keys values to log public void print to log c logger log c logger getc logger get class log fine multi map print to log int size m keys size for int i 0 i size i object k m keys get i object v m values get i log finest k null null k to string v null null v to string printtolog clogger clogger getclogger getclass multimap printtolog m_keys m_keys m_values tostring tostring get contsnts return contents public object get contents return contents getcontents public button set the name of this button param name set the name of this button public button set name string name add attribute name name return this setname addattribute set the value of this button param value set the value of this button public button set value string value add attribute value value return this setvalue addattribute set the type of button this is convience variables are br button submit br button reset br button button param type type public button set type string type add attribute type type return this settype addattribute is this button disabled disabled true false public button set disabled boolean disabled if disabled add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute set the elements position in the tabbing order param number set the elements position in the tabbing order public button set tab index int number add attribute tabindex integer to string number return this settabindex addattribute tostring set the elements position in the tabbing order param number set the elements position in the tabbing order public button set tab index string number add attribute tabindex number return this settabindex addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public button add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public button add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public button add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public button add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public button remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param script script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param script script public void set on blur string script add attribute onblur script setonblur addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c cyclephase properties ctx int c cyclephase id string trx name super ctx c cyclephase id trx name if c cyclephase id 0 setc cyclestep id 0 setc phase id 0 x_c_cyclephase c_cyclephase_id trxname c_cyclephase_id trxname c_cyclephase_id setc_cyclestep_id setc_phase_id load constructor public x c cyclephase properties ctx result set rs string trx name super ctx rs trx name x_c_cyclephase resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cyclephase append get id append return sb to string tostring stringbuffer stringbuffer x_c_cyclephase get_id tostring set cycle step the step for this cycle public void setc cyclestep id int c cyclestep id if c cyclestep id 1 throw new illegal argument exception c cyclestep id is mandatory set valuenocheck c cyclestep id new integer c cyclestep id setc_cyclestep_id c_cyclestep_id c_cyclestep_id illegalargumentexception c_cyclestep_id set_valuenocheck c_cyclestep_id c_cyclestep_id get cycle step the step for this cycle public int getc cyclestep id integer ii integer get value c cyclestep id if ii null return 0 return ii int value getc_cyclestep_id get_value c_cyclestep_id intvalue set standard phase standard phase of the project type public void setc phase id int c phase id if c phase id 1 throw new illegal argument exception c phase id is mandatory set valuenocheck c phase id new integer c phase id setc_phase_id c_phase_id c_phase_id illegalargumentexception c_phase_id set_valuenocheck c_phase_id c_phase_id get standard phase standard phase of the project type public int getc phase id integer ii integer get value c phase id if ii null return 0 return ii int value getc_phase_id get_value c_phase_id intvalue get content return content public object get contents return contents getcontents static create ui param c vomponent return compiere panel ui public static componentui createui j component c return new compiere panelui return s panelui jcomponent compierepanelui s_panelui install defaults param p panel protected void install defaults j panel p super install defaults p if enabled all windows are with compiere background but sun dialogs print are patchy as they are opaque system out println bg p get client property compiereplaf background if s setdefault p get client property compiereplaf background null p put client property compiereplaf background s default installdefaults jpanel installdefaults getclientproperty s_setdefault getclientproperty putclientproperty s_default update this method is invoked by code j component code when the specified component is being painted by default this method will fill the specified component with its background color if its code opaque code property is code true code and then immediately call code paint code param g the code graphics code context in which to paint param c the component being painted see javax swing j component paint component public void update graphics g j component c compiere utils print parents c if c is opaque update it g c paint g c does nothing jcomponent jcomponent paintcomponent jcomponent compiereutils printparents isopaque updateit print background based on compiere color or flat background if not found param g param c static void update it graphics g j component c system out print panel c get name system out print bounds c get bounds to string system out print background get compiere color compiere color bg null try bg compiere color c get client property compiereplaf background catch exception e system err println compiere panelui client property e get message paint compiere background if bg null system out print bg bg paint g c else system out print c get background g set color c get background g fill rect 0 0 c get width c get height system out println compierecolor updateit jcomponent getname getbounds tostring compierecolor compierecolor compierecolor getclientproperty compierepanelui clientproperty getmessage getbackground setcolor getbackground fillrect getwidth getheight set default background param bg background color public static void set default background compiere color bg if bg null return s default set color bg setdefaultbackground compierecolor s_default setcolor get default background return background public static compiere color get default background return s default compierecolor getdefaultbackground s_default set default background param set default if true the background will be set to the default color public static void set set default boolean set default s setdefault set default setdefault setsetdefault setdefault s_setdefault setdefault is the default background set by default return true if default background is set public static boolean is set default return s setdefault issetdefault s_setdefault get contents return contents public object get contents return contents getcontents get contents return contents public object get contents return contents getcontents constructor param ass accounting schemata param rs record parem trx name trx protected doc requisition m acct schema ass result set rs string trx name super ass m requisition class rs doctype purchaserequisition trx name trxname doc_requisition macctschema resultset trxname mrequisition doctype_purchaserequisition trxname load specific document details return error message or null protected string load document details setc currency id no currency m requisition req m requisition getpo set date doc req get date doc set date acct req get date doc amounts set amount amttype gross req get total lines set amount amttype net req get total lines contained objects p lines load lines req log fine lines p lines length taxes m taxes length return null loaddocumentdetails setc_currency_id no_currency mrequisition mrequisition setdatedoc getdatedoc setdateacct getdatedoc setamount amttype_gross gettotallines setamount amttype_net gettotallines p_lines loadlines p_lines m_taxes load invoice line return doc line array private doc line load lines m requisition req array list doc line list new array list doc line m requisition line lines req get lines for int i 0 i lines length i m requisition line line lines i doc line doc line new doc line line this big decimal qty line get qty doc line set qty qty false big decimal price actual line get price actual big decimal line net amt line get line net amt doc line set amount line net amt dr list add doc line return array doc line dls new doc line list size list to array dls return dls docline docline loadlines mrequisition arraylist docline arraylist docline mrequisitionline getlines mrequisitionline docline docline docline bigdecimal getqty docline setqty bigdecimal priceactual getpriceactual bigdecimal linenetamt getlinenetamt docline setamount linenetamt docline docline docline toarray get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value new big decimal 0 0 return ret value bigdecimal getbalance bigdecimal retvalue bigdecimal retvalue create facts the accounting logic for por pre reservation expense cr offset dr pre param as accounting schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact fact fact new fact this as fact post reservation setc currency id as getc currency id big decimal gross amt get amount doc amttype gross commitment if as is create reservation big decimal total env zero for int i 0 i p lines length i doc line line p lines i big decimal cost line get amt source total total add cost account m account expense line get account product cost accttype p expense as fact create line line expense as getc currency id cost null offset m account offset get account accttype commitmentoffset as if offset null p error not found commitmentoffset acct log log level severe p error return null fact create line null offset getc currency id null total facts add fact return facts arraylist createfacts macctschema arraylist arraylist post_reservation setc_currency_id getc_currency_id bigdecimal grossamt getamount amttype_gross iscreatereservation bigdecimal p_lines docline p_lines bigdecimal getamtsource maccount getaccount productcost accttype_p_expense createline getc_currency_id maccount getaccount accttype_commitmentoffset p_error notfound commitmentoffset_acct p_error createline getc_currency_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals ad org id m ad org id big decimal para i get parameter int value else if name equals c bankaccount id m c bankaccount id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else log log level severe unknown parameter name m ctx env get ctx processinfoparameter getparameter getparametername getparameter ad_client_id m_ad_client_id bigdecimal getparameter intvalue ad_org_id m_ad_org_id bigdecimal getparameter intvalue c_bankaccount_id m_c_bankaccount_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter m_ctx getctx perform process return message throws exception protected string do it throws java lang exception log info string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i bankstatement where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i bankstatement set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id append m ad org id append sql append is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no sql new string buffer update i bankstatement o set i isimported e i errormsg i errormsg err invalid org where ad org id is null or ad org id 0 or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid org no set bank account sql new string buffer update i bankstatement i set c bankaccount id select c bankaccount id from c bankaccount a c bank b where b is own bank y and a ad client id i ad client id and a c bank id b c bank id and a account no i bank account no and b routing no i routing no or b swift code i routing no where i c bankaccount id is null and i i isimported y or i i isimported is null append client check no db execute update sql to string get trxname if no 0 log info bank account with routing no no sql new string buffer update i bankstatement i set c bankaccount id select c bankaccount id from c bankaccount a c bank b where b is own bank y and a c bank id b c bank id and a account no i bank account no and a ad client id i ad client id where i c bankaccount id is null and i i isimported y or i i isimported is null append client check no db execute update sql to string get trxname if no 0 log info bank account without routing no no sql new string buffer update i bankstatement i set c bankaccount id select c bankaccount id from c bankaccount a where a c bankaccount id append m c bankaccount id sql append and a ad client id i ad client id where i c bankaccount id is null and i bank account no is null and i i isimported y or i i isimported is null append client check no db execute update sql to string get trxname if no 0 log info bank account no sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid bank account where c bankaccount id is null and i isimported y or i isimported is null append client check no db execute update sql to string get trxname if no 0 log warning invalid bank account no set currency sql new string buffer update i bankstatement i set c currency id select c currency id from c currency c where i iso code c iso code and c ad client id in 0 i ad client id where c currency id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log info set currency no sql new string buffer update i bankstatement i set i c currency id select c currency id from c bankaccount where c bankaccount id i c bankaccount id where i c currency id is null and i iso code is null append client check no db execute update sql to string get trxname if no 0 log info set currency no sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid currency where c currency id is null and i isimported e and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid currency no set amount sql new string buffer update i bankstatement set charge amt 0 where charge amt is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log info charge amount no sql new string buffer update i bankstatement set interest amt 0 where interest amt is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log info interest amount no sql new string buffer update i bankstatement set trx amt stmt amt interest amt charge amt where trx amt is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log info transaction amount no sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid amount where trx amt charge amt interest amt stmt amt and i isimported y append client check no db execute update sql to string get trxname if no 0 log info invaid amount no set valuta date sql new string buffer update i bankstatement set valuta date statement line date where valuta date is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log info valuta date no check payment invoice combination sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid payment invoive where i bankstatement id in select i bankstatement id from i bankstatement i c payment p where i c invoice id is not null and i c payment id is not null and p c invoice id is not null and p c invoice id i c invoice id group by i bankstatement id append client check no db execute update sql to string get trxname if no 0 log info payment invoice mismatch no check payment b partner combination sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid payment b partner where i bankstatement id in select i bankstatement id from i bankstatement i c payment p where i c payment id is not null and i c bpartner id is not null and p c bpartner id is not null and p c bpartner id i c bpartner id group by i bankstatement id append client check no db execute update sql to string get trxname if no 0 log info payment b partner mismatch no check invoice b partner combination sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid invoice b partner where i bankstatement id in select i bankstatement id from i bankstatement i c invoice v where i c bpartner id is not null and i c invoice id is not null and v c bpartner id is not null and v c bpartner id i c bpartner id group by i bankstatement id append client check no db execute update sql to string get trxname if no 0 log info invoice b partner mismatch no check invoice b partner payment b partner combination sql new string buffer update i bankstatement set i isimported e i errormsg i errormsg err invalid invoice b partner payment b partner where i bankstatement id in select i bankstatement id from i bankstatement i c invoice v c payment p where p c invoice id v c invoice id and i c invoice id is not null and i c payment id is not null and v c bpartner id is not null and p c bpartner id is not null and v c bpartner id p c bpartner id group by i bankstatement id append client check no db execute update sql to string get trxname if no 0 log info invoice b partner payment b partner mismatch no detect duplicates sql new string buffer select i i bankstatement id l c bankstatementline id i eft trxid from i bankstatement i c bankstatement s c bankstatementline l where i i isimported n and s c bankstatement id l c bankstatement id and i eft trxid is not null and concatinate eft info l eft trxid l eft amt l eft statement line date l eft valuta date l eft trx type l eft currency l eft reference s eft statement reference l eft check no l eft memo l eft payee l eft payee account i eft trxid i eft amt i eft statement line date i eft valuta date i doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_bankstatement i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_bankstatement ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id m_ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg ad_org_id ad_org_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement c_bankaccount_id c_bankaccount_id c_bankaccount c_bank isownbank ad_client_id ad_client_id c_bank_id c_bank_id accountno bankaccountno routingno routingno swiftcode routingno c_bankaccount_id i_isimported i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement c_bankaccount_id c_bankaccount_id c_bankaccount c_bank isownbank c_bank_id c_bank_id accountno bankaccountno ad_client_id ad_client_id c_bankaccount_id i_isimported i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement c_bankaccount_id c_bankaccount_id c_bankaccount c_bankaccount_id m_c_bankaccount_id ad_client_id ad_client_id c_bankaccount_id bankaccountno i_isimported i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg c_bankaccount_id i_isimported i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement c_currency_id c_currency_id c_currency iso_code iso_code ad_client_id ad_client_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement c_currency_id c_currency_id c_bankaccount c_bankaccount_id c_bankaccount_id c_currency_id iso_code clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg c_currency_id i_isimported i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement chargeamt chargeamt i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement interestamt interestamt i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement trxamt stmtamt interestamt chargeamt trxamt i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg trxamt chargeamt interestamt stmtamt i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement valutadate statementlinedate valutadate i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg i_bankstatement_id i_bankstatement_id i_bankstatement c_payment c_invoice_id c_payment_id c_invoice_id c_invoice_id c_invoice_id i_bankstatement_id clientcheck executeupdate tostring get_trxname bpartner stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg bpartner i_bankstatement_id i_bankstatement_id i_bankstatement c_payment c_payment_id c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id i_bankstatement_id clientcheck executeupdate tostring get_trxname bpartner bpartner stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg bpartner i_bankstatement_id i_bankstatement_id i_bankstatement c_invoice c_bpartner_id c_invoice_id c_bpartner_id c_bpartner_id c_bpartner_id i_bankstatement_id clientcheck executeupdate tostring get_trxname bpartner bpartner bpartner stringbuffer i_bankstatement i_isimported i_errormsg i_errormsg bpartner bpartner i_bankstatement_id i_bankstatement_id i_bankstatement c_invoice c_payment c_invoice_id c_invoice_id c_invoice_id c_payment_id c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id i_bankstatement_id clientcheck executeupdate tostring get_trxname bpartner bpartner stringbuffer i_bankstatement_id c_bankstatementline_id efttrxid i_bankstatement c_bankstatement c_bankstatementline i_isimported c_bankstatement_id c_bankstatement_id efttrxid efttrxid eftamt eftstatementlinedate eftvalutadate efttrxtype eftcurrency eftreference eftstatementreference eftcheckno eftmemo eftpayee eftpayeeaccount efttrxid eftamt eftstatementlinedate eftvalutadate get contents return context public object get contents return contents getcontents standard constructor public x r category properties ctx int r category id string trx name super ctx r category id trx name if r category id 0 set name null setr category id 0 x_r_category r_category_id trxname r_category_id trxname r_category_id setname setr_category_id load constructor public x r category properties ctx result set rs string trx name super ctx rs trx name x_r_category resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r category append get id append return sb to string tostring stringbuffer stringbuffer x_r_category get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set category request category public void setr category id int r category id if r category id 1 throw new illegal argument exception r category id is mandatory set valuenocheck r category id new integer r category id setr_category_id r_category_id r_category_id illegalargumentexception r_category_id set_valuenocheck r_category_id r_category_id get category request category public int getr category id integer ii integer get value r category id if ii null return 0 return ii int value getr_category_id get_value r_category_id intvalue get due days select name payment term due days c paymentterm id sys date sys date due days from c paymentterm param p c paymentterm id payment term param p docdate document date param p paydate payment date or today return days due public static int due days int p c paymentterm id timestamp p docdate timestamp p paydate throws sql exception parameter if p c paymentterm id 0 p docdate null return 0 pay date timestamp pay date p paydate if pay date null pay date new timestamp system current time millis pay date compiere trunc pay date get due date timestamp due date null string sql select from c paymentterm where c paymentterm id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c paymentterm id result set rs pstmt execute query if rs next boolean is due fixed y equals rs get string is due fixed if is due fixed int fix month day rs get int fix month day int fix month offset rs get int fix month offset int fix month cutoff rs get int fix month cutoff due date calculate date due p docdate fix month day fix month offset fix month cutoff else int net days rs get int net days due date compiere add days p docdate net days rs close pstmt close if due date null return 0 return compiere get days between due date pay date paymenttermduedays c_paymentterm_id sysdate sysdate duedays c_paymentterm p_c_paymentterm_id p_docdate p_paydate duedays p_c_paymentterm_id p_docdate p_paydate sqlexception p_c_paymentterm_id p_docdate paydate p_paydate paydate paydate currenttimemillis paydate paydate duedate c_paymentterm c_paymentterm_id preparedstatement preparestatement setint p_c_paymentterm_id resultset executequery isduefixed getstring isduefixed isduefixed fixmonthday getint fixmonthday fixmonthoffset getint fixmonthoffset fixmonthcutoff getint fixmonthcutoff duedate calculatedatedue p_docdate fixmonthday fixmonthoffset fixmonthcutoff netdays getint netdays duedate adddays p_docdate netdays duedate getdaysbetween duedate paydate get due days of invoice param p c invoice id invoice param p paydate paument date or today return days due public static int invoice due days int p c invoice id timestamp p paydate throws sql exception parameter if p c invoice id 0 return 0 int ret value 0 string sql select c paymentterm id date invoiced from c invoice where c invoice id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c invoice id result set rs pstmt execute query if rs next int c paymentterm id rs get int 1 timestamp doc date rs get timestamp 2 ret value due days c paymentterm id doc date p paydate rs close pstmt close return ret value p_c_invoice_id p_paydate invoiceduedays p_c_invoice_id p_paydate sqlexception p_c_invoice_id retvalue c_paymentterm_id dateinvoiced c_invoice c_invoice_id preparedstatement preparestatement setint p_c_invoice_id resultset executequery c_paymentterm_id getint docdate gettimestamp retvalue duedays c_paymentterm_id docdate p_paydate retvalue get due date select name payment term due date c paymentterm id sys date due date from c paymentterm param p c paymentterm id payment term param p docdate document date return due date public static timestamp due date int p c paymentterm id timestamp p docdate throws sql exception parameter if p c paymentterm id 0 p docdate null return null due date timestamp due date compiere trunc p docdate get due date string sql select from c paymentterm where c paymentterm id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c paymentterm id result set rs pstmt execute query if rs next boolean is due fixed y equals rs get string is due fixed if is due fixed int fix month day rs get int fix month day int fix month offset rs get int fix month offset int fix month cutoff rs get int fix month cutoff due date calculate date due p docdate fix month day fix month offset fix month cutoff else int net days rs get int net days if net days 0 due date compiere add days due date net days rs close pstmt close return due date paymenttermduedate c_paymentterm_id sysdate duedate c_paymentterm p_c_paymentterm_id p_docdate duedate p_c_paymentterm_id p_docdate sqlexception p_c_paymentterm_id p_docdate duedate p_docdate c_paymentterm c_paymentterm_id preparedstatement preparestatement setint p_c_paymentterm_id resultset executequery isduefixed getstring isduefixed isduefixed fixmonthday getint fixmonthday fixmonthoffset getint fixmonthoffset fixmonthcutoff getint fixmonthcutoff duedate calculatedatedue p_docdate fixmonthday fixmonthoffset fixmonthcutoff netdays getint netdays netdays duedate adddays duedate netdays duedate get invoice due date param p c invoice id payment term return due date public static timestamp invoice due date int p c invoice id throws sql exception parameter if p c invoice id 0 return null due date timestamp due date null string sql select c paymentterm id date invoiced from c invoice where c invoice id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c invoice id result set rs pstmt execute query if rs next int c paymentterm id rs get int 1 timestamp doc date rs get timestamp 2 due date due date c paymentterm id doc date rs close pstmt close return due date p_c_invoice_id invoiceduedate p_c_invoice_id sqlexception p_c_invoice_id duedate c_paymentterm_id dateinvoiced c_invoice c_invoice_id preparedstatement preparestatement setint p_c_invoice_id resultset executequery c_paymentterm_id getint docdate gettimestamp duedate duedate c_paymentterm_id docdate duedate calculate date param doc date document date param fix month day day param fix month offset offset param fix month cutoff cuttof return date due private static timestamp calculate date due timestamp doc date int fix month day int fix month offset int fix month cutoff gregorian calendar cal new gregorian calendar cal set time doc date cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 cutoff int max day cut cal get actual maximum calendar day of month if fix month cutoff max day cut 28 feb cal set calendar day of month max day cut else cal set calendar day of month fix month cutoff if doc date after cal get time fix month offset 1 cal add calendar month fix month offset due date int max day cal get actual maximum calendar day of month if fix month day max day 32 28 cal set calendar day of month max day else if fix month day 30 max day fix month day 30 31 cal set calendar day of month max day else cal set calendar day of month fix month day java util date temp cal get time return new timestamp temp get time docdate fixmonthday fixmonthoffset fixmonthcutoff calculatedatedue docdate fixmonthday fixmonthoffset fixmonthcutoff gregoriancalendar gregoriancalendar settime docdate hour_of_day maxdaycut getactualmaximum day_of_month fixmonthcutoff maxdaycut day_of_month maxdaycut day_of_month fixmonthcutoff docdate gettime fixmonthoffset fixmonthoffset maxday getactualmaximum day_of_month fixmonthday maxday day_of_month maxday fixmonthday maxday fixmonthday day_of_month maxday day_of_month fixmonthday gettime gettime get discount amount select c paymentterm id name payment term discount 111 1111 100 c paymentterm id sys date sys date discountusd payment term discount 111 1111 100 c paymentterm id sys date sys date discountjpy from c paymentterm param p amount amount param p c currency id currency param p c paymentterm id payment term param p docdate document date param p paydate payment date return discount amount throws sql exception public static big decimal discount big decimal p amount int p c currency id int p c paymentterm id timestamp p docdate timestamp p paydate throws sql exception no data no discount if p amount null p c paymentterm id 0 p docdate null return null if p amount signum 0 return compiere zero parameters timestamp pay date p paydate if pay date null pay date new timestamp system current time millis pay date compiere trunc pay date big decimal discount null string sql select from c paymentterm where c paymentterm id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c paymentterm id result set rs pstmt execute query if rs next int discount days rs get int discount days int discount days2 rs get int discount days2 int grace days rs get int grace days boolean is next business day y equals rs get string is next business day big decimal discount rs get big decimal discount big decimal discount2 rs get big decimal discount2 timestamp discount1 date compiere add days p docdate discount days grace days timestamp discount2 date compiere add days p docdate discount days2 grace days next business day if is next business day discount1 date compiere next business day discount1 date discount2 date compiere next business day discount2 date discount 1 if pay date after discount1 date discount p amount multiply discount discount 2 else if pay date after discount2 date discount p amount multiply discount2 else discount compiere zero divide if discount signum 0 discount discount divide compiere hundred 6 big decimal round half up discount currency round discount p c currency id n rs close pstmt close return discount c_paymentterm_id paymenttermdiscount c_paymentterm_id sysdate sysdate paymenttermdiscount c_paymentterm_id sysdate sysdate c_paymentterm p_amount p_c_currency_id p_c_paymentterm_id p_docdate p_paydate sqlexception bigdecimal bigdecimal p_amount p_c_currency_id p_c_paymentterm_id p_docdate p_paydate sqlexception p_amount p_c_paymentterm_id p_docdate p_amount paydate p_paydate paydate paydate currenttimemillis paydate paydate bigdecimal c_paymentterm c_paymentterm_id preparedstatement preparestatement setint p_c_paymentterm_id resultset executequery discountdays getint discountdays discountdays2 getint discountdays2 gracedays getint gracedays isnextbusinessday getstring isnextbusinessday bigdecimal getbigdecimal bigdecimal getbigdecimal discount1date adddays p_docdate discountdays gracedays discount2date adddays p_docdate discountdays2 gracedays isnextbusinessday discount1date nextbusinessday discount1date discount2date nextbusinessday discount2date paydate discount1date p_amount paydate discount2date p_amount bigdecimal round_half_up p_c_currency_id get file logger param create create if not exists param compiere home compiere home return file logger public static c log file get boolean create string compiere home boolean is client if s logfile null create s logfile new c log file compiere home true is client return s logfile compierehome clogfile compierehome isclient s_logfile s_logfile clogfile compierehome isclient s_logfile constructor param compiere home compiere home param create log dir create log directory if missing public c log file string compiere home boolean create log dir boolean is client if s logfile null s logfile this else report error file handler exists already new illegal state exception existing handler error manager generic failure if compiere home null compiere home length 0 m compierehome compiere home else m compierehome ini find compiere home initialize m compierehome create log dir is client compierehome createlogdir clogfile compierehome createlogdir isclient s_logfile s_logfile reporterror illegalstateexception errormanager generic_failure compierehome compierehome m_compierehome compierehome m_compierehome findcompierehome m_compierehome createlogdir isclient initialize param compiere home log file base directory name param create log dir create log directory private void initialize string compiere home boolean create log dir boolean is client system out println c log file initialize close old file if m writer null close m doneheader false new file name if create file compiere home create log dir is client return new writer try m writer new file writer m file true m records 0 catch exception ex report error writer ex error manager open failure m writer null system out println get file name foratting set formatter c log formatter get level set level level all filter set filter c log filter get compierehome createlogdir compierehome createlogdir isclient clogfile m_writer m_doneheader createfile compierehome createlogdir isclient m_writer filewriter m_file m_records reporterror errormanager open_failure m_writer getfilename setformatter clogformatter setlevel setfilter clogfilter create log file param base dir name base log file directory name param create log dir create log directory private boolean create file string base dir name boolean create log dir boolean is client string file name base dir name try test compiere home if file name null file dir new file file name if dir exists dir is directory report error invalid base directory file name null error manager open failure file name null test create compiere home log if file name null create log dir file name file separator log file dir new file file name if dir exists dir mkdir if dir exists dir is directory report error invalid log directory file name null error manager open failure file name null test create compiere home log file if file name null file name file separator if is client file name client m filenamedate get file name date system current time millis file name m filenamedate for int i 0 i 100 i string final name file name i log file file new file final name if file exists m file file break if m file null fallback create temp file m file file create temp file adempiere log catch exception ex report error file ex error manager open failure m file null return false return true basedirname createlogdir createfile basedirname createlogdir isclient filename basedirname compierehome filename filename isdirectory reporterror filename errormanager open_failure filename compierehome filename createlogdir filename filename isdirectory reporterror filename errormanager open_failure filename compierehome filename filename isclient filename m_filenamedate getfilenamedate currenttimemillis filename m_filenamedate _ finalname filename finalname m_file m_file m_file createtempfile reporterror errormanager open_failure m_file get file name date portion return date string public static string get file name date long time timestamp ts new timestamp time string s ts to string return s substring 0 10 getfilenamedate tostring rotate log when day changes param time time private void rotate log long time if m filenamedate null m filenamedate equals get file name date time return rotate log rotatelog m_filenamedate m_filenamedate getfilenamedate rotatelog rotate log called after initialization public void rotate log initialize m compierehome true ini is client rotatelog m_compierehome isclient get file name return file name public string get file name if m file null return m file get absolute path return getfilename m_file m_file getabsolutepath get log directory return log directory or null public file get log directory if m file null return m file get parent file return null getlogdirectory m_file m_file getparentfile set level see java util logging handler set level java util logging level param new level new level throws java lang security exception public synchronized void set level level new level throws security exception if new level null return super set level new level setlevel newlevel securityexception setlevel newlevel securityexception newlevel setlevel newlevel publish see java util logging handler publish java util logging log record param record log record public void publish log record record if is loggable record m writer null return rotate log record get millis format string msg null try msg get formatter format record catch exception ex report error formatting ex error manager format failure return output try if m doneheader m writer write get formatter get head this m doneheader true m writer write msg m records if record get level level severe record get level level warning m records 10 0 flush every 10 records flush catch exception ex report error writing ex error manager write failure logrecord logrecord isloggable m_writer rotatelog getmillis getformatter reporterror errormanager format_failure m_doneheader m_writer getformatter gethead m_doneheader m_writer m_records getlevel getlevel m_records reporterror errormanager write_failure flush see java util logging handler flush public void flush try if m writer null m writer flush catch exception ex report error flush ex error manager flush failure m_writer m_writer reporterror errormanager flush_failure close see java util logging handler close throws java lang security exception public void close throws security exception if m writer null return write tail try if m doneheader m writer write get formatter get head this m writer write get formatter get tail this catch exception ex report error tail ex error manager write failure flush close try m writer close catch exception ex report error close ex error manager close failure m writer null m file null securityexception securityexception m_writer m_doneheader m_writer getformatter gethead m_writer getformatter gettail reporterror errormanager write_failure m_writer reporterror errormanager close_failure m_writer m_file string representation return info public string to string string buffer sb new string buffer c log file sb append get file name append level append get level append return sb to string tostring stringbuffer stringbuffer clogfile getfilename getlevel tostring constructor public v combo box super common init vcombobox common_init public v combo box object items super items common init vcombobox common_init public v combo box combo box model model super model common init vcombobox comboboxmodel common_init common setup private void common init look and feel install colors and font this text field background text field foreground text field font set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal set preferred size s text get preferred size this set key selection manager new combo selection manager common init reference field private static j text field s text new j text field v text field display size set selected item to key find key value in list param key public void set value object key if key null this set selected index 1 return combo box model model get model int size model get size for int i 0 i size i object element model get element at i string id null if element instanceof name pair id name pair element getid else if element instanceof m locator id string value of m locator element getm locator id else log log level severe element not name pair element get class to string if key null id null if key null id null set selected index i return else if id equals key to string set selected index i return set selected index 1 set selected item null common_init lookandfeel installcolorsandfont textfield textfield textfield setforeground gettextcolor_normal setbackground getfieldbackground_normal setpreferredsize s_text getpreferredsize setkeyselectionmanager comboselectionmanager common_init jtextfield s_text jtextfield vtextfield display_size setvalue setselectedindex comboboxmodel getmodel getsize getelementat namepair namepair mlocator valueof mlocator getm_locator_id namepair getclass tostring setselectedindex tostring setselectedindex setselectedindex setselecteditem set selected item to key if exists param key public void set value int key set value string value of key setvalue setvalue valueof get value return key as integer or string value public object get value name pair p name pair get selected item if p null return null if p instanceof key name pair if p getid null 1 return null return null return new integer key name pair p getid return p getid getvalue namepair namepair getselecteditem keynamepair keynamepair get display return displayed string public string get display if get selected index 1 return name pair p name pair get selected item if p null return return p get name getdisplay getselectedindex namepair namepair getselecteditem getname standard constructor public x c rfqresponse properties ctx int c rfqresponse id string trx name super ctx c rfqresponse id trx name if c rfqresponse id 0 setc bpartner id 0 setc bpartner location id 0 setc currency id 0 c currency id setc rfqresponse id 0 setc rfq id 0 set is complete false set is selected winner false set is self service false set name null set price env zero set processed false x_c_rfqresponse c_rfqresponse_id trxname c_rfqresponse_id trxname c_rfqresponse_id setc_bpartner_id setc_bpartner_location_id setc_currency_id c_currency_id setc_rfqresponse_id setc_rfq_id setiscomplete setisselectedwinner setisselfservice setname setprice setprocessed load constructor public x c rfqresponse properties ctx result set rs string trx name super ctx rs trx name x_c_rfqresponse resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfqresponse append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfqresponse get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set valuenocheck ad user id null else set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_valuenocheck ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set rfq response request for quotation response from a potential vendor public void setc rfqresponse id int c rfqresponse id if c rfqresponse id 1 throw new illegal argument exception c rfqresponse id is mandatory set valuenocheck c rfqresponse id new integer c rfqresponse id setc_rfqresponse_id c_rfqresponse_id c_rfqresponse_id illegalargumentexception c_rfqresponse_id set_valuenocheck c_rfqresponse_id c_rfqresponse_id get rfq response request for quotation response from a potential vendor public int getc rfqresponse id integer ii integer get value c rfqresponse id if ii null return 0 return ii int value getc_rfqresponse_id get_value c_rfqresponse_id intvalue set rfq request for quotation public void setc rfq id int c rfq id if c rfq id 1 throw new illegal argument exception c rfq id is mandatory set valuenocheck c rfq id new integer c rfq id setc_rfq_id c_rfq_id c_rfq_id illegalargumentexception c_rfq_id set_valuenocheck c_rfq_id c_rfq_id get rfq request for quotation public int getc rfq id integer ii integer get value c rfq id if ii null return 0 return ii int value getc_rfq_id get_value c_rfq_id intvalue set check complete public void set check complete string check complete if check complete null check complete length 1 log warning length 1 truncated check complete check complete substring 0 0 set value check complete check complete setcheckcomplete checkcomplete checkcomplete checkcomplete checkcomplete checkcomplete set_value checkcomplete checkcomplete get check complete public string get check complete return string get value check complete getcheckcomplete get_value checkcomplete set invited date when last invitation was sent public void set date invited timestamp date invited set value date invited date invited setdateinvited dateinvited set_value dateinvited dateinvited get invited date when last invitation was sent public timestamp get date invited return timestamp get value date invited getdateinvited get_value dateinvited set response date date of the response public void set date response timestamp date response set value date response date response setdateresponse dateresponse set_value dateresponse dateresponse get response date date of the response public timestamp get date response return timestamp get value date response getdateresponse get_value dateresponse set work complete date when work is planned to be complete public void set date work complete timestamp date work complete set value date work complete date work complete setdateworkcomplete dateworkcomplete set_value dateworkcomplete dateworkcomplete get work complete date when work is planned to be complete public timestamp get date work complete return timestamp get value date work complete getdateworkcomplete get_value dateworkcomplete set work start date when work is planned to be started public void set date work start timestamp date work start set value date work start date work start setdateworkstart dateworkstart set_value dateworkstart dateworkstart get work start date when work is planned to be started public timestamp get date work start return timestamp get value date work start getdateworkstart get_value dateworkstart set delivery days number of days planned until delivery public void set delivery days int delivery days set value delivery days new integer delivery days setdeliverydays deliverydays set_value deliverydays deliverydays get delivery days number of days planned until delivery public int get delivery days integer ii integer get value delivery days if ii null return 0 return ii int value getdeliverydays get_value deliverydays intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set complete it is complete public void set is complete boolean is complete set value is complete new boolean is complete setiscomplete iscomplete set_value iscomplete iscomplete get complete it is complete public boolean is complete object oo get value is complete if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscomplete get_value iscomplete booleanvalue set selected winner the resonse is the selected winner public void set is selected winner boolean is selected winner set value is selected winner new boolean is selected winner setisselectedwinner isselectedwinner set_value isselectedwinner isselectedwinner get selected winner the resonse is the selected winner public boolean is selected winner object oo get value is selected winner if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselectedwinner get_value isselectedwinner booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set price price public void set price big decimal price if price null throw new illegal argument exception price is mandatory set value price price setprice bigdecimal illegalargumentexception set_value get price price public big decimal get price big decimal bd big decimal get value price if bd null return env zero return bd bigdecimal getprice bigdecimal bigdecimal get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set ranking relative rank number public void set ranking int ranking set value ranking new integer ranking setranking set_value get ranking relative rank number public int get ranking integer ii integer get value ranking if ii null return 0 return ii int value getranking get_value intvalue initialize the loader param controller reference to the bank statement loader controller return initialized succesfully protected boolean init m bank statement loader controller boolean result false if controller null m errormessage error initializing parser m errordescription import controller is a null reference return result this m controller controller try sax parser factory factory sax parser factory new instance m parser factory newsax parser result true catch parser configuration exception e m errormessage error initializing parser m errordescription unable to configure sax parser e get message catch sax exception e m errormessage error initializing parser m errordescription unable to initialize sax parser e get message return result bankstatementloadercontroller mbankstatementloader m_errormessage errorinitializingparser m_errordescription importcontroller m_controller saxparserfactory saxparserfactory newinstance m_parser newsaxparser parserconfigurationexception m_errormessage errorinitializingparser m_errordescription getmessage saxexception m_errormessage errorinitializingparser m_errordescription getmessage attach ofx input source detect whether we are dealing with ofx1 sgml or ofx2 xml in case of ofx1 process the data to create valid xml param is reference to the bank statement loader controller return true if input is valid ofx data protected boolean attach input input stream is boolean is ofx1 true boolean result false try buffered reader reader new buffered reader new input stream reader is reader mark header size 100 string header for int i 0 i header size i header header reader read line if header index of ofx 1 header index of ofx 1 is ofx1 false else if header index of xml 1 header index of xml 1 is ofx1 false deted specific ofx version else is ofx1 true detect specific ofx version reader reset if is ofx1 m reader new buffered reader new input stream reader new ofx1 toxml reader else m reader reader result true catch io exception e m errormessage error reading data m errordescription e get message return result return result bankstatementloadercontroller attachinput inputstream isofx1 bufferedreader bufferedreader inputstreamreader header_size header_size readline indexof indexof isofx1 indexof indexof isofx1 isofx1 isofx1 m_reader bufferedreader inputstreamreader ofx1toxml m_reader ioexception m_errormessage errorreadingdata m_errordescription getmessage verify the validity of the ofx data return true if input is valid ofx data public boolean is valid boolean result true try if load lines result true test false m reader reset catch io exception e m errormessage error reading data m errordescription e get message return result isvalid loadlines m_reader ioexception m_errormessage errorreadingdata m_errordescription getmessage check wether the import was succesfull return true if all statement lines have been imported succesfully public boolean import successfull currently there are no checks after the statement lines are read once all lines are read correctly a successfull import is assumed return m success importsuccessfull m_success read statementlines from input stream return load success this method will be invoked from import controller public boolean load lines boolean result false try m parser parse new input source m reader this result true m success true catch sax exception e m errormessage error parsing data m errordescription e get message catch io exception e m errormessage error reading data m errordescription e get message return result inputstream importcontroller loadlines m_parser inputsource m_reader m_success saxexception m_errormessage errorparsingdata m_errordescription getmessage ioexception m_errormessage errorreadingdata m_errordescription getmessage method get date last run return timestamp public timestamp get date last run return date last run getdatelastrun getdatelastrun datelastrun method get routing no return string public string get routing no return m line routing no getroutingno getroutingno m_line routingno method get bank account no return string public string get bank account no return m line bank account no getbankaccountno getbankaccountno m_line bankaccountno method get statement reference return string public string get statement reference return m line statement reference getstatementreference getstatementreference m_line statementreference method get statement date return timestamp public timestamp get statement date return statement date getstatementdate getstatementdate statementdate method get reference return string public string get reference return m line reference getreference getreference m_line method get statement line date return timestamp public timestamp get statement line date return m line statement line date getstatementlinedate getstatementlinedate m_line statementlinedate method get valuta date return timestamp public timestamp get valuta date return m line valuta date getvalutadate getvalutadate m_line valutadate method get trx type return string public string get trx type return m line trx type gettrxtype gettrxtype m_line trxtype method get is reversal return boolean public boolean get is reversal return m line is reversal getisreversal getisreversal m_line isreversal method get currency return string public string get currency return m line currency getcurrency getcurrency m_line method get stmt amt return big decimal public big decimal get stmt amt return m line stmt amt getstmtamt bigdecimal bigdecimal getstmtamt m_line stmtamt method get trx amt return transaction amount public big decimal get trx amt assume total amount transaction amount todo detect interest charge amount return m line stmt amt gettrxamt bigdecimal gettrxamt m_line stmtamt method get interest amount return interest amount public big decimal get interest amt return env zero getinterestamount bigdecimal getinterestamt method get memo return string public string get memo return m line memo getmemo getmemo m_line method get charge name return string public string get charge name return m line charge name getchargename getchargename m_line chargename method get charge amt return big decimal public big decimal get charge amt return m line charge amt getchargeamt bigdecimal bigdecimal getchargeamt m_line chargeamt method get trxid return string public string get trxid return m line trxid gettrxid gettrxid m_line method get payee account no return string public string get payee account no return m line payee account no getpayeeaccountno getpayeeaccountno m_line payeeaccountno method get payee name return string public string get payee name return m line payee name getpayeename getpayeename m_line payeename method get check no return string public string get check no return m line check no getcheckno getcheckno m_line checkno new xml element detected the xml nesting structure is saved on the m context stack param uri string param local name string param q name string param attributes attributes throws org xml sax sax exception see org xml sax content handler start element string string string attributes public void start element string uri string local name string q name attributes attributes throws org xml sax sax exception boolean validofx true currently no validating is being done valid ofx structure is assumed if validofx m context push q name else m errordescription invalid ofx syntax q name throw new sax exception invalid ofx syntax q name if q name equals xml stmttrn tag m line new statement line routing no bank account no currency m_context localname qname saxexception contenthandler startelement startelement localname qname saxexception m_context qname m_errordescription qname saxexception qname qname xml_stmttrn_tag m_line statementline routingno bankaccountno characters read from xml are assigned to a variable based on the current m context no checks are being done it is assumed that the context is correct param ch char param start int param length int throws sax exception see org xml sax content handler characters char int int public void characters char ch int start int length throws sax exception string xml tag string m context peek string value new string buffer append ch start length to string try read statment level data default currency for this set of statement lines ofx bankmsgsrsv2 stmttrnrs stmtrs if xml tag equals xml curdef tag currency value routing number or swift code for this set of statement lines ofx bankmsgsrsv2 stmttrnrs stmtrs bankacctfrom else if xml tag equals xml bankid tag routing no value bank account number for this set of bank statement lines ofx bankmsgsrsv2 stmttrnrs stmtrs bankacctfrom else if xml tag equals xml acctid tag bank account no value last date for this set of statement lines this is the date that should be specified as the dtstart for the next batch of statement lines in order not to miss any transactions ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist else if xml tag equals xml dtend tag date last run parse ofx date value ofx bankmsgsrsv2 stmttrnrs stmtrs availbal else if xml tag equals xml dtasof tag statement date parse ofx date value read statement line level data transaction type e g debit credit srvchg ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml trntype tag m line trx type value statement line date ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml dtposted tag m line statement line date parse ofx date value valuta date ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml dtavail tag m line valuta date parse ofx date value total statement line amount ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml trnamt tag m line stmt amt new big decimal value transaction identification ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml fitid tag m line trxid value check number for check transactions checknum for generic ofx chknum for ms money ofc ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml checknum tag xml tag equals xml chknum tag m line check no value statement line reference additional transaction reference information ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml refnum tag m line reference value transaction memo ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml memo tag m line memo value payee name ofx bankmsgsrsv2 stmttrnrs stmtrs banktranlist stmttrn else if xml tag equals xml name tag m line payee name value catch exception e m errordescription invalid data value e get message throw new sax exception invalid data value m_context saxexception contenthandler saxexception xml_tag m_context stringbuffer tostring xml_tag xml_curdef_tag xml_tag xml_bankid_tag routingno xml_tag xml_acctid_tag bankaccountno xml_tag xml_dtend_tag datelastrun parseofxdate xml_tag xml_dtasof_tag statementdate parseofxdate xml_tag xml_trntype_tag m_line trxtype xml_tag xml_dtposted_tag m_line statementlinedate parseofxdate xml_tag xml_dtavail_tag m_line valutadate parseofxdate xml_tag xml_trnamt_tag m_line stmtamt bigdecimal xml_tag xml_fitid_tag m_line xml_tag xml_checknum_tag xml_tag xml_chknum_tag m_line checkno xml_tag xml_refnum_tag m_line xml_tag xml_memo_tag m_line xml_tag xml_name_tag m_line payeename m_errordescription getmessage saxexception check for valid xml structure all tags are properly ended the statements are passed to import controller when the statement end stmttrn is detected param uri string param local name string param q name string throws sax exception see org xml sax content handler end element string string string public void end element string uri string local name string q name throws sax exception if q name equals m context peek m context pop else m errordescription invalid xml syntax q name throw new sax exception invalid xml syntax q name if q name equals xml stmttrn tag if test if m controller save line m errormessage m controller get error message m errordescription m controller get error description throw new sax exception m errormessage importcontroller localname qname saxexception contenthandler endelement endelement localname qname saxexception qname m_context m_context m_errordescription qname saxexception qname qname xml_stmttrn_tag m_controller saveline m_errormessage m_controller geterrormessage m_errordescription m_controller geterrordescription saxexception m_errormessage method parse ofx date param value string return timestamp throws parse exception private timestamp parse ofx date string value throws parse exception try simple date format sdf new simple date format yyyym mdd sdf set lenient false return new timestamp sdf parse value get time catch exception e throw new parse exception error parsing date value 0 parseofxdate parseexception parseofxdate parseexception simpledateformat simpledateformat yyyymmdd setlenient gettime parseexception method get last error message return string public string get last error message return m errormessage getlasterrormessage getlasterrormessage m_errormessage method get last error description return string public string get last error description return m errordescription getlasterrordescription getlasterrordescription m_errordescription constructor for statement line param routing no string param bank account no string param currency string public statement line string routing no string bank account no string currency this bank account no bank account no this routing no routing no this currency currency statementline routingno bankaccountno statementline routingno bankaccountno bankaccountno bankaccountno routingno routingno standard constructor param ctx context param c rfqresponse id id public m rfq response properties ctx int c rfqresponse id string trx name super ctx c rfqresponse id trx name if c rfqresponse id 0 set is complete false set is selected winner false set is self service false set price env zero set processed false set processing false c_rfqresponse_id mrfqresponse c_rfqresponse_id trxname c_rfqresponse_id trxname c_rfqresponse_id setiscomplete setisselectedwinner setisselfservice setprice setprocessed setprocessing load constructor param ctx context param rs result set public m rfq response properties ctx result set rs string trx name super ctx rs trx name mrfqresponse resultset trxname trxname parent constructor param rfq rfq param subscriber subscriber public m rfq response m rfq rfq m rfq topic subscriber subscriber this rfq subscriber subscriber getc bpartner id subscriber getc bpartner location id subscriber getad user id mrfqresponse mrfq mrfqtopicsubscriber getc_bpartner_id getc_bpartner_location_id getad_user_id parent constructor param rfq rfq param partner web response public m rfq response m rfq rfq mb partner partner this rfq null partner getc bpartner id partner getprimaryc bpartner location id partner getprimaryad user id mrfqresponse mrfq mbpartner getc_bpartner_id getprimaryc_bpartner_location_id getprimaryad_user_id parent constructor automatically saved if lines were created saved automatically param rfq rfq param subscriber optional subscriber public m rfq response m rfq rfq m rfq topic subscriber subscriber int c bpartner id int c bpartner location id int ad user id this rfq get ctx 0 rfq get trxname set client org rfq setc rfq id rfq getc rfq id setc currency id rfq getc currency id set name rfq get name m rfq rfq subscriber info setc bpartner id c bpartner id setc bpartner location id c bpartner location id setad user id ad user id create lines m rfq line lines rfq get lines for int i 0 i lines length i if lines i is active continue product on only list if subscriber null subscriber is included lines i getm product id continue if get id 0 save response save m rfq response line line new m rfq response line this lines i line is not saved dumped if there are no qtys mrfqresponse mrfq mrfqtopicsubscriber c_bpartner_id c_bpartner_location_id ad_user_id getctx get_trxname setclientorg setc_rfq_id getc_rfq_id setc_currency_id getc_currency_id setname getname m_rfq setc_bpartner_id c_bpartner_id setc_bpartner_location_id c_bpartner_location_id setad_user_id ad_user_id mrfqline getlines isactive isincluded getm_product_id get_id mrfqresponseline mrfqresponseline get response lines param requery requery return array of response lines public m rfq response line get lines boolean requery if m lines null requery return m lines array list m rfq response line list new array list m rfq response line string sql select from c rfqresponseline where c rfqresponse id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfqresponse id result set rs pstmt execute query while rs next list add new m rfq response line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m rfq response line list size list to array m lines return m lines mrfqresponseline getlines m_lines m_lines arraylist mrfqresponseline arraylist mrfqresponseline c_rfqresponseline c_rfqresponse_id isactive preparedstatement preparestatement get_trxname setint getc_rfqresponse_id resultset executequery mrfqresponseline getctx get_trxname getlines m_lines mrfqresponseline toarray m_lines m_lines get response lines no requery return array of response lines public m rfq response line get lines return get lines false mrfqresponseline getlines getlines get rfq return rfq public m rfq get rfq if m rfq null m rfq m rfq get get ctx getc rfq id get trxname return m rfq mrfq getrfq m_rfq m_rfq mrfq getctx getc_rfq_id get_trxname m_rfq string representation return info public string to string string buffer sb new string buffer m rfq response sb append get id append complete append is complete append winner append is selected winner append return sb to string tostring stringbuffer stringbuffer mrfqresponse get_id iscomplete isselectedwinner tostring send rfq return true if rfq is sent per email public boolean send rfq m user to m user get get ctx getad user id if to get id 0 to gete mail null to gete mail length 0 log log level severe no user or no e mail to return false m client client m client get get ctx string message get description if message null message length 0 message get help else if get help null message n get help if message null message get name e mail email client createe mail to gete mail rfq get name message email add attachment createpdf if e mail sent ok equals email send set date invited new timestamp system current time millis save return true return false sendrfq muser muser getctx getad_user_id get_id getemail getemail email mclient mclient getctx getdescription gethelp gethelp gethelp getname email createemail getemail getname addattachment email sent_ok setdateinvited currenttimemillis create pdf return file or null public file createpdf return createpdf null create pdf file param file output file return file or null public file createpdf file file report engine re report engine get get ctx report engine rfq getc rfqresponse id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_rfqresponse_id check if response is complete return null if complere error message otherwise public string check complete if is complete set is complete false m rfq rfq get rfq is rfq total valid string error rfq check quote total amt only if error null error length 0 return error do we have total amount if rfq is quote total amt rfq is quote total amt only big decimal amt get price if amt null env zero compare to amt 0 return no total amount do we have an amount qty for all lines if rfq is quote all lines m rfq response line lines get lines false for int i 0 i lines length i m rfq response line line lines i if line is active return line line get rfq line get line not active boolean valid amt false m rfq response line qty qtys line get qtys false for int j 0 j qtys length j m rfq response line qty qty qtys j if qty is active continue big decimal amt qty get net amt if amt null env zero compare to amt 0 valid amt true break if valid amt return line line get rfq line get line no amount do we have an amount for all line qtys if rfq is quote all qty m rfq response line lines get lines false for int i 0 i lines length i m rfq response line line lines i m rfq response line qty qtys line get qtys false for int j 0 j qtys length j m rfq response line qty qty qtys j if qty is active return line line get rfq line get line qty qty get rfq line qty get qty not active big decimal amt qty get net amt if amt null env zero compare to amt 0 return line line get rfq line get line qty qty get rfq line qty get qty no amount set is complete true return null checkcomplete iscomplete setiscomplete mrfq getrfq checkquotetotalamtonly isquotetotalamt isquotetotalamtonly bigdecimal getprice compareto isquotealllines mrfqresponseline getlines mrfqresponseline isactive getrfqline getline validamt mrfqresponselineqty getqtys mrfqresponselineqty isactive bigdecimal getnetamt compareto validamt validamt getrfqline getline isquoteallqty mrfqresponseline getlines mrfqresponseline mrfqresponselineqty getqtys mrfqresponselineqty isactive getrfqline getline getrfqlineqty getqty bigdecimal getnetamt compareto getrfqline getline getrfqlineqty getqty setiscomplete is quote total amt only return true if only total public boolean is quote total amt only return get rfq is quote total amt only isquotetotalamtonly getrfq isquotetotalamtonly before save param new record new return true protected boolean before save boolean new record calculate complete date also used to verify if get date work start null get delivery days 0 set date work complete time util add days get date work start get delivery days calculate delivery days else if get date work start null get delivery days 0 get date work complete null set delivery days time util get days between get date work start get date work complete calculate start date else if get date work start null get delivery days 0 get date work complete null set date work start time util add days get date work complete get delivery days 1 return true newrecord beforesave newrecord getdateworkstart getdeliverydays setdateworkcomplete timeutil adddays getdateworkstart getdeliverydays getdateworkstart getdeliverydays getdateworkcomplete setdeliverydays timeutil getdaysbetween getdateworkstart getdateworkcomplete getdateworkstart getdeliverydays getdateworkcomplete setdateworkstart timeutil adddays getdateworkcomplete getdeliverydays standard constructor public x m productionlinema properties ctx int m productionlinema id string trx name super ctx m productionlinema id trx name if m productionlinema id 0 setm attributesetinstance id 0 setm productionline id 0 set movement qty env zero x_m_productionlinema m_productionlinema_id trxname m_productionlinema_id trxname m_productionlinema_id setm_attributesetinstance_id setm_productionline_id setmovementqty load constructor public x m productionlinema properties ctx result set rs string trx name super ctx rs trx name x_m_productionlinema resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productionlinema append get id append return sb to string tostring stringbuffer stringbuffer x_m_productionlinema get_id tostring set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 1 throw new illegal argument exception m productionline id is mandatory set valuenocheck m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id illegalargumentexception m_productionline_id set_valuenocheck m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm productionline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_productionline_id set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty get allocations of payment param ctx context param c payment id payment return allocations of payment public static m allocation hdr get of payment properties ctx int c payment id string trx name string sql select from c allocationhdr h where is active y and exists select from c allocationline l where h c allocationhdr id l c allocationhdr id and l c payment id array list m allocation hdr list new array list m allocation hdr prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c payment id result set rs pstmt execute query while rs next list add new m allocation hdr ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m allocation hdr ret value new m allocation hdr list size list to array ret value return ret value c_payment_id mallocationhdr getofpayment c_payment_id trxname c_allocationhdr isactive c_allocationline c_allocationhdr_id c_allocationhdr_id c_payment_id arraylist mallocationhdr arraylist mallocationhdr preparedstatement preparestatement trxname setint c_payment_id resultset executequery mallocationhdr trxname s_log mallocationhdr retvalue mallocationhdr toarray retvalue retvalue get allocations of invoice param ctx context param c invoice id payment return allocations of payment public static m allocation hdr get of invoice properties ctx int c invoice id string trx name string sql select from c allocationhdr h where is active y and exists select from c allocationline l where h c allocationhdr id l c allocationhdr id and l c invoice id array list m allocation hdr list new array list m allocation hdr prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c invoice id result set rs pstmt execute query while rs next list add new m allocation hdr ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m allocation hdr ret value new m allocation hdr list size list to array ret value return ret value c_invoice_id mallocationhdr getofinvoice c_invoice_id trxname c_allocationhdr isactive c_allocationline c_allocationhdr_id c_allocationhdr_id c_invoice_id arraylist mallocationhdr arraylist mallocationhdr preparedstatement preparestatement trxname setint c_invoice_id resultset executequery mallocationhdr trxname s_log mallocationhdr retvalue mallocationhdr toarray retvalue retvalue standard constructor param ctx context param c allocationhdr id id public m allocation hdr properties ctx int c allocationhdr id string trx name super ctx c allocationhdr id trx name if c allocationhdr id 0 set document no null set date trx new timestamp system current time millis set date acct get date trx set doc action docaction complete co set doc status docstatus drafted dr setc currency id 0 set approval amt env zero set is approved false set is manual false set posted false set processed false set processing false c_allocationhdr_id mallocationhdr c_allocationhdr_id trxname c_allocationhdr_id trxname c_allocationhdr_id setdocumentno setdatetrx currenttimemillis setdateacct getdatetrx setdocaction docaction_complete setdocstatus docstatus_drafted setc_currency_id setapprovalamt setisapproved setismanual setposted setprocessed setprocessing mandatory new constructor param ctx context param is manual manual trx param date trx date if null today param c currency id currency public m allocation hdr properties ctx boolean is manual timestamp date trx int c currency id string description string trx name this ctx 0 trx name set is manual is manual if date trx null set date trx date trx set date acct date trx setc currency id c currency id if description null set description description ismanual datetrx c_currency_id mallocationhdr ismanual datetrx c_currency_id trxname trxname setismanual ismanual datetrx setdatetrx datetrx setdateacct datetrx setc_currency_id c_currency_id setdescription load constructor param ctx context param rs result set public m allocation hdr properties ctx result set rs string trx name super ctx rs trx name mallocationhdr resultset trxname trxname get lines param requery if true requery return lines public m allocation line get lines boolean requery if m lines null requery return m lines string sql select from c allocationline where c allocationhdr id array list m allocation line list new array list m allocation line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc allocationhdr id result set rs pstmt execute query while rs next m allocation line line new m allocation line get ctx rs get trxname line set parent this list add line rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m allocation line list size list to array m lines return m lines mallocationline getlines m_lines m_lines c_allocationline c_allocationhdr_id arraylist mallocationline arraylist mallocationline preparedstatement preparestatement get_trxname setint getc_allocationhdr_id resultset executequery mallocationline mallocationline getctx get_trxname setparent m_lines mallocationline toarray m_lines m_lines set processed param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update c allocationhdr set processed processed y n where c allocationhdr id getc allocationhdr id int no db execute update sql get trxname m lines null log fine processed no setprocessed setprocessed get_id c_allocationhdr c_allocationhdr_id getc_allocationhdr_id executeupdate get_trxname m_lines before save param new record return save protected boolean before save boolean new record changed from not to active if new record is valuechanged is active is active log severe cannot re activate deactivated allocations return false return true newrecord beforesave newrecord newrecord is_valuechanged isactive isactive before delete return true if acct was deleted protected boolean before delete string trx name get trxname if trx name null trx name length 0 log warning no transaction if is posted if m period is open get ctx get date trx m doc type docbasetype paymentallocation log warning period closed return false set posted false if m fact acct delete table id get id trx name 0 return false mark as inactive set is active false updated db for line delete process string sql update c allocationhdr set is active n where c allocationhdr id db execute update sql getc allocationhdr id trx name unlink get lines true hash set integer bps new hash set integer for int i 0 i m lines length i m allocation line line m lines i bps add new integer line getc bpartner id if line delete true trx name return false updatebp bps return true beforedelete trxname get_trxname trxname trxname isposted mperiod isopen getctx getdatetrx mdoctype docbasetype_paymentallocation setposted mfactacct table_id get_id trxname setisactive c_allocationhdr isactive c_allocationhdr_id executeupdate getc_allocationhdr_id trxname getlines hashset hashset m_lines mallocationline m_lines getc_bpartner_id trxname after save param new record param success return success protected boolean after save boolean new record boolean success return success newrecord aftersave newrecord process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get date acct m doc type docbasetype paymentallocation m processmsg period closed return doc action status invalid get lines false if m lines length 0 m processmsg no lines return doc action status invalid add up amounts validate big decimal approval env zero for int i 0 i m lines length i m allocation line line m lines i approval approval add line get write off amt add line get discount amt make sure there is bp if line getc bpartner id 0 m processmsg no business partner return doc action status invalid set approval amt approval m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getdateacct mdoctype docbasetype_paymentallocation m_processmsg periodclosed docaction status_invalid getlines m_lines m_processmsg nolines docaction status_invalid bigdecimal m_lines mallocationline m_lines getwriteoffamt getdiscountamt getc_bpartner_id m_processmsg docaction status_invalid setapprovalamt m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string link get lines false hash set integer bps new hash set integer for int i 0 i m lines length i m allocation line line m lines i bps add new integer line process it false not reverse updatebp bps user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring getlines hashset hashset m_lines mallocationline m_lines processit modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document same as close return true if success public boolean void it log info to string boolean ret value reverse it set doc action docaction none return ret value voidit tostring retvalue reverseit setdocaction docaction_none retvalue close document cancel not delivered qunatities return true if success public boolean close it log info to string set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return true if success public boolean reverse correct it log info to string boolean ret value reverse it set doc action docaction none return ret value reversecorrectit tostring retvalue reverseit setdocaction docaction_none retvalue reverse accrual none return false public boolean reverse accrual it log info to string boolean ret value reverse it set doc action docaction none return ret value reverseaccrualit tostring retvalue reverseit setdocaction docaction_none retvalue re activate return false public boolean re activate it log info to string return false reactivateit tostring string representation return info public string to string string buffer sb new string buffer m allocation hdr sb append get id append append get summary append return sb to string tostring stringbuffer stringbuffer mallocationhdr get_id getsummary tostring get document info return document info untranslated public string get document info return msg get element get ctx c allocationhdr id get document no getdocumentinfo getelement getctx c_allocationhdr_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby reverse allocation period needs to be open return true if reversed private boolean reverse it if is active throw new illegal state exception allocation already reversed not active can we delete posting if m period is open get ctx get date trx m period control docbasetype paymentallocation throw new illegal state exception period closed set inactive set is active false set document no get document no set doc status docstatus reversed for direct calls if save is active throw new illegal state exception cannot de activate allocation delete posting string sql delete from fact acct where ad table id m allocation hdr table id and record id getc allocationhdr id int no db execute update sql get trxname log fine fact acct deleted no unlink invoices get lines true hash set integer bps new hash set integer for int i 0 i m lines length i m allocation line line m lines i line set is active false line save bps add new integer line process it true reverse updatebp bps return true reverseit isactive illegalstateexception mperiod isopen getctx getdatetrx mperiodcontrol docbasetype_paymentallocation illegalstateexception periodclosed setisactive setdocumentno getdocumentno setdocstatus docstatus_reversed isactive illegalstateexception fact_acct ad_table_id mallocationhdr table_id record_id getc_allocationhdr_id executeupdate get_trxname fact_acct getlines hashset hashset m_lines mallocationline m_lines setisactive processit update open balance of bp s param bps list of business partners private void updatebp hash set integer bps log info bps size iterator integer it bps iterator while it has next int c bpartner id it next mb partner bp new mb partner get ctx c bpartner id get trxname bp set total open balance recalculates from scratch bp setso credit status called automatically if bp save log fine bp to string else log log level severe bp not updated bp hashset hasnext c_bpartner_id mbpartner mbpartner getctx c_bpartner_id get_trxname settotalopenbalance setsocreditstatus tostring constructor param status bar for info public configuration panel j label status bar m statusbar status bar try jb init catch exception e e print stack trace system exit 1 statusbar configurationpanel jlabel statusbar m_statusbar statusbar jbinit printstacktrace static layout init throws exception private void jb init throws exception this set layout grid bag layout insets b insets new insets 0 5 0 5 java l java home set tool tip text res get string java home info l java home set text res get string java home f java home set text ok java home set enabled false b java home set margin b insets b java home set tool tip text res get string java home info l java type set tool tip text res get string java type info l java type set text res get string java type f java type set preferred size f java home get preferred size this add l java home new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f java home new grid bag constraints 1 0 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok java home new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 this add b java home new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 this add l java type new grid bag constraints 4 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f java type new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 compiere home key store l compiere home set tool tip text res get string compiere home info l compiere home set text res get string compiere home f compiere home set text ok compiere home set enabled false b compiere home set margin b insets b compiere home set tool tip text res get string compiere home info l key store set text res get string key store password l key store set tool tip text res get string key store password info f key store set text ok key store set enabled false this add l compiere home new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f compiere home new grid bag constraints 1 1 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok compiere home new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 this add b compiere home new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 this add l key store new grid bag constraints 4 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 this add f key store new grid bag constraints 5 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok key store new grid bag constraints 6 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 apps server type l apps server set tool tip text res get string apps server info l apps server set text res get string apps server l apps server set font l apps server get font derive font font bold f apps server set text ok apps server set enabled false l apps type set tool tip text res get string apps type info l apps type set text res get string apps type f apps type set preferred size f apps server get preferred size this add l apps server new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 5 5 0 0 this add f apps server new grid bag constraints 1 2 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 5 5 0 0 0 this add ok apps server new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 0 5 5 0 0 this add l apps type new grid bag constraints 4 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 5 5 0 0 this add f apps type new grid bag constraints 5 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 5 5 0 0 0 deployment jnp l deploy dir set tool tip text res get string deploy dir info l deploy dir set text res get string deploy dir f deploy dir set text ok deploy dir set enabled false b deploy dir set margin b insets b deploy dir set tool tip text res get string deploy dir info ljnp port set tool tip text res get string jnp port info ljnp port set text res get string jnp port fjnp port set text okjnp port set enabled false this add l deploy dir new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f deploy dir new grid bag constraints 1 3 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok deploy dir new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 this add b deploy dir new grid bag constraints 3 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 this add ljnp port new grid bag constraints 4 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add fjnp port new grid bag constraints 5 3 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add okjnp port new grid bag constraints 6 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 web ports l web port set tool tip text res get string web port info l web port set text res get string web port f web port set text ok web port set enabled false lssl port set text ssl fssl port set text okssl port set enabled false this add l web port new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f web port new grid bag constraints 1 4 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok web port new grid bag constraints 2 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 this add lssl port new grid bag constraints 4 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add fssl port new grid bag constraints 5 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add okssl port new grid bag constraints 6 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 database server type l database server set tool tip text res get string database server info l database server set text res get string database server l database server set font l database server get font derive font font bold ok database server set enabled false l database type set tool tip text res get string database type info l database type set text res get string database type f database type set preferred size f database server get preferred size this add l database server new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 5 5 0 0 this add f database server new grid bag constraints 1 5 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 5 5 0 0 0 this add ok database server new grid bag constraints 2 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 0 5 5 0 0 this add l database type new grid bag constraints 4 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 5 5 0 0 this add f database type new grid bag constraints 5 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 5 5 0 0 0 db name tns l database name set tool tip text res get string database name info l database name set text res get string database name f database name set text l database discovered set tool tip text res get string tns name info l database discovered set text res get string tns name f database discovered set editable true f database discovered set preferred size f database name get preferred size ok databasesql set enabled false this add l database name new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this add f database name new grid bag constraints 1 6 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 this add ok databasesql new grid bag constraints 2 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 this add l database discovered new grid bag constraints 4 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 0 5 5 0 0 this add f database discovered new grid bag constraints 5 6 1 1 0 5 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 0 0 0 port system l database port set tool tip text res get string database port info l database port set text res get string database port f database port set text l system password set tool tip text res get string system password info l system password set text res get string system password f system password set text jbinit setlayout gridbaglayout binsets ljavahome settooltiptext getstring javahomeinfo ljavahome settext getstring javahome fjavahome settext okjavahome setenabled bjavahome setmargin binsets bjavahome settooltiptext getstring javahomeinfo ljavatype settooltiptext getstring javatypeinfo ljavatype settext getstring javatype fjavatype setpreferredsize fjavahome getpreferredsize ljavahome gridbagconstraints gridbagconstraints gridbagconstraints fjavahome gridbagconstraints gridbagconstraints gridbagconstraints okjavahome gridbagconstraints gridbagconstraints gridbagconstraints bjavahome gridbagconstraints gridbagconstraints gridbagconstraints ljavatype gridbagconstraints gridbagconstraints gridbagconstraints fjavatype gridbagconstraints gridbagconstraints gridbagconstraints compierehome keystore lcompierehome settooltiptext getstring compierehomeinfo lcompierehome settext getstring compierehome fcompierehome settext okcompierehome setenabled bcompierehome setmargin binsets bcompierehome settooltiptext getstring compierehomeinfo lkeystore settext getstring keystorepassword lkeystore settooltiptext getstring keystorepasswordinfo fkeystore settext okkeystore setenabled lcompierehome gridbagconstraints gridbagconstraints gridbagconstraints fcompierehome gridbagconstraints gridbagconstraints gridbagconstraints okcompierehome gridbagconstraints gridbagconstraints gridbagconstraints bcompierehome gridbagconstraints gridbagconstraints gridbagconstraints lkeystore gridbagconstraints gridbagconstraints gridbagconstraints fkeystore gridbagconstraints gridbagconstraints gridbagconstraints okkeystore gridbagconstraints gridbagconstraints gridbagconstraints lappsserver settooltiptext getstring appsserverinfo lappsserver settext getstring appsserver lappsserver setfont lappsserver getfont derivefont fappsserver settext okappsserver setenabled lappstype settooltiptext getstring appstypeinfo lappstype settext getstring appstype fappstype setpreferredsize fappsserver getpreferredsize lappsserver gridbagconstraints gridbagconstraints gridbagconstraints fappsserver gridbagconstraints gridbagconstraints gridbagconstraints okappsserver gridbagconstraints gridbagconstraints gridbagconstraints lappstype gridbagconstraints gridbagconstraints gridbagconstraints fappstype gridbagconstraints gridbagconstraints gridbagconstraints ldeploydir settooltiptext getstring deploydirinfo ldeploydir settext getstring deploydir fdeploydir settext okdeploydir setenabled bdeploydir setmargin binsets bdeploydir settooltiptext getstring deploydirinfo ljnpport settooltiptext getstring jnpportinfo ljnpport settext getstring jnpport fjnpport settext okjnpport setenabled ldeploydir gridbagconstraints gridbagconstraints gridbagconstraints fdeploydir gridbagconstraints gridbagconstraints gridbagconstraints okdeploydir gridbagconstraints gridbagconstraints gridbagconstraints bdeploydir gridbagconstraints gridbagconstraints gridbagconstraints ljnpport gridbagconstraints gridbagconstraints gridbagconstraints fjnpport gridbagconstraints gridbagconstraints gridbagconstraints okjnpport gridbagconstraints gridbagconstraints gridbagconstraints lwebport settooltiptext getstring webportinfo lwebport settext getstring webport fwebport settext okwebport setenabled lsslport settext fsslport settext oksslport setenabled lwebport gridbagconstraints gridbagconstraints gridbagconstraints fwebport gridbagconstraints gridbagconstraints gridbagconstraints okwebport gridbagconstraints gridbagconstraints gridbagconstraints lsslport gridbagconstraints gridbagconstraints gridbagconstraints fsslport gridbagconstraints gridbagconstraints gridbagconstraints oksslport gridbagconstraints gridbagconstraints gridbagconstraints ldatabaseserver settooltiptext getstring databaseserverinfo ldatabaseserver settext getstring databaseserver ldatabaseserver setfont ldatabaseserver getfont derivefont okdatabaseserver setenabled ldatabasetype settooltiptext getstring databasetypeinfo ldatabasetype settext getstring databasetype fdatabasetype setpreferredsize fdatabaseserver getpreferredsize ldatabaseserver gridbagconstraints gridbagconstraints gridbagconstraints fdatabaseserver gridbagconstraints gridbagconstraints gridbagconstraints okdatabaseserver gridbagconstraints gridbagconstraints gridbagconstraints ldatabasetype gridbagconstraints gridbagconstraints gridbagconstraints fdatabasetype gridbagconstraints gridbagconstraints gridbagconstraints ldatabasename settooltiptext getstring databasenameinfo ldatabasename settext getstring databasename fdatabasename settext ldatabasediscovered settooltiptext getstring tnsnameinfo ldatabasediscovered settext getstring tnsname fdatabasediscovered seteditable fdatabasediscovered setpreferredsize fdatabasename getpreferredsize okdatabasesql setenabled ldatabasename gridbagconstraints gridbagconstraints gridbagconstraints fdatabasename gridbagconstraints gridbagconstraints gridbagconstraints okdatabasesql gridbagconstraints gridbagconstraints gridbagconstraints ldatabasediscovered gridbagconstraints gridbagconstraints gridbagconstraints fdatabasediscovered gridbagconstraints gridbagconstraints gridbagconstraints ldatabaseport settooltiptext getstring databaseportinfo ldatabaseport settext getstring databaseport fdatabaseport settext lsystempassword settooltiptext getstring systempasswordinfo lsystempassword settext getstring systempassword fsystempassword settext dynamic initial called by setup return true if success public boolean dyn init return m data load dyninit m_data set status bar text param text text protected void set status bar string text m statusbar set text text setstatusbar m_statusbar settext action listener param e event public void action performed action event e if m testing return tns name changed if e get source f database discovered string db name string f database discovered get selected item if db name null db name length 0 f database name set text db name else if e get source f java type m data init java else if e get source f apps type m data init apps server else if e get source f database type m data init database else if e get source b java home set path f java home else if e get source b compiere home set path f compiere home else if e get source b deploy dir set path f deploy dir else if e get source b help new setup help frame swing utilities get window ancestor this else if e get source b test start test false else if e get source b save start test true actionlistener actionperformed actionevent m_testing getsource fdatabasediscovered dbname fdatabasediscovered getselecteditem dbname dbname fdatabasename settext dbname getsource fjavatype m_data initjava getsource fappstype m_data initappsserver getsource fdatabasetype m_data initdatabase getsource bjavahome setpath fjavahome getsource bcompierehome setpath fcompierehome getsource bdeploydir setpath fdeploydir getsource bhelp setup_help swingutilities getwindowancestor getsource btest starttest getsource bsave starttest set path in field param field field to set path private void set path c text field field j file chooser fc new j file chooser field get text fc set dialog type j file chooser open dialog fc set file selection mode j file chooser directories only fc set multi selection enabled false fc set dialog title field get tool tip text if fc show open dialog this j file chooser approve option field set text fc get selected file get absolute path setpath ctextfield jfilechooser jfilechooser gettext setdialogtype jfilechooser open_dialog setfileselectionmode jfilechooser directories_only setmultiselectionenabled setdialogtitle gettooltiptext showopendialog jfilechooser approve_option settext getselectedfile getabsolutepath start test async return swing worker private swing worker start test final boolean save it swing worker worker new swing worker start it public object construct m testing true set cursor cursor get predefined cursor cursor wait cursor b test set enabled false m success false m errorstring null try test catch exception ex ex print stack trace m errorstring n ex to string set cursor cursor get default cursor if m errorstring null m success true b test set enabled true m testing false return new boolean m success finish it public void finished if m errorstring null c logger get severe m errorstring j option pane show confirm dialog m statusbar get parent m errorstring res get string server error j option pane default option j option pane error message else if save it save worker start return worker swingworker swingworker starttest saveit swingworker swingworker m_testing setcursor getpredefinedcursor wait_cursor btest setenabled m_success m_errorstring printstacktrace m_errorstring tostring setcursor getdefaultcursor m_errorstring m_success btest setenabled m_testing m_success m_errorstring clogger m_errorstring joptionpane showconfirmdialog m_statusbar getparent m_errorstring getstring servererror joptionpane default_option joptionpane error_message saveit start it public object construct m testing true set cursor cursor get predefined cursor cursor wait cursor b test set enabled false m success false m errorstring null try test catch exception ex ex print stack trace m errorstring n ex to string set cursor cursor get default cursor if m errorstring null m success true b test set enabled true m testing false return new boolean m success m_testing setcursor getpredefinedcursor wait_cursor btest setenabled m_success m_errorstring printstacktrace m_errorstring tostring setcursor getdefaultcursor m_errorstring m_success btest setenabled m_testing m_success finish it public void finished if m errorstring null c logger get severe m errorstring j option pane show confirm dialog m statusbar get parent m errorstring res get string server error j option pane default option j option pane error message else if save it save m_errorstring clogger m_errorstring joptionpane showconfirmdialog m_statusbar getparent m_errorstring getstring servererror joptionpane default_option joptionpane error_message saveit test it throws exception private void test throws exception b save set enabled false if m data test return m statusbar set text res get string ok b save set enabled true m errorstring null bsave setenabled m_data m_statusbar settext getstring bsave setenabled m_errorstring ui signal ok param cb ckeck box param res string resource string key param pass true if test passed param critical true if critial param error msg error message void signalok c check box cb string res string boolean pass boolean critical string error msg m errorstring res get string res string cb set selected pass if pass cb set tool tip text null else cb set tool tip text error msg m errorstring n error msg if pass critical cb set background color red else cb set background color green resstring errormsg ccheckbox resstring errormsg m_errorstring getstring resstring setselected settooltiptext settooltiptext errormsg m_errorstring errormsg setbackground setbackground save settings called from start test finished private void save if m success return b save set enabled false b test set enabled false set cursor cursor get predefined cursor cursor wait cursor if m data save return final info j option pane show confirm dialog this res get string environment saved res get string compiere server setup j option pane default option j option pane information message run ant try c logger get info starting ant system set property ant home string args new string setup launcher main args calls system exit main ant main new main ant main start ant args null null catch exception e c logger get log level severe ant e to be sure frame swing utilities get window ancestor this dispose system exit 0 remains active when license dialog called starttest m_success bsave setenabled btest setenabled setcursor getpredefinedcursor wait_cursor m_data joptionpane showconfirmdialog getstring environmentsaved getstring compiereserversetup joptionpane default_option joptionpane information_message clogger setproperty antmain antmain startant clogger swingutilities getwindowancestor get cache management return cache mgr public static cache mgt get if s cache null s cache new cache mgt return s cache cachemgt s_cache s_cache cachemgt s_cache private constructor private cache mgt cachemgt register cache instance param instance cache return true if added suppress warnings unchecked public synchronized boolean register cache interface instance if instance null return false if instance instanceof c cache string table name c cache instance get name m tablenames add table name return m instances add instance suppresswarnings cacheinterface ccache tablename ccache getname m_tablenames tablename m_instances un register cache instance param instance cache return true if removed public boolean unregister cache interface instance if instance null return false boolean found false could be included multiple times for int i m instances size 1 i 0 i cache interface stored cache interface m instances get i if instance equals stored m instances remove i found true return found cacheinterface m_instances cacheinterface cacheinterface m_instances m_instances reset all registered cache return number of deleted cache entries public int reset int counter 0 int total 0 for int i 0 i m instances size i cache interface stored cache interface m instances get i if stored null stored size 0 log fine stored to string total stored reset counter log info counter total return total m_instances cacheinterface cacheinterface m_instances tostring reset registered cache param table name table name return number of deleted cache entries public int reset string table name return reset table name 0 tablename tablename tablename reset registered cache param table name table name param record id record if applicable or 0 for all return number of deleted cache entries suppress warnings unchecked public int reset string table name int record id if table name null return reset if table name ends with set table name table name substring 0 table name length 3 if m tablenames contains table name return 0 int counter 0 int total 0 for int i 0 i m instances size i cache interface stored cache interface m instances get i if stored null stored instanceof c cache c cache cc c cache stored if cc get name starts with table name reset lines dependent too if record id 0 log fine all stored total stored reset counter log info table name counter total update server if db is remote objects server server c connection get get server try if server null see server bean int server total server cache reset table name 0 if c log mgt is level finest log fine server server total catch remote exception ex log log level severe apps server error ex return total tablename record_id suppresswarnings tablename record_id tablename tablename endswith tablename tablename tablename m_tablenames tablename m_instances cacheinterface cacheinterface m_instances ccache ccache ccache getname startswith tablename record_id tablename isremoteobjects cconnection getserver serverbean servertotal cachereset tablename clogmgt islevelfinest servertotal remoteexception appsserver total cached elements return count suppress warnings unchecked public int get element count int total 0 for int i 0 i m instances size i cache interface stored cache interface m instances get i if stored null stored size 0 log fine stored to string if stored instanceof c cache total c cache stored size no expire else total stored size return total suppresswarnings getelementcount m_instances cacheinterface cacheinterface m_instances tostring ccache ccache sizenoexpire string representation return info public string to string string buffer sb new string buffer cache mgt sb append instances append m instances size append return sb to string tostring stringbuffer stringbuffer cachemgt m_instances tostring extended string representation return info public string to stringx string buffer sb new string buffer cache mgt sb append instances append m instances size append elements append get element count append return sb to string tostringx stringbuffer stringbuffer cachemgt m_instances getelementcount tostring constructor non nodal as otherwise process is blocked param owner param text message to be displayed param can not wait user can continue with other work param timer timer ticks seconds if 0 then 10 public waiting frame owner string text boolean can not wait int timer super owner msg get msg env get ctx processing init text can not wait timer cannotwait cannotwait getmsg getctx cannotwait constructor non modal as otherwise process is blocked param owner param text message to be displayed param can not wait user can continue with other work param timer timer ticks seconds if 0 then 10 public waiting dialog owner string text boolean can not wait int timer super owner msg get msg env get ctx processing init text can not wait timer cannotwait cannotwait getmsg getctx cannotwait common initialize routine does not create if timer 1 param text message to be displayed param can not wait user can continue with other work param timer timer ticks seconds if less than 5 then 10 private void init string text boolean can not wait int timer log fine text sec timer don t show if 1 sec average if timer 1 return try jb init set text text if can not wait b do not wait set visible false catch exception e log log level severe waiting e set progress bar progress bar set minimum 0 progress bar set maximum timer 5 10 timer min 2 seconds timer m timer new timer 1000 this every second m timer start a env show center window get owner this cannotwait cannotwait jbinit settext cannotwait bdonotwait setvisible progressbar setminimum progressbar setmaximum m_timer m_timer aenv showcenterwindow getowner static layout throws exception private void jb init throws exception this set default close operation window constants do nothing on close this set resizable false this set cursor cursor get predefined cursor cursor wait cursor this get content pane add box create vertical strut 8 border layout north this get content pane add box create horizontal strut 8 border layout west this get content pane add box create vertical strut 8 border layout south this get content pane add box create horizontal strut 8 border layout east main panel set layout new border layout 5 5 this get content pane add main panel border layout center info label set font new java awt font dialog 3 14 info label set horizontal alignment swing constants center info label set horizontal text position swing constants right info label set icon env get image icon ad10030 gif info label set icon text gap 10 main panel add info label border layout north main panel add progress bar border layout center b do not wait set text msg get msg env get ctx do not wait b do not wait set tool tip text msg get msg env get ctx do not wait info b do not wait add action listener this south panel set layout south layout south panel add b do not wait null main panel add south panel border layout south jbinit setdefaultcloseoperation windowconstants do_nothing_on_close setresizable setcursor getpredefinedcursor wait_cursor getcontentpane createverticalstrut borderlayout getcontentpane createhorizontalstrut borderlayout getcontentpane createverticalstrut borderlayout getcontentpane createhorizontalstrut borderlayout mainpanel setlayout borderlayout getcontentpane mainpanel borderlayout infolabel setfont infolabel sethorizontalalignment swingconstants infolabel sethorizontaltextposition swingconstants infolabel seticon getimageicon infolabel seticontextgap mainpanel infolabel borderlayout mainpanel progressbar borderlayout bdonotwait settext getmsg getctx donotwait bdonotwait settooltiptext getmsg getctx donotwaitinfo bdonotwait addactionlistener southpanel setlayout southlayout southpanel bdonotwait mainpanel southpanel borderlayout set info text param text public void set text string text info label set text text settext infolabel settext action listener param e public void action performed action event e if e get source b do not wait do not wait progress bar set value m timervalue if m timervalue progress bar get maximum m timervalue progress bar get minimum progress bar set string progress bar get percent complete actionlistener actionperformed actionevent getsource bdonotwait donotwait progressbar setvalue m_timervalue m_timervalue progressbar getmaximum m_timervalue progressbar getminimum progressbar setstring progressbar getpercentcomplete set timer estimate param max seconds public void set timer estimate int max progress bar set maximum max settimerestimate progressbar setmaximum user does not want to wait for result and continue with other worg callback dispose public void do not wait todo callback dispose donotwait dispose public void dispose if m timer null m timer stop m timer null super dispose m_timer m_timer m_timer constructor param ctx context param window no window no public mp attribute lookup properties ctx int window no super display type table dir window no m ctx ctx windowno mpattributelookup windowno displaytype tabledir windowno m_ctx get display for value not cached param value location id return string value public string get display object value if value null return name pair pp get value if pp null return value to string return pp get name location_id getdisplay namepair tostring getname the lookup contains the key not cached param key location id return true if key known public boolean contains key object key return get key null location_id containskey get object of key value param value value return object or null public name pair get object value if value null return null int m attributesetinstance id 0 if value instanceof integer m attributesetinstance id integer value int value else try m attributesetinstance id integer parse int value to string catch exception e log log level severe value value e if m attributesetinstance id 0 return no instance statement if m pstmt null m pstmt db prepare statement select description from m attributesetinstance where m attributesetinstance id null string description null try m pstmt set int 1 m attributesetinstance id result set rs m pstmt execute query if rs next description rs get string 1 description if description null description length 0 if c log mgt is level fine description m attributesetinstance id else description rs close catch exception e log log level severe get e if description null return null return new key name pair m attributesetinstance id description namepair m_attributesetinstance_id m_attributesetinstance_id intvalue m_attributesetinstance_id parseint tostring m_attributesetinstance_id no_instance m_pstmt m_pstmt preparestatement m_attributesetinstance m_attributesetinstance_id m_pstmt setint m_attributesetinstance_id resultset m_pstmt executequery getstring clogmgt islevelfine m_attributesetinstance_id keynamepair m_attributesetinstance_id dispose see org compiere model lookup dispose public void dispose try if m pstmt null m pstmt close catch sql exception e log log level severe dispose e log fine super dispose m_pstmt m_pstmt sqlexception return data as sorted array not implemented param mandatory mandatory param only validated only validated param only active only active param temporary force load for temporary display return null public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary log log level severe not implemented return null onlyvalidated onlyactive arraylist getdata onlyvalidated onlyactive get underlying fully qualified table column name used for v lookup action button zoom return column name public string get column name return m attributesetinstance id vlookup actionbutton getcolumnname m_attributesetinstance_id create ui param c component return singleton public static compiere labelui createui j component c return compiere labelui compierelabelui jcomponent compierelabelui install keyboard actions param l label protected void install keyboard actions j label l super install keyboard actions l int dka l get displayed mnemonic if dka 0 component lf l get label for if lf null action map action map l get action map action map put press action press input map input map swing utilities getui input map l j component when in focused window if input map null input map new component input mapui resource l swing utilities replaceui input map l j component when in focused window input map input map clear input map put key stroke get key stroke dka action event shift mask action event ctrl mask false press installkeyboardactions jlabel installkeyboardactions getdisplayedmnemonic getlabelfor actionmap actionmap getactionmap actionmap action_press inputmap inputmap swingutilities getuiinputmap jcomponent when_in_focused_window inputmap inputmap componentinputmapuiresource swingutilities replaceuiinputmap jcomponent when_in_focused_window inputmap inputmap inputmap keystroke getkeystroke actionevent shift_mask actionevent ctrl_mask press action super press pressaction public void action performed action event e j label label j label e get source string key get name if key press do press label actionperformed actionevent jlabel jlabel getsource getname dopress do press focus the field param label label private void do press j label label component label for label get label for if label for null label for is enabled component owner label get label for if owner instanceof container container owner is focus cycle root owner request focus else if owner instanceof container container container container owner if container is focus cycle root focus traversal policy policy container get focus traversal policy component comp policy get default component container if comp null comp request focus return container root ancestor container get focus cycle root ancestor if root ancestor null focus traversal policy policy root ancestor get focus traversal policy component comp policy get component after root ancestor container if comp null swing utilities is descending from comp container comp request focus return if owner is focusable owner request focus return no forcus dopress jlabel labelfor getlabelfor labelfor labelfor isenabled getlabelfor isfocuscycleroot requestfocus isfocuscycleroot focustraversalpolicy getfocustraversalpolicy getdefaultcomponent requestfocus rootancestor getfocuscyclerootancestor rootancestor focustraversalpolicy rootancestor getfocustraversalpolicy getcomponentafter rootancestor swingutilities isdescendingfrom requestfocus isfocusable requestfocus get active param ctx context return active processors public static m scheduler get active properties ctx array list m scheduler list new array list m scheduler string sql select from ad scheduler where is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m scheduler ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m scheduler ret value new m scheduler list size list to array ret value return ret value mscheduler getactive arraylist mscheduler arraylist mscheduler ad_scheduler isactive preparedstatement preparestatement resultset executequery mscheduler s_log mscheduler retvalue mscheduler toarray retvalue retvalue standard constructor param ctx context param ad scheduler id id public m scheduler properties ctx int ad scheduler id string trx name super ctx ad scheduler id trx name ad_scheduler_id mscheduler ad_scheduler_id trxname ad_scheduler_id trxname load constructor param ctx context param rs result set public m scheduler properties ctx result set rs string trx name super ctx rs trx name mscheduler resultset trxname trxname get server id return id public string get serverid return scheduler get id getserverid get_id get date next run param requery requery return date next run public timestamp get date next run boolean requery if requery load get trxname return get date next run getdatenextrun get_trxname getdatenextrun get logs return logs public compiere processor log get logs array list m scheduler log list new array list m scheduler log string sql select from ad schedulerlog where ad scheduler id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad scheduler id result set rs pstmt execute query while rs next list add new m scheduler log get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m scheduler log ret value new m scheduler log list size list to array ret value return ret value compiereprocessorlog getlogs arraylist mschedulerlog arraylist mschedulerlog ad_schedulerlog ad_scheduler_id preparedstatement preparestatement get_trxname setint getad_scheduler_id resultset executequery mschedulerlog getctx get_trxname mschedulerlog retvalue mschedulerlog toarray retvalue retvalue delete old request log return number of records public int delete log if get keep log days 1 return 0 string sql delete ad schedulerlog where ad scheduler id getad scheduler id and created get keep log days sys date int no db execute update sql get trxname return 0 deletelog getkeeplogdays ad_schedulerlog ad_scheduler_id getad_scheduler_id getkeeplogdays sysdate executeupdate get_trxname constructor param m product id product param trx name transcation public product info int m product id string trx name m trxname trx name init m product id m_product_id trxname productinfo m_product_id trxname m_trxname trxname m_product_id get product info service revenue recognition automatically called by constructor param m product id product private void init int m product id m m product id m product id if m m product id 0 return string sql select p product type pc value 1 2 p c revenuerecognition id p c uom id 3 4 p ad client id p ad org id 5 6 p isbom p is stocked 7 8 from m product category pc inner join m product p on pc m product category id p m product category id where p m product id 1 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id result set rs pstmt execute query if rs next m producttype rs get string 1 m productcategory rs get string 2 m c revenuerecognition id rs get int 3 m c uom id rs get int 4 reference m ad client id rs get int 5 m ad org id rs get int 6 m isbom y equals rs get string 7 m isstocked y equals rs get string 8 rs close pstmt close catch sql exception e log log level severe sql e m_product_id m_product_id m_m_product_id m_product_id m_m_product_id producttype c_revenuerecognition_id c_uom_id ad_client_id ad_org_id isstocked m_product_category m_product m_product_category_id m_product_category_id m_product_id preparedstatement preparestatement setint m_m_product_id resultset executequery m_producttype getstring m_productcategory getstring m_c_revenuerecognition_id getint m_c_uom_id getint m_ad_client_id getint m_ad_org_id getint m_isbom getstring m_isstocked getstring sqlexception is product item return true if product public boolean is product return m product producttype item equals m producttype isproduct mproduct producttype_item m_producttype is it a bom return true if bom public boolean isbom return m isbom m_isbom is it stocked return true if stocked public boolean is stocked return m isstocked isstocked m_isstocked is service return true if service public boolean is service return m product producttype service equals m producttype isservice mproduct producttype_service m_producttype get product category value return m product category id public string get product category return m productcategory m_product_category_id getproductcategory m_productcategory has revenue recognition return true if product service has revenue recognition public boolean is revenue recognition return m c revenuerecognition id 0 isrevenuerecognition m_c_revenuerecognition_id get revenue recognition return c revenuerecognition id public int getc revenuerecognition id return m c revenuerecognition id c_revenuerecognition_id getc_revenuerecognition_id m_c_revenuerecognition_id quantity uom return c uom id public int getc uom id return m c uom id c_uom_id getc_uom_id m_c_uom_id set quantity in storage uom param qty quantity public void set qty big decimal qty m qty qty setqty bigdecimal m_qty set quantity in uom param qty quantity param c uom id uom public void set qty big decimal qty int c uom id m qty muom conversion convert c uom id m c uom id qty true std precision if qty null m qty null conversion error log severe conversion error set to qty m qty qty c_uom_id setqty bigdecimal c_uom_id m_qty muomconversion c_uom_id m_c_uom_id stdprecision m_qty m_qty get qty in storage uom return qty public big decimal get qty return m qty bigdecimal getqty m_qty update create initial cost record check first for purchase price list then product purchase costs and then price list param as accounting schema param create create record return costs private big decimal update costs m acct schema as boolean create create zero record if create string buffer sql new string buffer insert into m product costing m product id c acctschema id ad client id ad org id is active created created by updated updated by current cost price cost standard future cost price cost standardpo qty cost standardpo amt cost standard cum qty cost standard cum amt cost average cost average cum qty cost average cum amt price lastpo price last inv total inv qty total inv amt values sql append m m product id append append as getc acctschema id append append m ad client id append append m ad org id append append y sys date 0 sys date 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 int no db execute update sql to string m trxname if no 1 log fine costing created try to find non zero price string cost source price list po big decimal costs get price list as true if costs null costs equals env zero cost source po cost costs getpo cost as if costs null costs equals env zero cost source price list costs get price list as false if not found use 1 to be able to do material transactions if costs null costs equals env zero cost source not found costs new big decimal 1 update current costs string buffer sql new string buffer update m product costing sql append set current cost price append costs append where m product id append m m product id append and c acctschema id append as getc acctschema id int no db execute update sql to string m trxname if no 1 log fine cost source costs return costs bigdecimal updatecosts macctschema stringbuffer stringbuffer m_product_costing m_product_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby currentcostprice coststandard futurecostprice coststandardpoqty coststandardpoamt coststandardcumqty coststandardcumamt costaverage costaveragecumqty costaveragecumamt pricelastpo pricelastinv totalinvqty totalinvamt m_m_product_id getc_acctschema_id m_ad_client_id m_ad_org_id sysdate sysdate executeupdate tostring m_trxname costingcreated costsource pricelist bigdecimal getpricelist costsource getpocost costsource pricelist getpricelist costsource bigdecimal stringbuffer stringbuffer m_product_costing currentcostprice m_product_id m_m_product_id c_acctschema_id getc_acctschema_id executeupdate tostring m_trxname costsource get po price from price list and convert it to acct schema currency param as accounting schema param onlypo price list use only po price list return po price private big decimal get price list m acct schema as boolean onlypo price list string buffer sql new string buffer select pl c currency id pp price list pp price std pp price limit from m pricelist pl m pricelist version plv m productprice pp where pl m pricelist id plv m pricelist id and plv m pricelist version id pp m pricelist version id and pp m product id if onlypo price list sql append and pl isso price list n sql append order by pl isso price list asc plv valid from desc int c currency id 0 big decimal price list null big decimal price std null big decimal price limit null try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m m product id result set rs pstmt execute query if rs next c currency id rs get int 1 price list rs get big decimal 2 price std rs get big decimal 3 price limit rs get big decimal 4 rs close pstmt close catch sql exception e log log level severe sql to string e nothing found if c currency id 0 return null big decimal price price limit best bet if price null price equals env zero price price std if price null price equals env zero price price list convert if price null price equals env zero price m conversion rate convert as get ctx price c currency id as getc currency id as getad client id 0 return price pricelist acctschema onlypopricelist bigdecimal getpricelist macctschema onlypopricelist stringbuffer stringbuffer c_currency_id pricelist pricestd pricelimit m_pricelist m_pricelist_version m_productprice m_pricelist_id m_pricelist_id m_pricelist_version_id m_pricelist_version_id m_product_id onlypopricelist issopricelist issopricelist validfrom c_currency_id bigdecimal pricelist bigdecimal pricestd bigdecimal pricelimit preparedstatement preparestatement tostring setint m_m_product_id resultset executequery c_currency_id getint pricelist getbigdecimal pricestd getbigdecimal pricelimit getbigdecimal sqlexception tostring c_currency_id bigdecimal pricelimit pricestd pricelist mconversionrate getctx c_currency_id getc_currency_id getad_client_id get po cost from purchase info and convert it to acct schema currency param as accounting schema return po cost private big decimal getpo cost m acct schema as string sql select c currency id price list pricepo price lastpo from m product po where m product id order by is current vendor desc int c currency id 0 big decimal price list null big decimal pricepo null big decimal price lastpo null try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id result set rs pstmt execute query if rs next c currency id rs get int 1 price list rs get big decimal 2 pricepo rs get big decimal 3 price lastpo rs get big decimal 4 rs close pstmt close catch sql exception e log log level severe sql e nothing found if c currency id 0 return null big decimal cost price lastpo best bet if cost null cost equals env zero cost pricepo if cost null cost equals env zero cost price list convert standard precision should be costing precision if cost null cost equals env zero cost m conversion rate convert as get ctx cost c currency id as getc currency id m ad client id m ad org id return cost acctschema bigdecimal getpocost macctschema c_currency_id pricelist pricelastpo m_product_po m_product_id iscurrentvendor c_currency_id bigdecimal pricelist bigdecimal bigdecimal pricelastpo preparedstatement preparestatement setint m_m_product_id resultset executequery c_currency_id getint pricelist getbigdecimal getbigdecimal pricelastpo getbigdecimal sqlexception c_currency_id bigdecimal pricelastpo pricelist mconversionrate getctx c_currency_id getc_currency_id m_ad_client_id m_ad_org_id grid element constructor call set data to initialize content param rows max rows param cols max cols public grid element int rows int cols m rows rows m cols cols m textlayout new text layout rows cols m iterator new attributed character iterator rows cols m rowheight new int rows m colwidth new int cols explicit init for int r 0 r m rows r m rowheight r 0 for int c 0 c m cols c m textlayout r c null m iterator r c null for int c 0 c m cols c m colwidth c 0 setdata gridelement m_rows m_cols m_textlayout textlayout m_iterator attributedcharacteriterator m_rowheight m_colwidth m_rows m_rowheight m_cols m_textlayout m_iterator m_cols m_colwidth create text layout from data and calculate size called from parameter element and location param row row param col column param string data info element param font font param foreground color for foreground public void set data int row int col string string data font font paint foreground if string data null string data length 0 return log fine set data row col string data attributed string a string new attributed string string data a string add attribute text attribute font font a string add attribute text attribute foreground foreground attributed character iterator iter a string get iterator text layout layout new text layout iter m frc set data row col layout iter textlayout parameterelement stringdata setdata stringdata stringdata stringdata setdata stringdata attributedstring astring attributedstring stringdata astring addattribute textattribute astring addattribute textattribute attributedcharacteriterator astring getiterator textlayout textlayout m_frc setdata create text layout from data and calculate size param row row param col column param layout single line layout private void set data int row int col text layout layout attributed character iterator iter if layout null return if p sizecalculated throw new illegal state exception size already calculated if row 0 row m rows throw new array index out of bounds exception row index row rows m rows if col 0 col m cols throw new array index out of bounds exception column index col cols m cols m textlayout row col layout m iterator row col iter set size int height int layout get ascent layout get descent layout get leading 1 int width int layout get advance 1 if m rowheight row height m rowheight row height if m colwidth col width m colwidth col width textlayout setdata textlayout attributedcharacteriterator p_sizecalculated illegalstateexception m_rows arrayindexoutofboundsexception m_rows m_cols arrayindexoutofboundsexception m_cols m_textlayout m_iterator getascent getdescent getleading getadvance m_rowheight m_rowheight m_colwidth m_colwidth set rpw column gap param row gap row gap param col gap column gap public void set gap int row gap int col gap m rowgap row gap m colgap col gap rowgap colgap setgap rowgap colgap m_rowgap rowgap m_colgap colgap layout calculate image size set p width p height return true if calculated protected boolean calculate size p height 0 for int r 0 r m rows r p height m rowheight r if m rowheight r 0 p height m rowgap p height m rowgap remove last p width 0 for int c 0 c m cols c p width m colwidth c if m colwidth c 0 p width m colgap p width m colgap remove last return true p_width p_height calculatesize p_height m_rows p_height m_rowheight m_rowheight p_height m_rowgap p_height m_rowgap p_width m_cols p_width m_colwidth m_colwidth p_width m_colgap p_width m_colgap paint it param g2d graphics param page start top left location of page param page no page number for multi page support 0 header footer ignored param ctx print context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view point2d double location get absolute location page start float y float location y for int row 0 row m rows row float x float location x for int col 0 col m cols col if m textlayout row col null float yy y m textlayout row col get ascent if m iterator row col null g2d draw string m iterator row col x yy else m textlayout row col draw g2d x yy x m colwidth col if m colwidth col 0 x m colgap y m rowheight row if m rowheight row 0 y m rowgap pagestart pageno isview ids pageno pagestart isview getabsolutelocation pagestart m_rows m_cols m_textlayout m_textlayout getascent m_iterator drawstring m_iterator m_textlayout m_colwidth m_colwidth m_colgap m_rowheight m_rowheight m_rowgap application start and menu public a menu super log info code base compiere get code base splash splash splash get splash m windowno env create window no this login init system splash login splash set text msg get msg m ctx loading compiere startup environment true load environment m session get env get ctx true start session preparation set default close operation j frame dispose on close wf activity new wf activity this wf panel new wf panel this tree panel new v tree panel m windowno true false editable has bar try jb init create menu catch exception ex log log level severe a menu ex initialize load tree int ad role id env getad role id env get ctx int ad tree id db getsql value null select coalesce r ad tree menu id ci ad tree menu id from ad clientinfo ci inner join ad role r on ci ad client id r ad client id where ad role id ad role id if ad tree id 0 ad tree id 10 menu tree panel init tree ad tree id translate env set context m ctx m windowno window name msg get msg m ctx menu set title env get header m ctx m windowno progress bar set string msg get msg m ctx select program finish ui point loc ini get window location 0 if loc null loc new point 0 0 this set location loc this pack this set visible true this set state frame normal m ad user id env get context as int m ctx ad user id m ad role id env get context as int m ctx ad role id update info splash dispose splash null amenu codebase getcodebase getsplash m_windowno createwindowno initsystem settext getmsg m_ctx startupenvironment msession getctx setdefaultcloseoperation jframe dispose_on_close wfactivity wfactivity wfpanel wfpanel treepanel vtreepanel m_windowno hasbar jbinit createmenu amenu ad_role_id getad_role_id getctx ad_tree_id getsqlvalue ad_tree_menu_id ad_tree_menu_id ad_clientinfo ad_role ad_client_id ad_client_id ad_role_id ad_role_id ad_tree_id ad_tree_id treepanel inittree ad_tree_id setcontext m_ctx m_windowno windowname getmsg m_ctx settitle getheader m_ctx m_windowno progressbar setstring getmsg m_ctx selectprogram getwindowlocation setlocation setvisible setstate m_ad_user_id getcontextasint m_ctx ad_user_id m_ad_role_id getcontextasint m_ctx ad_role_id updateinfo init system do not get msg as environment not initialized yet pre login in not successful exit pre param splash splash window private void init system splash splash default image this set icon image compiere get image16 focus traversal keyboard focus manager set current keyboard focus manager a keyboard focus manager get focus manager get current manager set default focus traversal policy a focus traversal policy get this set focus traversal policy a focus traversal policy get show login screen if not successful exit log finer login a login login new a login splash if login init login no automatic login center the window try a env show center screen login html load errors catch exception ex log severe ex to string if login is connected login iso kpressed a env exit 1 check db apps server version checked in login boolean dbok db is databaseok m ctx if dbok a env exit 1 initsystem seticonimage getimage16 keyboardfocusmanager setcurrentkeyboardfocusmanager akeyboardfocusmanager focusmanager getcurrentmanager setdefaultfocustraversalpolicy afocustraversalpolicy setfocustraversalpolicy afocustraversalpolicy alogin alogin initlogin aenv showcenterscreen tostring isconnected isokpressed aenv appsserver isdatabaseok m_ctx aenv static init pre main panel center pane tree panel wf activity wf panel south panel info panel b notes b task memory bar wf panel progress bar pre throws exception void jb init throws exception this set name menu this set locale language get login language get locale this setj menu bar menu bar main panel set layout main layout main layout set hgap 0 main layout set vgap 2 tree panel add property change listener v tree panel node selection this info panel set layout info layout info layout set columns 2 info layout set hgap 4 info layout set vgap 0 b notes set request focus enabled false b notes set tool tip text b notes set action command notes b notes add action listener this b notes set icon env get image icon get mail24 gif b notes set margin new insets 0 0 0 0 b requests set request focus enabled false b requests set action command requests b requests add action listener this b requests set icon env get image icon request24 gif b requests set margin new insets 0 0 0 0 south layout set hgap 0 south layout set vgap 1 memory bar set string painted true memory bar set opaque false memory bar set border painted false memory bar add mouse listener new amenu mouseadapter progress bar set string painted true progress bar set opaque false get content pane add main panel main panel add center pane border layout center main panel add south panel border layout south main panel add box create horizontal strut 3 border layout east main panel add box create horizontal strut 3 border layout west tabs pa panel pa panel get if pa panel null center pane add pa panel msg get msg m ctx pa panel m tabmenu m tabactivities m tabworkflow center pane add tree panel msg get msg m ctx menu center pane add new c scroll pane wf activity msg get msg m ctx workflow activities 0 center pane add new c scroll pane wf panel msg get msg m ctx workflow panel center pane add change listener this south panel set layout south layout south panel add info panel border layout north south panel add progress bar border layout south info panel add b notes null info panel add b requests null info panel add memory bar null int loc ini get divider location if loc 0 tree panel set divider location loc mainpanel centerpane treepanel wfactivity wfpanel southpanel infopanel bnotes btask memorybar wfpanel progressbar jbinit setname setlocale getloginlanguage getlocale setjmenubar menubar mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap treepanel addpropertychangelistener vtreepanel node_selection infopanel setlayout infolayout infolayout setcolumns infolayout sethgap infolayout setvgap bnotes setrequestfocusenabled bnotes settooltiptext bnotes setactioncommand bnotes addactionlistener bnotes seticon getimageicon getmail24 bnotes setmargin brequests setrequestfocusenabled brequests setactioncommand brequests addactionlistener brequests seticon getimageicon brequests setmargin southlayout sethgap southlayout setvgap memorybar setstringpainted memorybar setopaque memorybar setborderpainted memorybar addmouselistener amenu_mouseadapter progressbar setstringpainted progressbar setopaque getcontentpane mainpanel mainpanel centerpane borderlayout mainpanel southpanel borderlayout mainpanel createhorizontalstrut borderlayout mainpanel createhorizontalstrut borderlayout papanel papanel papanel centerpane papanel getmsg m_ctx papanel m_tabmenu m_tabactivities m_tabworkflow centerpane treepanel getmsg m_ctx centerpane cscrollpane wfactivity getmsg m_ctx workflowactivities centerpane cscrollpane wfpanel getmsg m_ctx workflowpanel centerpane addchangelistener southpanel setlayout southlayout southpanel infopanel borderlayout southpanel progressbar borderlayout infopanel bnotes infopanel brequests infopanel memorybar getdividerlocation treepanel setdividerlocation get preferred size return preferred size public dimension get preferred size dimension dim ini get window dimension 0 if dim null dim new dimension 350 500 return dim getpreferredsize getwindowdimension create menu private void create menu file j menu m file a env get menu file menu bar add m file a env add menu item print screen null key stroke get key stroke key event vk printscreen 0 m file this a env add menu item screen shot null key stroke get key stroke key event vk printscreen key event shift mask m file this m file add separator a env add menu item exit null key stroke get key stroke key event vk x event shift mask event alt mask m file this view j menu m view a env get menu view menu bar add m view a env add menu item info product null key stroke get key stroke key event vk i event alt mask m view this a env add menu item infob partner null key stroke get key stroke key event vk i event alt mask event ctrl mask m view this if m role get default is show acct a env add menu item info account null key stroke get key stroke key event vk i event alt mask event ctrl mask m view this a env add menu item info schedule null null m view this m view add separator a env add menu item info order info null m view this a env add menu item info invoice info null m view this a env add menu item info in out info null m view this a env add menu item info payment info null m view this a env add menu item info cash line info null m view this a env add menu item info assignment info null m view this a env add menu item info asset info null m view this tools j menu m tools a env get menu tools menu bar add m tools a env add menu item calculator null null m tools this a env add menu item calendar null null m tools this a env add menu item editor null null m tools this a env add menu item script null null m tools this if a env is workflow process a env add menu item work flow null null m tools this if m role get default is show preference m tools add separator a env add menu item preference null null m tools this help j menu m help a env get menu help menu bar add m help a env add menu item online null null m help this a env add menu item e mail support null null m help this a env add menu item about null null m help this createmenu jmenu mfile aenv getmenu menubar mfile aenv addmenuitem printscreen keystroke getkeystroke keyevent vk_printscreen mfile aenv addmenuitem screenshot keystroke getkeystroke keyevent vk_printscreen keyevent shift_mask mfile mfile addseparator aenv addmenuitem keystroke getkeystroke keyevent vk_x shift_mask alt_mask mfile jmenu mview aenv getmenu menubar mview aenv addmenuitem infoproduct keystroke getkeystroke keyevent vk_i alt_mask mview aenv addmenuitem infobpartner keystroke getkeystroke keyevent vk_i alt_mask ctrl_mask mview mrole getdefault isshowacct aenv addmenuitem infoaccount keystroke getkeystroke keyevent vk_i alt_mask ctrl_mask mview aenv addmenuitem infoschedule mview mview addseparator aenv addmenuitem infoorder mview aenv addmenuitem infoinvoice mview aenv addmenuitem infoinout mview aenv addmenuitem infopayment mview aenv addmenuitem infocashline mview aenv addmenuitem infoassignment mview aenv addmenuitem infoasset mview jmenu mtools aenv getmenu menubar mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv isworkflowprocess aenv addmenuitem workflow mtools mrole getdefault isshowpreference mtools addseparator aenv addmenuitem mtools jmenu mhelp aenv getmenu menubar mhelp aenv addmenuitem mhelp aenv addmenuitem emailsupport mhelp aenv addmenuitem mhelp dispose end system public void dispose clean up close windows ini set window dimension 0 get size ini set divider location tree panel get divider location ini set window location 0 get location ini save properties true super dispose a env exit 0 setwindowdimension getsize setdividerlocation treepanel getdividerlocation setwindowlocation getlocation saveproperties aenv window events request focus param e event protected void process window event window event e super process window event e if e getid window event window opened tree panel get search field request focus in window this to front requestfocus processwindowevent windowevent processwindowevent windowevent window_opened treepanel getsearchfield requestfocusinwindow tofront set busy param value true if buzy protected void set busy boolean value m startingitem value if value set cursor cursor get predefined cursor cursor wait cursor else set cursor cursor get default cursor set enabled value causes flicker setbusy m_startingitem setcursor getpredefinedcursor wait_cursor setcursor getdefaultcursor setenabled selection in tree launch application param e property change event public void property change property change event e m tree node nd m tree node e get new value log info nd getnode id nd to string ignore summary items when loading if m startingitem nd is summary return string sta nd to string progress bar set string sta int cmd nd getnode id new a menu start item cmd true sta this start async load update info propertychangeevent propertychange propertychangeevent mtreenode mtreenode getnewvalue getnode_id tostring m_startingitem issummary tostring progressbar setstring getnode_id amenustartitem updateinfo action listener param e action event public void action performed action event e buttons if e get source b notes goto notes else if e get source b requests goto requests else if a env action performed e get action command m windowno this log log level severe unknown action e get action command update info actionlistener actionevent actionperformed actionevent getsource bnotes gotonotes getsource brequests gotorequests aenv actionperformed getactioncommand m_windowno getactioncommand updateinfo get number of open notes return bumber of notes private int get notes int ret value 0 string sql select count from ad note where ad client id and ad user id in 0 and processed n try prepared statement pstmt db prepare statement sql null pstmt set int 1 env getad client id env get ctx pstmt set int 2 m ad user id result set rs pstmt execute query if rs next ret value rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value getnotes retvalue ad_note ad_client_id ad_user_id preparedstatement preparestatement setint getad_client_id getctx setint m_ad_user_id resultset executequery retvalue getint sqlexception retvalue open note window private void goto notes ad table id for ad note 389 hardcoded if m note menu id 0 m note menu id db getsql value null select ad menu id from ad menu m inner join ad table t on t ad window id m ad window id where t ad table id 389 if m note menu id 0 m note menu id 233 fallback hardcoded new a menu start item m note menu id true msg translate m ctx ad note id this start async load gotonotes ad_table_id ad_note m_note_menu_id m_note_menu_id getsqlvalue ad_menu_id ad_menu ad_table ad_window_id ad_window_id ad_table_id m_note_menu_id m_note_menu_id amenustartitem m_note_menu_id m_ctx ad_note_id ger number of open requests return number of requests private int get requests int ret value 0 if m requestsql null m requestsql m role get default add accesssql select count from r request where salesrep id or ad role id and processed n and date next action is null or trunc date next action trunc sys date and r status id is null or r status id in select r status id from r status where is closed n r request false true not qualified rw try prepared statement pstmt db prepare statement m requestsql null pstmt set int 1 m ad user id pstmt set int 2 m ad role id result set rs pstmt execute query if rs next ret value rs get int 1 rs close pstmt close catch sql exception e log log level severe m requestsql e return ret value getrequests retvalue m_requestsql m_requestsql mrole getdefault addaccesssql r_request salesrep_id ad_role_id datenextaction datenextaction sysdate r_status_id r_status_id r_status_id r_status isclosed r_request preparedstatement preparestatement m_requestsql setint m_ad_user_id setint m_ad_role_id resultset executequery retvalue getint sqlexception m_requestsql retvalue open request window private void goto requests ad table id for r request 417 hardcoded if m request menu id 0 goes to request all m request menu id db getsql value null select ad menu id from ad menu m inner join ad table t on t ad window id m ad window id where t ad table id 417 if m request menu id 0 m request menu id 237 my requests new a menu start item m request menu id true msg translate m ctx r request id this start async load gotorequests ad_table_id r_request m_request_menu_id m_request_menu_id getsqlvalue ad_menu_id ad_menu ad_table ad_window_id ad_window_id ad_table_id m_request_menu_id m_request_menu_id amenustartitem m_request_menu_id m_ctx r_request_id show memory info run gc if required update requests memos activities public void update info double total runtime get runtime total memory 1024 double free runtime get runtime free memory 1024 double used total free double percent used 100 total memory bar set maximum int total memory bar set value int used string msg message format format 0 number integer mb 1 number integer new object new big decimal total 1024 new big decimal percent memory bar set string msg msg message format format total memory 0 number integer kb free 1 number integer kb msg msg get msg m ctx memory info new object new big decimal total new big decimal free memory bar set tool tip text msg progress bar repaint if percent 50 system gc requests int requests get requests b requests set text msg translate m ctx r request id requests memo int notes get notes b notes set text msg translate m ctx ad note id notes activities int activities wf activity load activities center pane set title at m tabactivities msg get msg m ctx workflow activities activities log config msg processors runtime get runtime available processors requests requests notes notes activities activities c connection get get status m system get m ctx info updateinfo getruntime totalmemory getruntime freememory memorybar setmaximum memorybar setvalue messageformat bigdecimal bigdecimal memorybar setstring messageformat getmsg m_ctx memoryinfo bigdecimal bigdecimal memorybar settooltiptext progressbar getrequests brequests settext m_ctx r_request_id getnotes bnotes settext m_ctx ad_note_id wfactivity loadactivities centerpane settitleat m_tabactivities getmsg m_ctx workflowactivities getruntime availableprocessors cconnection getstatus msystem m_ctx start workflow activity param ad workflow id id protected void start work flow int ad workflow id center pane set selected index m tabworkflow switch wf panel load ad workflow id false ad_workflow_id startworkflow ad_workflow_id centerpane setselectedindex m_tabworkflow wfpanel ad_workflow_id change listener tab see javax swing event change listener state changed javax swing event change event param e event public void state changed change event e show activities if center pane get selected index m tabactivities wf activity display changelistener statechanged changeevent statechanged changeevent centerpane getselectedindex m_tabactivities wfactivity invoked when the mouse has been clicked on a component param e evant public void mouse clicked mouse event e if e get click count 1 system gc update info mouseclicked mouseevent getclickcount updateinfo os start param args array of string arguments ignored public static void main string args splash splash splash get splash compiere startup true needs to be here for ui a menu menu new a menu getsplash amenu amenu default constructor public v table super set autoscrolls true vtable setautoscrolls property change listener for current row selects the current row if not already selected required when navigating via buttons param evt event public void property change property change event evt log config evt if evt get property name equals m tab property int row integer evt get new value int value int sel row get selected row if row sel row return log config m tab property row from sel row set row selection interval row row rectangle cell rect get cell rect row 1 false if cell rect null scroll rect to visible cell rect log config m tab property row from sel row currentrow propertychange propertychangeevent getpropertyname mtab getnewvalue intvalue selrow getselectedrow selrow mtab selrow setrowselectioninterval cellrect getcellrect cellrect scrollrecttovisible cellrect mtab selrow get color code for row pre if numerical value in compare column is negative 1 positive 1 otherwise 0 pre param row row return color code public int get color code int row return m table get model get color code row colorcode getcolorcode mtable getmodel getcolorcode sort table param model column index model column sort index protected void sort int model column index int rows get row count if rows 0 return table model model get model if model instanceof m table super sort model column index return other sort column if model column index p lastsortindex p asc true else p asc p asc p lastsortindex model column index log config model column index rows rows asc p asc m table model sort model column index p asc table model fires sorted data status event which causes m tab to position to row 0 modelcolumnindex modelcolumnindex getrowcount tablemodel getmodel mtable modelcolumnindex modelcolumnindex p_lastsortindex p_asc p_asc p_asc p_lastsortindex modelcolumnindex modelcolumnindex p_asc mtable modelcolumnindex p_asc datastatus mtab transfer focus explicitly to editor due to editors with multiple components param row row param column column param e event return true if cell is editing public boolean edit cell at int row int column java util event object e if super edit cell at row column e return false log fine v table edit cell at r row c column object ed get cell editor if ed instanceof v editor component ed request focus else if ed instanceof v cell editor ed v cell editor ed get editor component ed request focus return true editcellat eventobject editcellat vtable editcellat getcelleditor veditor requestfocus vcelleditor vcelleditor geteditor requestfocus to string return string representation public string to string return new string buffer v table append get model append to string tostring tostring stringbuffer vtable getmodel tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals payment rule p paymentrule string para i get parameter else log log level severe prepare unknown parameter name p c payselection id getrecord id processinfoparameter getparameter getparametername getparameter paymentrule p_paymentrule getparameter p_c_payselection_id getrecord_id perrform process return message clear text throws exception if not successful protected string do it throws exception log info do it c payselection id p c payselection id payment rule p paymentrule m pay selection psel new m pay selection get ctx p c payselection id get trxname if psel get id 0 throw new illegal argument exception not found c payselection id p c payselection id if psel is processed throw new illegal argument exception processed if p paymentrule null throw new illegal argument exception no payment rule m pay selection line lines psel get lines false for int i 0 i lines length i m pay selection line line lines i if line is active line is processed continue create check line psel set processed true psel save return c payselectioncheck id m list size doit doit c_payselection_id p_c_payselection_id paymentrule p_paymentrule mpayselection mpayselection getctx p_c_payselection_id get_trxname get_id illegalargumentexception c_payselection_id p_c_payselection_id isprocessed illegalargumentexception p_paymentrule illegalargumentexception paymentrule mpayselectionline getlines mpayselectionline isactive isprocessed createcheck setprocessed c_payselectioncheck_id m_list create check from line param line private void create check m pay selection line line try to find one for int i 0 i m list size i m pay selection check check m pay selection check m list get i add to existing if check getc bpartner id line get invoice getc bpartner id check add line line if check save throw new illegal state exception cannot save m pay selection check line setc payselectioncheck id check getc payselectioncheck id line set processed true if line save throw new illegal state exception cannot save m pay selection line return create new m pay selection check check new m pay selection check line p paymentrule if check save throw new illegal state exception cannot save m pay selection check line setc payselectioncheck id check getc payselectioncheck id line set processed true if line save throw new illegal state exception cannot save m pay selection line m list add check createcheck mpayselectionline m_list mpayselectioncheck mpayselectioncheck m_list getc_bpartner_id getinvoice getc_bpartner_id addline illegalstateexception mpayselectioncheck setc_payselectioncheck_id getc_payselectioncheck_id setprocessed illegalstateexception mpayselectionline mpayselectioncheck mpayselectioncheck p_paymentrule illegalstateexception mpayselectioncheck setc_payselectioncheck_id getc_payselectioncheck_id setprocessed illegalstateexception mpayselectionline m_list initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception request servlet init servletexception servletconfig servletexception webenv initweb servletexception requestservlet get servlet information return info public string get servlet info return a dempiere web request servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request sends attachment param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr string url request details jsp http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter note id if is valid and belongs to wu then create pdf stream it string msg stream attachment request response if msg null msg length 0 return if info null info set message msg log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr requestdetails httpsession getsession getattribute removeattribute websessionctx hdr_message getattribute setmessage note_id streamattachment setmessage requestdispatcher getservletcontext getrequestdispatcher stream attachment param request request param response response return null or error message private string stream attachment http servlet request request http servlet response response get request id int r request id web util get parameter as int request p request id if r request id 0 log fine no r request id return no request id int attachment index web util get parameter as int request p attachment index if attachment index 0 log fine no index return no request attachment index log info r request id r request id attachment index get request properties ctx jsp env get ctx request m request doc new m request ctx r request id null if doc getr request id r request id log fine request not found r request id r request id return request not found m attachment attachment doc get attachment false if attachment null log fine no attachment for r request id r request id return request attachment not found get web user compare with invoice http session session request get session true web user wu web user session get attribute web user name if wu getad user id doc getad user id wu getad user id doc getsalesrep id else log warning r request id r request id web user wu getad user id ad user id doc getad user id salesrep id doc getsalesrep id return your request not found stream it return web util stream attachment response attachment attachment index streamattachment httpservletrequest httpservletresponse r_request_id webutil getparameterasint p_request_id r_request_id r_request_id attachmentindex webutil getparameterasint p_attachment_index attachmentindex r_request_id r_request_id attachmentindex jspenv getctx mrequest mrequest r_request_id getr_request_id r_request_id r_request_id r_request_id mattachment getattachment r_request_id r_request_id webuser httpsession getsession webuser webuser getattribute webuser getad_user_id getad_user_id getad_user_id getsalesrep_id r_request_id r_request_id web_user getad_user_id ad_user_id getad_user_id salesrep_id getsalesrep_id webutil streamattachment attachmentindex process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception string content type request get content type log info from request get remote host request get remote addr content type get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to request jsp entry return if content type null content type index of multipart form data 1 upload file request response return addl info string requesturl request get requesturl to string string request ref request get header referer string source web util get parameter request p source string info web util get parameter request p info string forward to web util get parameter request p forwardto log fine referer request ref source source forward to forward to if requesturl null requesturl if requesturl equals request ref if url and referrer are the same get source request ref source source null int ad client id env get context as int ctx ad client id int r requesttype id web util get parameter as int request p requesttype id int c order id web util get parameter as int request p ref order id int r request id web util get parameter as int request p request id int salesrep id web util get parameter as int request p salesrep id if salesrep id 0 m user is sales rep salesrep id log warning invalid set to 0 salesrep id salesrep id salesrep id 0 the text string summary web util get parameter request p summary if summary null summary length 0 web util create error page request response this no data received return boolean is confidential web util get parameter as boolean request p confidential boolean is close web util get parameter as boolean request p close boolean is escalate web util get parameter as boolean request p escalate m request req null new self service request if r request id 0 req new m request ctx salesrep id r requesttype id summary true null req setc bpartner id wu getc bpartner id req setad user id wu getad user id if c order id 0 req setc order id c order id if is confidential req set confidential type m request confidentialtype customerconfidential string buffer sb new string buffer sb append from append request get remote host append append request get remote addr sb append request append requesturl append append request ref if source null sb append append source sb append append info sb append user append request get header accept language append append request get header user agent req set last result sb to string if req save log log level severe new request not saved web util create error page request response this request save error shorten text return else existing request req new m request ctx r request id null if req get id 0 log log level severe request not found r request id r request id web util create error page request response this request not found return update info if c order id 0 req getc order id 0 req setc order id c order id if req web update summary web util create error page request response this request cannot be updated return flags if is confidential req set confidential type entry m request confidentialtypeentry customerconfidential if is close req do close else if is escalate boolean is user req getc bpartner id wu getc bpartner id if is user wu is sales rep allow only user or sales rep to escalate req do escalate is user if req save log log level severe request action error web util create error page request response this request process error return requests send e mail to customer string buffer message new string buffer req get summary string result req get result if result null result length 0 message append n n append req get result jsp env sende mail request wu m mail msg mailmsgtype request new object req get document no wu get name message n req get mail tag fini string web storeurl http request get server name request get context path if forward to null forward to length 0 forward to request ref if forward to null forward to index of request jsp 1 forward to index of request details jsp 1 forward to requests jsp list of requests if forward to null forward to length 0 forward to web storeurl if forward to index of servlet 1 forward to web storeurl web util create forward page response web request received thanks forward to 10 servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception contenttype getcontenttype getremotehost getremoteaddr contenttype httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser sendredirect loginservlet forwardto contenttype contenttype indexof uploadfile getrequesturl tostring requestref getheader webutil getparameter p_source webutil getparameter p_info forwardto webutil getparameter p_forwardto requestref forwardto forwardto requestref requestref ad_client_id getcontextasint ad_client_id r_requesttype_id webutil getparameterasint p_requesttype_id c_order_id webutil getparameterasint p_ref_order_id r_request_id webutil getparameterasint p_request_id salesrep_id webutil getparameterasint p_salesrep_id salesrep_id muser issalesrep salesrep_id salesrep_id salesrep_id salesrep_id webutil getparameter p_summary webutil createerrorpage isconfidential webutil getparameterasboolean p_confidential isclose webutil getparameterasboolean p_close isescalate webutil getparameterasboolean p_escalate mrequest selfservice r_request_id mrequest salesrep_id r_requesttype_id setc_bpartner_id getc_bpartner_id setad_user_id getad_user_id c_order_id setc_order_id c_order_id isconfidential setconfidentialtype mrequest confidentialtype_customerconfidential stringbuffer stringbuffer getremotehost getremoteaddr requestref getheader getheader setlastresult tostring webutil createerrorpage mrequest r_request_id get_id r_request_id r_request_id webutil createerrorpage c_order_id getc_order_id setc_order_id c_order_id webupdate webutil createerrorpage isconfidential setconfidentialtypeentry mrequest confidentialtypeentry_customerconfidential isclose doclose isescalate isuser getc_bpartner_id getc_bpartner_id isuser issalesrep doescalate isuser webutil createerrorpage email stringbuffer stringbuffer getsummary getresult getresult jspenv sendemail mmailmsg mailmsgtype_request getdocumentno getname getmailtag webstoreurl getservername getcontextpath forwardto forwardto forwardto requestref forwardto forwardto indexof forwardto indexof requestdetails forwardto forwardto forwardto forwardto webstoreurl forwardto indexof forwardto webstoreurl webutil createforwardpage forwardto upload file param request request param response response throws servlet exception throws io exception private void upload file http servlet request request http servlet response response throws servlet exception io exception file upload upload new file upload request string error upload get error if error null web util create forward page response error requests jsp 10 return properties ctx jsp env get ctx request get request int r request id upload get parameter as int r request id m request req null if r request id 0 req new m request ctx r request id null if r request id 0 req null req get id r request id web util create forward page response request not found requests jsp 10 return if req is web can update web util create forward page response request cannot be updated requests jsp 10 return string file name upload get file name log fine r request id r request id file name add attachment m attachment attachment req create attachment attachment add entry file name upload get data if attachment save string msg msg parse translation ctx added ad attachment id file name req web update msg req save web util create forward page response msg requests jsp 10 else web util create forward page response file upload error please try again requests jsp 10 log fine attachment to string servletexception ioexception uploadfile httpservletrequest httpservletresponse servletexception ioexception fileupload fileupload geterror webutil createforwardpage jspenv getctx r_request_id getparameterasint r_request_id mrequest r_request_id mrequest r_request_id r_request_id get_id r_request_id webutil createforwardpage iswebcanupdate webutil createforwardpage filename getfilename r_request_id r_request_id filename mattachment createattachment addentry filename getdata parsetranslation ad_attachment_id filename webupdate webutil createforwardpage webutil createforwardpage tostring ide bean constructor public v line this vline constructor param header public v line string header super set header header vline setheader paint border param c the component for which this border is being painted param g the paint graphics param x the x position of the painted border param y the y position of the painted border param w the width of the painted border param h the height of the painted border public void paint border component c graphics g int x int y int w int h graphics copy g create if copy null try copy translate x y paint line c copy w h finally copy dispose paintborder paintline paint line with header param c param g param w param h private void paint line component c graphics g int w int h int y h space line g set color color dark gray g draw line gap y w gap y g set color color white g draw line gap y 1 w gap y 1 last part of line if m header null m header length 0 return header text g set color m color g set font m font int x gap if language get login language is left to right g draw string m header gap h space 1 paintline setcolor darkgray drawline setcolor drawline m_header m_header setcolor m_color setfont m_font getloginlanguage islefttoright drawstring m_header set header param new header string are replaced by spaces public void set header string new header m header new header replace newheader _ setheader newheader m_header newheader _ get header return header string public string get header return m header getheader m_header configvm sun public configvm sun configuration data data super data configvmsun configvmsun configurationdata init public void init java home e g d j2sdk1 4 1 jre string java home system get property java home log fine java home if java home ends with jre java home java home substring 0 java home length 4 p data set java home java home javahome getproperty javahome javahome endswith javahome javahome javahome p_data setjavahome javahome test return error message or null of ok public string test java home file java home new file p data get java home boolean pass java home exists string error not found java home signalok get panel ok java home error java home pass true error if pass return error look for tools jar to make sure that it is not the jre file tools new file p data get java home file separator lib file separator tools jar pass tools exists error not found java sdk tools signalok get panel ok java home error java home pass true error if pass return error if c log mgt is level finest c log mgt print properties system get properties system true log info ok java home java home get absolute path set property configuration data java home java home get absolute path system set property configuration data java home java home get absolute path java version final string version 1 5 0 final string version2 1 5 0 the real one pass false string jh java home get absolute path if jh index of version 1 file name has version assuming ok pass true if pass jh index of version2 1 pass true string thisjh system get property java home if thisjh index of jh 1 we are running the version currently string thisjv system get property java version pass thisjv index of version 1 if pass thisjv index of version2 1 pass true if pass log info ok version thisjv error wrong java version should be version2 signalok get panel ok java home error java home pass true error if pass return error set property configuration data java type p data get java type return null javahome p_data getjavahome javahome getpanel okjavahome errorjavahome p_data getjavahome getpanel okjavahome errorjavahome clogmgt islevelfinest clogmgt printproperties getproperties javahome javahome getabsolutepath setproperty configurationdata java_home javahome getabsolutepath setproperty configurationdata java_home javahome getabsolutepath javahome getabsolutepath indexof indexof getproperty indexof getproperty indexof indexof getpanel okjavahome errorjavahome setproperty configurationdata java_type p_data getjavatype constructor param is hour hour field param is12 hour 12 hour format public m doc time boolean is hour boolean is12 hour super m ishour is hour m is12hour is12 hour ishour is12hour mdoctime ishour is12hour m_ishour ishour m_is12hour is12hour insert string param offset offset param string string param attr attributes throws bad location exception public void insert string int offset string string attribute set attr throws bad location exception log fine m doc time insert string offset offset string string attr attr text get text length get text length manual entry db text data binder update text sends stuff at once if string null string length 1 ignore if too long if offset 2 return is it a digit if character is digit string char at 0 log config no digit string return resulting string char cc get text to char array cc offset string char at 0 string result new string cc int i 0 try i integer parse int result trim catch exception e log log level severe e to string if i 0 log config invalid value i return minutes if m ishour i 59 log config invalid minute value i return hour if m ishour m is12hour i 12 log config invalid 12 hour value i return if m ishour m is12hour i 24 log config invalid 24 hour value i return super remove offset 1 replace current position set new character super insert string offset string attr badlocationexception insertstring attributeset badlocationexception mdoctime insertstring gettext gettext dbtextdatabinder updatetext isdigit charat gettext tochararray charat parseint tostring m_ishour m_ishour m_is12hour m_ishour m_is12hour insertstring delete string param offset offset param length length throws bad location exception public void remove int offset int length throws bad location exception log fine m doc time remove offset offset length length super remove offset length badlocationexception badlocationexception mdoctime get full text always two character return text private string get text string buffer sb new string buffer try sb append get content get string 0 get content length 1 cr at end catch exception e while sb length 2 sb insert 0 return sb to string gettext stringbuffer stringbuffer getcontent getstring getcontent tostring constructor param frame frame param title title param m account account info param c acctschema id as public v account dialog frame frame string title m account lookup m account int c acctschema id super frame title true log config c acctschema id c acctschema id c validcombination id m account c validcombination id m maccount m account m c acctschema id c acctschema id m windowno env create window no this set default close operation j dialog dispose on close try jb init catch exception ex log log level severe ex to string if init account a env show center window frame this else dispose maccount c_acctschema_id vaccountdialog maccountlookup maccount c_acctschema_id c_acctschema_id c_acctschema_id c_validcombination_id maccount c_validcombination_id m_maccount maccount m_c_acctschema_id c_acctschema_id m_windowno createwindowno setdefaultcloseoperation jdialog dispose_on_close jbinit tostring initaccount aenv showcenterwindow static component init pre panel north panel parameter panel tool bar grid controller confirm panel status bar pre throws exception void jb init throws exception titled border new titled border border factory create etched border color white new color 134 134 134 parameter panel layout set hgap 5 panel layout set vgap 5 north layout set hgap 5 north layout set vgap 5 parameter panel set layout parameter layout parameter panel set border titled border north panel set layout north layout tool bar set orientation j tool bar vertical tool bar set border null tool bar set request focus enabled false tool bar set border painted false tool bar set margin new insets 5 5 5 5 b save set icon new image icon org compiere compiere class get resource images save24 gif b save set margin new insets 2 2 2 2 b save set tool tip text msg get msg env get ctx account new update b save add action listener this b refresh set icon new image icon org compiere compiere class get resource images refresh24 gif b refresh set margin new insets 2 2 2 2 b refresh set tool tip text msg get msg env get ctx refresh b refresh add action listener this b ignore set icon new image icon org compiere compiere class get resource images ignore24 gif b ignore set margin new insets 2 2 2 2 b ignore set tool tip text msg get msg env get ctx ignore b ignore add action listener this tool bar add separator tool bar add b refresh null tool bar add b ignore null tool bar add b save null get content pane add panel panel set layout panel layout panel add confirm panel border layout south panel add north panel border layout north north panel add parameter panel border layout center north panel add tool bar border layout east this get content pane add status bar border layout south confirm panel add action listener this northpanel parameterpanel toolbar gridcontroller confirmpanel statusbar jbinit titledborder titledborder borderfactory createetchedborder panellayout sethgap panellayout setvgap northlayout sethgap northlayout setvgap parameterpanel setlayout parameterlayout parameterpanel setborder titledborder northpanel setlayout northlayout toolbar setorientation jtoolbar toolbar setborder toolbar setrequestfocusenabled toolbar setborderpainted toolbar setmargin bsave seticon imageicon getresource bsave setmargin bsave settooltiptext getmsg getctx accountnewupdate bsave addactionlistener brefresh seticon imageicon getresource brefresh setmargin brefresh settooltiptext getmsg getctx brefresh addactionlistener bignore seticon imageicon getresource bignore setmargin bignore settooltiptext getmsg getctx bignore addactionlistener toolbar addseparator toolbar brefresh toolbar bignore toolbar bsave getcontentpane setlayout panellayout confirmpanel borderlayout northpanel borderlayout northpanel parameterpanel borderlayout northpanel toolbar borderlayout getcontentpane statusbar borderlayout confirmpanel addactionlistener dyanmic init when a row is selected the editor values are set editors do not change grid return true if initialized private boolean init account m ad client id env get context as int env get ctx m windowno ad client id get acct schema info if s acctschema null s acctschema getc acctschema id m c acctschema id s acctschema new m acct schema env get ctx m c acctschema id null log config s acctschema to string s acctschema get acct schema elements length env set context env get ctx m windowno c acctschema id m c acctschema id model int ad window id 153 maintain account combinations m windowvo wvo a env getm windowvo m windowno ad window id 0 if wvo null return false m mwindow new m window wvo m mtab m mwindow get tab 0 parameter panel restrictions m mtab get field alias set display length 15 m mtab get field combination set display length 15 grid restrictions m mtab get field ad client id set displayed false m mtab get field c acctschema id set displayed false m mtab get field is active set displayed false m mtab get field is fully qualified set displayed false don t show fields not being displayed in this environment for int i 0 i m mtab get field count i m field field m mtab get field i if field is displayed true check context field set displayed false grid controller m gridcontroller new grid controller m gridcontroller init grid m mtab true m windowno null null m gridcontroller set preferred size new dimension 300 100 panel add m gridcontroller border layout center prepare parameter m gbc anchor grid bag constraints northwest m gbc gridy 0 line m gbc gridx 0 m gbc gridwidth 1 m gbc insets m fieldinsets m gbc fill grid bag constraints horizontal m gbc weightx 0 m gbc weighty 0 int tab no 0 alias if s acctschema is has alias m field alias m mtab get field alias f alias v editor factory get editor m mtab alias false add line alias f alias false alias combination m field combination m mtab get field combination f combination v editor factory get editor m mtab combination false add line combination f combination false m newrow true create fields in element order m acct schema element elements s acctschema get acct schema elements for int i 0 i elements length i m acct schema element ase elements i string type ase get element type boolean is mandatory ase is mandatory if type equals m acct schema element elementtype organization m field field m mtab get field ad org id f ad org id v editor factory get editor m mtab field false add line field f ad org id is mandatory else if type equals m acct schema element elementtype account m field field m mtab get field account id f account id v editor factory get editor m mtab field false v lookup f account id set width 400 add line field f account id is mandatory f account id add vetoable change listener this else if type equals m acct schema element elementtype subaccount m field field m mtab get field c subacct id f subacct id v editor factory get editor m mtab field false v lookup f subacct id set width 400 add line field f subacct id is mandatory else if type equals m acct schema element elementtype product m field field m mtab get field m product id f m product id v editor factory get editor m mtab field false add line field f m product id is mandatory else if type equals m acct schema element elementtype bpartner m field field m mtab get field c bpartner id f c bpartner id v editor factory get editor m mtab field false add line field f c bpartner id is mandatory else if type equals m acct schema element elementtype campaign m field field m mtab get field c campaign id f c campaign id v editor factory get editor m mtab field false add line field f c campaign id is mandatory else if type equals m acct schema element elementtype locationfrom m field field m mtab get field c locfrom id f c locfrom id v editor factory get editor m mtab field false add line field f c locfrom id is mandatory else if type equals m acct schema element elementtype locationto m field field m mtab get field c locto id f c locto id v editor factory get editor m mtab field false add line field f c locto id is mandatory else if type equals m acct schema element elementtype project m field field m mtab get field c project id f c project id v editor factory get editor m mtab field false add line field f c project id is mandatory else if type equals m acct schema element elementtype salesregion m field field m mtab get field c salesregion id f c salesregion id v editor factory get editor m mtab field false add line field f c salesregion id is mandatory else if type equals m acct schema element elementtype orgtrx m field field m mtab get field ad orgtrx id f ad orgtrx id v editor factory get editor m mtab field false add line field f ad orgtrx id is mandatory else if type equals m acct schema element elementtype activity m field field m mtab get field c activity id f c activity id v editor factory get editor m mtab field false add line field f c activity id is mandatory user1 else if type equals m acct schema element elementtype userlist1 m field field m mtab get field user1 id f user1 id v editor factory get editor m mtab field false add line field f user1 id is mandatory else if type equals m acct schema element elementtype userlist2 m field field m mtab get field user2 id f user2 id v editor factory get editor m mtab field false add line field f user2 id is mandatory create fields in element order add description m newrow true m gbc gridy m line m gbc gridx 0 m gbc gridwidth 4 m gbc insets new insets 5 15 2 0 top left bottom right m gbc fill grid bag constraints horizontal f description set font f description get font derive font font italic parameter panel add f description m gbc finish m query new m query m query add restriction c acctschema id m query equal m c acctschema id m query add restriction is fully qualified m query equal y if m maccount c validcombination id 0 m mtab set query m query get equal query 1 2 else m query query new m query query add restriction c acctschema id m query equal m c acctschema id query add restriction c validcombination id m query equal m maccount c validcombination id m mtab set query query m mtab query false m gridcontroller get table add mouse listener new vaccountdialog mouseadapter this m gridcontroller add data status listener this status bar set status line s acctschema to string status bar set statusdb initial value if m maccount c validcombination id 0 m mtab navigate 0 log config fini return true initaccount m_ad_client_id getcontextasint getctx m_windowno ad_client_id acctschema s_acctschema s_acctschema getc_acctschema_id m_c_acctschema_id s_acctschema macctschema getctx m_c_acctschema_id s_acctschema tostring s_acctschema getacctschemaelements setcontext getctx m_windowno c_acctschema_id m_c_acctschema_id ad_window_id mwindowvo aenv getmwindowvo m_windowno ad_window_id m_mwindow mwindow m_mtab m_mwindow gettab parameterpanel m_mtab getfield setdisplaylength m_mtab getfield setdisplaylength m_mtab getfield ad_client_id setdisplayed m_mtab getfield c_acctschema_id setdisplayed m_mtab getfield isactive setdisplayed m_mtab getfield isfullyqualified setdisplayed m_mtab getfieldcount mfield m_mtab getfield isdisplayed setdisplayed gridcontroller m_gridcontroller gridcontroller m_gridcontroller initgrid m_mtab m_windowno m_gridcontroller setpreferredsize m_gridcontroller borderlayout m_gbc gridbagconstraints m_gbc m_gbc m_gbc m_gbc m_fieldinsets m_gbc gridbagconstraints m_gbc m_gbc tabno s_acctschema ishasalias mfield m_mtab getfield f_alias veditorfactory geteditor m_mtab addline f_alias mfield m_mtab getfield f_combination veditorfactory geteditor m_mtab addline f_combination m_newrow macctschemaelement s_acctschema getacctschemaelements macctschemaelement getelementtype ismandatory ismandatory macctschemaelement elementtype_organization mfield m_mtab getfield ad_org_id f_ad_org_id veditorfactory geteditor m_mtab addline f_ad_org_id ismandatory macctschemaelement elementtype_account mfield m_mtab getfield account_id f_account_id veditorfactory geteditor m_mtab vlookup f_account_id setwidth addline f_account_id ismandatory f_account_id addvetoablechangelistener macctschemaelement elementtype_subaccount mfield m_mtab getfield c_subacct_id f_subacct_id veditorfactory geteditor m_mtab vlookup f_subacct_id setwidth addline f_subacct_id ismandatory macctschemaelement elementtype_product mfield m_mtab getfield m_product_id f_m_product_id veditorfactory geteditor m_mtab addline f_m_product_id ismandatory macctschemaelement elementtype_bpartner mfield m_mtab getfield c_bpartner_id f_c_bpartner_id veditorfactory geteditor m_mtab addline f_c_bpartner_id ismandatory macctschemaelement elementtype_campaign mfield m_mtab getfield c_campaign_id f_c_campaign_id veditorfactory geteditor m_mtab addline f_c_campaign_id ismandatory macctschemaelement elementtype_locationfrom mfield m_mtab getfield c_locfrom_id f_c_locfrom_id veditorfactory geteditor m_mtab addline f_c_locfrom_id ismandatory macctschemaelement elementtype_locationto mfield m_mtab getfield c_locto_id f_c_locto_id veditorfactory geteditor m_mtab addline f_c_locto_id ismandatory macctschemaelement elementtype_project mfield m_mtab getfield c_project_id f_c_project_id veditorfactory geteditor m_mtab addline f_c_project_id ismandatory macctschemaelement elementtype_salesregion mfield m_mtab getfield c_salesregion_id f_c_salesregion_id veditorfactory geteditor m_mtab addline f_c_salesregion_id ismandatory macctschemaelement elementtype_orgtrx mfield m_mtab getfield ad_orgtrx_id f_ad_orgtrx_id veditorfactory geteditor m_mtab addline f_ad_orgtrx_id ismandatory macctschemaelement elementtype_activity mfield m_mtab getfield c_activity_id f_c_activity_id veditorfactory geteditor m_mtab addline f_c_activity_id ismandatory macctschemaelement elementtype_userlist1 mfield m_mtab getfield user1_id f_user1_id veditorfactory geteditor m_mtab addline f_user1_id ismandatory macctschemaelement elementtype_userlist2 mfield m_mtab getfield user2_id f_user2_id veditorfactory geteditor m_mtab addline f_user2_id ismandatory m_newrow m_gbc m_line m_gbc m_gbc m_gbc m_gbc gridbagconstraints f_description setfont f_description getfont derivefont parameterpanel f_description m_gbc m_query mquery m_query addrestriction c_acctschema_id mquery m_c_acctschema_id m_query addrestriction isfullyqualified mquery m_maccount c_validcombination_id m_mtab setquery mquery getequalquery mquery mquery addrestriction c_acctschema_id mquery m_c_acctschema_id addrestriction c_validcombination_id mquery m_maccount c_validcombination_id m_mtab setquery m_mtab m_gridcontroller gettable addmouselistener vaccountdialog_mouseadapter m_gridcontroller adddatastatuslistener statusbar setstatusline s_acctschema tostring statusbar setstatusdb m_maccount c_validcombination_id m_mtab add editor to parameter panel alernative right left depending on m newrow field value changes update editors param field field param editor editor param mandatory mandatory private void add line m field field v editor editor boolean mandatory log fine field field j label label v editor factory get label field label set label for component editor editor set read write true editor set mandatory mandatory m field v editor field add property change listener editor label if m newrow m gbc gridy m line m gbc gridx 0 else m gbc gridx 2 m gbc insets m labelinsets m gbc fill grid bag constraints horizontal m gbc weightx 0 parameter panel add label m gbc field if m newrow m gbc gridx 1 else m gbc gridx 3 m gbc insets m fieldinsets m gbc fill grid bag constraints horizontal m gbc weightx 1 parameter panel add component editor m gbc m newrow m newrow parameterpanel m_newrow addline mfield veditor jlabel veditorfactory getlabel setlabelfor setreadwrite setmandatory mfield veditor addpropertychangelistener m_newrow m_gbc m_line m_gbc m_gbc m_gbc m_labelinsets m_gbc gridbagconstraints m_gbc parameterpanel m_gbc m_newrow m_gbc m_gbc m_gbc m_fieldinsets m_gbc gridbagconstraints m_gbc parameterpanel m_gbc m_newrow m_newrow load information param c validcombination id valid combination param c acctschema id acct schema private void load info int c validcombination id int c acctschema id log fine c validcombination id c validcombination id string sql select from c validcombination where c validcombination id and c acctschema id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c validcombination id pstmt set int 2 c acctschema id result set rs pstmt execute query if rs next if f alias null f alias set value rs get string alias f combination set value rs get string combination load info of rs f ad org id ad org id load info of rs f account id account id load info of rs f subacct id c subacct id load info of rs f m product id m product id load info of rs f c bpartner id c bpartner id load info of rs f c campaign id c campaign id load info of rs f c locfrom id c locfrom id load info of rs f c locto id c locto id load info of rs f c project id c project id load info of rs f c salesregion id c salesregion id load info of rs f ad orgtrx id ad orgtrx id load info of rs f c activity id c activity id load info of rs f user1 id user1 id load info of rs f user2 id user2 id f description set text rs get string description rs close pstmt close catch sql exception e log log level severe sql e c_validcombination_id c_acctschema_id loadinfo c_validcombination_id c_acctschema_id c_validcombination_id c_validcombination_id c_validcombination c_validcombination_id c_acctschema_id preparedstatement preparestatement setint c_validcombination_id setint c_acctschema_id resultset executequery f_alias f_alias setvalue getstring f_combination setvalue getstring loadinfoof f_ad_org_id ad_org_id loadinfoof f_account_id account_id loadinfoof f_subacct_id c_subacct_id loadinfoof f_m_product_id m_product_id loadinfoof f_c_bpartner_id c_bpartner_id loadinfoof f_c_campaign_id c_campaign_id loadinfoof f_c_locfrom_id c_locfrom_id loadinfoof f_c_locto_id c_locto_id loadinfoof f_c_project_id c_project_id loadinfoof f_c_salesregion_id c_salesregion_id loadinfoof f_ad_orgtrx_id ad_orgtrx_id loadinfoof f_c_activity_id c_activity_id loadinfoof f_user1_id user1_id loadinfoof f_user2_id user2_id f_description settext getstring sqlexception set value of editor param rs result set param editor editor param name name throws sql exception private void load info of result set rs v editor editor string name throws sql exception if editor null return int int value rs get int name if rs was null editor set value null else editor set value new integer int value sqlexception loadinfoof resultset veditor sqlexception intvalue getint wasnull setvalue setvalue intvalue dispose public void dispose save selection grid controller if m gridcontroller null m gridcontroller dispose m gridcontroller null model m mtab null if m mwindow null m mwindow dispose m mwindow null remove all env clear win context m windowno super dispose saveselection gridcontroller m_gridcontroller m_gridcontroller m_gridcontroller m_mtab m_mwindow m_mwindow m_mwindow removeall clearwincontext m_windowno save selection private void save selection if m changed m gridcontroller null int row m gridcontroller get table get selected row if row 0 m c validcombination id integer m mtab get value row c validcombination id int value log config row m c validcombination id saveselection m_changed m_gridcontroller m_gridcontroller gettable getselectedrow m_c_validcombination_id m_mtab getvalue c_validcombination_id intvalue m_c_validcombination_id action listener param e event public void action performed action event e if e get action command equals confirm panel a ok m changed true dispose else if e get action command equals confirm panel a cancel m changed false dispose else if e get source b save action save else if e get source b ignore action ignore all other else action find true actionlistener actionperformed actionevent getactioncommand confirmpanel a_ok m_changed getactioncommand confirmpanel a_cancel m_changed getsource bsave action_save getsource bignore action_ignore action_find status change listener param e event public void data status changed data status event e log config e to string string info string m mtab get value description f description set text info log info field m mtab get value ad org id editor f ad org id get value if f ad org id get value null f ad org id set value m mtab get value ad org id datastatuschanged datastatusevent tostring m_mtab getvalue f_description settext m_mtab getvalue ad_org_id f_ad_org_id getvalue f_ad_org_id getvalue f_ad_org_id setvalue m_mtab getvalue ad_org_id action find create where clause query database param include alias combination include alias combination private void action find boolean include alias combination log info set cursor cursor get predefined cursor cursor wait cursor create where clause m query query null if m query null query m query deep copy else query new m query alias if include alias combination f alias null f alias get value to string length 0 string value f alias get value to string to upper case if value ends with value query add restriction upper alias m query like value combination mandatory if include alias combination f combination get value to string length 0 string value f combination get value to string to upper case if value ends with value query add restriction upper combination m query like value org mandatory if f ad org id null f ad org id get value null query add restriction ad org id m query equal f ad org id get value account mandatory if f account id null f account id get value null query add restriction account id m query equal f account id get value if f subacct id null f subacct id get value null query add restriction c subacct id m query equal f subacct id get value product if f m product id null f m product id get value null query add restriction m product id m query equal f m product id get value b partner if f c bpartner id null f c bpartner id get value null query add restriction c bpartner id m query equal f c bpartner id get value campaign if f c campaign id null f c campaign id get value null query add restriction c campaign id m query equal f c campaign id get value loc from if f c locfrom id null f c locfrom id get value null query add restriction c locfrom id m query equal f c locfrom id get value loc to if f c locto id null f c locto id get value null query add restriction c locto id m query equal f c locto id get value project if f c project id null f c project id get value null query add restriction c project id m query equal f c project id get value s region if f c salesregion id null f c salesregion id get value null query add restriction c salesregion id m query equal f c salesregion id get value org trx if f ad orgtrx id null f ad orgtrx id get value null query add restriction ad orgtrx id m query equal f ad orgtrx id get value activity if f c activity id null f c activity id get value null query add restriction c activity id m query equal f c activity id get value user 1 if f user1 id null f user1 id get value null query add restriction user1 id m query equal f user1 id get value user 2 if f user2 id null f user2 id get value null query add restriction user2 id m query equal f user2 id get value query m mtab set query query m mtab query false status bar set statusdb string value of m mtab get row count set cursor cursor get default cursor includealiascombination action_find includealiascombination setcursor getpredefinedcursor wait_cursor mquery m_query m_query deepcopy mquery includealiascombination f_alias f_alias getvalue tostring f_alias getvalue tostring touppercase endswith addrestriction mquery includealiascombination f_combination getvalue tostring f_combination getvalue tostring touppercase endswith addrestriction mquery f_ad_org_id f_ad_org_id getvalue addrestriction ad_org_id mquery f_ad_org_id getvalue f_account_id f_account_id getvalue addrestriction account_id mquery f_account_id getvalue f_subacct_id f_subacct_id getvalue addrestriction c_subacct_id mquery f_subacct_id getvalue f_m_product_id f_m_product_id getvalue addrestriction m_product_id mquery f_m_product_id getvalue bpartner f_c_bpartner_id f_c_bpartner_id getvalue addrestriction c_bpartner_id mquery f_c_bpartner_id getvalue f_c_campaign_id f_c_campaign_id getvalue addrestriction c_campaign_id mquery f_c_campaign_id getvalue f_c_locfrom_id f_c_locfrom_id getvalue addrestriction c_locfrom_id mquery f_c_locfrom_id getvalue f_c_locto_id f_c_locto_id getvalue addrestriction c_locto_id mquery f_c_locto_id getvalue f_c_project_id f_c_project_id getvalue addrestriction c_project_id mquery f_c_project_id getvalue sregion f_c_salesregion_id f_c_salesregion_id getvalue addrestriction c_salesregion_id mquery f_c_salesregion_id getvalue f_ad_orgtrx_id f_ad_orgtrx_id getvalue addrestriction ad_orgtrx_id mquery f_ad_orgtrx_id getvalue f_c_activity_id f_c_activity_id getvalue addrestriction c_activity_id mquery f_c_activity_id getvalue f_user1_id f_user1_id getvalue addrestriction user1_id mquery f_user1_id getvalue f_user2_id f_user2_id getvalue addrestriction user2_id mquery f_user2_id getvalue m_mtab setquery m_mtab statusbar setstatusdb valueof m_mtab getrowcount setcursor getdefaultcursor create save account private void action save log info check completeness mandatory fields and for duplicates string buffer sb new string buffer string buffer sql new string buffer select c validcombination id alias from c validcombination where object value null if s acctschema is has alias value f alias get value to string if value null sb append msg translate env get ctx alias append m acct schema element elements s acctschema get acct schema elements for int i 0 i elements length i m acct schema element ase elements i string type ase get element type if type equals m acct schema element elementtype organization value f ad org id get value sql append ad org id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype account value f account id get value sql append account id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype subaccount value f subacct id get value sql append c subacct id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype product value f m product id get value sql append m product id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype bpartner value f c bpartner id get value sql append c bpartner id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype campaign value f c campaign id get value sql append c campaign id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype locationfrom value f c locfrom id get value sql append c locfrom id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype locationto value f c locto id get value sql append c locto id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype project value f c project id get value sql append c project id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype salesregion value f c salesregion id get value sql append c salesregion id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype orgtrx value f ad orgtrx id get value sql append ad orgtrx id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype activity value f c activity id get value sql append c activity id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype userlist1 value f user1 id get value sql append user1 id if value null sql append is null and else sql append append value append and else if type equals m acct schema element elementtype userlist2 value f user2 id get value sql append user2 id if value null sql append is null and else sql append append value append and if ase is mandatory value null sb append ase get name append fields in element order if sb length 0 a dialog error m windowno this fill mandatory sb substring 0 sb length 2 return if f ad org id null f ad org id get value null a dialog error m windowno this fill mandatory msg get element env get ctx ad org id return if f account id null f account id get value null a dialog error m windowno this fill mandatory msg get element env get ctx account id return check if already exists sql append ad client id and c acctschema id log fine check sql to string int i dvalue 0 string alias null try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m ad client id pstmt set int 2 s acctschema getc acctschema id result set rs pstmt execute query if rs next i dvalue rs get int 1 alias rs get string 2 rs close pstmt close catch sql exception e log log level severe sql to string e i dvalue 0 log fine id i dvalue alias alias if alias null alias we have an account like this already check alias if i dvalue 0 s acctschema is has alias f alias get value to string equals alias sql new string buffer update c validcombination set alias if f alias get value to string length 0 sql append null else sql append append f alias get value append sql append where c validcombination id append i dvalue int i 0 try java sql statement stmt db create statement i stmt execute update sql to string stmt close catch sql exception e log log level severe sql to string e if i 0 a dialog error m windowno this account not updated load and display if i dvalue 0 load info i dvalue s acctschema getc acctschema id action find false return log config new alias null if f alias null alias f alias get value to string int c subacct id 0 if f subacct id null f subacct id get value null c subacct id integer f subacct id get value int value int m product id 0 if f m product id null f m product id get value null m product id integer f m product id get value int value int c bpartner id 0 if f c bpartner id null f c bpartner id get value null c bpartner id integer f c bpartner id get value int value int ad orgtrx id 0 if f ad orgtrx id null f ad orgtrx id get value null ad orgtrx id integer f ad orgtrx id get value int value int c locfrom id 0 if f c locfrom id null f c locfrom id get value null c locfrom id integer f c locfrom id get value int value int c locto id 0 if f c locto id null f c locto id get value null c locto id integer f c locto id get value int value int c sregion id 0 if f c salesregion id null f c salesregion id get value null c sregion id integer f c salesregion id get value int value int c project id 0 if f c project id null f c project id get value null c project id integer f c project id get value int value int c campaign id 0 if f c campaign id null f c campaign id get value null c campaign id integer f c campaign id get value int value int c activity id 0 if f c activity id null f c activity id get value null c activity id integer f c activity id get value int value int user1 id 0 if f user1 id null f user1 id get value null user1 id integer f user1 id get value int value int user2 id 0 if f user2 id null f user2 id get value null user2 id integer f user2 id get value int value m account acct m account get env get ctx m ad client id integer f ad org id get value int value s acctschema getc acctschema id integer f account id get value int value c subacct id m product id c bpartner id ad orgtrx id c locfrom id c locto id c sregion id c project id c campaign id c activity id user1 id user2 id 0 0 if acct null acct get id 0 acct save show info if acct null acct get id 0 load info 0 0 else update account with optional alias if alias null alias length 0 acct set alias alias acct save load info acct get id s acctschema getc acctschema id action find false action_save stringbuffer stringbuffer stringbuffer stringbuffer c_validcombination_id c_validcombination s_acctschema ishasalias f_alias getvalue tostring getctx macctschemaelement s_acctschema getacctschemaelements macctschemaelement getelementtype macctschemaelement elementtype_organization f_ad_org_id getvalue ad_org_id macctschemaelement elementtype_account f_account_id getvalue account_id macctschemaelement elementtype_subaccount f_subacct_id getvalue c_subacct_id macctschemaelement elementtype_product f_m_product_id getvalue m_product_id macctschemaelement elementtype_bpartner f_c_bpartner_id getvalue c_bpartner_id macctschemaelement elementtype_campaign f_c_campaign_id getvalue c_campaign_id macctschemaelement elementtype_locationfrom f_c_locfrom_id getvalue c_locfrom_id macctschemaelement elementtype_locationto f_c_locto_id getvalue c_locto_id macctschemaelement elementtype_project f_c_project_id getvalue c_project_id macctschemaelement elementtype_salesregion f_c_salesregion_id getvalue c_salesregion_id macctschemaelement elementtype_orgtrx f_ad_orgtrx_id getvalue ad_orgtrx_id macctschemaelement elementtype_activity f_c_activity_id getvalue c_activity_id macctschemaelement elementtype_userlist1 f_user1_id getvalue user1_id macctschemaelement elementtype_userlist2 f_user2_id getvalue user2_id ismandatory getname adialog m_windowno fillmandatory f_ad_org_id f_ad_org_id getvalue adialog m_windowno fillmandatory getelement getctx ad_org_id f_account_id f_account_id getvalue adialog m_windowno fillmandatory getelement getctx account_id ad_client_id c_acctschema_id tostring idvalue preparedstatement preparestatement tostring setint m_ad_client_id setint s_acctschema getc_acctschema_id resultset executequery idvalue getint getstring sqlexception tostring idvalue idvalue idvalue s_acctschema ishasalias f_alias getvalue tostring stringbuffer c_validcombination f_alias getvalue tostring f_alias getvalue c_validcombination_id idvalue createstatement executeupdate tostring sqlexception tostring adialog m_windowno accountnotupdated idvalue loadinfo idvalue s_acctschema getc_acctschema_id action_find f_alias f_alias getvalue tostring c_subacct_id f_subacct_id f_subacct_id getvalue c_subacct_id f_subacct_id getvalue intvalue m_product_id f_m_product_id f_m_product_id getvalue m_product_id f_m_product_id getvalue intvalue c_bpartner_id f_c_bpartner_id f_c_bpartner_id getvalue c_bpartner_id f_c_bpartner_id getvalue intvalue ad_orgtrx_id f_ad_orgtrx_id f_ad_orgtrx_id getvalue ad_orgtrx_id f_ad_orgtrx_id getvalue intvalue c_locfrom_id f_c_locfrom_id f_c_locfrom_id getvalue c_locfrom_id f_c_locfrom_id getvalue intvalue c_locto_id f_c_locto_id f_c_locto_id getvalue c_locto_id f_c_locto_id getvalue intvalue c_sregion_id f_c_salesregion_id f_c_salesregion_id getvalue c_sregion_id f_c_salesregion_id getvalue intvalue c_project_id f_c_project_id f_c_project_id getvalue c_project_id f_c_project_id getvalue intvalue c_campaign_id f_c_campaign_id f_c_campaign_id getvalue c_campaign_id f_c_campaign_id getvalue intvalue c_activity_id f_c_activity_id f_c_activity_id getvalue c_activity_id f_c_activity_id getvalue intvalue user1_id f_user1_id f_user1_id getvalue user1_id f_user1_id getvalue intvalue user2_id f_user2_id f_user2_id getvalue user2_id f_user2_id getvalue intvalue maccount maccount getctx m_ad_client_id f_ad_org_id getvalue intvalue s_acctschema getc_acctschema_id f_account_id getvalue intvalue c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_sregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id get_id get_id loadinfo setalias loadinfo get_id s_acctschema getc_acctschema_id action_find ignore private void action ignore if f alias null f alias set value f combination set value f description set text org mandatory f ad org id set value null account mandatory f account id set value null f subacct id set value null product if f m product id null f m product id set value null b partner if f c bpartner id null f c bpartner id set value null campaign if f c campaign id null f c campaign id set value null loc from if f c locfrom id null f c locfrom id set value null loc to if f c locto id null f c locto id set value null project if f c project id null f c project id set value null s region if f c salesregion id null f c salesregion id set value null org trx if f ad orgtrx id null f ad orgtrx id set value null activity if f c activity id null f c activity id set value null user 1 if f user1 id null f user1 id set value null user 2 if f user2 id null f user2 id set value null action_ignore f_alias f_alias setvalue f_combination setvalue f_description settext f_ad_org_id setvalue f_account_id setvalue f_subacct_id setvalue f_m_product_id f_m_product_id setvalue bpartner f_c_bpartner_id f_c_bpartner_id setvalue f_c_campaign_id f_c_campaign_id setvalue f_c_locfrom_id f_c_locfrom_id setvalue f_c_locto_id f_c_locto_id setvalue f_c_project_id f_c_project_id setvalue sregion f_c_salesregion_id f_c_salesregion_id setvalue f_ad_orgtrx_id f_ad_orgtrx_id setvalue f_c_activity_id f_c_activity_id setvalue f_user1_id f_user1_id setvalue f_user2_id f_user2_id setvalue get selected account return account public integer get value log config c validcombination id m c validcombination id changed m changed if m changed m c validcombination id 0 return null return new integer m c validcombination id getvalue c_validcombination_id m_c_validcombination_id m_changed m_changed m_c_validcombination_id m_c_validcombination_id vetoable change account changed param evt event throws property veto exception public void vetoable change property change event evt throws property veto exception object new value evt get new value if new value instanceof integer env set context env get ctx m windowno account id integer new value int value vetoablechange propertyvetoexception vetoablechange propertychangeevent propertyvetoexception newvalue getnewvalue newvalue setcontext getctx m_windowno account_id newvalue intvalue class vaccountdialog mouseadapter extends java awt event mouse adapter vaccountdialog mouseadapter v account dialog adaptee this adaptee adaptee vaccountdialog_mouseadapter mouseadapter vaccountdialog_mouseadapter vaccountdialog public void mouse clicked mouse event e table select if e get source instanceof j table e get click count 1 adaptee m changed true adaptee dispose mouseclicked mouseevent getsource jtable getclickcount m_changed standard constructor public x t transaction properties ctx int t transaction id string trx name super ctx t transaction id trx name if t transaction id 0 setad pinstance id 0 setm attributesetinstance id 0 setm locator id 0 setm product id 0 setm transaction id 0 set movement date new timestamp system current time millis set movement qty env zero set movement type null x_t_transaction t_transaction_id trxname t_transaction_id trxname t_transaction_id setad_pinstance_id setm_attributesetinstance_id setm_locator_id setm_product_id setm_transaction_id setmovementdate currenttimemillis setmovementqty setmovementtype load constructor public x t transaction properties ctx result set rs string trx name super ctx rs trx name x_t_transaction resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t transaction append get id append return sb to string tostring stringbuffer stringbuffer x_t_transaction get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set value ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_value ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 0 set value c projectissue id null else set value c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id set_value c_projectissue_id set_value c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set value m inoutline id null else set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_value m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 0 set value m inout id null else set value m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id set_value m_inout_id set_value m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 0 set value m inventory id null else set value m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id set_value m_inventory_id set_value m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 0 set value m movementline id null else set value m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id set_value m_movementline_id set_value m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue set inventory move movement of inventory public void setm movement id int m movement id if m movement id 0 set value m movement id null else set value m movement id new integer m movement id setm_movement_id m_movement_id m_movement_id set_value m_movement_id set_value m_movement_id m_movement_id get inventory move movement of inventory public int getm movement id integer ii integer get value m movement id if ii null return 0 return ii int value getm_movement_id get_value m_movement_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 0 set value m productionline id null else set value m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id set_value m_productionline_id set_value m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue set production plan for producing a product public void setm production id int m production id if m production id 0 set value m production id null else set value m production id new integer m production id setm_production_id m_production_id m_production_id set_value m_production_id set_value m_production_id m_production_id get production plan for producing a product public int getm production id integer ii integer get value m production id if ii null return 0 return ii int value getm_production_id get_value m_production_id intvalue set inventory transaction public void setm transaction id int m transaction id if m transaction id 1 throw new illegal argument exception m transaction id is mandatory set value m transaction id new integer m transaction id setm_transaction_id m_transaction_id m_transaction_id illegalargumentexception m_transaction_id set_value m_transaction_id m_transaction_id get inventory transaction public int getm transaction id integer ii integer get value m transaction id if ii null return 0 return ii int value getm_transaction_id get_value m_transaction_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty public static final string movementtype workorder w set movement type method of moving the inventory public void set movement type string movement type if movement type null throw new illegal argument exception movement type is mandatory if movement type equals c movement type equals c movement type equals i movement type equals i movement type equals m movement type equals m movement type equals p movement type equals p movement type equals v movement type equals v movement type equals w movement type equals w else throw new illegal argument exception movement type invalid value movement type reference id 189 c c i i m m p p v v w w if movement type length 2 log warning length 2 truncated movement type movement type substring 0 1 set value movement type movement type movementtype_workorder_ setmovementtype movementtype movementtype illegalargumentexception movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype illegalargumentexception movementtype movementtype reference_id movementtype movementtype movementtype set_value movementtype movementtype get movement type method of moving the inventory public string get movement type return string get value movement type getmovementtype get_value movementtype public static final int search inout id ad reference id 295 set search shipment receipt material shipment document public void setsearch inout id int search inout id if search inout id 0 set value search inout id null else set value search inout id new integer search inout id search_inout_id_ad_reference_id setsearch_inout_id search_inout_id search_inout_id set_value search_inout_id set_value search_inout_id search_inout_id get search shipment receipt material shipment document public int getsearch inout id integer ii integer get value search inout id if ii null return 0 return ii int value getsearch_inout_id get_value search_inout_id intvalue public static final int search invoice id ad reference id 336 set search invoice search invoice identifier public void setsearch invoice id int search invoice id if search invoice id 0 set value search invoice id null else set value search invoice id new integer search invoice id search_invoice_id_ad_reference_id setsearch_invoice_id search_invoice_id search_invoice_id set_value search_invoice_id set_value search_invoice_id search_invoice_id get search invoice search invoice identifier public int getsearch invoice id integer ii integer get value search invoice id if ii null return 0 return ii int value getsearch_invoice_id get_value search_invoice_id intvalue public static final int search order id ad reference id 290 set search order order identifier public void setsearch order id int search order id if search order id 0 set value search order id null else set value search order id new integer search order id search_order_id_ad_reference_id setsearch_order_id search_order_id search_order_id set_value search_order_id set_value search_order_id search_order_id get search order order identifier public int getsearch order id integer ii integer get value search order id if ii null return 0 return ii int value getsearch_order_id get_value search_order_id intvalue constructor param ctx context param ad printformatitem id ad printformatitem id public m print format item properties ctx int ad printformatitem id string trx name super ctx ad printformatitem id trx name default setting if ad printformatitem id 0 set field alignment type fieldalignmenttype default set line alignment type linealignmenttype none set print format type printformattype text set print area type printareatype content set shape type shapetype normalrectangle set is centrally maintained true set is relative position true set is next line false set is next page false set is setnl position false set is filled rectangle false set is image field false setx space 0 sety space 0 setx position 0 sety position 0 set max width 0 set is fixed width false set is height one line false set max height 0 set line width 1 set arc diameter 0 set is order by false set sort no 0 set is group by false set is page break false set is summarized false set is averaged false set is counted false set is min calc false set is max calc false set is variance calc false set is deviation calc false set is running total false set image is attached false set is suppress null false ad_printformatitem_id ad_printformatitem_id mprintformatitem ad_printformatitem_id trxname ad_printformatitem_id trxname ad_printformatitem_id setfieldalignmenttype fieldalignmenttype_default setlinealignmenttype linealignmenttype_none setprintformattype printformattype_text setprintareatype printareatype_content setshapetype shapetype_normalrectangle setiscentrallymaintained setisrelativeposition setisnextline setisnextpage setissetnlposition setisfilledrectangle setisimagefield setxspace setyspace setxposition setyposition setmaxwidth setisfixedwidth setisheightoneline setmaxheight setlinewidth setarcdiameter setisorderby setsortno setisgroupby setispagebreak setissummarized setisaveraged setiscounted setismincalc setismaxcalc setisvariancecalc setisdeviationcalc setisrunningtotal setimageisattached setissuppressnull constructor param ctx context param rs result set public m print format item properties ctx result set rs string trx name super ctx rs trx name resultset mprintformatitem resultset trxname trxname get print name with language param language language ignored if is multi lingual document not y return print name public string get print name language language if language null env is base language language ad printformatitem return get print name load translations string ret value string m translationlabel get language getad language if ret value null ret value length 0 return get print name return ret value ismultilingualdocument getprintname isbaselanguage ad_printformatitem getprintname loadtranslations retvalue m_translationlabel getad_language retvalue retvalue getprintname retvalue load translations private void load translations if m translationlabel null m translationlabel new hash map string string m translationsuffix new hash map string string string sql select ad language print name print name suffix from ad printformatitem trl where ad printformatitem id try prepared statement pstmt db prepare statement sql null pstmt set int 1 get id result set rs pstmt execute query while rs next m translationlabel put rs get string 1 rs get string 2 m translationsuffix put rs get string 1 rs get string 3 rs close pstmt close catch sql exception e log log level severe load trl e loadtranslations m_translationlabel m_translationlabel hashmap m_translationsuffix hashmap ad_language printname printnamesuffix ad_printformatitem_trl ad_printformatitem_id preparedstatement preparestatement setint get_id resultset executequery m_translationlabel getstring getstring m_translationsuffix getstring getstring sqlexception loadtrl get print name suffix with language param language language ignored if is multi lingual document not y return print name suffix public string get print name suffix language language if language null env is base language language ad printformatitem return get print name suffix load translations string ret value string m translationsuffix get language getad language if ret value null ret value length 0 return get print name suffix return ret value ismultilingualdocument getprintnamesuffix isbaselanguage ad_printformatitem getprintnamesuffix loadtranslations retvalue m_translationsuffix getad_language retvalue retvalue getprintnamesuffix retvalue public boolean is type field return get print format type equals printformattype field istypefield getprintformattype printformattype_field return get print format type equals printformattype field public boolean is type text return get print format type equals printformattype text getprintformattype printformattype_field istypetext getprintformattype printformattype_text return get print format type equals printformattype text public boolean is type print format return get print format type equals printformattype printformat getprintformattype printformattype_text istypeprintformat getprintformattype printformattype_printformat return get print format type equals printformattype printformat public boolean is type image return get print format type equals printformattype image getprintformattype printformattype_printformat istypeimage getprintformattype printformattype_image public boolean is type box return get print format type equals printformattype line get print format type equals printformattype rectangle istypebox getprintformattype printformattype_line getprintformattype printformattype_rectangle public boolean is field center return get field alignment type equals fieldalignmenttype center isfieldcenter getfieldalignmenttype fieldalignmenttype_center return get field alignment type equals fieldalignmenttype center public boolean is field align leading return get field alignment type equals fieldalignmenttype leadingleft getfieldalignmenttype fieldalignmenttype_center isfieldalignleading getfieldalignmenttype fieldalignmenttype_leadingleft return get field alignment type equals fieldalignmenttype leadingleft public boolean is field align trailing return get field alignment type equals fieldalignmenttype trailingright getfieldalignmenttype fieldalignmenttype_leadingleft isfieldaligntrailing getfieldalignmenttype fieldalignmenttype_trailingright return get field alignment type equals fieldalignmenttype trailingright public boolean is field align block return get field alignment type equals fieldalignmenttype block getfieldalignmenttype fieldalignmenttype_trailingright isfieldalignblock getfieldalignmenttype fieldalignmenttype_block return get field alignment type equals fieldalignmenttype block public boolean is field align default return get field alignment type equals fieldalignmenttype default getfieldalignmenttype fieldalignmenttype_block isfieldaligndefault getfieldalignmenttype fieldalignmenttype_default public boolean is line align center return get line alignment type equals linealignmenttype center islinealigncenter getlinealignmenttype linealignmenttype_center return get line alignment type equals linealignmenttype center public boolean is line align leading return get line alignment type equals linealignmenttype leadingleft getlinealignmenttype linealignmenttype_center islinealignleading getlinealignmenttype linealignmenttype_leadingleft return get line alignment type equals linealignmenttype leadingleft public boolean is line align trailing return get line alignment type equals linealignmenttype trailingright getlinealignmenttype linealignmenttype_leadingleft islinealigntrailing getlinealignmenttype linealignmenttype_trailingright public boolean is header return get print area type equals printareatype header isheader getprintareatype printareatype_header return get print area type equals printareatype header public boolean is content return get print area type equals printareatype content getprintareatype printareatype_header iscontent getprintareatype printareatype_content return get print area type equals printareatype content public boolean is footer return get print area type equals printareatype footer getprintareatype printareatype_content isfooter getprintareatype printareatype_footer string representation return info public string to string string buffer sb new string buffer m print format item sb append id append get id append name append get name append print append get print name append seq append get seq no append sort append get sort no append area append get print area type append max width append get max width append max height append get max height append one line append is height one line append relative append is relative position if is relative position sb append x append getx space append y append gety space append line align append get line alignment type append new line append is next line append new page append is page break else sb append x append getx position append y append gety position sb append field align append get field alignment type sb append type append get print format type if is type text else if is type field sb append ad column id append getad column id else if is type print format sb append ad printformatchild id append getad printformatchild id append ad column id append getad column id else if is type image sb append image is attached append is image is attached append imageurl append get imageurl sb append printed append is printed append seq no append get seq no append order by append is order by append sort no append get sort no append summarized append is summarized sb append return sb to string tostring stringbuffer stringbuffer mprintformatitem get_id getname getprintname getseqno getsortno getprintareatype maxwidth getmaxwidth maxheight getmaxheight oneline isheightoneline isrelativeposition isrelativeposition getxspace getyspace linealign getlinealignmenttype newline isnextline newpage ispagebreak getxposition getyposition fieldalign getfieldalignmenttype getprintformattype istypetext istypefield ad_column_id getad_column_id istypeprintformat ad_printformatchild_id getad_printformatchild_id ad_column_id getad_column_id istypeimage imageisattached isimageisattached getimageurl isprinted seqno getseqno orderby isorderby sortno getsortno issummarized tostring get column name from ad column id return column name public string get column name if m columnname null get column name from ad column not index m columnname get column name new integer getad column id return m columnname columnname ad_column_id columnname getcolumnname m_columnname ad_column m_columnname getcolumnname getad_column_id m_columnname get column name from ad column id be careful not to confuse it with po method getad column id index param ad column id column return column name private static string get column name integer ad column id if ad column id null ad column id int value 0 return null string ret value string s columns get ad column id if ret value null string sql select column name from ad column where ad column id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad column id int value result set rs pstmt execute query if rs next ret value rs get string 1 s columns put ad column id ret value else s log log level severe not found ad column id ad column id rs close pstmt close catch sql exception e s log log level severe ad column id ad column id e return ret value ad_column_id getad_column_id ad_column_id getcolumnname ad_column_id ad_column_id ad_column_id intvalue retvalue s_columns ad_column_id retvalue columnname ad_column ad_column_id preparedstatement preparestatement setint ad_column_id intvalue resultset executequery retvalue getstring s_columns ad_column_id retvalue s_log ad_column_id ad_column_id sqlexception s_log ad_column_id ad_column_id retvalue create print format item from column param format parent param ad column id column param seq no sequence of display if 0 it is not printed return print format item public static m print format item create from column m print format format int ad column id int seq no m print format item pfi new m print format item format get ctx 0 null pfi setad printformat id format getad printformat id pfi set client org format pfi setad column id ad column id pfi set print format type printformattype field translation is dome by trigger string sql select c column name e name e print name 1 3 c ad reference id c is key c seq no 4 6 from ad column c ad element e where c ad column id and c ad element id e ad element id translate base entry if single language trigger copies to trl tables language language format get language boolean trl env is multi lingual document format get ctx language is base language if trl sql select c column name e name e print name 1 3 c ad reference id c is key c seq no 4 6 from ad column c ad element trl e where c ad column id and c ad element id e ad element id and e ad language try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad column id if trl pstmt set string 2 language getad language result set rs pstmt execute query if rs next string column name rs get string 1 pfi set name rs get string 2 pfi set print name rs get string 3 int display type rs get int 4 if display type is numeric display type pfi set field alignment type fieldalignmenttype trailingright else if display type display type text display type display type memo pfi set field alignment type fieldalignmenttype block else pfi set field alignment type fieldalignmenttype leadingleft boolean is key y equals rs get string 5 if is key column name starts with created column name starts with updated column name equals ad client id column name equals ad org id column name equals is active display type display type button display type display type binary display type display type id display type display type image display type display type rowid seq no 0 pfi set is printed false pfi set seq no 0 else pfi set is printed true pfi set seq no seq no int id seq no rs get int 6 is identifier sort no if id seq no 0 pfi set is order by true pfi set sort no id seq no else s log log level severe not found ad column id ad column id trl trl language getad language rs close pstmt close catch sql exception e s log log level severe sql e if pfi save return null pfi dump return pfi ad_column_id seqno mprintformatitem createfromcolumn mprintformat ad_column_id seqno mprintformatitem mprintformatitem getctx setad_printformat_id getad_printformat_id setclientorg setad_column_id ad_column_id setprintformattype printformattype_field columnname printname ad_reference_id iskey seqno ad_column ad_element ad_column_id ad_element_id ad_element_id getlanguage ismultilingualdocument getctx isbaselanguage columnname printname ad_reference_id iskey seqno ad_column ad_element_trl ad_column_id ad_element_id ad_element_id ad_language preparedstatement preparestatement setint ad_column_id setstring getad_language resultset executequery columnname getstring setname getstring setprintname getstring displaytype getint displaytype isnumeric displaytype setfieldalignmenttype fieldalignmenttype_trailingright displaytype displaytype displaytype displaytype setfieldalignmenttype fieldalignmenttype_block setfieldalignmenttype fieldalignmenttype_leadingleft iskey getstring iskey columnname startswith columnname startswith columnname ad_client_id columnname ad_org_id columnname isactive displaytype displaytype displaytype displaytype displaytype displaytype displaytype displaytype displaytype displaytype seqno setisprinted setseqno setisprinted setseqno seqno idseqno getint isidentifier sortno idseqno setisorderby setsortno idseqno s_log ad_column_id ad_column_id getad_language sqlexception s_log copy existing definition to client param to client id to client param ad printformat id parent print format return print format item public m print format item copy to client int to client id int ad printformat id m print format item to new m print format item p ctx 0 null m print format item copy values this to to set client org to client id 0 to setad printformat id ad printformat id to save return to to_client_id ad_printformat_id mprintformatitem copytoclient to_client_id ad_printformat_id mprintformatitem mprintformatitem p_ctx mprintformatitem copyvalues setclientorg to_client_id setad_printformat_id ad_printformat_id before save param new record return true if ok protected boolean before save boolean new record order if is order by set sort no 0 set is group by false set is page break false rel position if is relative position setx position 0 sety position 0 else setx space 0 sety space 0 image if is image field set image is attached false set imageurl null return true newrecord beforesave newrecord isorderby setsortno setisgroupby setispagebreak isrelativeposition setxposition setyposition setxspace setyspace isimagefield setimageisattached setimageurl after save param new record new param success success return success protected boolean after save boolean new record boolean success set translation from element if new record m client get get ctx is multi lingual document get print name null get print name length 0 string sql update ad printformatitem trl trl set print name select e print name from ad element trl e ad column c where e ad language trl ad language and e ad element id c ad element id and c ad column id getad column id where ad printformatitem id get id and exists select from ad element trl e ad column c where e ad language trl ad language and e ad element id c ad element id and c ad column id getad column id and trl ad printformatitem id get id and exists select from ad client where ad client id trl ad client id and is multi lingual document y int no db execute update sql get trxname log fine translations updated no return success newrecord aftersave newrecord newrecord mclient getctx ismultilingualdocument getprintname getprintname ad_printformatitem_trl printname printname ad_element_trl ad_column ad_language ad_language ad_element_id ad_element_id ad_column_id getad_column_id ad_printformatitem_id get_id ad_element_trl ad_column ad_language ad_language ad_element_id ad_element_id ad_column_id getad_column_id ad_printformatitem_id get_id ad_client ad_client_id ad_client_id ismultilingualdocument executeupdate get_trxname open invoice amount incoice open param p c invoice id invoice param p c invoicepayschedule id payment schedule return open amount throws sql exception public static big decimal open int p c invoice id int p c invoicepayschedule id throws sql exception invoice info int c currency id 0 int c conversiontype id 0 big decimal grand total null big decimal multiplierap null big decimal multipliercm null string sql select max c currency id max c conversiontype id sum grand total max multiplierap max multiplier from c invoice v corrected for cm split payment where c invoice id if p c invoicepayschedule id 0 sql and c invoicepayschedule id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c invoice id if p c invoicepayschedule id 0 pstmt set int 2 p c invoicepayschedule id result set rs pstmt execute query if rs next c currency id rs get int 1 c conversiontype id rs get int 2 grand total rs get big decimal 3 multiplierap rs get big decimal 4 multipliercm rs get big decimal 5 rs close pstmt close no invoice if grand total null return null big decimal paid amt allocated amt p c invoice id c currency id c conversiontype id multiplierap big decimal total open amt grand total subtract paid amt grand total paid total open remaining due x 100 0 100 0 1a 50 0 50 x 1b 0 50 0 50 2a 0 50 0 50 2b 50 0 50 x 100 10 100 10 1a 50 10 50 x 1b 10 50 0 50 2a 10 50 0 50 2b 50 0 50 x 100 60 100 60 1a 50 60 0 50 x 1b 60 50 50 2a 60 50 10 50 2b 50 10 50 x do we have a payment schedule if p c invoicepayschedule id 0 if not valid lists invoice amount total open amt grand total big decimal remaining amt paid amt sql select c invoicepayschedule id due amt from c invoicepayschedule where c invoice id and is valid y order by due date pstmt compiere prepare statement sql pstmt set int 1 p c invoice id rs pstmt execute query while rs next int c invoicepayschedule id rs get int 1 big decimal due amt rs get big decimal 2 if c invoicepayschedule id p c invoicepayschedule id if due amt signum 0 positive if due amt compare to remaining amt 0 paid more total open amt compiere zero else total open amt due amt multiply multipliercm subtract remaining amt else if due amt compare to remaining amt 0 paid more total open amt compiere zero else total open amt due amt multiply multipliercm add remaining amt else if due amt signum 0 positive remaining amt remaining amt subtract due amt if remaining amt signum 0 remaining amt compiere zero else remaining amt remaining amt add due amt if remaining amt signum 0 remaining amt compiere zero rs close pstmt close invoice schedule rounding total open amt currency round total open amt c currency id null ignore penny if there is a payment if paid amt signum 0 double open total open amt double value if open 0 01 open 0 01 total open amt compiere zero return total open amt incoiceopen p_c_invoice_id p_c_invoicepayschedule_id sqlexception bigdecimal p_c_invoice_id p_c_invoicepayschedule_id sqlexception c_currency_id c_conversiontype_id bigdecimal grandtotal bigdecimal bigdecimal c_currency_id c_conversiontype_id grandtotal c_invoice_v c_invoice_id p_c_invoicepayschedule_id c_invoicepayschedule_id preparedstatement preparestatement setint p_c_invoice_id p_c_invoicepayschedule_id setint p_c_invoicepayschedule_id resultset executequery c_currency_id getint c_conversiontype_id getint grandtotal getbigdecimal getbigdecimal getbigdecimal grandtotal bigdecimal paidamt allocatedamt p_c_invoice_id c_currency_id c_conversiontype_id bigdecimal totalopenamt grandtotal paidamt grandtotal totalopen p_c_invoicepayschedule_id totalopenamt grandtotal bigdecimal remainingamt paidamt c_invoicepayschedule_id dueamt c_invoicepayschedule c_invoice_id isvalid duedate preparestatement setint p_c_invoice_id executequery c_invoicepayschedule_id getint bigdecimal dueamt getbigdecimal c_invoicepayschedule_id p_c_invoicepayschedule_id dueamt dueamt compareto remainingamt totalopenamt totalopenamt dueamt remainingamt dueamt compareto remainingamt totalopenamt totalopenamt dueamt remainingamt dueamt remainingamt remainingamt dueamt remainingamt remainingamt remainingamt remainingamt dueamt remainingamt remainingamt totalopenamt totalopenamt c_currency_id paidamt totalopenamt doublevalue totalopenamt totalopenamt get invoice paid allocated amount invoice paid param p c invoice id invoice param p c currency id currency param p multiplierap multiplier return paid amount throws sql exception public static big decimal paid int p c invoice id int p c currency id int p multiplierap throws sql exception invalid parameters if p c invoice id 0 p c currency id 0 return null parameters big decimal multiplierap new big decimal double p multiplierap if p multiplierap 0 multiplierap compiere one int c conversiontype id 0 calculate allocated amount big decimal payment amt allocated amt p c invoice id p c currency id c conversiontype id multiplierap return currency round payment amt p c currency id null invoicepaid p_c_invoice_id p_c_currency_id p_multiplierap sqlexception bigdecimal p_c_invoice_id p_c_currency_id p_multiplierap sqlexception p_c_invoice_id p_c_currency_id bigdecimal bigdecimal p_multiplierap p_multiplierap c_conversiontype_id bigdecimal paymentamt allocatedamt p_c_invoice_id p_c_currency_id c_conversiontype_id paymentamt p_c_currency_id get allocated amt not directly used param c invoice id invoice param c currency id currency param c conversiontype id conversion type param multiplierap multiplier return allocated amount throws sql exception public static big decimal allocated amt int c invoice id int c currency id int c conversiontype id big decimal multiplierap throws sql exception calculate allocated amount big decimal paid amt compiere zero string sql select a ad client id a ad org id al amount al discount amt al write off amt a c currency id a date trx from c allocationline al inner join c allocationhdr a on al c allocationhdr id a c allocationhdr id where al c invoice id and a is active y prepared statement pstmt compiere prepare statement sql pstmt set int 1 c invoice id result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 big decimal amount rs get big decimal 3 big decimal discount amt rs get big decimal 4 big decimal write off amt rs get big decimal 5 int c currencyfrom id rs get int 6 timestamp date trx rs get timestamp 7 big decimal inv amt amount add discount amt add write off amt big decimal allocation currency convert inv amt multiply multiplierap c currencyfrom id c currency id date trx c conversiontype id ad client id ad org id if allocation null paid amt paid amt add allocation rs close pstmt close return paid amt c_invoice_id c_currency_id c_conversiontype_id sqlexception bigdecimal allocatedamt c_invoice_id c_currency_id c_conversiontype_id bigdecimal sqlexception bigdecimal paidamt ad_client_id ad_org_id discountamt writeoffamt c_currency_id datetrx c_allocationline c_allocationhdr c_allocationhdr_id c_allocationhdr_id c_invoice_id isactive preparedstatement preparestatement setint c_invoice_id resultset executequery ad_client_id getint ad_org_id getint bigdecimal getbigdecimal bigdecimal discountamt getbigdecimal bigdecimal writeoffamt getbigdecimal c_currencyfrom_id getint datetrx gettimestamp bigdecimal invamt discountamt writeoffamt bigdecimal invamt c_currencyfrom_id c_currency_id datetrx c_conversiontype_id ad_client_id ad_org_id paidamt paidamt paidamt get invoice discount c invoice discount invoice discount param p c invoice id invoice param p paydate pay date param p c invoicepayschedule id pay schedule return discount amount or null public static big decimal discount int p c invoice id timestamp p paydate int p c invoicepayschedule id throws sql exception parameters if p c invoice id 0 return null timestamp pay date p paydate if pay date null pay date new timestamp system current time millis pay date compiere trunc pay date invoice info boolean is discount line amt false big decimal grand total null big decimal total lines null int c paymentterm id 0 timestamp date invoiced null boolean is pay schedule valid false int c currency id 0 string sql select ci is discount line amt i grand total i total lines i c paymentterm id i date invoiced i is pay schedule valid i c currency id from c invoice i inner join ad clientinfo ci on ci ad client id i ad client id where i c invoice id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c invoice id result set rs pstmt execute query if rs next is discount line amt y equals rs get string 1 grand total rs get big decimal 2 total lines rs get big decimal 3 c paymentterm id rs get int 4 date invoiced rs get timestamp 5 is pay schedule valid y equals rs get string 6 c currency id rs get int 7 rs close pstmt close not found if grand total null return null what amount is the discount base big decimal amount grand total if is discount line amt amount total lines anything to discount if amount signum 0 return compiere zero valid payment schedule has discount if is pay schedule valid p c invoicepayschedule id 0 big decimal discount compiere zero sql select discount amt from c invoicepayschedule where c invoicepayschedule id and trunc discount date pstmt compiere prepare statement sql pstmt set int 1 p c invoicepayschedule id pstmt set timestamp 2 pay date rs pstmt execute query if rs next discount rs get big decimal 1 rs close pstmt close return discount return discount amount return payment term discount amount c currency id c paymentterm id date invoiced pay date c_invoice_discount invoicediscount p_c_invoice_id p_paydate p_c_invoicepayschedule_id bigdecimal p_c_invoice_id p_paydate p_c_invoicepayschedule_id sqlexception p_c_invoice_id paydate p_paydate paydate paydate currenttimemillis paydate paydate isdiscountlineamt bigdecimal grandtotal bigdecimal totallines c_paymentterm_id dateinvoiced ispayschedulevalid c_currency_id isdiscountlineamt grandtotal totallines c_paymentterm_id dateinvoiced ispayschedulevalid c_currency_id c_invoice ad_clientinfo ad_client_id ad_client_id c_invoice_id preparedstatement preparestatement setint p_c_invoice_id resultset executequery isdiscountlineamt getstring grandtotal getbigdecimal totallines getbigdecimal c_paymentterm_id getint dateinvoiced gettimestamp ispayschedulevalid getstring c_currency_id getint grandtotal bigdecimal grandtotal isdiscountlineamt totallines ispayschedulevalid p_c_invoicepayschedule_id bigdecimal discountamt c_invoicepayschedule c_invoicepayschedule_id discountdate preparestatement setint p_c_invoicepayschedule_id settimestamp paydate executequery getbigdecimal paymentterm c_currency_id c_paymentterm_id dateinvoiced paydate creates a new compiere panel with the specified layout manager and buffering strategy param layout the layout manager to use param is double buffered a boolean true for double buffering which uses additional memory space to achieve fast flicker free updates public c panel layout manager layout boolean is double buffered super layout is double buffered init compierepanel layoutmanager isdoublebuffered cpanel layoutmanager isdoublebuffered isdoublebuffered create a new buffered c panel with the specified layout manager param layout the layout manager to use public c panel layout manager layout super layout init cpanel layoutmanager cpanel layoutmanager creates a new code c panel code with code flow layout code and the specified buffering strategy if code is double buffered code is true the code c panel code will use a double buffer param is double buffered a boolean true for double buffering which uses additional memory space to achieve fast flicker free updates public c panel boolean is double buffered super is double buffered init cpanel flowlayout isdoublebuffered cpanel isdoublebuffered cpanel isdoublebuffered isdoublebuffered creates a new code c panel code with a double buffer and a flow layout public c panel super init cpanel cpanel creates a new code c panel code with a double buffer and a flow layout param bc initial background color public c panel compiere color bc this init set background color bc cpanel cpanel compierecolor setbackgroundcolor common init compiere backround requires that for the base background is set explictily the additional panels should be transparent private void init set opaque false transparent setopaque set background ignored by ui param bg ignored public void set background color bg if bg equals get background return super set background bg ignore calls from javax swing look and feel install colors look and feel java 61 if trace get caller class 1 starts with javax set background color new compiere color bg setbackground getbackground setbackground lookandfeel installcolors lookandfeel getcallerclass startswith setbackgroundcolor compierecolor set background param bg compiere color for background if null set standard background public void set background color compiere color bg if bg null bg compiere panelui get default background set opaque true not transparent put client property compiereplaf background bg super set background bg get flat color compierecolor setbackgroundcolor compierecolor compierepanelui getdefaultbackground setopaque putclientproperty setbackground getflatcolor get background return color for background public compiere color get background color try return compiere color get client property compiereplaf background catch exception e system err println c panel client property e get message return null compierecolor getbackgroundcolor compierecolor getclientproperty cpanel clientproperty getmessage set tab hierarchy level has only effect if tabs are on left or right side param level public void set tab level int level if level 0 put client property compiereplaf tablevel null else put client property compiereplaf tablevel new integer level settablevel putclientproperty putclientproperty get tab hierarchy level return tab level public int get tab level try integer ll integer get client property compiereplaf tablevel if ll null return ll int value catch exception e system err println client property e get message return 0 gettablevel getclientproperty intvalue clientproperty getmessage string representation return string representation public string to string string buffer sb new string buffer c panel sb append super to string compiere color bg get background color if bg null sb append bg to string sb append return sb to string tostring stringbuffer stringbuffer cpanel tostring compierecolor getbackgroundcolor tostring tostring get w store from cache param ctx context param w store id id return w store public static m store get properties ctx int w store id integer key new integer w store id m store ret value m store s cache get key if ret value null return ret value ret value new m store ctx w store id null if ret value get id 0 s cache put key ret value return ret value wstore w_store_id wstore mstore w_store_id w_store_id mstore retvalue mstore s_cache retvalue retvalue retvalue mstore w_store_id retvalue get_id s_cache retvalue retvalue get w store from cache param ctx context param context path web server context path return w store public static m store get properties ctx string context path m store wstore null iterator it s cache values iterator while it has next wstore m store it next if wstore get web context equals context path return wstore search by context prepared statement pstmt null string sql select from w store where web context try pstmt db prepare statement sql null pstmt set string 1 context path result set rs pstmt execute query if rs next wstore new m store ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null try client if wstore null sql select from w store where ad client id and is active y order by w store id try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query if rs next wstore new m store ctx rs null s log warning context context path not found found via ad client id env getad client id ctx rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null nothing if wstore null return null save integer key new integer wstore getw store id s cache put key wstore return wstore wstore contextpath wstore mstore contextpath mstore s_cache hasnext mstore getwebcontext contextpath preparedstatement w_store webcontext preparestatement setstring contextpath resultset executequery mstore s_log w_store ad_client_id isactive w_store_id preparestatement setint getad_client_id resultset executequery mstore s_log contextpath ad_client_id getad_client_id s_log getw_store_id s_cache get active web stores of clieny param client client return array of web stores public static m store get of client m client client array list m store list new array list m store string sql select from w store where ad client id and is active y prepared statement pstmt null try pstmt db prepare statement sql client get trxname pstmt set int 1 client getad client id result set rs pstmt execute query while rs next list add new m store client get ctx rs client get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m store ret value new m store list size list to array ret value return ret value mstore getofclient mclient arraylist mstore arraylist mstore w_store ad_client_id isactive preparedstatement preparestatement get_trxname setint getad_client_id resultset executequery mstore getctx get_trxname s_log mstore retvalue mstore toarray retvalue retvalue get active web stores return cached web stores public static m store get active s log info try collection cc s cache values object oo cc to array for int i 0 i oo length i s log info i oo i m store ret value new m store oo length for int i 0 i oo length i ret value i m store oo i return ret value catch exception e s log severe e to string return new m store mstore getactive s_log s_cache toarray s_log mstore retvalue mstore retvalue mstore retvalue s_log tostring mstore standard constructor param ctx context param w store id id param trx name trx public m store properties ctx int w store id string trx name super ctx w store id trx name if w store id 0 set is default false set is menu assets true y set is menu contact true y set is menu interests true y set is menu invoices true y set is menu orders true y set is menu payments true y set is menu registrations true y set is menu requests true y set is menu rf qs true y set is menu shipments true y setc paymentterm id 0 setm pricelist id 0 setm warehouse id 0 set name null setsalesrep id 0 seturl null set web context null w_store_id trxname mstore w_store_id trxname w_store_id trxname w_store_id setisdefault setismenuassets setismenucontact setismenuinterests setismenuinvoices setismenuorders setismenupayments setismenuregistrations setismenurequests setismenurfqs setismenushipments setc_paymentterm_id setm_pricelist_id setm_warehouse_id setname setsalesrep_id setwebcontext load constructor param ctx context param rs result set param trx name trx public m store properties ctx result set rs string trx name super ctx rs trx name trxname mstore resultset trxname trxname get web context param full if true fully qualified return web context public string get web context boolean full if full return super geturl string url super geturl if url null url length 0 url http localhost if url ends with url url substring 0 url length 1 return url get web context getwebcontext endswith getwebcontext string representation return info public string to string string buffer sb new string buffer w store sb append get web context true append return sb to string tostring stringbuffer stringbuffer wstore getwebcontext tostring before save param new record new return true if can be saved protected boolean before save boolean new record context to start with if get web context starts with set web context get web context org to warehouse if new record is valuechanged m warehouse id getad org id 0 m warehouse wh new m warehouse get ctx getm warehouse id get trxname setad org id wh getad org id string url geturl if url null url boolean urlok url starts with http url starts with https if urlok url index of localhost 1 log save error fill mandatory msg get element get ctx url e g http www adempiere org return false return true newrecord beforesave newrecord getwebcontext startswith setwebcontext getwebcontext newrecord is_valuechanged m_warehouse_id getad_org_id mwarehouse mwarehouse getctx getm_warehouse_id get_trxname setad_org_id getad_org_id startswith startswith indexof saveerror fillmandatory getelement getctx create e mail from request user param to recipient param subject sunject param message nessage return e mail public e mail createe mail string to string subject string message if to null to length 0 log warning no to return null e mail email null m client client m client get get ctx getad client id if client is servere mail ini is client server server c connection get get server try if server null see server bean email server createe mail get ctx getad client id to subject message else log log level warning no apps server catch remote exception ex log log level severe get name apps server error ex string from getw storee mail if from null from length 0 from client get requeste mail if email null email new e mail client from to subject message authorizetion if client is smtp authorization if getw storee mail null getw store user null getw store userpw null email create authenticator getw store user getw store userpw else email create authenticator client get request user client get request userpw bcc email add bcc from return email email email email createemail email mclient mclient getctx getad_client_id isserveremail isclient cconnection getserver serverbean createemail getctx getad_client_id appsserver remoteexception getname appsserver getwstoreemail getrequestemail email issmtpauthorization getwstoreemail getwstoreuser getwstoreuserpw createauthenticator getwstoreuser getwstoreuserpw createauthenticator getrequestuser getrequestuserpw addbcc send e mail from web store user param to recipient email address param subject subject param message message add header footer return true if sent public boolean sende mail string to string subject string message if message null message length 0 log warning no message return false string buffer msg text new string buffer if gete mail header null msg text append gete mail header msg text append message if gete mail footer null msg text append gete mail footer e mail email createe mail to subject msg text to string if email null return false try string msg email send if e mail sent ok equals email send log info sent e mail subject to to return true else log warning could not send email subject to to msg get name return false catch exception ex log severe get name ex get localized message return false email webstore sendemail stringbuffer msgtext stringbuffer getemailheader msgtext getemailheader msgtext getemailfooter msgtext getemailfooter email createemail msgtext tostring email sent_ok email getname getname getlocalizedmessage test web store e mail return ok or error public string teste mail if getw storee mail null getw storee mail length 0 return no web store e mail for get name e mail email createe mail getw storee mail a dempiere web store e mail test a dempiere web store e mail test to string if email null return could not create web store e mail get name try string msg email send if e mail sent ok equals email send log info sent test e mail to getw storee mail return ok else log warning could not send test email to getw storee mail msg return msg catch exception ex log severe get name ex get localized message return ex get localized message webstore email testemail getwstoreemail getwstoreemail email getname email createemail getwstoreemail adempiere webstore email adempiere webstore email tostring email getname email sent_ok email getwstoreemail getwstoreemail getname getlocalizedmessage getlocalizedmessage get messages param reload reload data return array of messages public m mail msg get mail msgs boolean reload if m msgs null reload return m msgs array list m mail msg list new array list m mail msg string sql select from w mailmsg where w store id order by mail msg type prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getw store id result set rs pstmt execute query while rs next list add new m mail msg get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m msgs new m mail msg list size list to array m msgs return m msgs mmailmsg getmailmsgs m_msgs m_msgs arraylist mmailmsg arraylist mmailmsg w_mailmsg w_store_id mailmsgtype preparedstatement preparestatement get_trxname setint getw_store_id resultset executequery mmailmsg getctx get_trxname m_msgs mmailmsg toarray m_msgs m_msgs get mail msg and if not found create it param mail msg type mail message type return message public m mail msg get mail msg string mail msg type if m msgs null get mail msgs false existing msg for int i 0 i m msgs length i if m msgs i get mail msg type equals mail msg type return m msgs i create missing if create messages 0 log severe not created found mail msg type return null get mail msgs true try again for int i 0 i m msgs length i if m msgs i get mail msg type equals mail msg type return m msgs i nothing found log severe not found mail msg type return null mailmsgtype mmailmsg getmailmsg mailmsgtype m_msgs getmailmsgs m_msgs m_msgs getmailmsgtype mailmsgtype m_msgs createmessages mailmsgtype getmailmsgs m_msgs m_msgs getmailmsgtype mailmsgtype m_msgs mailmsgtype create missing messages return number of messages created public int create messages string init msgs new string new string m mail msg mailmsgtype uservalidation e mail validation e mail validation dear n you requested the validation code n please enter the validation code to get access new string m mail msg mailmsgtype userpassword password request password request dear n we received a send password request from n your password is new string m mail msg mailmsgtype subscribe subscription new new subscription dear n you requested to be added to the list n thanks for your interest new string m mail msg mailmsgtype unsubscribe subscription removed remove subscription dear n you requested to be removed from the list n sorry to see you go this is effictive immediately new string m mail msg mailmsgtype orderacknowledgement order acknowledgement a dempiere web order dear n thank you for your purchase n you can view your orders invoices payments in the web store n from there you also download your assets documentation etc new string m mail msg mailmsgtype paymentacknowledgement payment success a dempiere web payment dear n thank you for your payment of n you can view your orders invoices payments in the web store n from there you also download your assets documentation etc new string m mail msg mailmsgtype paymenterror payment error a dempiere web declined payment dear n unfortunately your payment was declined n please check and try again you can pay later by going to my orders or my invoices or by directly creating a payment in my payments new string m mail msg mailmsgtype request request request dear n thank you for your request m request separator m request separator n please check back for updates new string m mail msg mailmsgtype useraccount welcome message welcome welcome to our web store this is the validation code to access information if m msgs null get mail msgs false if m msgs length init msgs length may create a problem if user defined own ones unlikely return 0 nothing to do int counter 0 for int i 0 i init msgs length i boolean found false for int m 0 m m msgs length m if init msgs i 0 equals m msgs m get mail msg type found true break for all existing msgs if found continue m mail msg msg new m mail msg this init msgs i 0 init msgs i 1 init msgs i 2 init msgs i 3 init msgs i 4 init msgs i 5 if msg save counter else log severe not created mail msg type init msgs i 0 for all init msgs log info counter m msgs null reset return counter createmessages initmsgs mmailmsg mailmsgtype_uservalidation email email nyou nplease mmailmsg mailmsgtype_userpassword nwe nyour mmailmsg mailmsgtype_subscribe nyou nthanks mmailmsg mailmsgtype_unsubscribe nyou nsorry mmailmsg mailmsgtype_orderacknowledgement adempiere nthank nyou nfrom mmailmsg mailmsgtype_paymentacknowledgement adempiere nthank nyou nfrom mmailmsg mailmsgtype_paymenterror adempiere nunfortunately nplease mmailmsg mailmsgtype_request nthank mrequest mrequest nplease mmailmsg mailmsgtype_useraccount m_msgs getmailmsgs m_msgs initmsgs initmsgs m_msgs initmsgs m_msgs getmailmsgtype mmailmsg mmailmsg initmsgs initmsgs initmsgs initmsgs initmsgs initmsgs mailmsgtype initmsgs initmsgs m_msgs basic constructor you need to set the attributes using the set methods public h4 use the set methods to set the values of the attributes param element set the value of lt h4 gt value lt h4 gt public h4 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h4 gt value lt h4 gt public h4 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h4 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h4 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h4 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h4 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h4 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x r categoryupdates properties ctx int r categoryupdates id string trx name super ctx r categoryupdates id trx name if r categoryupdates id 0 setad user id 0 set is self service false setr category id 0 x_r_categoryupdates r_categoryupdates_id trxname r_categoryupdates_id trxname r_categoryupdates_id setad_user_id setisselfservice setr_category_id load constructor public x r categoryupdates properties ctx result set rs string trx name super ctx rs trx name x_r_categoryupdates resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r categoryupdates append get id append return sb to string tostring stringbuffer stringbuffer x_r_categoryupdates get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set category request category public void setr category id int r category id if r category id 1 throw new illegal argument exception r category id is mandatory set valuenocheck r category id new integer r category id setr_category_id r_category_id r_category_id illegalargumentexception r_category_id set_valuenocheck r_category_id r_category_id get category request category public int getr category id integer ii integer get value r category id if ii null return 0 return ii int value getr_category_id get_value r_category_id intvalue get contents return contents public object get contents return contents getcontents m lookup constructor param info info param tab no tab no public m lookup m lookup info info int tab no super info display type info window no m info info log fine m info key column load into local lookup if already cached if m lookup cache load from cache m info m lookup return don t load search or created by updated by if m info display type display type search m info is creaded updated by return don t load parents keys if m info is parent m info is key m hasinactive true creates focus listener for dynamic loading return required when parent needs to be selected e g price from product m loader new m loader if tab no 0 m loader set priority thread norm priority 1 m loader start m loader run test sync call mlookup tabno mlookup mlookupinfo tabno displaytype windowno m_info m_info keycolumn mlookupcache loadfromcache m_info m_lookup createdby updatedby m_info displaytype displaytype m_info iscreadedupdatedby m_info isparent m_info iskey m_hasinactive m_loader mloader tabno m_loader setpriority norm_priority m_loader m_loader dispose public void dispose if m info null log fine m info key column dispose if m loader null m loader is alive m loader interrupt m loader null if m lookup null m lookup clear m lookup null if m lookupdirect null m lookupdirect clear m lookupdirect null m info null super dispose m_info m_info keycolumn m_loader m_loader isalive m_loader m_loader m_lookup m_lookup m_lookup m_lookupdirect m_lookupdirect m_lookupdirect m_info wait until async load complete public void load complete if m loader null m loader is alive try m loader join m loader null catch interrupted exception ie log log level severe m info key column interrupted ie loadcomplete m_loader m_loader isalive m_loader m_loader interruptedexception m_info keycolumn get value name for key if not found return null param key key integer for keys or string for lists return value public name pair get object key if key null minus one equals key indicator for null return null if m info is parent m nextread system current time millis m lookup clear if m lookupdirect null m lookupdirect clear m nextread system current time millis 500 1 2 sec try cache name pair ret value name pair m lookup get key if ret value null return ret value not found and waiting for loader if m loader null m loader is alive log finer m info key column null id m info column id m info key column waiting for loader load complete is most current ret value name pair m lookup get key if ret value null return ret value always check for parents not if we sql was validated and completely loaded if m info is parent m info is validated m allloaded log finer m info key column null key key get class size m lookup size log finest m lookup key set to string contains key m lookup contains key key also for new values and inactive ones return get direct key false true cache locally log finest m info key column key size m lookup size validated m info is validated all loaded m allloaded has inactive m hasinactive never loaded if m allloaded m lookup size 0 m info is creaded updated by m info is parent m info display type display type search m loader new m loader m loader run sync ret value name pair m lookup get key if ret value null return ret value try to get it directly boolean cache local m info is validated return get direct key false cache local do not cache namepair minus_one m_info isparent m_nextread currenttimemillis m_lookup m_lookupdirect m_lookupdirect m_nextread currenttimemillis namepair retvalue namepair m_lookup retvalue retvalue m_loader m_loader isalive m_info keycolumn m_info column_id m_info keycolumn loadcomplete retvalue namepair m_lookup retvalue retvalue m_info isparent m_info isvalidated m_allloaded m_info keycolumn getclass m_lookup m_lookup keyset tostring containskey m_lookup containskey getdirect m_info keycolumn m_lookup m_info isvalidated m_allloaded hasinactive m_hasinactive m_allloaded m_lookup m_info iscreadedupdatedby m_info isparent m_info displaytype displaytype m_loader mloader m_loader retvalue namepair m_lookup retvalue retvalue cachelocal m_info isvalidated getdirect cachelocal get display value name if not found return key embedded in inactive signs param key key return value public string get display object key if key null return object display get key if display null return key to string return display to string getdisplay tostring tostring the lookup contains the key param key key return true if key is known public boolean contains key object key return m lookup contains key key containskey m_lookup containskey return a string representation of the object public string to string return m lookup m info key column column id m info column id size m lookup size validated is validated get validation tostring mlookup m_info keycolumn column_id m_info column_id m_lookup isvalidated getvalidation indicates whether some other object is equal to this one param obj the reference object with which to compare return code true code if this object is the same as the obj argument code false code otherwise public boolean equals object obj if obj instanceof m lookup m lookup ll m lookup obj if ll m info column id this m info column id return true return false mlookup mlookup mlookup m_info column_id m_info column_id return size return size public int size return m lookup size m_lookup is it all loaded return true if all loaded public boolean is all loaded return m allloaded isallloaded m_allloaded is the list fully validated return true if validated public boolean is validated if m info null return false return m info is validated isvalidated m_info m_info isvalidated get validation sql return validation sql public string get validation return m info validation code getvalidation m_info validationcode get reference value return reference value public int getad reference value id return m info ad reference value id getad_reference_value_id m_info ad_reference_value_id has inactive elements in list return true if list contains inactive values public boolean has inactive return m hasinactive hasinactive m_hasinactive return info as array list containing value key name pair param only validated only validated param load parent get data even for parent lookups return list private array list object get data boolean only validated boolean load parent if m loader null m loader is alive log fine m info key column null id m info column id m info key column get data waiting for loader load complete never loaded correctly if m allloaded m lookup size 0 refresh load parent already validation included if m info is validated return new array list object m lookup values if m info is validated only validated refresh load parent log fine m info key column get data validated m lookup size return new array list object m lookup values arraylist keynamepair onlyvalidated loadparent arraylist getdata onlyvalidated loadparent m_loader m_loader isalive m_info keycolumn m_info column_id m_info keycolumn getdata loadcomplete m_allloaded m_lookup loadparent m_info isvalidated arraylist m_lookup m_info isvalidated onlyvalidated loadparent m_info keycolumn getdata m_lookup arraylist m_lookup return data as array containing value key name pair param mandatory if not mandatory an additional empty value is inserted param only validated only validated param only active only active param temporary force load for temporary display return list public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary create list array list object list get data only validated temporary remove inactive choices if only active m hasinactive list from the back for int i list size i 0 i object o list get i 1 if o null string s o to string if s starts with inactive s s ends with inactive e list remove i 1 add optional empty selection if mandatory name pair p null if m info key column null m info key column ends with id p new key name pair 1 else p new value name pair list add 0 p return list keynamepair onlyvalidated onlyactive arraylist getdata onlyvalidated onlyactive arraylist getdata onlyvalidated onlyactive m_hasinactive tostring startswith inactive_s endswith inactive_e namepair m_info keycolumn m_info keycolumn endswith _id keynamepair valuenamepair get data direct from table param key key param save in cache save in cache for r w param cache local cache locally for r o return value public name pair get direct object key boolean save in cache boolean cache local nothing to query if key null m info query direct null m info query direct length 0 return null if key equals m directnullkey return null name pair direct value null if m lookupdirect null lookup cache direct value name pair m lookupdirect get key if direct value null return direct value log finer m info key column key save in cache save in cache local cache local boolean is number m info key column ends with id try select key value name from prepared statement pstmt db prepare statement m info query direct null if is number pstmt set int 1 integer parse int key to string else pstmt set string 1 key to string result set rs pstmt execute query if rs next string name rs get string 3 if is number int key value rs get int 1 key name pair p new key name pair key value name if save in cache save if m lookup put new integer key value p direct value p else string value rs get string 2 value name pair p new value name pair value name if save in cache save if m lookup put value p direct value p if rs next log log level severe m info key column not unique first returned for key sql m info query direct else m directnullkey key direct value null rs close pstmt close if c log mgt is level finest log finest m info key column direct value m info catch exception e log log level severe m info key column sql m info query direct key key e direct value null cache local if not added to r w cache if cache local save in cache direct value null if m lookupdirect null m lookupdirect new hash map object object m lookupdirect put key direct value m hasinactive true return direct value saveincache cachelocal namepair getdirect saveincache cachelocal m_info querydirect m_info querydirect m_directnullkey namepair directvalue m_lookupdirect directvalue namepair m_lookupdirect directvalue directvalue m_info keycolumn saveincache saveincache cachelocal isnumber m_info keycolumn endswith _id preparedstatement preparestatement m_info querydirect isnumber setint parseint tostring setstring tostring resultset executequery getstring isnumber keyvalue getint keynamepair keynamepair keyvalue saveincache m_lookup keyvalue directvalue getstring valuenamepair valuenamepair saveincache m_lookup directvalue m_info keycolumn m_info querydirect m_directnullkey directvalue clogmgt islevelfinest m_info keycolumn directvalue m_info m_info keycolumn m_info querydirect directvalue cachelocal saveincache directvalue m_lookupdirect m_lookupdirect hashmap m_lookupdirect directvalue m_hasinactive directvalue get zoom return zoom window public int get zoom return m info zoom window getzoom m_info zoomwindow get zoom param query query return zoom window public int get zoom m query query if m info zoom windowpo 0 query null return m info zoom window need to check so po boolean isso trx db isso trx m info table name query get where clause false if isso trx return m info zoom windowpo return m info zoom window getzoom mquery m_info zoomwindowpo m_info zoomwindow issotrx issotrx m_info tablename getwhereclause issotrx m_info zoomwindowpo m_info zoomwindow get zoom query string return zoom sql where clause public m query get zoom query return m info zoom query mquery getzoomquery m_info zoomquery get underlying fully qualified table column name return key column public string get column name return m info key column getcolumnname m_info keycolumn refresh return number of items read get get data of parent lookups return no of items read public int refresh return refresh true refresh return number of items read param load parent get data of parent lookups return no of items read public int refresh boolean load parent if load parent m info is parent return 0 don t load search or created by updated by if m info display type display type search m info is creaded updated by return 0 log fine m info key column start m refreshing true m loader new m loader m loader start m loader run test sync call load complete log fine m info key column m lookup size m refreshing false return m lookup size loadparent loadparent loadparent m_info isparent createdby updatedby m_info displaytype displaytype m_info iscreadedupdatedby m_info keycolumn m_refreshing m_loader mloader m_loader m_loader loadcomplete m_info keycolumn m_lookup m_refreshing m_lookup public m loader super m loader m info key column if m info key column index of c invoiceline id 1 log info m info key column mloader mloader m_info keycolumn m_info keycolumn indexof c_invoiceline_id m_info keycolumn load lookup public void run long start time system current time millis m lookup cache load start m info string sql m info query not validated if m info is validated string validation env parse context m info ctx m info window no m info validation code false if validation length 0 m info validation code length 0 log fine m info key column loader not validated m info validation code return else log fine m info key column loader validated validation int pos from sql last index of from boolean has where sql index of where pos from 1 int pos order sql last index of order by if pos order 1 sql sql substring 0 pos order has where and where validation sql substring pos order else sql has where and where validation if c log mgt is level finest log fine m info key column validation validation check if is interrupted log log level warning m info key column loader interrupted return if c log mgt is level finer env set context m info ctx env window mlookup m info column id m info key column sql if c log mgt is level finest log fine m info key column sql reset m lookup clear boolean is number m info key column ends with id m hasinactive false int rows 0 try select key value name is active from prepared statement pstmt db prepare statement sql null result set rs pstmt execute query get first rows m allloaded true while rs next if rows max rows log warning m info key column loader too many records m allloaded false break check for interrupted every 10 rows if rows 20 0 is interrupted break load data string name rs get string 3 boolean is active rs get string 4 equals y if is active name inactive s name inactive e m hasinactive true if is number int key rs get int 1 key name pair p new key name pair key name m lookup put new integer key p else string value rs get string 2 value name pair p new value name pair value name m lookup put value p log fine m info key column name rs close pstmt close catch sql exception e log log level severe m info key column loader sql e int size m lookup size log finer m info key column m info column id id m info ad column id loader complete size all m allloaded ms string value of system current time millis m starttime string value of system current time millis start time if m allloaded m lookup cache load end m info m lookup starttime currenttimemillis mlookupcache loadstart m_info m_info m_info isvalidated parsecontext m_info m_info windowno m_info validationcode m_info validationcode m_info keycolumn m_info validationcode m_info keycolumn posfrom lastindexof haswhere indexof posfrom posorder lastindexof posorder posorder haswhere posorder haswhere clogmgt islevelfinest m_info keycolumn isinterrupted m_info keycolumn clogmgt islevelfiner setcontext m_info window_mlookup m_info column_id m_info keycolumn clogmgt islevelfinest m_info keycolumn m_lookup isnumber m_info keycolumn endswith _id m_hasinactive isactive preparedstatement preparestatement resultset executequery m_allloaded max_rows m_info keycolumn m_allloaded isinterrupted getstring isactive getstring isactive inactive_s inactive_e m_hasinactive isnumber getint keynamepair keynamepair m_lookup getstring valuenamepair valuenamepair m_lookup m_info keycolumn sqlexception m_info keycolumn m_lookup m_info keycolumn m_info column_id m_info ad_column_id m_allloaded valueof currenttimemillis m_starttime valueof currenttimemillis starttime m_allloaded mlookupcache loadend m_info m_lookup prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals start date p startdate timestamp para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter startdate p_startdate getparameter perform process return message text with variables throws exception if not successful protected string do it throws exception log info c commission id getrecord id start date p startdate if p startdate null p startdate new timestamp system current time millis m com new m commission get ctx getrecord id get trxname if m com get id 0 throw new compiere user error no commission create commission m commission run com run new m commission run m com set start end date com run set start date p startdate 01 jan 2000 31 jan 2001 usd simple date format format display type get date format display type date string description format format p startdate format format m enddate m currency getiso code get ctx m com getc currency id com run set description description if com run save throw new compiere system error could not save commission run m commission line lines m com get lines for int i 0 i lines length i amt for line updated by trigger m commission amt com amt new m commission amt com run lines i getc commissionline id if com amt save throw new compiere system error could not save commission amt string buffer sql new string buffer if m commission docbasistype receipt equals m com get doc basis type should go via allocation now only fully paid single allocation if m com is list details sql append select h c currency id l line net amt l qty invoiced null l c invoiceline id p document no h document no coalesce prd value l description h date invoiced from c payment p inner join c invoice h on p c invoice id h c invoice id inner join c invoiceline l on h c invoice id l c invoice id left outer join m product prd on l m product id prd m product id where p doc status in cl co re and h isso trx y and p ad client id and p date trx between and else sql append select h c currency id sum l line net amt as amt sum l qty invoiced as qty null null null null max h date invoiced from c payment p inner join c invoice h on p c invoice id h c invoice id inner join c invoiceline l on h c invoice id l c invoice id where p doc status in cl co re and h isso trx y and p ad client id and p date trx between and else if m commission docbasistype order equals m com get doc basis type if m com is list details sql append select h c currency id l line net amt l qty ordered l c orderline id null h document no coalesce prd value l description h date ordered from c order h inner join c orderline l on h c order id l c order id left outer join m product prd on l m product id prd m product id where h doc status in cl co and h isso trx y and h ad client id and h date ordered between and else sql append select h c currency id sum l line net amt as amt sum l qty ordered as qty null null null null max h date ordered from c order h inner join c orderline l on h c order id l c order id where h doc status in cl co and h isso trx y and h ad client id and h date ordered between and else invoice basis if m com is list details sql append select h c currency id l line net amt l qty invoiced null l c invoiceline id h document no coalesce prd value l description h date invoiced from c invoice h inner join c invoiceline l on h c invoice id l c invoice id left outer join m product prd on l m product id prd m product id where h doc status in cl co re and h isso trx y and h ad client id and h date invoiced between and else sql append select h c currency id sum l line net amt as amt sum l qty invoiced as qty null null null null max h date invoiced from c invoice h inner join c invoiceline l on h c invoice id l c invoice id where h doc status in cl co re and h isso trx y and h ad client id and h date invoiced between and commission orders invoices if lines i is commission orders m user users m user get ofb partner get ctx m com getc bpartner id if users null users length 0 throw new compiere user error commission business partner has no users contact if users length 1 int salesrep id users 0 getad user id sql append and h salesrep id append salesrep id else log warning not 1 user contact for c bpartner id m com getc bpartner id but users length sql append and h salesrep id in select ad user id from ad user where c bpartner id append m com getc bpartner id append organization if lines i getorg id 0 sql append and h ad org id append lines i getorg id b partner if lines i getc bpartner id 0 sql append and h c bpartner id append lines i getc bpartner id b partner group if lines i getc bp group id 0 sql append and h c bpartner id in select c bpartner id from c bpartner where c bp group id append lines i getc bp group id append sales region if lines i getc salesregion id 0 sql append and h c bpartner location id in select c bpartner location id from c bpartner location where c salesregion id append lines i getc salesregion id append product if lines i getm product id 0 sql append and l m product id append lines i getm product id product category if lines i getm product category id 0 sql append and l m product id in select m product id from m product where m product category id append lines i getm product category id append grouping if m com is list details sql append group by h c currency id log fine line lines i get line sql create detail sql to string com amt com amt calculate commission com amt save for all commission lines com run update from amt com run save save last run m com set date last run p startdate m com save return c commissionrun id com run get document no com run get description doit c_commission_id getrecord_id startdate p_startdate p_startdate p_startdate currenttimemillis m_com mcommission getctx getrecord_id get_trxname m_com get_id compiereusererror mcommissionrun comrun mcommissionrun m_com setstartenddate comrun setstartdate p_startdate simpledateformat displaytype getdateformat displaytype p_startdate m_enddate mcurrency getiso_code getctx m_com getc_currency_id comrun setdescription comrun compieresystemerror mcommissionline m_com getlines mcommissionamt comamt mcommissionamt comrun getc_commissionline_id comamt compieresystemerror stringbuffer stringbuffer mcommission docbasistype_receipt m_com getdocbasistype m_com islistdetails c_currency_id linenetamt qtyinvoiced c_invoiceline_id documentno _ documentno dateinvoiced c_payment c_invoice c_invoice_id c_invoice_id c_invoiceline c_invoice_id c_invoice_id m_product m_product_id m_product_id docstatus issotrx ad_client_id datetrx c_currency_id linenetamt qtyinvoiced dateinvoiced c_payment c_invoice c_invoice_id c_invoice_id c_invoiceline c_invoice_id c_invoice_id docstatus issotrx ad_client_id datetrx mcommission docbasistype_order m_com getdocbasistype m_com islistdetails c_currency_id linenetamt qtyordered c_orderline_id documentno dateordered c_order c_orderline c_order_id c_order_id m_product m_product_id m_product_id docstatus issotrx ad_client_id dateordered c_currency_id linenetamt qtyordered dateordered c_order c_orderline c_order_id c_order_id docstatus issotrx ad_client_id dateordered m_com islistdetails c_currency_id linenetamt qtyinvoiced c_invoiceline_id documentno dateinvoiced c_invoice c_invoiceline c_invoice_id c_invoice_id m_product m_product_id m_product_id docstatus issotrx ad_client_id dateinvoiced c_currency_id linenetamt qtyinvoiced dateinvoiced c_invoice c_invoiceline c_invoice_id c_invoice_id docstatus issotrx ad_client_id dateinvoiced commissionorders iscommissionorders muser muser getofbpartner getctx m_com getc_bpartner_id compiereusererror salesrep_id getad_user_id salesrep_id salesrep_id c_bpartner_id m_com getc_bpartner_id salesrep_id ad_user_id ad_user c_bpartner_id m_com getc_bpartner_id getorg_id ad_org_id getorg_id bpartner getc_bpartner_id c_bpartner_id getc_bpartner_id bpartner getc_bp_group_id c_bpartner_id c_bpartner_id c_bpartner c_bp_group_id getc_bp_group_id getc_salesregion_id c_bpartner_location_id c_bpartner_location_id c_bpartner_location c_salesregion_id getc_salesregion_id getm_product_id m_product_id getm_product_id getm_product_category_id m_product_id m_product_id m_product m_product_category_id getm_product_category_id m_com islistdetails c_currency_id getline createdetail tostring comamt comamt calculatecommission comamt comrun updatefromamt comrun m_com setdatelastrun p_startdate m_com c_commissionrun_id comrun getdocumentno comrun getdescription set start and end date private void set start end date gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis p startdate get time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 yearly if m commission frequencytype yearly equals m com get frequency type cal set calendar day of year 1 p startdate new timestamp cal get time in millis cal add calendar year 1 cal add calendar day of year 1 m enddate new timestamp cal get time in millis quarterly else if m commission frequencytype quarterly equals m com get frequency type cal set calendar day of month 1 int month cal get calendar month if month calendar april cal set calendar month calendar january else if month calendar july cal set calendar month calendar april else if month calendar october cal set calendar month calendar july else cal set calendar month calendar october p startdate new timestamp cal get time in millis cal add calendar month 3 cal add calendar day of year 1 m enddate new timestamp cal get time in millis weekly else if m commission frequencytype weekly equals m com get frequency type cal set calendar day of week calendar sunday p startdate new timestamp cal get time in millis cal add calendar day of year 7 m enddate new timestamp cal get time in millis monthly else cal set calendar day of month 1 p startdate new timestamp cal get time in millis cal add calendar month 1 cal add calendar day of year 1 m enddate new timestamp cal get time in millis log fine set start end date p startdate m enddate string sd db to date p startdate true string buffer sql new string buffer select if m commission frequencytype quarterly equals m com get frequency type sql append trunc append sd append q trunc append sd append 92 q 1 else if m commission frequencytype weekly equals m com get frequency type sql append trunc append sd append day trunc append sd append 7 day 1 else month sql append trunc append sd append mm trunc append sd append 31 mm 1 sql append from dual setstartenddate gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis p_startdate gettime hour_of_day mcommission frequencytype_yearly m_com getfrequencytype day_of_year p_startdate gettimeinmillis day_of_year m_enddate gettimeinmillis mcommission frequencytype_quarterly m_com getfrequencytype day_of_month p_startdate gettimeinmillis day_of_year m_enddate gettimeinmillis mcommission frequencytype_weekly m_com getfrequencytype day_of_week p_startdate gettimeinmillis day_of_year m_enddate gettimeinmillis day_of_month p_startdate gettimeinmillis day_of_year m_enddate gettimeinmillis setstartenddate p_startdate m_enddate to_date p_startdate stringbuffer stringbuffer mcommission frequencytype_quarterly m_com getfrequencytype mcommission frequencytype_weekly m_com getfrequencytype create commission detail param sql sql statement param com amt parent private void create detail string sql m commission amt com amt prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 m com getad client id pstmt set timestamp 2 p startdate pstmt set timestamp 3 m enddate result set rs pstmt execute query while rs next commission amount c currency id amt qty m commission detail cd new m commission detail com amt rs get int 1 rs get big decimal 2 rs get big decimal 3 c orderline id c invoiceline id cd set linei ds rs get int 4 rs get int 5 reference info string s rs get string 6 if s null cd set reference s s rs get string 7 if s null cd set info s date timestamp date rs get timestamp 8 cd set converted amt date if cd save creates memory leak throw new illegal argument exception commission calc detail not saved rs close pstmt close pstmt null catch exception e log log level severe create detail e try if pstmt null pstmt close pstmt null catch exception e pstmt null comamt createdetail mcommissionamt comamt preparedstatement preparestatement get_trxname setint m_com getad_client_id settimestamp p_startdate settimestamp m_enddate resultset executequery commissionamount c_currency_id mcommissiondetail mcommissiondetail comamt getint getbigdecimal getbigdecimal c_orderline_id c_invoiceline_id setlineids getint getint getstring setreference getstring setinfo gettimestamp setconvertedamt illegalargumentexception commissioncalc createdetail prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals search inout id p search inout id para i get parameter as int else if name equals search order id p search order id para i get parameter as int else if name equals search invoice id p search invoice id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter search_inout_id p_search_inout_id getparameterasint search_order_id p_search_order_id getparameterasint search_invoice_id p_search_invoice_id getparameterasint process it return info throws exception if error protected string do it throws exception log info m inout id p search inout id c order id p search order id c invoice id p search invoice id if p search inout id 0 insert trx select nvl ma m attributesetinstance id iol m attributesetinstance id from m inoutline iol left outer join m inoutlinema ma on iol m inoutline id ma m inoutline id where m inout id p search inout id else if p search order id 0 insert trx select nvl ma m attributesetinstance id iol m attributesetinstance id from m inoutline iol left outer join m inoutlinema ma on iol m inoutline id ma m inoutline id inner join m inout io on iol m inout id io m inout id where io c order id p search order id else if p search invoice id 0 insert trx select nvl ma m attributesetinstance id iol m attributesetinstance id from m inoutline iol left outer join m inoutlinema ma on iol m inoutline id ma m inoutline id inner join c invoiceline il on iol m inoutline id il m inoutline id where il c invoice id p search invoice id else throw new compiere user error select one parameter return doit m_inout_id p_search_inout_id c_order_id p_search_order_id c_invoice_id p_search_invoice_id p_search_inout_id inserttrx m_attributesetinstance_id m_attributesetinstance_id m_inoutline m_inoutlinema m_inoutline_id m_inoutline_id m_inout_id p_search_inout_id p_search_order_id inserttrx m_attributesetinstance_id m_attributesetinstance_id m_inoutline m_inoutlinema m_inoutline_id m_inoutline_id m_inout m_inout_id m_inout_id c_order_id p_search_order_id p_search_invoice_id inserttrx m_attributesetinstance_id m_attributesetinstance_id m_inoutline m_inoutlinema m_inoutline_id m_inoutline_id c_invoiceline m_inoutline_id m_inoutline_id c_invoice_id p_search_invoice_id compiereusererror get trx param sql sub select sql private void insert trx string sql sub select string sql insert into t transaction ad pinstance id m transaction id ad client id ad org id is active created created by updated updated by movement type m locator id m product id m attributesetinstance id movement date movement qty m inoutline id m inout id m movementline id m movement id m inventoryline id m inventory id c projectissue id c project id m productionline id m production id search order id search invoice id search inout id data select getad pinstance id m transaction id ad client id ad org id is active created created by updated updated by movement type m locator id m product id m attributesetinstance id movement date movement qty m inoutline id m inout id m movementline id m movement id m inventoryline id m inventory id c projectissue id c project id m productionline id m production id parameter p search order id p search invoice id p search inout id from m transaction v where m attributesetinstance id 0 and m attributesetinstance id in sql sub select order by m transaction id int no db execute update sql get trxname log fine sql log config no multi level sqlsubselect inserttrx sqlsubselect t_transaction ad_pinstance_id m_transaction_id ad_client_id ad_org_id isactive createdby updatedby movementtype m_locator_id m_product_id m_attributesetinstance_id movementdate movementqty m_inoutline_id m_inout_id m_movementline_id m_movement_id m_inventoryline_id m_inventory_id c_projectissue_id c_project_id m_productionline_id m_production_id search_order_id search_invoice_id search_inout_id getad_pinstance_id m_transaction_id ad_client_id ad_org_id isactive createdby updatedby movementtype m_locator_id m_product_id m_attributesetinstance_id movementdate movementqty m_inoutline_id m_inout_id m_movementline_id m_movement_id m_inventoryline_id m_inventory_id c_projectissue_id c_project_id m_productionline_id m_production_id p_search_order_id p_search_invoice_id p_search_inout_id m_transaction_v m_attributesetinstance_id m_attributesetinstance_id sqlsubselect m_transaction_id executeupdate get_trxname standard constructor public x pa reportlineset properties ctx int pa reportlineset id string trx name super ctx pa reportlineset id trx name if pa reportlineset id 0 set name null setpa reportlineset id 0 set processing false x_pa_reportlineset pa_reportlineset_id trxname pa_reportlineset_id trxname pa_reportlineset_id setname setpa_reportlineset_id setprocessing load constructor public x pa reportlineset properties ctx result set rs string trx name super ctx rs trx name x_pa_reportlineset resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa reportlineset append get id append return sb to string tostring stringbuffer stringbuffer x_pa_reportlineset get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set report line set public void setpa reportlineset id int pa reportlineset id if pa reportlineset id 1 throw new illegal argument exception pa reportlineset id is mandatory set valuenocheck pa reportlineset id new integer pa reportlineset id setpa_reportlineset_id pa_reportlineset_id pa_reportlineset_id illegalargumentexception pa_reportlineset_id set_valuenocheck pa_reportlineset_id pa_reportlineset_id get report line set public int getpa reportlineset id integer ii integer get value pa reportlineset id if ii null return 0 return ii int value getpa_reportlineset_id get_value pa_reportlineset_id intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor param ctx ctx param c taxdeclarationacct id id param trx name trc public m tax declaration acct properties ctx int c taxdeclarationacct id string trx name super ctx c taxdeclarationacct id trx name c_taxdeclarationacct_id trxname mtaxdeclarationacct c_taxdeclarationacct_id trxname c_taxdeclarationacct_id trxname load constructor param ctx ctx param rs result set param trx name trx public m tax declaration acct properties ctx result set rs string trx name super ctx rs trx name trxname mtaxdeclarationacct resultset trxname trxname parent constructor param parent parent param fact fact public m tax declaration acct m tax declaration parent m fact acct fact super parent get ctx 0 parent get trxname set client org fact setc taxdeclaration id parent getc taxdeclaration id setfact acct id fact getfact acct id setc acctschema id fact getc acctschema id mtaxdeclarationacct mtaxdeclaration mfactacct getctx get_trxname setclientorg setc_taxdeclaration_id getc_taxdeclaration_id setfact_acct_id getfact_acct_id setc_acctschema_id getc_acctschema_id detail constructor param format print format param data print data param query query for parameter info public layout engine m print format format print data data m query query log info format data query s fastdraw m client get format get ctx is use beta functions set print format format false set print data data query false layout layoutengine mprintformat printdata mquery s_fastdraw mclient getctx isusebetafunctions setprintformat setprintdata set print format optionally re calculate layout param do layout if layout exists redo it param format print format public void set print format m print format format boolean do layout m format format initial default settings m printctx new properties format get ctx set paper boolean temp has layout m haslayout m haslayout false do not start re calculation m print paper m paper m print paper get format getad printpaper id if m format is standard header footer set paper m paper getc paper else set paper m paper getc paper m format get header margin m format get footer margin m haslayout temp has layout m printcolor m print color get get ctx format getad printcolor id m printfont m print font get format getad printfont id print context env set context m printctx page context reportname m format get name env set context m printctx page context header env get header m printctx 0 env set context m printctx env language m format get language getad language if m haslayout do layout layout re calculate dolayout setprintformat mprintformat dolayout m_format m_printctx getctx temphaslayout m_haslayout m_haslayout mprintpaper mpaper mprintpaper getad_printpaper_id m_format isstandardheaderfooter setpaper mpaper getcpaper setpaper mpaper getcpaper m_format getheadermargin m_format getfootermargin m_haslayout temphaslayout m_printcolor mprintcolor getctx getad_printcolor_id m_printfont mprintfont getad_printfont_id setcontext m_printctx context_reportname m_format getname setcontext m_printctx context_header getheader m_printctx setcontext m_printctx m_format getlanguage getad_language m_haslayout dolayout set print data optionally re calculate layout param data data param do layout if layout exists redo it param query query for parameter public void set print data print data data m query query boolean do layout m data data m query query if m haslayout do layout layout re calculate printdata dolayout setprintdata printdata mquery dolayout m_data m_query m_haslayout dolayout set paper param paper paper public void set paper c paper paper set paper paper m headerheight m footerheight setpaper cpaper setpaper m_headerheight m_footerheight set paper optionally re calculate layout param paper paper param header height header height param footer height footer height public void set paper c paper paper int header height int footer height if paper null return boolean paper change header height m headerheight footer height m footerheight if paper change paper change paper equals m paper log fine paper header header height footer footer height m paper paper m headerheight header height m footerheight footer height calculate page size if m haslayout paper change layout re calculate headerheight footerheight setpaper cpaper headerheight footerheight paperchange headerheight m_headerheight footerheight m_footerheight paperchange paperchange m_paper headerheight footerheight m_paper m_headerheight headerheight m_footerheight footerheight calculatepagesize m_haslayout paperchange show dialog and set paper optionally re calculate layout param job printer job public void page setup dialog printer job job log info if m paper page setup dialog job set paper m paper layout pagesetupdialog printerjob m_paper pagesetupdialog setpaper m_paper set paper from page format page format is derived from c paper param pf optional page format if null standard paper portrait protected void set page format page format pf if pf null set paper new c paper pf else set paper null pageformat cpaper pageformat setpageformat pageformat setpaper cpaper setpaper get page format return page format public page format get page format return m paper get page format pageformat getpageformat m_paper getpageformat calculate page size based on paper and header footer height pre paper 8 5x11 0 portrait x 32 0 y 32 0 w 548 0 h 728 0 paper 612x792 non imageable space 32x32 header printable area start header height 32 x 32 y 32 width 548 height 32 content x 32 y 64 width 548 height 664 footer footer height 32 x 32 y 728 width 548 height 32 footer end printable area end non imageable space pre private void calculate page size int x int m paper get imageablex true int w int m paper get imageable width true int y int m paper get imageabley true int h int m paper get imageable height true int height m headerheight m header set bounds x y w height y height height h m headerheight m footerheight m content set bounds x y w height y height height m footerheight m footer set bounds x y w height log fine paper m paper header height m headerheight footer height m footerheight header m header contents m content footer m footer footerheight headerheight footerheight calculatepagesize m_paper getimageablex m_paper getimageablewidth m_paper getimageabley m_paper getimageableheight m_headerheight m_header setbounds m_headerheight m_footerheight m_content setbounds m_footerheight m_footer setbounds m_paper headerheight m_headerheight footerheight m_footerheight m_header m_content m_footer set paper return paper public c paper get paper return m paper cpaper getpaper m_paper create layout private void layout header footer m headerfooter new header footer m printctx if m format is form m format is standard header footer create standard header footer m pageno 0 m pages clear m tableelement null new page true false initialize if m format is form layout form else parameter print element element layout parameter if element null m currpage add element element element set location m position area content m position area content y element get height 5 gap table if m data null element layout table m format m data 0 element set location m content get location for int p 1 p element get page count p if p 1 new page true false m currpage add element element string page info string value of m pages size get page info m pages size env set context m printctx page context pagecount page info timestamp now new timestamp system current time millis env set context m printctx page context date display type get date format display type date m format get language format now env set context m printctx page context time display type get date format display type date time m format get language format now update page info int pages m pages size for int i 0 i pages i page page page m pages get i int page no page get page no page info string value of page no get page info page no page set page info page info page set page count pages m haslayout true m_headerfooter headerfooter m_printctx m_format isform m_format isstandardheaderfooter createstandardheaderfooter m_pageno m_pages m_tableelement newpage m_format isform layoutform printelement layoutparameter m_currpage addelement setlocation m_position area_content m_position area_content getheight m_data layouttable m_format m_data setlocation m_content getlocation getpagecount newpage m_currpage addelement pageinfo valueof m_pages getpageinfo m_pages setcontext m_printctx context_pagecount pageinfo currenttimemillis setcontext m_printctx context_date displaytype getdateformat displaytype m_format getlanguage setcontext m_printctx context_time displaytype getdateformat displaytype datetime m_format getlanguage m_pages m_pages pageno getpageno pageinfo valueof pageno getpageinfo pageno setpageinfo pageinfo setpagecount m_haslayout get print layout report context return context public properties get ctx return m printctx printlayout getctx m_printctx get the number of printed columns return no of printed columns public int get column count return m columncount getcolumncount m_columncount set the current print area param area see header constants protected void set area int area if m area area return if area 0 area 2 throw new array index out of bounds exception area m area area header_ setarea m_area arrayindexoutofboundsexception m_area get the current print area return area see header constants public int get area return m area header_ getarea m_area return bounds of current area return rectangle with bounds public rectangle get area bounds rectangle part m content if m area area header part m header else if m area area footer part m footer return part getareabounds m_content m_area area_header m_header m_area area_footer m_footer create new page set position to top content param force if false will check if nothing printed so far param preservex pos preserve x position of content area return new page no protected int new page boolean force boolean preservex pos we are on a new page if force m position area content getx m content x m position area content gety m content y log fine skipped return m pageno m pageno m currpage new page m printctx m pageno m pages add m currpage m position area header set location m header x m header y if preservex pos m position area content set location m position area content x m content y else m position area content set location m content x m content y m position area footer set location m footer x m footer y m maxheightsincenewline new float 0f 0f 0f log finer page m pageno return m pageno preservexpos newpage preservexpos m_position area_content m_content m_position area_content m_content m_pageno m_pageno m_currpage m_printctx m_pageno m_pages m_currpage m_position area_header setlocation m_header m_header preservexpos m_position area_content setlocation m_position area_content m_content m_position area_content setlocation m_content m_content m_position area_footer setlocation m_footer m_footer m_maxheightsincenewline m_pageno m_pageno move to new line may cause new page protected void new line rectangle part m content if m area area header part m header else if m area area footer part m footer temporary nl position int x pos part x if m tempnlpositon 0 x pos m tempnlpositon if is yspace for m maxheightsincenewline m area m position m area set location x pos m position m area y m maxheightsincenewline m area log finest page m pageno m area m position m area x m position m area y else if m area area content log finest not enough y space m lastheight m area remaining get yspace area m area new page true false log finest page m pageno m area m position m area x m position m area y else footer header m position m area set location part x m position m area y m maxheightsincenewline m area log log level severe outside of area m area m position m area m maxheightsincenewline m area 0f newline m_content m_area area_header m_header m_area area_footer m_footer xpos m_tempnlpositon xpos m_tempnlpositon isyspacefor m_maxheightsincenewline m_area m_position m_area setlocation xpos m_position m_area m_maxheightsincenewline m_area m_pageno m_area m_position m_area m_position m_area m_area area_content m_lastheight m_area getyspace m_area newpage m_pageno m_area m_position m_area m_position m_area m_position m_area setlocation m_position m_area m_maxheightsincenewline m_area m_area m_position m_area m_maxheightsincenewline m_area get current page number not zero based return page no public int get page no return m pageno getpageno m_pageno get page no param page no page number not zero based return page public page get page int page no if page no 0 page no m pages size log log level severe no page page no return null page ret value page m pages get page no 1 return ret value pageno getpage pageno pageno pageno m_pages pageno retvalue m_pages pageno retvalue get pages return pages in array list public array list get pages return m pages arraylist arraylist getpages m_pages get header footer info return header footer public header footer get header footer return m headerfooter headerfooter getheaderfooter m_headerfooter set current page to page no param page no page number not zero based protected void set page int page no if page no 0 page no m pages size log log level severe no page page no return page ret value page m pages get page no 1 m currpage ret value pageno setpage pageno pageno pageno m_pages pageno retvalue m_pages pageno m_currpage retvalue get page info for multi page tables param page no page return info e g 1 1 public string get page info int page no if m tableelement null m tableelement get pagex count 1 return int pi m tableelement get page index page no string buffer sb new string buffer sb append m tableelement get pagey index pi 1 append append m tableelement get pagex index pi 1 append return sb to string pageno getpageinfo pageno m_tableelement m_tableelement getpagexcount m_tableelement getpageindex pageno stringbuffer stringbuffer m_tableelement getpageyindex m_tableelement getpagexindex tostring get max page info for multi page tables return info e g 3 2 public string get page info max if m tableelement null m tableelement get pagex count 1 return string buffer sb new string buffer sb append m tableelement get pagey count append append m tableelement get pagex count append return sb to string getpageinfomax m_tableelement m_tableelement getpagexcount stringbuffer stringbuffer m_tableelement getpageycount m_tableelement getpagexcount tostring get format model return model public m print format get format return m format mprintformat getformat m_format get print interface pageable printable doc param is copy true if it is a document copy return this if nothing to print public layout engine get pageable boolean is copy set copy is copy if get number of pages 0 archive engine is valid this log warning nothing to print to string return null return this iscopy layoutengine getpageable iscopy setcopy iscopy getnumberofpages archiveengine isvalid tostring set position on current page no check param p point relative in area protected void set relative position point2d p if p null return rectangle part m content if m area area header part m header else if m area area footer part m footer m position m area set location part x p getx part y p gety log finest page m pageno m area m position m area x m position m area y setrelativeposition m_content m_area area_header m_header m_area area_footer m_footer m_position m_area setlocation m_pageno m_area m_position m_area m_position m_area set position on current page no check param x x position in 1 72 inch param y y position in 1 72 inch protected void set relative position float x float y set relative position new point2d float x y setrelativeposition setrelativeposition get the current position on current page return current position public point2d get position return m position m area getposition m_position m_area set x position on current page param x x position in 1 72 inch protected void setx float x m position m area x x log finest page m pageno m area m position m area x m position m area y m_position m_area m_pageno m_area m_position m_area m_position m_area add to x position on current page param x offset add offset to x position in 1 72 inch protected void addx float x offset if x offset 0f return m position m area x x offset log finest page m pageno m area m position m area x m position m area y xoffset xoffset xoffset m_position m_area xoffset m_pageno m_area m_position m_area m_position m_area get x position on current page return x position in 1 72 inch public float getx return float m position m area x m_position m_area set y position on current page param y y position in 1 72 inch protected void sety int y m position m area y y log finest page m pageno m area m position m area x m position m area y m_position m_area m_pageno m_area m_position m_area m_position m_area add to y position may cause new page param y offset add offset to y position in 1 72 inch protected void addy int y offset if y offset 0f return if is yspace for y offset m position m area y y offset log finest page m pageno m area m position m area x m position m area y else if m area area content log finest not enough y space m lastheight m area remaining get yspace area m area new page true true log finest page m pageno m area m position m area x m position m area y else m position m area y y offset log log level severe outside of area m position yoffset yoffset yoffset isyspacefor yoffset m_position m_area yoffset m_pageno m_area m_position m_area m_position m_area m_area area_content m_lastheight m_area getyspace m_area newpage m_pageno m_area m_position m_area m_position m_area m_position m_area yoffset m_position get y position on current page return y position in 1 72 inch public float gety return float m position m area y m_position m_area return remaining x dimension space on current page in area return space in 1 72 inch remaining in line public float get xspace rectangle part m content if m area area header part m header else if m area area footer part m footer return float part x part width m position m area x _ getxspace m_content m_area area_header m_header m_area area_footer m_footer m_position m_area remaining space is ok for width in area param width width return true if width fits in area public boolean is xspace for float width return get xspace width 0f isxspacefor getxspace return remaining y dimension space on current page in area return space in 1 72 inch remaining on page public float get yspace rectangle part m content if m area area header part m header else if m area area footer part m footer return float part y part height m position m area y getyspace m_content m_area area_header m_header m_area area_footer m_footer m_position m_area remaining space is ok for height in area param height height return true if height fits in area public boolean is yspace for float height return get yspace height 0f isyspacefor getyspace create standard header footer pre title c page x of x copyright who date time pre private void create standard header footer print element element new image element org compiere compiere get image logo small true 48x15 element new image element org compiere compiere get image logo 100x30 element layout 48 15 false m print format item fieldalignmenttype leadingleft element set location m header get location m headerfooter add element element m print table format tf m format get table format font font tf getpageheader font color color tf getpageheaderfg color element new string element report name font color null true element layout m header width 0 true m print format item fieldalignmenttype center element set location m header get location m headerfooter add element element element new string element page page of page count font color null true element layout m header width 0 true m print format item fieldalignmenttype trailingright element set location m header get location m headerfooter add element element footer font tf getpagefooter font color tf getpagefooterfg color element new string element compiere compiere r font color null true if you have a valid com piere support contract you can use the following element new string element compiere name font color null true element layout m footer width 0 true m print format item fieldalignmenttype leadingleft point ft m footer get location ft y m footer height element get height 2 2pt above min element set location ft m headerfooter add element element element new string element header font color null true element layout m footer width 0 true m print format item fieldalignmenttype center element set location ft m headerfooter add element element element new string element current date time font color null true element layout m footer width 0 true m print format item fieldalignmenttype trailingright element set location ft m headerfooter add element element createstandardheaderfooter printelement imageelement getimagelogosmall imageelement getimagelogo mprintformatitem fieldalignmenttype_leadingleft setlocation m_header getlocation m_headerfooter addelement mprinttableformat m_format gettableformat getpageheader_font getpageheaderfg_color stringelement reportname m_header mprintformatitem fieldalignmenttype_center setlocation m_header getlocation m_headerfooter addelement stringelement pagecount m_header mprintformatitem fieldalignmenttype_trailingright setlocation m_header getlocation m_headerfooter addelement getpagefooter_font getpagefooterfg_color stringelement compiere_r compiere stringelement m_footer mprintformatitem fieldalignmenttype_leadingleft m_footer getlocation m_footer getheight setlocation m_headerfooter addelement stringelement m_footer mprintformatitem fieldalignmenttype_center setlocation m_headerfooter addelement stringelement currentdatetime m_footer mprintformatitem fieldalignmenttype_trailingright setlocation m_headerfooter addelement layout form for every row loop through the format and calculate element size and position private void layout form log info layout form m columncount 0 if m data null return for every row for int row 0 row m data get row count row log info row row m data set row index row boolean something printed true prevent nl of nothing printed and supress null for every item for int i 0 i m format get item count i m print format item item m format get item i log fine layout form row row i item if item is printed continue log fine layout form row row i item m columncount read header footer just once if row 0 item is header item is footer continue position if item is header area set area area header else if item is footer set area area footer else set area area content if item is setnl position item is relative position m tempnlpositon 0 new page line if item is next page item is page break new page new page false false else if item is next line something printed new line new line something printed false else addx m lastwidth m area relative position space if item is relative position addx item getx space addy item gety space else absolute relative position set relative position item getx position item gety position temporary nl position when absolute positioned if item is setnl position item is relative position m tempnlpositon int get position getx line alignment string alignment item get field alignment type int max width item get max width boolean line aligned false if item is relative position if item is line align leading alignment m print format item fieldalignmenttype leadingleft max width get area bounds width line aligned true else if item is line align center alignment m print format item fieldalignmenttype center max width get area bounds width line aligned true else if item is line align trailing alignment m print format item fieldalignmenttype trailingright max width get area bounds width line aligned true type print element element null if item is type print format included print format element include format item m data else if item is type image image if item is image field element create image element item else if item is image is attached element image element get item get id else element image element get item get imageurl element layout max width item get max height false alignment else if item is type field field if max width 0 item is field align block max width get area bounds width element create field element item max width alignment m format is form else if item is type box line box if m format is form element create box element item else item is type text text if max width 0 item is field align block max width get area bounds width element create string element item get print name m format get language item getad printcolor id item getad printfont id max width item get max height item is height one line alignment true printed set last width height if element null something printed true if line aligned m lastwidth m area element get width m lastheight m area element get height else something printed false m lastwidth m area 0f m lastheight m area 0f does it fit if item is relative position line aligned if is xspace for m lastwidth m area log finest not enough x space for m lastwidth m area remaining get xspace area m area new line if m area area content is yspace for m lastheight m area log finest not enough y space m lastheight m area remaining get yspace area m area new page true true we know position and size log fine layout engine layout form page m pageno m area m position m area x m position m area y w last width m area h last height m area item if element null element set location m position m area add to area if m area area content m currpage add element element else m headerfooter add element element if m lastheight m area m maxheightsincenewline m area m maxheightsincenewline m area m lastheight m area for every item for every row layoutform layoutform m_columncount m_data m_data getrowcount m_data setrowindex somethingprinted m_format getitemcount mprintformatitem m_format getitem layoutform isprinted layoutform m_columncount isheader isfooter isheader setarea area_header isfooter setarea area_footer setarea area_content issetnlposition isrelativeposition m_tempnlpositon isnextpage ispagebreak newpage isnextline somethingprinted newline somethingprinted m_lastwidth m_area isrelativeposition getxspace getyspace setrelativeposition getxposition getyposition issetnlposition isrelativeposition m_tempnlpositon getposition getfieldalignmenttype maxwidth getmaxwidth linealigned isrelativeposition islinealignleading mprintformatitem fieldalignmenttype_leadingleft maxwidth getareabounds linealigned islinealigncenter mprintformatitem fieldalignmenttype_center maxwidth getareabounds linealigned islinealigntrailing mprintformatitem fieldalignmenttype_trailingright maxwidth getareabounds linealigned printelement istypeprintformat printformat includeformat m_data istypeimage isimagefield createimageelement isimageisattached imageelement get_id imageelement getimageurl maxwidth getmaxheight istypefield maxwidth isfieldalignblock maxwidth getareabounds createfieldelement maxwidth m_format isform istypebox m_format isform createboxelement istypetext maxwidth isfieldalignblock maxwidth getareabounds createstringelement getprintname m_format getlanguage getad_printcolor_id getad_printfont_id maxwidth getmaxheight isheightoneline somethingprinted linealigned m_lastwidth m_area getwidth m_lastheight m_area getheight somethingprinted m_lastwidth m_area m_lastheight m_area isrelativeposition linealigned isxspacefor m_lastwidth m_area m_lastwidth m_area getxspace m_area newline m_area area_content isyspacefor m_lastheight m_area m_lastheight m_area getyspace m_area newpage layoutengine layoutform m_pageno m_area m_position m_area m_position m_area lastwidth m_area lastheight m_area setlocation m_position m_area m_area area_content m_currpage addelement m_headerfooter addelement m_lastheight m_area m_maxheightsincenewline m_area m_maxheightsincenewline m_area m_lastheight m_area include table format param item print format item return print element private print element include format m print format item item print data data new line print element element null m print format format m print format get get ctx item getad printformatchild id false format set language m format get language if m format is translation view format set translation language m format get language int ad column id item getad column id log info format item item get name ad column id object obj data get node new integer ad column id object obj data get node item get column name slower if obj null data dump header data dump current row log log level severe no node ad column id ad column id item data return null print data element data element print data element obj string record string data element get value key if record string null record string length 0 data dump header data dump current row log log level severe no record key data element ad column id ad column id item return null int record id 0 try record id integer parse int record string catch exception e data dump current row log log level severe invalid record key record string e get message ad column id ad column id item return null m query query new m query format getad table id query add restriction item get column name m query equal new integer record id format set translation view query query log fine query to string data engine de new data engine format get language print data included data de get print data data get ctx format query log fine included data to string if included data null return null element layout table format included data item getx space handle multi page tables if element get page count 1 point2d double loc m position m area element set location loc for int p 1 p element get page count p don t add last one m currpage add element element new page true false m position m area loc table element element set height to last page m lastwidth m area element get width m lastheight m area element get height if is xspace for m lastwidth m area log finest not enough x space for m lastwidth m area remaining get xspace area m area new line if m area area content is yspace for m lastheight m area log finest not enough y space m lastheight m area remaining get yspace area m area new page true false return element printelement includeformat mprintformatitem printdata newline printelement mprintformat mprintformat getctx getad_printformatchild_id setlanguage m_format getlanguage m_format istranslationview settranslationlanguage m_format getlanguage ad_column_id getad_column_id getname ad_column_id getnode ad_column_id getnode getcolumnname dumpheader dumpcurrentrow ad_column_id ad_column_id printdataelement dataelement printdataelement recordstring dataelement getvaluekey recordstring recordstring dumpheader dumpcurrentrow dataelement ad_column_id ad_column_id record_id record_id parseint recordstring dumpcurrentrow recordstring getmessage ad_column_id ad_column_id mquery mquery getad_table_id addrestriction getcolumnname mquery record_id settranslationviewquery tostring dataengine dataengine getlanguage printdata includeddata getprintdata getctx includeddata tostring includeddata layouttable includeddata getxspace getpagecount m_position m_area setlocation getpagecount m_currpage addelement newpage m_position m_area tableelement setheighttolastpage m_lastwidth m_area getwidth m_lastheight m_area getheight isxspacefor m_lastwidth m_area m_lastwidth m_area getxspace m_area newline m_area area_content isyspacefor m_lastheight m_area m_lastheight m_area getyspace m_area newpage create string element param content string to be printed param ad printcolor id color param ad printfont id font param max width max width param max height max height param is height one line onle line only param field alignment type alignment type m print format item field align param is translated if true and content contaiins variable it is dynamically translated during print return print element private print element create string element string content int ad printcolor id int ad printfont id int max width int max height boolean is height one line string field alignment type boolean is translated if content null content length 0 return null color font color color get color default if ad printcolor id 0 m printcolor get id ad printcolor id m print color c m print color get get ctx ad printcolor id if c get color null color c get color font font m printfont get font default if ad printfont id 0 m printfont get id ad printfont id m print font f m print font get ad printfont id if f get font null font f get font print element e new string element content font color null is translated e layout max width max height is height one line field alignment type return e ad_printcolor_id ad_printfont_id maxwidth maxheight isheightoneline fieldalignmenttype mprintformatitem field_align_ istranslated printelement createstringelement ad_printcolor_id ad_printfont_id maxwidth maxheight isheightoneline fieldalignmenttype istranslated getcolor ad_printcolor_id m_printcolor get_id ad_printcolor_id mprintcolor mprintcolor getctx ad_printcolor_id getcolor getcolor m_printfont getfont ad_printfont_id m_printfont get_id ad_printfont_id mprintfont mprintfont ad_printfont_id getfont getfont printelement stringelement istranslated maxwidth maxheight isheightoneline fieldalignmenttype create field element param item format item param max width max width param field alignment type alignment type m print format item field align param is form true if document return print element or null if nothing to print private print element create field element m print format item item int max width string field alignment type boolean is form get data object obj m data get node new integer item getad column id if obj null return null else if obj instanceof print data element else log log level severe element not print data element obj get class return null convert data element to string print data element data print data element obj if data is null item is suppress null return null string string content data get value display m format get language if string content null string content length 0 item is suppress null return null non string object content string content if data get value instanceof boolean content data get value convert amt in words content to alpha if item get column name equals amt in words log fine amt in words string content string content msg get amt in words m format get language string content content string content label string label item get print name m format get language string label suffix item get print name suffix m format get language id type name pair id null if data isid record id column name object value data get value if value instanceof key name pair id new key name pair key name pair value get key item get column name else if value instanceof value name pair id new value name pair value name pair value get value item get column name else if m print format item fieldalignmenttype default equals field alignment type if data is numeric field alignment type m print format item fieldalignmenttype trailingright else field alignment type m print format item fieldalignmenttype leadingleft get color font color color get color default if id null is form link color underline handeled in print element classes else if item getad printcolor id 0 m printcolor get id item getad printcolor id m print color c m print color get get ctx item getad printcolor id if c get color null color c get color font font m printfont get font default if item getad printfont id 0 m printfont get id item getad printfont id m print font f m print font get item getad printfont id if f get font null font f get font create string html or location print element e null if data get display type display type location e new location element m printctx key name pair id get key font color e layout max width item get max height item is height one line field alignment type else if html element ishtml string content e new html element string content else e new string element content font color is form null id label label suffix e layout max width item get max height item is height one line field alignment type return e maxwidth fieldalignmenttype mprintformatitem field_align_ isform printelement createfieldelement mprintformatitem maxwidth fieldalignmenttype isform m_data getnode getad_column_id printdataelement printdataelement getclass dataelement printdataelement printdataelement isnull issuppressnull stringcontent getvaluedisplay m_format getlanguage stringcontent stringcontent issuppressnull stringcontent getvalue getvalue amtinwords getcolumnname amtinwords amtinwords stringcontent stringcontent getamtinwords m_format getlanguage stringcontent stringcontent getprintname m_format getlanguage labelsuffix getprintnamesuffix m_format getlanguage namepair record_id columnname getvalue keynamepair keynamepair keynamepair getkey getcolumnname valuenamepair valuenamepair valuenamepair getvalue getcolumnname mprintformatitem fieldalignmenttype_default fieldalignmenttype isnumeric fieldalignmenttype mprintformatitem fieldalignmenttype_trailingright fieldalignmenttype mprintformatitem fieldalignmenttype_leadingleft getcolor isform printelement getad_printcolor_id m_printcolor get_id getad_printcolor_id mprintcolor mprintcolor getctx getad_printcolor_id getcolor getcolor m_printfont getfont getad_printfont_id m_printfont get_id getad_printfont_id mprintfont mprintfont getad_printfont_id getfont getfont printelement getdisplaytype displaytype locationelement m_printctx keynamepair getkey maxwidth getmaxheight isheightoneline fieldalignmenttype htmlelement stringcontent htmlelement stringcontent stringelement isform labelsuffix maxwidth getmaxheight isheightoneline fieldalignmenttype create box line element param item item return box element private print element create box element m print format item item color color get color default if item getad printcolor id 0 m printcolor get id item getad printcolor id m print color c m print color get get ctx item getad printcolor id if c get color null color c get color return new box element item color printelement createboxelement mprintformatitem getcolor getad_printcolor_id m_printcolor get_id getad_printcolor_id mprintcolor mprintcolor getctx getad_printcolor_id getcolor getcolor boxelement create image element from item param item item return image element private print element create image element m print format item item object obj m data get node new integer item getad column id if obj null return null else if obj instanceof print data element else log log level severe element not print data element obj get class return null print data element data print data element obj if data is null item is suppress null return null string url data get value display m format get language if url null url length 0 if item is suppress null return null else should create an empty area return null image element element image element get url return element printelement createimageelement mprintformatitem m_data getnode getad_column_id printdataelement printdataelement getclass printdataelement printdataelement isnull issuppressnull getvaluedisplay m_format getlanguage issuppressnull imageelement imageelement get default color return color public color get color if m printcolor null return color black return m printcolor get color getcolor m_printcolor m_printcolor getcolor layout table convert print data into table element param format format to use param print data data to use param x offset x axis offset start of table i e indentation return table element private print element layout table m print format format print data print data int x offset log info format get name print data get name m print table format tf format get table format initial values hash map point font row col font new hash map point font m print font print font m print font get format getad printfont id row col font put new point table element all table element all print font get font tf setstandard font print font get font row col font put new point table element header row table element all tf getheader font hash map point color row col color new hash map point color m print color print color m print color get get ctx format getad printcolor id row col color put new point table element all table element all print color get color row col color put new point table element header row table element all tf getheaderfg color hash map point color row col background new hash map point color row col background put new point table element header row table element all tf getheaderbg color sizes boolean multi line header false int page no start m pageno int repeated columns 1 rectangle first page new rectangle m content first page x x offset first page width x offset int y offset int m position area content y m content y first page y y offset first page height y offset rectangle next pages new rectangle m content next pages x x offset next pages width x offset column count int column count 0 for int c 0 c format get item count c if format get item c is printed column count system out println cols cols header column setup value name pair column header new value name pair column count int column max width new int column count int column max height new int column count boolean fixed width new boolean column count string column justification new string column count hash map integer integer additional lines new hash map integer integer int col 0 for int c 0 c format get item count c m print format item item format get item c if item is printed if item is next line item get below column 0 additional lines put new integer col new integer item get below column 1 if item is suppress null item set is suppress null true display size will be set to 0 in table element item save column header col new value name pair item get column name item get print name format get language column max width col item get max width fixed width col column max width col 0 item is fixed width if item is suppress null if column max width col 0 column max width col 1 indication suppress if null else column max width col 1 column max height col item get max height if item is height one line column max height col 1 column justification col item get field alignment type if column justification col null column justification col equals m print format item fieldalignmenttype default column justification col m print format item fieldalignmenttype leadingleft when generated sets correct alignment column fonts if item getad printfont id 0 item getad printfont id format getad printfont id m print font font m print font get item getad printfont id row col font put new point table element all col font get font if item getad printcolor id 0 item getad printcolor id format getad printcolor id m print color color m print color get get ctx item getad printcolor id row col color put new point table element all col color get color col the data int rows print data get row count system out println rows rows object data new object rows column count key name pair pk new key name pair rows string pk column name null array list integer function rows new array list integer array list integer page break new array list integer for all rows for int row 0 row rows row system out println row row print data set row index row if print data is function row function rows add new integer row row col font put new point row table element all tf getfunct font row col color put new point row table element all tf getfunctfg color row col background put new point row table element all tf getfunctbg color if print data is page break page break add new integer row log finer page break row row summary line levels for finanial reports else int level no print data get line level no if level no 0 if level no 0 level no level no font base print font get font if level no 1 row col font put new point row table element all new font base get name font italic base get size level no else if level no 2 row col font put new point row table element all new font base get name font plain base get size level no for all columns col 0 for int c 0 c format get item count c m print format item item format get item c object data element null if item is printed item getad column id 0 text columns if item is type print format else if item is type image if item is image field object obj print data get node new integer item getad column id if obj null else if obj instanceof print data element print data element pde print data element obj data row col image element get string pde get value else if item is image is attached data row col image element get item get id else data row col image element get item get imageurl else object obj print data get node new integer item getad column id if obj null else if obj instanceof print data element print data element pde print data element obj if pde isid pde is yes no data element pde get value else data element pde get value display format get language else log log level severe element not print data element obj get class system out println row row col col item getad column id data element data row col data element col printed for all columns print data element pde print data getp key if pde null for function rows pk row key name pair pde get value if pk column name null pk column name pde get column name else system out println no pk print data for all rows table element table new table element column header column max width column max height column justification fixed width function rows multi line header data pk pk column name page no start first page next pages repeated columns additional lines row col font row col color row col background tf page break table layout 0 0 false m print format item fieldalignmenttype leadingleft if m tableelement null m tableelement table return table printdata tableelement printdata xoffset tableelement printelement layouttable mprintformat printdata printdata xoffset getname printdata getname mprinttableformat gettableformat hashmap rowcolfont hashmap mprintfont printfont mprintfont getad_printfont_id rowcolfont tableelement tableelement printfont getfont setstandard_font printfont getfont rowcolfont tableelement header_row tableelement getheader_font hashmap rowcolcolor hashmap mprintcolor printcolor mprintcolor getctx getad_printcolor_id rowcolcolor tableelement tableelement printcolor getcolor rowcolcolor tableelement header_row tableelement getheaderfg_color hashmap rowcolbackground hashmap rowcolbackground tableelement header_row tableelement getheaderbg_color multilineheader pagenostart m_pageno repeatedcolumns firstpage m_content firstpage xoffset firstpage xoffset yoffset m_position area_content m_content firstpage yoffset firstpage yoffset nextpages m_content nextpages xoffset nextpages xoffset columncount getitemcount getitem isprinted columncount valuenamepair columnheader valuenamepair columncount columnmaxwidth columncount columnmaxheight columncount fixedwidth columncount columnjustification columncount hashmap additionallines hashmap getitemcount mprintformatitem getitem isprinted isnextline getbelowcolumn additionallines getbelowcolumn issuppressnull setissuppressnull tableelement columnheader valuenamepair getcolumnname getprintname getlanguage columnmaxwidth getmaxwidth fixedwidth columnmaxwidth isfixedwidth issuppressnull columnmaxwidth columnmaxwidth columnmaxwidth columnmaxheight getmaxheight isheightoneline columnmaxheight columnjustification getfieldalignmenttype columnjustification columnjustification mprintformatitem fieldalignmenttype_default columnjustification mprintformatitem fieldalignmenttype_leadingleft getad_printfont_id getad_printfont_id getad_printfont_id mprintfont mprintfont getad_printfont_id rowcolfont tableelement getfont getad_printcolor_id getad_printcolor_id getad_printcolor_id mprintcolor mprintcolor getctx getad_printcolor_id rowcolcolor tableelement getcolor printdata getrowcount columncount keynamepair keynamepair pkcolumnname arraylist functionrows arraylist arraylist pagebreak arraylist printdata setrowindex printdata isfunctionrow functionrows rowcolfont tableelement getfunct_font rowcolcolor tableelement getfunctfg_color rowcolbackground tableelement getfunctbg_color printdata ispagebreak pagebreak pagebreak levelno printdata getlinelevelno levelno levelno levelno levelno printfont getfont levelno rowcolfont tableelement getname getsize levelno levelno rowcolfont tableelement getname getsize levelno getitemcount mprintformatitem getitem dataelement isprinted getad_column_id istypeprintformat istypeimage isimagefield printdata getnode getad_column_id printdataelement printdataelement printdataelement imageelement getvalue isimageisattached imageelement get_id imageelement getimageurl printdata getnode getad_column_id printdataelement printdataelement printdataelement isyesno dataelement getvalue dataelement getvaluedisplay getlanguage printdataelement getclass getad_column_id dataelement dataelement printdataelement printdata getpkey functionrows keynamepair getvalue pkcolumnname pkcolumnname getcolumnname printdata tableelement tableelement columnheader columnmaxwidth columnmaxheight columnjustification fixedwidth functionrows multilineheader pkcolumnname pagenostart firstpage nextpages repeatedcolumns additionallines rowcolfont rowcolcolor rowcolbackground pagebreak mprintformatitem fieldalignmenttype_leadingleft m_tableelement m_tableelement layout parameter based on m query return print element private print element layout parameter if m query null m query is active return null parameter element pe new parameter element m query m printctx m format get table format pe layout 0 0 false null return pe mquery printelement printelement layoutparameter m_query m_query isactive parameterelement parameterelement m_query m_printctx m_format gettableformat get number of pages pageable interface return number of pages public int get number of pages return m pages size getnumberofpages m_pages get page format pageable interface param page index page index return page format throws index out of bounds exception public page format get page format int page index throws index out of bounds exception if have page page index throw new index out of bounds exception no page index page index return get page format pageindex indexoutofboundsexception pageformat getpageformat pageindex indexoutofboundsexception havepage pageindex indexoutofboundsexception pageindex getpageformat get printable pageable interface param page index page index return this throws index out of bounds exception public printable get printable int page index throws index out of bounds exception if have page page index throw new index out of bounds exception no page index page index return this pageableinterface pageindex indexoutofboundsexception getprintable pageindex indexoutofboundsexception havepage pageindex indexoutofboundsexception pageindex print page printable interface param graphics graphics param page format page format ignored param page index page index return page exists no such page throws printer exception public int print graphics graphics page format page format int page index throws printer exception if have page page index return printable no such page rectangle r new rectangle 0 0 int get paper get width true int get paper get height true page page get page page index 1 log fine m id page index page index copy m iscopy page paint graphics2d graphics r false m iscopy sets context get header footer paint graphics2d graphics r false return printable page exists pageformat pageindex pageexists nosuchpage printerexception pageformat pageformat pageindex printerexception havepage pageindex no_such_page getpaper getwidth getpaper getheight getpage pageindex m_id pageindex pageindex m_iscopy m_iscopy getheaderfooter page_exists do we have the page param page index page index return true if page exists private boolean have page int page index if page index 0 page index get number of pages return false return true pageindex havepage pageindex pageindex pageindex getnumberofpages print copy return true if copy public boolean is copy return m iscopy iscopy m_iscopy set copy param is copy if true document is a copy public void set copy boolean is copy m iscopy is copy iscopy setcopy iscopy m_iscopy iscopy get the doc flavor doc interface return service formatted pageable public doc flavor get doc flavor return doc flavor service formatted pageable service_formatted docflavor getdocflavor docflavor service_formatted get print data doc interface return this throws io exception public object get print data throws io exception return this ioexception getprintdata ioexception get document attributes doc interface return null to obtain all attribute values from the job s attribute set public doc attribute set get attributes return null docattributeset getattributes obtains a reader for extracting character print data from this doc doc interface return null exception io exception public reader get reader for text throws io exception return null ioexception getreaderfortext ioexception obtains an input stream for extracting byte print data from this doc doc interface return null exception io exception public input stream get stream for bytes throws io exception return null ioexception inputstream getstreamforbytes ioexception mimimum constructor for date editor param frame frame public calendar frame frame this frame msg get msg env get ctx calendar null display type date getmsg getctx displaytype constructor param frame frame param title title param startts start date time param display type display type date date time time public calendar frame frame string title timestamp startts int display type super frame title true log info startts null null startts to string dt display type m displaytype display type try jb init set default close operation j dialog dispose on close catch exception ex log log level severe calendar ex load data startts displaytype displaytype datetime displaytype tostring displaytype m_displaytype displaytype jbinit setdefaultcloseoperation jdialog dispose_on_close loaddata static init throws exception private void jb init throws exception this add key listener this main panel set layout main layout main layout set hgap 2 main layout set vgap 2 main panel set border border factory create lowered bevel border get content pane add main panel month panel month panel set layout month layout month panel add b back new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 0 0 0 0 0 month panel add c year new grid bag constraints 3 0 1 1 1 0 0 0 grid bag constraints southeast grid bag constraints horizontal new insets 0 5 0 0 0 0 month panel add b next new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 0 0 0 0 month panel add c month new grid bag constraints 1 0 1 1 1 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 0 0 0 0 0 0 main panel add month panel border layout north c month add action listener this c year add change listener this b back set icon env get image icon parent16 gif b back set margin new insets 0 0 0 0 b back add action listener this b next set icon env get image icon detail16 gif b next set margin new insets 0 0 0 0 b next add action listener this day panel day panel set layout day layout day layout set columns 7 day layout set hgap 2 day layout set rows 7 day layout set vgap 2 main panel add day panel border layout center time panel time panel set layout time layout l time sep set text time panel add f hour new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints horizontal new insets 0 6 0 0 0 0 time panel add l time sep new grid bag constraints 1 0 1 1 0 0 1 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 time panel add f minute new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 0 0 0 0 time panel add cbpm new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 5 0 0 0 0 time panel add ltz new grid bag constraints 4 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 4 0 0 0 0 time panel add bok new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 6 0 2 0 0 main panel add time panel border layout south f hour add key listener this enter returns j spinner ignores key listener j spinner default editor f minute get editor get text field add key listener this f minute add change listener this cbpm add action listener this cbpm add key listener this bok set icon env get image icon ok16 gif bok set margin new insets 0 1 0 1 bok add action listener this jbinit addkeylistener mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap mainpanel setborder borderfactory createloweredbevelborder getcontentpane mainpanel monthpanel setlayout monthlayout monthpanel bback gridbagconstraints gridbagconstraints gridbagconstraints monthpanel cyear gridbagconstraints gridbagconstraints gridbagconstraints monthpanel bnext gridbagconstraints gridbagconstraints gridbagconstraints monthpanel cmonth gridbagconstraints gridbagconstraints gridbagconstraints mainpanel monthpanel borderlayout cmonth addactionlistener cyear addchangelistener bback seticon getimageicon bback setmargin bback addactionlistener bnext seticon getimageicon bnext setmargin bnext addactionlistener daypanel setlayout daylayout daylayout setcolumns daylayout sethgap daylayout setrows daylayout setvgap mainpanel daypanel borderlayout timepanel setlayout timelayout ltimesep settext timepanel fhour gridbagconstraints gridbagconstraints gridbagconstraints timepanel ltimesep gridbagconstraints gridbagconstraints gridbagconstraints timepanel fminute gridbagconstraints gridbagconstraints gridbagconstraints timepanel gridbagconstraints gridbagconstraints gridbagconstraints timepanel gridbagconstraints gridbagconstraints gridbagconstraints timepanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel timepanel borderlayout fhour addkeylistener jspinner keylistener jspinner defaulteditor fminute geteditor gettextfield addkeylistener fminute addchangelistener addactionlistener addkeylistener seticon getimageicon setmargin addactionlistener window events request focus param e event protected void process window event window event e log config calendar process window event e super process window event e if e getid window event window opened if m displaytype display type time f hour request focus else if m today null m today request focus requestfocus processwindowevent windowevent processwindowevent processwindowevent windowevent window_opened m_displaytype displaytype fhour requestfocus m_today m_today requestfocus load data years month names day names param startts time stamp private void load data timestamp startts m calendar new gregorian calendar language get login language get locale if startts null m calendar set time in millis system current time millis else m calendar set time startts m firstday m calendar get first day of week locale loc language get login language get locale simple date format format date simple date format date format get date instance date format long loc short h mm a hh mm long h mm ss a z hh mm ss z simple date format format time simple date format date format get time instance date format short loc m hasam pm format time to pattern index of a 1 if m hasam pm cbpm set text format time get date format symbols get am pm strings 1 else cbpm set visible false years m currentyear m calendar get java util calendar year c year set editor new j spinner number editor c year 0000 c year set value new integer m currentyear months 0 jan 12 string months format date get date format symbols get months for int i 0 i months length i key name pair p new key name pair i 1 months i if months i equals c month add item p m currentmonth m calendar get java util calendar month 1 jan 0 c month set selected index m currentmonth 1 week days 0 1 su 7 sa string days format date get date format symbols get short weekdays 0 is blank 1 is sunday for int i m firstday i 7 m firstday i int index i 7 i 7 i day panel add create weekday days index null days m days new c button 6 7 m currentday m calendar get java util calendar date for int i 0 i 6 i six weeks a month maximun for int j 0 j 7 j seven days int index i 7 j m days index create day day panel add m days index null today button m days m days length 1 set background color green m days m days length 1 set text m days m days length 1 set tool tip text msg get msg env get ctx today cancel m days m days length 2 set background color red m days m days length 2 set text x m days m days length 2 set tool tip text msg get msg env get ctx cancel date time m current24hour m calendar get java util calendar hour of day m currentminute m calendar get java util calendar minute what to show time panel set visible m displaytype display type date time m displaytype display type time month panel set visible m displaytype display type time day panel set visible m displaytype display type time update ui from m current m setting false set calendar loaddata m_calendar gregoriancalendar getloginlanguage getlocale m_calendar settimeinmillis currenttimemillis m_calendar settime m_firstday m_calendar getfirstdayofweek getloginlanguage getlocale simpledateformat formatdate simpledateformat dateformat getdateinstance dateformat simpledateformat formattime simpledateformat dateformat gettimeinstance dateformat m_hasam_pm formattime topattern indexof m_hasam_pm settext formattime getdateformatsymbols getampmstrings setvisible m_currentyear m_calendar cyear seteditor jspinner numbereditor cyear cyear setvalue m_currentyear _ formatdate getdateformatsymbols getmonths keynamepair keynamepair cmonth additem m_currentmonth m_calendar cmonth setselectedindex m_currentmonth _ formatdate getdateformatsymbols getshortweekdays m_firstday m_firstday daypanel createweekday m_days cbutton m_currentday m_calendar m_days createday daypanel m_days m_days m_days setbackground m_days m_days settext m_days m_days settooltiptext getmsg getctx m_days m_days setbackground m_days m_days settext m_days m_days settooltiptext getmsg getctx m_current24hour m_calendar hour_of_day m_currentminute m_calendar timepanel setvisible m_displaytype displaytype datetime m_displaytype displaytype monthpanel setvisible m_displaytype displaytype daypanel setvisible m_displaytype displaytype m_current m_setting setcalendar create week day label param title weedkay title return week day private j label create weekday string title j label label new j label title label set border border factory create raised bevel border label set horizontal alignment swing constants center label set horizontal text position swing constants center label set request focus enabled false return label jlabel createweekday jlabel jlabel setborder borderfactory createraisedbevelborder sethorizontalalignment swingconstants sethorizontaltextposition swingconstants setrequestfocusenabled create day label return button private c button create day c button button new c button button set border border factory create lowered bevel border button set horizontal text position swing constants center button set margin zero insets button add action listener this button add mouse listener this button add key listener this return button cbutton createday cbutton cbutton setborder borderfactory createloweredbevelborder sethorizontaltextposition swingconstants setmargin zero_insets addactionlistener addmouselistener addkeylistener create 12 25 hours return array with hours as string private object get hours locale loc language get login language get locale short h mm a hh mm long h mm ss a z hh mm ss z simple date format format time simple date format date format get time instance date format short loc m hasam pm format time to pattern index of a 1 object ret value new object m hasam pm 12 24 if m hasam pm ret value 0 12 for int i 1 i 10 i ret value i string value of i for int i 10 i 12 i ret value i string value of i else for int i 0 i 10 i ret value i 0 string value of i for int i 10 i 24 i ret value i string value of i return ret value gethours getloginlanguage getlocale simpledateformat formattime simpledateformat dateformat gettimeinstance dateformat m_hasam_pm formattime topattern indexof retvalue m_hasam_pm m_hasam_pm retvalue retvalue valueof retvalue valueof retvalue valueof retvalue valueof retvalue set calandar from m current variables and update ui private void set calendar if m setting return log config calendar set calendar set month year m setting true c month set selected index m currentmonth 1 c year set value new integer m currentyear m setting false set day what is the first day in the selected month m calendar set m currentyear m currentmonth 1 1 month is zero based int day one m calendar get java util calendar day of week int last date m calendar get actual maximum java util calendar date convert to index day one m firstday if day one 0 day one 7 last date day one 1 for all buttons but the last int cur day 1 for int i 0 i m days length 2 i if i day one i last date if m currentday cur day m days i set background color blue m days i set foreground color yellow m today m days i m today request focus else m days i set background color white m days i set foreground color black m days i set text string value of cur day m days i set read write true else m days i set text m days i set read write false m days i set background compiereplaf getfieldbackground inactive set hour boolean pm m current24hour 12 int index m current24hour if pm m hasam pm index 12 if index 0 index f hour get item count index 0 f hour set selected index index set minute int m m calendar get java util calendar minute f minute set value new integer m set pm cbpm set selected pm set tz time zone tz m calendar get time zone ltz set text tz get display name tz in daylight time m calendar get time time zone short update calendar m calendar set m currentyear m currentmonth 1 m currentday m current24hour m currentminute 0 m calendar set java util calendar millisecond 0 m_current setcalendar m_setting setcalendar m_setting cmonth setselectedindex m_currentmonth cyear setvalue m_currentyear m_setting m_calendar m_currentyear m_currentmonth dayone m_calendar day_of_week lastdate m_calendar getactualmaximum dayone m_firstday dayone dayone lastdate dayone curday m_days dayone lastdate m_currentday curday m_days setbackground m_days setforeground m_today m_days m_today requestfocus m_days setbackground m_days setforeground m_days settext valueof curday m_days setreadwrite m_days settext m_days setreadwrite m_days setbackground getfieldbackground_inactive m_current24hour m_current24hour m_hasam_pm fhour getitemcount fhour setselectedindex m_calendar fminute setvalue setselected timezone m_calendar gettimezone settext getdisplayname indaylighttime m_calendar gettime timezone m_calendar m_currentyear m_currentmonth m_currentday m_current24hour m_currentminute m_calendar set current time from ui set m current variables private void set time hour int h f hour get selected index m current24hour h if m hasam pm cbpm is selected m current24hour 12 if m current24hour 0 m current24hour 23 m current24hour 0 minute integer ii integer f minute get value m currentminute ii int value if m currentminute 0 m currentminute 59 m currentminute 0 m_current settime fhour getselectedindex m_current24hour m_hasam_pm isselected m_current24hour m_current24hour m_current24hour m_current24hour fminute getvalue m_currentminute intvalue m_currentminute m_currentminute m_currentminute return time stamp return date and time public timestamp get timestamp log config calendar get time stamp set calendar m calendar set m currentyear m currentmonth 1 m currentday m current24hour m currentminute 0 m calendar set java util calendar millisecond 0 return value if m abort m cancel return null long time m calendar get time in millis if m displaytype display type date time new java sql date time get time else if m displaytype display type time time new time time get time based on 1970 01 01 return new timestamp time gettimestamp gettimestamp m_calendar m_currentyear m_currentmonth m_currentday m_current24hour m_currentminute m_calendar m_abort m_cancel m_calendar gettimeinmillis m_displaytype displaytype gettime m_displaytype displaytype gettime cancel button pressed return true if canceled public boolean is cancel return m cancel iscancel m_cancel action listener for month year combo dat buttons double clicking on a date closes it set m current param e event public void action performed action event e if m setting return log config calendar action performed set time if e get source bok m abort false dispose return else if e get source b back if m currentmonth 1 m currentmonth 12 m currentyear m lastday 1 else if e get source b next if m currentmonth 12 m currentmonth 1 m currentyear m lastday 1 else if e get source instanceof j button j button b j button e get source string text b get text today set to today s date if text equals m calendar set time new timestamp system current time millis m currentday m calendar get java util calendar date m currentmonth m calendar get java util calendar month 1 m currentyear m calendar get java util calendar year cancel else if text equals x m cancel true dispose return we have a day else if text length 0 m currentday integer parse int text long current click system current time millis if m currentday m lastday current click m lastclick 1000 double click 1 second m abort false dispose return m lastclick current click m lastday m currentday else if e get source cbpm set time m lastday 1 else set month m currentmonth c month get selected index 1 m lastday 1 set calendar m_current actionperformed actionevent m_setting actionperformed settime getsource m_abort getsource bback m_currentmonth m_currentmonth m_currentyear m_lastday getsource bnext m_currentmonth m_currentmonth m_currentyear m_lastday getsource jbutton jbutton jbutton getsource gettext m_calendar settime currenttimemillis m_currentday m_calendar m_currentmonth m_calendar m_currentyear m_calendar m_cancel m_currentday parseint currentclick currenttimemillis m_currentday m_lastday currentclick m_lastclick m_abort m_lastclick currentclick m_lastday m_currentday getsource settime m_lastday m_currentmonth cmonth getselectedindex m_lastday setcalendar change listener year minute spinner param e event public void state changed change event e if m setting return set minute if e get source f minute set time return set year m currentyear integer c year get value int value m lastday 1 set calendar changelistener statechanged changeevent m_setting getsource fminute settime m_currentyear cyear getvalue intvalue m_lastday setcalendar mouse clicked param e evant public void mouse clicked mouse event e if e get click count 2 m abort false dispose mouseclicked mouseevent getclickcount m_abort mouse clicked public void mouse pressed mouse event e mouseclicked mousepressed mouseevent public void mouse pressed mouse event e public void mouse entered mouse event e mousepressed mouseevent mouseentered mouseevent public void mouse pressed mouse event e public void mouse entered mouse event e public void mouse exited mouse event e mousepressed mouseevent mouseentered mouseevent mouseexited mouseevent public void mouse entered mouse event e public void mouse exited mouse event e public void mouse released mouse event e mouseentered mouseevent mouseexited mouseevent mousereleased mouseevent key released return on enter param e event public void key released key event e system out println released e day buttons if e get source instanceof j button if e get key code key event vk page down if m currentmonth 12 m currentmonth 1 m currentyear set calendar return if e get key code key event vk page up if m currentmonth 1 m currentmonth 12 m currentyear set calendar return arrows int offset 0 if e get key code key event vk right offset 1 else if e get key code key event vk left offset 1 else if e get key code key event vk up offset 7 else if e get key code key event vk down offset 7 if offset 0 system out println m calendar get time offset offset m calendar add java util calendar day of year offset system out println m calendar get time m currentday m calendar get java util calendar day of month m currentmonth m calendar get java util calendar month 1 m currentyear m calendar get java util calendar year set calendar return something else action performed new action event e get source action event action performed pressed enter anywhere if e get key code key event vk enter m abort false set time dispose return modified hour miinute set time m lastday 1 keyreleased keyevent getsource jbutton getkeycode keyevent vk_page_down m_currentmonth m_currentmonth m_currentyear setcalendar getkeycode keyevent vk_page_up m_currentmonth m_currentmonth m_currentyear setcalendar getkeycode keyevent vk_right getkeycode keyevent vk_left getkeycode keyevent vk_up getkeycode keyevent vk_down m_calendar gettime m_calendar day_of_year m_calendar gettime m_currentday m_calendar day_of_month m_currentmonth m_calendar m_currentyear m_calendar setcalendar actionperformed actionevent getsource actionevent action_performed getkeycode keyevent vk_enter m_abort settime settime m_lastday key released public void key typed key event e system out println typed e keyreleased keytyped keyevent system out println typed e public void key pressed key event e system out println pressed e keypressed keyevent constructor creates integer spinner with minimum 0 maximum 59 stepsize 1 param snap size snap size public minute model int snap size super 0 0 59 1 integer model m snapsize snap size snapsize minutemodel snapsize m_snapsize snapsize return next full snap value return next snap value public object get next value int minutes integer get value int value minutes m snapsize if minutes 60 minutes 60 int steps minutes m snapsize return new integer steps m snapsize getnextvalue getvalue intvalue m_snapsize m_snapsize m_snapsize return previous full step value return previous snap value public object get previous value int minutes integer get value int value minutes m snapsize if minutes 0 minutes 60 int steps minutes m snapsize if minutes m snapsize 0 steps if steps m snapsize 59 steps 0 return new integer steps m snapsize getpreviousvalue getvalue intvalue m_snapsize m_snapsize m_snapsize m_snapsize m_snapsize standard constructor public x c projectline properties ctx int c projectline id string trx name super ctx c projectline id trx name if c projectline id 0 setc projectline id 0 setc project id 0 set invoiced amt env zero set invoiced qty env zero 0 set is printed true y set line 0 sql select nvl max line 0 10 as default value from c projectline where c project id c project id set planned amt env zero set planned margin amt env zero set planned price env zero set planned qty env zero 1 set processed false n x_c_projectline c_projectline_id trxname c_projectline_id trxname c_projectline_id setc_projectline_id setc_project_id setinvoicedamt setinvoicedqty setisprinted setline defaultvalue c_projectline c_project_id c_project_id setplannedamt setplannedmarginamt setplannedprice setplannedqty setprocessed load constructor public x c projectline properties ctx result set rs string trx name super ctx rs trx name x_c_projectline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projectline append get id append return sb to string tostring stringbuffer stringbuffer x_c_projectline get_id tostring public static final int c orderpo id ad reference id 290 set purchase order purchase order public void setc orderpo id int c orderpo id if c orderpo id 0 set valuenocheck c orderpo id null else set valuenocheck c orderpo id new integer c orderpo id c_orderpo_id_ad_reference_id setc_orderpo_id c_orderpo_id c_orderpo_id set_valuenocheck c_orderpo_id set_valuenocheck c_orderpo_id c_orderpo_id get purchase order purchase order public int getc orderpo id integer ii integer get value c orderpo id if ii null return 0 return ii int value getc_orderpo_id get_value c_orderpo_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 0 set valuenocheck c projectissue id null else set valuenocheck c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id set_valuenocheck c_projectissue_id set_valuenocheck c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue set project line task or step in a project public void setc projectline id int c projectline id if c projectline id 1 throw new illegal argument exception c projectline id is mandatory set valuenocheck c projectline id new integer c projectline id setc_projectline_id c_projectline_id c_projectline_id illegalargumentexception c_projectline_id set_valuenocheck c_projectline_id c_projectline_id get project line task or step in a project public int getc projectline id integer ii integer get value c projectline id if ii null return 0 return ii int value getc_projectline_id get_value c_projectline_id intvalue set project financial project public void setc project id int c project id if c project id 1 throw new illegal argument exception c project id is mandatory set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id illegalargumentexception c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set committed amount the legal commitment amount public void set committed amt big decimal committed amt set value committed amt committed amt setcommittedamt bigdecimal committedamt set_value committedamt committedamt get committed amount the legal commitment amount public big decimal get committed amt big decimal bd big decimal get value committed amt if bd null return env zero return bd bigdecimal getcommittedamt bigdecimal bigdecimal get_value committedamt set committed quantity the legal commitment quantity public void set committed qty big decimal committed qty set value committed qty committed qty setcommittedqty bigdecimal committedqty set_value committedqty committedqty get committed quantity the legal commitment quantity public big decimal get committed qty big decimal bd big decimal get value committed qty if bd null return env zero return bd bigdecimal getcommittedqty bigdecimal bigdecimal get_value committedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set pricing public void set do pricing string do pricing if do pricing null do pricing length 1 log warning length 1 truncated do pricing do pricing substring 0 0 set value do pricing do pricing setdopricing dopricing dopricing dopricing dopricing dopricing set_value dopricing dopricing get pricing public string get do pricing return string get value do pricing getdopricing get_value dopricing set invoiced amount the amount invoiced public void set invoiced amt big decimal invoiced amt if invoiced amt null throw new illegal argument exception invoiced amt is mandatory set value invoiced amt invoiced amt setinvoicedamt bigdecimal invoicedamt invoicedamt illegalargumentexception invoicedamt set_value invoicedamt invoicedamt get invoiced amount the amount invoiced public big decimal get invoiced amt big decimal bd big decimal get value invoiced amt if bd null return env zero return bd bigdecimal getinvoicedamt bigdecimal bigdecimal get_value invoicedamt set quantity invoiced the quantity invoiced public void set invoiced qty big decimal invoiced qty if invoiced qty null throw new illegal argument exception invoiced qty is mandatory set value invoiced qty invoiced qty setinvoicedqty bigdecimal invoicedqty invoicedqty illegalargumentexception invoicedqty set_value invoicedqty invoicedqty get quantity invoiced the quantity invoiced public big decimal get invoiced qty big decimal bd big decimal get value invoiced qty if bd null return env zero return bd bigdecimal getinvoicedqty bigdecimal bigdecimal get_value invoicedqty set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set planned amount planned amount for this project public void set planned amt big decimal planned amt if planned amt null throw new illegal argument exception planned amt is mandatory set value planned amt planned amt setplannedamt bigdecimal plannedamt plannedamt illegalargumentexception plannedamt set_value plannedamt plannedamt get planned amount planned amount for this project public big decimal get planned amt big decimal bd big decimal get value planned amt if bd null return env zero return bd bigdecimal getplannedamt bigdecimal bigdecimal get_value plannedamt set planned margin project s planned margin amount public void set planned margin amt big decimal planned margin amt if planned margin amt null throw new illegal argument exception planned margin amt is mandatory set value planned margin amt planned margin amt setplannedmarginamt bigdecimal plannedmarginamt plannedmarginamt illegalargumentexception plannedmarginamt set_value plannedmarginamt plannedmarginamt get planned margin project s planned margin amount public big decimal get planned margin amt big decimal bd big decimal get value planned margin amt if bd null return env zero return bd bigdecimal getplannedmarginamt bigdecimal bigdecimal get_value plannedmarginamt set planned price planned price for this project line public void set planned price big decimal planned price if planned price null throw new illegal argument exception planned price is mandatory set value planned price planned price setplannedprice bigdecimal plannedprice plannedprice illegalargumentexception plannedprice set_value plannedprice plannedprice get planned price planned price for this project line public big decimal get planned price big decimal bd big decimal get value planned price if bd null return env zero return bd bigdecimal getplannedprice bigdecimal bigdecimal get_value plannedprice set planned quantity planned quantity for this project public void set planned qty big decimal planned qty if planned qty null throw new illegal argument exception planned qty is mandatory set value planned qty planned qty setplannedqty bigdecimal plannedqty plannedqty illegalargumentexception plannedqty set_value plannedqty plannedqty get planned quantity planned quantity for this project public big decimal get planned qty big decimal bd big decimal get value planned qty if bd null return env zero return bd bigdecimal getplannedqty bigdecimal bigdecimal get_value plannedqty set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue standard constructor public x m movementconfirm properties ctx int m movementconfirm id string trx name super ctx m movementconfirm id trx name if m movementconfirm id 0 set doc action null set doc status null set document no null set is approved false n setm movementconfirm id 0 setm movement id 0 set processed false x_m_movementconfirm m_movementconfirm_id trxname m_movementconfirm_id trxname m_movementconfirm_id setdocaction setdocstatus setdocumentno setisapproved setm_movementconfirm_id setm_movement_id setprocessed load constructor public x m movementconfirm properties ctx result set rs string trx name super ctx rs trx name x_m_movementconfirm resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m movementconfirm append get id append return sb to string tostring stringbuffer stringbuffer x_m_movementconfirm get_id tostring set approval amount document approval amount public void set approval amt big decimal approval amt set value approval amt approval amt setapprovalamt bigdecimal approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 0 set value m inventory id null else set value m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id set_value m_inventory_id set_value m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set move confirm inventory move confirmation public void setm movementconfirm id int m movementconfirm id if m movementconfirm id 1 throw new illegal argument exception m movementconfirm id is mandatory set valuenocheck m movementconfirm id new integer m movementconfirm id setm_movementconfirm_id m_movementconfirm_id m_movementconfirm_id illegalargumentexception m_movementconfirm_id set_valuenocheck m_movementconfirm_id m_movementconfirm_id get move confirm inventory move confirmation public int getm movementconfirm id integer ii integer get value m movementconfirm id if ii null return 0 return ii int value getm_movementconfirm_id get_value m_movementconfirm_id intvalue set inventory move movement of inventory public void setm movement id int m movement id if m movement id 1 throw new illegal argument exception m movement id is mandatory set value m movement id new integer m movement id setm_movement_id m_movement_id m_movement_id illegalargumentexception m_movement_id set_value m_movement_id m_movement_id get inventory move movement of inventory public int getm movement id integer ii integer get value m movement id if ii null return 0 return ii int value getm_movement_id get_value m_movement_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x pa measurecalc properties ctx int pa measurecalc id string trx name super ctx pa measurecalc id trx name if pa measurecalc id 0 setad table id 0 set date column null x date set entity type null u set key column null set name null set org column null x ad org id setpa measurecalc id 0 set select clause null select from set where clause null where x_pa_measurecalc pa_measurecalc_id trxname pa_measurecalc_id trxname pa_measurecalc_id setad_table_id setdatecolumn setentitytype setkeycolumn setname setorgcolumn ad_org_id setpa_measurecalc_id setselectclause setwhereclause load constructor public x pa measurecalc properties ctx result set rs string trx name super ctx rs trx name x_pa_measurecalc resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa measurecalc append get id append return sb to string tostring stringbuffer stringbuffer x_pa_measurecalc get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set b partner column fully qualified business partner key column c bpartner id public void setb partner column string b partner column if b partner column null b partner column length 60 log warning length 60 truncated b partner column b partner column substring 0 59 set value b partner column b partner column c_bpartner_id setbpartnercolumn bpartnercolumn bpartnercolumn bpartnercolumn bpartnercolumn bpartnercolumn set_value bpartnercolumn bpartnercolumn get b partner column fully qualified business partner key column c bpartner id public string getb partner column return string get value b partner column c_bpartner_id getbpartnercolumn get_value bpartnercolumn set date column fully qualified date column public void set date column string date column if date column null throw new illegal argument exception date column is mandatory if date column length 60 log warning length 60 truncated date column date column substring 0 59 set value date column date column setdatecolumn datecolumn datecolumn illegalargumentexception datecolumn datecolumn datecolumn datecolumn set_value datecolumn datecolumn get date column fully qualified date column public string get date column return string get value date column getdatecolumn get_value datecolumn set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set key column key column for table public void set key column string key column if key column null throw new illegal argument exception key column is mandatory if key column length 60 log warning length 60 truncated key column key column substring 0 59 set value key column key column setkeycolumn keycolumn keycolumn illegalargumentexception keycolumn keycolumn keycolumn keycolumn set_value keycolumn keycolumn get key column key column for table public string get key column return string get value key column getkeycolumn get_value keycolumn set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set org column fully qualified organization column ad org id public void set org column string org column if org column null throw new illegal argument exception org column is mandatory if org column length 60 log warning length 60 truncated org column org column substring 0 59 set value org column org column ad_org_id setorgcolumn orgcolumn orgcolumn illegalargumentexception orgcolumn orgcolumn orgcolumn orgcolumn set_value orgcolumn orgcolumn get org column fully qualified organization column ad org id public string get org column return string get value org column ad_org_id getorgcolumn get_value orgcolumn set measure calculation calculation method for measuring performance public void setpa measurecalc id int pa measurecalc id if pa measurecalc id 1 throw new illegal argument exception pa measurecalc id is mandatory set valuenocheck pa measurecalc id new integer pa measurecalc id setpa_measurecalc_id pa_measurecalc_id pa_measurecalc_id illegalargumentexception pa_measurecalc_id set_valuenocheck pa_measurecalc_id pa_measurecalc_id get measure calculation calculation method for measuring performance public int getpa measurecalc id integer ii integer get value pa measurecalc id if ii null return 0 return ii int value getpa_measurecalc_id get_value pa_measurecalc_id intvalue set product column fully qualified product column m product id public void set product column string product column if product column null product column length 60 log warning length 60 truncated product column product column substring 0 59 set value product column product column m_product_id setproductcolumn productcolumn productcolumn productcolumn productcolumn productcolumn set_value productcolumn productcolumn get product column fully qualified product column m product id public string get product column return string get value product column m_product_id getproductcolumn get_value productcolumn set sql select sql select clause public void set select clause string select clause if select clause null throw new illegal argument exception select clause is mandatory if select clause length 2000 log warning length 2000 truncated select clause select clause substring 0 1999 set value select clause select clause setselectclause selectclause selectclause illegalargumentexception selectclause selectclause selectclause selectclause set_value selectclause selectclause get sql select sql select clause public string get select clause return string get value select clause getselectclause get_value selectclause set sql where fully qualified sql where clause public void set where clause string where clause if where clause null throw new illegal argument exception where clause is mandatory if where clause length 2000 log warning length 2000 truncated where clause where clause substring 0 1999 set value where clause where clause setwhereclause whereclause whereclause illegalargumentexception whereclause whereclause whereclause whereclause set_value whereclause whereclause get sql where fully qualified sql where clause public string get where clause return string get value where clause getwhereclause get_value whereclause create a new db exception based on a sql exception param e specicy the exception cause public db exception exception e super e dbexception sqlexception dbexception create a new db exception param msg message public db exception string msg super msg dbexception dbexception start a thread that will call the code construct code method and then exit public swing worker finish runnable final runnable do finished new runnable public void run finished worker runnable runnable do construct new runnable public void run try set value construct finally m threadvar clear swing utilities invoke later do finished thread t new thread do construct m threadvar new thread var t swingworker dofinished doconstruct setvalue m_threadvar swingutilities invokelater dofinished doconstruct m_threadvar threadvar final runnable do finished new runnable public void run finished dofinished public void run try set value construct finally m threadvar clear swing utilities invoke later do finished setvalue m_threadvar swingutilities invokelater dofinished compute the value to be returned by the code get code method return value called on the event dispatching thread not on the worker thread after the code construct code method has returned public void finished get the value produced by the worker thread or null if it hasn t been constructed yet return value of worker protected synchronized object get value return m value getvalue m_value set the value produced by worker thread param x worker value private synchronized void set value object x m value x setvalue m_value start the worker thread public void start thread t m threadvar get if t null t start m_threadvar return the value created by the code construct code method returns null if either the constructing thread or the current thread was interrupted before a value was produced blocks ui return the value created by the code construct code method public object get while true thread t m threadvar get if t null return get value try t join catch interrupted exception e thread current thread interrupt propagate return null m_threadvar getvalue interruptedexception currentthread a new method that interrupts the worker thread call this method to force the worker to stop what it s doing public void interrupt thread t m threadvar get if t null t interrupt m threadvar clear m_threadvar m_threadvar is worker alive return true if alive public boolean is alive thread t m threadvar get if t null return false return t is alive isalive m_threadvar isalive constructor param t sync thread thread var thread t thread t threadvar get sync thread return thread synchronized thread get return thread clear sync thread synchronized void clear thread null standard constructor public x m productionplan properties ctx int m productionplan id string trx name super ctx m productionplan id trx name if m productionplan id 0 set line 0 sql select nvl max line 0 10 as default value from m productionplan where m production id m production id setm locator id 0 m locator id setm product id 0 setm productionplan id 0 setm production id 0 set processed false set production qty env zero 1 x_m_productionplan m_productionplan_id trxname m_productionplan_id trxname m_productionplan_id setline defaultvalue m_productionplan m_production_id m_production_id setm_locator_id m_locator_id setm_product_id setm_productionplan_id setm_production_id setprocessed setproductionqty load constructor public x m productionplan properties ctx result set rs string trx name super ctx rs trx name x_m_productionplan resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productionplan append get id append return sb to string tostring stringbuffer stringbuffer x_m_productionplan get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue public static final int m product id ad reference id 211 set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id m_product_id_ad_reference_id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production plan plan for how a product is produced public void setm productionplan id int m productionplan id if m productionplan id 1 throw new illegal argument exception m productionplan id is mandatory set valuenocheck m productionplan id new integer m productionplan id setm_productionplan_id m_productionplan_id m_productionplan_id illegalargumentexception m_productionplan_id set_valuenocheck m_productionplan_id m_productionplan_id get production plan plan for how a product is produced public int getm productionplan id integer ii integer get value m productionplan id if ii null return 0 return ii int value getm_productionplan_id get_value m_productionplan_id intvalue set production plan for producing a product public void setm production id int m production id if m production id 1 throw new illegal argument exception m production id is mandatory set valuenocheck m production id new integer m production id setm_production_id m_production_id m_production_id illegalargumentexception m_production_id set_valuenocheck m_production_id m_production_id get production plan for producing a product public int getm production id integer ii integer get value m production id if ii null return 0 return ii int value getm_production_id get_value m_production_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set production quantity quantity of products to produce public void set production qty big decimal production qty if production qty null throw new illegal argument exception production qty is mandatory set value production qty production qty setproductionqty bigdecimal productionqty productionqty illegalargumentexception productionqty set_value productionqty productionqty get production quantity quantity of products to produce public big decimal get production qty big decimal bd big decimal get value production qty if bd null return env zero return bd bigdecimal getproductionqty bigdecimal bigdecimal get_value productionqty standard constructor public x m product bom properties ctx int m product bom id string trx name super ctx m product bom id trx name if m product bom id 0 setbom qty env zero 1 set line 0 sql select nvl max line 0 10 as default value from m product bom where m product id m product id setm productbom id 0 setm product bom id 0 setm product id 0 x_m_product_bom m_product_bom_id trxname m_product_bom_id trxname m_product_bom_id setbomqty setline defaultvalue m_product_bom m_product_id m_product_id setm_productbom_id setm_product_bom_id setm_product_id load constructor public x m product bom properties ctx result set rs string trx name super ctx rs trx name x_m_product_bom resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product bom append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_bom get_id tostring set bom quantity bill of materials quantity public void setbom qty big decimal bom qty if bom qty null throw new illegal argument exception bom qty is mandatory set value bom qty bom qty setbomqty bigdecimal bomqty bomqty illegalargumentexception bomqty set_value bomqty bomqty get bom quantity bill of materials quantity public big decimal getbom qty big decimal bd big decimal get value bom qty if bd null return env zero return bd bigdecimal getbomqty bigdecimal bigdecimal get_value bomqty public static final string bomtype standardpart p set bom type type of bom public void setbom type string bom type if bom type null throw new illegal argument exception bom type is mandatory if bom type null bom type equals 1 bom type equals 2 bom type equals 3 bom type equals 4 bom type equals 5 bom type equals 6 bom type equals 7 bom type equals 8 bom type equals 9 bom type equals o bom type equals p else throw new illegal argument exception bom type invalid value bom type reference id 279 1 2 3 4 5 6 7 8 9 o p if bom type null bom type length 1 log warning length 1 truncated bom type bom type substring 0 0 set value bom type bom type bomtype_standardpart setbomtype bomtype bomtype illegalargumentexception bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype bomtype illegalargumentexception bomtype bomtype reference_id bomtype bomtype bomtype bomtype set_value bomtype bomtype get bom type type of bom public string getbom type return string get value bom type getbomtype get_value bomtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue public static final int m productbom id ad reference id 162 set bom product bill of material component product public void setm productbom id int m productbom id if m productbom id 1 throw new illegal argument exception m productbom id is mandatory set value m productbom id new integer m productbom id m_productbom_id_ad_reference_id setm_productbom_id m_productbom_id m_productbom_id illegalargumentexception m_productbom_id set_value m_productbom_id m_productbom_id get bom product bill of material component product public int getm productbom id integer ii integer get value m productbom id if ii null return 0 return ii int value getm_productbom_id get_value m_productbom_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm productbom id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_productbom_id set bom line public void setm product bom id int m product bom id if m product bom id 1 throw new illegal argument exception m product bom id is mandatory set valuenocheck m product bom id new integer m product bom id setm_product_bom_id m_product_bom_id m_product_bom_id illegalargumentexception m_product_bom_id set_valuenocheck m_product_bom_id m_product_bom_id get bom line public int getm product bom id integer ii integer get value m product bom id if ii null return 0 return ii int value getm_product_bom_id get_value m_product_bom_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue configj boss public configj boss configuration data data super data configjboss configjboss configurationdata initialize public void init p data set apps server deploy dir get deploy dir p data set apps server deploy dir false p data set apps serverjnp port 1099 p data set apps serverjnp port true p data set apps server web port 80 p data set apps server web port true p data set apps serverssl port 443 p data set apps serverssl port true p_data setappsserverdeploydir getdeploydir p_data setappsserverdeploydir p_data setappsserverjnpport p_data setappsserverjnpport p_data setappsserverwebport p_data setappsserverwebport p_data setappsserversslport p_data setappsserversslport get deployment dir return deployment dir private string get deploy dir return p data get compiere home file separator jboss file separator server file separator adempiere file separator deploy getdeploydir p_data getcompierehome test return error message or null if ok public string test apps server string server p data get apps server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 inet address apps server null string error not correct apps server server try if pass apps server inet address get by name server catch exception e error e get message pass false signalok get panel ok apps server error apps server pass true error if pass return error log info ok apps server apps server set property configuration data compiere apps server apps server get host name set property configuration data compiere apps type p data get apps server type deployment dir p data set apps server deploy dir get deploy dir file deploy new file p data get apps server deploy dir pass deploy exists error not found deploy signalok get panel ok deploy dir error deploy dir pass true error if pass return error set property configuration data compiere apps deploy p data get apps server deploy dir log info ok deploy directory deploy jnp port int jnp port p data get apps serverjnp port pass p data test port apps server jnp port false p data test server port jnp port error not correct jnp port jnp port signalok get panel okjnp port errorjnp port pass true error if pass return error log info ok jnp port jnp port set property configuration data compiere jnp port string value of jnp port web port int web port p data get apps server web port pass p data test port http apps server get host name web port p data test server port web port error not correct web port web port signalok get panel ok web port error web port pass true error if pass return error log info ok web port web port set property configuration data compiere web port string value of web port ssl port int ssl port p data get apps serverssl port pass p data test port https apps server get host name ssl port p data test server port ssl port error not correct ssl port ssl port signalok get panel okssl port error web port pass true error if pass return error log info ok ssl port ssl port set property configuration data compiere ssl port string value of ssl port return null appsserver p_data getappsserver tolowercase indexof inetaddress appsserver appsserver appsserver inetaddress getbyname getmessage getpanel okappsserver errorappsserver appsserver appsserver setproperty configurationdata compiere_apps_server appsserver gethostname setproperty configurationdata compiere_apps_type p_data getappsservertype p_data setappsserverdeploydir getdeploydir p_data getappsserverdeploydir getpanel okdeploydir errordeploydir setproperty configurationdata compiere_apps_deploy p_data getappsserverdeploydir jnpport p_data getappsserverjnpport p_data testport appsserver jnpport p_data testserverport jnpport jnpport getpanel okjnpport errorjnpport jnpport jnpport setproperty configurationdata compiere_jnp_port valueof jnpport webport p_data getappsserverwebport p_data testport appsserver gethostname webport p_data testserverport webport webport getpanel okwebport errorwebport webport setproperty configurationdata compiere_web_port valueof webport sslport p_data getappsserversslport p_data testport appsserver gethostname sslport p_data testserverport sslport sslport getpanel oksslport errorwebport sslport setproperty configurationdata compiere_ssl_port valueof sslport default constructor public c table super new default table model set column selection allowed false set selection mode list selection model single selection set auto resize mode j table auto resize off get table header add mouse listener new c table mouse listener set surrenders focus on keystroke true ctable defaulttablemodel setcolumnselectionallowed setselectionmode listselectionmodel single_selection setautoresizemode jtable auto_resize_off gettableheader addmouselistener ctablemouselistener setsurrendersfocusonkeystroke set model index of key column used for identifying previous selected row after fort complete to set as selected row if not set column 0 is used param key column index model index public void set key column index int key column index p keycolumnindex key column index keycolumnindex setkeycolumnindex keycolumnindex p_keycolumnindex keycolumnindex get model index of key column return model index public int get key column index return p keycolumnindex getkeycolumnindex p_keycolumnindex get current row key column value return value or null public object get selected key column value int row get selected row if row 1 p keycolumnindex 1 return get model get value at row p keycolumnindex return null getselectedkeycolumnvalue getselectedrow p_keycolumnindex getmodel getvalueat p_keycolumnindex get selected value or null return value public object get selected value int row get selected row int col get selected column if row 1 col 1 return null return get value at row col getselectedvalue getselectedrow getselectedcolumn getvalueat stop table editors and remove focus param save value save value public void stop editor boolean save value multi row remove editors change event ce new change event this if save value editing stopped ce else editing canceled ce if get input context null get input context end composition change focus to next transfer focus savevalue stopeditor savevalue multirow changeevent changeevent savevalue editingstopped editingcanceled getinputcontext getinputcontext endcomposition transferfocus size columns param use column identifier if false uses plain content otherwise uses column identifier to indicate displayed columns public void auto size boolean use column identifier table model model this get model int size model get column count for all columns for int c 0 c size c table column column get column model get column c not displayed columns if use column identifier column get identifier null column get max width 0 column get identifier to string length 0 continue int width 0 header table cell renderer renderer column get header renderer if renderer null renderer new default table cell renderer component comp null if renderer null comp renderer get table cell renderer component this column get header value false false 0 0 if comp null width comp get preferred size width width math max width comp get width cells int col column get model index int max row math min 20 get row count try for int row 0 row max row row renderer get cell renderer row col comp renderer get table cell renderer component this get value at row col false false row col int row width comp get preferred size width width math max width row width catch exception e log log level severe column get identifier to string e width not greater than 250 width math min maxsize width slack column set preferred width width for all columns usecolumnidentifier autosize usecolumnidentifier tablemodel getmodel getcolumncount tablecolumn getcolumnmodel getcolumn usecolumnidentifier getidentifier getmaxwidth getidentifier tostring tablecellrenderer getheaderrenderer defaulttablecellrenderer gettablecellrenderercomponent getheadervalue getpreferredsize getwidth getmodelindex maxrow getrowcount maxrow getcellrenderer gettablecellrenderercomponent getvalueat rowwidth getpreferredsize rowwidth getidentifier tostring setpreferredwidth sort table param model column index model column sort index suppress warnings unchecked protected void sort int model column index int rows get row count if rows 0 return other column if model column index p lastsortindex p asc true else p asc p asc p lastsortindex model column index log config model column index rows rows asc p asc selection object selected null int sel row get selected row int sel col p keycolumnindex 1 0 p keycolumnindex used to identify current row if get selected row 0 selected get value at sel row sel col prepare sorting default table model model default table model get model m sort sort new m sort 0 null sort set sort asc p asc while something to sort sorting while true create sort list array list m sort sort list new array list m sort rows fill with data entity for int i 0 i rows i object value model get value at i model column index sort list add new m sort i value sort list it collections sort sort list sort move out of sequence row for int i 0 i rows i int index m sort sort list get i index if i index log config move i to index model move row i i index continue sorting we are done log config done break while something to sort selection clear selection if selected null for int r 0 r rows r if selected equals get value at r sel col set row selection interval r r break selected null modelcolumnindex suppresswarnings modelcolumnindex getrowcount modelcolumnindex p_lastsortindex p_asc p_asc p_asc p_lastsortindex modelcolumnindex modelcolumnindex p_asc selrow getselectedrow selcol p_keycolumnindex p_keycolumnindex getselectedrow getvalueat selrow selcol defaulttablemodel defaulttablemodel getmodel msort msort setsortasc p_asc sortlist arraylist msort sortlist arraylist msort getvalueat modelcolumnindex sortlist msort sortlist msort sortlist moverow clearselection getvalueat selcol setrowselectioninterval string representation return info public string to string return new string buffer c table append get model append to string tostring stringbuffer ctable getmodel tostring constructor public c table mouse listener super ctablemouselistener mouse clicked param e event public void mouse clicked mouse event e int vc get column model get column index atx e getx log info sort vc get column model get column vc get header value int mc convert column index to model vc sort mc mouseclicked mouseevent getcolumnmodel getcolumnindexatx getcolumnmodel getcolumn getheadervalue convertcolumnindextomodel static create ui param c return compiere button ui public static componentui createui j component c return s buttonui jcomponent s_buttonui install defaults param b public void install defaults abstract button b super install defaults b b set opaque false installdefaults abstractbutton installdefaults setopaque update this method is invoked by code j component code when the specified component is being painted by default this method will fill the specified component with its background color if its code opaque code property is code true code and then immediately call code paint code param g the code graphics code context in which to paint param c the component being painted see paint see javax swing j component paint component public void update graphics g j component c system out println c get class j button c get text c is opaque if c is opaque compiere utils fill rectange graphics2d g c compiere look and feel round paint g c jcomponent jcomponent paintcomponent jcomponent getclass jbutton gettext isopaque isopaque compiereutils fillrectange compierelookandfeel paint 3d boxes param g param c public void paint graphics g j component c super paint g c abstract button b abstract button c button model model b get model boolean in model is pressed model is selected if b is border painted compiere utils paint3 deffect graphics2d g c compiere look and feel round in jcomponent abstractbutton abstractbutton buttonmodel getmodel ispressed isselected isborderpainted compiereutils paint3deffect compierelookandfeel don t get selected color use default otherwise the pressed button is gray param g param b protected void paint button pressed graphics g abstract button b if b is content area filled dimension size b get size g set color get select color g fill rect 0 0 size width size height paintbuttonpressed abstractbutton iscontentareafilled getsize setcolor getselectcolor fillrect is tool bar button param c return true if toolbar boolean is tool bar button j component c return c get parent instanceof j tool bar istoolbarbutton jcomponent getparent jtoolbar create button listener param b button return listener protected basic button listener create button listener abstract button b return new compiere button listener b basicbuttonlistener createbuttonlistener abstractbutton compierebuttonlistener get create archive return existing document or newly created if client enabled archiving will return null if archiving not enabled public pdf document archive layout engine layout print info info do we need to archive m client client m client get layout get ctx string aa client client get auto archive string aa role null role get auto archive todo string aa aa client if aa null aa m client autoarchive none if aa role null if aa role equals m client autoarchive allreportsdocuments aa aa role else if aa role equals m client autoarchive documents aa client equals m client autoarchive allreportsdocuments aa aa role mothing to archive if aa equals m client autoarchive none return null archive external only if aa equals m client autoarchive externaldocuments if info is report return null archive documents only if aa equals m client autoarchive documents if info is report return null create printable byte data document getpdf as array layout get pageable false no copy if data null return null todo to be done async m archive archive new m archive layout get ctx info null archive set binary data data archive save return null pdfdocument layoutengine printinfo mclient mclient getctx aaclient getautoarchive aarole getautoarchive aaclient mclient autoarchive_none aarole aarole mclient autoarchive_allreportsdocuments aarole aarole mclient autoarchive_documents aaclient mclient autoarchive_allreportsdocuments aarole mclient autoarchive_none mclient autoarchive_externaldocuments isreport mclient autoarchive_documents isreport getpdfasarray getpageable marchive marchive getctx setbinarydata can we archive the document param layout layout return true if can be archived public static boolean is valid layout engine layout return layout null document is valid pageable layout layout get number of pages 0 isvalid layoutengine isvalid getnumberofpages get archive engine return engine public static archive engine get if s engine null s engine new archive engine return s engine archiveengine s_engine s_engine archiveengine s_engine archive engine private archive engine super if s engine null s engine this archiveengine archiveengine s_engine s_engine payment invoice when invoice selected set invoice amt invoice open discount amt c invoice discount id date trx amount invoice open id discount write off amt over under amt 0 public string invoice properties ctx int window no m tab m tab m field m field object value integer c invoice id integer value if is callout active assuming it is resetting value c invoice id null c invoice id int value 0 return check payment int c payment id env get context as int ctx window no c payment id m payment payment new m payment ctx c payment id null if payment getc charge id 0 payment getc invoice id 0 payment getc order id 0 return msg get msg ctx payment is allocated set callout active true m tab set value discount amt env zero m tab set value write off amt env zero m tab set value over under amt env zero int c invoicepayschedule id 0 if env get context as int ctx env window info env tab info c invoice id c invoice id int value env get context as int ctx env window info env tab info c invoicepayschedule id 0 c invoicepayschedule id env get context as int ctx env window info env tab info c invoicepayschedule id payment date timestamp ts env get context as date ctx window no date trx string sql select c bpartner id c currency id 1 2 invoice open c invoice id 3 1 invoice discount c invoice id isso trx 4 5 2 3 from c invoice where c invoice id 4 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c invoicepayschedule id pstmt set timestamp 2 ts pstmt set int 3 c invoicepayschedule id pstmt set int 4 c invoice id int value result set rs pstmt execute query if rs next m tab set value c bpartner id new integer rs get int 1 int c currency id rs get int 2 set invoice currency m tab set value c currency id new integer c currency id big decimal invoice open rs get big decimal 3 set invoice o pen amount if invoice open null invoice open env zero big decimal discount amt rs get big decimal 4 set discount amt if discount amt null discount amt env zero m tab set value invoice amt invoice open m tab set value amount invoice open subtract discount amt m tab set value discount amt discount amt reset as dependent fields get reset env set context ctx window no c invoice id c invoice id to string m tab set value c invoice id c invoice id rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message set callout active false return payment_invoice invoiceamt invoiceopen discountamt c_invoice_discount datetrx invoiceopen writeoffamt overunderamt windowno mtab mtab mfield mfield c_invoice_id iscalloutactive c_invoice_id c_invoice_id intvalue c_payment_id getcontextasint windowno c_payment_id mpayment mpayment c_payment_id getc_charge_id getc_invoice_id getc_order_id getmsg paymentisallocated setcalloutactive mtab setvalue discountamt mtab setvalue writeoffamt mtab setvalue overunderamt c_invoicepayschedule_id getcontextasint window_info tab_info c_invoice_id c_invoice_id intvalue getcontextasint window_info tab_info c_invoicepayschedule_id c_invoicepayschedule_id getcontextasint window_info tab_info c_invoicepayschedule_id getcontextasdate windowno datetrx c_bpartner_id c_currency_id invoiceopen c_invoice_id invoicediscount c_invoice_id issotrx c_invoice c_invoice_id preparedstatement preparestatement setint c_invoicepayschedule_id settimestamp setint c_invoicepayschedule_id setint c_invoice_id intvalue resultset executequery mtab setvalue c_bpartner_id getint c_currency_id getint mtab setvalue c_currency_id c_currency_id bigdecimal invoiceopen getbigdecimal open invoiceopen invoiceopen bigdecimal discountamt getbigdecimal discountamt discountamt mtab setvalue invoiceamt invoiceopen mtab setvalue invoiceopen discountamt mtab setvalue discountamt discountamt setcontext windowno c_invoice_id c_invoice_id tostring mtab setvalue c_invoice_id c_invoice_id sqlexception setcalloutactive getlocalizedmessage setcalloutactive payment amounts change of is over under payment set over under amt to 0 c currency id c convesionrate id convert all pay amt discount amt write off amt over under amt pay amt make sure that add up to invoice open amt public string amounts properties ctx int window no m tab m tab m field m field object value object old value if is callout active assuming it is resetting value return no invoice int c invoice id env get context as int ctx window no c invoice id if c invoice id 0 return set callout active true get info from tab big decimal amount big decimal m tab get value amount big decimal discount amt big decimal m tab get value discount amt big decimal write off amt big decimal m tab get value write off amt big decimal over under amt big decimal m tab get value over under amt big decimal invoice amt big decimal m tab get value invoice amt log fine amt amount discount discount amt write off write off amt over under over under amt invoice invoice amt changed column string col name m field get column name pay amt calculate write off if col name equals amount write off amt invoice amt subtract amount subtract discount amt subtract over under amt m tab set value write off amt write off amt else calculate amount amount invoice amt subtract discount amt subtract write off amt subtract over under amt m tab set value amount amount set callout active false return payment_amounts isoverunderpayment overunderamt c_currency_id c_convesionrate_id payamt discountamt writeoffamt overunderamt payamt invoiceopenamt windowno mtab mtab mfield mfield oldvalue iscalloutactive c_invoice_id getcontextasint windowno c_invoice_id c_invoice_id setcalloutactive bigdecimal bigdecimal mtab getvalue bigdecimal discountamt bigdecimal mtab getvalue discountamt bigdecimal writeoffamt bigdecimal mtab getvalue writeoffamt bigdecimal overunderamt bigdecimal mtab getvalue overunderamt bigdecimal invoiceamt bigdecimal mtab getvalue invoiceamt discountamt writeoff writeoffamt overunder overunderamt invoiceamt colname mfield getcolumnname payamt colname writeoffamt invoiceamt discountamt overunderamt mtab setvalue writeoffamt writeoffamt invoiceamt discountamt writeoffamt overunderamt mtab setvalue setcalloutactive standard constructor public x m inoutlineconfirm properties ctx int m inoutlineconfirm id string trx name super ctx m inoutlineconfirm id trx name if m inoutlineconfirm id 0 set confirmed qty env zero setm inoutconfirm id 0 setm inoutlineconfirm id 0 setm inoutline id 0 set processed false set target qty env zero x_m_inoutlineconfirm m_inoutlineconfirm_id trxname m_inoutlineconfirm_id trxname m_inoutlineconfirm_id setconfirmedqty setm_inoutconfirm_id setm_inoutlineconfirm_id setm_inoutline_id setprocessed settargetqty load constructor public x m inoutlineconfirm properties ctx result set rs string trx name super ctx rs trx name x_m_inoutlineconfirm resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inoutlineconfirm append get id append return sb to string tostring stringbuffer stringbuffer x_m_inoutlineconfirm get_id tostring set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set value c invoiceline id null else set value c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_value c_invoiceline_id set_value c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set confirmation no confirmation number public void set confirmation no string confirmation no if confirmation no null confirmation no length 20 log warning length 20 truncated confirmation no confirmation no substring 0 19 set value confirmation no confirmation no setconfirmationno confirmationno confirmationno confirmationno confirmationno confirmationno set_value confirmationno confirmationno get confirmation no confirmation number public string get confirmation no return string get value confirmation no getconfirmationno get_value confirmationno set confirmed quantity confirmation of a received quantity public void set confirmed qty big decimal confirmed qty if confirmed qty null throw new illegal argument exception confirmed qty is mandatory set value confirmed qty confirmed qty setconfirmedqty bigdecimal confirmedqty confirmedqty illegalargumentexception confirmedqty set_value confirmedqty confirmedqty get confirmed quantity confirmation of a received quantity public big decimal get confirmed qty big decimal bd big decimal get value confirmed qty if bd null return env zero return bd bigdecimal getconfirmedqty bigdecimal bigdecimal get_value confirmedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set difference difference quantity public void set difference qty big decimal difference qty set value difference qty difference qty setdifferenceqty bigdecimal differenceqty set_value differenceqty differenceqty get difference difference quantity public big decimal get difference qty big decimal bd big decimal get value difference qty if bd null return env zero return bd bigdecimal getdifferenceqty bigdecimal bigdecimal get_value differenceqty set ship receipt confirmation material shipment or receipt confirmation public void setm inoutconfirm id int m inoutconfirm id if m inoutconfirm id 1 throw new illegal argument exception m inoutconfirm id is mandatory set valuenocheck m inoutconfirm id new integer m inoutconfirm id setm_inoutconfirm_id m_inoutconfirm_id m_inoutconfirm_id illegalargumentexception m_inoutconfirm_id set_valuenocheck m_inoutconfirm_id m_inoutconfirm_id get ship receipt confirmation material shipment or receipt confirmation public int getm inoutconfirm id integer ii integer get value m inoutconfirm id if ii null return 0 return ii int value getm_inoutconfirm_id get_value m_inoutconfirm_id intvalue set ship receipt confirmation line material shipment or receipt confirmation line public void setm inoutlineconfirm id int m inoutlineconfirm id if m inoutlineconfirm id 1 throw new illegal argument exception m inoutlineconfirm id is mandatory set valuenocheck m inoutlineconfirm id new integer m inoutlineconfirm id setm_inoutlineconfirm_id m_inoutlineconfirm_id m_inoutlineconfirm_id illegalargumentexception m_inoutlineconfirm_id set_valuenocheck m_inoutlineconfirm_id m_inoutlineconfirm_id get ship receipt confirmation line material shipment or receipt confirmation line public int getm inoutlineconfirm id integer ii integer get value m inoutlineconfirm id if ii null return 0 return ii int value getm_inoutlineconfirm_id get_value m_inoutlineconfirm_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm inoutline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_inoutline_id set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set scrapped quantity the quantity scrapped due to qa issues public void set scrapped qty big decimal scrapped qty set value scrapped qty scrapped qty setscrappedqty bigdecimal scrappedqty set_value scrappedqty scrappedqty get scrapped quantity the quantity scrapped due to qa issues public big decimal get scrapped qty big decimal bd big decimal get value scrapped qty if bd null return env zero return bd bigdecimal getscrappedqty bigdecimal bigdecimal get_value scrappedqty set target quantity target movement quantity public void set target qty big decimal target qty if target qty null throw new illegal argument exception target qty is mandatory set valuenocheck target qty target qty settargetqty bigdecimal targetqty targetqty illegalargumentexception targetqty set_valuenocheck targetqty targetqty get target quantity target movement quantity public big decimal get target qty big decimal bd big decimal get value target qty if bd null return env zero return bd bigdecimal gettargetqty bigdecimal bigdecimal get_value targetqty standard constructor public x c cycle properties ctx int c cycle id string trx name super ctx c cycle id trx name if c cycle id 0 setc currency id 0 setc cycle id 0 set name null x_c_cycle c_cycle_id trxname c_cycle_id trxname c_cycle_id setc_currency_id setc_cycle_id setname load constructor public x c cycle properties ctx result set rs string trx name super ctx rs trx name x_c_cycle resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cycle append get id append return sb to string tostring stringbuffer stringbuffer x_c_cycle get_id tostring set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set project cycle identifier for this project reporting cycle public void setc cycle id int c cycle id if c cycle id 1 throw new illegal argument exception c cycle id is mandatory set valuenocheck c cycle id new integer c cycle id setc_cycle_id c_cycle_id c_cycle_id illegalargumentexception c_cycle_id set_valuenocheck c_cycle_id c_cycle_id get project cycle identifier for this project reporting cycle public int getc cycle id integer ii integer get value c cycle id if ii null return 0 return ii int value getc_cycle_id get_value c_cycle_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get contents return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals is send rfq p issendrfq y equals para i get parameter else log log level severe unknown parameter name p c rfq id getrecord id processinfoparameter getparameter getparametername getparameter issendrfq p_issendrfq getparameter p_c_rfq_id getrecord_id perform process return message translated text throws exception if not successful protected string do it throws exception m rfq rfq new m rfq get ctx p c rfq id get trxname log info do it rfq send p issendrfq string error rfq check quote total amt only if error null error length 0 throw new exception error int counter 0 int sent 0 int not sent 0 get all existing responses m rfq response responses rfq get responses false false topic m rfq topic topic new m rfq topic get ctx rfq getc rfq topic id get trxname m rfq topic subscriber subscribers topic get subscribers for int i 0 i subscribers length i m rfq topic subscriber subscriber subscribers i boolean skip false existing response for int r 0 r responses length r if subscriber getc bpartner id responses r getc bpartner id subscriber getc bpartner location id responses r getc bpartner location id skip true break if skip continue create response m rfq response response new m rfq response rfq subscriber if response get id 0 no lines continue counter if p issendrfq if response send rfq sent else not sent for all subscribers string ret value created counter if p issendrfq ret value is send rfq sent error not sent return ret value doit mrfq mrfq getctx p_c_rfq_id get_trxname doit p_issendrfq checkquotetotalamtonly notsent mrfqresponse getresponses mrfqtopic mrfqtopic getctx getc_rfq_topic_id get_trxname mrfqtopicsubscriber getsubscribers mrfqtopicsubscriber getc_bpartner_id getc_bpartner_id getc_bpartner_location_id getc_bpartner_location_id mrfqresponse mrfqresponse get_id p_issendrfq sendrfq notsent retvalue p_issendrfq retvalue issendrfq notsent retvalue standard constructor public x ad replicationtable properties ctx int ad replicationtable id string trx name super ctx ad replicationtable id trx name if ad replicationtable id 0 setad replicationstrategy id 0 setad replicationtable id 0 setad table id 0 set entity type null u set replication type null x_ad_replicationtable ad_replicationtable_id trxname ad_replicationtable_id trxname ad_replicationtable_id setad_replicationstrategy_id setad_replicationtable_id setad_table_id setentitytype setreplicationtype load constructor public x ad replicationtable properties ctx result set rs string trx name super ctx rs trx name x_ad_replicationtable resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad replicationtable append get id append return sb to string tostring stringbuffer stringbuffer x_ad_replicationtable get_id tostring set replication strategy data replication strategy public void setad replicationstrategy id int ad replicationstrategy id if ad replicationstrategy id 1 throw new illegal argument exception ad replicationstrategy id is mandatory set valuenocheck ad replicationstrategy id new integer ad replicationstrategy id setad_replicationstrategy_id ad_replicationstrategy_id ad_replicationstrategy_id illegalargumentexception ad_replicationstrategy_id set_valuenocheck ad_replicationstrategy_id ad_replicationstrategy_id get replication strategy data replication strategy public int getad replicationstrategy id integer ii integer get value ad replicationstrategy id if ii null return 0 return ii int value getad_replicationstrategy_id get_value ad_replicationstrategy_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad replicationstrategy id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_replicationstrategy_id set replication table data replication strategy table info public void setad replicationtable id int ad replicationtable id if ad replicationtable id 1 throw new illegal argument exception ad replicationtable id is mandatory set valuenocheck ad replicationtable id new integer ad replicationtable id setad_replicationtable_id ad_replicationtable_id ad_replicationtable_id illegalargumentexception ad_replicationtable_id set_valuenocheck ad_replicationtable_id ad_replicationtable_id get replication table data replication strategy table info public int getad replicationtable id integer ii integer get value ad replicationtable id if ii null return 0 return ii int value getad_replicationtable_id get_value ad_replicationtable_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype public static final string replicationtype reference r set replication type type of data replication public void set replication type string replication type if replication type null throw new illegal argument exception replication type is mandatory if replication type equals l replication type equals m replication type equals r else throw new illegal argument exception replication type invalid value replication type reference id 126 l m r if replication type length 1 log warning length 1 truncated replication type replication type substring 0 0 set value replication type replication type replicationtype_reference setreplicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype reference_id replicationtype replicationtype replicationtype set_value replicationtype replicationtype get replication type type of data replication public string get replication type return string get value replication type getreplicationtype get_value replicationtype constructor public print data function printdatafunction add value to counter param bd data public void add value big decimal bd if bd null sum m sum m sum add bd count m count min if m min null m min bd m min m min min bd max if m max null m max bd m max m max max bd sum of squares m sumsquare m sumsquare add bd multiply bd m totalcount addvalue bigdecimal m_sum m_sum m_count m_min m_min m_min m_min m_max m_max m_max m_max m_sumsquare m_sumsquare m_totalcount get function value param function function return function value public big decimal get value char function sum if function f sum return m sum min max if function f min return m min if function f max return m max count big decimal count new big decimal m count if function f count return count all other functions require count 0 if m count 0 return env zero mean sum count round to 4 digits if function f mean big decimal mean m sum divide count 4 big decimal round half up if mean scale 4 mean mean set scale 4 big decimal round half up return mean variance sum of squares square of sum count big decimal ss m sum multiply m sum ss ss divide count 4 big decimal round half up big decimal variance m sumsquare subtract ss if function f variance if variance scale 4 variance variance set scale 4 big decimal round half up return variance standard deviation big decimal deviation new big decimal math sqrt variance double value if deviation scale 4 deviation deviation set scale 4 big decimal round half up return deviation bigdecimal getvalue f_sum m_sum f_min m_min f_max m_max bigdecimal bigdecimal m_count f_count m_count f_mean bigdecimal m_sum bigdecimal round_half_up setscale bigdecimal round_half_up bigdecimal m_sum m_sum bigdecimal round_half_up bigdecimal m_sumsquare f_variance setscale bigdecimal round_half_up bigdecimal bigdecimal doublevalue setscale bigdecimal round_half_up reset value public void reset m count 0 m totalcount 0 m sum env zero m sumsquare env zero m min null m max null m_count m_totalcount m_sum m_sumsquare m_min m_max string representation return info public string to string string buffer sb new string buffer append count append m count append append m totalcount append sum append m sum append sum square append m sumsquare append min append m min append max append m max sb append return sb to string tostring stringbuffer stringbuffer m_count m_totalcount m_sum sumsquare m_sumsquare m_min m_max tostring get function symbol of function param function function return function symbol static public string get function symbol char function for int i 0 i functions length i if functions i function return function symbols i return unknown function function getfunctionsymbol function_symbols unknownfunction get function name of function param function function return function name static public string get function name char function for int i 0 i functions length i if functions i function return function names i return unknown function function getfunctionname function_names unknownfunction get funcuion name of function param function function return function name static public int get function display type char function if function f sum function f min function f max return display type amount if function f count return display type integer mean variance std deviation return display type number getfunctiondisplaytype f_sum f_min f_max displaytype f_count displaytype displaytype standard constructor public x r statuscategory properties ctx int r statuscategory id string trx name super ctx r statuscategory id trx name if r statuscategory id 0 set is default false set name null setr statuscategory id 0 x_r_statuscategory r_statuscategory_id trxname r_statuscategory_id trxname r_statuscategory_id setisdefault setname setr_statuscategory_id load constructor public x r statuscategory properties ctx result set rs string trx name super ctx rs trx name x_r_statuscategory resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r statuscategory append get id append return sb to string tostring stringbuffer stringbuffer x_r_statuscategory get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set status category request status category public void setr statuscategory id int r statuscategory id if r statuscategory id 1 throw new illegal argument exception r statuscategory id is mandatory set valuenocheck r statuscategory id new integer r statuscategory id setr_statuscategory_id r_statuscategory_id r_statuscategory_id illegalargumentexception r_statuscategory_id set_valuenocheck r_statuscategory_id r_statuscategory_id get status category request status category public int getr statuscategory id integer ii integer get value r statuscategory id if ii null return 0 return ii int value getr_statuscategory_id get_value r_statuscategory_id intvalue method init param controller m bank statement loader return boolean see org compiere impexp bank statement loader interface init m bank statement loader public boolean init m bank statement loader controller boolean result false file input stream m stream null try try to open the file specified as a process parameter if controller get local file name null m stream new file input stream controller get local file name try to open the file specified as part of the loader configuration else if controller get file name null m stream new file input stream controller get file name else return result if super init controller return result if m stream null return result result attach input m stream catch exception e m errormessage error reading data m errordescription return result mbankstatementloader bankstatementloaderinterface mbankstatementloader mbankstatementloader fileinputstream m_stream getlocalfilename m_stream fileinputstream getlocalfilename getfilename m_stream fileinputstream getfilename m_stream attachinput m_stream m_errormessage errorreadingdata m_errordescription method characters param ch char param start int param length int throws sax exception see org xml sax content handler characters char int int public void characters char ch int start int length throws sax exception there are no additional things to do when importing from file all data is handled by ofx bank statement handler super characters ch start length saxexception contenthandler saxexception ofxbankstatementhandler standard constructor param ctx context param m distributionlist id id public m distribution list properties ctx int m distributionlist id string trx name super ctx m distributionlist id trx name m_distributionlist_id mdistributionlist m_distributionlist_id trxname m_distributionlist_id trxname load constructor param ctx context param rs result set public m distribution list properties ctx result set rs string trx name super ctx rs trx name mdistributionlist resultset trxname trxname get distibution lines add correct also total ratio return array of lines public m distribution list line get lines array list m distribution list line list new array list m distribution list line big decimal ratio total env zero string sql select from m distributionlistline where m distributionlist id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm distributionlist id result set rs pstmt execute query while rs next m distribution list line line new m distribution list line get ctx rs get trxname list add line big decimal ratio line get ratio if ratio null ratio total ratio total add ratio rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null update ratio if ratio total compare to get ratio total 0 log info get lines set ratio total from get ratio total to ratio total set ratio total ratio total save m distribution list line ret value new m distribution list line list size list to array ret value return ret value mdistributionlistline getlines arraylist mdistributionlistline arraylist mdistributionlistline bigdecimal ratiototal m_distributionlistline m_distributionlist_id preparedstatement preparestatement get_trxname setint getm_distributionlist_id resultset executequery mdistributionlistline mdistributionlistline getctx get_trxname bigdecimal getratio ratiototal ratiototal getlines ratiototal compareto getratiototal getlines ratiototal getratiototal ratiototal setratiototal ratiototal mdistributionlistline retvalue mdistributionlistline toarray retvalue retvalue constructor param display type param format param tc param title public m doc number int display type decimal format format j text component tc string title super if format null tc null title null throw new illegal argument exception invalid argument m displaytype display type m format format m tc tc m title title decimal format symbols sym m format get decimal format symbols m decimalseparator sym get decimal separator m groupingseparator sym get grouping separator m minussign sym get minus sign log finest decimal m decimalseparator int m decimalseparator group m groupingseparator int m groupingseparator displaytype mdocnumber displaytype decimalformat jtextcomponent illegalargumentexception m_displaytype displaytype m_format m_tc m_title decimalformatsymbols m_format getdecimalformatsymbols m_decimalseparator getdecimalseparator m_groupingseparator getgroupingseparator m_minussign getminussign m_decimalseparator m_decimalseparator m_groupingseparator m_groupingseparator insert string param orig offset param string param attr throws bad location exception public void insert string int orig offset string string attribute set attr throws bad location exception log finest offset orig offset string string length string length if orig offset 0 string null throw new illegal argument exception invalid argument int offset orig offset int length string length from data binder assuming correct format if length 1 super insert string offset string attr return manual entry string content get text remove all thousands if content index of m groupingseparator 1 string buffer result new string buffer for int i 0 i content length i if content char at i m groupingseparator if i offset offset else result append content char at i super remove 0 content length super insert string 0 result to string attr m tc set caret position offset a debug trace a debug l6 database clear thousands m format to pattern content result to string content result to string remove thousands check character entered char c string char at 0 if character is digit c c 0 c 9 a debug trace a debug l6 database digit c super insert string offset string attr return plus remove minus sign if c a debug trace a debug l6 database plus c only positive numbers if m displaytype display type integer return if content char at 0 super remove 0 1 toggle minus put minus on start of string else if c c m minussign a debug trace a debug l6 database minus c no minus possible if m displaytype display type integer return remove or add if content length 0 content char at 0 super remove 0 1 else super insert string 0 attr decimal remove other decimals thousand treat as decimal else if c m decimalseparator c m groupingseparator c c log info decimal c ds m decimalseparator gs m groupingseparator no decimals on integers if m displaytype display type integer return int pos content index of m decimalseparator put decimal in string decimal string value of m decimalseparator super insert string offset decimal attr remove other decimals if pos 0 content get text string buffer result new string buffer int correction 0 for int i 0 i content length i if content char at i m decimalseparator if i offset result append content char at i else if i offset correction else result append content char at i super remove 0 content length super insert string 0 result to string attr m tc set caret position offset correction 1 remove other decimals decimal or thousand something else else log fine input c int c string result v number start calculator m tc get text m format m displaytype m title super remove 0 content length super insert string 0 result attr origoffset badlocationexception insertstring origoffset attributeset badlocationexception origoffset origoffset illegalargumentexception origoffset databinder insertstring gettext indexof m_groupingseparator stringbuffer stringbuffer charat m_groupingseparator charat insertstring tostring m_tc setcaretposition adebug adebug l6_database m_format topattern tostring tostring charat isdigit adebug adebug l6_database insertstring adebug adebug l6_database m_displaytype displaytype charat m_minussign adebug adebug l6_database m_displaytype displaytype charat insertstring m_decimalseparator m_groupingseparator m_decimalseparator m_groupingseparator m_displaytype displaytype indexof m_decimalseparator valueof m_decimalseparator insertstring gettext stringbuffer stringbuffer charat m_decimalseparator charat charat insertstring tostring m_tc setcaretposition vnumber startcalculator m_tc gettext m_format m_displaytype m_title insertstring delete string param orig offset offeset param length length throws bad location exception public void remove int orig offset int length throws bad location exception log finest offset orig offset length length if orig offset 0 length 0 throw new illegal argument exception m doc number remove invalid argument int offset orig offset if length 1 super remove offset length return manual entry string content get text remove all thousands if content index of m groupingseparator 1 string buffer result new string buffer for int i 0 i content length i if content char at i m groupingseparator i orig offset if i offset offset else result append content char at i super remove 0 content length super insert string 0 result to string null m tc set caret position offset remove thousands super remove offset length origoffset badlocationexception origoffset badlocationexception origoffset origoffset illegalargumentexception mdocnumber origoffset gettext indexof m_groupingseparator stringbuffer stringbuffer charat m_groupingseparator origoffset charat insertstring tostring m_tc setcaretposition get full text return text private string get text content c get content string str try str c get string 0 c length 1 cr at end catch exception e return str gettext getcontent getstring get contsnts return contents public object get contents return contents getcontents config postgresql param data public config postgresql configuration data data super data configpostgresql configpostgresql configurationdata init public void init p data set database port string value of db postgresql default port p_data setdatabaseport valueof db_postgresql default_port discover databases to be overwritten by database configs param selected selected database return array of databases public string discover databases string selected if p discovered null return p discovered p discovered new string return p discovered discoverdatabases p_discovered p_discovered p_discovered p_discovered test return error message or null if ok public string test database server string server p data get database server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 string error not correct db server server inet address database server null try if pass database server inet address get by name server catch exception e error e get message pass false signalok get panel ok database server error database server pass true error log info ok database server database server set property configuration data compiere db server database server get host name set property configuration data compiere db type p data get database type database port int database port p data get database port pass p data test port database server database port true error db server port database port signalok get panel ok database server error database port pass true error if pass return error log info ok database port database port set property configuration data compiere db port string value of database port jdbc database info string database name p data get database name service name string system password p data get database system password url derived jdbc sybase tds prod1 5000 prod1 string url system p db get connectionurl database server get host name database port p db get system database database name p db get system user pass testjdbc url system p db get system user system password error error connecting url system p db get system user system password signalok get panel ok database system errorjdbc pass true error if pass return error log info ok system connection url system set property configuration data compiere db system system password database user info string database user p data get database user uid string database password p data get database password pwd pass database password null database password length 0 error invalid database user password signalok get panel ok database user errorjdbc pass true error if pass return error string url p db get connectionurl database server get host name database port database name database user ignore result as it might not be imported pass testjdbc url database user database password error database imported cannot connect to user database user database password signalok get panel ok database user errorjdbc pass false error if pass log info ok database user database user else log warning error set property configuration data compiere db url url set property configuration data compiere db name database name set property configuration data compiere db user database user set property configuration data compiere db password database password tns name info string sqlplus sqlplus system system password database name utils oracle test sql log config sqlplus pass testsql sqlplus error error connecting via sqlplus signalok get panel ok databasesql errortns pass true error if pass log info ok database sql connection oci test url jdbc oracle oci8 database name pass testjdbc url system system password if pass log info ok connection url else log warning cannot connect via net8 url set property configuration data compiere db tns database name return null p_data getdatabaseserver tolowercase indexof inetaddress databaseserver databaseserver inetaddress getbyname getmessage getpanel okdatabaseserver errordatabaseserver databaseserver setproperty configurationdata compiere_db_server databaseserver gethostname setproperty configurationdata compiere_db_type p_data getdatabasetype databaseport p_data getdatabaseport p_data testport databaseserver databaseport databaseport getpanel okdatabaseserver errordatabaseport databaseport setproperty configurationdata compiere_db_port valueof databaseport databasename p_data getdatabasename systempassword p_data getdatabasesystempassword urlsystem p_db getconnectionurl databaseserver gethostname databaseport p_db getsystemdatabase databasename p_db getsystemuser urlsystem p_db getsystemuser systempassword urlsystem p_db getsystemuser systempassword getpanel okdatabasesystem urlsystem setproperty configurationdata compiere_db_system systempassword databaseuser p_data getdatabaseuser databasepassword p_data getdatabasepassword databasepassword databasepassword getpanel okdatabaseuser p_db getconnectionurl databaseserver gethostname databaseport databasename databaseuser databaseuser databasepassword databaseuser databasepassword getpanel okdatabaseuser databaseuser setproperty configurationdata compiere_db_url setproperty configurationdata compiere_db_name databasename setproperty configurationdata compiere_db_user databaseuser setproperty configurationdata compiere_db_password databasepassword systempassword databasename getpanel okdatabasesql databasename systempassword setproperty configurationdata compiere_db_tns databasename test jdbc connection to server param url connection string param uid user id param pwd password return true if ok private boolean testjdbc string url string uid string pwd try connection conn p db get driver connection url uid pwd catch exception e log severe e to string return false return true p_db getdriverconnection tostring standard constructor public x c uom conversion properties ctx int c uom conversion id string trx name super ctx c uom conversion id trx name if c uom conversion id 0 setc uom conversion id 0 setc uom id 0 setc uom to id 0 set divide rate env zero set multiply rate env zero x_c_uom_conversion c_uom_conversion_id trxname c_uom_conversion_id trxname c_uom_conversion_id setc_uom_conversion_id setc_uom_id setc_uom_to_id setdividerate setmultiplyrate load constructor public x c uom conversion properties ctx result set rs string trx name super ctx rs trx name x_c_uom_conversion resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c uom conversion append get id append return sb to string tostring stringbuffer stringbuffer x_c_uom_conversion get_id tostring set uom conversion unit of measure conversion public void setc uom conversion id int c uom conversion id if c uom conversion id 1 throw new illegal argument exception c uom conversion id is mandatory set valuenocheck c uom conversion id new integer c uom conversion id setc_uom_conversion_id c_uom_conversion_id c_uom_conversion_id illegalargumentexception c_uom_conversion_id set_valuenocheck c_uom_conversion_id c_uom_conversion_id get uom conversion unit of measure conversion public int getc uom conversion id integer ii integer get value c uom conversion id if ii null return 0 return ii int value getc_uom_conversion_id get_value c_uom_conversion_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc uom conversion id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_uom_conversion_id public static final int c uom id ad reference id 114 set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id c_uom_id_ad_reference_id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue public static final int c uom to id ad reference id 114 set uom to target or destination unit of measure public void setc uom to id int c uom to id if c uom to id 1 throw new illegal argument exception c uom to id is mandatory set value c uom to id new integer c uom to id c_uom_to_id_ad_reference_id setc_uom_to_id c_uom_to_id c_uom_to_id illegalargumentexception c_uom_to_id set_value c_uom_to_id c_uom_to_id get uom to target or destination unit of measure public int getc uom to id integer ii integer get value c uom to id if ii null return 0 return ii int value getc_uom_to_id get_value c_uom_to_id intvalue set divide rate to convert source number to target number the source is divided public void set divide rate big decimal divide rate if divide rate null throw new illegal argument exception divide rate is mandatory set value divide rate divide rate setdividerate bigdecimal dividerate dividerate illegalargumentexception dividerate set_value dividerate dividerate get divide rate to convert source number to target number the source is divided public big decimal get divide rate big decimal bd big decimal get value divide rate if bd null return env zero return bd bigdecimal getdividerate bigdecimal bigdecimal get_value dividerate set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set multiply rate rate to multiple the source by to calculate the target public void set multiply rate big decimal multiply rate if multiply rate null throw new illegal argument exception multiply rate is mandatory set value multiply rate multiply rate setmultiplyrate bigdecimal multiplyrate multiplyrate illegalargumentexception multiplyrate set_value multiplyrate multiplyrate get multiply rate rate to multiple the source by to calculate the target public big decimal get multiply rate big decimal bd big decimal get value multiply rate if bd null return env zero return bd bigdecimal getmultiplyrate bigdecimal bigdecimal get_value multiplyrate standard constructor public x i reportline properties ctx int i reportline id string trx name super ctx i reportline id trx name if i reportline id 0 seti isimported false seti reportline id 0 x_i_reportline i_reportline_id trxname i_reportline_id trxname i_reportline_id seti_isimported seti_reportline_id load constructor public x i reportline properties ctx result set rs string trx name super ctx rs trx name x_i_reportline resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i reportline append get id append return sb to string tostring stringbuffer stringbuffer x_i_reportline get_id tostring public static final string amounttype yearquantity qy set amount type type of amount to report public void set amount type string amount type if amount type null throw new illegal argument exception amount type is mandatory if amount type null amount type equals bp amount type equals bt amount type equals by amount type equals cp amount type equals ct amount type equals cy amount type equals dp amount type equals dt amount type equals dy amount type equals qp amount type equals qt amount type equals qy else throw new illegal argument exception amount type invalid value amount type reference id 235 bp bt by cp ct cy dp dt dy qp qt qy if amount type null amount type length 2 log warning length 2 truncated amount type amount type substring 0 1 set value amount type amount type amounttype_yearquantity setamounttype amounttype amounttype illegalargumentexception amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype amounttype illegalargumentexception amounttype amounttype reference_id amounttype amounttype amounttype amounttype set_value amounttype amounttype get amount type type of amount to report public string get amount type return string get value amount type getamounttype get_value amounttype set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 0 set value c elementvalue id null else set value c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id set_value c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue public static final string calculationtype subtractop1 op2 s set calculation public void set calculation type string calculation type if calculation type null throw new illegal argument exception calculation type is mandatory if calculation type null calculation type equals a calculation type equals p calculation type equals r calculation type equals s else throw new illegal argument exception calculation type invalid value calculation type reference id 236 a p r s if calculation type null calculation type length 1 log warning length 1 truncated calculation type calculation type substring 0 0 set value calculation type calculation type calculationtype_subtractop1_op2 setcalculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype calculationtype calculationtype calculationtype calculationtype illegalargumentexception calculationtype calculationtype reference_id calculationtype calculationtype calculationtype calculationtype set_value calculationtype calculationtype get calculation public string get calculation type return string get value calculation type getcalculationtype get_value calculationtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set element key key of the element public void set element value string element value if element value null element value length 40 log warning length 40 truncated element value element value substring 0 39 set value element value element value setelementvalue elementvalue elementvalue elementvalue elementvalue elementvalue set_value elementvalue elementvalue get element key key of the element public string get element value return string get value element value getelementvalue get_value elementvalue set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set import report line set import report line set values public void seti reportline id int i reportline id if i reportline id 1 throw new illegal argument exception i reportline id is mandatory set valuenocheck i reportline id new integer i reportline id seti_reportline_id i_reportline_id i_reportline_id illegalargumentexception i_reportline_id set_valuenocheck i_reportline_id i_reportline_id get import report line set import report line set values public int geti reportline id integer ii integer get value i reportline id if ii null return 0 return ii int value geti_reportline_id get_value i_reportline_id intvalue set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue public static final string linetype segmentvalue s set line type public void set line type string line type if line type null throw new illegal argument exception line type is mandatory if line type null line type equals c line type equals s else throw new illegal argument exception line type invalid value line type reference id 241 c s if line type null line type length 1 log warning length 1 truncated line type line type substring 0 0 set value line type line type linetype_segmentvalue setlinetype linetype linetype illegalargumentexception linetype linetype linetype linetype illegalargumentexception linetype linetype reference_id linetype linetype linetype linetype set_value linetype linetype get line type public string get line type return string get value line type getlinetype get_value linetype set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set report line set public void setpa reportlineset id int pa reportlineset id if pa reportlineset id 0 set value pa reportlineset id null else set value pa reportlineset id new integer pa reportlineset id setpa_reportlineset_id pa_reportlineset_id pa_reportlineset_id set_value pa_reportlineset_id set_value pa_reportlineset_id pa_reportlineset_id get report line set public int getpa reportlineset id integer ii integer get value pa reportlineset id if ii null return 0 return ii int value getpa_reportlineset_id get_value pa_reportlineset_id intvalue set report line public void setpa reportline id int pa reportline id if pa reportline id 0 set value pa reportline id null else set value pa reportline id new integer pa reportline id setpa_reportline_id pa_reportline_id pa_reportline_id set_value pa_reportline_id set_value pa_reportline_id pa_reportline_id get report line public int getpa reportline id integer ii integer get value pa reportline id if ii null return 0 return ii int value getpa_reportline_id get_value pa_reportline_id intvalue set report source restriction of what will be shown in report line public void setpa reportsource id int pa reportsource id if pa reportsource id 0 set value pa reportsource id null else set value pa reportsource id new integer pa reportsource id setpa_reportsource_id pa_reportsource_id pa_reportsource_id set_value pa_reportsource_id set_value pa_reportsource_id pa_reportsource_id get report source restriction of what will be shown in report line public int getpa reportsource id integer ii integer get value pa reportsource id if ii null return 0 return ii int value getpa_reportsource_id get_value pa_reportsource_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type null posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type null posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set report line set name name of the report line set public void set report line set name string report line set name if report line set name null report line set name length 60 log warning length 60 truncated report line set name report line set name substring 0 59 set value report line set name report line set name setreportlinesetname reportlinesetname reportlinesetname reportlinesetname reportlinesetname reportlinesetname set_value reportlinesetname reportlinesetname get report line set name name of the report line set public string get report line set name return string get value report line set name getreportlinesetname get_value reportlinesetname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue get content return content public object get contents return contents getcontents constructor param ctx context public print data handler properties ctx m ctx ctx printdatahandler m_ctx get print data return print data public print data get print data return m pd printdata printdata printdata getprintdata m_pd receive notification of the start of an element param uri namespace param local name simple name param q name qualified name param attributes attributes throws org xml sax sax exception public void start element string uri string local name string q name attributes attributes throws org xml sax sax exception if q name equals print data xml tag string name attributes get value print data xml attribute name if m pd null m pd new print data m ctx name push m pd else print data temp new print data m ctx name m curpd add node temp push temp else if q name equals print data xml row tag m curpd add row false 0 else if q name equals print data element xml tag m curpdename attributes get value print data element xml attribute name m curpdevalue new string buffer localname qname saxexception startelement localname qname saxexception qname printdata xml_tag getvalue printdata xml_attribute_name m_pd m_pd printdata m_ctx m_pd printdata printdata m_ctx m_curpd addnode qname printdata xml_row_tag m_curpd addrow qname printdataelement xml_tag m_curpdename getvalue printdataelement xml_attribute_name m_curpdevalue stringbuffer receive notification of character data inside an element param ch buffer param start start param length length throws sax exception public void characters char ch int start int length throws sax exception m curpdevalue append ch start length saxexception saxexception m_curpdevalue receive notification of the end of an element param uri namespace param local name simple name param q name qualified name throws sax exception public void end element string uri string local name string q name throws sax exception if q name equals print data xml tag pop else if q name equals print data element xml tag m curpd add node new print data element m curpdename m curpdevalue to string 0 localname qname saxexception endelement localname qname saxexception qname printdata xml_tag qname printdataelement xml_tag m_curpd addnode printdataelement m_curpdename m_curpdevalue tostring push new pd on stack and set m cutpd param newpd new pd private void push print data newpd add m stack add newpd m curpd newpd m_cutpd printdata m_stack m_curpd pop last pd from stack and set m cutpd private void pop remove last if m stack size 0 m stack remove m stack size 1 get previous if m stack size 0 m curpd print data m stack get m stack size 1 m_cutpd m_stack m_stack m_stack m_stack m_curpd printdata m_stack m_stack basic constructor public kbd basic constructor param element adds an element to the element public kbd element element add element element addelement basic constructor param element adds an element to the element public kbd string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public kbd add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public kbd add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public kbd add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public kbd add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public kbd remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor public print data group printdatagroup add group column param group column name group column public void add group column string group column name m groups add group column name groupcolumnname addgroupcolumn groupcolumnname m_groups groupcolumnname get grouyp column count total is included as a column return number of groups public int get group column count return m groups size getgroupcolumncount m_groups column has a function param column name column name or total return true if column has function public boolean is group column string column name if column name null m groups size 0 return false for int i 0 i m groups size i if column name equals m groups get i return true return false columnname isgroupcolumn columnname columnname m_groups m_groups columnname m_groups check for group change param group column name column name param value column value return null if no group change otherwise old value public object group change string group column name object value if is group column group column name return null object new value value if new value null new value null if m groupmap contains key group column name object old value m groupmap get group column name if new value equals old value return null m groupmap put group column name new value return old value m groupmap put group column name new value return null groupcolumnname groupchange groupcolumnname isgroupcolumn groupcolumnname newvalue newvalue newvalue m_groupmap containskey groupcolumnname oldvalue m_groupmap groupcolumnname newvalue oldvalue m_groupmap groupcolumnname newvalue oldvalue m_groupmap groupcolumnname newvalue add function column param function column name column name param function function public void add function string function column name char function m functions add function column name delimiter function if m groups contains total m groups add total functioncolumnname addfunction functioncolumnname m_functions functioncolumnname m_groups m_groups column has a function param column name column name return true if column has function public boolean is function column string column name if column name null m functions size 0 return false for int i 0 i m functions size i string f string m functions get i if f starts with column name return true return false columnname isfunctioncolumn columnname columnname m_functions m_functions m_functions startswith columnname get calculated functions of column param column name column name or total return array of functions public char get functions string column name array list string list new array list string the final function list iterator it m groupfunction key set iterator while it has next string group function string it next total load seq if group function starts with column name group function group function substring group function last index of delimiter 1 load seq for int i 0 i m functions size i string col function string m functions get i load seq a if col function starts with group function string function col function substring col function last index of delimiter 1 if list contains function list add function return value char ret value new char list size for int i 0 i ret value length i ret value i string list get i char at 0 log finest print data group get functions for column name ret value length new string ret value return ret value columnname getfunctions columnname arraylist arraylist m_groupfunction keyset hasnext group_function loadseq group_function startswith columnname group_function group_function group_function lastindexof loadseq m_functions col_function m_functions loadseq col_function startswith group_function col_function col_function lastindexof retvalue retvalue retvalue charat printdatagroup getfunctions columnname retvalue retvalue retvalue column has a function param column name column name param function function return true if column has function public boolean is function column string column name char function if column name null m functions size 0 return false string key column name delimiter function for int i 0 i m functions size i string f string m functions get i if f equals key return true return false columnname isfunctioncolumn columnname columnname m_functions columnname m_functions m_functions add value to groups param function column name column name param function value value public void add value string function column name big decimal function value if is function column function column name return group breaks for int i 0 i m groups size i string group column name string m groups get i string key group column name delimiter function column name print data function pdf print data function m groupfunction get key if pdf null pdf new print data function pdf add value function value m groupfunction put key pdf functioncolumnname functionvalue addvalue functioncolumnname bigdecimal functionvalue isfunctioncolumn functioncolumnname m_groups groupcolumnname m_groups groupcolumnname functioncolumnname printdatafunction printdatafunction m_groupfunction printdatafunction addvalue functionvalue m_groupfunction get value param group column name group column name or total param function column name function column name param function function return value public big decimal get value string group column name string function column name char function string key group column name delimiter function column name print data function pdf print data function m groupfunction get key if pdf null return null return pdf get value function groupcolumnname functioncolumnname bigdecimal getvalue groupcolumnname functioncolumnname groupcolumnname functioncolumnname printdatafunction printdatafunction m_groupfunction getvalue reset function values param group column name group column name or total param function column name function column name public void reset string group column name string function column name string key group column name delimiter function column name print data function pdf print data function m groupfunction get key if pdf null pdf reset groupcolumnname functioncolumnname groupcolumnname functioncolumnname groupcolumnname functioncolumnname printdatafunction printdatafunction m_groupfunction string representation return info public string to string return to string false tostring tostring string representation param with data with data return info public string to string boolean with data string buffer sb new string buffer print data group sb append groups for int i 0 i m groups size i if i 0 sb append sb append m groups get i if with data iterator it m groupmap key set iterator while it has next object key it next object value m groupmap get key sb append append key append append value sb append functions for int i 0 i m functions size i if i 0 sb append sb append m functions get i if with data iterator it m groupfunction key set iterator while it has next object key it next object value m groupfunction get key sb append append key append append value sb append return sb to string withdata tostring withdata stringbuffer stringbuffer printdatagroup m_groups m_groups withdata m_groupmap keyset hasnext m_groupmap m_functions m_functions withdata m_groupfunction keyset hasnext m_groupfunction tostring get archives param ctx context param where clause optional where clause starting with and return archives public static m archive get properties ctx string where clause array list m archive list new array list m archive prepared statement pstmt null string sql select from ad archive where ad client id if where clause null where clause length 0 sql where clause sql order by created try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next list add new m archive ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if list size 0 s log fine sql else s log finer sql m archive ret value new m archive list size list to array ret value return ret value whereclause marchive whereclause arraylist marchive arraylist marchive preparedstatement ad_archive ad_client_id whereclause whereclause whereclause preparestatement setint getad_client_id resultset executequery marchive s_log s_log s_log marchive retvalue marchive toarray retvalue retvalue standard constructor param ctx context param ad archive id id public m archive properties ctx int ad archive id string trx name super ctx ad archive id trx name ad_archive_id marchive ad_archive_id trxname ad_archive_id trxname load constructor param ctx context param rs result set public m archive properties ctx result set rs string trx name super ctx rs trx name marchive resultset trxname trxname constructor param ctx context param info print info public m archive properties ctx print info info string trx name this ctx 0 trx name set name info get name set is report info is report setad process id info getad process id setad table id info getad table id setrecord id info getrecord id setc bpartner id info getc bpartner id marchive printinfo trxname trxname setname getname setisreport isreport setad_process_id getad_process_id setad_table_id getad_table_id setrecord_id getrecord_id setc_bpartner_id getc_bpartner_id string representation return info public string to string string buffer sb new string buffer m archive sb append get id append name append get name if m inflated null sb append inflated m inflated if m deflated null sb append deflated m deflated sb append return sb to string tostring stringbuffer stringbuffer marchive get_id getname m_inflated m_inflated m_deflated m_deflated tostring get binary data inflate return inflated data public byte get binary data byte deflated data super get binary data m deflated null m inflated null if deflated data null return null log fine zip size deflated data length m deflated new integer deflated data length if deflated data length 0 return null byte inflated data null try byte array input stream in new byte array input stream deflated data zip input stream zip new zip input stream in zip entry entry zip get next entry if entry null just one entry byte array output stream out new byte array output stream byte buffer new byte 2048 int length zip read buffer while length 1 out write buffer 0 length length zip read buffer inflated data out to byte array log fine size inflated data length zip entry get compressed size entry get size entry get compressed size 100 entry get size m inflated new integer inflated data length catch exception e log log level severe e inflated data null return inflated data getbinarydata deflateddata getbinarydata m_deflated m_inflated deflateddata zipsize deflateddata m_deflated deflateddata deflateddata inflateddata bytearrayinputstream bytearrayinputstream deflateddata zipinputstream zipinputstream zipentry getnextentry bytearrayoutputstream bytearrayoutputstream inflateddata tobytearray inflateddata getcompressedsize getsize getcompressedsize getsize m_inflated inflateddata inflateddata inflateddata get data as input stream return input stream or null public input stream get input stream byte inflated data get binary data if inflated data null return null return new byte array input stream inflated data inputstream getinputstream inflateddata getbinarydata inflateddata bytearrayinputstream inflateddata save binary data deflate param inflated data inflated data public void set binary data byte inflated data if inflated data null inflated data length 0 throw new illegal argument exception inflated data is null m inflated new integer inflated data length byte array output stream out new byte array output stream zip output stream zip new zip output stream out zip set method zip output stream deflated zip set level deflater best compression zip set comment adempiere byte deflated data null try zip entry entry new zip entry a dempiere archive entry set time system current time millis entry set method zip entry deflated zip put next entry entry zip write inflated data 0 inflated data length zip close entry log fine entry get compressed size entry get size entry get compressed size 100 entry get size zip finish zip close deflated data out to byte array log fine length inflated data length m deflated new integer deflated data length catch exception e log log level severe savelob data e deflated data null m deflated null super set binary data deflated data inflateddata setbinarydata inflateddata inflateddata inflateddata illegalargumentexception inflateddata m_inflated inflateddata bytearrayoutputstream bytearrayoutputstream zipoutputstream zipoutputstream setmethod zipoutputstream setlevel best_compression setcomment deflateddata zipentry zipentry adempierearchive settime currenttimemillis setmethod zipentry putnextentry inflateddata inflateddata closeentry getcompressedsize getsize getcompressedsize getsize deflateddata tobytearray inflateddata m_deflated deflateddata savelobdata deflateddata m_deflated setbinarydata deflateddata get created by user name return name public string get created by name string name string sql select name from ad user where ad user id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 get created by result set rs pstmt execute query if rs next name rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return name getcreatedbyname ad_user ad_user_id preparedstatement preparestatement setint getcreatedby resultset executequery getstring before save param new record new returntrue if can be saved protected boolean before save boolean new record binary data is mandatory byte data super get binary data if data null data length 0 return false log fine to string return true newrecord beforesave newrecord getbinarydata tostring get pos from cache param ctx context param c pos id id return mpos public static mpos get properties ctx int c pos id integer key new integer c pos id mpos ret value mpos s cache get key if ret value null return ret value ret value new mpos ctx c pos id null if ret value get id 0 s cache put key ret value return ret value c_pos_id c_pos_id c_pos_id retvalue s_cache retvalue retvalue retvalue c_pos_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c pos id id public mpos properties ctx int c pos id string trx name super ctx c pos id trx name if c pos id 0 set name null setsalesrep id 0 setc cashbook id 0 setm pricelist id 0 set is modify price false n setm warehouse id 0 c_pos_id c_pos_id trxname c_pos_id trxname c_pos_id setname setsalesrep_id setc_cashbook_id setm_pricelist_id setismodifyprice setm_warehouse_id load constructor param ctx context param rs result set public mpos properties ctx result set rs string trx name super ctx rs trx name resultset trxname trxname before save param new record new return true protected boolean before save boolean new record org consistency if new record is valuechanged c cashbook id is valuechanged m warehouse id m cash book cb m cash book get get ctx getc cashbook id if cb getad org id getad org id log save error error msg parse translation get ctx ad org id c cashbook id return false m warehouse wh m warehouse get get ctx getm warehouse id if wh getad org id getad org id log save error error msg parse translation get ctx ad org id m warehouse id return false return true newrecord beforesave newrecord newrecord is_valuechanged c_cashbook_id is_valuechanged m_warehouse_id mcashbook mcashbook getctx getc_cashbook_id getad_org_id getad_org_id saveerror parsetranslation getctx ad_org_id c_cashbook_id mwarehouse mwarehouse getctx getm_warehouse_id getad_org_id getad_org_id saveerror parsetranslation getctx ad_org_id m_warehouse_id get default cash b partner return b partner public mb partner getb partner if m template null if getc bpartnercashtrx id 0 m template mb partner getb partner cash trx get ctx getad client id else m template new mb partner get ctx getc bpartnercashtrx id get trxname log fine getb partner m template return m template bpartner bpartner mbpartner getbpartner m_template getc_bpartnercashtrx_id m_template mbpartner getbpartnercashtrx getctx getad_client_id m_template mbpartner getctx getc_bpartnercashtrx_id get_trxname getbpartner m_template m_template oracle database public db oracle causes vpn problems try get driver catch exception e log log level severe e get message db_oracle getdriver getmessage get database name return database short name public string get name return database db oracle getname db_oracle get database description return database long name and version public string get description try if s driver null get driver catch exception e if s driver null return s driver to string return no driver getdescription s_driver getdriver s_driver s_driver tostring get standard jdbc port return standard port public int get standard port return default port getstandardport default_port get and register database driver return driver public driver get driver throws sql exception if s driver null speed up transfer rate system set property oracle jdbc tcp no delay true oracle multi language system set property oracle jdbc defaultn char true s driver new oracle driver driver manager register driver s driver driver manager set login timeout database connection timeout return s driver getdriver sqlexception s_driver setproperty tcpnodelay setproperty defaultnchar s_driver oracledriver drivermanager registerdriver s_driver drivermanager setlogintimeout connection_timeout s_driver get database connection string pre timing cm with source route not in address list 28 5 sec cm with source route in address list 58 0 sec direct 4 3 8 sec no real difference if on other box bequeath 3 4 8 sec pre param connection connection descriptor return connection string public string get connectionurl c connection connection string buffer sb null server connections bequeath if connection is bequeath sb new string buffer jdbc oracle oci8 bug does not work if there is more than one db instance use net8 sb append connection get db name else thin driver sb new string buffer jdbc oracle thin direct connection if connection is via firewall description address list source route yes address protocol tcp host cmhost port 1630 address protocol tcp host dev port 1521 connect data service name dev1 compiere org sb append description address list append source route yes append address protocol tcp host append connection get fw host append port append connection get fw port append append address protocol tcp host append connection get db host append port append connection get db port append append connect data service name append connection get db name append else old dev2 1521 sid new dev2 1521 service name sb append append connection get db host append append connection get db port append append connection get db name m connectionurl sb to string log config m connectionurl m username connection get db uid return m connectionurl source_route address_list source_route address_list getconnectionurl cconnection stringbuffer isbequeath stringbuffer getdbname stringbuffer isviafirewall address_list source_route connect_data service_name address_list source_route getfwhost getfwport getdbhost getdbport connect_data service_name getdbname servicename getdbhost getdbport getdbname m_connectionurl tostring m_connectionurl m_username getdbuid m_connectionurl get connection url http download east oracle com docs cd b14117 01 java 101 b10979 urls htm beidbfdf param db host db host param db port db port param db name db name param user name user name return connection public string get connectionurl string db host int db port string db name string user name m username user name return jdbc oracle thin db host db port db name b14117_01 dbhost dbport dbname username getconnectionurl dbhost dbport dbname username m_username username dbhost dbport dbname get jdbc catalog return null not used public string get catalog return null getcatalog get jdbc schema return user name public string get schema if m username null return m username to upper case log severe user name not set yet call get connectionurl first return null getschema m_username m_username touppercase getconnectionurl supports blob return true if blob is supported public boolean supportsblob return true string representation return info public string to string string buffer sb new string buffer db oracle sb append m connectionurl try if m ds null sb append append m ds get data source name append expl cache append m ds get explicit caching enabled append impl cache append m ds get implicit caching enabled append max stmts append m ds get max statements append ref append m ds get reference if m cachemgr null m cachemgr exists cache cache name sb append connection active append m cachemgr get number of active connections cache name append cache available append m cachemgr get number of available connections cache name catch exception e sb append append e get localized message sb append return sb to string tostring stringbuffer stringbuffer db_oracle m_connectionurl m_ds m_ds getdatasourcename explcache m_ds getexplicitcachingenabled implcache m_ds getimplicitcachingenabled maxstmts m_ds getmaxstatements m_ds getreference m_cachemgr m_cachemgr existscache cache_name connectionactive m_cachemgr getnumberofactiveconnections cache_name cacheavailable m_cachemgr getnumberofavailableconnections cache_name getlocalizedmessage tostring get status return status info public string get status string buffer sb new string buffer try if m cachemgr null m cachemgr exists cache cache name sb append connections append m cachemgr get number of active connections cache name append cache append m cachemgr get number of available connections cache name catch exception e return sb to string getstatus stringbuffer stringbuffer m_cachemgr m_cachemgr existscache cache_name m_cachemgr getnumberofactiveconnections cache_name m_cachemgr getnumberofavailableconnections cache_name tostring convert an individual oracle style statements to target database statement syntax param ora statement oracle statement return converted statement oracle statement public string convert statement string ora statement return ora statement orastatement convertstatement orastatement orastatement get name of system user return system public string get system user return system getsystemuser get name of system database param database name database name return e g master or database name public string get system database string database name return database name databasename getsystemdatabase databasename databasename create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return to date 2001 01 30 18 10 20 yyyy mm dd hh24 mi ss or to date 2001 01 30 yyyy mm dd public string to date timestamp time boolean day only if time null if day only return trunc sys date return sys date string buffer date string new string buffer to date yyyy mm dd hh24 mi ss mmmm jdbc timestamp format string my date time to string if day only date string append my date substring 0 10 date string append yyyy mm dd else date string append my date substring 0 my date index of cut off miliseconds date string append yyyy mm dd hh24 mi ss return date string to string dayonly to_date to_date to_date dayonly dayonly sysdate sysdate stringbuffer datestring stringbuffer to_date mydate tostring dayonly datestring mydate datestring datestring mydate mydate indexof datestring datestring tostring create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env public string to char string column name int display type string ad language string buffer ret value new string buffer trim to char ret value append column name numbers if display type is numeric display type if display type display type amount ret value append 9g999g990d00 else ret value append tm9 to char grand total 9g999g990d00 nls numeric characters if language is decimal point ad language reversed ret value append nls numeric characters else if display type is date display type ret value append append language get language ad language getd bdate pattern append ret value append return ret value to string columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype to_char columnname displaytype ad_language stringbuffer retvalue stringbuffer to_char retvalue columnname displaytype isnumeric displaytype displaytype displaytype retvalue retvalue to_char grandtotal nls_numeric_characters isdecimalpoint ad_language retvalue nls_numeric_characters displaytype isdate displaytype retvalue getlanguage ad_language getdbdatepattern retvalue retvalue tostring return number as string for insert statements with correct precision param number number param display type display type return number as string public string to number big decimal number int display type if number null return null return number to string displaytype to_number bigdecimal displaytype tostring get sql commands the following variables are resolved system password compiere user compiere password system password database name database device param cmd type cmd return array of commands to be executed public string get commands int cmd type if cmd create user cmd type return new string if cmd create database cmd type return new string if cmd drop database cmd type return new string return null systempassword compiereuser compierepassword systempassword databasename databasedevice cmdtype cmd_ getcommands cmdtype cmd_create_user cmdtype cmd_create_database cmdtype cmd_drop_database cmdtype create data source param connection connection return data dource public data source get data source c connection connection if m ds null return m ds try m ds new oracle data source m ds set driver type thin m ds set network protocol tcp m ds set server name connection get db host m ds set service name connection get db name m ds set port number connection get db port m ds set user connection get db uid m ds set password connection get db pwd m ds set data source name compiereds m ds set description compiere oracle data source m ds set implicit caching enabled true m ds set explicit caching enabled true m ds set max statements max statements properties cache properties new properties cache properties set property initial limit 3 at startup cache properties set property max statements limit 10 cache properties set property closest connection match true cache properties set property validate connection true if ini is client cache properties set property min limit 0 cache properties set property max limit 5 cache properties set property inactivity timeout 300 5 min cache properties set property abandoned connection timeout 300 5 min else server settings cache properties set property min limit 3 cache properties set property max limit 5 cache properties set property inactivity timeout 600 10 min cache properties set property abandoned connection timeout 600 10 min cache properties set property property check interval 120 2 min if use cache m ds set connection caching enabled true m ds set connection cache name cache name m ds set fast connection failover enabled true if m cachemgr null use cache m cachemgr oracle connection cache manager get connection cache manager instance if m cachemgr exists cache cache name m cachemgr create cache cache name m ds cache properties test oracle connection con m ds get connection con close log config to string return m ds catch exception e log log level severe to string e return null datasource datasource getdatasource cconnection m_ds m_ds m_ds oracledatasource m_ds setdrivertype m_ds setnetworkprotocol m_ds setservername getdbhost m_ds setservicename getdbname m_ds setportnumber getdbport m_ds setuser getdbuid m_ds setpassword getdbpwd m_ds setdatasourcename m_ds setdescription m_ds setimplicitcachingenabled m_ds setexplicitcachingenabled m_ds setmaxstatements max_statements cacheproperties cacheproperties setproperty initiallimit cacheproperties setproperty maxstatementslimit cacheproperties setproperty closestconnectionmatch cacheproperties setproperty validateconnection isclient cacheproperties setproperty minlimit cacheproperties setproperty maxlimit cacheproperties setproperty inactivitytimeout cacheproperties setproperty abandonedconnectiontimeout cacheproperties setproperty minlimit cacheproperties setproperty maxlimit cacheproperties setproperty inactivitytimeout cacheproperties setproperty abandonedconnectiontimeout cacheproperties setproperty propertycheckinterval use_cache m_ds setconnectioncachingenabled m_ds setconnectioncachename cache_name m_ds setfastconnectionfailoverenabled m_cachemgr use_cache m_cachemgr oracleconnectioncachemanager getconnectioncachemanagerinstance m_cachemgr existscache cache_name m_cachemgr createcache cache_name m_ds cacheproperties oracleconnection m_ds getconnection tostring m_ds tostring get cached connection param connection info param auto commit true if autocommit connection param transaction isolation connection transaction level return connection or null public connection get cached connection c connection connection boolean auto commit int transaction isolation throws exception oracle connection conn null exception exception null try if use cache m cachemgr null get data source connection if m ds null get data source connection properties conn attr new properties conn attr set property transaction isolation c connection get transaction isolation info transaction isolation oracle connection conn oracle connection m ds get connection conn attr try 5 times max for int i 0 i 5 i try conn oracle connection m ds get connection if conn null if conn get transaction isolation transaction isolation conn set transaction isolation transaction isolation if conn get auto commit auto commit conn set auto commit auto commit conn set default row prefetch 20 10 default reduces round trips catch exception e exception e conn null if e instanceof sql exception sql exception e get error code 1017 invalid username password log severe cannot connect to database get connectionurl connection userid connection get db uid break try if conn null conn is closed conn null ok if conn null conn is closed break if i 0 thread yield give some time else thread sleep 100 catch exception e exception e conn null 5 tries if conn null exception null log log level severe exception to string log fine to string log finest reference m ds get reference else system out println conn get status conn register connection cache callback this test oracle connection all connection callbacks catch exception e system err println db oracle get cached connection if e instanceof sql exception e print stack trace exception e if exception null throw exception return conn autocommit transactionisolation getcachedconnection cconnection autocommit transactionisolation oracleconnection use_cache m_cachemgr getdatasource m_ds getdatasource connattr connattr setproperty transaction_isolation cconnection gettransactionisolationinfo transactionisolation oracleconnection oracleconnection m_ds getconnection connattr oracleconnection m_ds getconnection gettransactionisolation transactionisolation settransactionisolation transactionisolation getautocommit autocommit setautocommit autocommit setdefaultrowprefetch sqlexception sqlexception geterrorcode getconnectionurl getdbuid isclosed isclosed tostring tostring m_ds getreference getstatus registerconnectioncachecallback oracleconnection all_connection_callbacks db_oracle getcachedconnection sqlexception printstacktrace get connection from driver param connection info return connection or null public connection get driver connection c connection connection throws sql exception get driver return driver manager get connection get connectionurl connection connection get db uid connection get db pwd getdriverconnection cconnection sqlexception getdriver drivermanager getconnection getconnectionurl getdbuid getdbpwd get driver connection param db url url param db uid user param db pwd password return connection throws sql exception public connection get driver connection string db url string db uid string db pwd throws sql exception get driver return driver manager get connection db url db uid db pwd dburl dbuid dbpwd sqlexception getdriverconnection dburl dbuid dbpwd sqlexception getdriver drivermanager getconnection dburl dbuid dbpwd close public void close log config to string if m ds null try m ds close catch sql exception e e print stack trace if m cachemgr null try if m cachemgr exists cache cache name m cachemgr purge cache cache name false not active m cache disable cache cache name m cache remove cache cache name 0 catch sql exception e e print stack trace m cachemgr null m ds null tostring m_ds m_ds sqlexception printstacktrace m_cachemgr m_cachemgr existscache cache_name m_cachemgr purgecache cache_name m_cache disablecache cache_name m_cache removecache cache_name sqlexception printstacktrace m_cachemgr m_ds clean up public void cleanup if use cache return log config try if m cachemgr null m cachemgr oracle connection cache manager get connection cache manager instance string cache names m cachemgr get cache name list for int i 0 i cache names length i string name cache names i system out println cleanup name system out println before active m cachemgr get number of active connections name available m cachemgr get number of available connections name m cachemgr purge cache name false system out println cached active m cachemgr get number of active connections name available m cachemgr get number of available connections name m cachemgr purge cache name true system out println all active m cachemgr get number of active connections name available m cachemgr get number of available connections name catch exception e e print stack trace use_cache m_cachemgr m_cachemgr oracleconnectioncachemanager getconnectioncachemanagerinstance cachenames m_cachemgr getcachenamelist cachenames cachenames m_cachemgr getnumberofactiveconnections m_cachemgr getnumberofavailableconnections m_cachemgr purgecache m_cachemgr getnumberofactiveconnections m_cachemgr getnumberofavailableconnections m_cachemgr purgecache m_cachemgr getnumberofactiveconnections m_cachemgr getnumberofavailableconnections printstacktrace handle abandoned connection param conn connection param user object return true if close false for keeping it public boolean handle abandoned connection oracle connection conn object user object system out println handle abandoned connection conn user object return true reclaim it userobject handleabandonedconnection oracleconnection userobject handleabandonedconnection userobject release connection param conn connection param user object public void release connection oracle connection conn object user object system out println release connection conn user object userobject releaseconnection oracleconnection userobject releaseconnection userobject get data type param display type display type param precision precision param default value if true adds default value return data type public string get data type int display type int precision boolean default value string ret value null switch display type i ds case display type account case display type assignment case display type color case display type id case display type location case display type locator case display type p attribute case display type search case display type table case display type table dir ret value number 10 break dynamic precision case display type amount ret value number if default value ret value default 0 break case display type binary case display type image ret value blob break case display type button ret value char 1 break number dynamic precision case display type cost price ret value number if default value ret value default 0 break date case display type date case display type date time case display type time ret value date if default value ret value default sysdate break number 10 case display type integer ret value number 10 break case display type list ret value char precision break nvarchar case display type memo case display type string case display type text ret value nvarchar precision break case display type text long ret value clob break dyn prec case display type quantity ret value number break case display type yes no ret value char 1 break default log severe unknown display type break return ret value displaytype defaultvalue getdatatype displaytype defaultvalue retvalue displaytype ids displaytype displaytype displaytype displaytype displaytype displaytype displaytype pattribute displaytype displaytype displaytype tabledir retvalue displaytype retvalue defaultvalue retvalue displaytype displaytype retvalue displaytype retvalue displaytype costprice retvalue defaultvalue retvalue displaytype displaytype datetime displaytype retvalue defaultvalue retvalue displaytype retvalue displaytype retvalue displaytype displaytype displaytype retvalue displaytype textlong retvalue displaytype retvalue displaytype yesno retvalue displaytype retvalue testing param args ignored public static void main string args compiere startup environment true c connection cc c connection get db oracle db db oracle cc get database db cleanup try connection conn null system out println driver db get driver connection cc data source ds db get data source cc system out println ds ds get connection conn db get cached connection cc true connection transaction read committed system out println cached conn system out println db system out println java classpath n system get property java class path n database meta data dmd conn get meta data system out println driver version dmd get driver version system out println driver major version dmd get driver major version system out println driver minor version dmd get driver minor version system out println driver name dmd get driver name system out println product name dmd get database product name system out println product version n dmd get database product version n catch exception e1 e1 print stack trace db cleanup system out println drop table x test create table x test text1 nvarchar2 2000 null text2 varchar2 2000 null try string my string1 123456789 12345678 string my string for int i 0 i 99 i my string my string1 char a i n system out println my string length system out println util size my string my string util trim size my string 2000 system out println my string length system out println util size my string connection conn2 db get cached connection cc true connection transaction read committed prepared statement pstmt conn2 prepare statement insert into x test text1 text2 values pstmt set string 1 my string nvarchar2 column pstmt set string 2 my string varchar2 column system out println pstmt execute update statement stmt conn2 create statement system out println stmt execute update insert into x test text1 text2 values my string my string catch exception e e print stack trace db cleanup system out println system exit 0 system out println try connection conn1 db get cached connection cc false connection transaction read committed connection conn2 db get cached connection cc true connection transaction read committed connection conn3 db get cached connection cc false connection transaction read committed system out println 3 db conn1 close conn2 close conn1 db get cached connection cc true connection transaction read committed conn2 db get cached connection cc true connection transaction read committed system out println 3 db conn1 close conn2 close conn3 close system out println 0 db catch exception e1 e1 print stack trace db cleanup system exit 0 system out println system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db try system out println sleeping thread sleep 60000 system out println db db close db cleanup system out println db catch interrupted exception e connection option 1 try system set property oracle jdbc trace true driver manager register driver new oracle driver connection con driver manager get connection jdbc oracle thin dev 1521 dev adempiere adempiere system out println catalog con get catalog database meta data md con get meta data system out println url md geturl system out println user md get user name system out println catalog result set rs md get catalogs while rs next system out println rs get string 1 system out println table rs md get tables null compiere null new string table while rs next system out println user rs get string 2 table rs get string 3 type rs get string 4 rs get string 5 system out println column rs md get columns null compiere c order null while rs next system out println tab rs get string 3 col rs get string 4 type rs get string 5 rs get string 6 size rs get string 7 rs get string 8 digits rs get string 9 radix rs get string 10 null rs get string 11 rem rs get string 12 def rs get string 13 rs get string 14 rs get string 15 rs get string 16 ord rs get string 17 null rs get string 18 con close catch sql exception ex ex print stack trace startupenvironment cconnection cconnection db_oracle db_oracle getdatabase getdriverconnection datasource getdatasource getconnection getcachedconnection transaction_read_committed getproperty databasemetadata getmetadata driverversion getdriverversion drivermajorversion getdrivermajorversion driverminorversion getdriverminorversion drivername getdrivername productname getdatabaseproductname productversion getdatabaseproductversion printstacktrace x_test x_test mystring1 mystring mystring mystring1 mystring mystring mystring trimsize mystring mystring mystring getcachedconnection transaction_read_committed preparedstatement preparestatement x_test setstring mystring setstring mystring executeupdate createstatement executeupdate x_test mystring mystring printstacktrace getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed printstacktrace getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed interruptedexception setproperty drivermanager registerdriver oracledriver drivermanager getconnection getcatalog databasemetadata getmetadata getusername resultset getcatalogs getstring gettables getstring getstring getstring getstring getcolumns c_order getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring sqlexception printstacktrace standard constructor public x c currency acct properties ctx int c currency acct id string trx name super ctx c currency acct id trx name if c currency acct id 0 setc acctschema id 0 setc currency id 0 setrealizedgain acct 0 setrealizedloss acct 0 setunrealizedgain acct 0 setunrealizedloss acct 0 x_c_currency_acct c_currency_acct_id trxname c_currency_acct_id trxname c_currency_acct_id setc_acctschema_id setc_currency_id setrealizedgain_acct setrealizedloss_acct setunrealizedgain_acct setunrealizedloss_acct load constructor public x c currency acct properties ctx result set rs string trx name super ctx rs trx name x_c_currency_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c currency acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_currency_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set realized gain acct realized gain account public void setrealizedgain acct int realizedgain acct set value realizedgain acct new integer realizedgain acct setrealizedgain_acct realizedgain_acct set_value realizedgain_acct realizedgain_acct get realized gain acct realized gain account public int getrealizedgain acct integer ii integer get value realizedgain acct if ii null return 0 return ii int value getrealizedgain_acct get_value realizedgain_acct intvalue set realized loss acct realized loss account public void setrealizedloss acct int realizedloss acct set value realizedloss acct new integer realizedloss acct setrealizedloss_acct realizedloss_acct set_value realizedloss_acct realizedloss_acct get realized loss acct realized loss account public int getrealizedloss acct integer ii integer get value realizedloss acct if ii null return 0 return ii int value getrealizedloss_acct get_value realizedloss_acct intvalue set unrealized gain acct unrealized gain account for currency revaluation public void setunrealizedgain acct int unrealizedgain acct set value unrealizedgain acct new integer unrealizedgain acct setunrealizedgain_acct unrealizedgain_acct set_value unrealizedgain_acct unrealizedgain_acct get unrealized gain acct unrealized gain account for currency revaluation public int getunrealizedgain acct integer ii integer get value unrealizedgain acct if ii null return 0 return ii int value getunrealizedgain_acct get_value unrealizedgain_acct intvalue set unrealized loss acct unrealized loss account for currency revaluation public void setunrealizedloss acct int unrealizedloss acct set value unrealizedloss acct new integer unrealizedloss acct setunrealizedloss_acct unrealizedloss_acct set_value unrealizedloss_acct unrealizedloss_acct get unrealized loss acct unrealized loss account for currency revaluation public int getunrealizedloss acct integer ii integer get value unrealizedloss acct if ii null return 0 return ii int value getunrealizedloss_acct get_value unrealizedloss_acct intvalue is table client level only param ad client id client param ad table id table return true if client level only default false public static boolean is client level only int ad client id int ad table id boolean share is shared ad client id ad table id if share null return share boolean value return false ad_client_id ad_table_id isclientlevelonly ad_client_id ad_table_id isshared ad_client_id ad_table_id booleanvalue is table org level only param ad client id client param ad table id table return true if org level only default false public static boolean is org level only int ad client id int ad table id boolean share is shared ad client id ad table id if share null return share boolean value return false ad_client_id ad_table_id isorglevelonly ad_client_id ad_table_id isshared ad_client_id ad_table_id booleanvalue is table shared for client param ad client id client param ad table id table return info or null private static boolean is shared int ad client id int ad table id load if s shares is empty string sql select ad client id ad table id share type from ad clientshare where share type x and is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next int client id rs get int 1 int table id rs get int 2 string key client id table id string share type rs get string 3 if share type equals sharetype clientallshared s shares put key boolean true else if share type equals sharetype orgnotshared s shares put key boolean false rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if s shares is empty put in something s shares put 0 0 boolean true load string key ad client id ad table id return s shares get key ad_client_id ad_table_id isshared ad_client_id ad_table_id s_shares isempty ad_client_id ad_table_id sharetype ad_clientshare sharetype isactive preparedstatement preparestatement resultset executequery client_id getint table_id getint client_id _ table_id sharetype getstring sharetype sharetype_clientallshared s_shares sharetype sharetype_orgnotshared s_shares s_log s_shares isempty s_shares 0_0 ad_client_id _ ad_table_id s_shares default constructor param ctx context param ad clientshare id id param trx name trx public m client share properties ctx int ad clientshare id string trx name super ctx ad clientshare id trx name ad_clientshare_id trxname mclientshare ad_clientshare_id trxname ad_clientshare_id trxname load constructor param ctx context param rs result set param trx name trx public m client share properties ctx result set rs string trx name super ctx rs trx name trxname mclientshare resultset trxname trxname is client level only return true if client level only shared public boolean is client level only return get share type equals sharetype clientallshared isclientlevelonly getsharetype sharetype_clientallshared is org level only return true if org level only not shared public boolean is org level only return get share type equals sharetype orgnotshared isorglevelonly getsharetype sharetype_orgnotshared get table model return table public m table get table if m table null m table m table get get ctx getad table id return m table m_table gettable m_table m_table m_table getctx getad_table_id m_table get table name return table name public string get table name return get table get table name gettablename gettable gettablename after save param new record new param success success return true protected boolean after save boolean new record boolean success if is active set data to level list child records return true newrecord aftersave newrecord isactive setdatatolevel listchildrecords set data to level return info public string set data to level string info if is client level only string buffer sql new string buffer update append get table name append set ad org id 0 where ad org id 0 and ad client id int no db execute update sql to string getad client id get trxname info get table name set to shared no log info info else if is org level only string buffer sql new string buffer select count from append get table name append where ad org id 0 where ad client id int no db getsql value get trxname sql to string getad client id info get table name shared records no log info info return info setdatatolevel isclientlevelonly stringbuffer stringbuffer gettablename ad_org_id ad_org_id ad_client_id executeupdate tostring getad_client_id get_trxname gettablename isorglevelonly stringbuffer stringbuffer gettablename ad_org_id ad_client_id getsqlvalue get_trxname tostring getad_client_id gettablename list child tables return child tables public string list child records string buffer info new string buffer string sql select ad table id table name from ad table t where access level 3 and is view n and exists select from ad column c where t ad table id c ad table id and c is parent y and c column name select column name from ad column cc where cc is key y and cc ad table id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad table id result set rs pstmt execute query while rs next int ad table id rs get int 1 string table name rs get string 2 if info length 0 info append info append table name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info info to string return info to string listchildrecords stringbuffer stringbuffer ad_table_id tablename ad_table accesslevel isview ad_column ad_table_id ad_table_id isparent columnname columnname ad_column iskey ad_table_id preparedstatement preparestatement setint getad_table_id resultset executequery ad_table_id getint tablename getstring tablename tostring tostring before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id get payment batch for pay selection param ctx context param c payselection id id return payment batch public static m payment batch get for pay selection properties ctx int c payselection id string trx name m pay selection ps new m pay selection ctx c payselection id trx name m payment batch ret value new m payment batch ps return ret value payselection c_payselection_id mpaymentbatch getforpayselection c_payselection_id trxname mpayselection mpayselection c_payselection_id trxname mpaymentbatch retvalue mpaymentbatch retvalue standard constructor param ctx context param c paymentbatch id id public m payment batch properties ctx int c paymentbatch id string trx name super ctx c paymentbatch id trx name if c paymentbatch id 0 set name null set processed false set processing false c_paymentbatch_id mpaymentbatch c_paymentbatch_id trxname c_paymentbatch_id trxname c_paymentbatch_id setname setprocessed setprocessing load constructor param ctx context param rs result set public m payment batch properties ctx result set rs string trx name super ctx rs trx name mpaymentbatch resultset trxname trxname new constructor param ctx context param name name param trx name trx public m payment batch properties ctx string name string trx name this ctx 0 trx name set name name trxname mpaymentbatch trxname trxname setname parent constructor param ps pay selection public m payment batch m pay selection ps this ps get ctx 0 ps get trxname set client org ps set name ps get name mpaymentbatch mpayselection getctx get_trxname setclientorg setname getname standard constructor param ctx context param ad alert id id public m alert properties ctx int ad alert id string trx name super ctx ad alert id trx name if ad alert id 0 setad alertprocessor id 0 set name null set alert message null set alert subject null set enforce client security true y set enforce role security true y set is valid true y ad_alert_id malert ad_alert_id trxname ad_alert_id trxname ad_alert_id setad_alertprocessor_id setname setalertmessage setalertsubject setenforceclientsecurity setenforcerolesecurity setisvalid load constructor param ctx context param rs result set public m alert properties ctx result set rs string trx name super ctx rs trx name malert resultset trxname trxname get rules param reload reload data return array of rules public m alert rule get rules boolean reload if m rules null reload return m rules string sql select from ad alertrule where ad alert id array list m alert rule list new array list m alert rule prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad alert id result set rs pstmt execute query while rs next list add new m alert rule get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rules new m alert rule list size list to array m rules return m rules malertrule getrules m_rules m_rules ad_alertrule ad_alert_id arraylist malertrule arraylist malertrule preparedstatement preparestatement setint getad_alert_id resultset executequery malertrule getctx m_rules malertrule toarray m_rules m_rules get recipients param reload reload data return array of recipients public m alert recipient get recipients boolean reload if m recipients null reload return m recipients string sql select from ad alertrecipient where ad alert id array list m alert recipient list new array list m alert recipient prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad alert id result set rs pstmt execute query while rs next list add new m alert recipient get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m recipients new m alert recipient list size list to array m recipients return m recipients malertrecipient getrecipients m_recipients m_recipients ad_alertrecipient ad_alert_id arraylist malertrecipient arraylist malertrecipient preparedstatement preparestatement setint getad_alert_id resultset executequery malertrecipient getctx m_recipients malertrecipient toarray m_recipients m_recipients get first role if exist return ad role id or 1 public int getfirstad role id get recipients false for int i 0 i m recipients length i if m recipients i getad role id 1 return m recipients i getad role id return 1 ad_role_id getfirstad_role_id getrecipients m_recipients m_recipients getad_role_id m_recipients getad_role_id get first user role if exist return ad role id or 1 public int getfirstuserad role id get recipients false int ad user id getfirstad user id if ad user id 1 m user roles urs m user roles get of user get ctx ad user id for int i 0 i urs length i if urs i is active return urs i getad role id return 1 ad_role_id getfirstuserad_role_id getrecipients ad_user_id getfirstad_user_id ad_user_id muserroles muserroles getofuser getctx ad_user_id isactive getad_role_id get first user if exist return ad user id or 1 public int getfirstad user id get recipients false for int i 0 i m recipients length i if m recipients i getad user id 1 return m recipients i getad user id return 1 ad_user_id getfirstad_user_id getrecipients m_recipients m_recipients getad_user_id m_recipients getad_user_id string representation return info public string to string string buffer sb new string buffer m alert sb append get id append append get name append valid append is valid if m rules null sb append rules append m rules length if m recipients null sb append recipients append m recipients length sb append return sb to string tostring stringbuffer stringbuffer malert get_id getname isvalid m_rules m_rules m_recipients m_recipients tostring standard constructor public x ad archive properties ctx int ad archive id string trx name super ctx ad archive id trx name if ad archive id 0 setad archive id 0 set binary data null set is report false set name null x_ad_archive ad_archive_id trxname ad_archive_id trxname ad_archive_id setad_archive_id setbinarydata setisreport setname load constructor public x ad archive properties ctx result set rs string trx name super ctx rs trx name x_ad_archive resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad archive append get id append return sb to string tostring stringbuffer stringbuffer x_ad_archive get_id tostring set archive document and report archive public void setad archive id int ad archive id if ad archive id 1 throw new illegal argument exception ad archive id is mandatory set valuenocheck ad archive id new integer ad archive id setad_archive_id ad_archive_id ad_archive_id illegalargumentexception ad_archive_id set_valuenocheck ad_archive_id ad_archive_id get archive document and report archive public int getad archive id integer ii integer get value ad archive id if ii null return 0 return ii int value getad_archive_id get_value ad_archive_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set binary data binary data public void set binary data byte binary data if binary data null throw new illegal argument exception binary data is mandatory set value binary data binary data binarydata setbinarydata binarydata binarydata illegalargumentexception binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set report indicates a report record public void set is report boolean is report set value is report new boolean is report setisreport isreport set_value isreport isreport get report indicates a report record public boolean is report object oo get value is report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreport get_value isreport booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set record id direct internal record id public void setrecord id int record id if record id 0 set value record id null else set value record id new integer record id setrecord_id record_id record_id set_value record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue standard constructor param ctx context param c element id id public m element properties ctx int c element id string trx name super ctx c element id trx name if c element id 0 set name null setad tree id 0 set element type null a set is balancing false set is natural account false c_element_id melement c_element_id trxname c_element_id trxname c_element_id setname setad_tree_id setelementtype setisbalancing setisnaturalaccount load constructor param ctx context param rs result set public m element properties ctx result set rs string trx name super ctx rs trx name melement resultset trxname trxname full constructor param client client param name name param element type type param ad tree id tree public m element m client client string name string element type int ad tree id this client get ctx 0 client get trxname set client org client set name name set element type element type a setad tree id ad tree id set is natural account elementtype account equals element type elementtype ad_tree_id melement mclient elementtype ad_tree_id getctx get_trxname setclientorg setname setelementtype elementtype setad_tree_id ad_tree_id setisnaturalaccount elementtype_account elementtype before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 if elementtype userdefined equals get element type is natural account set is natural account false return true newrecord beforesave newrecord getad_org_id setad_org_id elementtype_userdefined getelementtype isnaturalaccount setisnaturalaccount standard constructor public x c taxcategory properties ctx int c taxcategory id string trx name super ctx c taxcategory id trx name if c taxcategory id 0 setc taxcategory id 0 set is default false set name null x_c_taxcategory c_taxcategory_id trxname c_taxcategory_id trxname c_taxcategory_id setc_taxcategory_id setisdefault setname load constructor public x c taxcategory properties ctx result set rs string trx name super ctx rs trx name x_c_taxcategory resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c taxcategory append get id append return sb to string tostring stringbuffer stringbuffer x_c_taxcategory get_id tostring set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set valuenocheck c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_valuenocheck c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set commodity code commodity code used for tax calculation public void set commodity code string commodity code if commodity code null commodity code length 20 log warning length 20 truncated commodity code commodity code substring 0 19 set value commodity code commodity code setcommoditycode commoditycode commoditycode commoditycode commoditycode commoditycode set_value commoditycode commoditycode get commodity code commodity code used for tax calculation public string get commodity code return string get value commodity code getcommoditycode get_value commoditycode set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname product modified set attribute set instance param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null return windowno mtab mfield windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id public table allows one to set the border size param border sets the border attribute public table int border set border border setborder allows one to set the border size param border sets the border attribute param cell spacing sets the cell spacing attribute param cell padding sets the cells padding attribute param width optionally sets the width attribute param class name optionally sets the class attribute public table string border string cell spacing string cell padding string width string class name set border border set cell spacing cell spacing set cell padding cell padding if width null set width width if class name null set class class name cellspacing cellspacing cellpadding cellspadding classname cellspacing cellpadding classname setborder setcellspacing cellspacing setcellpadding cellpadding setwidth classname setclass classname allows one to set the border size param border sets the border attribute public table string border set border border setborder set the summary attribue param summary sets the summary attribute public table set summary string summary add attribute summary summary return this setsummary addattribute sets the align attribute param align sets the align attribute you can use the align type variables for convience public table set align string align add attribute align align return this aligntype setalign addattribute sets the width attribute param width sets the width attribute public table set width string width add attribute width width return this setwidth addattribute sets the height attribute param width sets the height attribute public table set height string height add attribute height height return this setheight addattribute sets the width attribute param width sets the width attribute public table set width int width add attribute width integer to string width return this setwidth addattribute tostring sets the height attribute param width sets the height attribute public table set height int height add attribute height integer to string height return this setheight addattribute tostring sets the cols attribute param width sets the cols attribute public table set cols int cols add attribute cols integer to string cols return this setcols addattribute tostring sets the cols attribute param width sets the cols attribute public table set cols string cols add attribute cols cols return this setcols addattribute sets the cellpading attribute param cellpadding sets the cellpading attribute public table set cell padding int cellpadding add attribute cellpadding integer to string cellpadding return this setcellpadding addattribute tostring sets the cellspacing attribute param spacing sets the cellspacing attribute public table set cell spacing int cellspacing add attribute cellspacing integer to string cellspacing return this setcellspacing addattribute tostring sets the cellpading attribute param cellpadding sets the cellpading attribute public table set cell padding string cellpadding add attribute cellpadding cellpadding return this setcellpadding addattribute sets the cellspacing attribute param spacing sets the cellspacing attribute public table set cell spacing string cellspacing add attribute cellspacing cellspacing return this setcellspacing addattribute sets the border attribute param border sets the border attribute public table set border int border add attribute border integer to string border return this setborder addattribute tostring sets the border attribute param border sets the border attribute public table set border string border add attribute border border return this setborder addattribute sets the frame attribute param frame sets the frame attribute public table set frame string frame add attribute frame frame return this setframe addattribute sets the rules attribute param rules sets the rules attribute public table set rules string rules add attribute rules rules return this setrules addattribute sets the bordercolor attribute param color the bgcolor attribute public table set border color string color add attribute bordercolor html color convert color color return this setbordercolor addattribute htmlcolor convertcolor sets the bgcolor attribute param color the bgcolor attribute public table set bg color string color add attribute bgcolor html color convert color color return this setbgcolor addattribute htmlcolor convertcolor sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public table add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public table add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public table add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public table add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public table remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute create new journal batch by copying param ctx context param gl journalbatch id journal batch param date doc date of the document date return journal batch public static m journal batch copy from properties ctx int gl journalbatch id timestamp date doc string trx name m journal batch from new m journal batch ctx gl journalbatch id trx name if from getgl journalbatch id 0 throw new illegal argument exception from journal batch not found gl journalbatch id gl journalbatch id m journal batch to new m journal batch ctx 0 trx name po copy values from to from getad client id from getad org id to set valuenocheck document no null to set date acct date doc to set date doc date doc to set doc status docstatus drafted to set doc action docaction complete to set is approved false if to save throw new illegal state exception could not create journal batch if to copy details from from 0 throw new illegal state exception could not create journal batch details return to gl_journalbatch_id datedoc mjournalbatch copyfrom gl_journalbatch_id datedoc trxname mjournalbatch mjournalbatch gl_journalbatch_id trxname getgl_journalbatch_id illegalargumentexception gl_journalbatch_id gl_journalbatch_id mjournalbatch mjournalbatch trxname copyvalues getad_client_id getad_org_id set_valuenocheck documentno setdateacct datedoc setdatedoc datedoc setdocstatus docstatus_drafted setdocaction docaction_complete setisapproved illegalstateexception copydetailsfrom illegalstateexception standard construvtore param ctx context param gl journalbatch id id if 0 create actual batch public m journal batch properties ctx int gl journalbatch id string trx name super ctx gl journalbatch id trx name if gl journalbatch id 0 setgl journalbatch id 0 pk set description null set document no null setc doctype id 0 set posting type postingtype actual set doc action docaction complete set doc status docstatus drafted set total cr env zero set total dr env zero set processed false set processing false set is approved false gl_journalbatch_id mjournalbatch gl_journalbatch_id trxname gl_journalbatch_id trxname gl_journalbatch_id setgl_journalbatch_id setdescription setdocumentno setc_doctype_id setpostingtype postingtype_actual setdocaction docaction_complete setdocstatus docstatus_drafted settotalcr settotaldr setprocessed setprocessing setisapproved load constructor param ctx context param rs result set public m journal batch properties ctx result set rs string trx name super ctx rs trx name mjournalbatch resultset trxname trxname copy constructor dos not copy dates period param original original public m journal batch m journal batch original this original get ctx 0 original get trxname set client org original setgl journalbatch id original getgl journalbatch id setc acctschema id original getc acctschema id setgl budget id original getgl budget id setgl category id original getgl category id set posting type original get posting type set description original get description setc doctype id original getc doctype id set control amt original get control amt setc currency id original getc currency id setc conversiontype id original getc conversiontype id set currency rate original get currency rate set date doc original get date doc set date acct original get date acct setc period id original getc period id mjournalbatch mjournalbatch getctx get_trxname setclientorg setgl_journalbatch_id getgl_journalbatch_id setc_acctschema_id getc_acctschema_id setgl_budget_id getgl_budget_id setgl_category_id getgl_category_id setpostingtype getpostingtype setdescription getdescription setc_doctype_id getc_doctype_id setcontrolamt getcontrolamt setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setcurrencyrate getcurrencyrate setdatedoc getdatedoc setdateacct getdateacct setc_period_id getc_period_id overwrite client org if required param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id set accounting date set also period if not set earlier param date acct date public void set date acct timestamp date acct super set date acct date acct if date acct null return if getc period id 0 return int c period id m period getc period id get ctx date acct if c period id 0 log warning period not found else setc period id c period id dateacct setdateacct dateacct setdateacct dateacct dateacct getc_period_id c_period_id mperiod getc_period_id getctx dateacct c_period_id setc_period_id c_period_id get journal lines param requery requery return array of lines public m journal get journals boolean requery array list m journal list new array list m journal string sql select from gl journal where gl journalbatch id order by document no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getgl journalbatch id result set rs pstmt execute query while rs next list add new m journal get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m journal ret value new m journal list size list to array ret value return ret value mjournal getjournals arraylist mjournal arraylist mjournal gl_journal gl_journalbatch_id documentno preparedstatement preparestatement get_trxname setint getgl_journalbatch_id resultset executequery mjournal getctx get_trxname sqlexception sqlexception mjournal retvalue mjournal toarray retvalue retvalue copy journal lines from other journal batch param jb journal batch return number of journals lines copied public int copy details from m journal batch jb if is processed jb null return 0 int count 0 int line count 0 m journal from journals jb get journals false for int i 0 i from journals length i m journal to journal new m journal get ctx 0 jb get trxname po copy values from journals i to journal getad client id getad org id to journal setgl journalbatch id getgl journalbatch id to journal set valuenocheck document no null create new to journal setc period id 0 to journal set date doc get date doc dates from this batch to journal set date acct get date acct to journal set doc status m journal docstatus drafted to journal set doc action m journal docaction complete to journal set total cr env zero to journal set total dr env zero to journal set is approved false to journal set is printed false to journal set posted false to journal set processed false if to journal save count line count to journal copy lines from from journals i get date acct x if from journals length count log log level severe copy details from line difference journals from journals length saved count return count line count copydetailsfrom mjournalbatch isprocessed linecount mjournal fromjournals getjournals fromjournals mjournal tojournal mjournal getctx get_trxname copyvalues fromjournals tojournal getad_client_id getad_org_id tojournal setgl_journalbatch_id getgl_journalbatch_id tojournal set_valuenocheck documentno tojournal setc_period_id tojournal setdatedoc getdatedoc tojournal setdateacct getdateacct tojournal setdocstatus mjournal docstatus_drafted tojournal setdocaction mjournal docaction_complete tojournal settotalcr tojournal settotaldr tojournal setisapproved tojournal setisprinted tojournal setposted tojournal setprocessed tojournal linecount tojournal copylinesfrom fromjournals getdateacct fromjournals copydetailsfrom fromjournals linecount process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string return true invalidateit invalidateit tostring prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctype id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid add up amounts prepare them m journal journals get journals false if journals length 0 m processmsg no lines return doc action status invalid big decimal total dr env zero big decimal total cr env zero for int i 0 i journals length i m journal journal journals i if journal is active continue prepare if not closed if docstatus closed equals journal get doc status docstatus voided equals journal get doc status docstatus reversed equals journal get doc status docstatus completed equals journal get doc status else string status journal prepare it if doc action status inprogress equals status journal set doc status status journal save m processmsg journal get process msg return status journal set doc status docstatus inprogress journal save total dr total dr add journal get total dr total cr total cr add journal get total cr set total dr total dr set total cr total cr control amount if env zero compare to get control amt 0 get control amt compare to get total dr 0 m processmsg control amt error return doc action status invalid bug 1353695 currency rate and c onbversion type should get copied from journal to lines for int i 0 i journals length i m journal journal journals i m journal line lines journal get lines true if journal get currency rate null journal get currency rate compare to env zero 0 for int j 0 j lines length j m journal line line lines j line set currency rate journal get currency rate line save if journal getc conversiontype id 0 for int j 0 j lines length j m journal line line lines j line setc conversiontype id journal getc conversiontype id line save add up amounts m justprepared true return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid mjournal getjournals m_processmsg nolines docaction status_invalid bigdecimal totaldr bigdecimal totalcr mjournal isactive docstatus_closed getdocstatus docstatus_voided getdocstatus docstatus_reversed getdocstatus docstatus_completed getdocstatus prepareit docaction status_inprogress setdocstatus m_processmsg getprocessmsg setdocstatus docstatus_inprogress totaldr totaldr gettotaldr totalcr totalcr gettotalcr settotaldr totaldr settotalcr totalcr compareto getcontrolamt getcontrolamt compareto gettotaldr m_processmsg controlamterror docaction status_invalid conbversion mjournal mjournalline getlines getcurrencyrate getcurrencyrate compareto mjournalline setcurrencyrate getcurrencyrate getc_conversiontype_id mjournalline setc_conversiontype_id getc_conversiontype_id m_justprepared docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it log info complete it to string re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval approve it add up amounts complete them m journal journals get journals true big decimal total dr env zero big decimal total cr env zero for int i 0 i journals length i m journal journal journals i if journal is active journal set processed true journal set doc status docstatus voided journal set doc action docaction none journal save continue complete if not closed if docstatus closed equals journal get doc status docstatus voided equals journal get doc status docstatus reversed equals journal get doc status docstatus completed equals journal get doc status else string status journal complete it if doc action status completed equals status journal set doc status status journal save m processmsg journal get process msg return status journal set doc status docstatus completed journal save total dr total dr add journal get total dr total cr total cr add journal get total cr set total dr total dr set total cr total cr user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit completeit tostring m_justprepared prepareit docaction status_inprogress approveit mjournal getjournals bigdecimal totaldr bigdecimal totalcr mjournal isactive setprocessed setdocstatus docstatus_voided setdocaction docaction_none docstatus_closed getdocstatus docstatus_voided getdocstatus docstatus_reversed getdocstatus docstatus_completed getdocstatus completeit docaction status_completed setdocstatus m_processmsg getprocessmsg setdocstatus docstatus_completed totaldr totaldr gettotaldr totalcr totalcr gettotalcr settotaldr totaldr settotalcr totalcr modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document return false public boolean void it log info void it to string return false voidit voidit tostring close document return true if success public boolean close it log info close it to string m journal journals get journals true for int i 0 i journals length i m journal journal journals i if journal is active journal is processed journal set processed true journal set doc status docstatus voided journal set doc action docaction none journal save continue if docstatus drafted equals journal get doc status docstatus inprogress equals journal get doc status docstatus invalid equals journal get doc status m processmsg journal not completed journal get summary return false close if not closed if docstatus closed equals journal get doc status docstatus voided equals journal get doc status docstatus reversed equals journal get doc status else if journal close it m processmsg cannot close journal get summary return false journal save return true closeit closeit tostring mjournal getjournals mjournal isactive isprocessed setprocessed setdocstatus docstatus_voided setdocaction docaction_none docstatus_drafted getdocstatus docstatus_inprogress getdocstatus docstatus_invalid getdocstatus m_processmsg getsummary docstatus_closed getdocstatus docstatus_voided getdocstatus docstatus_reversed getdocstatus closeit m_processmsg getsummary reverse correction as if nothing happened same date return true if success public boolean reverse correct it log info reverse correct it to string m journal journals get journals true check prerequisites for int i 0 i journals length i m journal journal journals i if journal is active continue all need to be closed completed if docstatus completed equals journal get doc status else m processmsg all journals need to be compleded journal get summary return false reverse it m journal batch reverse new m journal batch this reverse set date doc get date doc reverse setc period id getc period id reverse set date acct get date acct reverse indicator string description reverse get description if description null description get document no else description get document no reverse set description description reverse save reverse journals for int i 0 i journals length i m journal journal journals i if journal is active continue if journal reverse correct it reverse getgl journalbatch id null m processmsg could not reverse journal return false journal save return true reversecorrectit reversecorrectit tostring mjournal getjournals mjournal isactive docstatus_completed getdocstatus m_processmsg getsummary mjournalbatch mjournalbatch setdatedoc getdatedoc setc_period_id getc_period_id setdateacct getdateacct getdescription getdocumentno getdocumentno setdescription mjournal isactive reversecorrectit getgl_journalbatch_id m_processmsg reverse accrual flip dr cr use today s date return true if success public boolean reverse accrual it log info reverse accrual it to string m journal journals get journals true check prerequisites for int i 0 i journals length i m journal journal journals i if journal is active continue all need to be closed completed if docstatus completed equals journal get doc status else m processmsg all journals need to be compleded journal get summary return false reverse it m journal batch reverse new m journal batch this reverse setc period id 0 reverse set date doc new timestamp system current time millis reverse set date acct reverse get date doc reverse indicator string description reverse get description if description null description get document no else description get document no reverse set description description reverse save reverse journals for int i 0 i journals length i m journal journal journals i if journal is active continue if journal reverse accrual it reverse getgl journalbatch id null m processmsg could not reverse journal return false journal save return true reverseaccrualit reverseaccrualit tostring mjournal getjournals mjournal isactive docstatus_completed getdocstatus m_processmsg getsummary mjournalbatch mjournalbatch setc_period_id setdatedoc currenttimemillis setdateacct getdatedoc getdescription getdocumentno getdocumentno setdescription mjournal isactive reverseaccrualit getgl_journalbatch_id m_processmsg re activate same as reverse correct return true if success public boolean re activate it log info re activate it to string set processed false if reverse correct it return true return false reactivateit reactivateit tostring setprocessed reversecorrectit get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx total dr append append get total dr append append msg translate get ctx totalcr append append get total cr append append get journals false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx totaldr gettotaldr getctx gettotalcr getjournals getdescription getdescription getdescription tostring string representation return info public string to string string buffer sb new string buffer m journal batch sb append get id append append get description append dr append get total dr append cr append get total cr append return sb to string tostring stringbuffer stringbuffer mjournalbatch get_id getdescription gettotaldr gettotalcr tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id created by public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby get document approval amount return dr amount public big decimal get approval amt return get total dr bigdecimal getapprovalamt gettotaldr initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame try dyn parameter jb init dyn init frame get content pane add main panel border layout center frame get content pane add status bar border layout south catch exception ex log log level severe ex windowno windowno formframe m_windowno windowno m_frame dynparameter jbinit dyninit getcontentpane mainpanel borderlayout getcontentpane statusbar borderlayout static init throws exception void jb init throws exception compiere color set background this main panel set layout main layout main layout set vgap 10 parameter panel set layout parameter layout org label set text msg translate env get ctx ad org id locator label set text msg translate env get ctx m locator id product label set text msg translate env get ctx product datef label set text msg translate env get ctx date from datet label set text msg translate env get ctx date to mtype label set text msg translate env get ctx movement type main panel add parameter panel border layout north parameter panel add org label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add org field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 parameter panel add mtype label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add mtype field new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 parameter panel add datef label new grid bag constraints 4 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add datef field new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 parameter panel add locator label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add locator field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 parameter panel add product label new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add product field new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 parameter panel add datet label new grid bag constraints 4 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 parameter panel add datet field new grid bag constraints 5 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 0 5 0 0 south panel set layout south layout south panel add confirm panel border layout north south panel add status bar border layout south main panel add south panel border layout south jbinit compierecolor setbackground mainpanel setlayout mainlayout mainlayout setvgap parameterpanel setlayout parameterlayout orglabel settext getctx ad_org_id locatorlabel settext getctx m_locator_id productlabel settext getctx dateflabel settext getctx datefrom datetlabel settext getctx dateto mtypelabel settext getctx movementtype mainpanel parameterpanel borderlayout parameterpanel orglabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel orgfield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel mtypelabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel mtypefield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel dateflabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel dateffield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel locatorlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel locatorfield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel productlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel productfield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel datetlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel datetfield gridbagconstraints gridbagconstraints gridbagconstraints southpanel setlayout southlayout southpanel confirmpanel borderlayout southpanel statusbar borderlayout mainpanel southpanel borderlayout initialize parameter fields throws exception if lookups cannot be initialized private void dyn parameter throws exception properties ctx env get ctx organization m lookup org lookup m lookup factory get ctx m windowno 0 3660 display type table dir org field new v lookup ad org id false false true org lookup org field add vetoable change listener this locator m locator lookup locator lookup new m locator lookup ctx m windowno locator field new v locator m locator id false false true locator lookup m windowno locator field add vetoable change listener this product m lookup product lookup m lookup factory get ctx m windowno 0 3668 display type search product field new v lookup m product id false false true product lookup product field add vetoable change listener this movement type m lookup mtype lookup m lookup factory get ctx m windowno 0 3666 display type list mtype field new v lookup movement type false false true mtype lookup dates datef field new v date date from false false true display type date msg get msg env get ctx date from datet field new v date date to false false true display type date msg get msg env get ctx date to confirm panel add action listener this status bar set status line dynparameter getctx mlookup orglookup mlookupfactory m_windowno displaytype tabledir orgfield vlookup ad_org_id orglookup orgfield addvetoablechangelistener mlocatorlookup locatorlookup mlocatorlookup m_windowno locatorfield vlocator m_locator_id locatorlookup m_windowno locatorfield addvetoablechangelistener mlookup productlookup mlookupfactory m_windowno displaytype productfield vlookup m_product_id productlookup productfield addvetoablechangelistener mlookup mtypelookup mlookupfactory m_windowno displaytype mtypefield vlookup movementtype mtypelookup dateffield vdate datefrom displaytype getmsg getctx datefrom datetfield vdate dateto displaytype getmsg getctx dateto confirmpanel addactionlistener statusbar setstatusline dynamic layout grid based on ad window material transactions private void dyn init m staticquery new m query m staticquery add restriction ad client id m query equal env getad client id env get ctx int ad window id 223 hardcoded m windowvo wvo a env getm windowvo m windowno ad window id 0 if wvo null return m mwindow new m window wvo m mtab m mwindow get tab 0 m gridcontroller new grid controller m gridcontroller init grid m mtab true m windowno null null main panel add m gridcontroller border layout center m mtab set query m query get equal query 1 2 m mtab query false status bar set status line false status bar set statusdb ad_window dyninit m_staticquery mquery m_staticquery addrestriction ad_client_id mquery getad_client_id getctx ad_window_id mwindowvo aenv getmwindowvo m_windowno ad_window_id m_mwindow mwindow m_mtab m_mwindow gettab m_gridcontroller gridcontroller m_gridcontroller initgrid m_mtab m_windowno mainpanel m_gridcontroller borderlayout m_mtab setquery mquery getequalquery m_mtab statusbar setstatusline statusbar setstatusdb dispose public void dispose if m gridcontroller null m gridcontroller dispose m gridcontroller null m mtab null if m mwindow null m mwindow dispose m mwindow null org field null locator field null product field null mtype field null datef field null datet field null if m frame null m frame dispose m frame null m_gridcontroller m_gridcontroller m_gridcontroller m_mtab m_mwindow m_mwindow m_mwindow orgfield locatorfield productfield mtypefield dateffield datetfield m_frame m_frame m_frame action listener param e event public void action performed action event e if e get action command equals confirm panel a cancel dispose else if e get action command equals confirm panel a refresh e get action command equals confirm panel a ok refresh else if e get action command equals confirm panel a zoom zoom actionperformed actionevent getactioncommand confirmpanel a_cancel getactioncommand confirmpanel a_refresh getactioncommand confirmpanel a_ok getactioncommand confirmpanel a_zoom property listener param e event public void vetoable change property change event e if e get property name equals m product id product field set value e get new value vetoablechange propertychangeevent getpropertyname m_product_id productfield setvalue getnewvalue refresh create query and refresh grid private void refresh create where clause m query query m staticquery deep copy organization object value org field get value if value null value to string length 0 query add restriction ad org id m query equal value locator value locator field get value if value null value to string length 0 query add restriction m locator id m query equal value product value product field get value if value null value to string length 0 query add restriction m product id m query equal value movement type value mtype field get value if value null value to string length 0 query add restriction movement type m query equal value date from timestamp ts timestamp datef field get value if ts null query add restriction trunc movement date m query greater equal ts dateto ts timestamp datet field get value if ts null query add restriction trunc movement date m query less equal ts log info v trx material refresh query query to string refresh requery set cursor cursor get predefined cursor cursor wait cursor status bar set status line msg get msg env get ctx start search false m mtab set query query m mtab query false set cursor cursor get default cursor int no m mtab get row count status bar set status line false status bar set statusdb integer to string no mquery m_staticquery deepcopy orgfield getvalue tostring addrestriction ad_org_id mquery locatorfield getvalue tostring addrestriction m_locator_id mquery productfield getvalue tostring addrestriction m_product_id mquery movementtype mtypefield getvalue tostring addrestriction movementtype mquery datefrom dateffield getvalue addrestriction movementdate mquery greater_equal datetfield getvalue addrestriction movementdate mquery less_equal vtrxmaterial tostring setcursor getpredefinedcursor wait_cursor statusbar setstatusline getmsg getctx startsearch m_mtab setquery m_mtab setcursor getdefaultcursor m_mtab getrowcount statusbar setstatusline statusbar setstatusdb tostring zoom private void zoom log info int ad window id 0 string column name null string sql null int lineid env get context as int env get ctx m windowno m inoutline id if lineid 0 log fine m inoutline id lineid if env get context env get ctx m windowno movement type starts with c ad window id 169 customer else ad window id 184 vendor column name m inout id sql select m inout id from m inoutline where m inoutline id else lineid env get context as int env get ctx m windowno m inventoryline id if lineid 0 log fine m inventoryline id lineid ad window id 168 column name m inventory id sql select m inventory id from m inventoryline where m inventoryline id else lineid env get context as int env get ctx m windowno m movementline id if lineid 0 log fine m movementline id lineid ad window id 170 column name m movement id sql select m movement id from m movementline where m movementline id else lineid env get context as int env get ctx m windowno m productionline id if lineid 0 log fine m productionline id lineid ad window id 191 column name m production id sql select m production id from m productionline where m productionline id else log fine not found window no m windowno if ad window id 0 return get parent id int parentid 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 lineid result set rs pstmt execute query if rs next parentid rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e m query query m query get equal query column name parentid log config ad window id ad window id query if parentid 0 log log level severe no parent value sql lineid zoom set cursor cursor get predefined cursor cursor wait cursor a window frame new a window if frame init window ad window id query set cursor cursor get default cursor return a env show center screen frame frame null set cursor cursor get default cursor ad_window_id columnname getcontextasint getctx m_windowno m_inoutline_id m_inoutline_id getcontext getctx m_windowno movementtype startswith ad_window_id ad_window_id columnname m_inout_id m_inout_id m_inoutline m_inoutline_id getcontextasint getctx m_windowno m_inventoryline_id m_inventoryline_id ad_window_id columnname m_inventory_id m_inventory_id m_inventoryline m_inventoryline_id getcontextasint getctx m_windowno m_movementline_id m_movementline_id ad_window_id columnname m_movement_id m_movement_id m_movementline m_movementline_id getcontextasint getctx m_windowno m_productionline_id m_productionline_id ad_window_id columnname m_production_id m_production_id m_productionline m_productionline_id windowno m_windowno ad_window_id preparedstatement preparestatement setint resultset executequery getint sqlexception mquery mquery getequalquery columnname ad_window_id ad_window_id parentvalue setcursor getpredefinedcursor wait_cursor awindow awindow initwindow ad_window_id setcursor getdefaultcursor aenv showcenterscreen setcursor getdefaultcursor standard constructor public x fact acct balance properties ctx int fact acct balance id string trx name super ctx fact acct balance id trx name if fact acct balance id 0 setaccount id 0 set amt acct cr env zero set amt acct dr env zero setc acctschema id 0 set date acct new timestamp system current time millis set posting type null set qty env zero x_fact_acct_balance fact_acct_balance_id trxname fact_acct_balance_id trxname fact_acct_balance_id setaccount_id setamtacctcr setamtacctdr setc_acctschema_id setdateacct currenttimemillis setpostingtype setqty load constructor public x fact acct balance properties ctx result set rs string trx name super ctx rs trx name x_fact_acct_balance resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x fact acct balance append get id append return sb to string tostring stringbuffer stringbuffer x_fact_acct_balance get_id tostring public static final int ad orgtrx id ad reference id 276 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue public static final int account id ad reference id 182 set account account used public void setaccount id int account id if account id 1 throw new illegal argument exception account id is mandatory set value account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id illegalargumentexception account_id set_value account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr if amt acct cr null throw new illegal argument exception amt acct cr is mandatory set value amt acct cr amt acct cr setamtacctcr bigdecimal amtacctcr amtacctcr illegalargumentexception amtacctcr set_value amtacctcr amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr if amt acct dr null throw new illegal argument exception amt acct dr is mandatory set value amt acct dr amt acct dr setamtacctdr bigdecimal amtacctdr amtacctdr illegalargumentexception amtacctdr set_value amtacctdr amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc acctschema id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_acctschema_id set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set value c locfrom id null else set value c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_value c_locfrom_id set_value c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set value c locto id null else set value c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_value c_locto_id set_value c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set sub account sub account for element value public void setc subacct id int c subacct id if c subacct id 0 set valuenocheck c subacct id null else set valuenocheck c subacct id new integer c subacct id setc_subacct_id c_subacct_id c_subacct_id set_valuenocheck c_subacct_id set_valuenocheck c_subacct_id c_subacct_id get sub account sub account for element value public int getc subacct id integer ii integer get value c subacct id if ii null return 0 return ii int value getc_subacct_id get_value c_subacct_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set value gl budget id null else set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_value gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue set user element 1 user defined accounting element public void setuserelement1 id int userelement1 id if userelement1 id 0 set value userelement1 id null else set value userelement1 id new integer userelement1 id setuserelement1_id userelement1_id userelement1_id set_value userelement1_id set_value userelement1_id userelement1_id get user element 1 user defined accounting element public int getuserelement1 id integer ii integer get value userelement1 id if ii null return 0 return ii int value getuserelement1_id get_value userelement1_id intvalue set user element 2 user defined accounting element public void setuserelement2 id int userelement2 id if userelement2 id 0 set value userelement2 id null else set value userelement2 id new integer userelement2 id setuserelement2_id userelement2_id userelement2_id set_value userelement2_id set_value userelement2_id userelement2_id get user element 2 user defined accounting element public int getuserelement2 id integer ii integer get value userelement2 id if ii null return 0 return ii int value getuserelement2_id get_value userelement2_id intvalue get contents return contents public object get contents return contents getcontents create own instance param x return compiere menu barui public static componentui createui j component x return new compiere menu barui compieremenubarui jcomponent compieremenubarui install ui param c public void installui j component c super installui c c set opaque true jcomponent setopaque update ui param g graphics param c component public void update graphics g j component c if c is opaque get compiere color compiere color bg compiere color get default background bg paint g c else g set color c get background g fill rect 0 0 c get width c get height paint g c jcomponent isopaque compierecolor compierecolor compierecolor getdefaultbackground setcolor getbackground fillrect getwidth getheight standard constructor param frame frame param window no window public preference frame frame int window no super frame msg get msg env get ctx preference true log config preference try jb init catch exception ex log log level severe ex get message load string buffer sta new string buffer sta append env get ctx size append append msg translate env get ctx ad window id append append window no status bar set status line sta to string status bar set statusdb a env position center window frame this windowno windowno getmsg getctx jbinit getmessage stringbuffer stringbuffer getctx getctx ad_window_id windowno statusbar setstatusline tostring statusbar setstatusdb aenv positioncenterwindow static init pre panel tab pane customize pane info area fields context pane context list context south panel context header context detail error pane error scoll pane error table south panel pre throws exception void jb init throws exception trace label set request focus enabled false trace label set text msg get msg env get ctx trace level true trace label set tool tip text msg get msg env get ctx trace level false trace file set text msg get msg env get ctx trace file true trace file set tool tip text msg get msg env get ctx trace file false ui theme set text msg get msg env get ctx ui theme true ui theme set tool tip text msg get msg env get ctx ui theme false auto commit set text msg get msg env get ctx auto commit true auto commit set tool tip text msg get msg env get ctx auto commit false auto new set text msg get msg env get ctx auto new true auto new set tool tip text msg get msg env get ctx auto new false compiere sys set text msg get msg env get ctx a dempiere sys true compiere sys set tool tip text msg get msg env get ctx a dempiere sys false print preview set text msg get msg env get ctx always print preview true print preview set tool tip text msg get msg env get ctx always print preview false auto login set text msg get msg env get ctx auto login true auto login set tool tip text msg get msg env get ctx auto login false store password set text msg get msg env get ctx store password true store password set tool tip text msg get msg env get ctx store password false show trl set text msg get msg env get ctx show trl tab true show trl set tool tip text msg get msg env get ctx show trl tab false show acct set text msg get msg env get ctx show acct tab true show acct set tool tip text msg get msg env get ctx show acct tab false show advanced set text msg get msg env get ctx show advanced tab true show advanced set tool tip text msg get msg env get ctx show advanced tab false connection profile label set text msg get element env get ctx connection profile cache window set text msg get msg env get ctx cache window true cache window set tool tip text msg get msg env get ctx cache window false l printer set text msg get msg env get ctx printer l date set text msg get msg env get ctx date info area set read write false get content pane add panel panel set layout panel layout panel add tab pane border layout center customize tab pane add customize pane msg get msg env get ctx preference tab pane add customize pane msg get msg env get ctx preference customize pane set layout customize layout customize pane add info area new grid bag constraints 0 0 3 1 0 0 0 0 grid bag constraints center grid bag constraints both new insets 5 5 5 5 0 0 customize pane add ui theme new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add b role info new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 customize pane add auto commit new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add compiere sys new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add auto login new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add store password new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add show acct new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add show trl new grid bag constraints 2 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add show advanced new grid bag constraints 1 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add auto new new grid bag constraints 2 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add connection profile label new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 customize pane add connection profile new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add cache window new grid bag constraints 2 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add trace label new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 0 5 5 0 0 customize pane add trace level new grid bag constraints 1 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add trace file new grid bag constraints 2 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add l printer new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 customize pane add f printer new grid bag constraints 1 8 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add l date new grid bag constraints 0 9 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 customize pane add f date new grid bag constraints 1 9 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 customize pane add print preview new grid bag constraints 2 9 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 info tab pane add context pane msg get msg env get ctx context tab pane add context pane msg get msg env get ctx context context pane set layout icontext layout context pane add context list scroll pane border layout center context list scroll pane set preferred size new dimension 200 300 info list set selection mode list selection model single interval selection info list set background compiereplaf getfieldbackground inactive info list add list selection listener this info list set fixed cell width 30 context pane add context south panel border layout south context south panel set layout context south layout context south panel add context header border layout west context header set background system color info context header set read write false context header set line wrap true context header set wrap style word true context header set border border factory create lowered bevel border context south panel add context detail border layout center context detail set background system color info context detail set read write false context detail set line wrap true context detail set wrap style word true context detail set border border factory create lowered bevel border error pane error pane set layout error layout tab pane add error pane msg get msg env get ctx errors tab pane add error pane errors error pane add error scroll pane border layout center error scroll pane get viewport add error table null error panel add b errors only error panel add b error reset error panel add b errore mail error panel add b error save error pane add error panel border layout south south panel add south panel border layout south south panel set layout south layout south panel add status bar border layout south south panel add confirm border layout center b role info add action listener this confirm add action listener this tabpane customizepane infoarea contextpane contextlist contextsouthpanel contextheader contextdetail errorpane errorscollpane errortable southpanel jbinit tracelabel setrequestfocusenabled tracelabel settext getmsg getctx tracelevel tracelabel settooltiptext getmsg getctx tracelevel tracefile settext getmsg getctx tracefile tracefile settooltiptext getmsg getctx tracefile uitheme settext getmsg getctx uitheme uitheme settooltiptext getmsg getctx uitheme autocommit settext getmsg getctx autocommit autocommit settooltiptext getmsg getctx autocommit autonew settext getmsg getctx autonew autonew settooltiptext getmsg getctx autonew compieresys settext getmsg getctx adempieresys compieresys settooltiptext getmsg getctx adempieresys printpreview settext getmsg getctx alwaysprintpreview printpreview settooltiptext getmsg getctx alwaysprintpreview autologin settext getmsg getctx autologin autologin settooltiptext getmsg getctx autologin storepassword settext getmsg getctx storepassword storepassword settooltiptext getmsg getctx storepassword showtrl settext getmsg getctx showtrltab showtrl settooltiptext getmsg getctx showtrltab showacct settext getmsg getctx showaccttab showacct settooltiptext getmsg getctx showaccttab showadvanced settext getmsg getctx showadvancedtab showadvanced settooltiptext getmsg getctx showadvancedtab connectionprofilelabel settext getelement getctx connectionprofile cachewindow settext getmsg getctx cachewindow cachewindow settooltiptext getmsg getctx cachewindow lprinter settext getmsg getctx ldate settext getmsg getctx infoarea setreadwrite getcontentpane setlayout panellayout tabpane borderlayout tabpane customizepane getmsg getctx tabpane customizepane getmsg getctx customizepane setlayout customizelayout customizepane infoarea gridbagconstraints gridbagconstraints gridbagconstraints customizepane uitheme gridbagconstraints gridbagconstraints gridbagconstraints customizepane broleinfo gridbagconstraints gridbagconstraints gridbagconstraints customizepane autocommit gridbagconstraints gridbagconstraints gridbagconstraints customizepane compieresys gridbagconstraints gridbagconstraints gridbagconstraints customizepane autologin gridbagconstraints gridbagconstraints gridbagconstraints customizepane storepassword gridbagconstraints gridbagconstraints gridbagconstraints customizepane showacct gridbagconstraints gridbagconstraints gridbagconstraints customizepane showtrl gridbagconstraints gridbagconstraints gridbagconstraints customizepane showadvanced gridbagconstraints gridbagconstraints gridbagconstraints customizepane autonew gridbagconstraints gridbagconstraints gridbagconstraints customizepane connectionprofilelabel gridbagconstraints gridbagconstraints gridbagconstraints customizepane connectionprofile gridbagconstraints gridbagconstraints gridbagconstraints customizepane cachewindow gridbagconstraints gridbagconstraints gridbagconstraints customizepane tracelabel gridbagconstraints gridbagconstraints gridbagconstraints customizepane tracelevel gridbagconstraints gridbagconstraints gridbagconstraints customizepane tracefile gridbagconstraints gridbagconstraints gridbagconstraints customizepane lprinter gridbagconstraints gridbagconstraints gridbagconstraints customizepane fprinter gridbagconstraints gridbagconstraints gridbagconstraints customizepane ldate gridbagconstraints gridbagconstraints gridbagconstraints customizepane fdate gridbagconstraints gridbagconstraints gridbagconstraints customizepane printpreview gridbagconstraints gridbagconstraints gridbagconstraints tabpane contextpane getmsg getctx tabpane contextpane getmsg getctx contextpane setlayout icontextlayout contextpane contextlistscrollpane borderlayout contextlistscrollpane setpreferredsize infolist setselectionmode listselectionmodel single_interval_selection infolist setbackground getfieldbackground_inactive infolist addlistselectionlistener infolist setfixedcellwidth contextpane contextsouthpanel borderlayout contextsouthpanel setlayout contextsouthlayout contextsouthpanel contextheader borderlayout contextheader setbackground systemcolor contextheader setreadwrite contextheader setlinewrap contextheader setwrapstyleword contextheader setborder borderfactory createloweredbevelborder contextsouthpanel contextdetail borderlayout contextdetail setbackground systemcolor contextdetail setreadwrite contextdetail setlinewrap contextdetail setwrapstyleword contextdetail setborder borderfactory createloweredbevelborder errorpane setlayout errorlayout tabpane errorpane getmsg getctx tabpane errorpane errorpane errorscrollpane borderlayout errorscrollpane getviewport errortable errorpanel berrorsonly errorpanel berrorreset errorpanel berroremail errorpanel berrorsave errorpane errorpanel borderlayout southpanel borderlayout southpanel setlayout southlayout southpanel statusbar borderlayout southpanel borderlayout broleinfo addactionlistener addactionlistener list selection listener show info in header detail fields param e evant public void value changed list selection event e if e get value is adjusting return string value string info list get selected value if value null return int pos value index of if pos 1 context header set text context detail set text value else context header set text value substring 0 pos replace n context detail set text value substring pos 3 valuechanged listselectionevent getvalueisadjusting infolist getselectedvalue indexof contextheader settext contextdetail settext contextheader settext contextdetail settext action listener param e event public void action performed action event e ui change if e get source ui theme new compiereplaf editor this false else if e get action command equals confirm panel a cancel dispose else if e get action command equals confirm panel a ok cmd save else if e get source b errors only cmd displayerrors else if e get source b error reset cmd errorreset else if e get source b errore mail cmd erroremail else if e get source b error save cmd errorsave else if e get source b role info a dialog info 0 this role info m role get default to stringx env get ctx actionlistener actionperformed actionevent getsource uitheme compiereplafeditor getactioncommand confirmpanel a_cancel getactioncommand confirmpanel a_ok cmd_save getsource berrorsonly cmd_displayerrors getsource berrorreset cmd_errorreset getsource berroremail cmd_erroremail getsource berrorsave cmd_errorsave getsource broleinfo adialog roleinfo mrole getdefault tostringx getctx load settings and context private void load log config info area set text c log mgt get info null to string info area set caret position 0 load settings ui ui theme add action listener this auto commit auto commit set selected env is auto commit env get ctx auto new set selected env is auto new env get ctx compiere sys compiere sys set selected ini is property bool ini p compieresys if env getad client id env get ctx 20 compiere sys set selected false compiere sys set enabled false auto login auto login set selected ini is property bool ini p a login save password store password set selected ini is property bool ini p store pwd show acct tab if m role get default is show acct show acct set selected ini is property bool ini p show acct else show acct set selected false show acct set read write false show trl advanced tab show trl set selected ini is property bool ini p show trl show advanced set selected ini is property bool ini p show advanced connection profile m user user m user get env get ctx string cp user get connection profile if cp null cp m role get default get connection profile if cp null c connection get set connection profile cp connection profile set read write false connection profile set selected item c connection get get connection profile pair cache window set selected ini is cache window print preview print preview set selected ini is property bool ini p printpreview trace level trace level set selected item c log mgt get level trace file set selected ini is property bool ini p tracefile printer f printer set value env get context env get ctx printer date f date set value env get context as date env get ctx date load and sort context string context env get entire context env get ctx arrays sort context info list set list data context load errors c log mgt mgt new c log mgt creates test trace b errors only set selected true error table set cell selection enabled true cmd displayerrors for int i 2 i 6 i error table set column read only i false b errors only add action listener this b error reset add action listener this b error save add action listener this b errore mail add action listener this infoarea settext clogmgt getinfo tostring infoarea setcaretposition uitheme addactionlistener autocommit autocommit setselected isautocommit getctx autonew setselected isautonew getctx compieresys compieresys setselected ispropertybool p_compieresys getad_client_id getctx compieresys setselected compieresys setenabled autologin autologin setselected ispropertybool p_a_login storepassword setselected ispropertybool p_store_pwd mrole getdefault isshowacct showacct setselected ispropertybool p_show_acct showacct setselected showacct setreadwrite showtrl setselected ispropertybool p_show_trl showadvanced setselected ispropertybool p_show_advanced muser muser getctx getconnectionprofile mrole getdefault getconnectionprofile cconnection setconnectionprofile connectionprofile setreadwrite connectionprofile setselecteditem cconnection getconnectionprofilepair cachewindow setselected iscachewindow printpreview setselected ispropertybool p_printpreview tracelevel tracelevel setselecteditem clogmgt getlevel tracefile setselected ispropertybool p_tracefile fprinter setvalue getcontext getctx fdate setvalue getcontextasdate getctx getentirecontext getctx infolist setlistdata clogmgt clogmgt berrorsonly setselected errortable setcellselectionenabled cmd_displayerrors errortable setcolumnreadonly berrorsonly addactionlistener berrorreset addactionlistener berrorsave addactionlistener berroremail addactionlistener save settings private void cmd save log config ui auto commit ini set property ini p a commit auto commit is selected env set auto commit env get ctx auto commit is selected ini set property ini p a new auto new is selected env set auto new env get ctx auto new is selected compiere sys ini set property ini p compieresys compiere sys is selected auto login ini set property ini p a login auto login is selected save password ini set property ini p store pwd store password is selected show acct tab ini set property ini p show acct show acct is selected env set context env get ctx show acct show acct is selected show trl tab ini set property ini p show trl show trl is selected env set context env get ctx show trl show trl is selected show advanced tab ini set property ini p show advanced show advanced is selected env set context env get ctx show advanced show advanced is selected connection profile value name pair pp new value name pair connection profile get selected item string cp new pp new get value string cp old c connection get get connection profile c connection get set connection profile cp new if cp new equals cp old cp new equals c connection profile wan cp old equals c connection profile wan a dialog info 0 this connection profile change ini set property ini p cache window cache window is selected print preview ini set property ini p printpreview print preview is selected trace level file level level level trace level get selected item c log mgt set level level ini set property ini p tracelevel level get name ini set property ini p tracefile trace file is selected printer string printer string f printer get selected item env set context env get ctx printer printer ini set property ini p printer printer date remove seconds java sql timestamp ts java sql timestamp f date get value if ts null env set context env get ctx date ts ini save properties ini is client dispose cmd_save autocommit setproperty p_a_commit autocommit isselected setautocommit getctx autocommit isselected setproperty p_a_new autonew isselected setautonew getctx autonew isselected compieresys setproperty p_compieresys compieresys isselected autologin setproperty p_a_login autologin isselected setproperty p_store_pwd storepassword isselected setproperty p_show_acct showacct isselected setcontext getctx showacct showacct isselected setproperty p_show_trl showtrl isselected setcontext getctx showtrl showtrl isselected setproperty p_show_advanced showadvanced isselected setcontext getctx showadvanced showadvanced isselected connectionprofile valuenamepair ppnew valuenamepair connectionprofile getselecteditem cpnew ppnew getvalue cpold cconnection getconnectionprofile cconnection setconnectionprofile cpnew cpnew cpold cpnew cconnection profile_wan cpold cconnection profile_wan adialog connectionprofilechange setproperty p_cache_window cachewindow isselected setproperty p_printpreview printpreview isselected tracelevel tracelevel getselecteditem clogmgt setlevel setproperty p_tracelevel getname setproperty p_tracefile tracefile isselected fprinter getselecteditem setcontext getctx setproperty p_printer fdate getvalue setcontext getctx saveproperties isclient re display errors private void cmd displayerrors vector data c log error buffer get true get log data b errors only is selected vector column names c log error buffer get true get column names env get ctx default table model model new default table model data column names error table set model model if b errors only is selected tab pane set title at 2 msg get msg env get ctx errors data size else tab pane set title at 2 msg get msg env get ctx trace info data size error table auto size cmd_displayerrors clogerrorbuffer getlogdata berrorsonly isselected columnnames clogerrorbuffer getcolumnnames getctx defaulttablemodel defaulttablemodel columnnames errortable setmodel berrorsonly isselected tabpane settitleat getmsg getctx tabpane settitleat getmsg getctx traceinfo errortable autosize reset errors private void cmd errorreset c log error buffer get true reset buffer b errors only is selected cmd displayerrors cmd_errorreset clogerrorbuffer resetbuffer berrorsonly isselected cmd_displayerrors e mail errors private void cmd erroremail e mail dialog emd new e mail dialog this e mail trace m user get env get ctx to a dempiere trace info c log error buffer get true get error info env get ctx b errors only is selected null email cmd_erroremail emaildialog emaildialog email muser getctx adempiere clogerrorbuffer geterrorinfo getctx berrorsonly isselected save error to file private void cmd errorsave j file chooser chooser new j file chooser chooser set dialog type j file chooser save dialog chooser set dialog title a dempiere trace file chooser set file selection mode j file chooser files only chooser set selected file new file trace info log int return val chooser show save dialog this if return val j file chooser approve option return try file file chooser get selected file file writer writer new file writer file writer write c log error buffer get true get error info env get ctx b errors only is selected writer flush writer close catch exception e log log level severe e cmd_errorsave jfilechooser jfilechooser setdialogtype jfilechooser save_dialog setdialogtitle adempiere setfileselectionmode jfilechooser files_only setselectedfile traceinfo returnval showsavedialog returnval jfilechooser approve_option getselectedfile filewriter filewriter clogerrorbuffer geterrorinfo getctx berrorsonly isselected standard constructor public x ad user properties ctx int ad user id string trx name super ctx ad user id trx name if ad user id 0 setad user id 0 set is fullbp access true y set name null set notification type null e x_ad_user ad_user_id trxname ad_user_id trxname ad_user_id setad_user_id setisfullbpaccess setname setnotificationtype load constructor public x ad user properties ctx result set rs string trx name super ctx rs trx name x_ad_user resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad user append get id append return sb to string tostring stringbuffer stringbuffer x_ad_user get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set birthday birthday or anniversary day public void set birthday timestamp birthday set value birthday birthday setbirthday set_value get birthday birthday or anniversary day public timestamp get birthday return timestamp get value birthday getbirthday get_value set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set greeting greeting to print on correspondence public void setc greeting id int c greeting id if c greeting id 0 set value c greeting id null else set value c greeting id new integer c greeting id setc_greeting_id c_greeting_id c_greeting_id set_value c_greeting_id set_value c_greeting_id c_greeting_id get greeting greeting to print on correspondence public int getc greeting id integer ii integer get value c greeting id if ii null return 0 return ii int value getc_greeting_id get_value c_greeting_id intvalue set position job position public void setc job id int c job id if c job id 0 set value c job id null else set value c job id new integer c job id setc_job_id c_job_id c_job_id set_value c_job_id set_value c_job_id c_job_id get position job position public int getc job id integer ii integer get value c job id if ii null return 0 return ii int value getc_job_id get_value c_job_id intvalue set comments comments or additional information public void set comments string comments if comments null comments length 2000 log warning length 2000 truncated comments comments substring 0 1999 set value comments comments setcomments set_value get comments comments or additional information public string get comments return string get value comments getcomments get_value public static final string connectionprofile wan w set connection profile how a java client connects to the server s public void set connection profile string connection profile if connection profile null throw new illegal argument exception connection profile is mandatory if connection profile null connection profile equals l connection profile equals t connection profile equals v connection profile equals w else throw new illegal argument exception connection profile invalid value connection profile reference id 364 l t v w if connection profile null connection profile length 1 log warning length 1 truncated connection profile connection profile substring 0 0 set value connection profile connection profile connectionprofile_wan setconnectionprofile connectionprofile connectionprofile illegalargumentexception connectionprofile connectionprofile connectionprofile connectionprofile connectionprofile connectionprofile illegalargumentexception connectionprofile connectionprofile reference_id connectionprofile connectionprofile connectionprofile connectionprofile set_value connectionprofile connectionprofile get connection profile how a java client connects to the server s public string get connection profile return string get value connection profile getconnectionprofile get_value connectionprofile set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set e mail user id user name id in the mail system public void sete mail user string e mail user if e mail user null e mail user length 60 log warning length 60 truncated e mail user e mail user substring 0 59 set value e mail user e mail user email setemailuser emailuser emailuser emailuser emailuser emailuser set_value emailuser emailuser get e mail user id user name id in the mail system public string gete mail user return string get value e mail user email getemailuser get_value emailuser set e mail user password password of your email user id public void sete mail userpw string e mail userpw if e mail userpw null e mail userpw length 20 log warning length 20 truncated e mail userpw e mail userpw substring 0 19 set valuee e mail userpw e mail userpw email setemailuserpw emailuserpw emailuserpw emailuserpw emailuserpw emailuserpw set_valuee emailuserpw emailuserpw get e mail user password password of your email user id public string gete mail userpw return string get valuee e mail userpw email getemailuserpw get_valuee emailuserpw set verification info verification information of e mail address public void sete mail verify string e mail verify if e mail verify null e mail verify length 40 log warning length 40 truncated e mail verify e mail verify substring 0 39 set valuenocheck e mail verify e mail verify email setemailverify emailverify emailverify emailverify emailverify emailverify set_valuenocheck emailverify emailverify get verification info verification information of e mail address public string gete mail verify return string get value e mail verify email getemailverify get_value emailverify set e mail verify date email was verified public void sete mail verify date timestamp e mail verify date set valuenocheck e mail verify date e mail verify date email setemailverifydate emailverifydate set_valuenocheck emailverifydate emailverifydate get e mail verify date email was verified public timestamp gete mail verify date return timestamp get value e mail verify date email getemailverifydate get_value emailverifydate set fax facsimile number public void set fax string fax if fax null fax length 40 log warning length 40 truncated fax fax substring 0 39 set value fax fax setfax set_value get fax facsimile number public string get fax return string get value fax getfax get_value set full bp access the user concat has full access to business partner information and resources public void set is fullbp access boolean is fullbp access set value is fullbp access new boolean is fullbp access setisfullbpaccess isfullbpaccess set_value isfullbpaccess isfullbpaccess get full bp access the user concat has full access to business partner information and resources public boolean is fullbp access object oo get value is fullbp access if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfullbpaccess get_value isfullbpaccess booleanvalue set ldap user name user name used for authorization via ldap directory services public void setldap user string ldap user if ldap user null ldap user length 60 log warning length 60 truncated ldap user ldap user substring 0 59 set value ldap user ldap user setldapuser ldapuser ldapuser ldapuser ldapuser ldapuser set_value ldapuser ldapuser get ldap user name user name used for authorization via ldap directory services public string getldap user return string get value ldap user getldapuser get_value ldapuser set last contact date this individual was last contacted public void set last contact timestamp last contact set value last contact last contact setlastcontact lastcontact set_value lastcontact lastcontact get last contact date this individual was last contacted public timestamp get last contact return timestamp get value last contact getlastcontact get_value lastcontact set last result result of last contact public void set last result string last result if last result null last result length 255 log warning length 255 truncated last result last result substring 0 254 set value last result last result setlastresult lastresult lastresult lastresult lastresult lastresult set_value lastresult lastresult get last result result of last contact public string get last result return string get value last result getlastresult get_value lastresult set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string notificationtype none x set notification type type of notifications public void set notification type string notification type if notification type null throw new illegal argument exception notification type is mandatory if notification type equals b notification type equals e notification type equals n notification type equals x else throw new illegal argument exception notification type invalid value notification type reference id 344 b e n x if notification type length 1 log warning length 1 truncated notification type notification type substring 0 0 set value notification type notification type notificationtype_none setnotificationtype notificationtype notificationtype illegalargumentexception notificationtype notificationtype notificationtype notificationtype notificationtype illegalargumentexception notificationtype notificationtype reference_id notificationtype notificationtype notificationtype set_value notificationtype notificationtype get notification type type of notifications public string get notification type return string get value notification type getnotificationtype get_value notificationtype set password password of any length case sensitive public void set password string password if password null password length 40 log warning length 40 truncated password password substring 0 39 set valuee password password setpassword set_valuee get password password of any length case sensitive public string get password return string get valuee password getpassword get_valuee set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set value phone phone setphone set_value get phone identifies a telephone number public string get phone return string get value phone getphone get_value set 2nd phone identifies an alternate telephone number public void set phone2 string phone2 if phone2 null phone2 length 40 log warning length 40 truncated phone2 phone2 substring 0 39 set value phone2 phone2 setphone2 set_value get 2nd phone identifies an alternate telephone number public string get phone2 return string get value phone2 getphone2 get_value set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int supervisor id ad reference id 110 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 0 set value supervisor id null else set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id set_value supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue set title name this entity is referred to as public void set title string title if title null title length 40 log warning length 40 truncated title title substring 0 39 set value title title settitle set_value get title name this entity is referred to as public string get title return string get value title gettitle get_value standard constructor public x ad wf activity properties ctx int ad wf activity id string trx name super ctx ad wf activity id trx name if ad wf activity id 0 setad table id 0 setad wf activity id 0 setad wf node id 0 setad wf process id 0 setad workflow id 0 set processed false setrecord id 0 setwf state null x_ad_wf_activity ad_wf_activity_id trxname ad_wf_activity_id trxname ad_wf_activity_id setad_table_id setad_wf_activity_id setad_wf_node_id setad_wf_process_id setad_workflow_id setprocessed setrecord_id setwfstate load constructor public x ad wf activity properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_activity resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf activity append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_activity get_id tostring set message system message public void setad message id int ad message id if ad message id 0 set value ad message id null else set value ad message id new integer ad message id setad_message_id ad_message_id ad_message_id set_value ad_message_id set_value ad_message_id ad_message_id get message system message public int getad message id integer ii integer get value ad message id if ii null return 0 return ii int value getad_message_id get_value ad_message_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue public static final int ad user id ad reference id 286 set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id ad_user_id_ad_reference_id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set workflow activity workflow activity public void setad wf activity id int ad wf activity id if ad wf activity id 1 throw new illegal argument exception ad wf activity id is mandatory set valuenocheck ad wf activity id new integer ad wf activity id setad_wf_activity_id ad_wf_activity_id ad_wf_activity_id illegalargumentexception ad_wf_activity_id set_valuenocheck ad_wf_activity_id ad_wf_activity_id get workflow activity workflow activity public int getad wf activity id integer ii integer get value ad wf activity id if ii null return 0 return ii int value getad_wf_activity_id get_value ad_wf_activity_id intvalue set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 1 throw new illegal argument exception ad wf node id is mandatory set value ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception ad_wf_node_id set_value ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf node id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_node_id set workflow process actual workflow process instance public void setad wf process id int ad wf process id if ad wf process id 1 throw new illegal argument exception ad wf process id is mandatory set valuenocheck ad wf process id new integer ad wf process id setad_wf_process_id ad_wf_process_id ad_wf_process_id illegalargumentexception ad_wf_process_id set_valuenocheck ad_wf_process_id ad_wf_process_id get workflow process actual workflow process instance public int getad wf process id integer ii integer get value ad wf process id if ii null return 0 return ii int value getad_wf_process_id get_value ad_wf_process_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 0 set value ad wf responsible id null else set value ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id set_value ad_wf_responsible_id set_value ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set value ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_value ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue set last alert date when last alert were sent public void set date last alert timestamp date last alert set value date last alert date last alert setdatelastalert datelastalert set_value datelastalert datelastalert get last alert date when last alert were sent public timestamp get date last alert return timestamp get value date last alert getdatelastalert get_value datelastalert set dyn priority start starting priority before changed dynamically public void set dyn priority start int dyn priority start set value dyn priority start new integer dyn priority start setdynprioritystart dynprioritystart set_value dynprioritystart dynprioritystart get dyn priority start starting priority before changed dynamically public int get dyn priority start integer ii integer get value dyn priority start if ii null return 0 return ii int value getdynprioritystart get_value dynprioritystart intvalue set end wait end of sleep time public void set end wait time timestamp end wait time set value end wait time end wait time setendwaittime endwaittime set_value endwaittime endwaittime get end wait end of sleep time public timestamp get end wait time return timestamp get value end wait time getendwaittime get_value endwaittime set priority indicates if this request is of a high medium or low priority public void set priority int priority set value priority new integer priority setpriority set_value get priority indicates if this request is of a high medium or low priority public int get priority integer ii integer get value priority if ii null return 0 return ii int value getpriority get_value intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set value record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg public static final string wfstate suspended os set workflow state state of the execution of the workflow public void setwf state string wf state if wf state null throw new illegal argument exception wf state is mandatory if wf state equals ca wf state equals cc wf state equals ct wf state equals on wf state equals or wf state equals os else throw new illegal argument exception wf state invalid value wf state reference id 305 ca cc ct on or os if wf state length 2 log warning length 2 truncated wf state wf state substring 0 1 set value wf state wf state wfstate_suspended setwfstate wfstate wfstate illegalargumentexception wfstate wfstate wfstate wfstate wfstate wfstate wfstate illegalargumentexception wfstate wfstate reference_id wfstate wfstate wfstate set_value wfstate wfstate get workflow state state of the execution of the workflow public string getwf state return string get value wf state getwfstate get_value wfstate standard constructor public x c charge acct properties ctx int c charge acct id string trx name super ctx c charge acct id trx name if c charge acct id 0 setc acctschema id 0 setc charge id 0 setch expense acct 0 setch revenue acct 0 x_c_charge_acct c_charge_acct_id trxname c_charge_acct_id trxname c_charge_acct_id setc_acctschema_id setc_charge_id setch_expense_acct setch_revenue_acct load constructor public x c charge acct properties ctx result set rs string trx name super ctx rs trx name x_c_charge_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c charge acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_charge_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 1 throw new illegal argument exception c charge id is mandatory set valuenocheck c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id illegalargumentexception c_charge_id set_valuenocheck c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set charge expense charge expense account public void setch expense acct int ch expense acct set value ch expense acct new integer ch expense acct setch_expense_acct ch_expense_acct set_value ch_expense_acct ch_expense_acct get charge expense charge expense account public int getch expense acct integer ii integer get value ch expense acct if ii null return 0 return ii int value getch_expense_acct get_value ch_expense_acct intvalue set charge revenue charge revenue account public void setch revenue acct int ch revenue acct set value ch revenue acct new integer ch revenue acct setch_revenue_acct ch_revenue_acct set_value ch_revenue_acct ch_revenue_acct get charge revenue charge revenue account public int getch revenue acct integer ii integer get value ch revenue acct if ii null return 0 return ii int value getch_revenue_acct get_value ch_revenue_acct intvalue standard constructor public x c periodcontrol properties ctx int c periodcontrol id string trx name super ctx c periodcontrol id trx name if c periodcontrol id 0 setc periodcontrol id 0 setc period id 0 set doc base type null set period action null n x_c_periodcontrol c_periodcontrol_id trxname c_periodcontrol_id trxname c_periodcontrol_id setc_periodcontrol_id setc_period_id setdocbasetype setperiodaction load constructor public x c periodcontrol properties ctx result set rs string trx name super ctx rs trx name x_c_periodcontrol resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c periodcontrol append get id append return sb to string tostring stringbuffer stringbuffer x_c_periodcontrol get_id tostring set period control public void setc periodcontrol id int c periodcontrol id if c periodcontrol id 1 throw new illegal argument exception c periodcontrol id is mandatory set valuenocheck c periodcontrol id new integer c periodcontrol id setc_periodcontrol_id c_periodcontrol_id c_periodcontrol_id illegalargumentexception c_periodcontrol_id set_valuenocheck c_periodcontrol_id c_periodcontrol_id get period control public int getc periodcontrol id integer ii integer get value c periodcontrol id if ii null return 0 return ii int value getc_periodcontrol_id get_value c_periodcontrol_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc periodcontrol id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_periodcontrol_id set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue public static final string docbasetype salesorder soo set document base type logical type of document public void set doc base type string doc base type if doc base type null throw new illegal argument exception doc base type is mandatory if doc base type equals apc doc base type equals api doc base type equals app doc base type equals arc doc base type equals arf doc base type equals ari doc base type equals arr doc base type equals cma doc base type equals cmb doc base type equals cmc doc base type equals gld doc base type equals glj doc base type equals mmi doc base type equals mmm doc base type equals mmp doc base type equals mmr doc base type equals mms doc base type equals mxi doc base type equals mxp doc base type equals pji doc base type equals poo doc base type equals por doc base type equals soo else throw new illegal argument exception doc base type invalid value doc base type reference id 183 apc api app arc arf ari arr cma cmb cmc gld glj mmi mmm mmp mmr mms mxi mxp pji poo por soo if doc base type length 3 log warning length 3 truncated doc base type doc base type substring 0 2 set valuenocheck doc base type doc base type docbasetype_salesorder basetype setdocbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype reference_id docbasetype docbasetype docbasetype set_valuenocheck docbasetype docbasetype get document base type logical type of document public string get doc base type return string get value doc base type basetype getdocbasetype get_value docbasetype public static final string periodaction permanentlycloseperiod p set period action action taken for this period public void set period action string period action if period action null throw new illegal argument exception period action is mandatory if period action equals c period action equals n period action equals o period action equals p else throw new illegal argument exception period action invalid value period action reference id 176 c n o p if period action length 1 log warning length 1 truncated period action period action substring 0 0 set value period action period action periodaction_permanentlycloseperiod setperiodaction periodaction periodaction illegalargumentexception periodaction periodaction periodaction periodaction periodaction illegalargumentexception periodaction periodaction reference_id periodaction periodaction periodaction set_value periodaction periodaction get period action action taken for this period public string get period action return string get value period action getperiodaction get_value periodaction public static final string periodstatus permanentlyclosed p set period status current state of this period public void set period status string period status if period status null throw new illegal argument exception period status is mandatory if period status null period status equals c period status equals n period status equals o period status equals p else throw new illegal argument exception period status invalid value period status reference id 177 c n o p if period status null period status length 1 log warning length 1 truncated period status period status substring 0 0 set valuenocheck period status period status periodstatus_permanentlyclosed setperiodstatus periodstatus periodstatus illegalargumentexception periodstatus periodstatus periodstatus periodstatus periodstatus periodstatus illegalargumentexception periodstatus periodstatus reference_id periodstatus periodstatus periodstatus periodstatus set_valuenocheck periodstatus periodstatus get period status current state of this period public string get period status return string get value period status getperiodstatus get_value periodstatus set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x gl journal properties ctx int gl journal id string trx name super ctx gl journal id trx name if gl journal id 0 setc acctschema id 0 c acctschema id setc conversiontype id 0 setc currency id 0 c currency id setc doctype id 0 c doctype id setc period id 0 c period id set currency rate env zero 1 set date acct new timestamp system current time millis date acct set date doc new timestamp system current time millis date doc set description null set doc action null co set doc status null dr set document no null setgl category id 0 gl category id setgl journal id 0 set is approved true y set is printed false n set posted false n set posting type null posting type set total cr env zero 0 set total dr env zero 0 x_gl_journal gl_journal_id trxname gl_journal_id trxname gl_journal_id setc_acctschema_id c_acctschema_id setc_conversiontype_id setc_currency_id c_currency_id setc_doctype_id c_doctype_id setc_period_id c_period_id setcurrencyrate setdateacct currenttimemillis dateacct setdatedoc currenttimemillis datedoc setdescription setdocaction setdocstatus setdocumentno setgl_category_id gl_category_id setgl_journal_id setisapproved setisprinted setposted setpostingtype postingtype settotalcr settotaldr load constructor public x gl journal properties ctx result set rs string trx name super ctx rs trx name x_gl_journal resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl journal append get id append return sb to string tostring stringbuffer stringbuffer x_gl_journal get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 1 throw new illegal argument exception c conversiontype id is mandatory set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id illegalargumentexception c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue public static final int c period id ad reference id 275 set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set value c period id new integer c period id c_period_id_ad_reference_id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_value c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue set control amount if not zero the debit amount of the document must be equal this amount public void set control amt big decimal control amt set value control amt control amt setcontrolamt bigdecimal controlamt set_value controlamt controlamt get control amount if not zero the debit amount of the document must be equal this amount public big decimal get control amt big decimal bd big decimal get value control amt if bd null return env zero return bd bigdecimal getcontrolamt bigdecimal bigdecimal get_value controlamt set rate currency conversion rate public void set currency rate big decimal currency rate if currency rate null throw new illegal argument exception currency rate is mandatory set value currency rate currency rate setcurrencyrate bigdecimal currencyrate currencyrate illegalargumentexception currencyrate set_value currencyrate currencyrate get rate currency conversion rate public big decimal get currency rate big decimal bd big decimal get value currency rate if bd null return env zero return bd bigdecimal getcurrencyrate bigdecimal bigdecimal get_value currencyrate set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set document date date of the document public void set date doc timestamp date doc if date doc null throw new illegal argument exception date doc is mandatory set value date doc date doc setdatedoc datedoc datedoc illegalargumentexception datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set description optional short description of the record public void set description string description if description null throw new illegal argument exception description is mandatory if description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription illegalargumentexception set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set value gl budget id null else set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_value gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set gl category general ledger category public void setgl category id int gl category id if gl category id 1 throw new illegal argument exception gl category id is mandatory set value gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id illegalargumentexception gl_category_id set_value gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set journal batch general ledger journal batch public void setgl journalbatch id int gl journalbatch id if gl journalbatch id 0 set valuenocheck gl journalbatch id null else set valuenocheck gl journalbatch id new integer gl journalbatch id setgl_journalbatch_id gl_journalbatch_id gl_journalbatch_id set_valuenocheck gl_journalbatch_id set_valuenocheck gl_journalbatch_id gl_journalbatch_id get journal batch general ledger journal batch public int getgl journalbatch id integer ii integer get value gl journalbatch id if ii null return 0 return ii int value getgl_journalbatch_id get_value gl_journalbatch_id intvalue set journal general ledger journal public void setgl journal id int gl journal id if gl journal id 1 throw new illegal argument exception gl journal id is mandatory set valuenocheck gl journal id new integer gl journal id setgl_journal_id gl_journal_id gl_journal_id illegalargumentexception gl_journal_id set_valuenocheck gl_journal_id gl_journal_id get journal general ledger journal public int getgl journal id integer ii integer get value gl journal id if ii null return 0 return ii int value getgl_journal_id get_value gl_journal_id intvalue set approved indicates if this document requires approval public void set is approved boolean is approved set valuenocheck is approved new boolean is approved setisapproved isapproved set_valuenocheck isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set valuenocheck is printed new boolean is printed setisprinted isprinted set_valuenocheck isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set posted posting status public void set posted boolean posted set valuenocheck posted new boolean posted setposted set_valuenocheck get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set total credit total credit in document currency public void set total cr big decimal total cr if total cr null throw new illegal argument exception total cr is mandatory set valuenocheck total cr total cr settotalcr bigdecimal totalcr totalcr illegalargumentexception totalcr set_valuenocheck totalcr totalcr get total credit total credit in document currency public big decimal get total cr big decimal bd big decimal get value total cr if bd null return env zero return bd bigdecimal gettotalcr bigdecimal bigdecimal get_value totalcr set total debit total debit in document currency public void set total dr big decimal total dr if total dr null throw new illegal argument exception total dr is mandatory set valuenocheck total dr total dr settotaldr bigdecimal totaldr totaldr illegalargumentexception totaldr set_valuenocheck totaldr totaldr get total debit total debit in document currency public big decimal get total dr big decimal bd big decimal get value total dr if bd null return env zero return bd bigdecimal gettotaldr bigdecimal bigdecimal get_value totaldr get menues with where clause param ctx context param where clause where clause w o the actual where return m menu public static m menu get properties ctx string where clause string sql select from ad menu if where clause null where clause length 0 sql where where clause array list m menu list new array list m menu prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m menu ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m menu ret value new m menu list size list to array ret value return ret value whereclause mmenu mmenu whereclause ad_menu whereclause whereclause whereclause arraylist mmenu arraylist mmenu preparedstatement preparestatement resultset executequery mmenu s_log mmenu retvalue mmenu toarray retvalue retvalue standard constructor param ctx context param ad menu id id public m menu properties ctx int ad menu id string trx name super ctx ad menu id trx name if ad menu id 0 set entity type entitytype usermaintained u set is read only false n set isso trx false set is summary false set name null ad_menu_id mmenu ad_menu_id trxname ad_menu_id trxname ad_menu_id setentitytype entitytype_usermaintained setisreadonly setissotrx setissummary setname m menu param ctx param rs public m menu properties ctx result set rs string trx name super ctx rs trx name mmenu mmenu resultset trxname trxname before save param new record new return true protected boolean before save boolean new record reset info if is summary get action null set action null string action get action if action null action clean up references if getad window id 0 action equals action window setad window id 0 if getad form id 0 action equals action form setad form id 0 if getad workflow id 0 action equals action workflow setad workflow id 0 if getad workbench id 0 action equals action workbench setad workbench id 0 if getad task id 0 action equals action task setad task id 0 if getad process id 0 action equals action process action equals action report setad process id 0 return true newrecord beforesave newrecord issummary getaction setaction getaction getad_window_id action_window setad_window_id getad_form_id action_form setad_form_id getad_workflow_id action_workflow setad_workflow_id getad_workbench_id action_workbench setad_workbench_id getad_task_id action_task setad_task_id getad_process_id action_process action_report setad_process_id after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record insert tree mtree base treetype menu return success newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_menu after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype menu return success afterdelete delete_tree mtree_base treetype_menu prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals delete old p deleteold string para i get parameter else log log level severe unknown parameter name p pricelist version id getrecord id processinfoparameter getparameter getparametername getparameter deleteold p_deleteold getparameter p_pricelist_version_id getrecord_id process return message throws exception protected string do it throws exception string sql string sqlupd string sqldel string sqlins int cntu 0 int cntd 0 int cnti 0 int totu 0 int toti 0 int totd 0 int v temp int v nextno 0 string message checking prerequisites po prices must exists sqlupd update m product po set price list 0 where price list is null cntu db execute update sqlupd if cntu 1 raise error update the price list to zero of m product po where price list is null sqlupd totu cntu sqlupd update m product po set price lastpo 0 where price lastpo is null cntu db execute update sqlupd if cntu 1 raise error update the price listpo to zero of m product po where price lastpo is null sqlupd totu cntu sqlupd update m product po set pricepo price lastpo where pricepo is null or pricepo 0 and price lastpo 0 cntu db execute update sqlupd if cntu 1 raise error update the pricepo to price lastpo of m product po where pricepo is null or pricepo 0 and price lastpo 0 sqlupd totu cntu sqlupd update m product po set pricepo 0 where pricepo is null cntu db execute update sqlupd if cntu 1 raise error update the pricepo to zero of m product po where pricepo is null sqlupd totu cntu set default current vendor sqlupd update m product po set is current vendor y where is current vendor n and not exists select pp m product id from m product po pp where pp m product id m product po m product id group by pp m product id having count 1 cntu db execute update sqlupd if cntu 1 raise error update is current vendor to y of m product po sqlupd totu cntu db commit true get trxname make sure that we have only one active product sql select distinct m product id from m product po po where is current vendor y and is active y and exists select m product id from m product po x where x m product id po m product id group by m product id having count 1 prepared statement cur duplicates null cur duplicates db prepare statement sql result set dupl cur duplicates execute query while dupl next sql select m product id c bpartner id from m product po where is current vendor y and is active y and m product id dupl get int m product id order by price list desc prepared statement cur vendors null cur duplicates db prepare statement sql result set vend cur vendors execute query leave first vend next while vend next sqlupd update m product po set is current vendor n where m product id vend get int m product id and c bpartner id vend get int c bpartner id cntu db execute update sqlupd if cntu 1 raise error update is current vendor to n of m product po for a m product id and c bpartner id ingresed sqlupd totu cntu vend close cur vendors close cur vendors null dupl close cur duplicates close cur duplicates null commit db commit true get trxname delete old data if p deleteold y sqldel delete m productprice where m pricelist version id p pricelist version id cntd db execute update sqldel if cntd 1 raise error delete m productprice sqldel totd cntd message deleted cntd get price list info sql select p c currency id c std precision v ad client id v ad org id v updated by v m discountschema id m pricelist version base id from m pricelist p m pricelist version v c currency c where p m pricelist id v m pricelist id and p c currency id c c currency id and v m pricelist version id p pricelist version id prepared statement curgen null curgen db prepare statement sql result set v curgen execute query while v next for all discount lines in sequence sql select m discountschemaline id ad client id ad org id isactive created createdby updated updatedby m discountschema id seqno m product category id c bpartner id m product id conversiondate list base list addamt list discount list rounding list minamt list maxamt list fixed std base std addamt std discount std rounding std minamt std maxamt std fixed limit base limit addamt limit discount limit rounding limit minamt limit maxamt limit fixed c conversiontype id from m discountschemaline where m discountschema id v get int m discountschema id and is active y order by seq no prepared statement cur discountline null cur discountline db prepare statement sql result set dl cur discountline execute query while dl next clear temporary table sqldel delete from t selection cntd db execute update sqldel if cntd 1 raise error delete t selection sqldel totd cntd create selection in temporary table v temp v get int m pricelist version base id if v was null create selection from m product po sqlins insert into t selection t selection id select distinct po m product id from m product p m product po po where p m product id po m product id and p ad client id v get int ad client id or p ad client id 0 and p is active y and po is active y and po is current vendor y optional restrictions and dl get int m product category id is null or p m product category id dl get int m product category id and dl get int c bpartner id is null or po c bpartner id dl get int c bpartner id and dl get int m product id is null or p m product id dl get int m product id cnti db execute update sqlins if cnti 1 raise error insert into t selection sqlins toti cnti else create selection from existing price list sqlins insert into t selection t selection id select distinct p m product id from m product p m productprice pp where p m product id pp m product id and pp m pricelist version id v get int m pricelist version base id and p is active y and pp is active y optional restrictions and dl get int m product category id is null or p m product category id dl get int m product category id and dl get int c bpartner id is null or exists select m product id c bpartner id ad client id ad org id isactive created createdby updated updatedby iscurrentvendor c uom id c currency id pricelist pricepo priceeffective pricelastpo pricelastinv vendorproductno upc vendorcategory discontinued discontinuedby order min order pack costperorder deliverytime promised deliverytime actual qualityrating royaltyamt manufacturer from m product po po where po m product id p m product id and po c bpartner id dl get int c bpartner id and dl get int m product id is null or p m product id dl get int m product id cnti db execute update sqlins if cnti 1 raise error insert into t selection from existing price list sqlins toti cnti message message selected cnti delete prices in selection so that we can insert v temp v get int m pricelist version base id if v was null v temp p pricelist version id sqldel delete m productprice pp where pp m pricelist version id p pricelist version id and exists select t selection id from t selection s where pp m product id s t selection id cntd db execute update sqldel doit v_temp v_nextno m_product_po pricelist pricelist executeupdate raiseerror pricelist m_product_po pricelist m_product_po pricelastpo pricelastpo executeupdate raiseerror pricelistpo m_product_po pricelastpo m_product_po pricelastpo pricelastpo executeupdate raiseerror pricelastpo m_product_po pricelastpo m_product_po executeupdate raiseerror m_product_po m_product_po iscurrentvendor iscurrentvendor m_product_id m_product_po m_product_id m_product_po m_product_id m_product_id executeupdate raiseerror iscurrentvendor m_product_po get_trxname m_product_id m_product_po iscurrentvendor isactive m_product_id m_product_po m_product_id m_product_id m_product_id preparedstatement cur_duplicates cur_duplicates preparestatement resultset cur_duplicates executequery m_product_id c_bpartner_id m_product_po iscurrentvendor isactive m_product_id getint m_product_id pricelist preparedstatement cur_vendors cur_duplicates preparestatement resultset cur_vendors executequery m_product_po iscurrentvendor m_product_id getint m_product_id c_bpartner_id getint c_bpartner_id executeupdate raiseerror iscurrentvendor m_product_po m_product_id c_bpartner_id cur_vendors cur_vendors cur_duplicates cur_duplicates get_trxname p_deleteold m_productprice m_pricelist_version_id p_pricelist_version_id executeupdate raiseerror m_productprice pricelist c_currency_id stdprecision ad_client_id ad_org_id updatedby m_discountschema_id m_pricelist_version_base_id m_pricelist m_pricelist_version c_currency m_pricelist_id m_pricelist_id c_currency_id c_currency_id m_pricelist_version_id p_pricelist_version_id preparedstatement preparestatement resultset executequery m_discountschemaline_id ad_client_id ad_org_id m_discountschema_id m_product_category_id c_bpartner_id m_product_id list_base list_addamt list_discount list_rounding list_minamt list_maxamt list_fixed std_base std_addamt std_discount std_rounding std_minamt std_maxamt std_fixed limit_base limit_addamt limit_discount limit_rounding limit_minamt limit_maxamt limit_fixed c_conversiontype_id m_discountschemaline m_discountschema_id getint m_discountschema_id isactive seqno preparedstatement cur_discountline cur_discountline preparestatement resultset cur_discountline executequery t_selection executeupdate raiseerror t_selection v_temp getint m_pricelist_version_base_id wasnull m_product_po t_selection t_selection_id m_product_id m_product m_product_po m_product_id m_product_id ad_client_id getint ad_client_id ad_client_id isactive isactive iscurrentvendor getint m_product_category_id m_product_category_id getint m_product_category_id getint c_bpartner_id c_bpartner_id getint c_bpartner_id getint m_product_id m_product_id getint m_product_id executeupdate raiseerror t_selection pricelist t_selection t_selection_id m_product_id m_product m_productprice m_product_id m_product_id m_pricelist_version_id getint m_pricelist_version_base_id isactive isactive getint m_product_category_id m_product_category_id getint m_product_category_id getint c_bpartner_id m_product_id c_bpartner_id ad_client_id ad_org_id c_uom_id c_currency_id order_min order_pack deliverytime_promised deliverytime_actual m_product_po m_product_id m_product_id c_bpartner_id getint c_bpartner_id getint m_product_id m_product_id getint m_product_id executeupdate raiseerror t_selection pricelist v_temp getint m_pricelist_version_base_id wasnull v_temp p_pricelist_version_id m_productprice m_pricelist_version_id p_pricelist_version_id t_selection_id t_selection m_product_id t_selection_id executeupdate private void raise error string string string sql throws exception db rollback false get trxname string msg string value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg raiseerror get_trxname valuenamepair clogger retrieveerror getname compiereusererror standard constructor public x m shipper properties ctx int m shipper id string trx name super ctx m shipper id trx name if m shipper id 0 setm shipper id 0 set name null x_m_shipper m_shipper_id trxname m_shipper_id trxname m_shipper_id setm_shipper_id setname load constructor public x m shipper properties ctx result set rs string trx name super ctx rs trx name x_m_shipper resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m shipper append get id append return sb to string tostring stringbuffer stringbuffer x_m_shipper get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 1 throw new illegal argument exception m shipper id is mandatory set valuenocheck m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id illegalargumentexception m_shipper_id set_valuenocheck m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set tracking url url of the shipper to track shipments public void set trackingurl string trackingurl if trackingurl null trackingurl length 120 log warning length 120 truncated trackingurl trackingurl substring 0 119 set value trackingurl trackingurl settrackingurl set_value get tracking url url of the shipper to track shipments public string get trackingurl return string get value trackingurl gettrackingurl get_value standard constructor param ctx context param ignored ignored public m process access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key else setad process id 0 setad role id 0 set is read write true mprocessaccess trxname trxname illegalargumentexception setad_process_id setad_role_id setisreadwrite load constructor param ctx context param rs result set public m process access properties ctx result set rs string trx name super ctx rs trx name mprocessaccess resultset trxname trxname parent constructor param parent parent param ad role id role id public m process access m process parent int ad role id super parent get ctx 0 parent get trxname set client org parent setad process id parent getad process id setad role id ad role id ad_role_id mprocessaccess mprocess ad_role_id getctx get_trxname setclientorg setad_process_id getad_process_id setad_role_id ad_role_id standard constructor public x c region properties ctx int c region id string trx name super ctx c region id trx name if c region id 0 setc country id 0 setc region id 0 set name null x_c_region c_region_id trxname c_region_id trxname c_region_id setc_country_id setc_region_id setname load constructor public x c region properties ctx result set rs string trx name super ctx rs trx name x_c_region resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c region append get id append return sb to string tostring stringbuffer stringbuffer x_c_region get_id tostring set country country public void setc country id int c country id if c country id 1 throw new illegal argument exception c country id is mandatory set valuenocheck c country id new integer c country id setc_country_id c_country_id c_country_id illegalargumentexception c_country_id set_valuenocheck c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 1 throw new illegal argument exception c region id is mandatory set valuenocheck c region id new integer c region id setc_region_id c_region_id c_region_id illegalargumentexception c_region_id set_valuenocheck c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c doctype id p c doctype id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_doctype_id p_c_doctype_id getparameterasint process return message throws exception protected string do it throws exception log info clean up empty storage string sql delete from m storage where qty on hand 0 and qty reserved 0 and qty ordered 0 and created sys date 3 int no db execute update sql get trxname log info delete empty no sql select from m storage s where ad client id and qty on hand 0 instance attribute and exists select from m product p inner join m attributeset mas on p m attributeset id mas m attributeset id where s m product id p m product id and mas is instance attribute y stock in same location and exists select from m storage sl where sl qty on hand 0 and s m product id sl m product id and s m locator id sl m locator id stock in same warehouse and exists select from m storage sw inner join m locator swl on sw m locator id swl m locator id m locator sl where sw qty on hand 0 and s m product id sw m product id and s m locator id sl m locator id and sl m warehouse id swl m warehouse id prepared statement pstmt null int lines 0 try pstmt db prepare statement sql get trxname pstmt set int 1 env getad client id get ctx result set rs pstmt execute query while rs next lines move new m storage get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return lines doit m_storage qtyonhand qtyreserved qtyordered sysdate executeupdate get_trxname m_storage ad_client_id qtyonhand m_product m_attributeset m_attributeset_id m_attributeset_id m_product_id m_product_id isinstanceattribute m_storage qtyonhand m_product_id m_product_id m_locator_id m_locator_id m_storage m_locator m_locator_id m_locator_id m_locator qtyonhand m_product_id m_product_id m_locator_id m_locator_id m_warehouse_id m_warehouse_id preparedstatement preparestatement get_trxname setint getad_client_id getctx resultset executequery mstorage getctx get_trxname move stock to location param target target storage return no of movements private int move m storage target log info target to string big decimal qty target get qty on hand negate create movement m movement mh new m movement get ctx 0 get trxname mh setad org id target getad org id mh setc doctype id p c doctype id mh set description get name if mh save return 0 int lines 0 m storage sources get sources target getm product id target getm locator id for int i 0 i sources length i m storage source sources i movement line m movement line ml new m movement line mh ml setm product id target getm product id ml setm locatorto id target getm locator id ml setm attributesetinstanceto id target getm attributesetinstance id from ml setm locator id source getm locator id ml setm attributesetinstance id source getm attributesetinstance id big decimal qty move qty if qty move compare to source get qty on hand 0 qty move source get qty on hand ml set movement qty qty move lines ml set line lines 10 if ml save return 0 qty qty subtract qty move if qty signum 0 break for all movements process mh process it m movement action complete mh save add log 0 null new big decimal lines m movement id mh get document no m ref list get get ctx m movement docstatus ad reference id mh get doc status get trxname eliminate reservation target return lines mstorage tostring bigdecimal getqtyonhand mmovement mmovement getctx get_trxname setad_org_id getad_org_id setc_doctype_id p_c_doctype_id setdescription getname mstorage getsources getm_product_id getm_locator_id mstorage mmovementline mmovementline setm_product_id getm_product_id setm_locatorto_id getm_locator_id setm_attributesetinstanceto_id getm_attributesetinstance_id setm_locator_id getm_locator_id setm_attributesetinstance_id getm_attributesetinstance_id bigdecimal qtymove qtymove compareto getqtyonhand qtymove getqtyonhand setmovementqty qtymove setline qtymove processit mmovement action_complete addlog bigdecimal m_movement_id getdocumentno mreflist getctx mmovement docstatus_ad_reference_id getdocstatus get_trxname eliminatereservation eliminate reserved ordered param target target storage private void eliminate reservation m storage target negative ordered reserved qty if target get qty reserved signum 0 target get qty ordered signum 0 int m locator id target getm locator id m storage storage0 m storage get get ctx m locator id target getm product id 0 get trxname if storage0 null m locator default loc m locator get default get ctx m locator id if m locator id default loc getm locator id m locator id default loc getm locator id storage0 m storage get get ctx m locator id target getm product id 0 get trxname if storage0 null big decimal reserved env zero big decimal ordered env zero if target get qty reserved add storage0 get qty reserved signum 0 reserved target get qty reserved negative if target get qty ordered add storage0 get qty ordered signum 0 ordered target get qty ordered negative eliminate reservation if reserved signum 0 ordered signum 0 if m storage add get ctx target getm warehouse id target getm locator id target getm product id target getm attributesetinstance id target getm attributesetinstance id env zero reserved negate ordered negate get trxname if m storage add get ctx storage0 getm warehouse id storage0 getm locator id storage0 getm product id storage0 getm attributesetinstance id storage0 getm attributesetinstance id env zero reserved ordered get trxname log info reserved reserved ordered ordered else log warning failed storage0 update else log warning failed target update eliminatereservation mstorage getqtyreserved getqtyordered m_locator_id getm_locator_id mstorage mstorage getctx m_locator_id getm_product_id get_trxname mlocator defaultloc mlocator getdefault getctx m_locator_id m_locator_id defaultloc getm_locator_id m_locator_id defaultloc getm_locator_id mstorage getctx m_locator_id getm_product_id get_trxname bigdecimal bigdecimal getqtyreserved getqtyreserved getqtyreserved getqtyordered getqtyordered getqtyordered mstorage getctx getm_warehouse_id getm_locator_id getm_product_id getm_attributesetinstance_id getm_attributesetinstance_id get_trxname mstorage getctx getm_warehouse_id getm_locator_id getm_product_id getm_attributesetinstance_id getm_attributesetinstance_id get_trxname get storage sources param m product id product param m locator id locator return sources private m storage get sources int m product id int m locator id array list m storage list new array list m storage string sql select from m storage s where qty on hand 0 and m product id empty asi and m attributesetinstance id 0 or exists select from m attributesetinstance asi where s m attributesetinstance id asi m attributesetinstance id and asi description is null stock in same warehouse and exists select from m locator sl m locator x where s m locator id sl m locator id and x m locator id and sl m warehouse id x m warehouse id order by m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 m product id pstmt set int 2 m locator id result set rs pstmt execute query while rs next list add new m storage get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m storage ret value new m storage list size list to array ret value return ret value m_product_id m_locator_id mstorage getsources m_product_id m_locator_id arraylist mstorage arraylist mstorage m_storage qtyonhand m_product_id m_attributesetinstance_id m_attributesetinstance m_attributesetinstance_id m_attributesetinstance_id m_locator m_locator m_locator_id m_locator_id m_locator_id m_warehouse_id m_warehouse_id m_attributesetinstance_id preparedstatement preparestatement get_trxname setint m_product_id setint m_locator_id resultset executequery mstorage getctx get_trxname mstorage retvalue mstorage toarray retvalue retvalue standard constructor param ctx context param c payschedule id id public m pay schedule properties ctx int c payschedule id string trx name super ctx c payschedule id trx name if c payschedule id 0 setc paymentterm id 0 parent set percentage env zero set discount env zero set discount days 0 set grace days 0 set net days 0 set is valid false c_payschedule_id mpayschedule c_payschedule_id trxname c_payschedule_id trxname c_payschedule_id setc_paymentterm_id setpercentage setdiscount setdiscountdays setgracedays setnetdays setisvalid load constructor param ctx context param rs result set public m pay schedule properties ctx result set rs string trx name super ctx rs trx name mpayschedule resultset trxname trxname return returns the parent public m payment term get parent if m parent null m parent new m payment term get ctx getc paymentterm id get trxname return m parent mpaymentterm getparent m_parent m_parent mpaymentterm getctx getc_paymentterm_id get_trxname m_parent param parent the parent to set public void set parent m payment term parent m parent parent setparent mpaymentterm m_parent before save param new record new return true protected boolean before save boolean new record if is valuechanged percentage log fine before save set is valid false return true newrecord beforesave newrecord is_valuechanged beforesave setisvalid after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record is valuechanged percentage log fine after save get parent m parent validate m parent save return success newrecord aftersave newrecord newrecord is_valuechanged aftersave getparent m_parent m_parent get client document type with doc base type param ctx context param doc base type base document type return array of doc types static public m doc type get of doc base type properties ctx string doc base type array list m doc type list new array list m doc type string sql select from c doctype where ad client id and doc base type prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx pstmt set string 2 doc base type result set rs pstmt execute query while rs next list add new m doc type ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m doc type ret value new m doc type list size list to array ret value return ret value docbasetype docbasetype mdoctype getofdocbasetype docbasetype arraylist mdoctype arraylist mdoctype c_doctype ad_client_id docbasetype preparedstatement preparestatement setint getad_client_id setstring docbasetype resultset executequery mdoctype s_log mdoctype retvalue mdoctype toarray retvalue retvalue get client document types param ctx context return array of doc types static public m doc type get of client properties ctx array list m doc type list new array list m doc type string sql select from c doctype where ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next list add new m doc type ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m doc type ret value new m doc type list size list to array ret value return ret value mdoctype getofclient arraylist mdoctype arraylist mdoctype c_doctype ad_client_id preparedstatement preparestatement setint getad_client_id resultset executequery mdoctype s_log mdoctype retvalue mdoctype toarray retvalue retvalue get document type cached param ctx context param c doctype id id return document type static public m doc type get properties ctx int c doctype id integer key new integer c doctype id m doc type ret value m doc type s cache get key if ret value null ret value new m doc type ctx c doctype id null s cache put key ret value return ret value c_doctype_id mdoctype c_doctype_id c_doctype_id mdoctype retvalue mdoctype s_cache retvalue retvalue mdoctype c_doctype_id s_cache retvalue retvalue standard constructor param ctx context param c doctype id id public m doc type properties ctx int c doctype id string trx name super ctx c doctype id trx name if c doctype id 0 set name null set print name null set doc base type null setgl category id 0 set document copies 0 set has charges false set is default false set is doc no controlled false set isso trx false set is pickqa confirm false set is ship confirm false set is split when difference false set is create counter true set is default counter doc false c_doctype_id mdoctype c_doctype_id trxname c_doctype_id trxname c_doctype_id setname setprintname setdocbasetype setgl_category_id setdocumentcopies sethascharges setisdefault setisdocnocontrolled setissotrx setispickqaconfirm setisshipconfirm setissplitwhendifference setiscreatecounter setisdefaultcounterdoc load constructor param ctx context param rs result set public m doc type properties ctx result set rs string trx name super ctx rs trx name mdoctype resultset trxname trxname new constructor param ctx context param doc base type document base type param name name public m doc type properties ctx string doc base type string name string trx name this ctx 0 trx name setad org id 0 set doc base type doc base type set name name set print name name setgl category id docbasetype mdoctype docbasetype trxname trxname setad_org_id setdocbasetype docbasetype setname setprintname setgl_category_id set default gl category public void setgl category id string sql select from gl category where ad client id and is default y int gl category id db getsql value get trxname sql getad client id if gl category id 0 sql select from gl category where ad client id gl category id db getsql value get trxname sql getad client id setgl category id gl category id setgl_category_id gl_category ad_client_id isdefault gl_category_id getsqlvalue get_trxname getad_client_id gl_category_id gl_category ad_client_id gl_category_id getsqlvalue get_trxname getad_client_id setgl_category_id gl_category_id set so trx based on document base type public void set isso trx boolean isso trx docbasetype salesorder equals get doc base type docbasetype materialdelivery equals get doc base type get doc base type starts with ar super set isso trx isso trx sotrx setissotrx issotrx docbasetype_salesorder getdocbasetype docbasetype_materialdelivery getdocbasetype getdocbasetype startswith setissotrx issotrx string representation return info public string to string string buffer sb new string buffer m doc type sb append get id append append get name append docnosequence id append getdocnosequence id append return sb to string tostring stringbuffer stringbuffer mdoctype get_id getname docnosequence_id getdocnosequence_id tostring is this a quotation binding return true if quotation public boolean is quotation return docsubtypeso quotation equals get doc sub typeso docbasetype salesorder equals get doc base type isquotation docsubtypeso_quotation getdocsubtypeso docbasetype_salesorder getdocbasetype is this a proposal not binding return true if proposal public boolean is proposal return docsubtypeso proposal equals get doc sub typeso docbasetype salesorder equals get doc base type isproposal docsubtypeso_proposal getdocsubtypeso docbasetype_salesorder getdocbasetype is this a proposal or quotation return true if proposal or quotation public boolean is offer return docsubtypeso proposal equals get doc sub typeso docsubtypeso quotation equals get doc sub typeso docbasetype salesorder equals get doc base type isoffer docsubtypeso_proposal getdocsubtypeso docsubtypeso_quotation getdocsubtypeso docbasetype_salesorder getdocbasetype get print name return print name if available translated public string get print name string ad language if ad language null ad language length 0 return super get print name string ret value get translation print name ad language if ret value null return ret value return super get print name getprintname ad_language ad_language ad_language getprintname retvalue get_translation printname ad_language retvalue retvalue getprintname before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id load constructor param ctx context param ad replication id id public m replication properties ctx int ad replication id string trx name super ctx ad replication id trx name ad_replication_id mreplication ad_replication_id trxname ad_replication_id trxname public access param date last run date last run public void set date last run timestamp date last run super set date last run date last run datelastrun setdatelastrun datelastrun setdatelastrun datelastrun standard constructor public x i payment properties ctx int i payment id string trx name super ctx i payment id trx name if i payment id 0 seti isimported false seti payment id 0 x_i_payment i_payment_id trxname i_payment_id trxname i_payment_id seti_isimported seti_payment_id load constructor public x i payment properties ctx result set rs string trx name super ctx rs trx name x_i_payment resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i payment append get id append return sb to string tostring stringbuffer stringbuffer x_i_payment get_id tostring set account city city or the credit card or account holder public void seta city string a city if a city null a city length 60 log warning length 60 truncated a city a city substring 0 59 set value a city a city seta_city a_city a_city a_city a_city a_city set_value a_city a_city get account city city or the credit card or account holder public string geta city return string get value a city geta_city get_value a_city set account country country public void seta country string a country if a country null a country length 40 log warning length 40 truncated a country a country substring 0 39 set value a country a country seta_country a_country a_country a_country a_country a_country set_value a_country a_country get account country country public string geta country return string get value a country geta_country get_value a_country set account e mail email address public void seta email string a email if a email null a email length 60 log warning length 60 truncated a email a email substring 0 59 set value a email a email email seta_email a_email a_email a_email a_email a_email set_value a_email a_email get account e mail email address public string geta email return string get value a email email geta_email get_value a_email set driver license payment identification driver license public void seta ident dl string a ident dl if a ident dl null a ident dl length 20 log warning length 20 truncated a ident dl a ident dl substring 0 19 set value a ident dl a ident dl seta_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl set_value a_ident_dl a_ident_dl get driver license payment identification driver license public string geta ident dl return string get value a ident dl geta_ident_dl get_value a_ident_dl set social security no payment identification social security no public void seta ident ssn string a ident ssn if a ident ssn null a ident ssn length 20 log warning length 20 truncated a ident ssn a ident ssn substring 0 19 set value a ident ssn a ident ssn seta_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn set_value a_ident_ssn a_ident_ssn get social security no payment identification social security no public string geta ident ssn return string get value a ident ssn geta_ident_ssn get_value a_ident_ssn set account name name on credit card or account holder public void seta name string a name if a name null a name length 60 log warning length 60 truncated a name a name substring 0 59 set value a name a name seta_name a_name a_name a_name a_name a_name set_value a_name a_name get account name name on credit card or account holder public string geta name return string get value a name geta_name get_value a_name set account state state of the credit card or account holder public void seta state string a state if a state null a state length 40 log warning length 40 truncated a state a state substring 0 39 set value a state a state seta_state a_state a_state a_state a_state a_state set_value a_state a_state get account state state of the credit card or account holder public string geta state return string get value a state geta_state get_value a_state set account street street address of the credit card or account holder public void seta street string a street if a street null a street length 60 log warning length 60 truncated a street a street substring 0 59 set value a street a street seta_street a_street a_street a_street a_street a_street set_value a_street a_street get account street street address of the credit card or account holder public string geta street return string get value a street geta_street get_value a_street set account zip postal zip code of the credit card or account holder public void seta zip string a zip if a zip null a zip length 20 log warning length 20 truncated a zip a zip substring 0 19 set value a zip a zip seta_zip a_zip a_zip a_zip a_zip a_zip set_value a_zip a_zip get account zip postal zip code of the credit card or account holder public string geta zip return string get value a zip geta_zip get_value a_zip set account no account number public void set account no string account no if account no null account no length 20 log warning length 20 truncated account no account no substring 0 19 set value account no account no setaccountno accountno accountno accountno accountno accountno set_value accountno accountno get account no account number public string get account no return string get value account no getaccountno get_value accountno set business partner key key of the business partner public void setb partner value string b partner value if b partner value null b partner value length 40 log warning length 40 truncated b partner value b partner value substring 0 39 set value b partner value b partner value setbpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue set_value bpartnervalue bpartnervalue get business partner key key of the business partner public string getb partner value return string get value b partner value getbpartnervalue get_value bpartnervalue set bank account no bank account number public void set bank account no string bank account no if bank account no null bank account no length 20 log warning length 20 truncated bank account no bank account no substring 0 19 set value bank account no bank account no setbankaccountno bankaccountno bankaccountno bankaccountno bankaccountno bankaccountno set_value bankaccountno bankaccountno get bank account no bank account number public string get bank account no return string get value bank account no getbankaccountno get_value bankaccountno set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 0 set value c bankaccount id null else set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id set_value c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt set value charge amt charge amt setchargeamt bigdecimal chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set charge name name of the charge public void set charge name string charge name if charge name null charge name length 60 log warning length 60 truncated charge name charge name substring 0 59 set value charge name charge name setchargename chargename chargename chargename chargename chargename set_value chargename chargename get charge name name of the charge public string get charge name return string get value charge name getchargename get_value chargename set check no check number public void set check no string check no if check no null check no length 20 log warning length 20 truncated check no check no substring 0 19 set value check no check no setcheckno checkno checkno checkno checkno checkno set_value checkno checkno get check no check number public string get check no return string get value check no getcheckno get_value checkno set exp month expiry month public void set credit card expmm int credit card expmm set value credit card expmm new integer credit card expmm setcreditcardexpmm creditcardexpmm set_value creditcardexpmm creditcardexpmm get exp month expiry month public int get credit card expmm integer ii integer get value credit card expmm if ii null return 0 return ii int value getcreditcardexpmm get_value creditcardexpmm intvalue set exp year expiry year public void set credit card expyy int credit card expyy set value credit card expyy new integer credit card expyy setcreditcardexpyy creditcardexpyy set_value creditcardexpyy creditcardexpyy get exp year expiry year public int get credit card expyy integer ii integer get value credit card expyy if ii null return 0 return ii int value getcreditcardexpyy get_value creditcardexpyy intvalue set number credit card number public void set credit card number string credit card number if credit card number null credit card number length 20 log warning length 20 truncated credit card number credit card number substring 0 19 set value credit card number credit card number setcreditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber set_value creditcardnumber creditcardnumber get number credit card number public string get credit card number return string get value credit card number getcreditcardnumber get_value creditcardnumber public static final string creditcardtype visa v set credit card credit card visa mc am ex public void set credit card type string credit card type if credit card type null throw new illegal argument exception credit card type is mandatory if credit card type null credit card type equals a credit card type equals c credit card type equals d credit card type equals m credit card type equals n credit card type equals p credit card type equals v else throw new illegal argument exception credit card type invalid value credit card type reference id 149 a c d m n p v if credit card type null credit card type length 1 log warning length 1 truncated credit card type credit card type substring 0 0 set value credit card type credit card type creditcardtype_visa amex setcreditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype reference_id creditcardtype creditcardtype creditcardtype creditcardtype set_value creditcardtype creditcardtype get credit card credit card visa mc am ex public string get credit card type return string get value credit card type amex getcreditcardtype get_value creditcardtype set verification code credit card verification code on credit card public void set credit cardvv string credit cardvv if credit cardvv null credit cardvv length 4 log warning length 4 truncated credit cardvv credit cardvv substring 0 3 set value credit cardvv credit cardvv setcreditcardvv creditcardvv creditcardvv creditcardvv creditcardvv creditcardvv set_value creditcardvv creditcardvv get verification code credit card verification code on credit card public string get credit cardvv return string get value credit cardvv getcreditcardvv get_value creditcardvv set transaction date transaction date public void set date trx timestamp date trx set value date trx date trx setdatetrx datetrx set_value datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set discount amount calculated amount of discount public void set discount amt big decimal discount amt set value discount amt discount amt setdiscountamt bigdecimal discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set document type name name of the document type public void set doc type name string doc type name if doc type name null doc type name length 60 log warning length 60 truncated doc type name doc type name substring 0 59 set value doc type name doc type name setdoctypename doctypename doctypename doctypename doctypename doctypename set_value doctypename doctypename get document type name name of the document type public string get doc type name return string get value doc type name getdoctypename get_value doctypename set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set import payment import payment public void seti payment id int i payment id if i payment id 1 throw new illegal argument exception i payment id is mandatory set valuenocheck i payment id new integer i payment id seti_payment_id i_payment_id i_payment_id illegalargumentexception i_payment_id set_valuenocheck i_payment_id i_payment_id get import payment import payment public int geti payment id integer ii integer get value i payment id if ii null return 0 return ii int value geti_payment_id get_value i_payment_id intvalue set invoice document no document number of the invoice public void set invoice document no string invoice document no if invoice document no null invoice document no length 30 log warning length 30 truncated invoice document no invoice document no substring 0 29 set value invoice document no invoice document no setinvoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno set_value invoicedocumentno invoicedocumentno get invoice document no document number of the invoice public string get invoice document no return string get value invoice document no getinvoicedocumentno get_value invoicedocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set delayed capture charge after shipment public void set is delayed capture boolean is delayed capture set value is delayed capture new boolean is delayed capture setisdelayedcapture isdelayedcapture set_value isdelayedcapture isdelayedcapture get delayed capture charge after shipment public boolean is delayed capture object oo get value is delayed capture if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdelayedcapture get_value isdelayedcapture booleanvalue set over under payment over payment unallocated or under payment partial payment public void set is over under payment boolean is over under payment set value is over under payment new boolean is over under payment setisoverunderpayment isoverunderpayment set_value isoverunderpayment isoverunderpayment get over under payment over payment unallocated or under payment partial payment public boolean is over under payment object oo get value is over under payment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverunderpayment get_value isoverunderpayment booleanvalue set receipt this is a sales transaction receipt public void set is receipt boolean is receipt set value is receipt new boolean is receipt setisreceipt isreceipt set_value isreceipt isreceipt get receipt this is a sales transaction receipt public boolean is receipt object oo get value is receipt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreceipt get_value isreceipt booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set micr combination of routing no account and check no public void set micr string micr if micr null micr length 20 log warning length 20 truncated micr micr substring 0 19 set value micr micr setmicr set_value get micr combination of routing no account and check no public string get micr return string get value micr getmicr get_value set original transaction id original transaction id public void setorig trxid string orig trxid if orig trxid null orig trxid length 20 log warning length 20 truncated orig trxid orig trxid substring 0 19 set value orig trxid orig trxid setorig_trxid orig_trxid orig_trxid orig_trxid orig_trxid orig_trxid set_value orig_trxid orig_trxid get original transaction id original transaction id public string getorig trxid return string get value orig trxid getorig_trxid get_value orig_trxid set over under payment over payment unallocated or under payment partial payment amount public void set over under amt big decimal over under amt set value over under amt over under amt setoverunderamt bigdecimal overunderamt set_value overunderamt overunderamt get over under payment over payment unallocated or under payment partial payment amount public big decimal get over under amt big decimal bd big decimal get value over under amt if bd null return env zero return bd bigdecimal getoverunderamt bigdecimal bigdecimal get_value overunderamt set po number purchase order number public void setpo num string po num if po num null po num length 60 log warning length 60 truncated po num po num substring 0 59 set value po num po num setponum ponum ponum ponum ponum ponum set_value ponum ponum get po number purchase order number public string getpo num return string get value po num getponum get_value ponum set payment amount amount being paid public void set pay amt big decimal pay amt set value pay amt pay amt setpayamt bigdecimal payamt set_value payamt payamt get payment amount amount being paid public big decimal get pay amt big decimal bd big decimal get value pay amt if bd null return env zero return bd bigdecimal getpayamt bigdecimal bigdecimal get_value payamt set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set authorization code authorization code returned public void setr authcode string r authcode if r authcode null r authcode length 20 log warning length 20 truncated r authcode r authcode substring 0 19 set value r authcode r authcode setr_authcode r_authcode r_authcode r_authcode r_authcode r_authcode set_value r_authcode r_authcode get authorization code authorization code returned public string getr authcode return string get value r authcode getr_authcode get_value r_authcode set info response info public void setr info string r info if r info null r info length 2000 log warning length 2000 truncated r info r info substring 0 1999 set value r info r info setr_info r_info r_info r_info r_info r_info set_value r_info r_info get info response info public string getr info return string get value r info getr_info get_value r_info set reference payment reference public void setr pnref string r pnref if r pnref null r pnref length 20 log warning length 20 truncated r pnref r pnref substring 0 19 set value r pnref r pnref setr_pnref r_pnref r_pnref r_pnref r_pnref r_pnref set_value r_pnref r_pnref get reference payment reference public string getr pnref return string get value r pnref getr_pnref get_value r_pnref set response message response message public void setr respmsg string r respmsg if r respmsg null r respmsg length 60 log warning length 60 truncated r respmsg r respmsg substring 0 59 set value r respmsg r respmsg setr_respmsg r_respmsg r_respmsg r_respmsg r_respmsg r_respmsg set_value r_respmsg r_respmsg get response message response message public string getr respmsg return string get value r respmsg getr_respmsg get_value r_respmsg set result result of transmission public void setr result string r result if r result null r result length 20 log warning length 20 truncated r result r result substring 0 19 set value r result r result setr_result r_result r_result r_result r_result r_result set_value r_result r_result get result result of transmission public string getr result return string get value r result getr_result get_value r_result set routing no bank routing number public void set routing no string routing no if routing no null routing no length 20 log warning length 20 truncated routing no routing no substring 0 19 set value routing no routing no setroutingno routingno routingno routingno routingno routingno set_value routingno routingno get routing no bank routing number public string get routing no return string get value routing no getroutingno get_value routingno set swipe track 1 and 2 of the credit card public void set swipe string swipe if swipe null swipe length 80 log warning length 80 truncated swipe swipe substring 0 79 set value swipe swipe setswipe set_value get swipe track 1 and 2 of the credit card public string get swipe return string get value swipe getswipe get_value set tax amount tax amount for a document public void set tax amt big decimal tax amt set value tax amt tax amt settaxamt bigdecimal taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt public static final string tendertype check k set tender type method of payment public void set tender type string tender type if tender type null throw new illegal argument exception tender type is mandatory if tender type null tender type equals a tender type equals c tender type equals d tender type equals k else throw new illegal argument exception tender type invalid value tender type reference id 214 a c d k if tender type null tender type length 1 log warning length 1 truncated tender type tender type substring 0 0 set value tender type tender type tendertype_check settendertype tendertype tendertype illegalargumentexception tendertype tendertype tendertype tendertype tendertype tendertype illegalargumentexception tendertype tendertype reference_id tendertype tendertype tendertype tendertype set_value tendertype tendertype get tender type method of payment public string get tender type return string get value tender type gettendertype get_value tendertype public static final string trxtype void v set transaction type type of credit card transaction public void set trx type string trx type if trx type null throw new illegal argument exception trx type is mandatory if trx type null trx type equals a trx type equals c trx type equals d trx type equals f trx type equals s trx type equals v else throw new illegal argument exception trx type invalid value trx type reference id 215 a c d f s v if trx type null trx type length 1 log warning length 1 truncated trx type trx type substring 0 0 set value trx type trx type trxtype_void settrxtype trxtype trxtype illegalargumentexception trxtype trxtype trxtype trxtype trxtype trxtype trxtype trxtype illegalargumentexception trxtype trxtype reference_id trxtype trxtype trxtype trxtype set_value trxtype trxtype get transaction type type of credit card transaction public string get trx type return string get value trx type gettrxtype get_value trxtype set voice authorization code voice authorization code from credit card company public void set voice auth code string voice auth code if voice auth code null voice auth code length 20 log warning length 20 truncated voice auth code voice auth code substring 0 19 set value voice auth code voice auth code setvoiceauthcode voiceauthcode voiceauthcode voiceauthcode voiceauthcode voiceauthcode set_value voiceauthcode voiceauthcode get voice authorization code voice authorization code from credit card company public string get voice auth code return string get value voice auth code getvoiceauthcode get_value voiceauthcode set write off amount amount to write off public void set write off amt big decimal write off amt set value write off amt write off amt setwriteoffamt bigdecimal writeoffamt set_value writeoffamt writeoffamt get write off amount amount to write off public big decimal get write off amt big decimal bd big decimal get value write off amt if bd null return env zero return bd bigdecimal getwriteoffamt bigdecimal bigdecimal get_value writeoffamt get material allocations for line param ctx context param m inventoryline id line param trx name trx return allocations public static m inventory linema get properties ctx int m inventoryline id string trx name array list m inventory linema list new array list m inventory linema string sql select from m inventorylinema where m inventoryline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inventoryline id result set rs pstmt execute query while rs next list add new m inventory linema ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m inventory linema ret value new m inventory linema list size list to array ret value return ret value m_inventoryline_id trxname minventorylinema m_inventoryline_id trxname arraylist minventorylinema arraylist minventorylinema m_inventorylinema m_inventoryline_id preparedstatement preparestatement trxname setint m_inventoryline_id resultset executequery minventorylinema trxname s_log minventorylinema retvalue minventorylinema toarray retvalue retvalue delete all material allocation for inventory param m inventory id inventory return number of rows deleted or 1 for error public static int delete inventoryma int m inventory id string trx name string sql delete from m inventorylinema ma where exists select from m inventoryline l where l m inventoryline id ma m inventoryline id and m inventory id m inventory id return db execute update sql trx name m_inventory_id deleteinventoryma m_inventory_id trxname m_inventorylinema m_inventoryline m_inventoryline_id m_inventoryline_id m_inventory_id m_inventory_id executeupdate trxname standard constructor param ctx context param m inventorylinema id ignored param trx name trx public m inventory linema properties ctx int m inventorylinema id string trx name super ctx m inventorylinema id trx name if m inventorylinema id 0 throw new illegal argument exception multi key m_inventorylinema_id trxname minventorylinema m_inventorylinema_id trxname m_inventorylinema_id trxname m_inventorylinema_id illegalargumentexception load cosntructor param ctx context param rs result set param trx name trx public m inventory linema properties ctx result set rs string trx name super ctx rs trx name trxname minventorylinema resultset trxname trxname parent constructor param parent parent param m attributesetinstance id asi param movement qty qty public m inventory linema m inventory line parent int m attributesetinstance id big decimal movement qty this parent get ctx 0 parent get trxname set client org parent setm inventoryline id parent getm inventoryline id setm attributesetinstance id m attributesetinstance id set movement qty movement qty m_attributesetinstance_id movementqty minventorylinema minventoryline m_attributesetinstance_id bigdecimal movementqty getctx get_trxname setclientorg setm_inventoryline_id getm_inventoryline_id setm_attributesetinstance_id m_attributesetinstance_id setmovementqty movementqty string representation return info public string to string string buffer sb new string buffer m inventory linema sb append m inventoryline id append getm inventoryline id append m attributesetinstance id append getm attributesetinstance id append qty append get movement qty append return sb to string tostring stringbuffer stringbuffer minventorylinema m_inventoryline_id getm_inventoryline_id m_attributesetinstance_id getm_attributesetinstance_id getmovementqty tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad org id p ad org id big decimal para i get parameter int value else if name equals m warehouse id p m warehouse id big decimal para i get parameter int value else if name equals m product category id p m product category id big decimal para i get parameter int value else if name equals m product id p m product id big decimal para i get parameter int value else if name equals c bp group id p c bp group id big decimal para i get parameter int value else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter ad_org_id p_ad_org_id bigdecimal getparameter intvalue m_warehouse_id p_m_warehouse_id bigdecimal getparameter intvalue m_product_category_id p_m_product_category_id bigdecimal getparameter intvalue m_product_id p_m_product_id bigdecimal getparameter intvalue c_bp_group_id p_c_bp_group_id bigdecimal getparameter intvalue c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue perform process return message clear text throws exception if not successful protected string do it throws exception log info do it ad org id p ad org id if p ad org id 0 throw new illegal argument exception org ownership invalid ad org id p ad org id general ownership if p m warehouse id 0 return warehouse ownership if p m product id 0 p m product category id 0 return product ownership if p c bpartner id 0 p c bp group id 0 return b partner ownership return not supported doit doit ad_org_id p_ad_org_id p_ad_org_id illegalargumentexception orgownership ad_org_id p_ad_org_id generalownership p_m_warehouse_id warehouseownership p_m_product_id p_m_product_category_id productownership p_c_bpartner_id p_c_bp_group_id bpartnerownership set warehouse ownership return private string warehouse ownership log info warehouse ownership m warehouse id p m warehouse id if p ad org id 0 throw new illegal argument exception warehouse org cannot be 0 set warehouse string buffer sql new string buffer sql append update m warehouse set ad org id append p ad org id append where m warehouse id append p m warehouse id append and ad client id append getad client id append and ad org id append p ad org id int no db execute update sql to string get trxname add log 0 null new big decimal no msg translate get ctx m warehouse id set accounts sql new string buffer sql append update m warehouse acct set ad org id append p ad org id append where m warehouse id append p m warehouse id append and ad client id append getad client id append and ad org id append p ad org id no db execute update sql to string get trxname add log 0 null new big decimal no msg translate get ctx c acctschema id set locators sql new string buffer sql append update m locator set ad org id append p ad org id append where m warehouse id append p m warehouse id append and ad client id append getad client id append and ad org id append p ad org id no db execute update sql to string get trxname add log 0 null new big decimal no msg translate get ctx m locator id set storage sql new string buffer sql append update m storage s set ad org id append p ad org id append where exists select from m locator l where l m locator id s m locator id and l m warehouse id append p m warehouse id append and ad client id append getad client id append and ad org id append p ad org id no db execute update sql to string get trxname add log 0 null new big decimal no msg translate get ctx storage return warehouseownership warehouseownership m_warehouse_id p_m_warehouse_id p_ad_org_id illegalargumentexception stringbuffer stringbuffer m_warehouse ad_org_id p_ad_org_id m_warehouse_id p_m_warehouse_id ad_client_id getad_client_id ad_org_id p_ad_org_id executeupdate tostring get_trxname addlog bigdecimal getctx m_warehouse_id stringbuffer m_warehouse_acct ad_org_id p_ad_org_id m_warehouse_id p_m_warehouse_id ad_client_id getad_client_id ad_org_id p_ad_org_id executeupdate tostring get_trxname addlog bigdecimal getctx c_acctschema_id stringbuffer m_locator ad_org_id p_ad_org_id m_warehouse_id p_m_warehouse_id ad_client_id getad_client_id ad_org_id p_ad_org_id executeupdate tostring get_trxname addlog bigdecimal getctx m_locator_id stringbuffer m_storage ad_org_id p_ad_org_id m_locator m_locator_id m_locator_id m_warehouse_id p_m_warehouse_id ad_client_id getad_client_id ad_org_id p_ad_org_id executeupdate tostring get_trxname addlog bigdecimal getctx product ownership return private string product ownership log info product ownership m product category id p m product category id m product id p m product id string set set ad org id p ad org id if p m product category id 0 set where exists select from m product p where p m product id x m product id and p m product category id p m product category id else set where m product id p m product id set and ad client id getad client id and ad org id p ad org id log fine product ownership set product string sql update m product x set int no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx m product id acct sql update m product acct x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c acctschema id bom sql update m product bom x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx m product bom id po sql update m product po x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx po trl sql update m product trl x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx ad language return productownership productownership m_product_category_id p_m_product_category_id m_product_id p_m_product_id ad_org_id p_ad_org_id p_m_product_category_id m_product m_product_id m_product_id m_product_category_id p_m_product_category_id m_product_id p_m_product_id ad_client_id getad_client_id ad_org_id p_ad_org_id productownership m_product executeupdate get_trxname addlog bigdecimal getctx m_product_id m_product_acct executeupdate get_trxname addlog bigdecimal getctx c_acctschema_id m_product_bom executeupdate get_trxname addlog bigdecimal getctx m_product_bom_id m_product_po executeupdate get_trxname addlog bigdecimal getctx m_product_trl executeupdate get_trxname addlog bigdecimal getctx ad_language business partner ownership return private string b partner ownership log info b partner ownership c bp group id p c bp group id c bpartner id p c bpartner id string set set ad org id p ad org id if p c bp group id 0 set where exists select from c bpartner bp where bp c bpartner id x c bpartner id and bp c bp group id p c bp group id else set where c bpartner id p c bpartner id set and ad client id getad client id and ad org id p ad org id log fine b partner ownership set b partner string sql update c bpartner x set int no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c bpartner id acct xxx sql update c bp customer acct x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c acctschema id sql update c bp employee acct x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c acctschema id sql update c bp vendor acct x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c acctschema id location sql update c bpartner location x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c bpartner location id contcat user sql update ad user x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx ad user id bank acct sql update c bp bankaccount x set no db execute update sql get trxname add log 0 null new big decimal no msg translate get ctx c bp bankaccount id return bpartnerownership bpartnerownership c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id ad_org_id p_ad_org_id p_c_bp_group_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id ad_client_id getad_client_id ad_org_id p_ad_org_id bpartnerownership bpartner c_bpartner executeupdate get_trxname addlog bigdecimal getctx c_bpartner_id c_bp_customer_acct executeupdate get_trxname addlog bigdecimal getctx c_acctschema_id c_bp_employee_acct executeupdate get_trxname addlog bigdecimal getctx c_acctschema_id c_bp_vendor_acct executeupdate get_trxname addlog bigdecimal getctx c_acctschema_id c_bpartner_location executeupdate get_trxname addlog bigdecimal getctx c_bpartner_location_id ad_user executeupdate get_trxname addlog bigdecimal getctx ad_user_id bankacct c_bp_bankaccount executeupdate get_trxname addlog bigdecimal getctx c_bp_bankaccount_id set general ownership i e org to 0 in general for items with two parents private void general ownership string set set ad org id 0 where ad client id getad client id and ad org id 0 r contactinterest string sql update r contactinterest set int no db execute update sql get trxname if no 0 log fine general ownership r contactinterest no ad user roles sql update ad user roles set no db execute update sql get trxname if no 0 log fine general ownership ad user roles no c bpartner product sql update c bpartner product set no db execute update sql get trxname if no 0 log fine general ownership c bpartner product no withholding sql update c bp withholding x set no db execute update sql get trxname if no 0 log fine general ownership c bp withholding no costing sql update m product costing set no db execute update sql get trxname if no 0 log fine general ownership m product costing no replenish sql update m replenish set no db execute update sql get trxname if no 0 log fine general ownership m replenish no generalownership ad_org_id ad_client_id getad_client_id ad_org_id r_contactinterest r_contactinterest executeupdate get_trxname generalownership r_contactinterest ad_user_roles ad_user_roles executeupdate get_trxname generalownership ad_user_roles c_bpartner_product c_bpartner_product executeupdate get_trxname generalownership c_bpartner_product c_bp_withholding executeupdate get_trxname generalownership c_bp_withholding m_product_costing executeupdate get_trxname generalownership m_product_costing m_replenish executeupdate get_trxname generalownership m_replenish standard constructor public x c payselectioncheck properties ctx int c payselectioncheck id string trx name super ctx c payselectioncheck id trx name if c payselectioncheck id 0 setc bpartner id 0 setc payselectioncheck id 0 setc payselection id 0 set discount amt env zero set is printed false set is receipt false set pay amt env zero set payment rule null set processed false n set qty 0 x_c_payselectioncheck c_payselectioncheck_id trxname c_payselectioncheck_id trxname c_payselectioncheck_id setc_bpartner_id setc_payselectioncheck_id setc_payselection_id setdiscountamt setisprinted setisreceipt setpayamt setpaymentrule setprocessed setqty load constructor public x c payselectioncheck properties ctx result set rs string trx name super ctx rs trx name x_c_payselectioncheck resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c payselectioncheck append get id append return sb to string tostring stringbuffer stringbuffer x_c_payselectioncheck get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set pay selection check payment selection check public void setc payselectioncheck id int c payselectioncheck id if c payselectioncheck id 1 throw new illegal argument exception c payselectioncheck id is mandatory set valuenocheck c payselectioncheck id new integer c payselectioncheck id setc_payselectioncheck_id c_payselectioncheck_id c_payselectioncheck_id illegalargumentexception c_payselectioncheck_id set_valuenocheck c_payselectioncheck_id c_payselectioncheck_id get pay selection check payment selection check public int getc payselectioncheck id integer ii integer get value c payselectioncheck id if ii null return 0 return ii int value getc_payselectioncheck_id get_value c_payselectioncheck_id intvalue set payment selection payment selection public void setc payselection id int c payselection id if c payselection id 1 throw new illegal argument exception c payselection id is mandatory set valuenocheck c payselection id new integer c payselection id setc_payselection_id c_payselection_id c_payselection_id illegalargumentexception c_payselection_id set_valuenocheck c_payselection_id c_payselection_id get payment selection payment selection public int getc payselection id integer ii integer get value c payselection id if ii null return 0 return ii int value getc_payselection_id get_value c_payselection_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set discount amount calculated amount of discount public void set discount amt big decimal discount amt if discount amt null throw new illegal argument exception discount amt is mandatory set value discount amt discount amt setdiscountamt bigdecimal discountamt discountamt illegalargumentexception discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set printed indicates if this document line is printed public void set is printed boolean is printed set value is printed new boolean is printed setisprinted isprinted set_value isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set receipt this is a sales transaction receipt public void set is receipt boolean is receipt set value is receipt new boolean is receipt setisreceipt isreceipt set_value isreceipt isreceipt get receipt this is a sales transaction receipt public boolean is receipt object oo get value is receipt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreceipt get_value isreceipt booleanvalue set payment amount amount being paid public void set pay amt big decimal pay amt if pay amt null throw new illegal argument exception pay amt is mandatory set value pay amt pay amt setpayamt bigdecimal payamt payamt illegalargumentexception payamt set_value payamt payamt get payment amount amount being paid public big decimal get pay amt big decimal bd big decimal get value pay amt if bd null return env zero return bd bigdecimal getpayamt bigdecimal bigdecimal get_value payamt public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty int qty set value qty new integer qty setqty set_value get quantity quantity public int get qty integer ii integer get value qty if ii null return 0 return ii int value getqty get_value intvalue basic constructor public s basic constructor param element adds an element to the element public s element element add element element addelement basic constructor param element adds an element to the element public s string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public s add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public s add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public s add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public s add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public s remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param frame frame param modal modal param window no window no param m warehouse id warehouse param m pricelist id price list param value query value or name if enclosed in param multi selection multiple selections param where clause where clause public info product frame frame boolean modal int window no int m warehouse id int m pricelist id string value boolean multi selection string where clause super frame modal window no p m product id multi selection where clause log info value wh m warehouse id pl m pricelist id where where clause set title msg get msg env get ctx info product stat init init info value m warehouse id m pricelist id m c bpartner id env get context as int env get ctx window no c bpartner id int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no auto query if value null value length 0 execute query p loadedok true focus field value request focus a env position center window frame this windowno m_warehouse_id m_pricelist_id multiselection whereclause infoproduct windowno m_warehouse_id m_pricelist_id multiselection whereclause windowno m_product_id multiselection whereclause m_warehouse_id m_pricelist_id whereclause settitle getmsg getctx infoproduct statinit initinfo m_warehouse_id m_pricelist_id m_c_bpartner_id getcontextasint getctx windowno c_bpartner_id p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring autoquery executequery p_loadedok fieldvalue requestfocus aenv positioncenterwindow static setup add fields to parameter panel private void stat init label value set text msg get msg env get ctx value field value set background compiereplaf get info background field value add action listener this label name set text msg get msg env get ctx name field name set background compiereplaf get info background field name add action listener this labelupc set text msg translate env get ctx upc fieldupc set background compiereplaf get info background fieldupc add action listener this labelsku set text msg translate env get ctx sku fieldsku set background compiereplaf get info background fieldsku add action listener this label warehouse set text msg get msg env get ctx warehouse pick warehouse set background compiereplaf get info background label price list set text msg get msg env get ctx price list version pick price list set background compiereplaf get info background m infopattributebutton set margin new insets 2 2 2 2 m infopattributebutton set tool tip text msg get msg env get ctx infop attribute m infopattributebutton add action listener this line 1 parameter panel set layout new a layout parameter panel add label value new a layout constraint 0 0 parameter panel add field value null parameter panel add labelupc null parameter panel add fieldupc null parameter panel add label warehouse null parameter panel add pick warehouse null parameter panel add m infopattributebutton line 2 parameter panel add label name new a layout constraint 1 0 parameter panel add field name null parameter panel add labelsku null parameter panel add fieldsku null parameter panel add label price list null parameter panel add pick price list null product attribute instance m pattributebutton confirm panel createp attribute button true confirm panel add button m pattributebutton m pattributebutton add action listener this m pattributebutton set enabled false parameterpanel statinit labelvalue settext getmsg getctx fieldvalue setbackground getinfobackground fieldvalue addactionlistener labelname settext getmsg getctx fieldname setbackground getinfobackground fieldname addactionlistener settext getctx setbackground getinfobackground addactionlistener settext getctx setbackground getinfobackground addactionlistener labelwarehouse settext getmsg getctx pickwarehouse setbackground getinfobackground labelpricelist settext getmsg getctx pricelistversion pickpricelist setbackground getinfobackground m_infopattributebutton setmargin m_infopattributebutton settooltiptext getmsg getctx infopattribute m_infopattributebutton addactionlistener parameterpanel setlayout alayout parameterpanel labelvalue alayoutconstraint parameterpanel fieldvalue parameterpanel parameterpanel parameterpanel labelwarehouse parameterpanel pickwarehouse parameterpanel m_infopattributebutton parameterpanel labelname alayoutconstraint parameterpanel fieldname parameterpanel parameterpanel parameterpanel labelpricelist parameterpanel pickpricelist m_pattributebutton confirmpanel createpattributebutton confirmpanel addbutton m_pattributebutton m_pattributebutton addactionlistener m_pattributebutton setenabled dynamic init param value value param m warehouse id warehouse param m pricelist id price list private void init info string value int m warehouse id int m pricelist id pick init fill picks m pricelist id int m pricelist version id findplv m pricelist id set value or name if value starts with value ends with field name set text value substring 1 value length 1 else field value set text value set warehouse if m warehouse id 0 m warehouse id env get context as int env get ctx m warehouse id if m warehouse id 0 set warehouse m warehouse id set price list version if m pricelist version id 0 set price list version m pricelist version id create grid string buffer where new string buffer where append p is active y if m warehouse id 0 where append and p is summary n dynamic where clause if p whereclause null p whereclause length 0 where append and replace fully qalified name with alias append util replace p whereclause m product p prepare table get product layout s productfrom where to string qty available desc margin desc pick warehouse add action listener this pick price list add action listener this m_warehouse_id m_pricelist_id initinfo m_warehouse_id m_pricelist_id fillpicks m_pricelist_id m_pricelist_version_id m_pricelist_id startswith endswith fieldname settext fieldvalue settext m_warehouse_id m_warehouse_id getcontextasint getctx m_warehouse_id m_warehouse_id setwarehouse m_warehouse_id pricelist m_pricelist_version_id setpricelistversion m_pricelist_version_id stringbuffer stringbuffer isactive m_warehouse_id issummary p_whereclause p_whereclause p_whereclause m_product preparetable getproductlayout s_productfrom tostring qtyavailable pickwarehouse addactionlistener pickpricelist addactionlistener fill picks with values param m pricelist id price list private void fill picks int m pricelist id price list string sql select m pricelist version m pricelist version id m pricelist version name c iso code as value name from m pricelist version m pricelist pl c currency c where m pricelist version m pricelist id pl m pricelist id and pl c currency id c c currency id and m pricelist version is active y and pl is active y same pl currency as original one if m pricelist id 0 sql and exists select from m pricelist xp where xp m pricelist id m pricelist id and pl c currency id xp c currency id add access order sql m role get default add accesssql sql m pricelist version true false fully qualidfied ro order by m pricelist version name try pick price list add item new key name pair 0 prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next key name pair kn new key name pair rs get int 1 rs get string 2 pick price list add item kn rs close pstmt close warehouse sql m role get default add accesssql select m warehouse id value name as value name from m warehouse where is active y m warehouse m role sql notqualified m role sql ro order by value pick warehouse add item new key name pair 0 pstmt db prepare statement sql null rs pstmt execute query while rs next key name pair kn new key name pair rs get int m warehouse id rs get string value name pick warehouse add item kn rs close pstmt close catch sql exception e log log level severe sql e set status line e get localized message true m_pricelist_id fillpicks m_pricelist_id m_pricelist_version m_pricelist_version_id m_pricelist_version iso_code valuename m_pricelist_version m_pricelist c_currency m_pricelist_version m_pricelist_id m_pricelist_id c_currency_id c_currency_id m_pricelist_version isactive isactive m_pricelist_id m_pricelist m_pricelist_id m_pricelist_id c_currency_id c_currency_id mrole getdefault addaccesssql m_pricelist_version m_pricelist_version pickpricelist additem keynamepair preparedstatement preparestatement resultset executequery keynamepair keynamepair getint getstring pickpricelist additem mrole getdefault addaccesssql m_warehouse_id valuename m_warehouse isactive m_warehouse mrole sql_notqualified mrole sql_ro pickwarehouse additem keynamepair preparestatement executequery keynamepair keynamepair getint m_warehouse_id getstring valuename pickwarehouse additem sqlexception setstatusline getlocalizedmessage set warehouse param m warehouse id warehouse private void set warehouse int m warehouse id for int i 0 i pick warehouse get item count i key name pair kn key name pair pick warehouse get item at i if kn get key m warehouse id pick warehouse set selected index i return m_warehouse_id setwarehouse m_warehouse_id pickwarehouse getitemcount keynamepair keynamepair pickwarehouse getitemat getkey m_warehouse_id pickwarehouse setselectedindex set price list param m pricelist version id price list private void set price list version int m pricelist version id log config m pricelist version id m pricelist version id for int i 0 i pick price list get item count i key name pair kn key name pair pick price list get item at i if kn get key m pricelist version id pick price list set selected index i return log fine not found pricelist m_pricelist_version_id setpricelistversion m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id pickpricelist getitemcount keynamepair keynamepair pickpricelist getitemat getkey m_pricelist_version_id pickpricelist setselectedindex find price list version and update context param m pricelist id price list return m pricelist version id price list version private int findplv int m pricelist id timestamp price date null sales order date string date str env get context env get ctx p windowno date ordered if date str null date str length 0 price date env get context as date env get ctx p windowno date ordered else invoice date date str env get context env get ctx p windowno date invoiced if date str null date str length 0 price date env get context as date env get ctx p windowno date invoiced today if price date null price date new timestamp system current time millis log config m pricelist id m pricelist id price date int ret value 0 string sql select plv m pricelist version id plv valid from from m pricelist pl m pricelist version plv where pl m pricelist id plv m pricelist id and plv is active y and pl m pricelist id 1 order by plv valid from desc find newest one try prepared statement pstmt db prepare statement sql null pstmt set int 1 m pricelist id result set rs pstmt execute query while rs next ret value 0 timestamp pl date rs get timestamp 2 if price date before pl date ret value rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e env set context env get ctx p windowno m pricelist version id ret value return ret value m_pricelist_id m_pricelist_version_id m_pricelist_id pricedate datestr getcontext getctx p_windowno dateordered datestr datestr pricedate getcontextasdate getctx p_windowno dateordered datestr getcontext getctx p_windowno dateinvoiced datestr datestr pricedate getcontextasdate getctx p_windowno dateinvoiced pricedate pricedate currenttimemillis m_pricelist_id m_pricelist_id pricedate retvalue m_pricelist_version_id validfrom m_pricelist m_pricelist_version m_pricelist_id m_pricelist_id isactive m_pricelist_id validfrom preparedstatement preparestatement setint m_pricelist_id resultset executequery retvalue pldate gettimestamp pricedate pldate retvalue getint sqlexception setcontext getctx p_windowno m_pricelist_version_id retvalue retvalue construct sql where clause and define parameters set parameters needs to set parameters includes first and return sql where clause string getsql where string buffer where new string buffer optional plv int m pricelist version id 0 key name pair pl key name pair pick price list get selected item if pl null m pricelist version id pl get key if m pricelist version id 0 where append and pr m pricelist version id product attribute search if m pattributewhere null where append m pattributewhere return where to string value string value field value get text to upper case if value equals value equals where append and upper p value like name string name field name get text to upper case if name equals name equals where append and upper p name like upc string upc fieldupc get text to upper case if upc equals upc equals where append and upper p upc like sku string sku fieldsku get text to upper case if sku equals sku equals where append and upper p sku like return where to string setparameters getsqlwhere stringbuffer stringbuffer m_pricelist_version_id keynamepair keynamepair pickpricelist getselecteditem m_pricelist_version_id getkey m_pricelist_version_id m_pricelist_version_id m_pattributewhere m_pattributewhere tostring fieldvalue gettext touppercase fieldname gettext touppercase gettext touppercase gettext touppercase tostring set parameters for query as defined in getsql where param pstmt pstmt param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 warehouse int m warehouse id 0 key name pair wh key name pair pick warehouse get selected item if wh null m warehouse id wh get key if for count parameters in select for int i 0 i p layout length i if p layout i get colsql index of 1 pstmt set int index m warehouse id log fine m warehouse id m warehouse id index 1 price list int m pricelist version id 0 key name pair pl key name pair pick price list get selected item if pl null m pricelist version id pl get key if m pricelist version id 0 pstmt set int index m pricelist version id log fine m pricelist version id m pricelist version id rest of parameter in query for attribute search if m pattributewhere null return value string value field value get text to upper case if value equals value equals if value ends with value pstmt set string index value log fine value value name string name field name get text to upper case if name equals name equals if name ends with name pstmt set string index name log fine name name upc string upc fieldupc get text to upper case if upc equals upc equals if upc ends with upc pstmt set string index upc log fine upc upc sku string sku fieldsku get text to upper case if sku equals sku equals if sku ends with sku pstmt set string index sku log fine sku sku getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception m_warehouse_id keynamepair keynamepair pickwarehouse getselecteditem m_warehouse_id getkey forcount p_layout p_layout getcolsql indexof setint m_warehouse_id m_warehouse_id m_warehouse_id pricelist m_pricelist_version_id keynamepair keynamepair pickpricelist getselecteditem m_pricelist_version_id getkey m_pricelist_version_id setint m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pattributewhere fieldvalue gettext touppercase endswith setstring fieldname gettext touppercase endswith setstring gettext touppercase endswith setstring gettext touppercase endswith setstring action listner param e event public void action performed action event e don t requery if field value and field name are empty if e get source pick warehouse e get source pick price list field value get text length 0 field name get text length 0 return product attribute search if e get source equals m infopattributebutton cmd infopattribute return m pattributewhere null query product attribure instance int row p table get selected row if e get source equals m pattributebutton row 1 integer product integer get selected row key string product name string p table get value at row index name key name pair warehouse key name pair pick warehouse get selected item if product integer null product integer int value 0 warehouse null return string title warehouse get name product name p attribute instance pai new p attribute instance this title warehouse get key 0 product integer int value m c bpartner id m m attributesetinstance id pai getm attributesetinstance id if m m attributesetinstance id 1 dispose true return super action performed e actionperformed actionevent fieldvalue fieldname getsource pickwarehouse getsource pickpricelist fieldvalue gettext fieldname gettext getsource m_infopattributebutton cmd_infopattribute m_pattributewhere p_table getselectedrow getsource m_pattributebutton productinteger getselectedrowkey productname p_table getvalueat index_name keynamepair keynamepair pickwarehouse getselecteditem productinteger productinteger intvalue getname productname pattributeinstance pattributeinstance getkey productinteger intvalue m_c_bpartner_id m_m_attributesetinstance_id getm_attributesetinstance_id m_m_attributesetinstance_id actionperformed enable p attribute if row selected changed void enable buttons m m attributesetinstance id 1 if m pattributebutton null int row p table get selected row boolean enabled false if row 0 object value p table get value at row index pattribute enabled boolean true equals value m pattributebutton set enabled enabled super enable buttons pattribute enablebuttons m_m_attributesetinstance_id m_pattributebutton p_table getselectedrow p_table getvalueat index_pattribute m_pattributebutton setenabled enablebuttons query per product attribute code available synonyms m product p m productprice pr m attributeset pa code private void cmd infopattribute infop attribute ia new infop attribute this m pattributewhere ia get where clause if m pattributewhere null execute query m_product m_productprice m_attributeset cmd_infopattribute infopattribute infopattribute m_pattributewhere getwhereclause m_pattributewhere executequery show history void show history log info integer m product id get selected row key if m product id null return key name pair kn key name pair pick warehouse get selected item int m warehouse id kn get key int m attributesetinstance id m m attributesetinstance id if m m attributesetinstance id 1 not selected m attributesetinstance id 0 invoice history ih new invoice history this 0 m product id int value m warehouse id m attributesetinstance id ih set visible true ih null showhistory m_product_id getselectedrowkey m_product_id keynamepair keynamepair pickwarehouse getselecteditem m_warehouse_id getkey m_attributesetinstance_id m_m_attributesetinstance_id m_m_attributesetinstance_id m_attributesetinstance_id invoicehistory invoicehistory m_product_id intvalue m_warehouse_id m_attributesetinstance_id setvisible has history return true has history boolean has history return true hashistory zoom void zoom log info integer m product id get selected row key if m product id null return a env zoom m product table id m product id int value true so m query query new m query m product query add restriction m product id m query equal m product id query set record count 1 int ad windowno getad window id m product true so zoom ad windowno query m_product_id getselectedrowkey m_product_id aenv mproduct table_id m_product_id intvalue mquery mquery m_product addrestriction m_product_id mquery m_product_id setrecordcount ad_windowno getad_window_id m_product ad_windowno has zoom return has zoom boolean has zoom return true haszoom customize void customize log info has customize return false no customize boolean has customize return false for now hascustomize save selection settings for price list void save selection detail publish for callout to read integer id get selected row key env set context env get ctx env window info env tab info m product id id null 0 id to string key name pair kn key name pair pick price list get selected item env set context env get ctx env window info env tab info m pricelist version id kn getid kn key name pair pick warehouse get selected item env set context env get ctx env window info env tab info m warehouse id kn getid if m m attributesetinstance id 1 not selected env set context env get ctx env window info env tab info m attributesetinstance id 0 else env set context env get ctx env window info env tab info m attributesetinstance id string value of m m attributesetinstance id pricelist saveselectiondetail getselectedrowkey setcontext getctx window_info tab_info m_product_id tostring keynamepair keynamepair pickpricelist getselecteditem setcontext getctx window_info tab_info m_pricelist_version_id keynamepair pickwarehouse getselecteditem setcontext getctx window_info tab_info m_warehouse_id m_m_attributesetinstance_id setcontext getctx window_info tab_info m_attributesetinstance_id setcontext getctx window_info tab_info m_attributesetinstance_id valueof m_m_attributesetinstance_id get product layout return array of column info private info column get product layout if s productlayout null return s productlayout euro 13 m client client m client get env get ctx if frie equals client get value final info column frie layout new info column p m product id id column class new info column msg translate env get ctx value p value string class new info column msg translate env get ctx name p name string class new info column msg translate env get ctx qty available bom qty available p m product id 0 as qty available double class true true null new info column msg translate env get ctx price list bom price list p m product id pr m pricelist version id as price list big decimal class new info column msg translate env get ctx price std bom price std p m product id pr m pricelist version id as price std big decimal class new info column einzel mw st pr price std 1 16 big decimal class new info column einzel kompl pr price std 13 1 16 big decimal class new info column satz kompl pr price std 13 1 16 4 big decimal class new info column msg translate env get ctx qty on hand bom qty on hand p m product id 0 as qty on hand double class new info column msg translate env get ctx qty reserved bom qty reserved p m product id 0 as qty reserved double class new info column msg translate env get ctx qty ordered bom qty ordered p m product id 0 as qty ordered double class new info column msg translate env get ctx discontinued substring 0 1 p discontinued boolean class new info column msg translate env get ctx margin bom price std p m product id pr m pricelist version id bom price limit p m product id pr m pricelist version id as margin big decimal class new info column msg translate env get ctx price limit bom price limit p m product id pr m pricelist version id as price limit big decimal class new info column msg translate env get ctx is instance attribute pa is instance attribute boolean class index name 2 index pattribute frie layout length 1 last item s productlayout frie layout return s productlayout if s productlayout null array list info column list new array list info column list add new info column p m product id id column class list add new info column msg translate env get ctx discontinued substring 0 1 p discontinued boolean class list add new info column msg translate env get ctx value p value string class list add new info column msg translate env get ctx name p name string class list add new info column msg translate env get ctx qty available bom qty available p m product id 0 as qty available double class true true null list add new info column msg translate env get ctx price list bom price list p m product id pr m pricelist version id as price list big decimal class list add new info column msg translate env get ctx price std bom price std p m product id pr m pricelist version id as price std big decimal class list add new info column msg translate env get ctx qty on hand bom qty on hand p m product id 0 as qty on hand double class list add new info column msg translate env get ctx qty reserved bom qty reserved p m product id 0 as qty reserved double class list add new info column msg translate env get ctx qty ordered bom qty ordered p m product id 0 as qty ordered double class if is unconfirmed list add new info column msg translate env get ctx qty unconfirmed select sum c target qty from m inoutlineconfirm c inner join m inoutline il on c m inoutline id il m inoutline id inner join m inout i on il m inout id i m inout id where c processed n and i m warehouse id and il m product id p m product id as qty unconfirmed double class list add new info column msg translate env get ctx qty unconfirmed move select sum c target qty from m movementlineconfirm c inner join m movementline ml on c m movementline id ml m movementline id inner join m locator l on ml m locatorto id l m locator id where c processed n and l m warehouse id and ml m product id p m product id as qty unconfirmed move double class list add new info column msg translate env get ctx margin bom price std p m product id pr m pricelist version id bom price limit p m product id pr m pricelist version id as margin big decimal class list add new info column msg translate env get ctx price limit bom price limit p m product id pr m pricelist version id as price limit big decimal class list add new info column msg translate env get ctx is instance attribute pa is instance attribute boolean class s productlayout new info column list size list to array s productlayout index name 3 index pattribute s productlayout length 1 last item return s productlayout column_info info_column getproductlayout s_productlayout s_productlayout mclient mclient getctx getvalue info_column frielayout info_column m_product_id idcolumn info_column getctx info_column getctx info_column getctx qtyavailable bomqtyavailable m_product_id qtyavailable info_column getctx pricelist bompricelist m_product_id m_pricelist_version_id pricelist bigdecimal info_column getctx pricestd bompricestd m_product_id m_pricelist_version_id pricestd bigdecimal info_column mwst pricestd bigdecimal info_column pricestd bigdecimal info_column pricestd bigdecimal info_column getctx qtyonhand bomqtyonhand m_product_id qtyonhand info_column getctx qtyreserved bomqtyreserved m_product_id qtyreserved info_column getctx qtyordered bomqtyordered m_product_id qtyordered info_column getctx info_column getctx bompricestd m_product_id m_pricelist_version_id bompricelimit m_product_id m_pricelist_version_id bigdecimal info_column getctx pricelimit bompricelimit m_product_id m_pricelist_version_id pricelimit bigdecimal info_column getctx isinstanceattribute isinstanceattribute index_name index_pattribute frielayout s_productlayout frielayout s_productlayout s_productlayout arraylist info_column arraylist info_column info_column m_product_id idcolumn info_column getctx info_column getctx info_column getctx info_column getctx qtyavailable bomqtyavailable m_product_id qtyavailable info_column getctx pricelist bompricelist m_product_id m_pricelist_version_id pricelist bigdecimal info_column getctx pricestd bompricestd m_product_id m_pricelist_version_id pricestd bigdecimal info_column getctx qtyonhand bomqtyonhand m_product_id qtyonhand info_column getctx qtyreserved bomqtyreserved m_product_id qtyreserved info_column getctx qtyordered bomqtyordered m_product_id qtyordered isunconfirmed info_column getctx qtyunconfirmed targetqty m_inoutlineconfirm m_inoutline m_inoutline_id m_inoutline_id m_inout m_inout_id m_inout_id m_warehouse_id m_product_id m_product_id qtyunconfirmed info_column getctx qtyunconfirmedmove targetqty m_movementlineconfirm m_movementline m_movementline_id m_movementline_id m_locator m_locatorto_id m_locator_id m_warehouse_id m_product_id m_product_id qtyunconfirmedmove info_column getctx bompricestd m_product_id m_pricelist_version_id bompricelimit m_product_id m_pricelist_version_id bigdecimal info_column getctx pricelimit bompricelimit m_product_id m_pricelist_version_id pricelimit bigdecimal info_column getctx isinstanceattribute isinstanceattribute s_productlayout info_column toarray s_productlayout index_name index_pattribute s_productlayout s_productlayout system has unforfirmed records return true if unconfirmed private boolean is unconfirmed int no db getsql value null select count from m inoutlineconfirm where ad client id env getad client id env get ctx if no 0 return true no db getsql value null select count from m movementlineconfirm where ad client id env getad client id env get ctx return no 0 isunconfirmed getsqlvalue m_inoutlineconfirm ad_client_id getad_client_id getctx getsqlvalue m_movementlineconfirm ad_client_id getad_client_id getctx prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m product category id p m product category id para i get parameter as int else if name equals c acctschema id p c acctschema id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter m_product_category_id p_m_product_category_id getparameterasint c_acctschema_id p_c_acctschema_id getparameterasint process return message throws exception protected string do it throws exception log info c acctschema id p c acctschema id if p c acctschema id 0 throw new compiere system error c acctschema id 0 m acct schema as m acct schema get get ctx p c acctschema id if as get id 0 throw new compiere system error not found c acctschema id p c acctschema id update string sql update m product acct pa set p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct from m product category acct pca where pca m product category id p m product category id and pca c acctschema id p c acctschema id updated sys date updated by 0 where pa c acctschema id p c acctschema id and exists select from m product p where p m product id pa m product id and p m product category id p m product category id int updated db execute update sql get trxname add log 0 null new big decimal updated updated insert new products sql insert into m product acct m product id c acctschema id ad client id ad org id is active created created by updated updated by p revenue acct p expense acct p costadjustment acct p inventoryclearing acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p m product id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct p revenue acct acct p expense acct acct p costadjustment acct acct p inventoryclearing acct acct p asset acct acct p cogs acct acct p purchasepricevariance acct acct p invoicepricevariance acct acct p tradediscountrec acct acct p tradediscountgrant acct from m product p inner join m product category acct acct on acct m product category id p m product category id where acct c acctschema id p c acctschema id and p m product category id p m product category id and not exists select from m product acct pa where pa m product id p m product id and pa c acctschema id acct c acctschema id int created db execute update sql get trxname add log 0 null new big decimal created created return created created updated updated doit c_acctschema_id p_c_acctschema_id p_c_acctschema_id compieresystemerror c_acctschema_id macctschema macctschema getctx p_c_acctschema_id get_id compieresystemerror c_acctschema_id p_c_acctschema_id m_product_acct p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_category_acct m_product_category_id p_m_product_category_id c_acctschema_id p_c_acctschema_id sysdate updatedby c_acctschema_id p_c_acctschema_id m_product m_product_id m_product_id m_product_category_id p_m_product_category_id executeupdate get_trxname addlog bigdecimal m_product_acct m_product_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate p_revenue_acct p_expense_acct p_costadjustment_acct p_inventoryclearing_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product m_product_category_acct m_product_category_id m_product_category_id c_acctschema_id p_c_acctschema_id m_product_category_id p_m_product_category_id m_product_acct m_product_id m_product_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal standard constructor public x ad printtableformat properties ctx int ad printtableformat id string trx name super ctx ad printtableformat id trx name if ad printtableformat id 0 setad printtableformat id 0 set is default false set is paint boundary lines false set is painth lines false set is paint header lines true y set is paintv lines false set is print function symbols false set name null x_ad_printtableformat ad_printtableformat_id trxname ad_printtableformat_id trxname ad_printtableformat_id setad_printtableformat_id setisdefault setispaintboundarylines setispainthlines setispaintheaderlines setispaintvlines setisprintfunctionsymbols setname load constructor public x ad printtableformat properties ctx result set rs string trx name super ctx rs trx name x_ad_printtableformat resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printtableformat append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printtableformat get_id tostring set print table format table format in reports public void setad printtableformat id int ad printtableformat id if ad printtableformat id 1 throw new illegal argument exception ad printtableformat id is mandatory set valuenocheck ad printtableformat id new integer ad printtableformat id setad_printtableformat_id ad_printtableformat_id ad_printtableformat_id illegalargumentexception ad_printtableformat_id set_valuenocheck ad_printtableformat_id ad_printtableformat_id get print table format table format in reports public int getad printtableformat id integer ii integer get value ad printtableformat id if ii null return 0 return ii int value getad_printtableformat_id get_value ad_printtableformat_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set footer center content of the center portion of the footer public void set footer center string footer center if footer center null footer center length 255 log warning length 255 truncated footer center footer center substring 0 254 set value footer center footer center setfootercenter footercenter footercenter footercenter footercenter footercenter set_value footercenter footercenter get footer center content of the center portion of the footer public string get footer center return string get value footer center getfootercenter get_value footercenter set footer left content of the left portion of the footer public void set footer left string footer left if footer left null footer left length 255 log warning length 255 truncated footer left footer left substring 0 254 set value footer left footer left setfooterleft footerleft footerleft footerleft footerleft footerleft set_value footerleft footerleft get footer left content of the left portion of the footer public string get footer left return string get value footer left getfooterleft get_value footerleft set footer right content of the right portion of the footer public void set footer right string footer right if footer right null footer right length 255 log warning length 255 truncated footer right footer right substring 0 254 set value footer right footer right setfooterright footerright footerright footerright footerright footerright set_value footerright footerright get footer right content of the right portion of the footer public string get footer right return string get value footer right getfooterright get_value footerright public static final int functbg printcolor id ad reference id 266 set function bg color function background color public void setfunctbg printcolor id int functbg printcolor id if functbg printcolor id 0 set value functbg printcolor id null else set value functbg printcolor id new integer functbg printcolor id functbg_printcolor_id_ad_reference_id setfunctbg_printcolor_id functbg_printcolor_id functbg_printcolor_id set_value functbg_printcolor_id set_value functbg_printcolor_id functbg_printcolor_id get function bg color function background color public int getfunctbg printcolor id integer ii integer get value functbg printcolor id if ii null return 0 return ii int value getfunctbg_printcolor_id get_value functbg_printcolor_id intvalue public static final int functfg printcolor id ad reference id 266 set function color function foreground color public void setfunctfg printcolor id int functfg printcolor id if functfg printcolor id 0 set value functfg printcolor id null else set value functfg printcolor id new integer functfg printcolor id functfg_printcolor_id_ad_reference_id setfunctfg_printcolor_id functfg_printcolor_id functfg_printcolor_id set_value functfg_printcolor_id set_value functfg_printcolor_id functfg_printcolor_id get function color function foreground color public int getfunctfg printcolor id integer ii integer get value functfg printcolor id if ii null return 0 return ii int value getfunctfg_printcolor_id get_value functfg_printcolor_id intvalue public static final int funct printfont id ad reference id 267 set function font function row font public void setfunct printfont id int funct printfont id if funct printfont id 0 set value funct printfont id null else set value funct printfont id new integer funct printfont id funct_printfont_id_ad_reference_id setfunct_printfont_id funct_printfont_id funct_printfont_id set_value funct_printfont_id set_value funct_printfont_id funct_printfont_id get function font function row font public int getfunct printfont id integer ii integer get value funct printfont id if ii null return 0 return ii int value getfunct_printfont_id get_value funct_printfont_id intvalue public static final int hdrline printcolor id ad reference id 266 set header line color table header row line color public void sethdrline printcolor id int hdrline printcolor id if hdrline printcolor id 0 set value hdrline printcolor id null else set value hdrline printcolor id new integer hdrline printcolor id hdrline_printcolor_id_ad_reference_id sethdrline_printcolor_id hdrline_printcolor_id hdrline_printcolor_id set_value hdrline_printcolor_id set_value hdrline_printcolor_id hdrline_printcolor_id get header line color table header row line color public int gethdrline printcolor id integer ii integer get value hdrline printcolor id if ii null return 0 return ii int value gethdrline_printcolor_id get_value hdrline_printcolor_id intvalue set header stroke width of the header line stroke public void set hdr stroke big decimal hdr stroke set value hdr stroke hdr stroke sethdrstroke bigdecimal hdrstroke set_value hdrstroke hdrstroke get header stroke width of the header line stroke public big decimal get hdr stroke big decimal bd big decimal get value hdr stroke if bd null return env zero return bd bigdecimal gethdrstroke bigdecimal bigdecimal get_value hdrstroke public static final string hdrstroketype dottedline d set header stroke type type of the header line stroke public void set hdr stroke type string hdr stroke type if hdr stroke type null throw new illegal argument exception hdr stroke type is mandatory if hdr stroke type null hdr stroke type equals 2 hdr stroke type equals d hdr stroke type equals s hdr stroke type equals d else throw new illegal argument exception hdr stroke type invalid value hdr stroke type reference id 312 2 d s d if hdr stroke type null hdr stroke type length 1 log warning length 1 truncated hdr stroke type hdr stroke type substring 0 0 set value hdr stroke type hdr stroke type hdrstroketype_dottedline sethdrstroketype hdrstroketype hdrstroketype illegalargumentexception hdrstroketype hdrstroketype hdrstroketype hdrstroketype hdrstroketype hdrstroketype illegalargumentexception hdrstroketype hdrstroketype reference_id hdrstroketype hdrstroketype hdrstroketype hdrstroketype set_value hdrstroketype hdrstroketype get header stroke type type of the header line stroke public string get hdr stroke type return string get value hdr stroke type gethdrstroketype get_value hdrstroketype public static final int hdrtextbg printcolor id ad reference id 266 set header row bg color background color of header row public void sethdrtextbg printcolor id int hdrtextbg printcolor id if hdrtextbg printcolor id 0 set value hdrtextbg printcolor id null else set value hdrtextbg printcolor id new integer hdrtextbg printcolor id hdrtextbg_printcolor_id_ad_reference_id sethdrtextbg_printcolor_id hdrtextbg_printcolor_id hdrtextbg_printcolor_id set_value hdrtextbg_printcolor_id set_value hdrtextbg_printcolor_id hdrtextbg_printcolor_id get header row bg color background color of header row public int gethdrtextbg printcolor id integer ii integer get value hdrtextbg printcolor id if ii null return 0 return ii int value gethdrtextbg_printcolor_id get_value hdrtextbg_printcolor_id intvalue public static final int hdrtextfg printcolor id ad reference id 266 set header row color foreground color if the table header row public void sethdrtextfg printcolor id int hdrtextfg printcolor id if hdrtextfg printcolor id 0 set value hdrtextfg printcolor id null else set value hdrtextfg printcolor id new integer hdrtextfg printcolor id hdrtextfg_printcolor_id_ad_reference_id sethdrtextfg_printcolor_id hdrtextfg_printcolor_id hdrtextfg_printcolor_id set_value hdrtextfg_printcolor_id set_value hdrtextfg_printcolor_id hdrtextfg_printcolor_id get header row color foreground color if the table header row public int gethdrtextfg printcolor id integer ii integer get value hdrtextfg printcolor id if ii null return 0 return ii int value gethdrtextfg_printcolor_id get_value hdrtextfg_printcolor_id intvalue public static final int hdr printfont id ad reference id 267 set header row font header row font public void sethdr printfont id int hdr printfont id if hdr printfont id 0 set value hdr printfont id null else set value hdr printfont id new integer hdr printfont id hdr_printfont_id_ad_reference_id sethdr_printfont_id hdr_printfont_id hdr_printfont_id set_value hdr_printfont_id set_value hdr_printfont_id hdr_printfont_id get header row font header row font public int gethdr printfont id integer ii integer get value hdr printfont id if ii null return 0 return ii int value gethdr_printfont_id get_value hdr_printfont_id intvalue set header center content of the center portion of the header public void set header center string header center if header center null header center length 255 log warning length 255 truncated header center header center substring 0 254 set value header center header center setheadercenter headercenter headercenter headercenter headercenter headercenter set_value headercenter headercenter get header center content of the center portion of the header public string get header center return string get value header center getheadercenter get_value headercenter set header left content of the left portion of the header public void set header left string header left if header left null header left length 255 log warning length 255 truncated header left header left substring 0 254 set value header left header left setheaderleft headerleft headerleft headerleft headerleft headerleft set_value headerleft headerleft get header left content of the left portion of the header public string get header left return string get value header left getheaderleft get_value headerleft set header right content of the right portion of the header public void set header right string header right if header right null header right length 255 log warning length 255 truncated header right header right substring 0 254 set value header right header right setheaderright headerright headerright headerright headerright headerright set_value headerright headerright get header right content of the right portion of the header public string get header right return string get value header right getheaderright get_value headerright set image attached the image to be printed is attached to the record public void set image is attached boolean image is attached set value image is attached new boolean image is attached setimageisattached imageisattached set_value imageisattached imageisattached get image attached the image to be printed is attached to the record public boolean is image is attached object oo get value image is attached if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isimageisattached get_value imageisattached booleanvalue set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set paint boundary lines paint table boundary lines public void set is paint boundary lines boolean is paint boundary lines set value is paint boundary lines new boolean is paint boundary lines setispaintboundarylines ispaintboundarylines set_value ispaintboundarylines ispaintboundarylines get paint boundary lines paint table boundary lines public boolean is paint boundary lines object oo get value is paint boundary lines if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispaintboundarylines get_value ispaintboundarylines booleanvalue set paint horizontal lines paint horizontal lines public void set is painth lines boolean is painth lines set value is painth lines new boolean is painth lines setispainthlines ispainthlines set_value ispainthlines ispainthlines get paint horizontal lines paint horizontal lines public boolean is painth lines object oo get value is painth lines if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispainthlines get_value ispainthlines booleanvalue set paint header lines paint lines over under the header line public void set is paint header lines boolean is paint header lines set value is paint header lines new boolean is paint header lines setispaintheaderlines ispaintheaderlines set_value ispaintheaderlines ispaintheaderlines get paint header lines paint lines over under the header line public boolean is paint header lines object oo get value is paint header lines if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispaintheaderlines get_value ispaintheaderlines booleanvalue set paint vertical lines paint vertical lines public void set is paintv lines boolean is paintv lines set value is paintv lines new boolean is paintv lines setispaintvlines ispaintvlines set_value ispaintvlines ispaintvlines get paint vertical lines paint vertical lines public boolean is paintv lines object oo get value is paintv lines if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispaintvlines get_value ispaintvlines booleanvalue set print function symbols print symbols for functions sum average count public void set is print function symbols boolean is print function symbols set value is print function symbols new boolean is print function symbols setisprintfunctionsymbols isprintfunctionsymbols set_value isprintfunctionsymbols isprintfunctionsymbols get print function symbols print symbols for functions sum average count public boolean is print function symbols object oo get value is print function symbols if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprintfunctionsymbols get_value isprintfunctionsymbols booleanvalue set line stroke width of the line stroke public void set line stroke big decimal line stroke set value line stroke line stroke setlinestroke bigdecimal linestroke set_value linestroke linestroke get line stroke width of the line stroke public big decimal get line stroke big decimal bd big decimal get value line stroke if bd null return env zero return bd bigdecimal getlinestroke bigdecimal bigdecimal get_value linestroke public static final string linestroketype dottedline d set line stroke type type of the line stroke public void set line stroke type string line stroke type if line stroke type null throw new illegal argument exception line stroke type is mandatory if line stroke type null line stroke type equals 2 line stroke type equals d line stroke type equals s line stroke type equals d else throw new illegal argument exception line stroke type invalid value line stroke type reference id 312 2 d s d if line stroke type null line stroke type length 1 log warning length 1 truncated line stroke type line stroke type substring 0 0 set value line stroke type line stroke type linestroketype_dottedline setlinestroketype linestroketype linestroketype illegalargumentexception linestroketype linestroketype linestroketype linestroketype linestroketype linestroketype illegalargumentexception linestroketype linestroketype reference_id linestroketype linestroketype linestroketype linestroketype set_value linestroketype linestroketype get line stroke type type of the line stroke public string get line stroke type return string get value line stroke type getlinestroketype get_value linestroketype public static final int line printcolor id ad reference id 266 set line color table line color public void setline printcolor id int line printcolor id if line printcolor id 0 set value line printcolor id null else set value line printcolor id new integer line printcolor id line_printcolor_id_ad_reference_id setline_printcolor_id line_printcolor_id line_printcolor_id set_value line_printcolor_id set_value line_printcolor_id line_printcolor_id get line color table line color public int getline printcolor id integer ii integer get value line printcolor id if ii null return 0 return ii int value getline_printcolor_id get_value line_printcolor_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c bp group id p c bp group id para i get parameter as int else if name equals c invoice id p c invoice id para i get parameter as int else if name equals max inv write off amt p maxinvwriteoffamt big decimal para i get parameter else if name equals apar p apar string para i get parameter else if name equals date invoiced p dateinvoiced from timestamp para i get parameter p dateinvoiced to timestamp para i getparameter to else if name equals date acct p dateacct timestamp para i get parameter else if name equals create payment p createpayment y equals para i get parameter else if name equals c bankaccount id p c bankaccount id para i get parameter as int else if name equals is simulation p issimulation y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bpartner_id p_c_bpartner_id getparameterasint c_bp_group_id p_c_bp_group_id getparameterasint c_invoice_id p_c_invoice_id getparameterasint maxinvwriteoffamt p_maxinvwriteoffamt bigdecimal getparameter p_apar getparameter dateinvoiced p_dateinvoiced_from getparameter p_dateinvoiced_to getparameter_to dateacct p_dateacct getparameter createpayment p_createpayment getparameter c_bankaccount_id p_c_bankaccount_id getparameterasint issimulation p_issimulation getparameter execute return message throws exception protected string do it throws exception log info c bpartner id p c bpartner id c bp group id p c bp group id c invoice id p c invoice id apar p apar p dateinvoiced from p dateinvoiced to create payment p createpayment c bankaccount id p c bankaccount id if p c bpartner id 0 p c invoice id 0 p c bp group id 0 throw new compiere user error fill mandatory c invoice id c bpartner id if p createpayment p c bankaccount id 0 throw new compiere user error fill mandatory c bankaccount id string buffer sql new string buffer select c invoice id document no date invoiced c currency id grand total invoice open c invoice id 0 as open amt from c invoice where if p c invoice id 0 sql append c invoice id append p c invoice id else if p c bpartner id 0 sql append c bpartner id append p c bpartner id else sql append exists select from c bpartner bp where c invoice c bpartner id bp c bpartner id and bp c bp group id append p c bp group id append if only ar equals p apar sql append and isso trx y else if only ap equals p apar sql append and isso trx n if p dateinvoiced from null p dateinvoiced to null sql append and trim date invoiced between append db to date p dateinvoiced from true append and append db to date p dateinvoiced to true else if p dateinvoiced from null sql append and trim date invoiced append db to date p dateinvoiced from true else if p dateinvoiced to null sql append and trim date invoiced append db to date p dateinvoiced to true sql append and is paid n order by c currency id c bpartner id date invoiced log finer sql to string int counter 0 prepared statement pstmt null try pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next if write off rs get int 1 rs get string 2 rs get timestamp 3 rs get int 4 rs get big decimal 6 counter rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null final process payment process allocation return counter doit c_bpartner_id p_c_bpartner_id c_bp_group_id p_c_bp_group_id c_invoice_id p_c_invoice_id p_apar p_dateinvoiced_from p_dateinvoiced_to createpayment p_createpayment c_bankaccount_id p_c_bankaccount_id p_c_bpartner_id p_c_invoice_id p_c_bp_group_id compiereusererror fillmandatory c_invoice_id c_bpartner_id p_createpayment p_c_bankaccount_id compiereusererror fillmandatory c_bankaccount_id stringbuffer stringbuffer c_invoice_id documentno dateinvoiced c_currency_id grandtotal invoiceopen c_invoice_id openamt c_invoice p_c_invoice_id c_invoice_id p_c_invoice_id p_c_bpartner_id c_bpartner_id p_c_bpartner_id c_bpartner c_invoice c_bpartner_id c_bpartner_id c_bp_group_id p_c_bp_group_id only_ar p_apar issotrx only_ap p_apar issotrx p_dateinvoiced_from p_dateinvoiced_to dateinvoiced to_date p_dateinvoiced_from to_date p_dateinvoiced_to p_dateinvoiced_from dateinvoiced to_date p_dateinvoiced_from p_dateinvoiced_to dateinvoiced to_date p_dateinvoiced_to ispaid c_currency_id c_bpartner_id dateinvoiced tostring preparedstatement preparestatement tostring get_trxname resultset executequery writeoff getint getstring gettimestamp getint getbigdecimal tostring processpayment processallocation write off param c invoice id invoice param document no doc no param date invoiced date param c currency id currency param open amt open amt return true if written off private boolean write off int c invoice id string document no timestamp date invoiced int c currency id big decimal open amt nothing to do if open amt null open amt signum 0 return false if open amt abs compare to p maxinvwriteoffamt 0 return false if p issimulation add log c invoice id date invoiced open amt document no return true invoice m invoice invoice new m invoice get ctx c invoice id get trxname if invoice isso trx open amt open amt negate allocation if m alloc null c currency id m alloc getc currency id process allocation m alloc new m allocation hdr get ctx true p dateacct c currency id get process info get title getad pinstance id get trxname m alloc setad org id invoice getad org id if m alloc save log log level severe cannot create allocation header return false payment if p createpayment m payment null invoice getc bpartner id m payment getc bpartner id c currency id m payment getc currency id process payment m payment new m payment get ctx 0 get trxname m payment setad org id invoice getad org id m payment setc bankaccount id p c bankaccount id m payment set tender type m payment tendertype check m payment set date trx p dateacct m payment set date acct p dateacct m payment set description get process info get title getad pinstance id m payment setc bpartner id invoice getc bpartner id m payment set is receipt true payments are negative m payment setc currency id c currency id if m payment save log log level severe cannot create payment return false line m allocation line a line null if p createpayment a line new m allocation line m alloc open amt env zero env zero env zero m payment set pay amt m payment get pay amt add open amt a line setc payment id m payment getc payment id else a line new m allocation line m alloc env zero env zero open amt env zero a line setc invoice id c invoice id if a line save add log c invoice id date invoiced open amt document no return true error log log level severe cannot create allocation line for c invoice id c invoice id return false c_invoice_id documentno dateinvoiced c_currency_id openamt writeoff c_invoice_id documentno dateinvoiced c_currency_id bigdecimal openamt openamt openamt openamt compareto p_maxinvwriteoffamt p_issimulation addlog c_invoice_id dateinvoiced openamt documentno minvoice minvoice getctx c_invoice_id get_trxname issotrx openamt openamt m_alloc c_currency_id m_alloc getc_currency_id processallocation m_alloc mallocationhdr getctx p_dateacct c_currency_id getprocessinfo gettitle getad_pinstance_id get_trxname m_alloc setad_org_id getad_org_id m_alloc p_createpayment m_payment getc_bpartner_id m_payment getc_bpartner_id c_currency_id m_payment getc_currency_id processpayment m_payment mpayment getctx get_trxname m_payment setad_org_id getad_org_id m_payment setc_bankaccount_id p_c_bankaccount_id m_payment settendertype mpayment tendertype_check m_payment setdatetrx p_dateacct m_payment setdateacct p_dateacct m_payment setdescription getprocessinfo gettitle getad_pinstance_id m_payment setc_bpartner_id getc_bpartner_id m_payment setisreceipt m_payment setc_currency_id c_currency_id m_payment mallocationline aline p_createpayment aline mallocationline m_alloc openamt m_payment setpayamt m_payment getpayamt openamt aline setc_payment_id m_payment getc_payment_id aline mallocationline m_alloc openamt aline setc_invoice_id c_invoice_id aline addlog c_invoice_id dateinvoiced openamt documentno c_invoice_id c_invoice_id process allocation return true if processed private boolean process allocation if m alloc null return true process payment process it if m alloc process it doc action action complete m alloc save m alloc null return true m alloc null return false processallocation m_alloc processpayment m_alloc processit docaction action_complete m_alloc m_alloc m_alloc process payment return true if processed private boolean process payment if m payment null return true process it if m payment process it doc action action complete m payment save m payment null return true m payment null return false processpayment m_payment m_payment processit docaction action_complete m_payment m_payment m_payment private string icon mono32x32 filename public v string bean info iconmono32x32filename vstringbeaninfo public property descriptor get property descriptors try property descriptor display new property descriptor display bean class get display null property descriptor editable new property descriptor editable bean class null set editable property descriptor mandatory new property descriptor mandatory bean class is mandatory set mandatory property descriptor value new property descriptor value bean class get value set value property descriptor pds new property descriptor display editable mandatory value return pds catch introspection exception ex ex print stack trace return null propertydescriptor getpropertydescriptors propertydescriptor _display propertydescriptor beanclass getdisplay propertydescriptor _editable propertydescriptor beanclass seteditable propertydescriptor _mandatory propertydescriptor beanclass ismandatory setmandatory propertydescriptor _value propertydescriptor beanclass getvalue setvalue propertydescriptor propertydescriptor _display _editable _mandatory _value introspectionexception printstacktrace public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename public bean info get additional bean info class superclass bean class get superclass try bean info super bean info introspector get bean info superclass return new bean info super bean info catch introspection exception ex ex print stack trace return null beaninfo getadditionalbeaninfo beanclass getsuperclass beaninfo superbeaninfo getbeaninfo beaninfo superbeaninfo introspectionexception printstacktrace viewer constructor param re report engine public viewer report engine re super log info m windowno env create window no this m reportengine re m ad table id re get print format getad table id if m role get default is can report m ad table id a dialog error m windowno this access cannot report m reportengine get name this dispose m iscanexport m role get default is can export m ad table id try m viewpanel re get view m ctx m reportengine get ctx jb init dyn init if m viewpanel is archivable log warning cannot archive document a env show center screen this catch exception e log log level severe e a dialog error m windowno this load error e get localized message this dispose reportengine m_windowno createwindowno m_reportengine m_ad_table_id getprintformat getad_table_id mrole getdefault iscanreport m_ad_table_id adialog m_windowno accesscannotreport m_reportengine getname m_iscanexport mrole getdefault iscanexport m_ad_table_id m_viewpanel getview m_ctx m_reportengine getctx jbinit dyninit m_viewpanel isarchivable aenv showcenterscreen adialog m_windowno loaderror getlocalizedmessage static layout throws exception private void jb init throws exception this set icon image env get image m report gif this set default close operation j frame dispose on close north panel set layout north layout this get content pane add north panel border layout north north panel add tool bar border layout east this get content pane add center scroll pane border layout center center scroll pane get viewport add m viewpanel null this get content pane add status bar border layout south tool bar this setj menu bar menu bar page control tool bar add b previous tool bar add spinner spinner set tool tip text msg get msg m ctx go to page tool bar add b next zoom level tool bar add separator tool bar add combo zoom null combo zoom set tool tip text msg get msg m ctx zoom drill tool bar add separator label drill set text msg get msg m ctx drill tool bar add label drill tool bar add combo drill combo drill set tool tip text msg get msg m ctx drill format customize find tool bar add separator tool bar add combo report combo report set tool tip text msg translate m ctx ad printformat id tool bar add b customize b customize set tool tip text msg get msg m ctx print customize tool bar add b find b find set tool tip text msg get msg m ctx find tool bar add separator print export tool bar add b print tool bar add separator tool bar add b page setup b page setup set tool tip text msg get msg m ctx page setup tool bar add b send mail tool bar add b archive if m iscanexport b export set tool tip text msg get msg m ctx export tool bar add b export end tool bar add separator tool bar add b end null b end set tool tip text msg get msg m ctx end jbinit seticonimage getimage mreport setdefaultcloseoperation jframe dispose_on_close northpanel setlayout northlayout getcontentpane northpanel borderlayout northpanel toolbar borderlayout getcontentpane centerscrollpane borderlayout centerscrollpane getviewport m_viewpanel getcontentpane statusbar borderlayout toolbar setjmenubar menubar toolbar bprevious toolbar settooltiptext getmsg m_ctx gotopage toolbar bnext toolbar addseparator toolbar combozoom combozoom settooltiptext getmsg m_ctx toolbar addseparator labeldrill settext getmsg m_ctx toolbar labeldrill toolbar combodrill combodrill settooltiptext getmsg m_ctx toolbar addseparator toolbar comboreport comboreport settooltiptext m_ctx ad_printformat_id toolbar bcustomize bcustomize settooltiptext getmsg m_ctx printcustomize toolbar bfind bfind settooltiptext getmsg m_ctx toolbar addseparator toolbar bprint toolbar addseparator toolbar bpagesetup bpagesetup settooltiptext getmsg m_ctx pagesetup toolbar bsendmail toolbar barchive m_iscanexport bexport settooltiptext getmsg m_ctx toolbar bexport toolbar addseparator toolbar bend bend settooltiptext getmsg m_ctx dynamic init private void dyn init create menu combo zoom add action listener this change listener to set page no center scroll pane get viewport add change listener this max page m pagemax m viewpanel get page count spinner model set maximum new integer m pagemax spinner add change listener this fill combo report m reportengine get print format get id view panel mouse listener m viewpanel add mouse listener new mouse adapter public void mouse clicked mouse event e if swing utilities is right mouse button e mouse clicked e true else if e get click count 1 mouse clicked e false fill drill options name table name combo drill add item new value name pair null string sql select t ad table id t table name e print name nullif e po printname e print name from ad column c inner join ad column used on c column name used column name inner join ad table t on used ad table id t ad table id and t is view n and t ad table id c ad table id inner join ad column c key on t ad table id c key ad table id and c key is key y inner join ad element e on c key column name e column name where c ad table id and c is key y order by 3 boolean trl env is base language env get ctx ad element if trl sql select t ad table id t table name et print name nullif et po printname et print name from ad column c inner join ad column used on c column name used column name inner join ad table t on used ad table id t ad table id and t is view n and t ad table id c ad table id inner join ad column c key on t ad table id c key ad table id and c key is key y inner join ad element e on c key column name e column name inner join ad element trl et on e ad element id et ad element id where c ad table id and c is key y and et ad language order by 3 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m reportengine get print format getad table id if trl pstmt set string 2 env getad language env get ctx result set rs pstmt execute query while rs next string table name rs get string 2 string name rs get string 3 string po name rs get string 4 if po name null name po name combo drill add item new value name pair table name name rs close pstmt close catch sql exception e log log level severe sql e if combo drill get item count 1 label drill set visible false combo drill set visible false else combo drill add action listener this revalidate dyninit createmenu combozoom addactionlistener centerscrollpane getviewport addchangelistener m_pagemax m_viewpanel getpagecount spinnermodel setmaximum m_pagemax addchangelistener fillcomboreport m_reportengine getprintformat get_id m_viewpanel addmouselistener mouseadapter mouseclicked mouseevent swingutilities isrightmousebutton mouse_clicked getclickcount mouse_clicked tablename combodrill additem valuenamepair ad_table_id tablename printname po_printname printname ad_column ad_column columnname columnname ad_table ad_table_id ad_table_id isview ad_table_id ad_table_id ad_column ckey ad_table_id ckey ad_table_id ckey iskey ad_element ckey columnname columnname ad_table_id iskey isbaselanguage getctx ad_element ad_table_id tablename printname po_printname printname ad_column ad_column columnname columnname ad_table ad_table_id ad_table_id isview ad_table_id ad_table_id ad_column ckey ad_table_id ckey ad_table_id ckey iskey ad_element ckey columnname columnname ad_element_trl ad_element_id ad_element_id ad_table_id iskey ad_language preparedstatement preparestatement setint m_reportengine getprintformat getad_table_id setstring getad_language getctx resultset executequery tablename getstring getstring poname getstring poname poname combodrill additem valuenamepair tablename sqlexception combodrill getitemcount labeldrill setvisible combodrill setvisible combodrill addactionlistener public void mouse clicked mouse event e if swing utilities is right mouse button e mouse clicked e true else if e get click count 1 mouse clicked e false mouseclicked mouseevent swingutilities isrightmousebutton mouse_clicked getclickcount mouse_clicked fill combo box combo report report options param ad printformat id item to be selected private void fill combo report int ad printformat id combo report remove action listener this combo report remove all items key name pair select value null fill report options string sql m role get default add accesssql select ad printformat id name description from ad printformat where ad table id order by name ad printformat m role sql notqualified m role sql ro int ad table id m reportengine get print format getad table id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query while rs next key name pair pp new key name pair rs get int 1 rs get string 2 combo report add item pp if rs get int 1 ad printformat id select value pp rs close pstmt close catch sql exception e log log level severe sql e string buffer sb new string buffer append msg get msg m ctx new report append key name pair pp new key name pair 1 sb to string combo report add item pp if select value null combo report set selected item select value combo report add action listener this combobox comboreport ad_printformat_id fillcomboreport ad_printformat_id comboreport removeactionlistener comboreport removeallitems keynamepair selectvalue mrole getdefault addaccesssql ad_printformat_id ad_printformat ad_table_id ad_printformat mrole sql_notqualified mrole sql_ro ad_table_id m_reportengine getprintformat getad_table_id preparedstatement preparestatement setint ad_table_id resultset executequery keynamepair keynamepair getint getstring comboreport additem getint ad_printformat_id selectvalue sqlexception stringbuffer stringbuffer getmsg m_ctx newreport keynamepair keynamepair tostring comboreport additem selectvalue comboreport setselecteditem selectvalue comboreport addactionlistener revalidate settings after change of environment private void revalidate m pagemax m viewpanel get page count spinner model set maximum new integer m pagemax scroll area page size dependent center scroll pane set preferred size new dimension m viewpanel get paper width 30 m viewpanel get paper height 15 center scroll pane get viewport set view size new dimension m viewpanel get paper width 2 view margin m viewpanel get paper height 2 view margin report info set title msg get msg m ctx report m reportengine get name env get header m ctx 0 string buffer sb new string buffer sb append m viewpanel get paper to string m ctx append append msg get msg m ctx data cols append append m reportengine get column count append append msg get msg m ctx data rows append append m reportengine get row count status bar set status line sb to string set page m pageno m_pagemax m_viewpanel getpagecount spinnermodel setmaximum m_pagemax centerscrollpane setpreferredsize m_viewpanel getpaperwidth m_viewpanel getpaperheight centerscrollpane getviewport setviewsize m_viewpanel getpaperwidth m_viewpanel getpaperheight settitle getmsg m_ctx m_reportengine getname getheader m_ctx stringbuffer stringbuffer m_viewpanel getpaper tostring m_ctx getmsg m_ctx datacols m_reportengine getcolumncount getmsg m_ctx datarows m_reportengine getrowcount statusbar setstatusline tostring setpage m_pageno create menu private void create menu file j menu m file a env get menu file menu bar add m file a env add menu item print screen null key stroke get key stroke key event vk printscreen 0 m file this a env add menu item screen shot null key stroke get key stroke key event vk printscreen event shift mask m file this a env add menu item report null key stroke get key stroke key event vk p event alt mask m file this m file add separator a env add menu item print customize preference null m file this a env add menu item translate null null m file this a env add menu item find null key stroke get key stroke key event vk f event ctrl mask m file this m file add separator a env add menu item page setup null null m file this a env add menu item print null key stroke get key stroke key event vk p event ctrl mask m file this if m iscanexport a env add menu item export null null m file this m file add separator a env add menu item end null key stroke get key stroke key event vk x event alt mask m file this a env add menu item exit null key stroke get key stroke key event vk x event shift mask event alt mask m file this view j menu m view a env get menu view menu bar add m view a env add menu item info product null key stroke get key stroke key event vk i event ctrl mask m view this a env add menu item infob partner null key stroke get key stroke key event vk i event shift mask event ctrl mask m view this a env add menu item info account null key stroke get key stroke key event vk i event alt mask event ctrl mask m view this a env add menu item info schedule null null m view this m view add separator a env add menu item info order info null m view this a env add menu item info invoice info null m view this a env add menu item info in out info null m view this a env add menu item info payment info null m view this go j menu m go a env get menu go menu bar add m go a env add menu item first first key stroke get key stroke key event vk page up event alt mask m go this a env add menu item previous page previous key stroke get key stroke key event vk up event alt mask m go this a env add menu item next page next key stroke get key stroke key event vk down event alt mask m go this a env add menu item last last key stroke get key stroke key event vk page down event alt mask m go this tools j menu m tools a env get menu tools menu bar add m tools a env add menu item calculator null null m tools this a env add menu item calendar null null m tools this a env add menu item editor null null m tools this a env add menu item script null null m tools this m tools add separator a env add menu item preference null null m tools this help j menu m help a env get menu help menu bar add m help a env add menu item online null null m help this a env add menu item send mail null null m help this a env add menu item about null null m help this tool bar set button b print print print set button b send mail send mail send mail set button b page setup page setup page setup set button b archive archive archive if m iscanexport set button b export export export set button b next next page next set button b previous previous page previous set button b find find find set button b customize print customize preference set button b end end end createmenu jmenu mfile aenv getmenu menubar mfile aenv addmenuitem printscreen keystroke getkeystroke keyevent vk_printscreen mfile aenv addmenuitem screenshot keystroke getkeystroke keyevent vk_printscreen shift_mask mfile aenv addmenuitem keystroke getkeystroke keyevent vk_p alt_mask mfile mfile addseparator aenv addmenuitem printcustomize mfile aenv addmenuitem mfile aenv addmenuitem keystroke getkeystroke keyevent vk_f ctrl_mask mfile mfile addseparator aenv addmenuitem pagesetup mfile aenv addmenuitem keystroke getkeystroke keyevent vk_p ctrl_mask mfile m_iscanexport aenv addmenuitem mfile mfile addseparator aenv addmenuitem keystroke getkeystroke keyevent vk_x alt_mask mfile aenv addmenuitem keystroke getkeystroke keyevent vk_x shift_mask alt_mask mfile jmenu mview aenv getmenu menubar mview aenv addmenuitem infoproduct keystroke getkeystroke keyevent vk_i ctrl_mask mview aenv addmenuitem infobpartner keystroke getkeystroke keyevent vk_i shift_mask ctrl_mask mview aenv addmenuitem infoaccount keystroke getkeystroke keyevent vk_i alt_mask ctrl_mask mview aenv addmenuitem infoschedule mview mview addseparator aenv addmenuitem infoorder mview aenv addmenuitem infoinvoice mview aenv addmenuitem infoinout mview aenv addmenuitem infopayment mview jmenu mgo aenv getmenu menubar mgo aenv addmenuitem keystroke getkeystroke keyevent vk_page_up alt_mask mgo aenv addmenuitem previouspage keystroke getkeystroke keyevent vk_up alt_mask mgo aenv addmenuitem nextpage keystroke getkeystroke keyevent vk_down alt_mask mgo aenv addmenuitem keystroke getkeystroke keyevent vk_page_down alt_mask mgo jmenu mtools aenv getmenu menubar mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools aenv addmenuitem mtools mtools addseparator aenv addmenuitem mtools jmenu mhelp aenv getmenu menubar mhelp aenv addmenuitem mhelp aenv addmenuitem sendmail mhelp aenv addmenuitem mhelp toolbar setbutton bprint setbutton bsendmail sendmail sendmail setbutton bpagesetup pagesetup pagesetup setbutton barchive m_iscanexport setbutton bexport setbutton bnext nextpage setbutton bprevious previouspage setbutton bfind setbutton bcustomize printcustomize setbutton bend set button param button button param cmd command param file fine mame private void set button abstract button button string cmd string file string text msg get msg m ctx cmd button set tool tip text text button set action command cmd image icon ii24 env get image icon file 24 gif if ii24 null button set icon ii24 button set margin apps action button insets button set preferred size apps action button size button add action listener this setbutton abstractbutton getmsg m_ctx settooltiptext setactioncommand imageicon getimageicon seticon setmargin appsaction button_insets setpreferredsize appsaction button_size addactionlistener dispose public void dispose env clear win context m windowno m reportengine null m viewpanel null m ctx null super dispose clearwincontext m_windowno m_reportengine m_viewpanel m_ctx action listener param e event public void action performed action event e if m setting return string cmd e get action command log config cmd this set cursor cursor get predefined cursor cursor wait cursor if e get source combo zoom cmd zoom else if e get source combo report cmd report else if e get source combo drill cmd drill else if cmd equals first set page 1 else if cmd equals previous page cmd equals previous set page m pageno 1 else if cmd equals next page cmd equals next set page m pageno 1 else if cmd equals last set page m pagemax else if cmd equals find cmd find else if cmd equals export cmd export else if cmd equals print cmd print else if cmd equals send mail cmd sendmail else if cmd equals archive cmd archive else if cmd equals print customize cmd customize else if cmd equals page setup cmd pagesetup else if cmd equals translate cmd translate else if cmd equals end dispose else if e get source m ddm cmd window m ddq else if e get source m dam cmd window m daq else if a env action performed e get action command m windowno this log log level severe unknown action e get action command this set cursor cursor get default cursor actionperformed actionevent m_setting getactioncommand setcursor getpredefinedcursor wait_cursor getsource combozoom cmd_zoom getsource comboreport cmd_report getsource combodrill cmd_drill setpage previouspage setpage m_pageno nextpage setpage m_pageno setpage m_pagemax cmd_find cmd_export cmd_print sendmail cmd_sendmail cmd_archive printcustomize cmd_customize pagesetup cmd_pagesetup cmd_translate getsource m_ddm cmd_window m_ddq getsource m_dam cmd_window m_daq aenv actionperformed getactioncommand m_windowno getactioncommand setcursor getdefaultcursor change listener spinner viewpoint param e event public void state changed change event e if m setting return log config viewer state changed e m setting true int new page 0 if e get source spinner new page integer spinner model get value int value else viewpoint point p center scroll pane get viewport get view position new page math round m viewpanel get page no at p set page new page m setting false statechanged changeevent m_setting statechanged m_setting newpage getsource newpage spinnermodel getvalue intvalue centerscrollpane getviewport getviewposition newpage m_viewpanel getpagenoat setpage newpage m_setting set page no param page page no private void set page int page m setting true m pageno page if m pageno 1 m pageno 1 if page m pagemax m pageno m pagemax b previous set enabled m pageno 1 b next set enabled m pageno m pagemax rectangle page rectangle m viewpanel get rectangle of page m pageno page rectangle x view margin page rectangle y view margin center scroll pane get viewport set view position page rectangle get location system out println scroll to page rectangle set page spinner model set value new integer m pageno string buffer sb new string buffer msg get msg m ctx page append append m pageno append m viewpanel get page info m pageno append append msg get msg m ctx of append append m pagemax append m viewpanel get page info max status bar set statusdb sb to string m setting false setpage m_setting m_pageno m_pageno m_pageno m_pagemax m_pageno m_pagemax bprevious setenabled m_pageno bnext setenabled m_pageno m_pagemax pagerectangle m_viewpanel getrectangleofpage m_pageno pagerectangle pagerectangle centerscrollpane getviewport setviewposition pagerectangle getlocation scrollto pagerectangle spinnermodel setvalue m_pageno stringbuffer stringbuffer getmsg m_ctx m_pageno m_viewpanel getpageinfo m_pageno getmsg m_ctx m_pagemax m_viewpanel getpageinfomax statusbar setstatusdb tostring m_setting re set drill accross cursor private void cmd drill m drilldown combo drill get selected index 1 1 or 0 if m drilldown set cursor cursor get default cursor else set cursor cursor get predefined cursor cursor hand cursor cmd_drill m_drilldown combodrill getselectedindex m_drilldown setcursor getdefaultcursor setcursor getpredefinedcursor hand_cursor mouse clicked param e event param right click true if right click private void mouse clicked mouse event e boolean right click point point e get point log info right right click point to string if right click m ddq m viewpanel get drill down point m daq m viewpanel get drill across point m ddm null m dam null if m ddq null m daq null return create menu j popup menu pop new j popup menu icon wi env get image icon m window gif if m ddq null m ddm new c menu item m ddq get display name env get ctx wi m ddm set tool tip text m ddq to string m ddm add action listener this pop add m ddm if m daq null m dam new c menu item m daq get display name env get ctx wi m dam set tool tip text m daq to string m dam add action listener this pop add m dam point pp e get point pop show component e get source pp x pp y return set cursor cursor get predefined cursor cursor wait cursor if m drilldown m query query m viewpanel get drill down point if query null log info drill down query get where clause true execute drill query else if combo drill get selected item null combo drill get selected index 0 m query query m viewpanel get drill across point if query null name pair pp name pair combo drill get selected item query set table name pp getid log info drill accross query get where clause true execute drill query cmd drill set cursor rightclick mouse_clicked mouseevent rightclick getpoint rightclick tostring rightclick m_ddq m_viewpanel getdrilldown m_daq m_viewpanel getdrillacross m_ddm m_dam m_ddq m_daq jpopupmenu jpopupmenu getimageicon mwindow m_ddq m_ddm cmenuitem m_ddq getdisplayname getctx m_ddm settooltiptext m_ddq tostring m_ddm addactionlistener m_ddm m_daq m_dam cmenuitem m_daq getdisplayname getctx m_dam settooltiptext m_daq tostring m_dam addactionlistener m_dam getpoint getsource setcursor getpredefinedcursor wait_cursor m_drilldown mquery m_viewpanel getdrilldown getwhereclause executedrill combodrill getselecteditem combodrill getselectedindex mquery m_viewpanel getdrillacross namepair namepair combodrill getselecteditem settablename getwhereclause executedrill cmd_drill setcursor execute drill to query param query query private void execute drill m query query int ad table id a report getad table id query get table name if m role get default is can report ad table id a dialog error m windowno this access cannot report query get table name return if ad table id 0 new a report ad table id null query else log warning no table found for query get where clause true executedrill mquery ad_table_id areport getad_table_id gettablename mrole getdefault iscanreport ad_table_id adialog m_windowno accesscannotreport gettablename ad_table_id areport ad_table_id getwhereclause open window param query query private void cmd window m query query if query null return a env zoom query cmd_window mquery aenv print report private void cmd print set cursor cursor get predefined cursor cursor wait cursor m reportengine get print info set with dialog true m reportengine print cmd drill set cursor cmd_print setcursor getpredefinedcursor wait_cursor m_reportengine getprintinfo setwithdialog m_reportengine cmd_drill setcursor send mail private void cmd sendmail string to m user from m user get env get ctx env getad user id env get ctx string subject m reportengine get name string message file attachment null try attachment file create temp file mail pdf m reportengine getpdf attachment catch exception e log log level severe e e mail dialog emd new e mail dialog this msg get msg env get ctx send mail from to subject message attachment cmd_sendmail muser muser getctx getad_user_id getctx m_reportengine getname createtempfile m_reportengine emaildialog emaildialog getmsg getctx sendmail archive report directly private void cmd archive boolean success false byte data document getpdf as array m reportengine get layout get pageable false no copy if data null m archive archive new m archive env get ctx m reportengine get print info null archive set binary data data success archive save if success a dialog info m windowno this archived else a dialog error m windowno this archive error cmd_archive getpdfasarray m_reportengine getlayout getpageable marchive marchive getctx m_reportengine getprintinfo setbinarydata adialog m_windowno adialog m_windowno archiveerror print setup dialog private void cmd pagesetup set cursor cursor get predefined cursor cursor wait cursor m reportengine page setup dialog revalidate cmd drill set cursor cmd_pagesetup setcursor getpredefinedcursor wait_cursor m_reportengine pagesetupdialog cmd_drill setcursor export private void cmd export log config if m iscanexport a dialog error m windowno this access cannot export get title return j file chooser chooser new j file chooser chooser set dialog type j file chooser save dialog chooser set file selection mode j file chooser files only chooser set dialog title msg get msg m ctx export get title chooser add choosable file filter new extension file filter ps msg get msg m ctx fileps chooser add choosable file filter new extension file filter xml msg get msg m ctx filexml chooser add choosable file filter new extension file filter pdf msg get msg m ctx filepdf chooser add choosable file filter new extension file filter html msg get msg m ctx filehtml chooser add choosable file filter new extension file filter txt msg get msg m ctx filetxt chooser add choosable file filter new extension file filter ssv msg get msg m ctx filessv chooser add choosable file filter new extension file filter csv msg get msg m ctx filecsv if chooser show save dialog this j file chooser approve option return create file file out file extension file filter get file chooser get selected file chooser get file filter try out file create new file catch io exception e log log level severe e a dialog error m windowno this file cannot create e get localized message return string ext out file get path no extension if ext last index of 1 a dialog error m windowno this file invalid extension return ext ext substring ext last index of 1 to lower case log config file out file get path type ext set cursor cursor get predefined cursor cursor wait cursor if ext equals pdf m reportengine createpdf out file else if ext equals ps m reportengine createps out file else if ext equals xml m reportengine createxml out file else if ext equals csv m reportengine createcsv out file m reportengine get print format get language else if ext equals ssv m reportengine createcsv out file m reportengine get print format get language else if ext equals txt m reportengine createcsv out file t m reportengine get print format get language else if ext equals html ext equals htm m reportengine createhtml out file false m reportengine get print format get language else a dialog error m windowno this file invalid extension cmd drill set cursor cmd_export m_iscanexport adialog m_windowno accesscannotexport gettitle jfilechooser jfilechooser setdialogtype jfilechooser save_dialog setfileselectionmode jfilechooser files_only setdialogtitle getmsg m_ctx gettitle addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx addchoosablefilefilter extensionfilefilter getmsg m_ctx showsavedialog jfilechooser approve_option outfile extensionfilefilter getfile getselectedfile getfilefilter outfile createnewfile ioexception adialog m_windowno filecannotcreate getlocalizedmessage outfile getpath lastindexof adialog m_windowno fileinvalidextension lastindexof tolowercase outfile getpath setcursor getpredefinedcursor wait_cursor m_reportengine outfile m_reportengine outfile m_reportengine outfile m_reportengine outfile m_reportengine getprintformat getlanguage m_reportengine outfile m_reportengine getprintformat getlanguage m_reportengine outfile m_reportengine getprintformat getlanguage m_reportengine outfile m_reportengine getprintformat getlanguage adialog m_windowno fileinvalidextension cmd_drill setcursor report combo start other report or create new one private void cmd report key name pair pp key name pair combo report get selected item if pp null return set cursor cursor get predefined cursor cursor wait cursor m print format pf null int ad printformat id pp get key create new if ad printformat id 1 int ad reportview id m reportengine get print format getad reportview id if ad reportview id 0 string name m reportengine get name int index name last index of if index 1 name name substring 0 index pf m print format create from report view m ctx ad reportview id name else int ad table id m reportengine get print format getad table id pf m print format create from table m ctx ad table id if pf null fill combo report pf get id else return else pf m print format get env get ctx ad printformat id true m reportengine set print format pf revalidate cmd drill set cursor cmd_report keynamepair keynamepair comboreport getselecteditem setcursor getpredefinedcursor wait_cursor mprintformat ad_printformat_id getkey ad_printformat_id ad_reportview_id m_reportengine getprintformat getad_reportview_id ad_reportview_id m_reportengine getname lastindexof _ mprintformat createfromreportview m_ctx ad_reportview_id ad_table_id m_reportengine getprintformat getad_table_id mprintformat createfromtable m_ctx ad_table_id fillcomboreport get_id mprintformat getctx ad_printformat_id m_reportengine setprintformat cmd_drill setcursor query report private void cmd find set cursor cursor get predefined cursor cursor wait cursor int ad table id m reportengine get print format getad table id string title null string table name null get find tab info string sql select t ad tab id w name t name w is default t seq no abs tt ad window id t ad window id from ad tab t inner join ad window w on t ad window id w ad window id inner join ad table tt on t ad table id tt ad table id where ad table id order by w is default desc t seq no abs tt ad window id t ad window id int ad tab id db getsql value null sql ad table id sql select name table name from ad tab v where ad tab id if env is base language env get ctx ad tab sql select name table name from ad tab vt where ad tab id and ad language env getad language env get ctx try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad tab id result set rs pstmt execute query if rs next title rs get string 1 table name rs get string 2 rs close pstmt close catch sql exception e log log level severe sql e m field find fields null if table name null find fields m field create fields m ctx m windowno 0 ad tab id if find fields null no tab for table exists b find set enabled false else find find new find this m windowno title ad table id table name find fields 1 m reportengine set query find get query revalidate cmd drill set cursor cmd_find setcursor getpredefinedcursor wait_cursor ad_table_id m_reportengine getprintformat getad_table_id tablename ad_tab_id isdefault seqno ad_window_id ad_window_id ad_tab ad_window ad_window_id ad_window_id ad_table ad_table_id ad_table_id ad_table_id isdefault seqno ad_window_id ad_window_id ad_tab_id getsqlvalue ad_table_id tablename ad_tab_v ad_tab_id isbaselanguage getctx ad_tab tablename ad_tab_vt ad_tab_id ad_language getad_language getctx preparedstatement preparestatement setint ad_tab_id resultset executequery getstring tablename getstring sqlexception mfield findfields tablename findfields mfield createfields m_ctx m_windowno ad_tab_id findfields bfind setenabled m_windowno ad_table_id tablename findfields m_reportengine setquery getquery cmd_drill setcursor call customize private void cmd customize a window win new a window new a window listener win this forwards window events int ad window id 240 hardcoded int ad printformat id m reportengine get print format get id win init window ad window id m query get equal query ad printformat id ad printformat id a env show center screen win see window state changed for applying change cmd_customize awindow awindow awindowlistener ad_window_id ad_printformat_id m_reportengine getprintformat get_id initwindow ad_window_id mquery getequalquery ad_printformat_id ad_printformat_id aenv showcenterscreen windowstatechanged window state listener for customize window param e event public void window state changed window event e the customize window was closed if e getid window event window closed m reportengine null set cursor cursor get predefined cursor cursor wait cursor log info re read print format int ad printformat id m reportengine get print format get id language language m reportengine get print format get language m print format pf m print format get env get ctx ad printformat id true pf set language language needs to be re set otherwise viewer will be blank pf set translation language language m reportengine set print format pf revalidate cmd drill set cursor windowstatechanged windowevent windowevent window_closed m_reportengine setcursor getpredefinedcursor wait_cursor printformat ad_printformat_id m_reportengine getprintformat get_id m_reportengine getprintformat getlanguage mprintformat mprintformat getctx ad_printformat_id setlanguage settranslationlanguage m_reportengine setprintformat cmd_drill setcursor set zoom level private void cmd zoom set cursor cursor get predefined cursor cursor wait cursor m viewpanel set zoom level combo zoom get selected index revalidate cmd drill set cursor cmd_zoom setcursor getpredefinedcursor wait_cursor m_viewpanel setzoomlevel combozoom getselectedindex cmd_drill setcursor show translation dialog translate base table entry will be copied to trl tables if not multi lingual private void cmd translate array list value name pair list new array list value name pair value name pair pp null string sql select name ad language from ad language where is system language y order by 1 try prepared statement pstmt db prepare statement sql sql result set rs pstmt execute query while rs next list add new value name pair rs get string 2 rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e if list size 0 a dialog warn m windowno this no translation return dialog string title msg get msg env get ctx print format trl true string message msg get msg env get ctx print format trl false int choice j option pane show option dialog this message title j option pane ok option j option pane question message null list to array null if choice j option pane closed option return pp value name pair list get choice string ad language pp get value int ad printformat id m reportengine get print format get id log config ad language ad printformat id ad printformat id string buffer sb new string buffer english if language is base language ad language sb append update ad printformatitem pfi set name select e name from ad element e ad column c where e ad element id c ad element id and c ad column id pfi ad column id print name select e print name from ad element e ad column c where e ad element id c ad element id and c ad column id pfi ad column id where ad printformat id append ad printformat id append and exists select from ad element e ad column c where e ad element id c ad element id and c ad column id pfi ad column id else ad language ad language sb append update ad printformatitem pfi set name select e name from ad element trl e ad column c where e ad language append ad language append and e ad element id c ad element id and c ad column id pfi ad column id print name select e print name from ad element trl e ad column c where e ad language append ad language append and e ad element id c ad element id and c ad column id pfi ad column id where ad printformat id append ad printformat id append and exists select from ad element trl e ad column c where e ad language append ad language append and e ad element id c ad element id and c ad column id pfi ad column id int count db execute update sb to string null log config count count m reportengine set print format m print format get env get ctx ad printformat id true revalidate cmd_translate arraylist valuenamepair arraylist valuenamepair valuenamepair ad_language ad_language issystemlanguage preparedstatement preparestatement resultset executequery valuenamepair getstring getstring sqlexception adialog m_windowno notranslation getmsg getctx printformattrl getmsg getctx printformattrl joptionpane showoptiondialog joptionpane ok_option joptionpane question_message toarray joptionpane closed_option valuenamepair ad_language getvalue ad_printformat_id m_reportengine getprintformat get_id ad_language ad_printformat_id ad_printformat_id stringbuffer stringbuffer isbaselanguage ad_language ad_printformatitem ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id printname printname ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id ad_printformat_id ad_printformat_id ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id ad_language ad_language ad_printformatitem ad_element_trl ad_column ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id printname printname ad_element_trl ad_column ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id ad_printformat_id ad_printformat_id ad_element_trl ad_column ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id executeupdate tostring m_reportengine setprintformat mprintformat getctx ad_printformat_id test param args args static public void main string args login init test true m query q new m query c invoice q add restriction c invoice id m query equal new integer 103 102 invoice 100 order print info i new print info test x c invoice table id 102 0 m print format f m print format get env get ctx 102 false report engine re new report engine env get ctx f q i m print format f new m print format env get ctx 101 report engine re new report engine f null new viewer re inittest mquery mquery c_invoice addrestriction c_invoice_id mquery printinfo printinfo x_c_invoice table_id mprintformat mprintformat getctx reportengine reportengine getctx mprintformat mprintformat getctx reportengine reportengine standard constructor public x m product po properties ctx int m product po id string trx name super ctx m product po id trx name if m product po id 0 setc bpartner id 0 0 set is current vendor true y setm product id 0 m product id set vendor product no null value x_m_product_po m_product_po_id trxname m_product_po_id trxname m_product_po_id setc_bpartner_id setiscurrentvendor setm_product_id m_product_id setvendorproductno load constructor public x m product po properties ctx result set rs string trx name super ctx rs trx name x_m_product_po resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product po append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_po get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set cost per order fixed cost per order public void set cost per order big decimal cost per order set value cost per order cost per order setcostperorder bigdecimal costperorder set_value costperorder costperorder get cost per order fixed cost per order public big decimal get cost per order big decimal bd big decimal get value cost per order if bd null return env zero return bd bigdecimal getcostperorder bigdecimal bigdecimal get_value costperorder set actual delivery time actual days between order and delivery public void setdeliverytime actual int deliverytime actual set value deliverytime actual new integer deliverytime actual setdeliverytime_actual deliverytime_actual set_value deliverytime_actual deliverytime_actual get actual delivery time actual days between order and delivery public int getdeliverytime actual integer ii integer get value deliverytime actual if ii null return 0 return ii int value getdeliverytime_actual get_value deliverytime_actual intvalue set promised delivery time promised days between order and delivery public void setdeliverytime promised int deliverytime promised set value deliverytime promised new integer deliverytime promised setdeliverytime_promised deliverytime_promised set_value deliverytime_promised deliverytime_promised get promised delivery time promised days between order and delivery public int getdeliverytime promised integer ii integer get value deliverytime promised if ii null return 0 return ii int value getdeliverytime_promised get_value deliverytime_promised intvalue set discontinued this product is no longer available public void set discontinued boolean discontinued set value discontinued new boolean discontinued setdiscontinued set_value get discontinued this product is no longer available public boolean is discontinued object oo get value discontinued if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscontinued get_value booleanvalue set discontinued by discontinued by public void set discontinued by timestamp discontinued by set value discontinued by discontinued by setdiscontinuedby discontinuedby set_value discontinuedby discontinuedby get discontinued by discontinued by public timestamp get discontinued by return timestamp get value discontinued by getdiscontinuedby get_value discontinuedby set current vendor use this vendor for pricing and stock replenishment public void set is current vendor boolean is current vendor set value is current vendor new boolean is current vendor setiscurrentvendor iscurrentvendor set_value iscurrentvendor iscurrentvendor get current vendor use this vendor for pricing and stock replenishment public boolean is current vendor object oo get value is current vendor if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscurrentvendor get_value iscurrentvendor booleanvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set manufacturer manufacturer of the product public void set manufacturer string manufacturer if manufacturer null manufacturer length 30 log warning length 30 truncated manufacturer manufacturer substring 0 29 set value manufacturer manufacturer setmanufacturer set_value get manufacturer manufacturer of the product public string get manufacturer return string get value manufacturer getmanufacturer get_value set minimum order qty minimum order quantity in uom public void setorder min big decimal order min set value order min order min setorder_min bigdecimal order_min set_value order_min order_min get minimum order qty minimum order quantity in uom public big decimal getorder min big decimal bd big decimal get value order min if bd null return env zero return bd bigdecimal getorder_min bigdecimal bigdecimal get_value order_min set order pack qty package order size in uom e g order set of 5 units public void setorder pack big decimal order pack set value order pack order pack setorder_pack bigdecimal order_pack set_value order_pack order_pack get order pack qty package order size in uom e g order set of 5 units public big decimal getorder pack big decimal bd big decimal get value order pack if bd null return env zero return bd bigdecimal getorder_pack bigdecimal bigdecimal get_value order_pack set price effective effective date of price public void set price effective timestamp price effective set value price effective price effective setpriceeffective priceeffective set_value priceeffective priceeffective get price effective effective date of price public timestamp get price effective return timestamp get value price effective getpriceeffective get_value priceeffective set last invoice price price of the last invoice for the product public void set price last inv big decimal price last inv set valuenocheck price last inv price last inv setpricelastinv bigdecimal pricelastinv set_valuenocheck pricelastinv pricelastinv get last invoice price price of the last invoice for the product public big decimal get price last inv big decimal bd big decimal get value price last inv if bd null return env zero return bd bigdecimal getpricelastinv bigdecimal bigdecimal get_value pricelastinv set last po price price of the last purchase order for the product public void set price lastpo big decimal price lastpo set valuenocheck price lastpo price lastpo setpricelastpo bigdecimal pricelastpo set_valuenocheck pricelastpo pricelastpo get last po price price of the last purchase order for the product public big decimal get price lastpo big decimal bd big decimal get value price lastpo if bd null return env zero return bd bigdecimal getpricelastpo bigdecimal bigdecimal get_value pricelastpo set list price list price public void set price list big decimal price list set value price list price list setpricelist bigdecimal pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set po price price based on a purchase order public void set pricepo big decimal pricepo set value pricepo pricepo setpricepo bigdecimal set_value get po price price based on a purchase order public big decimal get pricepo big decimal bd big decimal get value pricepo if bd null return env zero return bd bigdecimal getpricepo bigdecimal bigdecimal get_value set quality rating method for rating vendors public void set quality rating int quality rating set value quality rating new integer quality rating setqualityrating qualityrating set_value qualityrating qualityrating get quality rating method for rating vendors public int get quality rating integer ii integer get value quality rating if ii null return 0 return ii int value getqualityrating get_value qualityrating intvalue set royalty amount included amount for copyright etc public void set royalty amt big decimal royalty amt set value royalty amt royalty amt setroyaltyamt bigdecimal royaltyamt set_value royaltyamt royaltyamt get royalty amount included amount for copyright etc public big decimal get royalty amt big decimal bd big decimal get value royalty amt if bd null return env zero return bd bigdecimal getroyaltyamt bigdecimal bigdecimal get_value royaltyamt set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 20 log warning length 20 truncated upc upc substring 0 19 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set partner category product category of the business partner public void set vendor category string vendor category if vendor category null vendor category length 30 log warning length 30 truncated vendor category vendor category substring 0 29 set value vendor category vendor category setvendorcategory vendorcategory vendorcategory vendorcategory vendorcategory vendorcategory set_value vendorcategory vendorcategory get partner category product category of the business partner public string get vendor category return string get value vendor category getvendorcategory get_value vendorcategory set partner product key product key of the business partner public void set vendor product no string vendor product no if vendor product no null throw new illegal argument exception vendor product no is mandatory if vendor product no length 30 log warning length 30 truncated vendor product no vendor product no substring 0 29 set value vendor product no vendor product no setvendorproductno vendorproductno vendorproductno illegalargumentexception vendorproductno vendorproductno vendorproductno vendorproductno set_value vendorproductno vendorproductno get partner product key product key of the business partner public string get vendor product no return string get value vendor product no getvendorproductno get_value vendorproductno initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception invoice servlet init servletexception servletconfig servletexception webenv initweb servletexception invoiceservlet get servlet information return info public string get servlet info return a dempiere web invoice servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request logout delete cookie sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr string url invoices jsp http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter invoice id if invoice is valid and belongs to wu then create pdf stream it string msg stream invoice request response if msg null msg length 0 return if info null info set message msg log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response deletecookie servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession getattribute removeattribute websessionctx hdr_message getattribute setmessage invoice_id streaminvoice setmessage requestdispatcher getservletcontext getrequestdispatcher process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr doget stream invoice param request request param response response return or error message private string stream invoice http servlet request request http servlet response response int min size 2000 if not created size is 1015 get invoice id int c invoice id web util get parameter as int request invoice id if c invoice id 0 log fine no id return no invoice id get invoice properties ctx jsp env get ctx request m invoice invoice new m invoice ctx c invoice id null if invoice getc invoice id c invoice id log fine invoice not found id c invoice id return invoice not found get web user compare with invoice http session session request get session true web user wu web user session get attribute web user name if wu getc bpartner id invoice getc bpartner id log warning invoice from b partner c invoice id c invoice id bp invoice invoice getc bpartner id bp web wu getc bpartner id return your invoice not found check directory string dir name ctx get property document dir try file dir new file dir name if dir exists dir mkdir catch exception ex log log level severe could not create directory dir name ex return streaming error directory check if invoice already created string file name invoice getpdf file name dir name file file new file file name if file exists file is file file length min size log info existing file new timestamp file last modified else log info new file name file invoice createpdf file if file null invoice set date printed new timestamp system current time millis invoice save issue error if file null file exists file length min size log warning file does not exist file return streaming error file send pdf try int buffer size 2048 2k buffer int file length int file length response set content type application pdf response set buffer size buffer size response set content length file length log fine file get absolute path length file length long time system current time millis timer start file input stream in new file input stream file servlet output stream out response get output stream byte buffer new byte buffer size double total size 0 int count 0 do count in read buffer 0 buffer size if count 0 total size count out write buffer 0 count while count 1 out flush out close in close time system current time millis time double speed total size 1024 double time 1000 log fine length total size time ms speed kb sec catch io exception ex log log level severe ex to string return streaming error return null streaminvoice httpservletrequest httpservletresponse min_size c_invoice_id webutil getparameterasint invoice_id c_invoice_id jspenv getctx minvoice minvoice c_invoice_id getc_invoice_id c_invoice_id c_invoice_id webuser httpsession getsession webuser webuser getattribute webuser getc_bpartner_id getc_bpartner_id bpartner c_invoice_id c_invoice_id bp_invoice getc_bpartner_id bp_web getc_bpartner_id dirname getproperty documentdir dirname dirname filename getpdffilename dirname filename isfile min_size lastmodified filename setdateprinted currenttimemillis min_size buffersize filelength setcontenttype setbuffersize buffersize setcontentlength filelength getabsolutepath filelength currenttimemillis fileinputstream fileinputstream servletoutputstream getoutputstream buffersize totalsize buffersize totalsize currenttimemillis totalsize totalsize ioexception tostring standard constructor public x c country properties ctx int c country id string trx name super ctx c country id trx name if c country id 0 setc country id 0 set country code null set display sequence null c r p sethaspostal add false set has region false set is address lines local reverse false set is address lines reverse false set name null x_c_country c_country_id trxname c_country_id trxname c_country_id setc_country_id setcountrycode setdisplaysequence sethaspostal_add sethasregion setisaddresslineslocalreverse setisaddresslinesreverse setname load constructor public x c country properties ctx result set rs string trx name super ctx rs trx name x_c_country resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c country append get id append return sb to string tostring stringbuffer stringbuffer x_c_country get_id tostring public static final int ad language ad reference id 106 set language language for this entity public void setad language string ad language if ad language null ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set country country public void setc country id int c country id if c country id 1 throw new illegal argument exception c country id is mandatory set valuenocheck c country id new integer c country id setc_country_id c_country_id c_country_id illegalargumentexception c_country_id set_valuenocheck c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public void set country code string country code if country code null throw new illegal argument exception country code is mandatory if country code length 2 log warning length 2 truncated country code country code substring 0 1 set value country code country code iso_3166 setcountrycode countrycode countrycode illegalargumentexception countrycode countrycode countrycode countrycode set_value countrycode countrycode get iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public string get country code return string get value country code iso_3166 getcountrycode get_value countrycode set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set address print format format for printing this address public void set display sequence string display sequence if display sequence null throw new illegal argument exception display sequence is mandatory if display sequence length 20 log warning length 20 truncated display sequence display sequence substring 0 19 set value display sequence display sequence setdisplaysequence displaysequence displaysequence illegalargumentexception displaysequence displaysequence displaysequence displaysequence set_value displaysequence displaysequence get address print format format for printing this address public string get display sequence return string get value display sequence getdisplaysequence get_value displaysequence set local address format format for printing this address locally public void set display sequence local string display sequence local if display sequence local null display sequence local length 20 log warning length 20 truncated display sequence local display sequence local substring 0 19 set value display sequence local display sequence local setdisplaysequencelocal displaysequencelocal displaysequencelocal displaysequencelocal displaysequencelocal displaysequencelocal set_value displaysequencelocal displaysequencelocal get local address format format for printing this address locally public string get display sequence local return string get value display sequence local getdisplaysequencelocal get_value displaysequencelocal set bank account no format format of the bank account public void set expression bank account no string expression bank account no if expression bank account no null expression bank account no length 20 log warning length 20 truncated expression bank account no expression bank account no substring 0 19 set value expression bank account no expression bank account no setexpressionbankaccountno expressionbankaccountno expressionbankaccountno expressionbankaccountno expressionbankaccountno expressionbankaccountno set_value expressionbankaccountno expressionbankaccountno get bank account no format format of the bank account public string get expression bank account no return string get value expression bank account no getexpressionbankaccountno get_value expressionbankaccountno set bank routing no format format of the bank routing number public void set expression bank routing no string expression bank routing no if expression bank routing no null expression bank routing no length 20 log warning length 20 truncated expression bank routing no expression bank routing no substring 0 19 set value expression bank routing no expression bank routing no setexpressionbankroutingno expressionbankroutingno expressionbankroutingno expressionbankroutingno expressionbankroutingno expressionbankroutingno set_value expressionbankroutingno expressionbankroutingno get bank routing no format format of the bank routing number public string get expression bank routing no return string get value expression bank routing no getexpressionbankroutingno get_value expressionbankroutingno set phone format format of the phone can contain fixed format elements variables llooaacca09 public void set expression phone string expression phone if expression phone null expression phone length 20 log warning length 20 truncated expression phone expression phone substring 0 19 set value expression phone expression phone _llooaacca09 setexpressionphone expressionphone expressionphone expressionphone expressionphone expressionphone set_value expressionphone expressionphone get phone format format of the phone can contain fixed format elements variables llooaacca09 public string get expression phone return string get value expression phone _llooaacca09 getexpressionphone get_value expressionphone set postal code format format of the postal code can contain fixed format elements variables llooaacca09 public void set expression postal string expression postal if expression postal null expression postal length 20 log warning length 20 truncated expression postal expression postal substring 0 19 set value expression postal expression postal _llooaacca09 setexpressionpostal expressionpostal expressionpostal expressionpostal expressionpostal expressionpostal set_value expressionpostal expressionpostal get postal code format format of the postal code can contain fixed format elements variables llooaacca09 public string get expression postal return string get value expression postal _llooaacca09 getexpressionpostal get_value expressionpostal set additional postal format format of the value can contain fixed format elements variables llooaacca09 public void setexpressionpostal add string expressionpostal add if expressionpostal add null expressionpostal add length 20 log warning length 20 truncated expressionpostal add expressionpostal add substring 0 19 set value expressionpostal add expressionpostal add _llooaacca09 setexpressionpostal_add expressionpostal_add expressionpostal_add expressionpostal_add expressionpostal_add expressionpostal_add set_value expressionpostal_add expressionpostal_add get additional postal format format of the value can contain fixed format elements variables llooaacca09 public string getexpressionpostal add return string get value expressionpostal add _llooaacca09 getexpressionpostal_add get_value expressionpostal_add set additional postal code has additional postal code public void sethaspostal add boolean haspostal add set value haspostal add new boolean haspostal add sethaspostal_add haspostal_add set_value haspostal_add haspostal_add get additional postal code has additional postal code public boolean ishaspostal add object oo get value haspostal add if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishaspostal_add get_value haspostal_add booleanvalue set country has region country contains regions public void set has region boolean has region set value has region new boolean has region sethasregion hasregion set_value hasregion hasregion get country has region country contains regions public boolean is has region object oo get value has region if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishasregion get_value hasregion booleanvalue set reverse local address lines print local address in reverse order public void set is address lines local reverse boolean is address lines local reverse set value is address lines local reverse new boolean is address lines local reverse setisaddresslineslocalreverse isaddresslineslocalreverse set_value isaddresslineslocalreverse isaddresslineslocalreverse get reverse local address lines print local address in reverse order public boolean is address lines local reverse object oo get value is address lines local reverse if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaddresslineslocalreverse get_value isaddresslineslocalreverse booleanvalue set reverse address lines print address in reverse order public void set is address lines reverse boolean is address lines reverse set value is address lines reverse new boolean is address lines reverse setisaddresslinesreverse isaddresslinesreverse set_value isaddresslinesreverse isaddresslinesreverse get reverse address lines print address in reverse order public boolean is address lines reverse object oo get value is address lines reverse if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaddresslinesreverse get_value isaddresslinesreverse booleanvalue set media size java media size public void set media size string media size if media size null media size length 40 log warning length 40 truncated media size media size substring 0 39 set value media size media size setmediasize mediasize mediasize mediasize mediasize mediasize set_value mediasize mediasize get media size java media size public string get media size return string get value media size getmediasize get_value mediasize set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set region name of the region public void set region name string region name if region name null region name length 60 log warning length 60 truncated region name region name substring 0 59 set value region name region name setregionname regionname regionname regionname regionname regionname set_value regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname constructor param ctx context param window no window no to derive ad client org for new records public m location lookup properties ctx int window no super display type table dir window no m ctx ctx windowno ad_client mlocationlookup windowno displaytype tabledir windowno m_ctx get display for value not cached param value location id return string value public string get display object value if value null return null m location loc get location value null if loc null return value to string return loc to string location_id getdisplay mlocation getlocation tostring tostring get object of key value param value value return object or null public name pair get object value if value null return null m location loc get location value null if loc null return null return new key name pair loc getc location id loc to string namepair mlocation getlocation keynamepair getc_location_id tostring the lookup contains the key param key location id return true if key known public boolean contains key object key return get location key null null location_id containskey getlocation get location return location public m location get location object key string trx name if key null return null int c location id 0 if key instanceof integer c location id integer key int value else if key null c location id integer parse int key to string return get location c location id trx name mlocation getlocation trxname c_location_id c_location_id intvalue c_location_id parseint tostring getlocation c_location_id trxname get location return location public m location get location int c location id string trx name return m location get m ctx c location id trx name mlocation getlocation c_location_id trxname mlocation m_ctx c_location_id trxname get underlying fully qualified table column name used for v lookup action button zoom return column name public string get column name return c location id vlookup actionbutton getcolumnname c_location_id return data as sorted array not implemented param mandatory mandatory param only validated only validated param only active only active param temporary force load for temporary display return null public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary log log level severe not implemented return null onlyvalidated onlyactive arraylist getdata onlyvalidated onlyactive public string filter super 4 stringfilter returns the name of the filter public string get info return string filter getinfo stringfilter this method actually performs the filtering public string process string to process system out println n string to process in string filter to process string value split to process string buffer new value new string buffer for int x 0 x value length x if has attribute value x new value append string get value x else new value append value x if x value length 1 new value append return new value to string to_process nstring stringfilter to_process to_process stringbuffer new_value stringbuffer hasattribute new_value new_value new_value new_value tostring put a filter somewhere we can get to it public filter add attribute string attribute object entity put attribute entity return this addattribute get rid of a current filter public filter remove attribute string attribute try remove attribute catch null pointer exception exc don t really care if this throws a null pointer exception return this removeattribute nullpointerexception does the filter filter this public boolean has attribute string attribute return contains key attribute hasattribute containskey need a way to parse the stream so we can do string comparisons instead of character comparisons private string split string to split if to split null to split length 0 string array new string 0 return array string buffer sb new string buffer to split length 50 string character iterator sci new string character iterator to split int length 0 for char c sci first c character iterator done c sci next if string value of c equals length else if sci get end index 1 sci get index length string array new string length length 0 string tmp new string for char c sci first c character iterator done c sci next if string value of c equals array length tmp tmp new string length else if sci get end index 1 sci get index tmp tmp string value of sci last array length tmp tmp new string length else tmp string value of c return array to_split to_split to_split stringbuffer stringbuffer to_split stringcharacteriterator stringcharacteriterator to_split characteriterator valueof getendindex getindex characteriterator valueof getendindex getindex valueof valueof get empty template business partner param ctx context param ad client id client return template business partner or null public static mb partner get template properties ctx int ad client id mb partner template getb partner cash trx ctx ad client id if template null template new mb partner ctx 0 null reset if template null template set valuenocheck c bpartner id new integer 0 template set value template set name template set name2 null template setduns template set first sale null template setso creditlimit env zero template setso creditused env zero template set total open balance env zero s template set rating null template set actual life time value env zero template set potential life time value env zero template set acqusition cost env zero template set share of customer 0 template set sales volume 0 return template ad_client_id mbpartner gettemplate ad_client_id mbpartner getbpartnercashtrx ad_client_id mbpartner set_valuenocheck c_bpartner_id setvalue setname setname2 setfirstsale setso_creditlimit setso_creditused settotalopenbalance s_template setrating setactuallifetimevalue setpotentiallifetimevalue setacqusitioncost setshareofcustomer setsalesvolume get cash trx business partner param ctx context param ad client id client return cash trx business partner or null public static mb partner getb partner cash trx properties ctx int ad client id mb partner ret value null string sql select from c bpartner where c bpartner id select c bpartnercashtrx id from ad clientinfo where ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next ret value new mb partner ctx rs null else s log log level severe not found for ad client id ad client id rs close pstmt close pstmt null catch exception e s log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null return ret value ad_client_id mbpartner getbpartnercashtrx ad_client_id mbpartner retvalue c_bpartner c_bpartner_id c_bpartnercashtrx_id ad_clientinfo ad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery retvalue mbpartner s_log ad_client_id ad_client_id s_log retvalue get b partner with value param ctx context param value value return b partner or null public static mb partner get properties ctx string value if value null value length 0 return null mb partner ret value null int ad client id env getad client id ctx string sql select from c bpartner where value and ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 value pstmt set int 2 ad client id result set rs pstmt execute query if rs next ret value new mb partner ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value bpartner bpartner mbpartner mbpartner retvalue ad_client_id getad_client_id c_bpartner ad_client_id preparedstatement preparestatement setstring setint ad_client_id resultset executequery retvalue mbpartner s_log retvalue get not invoiced shipment value param c bpartner id partner return value in accounting currency public static big decimal get not invoiced amt int c bpartner id big decimal ret value null string sql select sum coalesce currency base ol qty delivered ol qty invoiced ol price actual o c currency id o date ordered o ad client id o ad org id 0 from c orderline ol inner join c order o on ol c order id o c order id where o isso trx y and bill bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value c_bpartner_id bigdecimal getnotinvoicedamt c_bpartner_id bigdecimal retvalue currencybase qtydelivered qtyinvoiced priceactual c_currency_id dateordered ad_client_id ad_org_id c_orderline c_order c_order_id c_order_id issotrx bill_bpartner_id preparedstatement preparestatement setint c_bpartner_id resultset executequery retvalue getbigdecimal s_log retvalue constructor for new b partner from template param ctx context public mb partner properties ctx this ctx 1 null bpartner mbpartner default constructor param ctx context param rs result set to load from public mb partner properties ctx result set rs string trx name super ctx rs trx name resultset mbpartner resultset trxname trxname default constructor param ctx context param c bpartner id partner or 0 or 1 load from template param trx name trx name public mb partner properties ctx int c bpartner id string trx name super ctx c bpartner id trx name if c bpartner id 1 init template env get context as int ctx ad client id c bpartner id 0 if c bpartner id 0 set value set name set name2 null setduns set is customer true set is prospect true set sende mail false set is one time false set is vendor false set is summary false set is employee false set is sales rep false set is tax exempt false set is discount printed false setso creditlimit env zero setso creditused env zero set total open balance env zero setso credit status socreditstatus nocreditcheck set first sale null set actual life time value env zero set potential life time value env zero set acqusition cost env zero set share of customer 0 set sales volume 0 log fine to string c_bpartner_id trxname mbpartner c_bpartner_id trxname c_bpartner_id trxname c_bpartner_id inittemplate getcontextasint ad_client_id c_bpartner_id c_bpartner_id setvalue setname setname2 setiscustomer setisprospect setsendemail setisonetime setisvendor setissummary setisemployee setissalesrep setistaxexempt setisdiscountprinted setso_creditlimit setso_creditused settotalopenbalance setsocreditstatus socreditstatus_nocreditcheck setfirstsale setactuallifetimevalue setpotentiallifetimevalue setacqusitioncost setshareofcustomer setsalesvolume tostring import contstructor param impbp import public mb partner x i bpartner impbp this impbp get ctx 0 impbp get trxname set client org impbp set updated by impbp get updated by string value impbp get value if value null value length 0 value impbp gete mail if value null value length 0 value impbp get contact name set value value string name impbp get name if name null name length 0 name impbp get contact name if name null name length 0 name impbp gete mail set name name set name2 impbp get name2 set description impbp get description set help impbp get help setduns impbp getduns set taxid impbp get taxid setnaics impbp getnaics setc bp group id impbp getc bp group id mbpartner x_i_bpartner getctx get_trxname setclientorg setupdatedby getupdatedby getvalue getemail getcontactname setvalue getname getcontactname getemail setname setname2 getname2 setdescription getdescription sethelp gethelp settaxid gettaxid setc_bp_group_id getc_bp_group_id load default b partner param ad client id client private boolean init template int ad client id if ad client id 0 throw new illegal argument exception client id 0 boolean success true string sql select from c bpartner where c bpartner id select c bpartnercashtrx id from ad clientinfo where ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next success load rs else load 0 null success false log severe none found rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null set standard defaults reset set valuenocheck c bpartner id i zero set value set name set name2 null return success bpartner ad_client_id inittemplate ad_client_id ad_client_id illegalargumentexception client_id c_bpartner c_bpartner_id c_bpartnercashtrx_id ad_clientinfo ad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery setstandarddefaults set_valuenocheck c_bpartner_id i_zero setvalue setname setname2 get all contacts param reload if true users will be requeried return contacts public m user get contacts boolean reload if reload m contacts null m contacts length 0 else return m contacts array list m user list new array list m user string sql select from ad user where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m user get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m contacts new m user list size list to array m contacts return m contacts muser getcontacts m_contacts m_contacts m_contacts arraylist muser arraylist muser ad_user c_bpartner_id preparedstatement preparestatement setint getc_bpartner_id resultset executequery muser getctx m_contacts muser toarray m_contacts m_contacts get specified or first contact param ad user id optional user return contact or null public m user get contact int ad user id m user users get contacts false if users length 0 return null for int i 0 ad user id 0 i users length i if users i getad user id ad user id return users i return users 0 ad_user_id muser getcontact ad_user_id muser getcontacts ad_user_id getad_user_id ad_user_id get all locations param reload if true locations will be requeried return locations public mb partner location get locations boolean reload if reload m locations null m locations length 0 else return m locations array list mb partner location list new array list mb partner location string sql select from c bpartner location where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new mb partner location get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m locations new mb partner location list size list to array m locations return m locations mbpartnerlocation getlocations m_locations m_locations m_locations arraylist mbpartnerlocation arraylist mbpartnerlocation c_bpartner_location c_bpartner_id preparedstatement preparestatement get_trxname setint getc_bpartner_id resultset executequery mbpartnerlocation getctx get_trxname m_locations mbpartnerlocation toarray m_locations m_locations get explicit or first bill location param c bpartner location id optional explicit location return location or null public mb partner location get location int c bpartner location id mb partner location locations get locations false if locations length 0 return null mb partner location ret value null for int i 0 i locations length i if locations i getc bpartner location id c bpartner location id return locations i if ret value null locations i is bill to ret value locations i if ret value null return locations 0 return ret value c_bpartner_location_id mbpartnerlocation getlocation c_bpartner_location_id mbpartnerlocation getlocations mbpartnerlocation retvalue getc_bpartner_location_id c_bpartner_location_id retvalue isbillto retvalue retvalue retvalue get bank accounts param requery requery return bank accounts public mbp bank account get bank accounts boolean requery if m accounts null m accounts length 0 requery re load return m accounts array list mbp bank account list new array list mbp bank account string sql select from c bp bankaccount where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new mbp bank account get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m accounts new mbp bank account list size list to array m accounts return m accounts mbpbankaccount getbankaccounts m_accounts m_accounts m_accounts arraylist mbpbankaccount arraylist mbpbankaccount c_bp_bankaccount c_bpartner_id preparedstatement preparestatement get_trxname setint getc_bpartner_id resultset executequery mbpbankaccount getctx get_trxname m_accounts mbpbankaccount toarray m_accounts m_accounts string representation return info public string to string string buffer sb new string buffer mb partner id append get id append value append get value append name append get name append open append get total open balance append return sb to string tostring stringbuffer stringbuffer mbpartner get_id getvalue getname gettotalopenbalance tostring set client org param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id set linked organization is button param ad orgbp id public void setad orgbp id int ad orgbp id if ad orgbp id 0 super setad orgbp id null else super setad orgbp id string value of ad orgbp id ad_orgbp_id setad_orgbp_id ad_orgbp_id ad_orgbp_id setad_orgbp_id setad_orgbp_id valueof ad_orgbp_id get linked organization is button the business partner is another organization for explicit inter org transactions public int getad orgbp id int string org super getad orgbp id if org null return 0 int ad orgbp id 0 try ad orgbp id integer parse int org catch exception ex log log level severe org ex return ad orgbp id getad_orgbp_id_int getad_orgbp_id ad_orgbp_id ad_orgbp_id parseint ad_orgbp_id get primary c bpartner location id return c bpartner location id public int getprimaryc bpartner location id if m primaryc bpartner location id null mb partner location locs get locations false for int i 0 m primaryc bpartner location id null i locs length i if locs i is bill to setprimaryc bpartner location id locs i getc bpartner location id break get first if m primaryc bpartner location id null locs length 0 setprimaryc bpartner location id locs 0 getc bpartner location id if m primaryc bpartner location id null return 0 return m primaryc bpartner location id int value c_bpartner_location_id c_bpartner_location_id getprimaryc_bpartner_location_id m_primaryc_bpartner_location_id mbpartnerlocation getlocations m_primaryc_bpartner_location_id isbillto setprimaryc_bpartner_location_id getc_bpartner_location_id m_primaryc_bpartner_location_id setprimaryc_bpartner_location_id getc_bpartner_location_id m_primaryc_bpartner_location_id m_primaryc_bpartner_location_id intvalue get primary ad user id return ad user id public int getprimaryad user id if m primaryad user id null m user users get contacts false for int i 0 i users length i if m primaryad user id null users length 0 setprimaryad user id users 0 getad user id if m primaryad user id null return 0 return m primaryad user id int value ad_user_id ad_user_id getprimaryad_user_id m_primaryad_user_id muser getcontacts m_primaryad_user_id setprimaryad_user_id getad_user_id m_primaryad_user_id m_primaryad_user_id intvalue set primary c bpartner location id param c bpartner location id id public void setprimaryc bpartner location id int c bpartner location id m primaryc bpartner location id new integer c bpartner location id c_bpartner_location_id c_bpartner_location_id setprimaryc_bpartner_location_id c_bpartner_location_id m_primaryc_bpartner_location_id c_bpartner_location_id set primary ad user id param ad user id id public void setprimaryad user id int ad user id m primaryad user id new integer ad user id ad_user_id ad_user_id setprimaryad_user_id ad_user_id m_primaryad_user_id ad_user_id calculate total open balance and so creditused includes drafted invoices public void set total open balance big decimal so creditused null big decimal total open balance null string sql select so credit used coalesce select sum currency base invoice open i c invoice id i c invoicepayschedule id i c currency id i date ordered i ad client id i ad org id from c invoice v i where i c bpartner id bp c bpartner id and i isso trx y and i is paid n 0 balance incl unallocated payments coalesce select sum currency base invoice open i c invoice id i c invoicepayschedule id i c currency id i date ordered i ad client id i ad org id i multiplierap from c invoice v i where i c bpartner id bp c bpartner id and i is paid n 0 coalesce select sum currency base p pay amt p c currency id p date trx p ad client id p ad org id from c payment v p where p c bpartner id bp c bpartner id and p is allocated n and p c charge id is null and not exists select from c allocationline al where p c payment id al c payment id 0 from c bpartner bp where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc bpartner id result set rs pstmt execute query if rs next so creditused rs get big decimal 1 total open balance rs get big decimal 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m totalopenbalanceset true if so creditused null super setso creditused so creditused if total open balance null super set total open balance total open balance setso credit status so_creditused settotalopenbalance bigdecimal so_creditused bigdecimal totalopenbalance currencybase invoiceopen c_invoice_id c_invoicepayschedule_id c_currency_id dateordered ad_client_id ad_org_id c_invoice_v c_bpartner_id c_bpartner_id issotrx ispaid currencybase invoiceopen c_invoice_id c_invoicepayschedule_id c_currency_id dateordered ad_client_id ad_org_id c_invoice_v c_bpartner_id c_bpartner_id ispaid currencybase payamt c_currency_id datetrx ad_client_id ad_org_id c_payment_v c_bpartner_id c_bpartner_id isallocated c_charge_id c_allocationline c_payment_id c_payment_id c_bpartner c_bpartner_id preparedstatement preparestatement get_trxname setint getc_bpartner_id resultset executequery so_creditused getbigdecimal totalopenbalance getbigdecimal m_totalopenbalanceset so_creditused setso_creditused so_creditused totalopenbalance settotalopenbalance totalopenbalance setsocreditstatus set actual life time value from db public void set actual life time value big decimal actual life time value null string sql select coalesce select sum currency base i grand total i c currency id i date ordered i ad client id i ad org id from c invoice v i where i c bpartner id bp c bpartner id and i isso trx y 0 from c bpartner bp where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc bpartner id result set rs pstmt execute query if rs next actual life time value rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if actual life time value null super set actual life time value actual life time value setactuallifetimevalue bigdecimal actuallifetimevalue currencybase grandtotal c_currency_id dateordered ad_client_id ad_org_id c_invoice_v c_bpartner_id c_bpartner_id issotrx c_bpartner c_bpartner_id preparedstatement preparestatement get_trxname setint getc_bpartner_id resultset executequery actuallifetimevalue getbigdecimal actuallifetimevalue setactuallifetimevalue actuallifetimevalue get total open balance param calculate if null calculate it return open balance public big decimal get total open balance boolean calculate if get total open balance signum 0 calculate set total open balance return super get total open balance bigdecimal gettotalopenbalance gettotalopenbalance settotalopenbalance gettotalopenbalance set credit status public void setso credit status big decimal credit limit getso creditlimit nothing to do if socreditstatus nocreditcheck equals getso credit status socreditstatus creditstop equals getso credit status env zero compare to credit limit 0 return above credit limit if credit limit compare to get total open balance m totalopenbalanceset 0 setso credit status socreditstatus credithold else above watch limit big decimal watch amt credit limit multiply get credit watch ratio if watch amt compare to get total open balance 0 setso credit status socreditstatus creditwatch else is ok setso credit status socreditstatus creditok setsocreditstatus bigdecimal creditlimit getso_creditlimit socreditstatus_nocreditcheck getsocreditstatus socreditstatus_creditstop getsocreditstatus compareto creditlimit creditlimit compareto gettotalopenbalance m_totalopenbalanceset setsocreditstatus socreditstatus_credithold bigdecimal watchamt creditlimit getcreditwatchratio watchamt compareto gettotalopenbalance setsocreditstatus socreditstatus_creditwatch setsocreditstatus socreditstatus_creditok get so credit status with additional amount param additional amt additional amount in accounting currency return sinulated credit status public string getso credit status big decimal additional amt if additional amt null additional amt signum 0 return getso credit status big decimal credit limit getso creditlimit nothing to do if socreditstatus nocreditcheck equals getso credit status socreditstatus creditstop equals getso credit status env zero compare to credit limit 0 return getso credit status above reduced credit limit credit limit credit limit subtract additional amt if credit limit compare to get total open balance m totalopenbalanceset 0 return socreditstatus credithold above watch limit big decimal watch amt credit limit multiply get credit watch ratio if watch amt compare to get total open balance 0 return socreditstatus creditwatch is ok return socreditstatus creditok creditstatus additionalamt getsocreditstatus bigdecimal additionalamt additionalamt additionalamt getsocreditstatus bigdecimal creditlimit getso_creditlimit socreditstatus_nocreditcheck getsocreditstatus socreditstatus_creditstop getsocreditstatus compareto creditlimit getsocreditstatus creditlimit creditlimit additionalamt creditlimit compareto gettotalopenbalance m_totalopenbalanceset socreditstatus_credithold bigdecimal watchamt creditlimit getcreditwatchratio watchamt compareto gettotalopenbalance socreditstatus_creditwatch socreditstatus_creditok get credit watch ratio return bp group ratio or 0 9 public big decimal get credit watch ratio return get group get credit watch ratio bigdecimal getcreditwatchratio getgroup getcreditwatchratio credit status is stop or hold return true if stop hold public boolean is credit stop hold string status getso credit status return socreditstatus creditstop equals status socreditstatus credithold equals status iscreditstophold getsocreditstatus socreditstatus_creditstop socreditstatus_credithold set total open balance param total open balance public void set total open balance big decimal total open balance m totalopenbalanceset false super set total open balance total open balance totalopenbalance settotalopenbalance bigdecimal totalopenbalance m_totalopenbalanceset settotalopenbalance totalopenbalance get group return group public mbp group get group if m group null m group mbp group get get ctx getc bp group id return m group mbpgroup getgroup m_group m_group mbpgroup getctx getc_bp_group_id m_group get price list return price list public int getm pricelist id int ii super getm pricelist id if ii 0 ii get group getm pricelist id return ii pricelist getm_pricelist_id getm_pricelist_id getgroup getm_pricelist_id get po price list return price list public int getpo pricelist id int ii super getpo pricelist id if ii 0 ii get group getpo pricelist id return ii pricelist getpo_pricelist_id getpo_pricelist_id getgroup getpo_pricelist_id get discount schema return discount schema public int getm discountschema id int ii super getm discountschema id if ii 0 ii get group getm discountschema id return ii discountschema getm_discountschema_id getm_discountschema_id getgroup getm_discountschema_id get po discount schema return po discount public int getpo discountschema id int ii super getpo discountschema id if ii 0 ii get group getpo discountschema id return ii discountschema getpo_discountschema_id getpo_discountschema_id getgroup getpo_discountschema_id after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success trees insert tree mtree base treetype bpartner accounting insert accounting c bp customer acct c bp group acct p c bp group id getc bp group id insert accounting c bp vendor acct c bp group acct p c bp group id getc bp group id insert accounting c bp employee acct c acctschema default null value name change if success new record is valuechanged value is valuechanged name m account update value description get ctx c bpartner id getc bpartner id get trxname return success newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_bpartner insert_accounting c_bp_customer_acct c_bp_group_acct c_bp_group_id getc_bp_group_id insert_accounting c_bp_vendor_acct c_bp_group_acct c_bp_group_id getc_bp_group_id insert_accounting c_bp_employee_acct c_acctschema_default newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_bpartner_id getc_bpartner_id get_trxname before delete return true protected boolean before delete return delete accounting c bp customer acct delete accounting c bp vendor acct delete accounting c bp employee acct beforedelete delete_accounting c_bp_customer_acct delete_accounting c_bp_vendor_acct delete_accounting c_bp_employee_acct after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype bpartner return success afterdelete delete_tree mtree_base treetype_bpartner prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals confirm type p confirmtype string para i get parameter else log log level severe prepare unknown parameter name p m inout id getrecord id processinfoparameter getparameter getparametername getparameter confirmtype p_confirmtype getparameter p_m_inout_id getrecord_id create confirmation return document no throws exception protected string do it throws exception log info m inout id p m inout id type p confirmtype m in out shipment new m in out get ctx p m inout id null if shipment get id 0 throw new illegal argument exception not found m inout id p m inout id m in out confirm confirm m in out confirm create shipment p confirmtype true if confirm null throw new exception cannot create confirmation for shipment get document no return confirm get document no doit m_inout_id p_m_inout_id p_confirmtype minout minout getctx p_m_inout_id get_id illegalargumentexception m_inout_id p_m_inout_id minoutconfirm minoutconfirm p_confirmtype getdocumentno getdocumentno get image icon or null if not exists param name file name in org compiere images return image public static image icon get image icon string name url url org compiere compiere class get resource images name if url null log log level severe image factory get image icon not found name return null return new image icon url imageicon getimageicon getresource imagefactory getimageicon imageicon get home icon little house 18 18 return image public static icon get home icon if s homeicon null s homeicon new home icon return s homeicon gethomeicon s_homeicon s_homeicon homeicon s_homeicon public void paint icon component c graphics g int x int y g translate x y draw outside edge of house g set color compiere look and feel get control info black g draw line 8 1 1 8 left edge of roof g draw line 8 1 15 8 right edge of roof g draw line 11 2 11 3 left edge of chimney g draw line 12 2 12 4 right edge of chimney g draw line 3 7 3 15 left edge of house g draw line 13 7 13 15 right edge of house g draw line 4 15 12 15 bottom edge of house draw door frame same color as edge of house g draw line 6 9 6 14 left g draw line 10 9 10 14 right g draw line 7 9 9 9 top draw roof body g set color compiere look and feel get control dark shadow secondary1 g fill rect 8 2 1 1 top toward bottom g fill rect 7 3 3 1 g fill rect 6 4 5 1 g fill rect 5 5 7 1 g fill rect 4 6 9 2 draw doornob same color as roof body g draw line 9 12 9 12 paint the house g set color compiere look and feel get primary control primary3 g draw line 4 8 12 8 above door g fill rect 4 9 2 6 left of door g fill rect 11 9 2 6 right of door g translate x y painticon setcolor compierelookandfeel getcontrolinfo drawline drawline drawline drawline drawline drawline drawline drawline drawline drawline setcolor compierelookandfeel getcontroldarkshadow fillrect fillrect fillrect fillrect fillrect drawline setcolor compierelookandfeel getprimarycontrol drawline fillrect fillrect g translate x y public int get icon width return 18 geticonwidth return 18 public int get icon height return 18 geticonheight folder icon return icon public static icon get folder icon if s foldericon null s foldericon new folder icon return s foldericon getfoldericon s_foldericon s_foldericon foldericon s_foldericon private static class folder icon extends folder icon16 public int get shift return 1 foldericon foldericon16 getshift return 1 public int get additional height return 2 getadditionalheight public void paint icon component c graphics g int x int y if image null image new buffered image get icon width get icon height buffered image type int argb graphics imageg image get graphics paint me c imageg imageg dispose g draw image image x y get shift null painticon bufferedimage geticonwidth geticonheight bufferedimage type_int_argb getgraphics paintme drawimage getshift private void paint me component c graphics g int right s icon16size width 1 int bottom s icon16size height 1 draw tab top g set color compiere look and feel get primary control dark shadow primary1 g draw line right 5 3 right 3 g draw line right 6 4 right 4 draw folder front g set color compiere look and feel get primary control primary3 g fill rect 2 7 13 8 draw tab bottom g set color compiere look and feel get primary control shadow primary2 g draw line right 6 5 right 1 5 draw outline g set color compiere look and feel get primary control info black g draw line 0 6 0 bottom left side g draw line 1 5 right 7 5 first part of top g draw line right 6 6 right 1 6 second part of top g draw line right 5 right bottom right side g draw line 0 bottom right bottom bottom draw highlight g set color compiere look and feel get primary control highlight white g draw line 1 6 1 bottom 1 g draw line 1 6 right 7 6 g draw line right 6 7 right 1 7 paintme s_icon16size s_icon16size setcolor compierelookandfeel getprimarycontroldarkshadow drawline drawline setcolor compierelookandfeel getprimarycontrol fillrect setcolor compierelookandfeel getprimarycontrolshadow drawline setcolor compierelookandfeel getprimarycontrolinfo drawline drawline drawline drawline drawline setcolor compierelookandfeel getprimarycontrolhighlight drawline drawline drawline g draw line right 6 7 right 1 7 public int get shift return 0 drawline getshift return 0 public int get additional height return 0 getadditionalheight return 0 public int get icon width return s icon16size width geticonwidth s_icon16size return s icon16size width public int get icon height return s icon16size height get additional height s_icon16size geticonheight s_icon16size getadditionalheight load pricate access param ctx context param ad user id user param ad table id table param record id record return access or null if not found public static m private access get properties ctx int ad user id int ad table id int record id m private access ret value null prepared statement pstmt null string sql select from ad private access where ad user id and ad table id and record id try pstmt db prepare statement sql null pstmt set int 1 ad user id pstmt set int 2 ad table id pstmt set int 3 record id result set rs pstmt execute query if rs next ret value new m private access ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe m private access e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value ad_user_id ad_table_id record_id mprivateaccess ad_user_id ad_table_id record_id mprivateaccess retvalue preparedstatement ad_private_access ad_user_id ad_table_id record_id preparestatement setint ad_user_id setint ad_table_id setint record_id resultset executequery retvalue mprivateaccess s_log mprivateaccess retvalue get where clause of locked records for table param ad table id table param ad user id user requesting info return 1 or not in 1 2 or null public static string get locked record where int ad table id int ad user id array list integer list new array list integer prepared statement pstmt null string sql select record id from ad private access where ad table id and ad user id and is active y try pstmt db prepare statement sql null pstmt set int 1 ad table id pstmt set int 2 ad user id result set rs pstmt execute query while rs next list add new integer rs get int 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if list size 0 return null if list size 1 return list get 0 string buffer sb new string buffer not in for int i 0 i list size i if i 0 sb append sb append list get i sb append return sb to string ad_table_id ad_user_id getlockedrecordwhere ad_table_id ad_user_id arraylist arraylist preparedstatement record_id ad_private_access ad_table_id ad_user_id isactive preparestatement setint ad_table_id setint ad_user_id resultset executequery getint s_log stringbuffer stringbuffer tostring persistency constructor param ctx context param ignored ignored public m private access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mprivateaccess trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m private access properties ctx result set rs string trx name super ctx rs trx name mprivateaccess resultset trxname trxname new constructor param ctx context param ad user id user param ad table id table param record id record public m private access properties ctx int ad user id int ad table id int record id super ctx 0 null setad user id ad user id setad table id ad table id setrecord id record id ad_user_id ad_table_id record_id mprivateaccess ad_user_id ad_table_id record_id setad_user_id ad_user_id setad_table_id ad_table_id setrecord_id record_id get contents return contents public object get contents return contents getcontents start tag return skip body throws jsp exception public int do start tag throws jsp exception properties ctx jsp env get ctx http servlet request page context get request web user wu get web user ctx if wu null page context get session remove attribute web user name else page context get session set attribute web user name wu string server context ctx get property web session ctx ctx server context log fine do start tag server context server context html code html null if wu null wu is valid html get welcome link server context wu else html get login link server context jsp writer out page context get out delete cookie call if cookie user null cookie user equals log fine cookie cookie user html add element a a new a login servlet mode delete cookie a set class menu detail a add element delete nbsp cookie html add element a html output out return skip body skip_body jspexception dostarttag jspexception jspenv getctx httpservletrequest pagecontext getrequest webuser getwebuser pagecontext getsession removeattribute webuser pagecontext getsession setattribute webuser servercontext getproperty websessionctx ctx_server_context dostarttag servercontext servercontext htmlcode isvalid getwelcomelink servercontext getloginlink servercontext jspwriter pagecontext getout cookieuser cookieuser cookieuser addelement loginservlet deletecookie setclass menudetail addelement addelement skip_body end tag return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page get web user param ctx context return web user or null private web user get web user properties ctx string address page context get request get remote addr get stored user web user wu web user page context get session get attribute web user name if wu null log finest address session context wu else wu web user page context get attribute web user name if wu null log finest address context wu if wu null return wu check coockie string cookie user jsp env get cookie web user http servlet request page context get request if cookie user null cookie user trim length 0 log finer address no cookie else try to load wu web user get ctx cookie user log finer address cookie wu if wu null return wu return null webuser webuser getwebuser pagecontext getrequest getremoteaddr webuser webuser pagecontext getsession getattribute webuser sessioncontext webuser pagecontext getattribute webuser cookieuser jspenv getcookiewebuser httpservletrequest pagecontext getrequest cookieuser cookieuser webuser cookieuser get login link param server context server context return link private html code get login link string server context html code ret value new html code login button input button new input input type button login login button set on click window top location replace https server context login servlet ret value add element button link a a new a https server context login jsp a set class menu main a add element login ret value add element a ret value add element return ret value servercontext htmlcode getloginlink servercontext htmlcode retvalue htmlcode type_button setonclick servercontext loginservlet retvalue addelement servercontext setclass menumain addelement retvalue addelement retvalue addelement retvalue get welcome link param server context server context param wu web user return link private html code get welcome link string server context web user wu html code ret value new html code a a new a https server context login jsp a set class menu main string msg welcome wu get name a add element msg ret value add element a ret value add element nbsp if wu is logged in verify if wu ise mail verified input button new input input type button verify verify e mail button set on click window top location replace email verify jsp ret value add element button ret value add element update input button new input input type button update update button set on click window top location replace login jsp ret value add element button ret value add element logout button new input input type button logout logout button set on click window top location replace login servlet mode logout ret value add element button link a new a login servlet mode logout a set class menu main a add element logout ret value add element a else input button new input input type button login login button set on click window top location replace https server context login jsp ret value add element button ret value add element return ret value servercontext htmlcode getwelcomelink servercontext webuser htmlcode retvalue htmlcode servercontext setclass menumain getname addelement retvalue addelement retvalue addelement isloggedin isemailverified type_button email setonclick emailverify retvalue addelement retvalue addelement type_button setonclick retvalue addelement retvalue addelement type_button setonclick loginservlet retvalue addelement loginservlet setclass menumain addelement retvalue addelement type_button setonclick servercontext retvalue addelement retvalue addelement retvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals only discount p onlydiscount y equals para i get parameter else if name equals only due p onlydue y equals para i get parameter else if name equals include in dispute p includeindispute y equals para i get parameter else if name equals match requirement p matchrequirement string para i get parameter else if name equals payment rule p paymentrule string para i get parameter else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c bp group id p c bp group id para i get parameter as int else log log level severe unknown parameter name p c payselection id getrecord id processinfoparameter getparameter getparametername getparameter onlydiscount p_onlydiscount getparameter onlydue p_onlydue getparameter includeindispute p_includeindispute getparameter matchrequirement p_matchrequirement getparameter paymentrule p_paymentrule getparameter c_bpartner_id p_c_bpartner_id getparameterasint c_bp_group_id p_c_bp_group_id getparameterasint p_c_payselection_id getrecord_id perrform process return message throws exception if not successful protected string do it throws exception log info c payselection id p c payselection id only discount p onlydiscount only due p onlydue include in dispute p includeindispute match requirement p matchrequirement payment rule p paymentrule c bp group id p c bp group id c bpartner id p c bpartner id m pay selection psel new m pay selection get ctx p c payselection id get trxname if psel get id 0 throw new illegal argument exception not found c payselection id p c payselection id if psel is processed throw new illegal argument exception processed psel get pay date string sql select c invoice id open currency convert invoice open i c invoice id 0 i c currency id i c conversiontype id i ad client id i ad org id 1 2 currency to pay date discount currency convert payment term discount i grand total i c currency id i c paymentterm id i date invoiced 3 pay date i c currency id i c conversiontype id i ad client id i ad org id 4 5 currency to pay date payment rule isso trx from c invoice i where isso trx n and is paid n and doc status in co cl and ad client id 6 existing payments will reselect invoice if prepared but not paid and not exists select from c payselectionline psl where i c invoice id psl c invoice id and psl is active y and psl c payselectioncheck id is not null disputed if p includeindispute sql and i is in dispute n payment rule optional if p paymentrule null sql and payment rule only discount if p onlydiscount if p onlydue sql and else sql and sql payment term discount invoice open c invoice id 0 c currency id c paymentterm id date invoiced 0 only due if p onlydue if p onlydiscount sql or else sql and sql payment term due days c paymentterm id date invoiced 0 if p onlydiscount sql business partner if p c bpartner id 0 sql and c bpartner id business partner group else if p c bp group id 0 sql and exists select from c bpartner bp where bp c bpartner id i c bpartner id and bp c bp group id po matching requiremnent if p matchrequirement equals p p matchrequirement equals b sql and exists select from c invoiceline il where i c invoice id il c invoice id and qty invoiced select sum qty from m matchpo m where il c invoiceline id m c invoiceline id receipt matching requiremnent if p matchrequirement equals r p matchrequirement equals b sql and exists select from c invoiceline il where i c invoice id il c invoice id and qty invoiced select sum qty from m matchinv m where il c invoiceline id m c invoiceline id int lines 0 int c currencyto id psel getc currency id prepared statement pstmt null try pstmt db prepare statement sql get trxname int index 1 pstmt set int index c currencyto id pstmt set timestamp index psel get pay date pstmt set timestamp index psel get pay date pstmt set int index c currencyto id pstmt set timestamp index psel get pay date pstmt set int index psel getad client id if p paymentrule null pstmt set string index p paymentrule if p onlydiscount pstmt set timestamp index psel get pay date if p onlydue pstmt set timestamp index psel get pay date if p c bpartner id 0 pstmt set int index p c bpartner id else if p c bp group id 0 pstmt set int index p c bp group id result set rs pstmt execute query while rs next int c invoice id rs get int 1 big decimal pay amt rs get big decimal 2 if c invoice id 0 env zero compare to pay amt 0 continue big decimal discount amt rs get big decimal 3 string payment rule rs get string 4 boolean isso trx y equals rs get string 5 lines m pay selection line psel line new m pay selection line psel lines 10 payment rule psel line set invoice c invoice id isso trx pay amt pay amt subtract discount amt discount amt if psel line save pstmt close throw new illegal state exception cannot save m pay selection line rs close pstmt close pstmt null catch exception e log log level severe do it sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return c payselectionline id lines doit c_payselection_id p_c_payselection_id onlydiscount p_onlydiscount onlydue p_onlydue includeindispute p_includeindispute matchrequirement p_matchrequirement paymentrule p_paymentrule c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id mpayselection mpayselection getctx p_c_payselection_id get_trxname get_id illegalargumentexception c_payselection_id p_c_payselection_id isprocessed illegalargumentexception getpaydate c_invoice_id currencyconvert invoiceopen c_invoice_id c_currency_id c_conversiontype_id ad_client_id ad_org_id currency_to paydate currencyconvert paymenttermdiscount grandtotal c_currency_id c_paymentterm_id dateinvoiced paydate c_currency_id c_conversiontype_id ad_client_id ad_org_id currency_to paydate paymentrule issotrx c_invoice issotrx ispaid docstatus ad_client_id c_payselectionline c_invoice_id c_invoice_id isactive c_payselectioncheck_id p_includeindispute isindispute paymentrule p_paymentrule paymentrule onlydiscount p_onlydiscount p_onlydue paymenttermdiscount invoiceopen c_invoice_id c_currency_id c_paymentterm_id dateinvoiced onlydue p_onlydue p_onlydiscount paymenttermduedays c_paymentterm_id dateinvoiced p_onlydiscount p_c_bpartner_id c_bpartner_id p_c_bp_group_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_matchrequirement p_matchrequirement c_invoiceline c_invoice_id c_invoice_id qtyinvoiced m_matchpo c_invoiceline_id c_invoiceline_id p_matchrequirement p_matchrequirement c_invoiceline c_invoice_id c_invoice_id qtyinvoiced m_matchinv c_invoiceline_id c_invoiceline_id c_currencyto_id getc_currency_id preparedstatement preparestatement get_trxname setint c_currencyto_id settimestamp getpaydate settimestamp getpaydate setint c_currencyto_id settimestamp getpaydate setint getad_client_id p_paymentrule setstring p_paymentrule p_onlydiscount settimestamp getpaydate p_onlydue settimestamp getpaydate p_c_bpartner_id setint p_c_bpartner_id p_c_bp_group_id setint p_c_bp_group_id resultset executequery c_invoice_id getint bigdecimal payamt getbigdecimal c_invoice_id compareto payamt bigdecimal discountamt getbigdecimal paymentrule getstring issotrx getstring mpayselectionline pselline mpayselectionline paymentrule pselline setinvoice c_invoice_id issotrx payamt payamt discountamt discountamt pselline illegalstateexception mpayselectionline doit c_payselectionline_id constructor param pi process info public a sync process base process info pi m pi pi asyncprocessbase processinfo m_pi start a sync worker void start if isui locked don t start twice return a sync worker worker new a sync worker this m pi worker start calls lockui executea sync unlockui async isuilocked asyncworker asyncworker m_pi executeasync lock user interface called from the worker before processing param pi process info public void lockui process info pi m islocked true m splash new splash msg get msg env get ctx processing m splash to front processinfo m_islocked m_splash getmsg getctx m_splash tofront unlock user interface called from the worker when processing is done param pi process info public void unlockui process info pi m islocked false m splash dispose m splash null processinfo m_islocked m_splash m_splash is the ui locked internal method return true if ui is locked public boolean isui locked return m islocked isuilocked m_islocked method to be executed async called from the worker param pi process info get language model from language param ctx context param lang language return language public static m language get properties ctx language lang return get ctx lang getad language mlanguage getad_language get language model from ad language param ctx context param ad language language e g en us return language or null public static m language get properties ctx string ad language m language lang null string sql select from ad language where ad language prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 ad language result set rs pstmt execute query if rs next lang new m language ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe get ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return lang ad_language ad_language en_us mlanguage ad_language mlanguage ad_language ad_language preparedstatement preparestatement setstring ad_language resultset executequery mlanguage sqlexception s_log sqlexception load languages variants with language param ctx context param languageiso language 2 letter e g en return language public static m language get with language properties ctx string languageiso array list m language list new array list m language string sql select from ad language where languageiso prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 languageiso result set rs pstmt execute query while rs next list add new m language ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m language languages new m language list size list to array languages return languages mlanguage getwithlanguage arraylist mlanguage arraylist mlanguage ad_language preparedstatement preparestatement setstring resultset executequery mlanguage sqlexception s_log sqlexception mlanguage mlanguage toarray maintain all active languages public static void maintain properties ctx string sql select from ad language where is system language y and is base language n and is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m language language new m language ctx rs null language maintain true rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null ad_language issystemlanguage isbaselanguage isactive preparedstatement preparestatement resultset executequery mlanguage mlanguage s_log standard constructor param ctx context param ad language id id public m language properties ctx int ad language id string trx name super ctx ad language id trx name ad_language_id mlanguage ad_language_id trxname ad_language_id trxname load constructor param ctx context param rs result set public m language properties ctx result set rs string trx name super ctx rs trx name mlanguage resultset trxname trxname create language param ctx context param ad language language code param name name param country code country code param languageiso language code private m language properties ctx string ad language string name string country code string languageiso string trx name super ctx 0 trx name setad language ad language en us set is base language false set is system language false set name name set country code country code us set languageiso languageiso en string sql select nvl max ad language id 0 1 as default value from ad language setad language id db getsql value trx name sql ad_language countrycode mlanguage ad_language countrycode trxname trxname setad_language ad_language en_us setisbaselanguage setissystemlanguage setname setcountrycode countrycode setlanguageiso ad_language_id defaultvalue ad_language setad_language_id getsqlvalue trxname string representation return info public string to string return m language getad language get name language get languageiso country get country code tostring mlanguage getad_language getname getlanguageiso getcountrycode get locale return locale public locale get locale if m locale null m locale new locale get languageiso get country code return m locale getlocale m_locale m_locale getlanguageiso getcountrycode m_locale get short date format the date format must parseable by org compiere grid ed m doc date i e leading zero for date and month return date format mm dd yyyy dd mm yyyy public simple date format get date format if m dateformat null return m dateformat if get date pattern null m dateformat simple date format date format get date instance date format short get locale try m dateformat apply pattern get date pattern catch exception e log severe get date pattern e m dateformat null if m dateformat null fix locale date format m dateformat simple date format date format get date instance date format short get locale string s format m dateformat to pattern some short formats have only one m and d e g ths us if s format index of mm 1 s format index of dd 1 string n format for int i 0 i s format length i if s format char at i m n format mm else if s format char at i d n format dd else n format s format char at i system out println s format n format m dateformat apply pattern n format unknown short format use jdbc if m dateformat to pattern length 8 m dateformat apply pattern yyyy mm dd 4 digit year if m dateformat to pattern index of yyyy 1 s format m dateformat to pattern string n format for int i 0 i s format length i if s format char at i y n format yy else n format s format char at i m dateformat apply pattern n format m dateformat set lenient true return m dateformat mdocdate simpledateformat getdateformat m_dateformat m_dateformat getdatepattern m_dateformat simpledateformat dateformat getdateinstance dateformat getlocale m_dateformat applypattern getdatepattern getdatepattern m_dateformat m_dateformat m_dateformat simpledateformat dateformat getdateinstance dateformat getlocale sformat m_dateformat topattern sformat indexof sformat indexof nformat sformat sformat charat nformat sformat charat nformat nformat sformat charat sformat nformat m_dateformat applypattern nformat m_dateformat topattern m_dateformat applypattern m_dateformat topattern indexof sformat m_dateformat topattern nformat sformat sformat charat nformat nformat sformat charat m_dateformat applypattern nformat m_dateformat setlenient m_dateformat before save param new record new return true false protected boolean before save boolean new record if is valuechanged date pattern get date pattern null string dp get date pattern if dp index of mm 1 log save error error msg parse translation get ctx error date pattern no month mm return false if dp index of dd 1 log save error error msg parse translation get ctx error date pattern no day dd return false if dp index of yy 1 log save error error msg parse translation get ctx error date pattern no year yy return false m dateformat simple date format date format get date instance date format short get locale try m dateformat apply pattern dp catch exception e log save error error msg parse translation get ctx error date pattern e get message m dateformat null return false return true newrecord beforesave newrecord is_valuechanged datepattern getdatepattern getdatepattern indexof saveerror parsetranslation getctx datepattern indexof saveerror parsetranslation getctx datepattern indexof saveerror parsetranslation getctx datepattern m_dateformat simpledateformat dateformat getdateinstance dateformat getlocale m_dateformat applypattern saveerror parsetranslation getctx datepattern getmessage m_dateformat after save param new record new param success success return true if saved protected boolean after save boolean new record boolean success int no translation table get active languages true log fine active languages no return true aftersave newrecord aftersave newrecord translationtable getactivelanguages maintain translation param add if true add missing records otherwise delete return number of records deleted inserted public int maintain boolean add string sql select table name from ad table where table name like trl order by 1 prepared statement pstmt null int ret no 0 try pstmt db prepare statement sql null result set rs pstmt execute query while rs next if add ret no add table rs get string 1 else ret no delete table rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret no tablename ad_table tablename _trl preparedstatement retno preparestatement resultset executequery retno addtable getstring retno deletetable getstring retno delete translation param table name table name return number of records deleted private int delete table string table name string sql delete table name where ad language getad language int no db execute update sql get trxname log fine table name no return no tablename deletetable tablename tablename ad_language getad_language executeupdate get_trxname tablename add translation to table param table name table name return number of records inserted private int add table string table name string base table table name substring 0 table name length 4 string sql select c column name from ad column c inner join ad table t on c ad table id t ad table id where t table name and c is translated y and c is active y order by 1 array list string columns new array list string 5 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 base table result set rs pstmt execute query while rs next columns add rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null columns if columns size 0 log log level severe no columns found for base table return 0 string buffer cols new string buffer for int i 0 i columns size i cols append append columns get i insert statement int ad user id env getad user id get ctx string key column base table id string insert insert into table name ad language is translated ad client id ad org id createdby updated by key column cols select getad language n ad client id ad org id ad user id ad user id key column cols from base table where key column getad language not in select key column ad language from table name int no db execute update insert get trxname log fine table name no return no tablename addtable tablename basetable tablename tablename columnname ad_column ad_table ad_table_id ad_table_id tablename istranslated isactive arraylist arraylist preparedstatement preparestatement setstring basetable resultset executequery getstring basetable stringbuffer stringbuffer ad_user_id getad_user_id getctx keycolumn basetable _id tablename ad_language istranslated ad_client_id ad_org_id updatedby keycolumn getad_language ad_client_id ad_org_id ad_user_id ad_user_id keycolumn basetable keycolumn getad_language keycolumn ad_language tablename executeupdate get_trxname tablename setup param args args public static void main string args system out println language compiere startup true system out println m language get env get ctx de de system out println m language get env get ctx en us locale locales locale get available locales for int i 0 i locales length i locale loc locales i if loc get variant null loc get variant length 0 continue if loc get country null loc get country length 0 continue system out println loc to string loc get display name loc get country loc get language m language lang new m language env get ctx loc to string loc get display name loc get country loc get language lang save system out println lang mlanguage getctx de_de mlanguage getctx en_us getavailablelocales getvariant getvariant getcountry getcountry tostring getdisplayname getcountry getlanguage mlanguage mlanguage getctx tostring getdisplayname getcountry getlanguage standard constructor param ctx context param m changenotice id id param trx name trx public m change notice properties ctx int m changenotice id string trx name super ctx m changenotice id trx name if m changenotice id 0 set name null set is approved false n set processed false m_changenotice_id trxname mchangenotice m_changenotice_id trxname m_changenotice_id trxname m_changenotice_id setname setisapproved setprocessed load constructor param ctx context param rs result set param trx name trx public m change notice properties ctx result set rs string trx name super ctx rs trx name trxname mchangenotice resultset trxname trxname public m recurring properties ctx int c recurring id string trx name super ctx c recurring id trx name if c recurring id 0 setc recurring id 0 pk set date next run new timestamp system current time millis set frequency type frequencytype monthly set frequency 1 set name null set recurring type null set runs max 1 set runs remaining 0 mrecurring c_recurring_id trxname c_recurring_id trxname c_recurring_id setc_recurring_id setdatenextrun currenttimemillis setfrequencytype frequencytype_monthly setfrequency setname setrecurringtype setrunsmax setrunsremaining m recurring public m recurring properties ctx result set rs string trx name super ctx rs trx name m recurring mrecurring mrecurring resultset trxname trxname mrecurring string representation return info public string to string string buffer sb new string buffer m recurring append get id append append get name if get recurring type equals m recurring recurringtype order sb append c order id append getc order id else if get recurring type equals m recurring recurringtype invoice sb append c invoice id append getc invoice id else if get recurring type equals m recurring recurringtype project sb append c project id append getc project id else if get recurring type equals m recurring recurringtype gljournal sb append gl journalbatch id append getgl journalbatch id sb append fequency append get frequency type append append get frequency sb append return sb to string tostring stringbuffer stringbuffer mrecurring get_id getname getrecurringtype mrecurring recurringtype_order c_order_id getc_order_id getrecurringtype mrecurring recurringtype_invoice c_invoice_id getc_invoice_id getrecurringtype mrecurring recurringtype_project c_project_id getc_project_id getrecurringtype mrecurring recurringtype_gljournal gl_journalbatch_id getgl_journalbatch_id getfrequencytype getfrequency tostring execute run return clear text info public string execute run timestamp date doc get date next run if calculate runs throw new illegal state exception no runs left log m recurring run run new m recurring run get ctx this string msg created copy if get recurring type equals m recurring recurringtype order m order from new m order get ctx getc order id get trxname m order order m order copy from from date doc from getc doctype id from isso trx false false get trxname run setc order id order getc order id msg order get document no else if get recurring type equals m recurring recurringtype invoice m invoice from new m invoice get ctx getc invoice id get trxname m invoice invoice m invoice copy from from date doc from getc doctype id from isso trx false get trxname false run setc invoice id invoice getc invoice id msg invoice get document no else if get recurring type equals m recurring recurringtype project m project project m project copy from get ctx getc project id date doc get trxname run setc project id project getc project id msg project get value else if get recurring type equals m recurring recurringtype gljournal m journal batch journal m journal batch copy from get ctx getgl journalbatch id date doc get trxname run setgl journalbatch id journal getgl journalbatch id msg journal get document no else return invalid recurring type get recurring type run save get trxname set date last run run get updated set runs remaining get runs remaining 1 set date next run save get trxname return msg executerun datedoc getdatenextrun calculateruns illegalstateexception mrecurringrun mrecurringrun getctx getrecurringtype mrecurring recurringtype_order morder morder getctx getc_order_id get_trxname morder morder copyfrom datedoc getc_doctype_id issotrx get_trxname setc_order_id getc_order_id getdocumentno getrecurringtype mrecurring recurringtype_invoice minvoice minvoice getctx getc_invoice_id get_trxname minvoice minvoice copyfrom datedoc getc_doctype_id issotrx get_trxname setc_invoice_id getc_invoice_id getdocumentno getrecurringtype mrecurring recurringtype_project mproject mproject copyfrom getctx getc_project_id datedoc get_trxname setc_project_id getc_project_id getvalue getrecurringtype mrecurring recurringtype_gljournal mjournalbatch mjournalbatch copyfrom getctx getgl_journalbatch_id datedoc get_trxname setgl_journalbatch_id getgl_journalbatch_id getdocumentno recurringtype getrecurringtype get_trxname setdatelastrun getupdated setrunsremaining getrunsremaining setdatenextrun get_trxname calculate set remaining runs return true if runs left private boolean calculate runs string sql select count from c recurring run where c recurring id int current db getsql value get trxname sql getc recurring id int remaining get runs max current set runs remaining remaining save return remaining 0 calculateruns c_recurring_run c_recurring_id getsqlvalue get_trxname getc_recurring_id getrunsmax setrunsremaining calculate next run date private void set date next run if get frequency 1 set frequency 1 int frequency get frequency calendar cal calendar get instance cal set time get date next run if get frequency type equals frequencytype daily cal add calendar day of year frequency else if get frequency type equals frequencytype weekly cal add calendar week of year frequency else if get frequency type equals frequencytype monthly cal add calendar month frequency else if get frequency type equals frequencytype quarterly cal add calendar month 3 frequency timestamp next new timestamp cal get time in millis set date next run next setdatenextrun getfrequency setfrequency getfrequency getinstance settime getdatenextrun getfrequencytype frequencytype_daily day_of_year getfrequencytype frequencytype_weekly week_of_year getfrequencytype frequencytype_monthly getfrequencytype frequencytype_quarterly gettimeinmillis setdatenextrun before save param new record new return true protected boolean before save boolean new record string rt get recurring type if rt null log save error fill mandatory msg get element get ctx recurring type return false if rt equals m recurring recurringtype order getc order id 0 log save error fill mandatory msg get element get ctx c order id return false if rt equals m recurring recurringtype invoice getc invoice id 0 log save error fill mandatory msg get element get ctx c invoice id return false if rt equals m recurring recurringtype gljournal getgl journalbatch id 0 log save error fill mandatory msg get element get ctx gl journalbatch id return false if rt equals m recurring recurringtype project getc project id 0 log save error fill mandatory msg get element get ctx c project id return false return true newrecord beforesave newrecord getrecurringtype saveerror fillmandatory getelement getctx recurringtype mrecurring recurringtype_order getc_order_id saveerror fillmandatory getelement getctx c_order_id mrecurring recurringtype_invoice getc_invoice_id saveerror fillmandatory getelement getctx c_invoice_id mrecurring recurringtype_gljournal getgl_journalbatch_id saveerror fillmandatory getelement getctx gl_journalbatch_id mrecurring recurringtype_project getc_project_id saveerror fillmandatory getelement getctx c_project_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals date ordered p dateordered from timestamp para i get parameter p dateordered to timestamp para i getparameter to else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else if name equals vendor id p vendor id big decimal para i get parameter int value else if name equals c order id p c order id big decimal para i get parameter int value else if name equals is drop ship p isdropship string para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter dateordered p_dateordered_from getparameter p_dateordered_to getparameter_to c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue vendor_id p_vendor_id bigdecimal getparameter intvalue c_order_id p_c_order_id bigdecimal getparameter intvalue isdropship p_isdropship getparameter perrform process return message throws exception if not successful protected string do it throws exception log info date ordered p dateordered from p dateordered to c bpartner id p c bpartner id vendor id p vendor id is drop ship p isdropship c order id p c order id if p c order id 0 p isdropship null p dateordered from null p dateordered to null p c bpartner id 0 p vendor id 0 throw new illegal path state exception you need to restrict selection string sql select from c order o where o isso trx y no duplicates and o ref order id is null and not exists select from c orderline ol where o c order id ol c order id and ol ref orderline id is not null if p c order id 0 sql and o c order id else if p c bpartner id 0 sql and o c bpartner id if p isdropship null sql and o is drop ship if p vendor id 0 sql and exists select from c orderline ol inner join m product po po on ol m product id po m product id where o c order id ol c order id and po c bpartner id if p dateordered from null p dateordered to null sql and trunc o date ordered between and else if p dateordered from null p dateordered to null sql and trunc o date ordered else if p dateordered from null p dateordered to null sql and trunc o date ordered prepared statement pstmt null int counter 0 try pstmt db prepare statement sql get trxname if p c order id 0 pstmt set int 1 p c order id else int index 1 if p c bpartner id 0 pstmt set int index p c bpartner id if p isdropship null pstmt set string index p isdropship if p vendor id 0 pstmt set int index p vendor id if p dateordered from null p dateordered to null pstmt set timestamp index p dateordered from pstmt set timestamp index p dateordered to else if p dateordered from null p dateordered to null pstmt set timestamp index p dateordered from else if p dateordered from null p dateordered to null pstmt set timestamp index p dateordered to result set rs pstmt execute query while rs next counter createpo fromso new m order get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if counter 0 log fine sql return created counter doit dateordered p_dateordered_from p_dateordered_to c_bpartner_id p_c_bpartner_id vendor_id p_vendor_id isdropship p_isdropship c_order_id p_c_order_id p_c_order_id p_isdropship p_dateordered_from p_dateordered_to p_c_bpartner_id p_vendor_id illegalpathstateexception c_order issotrx ref_order_id c_orderline c_order_id c_order_id ref_orderline_id p_c_order_id c_order_id p_c_bpartner_id c_bpartner_id p_isdropship isdropship p_vendor_id c_orderline m_product_po m_product_id m_product_id c_order_id c_order_id c_bpartner_id p_dateordered_from p_dateordered_to dateordered p_dateordered_from p_dateordered_to dateordered p_dateordered_from p_dateordered_to dateordered preparedstatement preparestatement get_trxname p_c_order_id setint p_c_order_id p_c_bpartner_id setint p_c_bpartner_id p_isdropship setstring p_isdropship p_vendor_id setint p_vendor_id p_dateordered_from p_dateordered_to settimestamp p_dateordered_from settimestamp p_dateordered_to p_dateordered_from p_dateordered_to settimestamp p_dateordered_from p_dateordered_from p_dateordered_to settimestamp p_dateordered_to resultset executequery createpofromso morder getctx get_trxname create po from so param so sales order return number of p os created private int createpo fromso m order so log info so to string m order line so lines so get lines true null if so lines null so lines length 0 log warning no lines so return 0 int counter 0 order lines with a product which has a current vendor string sql select distinct po c bpartner id po m product id from m product po po inner join c orderline ol on po m product id ol m product id where ol c order id and po is current vendor y order by 1 prepared statement pstmt null m order po null try pstmt db prepare statement sql get trxname pstmt set int 1 so getc order id result set rs pstmt execute query while rs next new order int c bpartner id rs get int 1 if po null po getbill bpartner id c bpartner id po createpo for vendor rs get int 1 so add log 0 null null po get document no counter line int m product id rs get int 2 for int i 0 i so lines length i if so lines i getm product id m product id m order line po line new m order line po po line setref orderline id so lines i getc orderline id po line setm product id so lines i getm product id po line setm attributesetinstance id so lines i getm attributesetinstance id po line setc uom id so lines i getc uom id po line set qty entered so lines i get qty entered po line set qty ordered so lines i get qty ordered po line set description so lines i get description po line set date promised so lines i get date promised po line set price po line save rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null set reference to po if counter 1 po null so setref order id po getc order id so save return counter pos createpofromso morder tostring morderline solines getlines solines solines c_bpartner_id m_product_id m_product_po c_orderline m_product_id m_product_id c_order_id iscurrentvendor preparedstatement morder preparestatement get_trxname setint getc_order_id resultset executequery c_bpartner_id getint getbill_bpartner_id c_bpartner_id createpoforvendor getint addlog getdocumentno m_product_id getint solines solines getm_product_id m_product_id morderline poline morderline poline setref_orderline_id solines getc_orderline_id poline setm_product_id solines getm_product_id poline setm_attributesetinstance_id solines getm_attributesetinstance_id poline setc_uom_id solines getc_uom_id poline setqtyentered solines getqtyentered poline setqtyordered solines getqtyordered poline setdescription solines getdescription poline setdatepromised solines getdatepromised poline setprice poline setref_order_id getc_order_id create po for vendor param c bpartner id vendor param so sales order public m order createpo for vendor int c bpartner id m order so m order po new m order get ctx 0 get trxname po set client org so getad client id so getad org id po setref order id so getc order id po set isso trx false po setc doctypetarget id po set description so get description po setpo reference so get document no po set priority rule so get priority rule po setsalesrep id so getsalesrep id po setm warehouse id so getm warehouse id set vendor mb partner vendor new mb partner get ctx c bpartner id get trxname po setb partner vendor drop ship po set is drop ship so is drop ship if so is drop ship po setship bpartner id so getc bpartner id po setship location id so getc bpartner location id po setship user id so getad user id references po setc activity id so getc activity id po setc campaign id so getc campaign id po setc project id so getc project id po setuser1 id so getuser1 id po setuser2 id so getuser2 id po save return po c_bpartner_id morder createpoforvendor c_bpartner_id morder morder morder getctx get_trxname setclientorg getad_client_id getad_org_id setref_order_id getc_order_id setissotrx setc_doctypetarget_id setdescription getdescription setporeference getdocumentno setpriorityrule getpriorityrule setsalesrep_id getsalesrep_id setm_warehouse_id getm_warehouse_id mbpartner mbpartner getctx c_bpartner_id get_trxname setbpartner setisdropship isdropship isdropship setship_bpartner_id getc_bpartner_id setship_location_id getc_bpartner_location_id setship_user_id getad_user_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_project_id getc_project_id setuser1_id getuser1_id setuser2_id getuser2_id standard constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display length display length param field length field length public v text string column name boolean mandatory boolean is read only boolean is updateable int display length int field length super field length 300 2 3 50 super set name column name look and feel install border this text field border create editor set columns display length v string maxdisplay length v string maxdisplay length display length 46 set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal set line wrap true set wrap style word true set mandatory mandatory m columnname column name m fieldlength field length if is read only is updateable set read write false add key listener this popup add mouse listener new vtext mouseadapter this if column name equals script menu editor new c menu item msg get msg env get ctx script env get image icon script16 gif else menu editor new c menu item msg get msg env get ctx editor env get image icon editor16 gif menu editor add action listener this popup menu add menu editor columnname isreadonly isupdateable displaylength fieldlength vtext columnname isreadonly isupdateable displaylength fieldlength fieldlength setname columnname lookandfeel installborder textfield setcolumns displaylength vstring maxdisplay_length vstring maxdisplay_length displaylength setforeground gettextcolor_normal setbackground getfieldbackground_normal setlinewrap setwrapstyleword setmandatory m_columnname columnname m_fieldlength fieldlength isreadonly isupdateable setreadwrite addkeylistener addmouselistener vtext_mouseadapter columnname menueditor cmenuitem getmsg getctx getimageicon menueditor cmenuitem getmsg getctx getimageicon menueditor addactionlistener popupmenu menueditor dispose public void dispose set editor to value param value value public void set value object value if value null m oldtext else m oldtext value to string if m setting return super set value m oldtext m initialtext m oldtext always position top set caret position 0 setvalue m_oldtext m_oldtext tostring m_setting setvalue m_oldtext m_initialtext m_oldtext setcaretposition property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue action listener param e event public void action performed action event e if e get source menu editor menu editor set enabled false string s null if m columnname equals script s script editor start msg translate env get ctx m columnname get text is editable 0 else s editor start editor this msg translate env get ctx m columnname get text is editable m fieldlength menu editor set enabled true data binding try fire vetoable change m columnname m oldtext s catch property veto exception pve actionlistener actionperformed actionevent getsource menueditor menueditor setenabled m_columnname scripteditor getctx m_columnname gettext iseditable starteditor getctx m_columnname gettext iseditable m_fieldlength menueditor setenabled firevetoablechange m_columnname m_oldtext propertyvetoexception action listener interface nop param listener listener public void add action listener action listener listener addactionlistener actionlistener key listener interface param e event public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent key released if escape restore old text param e event public void key released key event e esc if e get key code key event vk escape set text m initialtext m setting true try fire vetoable change m columnname m oldtext get text catch property veto exception pve m setting false keyreleased keyevent getkeycode keyevent vk_escape settext m_initialtext m_setting firevetoablechange m_columnname m_oldtext gettext propertyvetoexception m_setting set field window no for value preference nop param m field field model public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield constructor param adaptee v text vtext mouseadapter v text adaptee this adaptee adaptee vtext vtext_mouseadapter vtext mouse listener param e event public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource constructor param ad column id column id param column name dolumn name param columnsql virtual column param display type display type param is mandatory mandatory param is updateable updateable param default logic default logic param column label column label param column description column description param is key true if key param is parent true if parent param ad reference value id reference value param validation code sql validation code param field length field length param value min minimal value param value max maximal value public po info column int ad column id string column name string columnsql int display type boolean is mandatory boolean is updateable string default logic string column label string column description boolean is key boolean is parent int ad reference value id string validation code int field length string value min string value max boolean is translated boolean is encrypted ad column id ad column id column name column name columnsql columnsql display type display type if column name equals ad language display type org compiere util display type string column class string class else if column name equals posted column name equals processed column name equals processing column class boolean class else if column name equals record id display type org compiere util display type id column class integer class else column class org compiere util display type get class display type true is mandatory is mandatory is updateable is updateable default logic default logic column label column label column description column description is key is key is parent is parent ad reference value id ad reference value id validation code validation code field length field length value min value min try if value min null value min length 0 valuemin bd new big decimal value min catch exception ex c logger get log level severe value min value min ex value max value max try if value max null value max length 0 valuemax bd new big decimal value max catch exception ex c logger get log level severe value max value max ex is translated is translated is encrypted is encrypted ad_column_id columnname displaytype ismandatory isupdateable defaultlogic columnlabel columndescription iskey isparent ad_reference_value_id validationcode fieldlength valuemin valuemax poinfocolumn ad_column_id columnname displaytype ismandatory isupdateable defaultlogic columnlabel columndescription iskey isparent ad_reference_value_id validationcode fieldlength valuemin valuemax istranslated isencrypted ad_column_id ad_column_id columnname columnname displaytype displaytype columnname ad_language displaytype displaytype columnclass columnname columnname columnname columnclass columnname record_id displaytype displaytype columnclass columnclass displaytype getclass displaytype ismandatory ismandatory isupdateable isupdateable defaultlogic defaultlogic columnlabel columnlabel columndescription columndescription iskey iskey isparent isparent ad_reference_value_id ad_reference_value_id validationcode validationcode fieldlength fieldlength valuemin valuemin valuemin valuemin valuemin_bd bigdecimal valuemin clogger valuemin valuemin valuemax valuemax valuemax valuemax valuemax_bd bigdecimal valuemax clogger valuemax valuemax istranslated istranslated isencrypted isencrypted string representation return info public string to string string buffer sb new string buffer po info column sb append column name append id append ad column id append display type append display type append column class append column class sb append return sb to string tostring stringbuffer stringbuffer poinfo columnname ad_column_id displaytype displaytype columnclass columnclass tostring standard field constructor created in layout engine param in text text param font font param paint paint param id optional id null if document param translate text if true check for optional text translation public string element string in text font font paint paint name pair id boolean translate text super log finest text in text id id translate translate text m font font m paint paint if translate text int count util get count in text if count 0 count 2 0 m originalstring in text translate it to get rough space not correct context may be too small in text msg parse translation env get ctx m originalstring m id id string lines pattern compile pattern multiline split in text m string paper new attributed string lines length m string view new attributed string lines length for int i 0 i lines length i string line util removecrlf lines i m string paper i new attributed string line if line length 0 continue log finest line i line m string paper i add attribute text attribute font font m string paper i add attribute text attribute foreground paint if m id null i 0 first line only create special attributed string m string view i new attributed string line m string view i add attribute text attribute font font int end index line length m string view i add attribute text attribute foreground link color m string view i add attribute text attribute underline text attribute underline low one pixel 0 end index else m string view i m string paper i load image wait for load layout engine image true wait for load layout engine image false layoutengine intext translatetext stringelement intext namepair translatetext intext translatetext m_font m_paint translatetext getcount intext m_originalstring intext intext parsetranslation getctx m_originalstring m_id intext m_string_paper attributedstring m_string_view attributedstring m_string_paper attributedstring m_string_paper addattribute textattribute m_string_paper addattribute textattribute m_id m_string_view attributedstring m_string_view addattribute textattribute endindex m_string_view addattribute textattribute link_color m_string_view addattribute textattribute textattribute underline_low_one_pixel endindex m_string_view m_string_paper waitforload layoutengine image_true waitforload layoutengine image_false attributed string constructor param string attributed string public string element attributed string string super m string paper new attributed string string m string view m string paper stringelement attributedstring m_string_paper attributedstring m_string_view m_string_paper field constructor created in layout engine param content text or boolean param font font param paint paint param id optional id null if document param label optional label param label suffix optional label suffix public string element object content font font paint paint name pair id string label string label suffix super log finest label label label suffix content content id id m font font m paint paint int start index 0 int end offset 0 string buffer text new string buffer if label null label length 0 text append label append start index label length 1 if content instanceof boolean m check boolean content else text append content if label suffix null label suffix length 0 text append label suffix end offset label suffix length m id id string lines pattern compile pattern multiline split text m string paper new attributed string lines length m string view new attributed string lines length for int i 0 i lines length i string line util removecrlf lines i m string paper i new attributed string line if line length 0 continue log finest line i line m string paper i add attribute text attribute font font m string paper i add attribute text attribute foreground paint if m id null i 0 first line only create special attributed string m string view i new attributed string line m string view i add attribute text attribute font font m string view i add attribute text attribute foreground paint int end index line length end offset if end index start index m string view i add attribute text attribute foreground link color start index end index m string view i add attribute text attribute underline text attribute underline low one pixel start index end index else m string view i m string paper i layoutengine labelsuffix stringelement namepair labelsuffix labelsuffix m_font m_paint startindex endoffset stringbuffer stringbuffer startindex m_check labelsuffix labelsuffix labelsuffix endoffset labelsuffix m_id m_string_paper attributedstring m_string_view attributedstring m_string_paper attributedstring m_string_paper addattribute textattribute m_string_paper addattribute textattribute m_id m_string_view attributedstring m_string_view addattribute textattribute m_string_view addattribute textattribute endindex endoffset endindex startindex m_string_view addattribute textattribute link_color startindex endindex m_string_view addattribute textattribute textattribute underline_low_one_pixel startindex endindex m_string_view m_string_paper get optional id return id or null public name pair getid return m id namepair m_id get original string return original may be null public string get original string return m originalstring getoriginalstring m_originalstring translate context if required if content is translated the element needs to stay in the bounds of the originally calculated size and need to align the field param ctx context public void translate properties ctx if m originalstring null return string in text msg parse translation ctx m originalstring log fine string element translate in text string lines pattern compile pattern multiline split in text m string paper new attributed string lines length for int i 0 i lines length i string line util removecrlf lines i m string paper i new attributed string line if line length 0 m string paper i add attribute text attribute font m font m string paper i add attribute text attribute foreground m paint m string view m string paper m_originalstring intext parsetranslation m_originalstring stringelement intext intext m_string_paper attributedstring m_string_paper attributedstring m_string_paper addattribute textattribute m_font m_string_paper addattribute textattribute m_paint m_string_view m_string_paper layout and calculate size set p width p height return size protected boolean calculate size if p sizecalculated return true font render context frc new font render context null true true text layout layout null p height 0f p width 0f no limit if p maxwidth 0f p maxheight 0f for int i 0 i m string paper length i attributed character iterator iter m string paper i get iterator if iter get begin index iter get end index continue check for tab just first int tab pos 1 for char c iter first c character iterator done tab pos 1 c iter next if c t tab pos iter get index if tab pos 1 layout new text layout iter frc p height layout get ascent layout get descent layout get leading if p width layout get advance p width layout get advance else with tab line break measurer measurer new line break measurer iter frc layout measurer next layout 9999 tab pos false p height layout get ascent layout get descent layout get leading float width get tab pos 0 layout get advance layout measurer next layout 9999 iter get end index true width layout get advance if p width width p width width for all strings add check box size if m check null p width layout engine image size width if p height layout engine image size height p height layout engine image size height size limits else p width p maxwidth for int i 0 i m string paper length i attributed character iterator iter m string paper i get iterator if iter get begin index iter get end index continue line break measurer measurer new line break measurer iter frc system out println string length m originalstring length max width p maxwidth max height p maxheight while measurer get position iter get end index no need to expand tab space for limited space layout measurer next layout p maxwidth float line height layout get ascent layout get descent layout get leading system out println line width layout get advance line height line height if p maxheight 1f i 0 one line only p maxheight line height if p maxheight 0f p height line height p maxheight p height line height for all strings add check box size if m check null p width layout engine image size width if p height layout engine image size height p height layout engine image size height system out println width p width height p height system out println string element calculate size width p width p maxwidth height p height p maxheight enlarge size when aligned and max size is given if p fieldalignmenttype null boolean changed false if p height p maxheight p height p maxheight changed true if p width p maxwidth p width p maxwidth changed true if changed system out println string element calculate size width p width p maxwidth height p height p maxheight return true p_width p_height calculatesize p_sizecalculated fontrendercontext fontrendercontext textlayout p_height p_width p_maxwidth p_maxheight m_string_paper attributedcharacteriterator m_string_paper getiterator getbeginindex getendindex tabpos characteriterator tabpos tabpos getindex tabpos textlayout p_height getascent getdescent getleading p_width getadvance p_width getadvance linebreakmeasurer linebreakmeasurer nextlayout tabpos p_height getascent getdescent getleading gettabpos getadvance nextlayout getendindex getadvance p_width p_width checkbox m_check p_width layoutengine image_size p_height layoutengine image_size p_height layoutengine image_size p_width p_maxwidth m_string_paper attributedcharacteriterator m_string_paper getiterator getbeginindex getendindex linebreakmeasurer linebreakmeasurer stringlength m_originalstring maxwidth p_maxwidth maxheight p_maxheight getposition getendindex nextlayout p_maxwidth lineheight getascent getdescent getleading linewidth getadvance lineheight lineheight p_maxheight p_maxheight lineheight p_maxheight p_height lineheight p_maxheight p_height lineheight checkbox m_check p_width layoutengine image_size p_height layoutengine image_size p_height layoutengine image_size p_width p_height stringelement p_width p_maxwidth p_height p_maxheight p_fieldalignmenttype p_height p_maxheight p_height p_maxheight p_width p_maxwidth p_width p_maxwidth stringelement p_width p_maxwidth p_height p_maxheight get drill down value param relative point relative point param page no page number ignored return if found query or null public m query get drill down point relative point int page no if m id null get bounds contains relative point log fine to string string column name m query get zoom column name m id get name string table name m query get zoom table name column name object code m id getid if m id instanceof key name pair code new integer key name pair m id get key m query query new m query table name query add restriction column name m query equal code return query return null relativepoint pageno mquery getdrilldown relativepoint pageno m_id getbounds relativepoint tostring columnname mquery getzoomcolumnname m_id getname tablename mquery getzoomtablename columnname m_id m_id keynamepair keynamepair m_id getkey mquery mquery tablename addrestriction columnname mquery get drill across value param relative point relative point param page no page number ignored return null not implemented public m query get drill across point relative point int page no log fine string element get drill across if get bounds contains relative point return null relativepoint pageno mquery getdrillacross relativepoint pageno stringelement getdrillacross getbounds relativepoint paint print calculate actual size the text is printed in the topmost left position i e the leading is below the line param g2d graphics param page start top left location of page param page no page number for multi page support 0 header footer ignored param ctx print context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view log finest string element paint m originalstring p pagelocation x p pagelocation y clip g2d get clip translate g2d get transform get translatex g2d get transform get translatey scale g2d get transform get scalex g2d get transform get scaley shear g2d get transform get shearx g2d get transform get sheary point2d double location get absolute location page start if m originalstring null translate ctx attributed string a string null attributed character iterator iter null attributed character iterator iter2 null float x pos float location x float y pos float location y float y pen 0f float height 0f float width 0f for all lines for int i 0 i m string paper length i get text if is view if m string view i null continue a string m string view i else if m string paper i null continue a string m string paper i iter a string get iterator zero length if iter get begin index iter get end index continue check for tab just first and 16 bit characters int tab pos 1 boolean is8 bit true for char c iter first c character iterator done c iter next if c t tab pos 1 tab pos iter get index if c 255 is8 bit false text layout layout null float x pen x pos no limit if p maxwidth 0f if tab pos 1 layout new text layout iter g2d get font render context y pen y pos layout get ascent layout draw g2d x pen y pen g2d set font m font g2d set paint m paint g2d draw string iter x pen y pen y pos layout get ascent layout get descent layout get leading if width layout get advance width layout get advance else we have a tab line break measurer measurer new line break measurer iter g2d get font render context layout measurer next layout 9999 tab pos false float lineheight 1 layout get ascent layout get descent layout get leading y pen y pos layout get ascent layout draw g2d x pen y pen first part before tab x pen get tab pos x pos layout get advance float line width x pen x pos layout measurer next layout 9999 iter get end index true float lineheight 2 layout get ascent layout get descent layout get leading layout draw g2d x pen y pen second part after tab y pos math max lineheight 1 lineheight 2 line width layout get advance if width line width width line width log finest string element paint no limit location x y pos w layout get advance h line height bounds layout get bounds size limits else boolean fast draw layout engine s fastdraw if fast draw is view is8 bit fast draw false line break measurer measurer new line break measurer iter g2d get font render context while measurer get position iter get end index if tab pos 1 layout measurer next layout p maxwidth if iter get end index measurer next offset p maxwidth fast draw false else tab fast draw false layout measurer next layout p maxwidth tab pos false line height float line height layout get ascent layout get descent layout get leading if p maxheight 1f i 0 one line only p maxheight line height if we have hight left over if p maxheight 0f height line height p maxheight y pen float location y height layout get ascent tab in text if tab pos 1 layout draw g2d x pen y pen first part before tab x pen get tab pos x pos layout get advance layout measurer next layout p width iter get end index true tab pos 1 reset just one tab else if m print format item fieldalignmenttype trailingright equals p fieldalignmenttype layout is left to right m print format item fieldalignmenttype leadingleft equals p fieldalignmenttype layout is left to right x pen p maxwidth layout get advance else if m print format item fieldalignmenttype center equals p fieldalignmenttype x pen p maxwidth layout get advance 2 else if m print format item fieldalignmenttype block equals p fieldalignmenttype measurer get position iter get end index layout layout get justified layout p maxwidth fast draw false if fast draw g2d set font m font g2d set paint m paint g2d draw string iter x pen y pen else layout draw g2d x pen y pen height line height log finest string element paint limit x pen y pen w layout get advance h line height align p fieldalignmenttype max w p maxwidth h p maxheight bounds layout get bounds width p maxwidth size limits for all strings if m check null int x int location x width 1 int y int location y g2d draw image m check boolean value layout engine image true layout engine image false x y this pagestart pageno isview ids pageno pagestart isview stringelement m_originalstring p_pagelocation p_pagelocation getclip gettransform gettranslatex gettransform gettranslatey gettransform getscalex gettransform getscaley gettransform getshearx gettransform getsheary getabsolutelocation pagestart m_originalstring attributedstring astring attributedcharacteriterator attributedcharacteriterator xpos ypos ypen m_string_paper isview m_string_view astring m_string_view m_string_paper astring m_string_paper astring getiterator getbeginindex getendindex tabpos is8bit characteriterator tabpos tabpos getindex is8bit textlayout xpen xpos p_maxwidth tabpos textlayout getfontrendercontext ypen ypos getascent xpen ypen setfont m_font setpaint m_paint drawstring xpen ypen ypos getascent getdescent getleading getadvance getadvance linebreakmeasurer linebreakmeasurer getfontrendercontext nextlayout tabpos lineheight_1 getascent getdescent getleading ypen ypos getascent xpen ypen xpen gettabpos xpos getadvance linewidth xpen xpos nextlayout getendindex lineheight_2 getascent getdescent getleading xpen ypen ypos lineheight_1 lineheight_2 linewidth getadvance linewidth linewidth stringelement ypos getadvance lineheight getbounds fastdraw layoutengine s_fastdraw fastdraw isview is8bit fastdraw linebreakmeasurer linebreakmeasurer getfontrendercontext getposition getendindex tabpos nextlayout p_maxwidth getendindex nextoffset p_maxwidth fastdraw fastdraw nextlayout p_maxwidth tabpos lineheight getascent getdescent getleading p_maxheight p_maxheight lineheight p_maxheight lineheight p_maxheight ypen getascent tabpos xpen ypen xpen gettabpos xpos getadvance nextlayout p_width getendindex tabpos mprintformatitem fieldalignmenttype_trailingright p_fieldalignmenttype islefttoright mprintformatitem fieldalignmenttype_leadingleft p_fieldalignmenttype islefttoright xpen p_maxwidth getadvance mprintformatitem fieldalignmenttype_center p_fieldalignmenttype xpen p_maxwidth getadvance mprintformatitem fieldalignmenttype_block p_fieldalignmenttype getposition getendindex getjustifiedlayout p_maxwidth fastdraw fastdraw setfont m_font setpaint m_paint drawstring xpen ypen xpen ypen lineheight stringelement xpen ypen getadvance lineheight p_fieldalignmenttype p_maxwidth p_maxheight getbounds p_maxwidth m_check drawimage m_check booleanvalue layoutengine image_true layoutengine image_false get tab position the tab position is relative to the string itself not the absolute position i e to have the same tab position on a page strings need to start at the same position the tab is rounded up to the next 30 dividable position param x pos starting x position param length length of segment return new x position x pos length tab space private float get tab pos float x pos float length float ret value x pos length int i length int math ceil length int tab space i length 30 ret value 30 tab space return ret value xpos xpos tabspace gettabpos xpos retvalue xpos ilength tabspace ilength retvalue tabspace retvalue string representation return info public string to string string buffer sb new string buffer string element sb append bounds append get bounds append height append p height append append p maxheight append width append p width append append p maxheight append page location append p pagelocation append for int i 0 i m string paper length i if m string paper length 1 sb append env nl append i append attributed character iterator iter m string paper i get iterator for char c iter first c character iterator done c iter next sb append c if m id null sb append id append m id to stringx append sb append return sb to string tostring stringbuffer stringbuffer stringelement getbounds p_height p_maxheight p_width p_maxheight pagelocation p_pagelocation m_string_paper m_string_paper attributedcharacteriterator m_string_paper getiterator characteriterator m_id m_id tostringx tostring standard constructor public x c remuneration properties ctx int c remuneration id string trx name super ctx c remuneration id trx name if c remuneration id 0 setc remuneration id 0 set grossr amt env zero set grossr cost env zero set name null set overtime amt env zero set overtime cost env zero set remuneration type null set standard hours 0 x_c_remuneration c_remuneration_id trxname c_remuneration_id trxname c_remuneration_id setc_remuneration_id setgrossramt setgrossrcost setname setovertimeamt setovertimecost setremunerationtype setstandardhours load constructor public x c remuneration properties ctx result set rs string trx name super ctx rs trx name x_c_remuneration resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c remuneration append get id append return sb to string tostring stringbuffer stringbuffer x_c_remuneration get_id tostring set remuneration wage or salary public void setc remuneration id int c remuneration id if c remuneration id 1 throw new illegal argument exception c remuneration id is mandatory set valuenocheck c remuneration id new integer c remuneration id setc_remuneration_id c_remuneration_id c_remuneration_id illegalargumentexception c_remuneration_id set_valuenocheck c_remuneration_id c_remuneration_id get remuneration wage or salary public int getc remuneration id integer ii integer get value c remuneration id if ii null return 0 return ii int value getc_remuneration_id get_value c_remuneration_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gross amount gross remuneration amount public void set grossr amt big decimal grossr amt if grossr amt null throw new illegal argument exception grossr amt is mandatory set value grossr amt grossr amt setgrossramt bigdecimal grossramt grossramt illegalargumentexception grossramt set_value grossramt grossramt get gross amount gross remuneration amount public big decimal get grossr amt big decimal bd big decimal get value grossr amt if bd null return env zero return bd bigdecimal getgrossramt bigdecimal bigdecimal get_value grossramt set gross cost gross remuneration costs public void set grossr cost big decimal grossr cost if grossr cost null throw new illegal argument exception grossr cost is mandatory set value grossr cost grossr cost setgrossrcost bigdecimal grossrcost grossrcost illegalargumentexception grossrcost set_value grossrcost grossrcost get gross cost gross remuneration costs public big decimal get grossr cost big decimal bd big decimal get value grossr cost if bd null return env zero return bd bigdecimal getgrossrcost bigdecimal bigdecimal get_value grossrcost set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set overtime amount hourly overtime rate public void set overtime amt big decimal overtime amt if overtime amt null throw new illegal argument exception overtime amt is mandatory set value overtime amt overtime amt setovertimeamt bigdecimal overtimeamt overtimeamt illegalargumentexception overtimeamt set_value overtimeamt overtimeamt get overtime amount hourly overtime rate public big decimal get overtime amt big decimal bd big decimal get value overtime amt if bd null return env zero return bd bigdecimal getovertimeamt bigdecimal bigdecimal get_value overtimeamt set overtime cost hourly overtime cost public void set overtime cost big decimal overtime cost if overtime cost null throw new illegal argument exception overtime cost is mandatory set value overtime cost overtime cost setovertimecost bigdecimal overtimecost overtimecost illegalargumentexception overtimecost set_value overtimecost overtimecost get overtime cost hourly overtime cost public big decimal get overtime cost big decimal bd big decimal get value overtime cost if bd null return env zero return bd bigdecimal getovertimecost bigdecimal bigdecimal get_value overtimecost public static final string remunerationtype weekly w set remuneration type type of remuneration public void set remuneration type string remuneration type if remuneration type null throw new illegal argument exception remuneration type is mandatory if remuneration type equals b remuneration type equals d remuneration type equals h remuneration type equals m remuneration type equals t remuneration type equals w else throw new illegal argument exception remuneration type invalid value remuneration type reference id 346 b d h m t w if remuneration type length 1 log warning length 1 truncated remuneration type remuneration type substring 0 0 set value remuneration type remuneration type remunerationtype_weekly setremunerationtype remunerationtype remunerationtype illegalargumentexception remunerationtype remunerationtype remunerationtype remunerationtype remunerationtype remunerationtype remunerationtype illegalargumentexception remunerationtype remunerationtype reference_id remunerationtype remunerationtype remunerationtype set_value remunerationtype remunerationtype get remuneration type type of remuneration public string get remuneration type return string get value remuneration type getremunerationtype get_value remunerationtype set standard hours standard work hours based on remuneration type public void set standard hours int standard hours set value standard hours new integer standard hours setstandardhours standardhours set_value standardhours standardhours get standard hours standard work hours based on remuneration type public int get standard hours integer ii integer get value standard hours if ii null return 0 return ii int value getstandardhours get_value standardhours intvalue standard constructor public x ad reference properties ctx int ad reference id string trx name super ctx ad reference id trx name if ad reference id 0 setad reference id 0 set entity type null u set name null set validation type null x_ad_reference ad_reference_id trxname ad_reference_id trxname ad_reference_id setad_reference_id setentitytype setname setvalidationtype load constructor public x ad reference properties ctx result set rs string trx name super ctx rs trx name x_ad_reference resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad reference append get id append return sb to string tostring stringbuffer stringbuffer x_ad_reference get_id tostring set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set valuenocheck ad reference id new integer ad reference id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_valuenocheck ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 40 log warning length 40 truncated v format v format substring 0 39 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat public static final string validationtype tablevalidation t set validation type different method of validating data public void set validation type string validation type if validation type null throw new illegal argument exception validation type is mandatory if validation type equals d validation type equals l validation type equals t else throw new illegal argument exception validation type invalid value validation type reference id 2 d l t if validation type length 1 log warning length 1 truncated validation type validation type substring 0 0 set value validation type validation type validationtype_tablevalidation setvalidationtype validationtype validationtype illegalargumentexception validationtype validationtype validationtype validationtype illegalargumentexception validationtype validationtype reference_id validationtype validationtype validationtype set_value validationtype validationtype get validation type different method of validating data public string get validation type return string get value validation type getvalidationtype get_value validationtype constructor param find find param value to true if it is the to value column public find value editor find find boolean value to super m find find m valuetocolumn value to valueto findvalueeditor valueto m_find m_valuetocolumn valueto get value need to convert to string return current value public object get cell editor value if m editor null return null object obj m editor get value returns integer bid decimal string log config obj obj return obj if obj null return null string ret value obj to string log config find value editor get cell editor value return ret value getcelleditorvalue m_editor m_editor getvalue biddecimal retvalue tostring findvalueeditor getcelleditorvalue retvalue get editor param table table param value value param is selected cell is selected param row row param col column return editor component public component get table cell editor component j table table object value boolean is selected int row int col log config find value editor get table cell editor component r row c col between enables value to column m between false object between value table get model get value at row find index operator if m valuetocolumn between value null between value equals m query operators m query between index m between true boolean enabled m valuetocolumn m valuetocolumn m between log config value enabled enabled string column name null object column table get model get value at row find index columnname if column null column name value name pair column get value create editor m field field m find get targetm field column name log fine field field to stringx if field is key m editor new v number column name false false true display type integer column name else m editor v editor factory get editor field true if m editor null m editor new v string m editor set value value m editor set read write enabled m editor set border null return component m editor isselected gettablecelleditorcomponent jtable isselected findvalueeditor gettablecelleditorcomponent valuetocolumn m_between betweenvalue getmodel getvalueat index_operator m_valuetocolumn betweenvalue betweenvalue mquery mquery between_index m_between m_valuetocolumn m_valuetocolumn m_between columnname getmodel getvalueat index_columnname columnname valuenamepair getvalue mfield m_find gettargetmfield columnname tostringx iskey m_editor vnumber columnname displaytype columnname m_editor veditorfactory geteditor m_editor m_editor vstring m_editor setvalue m_editor setreadwrite m_editor setborder m_editor cell editable called before get table cell editor component param e event return true if editable public boolean is cell editable event object e log config find value editor is cell editable return true gettablecelleditorcomponent iscelleditable eventobject findvalueeditor iscelleditable cell selectable called after get table cell editor component param e event return true if selectable public boolean should select cell event object e boolean ret value m valuetocolumn m valuetocolumn m between log config find value editor should select cell ret value return ret value gettablecelleditorcomponent shouldselectcell eventobject retvalue m_valuetocolumn m_valuetocolumn m_between findvalueeditor shouldselectcell retvalue retvalue standard constructor param ctx context param w countercount id id public m counter count properties ctx int w countercount id string trx name super ctx w countercount id trx name if w countercount id 0 set counter 0 set name null set pageurl null w_countercount_id mcountercount w_countercount_id trxname w_countercount_id trxname w_countercount_id setcounter setname setpageurl load constructor param ctx context param rs result set public m counter count properties ctx result set rs string trx name super ctx rs trx name mcountercount resultset trxname trxname standard constructor param ctx context param c year id id public m year properties ctx int c year id string trx name super ctx c year id trx name if c year id 0 setc calendar id 0 set year null set processing false n c_year_id myear c_year_id trxname c_year_id trxname c_year_id setc_calendar_id setyear setprocessing load constructor param ctx context param rs result set public m year properties ctx result set rs string trx name super ctx rs trx name myear resultset trxname trxname parent constructor param calendar parent public m year m calendar calendar this calendar get ctx 0 calendar get trxname set client org calendar setc calendar id calendar getc calendar id set year myear mcalendar getctx get_trxname setclientorg setc_calendar_id getc_calendar_id setyear set current year private void set year gregorian calendar cal new gregorian calendar language get login language get locale string year string value of cal get calendar year super set year year setyear gregoriancalendar gregoriancalendar getloginlanguage getlocale valueof setyear get year as int return year as int or 0 public int get year as int try return integer parse int get year catch exception e log log level severe get year as int e to string return 0 getyearasint parseint getyear getyearasint tostring get last two characters of year return 01 public string getyy string year get year return year substring 2 4 getyear string representation return info public string to string string buffer sb new string buffer m year sb append get id append append get year append return sb to string tostring stringbuffer stringbuffer myear get_id getyear tostring before save param new record new return true if can be saved protected boolean before save boolean new record if get year as int 0 return false return true newrecord beforesave newrecord getyearasint create 12 standard jan dec periods creates also period control from doc type see document type verify create period controls properties int svr process string return true if created public boolean create std periods locale locale if locale null m client client m client get get ctx locale client get locale if locale null language get login language null locale language get login language get locale if locale null locale env get language get ctx get locale date format symbols symbols new date format symbols locale string months symbols get short months int year get year as int gregorian calendar cal new gregorian calendar locale cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 for int month 0 month 12 month cal set calendar year year cal set calendar month month cal set calendar day of month 1 timestamp start new timestamp cal get time in millis string name months month getyy cal add calendar month 1 cal add calendar day of year 1 timestamp end new timestamp cal get time in millis m period period new m period this month 1 name start end if period save get trxname creates period control return false return true doctype documenttypeverify createperiodcontrols svrprocess createstdperiods mclient mclient getctx getlocale getloginlanguage getloginlanguage getlocale getlanguage getctx getlocale dateformatsymbols dateformatsymbols getshortmonths getyearasint gregoriancalendar gregoriancalendar hour_of_day day_of_month gettimeinmillis day_of_year gettimeinmillis mperiod mperiod get_trxname standard constructor public x c activity properties ctx int c activity id string trx name super ctx c activity id trx name if c activity id 0 setc activity id 0 set is summary false set name null set value null x_c_activity c_activity_id trxname c_activity_id trxname c_activity_id setc_activity_id setissummary setname setvalue load constructor public x c activity properties ctx result set rs string trx name super ctx rs trx name x_c_activity resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c activity append get id append return sb to string tostring stringbuffer stringbuffer x_c_activity get_id tostring set activity business activity public void setc activity id int c activity id if c activity id 1 throw new illegal argument exception c activity id is mandatory set valuenocheck c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id illegalargumentexception c_activity_id set_valuenocheck c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value get content return content public object get contents return contents getcontents get m rfq from cache param ctx context param c rfq id id return m rfq public static m rfq get properties ctx int c rfq id string trx name integer key new integer c rfq id m rfq ret value m rfq s cache get key if ret value null return ret value ret value new m rfq ctx c rfq id trx name if ret value get id 0 s cache put key ret value return ret value mrfq c_rfq_id mrfq mrfq c_rfq_id trxname c_rfq_id mrfq retvalue mrfq s_cache retvalue retvalue retvalue mrfq c_rfq_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c rfq id id public m rfq properties ctx int c rfq id string trx name super ctx c rfq id trx name if c rfq id 0 setc rfq topic id 0 set name null setc currency id 0 c currency id setsalesrep id 0 set date response new timestamp system current time millis set date work start new timestamp system current time millis set is invited vendors only false set quote type quotetype quoteselectedlines set is quote all qty false set is quote total amt false set is rfq response accepted true set is self service true set processed false c_rfq_id mrfq c_rfq_id trxname c_rfq_id trxname c_rfq_id setc_rfq_topic_id setname setc_currency_id c_currency_id setsalesrep_id setdateresponse currenttimemillis setdateworkstart currenttimemillis setisinvitedvendorsonly setquotetype quotetype_quoteselectedlines setisquoteallqty setisquotetotalamt setisrfqresponseaccepted setisselfservice setprocessed load constructor param ctx context param rs result set public m rfq properties ctx result set rs string trx name super ctx rs trx name mrfq resultset trxname trxname get active lines return array of lines public m rfq line get lines array list m rfq line list new array list m rfq line string sql select from c rfqline where c rfq id and is active y order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfq id result set rs pstmt execute query while rs next list add new m rfq line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rfq line ret value new m rfq line list size list to array ret value return ret value mrfqline getlines arraylist mrfqline arraylist mrfqline c_rfqline c_rfq_id isactive preparedstatement preparestatement get_trxname setint getc_rfq_id resultset executequery mrfqline getctx get_trxname mrfqline retvalue mrfqline toarray retvalue retvalue get rfq responses param active only active responses only param completed only complete responses only return array of lines public m rfq response get responses boolean active only boolean completed only array list m rfq response list new array list m rfq response string sql select from c rfqresponse where c rfq id if active only sql and is active y if completed only sql and is complete y sql order by price prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfq id result set rs pstmt execute query while rs next list add new m rfq response get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rfq response ret value new m rfq response list size list to array ret value return ret value activeonly completedonly mrfqresponse getresponses activeonly completedonly arraylist mrfqresponse arraylist mrfqresponse c_rfqresponse c_rfq_id activeonly isactive completedonly iscomplete preparedstatement preparestatement get_trxname setint getc_rfq_id resultset executequery mrfqresponse getctx get_trxname mrfqresponse retvalue mrfqresponse toarray retvalue retvalue string representation return info public string to string string buffer sb new string buffer m rfq sb append get id append name append get name append quote type append get quote type append return sb to string tostring stringbuffer stringbuffer mrfq get_id getname quotetype getquotetype tostring is quote total amt only return true if total amout only public boolean is quote total amt only return quotetype quotetotalonly equals get quote type isquotetotalamtonly quotetype_quotetotalonly getquotetype is quote selected lines return true if quote selected lines public boolean is quote selected lines return quotetype quoteselectedlines equals get quote type isquoteselectedlines quotetype_quoteselectedlines getquotetype is quote all lines return true if quote selected lines public boolean is quote all lines return quotetype quotealllines equals get quote type isquotealllines quotetype_quotealllines getquotetype is quote total amt only valid return null or error message public string check quote total amt only if is quote total amt only return null need to check line qty m rfq line lines get lines for int i 0 i lines length i m rfq line line lines i m rfq line qty qtys line get qtys if qtys length 1 log warning is quote total amt only valid qtys length line string msg line line get line c rfqlineqty qtys length is quote total amt return msg return null checkquotetotalamtonly isquotetotalamtonly mrfqline getlines mrfqline mrfqlineqty getqtys isquotetotalamtonlyvalid getline c_rfqlineqty isquotetotalamt before save param new record new return true protected boolean before save boolean new record calculate complete date also used to verify if get date work start null get delivery days 0 set date work complete time util add days get date work start get delivery days calculate delivery days else if get date work start null get delivery days 0 get date work complete null set delivery days time util get days between get date work start get date work complete calculate start date else if get date work start null get delivery days 0 get date work complete null set date work start time util add days get date work complete get delivery days 1 return true newrecord beforesave newrecord getdateworkstart getdeliverydays setdateworkcomplete timeutil adddays getdateworkstart getdeliverydays getdateworkstart getdeliverydays getdateworkcomplete setdeliverydays timeutil getdaysbetween getdateworkstart getdateworkcomplete getdateworkstart getdeliverydays getdateworkcomplete setdateworkstart timeutil adddays getdateworkcomplete getdeliverydays get payments of b partner param ctx context param c bpartner id id return array public static m invoice get ofb partner properties ctx int c bpartner id string trx name array list m invoice list new array list m invoice string sql select from c invoice where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next list add new m invoice ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m invoice ret value new m invoice list size list to array ret value return ret value bpartner c_bpartner_id minvoice getofbpartner c_bpartner_id trxname arraylist minvoice arraylist minvoice c_invoice c_bpartner_id preparedstatement preparestatement trxname setint c_bpartner_id resultset executequery minvoice trxname s_log minvoice retvalue minvoice toarray retvalue retvalue create new invoice by copying param from invoice param date doc date of the document date param c doctypetarget id target doc type param isso trx sales order param counter create counter links param trx name trx param set order set order links return invoice public static m invoice copy from m invoice from timestamp date doc int c doctypetarget id boolean isso trx boolean counter string trx name boolean set order m invoice to new m invoice from get ctx 0 null to set trxname trx name po copy values from to from getad client id from getad org id to set valuenocheck c invoice id i zero to set valuenocheck document no null to set doc status docstatus drafted draft to set doc action docaction complete to setc doctype id 0 to setc doctypetarget id c doctypetarget id to set isso trx isso trx to set date invoiced date doc to set date acct date doc to set date printed null to set is printed false to set is approved false to setc payment id 0 to setc cashline id 0 to set is paid false to set is in dispute false amounts are updated by trigger when adding lines to set grand total env zero to set total lines env zero to set is transferred false to set posted false to set processed false delete references to set is self service false if set order to setc order id 0 if counter to setref invoice id from getc invoice id try to find order link if from getc order id 0 m order peer new m order from get ctx from getc order id from get trxname if peer getref order id 0 to setc order id peer getref order id else to setref invoice id 0 if to save trx name throw new illegal state exception could not create invoice if counter from setref invoice id to getc invoice id lines if to copy lines from from counter set order 0 throw new illegal state exception could not create invoice lines return to datedoc c_doctypetarget_id issotrx trxname setorder minvoice copyfrom minvoice datedoc c_doctypetarget_id issotrx trxname setorder minvoice minvoice getctx set_trxname trxname copyvalues getad_client_id getad_org_id set_valuenocheck c_invoice_id i_zero set_valuenocheck documentno setdocstatus docstatus_drafted setdocaction docaction_complete setc_doctype_id setc_doctypetarget_id c_doctypetarget_id setissotrx issotrx setdateinvoiced datedoc setdateacct datedoc setdateprinted setisprinted setisapproved setc_payment_id setc_cashline_id setispaid setisindispute setgrandtotal settotallines setistransferred setposted setprocessed setisselfservice setorder setc_order_id setref_invoice_id getc_invoice_id getc_order_id morder morder getctx getc_order_id get_trxname getref_order_id setc_order_id getref_order_id setref_invoice_id trxname illegalstateexception setref_invoice_id getc_invoice_id copylinesfrom setorder illegalstateexception get pdf file name param document dir directory param c invoice id invoice return file name public static string getpdf file name string document dir int c invoice id string buffer sb new string buffer document dir if sb length 0 sb append if sb to string ends with file separator sb append file separator sb append c invoice id append c invoice id append pdf return sb to string documentdir c_invoice_id getpdffilename documentdir c_invoice_id stringbuffer stringbuffer documentdir tostring endswith c_invoice_id_ c_invoice_id tostring get m invoice from cache param ctx context param c invoice id id return m invoice public static m invoice get properties ctx int c invoice id integer key new integer c invoice id m invoice ret value m invoice s cache get key if ret value null return ret value ret value new m invoice ctx c invoice id null if ret value get id 0 s cache put key ret value return ret value minvoice c_invoice_id minvoice minvoice c_invoice_id c_invoice_id minvoice retvalue minvoice s_cache retvalue retvalue retvalue minvoice c_invoice_id retvalue get_id s_cache retvalue retvalue invoice constructor param ctx context param c invoice id invoice or 0 for new param trx name trx name public m invoice properties ctx int c invoice id string trx name super ctx c invoice id trx name if c invoice id 0 set doc status docstatus drafted draft set doc action docaction complete set payment rule paymentrule oncredit payment terms set date invoiced new timestamp system current time millis set date acct new timestamp system current time millis set charge amt env zero set total lines env zero set grand total env zero set isso trx true set is tax included false set is approved false set is discount printed false set is paid false set sende mail false set is printed false set is transferred false set is self service false set is pay schedule valid false set is in dispute false set posted false super set processed false set processing false c_invoice_id trxname minvoice c_invoice_id trxname c_invoice_id trxname c_invoice_id setdocstatus docstatus_drafted setdocaction docaction_complete setpaymentrule paymentrule_oncredit setdateinvoiced currenttimemillis setdateacct currenttimemillis setchargeamt settotallines setgrandtotal setissotrx setistaxincluded setisapproved setisdiscountprinted setispaid setsendemail setisprinted setistransferred setisselfservice setispayschedulevalid setisindispute setposted setprocessed setprocessing load constructor param ctx context param rs result set record public m invoice properties ctx result set rs string trx name super ctx rs trx name minvoice resultset trxname trxname create invoice from order param order order param c doctypetarget id target document type param invoice date date or null public m invoice m order order int c doctypetarget id timestamp invoice date this order get ctx 0 order get trxname set client org order set order order set base settings if c doctypetarget id 0 c doctypetarget id db getsql value null select c doctypeinvoice id from c doctype where c doctype id order getc doctype id setc doctypetarget id c doctypetarget id if invoice date null set date invoiced invoice date set date acct get date invoiced setsalesrep id order getsalesrep id setc bpartner id order getbill bpartner id setc bpartner location id order getbill location id setad user id order getbill user id c_doctypetarget_id invoicedate minvoice morder c_doctypetarget_id invoicedate getctx get_trxname setclientorg setorder c_doctypetarget_id c_doctypetarget_id getsqlvalue c_doctypeinvoice_id c_doctype c_doctype_id getc_doctype_id setc_doctypetarget_id c_doctypetarget_id invoicedate setdateinvoiced invoicedate setdateacct getdateinvoiced setsalesrep_id getsalesrep_id setc_bpartner_id getbill_bpartner_id setc_bpartner_location_id getbill_location_id setad_user_id getbill_user_id create invoice from shipment param ship shipment param invoice date date or null public m invoice m in out ship timestamp invoice date this ship get ctx 0 ship get trxname set client org ship set shipment ship set base settings setc doctypetarget id if invoice date null set date invoiced invoice date set date acct get date invoiced setsalesrep id ship getsalesrep id setad user id ship getad user id invoicedate minvoice minout invoicedate getctx get_trxname setclientorg setshipment setc_doctypetarget_id invoicedate setdateinvoiced invoicedate setdateacct getdateinvoiced setsalesrep_id getsalesrep_id setad_user_id getad_user_id create invoice from batch line param batch batch param line batch line public m invoice m invoice batch batch m invoice batch line line this line get ctx 0 line get trxname set client org line set document no line get document no set isso trx batch isso trx mb partner bp new mb partner line get ctx line getc bpartner id line get trxname setb partner bp defaults set is tax included line is tax included may conflict with default price list setc currency id batch getc currency id setc conversiontype id batch getc conversiontype id set payment rule order get payment rule setc paymentterm id order getc paymentterm id setpo reference set description batch get description set date ordered order get date ordered setad orgtrx id line getad orgtrx id setc project id line getc project id setc campaign id line getc campaign id setc activity id line getc activity id setuser1 id line getuser1 id setuser2 id line getuser2 id setc doctypetarget id line getc doctype id set date invoiced line get date invoiced set date acct line get date acct setsalesrep id batch getsalesrep id setc bpartner id line getc bpartner id setc bpartner location id line getc bpartner location id setad user id line getad user id minvoice minvoicebatch minvoicebatchline getctx get_trxname setclientorg setdocumentno getdocumentno setissotrx issotrx mbpartner mbpartner getctx getc_bpartner_id get_trxname setbpartner setistaxincluded istaxincluded setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setpaymentrule getpaymentrule setc_paymentterm_id getc_paymentterm_id setporeference setdescription getdescription setdateordered getdateordered setad_orgtrx_id getad_orgtrx_id setc_project_id getc_project_id setc_campaign_id getc_campaign_id setc_activity_id getc_activity_id setuser1_id getuser1_id setuser2_id getuser2_id setc_doctypetarget_id getc_doctype_id setdateinvoiced getdateinvoiced setdateacct getdateacct setsalesrep_id getsalesrep_id setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id overwrite client org if required param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id set business partner defaults details param bp business partner public void setb partner mb partner bp if bp null return setc bpartner id bp getc bpartner id set defaults int ii 0 if isso trx ii bp getc paymentterm id else ii bp getpo paymentterm id if ii 0 setc paymentterm id ii if isso trx ii bp getm pricelist id else ii bp getpo pricelist id if ii 0 setm pricelist id ii string ss bp get payment rule if ss null set payment rule ss set locations mb partner location locs bp get locations false if locs null for int i 0 i locs length i if locs i is bill to isso trx locs i is pay from isso trx setc bpartner location id locs i getc bpartner location id set to first if getc bpartner location id 0 locs length 0 setc bpartner location id locs 0 getc bpartner location id if getc bpartner location id 0 log log level severe has no to address bp set contact m user contacts bp get contacts false if contacts null contacts length 0 get first user setad user id contacts 0 getad user id setbpartner mbpartner setc_bpartner_id getc_bpartner_id issotrx getc_paymentterm_id getpo_paymentterm_id setc_paymentterm_id issotrx getm_pricelist_id getpo_pricelist_id setm_pricelist_id getpaymentrule setpaymentrule mbpartnerlocation getlocations isbillto issotrx ispayfrom issotrx setc_bpartner_location_id getc_bpartner_location_id getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id getc_bpartner_location_id muser getcontacts setad_user_id getad_user_id set order references param order order public void set order m order order if order null return setc order id order getc order id set isso trx order isso trx set is discount printed order is discount printed set is self service order is self service set sende mail order is sende mail setm pricelist id order getm pricelist id set is tax included order is tax included setc currency id order getc currency id setc conversiontype id order getc conversiontype id set payment rule order get payment rule setc paymentterm id order getc paymentterm id setpo reference order getpo reference set description order get description set date ordered order get date ordered setad orgtrx id order getad orgtrx id setc project id order getc project id setc campaign id order getc campaign id setc activity id order getc activity id setuser1 id order getuser1 id setuser2 id order getuser2 id setorder morder setc_order_id getc_order_id setissotrx issotrx setisdiscountprinted isdiscountprinted setisselfservice isselfservice setsendemail issendemail setm_pricelist_id getm_pricelist_id setistaxincluded istaxincluded setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setpaymentrule getpaymentrule setc_paymentterm_id getc_paymentterm_id setporeference getporeference setdescription getdescription setdateordered getdateordered setad_orgtrx_id getad_orgtrx_id setc_project_id getc_project_id setc_campaign_id getc_campaign_id setc_activity_id getc_activity_id setuser1_id getuser1_id setuser2_id getuser2_id set shipment references param ship shipment public void set shipment m in out ship if ship null return set isso trx ship isso trx mb partner bp new mb partner get ctx ship getc bpartner id null setb partner bp set sende mail ship is sende mail setpo reference ship getpo reference set description ship get description set date ordered ship get date ordered setad orgtrx id ship getad orgtrx id setc project id ship getc project id setc campaign id ship getc campaign id setc activity id ship getc activity id setuser1 id ship getuser1 id setuser2 id ship getuser2 id if ship getc order id 0 setc order id ship getc order id m order order new m order get ctx ship getc order id get trxname set is discount printed order is discount printed setm pricelist id order getm pricelist id set is tax included order is tax included setc currency id order getc currency id setc conversiontype id order getc conversiontype id set payment rule order get payment rule setc paymentterm id order getc paymentterm id m doc type dt m doc type get get ctx order getc doctype id if dt getc doctypeinvoice id 0 setc doctypetarget id dt getc doctypeinvoice id overwrite invoice address setc bpartner location id order getbill location id setshipment minout setissotrx issotrx mbpartner mbpartner getctx getc_bpartner_id setbpartner setsendemail issendemail setporeference getporeference setdescription getdescription setdateordered getdateordered setad_orgtrx_id getad_orgtrx_id setc_project_id getc_project_id setc_campaign_id getc_campaign_id setc_activity_id getc_activity_id setuser1_id getuser1_id setuser2_id getuser2_id getc_order_id setc_order_id getc_order_id morder morder getctx getc_order_id get_trxname setisdiscountprinted isdiscountprinted setm_pricelist_id getm_pricelist_id setistaxincluded istaxincluded setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setpaymentrule getpaymentrule setc_paymentterm_id getc_paymentterm_id mdoctype mdoctype getctx getc_doctype_id getc_doctypeinvoice_id setc_doctypetarget_id getc_doctypeinvoice_id setc_bpartner_location_id getbill_location_id set target document type param doc base type doc type m doc type docbasetype public void setc doctypetarget id string doc base type string sql select c doctype id from c doctype where ad client id and doc base type order by is default desc int c doctype id db getsql value null sql getad client id doc base type if c doctype id 0 log log level severe not found for ac client id getad client id doc base type else log fine doc base type setc doctypetarget id c doctype id boolean isso trx m doc type docbasetype arinvoice equals doc base type m doc type docbasetype arcreditmemo equals doc base type set isso trx isso trx docbasetype mdoctype docbasetype_ setc_doctypetarget_id docbasetype c_doctype_id c_doctype ad_client_id docbasetype isdefault c_doctype_id getsqlvalue getad_client_id docbasetype c_doctype_id ac_client_id getad_client_id docbasetype docbasetype setc_doctypetarget_id c_doctype_id issotrx mdoctype docbasetype_arinvoice docbasetype mdoctype docbasetype_arcreditmemo docbasetype setissotrx issotrx set target document type based on so flag ap ap invoice public void setc doctypetarget id if getc doctypetarget id 0 return if isso trx setc doctypetarget id m doc type docbasetype arinvoice else setc doctypetarget id m doc type docbasetype apinvoice setc_doctypetarget_id getc_doctypetarget_id issotrx setc_doctypetarget_id mdoctype docbasetype_arinvoice setc_doctypetarget_id mdoctype docbasetype_apinvoice get grand total param credit memo adjusted adjusted for cm negative return grand total public big decimal get grand total boolean credit memo adjusted if credit memo adjusted return super get grand total big decimal amt get grand total if is credit memo return amt negate return amt creditmemoadjusted bigdecimal getgrandtotal creditmemoadjusted creditmemoadjusted getgrandtotal bigdecimal getgrandtotal iscreditmemo get invoice lines of invoice param where clause starting with and return lines private m invoice line get lines string where clause array list m invoice line list new array list m invoice line string sql select from c invoiceline where c invoice id if where clause null sql where clause sql order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoice id result set rs pstmt execute query while rs next m invoice line il new m invoice line get ctx rs get trxname il set invoice this list add il rs close pstmt close pstmt null catch exception e log log level severe get lines e finally try if pstmt null pstmt close catch exception e pstmt null m invoice line lines new m invoice line list size list to array lines return lines whereclause minvoiceline getlines whereclause arraylist minvoiceline arraylist minvoiceline c_invoiceline c_invoice_id whereclause whereclause preparedstatement preparestatement get_trxname setint getc_invoice_id resultset executequery minvoiceline minvoiceline getctx get_trxname setinvoice getlines minvoiceline minvoiceline toarray get invoice lines param requery return lines public m invoice line get lines boolean requery if m lines null m lines length 0 requery m lines get lines null return m lines minvoiceline getlines m_lines m_lines m_lines getlines m_lines get lines of invoice return lines public m invoice line get lines return get lines false minvoiceline getlines getlines renumber lines param step start and step public void renumber lines int step int number step m invoice line lines get lines false for int i 0 i lines length i m invoice line line lines i line set line number line save number step m lines null renumberlines minvoiceline getlines minvoiceline setline m_lines copy lines from other invoice param other invoice invoice param counter create counter links param set order set order links return number of lines copied public int copy lines from m invoice other invoice boolean counter boolean set order if is processed is posted other invoice null return 0 m invoice line from lines other invoice get lines false int count 0 for int i 0 i from lines length i m invoice line line new m invoice line get ctx 0 get trxname m invoice line from line from lines i if counter header po copy values from line line getad client id getad org id else po copy values from line line from line getad client id from line getad org id line setc invoice id getc invoice id line set invoice this line set valuenocheck c invoiceline id i zero new reset if set order line setc orderline id 0 line setref invoiceline id 0 line setm inoutline id 0 line seta asset id 0 line setm attributesetinstance id 0 line sets resourceassignment id 0 new tax if getc bpartner id other invoice getc bpartner id line set tax recalculate if counter line setref invoiceline id from line getc invoiceline id if from line getc orderline id 0 m order line peer new m order line get ctx from line getc orderline id get trxname if peer getref orderline id 0 line setc orderline id peer getref orderline id line setm inoutline id 0 if from line getm inoutline id 0 m in out line peer new m in out line get ctx from line getm inoutline id get trxname if peer getref inoutline id 0 line setm inoutline id peer getref inoutline id line set processed false if line save get trxname count cross link if counter from line setref invoiceline id line getc invoiceline id from line save get trxname if from lines length count log log level severe line difference from from lines length saved count return count otherinvoice setorder copylinesfrom minvoice otherinvoice setorder isprocessed isposted otherinvoice minvoiceline fromlines otherinvoice getlines fromlines minvoiceline minvoiceline getctx get_trxname minvoiceline fromline fromlines copyvalues fromline getad_client_id getad_org_id copyvalues fromline fromline getad_client_id fromline getad_org_id setc_invoice_id getc_invoice_id setinvoice set_valuenocheck c_invoiceline_id i_zero setorder setc_orderline_id setref_invoiceline_id setm_inoutline_id seta_asset_id setm_attributesetinstance_id sets_resourceassignment_id getc_bpartner_id otherinvoice getc_bpartner_id settax setref_invoiceline_id fromline getc_invoiceline_id fromline getc_orderline_id morderline morderline getctx fromline getc_orderline_id get_trxname getref_orderline_id setc_orderline_id getref_orderline_id setm_inoutline_id fromline getm_inoutline_id minoutline minoutline getctx fromline getm_inoutline_id get_trxname getref_inoutline_id setm_inoutline_id getref_inoutline_id setprocessed get_trxname fromline setref_invoiceline_id getc_invoiceline_id fromline get_trxname fromlines fromlines set reversal param reversal reversal private void set reversal boolean reversal m reversal reversal setreversal m_reversal set reversal is reversal return reversal private boolean is reversal return m reversal setreversal isreversal m_reversal get taxes param requery requery return array of taxes public m invoice tax get taxes boolean requery if m taxes null requery return m taxes string sql select from c invoicetax where c invoice id array list m invoice tax list new array list m invoice tax prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoice id result set rs pstmt execute query while rs next list add new m invoice tax get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get taxes e try if pstmt null pstmt close pstmt null catch exception e pstmt null m taxes new m invoice tax list size list to array m taxes return m taxes minvoicetax gettaxes m_taxes m_taxes c_invoicetax c_invoice_id arraylist minvoicetax arraylist minvoicetax preparedstatement preparestatement get_trxname setint getc_invoice_id resultset executequery minvoicetax getctx get_trxname gettaxes m_taxes minvoicetax toarray m_taxes m_taxes add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription is it a credit memo return true if cm public boolean is credit memo m doc type dt m doc type get get ctx getc doctype id 0 getc doctypetarget id getc doctype id return m doc type docbasetype apcreditmemo equals dt get doc base type m doc type docbasetype arcreditmemo equals dt get doc base type iscreditmemo mdoctype mdoctype getctx getc_doctype_id getc_doctypetarget_id getc_doctype_id mdoctype docbasetype_apcreditmemo getdocbasetype mdoctype docbasetype_arcreditmemo getdocbasetype set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string set set processed processed y n where c invoice id getc invoice id int no line db execute update update c invoiceline set get trxname int no tax db execute update update c invoicetax set get trxname m lines null m taxes null log fine processed lines no line tax no tax setprocessed setprocessed get_id c_invoice_id getc_invoice_id noline executeupdate c_invoiceline get_trxname notax executeupdate c_invoicetax get_trxname m_lines m_taxes noline notax validate invoice pay schedule return pay schedule is valid public boolean validate pay schedule m invoice pay schedule schedule m invoice pay schedule get invoice pay schedule get ctx getc invoice id 0 get trxname log fine schedule length if schedule length 0 set is pay schedule valid false return false add up due amounts big decimal total env zero for int i 0 i schedule length i schedule i set parent this big decimal due schedule i get due amt if due null total total add due boolean valid get grand total compare to total 0 set is pay schedule valid valid update schedule lines for int i 0 i schedule length i if schedule i is valid valid schedule i set is valid valid schedule i save get trxname return valid validatepayschedule minvoicepayschedule minvoicepayschedule getinvoicepayschedule getctx getc_invoice_id get_trxname setispayschedulevalid bigdecimal setparent bigdecimal getdueamt getgrandtotal compareto setispayschedulevalid isvalid setisvalid get_trxname before save param new record new return true protected boolean before save boolean new record log fine no partner info set template if getc bpartner id 0 setb partner mb partner get template get ctx getad client id if getc bpartner location id 0 setb partner new mb partner get ctx getc bpartner id null price list if getm pricelist id 0 int ii env get context as int get ctx m pricelist id if ii 0 setm pricelist id ii else string sql select m pricelist id from m pricelist where ad client id and is default y ii db getsql value null sql getad client id if ii 0 setm pricelist id ii currency if getc currency id 0 string sql select c currency id from m pricelist where m pricelist id int ii db getsql value null sql getm pricelist id if ii 0 setc currency id ii else setc currency id env get context as int get ctx c currency id sales rep if getsalesrep id 0 int ii env get context as int get ctx salesrep id if ii 0 setsalesrep id ii document type if getc doctype id 0 setc doctype id 0 make sure it s set to 0 if getc doctypetarget id 0 setc doctypetarget id isso trx m doc type docbasetype arinvoice m doc type docbasetype apinvoice payment term if getc paymentterm id 0 int ii env get context as int get ctx c paymentterm id if ii 0 setc paymentterm id ii else string sql select c paymentterm id from c paymentterm where ad client id and is default y ii db getsql value null sql getad client id if ii 0 setc paymentterm id ii return true newrecord beforesave newrecord getc_bpartner_id setbpartner mbpartner gettemplate getctx getad_client_id getc_bpartner_location_id setbpartner mbpartner getctx getc_bpartner_id getm_pricelist_id getcontextasint getctx m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist ad_client_id isdefault getsqlvalue getad_client_id setm_pricelist_id getc_currency_id c_currency_id m_pricelist m_pricelist_id getsqlvalue getm_pricelist_id setc_currency_id setc_currency_id getcontextasint getctx c_currency_id getsalesrep_id getcontextasint getctx salesrep_id setsalesrep_id getc_doctype_id setc_doctype_id getc_doctypetarget_id setc_doctypetarget_id issotrx mdoctype docbasetype_arinvoice mdoctype docbasetype_apinvoice getc_paymentterm_id getcontextasint getctx c_paymentterm_id setc_paymentterm_id c_paymentterm_id c_paymentterm ad_client_id isdefault getsqlvalue getad_client_id setc_paymentterm_id before delete return true if it can be deleted protected boolean before delete if getc order id 0 log save error error msg get msg get ctx cannot delete return false return true beforedelete getc_order_id saveerror getmsg getctx cannotdelete string representation return info public string to string string buffer sb new string buffer m invoice append get id append append get document no append grand total append get grand total if m lines null sb append append m lines length append sb append return sb to string tostring stringbuffer stringbuffer minvoice get_id getdocumentno grandtotal getgrandtotal m_lines m_lines tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno after save param new record new param success success return success protected boolean after save boolean new record boolean success if success new record return success if is valuechanged ad org id string sql update c invoiceline ol set ad org id select ad org id from c invoice o where ol c invoice id o c invoice id where c invoice id getc order id int no db execute update sql get trxname log fine lines no return true newrecord aftersave newrecord newrecord is_valuechanged ad_org_id c_invoiceline ad_org_id ad_org_id c_invoice c_invoice_id c_invoice_id c_invoice_id getc_order_id executeupdate get_trxname set price list and currency when valid param m pricelist id price list public void setm pricelist id int m pricelist id string sql select m pricelist id c currency id from m pricelist where m pricelist id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m pricelist id result set rs pstmt execute query if rs next super setm pricelist id rs get int 1 setc currency id rs get int 2 rs close pstmt close pstmt null catch exception e log log level severe setm pricelist id e finally try if pstmt null pstmt close catch exception e pstmt null m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist_id c_currency_id m_pricelist m_pricelist_id preparedstatement preparestatement setint m_pricelist_id resultset executequery setm_pricelist_id getint setc_currency_id getint setm_pricelist_id get allocated amt in invoice currency return pos neg amount or null public big decimal get allocated amt big decimal ret value null string sql select sum currency convert al amount al discount amt al write off amt ah c currency id i c currency id ah date trx i c conversiontype id al ad client id al ad org id from c allocationline al inner join c allocationhdr ah on al c allocationhdr id ah c allocationhdr id inner join c invoice i on al c invoice id i c invoice id where al c invoice id and ah is active y and al is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoice id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log fine get allocated amt ret value round nvl v allocatedamt 0 2 return ret value bigdecimal getallocatedamt bigdecimal retvalue currencyconvert discountamt writeoffamt c_currency_id c_currency_id datetrx c_conversiontype_id ad_client_id ad_org_id c_allocationline c_allocationhdr c_allocationhdr_id c_allocationhdr_id c_invoice c_invoice_id c_invoice_id c_invoice_id isactive isactive preparedstatement preparestatement get_trxname setint getc_invoice_id resultset executequery retvalue getbigdecimal getallocatedamt retvalue v_allocatedamt retvalue test allocation and set paid flag return true if updated public boolean test allocation big decimal alloc get allocated amt absolute if alloc null alloc env zero big decimal total get grand total if isso trx total total negate if is credit memo total total negate boolean test total compare to alloc 0 boolean change test is paid if change set is paid test log fine paid test alloc total return change testallocation bigdecimal getallocatedamt bigdecimal getgrandtotal issotrx iscreditmemo compareto ispaid setispaid set paid flag for invoices param c bpartner id if 0 all public static void set is paid properties ctx int c bpartner id string trx name int counter 0 string sql select from c invoice where is paid n and doc status in co cl if c bpartner id 1 sql and c bpartner id else sql and ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql trx name if c bpartner id 1 pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next m invoice invoice new m invoice ctx rs trx name if invoice test allocation if invoice save counter rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log config counter c_bpartner_id setispaid c_bpartner_id trxname c_invoice ispaid docstatus c_bpartner_id c_bpartner_id ad_client_id getad_client_id preparedstatement preparestatement trxname c_bpartner_id setint c_bpartner_id resultset executequery minvoice minvoice trxname testallocation s_log s_log get open amount used by web interface return open amt public big decimal get open amt return get open amt true null bigdecimal getopenamt getopenamt get open amount param credit memo adjusted adjusted for cm negative param payment date ignored payment date return open amt public big decimal get open amt boolean credit memo adjusted timestamp payment date if is paid return env zero if m openamt null m openamt get grand total if payment date null payment discount payment schedule big decimal allocated get allocated amt if allocated null allocated allocated abs is absolute m openamt m openamt subtract allocated if credit memo adjusted return m openamt if is credit memo return m openamt negate return m openamt creditmemoadjusted paymentdate bigdecimal getopenamt creditmemoadjusted paymentdate ispaid m_openamt m_openamt getgrandtotal paymentdate bigdecimal getallocatedamt m_openamt m_openamt creditmemoadjusted m_openamt iscreditmemo m_openamt m_openamt get document status return document status clear text public string get doc status name return m ref list get list name get ctx 131 get doc status getdocstatusname mreflist getlistname getctx getdocstatus create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id get pdf file name param document dir directory return file name public string getpdf file name string document dir return getpdf file name document dir getc invoice id documentdir getpdffilename documentdir getpdffilename documentdir getc_invoice_id get iso code of currency return currency iso public string get currencyiso return m currency getiso code get ctx getc currency id getcurrencyiso mcurrency getiso_code getctx getc_currency_id get currency precision return precision public int get precision return m currency get std precision get ctx getc currency id getprecision mcurrency getstdprecision getctx getc_currency_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctypetarget id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid lines m invoice line lines get lines true if lines length 0 m processmsg no lines return doc action status invalid no cash book if paymentrule cash equals get payment rule m cash book get get ctx getad org id getc currency id null m processmsg no cash book return doc action status invalid convert check doc type if getc doctype id getc doctypetarget id setc doctype id getc doctypetarget id if getc doctype id 0 m processmsg no document type return doc action status invalid explodebom if calculate tax total set totals m processmsg error calculating tax return doc action status invalid create pay schedule credit status if isso trx is reversal mb partner bp new mb partner get ctx getc bpartner id null if mb partner socreditstatus creditstop equals bp getso credit status m processmsg b partner credit stop total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid landed costs if isso trx for int i 0 i lines length i m invoice line line lines i string error line allocate landed costs if error null error length 0 m processmsg error return doc action status invalid add up amounts m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctypetarget_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid minvoiceline getlines m_processmsg nolines docaction status_invalid paymentrule_cash getpaymentrule mcashbook getctx getad_org_id getc_currency_id m_processmsg nocashbook docaction status_invalid doctype getc_doctype_id getc_doctypetarget_id setc_doctype_id getc_doctypetarget_id getc_doctype_id m_processmsg docaction status_invalid calculatetaxtotal settotals m_processmsg docaction status_invalid createpayschedule issotrx isreversal mbpartner mbpartner getctx getc_bpartner_id mbpartner socreditstatus_creditstop getsocreditstatus m_processmsg bpartnercreditstop totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid issotrx minvoiceline allocatelandedcosts m_processmsg docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress explode non stocked bom private void explodebom string where and is active y and exists select from m product p where c invoiceline m product id p m product id and p isbom y and p is verified y and p is stocked n string sql select count from c invoiceline where c invoice id where int count db getsql value get trxname sql getc invoice id while count 0 renumber lines 100 order lines with non stocked bo ms m invoice line lines get lines where for int i 0 i lines length i m invoice line line lines i m product product m product get get ctx line getm product id log fine product get name new lines int line no line get line m productbom boms m productbom getbom lines product for int j 0 j boms length j m productbom bom boms j m invoice line new line new m invoice line this new line set line line no new line setm product id bom get product getm product id bom get product getc uom id new line set qty line get qty invoiced multiply bom getbom qty invoiced entered if bom get description null new line set description bom get description new line set price new line save get trxname convert into comment line line setm product id 0 line setm attributesetinstance id 0 line set price entered env zero line set price actual env zero line set price limit env zero line set price list env zero line set line net amt env zero string description product get name if product get description null description product get description if line get description null description line get description line set description description line save get trxname for all lines with bom m lines null count db getsql value get trxname sql getc invoice id renumber lines 10 while count 0 isactive m_product c_invoiceline m_product_id m_product_id isverified isstocked c_invoiceline c_invoice_id getsqlvalue get_trxname getc_invoice_id renumberlines boms minvoiceline getlines minvoiceline mproduct mproduct getctx getm_product_id getname lineno getline mproductbom mproductbom getbomlines mproductbom minvoiceline newline minvoiceline newline setline lineno newline setm_product_id getproduct getm_product_id getproduct getc_uom_id newline setqty getqtyinvoiced getbomqty getdescription newline setdescription getdescription newline setprice newline get_trxname setm_product_id setm_attributesetinstance_id setpriceentered setpriceactual setpricelimit setpricelist setlinenetamt getname getdescription getdescription getdescription getdescription setdescription get_trxname m_lines getsqlvalue get_trxname getc_invoice_id renumberlines calculate tax and total private boolean calculate tax total log fine delete taxes db execute update delete c invoicetax where c invoice id getc invoice id get trxname m taxes null lines big decimal total lines env zero array list integer tax list new array list integer m invoice line lines get lines false for int i 0 i lines length i m invoice line line lines i sync ownership for so if isso trx line getad org id getad org id line setad org id getad org id line save integer taxid new integer line getc tax id if tax list contains taxid m invoice tax i tax m invoice tax get line get precision false get trxname current tax if i tax null i tax set is tax included is tax included if i tax calculate tax from lines return false if i tax save return false tax list add taxid total lines total lines add line get line net amt taxes big decimal grand total total lines m invoice tax taxes get taxes true for int i 0 i taxes length i m invoice tax i tax taxes i m tax tax i tax get tax if tax is summary m tax c taxes tax get child taxes false multiple taxes for int j 0 j c taxes length j m tax c tax c taxes j big decimal tax amt c tax calculate tax i tax get tax base amt is tax included get precision m invoice tax newi tax new m invoice tax get ctx 0 get trxname newi tax set client org this newi tax setc invoice id getc invoice id newi tax setc tax id c tax getc tax id newi tax set precision get precision newi tax set is tax included is tax included newi tax set tax base amt i tax get tax base amt newi tax set tax amt tax amt if newi tax save get trxname return false if is tax included grand total grand total add tax amt if i tax delete true get trxname return false else if is tax included grand total grand total add i tax get tax amt set total lines total lines set grand total grand total return true calculatetaxtotal executeupdate c_invoicetax c_invoice_id getc_invoice_id get_trxname m_taxes bigdecimal totallines arraylist taxlist arraylist minvoiceline getlines minvoiceline issotrx getad_org_id getad_org_id setad_org_id getad_org_id getc_tax_id taxlist minvoicetax itax minvoicetax getprecision get_trxname itax itax setistaxincluded istaxincluded itax calculatetaxfromlines itax taxlist totallines totallines getlinenetamt bigdecimal grandtotal totallines minvoicetax gettaxes minvoicetax itax mtax itax gettax issummary mtax ctaxes getchildtaxes ctaxes mtax ctax ctaxes bigdecimal taxamt ctax calculatetax itax gettaxbaseamt istaxincluded getprecision minvoicetax newitax minvoicetax getctx get_trxname newitax setclientorg newitax setc_invoice_id getc_invoice_id newitax setc_tax_id ctax getc_tax_id newitax setprecision getprecision newitax setistaxincluded istaxincluded newitax settaxbaseamt itax gettaxbaseamt newitax settaxamt taxamt newitax get_trxname istaxincluded grandtotal grandtotal taxamt itax get_trxname istaxincluded grandtotal grandtotal itax gettaxamt settotallines totallines setgrandtotal grandtotal re create pay schedule return true if valid schedule private boolean create pay schedule if getc paymentterm id 0 return false m payment term pt new m payment term get ctx getc paymentterm id null log fine pt to string return pt apply this calls validate pay schedule createpayschedule getc_paymentterm_id mpaymentterm mpaymentterm getctx getc_paymentterm_id tostring approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string string buffer info new string buffer create cash if paymentrule cash equals get payment rule m cash cash m cash get get ctx getad org id get date invoiced getc currency id get trxname if cash null cash get id 0 m processmsg no cash book return doc action status invalid m cash line cl new m cash line cash cl set invoice this if cl save get trxname m processmsg could not save cash journal line return doc action status invalid info append c cash id cash get name cl get line setc cashline id cl getc cashline id cash book update order match int match inv 0 int matchpo 0 m invoice line lines get lines false for int i 0 i lines length i m invoice line line lines i update order line m order line ol null if line getc orderline id 0 if isso trx line getm product id 0 ol new m order line get ctx line getc orderline id get trxname if line get qty invoiced null ol set qty invoiced ol get qty invoiced add line get qty invoiced if ol save get trxname m processmsg could not update order line return doc action status invalid order invoiced qty updated via matching inv po else if isso trx line getm product id 0 is reversal matchpo is created also from m in out when invoice exists before shipment big decimal match qty line get qty invoiced m matchpo po m matchpo create line null get date invoiced match qty if po save get trxname m processmsg could not create po matching return doc action status invalid else matchpo matching inv shipment if isso trx line getm inoutline id 0 line getm product id 0 is reversal big decimal match qty line get qty invoiced m match inv inv new m match inv line get date invoiced match qty if inv save get trxname m processmsg could not create invoice matching return doc action status invalid else match inv for all lines if match inv 0 info append m matchinv id append match inv append if matchpo 0 info append m matchpo id append matchpo append update bp statistics mb partner bp new mb partner get ctx getc bpartner id get trxname update total revenue and balance credit limit reversed on allocation line process it big decimal inv amt m conversion rate convert base get ctx get grand total true cm adjusted getc currency id get date acct 0 getad client id getad org id total balance big decimal new balance bp get total open balance false if new balance null new balance env zero if isso trx new balance new balance add inv amt if bp get first sale null bp set first sale get date invoiced big decimal new life amt bp get actual life time value if new life amt null new life amt inv amt else new life amt new life amt add inv amt big decimal new credit amt bp getso creditused if new credit amt null new credit amt inv amt else new credit amt new credit amt add inv amt log fine grand total get grand total true inv amt bp life bp get actual life time value new life amt credit bp getso creditused new credit amt balance bp get total open balance false new balance bp set actual life time value new life amt bp setso creditused new credit amt so else new balance new balance subtract inv amt log fine grand total get grand total true inv amt balance bp get total open balance false new balance bp set total open balance new balance bp setso credit status if bp save get trxname m processmsg could not update business partner return doc action status invalid user last result contact if getad user id 0 m user user new m user get ctx getad user id get trxname user set last contact new timestamp system current time millis user set last result msg translate get ctx c invoice id get document no if user save get trxname m processmsg could not update business partner user return doc action status invalid user update project if isso trx getc project id 0 m project project new m project get ctx getc project id get trxname big decimal amt get grand total true int c currencyto id project getc currency id if c currencyto id getc currency id amt m conversion rate convert get ctx amt getc currency id c currencyto id get date acct 0 getad client id getad org id big decimal new amt project get invoiced amt if new amt null new amt amt else new amt new amt add amt log fine grand total get grand total true amt project project get name invoiced project get invoiced amt new amt project set invoiced amt new amt if project save get trxname m processmsg could not update project return doc action status invalid project user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid counter documents m invoice counter create counter doc if counter null info append counter doc c invoice id append counter get document no m processmsg info to string trim set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring stringbuffer stringbuffer paymentrule_cash getpaymentrule mcash mcash getctx getad_org_id getdateinvoiced getc_currency_id get_trxname get_id m_processmsg nocashbook docaction status_invalid mcashline mcashline setinvoice get_trxname m_processmsg docaction status_invalid c_cash_id getname getline setc_cashline_id getc_cashline_id cashbook matchinv minvoiceline getlines minvoiceline morderline getc_orderline_id issotrx getm_product_id morderline getctx getc_orderline_id get_trxname getqtyinvoiced setqtyinvoiced getqtyinvoiced getqtyinvoiced get_trxname m_processmsg docaction status_invalid issotrx getm_product_id isreversal minout bigdecimal matchqty getqtyinvoiced mmatchpo mmatchpo getdateinvoiced matchqty get_trxname m_processmsg docaction status_invalid issotrx getm_inoutline_id getm_product_id isreversal bigdecimal matchqty getqtyinvoiced mmatchinv mmatchinv getdateinvoiced matchqty get_trxname m_processmsg docaction status_invalid matchinv matchinv m_matchinv_id matchinv m_matchpo_id mbpartner mbpartner getctx getc_bpartner_id get_trxname allocationline processit bigdecimal invamt mconversionrate convertbase getctx getgrandtotal getc_currency_id getdateacct getad_client_id getad_org_id bigdecimal newbalance gettotalopenbalance newbalance newbalance issotrx newbalance newbalance invamt getfirstsale setfirstsale getdateinvoiced bigdecimal newlifeamt getactuallifetimevalue newlifeamt newlifeamt invamt newlifeamt newlifeamt invamt bigdecimal newcreditamt getso_creditused newcreditamt newcreditamt invamt newcreditamt newcreditamt invamt grandtotal getgrandtotal invamt getactuallifetimevalue newlifeamt getso_creditused newcreditamt gettotalopenbalance newbalance setactuallifetimevalue newlifeamt setso_creditused newcreditamt newbalance newbalance invamt grandtotal getgrandtotal invamt gettotalopenbalance newbalance settotalopenbalance newbalance setsocreditstatus get_trxname m_processmsg docaction status_invalid getad_user_id muser muser getctx getad_user_id get_trxname setlastcontact currenttimemillis setlastresult getctx c_invoice_id getdocumentno get_trxname m_processmsg docaction status_invalid issotrx getc_project_id mproject mproject getctx getc_project_id get_trxname bigdecimal getgrandtotal c_currencyto_id getc_currency_id c_currencyto_id getc_currency_id mconversionrate getctx getc_currency_id c_currencyto_id getdateacct getad_client_id getad_org_id bigdecimal newamt getinvoicedamt newamt newamt newamt newamt grandtotal getgrandtotal getname getinvoicedamt newamt setinvoicedamt newamt get_trxname m_processmsg docaction status_invalid modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid minvoice createcounterdoc counterdoc c_invoice_id getdocumentno m_processmsg tostring setprocessed setdocaction docaction_close docaction status_completed create counter document private m invoice create counter doc is this a counter doc if getref invoice id 0 return null org must be linked to b partner m org org m org get get ctx getad org id int counterc bpartner id org getlinkedc bpartner id if counterc bpartner id 0 return null business partner needs to be linked to org mb partner bp new mb partner get ctx getc bpartner id null int counterad org id bp getad orgbp id int if counterad org id 0 return null mb partner counterbp new mb partner get ctx counterc bpartner id null m org info counter org info m org info get get ctx counterad org id log info counter bp counterbp get name document type int c doctypetarget id 0 m doc type counter counterdt m doc type counter get counter doc type get ctx getc doctype id if counterdt null log fine counterdt to string if counterdt is create counter counterdt is valid return null c doctypetarget id counterdt getcounter c doctype id else indirect c doctypetarget id m doc type counter getcounterdoctype id get ctx getc doctype id log fine indirect c doctypetarget id c doctypetarget id if c doctypetarget id 0 return null deep copy m invoice counter copy from this get date invoiced c doctypetarget id isso trx true get trxname true counter setad org id counterad org id counter setm warehouse id counter org info getm warehouse id counter setb partner counterbp refernces should not be required counter setsalesrep id getsalesrep id counter save get trxname update copied lines m invoice line counter lines counter get lines true for int i 0 i counter lines length i m invoice line counter line counter lines i counter line set client org counter counter line set invoice counter copies header values bp etc counter line set price counter line set tax counter line save get trxname log fine counter to string document action if counterdt null if counterdt get doc action null counter set doc action counterdt get doc action counter process it counterdt get doc action counter save get trxname return counter minvoice createcounterdoc getref_invoice_id bpartner morg morg getctx getad_org_id counterc_bpartner_id getlinkedc_bpartner_id counterc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id counterad_org_id getad_orgbp_id_int counterad_org_id mbpartner mbpartner getctx counterc_bpartner_id morginfo counterorginfo morginfo getctx counterad_org_id getname c_doctypetarget_id mdoctypecounter mdoctypecounter getcounterdoctype getctx getc_doctype_id tostring iscreatecounter isvalid c_doctypetarget_id getcounter_c_doctype_id c_doctypetarget_id mdoctypecounter getcounterdoctype_id getctx getc_doctype_id c_doctypetarget_id c_doctypetarget_id c_doctypetarget_id minvoice copyfrom getdateinvoiced c_doctypetarget_id issotrx get_trxname setad_org_id counterad_org_id setm_warehouse_id counterorginfo getm_warehouse_id setbpartner setsalesrep_id getsalesrep_id get_trxname minvoiceline counterlines getlines counterlines minvoiceline counterline counterlines counterline setclientorg counterline setinvoice counterline setprice counterline settax counterline get_trxname tostring getdocaction setdocaction getdocaction processit getdocaction get_trxname void document return true if success public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status set doc action docaction none return false not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status set lines to 0 m invoice line lines get lines false for int i 0 i lines length i m invoice line line lines i big decimal old line get qty invoiced if old compare to env zero 0 line set qty env zero line set tax amt env zero line set line net amt env zero line set line total amt env zero line add description msg get msg get ctx voided old unlink shipment if line getm inoutline id 0 m in out line io line new m in out line get ctx line getm inoutline id get trxname io line set is invoiced false io line save get trxname line setm inoutline id 0 line save get trxname add description msg get msg get ctx voided set is paid true setc payment id 0 else return reverse correct it set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus setdocaction docaction_none docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus minvoiceline getlines minvoiceline bigdecimal getqtyinvoiced compareto setqty settaxamt setlinenetamt setlinetotalamt adddescription getmsg getctx getm_inoutline_id minoutline ioline minoutline getctx getm_inoutline_id get_trxname ioline setisinvoiced ioline get_trxname setm_inoutline_id get_trxname adddescription getmsg getctx setispaid setc_payment_id reversecorrectit setprocessed setdocaction docaction_none close document return true if success public boolean close it log info to string set processed true set doc action docaction none return true closeit tostring setprocessed setdocaction docaction_none reverse correction same date return true if success public boolean reverse correct it log info to string m doc type dt m doc type get get ctx getc doctype id if m period is open get ctx get date acct dt get doc base type m processmsg period closed return false m allocation hdr allocations m allocation hdr get of invoice get ctx getc invoice id get trxname for int i 0 i allocations length i allocations i set doc action doc action action reverse correct allocations i reverse correct it allocations i save get trxname reverse delete matching if isso trx m match inv m inv m match inv get invoice get ctx getc invoice id get trxname for int i 0 i m inv length i m inv i delete true m matchpo mpo m matchpo get invoice get ctx getc invoice id get trxname for int i 0 i mpo length i if mpo i getm inoutline id 0 mpo i delete true else mpo i setc invoiceline id null mpo i save get trxname load get trxname reload allocation reversal info deep copy m invoice reversal copy from this get date invoiced getc doctype id isso trx false get trxname true if reversal null m processmsg could not create invoice reversal return false reversal set reversal true reverse line qty m invoice line r lines reversal get lines false for int i 0 i r lines length i m invoice line r line r lines i r line set qty entered r line get qty entered negate r line set qty invoiced r line get qty invoiced negate r line set line net amt r line get line net amt negate if r line get tax amt null r line get tax amt compare to env zero 0 r line set tax amt r line get tax amt negate if r line get line total amt null r line get line total amt compare to env zero 0 r line set line total amt r line get line total amt negate if r line save get trxname m processmsg could not correct invoice reversal line return false reversal setc order id getc order id reversal add description get document no if reversal process it doc action action complete m processmsg reversal error reversal get process msg return false reversal setc payment id 0 reversal set is paid true reversal close it reversal set doc status docstatus reversed reversal set doc action docaction none reversal save get trxname m processmsg reversal get document no add description reversal get document no clean up reversed this m invoice line i lines get lines false for int i 0 i i lines length i m invoice line i line i lines i if i line getm inoutline id 0 m in out line io line new m in out line get ctx i line getm inoutline id get trxname io line set is invoiced false io line save get trxname reconsiliation i line setm inoutline id 0 i line save get trxname set processed true set doc status docstatus reversed may come from void set doc action docaction none setc payment id 0 set is paid true create allocation m allocation hdr alloc new m allocation hdr get ctx false get date acct getc currency id msg translate get ctx c invoice id get document no reversal get document no get trxname alloc setad org id getad org id if alloc save amount big decimal gt get grand total true if isso trx gt gt negate orig line m allocation line a line new m allocation line alloc gt env zero env zero env zero a line setc invoice id getc invoice id a line save reversal line m allocation line r line new m allocation line alloc gt negate env zero env zero env zero r line setc invoice id reversal getc invoice id r line save process it if alloc process it doc action action complete alloc save return true reversecorrectit tostring mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed mallocationhdr mallocationhdr getofinvoice getctx getc_invoice_id get_trxname setdocaction docaction action_reverse_correct reversecorrectit get_trxname issotrx mmatchinv minv mmatchinv getinvoice getctx getc_invoice_id get_trxname minv minv mmatchpo mmatchpo getinvoice getctx getc_invoice_id get_trxname getm_inoutline_id setc_invoiceline_id get_trxname get_trxname minvoice copyfrom getdateinvoiced getc_doctype_id issotrx get_trxname m_processmsg setreversal minvoiceline rlines getlines rlines minvoiceline rline rlines rline setqtyentered rline getqtyentered rline setqtyinvoiced rline getqtyinvoiced rline setlinenetamt rline getlinenetamt rline gettaxamt rline gettaxamt compareto rline settaxamt rline gettaxamt rline getlinetotalamt rline getlinetotalamt compareto rline setlinetotalamt rline getlinetotalamt rline get_trxname m_processmsg setc_order_id getc_order_id adddescription getdocumentno processit docaction action_complete m_processmsg getprocessmsg setc_payment_id setispaid closeit setdocstatus docstatus_reversed setdocaction docaction_none get_trxname m_processmsg getdocumentno adddescription getdocumentno minvoiceline ilines getlines ilines minvoiceline iline ilines iline getm_inoutline_id minoutline ioline minoutline getctx iline getm_inoutline_id get_trxname ioline setisinvoiced ioline get_trxname iline setm_inoutline_id iline get_trxname setprocessed setdocstatus docstatus_reversed setdocaction docaction_none setc_payment_id setispaid mallocationhdr mallocationhdr getctx getdateacct getc_currency_id getctx c_invoice_id getdocumentno getdocumentno get_trxname setad_org_id getad_org_id bigdecimal getgrandtotal issotrx mallocationline aline mallocationline aline setc_invoice_id getc_invoice_id aline mallocationline rline mallocationline rline setc_invoice_id getc_invoice_id rline processit docaction action_complete reverse accrual none return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return false public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no grand total 123 00 1 sb append append msg translate get ctx grand total append append get grand total append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx grandtotal getgrandtotal getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return getsalesrep id ad_user_id getdoc_user_id getsalesrep_id get document approval amount return amount public big decimal get approval amt return get grand total bigdecimal getapprovalamt getgrandtotal public combo selection manager comboselectionmanager given code a key code and the model returns the row that should become selected return 1 if no match was found param key a char value usually indicating a keyboard key that was pressed param model a combo box model the component s data model containing the list of selectable items return an int equal to the selected row where 0 is the first item and 1 is none public int selection for key char key combo box model model log fine key key int current selection 1 object selected item model get selected item return 0 akey comboboxmodel selectionforkey comboboxmodel currentselection selecteditem getselecteditem constructor param ctx context param a asset delivery id id or 0 param trx name trx public m asset delivery properties ctx int a asset delivery id string trx name super ctx a asset delivery id trx name if a asset delivery id 0 set movement date new timestamp system current time millis a_asset_delivery_id trxname massetdelivery a_asset_delivery_id trxname a_asset_delivery_id trxname a_asset_delivery_id setmovementdate currenttimemillis load constructor param ctx context param rs result set record public m asset delivery properties ctx result set rs string trx name super ctx rs trx name massetdelivery resultset trxname trxname create asset delivery for http request param asset asset param request request param ad user id bp contact public m asset delivery m asset asset http servlet request request int ad user id super asset get ctx 0 asset get trxname setad client id asset getad client id setad org id asset getad org id asset info seta asset id asset geta asset id set lot asset get lot set ser no asset get ser no set version no asset get version no set movement date new timestamp system current time millis request seturl request get requesturl to string set referrer request get header referer setremote addr request get remote addr setremote host request get remote host who setad user id ad user id save ad_user_id massetdelivery masset httpservletrequest ad_user_id getctx get_trxname setad_client_id getad_client_id setad_org_id getad_org_id seta_asset_id geta_asset_id setlot getlot setserno getserno setversionno getversionno setmovementdate currenttimemillis getrequesturl tostring setreferrer getheader setremote_addr getremoteaddr setremote_host getremotehost setad_user_id ad_user_id create asset delivery for e mail param asset asset param email email param ad user id bp contact public m asset delivery m asset asset e mail email int ad user id super asset get ctx 0 asset get trxname asset info seta asset id asset geta asset id set lot asset get lot set ser no asset get ser no set version no asset get version no set movement date new timestamp system current time millis e mail sete mail email get to to string set messageid email get messageid who setad user id ad user id save email ad_user_id massetdelivery masset email ad_user_id getctx get_trxname seta_asset_id geta_asset_id setlot getlot setserno getserno setversionno getversionno setmovementdate currenttimemillis email setemail getto tostring setmessageid getmessageid setad_user_id ad_user_id string representation return info public string to string string buffer sb new string buffer m asset delivery append get id append a asset id append geta asset id append movement date append get movement date append return sb to string tostring stringbuffer stringbuffer massetdelivery get_id a_asset_id geta_asset_id movementdate getmovementdate tostring get m column from cache param ctx context param ad column id id return m column public static m column get properties ctx int ad column id integer key new integer ad column id m column ret value m column s cache get key if ret value null return ret value ret value new m column ctx ad column id null if ret value get id 0 s cache put key ret value return ret value m_column ad_column_id m_column m_column ad_column_id ad_column_id m_column retvalue m_column s_cache retvalue retvalue retvalue m_column ad_column_id retvalue get_id s_cache retvalue retvalue get column name param ctx context param ad column id id return column name or null public static string get column name properties ctx int ad column id m column col m column get ctx ad column id if col get id 0 return null return col get column name ad_column_id getcolumnname ad_column_id m_column m_column ad_column_id get_id getcolumnname standard constructor param ctx context param ad column id public m column properties ctx int ad column id string trx name super ctx ad column id trx name if ad column id 0 setad element id 0 setad reference id 0 set column name null set name null set entity type null u set is always updateable false n set is encrypted false set is identifier false set is key false set is mandatory false set is parent false set is selection column false set is translated false set is updateable true y set version env zero ad_column_id m_column ad_column_id trxname ad_column_id trxname ad_column_id setad_element_id setad_reference_id setcolumnname setname setentitytype setisalwaysupdateable setisencrypted setisidentifier setiskey setismandatory setisparent setisselectioncolumn setistranslated setisupdateable setversion load constructor param ctx context param rs result set public m column properties ctx result set rs string trx name super ctx rs trx name m_column resultset trxname trxname parent constructor param parent table public m column m table parent this parent get ctx 0 parent get trxname set client org parent setad table id parent getad table id set entity type parent get entity type m_column m_table getctx get_trxname setclientorg setad_table_id getad_table_id setentitytype getentitytype is standard column return true for ad client id etc public boolean is standard column string column name get column name if column name equals ad client id column name equals ad org id column name equals is active column name starts with created column name starts with updated return true return false ad_client_id isstandardcolumn columnname getcolumnname columnname ad_client_id columnname ad_org_id columnname isactive columnname startswith columnname startswith is virtual column return true if virtual column public boolean is virtual column string s get columnsql return s null s length 0 isvirtualcolumn getcolumnsql is the column encrypted return true if encrypted public boolean is encrypted string s get is encrypted return y equals s isencrypted getisencrypted set encrypted param is encrypted encrypted public void set is encrypted boolean is encrypted set is encrypted is encrypted y n isencrypted setisencrypted isencrypted setisencrypted isencrypted before save param new record new return true protected boolean before save boolean new record length if get field length 0 log save error fill mandatory msg get element get ctx field length return false views are not updateable update ad column c set is updateable n is always updateable n where ad table id in select ad table id from ad table where is view y virtual column if is virtual column if is mandatory set is mandatory false if is updateable set is updateable false updateable if is always updateable is updateable set is always updateable false encrypted if is encrypted int dt getad reference id if is key is parent is standard column is virtual column is identifier is translated display type is lookup dt display type islob dt document no equals ignore case get column name value equals ignore case get column name name equals ignore case get column name log warning encryption not sensible get column name set is encrypted false return true newrecord beforesave newrecord getfieldlength saveerror fillmandatory getelement getctx fieldlength ad_column isupdateable isalwaysupdateable ad_table_id ad_table_id ad_table isview isvirtualcolumn ismandatory setismandatory isupdateable setisupdateable isalwaysupdateable isupdateable setisalwaysupdateable isencrypted getad_reference_id iskey isparent isstandardcolumn isvirtualcolumn isidentifier istranslated displaytype islookup displaytype documentno equalsignorecase getcolumnname equalsignorecase getcolumnname equalsignorecase getcolumnname getcolumnname setisencrypted after save param new record new param success success return success protected boolean after save boolean new record boolean success update fields if new record string buffer sql new string buffer update ad field set name append db to string get name append description append db to string get description append help append db to string get help append where ad column id append get id append and is centrally maintained y int no db execute update sql to string get trxname log fine after save fields updated no return success newrecord aftersave newrecord newrecord stringbuffer stringbuffer ad_field to_string getname to_string getdescription to_string gethelp ad_column_id get_id iscentrallymaintained executeupdate tostring get_trxname aftersave get sql add command param table table return sql public string getsql add m table table string buffer sql new string buffer alter table append table get table name append add append getsqlddl return sql to string getsqladd m_table stringbuffer stringbuffer gettablename tostring get sql ddl return column name datatype public string getsqlddl string buffer sql new string buffer get column name append append getsql data type default if get default value null get default value length 0 globalqss 2005 11 03 get default value equals ad org id get default value equals ad client id get default value equals ad org id get default value equals ad client id end globalqss 2005 11 03 sql append default if display type is text getad reference id sql append db to string get default value else sql append get default value inline constraint if getad reference id display type yes no sql append check append get column name append in y n null if is mandatory sql append not null return sql to string columnname stringbuffer stringbuffer getcolumnname getsqldatatype getdefaultvalue getdefaultvalue getdefaultvalue ad_org_id getdefaultvalue ad_client_id getdefaultvalue ad_org_id getdefaultvalue ad_client_id displaytype istext getad_reference_id to_string getdefaultvalue getdefaultvalue getad_reference_id displaytype yesno getcolumnname ismandatory tostring get sql modify command param table table param set null option generate null not null statement return sql separated by public string getsql modify m table table boolean set null option string buffer sql new string buffer string buffer sql base new string buffer alter table append table get table name append modify append get column name default string buffer sql default new string buffer sql base append append getsql data type append default string default value get default value if default value null default value length 0 default value index of 1 no variables if display type is text getad reference id getad reference id display type list getad reference id display type yes no if default value starts with default value ends with default value db to string default value sql default append default value else sql default append null default value null sql append sql default constraint null values if is mandatory default value null default value length 0 string buffer sql set new string buffer update append table get table name append set append get column name append append default value append where append get column name append is null sql append db sqlstatement separator append sql set null if set null option string buffer sql null new string buffer sql base if is mandatory sql null append not null else sql null append null sql append db sqlstatement separator append sql null return sql to string setnulloption getsqlmodify m_table setnulloption stringbuffer stringbuffer stringbuffer sqlbase stringbuffer gettablename getcolumnname stringbuffer sqldefault stringbuffer sqlbase getsqldatatype defaultvalue getdefaultvalue defaultvalue defaultvalue defaultvalue indexof displaytype istext getad_reference_id getad_reference_id displaytype getad_reference_id displaytype yesno defaultvalue startswith defaultvalue endswith defaultvalue to_string defaultvalue sqldefault defaultvalue sqldefault defaultvalue sqldefault ismandatory defaultvalue defaultvalue stringbuffer sqlset stringbuffer gettablename getcolumnname defaultvalue getcolumnname sqlstatement_separator sqlset setnulloption stringbuffer sqlnull stringbuffer sqlbase ismandatory sqlnull sqlnull sqlstatement_separator sqlnull tostring get sql data type return e g nvarchar2 60 private string getsql data type int dt getad reference id if display type isid dt dt display type integer return number 10 if display type is date dt return date if display type is numeric dt return number if dt display type binary dt display type image return blob if dt display type text long return clob if dt display type yes no return char 1 if dt display type list return char get field length else if display type is text dt log severe unhandled data type dt return nvarchar2 get field length getsqldatatype getad_reference_id displaytype displaytype displaytype isdate displaytype isnumeric displaytype displaytype displaytype textlong displaytype yesno displaytype getfieldlength displaytype istext getfieldlength get table constraint param table name table name return table constraint public string get constraint string table name if is key return constraint table name key primary key get column name if getad reference id display type table dir getad reference id display type search return constraint adtable adtabletrl foreign key get column name references ad table ad table id on delete cascade return tablename getconstraint tablename iskey tablename _key getcolumnname getad_reference_id displaytype tabledir getad_reference_id displaytype adtable_adtabletrl getcolumnname ad_table ad_table_id prepared statement constructor param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable param sql0 unconverted sql statement param trx name transaction name or null public c prepared statement int result set type int result set concurrency string sql0 string trx name if sql0 null sql0 length 0 throw new illegal argument exception sql required p vo new c statementvo result set type result set concurrency db get database convert statement sql0 local access if db is remote objects try connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else if result set concurrency result set concur updatable conn db get connectionrw else conn db get connectionro if conn null throw new db exception no connection p stmt conn prepare statement p vo get sql result set type result set concurrency return catch exception e log log level severe p vo get sql e resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable trxname cpreparedstatement resultsettype resultsetconcurrency trxname illegalargumentexception p_vo cstatementvo resultsettype resultsetconcurrency getdatabase convertstatement isremoteobjects trxname trxname getconnection resultsetconcurrency resultset concur_updatable getconnectionrw getconnectionro dbexception p_stmt preparestatement p_vo getsql resultsettype resultsetconcurrency p_vo getsql remote constructor param vo value object public c prepared statement c statementvo vo super vo cpreparedstatement cstatementvo execute query return result set or row set throws sql exception see java sql prepared statement execute query public result set execute query throws sql exception if p stmt null local return prepared statement p stmt execute query client remote sever log finest server p vo remote db is remote objects try boolean remote db is remote objects c connection get is apps serverok false if remote p remoteerrors 1 remote c connection get is apps serverok true if remote server server c connection get get server if server null result set rs server pstmt getrowset p vo p vo clear parameters re use of result set if rs null log warning result set is null p vo else p remoteerrors 0 return rs log log level severe apps server not found p remoteerrors catch exception ex log log level severe apps server error ex p remoteerrors try locally log warning execute locally prepared statement pstmt local getpreparedstatement false null shared connection p vo clear parameters re use of result set result set rs pstmt execute query return rs resultset rowset sqlexception preparedstatement executequery resultset executequery sqlexception p_stmt preparedstatement p_stmt executequery p_vo isremoteobjects isremoteobjects cconnection isappsserverok p_remoteerrors cconnection isappsserverok cconnection getserver resultset pstmt_getrowset p_vo p_vo clearparameters resultset p_vo p_remoteerrors appsserver p_remoteerrors appsserver p_remoteerrors preparedstatement local_getpreparedstatement p_vo clearparameters resultset executequery execute query param sql0 unconverted sql to execute return result set or row set throws sql exception see java sql statement execute query string public result set execute query string sql0 throws sql exception convert sql p vo set sql db get database convert statement sql0 if p stmt null local return p stmt execute query p vo get sql return execute query resultset rowset sqlexception executequery resultset executequery sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executequery p_vo getsql executequery execute update return no of updated rows throws sql exception see java sql prepared statement execute update public int execute update throws sql exception if p stmt null return prepared statement p stmt execute update client remote sever log finest server p vo remote db is remote objects try if db is remote objects c connection get is apps serverok false server server c connection get get server if server null int result server stmt executeupdate p vo p vo clear parameters re use of result set return result log log level severe apps server not found catch remote exception ex log log level severe apps server error ex try locally log warning execute locally prepared statement pstmt local getpreparedstatement false null shared connection p vo clear parameters re use of result set return pstmt execute update sqlexception preparedstatement executeupdate executeupdate sqlexception p_stmt preparedstatement p_stmt executeupdate p_vo isremoteobjects isremoteobjects cconnection isappsserverok cconnection getserver stmt_executeupdate p_vo p_vo clearparameters appsserver remoteexception appsserver preparedstatement local_getpreparedstatement p_vo clearparameters executeupdate execute update param sql0 unconverted sql return no of updated rows throws sql exception see java sql statement execute update string public int execute update string sql0 throws sql exception convert sql p vo set sql db get database convert statement sql0 if p stmt null local return p stmt execute update p vo get sql return execute update sqlexception executeupdate executeupdate sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executeupdate p_vo getsql executeupdate method execute return boolean throws sql exception see java sql prepared statement execute public boolean execute throws sql exception if p stmt null return prepared statement p stmt execute throw new java lang unsupported operation exception method execute not yet implemented sqlexception preparedstatement sqlexception p_stmt preparedstatement p_stmt unsupportedoperationexception method get meta data return result set meta data throws sql exception see java sql prepared statement get meta data public result set meta data get meta data throws sql exception if p stmt null return prepared statement p stmt get meta data else throw new java lang unsupported operation exception method get meta data not yet implemented getmetadata resultsetmetadata sqlexception preparedstatement getmetadata resultsetmetadata getmetadata sqlexception p_stmt preparedstatement p_stmt getmetadata unsupportedoperationexception getmetadata method get parameter meta data return parameter meta data throws sql exception see java sql prepared statement get parameter meta data public parameter meta data get parameter meta data throws sql exception if p stmt null return prepared statement p stmt get parameter meta data throw new java lang unsupported operation exception method get parameter meta data not yet implemented getparametermetadata parametermetadata sqlexception preparedstatement getparametermetadata parametermetadata getparametermetadata sqlexception p_stmt preparedstatement p_stmt getparametermetadata unsupportedoperationexception getparametermetadata method add batch throws sql exception see java sql prepared statement add batch public void add batch throws sql exception if p stmt null prepared statement p stmt add batch else throw new java lang unsupported operation exception method add batch not yet implemented addbatch sqlexception preparedstatement addbatch addbatch sqlexception p_stmt preparedstatement p_stmt addbatch unsupportedoperationexception addbatch set null param parameter index index param sql type type throws sql exception public void set null int parameter index int sql type throws sql exception if p stmt null prepared statement p stmt set null parameter index sql type else p vo set parameter parameter index new null parameter sql type parameterindex sqltype sqlexception setnull parameterindex sqltype sqlexception p_stmt preparedstatement p_stmt setnull parameterindex sqltype p_vo setparameter parameterindex nullparameter sqltype method set null param parameter index int param sql type int param type name string throws sql exception see java sql prepared statement set null int int string public void set null int parameter index int sql type string type name throws sql exception if p stmt null prepared statement p stmt set null parameter index sql type else p vo set parameter parameter index new null parameter sql type setnull parameterindex sqltype typename sqlexception preparedstatement setnull setnull parameterindex sqltype typename sqlexception p_stmt preparedstatement p_stmt setnull parameterindex sqltype p_vo setparameter parameterindex nullparameter sqltype method set boolean param parameter index int param x boolean throws sql exception see java sql prepared statement set boolean int boolean public void set boolean int parameter index boolean x throws sql exception if p stmt null prepared statement p stmt set boolean parameter index x else p vo set parameter parameter index new boolean x setboolean parameterindex sqlexception preparedstatement setboolean setboolean parameterindex sqlexception p_stmt preparedstatement p_stmt setboolean parameterindex p_vo setparameter parameterindex method set byte param parameter index int param x byte throws sql exception see java sql prepared statement set byte int byte public void set byte int parameter index byte x throws sql exception if p stmt null prepared statement p stmt set byte parameter index x else p vo set parameter parameter index new byte x setbyte parameterindex sqlexception preparedstatement setbyte setbyte parameterindex sqlexception p_stmt preparedstatement p_stmt setbyte parameterindex p_vo setparameter parameterindex method set short param parameter index int param x short throws sql exception see java sql prepared statement set short int short public void set short int parameter index short x throws sql exception if p stmt null prepared statement p stmt set short parameter index x else p vo set parameter parameter index new short x setshort parameterindex sqlexception preparedstatement setshort setshort parameterindex sqlexception p_stmt preparedstatement p_stmt setshort parameterindex p_vo setparameter parameterindex method set int param parameter index int param x int throws sql exception see java sql prepared statement set int int int public void set int int parameter index int x throws sql exception if p stmt null prepared statement p stmt set int parameter index x else p vo set parameter parameter index new integer x setint parameterindex sqlexception preparedstatement setint setint parameterindex sqlexception p_stmt preparedstatement p_stmt setint parameterindex p_vo setparameter parameterindex method set long param parameter index int param x long throws sql exception see java sql prepared statement set long int long public void set long int parameter index long x throws sql exception if p stmt null prepared statement p stmt set long parameter index x else p vo set parameter parameter index new long x setlong parameterindex sqlexception preparedstatement setlong setlong parameterindex sqlexception p_stmt preparedstatement p_stmt setlong parameterindex p_vo setparameter parameterindex method set float param parameter index int param x float throws sql exception see java sql prepared statement set float int float public void set float int parameter index float x throws sql exception if p stmt null prepared statement p stmt set float parameter index x else p vo set parameter parameter index new float x setfloat parameterindex sqlexception preparedstatement setfloat setfloat parameterindex sqlexception p_stmt preparedstatement p_stmt setfloat parameterindex p_vo setparameter parameterindex method set double param parameter index int param x double throws sql exception see java sql prepared statement set double int double public void set double int parameter index double x throws sql exception if p stmt null prepared statement p stmt set double parameter index x else p vo set parameter parameter index new double x setdouble parameterindex sqlexception preparedstatement setdouble setdouble parameterindex sqlexception p_stmt preparedstatement p_stmt setdouble parameterindex p_vo setparameter parameterindex method set big decimal param parameter index int param x big decimal throws sql exception see java sql prepared statement set big decimal int big decimal public void set big decimal int parameter index big decimal x throws sql exception if p stmt null prepared statement p stmt set big decimal parameter index x else p vo set parameter parameter index x setbigdecimal parameterindex bigdecimal sqlexception preparedstatement setbigdecimal bigdecimal setbigdecimal parameterindex bigdecimal sqlexception p_stmt preparedstatement p_stmt setbigdecimal parameterindex p_vo setparameter parameterindex method set string param parameter index int param x string throws sql exception see java sql prepared statement set string int string public void set string int parameter index string x throws sql exception if p stmt null prepared statement p stmt set string parameter index x else p vo set parameter parameter index x setstring parameterindex sqlexception preparedstatement setstring setstring parameterindex sqlexception p_stmt preparedstatement p_stmt setstring parameterindex p_vo setparameter parameterindex method set bytes param parameter index int param x byte throws sql exception see java sql prepared statement set bytes int byte public void set bytes int parameter index byte x throws sql exception if p stmt null prepared statement p stmt set bytes parameter index x else p vo set parameter parameter index x setbytes parameterindex sqlexception preparedstatement setbytes setbytes parameterindex sqlexception p_stmt preparedstatement p_stmt setbytes parameterindex p_vo setparameter parameterindex method set date param parameter index int param x java sql date throws sql exception see java sql prepared statement set date int java sql date public void set date int parameter index java sql date x throws sql exception if p stmt null prepared statement p stmt set date parameter index x else p vo set parameter parameter index x setdate parameterindex sqlexception preparedstatement setdate setdate parameterindex sqlexception p_stmt preparedstatement p_stmt setdate parameterindex p_vo setparameter parameterindex method set time param parameter index int param x time throws sql exception see java sql prepared statement set time int time public void set time int parameter index time x throws sql exception if p stmt null prepared statement p stmt set time parameter index x else p vo set parameter parameter index x settime parameterindex sqlexception preparedstatement settime settime parameterindex sqlexception p_stmt preparedstatement p_stmt settime parameterindex p_vo setparameter parameterindex method set timestamp param parameter index int param x timestamp throws sql exception see java sql prepared statement set timestamp int timestamp public void set timestamp int parameter index timestamp x throws sql exception if p stmt null prepared statement p stmt set timestamp parameter index x else p vo set parameter parameter index x settimestamp parameterindex sqlexception preparedstatement settimestamp settimestamp parameterindex sqlexception p_stmt preparedstatement p_stmt settimestamp parameterindex p_vo setparameter parameterindex method set ascii stream param parameter index int param x input stream param length int throws sql exception see java sql prepared statement set ascii stream int input stream int public void set ascii stream int parameter index input stream x int length throws sql exception if p stmt null prepared statement p stmt set ascii stream parameter index x length else throw new java lang unsupported operation exception method set ascii stream not yet implemented setasciistream parameterindex inputstream sqlexception preparedstatement setasciistream inputstream setasciistream parameterindex inputstream sqlexception p_stmt preparedstatement p_stmt setasciistream parameterindex unsupportedoperationexception setasciistream param parameter index the first parameter is 1 the second is 2 param x a code java io input stream code object that contains the unicode parameter value as two byte unicode characters param length the number of bytes in the stream exception sql exception if a database access error occurs see java sql prepared statement set unicode stream int input stream int deprecated public void set unicode stream int parameter index input stream x int length throws sql exception throw new unsupported operation exception method set unicode stream not yet implemented parameterindex inputstream sqlexception preparedstatement setunicodestream inputstream setunicodestream parameterindex inputstream sqlexception unsupportedoperationexception setunicodestream method set binary stream param parameter index int param x input stream param length int throws sql exception see java sql prepared statement set binary stream int input stream int public void set binary stream int parameter index input stream x int length throws sql exception if p stmt null prepared statement p stmt set binary stream parameter index x length else throw new java lang unsupported operation exception method set binary stream not yet implemented setbinarystream parameterindex inputstream sqlexception preparedstatement setbinarystream inputstream setbinarystream parameterindex inputstream sqlexception p_stmt preparedstatement p_stmt setbinarystream parameterindex unsupportedoperationexception setbinarystream method clear parameters throws sql exception see java sql prepared statement clear parameters public void clear parameters throws sql exception if p stmt null prepared statement p stmt clear parameters else p vo clear parameters clearparameters sqlexception preparedstatement clearparameters clearparameters sqlexception p_stmt preparedstatement p_stmt clearparameters p_vo clearparameters method set object param parameter index int param x object param target sql type int param scale int throws sql exception see java sql prepared statement set object int object int int public void set object int parameter index object x int target sql type int scale throws sql exception if p stmt null prepared statement p stmt set object parameter index x target sql type scale else throw new java lang unsupported operation exception method set object not yet implemented setobject parameterindex targetsqltype sqlexception preparedstatement setobject setobject parameterindex targetsqltype sqlexception p_stmt preparedstatement p_stmt setobject parameterindex targetsqltype unsupportedoperationexception setobject method set object param parameter index int param x object param target sql type int throws sql exception see java sql prepared statement set object int object int public void set object int parameter index object x int target sql type throws sql exception if p stmt null prepared statement p stmt set object parameter index x else throw new java lang unsupported operation exception method set object not yet implemented setobject parameterindex targetsqltype sqlexception preparedstatement setobject setobject parameterindex targetsqltype sqlexception p_stmt preparedstatement p_stmt setobject parameterindex unsupportedoperationexception setobject method set object param parameter index int param x object throws sql exception see java sql prepared statement set object int object public void set object int parameter index object x throws sql exception if p stmt null prepared statement p stmt set object parameter index x else p vo set parameter parameter index x setobject parameterindex sqlexception preparedstatement setobject setobject parameterindex sqlexception p_stmt preparedstatement p_stmt setobject parameterindex p_vo setparameter parameterindex method set character stream param parameter index int param reader reader param length int throws sql exception see java sql prepared statement set character stream int reader int public void set character stream int parameter index reader reader int length throws sql exception if p stmt null prepared statement p stmt set character stream parameter index reader length else throw new java lang unsupported operation exception method set character stream not yet implemented setcharacterstream parameterindex sqlexception preparedstatement setcharacterstream setcharacterstream parameterindex sqlexception p_stmt preparedstatement p_stmt setcharacterstream parameterindex unsupportedoperationexception setcharacterstream method set ref param parameter index int param x ref throws sql exception see java sql prepared statement set ref int ref public void set ref int parameter index ref x throws sql exception if p stmt null prepared statement p stmt set ref parameter index x else p vo set parameter parameter index x setref parameterindex sqlexception preparedstatement setref setref parameterindex sqlexception p_stmt preparedstatement p_stmt setref parameterindex p_vo setparameter parameterindex method set blob param parameter index int param x blob throws sql exception see java sql prepared statement set blob int blob public void set blob int parameter index blob x throws sql exception if p stmt null prepared statement p stmt set object parameter index x else p vo set parameter parameter index x setblob parameterindex sqlexception preparedstatement setblob setblob parameterindex sqlexception p_stmt preparedstatement p_stmt setobject parameterindex p_vo setparameter parameterindex method set clob param parameter index int param x clob throws sql exception see java sql prepared statement set clob int clob public void set clob int parameter index clob x throws sql exception if p stmt null prepared statement p stmt set object parameter index x else p vo set parameter parameter index x setclob parameterindex sqlexception preparedstatement setclob setclob parameterindex sqlexception p_stmt preparedstatement p_stmt setobject parameterindex p_vo setparameter parameterindex method set array param parameter index int param x array throws sql exception see java sql prepared statement set array int array public void set array int parameter index array x throws sql exception if p stmt null prepared statement p stmt set object parameter index x else p vo set parameter parameter index x setarray parameterindex sqlexception preparedstatement setarray setarray parameterindex sqlexception p_stmt preparedstatement p_stmt setobject parameterindex p_vo setparameter parameterindex method set date param parameter index int param x java sql date param cal calendar throws sql exception see java sql prepared statement set date int java sql date calendar public void set date int parameter index java sql date x calendar cal throws sql exception if p stmt null prepared statement p stmt set date parameter index x cal else throw new java lang unsupported operation exception method set date not yet implemented setdate parameterindex sqlexception preparedstatement setdate setdate parameterindex sqlexception p_stmt preparedstatement p_stmt setdate parameterindex unsupportedoperationexception setdate method set time param parameter index int param x time param cal calendar throws sql exception see java sql prepared statement set time int time calendar public void set time int parameter index time x calendar cal throws sql exception if p stmt null prepared statement p stmt set time parameter index x cal else throw new java lang unsupported operation exception method set time not yet implemented settime parameterindex sqlexception preparedstatement settime settime parameterindex sqlexception p_stmt preparedstatement p_stmt settime parameterindex unsupportedoperationexception settime method set timestamp param parameter index int param x timestamp param cal calendar throws sql exception see java sql prepared statement set timestamp int timestamp calendar public void set timestamp int parameter index timestamp x calendar cal throws sql exception if p stmt null prepared statement p stmt set timestamp parameter index x cal else throw new java lang unsupported operation exception method set timestamp not yet implemented settimestamp parameterindex sqlexception preparedstatement settimestamp settimestamp parameterindex sqlexception p_stmt preparedstatement p_stmt settimestamp parameterindex unsupportedoperationexception settimestamp method seturl param parameter index int param x url throws sql exception see java sql prepared statement seturl int url public void seturl int parameter index url x throws sql exception if p stmt null prepared statement p stmt set object parameter index x else p vo set parameter parameter index x parameterindex sqlexception preparedstatement parameterindex sqlexception p_stmt preparedstatement p_stmt setobject parameterindex p_vo setparameter parameterindex string representation return info public string to string if p stmt null return c prepared statement local p stmt return c prepared statement p vo tostring p_stmt cpreparedstatement p_stmt cpreparedstatement p_vo get prepared statement to create row set and set parameters method called on remote to execute locally param dedicated connection if true gets new connection if false gets anormal ro rw connection return prepared statement private prepared statement local getpreparedstatement boolean dedicated connection string trx name log finest p vo get sql connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else if dedicated connection conn db create connection false connection transaction read committed else conn local getconnection trx name if conn null throw new illegal state exception local no connection prepared statement pstmt null try pstmt conn prepare statement p vo get sql p vo get result set type p vo get result set concurrency set parameters array list parameters p vo get parameters for int i 0 i parameters size i object o parameters get i if o null throw new illegal argument exception local null parameter i else if o instanceof null parameter int type null parameter o get type pstmt set null i 1 type log finest i 1 null else if o instanceof integer pstmt set int i 1 integer o int value log finest i 1 int o else if o instanceof string pstmt set string i 1 string o log finest i 1 string o else if o instanceof timestamp pstmt set timestamp i 1 timestamp o log finest i 1 timestamp o else if o instanceof big decimal pstmt set big decimal i 1 big decimal o log finest i 1 big decimal o else throw new java lang unsupported operation exception unknown parameter class o get class catch sql exception ex log log level severe local ex try if pstmt null pstmt close pstmt null catch sql exception ex1 return pstmt rowset dedicatedconnection preparedstatement local_getpreparedstatement dedicatedconnection trxname p_vo getsql trxname trxname getconnection dedicatedconnection createconnection transaction_read_committed local_getconnection trxname illegalstateexception preparedstatement preparestatement p_vo getsql p_vo getresultsettype p_vo getresultsetconcurrency arraylist p_vo getparameters illegalargumentexception nullparameter nullparameter gettype setnull setint intvalue setstring settimestamp bigdecimal setbigdecimal bigdecimal bigdecimal unsupportedoperationexception getclass sqlexception sqlexception get result as row set for local system get explicit connection as connection is closed when closing row set return result as row set public row set local getrowset log finest local try compiere database db c connection get get database if db null throw new illegal state exception no database prepared statement pstmt local getpreparedstatement true null decicated connection result set rs pstmt execute query row set row set db get row set rs rs close pstmt close if row set null throw new null pointer exception no row set return row set catch exception ex log log level severe p vo to string ex throw new runtime exception ex dedicated connection connection conn db create connection false connection transaction read committed prepared statement pstmt null row set row set null try pstmt conn prepare statement p vo get sql result set type scroll insensitive result set concur read only set parameters array list parameters p vo get parameters for int i 0 i parameters size i object o parameters get i if o null throw new illegal argument exception null parameter i else if o instanceof null parameter int type null parameter o get type pstmt set null i 1 type log finest i 1 null else if o instanceof integer pstmt set int i 1 integer o int value log finest i 1 int o else if o instanceof string pstmt set string i 1 string o log finest i 1 string o else if o instanceof timestamp pstmt set timestamp i 1 timestamp o log finest i 1 timestamp o else if o instanceof big decimal pstmt set big decimal i 1 big decimal o log finest i 1 big decimal o else throw new java lang unsupported operation exception unknown parameter class o get class result set rs pstmt execute query row set c cached row set get row set rs pstmt close pstmt null conn close conn null catch exception ex log log level severe p vo to string ex throw new runtime exception ex close cursor try if pstmt null pstmt close pstmt null if conn null conn close conn null catch exception e log log level severe close e return row set rowset rowset rowset rowset local_getrowset compieredatabase cconnection getdatabase illegalstateexception preparedstatement local_getpreparedstatement resultset executequery rowset rowset getrowset rowset nullpointerexception rowset rowset p_vo tostring runtimeexception createconnection transaction_read_committed preparedstatement rowset rowset preparestatement p_vo getsql resultset type_scroll_insensitive resultset concur_read_only arraylist p_vo getparameters illegalargumentexception nullparameter nullparameter gettype setnull setint intvalue setstring settimestamp bigdecimal setbigdecimal bigdecimal bigdecimal unsupportedoperationexception getclass resultset executequery rowset ccachedrowset getrowset p_vo tostring runtimeexception rowset get result as row set for remote get shared connection for rmi if row set is transfred via rmi closing the row set does not close the connection return result as row set public row set remote getrowset log finest remote try compiere database db c connection get get database if db null log log level severe no database throw new null pointer exception no database prepared statement pstmt local getpreparedstatement false null shared connection result set rs pstmt execute query row set row set db get row set rs rs close pstmt close if row set null return row set else log log level severe no row set throw new null pointer exception remote no row set catch exception ex log log level severe p vo to string ex throw new runtime exception ex return null shared connection connection conn local getconnection null prepared statement pstmt null row set row set null try pstmt conn prepare statement p vo get sql result set type scroll insensitive result set concur read only set parameters array list parameters p vo get parameters for int i 0 i parameters size i object o parameters get i if o null throw new illegal argument exception null parameter i else if o instanceof null parameter int type null parameter o get type pstmt set null i 1 type log finest i 1 null else if o instanceof integer pstmt set int i 1 integer o int value log finest i 1 int o else if o instanceof string pstmt set string i 1 string o log finest i 1 string o else if o instanceof timestamp pstmt set timestamp i 1 timestamp o log finest i 1 timestamp o else if o instanceof big decimal pstmt set big decimal i 1 big decimal o log finest i 1 big decimal o else throw new java lang unsupported operation exception unknown parameter class o get class result set rs pstmt execute query row set c cached row set get row set rs pstmt close pstmt null catch exception ex log log level severe p vo to string ex throw new runtime exception ex close cursor try if pstmt null pstmt close pstmt null catch exception e log log level severe close pstmt e return row set rowset rowset rowset rowset rowset remote_getrowset compieredatabase cconnection getdatabase nullpointerexception preparedstatement local_getpreparedstatement resultset executequery rowset rowset getrowset rowset rowset rowset nullpointerexception rowset p_vo tostring runtimeexception local_getconnection preparedstatement rowset rowset preparestatement p_vo getsql resultset type_scroll_insensitive resultset concur_read_only arraylist p_vo getparameters illegalargumentexception nullparameter nullparameter gettype setnull setint intvalue setstring settimestamp bigdecimal setbigdecimal bigdecimal bigdecimal unsupportedoperationexception getclass resultset executequery rowset ccachedrowset getrowset p_vo tostring runtimeexception rowset execute update return row count public int remote executeupdate log finest update try compiere database db c connection get get database if db null throw new null pointer exception remote no database prepared statement pstmt local getpreparedstatement false null shared connection int result pstmt execute update pstmt close return result catch exception ex log log level severe p vo to string ex throw new runtime exception ex remote_executeupdate compieredatabase cconnection getdatabase nullpointerexception preparedstatement local_getpreparedstatement executeupdate p_vo tostring runtimeexception initialize global variables param config servlet configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception product servlet init servletexception servletconfig servletexception webenv initweb servletexception productservlet get servlet information return info public string get servlet info return a dempiere product serach servlet getservletinfo adempiere clean up resources public void destroy log info destroy process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message w env dump session w env dump request web user web user wu web user session get attribute web user name save in ctx for price list tag search parameter string search string web util get parameter request p searchstring if search string null ctx put p searchstring search string product category string category web util get parameter request p m product category id if category null ctx put p m product category id category forward string url index jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession removeattribute websessionctx hdr_message wenv wenv webuser webuser getattribute webuser pricelisttag searchstring webutil getparameter p_searchstring searchstring p_searchstring searchstring webutil getparameter p_m_product_category_id p_m_product_category_id requestdispatcher getservletcontext getrequestdispatcher process the initial http get request reads the parameter amt and optional c invoice id param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr do post request response c_invoice_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr dopost get contsnts return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals ad org id m ad org id big decimal para i get parameter int value else if name equals c acctschema id m c acctschema id big decimal para i get parameter int value else if name equals date acct m dateacct timestamp para i get parameter else if name equals is validate only m isvalidateonly y equals para i get parameter else if name equals is import only no errors m isimportonlynoerrors y equals para i get parameter else if name equals delete old imported m deleteoldimported y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_client_id m_ad_client_id bigdecimal getparameter intvalue ad_org_id m_ad_org_id bigdecimal getparameter intvalue c_acctschema_id m_c_acctschema_id bigdecimal getparameter intvalue dateacct m_dateacct getparameter isvalidateonly m_isvalidateonly getparameter isimportonlynoerrors m_isimportonlynoerrors getparameter deleteoldimported m_deleteoldimported getparameter perrform process return message throws exception protected string do it throws java lang exception log info is validate only m isvalidateonly is import only no errors m isimportonlynoerrors string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i gljournal where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set is active created updated sql new string buffer update i gljournal set is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no set client from name sql new string buffer update i gljournal i set ad client id select c ad client id from ad client c where c value i client value where ad client id is null or ad client id 0 and client value is not null and i isimported y no db execute update sql to string get trxname log fine set client from value no set default client doc org acct schema dat acct sql new string buffer update i gljournal set ad client id coalesce ad client id append m ad client id append ad orgdoc id coalesce ad orgdoc id append m ad org id append if m c acctschema id 0 sql append c acctschema id coalesce c acctschema id append m c acctschema id append if m dateacct null sql append date acct coalesce date acct append db to date m dateacct append sql append updated coalesce updated sys date where i isimported y or i isimported is null no db execute update sql to string get trxname log fine client doc org default no error doc org sql new string buffer update i gljournal o set i isimported e i errormsg i errormsg err invalid doc org where ad orgdoc id is null or ad orgdoc id 0 or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid doc org no set acct schema sql new string buffer update i gljournal i set c acctschema id select a c acctschema id from c acctschema a where i acct schema name a name and i ad client id a ad client id where c acctschema id is null and acct schema name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set acct schema from name no sql new string buffer update i gljournal i set c acctschema id select c c acctschema1 id from ad clientinfo c where c ad client id i ad client id where c acctschema id is null and acct schema name is null and i isimported y append client check no db execute update sql to string get trxname log fine set acct schema from client no error acct schema sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err invalid acct schema where c acctschema id is null or c acctschema id 0 or not exists select from c acctschema a where i ad client id a ad client id and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid acct schema no set date acct mandatory sql new string buffer update i gljournal i set date acct sys date where date acct is null and i isimported y append client check no db execute update sql to string get trxname log fine set date acct no document type sql new string buffer update i gljournal i set c doctype id select d c doctype id from c doctype d where d name i doc type name and d doc base type glj and i ad client id d ad client id where c doctype id is null and doc type name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set doc type no sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err invalid doc type where c doctype id is null or c doctype id 0 or not exists select from c doctype d where i ad client id d ad client id and d doc base type glj and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid doc type no gl category sql new string buffer update i gljournal i set gl category id select c gl category id from gl category c where c name i category name and i ad client id c ad client id where gl category id is null and category name is not null and i isimported y append client check no db execute update sql to string get trxname log fine set doc type no sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err invalid category where gl category id is null or gl category id 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid category no set currency sql new string buffer update i gljournal i set c currency id select c c currency id from c currency c where c iso code i iso code and c ad client id in 0 i ad client id where c currency id is null and iso code is not null and i isimported y append client check no db execute update sql to string get trxname log fine set currency from iso no sql new string buffer update i gljournal i set c currency id select a c currency id from c acctschema a where a c acctschema id i c acctschema id and a ad client id i ad client id where c currency id is null and iso code is null and i isimported y append client check no db execute update sql to string get trxname log fine set default currency no sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err invalid currency where c currency id is null or c currency id 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid currency no set conversion type sql new string buffer update i gljournal i set conversion type value s where c conversiontype id is null and conversion type value is null and i isimported n append client check no db execute update sql to string get trxname log fine set currency type value to spot no sql new string buffer update i gljournal i set c conversiontype id select c c conversiontype id from c conversiontype c where c value i conversion type value and c ad client id in 0 i ad client id where c conversiontype id is null and conversion type value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set currency type from value no sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err invalid currency type where c conversiontype id is null or c conversiontype id 0 and conversion type value is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid currency type value no sql new string buffer update i gljournal i set i isimported e i errormsg i errormsg err no conversion type where c conversiontype id is null or c conversiontype id 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no courrency type no set overwrite home currency rate sql new string buffer update i gljournal i set currency rate 1 where exists select from c acctschema a where a c acctschema id i c acctschema id and a c currency id i c currency id and c currency id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set home currency rate no set currency rate sql new string buffer update i gljournal i set currency rate select r multiply rate from c conversion rate r c acctschema s where s c acctschema id i c acctschema id and s ad client id i ad client id and r c currency id i c currency id and r c currency id to s c currency id and r ad client id i ad client id and r ad org id i ad orgdoc id and r c conversiontype id i c conversiontype id and i date acct between r valid from and r valid to and rownum 1 order by valid from desc where currency rate is null or currency rate 0 and c currency id 0 and i isimported y append client check no db execute update sql to string get trxname log fine set org rate no sql new st doit isvalidateonly m_isvalidateonly isimportonlynoerrors m_isimportonlynoerrors stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_gljournal i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_gljournal isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_gljournal ad_client_id ad_client_id ad_client clientvalue ad_client_id ad_client_id clientvalue i_isimported executeupdate tostring get_trxname acctschema datacct stringbuffer i_gljournal ad_client_id ad_client_id m_ad_client_id ad_orgdoc_id ad_orgdoc_id m_ad_org_id m_c_acctschema_id c_acctschema_id c_acctschema_id m_c_acctschema_id m_dateacct dateacct dateacct to_date m_dateacct sysdate i_isimported i_isimported executeupdate tostring get_trxname docorg stringbuffer i_gljournal i_isimported i_errormsg i_errormsg ad_orgdoc_id ad_orgdoc_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname acctschema stringbuffer i_gljournal c_acctschema_id c_acctschema_id c_acctschema acctschemaname ad_client_id ad_client_id c_acctschema_id acctschemaname i_isimported clientcheck executeupdate tostring get_trxname acctschema stringbuffer i_gljournal c_acctschema_id c_acctschema1_id ad_clientinfo ad_client_id ad_client_id c_acctschema_id acctschemaname i_isimported clientcheck executeupdate tostring get_trxname acctschema acctschema stringbuffer i_gljournal i_isimported i_errormsg i_errormsg acctschema c_acctschema_id c_acctschema_id c_acctschema ad_client_id ad_client_id i_isimported clientcheck executeupdate tostring get_trxname acctschema dateacct stringbuffer i_gljournal dateacct sysdate dateacct i_isimported clientcheck executeupdate tostring get_trxname dateacct stringbuffer i_gljournal c_doctype_id c_doctype_id c_doctype doctypename docbasetype ad_client_id ad_client_id c_doctype_id doctypename i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_gljournal i_isimported i_errormsg i_errormsg doctype c_doctype_id c_doctype_id c_doctype ad_client_id ad_client_id docbasetype i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_gljournal gl_category_id gl_category_id gl_category categoryname ad_client_id ad_client_id gl_category_id categoryname i_isimported clientcheck executeupdate tostring get_trxname doctype stringbuffer i_gljournal i_isimported i_errormsg i_errormsg gl_category_id gl_category_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_gljournal c_currency_id c_currency_id c_currency iso_code iso_code ad_client_id ad_client_id c_currency_id iso_code i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_gljournal c_currency_id c_currency_id c_acctschema c_acctschema_id c_acctschema_id ad_client_id ad_client_id c_currency_id iso_code i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_gljournal i_isimported i_errormsg i_errormsg c_currency_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_gljournal conversiontypevalue c_conversiontype_id conversiontypevalue i_isimported clientcheck executeupdate tostring get_trxname currencytype stringbuffer i_gljournal c_conversiontype_id c_conversiontype_id c_conversiontype conversiontypevalue ad_client_id ad_client_id c_conversiontype_id conversiontypevalue i_isimported clientcheck executeupdate tostring get_trxname currencytype stringbuffer i_gljournal i_isimported i_errormsg i_errormsg currencytype c_conversiontype_id c_conversiontype_id conversiontypevalue i_isimported clientcheck executeupdate tostring get_trxname currencytypevalue stringbuffer i_gljournal i_isimported i_errormsg i_errormsg conversiontype c_conversiontype_id c_conversiontype_id i_isimported clientcheck executeupdate tostring get_trxname courrencytype stringbuffer i_gljournal currencyrate c_acctschema c_acctschema_id c_acctschema_id c_currency_id c_currency_id c_currency_id i_isimported clientcheck executeupdate tostring get_trxname currencyrate stringbuffer i_gljournal currencyrate multiplyrate c_conversion_rate c_acctschema c_acctschema_id c_acctschema_id ad_client_id ad_client_id c_currency_id c_currency_id c_currency_id_to c_currency_id ad_client_id ad_client_id ad_org_id ad_orgdoc_id c_conversiontype_id c_conversiontype_id dateacct validfrom validto validfrom currencyrate currencyrate c_currency_id i_isimported clientcheck executeupdate tostring get_trxname standard constructor public x c salesregion properties ctx int c salesregion id string trx name super ctx c salesregion id trx name if c salesregion id 0 setc salesregion id 0 set is default false set is summary false set name null set value null x_c_salesregion c_salesregion_id trxname c_salesregion_id trxname c_salesregion_id setc_salesregion_id setisdefault setissummary setname setvalue load constructor public x c salesregion properties ctx result set rs string trx name super ctx rs trx name x_c_salesregion resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c salesregion append get id append return sb to string tostring stringbuffer stringbuffer x_c_salesregion get_id tostring set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 1 throw new illegal argument exception c salesregion id is mandatory set valuenocheck c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id illegalargumentexception c_salesregion_id set_valuenocheck c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x c projectissue properties ctx int c projectissue id string trx name super ctx c projectissue id trx name if c projectissue id 0 setc projectissue id 0 setc project id 0 set line 0 sql select nvl max line 0 10 as default value from c projectissue where c project id c project id setm attributesetinstance id 0 setm locator id 0 setm product id 0 set movement date new timestamp system current time millis set movement qty env zero set posted false n set processed false x_c_projectissue c_projectissue_id trxname c_projectissue_id trxname c_projectissue_id setc_projectissue_id setc_project_id setline defaultvalue c_projectissue c_project_id c_project_id setm_attributesetinstance_id setm_locator_id setm_product_id setmovementdate currenttimemillis setmovementqty setposted setprocessed load constructor public x c projectissue properties ctx result set rs string trx name super ctx rs trx name x_c_projectissue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projectissue append get id append return sb to string tostring stringbuffer stringbuffer x_c_projectissue get_id tostring set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 1 throw new illegal argument exception c projectissue id is mandatory set valuenocheck c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id illegalargumentexception c_projectissue_id set_valuenocheck c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue set project financial project public void setc project id int c project id if c project id 1 throw new illegal argument exception c project id is mandatory set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id illegalargumentexception c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc project id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_project_id set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set value m inoutline id null else set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_value m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set expense line time and expense report line public void sets timeexpenseline id int s timeexpenseline id if s timeexpenseline id 0 set value s timeexpenseline id null else set value s timeexpenseline id new integer s timeexpenseline id sets_timeexpenseline_id s_timeexpenseline_id s_timeexpenseline_id set_value s_timeexpenseline_id set_value s_timeexpenseline_id s_timeexpenseline_id get expense line time and expense report line public int gets timeexpenseline id integer ii integer get value s timeexpenseline id if ii null return 0 return ii int value gets_timeexpenseline_id get_value s_timeexpenseline_id intvalue standard constructor public x r issueuser properties ctx int r issueuser id string trx name super ctx r issueuser id trx name if r issueuser id 0 setr issueuser id 0 set user name null x_r_issueuser r_issueuser_id trxname r_issueuser_id trxname r_issueuser_id setr_issueuser_id setusername load constructor public x r issueuser properties ctx result set rs string trx name super ctx rs trx name x_r_issueuser resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issueuser append get id append return sb to string tostring stringbuffer stringbuffer x_r_issueuser get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set issue user user who reported issues public void setr issueuser id int r issueuser id if r issueuser id 1 throw new illegal argument exception r issueuser id is mandatory set valuenocheck r issueuser id new integer r issueuser id issueuser setr_issueuser_id r_issueuser_id r_issueuser_id illegalargumentexception r_issueuser_id set_valuenocheck r_issueuser_id r_issueuser_id get issue user user who reported issues public int getr issueuser id integer ii integer get value r issueuser id if ii null return 0 return ii int value issueuser getr_issueuser_id get_value r_issueuser_id intvalue set registered e mail email of the responsible for the system public void set user name string user name if user name null throw new illegal argument exception user name is mandatory if user name length 60 log warning length 60 truncated user name user name substring 0 59 set valuenocheck user name user name email setusername username username illegalargumentexception username username username username set_valuenocheck username username get registered e mail email of the responsible for the system public string get user name return string get value user name email getusername get_value username return string get value user name public key name pair get key name pair return new key name pair get id get user name get_value username keynamepair getkeynamepair keynamepair get_id getusername get oldest default locator of warehouse with locator param ctx context param m locator id locator return locator or null public static m locator get default properties ctx int m locator id string trx name null m locator ret value null string sql select from m locator l where is default y and exists select from m locator lx where l m warehouse id lx m warehouse id and lx m locator id order by created prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m locator id result set rs pstmt execute query while rs next ret value new m locator ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_locator_id mlocator getdefault m_locator_id trxname mlocator retvalue m_locator isdefault m_locator m_warehouse_id m_warehouse_id m_locator_id preparedstatement preparestatement trxname setint m_locator_id resultset executequery retvalue mlocator trxname s_log retvalue get the locator with the combination or create new one param ctx context param m warehouse id warehouse param value value param x x param y y param z z return locator public static m locator get properties ctx int m warehouse id string value string x string y string z m locator ret value null string sql select from m locator where m warehouse id and x and y and z prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m warehouse id pstmt set string 2 x pstmt set string 3 y pstmt set string 4 z result set rs pstmt execute query if rs next ret value new m locator ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe get ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if ret value null m warehouse wh m warehouse get ctx m warehouse id ret value new m locator wh value ret value setxyz x y z ret value save return ret value m_warehouse_id mlocator m_warehouse_id mlocator retvalue m_locator m_warehouse_id preparedstatement preparestatement setint m_warehouse_id setstring setstring setstring resultset executequery retvalue mlocator sqlexception s_log sqlexception retvalue mwarehouse mwarehouse m_warehouse_id retvalue mlocator retvalue retvalue retvalue get locator from cache param ctx context param m locator id id return m locator public static m locator get properties ctx int m locator id if s cache null s cache new c cache integer m locator m locator 20 integer key new integer m locator id m locator ret value m locator s cache get key if ret value null return ret value ret value new m locator ctx m locator id null if ret value get id 0 s cache put key ret value return ret value m_locator_id mlocator mlocator m_locator_id s_cache s_cache ccache mlocator m_locator m_locator_id mlocator retvalue mlocator s_cache retvalue retvalue retvalue mlocator m_locator_id retvalue get_id s_cache retvalue retvalue standard locator constructor param ctx context param m locator id id public m locator properties ctx int m locator id string trx name super ctx m locator id trx name if m locator id 0 setm locator id 0 pk setm warehouse id 0 parent set is default false set priority no 50 set value null setx null sety null setz null m_locator_id mlocator m_locator_id trxname m_locator_id trxname m_locator_id setm_locator_id setm_warehouse_id setisdefault setpriorityno setvalue new locator constructor with xyz 000 param warehouse parent param value value public m locator m warehouse warehouse string value this warehouse get ctx 0 warehouse get trxname set client org warehouse setm warehouse id warehouse getm warehouse id parent set value value setxyz 0 0 0 mlocator mwarehouse getctx get_trxname setclientorg setm_warehouse_id getm_warehouse_id setvalue load constructor param ctx context param rs result set public m locator properties ctx result set rs string trx name super ctx rs trx name mlocator resultset trxname trxname get string representation return value public string to string return get value tostring getvalue set location param x x param y y param z z public void setxyz string x string y string z setx x sety y setz z get warehouse name return name public string get warehouse name m warehouse wh m warehouse get get ctx getm warehouse id if wh get id 0 return getm warehouse id return wh get name getwarehousename mwarehouse mwarehouse getctx getm_warehouse_id get_id getm_warehouse_id getname show plain message param window no number of window param c container owner param clear heading translated title of window param clear message translated message param clear text additional message public static void info int window no container c string clear heading string clear message string clear text log info clear heading clear message clear text string out clear message if clear text null clear text equals out n clear text window parent env get parent c if parent null parent env get window window no if show dialog parent null if parent instanceof j frame new a dialog dialog j frame parent clear heading out j option pane information message else new a dialog dialog j dialog parent clear heading out j option pane information message else j option pane show message dialog parent out n message clear heading title j option pane information message windowno clearheading clearmessage cleartext windowno clearheading clearmessage cleartext clearheading clearmessage cleartext clearmessage cleartext cleartext cleartext getparent getwindow windowno showdialog jframe adialogdialog jframe clearheading joptionpane information_message adialogdialog jdialog clearheading joptionpane information_message joptionpane showmessagedialog clearheading joptionpane information_message show message with info icon param window no number of window param c container owner param ad message message to be translated param msg additional message public static void info int window no container c string ad message string msg log info ad message msg properties ctx env get ctx string buffer out new string buffer if ad message null ad message equals out append msg get msg ctx ad message if msg null msg length 0 out append n append msg window parent env get parent c if parent null parent env get window window no if show dialog parent null if parent instanceof j frame new a dialog dialog j frame parent env get header ctx window no out to string j option pane information message else new a dialog dialog j dialog parent env get header ctx window no out to string j option pane information message else j option pane show message dialog parent out to string n message env get header ctx window no title j option pane information message windowno ad_message windowno ad_message ad_message getctx stringbuffer stringbuffer ad_message ad_message getmsg ad_message getparent getwindow windowno showdialog jframe adialogdialog jframe getheader windowno tostring joptionpane information_message adialogdialog jdialog getheader windowno tostring joptionpane information_message joptionpane showmessagedialog tostring getheader windowno joptionpane information_message show message with info icon param window no number of window param c container owner param ad message message to be translated public static void info int window no container c string ad message info window no c ad message null windowno ad_message windowno ad_message windowno ad_message display warning with warning icon param window no number of window param c container owner param ad message message to be translated param msg additional message public static void warn int window no container c string ad message string msg log info ad message msg properties ctx env get ctx string buffer out new string buffer if ad message null ad message equals out append msg get msg ctx ad message if msg null msg length 0 out append n append msg window parent env get parent c if parent null parent env get window window no if show dialog parent null if parent instanceof j frame new a dialog dialog j frame parent env get header ctx window no out to string j option pane warning message else new a dialog dialog j dialog parent env get header ctx window no out to string j option pane warning message else j option pane show message dialog parent out to string n message env get header ctx window no title j option pane warning message windowno ad_message windowno ad_message ad_message getctx stringbuffer stringbuffer ad_message ad_message getmsg ad_message getparent getwindow windowno showdialog jframe adialogdialog jframe getheader windowno tostring joptionpane warning_message adialogdialog jdialog getheader windowno tostring joptionpane warning_message joptionpane showmessagedialog tostring getheader windowno joptionpane warning_message display warning with warning icon param window no number of window param c container owner param ad message message to be translated public static void warn int window no container c string ad message warn window no c ad message null windowno ad_message windowno ad_message windowno ad_message display error with error icon param window no number of window param c container owner param ad message message to be translated param msg additional message public static void error int window no container c string ad message string msg log info ad message msg if c log mgt is level finest trace print stack properties ctx env get ctx string buffer out new string buffer if ad message null ad message equals out append msg get msg ctx ad message if msg null msg length 0 out append n append msg window parent env get parent c if parent null parent env get window window no if show dialog parent null if parent instanceof j frame new a dialog dialog j frame parent env get header ctx window no out to string j option pane error message else if parent instanceof j dialog new a dialog dialog j dialog parent env get header ctx window no out to string j option pane error message else j option pane show message dialog env get window window no out to string n message env get header ctx window no title j option pane error message windowno ad_message windowno ad_message ad_message clogmgt islevelfinest printstack getctx stringbuffer stringbuffer ad_message ad_message getmsg ad_message getparent getwindow windowno showdialog jframe adialogdialog jframe getheader windowno tostring joptionpane error_message jdialog adialogdialog jdialog getheader windowno tostring joptionpane error_message joptionpane showmessagedialog getwindow windowno tostring getheader windowno joptionpane error_message display error with error icon param window no number of window param c container owner param ad message message to be translated public static void error int window no container c string ad message error window no c ad message null windowno ad_message windowno ad_message windowno ad_message ask question with question icon and ok cancel buttons param window no number of window param c container owner param ad message message to be translated param msg additional clear text message return true if ok public static boolean ask int window no container c string ad message string msg log info ad message msg properties ctx env get ctx string buffer out new string buffer if ad message null ad message equals out append msg get msg ctx ad message if msg null msg length 0 out append n append msg window parent env get parent c if parent null parent env get window window no boolean ret value false if show dialog parent null if parent instanceof j frame a dialog dialog d new a dialog dialog j frame parent env get header ctx window no out to string j option pane question message ret value d get return code a dialog dialog a ok else a dialog dialog d new a dialog dialog j dialog parent env get header ctx window no out to string j option pane question message ret value d get return code a dialog dialog a ok else object optionsoc util clean amp msg get msg ctx ok util clean amp msg get msg ctx cancel int i j option pane show option dialog parent out to string n message env get header ctx window no title j option pane default option j option pane question message null optionsoc optionsoc 0 ret value i j option pane yes option return ret value windowno ad_message windowno ad_message ad_message getctx stringbuffer stringbuffer ad_message ad_message getmsg ad_message getparent getwindow windowno retvalue showdialog jframe adialogdialog adialogdialog jframe getheader windowno tostring joptionpane question_message retvalue getreturncode adialogdialog a_ok adialogdialog adialogdialog jdialog getheader windowno tostring joptionpane question_message retvalue getreturncode adialogdialog a_ok cleanamp getmsg cleanamp getmsg joptionpane showoptiondialog tostring getheader windowno joptionpane default_option joptionpane question_message retvalue joptionpane yes_option retvalue ask question with question icon and ok cancel buttons param window no number of window param c container owner param ad message message to be translated return true if ok public static boolean ask int window no container c string ad message return ask window no c ad message null windowno ad_message windowno ad_message windowno ad_message display parsed development info message string param window no number of parent window if zero no parent window param c container owner param parse string string to be parsed public static void clear int window no container c string parse string log info dialog clear parse string properties ctx env get ctx string parse env parse context ctx window no parse string false if parse length 0 parse error parsing parse string window parent env get parent c if parent null parent env get window window no if show dialog parent null if parent instanceof j frame new a dialog dialog j frame parent env get header ctx window no parse j option pane information message else new a dialog dialog j dialog parent env get header ctx window no parse j option pane information message else j option pane show message dialog parent parse n message env get header ctx window no title j option pane information message windowno parsestring windowno parsestring parsestring getctx parsecontext windowno parsestring parsestring getparent getwindow windowno showdialog jframe adialogdialog jframe getheader windowno joptionpane information_message adialogdialog jdialog getheader windowno joptionpane information_message joptionpane showmessagedialog getheader windowno joptionpane information_message display parsed development info message string x if condition is true param window no number of parent window if zero no parent window param c container owner param parse string parsed message param condition to print must be true and debugging enabled public static void clear int window no container c string parse string boolean condition if condition return clear window no c parse string if window no 0 log log level severe w indow no 0 windowno parsestring windowno parsestring windowno parsestring windowno windowno display parsed development info message string param parse string string to be parsed deprecated public static void clear string parse string clear 0 null parse string parsestring parsestring parsestring create support e mail param owner owner param subject subkect param message message public static void create supporte mail dialog owner string subject string message log config a dialog create supporte mail string to compiere get supporte mail m user from m user get env get ctx env getad user id env get ctx string buffer my message new string buffer message my message append n c log mgt get info my message c log mgt get info detail my message env get ctx e mail dialog emd new e mail dialog owner msg get msg env get ctx e mail support from to support subject my message to string null email createsupportemail adialog createsupportemail getsupportemail muser muser getctx getad_user_id getctx stringbuffer mymessage stringbuffer mymessage clogmgt getinfo mymessage clogmgt getinfodetail mymessage getctx emaildialog emaildialog getmsg getctx emailsupport mymessage tostring create support e mail param owner owner param subject subkect param message message public static void create supporte mail frame owner string subject string message log config a dialog create supporte mail string to compiere get supporte mail m user from m user get env get ctx env getad user id env get ctx string buffer my message new string buffer message my message append n c log mgt get info my message c log mgt get info detail my message env get ctx e mail dialog emd new e mail dialog owner msg get msg env get ctx e mail support from to support subject my message to string null email createsupportemail adialog createsupportemail getsupportemail muser muser getctx getad_user_id getctx stringbuffer mymessage stringbuffer mymessage clogmgt getinfo mymessage clogmgt getinfodetail mymessage getctx emaildialog emaildialog getmsg getctx emailsupport mymessage tostring beep public static void beep toolkit get default toolkit beep getdefaulttoolkit basic constructor public dl sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dl add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dl add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dl add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dl add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public dl remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get general info return info public static info get general if m general null m general new info new properties null return m general getgeneral m_general m_general m_general constructor param ctx context param wu b partner public info properties ctx web user wu m ctx ctx m wu wu bpartner webuser m_ctx m_wu string representation return info public string to string string buffer sb new string buffer info sb append getc bpartner id sb append return sb to string tostring stringbuffer stringbuffer getc_bpartner_id tostring get info message reset return info message public string get message string ret value m infomessage m infomessage null return ret value getmessage retvalue m_infomessage m_infomessage retvalue get info message do not reset return info message public string get info return m infomessage getinfo m_infomessage set info message param msg info message public void set message string msg m infomessage msg setmessage m_infomessage get info message return info id public int get id return m id getid m_id set info message param id info id public void set id string id try set id integer parse int id catch number format exception ex log log level severe id id ex to string m id 0 setid setid parseint numberformatexception tostring m_id set info message param id info id public void set id int id log info id id m id id setid m_id get client return ad client id public int getad client id if m wu null return 1 return m wu getad client id ad_client_id getad_client_id m_wu m_wu getad_client_id get b partner return c bpartner id public int getc bpartner id if m wu null return 1 return m wu getc bpartner id bpartner c_bpartner_id getc_bpartner_id m_wu m_wu getc_bpartner_id get b partner contact user return ad user id public int getad user id if m wu null return 1 return m wu getad user id bpartner ad_user_id getad_user_id m_wu m_wu getad_user_id get b partner contact user return ad user id public int getuser id return getad user id bpartner ad_user_id getuser_id getad_user_id get orders return invoices of bp public array list m order get orders m infomessage null array list m order list new array list m order if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype purchaseorder m doc type docbasetype salesorder log info no access return list string sql select from c order where bill bpartner id and doc status not in dr in order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m order m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist morder getorders m_infomessage arraylist morder arraylist morder m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_purchaseorder mdoctype docbasetype_salesorder c_order bill_bpartner_id docstatus documentno preparedstatement preparestatement setint getc_bpartner_id resultset executequery morder m_ctx get order needs to have id set first return invoice of bp with id public m order get order m infomessage null m order ret value null if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype purchaseorder m doc type docbasetype salesorder log info no access return null string sql select from c order where bill bpartner id and c order id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new m order m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe c order id m id e finally try if pstmt null pstmt close catch exception e pstmt null log fine c order id m id ret value return ret value morder getorder m_infomessage morder retvalue m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_purchaseorder mdoctype docbasetype_salesorder c_order bill_bpartner_id c_order_id preparedstatement preparestatement setint getc_bpartner_id setint m_id resultset executequery retvalue morder m_ctx c_order_id m_id c_order_id m_id retvalue retvalue get shipments return shipments of bp public array list m in out get shipments m infomessage null array list m in out list new array list m in out if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype materialreceipt m doc type docbasetype materialdelivery log info no access return list string sql select from m inout where c bpartner id and doc status not in dr in order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m in out m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist minout getshipments m_infomessage arraylist minout arraylist minout m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_materialreceipt mdoctype docbasetype_materialdelivery m_inout c_bpartner_id docstatus documentno preparedstatement preparestatement setint getc_bpartner_id resultset executequery minout m_ctx get own requests return array of own requests public array list get requests own return get requests true arraylist getrequestsown getrequests get own requests return array of assigned requests public array list get requests assigned return get requests false arraylist getrequestsassigned getrequests get requests param own if true its own requests otherwise or return array of requests public array list m request get requests boolean own m infomessage null array list m request list new array list m request string sql null if own all requests sql select from r request r where r c bpartner id 1 and r ad user id 2 or exists select from ad user u where u ad user id and r c bpartner id u c bpartner id and is fullbp access y 3 or exists select from ad user u inner join ad userbpaccess a on u ad user id a ad user id where u ad user id and r c bpartner id u c bpartner id 4 and a bp access type r and a r requesttype id is null or a r requesttype id r r requesttype id order by r document no desc else open requests of sales rep sql select from r request where salesrep id in select ad user id from ad user where c bpartner id and r status id in select r status id from r status where is closed n order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id if own pstmt set int 2 getad user id pstmt set int 3 getad user id pstmt set int 4 getad user id result set rs pstmt execute query while rs next list add new m request m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine own own list size return list arraylist mrequest getrequests m_infomessage arraylist mrequest arraylist mrequest r_request c_bpartner_id ad_user_id ad_user ad_user_id c_bpartner_id c_bpartner_id isfullbpaccess ad_user ad_userbpaccess ad_user_id ad_user_id ad_user_id c_bpartner_id c_bpartner_id bpaccesstype r_requesttype_id r_requesttype_id r_requesttype_id documentno r_request salesrep_id ad_user_id ad_user c_bpartner_id r_status_id r_status_id r_status isclosed documentno preparedstatement preparestatement setint getc_bpartner_id setint getad_user_id setint getad_user_id setint getad_user_id resultset executequery mrequest m_ctx get request needs to have id set first check that it is owned created by requestor return invoice of bp with id public m request get request m infomessage null m request ret value null string sql select from r request where r request id and c bpartner id or salesrep id in select ad user id from ad user where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m id pstmt set int 2 getc bpartner id pstmt set int 3 getc bpartner id result set rs pstmt execute query if rs next ret value new m request m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe r request id m id e finally try if pstmt null pstmt close catch exception e pstmt null log fine r request id m id ret value return ret value mrequest getrequest m_infomessage mrequest retvalue r_request r_request_id c_bpartner_id salesrep_id ad_user_id ad_user c_bpartner_id preparedstatement preparestatement setint m_id setint getc_bpartner_id setint getc_bpartner_id resultset executequery retvalue mrequest m_ctx r_request_id m_id r_request_id m_id retvalue retvalue get request types return array of request types public array list m request type get request types m infomessage null array list m request type list new array list m request type string sql select from r requesttype where is self service y and ad client id order by name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad client id result set rs pstmt execute query while rs next list add new m request type m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mrequesttype getrequesttypes m_infomessage arraylist mrequesttype arraylist mrequesttype r_requesttype isselfservice ad_client_id preparedstatement preparestatement setint getad_client_id resultset executequery mrequesttype m_ctx get request type return request type public m request type get request type m infomessage null m request type ret value null string sql select from r requesttype where is self service y and r requesttype id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m id result set rs pstmt execute query if rs next ret value new m request type m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine r requesttype id m id ret value return ret value mrequesttype getrequesttype m_infomessage mrequesttype retvalue r_requesttype isselfservice r_requesttype_id preparedstatement preparestatement setint m_id resultset executequery retvalue mrequesttype m_ctx r_requesttype_id m_id retvalue retvalue get invoices return invoices of bp public array list m invoice get invoices m infomessage null array list m invoice list new array list m invoice if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype apinvoice m doc type docbasetype apcreditmemo m doc type docbasetype arinvoice m doc type docbasetype arcreditmemo log info no access return list string sql select from c invoice where c bpartner id and doc status not in dr in order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m invoice m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist minvoice getinvoices m_infomessage arraylist minvoice arraylist minvoice m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_apinvoice mdoctype docbasetype_apcreditmemo mdoctype docbasetype_arinvoice mdoctype docbasetype_arcreditmemo c_invoice c_bpartner_id docstatus documentno preparedstatement preparestatement setint getc_bpartner_id resultset executequery minvoice m_ctx get invoice needs to have id set first return invoice with id of bp public m invoice get invoice m infomessage null m invoice ret value null if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype apinvoice m doc type docbasetype apcreditmemo m doc type docbasetype arinvoice m doc type docbasetype arcreditmemo log info no access return null string sql select from c invoice where c bpartner id and c invoice id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new m invoice m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe c invoice id m id e finally try if pstmt null pstmt close catch exception e pstmt null log fine c invoice id m id ret value return ret value minvoice getinvoice m_infomessage minvoice retvalue m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_apinvoice mdoctype docbasetype_apcreditmemo mdoctype docbasetype_arinvoice mdoctype docbasetype_arcreditmemo c_invoice c_bpartner_id c_invoice_id preparedstatement preparestatement setint getc_bpartner_id setint m_id resultset executequery retvalue minvoice m_ctx c_invoice_id m_id c_invoice_id m_id retvalue retvalue get payments return payments of bp public array list m payment get payments m infomessage null array list m payment list new array list m payment if m wu null m wu hasbp access x ad userbpaccess bpaccesstype businessdocuments new object m doc type docbasetype appayment m doc type docbasetype arreceipt log info no access return list string sql select from c payment where c bpartner id and doc status not in dr in order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m payment m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mpayment getpayments m_infomessage arraylist mpayment arraylist mpayment m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_businessdocuments mdoctype docbasetype_appayment mdoctype docbasetype_arreceipt c_payment c_bpartner_id docstatus documentno preparedstatement preparestatement setint getc_bpartner_id resultset executequery mpayment m_ctx get active assets if not credit stop and e mail is verified return payments of bp public array list m asset get assets m infomessage null array list m asset list new array list m asset if m wu null if m wu is credit stop hold return list if m wu ise mail verified return list if m wu null m wu hasbp access x ad userbpaccess bpaccesstype assetsdownload null log info no access return list string sql select from a asset where c bpartner id and is active y order by name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m asset m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list email arraylist masset getassets m_infomessage arraylist masset arraylist masset m_wu m_wu iscreditstophold m_wu isemailverified m_wu m_wu hasbpaccess x_ad_userbpaccess bpaccesstype_assetsdownload a_asset c_bpartner_id isactive preparedstatement preparestatement setint getc_bpartner_id resultset executequery masset m_ctx get interest areas return interest areas of bpc public array list m interest area get interests m infomessage null int ad client id env getad client id m ctx array list m interest area list new array list m interest area string sql select from r interestarea where is active y and is self service y and ad client id order by name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next m interest area ia new m interest area m ctx rs null ia set subscription info getad user id list add ia rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist minterestarea getinterests m_infomessage ad_client_id getad_client_id m_ctx arraylist minterestarea arraylist minterestarea r_interestarea isactive isselfservice ad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery minterestarea minterestarea m_ctx setsubscriptioninfo getad_user_id get advertisements return advertisements of bp public array list m advertisement get advertisements m infomessage null array list m advertisement list new array list m advertisement string sql select from w advertisement where c bpartner id order by valid from desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m advertisement m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist madvertisement getadvertisements m_infomessage arraylist madvertisement arraylist madvertisement w_advertisement c_bpartner_id validfrom preparedstatement preparestatement setint getc_bpartner_id resultset executequery madvertisement m_ctx get all advertisements return all advertisements public array list m advertisement get all ads m infomessage null array list m advertisement list new array list m advertisement string sql select from w advertisement where is active y order by description prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m advertisement m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist madvertisement getallads m_infomessage arraylist madvertisement arraylist madvertisement w_advertisement isactive preparedstatement preparestatement resultset executequery madvertisement m_ctx get commissioned invoices return commissioned invoices public array list m invoice get commissioned invoices m infomessage null array list m invoice list new array list m invoice string sql select from c invoice where c invoice salesrep id 1 or exists select from c bpartner bp where c invoice c bpartner id bp c bpartner id and bp salesrep id or exists select from c invoiceline il inner join m product p on il m product id p m product id where c invoice c invoice id il c invoice id and p salesrep id and doc status not in dr in order by document no desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id pstmt set int 2 getad user id pstmt set int 3 getad user id result set rs pstmt execute query while rs next list add new m invoice m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist minvoice getcommissionedinvoices m_infomessage arraylist minvoice arraylist minvoice c_invoice c_invoice salesrep_id c_bpartner c_invoice c_bpartner_id c_bpartner_id salesrep_id c_invoiceline m_product m_product_id m_product_id c_invoice c_invoice_id c_invoice_id salesrep_id docstatus documentno preparedstatement preparestatement setint getad_user_id setint getad_user_id setint getad_user_id resultset executequery minvoice m_ctx get commission runs return commissioned invoices public array list m commission run get commission runs m infomessage null array list m commission run list new array list m commission run string sql select from c commissionrun where exists select from c commission c where c commissionrun c commission id c c commission id and c c bpartner id order by document no prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m commission run m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mcommissionrun getcommissionruns m_infomessage arraylist mcommissionrun arraylist mcommissionrun c_commissionrun c_commission c_commissionrun c_commission_id c_commission_id c_bpartner_id documentno preparedstatement preparestatement setint getc_bpartner_id resultset executequery mcommissionrun m_ctx get notices return notices public array list m note get notes array list m note list new array list m note string sql select from ad note where ad user id and processed n or processed is null order by created desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id result set rs pstmt execute query while rs next list add new m note m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mnote getnotes arraylist mnote arraylist mnote ad_note ad_user_id preparedstatement preparestatement setint getad_user_id resultset executequery mnote m_ctx get notification needs to have id set first return notification of user with id public m note get note m infomessage null m note ret value null string sql select from ad note where ad user id and ad note id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new m note m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe ad note id m id e finally try if pstmt null pstmt close catch exception e pstmt null log fine ad note id m id ret value return ret value mnote getnote m_infomessage mnote retvalue ad_note ad_user_id ad_note_id preparedstatement preparestatement setint getad_user_id setint m_id resultset executequery retvalue mnote m_ctx ad_note_id m_id ad_note_id m_id retvalue retvalue get workflow activities return activities public array list mwf activity get activities array list mwf activity list new array list mwf activity string sql select from ad wf activity where ad user id and processed n order by priority desc created prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id result set rs pstmt execute query while rs next list add new mwf activity m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mwfactivity getactivities arraylist mwfactivity arraylist mwfactivity ad_wf_activity ad_user_id preparedstatement preparestatement setint getad_user_id resultset executequery mwfactivity m_ctx get acitivity needs to have id set first return notification of user with id public mwf activity get activity m infomessage null mwf activity ret value null string sql select from ad wf activity where ad user id and ad wf activity id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new mwf activity m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe ad wf activity id m id e finally try if pstmt null pstmt close catch exception e pstmt null log fine ad wf activity id m id ret value return ret value mwfactivity getactivity m_infomessage mwfactivity retvalue ad_wf_activity ad_user_id ad_wf_activity_id preparedstatement preparestatement setint getad_user_id setint m_id resultset executequery retvalue mwfactivity m_ctx ad_wf_activity_id m_id ad_wf_activity_id m_id retvalue retvalue get expenses return expense reports public array list m time expense get expenses m infomessage null array list m time expense list new array list m time expense string sql select from s timeexpense where c bpartner id order by created desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m time expense m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mtimeexpense getexpenses m_infomessage arraylist mtimeexpense arraylist mtimeexpense s_timeexpense c_bpartner_id preparedstatement preparestatement setint getc_bpartner_id resultset executequery mtimeexpense m_ctx get expense report needs to have id set first return invoice of bp with id public m time expense get expense m infomessage null m time expense ret value null string sql select from s timeexpense where c bpartner id and s timeexpense id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new m time expense m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe s timeexpense id m id e finally try if pstmt null pstmt close catch exception e pstmt null if ret value null ret value new m time expense m ctx 0 null log fine s timeexpense id m id ret value return ret value mtimeexpense getexpense m_infomessage mtimeexpense retvalue s_timeexpense c_bpartner_id s_timeexpense_id preparedstatement preparestatement setint getc_bpartner_id setint m_id resultset executequery retvalue mtimeexpense m_ctx s_timeexpense_id m_id retvalue retvalue mtimeexpense m_ctx s_timeexpense_id m_id retvalue retvalue get registrations return registrations public array list m registration get registrations m infomessage null array list m registration list new array list m registration string sql select from a registration where c bpartner id order by created desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m registration m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list arraylist mregistration getregistrations m_infomessage arraylist mregistration arraylist mregistration a_registration c_bpartner_id preparedstatement preparestatement setint getc_bpartner_id resultset executequery mregistration m_ctx get registration needs to have id set first return invoice of bp with id public m registration get registration m infomessage null m registration ret value null string sql select from a registration where c bpartner id and a registration id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id pstmt set int 2 m id result set rs pstmt execute query if rs next ret value new m registration m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe a registration id m id e finally try if pstmt null pstmt close catch exception e pstmt null new registration if ret value null ret value new m registration m ctx 0 null log fine a registration id m id ret value return ret value mregistration getregistration m_infomessage mregistration retvalue a_registration c_bpartner_id a_registration_id preparedstatement preparestatement setint getc_bpartner_id setint m_id resultset executequery retvalue mregistration m_ctx a_registration_id m_id retvalue retvalue mregistration m_ctx a_registration_id m_id retvalue retvalue get rf qs where response is accepted self service and either all vendors or this vendor is selected return request for quotations public array list m rfq get rf qs m infomessage null array list m rfq list new array list m rfq string sql select from c rfq r where r is rfq response accepted y and r is self service y and r is active y and r processed n and r is invited vendors only n or exists select from c rfqresponse rr where r c rfq id rr c rfq id and rr c bpartner id order by r name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc bpartner id result set rs pstmt execute query while rs next list add new m rfq m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null log fine list size return list rfqs arraylist mrfq getrfqs m_infomessage arraylist mrfq arraylist mrfq c_rfq isrfqresponseaccepted isselfservice isactive isinvitedvendorsonly c_rfqresponse c_rfq_id c_rfq_id c_bpartner_id preparedstatement preparestatement setint getc_bpartner_id resultset executequery mrfq m_ctx get rfq response needs to have id set first return rfq of bp with id public m rfq response get rfq response m infomessage null m rfq response ret value null string sql select from c rfqresponse where c rfq id and c bpartner id and is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m id pstmt set int 2 getc bpartner id result set rs pstmt execute query if rs next ret value new m rfq response m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe c rfqresponse id m id e finally try if pstmt null pstmt close catch exception e pstmt null no response existing if ret value null m rfq rfq new m rfq m ctx m id null we can create a response if rfq get id 0 rfq is self service rfq is rfq response accepted rfq is invited vendors only getc bpartner id 0 getad user id 0 mb partner bp new mb partner m ctx getc bpartner id null bp setprimaryad user id getad user id ret value new m rfq response rfq bp may have no lines ret value save log fine c rfqresponse id m id ret value return ret value mrfqresponse getrfqresponse m_infomessage mrfqresponse retvalue c_rfqresponse c_rfq_id c_bpartner_id isactive preparedstatement preparestatement setint m_id setint getc_bpartner_id resultset executequery retvalue mrfqresponse m_ctx c_rfqresponse_id m_id retvalue mrfq mrfq m_ctx m_id get_id isselfservice isrfqresponseaccepted isinvitedvendorsonly getc_bpartner_id getad_user_id mbpartner mbpartner m_ctx getc_bpartner_id setprimaryad_user_id getad_user_id retvalue mrfqresponse retvalue c_rfqresponse_id m_id retvalue retvalue standard constructor param ctx context param ad pinstance id instance or 0 public mp instance properties ctx int ad pinstance id string ignored super ctx ad pinstance id null new process if ad pinstance id 0 setad process id 0 parent setrecord id 0 set is processing false ad_pinstance_id mpinstance ad_pinstance_id ad_pinstance_id ad_pinstance_id setad_process_id setrecord_id setisprocessing load constructor param ctx context param rs result set public mp instance properties ctx result set rs string ignored super ctx rs null mpinstance resultset create process instance from process and create parameters param process process param record id record public mp instance m process process int record id this process get ctx 0 null setad process id process getad process id setrecord id record id setad user id env getad user id process get ctx if save need to save for parameters throw new illegal argument exception cannot save set parameter base info m process para para process get parameters for int i 0 i para length i mp instance para pip new mp instance para this para i get seq no pip set parameter name para i get column name pip set info para i get name pip save record_id mpinstance mprocess record_id getctx setad_process_id getad_process_id setrecord_id record_id setad_user_id getad_user_id getctx illegalargumentexception mprocesspara getparameters mpinstancepara mpinstancepara getseqno setparametername getcolumnname setinfo getname new constructor param ctx context param ad process id process id param record id record public mp instance properties ctx int ad process id int record id this ctx 0 null setad process id ad process id setrecord id record id setad user id env getad user id ctx set is processing false ad_process_id record_id mpinstance ad_process_id record_id setad_process_id ad_process_id setrecord_id record_id setad_user_id getad_user_id setisprocessing get parameters return parameter array public mp instance para get parameters if m parameters null return m parameters array list mp instance para list new array list mp instance para string sql select from ad pinstance para where ad pinstance id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad pinstance id result set rs pstmt execute query while rs next list add new mp instance para get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m parameters new mp instance para list size list to array m parameters return m parameters mpinstancepara getparameters m_parameters m_parameters arraylist mpinstancepara arraylist mpinstancepara ad_pinstance_para ad_pinstance_id preparedstatement preparestatement setint getad_pinstance_id resultset executequery mpinstancepara getctx m_parameters mpinstancepara toarray m_parameters m_parameters get logs return array of logs public mp instance log get log load it from db m log clear string sql select from ad pinstance log where ad pinstance id order by log id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad pinstance id result set rs pstmt execute query while rs next m log add new mp instance log rs rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null mp instance log ret value new mp instance log m log size m log to array ret value return ret value mpinstancelog getlog m_log ad_pinstance_log ad_pinstance_id log_id preparedstatement preparestatement setint getad_pinstance_id resultset executequery m_log mpinstancelog mpinstancelog retvalue mpinstancelog m_log m_log toarray retvalue retvalue param p date date param p id id param p number number param p msg msg public void add log timestamp p date int p id big decimal p number string p msg mp instance log log entry new mp instance log getad pinstance id m log size 1 p date p id p number p msg m log add log entry save it to db log save p_date p_id p_number p_msg addlog p_date p_id bigdecimal p_number p_msg mpinstancelog logentry mpinstancelog getad_pinstance_id m_log p_date p_id p_number p_msg m_log logentry set ad process id check role if process can be performed param ad process id process public void setad process id int ad process id int ad role id env getad role id get ctx if ad role id 0 m role role m role get get ctx ad role id boolean access role get process access ad process id if access null access boolean value throw new illegal access error cannot access process with role get name super setad process id ad process id ad_process_id ad_process_id setad_process_id ad_process_id ad_role_id getad_role_id getctx ad_role_id mrole mrole getctx ad_role_id getprocessaccess ad_process_id booleanvalue illegalaccesserror getname setad_process_id ad_process_id string representation see java lang object to string return info public string to string string buffer sb new string buffer mp instance append get id append ok append isok string msg get error msg if msg null msg length 0 sb append msg sb append return sb to string tostring tostring stringbuffer stringbuffer mpinstance get_id geterrormsg tostring dump log public void log log info to string mp instance log pil get log for int i 0 i pil length i log info i pil i tostring mpinstancelog getlog is it ok return result ok public boolean isok return get result result ok getresult result_ok set result param ok public void set result boolean ok super set result ok result ok result error setresult setresult result_ok result_error after save param new record new param success success return success protected boolean after save boolean new record boolean success update statistics if new record is processing is valuechanged is processing long ms system current time millis get created get time int seconds int ms 1000 if seconds 1 seconds 1 m process prc m process get get ctx getad process id prc add statistics seconds if prc get id 0 prc save log fine after save process statistics updated sec seconds else log warning after save process statistics not updated return success newrecord aftersave newrecord newrecord isprocessing is_valuechanged isprocessing currenttimemillis getcreated gettime mprocess mprocess getctx getad_process_id addstatistics get_id aftersave aftersave standard constructor param ctx context param m distributionrun id id public m distribution run properties ctx int m distributionrun id string trx name super ctx m distributionrun id trx name m_distributionrun_id mdistributionrun m_distributionrun_id trxname m_distributionrun_id trxname load constructor param ctx context param rs result set public m distribution run properties ctx result set rs string trx name super ctx rs trx name mdistributionrun resultset trxname trxname get active non zero lines param reload true if reload return lines public m distribution run line get lines boolean reload if reload m lines null return m lines string sql select from m distributionrunline where m distributionrun id and is active y and total qty is not null and total qty 0 order by line array list m distribution run line list new array list m distribution run line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm distributionrun id result set rs pstmt execute query while rs next list add new m distribution run line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m distribution run line list size list to array m lines return m lines mdistributionrunline getlines m_lines m_lines m_distributionrunline m_distributionrun_id isactive totalqty totalqty arraylist mdistributionrunline arraylist mdistributionrunline preparedstatement preparestatement get_trxname setint getm_distributionrun_id resultset executequery mdistributionrunline getctx get_trxname getlines m_lines mdistributionrunline toarray m_lines m_lines standard constructor public x ad alertprocessorlog properties ctx int ad alertprocessorlog id string trx name super ctx ad alertprocessorlog id trx name if ad alertprocessorlog id 0 setad alertprocessorlog id 0 setad alertprocessor id 0 set is error false x_ad_alertprocessorlog ad_alertprocessorlog_id trxname ad_alertprocessorlog_id trxname ad_alertprocessorlog_id setad_alertprocessorlog_id setad_alertprocessor_id setiserror load constructor public x ad alertprocessorlog properties ctx result set rs string trx name super ctx rs trx name x_ad_alertprocessorlog resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad alertprocessorlog append get id append return sb to string tostring stringbuffer stringbuffer x_ad_alertprocessorlog get_id tostring set alert processor log result of the execution of the alert processor public void setad alertprocessorlog id int ad alertprocessorlog id if ad alertprocessorlog id 1 throw new illegal argument exception ad alertprocessorlog id is mandatory set valuenocheck ad alertprocessorlog id new integer ad alertprocessorlog id setad_alertprocessorlog_id ad_alertprocessorlog_id ad_alertprocessorlog_id illegalargumentexception ad_alertprocessorlog_id set_valuenocheck ad_alertprocessorlog_id ad_alertprocessorlog_id get alert processor log result of the execution of the alert processor public int getad alertprocessorlog id integer ii integer get value ad alertprocessorlog id if ii null return 0 return ii int value getad_alertprocessorlog_id get_value ad_alertprocessorlog_id intvalue set alert processor alert processor server parameter public void setad alertprocessor id int ad alertprocessor id if ad alertprocessor id 1 throw new illegal argument exception ad alertprocessor id is mandatory set valuenocheck ad alertprocessor id new integer ad alertprocessor id setad_alertprocessor_id ad_alertprocessor_id ad_alertprocessor_id illegalargumentexception ad_alertprocessor_id set_valuenocheck ad_alertprocessor_id ad_alertprocessor_id get alert processor alert processor server parameter public int getad alertprocessor id integer ii integer get value ad alertprocessor id if ii null return 0 return ii int value getad_alertprocessor_id get_value ad_alertprocessor_id intvalue set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set error an error occured in the execution public void set is error boolean is error set value is error new boolean is error setiserror iserror set_value iserror iserror get error an error occured in the execution public boolean is error object oo get value is error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iserror get_value iserror booleanvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg constructor public check renderer super m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center m check set opaque true checkrenderer m_check setmargin m_check sethorizontalalignment jlabel m_check setopaque return centered white check box param table param value param is selected param has focus param row param col return component public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int col background foreground color bg compiereplaf getfieldbackground normal selected is white on blue in windows if is selected has focus bg table get selection background row not selected or field has focus else inactive background if table is cell editable row col bg compiereplaf getfieldbackground inactive set color m check set background bg value set value value return m check isselected hasfocus gettablecellrenderercomponent jtable isselected hasfocus getfieldbackground_normal isselected hasfocus getselectionbackground iscelleditable getfieldbackground_inactive m_check setbackground setvalue m_check set value param value public void set value object value if value null boolean value boolean value m check set selected true else m check set selected false setvalue booleanvalue m_check setselected m_check setselected get contents return contents public object get contents return contents getcontents standard constructor public x ad printlabel properties ctx int ad printlabel id string trx name super ctx ad printlabel id trx name if ad printlabel id 0 setad labelprinter id 0 setad printlabel id 0 setad table id 0 set is landscape false set label height 0 set label width 0 set name null x_ad_printlabel ad_printlabel_id trxname ad_printlabel_id trxname ad_printlabel_id setad_labelprinter_id setad_printlabel_id setad_table_id setislandscape setlabelheight setlabelwidth setname load constructor public x ad printlabel properties ctx result set rs string trx name super ctx rs trx name x_ad_printlabel resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printlabel append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printlabel get_id tostring set label printer label printer definition public void setad labelprinter id int ad labelprinter id if ad labelprinter id 1 throw new illegal argument exception ad labelprinter id is mandatory set value ad labelprinter id new integer ad labelprinter id setad_labelprinter_id ad_labelprinter_id ad_labelprinter_id illegalargumentexception ad_labelprinter_id set_value ad_labelprinter_id ad_labelprinter_id get label printer label printer definition public int getad labelprinter id integer ii integer get value ad labelprinter id if ii null return 0 return ii int value getad_labelprinter_id get_value ad_labelprinter_id intvalue set print label label format to print public void setad printlabel id int ad printlabel id if ad printlabel id 1 throw new illegal argument exception ad printlabel id is mandatory set valuenocheck ad printlabel id new integer ad printlabel id setad_printlabel_id ad_printlabel_id ad_printlabel_id illegalargumentexception ad_printlabel_id set_valuenocheck ad_printlabel_id ad_printlabel_id get print label label format to print public int getad printlabel id integer ii integer get value ad printlabel id if ii null return 0 return ii int value getad_printlabel_id get_value ad_printlabel_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set landscape landscape orientation public void set is landscape boolean is landscape set value is landscape new boolean is landscape setislandscape islandscape set_value islandscape islandscape get landscape landscape orientation public boolean is landscape object oo get value is landscape if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islandscape get_value islandscape booleanvalue set label height height of the label public void set label height int label height set value label height new integer label height setlabelheight labelheight set_value labelheight labelheight get label height height of the label public int get label height integer ii integer get value label height if ii null return 0 return ii int value getlabelheight get_value labelheight intvalue set label width width of the label public void set label width int label width set value label width new integer label width setlabelwidth labelwidth set_value labelwidth labelwidth get label width width of the label public int get label width integer ii integer get value label width if ii null return 0 return ii int value getlabelwidth get_value labelwidth intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set printer name name of the printer public void set printer name string printer name if printer name null printer name length 40 log warning length 40 truncated printer name printer name substring 0 39 set value printer name printer name setprintername printername printername printername printername printername set_value printername printername get printer name name of the printer public string get printer name return string get value printer name getprintername get_value printername create dialog window for frame param frame param title param message param message type public a dialog dialog frame frame string title string message int message type super frame title frame null common message message type a env show center window frame this messagetype adialogdialog messagetype messagetype aenv showcenterwindow create dialog window for dialog param dialog param title param message param message type public a dialog dialog dialog dialog string title string message int message type super dialog title dialog null common message message type a env show center window dialog this messagetype adialogdialog messagetype messagetype aenv showcenterwindow common init param message param message type private void common string message int message type try set info message message jb init set info icon message type catch exception ex log log level severe a dialog dialog common ex get message default button this get root pane set default button confirm panel getok button messagetype messagetype setinfomessage jbinit setinfoicon messagetype adialogdialog getmessage getrootpane setdefaultbutton confirmpanel getokbutton window events request focus param e protected void process window event window event e super process window event e if e getid window event window opened confirm panel getok button request focus in window requestfocus processwindowevent windowevent processwindowevent windowevent window_opened confirmpanel getokbutton requestfocusinwindow static constructor throws exception private void jb init throws exception this setj menu bar menu bar me mail set icon env get image icon e mail support16 gif me mail set text msg get msg env get ctx e mail support me mail add action listener this m print screen set icon env get image icon print screen16 gif m print screen set text msg get msg env get ctx print screen m print screen set accelerator key stroke get key stroke key event vk printscreen 0 m print screen add action listener this m screen shot set icon env get image icon screen shot16 gif m screen shot set text msg get msg env get ctx screen shot m screen shot set accelerator key stroke get key stroke key event vk printscreen event shift mask m screen shot add action listener this m preference set icon env get image icon preference16 gif m preference set text msg get msg env get ctx preference m preference add action listener this m end set icon env get image icon end16 gif m end set text msg get msg env get ctx end m end set accelerator key stroke get key stroke key event vk x event alt mask m end add action listener this west panel set layout west layout west panel set name west panel west panel set request focus enabled false info panel set layout info layout info panel set name info panel info panel set request focus enabled false this get content pane add confirm panel border layout south this get content pane add west panel border layout west west panel add icon label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints both new insets 10 10 10 10 0 0 this get content pane add info panel border layout center info panel add info new grid bag constraints 0 1 1 1 1 0 1 0 grid bag constraints center grid bag constraints both new insets 10 10 10 10 0 0 menu bar add m file m file add m print screen m file add m screen shot m file add separator m file add me mail if m role get default is show preference m file add m preference m file add separator m file add m end confirm panel add action listener this jbinit setjmenubar menubar memail seticon getimageicon emailsupport16 memail settext getmsg getctx emailsupport memail addactionlistener mprintscreen seticon getimageicon printscreen16 mprintscreen settext getmsg getctx printscreen mprintscreen setaccelerator keystroke getkeystroke keyevent vk_printscreen mprintscreen addactionlistener mscreenshot seticon getimageicon screenshot16 mscreenshot settext getmsg getctx screenshot mscreenshot setaccelerator keystroke getkeystroke keyevent vk_printscreen shift_mask mscreenshot addactionlistener mpreference seticon getimageicon mpreference settext getmsg getctx mpreference addactionlistener mend seticon getimageicon mend settext getmsg getctx mend setaccelerator keystroke getkeystroke keyevent vk_x alt_mask mend addactionlistener westpanel setlayout westlayout westpanel setname westpanel westpanel setrequestfocusenabled infopanel setlayout infolayout infopanel setname infopanel infopanel setrequestfocusenabled getcontentpane confirmpanel borderlayout getcontentpane westpanel borderlayout westpanel iconlabel gridbagconstraints gridbagconstraints gridbagconstraints getcontentpane infopanel borderlayout infopanel gridbagconstraints gridbagconstraints gridbagconstraints menubar mfile mfile mprintscreen mfile mscreenshot mfile addseparator mfile memail mrole getdefault isshowpreference mfile mpreference mfile addseparator mfile mend confirmpanel addactionlistener calculate size param message message private void set info message string message string buffer sb new string buffer message length 20 sb append b char chars message to char array boolean first true int paras 0 for int i 0 i chars length i char c chars i if c n if first sb append b first false if paras 1 sb append br else sb append p paras else sb append c info set text sb to string dimension size info get preferred size size width 450 size height math max paras message length 60 1 30 size height math min size height 600 info set preferred size size log print para paras info get preferred size info set request focus enabled false info set read write false info set opaque false info set border null info set caret position 0 setinfomessage stringbuffer stringbuffer tochararray settext tostring getpreferredsize setpreferredsize getpreferredsize setrequestfocusenabled setreadwrite setopaque setborder setcaretposition set info param message type private void set info icon int message type confirm panel get cancel button set visible false switch message type case j option pane error message icon label set icon i error break case j option pane information message icon label set icon i inform break case j option pane question message confirm panel get cancel button set visible true icon label set icon i question break case j option pane warning message icon label set icon i warn break case j option pane plain message default break switch messagetype setinfoicon messagetype confirmpanel getcancelbutton setvisible messagetype joptionpane error_message iconlabel seticon i_error joptionpane information_message iconlabel seticon i_inform joptionpane question_message confirmpanel getcancelbutton setvisible iconlabel seticon i_question joptionpane warning_message iconlabel seticon i_warn joptionpane plain_message action listener param e public void action performed action event e log finest a dialog dialog action performed e if e get action command equals confirm panel a ok m returncode a ok dispose else if e get action command equals confirm panel a cancel e get source m end m returncode a cancel dispose else if e get source m print screen print screen else if e get source me mail string title get title string text info get text dispose otherwise locking a dialog create supporte mail this title text else if e get source m preference if m role get default is show preference preference p new preference null 0 p set visible true actionlistener actionperformed actionevent adialogdialog actionperformed getactioncommand confirmpanel a_ok m_returncode a_ok getactioncommand confirmpanel a_cancel getsource mend m_returncode a_cancel getsource mprintscreen printscreen getsource memail gettitle gettext adialog createsupportemail getsource mpreference mrole getdefault isshowpreference setvisible get return code return return code public int get return code return m returncode getreturncode m_returncode print screen private void print screen print screen painter print screen this printscreen printscreen printscreenpainter printscreen standard constructor public x c withholding acct properties ctx int c withholding acct id string trx name super ctx c withholding acct id trx name if c withholding acct id 0 setc acctschema id 0 setc withholding id 0 setwithholding acct 0 x_c_withholding_acct c_withholding_acct_id trxname c_withholding_acct_id trxname c_withholding_acct_id setc_acctschema_id setc_withholding_id setwithholding_acct load constructor public x c withholding acct properties ctx result set rs string trx name super ctx rs trx name x_c_withholding_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c withholding acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_withholding_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set withholding withholding type defined public void setc withholding id int c withholding id if c withholding id 1 throw new illegal argument exception c withholding id is mandatory set valuenocheck c withholding id new integer c withholding id setc_withholding_id c_withholding_id c_withholding_id illegalargumentexception c_withholding_id set_valuenocheck c_withholding_id c_withholding_id get withholding withholding type defined public int getc withholding id integer ii integer get value c withholding id if ii null return 0 return ii int value getc_withholding_id get_value c_withholding_id intvalue set withholding account for withholdings public void setwithholding acct int withholding acct set value withholding acct new integer withholding acct setwithholding_acct withholding_acct set_value withholding_acct withholding_acct get withholding account for withholdings public int getwithholding acct integer ii integer get value withholding acct if ii null return 0 return ii int value getwithholding_acct get_value withholding_acct intvalue basic constructor you need to set the attributes using the set methods public h3 use the set methods to set the values of the attributes param element set the value of lt h3 gt value lt h3 gt public h3 element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt h3 gt value lt h3 gt public h3 string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h3 add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public h3 add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h3 add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public h3 add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public h3 remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x ad table properties ctx int ad table id string trx name super ctx ad table id trx name if ad table id 0 setad table id 0 set access level null 4 set entity type null u set is change log false set is deleteable false set is high volume false set is security enabled false set is view false n set name null set replication type null l set table name null x_ad_table ad_table_id trxname ad_table_id trxname ad_table_id setad_table_id setaccesslevel setentitytype setischangelog setisdeleteable setishighvolume setissecurityenabled setisview setname setreplicationtype settablename load constructor public x ad table properties ctx result set rs string trx name super ctx rs trx name x_ad_table resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad table append get id append return sb to string tostring stringbuffer stringbuffer x_ad_table get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set dynamic validation dynamic validation rule public void setad val rule id int ad val rule id if ad val rule id 0 set value ad val rule id null else set value ad val rule id new integer ad val rule id setad_val_rule_id ad_val_rule_id ad_val_rule_id set_value ad_val_rule_id set_value ad_val_rule_id ad_val_rule_id get dynamic validation dynamic validation rule public int getad val rule id integer ii integer get value ad val rule id if ii null return 0 return ii int value getad_val_rule_id get_value ad_val_rule_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue public static final string accesslevel all 7 set data access level access level required public void set access level string access level if access level null throw new illegal argument exception access level is mandatory if access level equals 1 access level equals 2 access level equals 3 access level equals 4 access level equals 6 access level equals 7 else throw new illegal argument exception access level invalid value access level reference id 5 1 2 3 4 6 7 if access level length 1 log warning length 1 truncated access level access level substring 0 0 set value access level access level accesslevel_all setaccesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel reference_id accesslevel accesslevel accesslevel set_value accesslevel accesslevel get data access level access level required public string get access level return string get value access level getaccesslevel get_value accesslevel set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set import table import table columns from database public void set import table string import table if import table null import table length 1 log warning length 1 truncated import table import table substring 0 0 set value import table import table setimporttable importtable importtable importtable importtable importtable set_value importtable importtable get import table import table columns from database public string get import table return string get value import table getimporttable get_value importtable set maintain change log maintain a log of changes public void set is change log boolean is change log set value is change log new boolean is change log setischangelog ischangelog set_value ischangelog ischangelog get maintain change log maintain a log of changes public boolean is change log object oo get value is change log if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ischangelog get_value ischangelog booleanvalue set records deleteable indicates if records can be deleted from the database public void set is deleteable boolean is deleteable set value is deleteable new boolean is deleteable setisdeleteable isdeleteable set_value isdeleteable isdeleteable get records deleteable indicates if records can be deleted from the database public boolean is deleteable object oo get value is deleteable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdeleteable get_value isdeleteable booleanvalue set high volume use search instead of pick list public void set is high volume boolean is high volume set value is high volume new boolean is high volume setishighvolume ishighvolume set_value ishighvolume ishighvolume get high volume use search instead of pick list public boolean is high volume object oo get value is high volume if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishighvolume get_value ishighvolume booleanvalue set security enabled if security is enabled user access to data can be restricted via roles public void set is security enabled boolean is security enabled set value is security enabled new boolean is security enabled setissecurityenabled issecurityenabled set_value issecurityenabled issecurityenabled get security enabled if security is enabled user access to data can be restricted via roles public boolean is security enabled object oo get value is security enabled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issecurityenabled get_value issecurityenabled booleanvalue set view this is a view public void set is view boolean is view set value is view new boolean is view setisview isview set_value isview isview get view this is a view public boolean is view object oo get value is view if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isview get_value isview booleanvalue set sequence public void set load seq int load seq set valuenocheck load seq new integer load seq setloadseq loadseq set_valuenocheck loadseq loadseq get sequence public int get load seq integer ii integer get value load seq if ii null return 0 return ii int value getloadseq get_value loadseq intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value public static final int po window id ad reference id 284 set po window purchase order window public void setpo window id int po window id if po window id 0 set value po window id null else set value po window id new integer po window id po_window_id_ad_reference_id setpo_window_id po_window_id po_window_id set_value po_window_id set_value po_window_id po_window_id get po window purchase order window public int getpo window id integer ii integer get value po window id if ii null return 0 return ii int value getpo_window_id get_value po_window_id intvalue public static final string replicationtype reference r set replication type type of data replication public void set replication type string replication type if replication type null throw new illegal argument exception replication type is mandatory if replication type equals l replication type equals m replication type equals r else throw new illegal argument exception replication type invalid value replication type reference id 126 l m r if replication type length 1 log warning length 1 truncated replication type replication type substring 0 0 set value replication type replication type replicationtype_reference setreplicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype reference_id replicationtype replicationtype replicationtype set_value replicationtype replicationtype get replication type type of data replication public string get replication type return string get value replication type getreplicationtype get_value replicationtype set db table name name of the table in the database public void set table name string table name if table name null throw new illegal argument exception table name is mandatory if table name length 40 log warning length 40 truncated table name table name substring 0 39 set value table name table name settablename tablename tablename illegalargumentexception tablename tablename tablename tablename set_value tablename tablename get db table name name of the table in the database public string get table name return string get value table name gettablename get_value tablename return string get value table name public key name pair get key name pair return new key name pair get id get table name get_value tablename keynamepair getkeynamepair keynamepair get_id gettablename default constructor use set methods public ins set the url that designates a source doument or message param url set the url that designates a source document or message public ins set cite string url add attribute cite url return this setcite addattribute sets the date and time the change was made param datetime the date and time the change was made public ins set date time string datetime add attribute datetime datetime return this setdatetime addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ins add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ins add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public ins add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public ins add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public ins remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute query p instance for result fill summary and success in process info param pi process info public static void set summary fromdb process info pi s log fine set summary fromdb ad pinstance id pi getad pinstance id int sleep time 2000 2 secomds int no retry 5 10 seconds total string sql select result error msg from ad pinstance where ad pinstance id and result is not null try prepared statement pstmt db prepare statement sql result set type forward only result set concur read only null for int no try 0 no try no retry no try pstmt set int 1 pi getad pinstance id result set rs pstmt execute query if rs next we have a result int i rs get int 1 if i 1 pi set summary msg get msg env get ctx success else pi set summary msg get msg env get ctx failure true string message rs get string 2 rs close pstmt close if message null pi add summary msg parse translation env get ctx message s log fine set summary fromdb message return rs close sleep try s log fine sleeping thread sleep sleep time catch interrupted exception ie s log log level severe sleep thread ie pstmt close catch sql exception e s log log level severe sql e pi set summary e get localized message true return pi set summary msg get msg env get ctx timeout true pinstance processinfo setsummaryfromdb processinfo s_log setsummaryfromdb ad_pinstance_id getad_pinstance_id sleeptime noretry errormsg ad_pinstance ad_pinstance_id preparedstatement preparestatement resultset type_forward_only resultset concur_read_only notry notry noretry notry setint getad_pinstance_id resultset executequery getint setsummary getmsg getctx setsummary getmsg getctx getstring addsummary parsetranslation getctx s_log setsummaryfromdb s_log sleeptime interruptedexception s_log sqlexception s_log setsummary getlocalizedmessage setsummary getmsg getctx set log of process param pi process info public static void set log fromdb process info pi s log fine set log fromdb ad pinstance id pi getad pinstance id string sql select log id p id p date p number p msg from ad pinstance log where ad pinstance id order by log id try prepared statement pstmt db prepare statement sql null pstmt set int 1 pi getad pinstance id result set rs pstmt execute query while rs next int log id int p id timestamp p date big decimal p number string p msg pi add log rs get int 1 rs get int 2 rs get timestamp 3 rs get big decimal 4 rs get string 5 rs close pstmt close catch sql exception e s log log level severe set log fromdb e setlogfromdb processinfo s_log setlogfromdb ad_pinstance_id getad_pinstance_id log_id p_id p_date p_number p_msg ad_pinstance_log ad_pinstance_id log_id preparedstatement preparestatement setint getad_pinstance_id resultset executequery log_id p_id p_date bigdecimal p_number p_msg addlog getint getint gettimestamp getbigdecimal getstring sqlexception s_log setlogfromdb create process log param pi process info public static void save log todb process info pi process info log logs pi get logs if logs null logs length 0 s log fine save log todb no log return if pi getad pinstance id 0 s log log level warning save log todb not saved ad pinstance id 0 return for int i 0 i logs length i string buffer sql new string buffer insert into ad pinstance log ad pinstance id log id p date p id p number p msg values sql append pi getad pinstance id append append logs i getlog id append if logs i getp date null sql append null else sql append db to date logs i getp date false append if logs i getp id 0 sql append null else sql append logs i getp id append if logs i getp number null sql append null else sql append logs i getp number append if logs i getp msg null sql append null else sql append db to string logs i getp msg 2000 append db execute update sql to string null pi set log list null otherwise log entries are twice savelogtodb processinfo processinfolog getlogs s_log savelogtodb getad_pinstance_id s_log savelogtodb ad_pinstance_id stringbuffer stringbuffer ad_pinstance_log ad_pinstance_id log_id p_date p_id p_number p_msg getad_pinstance_id getlog_id getp_date to_date getp_date getp_id getp_id getp_number getp_number getp_msg to_string getp_msg executeupdate tostring setloglist set parameter of process and client user param pi process info public static void set parameter fromdb process info pi array list process info parameter list new array list process info parameter string sql select p parameter name 1 p p string p p string to p p number p p number to 2 3 4 5 p p date p p date to p info p info to 6 7 8 9 i ad client id i ad org id i ad user id 10 12 from ad pinstance para p inner join ad pinstance i on p ad pinstance id i ad pinstance id where p ad pinstance id order by p seq no try prepared statement pstmt db prepare statement sql null pstmt set int 1 pi getad pinstance id result set rs pstmt execute query while rs next string parameter name rs get string 1 string object parameter rs get string 2 object parameter to rs get string 3 big decimal if parameter null parameter to null parameter rs get big decimal 4 parameter to rs get big decimal 5 timestamp if parameter null parameter to null parameter rs get timestamp 6 parameter to rs get timestamp 7 info string info rs get string 8 string info to rs get string 9 list add new process info parameter parameter name parameter parameter to info info to if pi getad client id null pi setad client id rs get int 10 if pi getad user id null pi setad user id rs get int 12 rs close pstmt close catch sql exception e s log log level severe sql e process info parameter pars new process info parameter list size list to array pars pi set parameter pars setparameterfromdb processinfo arraylist processinfoparameter arraylist processinfoparameter parametername p_string p_string_to p_number p_number_to p_date p_date_to info_to ad_client_id ad_org_id ad_user_id ad_pinstance_para ad_pinstance ad_pinstance_id ad_pinstance_id ad_pinstance_id seqno preparedstatement preparestatement setint getad_pinstance_id resultset executequery parametername getstring getstring parameter_to getstring parameter_to getbigdecimal parameter_to getbigdecimal parameter_to gettimestamp parameter_to gettimestamp getstring info_to getstring processinfoparameter parametername parameter_to info_to getad_client_id setad_client_id getint getad_user_id setad_user_id getint sqlexception s_log processinfoparameter processinfoparameter toarray setparameter prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue perform process return message text with variables throws exception if not successful protected string do it throws exception log info do it c bpartner id p c bpartner id if p c bpartner id 0 throw new illegal argument exception no business partner id mb partner bp new mb partner get ctx p c bpartner id get trxname if bp get id 0 throw new illegal argument exception business partner not found c bpartner id p c bpartner id if bp getad orgbp id int 0 throw new illegal argument exception business partner not linked to an organization bp setad orgbp id null if bp save throw new illegal argument exception business partner not changed return ok doit doit c_bpartner_id p_c_bpartner_id p_c_bpartner_id illegalargumentexception mbpartner mbpartner getctx p_c_bpartner_id get_trxname get_id illegalargumentexception c_bpartner_id p_c_bpartner_id getad_orgbp_id_int illegalargumentexception setad_orgbp_id illegalargumentexception prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name m c project id getrecord id processinfoparameter getparameter getparametername getparameter m_c_project_id getrecord_id perrform process return message translated text throws exception if not successful protected string do it throws exception m project project new m project get ctx m c project id get trxname log info do it project m project line project lines project get lines if m project projectcategory workorderjob equals project get project category m project projectcategory assetproject equals project get project category todo check if we should close it close lines for int line 0 line project lines length line project lines line set processed true project lines line save project set processed true project save return doit mproject mproject getctx m_c_project_id get_trxname doit mprojectline projectlines getlines mproject projectcategory_workorderjob getprojectcategory mproject projectcategory_assetproject getprojectcategory projectlines projectlines setprocessed projectlines setprocessed scheduler param model model public scheduler m scheduler model super model 240 nap m model model m client m client get model get ctx model getad client id mscheduler m_model m_client mclient getctx getad_client_id work protected void do work m summary new string buffer not implemented yet int no m model delete log m summary append logs deleted append no m scheduler log p log new m scheduler log m model m summary to string p log set reference string value of p runcount time util format elapsed new timestamp p startwork p log save dowork m_summary stringbuffer m_model deletelog m_summary mschedulerlog plog mschedulerlog m_model m_summary tostring plog setreference valueof p_runcount timeutil formatelapsed p_startwork plog get server info return info public string get server info return p runcount last m summary to string getserverinfo p_runcount m_summary tostring prepare protected void prepare p ad tab id getrecord id p_ad_tab_id getrecord_id process return info throws exception protected string do it throws exception m tab tab new m tab get ctx p ad tab id get trxname if p ad tab id 0 tab null tab get id 0 throw new compiere system error not found ad tab id p ad tab id log info tab to string int count 0 string sql select from ad column c where not exists select from ad field f where c ad column id f ad column id and c ad table id 1 and f ad tab id 2 and ad table id 3 and not name like created or name like updated and is active y order by name prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 tab getad table id pstmt set int 2 tab getad tab id pstmt set int 3 tab getad table id result set rs pstmt execute query while rs next m column column new m column get ctx rs get trxname m field field new m field tab field set column column if column is key field set is displayed false if field save add log 0 null null column get name count rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return created count doit m_tab m_tab getctx p_ad_tab_id get_trxname p_ad_tab_id get_id compieresystemerror notfound ad_tab_id p_ad_tab_id tostring ad_column ad_field ad_column_id ad_column_id ad_table_id ad_tab_id ad_table_id isactive preparedstatement preparestatement get_trxname setint getad_table_id setint getad_tab_id setint getad_table_id resultset executequery m_column m_column getctx get_trxname m_field m_field setcolumn iskey setisdisplayed addlog getname basic constructor use set value if needed public li setvalue sets the value after the lt li gt tag param value the value after the lt li gt tag public li string value add element value addelement sets the value after the lt li gt tag param element the value after the lt li gt tag public li element element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public li add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public li add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry mechanism for taking a list of strings and creating a list of li objects param element list of strings that need to be li objects public li add element string element li li new li element length for int x 0 x element length x li x new li element x return li addelement adds an element to the element param element adds an element to the element public li add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public li add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public li remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute financial report constructor public fin balance super log info finbalance prepare e g get parameters protected void prepare parameter process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p c acctschema id big decimal para i get parameter int value else if name equals is recreate p isrecreate y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_acctschema_id p_c_acctschema_id bigdecimal getparameter intvalue isrecreate p_isrecreate getparameter perform process return message to be translated throws exception protected string do it throws java lang exception log fine c acctschema id p c acctschema id is recreate p isrecreate if p c acctschema id 0 update balance p c acctschema id p isrecreate else update balance client get ctx getad client id p isrecreate return doit c_acctschema_id p_c_acctschema_id isrecreate p_isrecreate p_c_acctschema_id updatebalance p_c_acctschema_id p_isrecreate updatebalanceclient getctx getad_client_id p_isrecreate delete balances param c acctschema id accounting schema 0 for all return message to be translated public static string delete balance int c acctschema id string buffer sql new string buffer delete from fact acct balance where if c acctschema id 0 sql append c acctschema id append c acctschema id int no db execute update sql to string null out of trx string msg deleted no s log fine c acctschema id c acctschema id no return msg c_acctschema_id deletebalance c_acctschema_id stringbuffer stringbuffer fact_acct_balance c_acctschema_id c_acctschema_id c_acctschema_id executeupdate tostring s_log c_acctschema_id c_acctschema_id update create balances called from fin report fact acct reset indirect param c acctschema id accounting schema param delete first delete all balances first return message to be translated public static string update balance int c acctschema id boolean delete first s log info c acctschema id c acctschema id delete first delete first long start system current time millis if delete first int no db execute update delete fact acct balance where c acctschema id c acctschema id null s log fine deleted no update existing string sql update fact acct balance ab set amt acct dr amt acct cr qty select coalesce sum amt acct dr 0 coalesce sum amt acct cr 0 coalesce sum qty 0 from fact acct a where a ad client id ab ad client id and a ad org id ab ad org id and a c acctschema id ab c acctschema id and trunc a date acct trunc ab date acct and a account id ab account id and a posting type ab posting type and coalesce a m product id 0 coalesce ab m product id 0 and coalesce a c bpartner id 0 coalesce ab c bpartner id 0 and coalesce a c project id 0 coalesce ab c project id 0 and coalesce a ad orgtrx id 0 coalesce ab ad orgtrx id 0 and coalesce a c salesregion id 0 coalesce ab c salesregion id 0 and coalesce a c activity id 0 coalesce ab c activity id 0 and coalesce a c campaign id 0 coalesce ab c campaign id 0 and coalesce a c locto id 0 coalesce ab c locto id 0 and coalesce a c locfrom id 0 coalesce ab c locfrom id 0 and coalesce a user1 id 0 coalesce ab user1 id 0 and coalesce a user2 id 0 coalesce ab user2 id 0 and coalesce a gl budget id 0 coalesce ab gl budget id 0 group by ad client id ad org id c acctschema id trunc date acct account id posting type m product id c bpartner id c project id ad orgtrx id c salesregion id c activity id c campaign id c locto id c locfrom id user1 id user2 id gl budget id where c acctschema id c acctschema id and exists select from fact acct a where a ad client id ab ad client id and a ad org id ab ad org id and a c acctschema id ab c acctschema id and trunc a date acct trunc ab date acct and a account id ab account id and a posting type ab posting type and coalesce a m product id 0 coalesce ab m product id 0 and coalesce a c bpartner id 0 coalesce ab c bpartner id 0 and coalesce a c project id 0 coalesce ab c project id 0 and coalesce a ad orgtrx id 0 coalesce ab ad orgtrx id 0 and coalesce a c salesregion id 0 coalesce ab c salesregion id 0 and coalesce a c activity id 0 coalesce ab c activity id 0 and coalesce a c campaign id 0 coalesce ab c campaign id 0 and coalesce a c locto id 0 coalesce ab c locto id 0 and coalesce a c locfrom id 0 coalesce ab c locfrom id 0 and coalesce a user1 id 0 coalesce ab user1 id 0 and coalesce a user2 id 0 coalesce ab user2 id 0 and coalesce a gl budget id 0 coalesce ab gl budget id 0 group by ad client id ad org id c acctschema id trunc date acct account id posting type m product id c bpartner id c project id ad orgtrx id c salesregion id c activity id c campaign id c locto id c locfrom id user1 id user2 id gl budget id if delete first int no db execute update sql null s log fine updates no insert sql insert into fact acct balance ab ad client id ad org id c acctschema id date acct account id posting type m product id c bpartner id c project id ad orgtrx id c salesregion id c activity id c campaign id c locto id c locfrom id user1 id user2 id gl budget id amt acct dr amt acct cr qty select ad client id ad org id c acctschema id trunc date acct account id posting type m product id c bpartner id c project id ad orgtrx id c salesregion id c activity id c campaign id c locto id c locfrom id user1 id user2 id gl budget id coalesce sum amt acct dr 0 coalesce sum amt acct cr 0 coalesce sum qty 0 from fact acct a where c acctschema id c acctschema id if delete first sql and not exists select from fact acct balance x where a ad client id x ad client id and a ad org id x ad org id and a c acctschema id x c acctschema id and trunc a date acct trunc x date acct and a account id x account id and a posting type x posting type and coalesce a m product id 0 coalesce x m product id 0 and coalesce a c bpartner id 0 coalesce x c bpartner id 0 and coalesce a c project id 0 coalesce x c project id 0 and coalesce a ad orgtrx id 0 coalesce x ad orgtrx id 0 and coalesce a c salesregion id 0 coalesce x c salesregion id 0 and coalesce a c activity id 0 coalesce x c activity id 0 and coalesce a c campaign id 0 coalesce x c campaign id 0 and coalesce a c locto id 0 coalesce x c locto id 0 and coalesce a c locfrom id 0 coalesce x c locfrom id 0 and coalesce a user1 id 0 coalesce x user1 id 0 and coalesce a user2 id 0 coalesce x user2 id 0 and coalesce a gl budget id 0 coalesce x gl budget id 0 sql group by ad client id ad org id c acctschema id trunc date acct account id posting type m product id c bpartner id c project id ad orgtrx id c salesregion id c activity id c campaign id c locto id c locfrom id user1 id user2 id gl budget id int no db execute update sql null s log fine inserts no start system current time millis start s log info start 1000 sec return finreport factacctreset c_acctschema_id deletefirst updatebalance c_acctschema_id deletefirst s_log c_acctschema_id c_acctschema_id deletefirst deletefirst currenttimemillis deletefirst executeupdate fact_acct_balance c_acctschema_id c_acctschema_id s_log fact_acct_balance amtacctdr amtacctcr amtacctdr amtacctcr fact_acct ad_client_id ad_client_id ad_org_id ad_org_id c_acctschema_id c_acctschema_id dateacct dateacct account_id account_id postingtype postingtype m_product_id m_product_id c_bpartner_id c_bpartner_id c_project_id c_project_id ad_orgtrx_id ad_orgtrx_id c_salesregion_id c_salesregion_id c_activity_id c_activity_id c_campaign_id c_campaign_id c_locto_id c_locto_id c_locfrom_id c_locfrom_id user1_id user1_id user2_id user2_id gl_budget_id gl_budget_id ad_client_id ad_org_id c_acctschema_id dateacct account_id postingtype m_product_id c_bpartner_id c_project_id ad_orgtrx_id c_salesregion_id c_activity_id c_campaign_id c_locto_id c_locfrom_id user1_id user2_id gl_budget_id c_acctschema_id c_acctschema_id fact_acct ad_client_id ad_client_id ad_org_id ad_org_id c_acctschema_id c_acctschema_id dateacct dateacct account_id account_id postingtype postingtype m_product_id m_product_id c_bpartner_id c_bpartner_id c_project_id c_project_id ad_orgtrx_id ad_orgtrx_id c_salesregion_id c_salesregion_id c_activity_id c_activity_id c_campaign_id c_campaign_id c_locto_id c_locto_id c_locfrom_id c_locfrom_id user1_id user1_id user2_id user2_id gl_budget_id gl_budget_id ad_client_id ad_org_id c_acctschema_id dateacct account_id postingtype m_product_id c_bpartner_id c_project_id ad_orgtrx_id c_salesregion_id c_activity_id c_campaign_id c_locto_id c_locfrom_id user1_id user2_id gl_budget_id deletefirst executeupdate s_log fact_acct_balance ad_client_id ad_org_id c_acctschema_id dateacct account_id postingtype m_product_id c_bpartner_id c_project_id ad_orgtrx_id c_salesregion_id c_activity_id c_campaign_id c_locto_id c_locfrom_id user1_id user2_id gl_budget_id amtacctdr amtacctcr ad_client_id ad_org_id c_acctschema_id dateacct account_id postingtype m_product_id c_bpartner_id c_project_id ad_orgtrx_id c_salesregion_id c_activity_id c_campaign_id c_locto_id c_locfrom_id user1_id user2_id gl_budget_id amtacctdr amtacctcr fact_acct c_acctschema_id c_acctschema_id deletefirst fact_acct_balance ad_client_id ad_client_id ad_org_id ad_org_id c_acctschema_id c_acctschema_id dateacct dateacct account_id account_id postingtype postingtype m_product_id m_product_id c_bpartner_id c_bpartner_id c_project_id c_project_id ad_orgtrx_id ad_orgtrx_id c_salesregion_id c_salesregion_id c_activity_id c_activity_id c_campaign_id c_campaign_id c_locto_id c_locto_id c_locfrom_id c_locfrom_id user1_id user1_id user2_id user2_id gl_budget_id gl_budget_id ad_client_id ad_org_id c_acctschema_id dateacct account_id postingtype m_product_id c_bpartner_id c_project_id ad_orgtrx_id c_salesregion_id c_activity_id c_campaign_id c_locto_id c_locfrom_id user1_id user2_id gl_budget_id executeupdate s_log currenttimemillis s_log update balance of client param ctx context param ad client id client param delete first delete first return error or public static string update balance client properties ctx int ad client id boolean delete first m acct schema ass m acct schema get client acct schema ctx ad client id for int i 0 i ass length i update balance ass i getc acctschema id delete first return ad_client_id deletefirst updatebalanceclient ad_client_id deletefirst macctschema macctschema getclientacctschema ad_client_id updatebalance getc_acctschema_id deletefirst test param args ignored public static void main string args fin balance fin balance1 new fin balance finbalance finbalance1 finbalance public tfoot sets the span attribute param span sets the span attribute public tfoot set span string span add attribute span span return this setspan addattribute sets the span attribute param span sets the span attribute public tfoot set span int span add attribute span integer to string span return this setspan addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public tfoot set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public tfoot set width string width add attribute width width return this setwidth addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public tfoot set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public tfoot setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public tfoot set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tfoot set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tfoot set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tfoot add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tfoot add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tfoot add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tfoot add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public tfoot remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x r requestupdates properties ctx int r requestupdates id string trx name super ctx r requestupdates id trx name if r requestupdates id 0 setad user id 0 set is self service false setr request id 0 x_r_requestupdates r_requestupdates_id trxname r_requestupdates_id trxname r_requestupdates_id setad_user_id setisselfservice setr_request_id load constructor public x r requestupdates properties ctx result set rs string trx name super ctx rs trx name x_r_requestupdates resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestupdates append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestupdates get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set request request from a business partner or prospect public void setr request id int r request id if r request id 1 throw new illegal argument exception r request id is mandatory set valuenocheck r request id new integer r request id setr_request_id r_request_id r_request_id illegalargumentexception r_request_id set_valuenocheck r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue standard constructor public x c doctype properties ctx int c doctype id string trx name super ctx c doctype id trx name if c doctype id 0 setc doctype id 0 set doc base type null set document copies 0 1 setgl category id 0 set has charges false set is create counter true y set is default false set is default counter doc false set is doc no controlled true y set is in transit false set is pickqa confirm false set isso trx false set is ship confirm false set is split when difference false n set name null set print name null x_c_doctype c_doctype_id trxname c_doctype_id trxname c_doctype_id setc_doctype_id setdocbasetype setdocumentcopies setgl_category_id sethascharges setiscreatecounter setisdefault setisdefaultcounterdoc setisdocnocontrolled setisintransit setispickqaconfirm setissotrx setisshipconfirm setissplitwhendifference setname setprintname load constructor public x c doctype properties ctx result set rs string trx name super ctx rs trx name x_c_doctype resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c doctype append get id append return sb to string tostring stringbuffer stringbuffer x_c_doctype get_id tostring set print format data print format public void setad printformat id int ad printformat id if ad printformat id 0 set value ad printformat id null else set value ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id set_value ad_printformat_id set_value ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue public static final int c doctypedifference id ad reference id 170 set difference document document type for generating in dispute shipments public void setc doctypedifference id int c doctypedifference id if c doctypedifference id 0 set value c doctypedifference id null else set value c doctypedifference id new integer c doctypedifference id c_doctypedifference_id_ad_reference_id setc_doctypedifference_id c_doctypedifference_id c_doctypedifference_id set_value c_doctypedifference_id set_value c_doctypedifference_id c_doctypedifference_id get difference document document type for generating in dispute shipments public int getc doctypedifference id integer ii integer get value c doctypedifference id if ii null return 0 return ii int value getc_doctypedifference_id get_value c_doctypedifference_id intvalue public static final int c doctypeinvoice id ad reference id 170 set document type for invoice document type used for invoices generated from this sales document public void setc doctypeinvoice id int c doctypeinvoice id if c doctypeinvoice id 0 set value c doctypeinvoice id null else set value c doctypeinvoice id new integer c doctypeinvoice id c_doctypeinvoice_id_ad_reference_id setc_doctypeinvoice_id c_doctypeinvoice_id c_doctypeinvoice_id set_value c_doctypeinvoice_id set_value c_doctypeinvoice_id c_doctypeinvoice_id get document type for invoice document type used for invoices generated from this sales document public int getc doctypeinvoice id integer ii integer get value c doctypeinvoice id if ii null return 0 return ii int value getc_doctypeinvoice_id get_value c_doctypeinvoice_id intvalue public static final int c doctypeproforma id ad reference id 170 set document type for pro forma document type used for pro forma invoices generated from this sales document public void setc doctypeproforma id int c doctypeproforma id if c doctypeproforma id 0 set value c doctypeproforma id null else set value c doctypeproforma id new integer c doctypeproforma id c_doctypeproforma_id_ad_reference_id proforma setc_doctypeproforma_id c_doctypeproforma_id c_doctypeproforma_id set_value c_doctypeproforma_id set_value c_doctypeproforma_id c_doctypeproforma_id get document type for pro forma document type used for pro forma invoices generated from this sales document public int getc doctypeproforma id integer ii integer get value c doctypeproforma id if ii null return 0 return ii int value proforma getc_doctypeproforma_id get_value c_doctypeproforma_id intvalue public static final int c doctypeshipment id ad reference id 170 set document type for shipment document type used for shipments generated from this sales document public void setc doctypeshipment id int c doctypeshipment id if c doctypeshipment id 0 set value c doctypeshipment id null else set value c doctypeshipment id new integer c doctypeshipment id c_doctypeshipment_id_ad_reference_id setc_doctypeshipment_id c_doctypeshipment_id c_doctypeshipment_id set_value c_doctypeshipment_id set_value c_doctypeshipment_id c_doctypeshipment_id get document type for shipment document type used for shipments generated from this sales document public int getc doctypeshipment id integer ii integer get value c doctypeshipment id if ii null return 0 return ii int value getc_doctypeshipment_id get_value c_doctypeshipment_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set valuenocheck c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_valuenocheck c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docbasetype salesorder soo set document base type logical type of document public void set doc base type string doc base type if doc base type null throw new illegal argument exception doc base type is mandatory if doc base type equals apc doc base type equals api doc base type equals app doc base type equals arc doc base type equals arf doc base type equals ari doc base type equals arr doc base type equals cma doc base type equals cmb doc base type equals cmc doc base type equals gld doc base type equals glj doc base type equals mmi doc base type equals mmm doc base type equals mmp doc base type equals mmr doc base type equals mms doc base type equals mxi doc base type equals mxp doc base type equals pji doc base type equals poo doc base type equals por doc base type equals soo else throw new illegal argument exception doc base type invalid value doc base type reference id 183 apc api app arc arf ari arr cma cmb cmc gld glj mmi mmm mmp mmr mms mxi mxp pji poo por soo if doc base type length 3 log warning length 3 truncated doc base type doc base type substring 0 2 set value doc base type doc base type docbasetype_salesorder basetype setdocbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype reference_id docbasetype docbasetype docbasetype set_value docbasetype docbasetype get document base type logical type of document public string get doc base type return string get value doc base type basetype getdocbasetype get_value docbasetype public static final int docnosequence id ad reference id 128 set document sequence document sequence determines the numbering of documents public void setdocnosequence id int docnosequence id if docnosequence id 0 set value docnosequence id null else set value docnosequence id new integer docnosequence id docnosequence_id_ad_reference_id setdocnosequence_id docnosequence_id docnosequence_id set_value docnosequence_id set_value docnosequence_id docnosequence_id get document sequence document sequence determines the numbering of documents public int getdocnosequence id integer ii integer get value docnosequence id if ii null return 0 return ii int value getdocnosequence_id get_value docnosequence_id intvalue public static final string docsubtypeso posorder wr set so sub type sales order sub type public void set doc sub typeso string doc sub typeso if doc sub typeso null throw new illegal argument exception doc sub typeso is mandatory if doc sub typeso null doc sub typeso equals ob doc sub typeso equals on doc sub typeso equals pr doc sub typeso equals rm doc sub typeso equals so doc sub typeso equals wi doc sub typeso equals wp doc sub typeso equals wr else throw new illegal argument exception doc sub typeso invalid value doc sub typeso reference id 148 ob on pr rm so wi wp wr if doc sub typeso null doc sub typeso length 2 log warning length 2 truncated doc sub typeso doc sub typeso substring 0 1 set value doc sub typeso doc sub typeso docsubtypeso_posorder setdocsubtypeso docsubtypeso docsubtypeso illegalargumentexception docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso docsubtypeso illegalargumentexception docsubtypeso docsubtypeso reference_id docsubtypeso docsubtypeso docsubtypeso docsubtypeso set_value docsubtypeso docsubtypeso get so sub type sales order sub type public string get doc sub typeso return string get value doc sub typeso getdocsubtypeso get_value docsubtypeso set document copies number of copies to be printed public void set document copies int document copies set value document copies new integer document copies setdocumentcopies documentcopies set_value documentcopies documentcopies get document copies number of copies to be printed public int get document copies integer ii integer get value document copies if ii null return 0 return ii int value getdocumentcopies get_value documentcopies intvalue set document note additional information for a document public void set document note string document note if document note null document note length 2000 log warning length 2000 truncated document note document note substring 0 1999 set value document note document note setdocumentnote documentnote documentnote documentnote documentnote documentnote set_value documentnote documentnote get document note additional information for a document public string get document note return string get value document note getdocumentnote get_value documentnote set gl category general ledger category public void setgl category id int gl category id if gl category id 1 throw new illegal argument exception gl category id is mandatory set value gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id illegalargumentexception gl_category_id set_value gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set charges charges can be added to the document public void set has charges boolean has charges set value has charges new boolean has charges sethascharges hascharges set_value hascharges hascharges get charges charges can be added to the document public boolean is has charges object oo get value has charges if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishascharges get_value hascharges booleanvalue set pro forma invoice indicates if pro forma invoices can be generated from this document public void set has proforma boolean has proforma set value has proforma new boolean has proforma sethasproforma hasproforma set_value hasproforma hasproforma get pro forma invoice indicates if pro forma invoices can be generated from this document public boolean is has proforma object oo get value has proforma if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishasproforma get_value hasproforma booleanvalue set create counter document create counter document public void set is create counter boolean is create counter set value is create counter new boolean is create counter setiscreatecounter iscreatecounter set_value iscreatecounter iscreatecounter get create counter document create counter document public boolean is create counter object oo get value is create counter if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatecounter get_value iscreatecounter booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set default counter document the document type is the default counter document type public void set is default counter doc boolean is default counter doc set value is default counter doc new boolean is default counter doc setisdefaultcounterdoc isdefaultcounterdoc set_value isdefaultcounterdoc isdefaultcounterdoc get default counter document the document type is the default counter document type public boolean is default counter doc object oo get value is default counter doc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefaultcounterdoc get_value isdefaultcounterdoc booleanvalue set document is number controlled the document has a document sequence public void set is doc no controlled boolean is doc no controlled set value is doc no controlled new boolean is doc no controlled setisdocnocontrolled isdocnocontrolled set_value isdocnocontrolled isdocnocontrolled get document is number controlled the document has a document sequence public boolean is doc no controlled object oo get value is doc no controlled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdocnocontrolled get_value isdocnocontrolled booleanvalue set in transit movement is in transit public void set is in transit boolean is in transit set value is in transit new boolean is in transit setisintransit isintransit set_value isintransit isintransit get in transit movement is in transit public boolean is in transit object oo get value is in transit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isintransit get_value isintransit booleanvalue set pick qa confirmation require pick or qa confirmation before processing public void set is pickqa confirm boolean is pickqa confirm set value is pickqa confirm new boolean is pickqa confirm setispickqaconfirm ispickqaconfirm set_value ispickqaconfirm ispickqaconfirm get pick qa confirmation require pick or qa confirmation before processing public boolean is pickqa confirm object oo get value is pickqa confirm if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispickqaconfirm get_value ispickqaconfirm booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set ship receipt confirmation require ship or receipt confirmation before processing public void set is ship confirm boolean is ship confirm set value is ship confirm new boolean is ship confirm setisshipconfirm isshipconfirm set_value isshipconfirm isshipconfirm get ship receipt confirmation require ship or receipt confirmation before processing public boolean is ship confirm object oo get value is ship confirm if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isshipconfirm get_value isshipconfirm booleanvalue set split when difference split document when there is a difference public void set is split when difference boolean is split when difference set value is split when difference new boolean is split when difference setissplitwhendifference issplitwhendifference set_value issplitwhendifference issplitwhendifference get split when difference split document when there is a difference public boolean is split when difference object oo get value is split when difference if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issplitwhendifference get_value issplitwhendifference booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set print text the label text to be printed on a document or correspondence public void set print name string print name if print name null throw new illegal argument exception print name is mandatory if print name length 60 log warning length 60 truncated print name print name substring 0 59 set value print name print name setprintname printname printname illegalargumentexception printname printname printname printname set_value printname printname get print text the label text to be printed on a document or correspondence public string get print name return string get value print name getprintname get_value printname no parameters nop see org compiere process svr process prepare protected void prepare svrprocess execute process see org compiere process svr process do it return info throws exception protected string do it throws exception create document types get ctx getad client id this get trxname create period controls get ctx getad client id this get trxname return ok svrprocess doit doit createdocumenttypes getctx getad_client_id get_trxname createperiodcontrols getctx getad_client_id get_trxname create missing document types param ctx context param ad client id client param sp server process public static void create document types properties ctx int ad client id svr process sp string trx name s log info ad client id ad client id string sql select rl value rl name from ad ref list rl where rl ad reference id 183 and rl is active y and not exists select from c doctype dt where dt ad client id and rl value dt doc base type prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad client id result set rs pstmt execute query while rs next string name rs get string 2 string value rs get string 1 s log config name value m doc type dt new m doc type ctx value name trx name if dt save if sp null sp add log 0 null null name else s log fine name else if sp null sp add log 0 null null not created name else s log warning not created name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null ad_client_id createdocumenttypes ad_client_id svrprocess trxname s_log ad_client_id ad_client_id ad_ref_list ad_reference_id isactive c_doctype ad_client_id docbasetype preparedstatement preparestatement trxname setint ad_client_id resultset executequery getstring getstring s_log mdoctype mdoctype trxname addlog s_log addlog s_log s_log create period controls param ctx context param ad client id client param sp server process public static void create period controls properties ctx int ad client id svr process sp string trx name s log info ad client id ad client id string sql select p ad client id p c period id dt doc base type from c period p full join c doctype dt on p ad client id dt ad client id where p ad client id and not exists select from c periodcontrol pc where pc c period id p c period id and pc doc base type dt doc base type prepared statement pstmt null int counter 0 try pstmt db prepare statement sql trx name pstmt set int 1 ad client id result set rs pstmt execute query while rs next int client id rs get int 1 int c period id rs get int 2 string doc base type rs get string 3 s log config ad client id client id c period id c period id doc base type doc base type m period control pc new m period control ctx client id c period id doc base type trx name if pc save counter s log fine pc to string else s log warning not saved pc rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if sp null sp add log 0 null new big decimal counter c periodcontrol id created ad_client_id createperiodcontrols ad_client_id svrprocess trxname s_log ad_client_id ad_client_id ad_client_id c_period_id docbasetype c_period c_doctype ad_client_id ad_client_id ad_client_id c_periodcontrol c_period_id c_period_id docbasetype docbasetype preparedstatement preparestatement trxname setint ad_client_id resultset executequery client_id getint c_period_id getint docbasetype getstring s_log ad_client_id client_id c_period_id c_period_id docbasetype docbasetype mperiodcontrol mperiodcontrol client_id c_period_id docbasetype trxname s_log tostring s_log s_log addlog bigdecimal c_periodcontrol_id constructor creates r model data param table name public r model string table name m data new r model data table name rmodeldata tablename rmodel tablename m_data rmodeldata tablename get column display name param col return r column protected r column getr column int col if col 0 col m data cols size throw new java lang illegal argument exception column invalid return r column m data cols get col rcolumn rcolumn getrcolumn m_data illegalargumentexception rcolumn m_data add column param rc public void add column r column rc m data cols add rc addcolumn rcolumn m_data add column at index param rc param index public void add column r column rc int index m data cols add index rc addcolumn rcolumn m_data add row public void add row m data rows add new array list object m data rows meta add null addrow m_data arraylist m_data rowsmeta add row at index param index public void add row int index m data rows add index new array list object m data rows meta add index null addrow m_data arraylist m_data rowsmeta add row param l public void add row array list object l m data rows add l m data rows meta add null addrow arraylist m_data m_data rowsmeta add row at index param l param index public void add row array list object l int index m data rows add index l m data rows meta add index null addrow arraylist m_data m_data rowsmeta find index for column name param column name return index or 1 if not found public int get column index string column name if column name null column name length 0 return 1 for int i 0 i m data cols size i r column rc r column m data cols get i log fine column i rc get colsql column name if rc get colsql starts with column name log fine column i rc get colsql column name return i return 1 columnname columnname getcolumnindex columnname columnname columnname m_data rcolumn rcolumn m_data getcolsql columnname getcolsql startswith columnname getcolsql columnname query param ctx param where clause param order clause public void query properties ctx string where clause string order clause m data query ctx where clause order clause whereclause orderclause whereclause orderclause m_data whereclause orderclause set a group column param column name public void set group string column name set group get column index column name columnname setgroup columnname setgroup getcolumnindex columnname set a group column if the group value changes a new row in inserted performing the calculations set in set group function if you set multiple groups start with the highest level e g country region city the data is assumed to be sorted to result in meaningful groups pre a aa 1 a ab 2 b ba 3 b bb 4 after set group 0 a aa 1 a ab 2 a b ba 3 b bb 4 b pre param col the group by column public void set group int col log config r model set group col col if col 0 col m data cols size return integer ii new integer col if m data groups contains ii m data groups add ii setgroupfunction setgroup setgroup rmodel setgroup m_data m_data m_data is row a group row param row index return true if row is a group row public boolean is group row int row return m data is group row row isgrouprow m_data isgrouprow set group function param column name param function public void set function string column name string function set function get column index column name function columnname setfunction columnname setfunction getcolumnindex columnname set group function for the column set a function like function sum function count param col the column on which the function is performed param function the function public void set function int col string function log config r model set function col col function if col 0 col m data cols size return m data functions put new integer col function function_sum function_count setfunction rmodel setfunction m_data m_data return total mumber of rows return row count public int get row count return m data rows size getrowcount m_data get total number of columns return column count public int get column count return m data cols size getcolumncount m_data get column display name param col index return column name public string get column name int col if col 0 col m data cols size throw new java lang illegal argument exception column invalid r column rc r column m data cols get col if rc null return rc get col header return null columnname getcolumnname m_data illegalargumentexception rcolumn rcolumn m_data getcolheader get column class param col index return column class public class get column class int col if col 0 col m data cols size throw new java lang illegal argument exception column invalid r column rc r column m data cols get col if rc null return rc get col class return null getcolumnclass m_data illegalargumentexception rcolumn rcolumn m_data getcolclass is cell editable param row index param column index return true if editable public boolean is cell editable int row index int column index return m editable rowindex columnindex iscelleditable rowindex columnindex m_editable get value at param row param col return value public object get value at int row int col invalid row if row 0 row m data rows size return null throw new java lang illegal argument exception row invalid if col 0 col m data cols size return null throw new java lang illegal argument exception column invalid array list my row array list m data rows get row invalid column if my row null col my row size return null set value return my row get col getvalueat m_data illegalargumentexception m_data illegalargumentexception arraylist myrow arraylist m_data myrow myrow setvalue myrow set value at param a value param row param col throws illegal argument exception if row column is invalid or cell is read only public void set value at object a value int row int col invalid row if row 0 row m data rows size throw new illegal argument exception row invalid if col 0 col m data cols size throw new illegal argument exception column invalid if is cell editable row col throw new illegal argument exception cell is read only array list object my row m data rows get row invalid row if my row null throw new java lang illegal argument exception row not initialized not enough columns add nulls if col my row size while my row size m data cols size my row add null set value my row set col a value avalue illegalargumentexception setvalueat avalue m_data illegalargumentexception m_data illegalargumentexception iscelleditable illegalargumentexception arraylist myrow m_data myrow illegalargumentexception myrow myrow m_data myrow setvalue myrow avalue move row param from index param to index public void move row int from int to m data move row from to moverow m_data moverow basic constructor use the set methods to set the values of the attributes public nobr use the set methods to set the values of the attributes param element set the value of lt nobr gt value lt nobr gt public nobr element element add element element addelement use the set methods to set the values of the attributes param value set the value of lt nobr gt value lt nobr gt public nobr string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public nobr add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public nobr add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public nobr add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public nobr add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public nobr remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry detail protected constructor param frame parent param modal modal param window no window no param value query value param table name table name param key column key column ignored param multi selection multiple selections param where clause where clause protected info general frame frame boolean modal int window no string value string table name string key column boolean multi selection string where clause super frame modal window no table name key column multi selection where clause log info table name key column where clause set title msg get msg env get ctx info stat init p loadedok init info int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no focus text field1 set value value text field1 request focus if value null value length 0 execute query windowno queryvalue tablename keycolumn multiselection whereclause infogeneral windowno tablename keycolumn multiselection whereclause windowno tablename keycolumn multiselection whereclause tablename keycolumn whereclause settitle getmsg getctx statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring textfield1 setvalue textfield1 requestfocus executequery static setup add fields to parameter panel grid layout private void stat init label1 set label for text field1 label1 set text label1 label1 set horizontal alignment j label leading text field1 set background compiereplaf get info background label2 set label for text field2 label2 set text label2 label2 set horizontal alignment j label leading text field2 set background compiereplaf get info background label3 set label for text field3 label3 set text label3 label3 set horizontal alignment j label leading text field3 set background compiereplaf get info background label4 set label for text field4 label4 set text label4 label4 set horizontal alignment j label leading text field4 set background compiereplaf get info background parameter panel set layout new a layout parameter panel add label1 new a layout constraint 0 0 parameter panel add label2 null parameter panel add label3 null parameter panel add label4 null parameter panel add text field1 new a layout constraint 1 0 parameter panel add text field2 null parameter panel add text field3 null parameter panel add text field4 null parameterpanel gridlayout statinit setlabelfor textfield1 settext sethorizontalalignment jlabel textfield1 setbackground getinfobackground setlabelfor textfield2 settext sethorizontalalignment jlabel textfield2 setbackground getinfobackground setlabelfor textfield3 settext sethorizontalalignment jlabel textfield3 setbackground getinfobackground setlabelfor textfield4 settext sethorizontalalignment jlabel textfield4 setbackground getinfobackground parameterpanel setlayout alayout parameterpanel alayoutconstraint parameterpanel parameterpanel parameterpanel parameterpanel textfield1 alayoutconstraint parameterpanel textfield2 parameterpanel textfield3 parameterpanel textfield4 general init return true if success private boolean init info if init info table return false prepare table string buffer where new string buffer is active y if p whereclause length 0 where append and append p whereclause prepare table m generallayout p tablename where to string 2 set enable fields label1 set text msg translate env get ctx m querycolumns get 0 to string text field1 add action listener this if m querycolumns size 1 label2 set text msg translate env get ctx m querycolumns get 1 to string text field2 add action listener this else label2 set visible false text field2 set visible false if m querycolumns size 2 label3 set text msg translate env get ctx m querycolumns get 2 to string text field3 add action listener this else label3 set visible false text field3 set visible false if m querycolumns size 3 label4 set text msg translate env get ctx m querycolumns get 3 to string text field4 add action listener this else label4 set visible false text field4 set visible false return true initinfo initinfotable stringbuffer stringbuffer isactive p_whereclause p_whereclause preparetable m_generallayout p_tablename tostring settext getctx m_querycolumns tostring textfield1 addactionlistener m_querycolumns settext getctx m_querycolumns tostring textfield2 addactionlistener setvisible textfield2 setvisible m_querycolumns settext getctx m_querycolumns tostring textfield3 addactionlistener setvisible textfield3 setvisible m_querycolumns settext getctx m_querycolumns tostring textfield4 addactionlistener setvisible textfield4 setvisible init info with table find query columns value name build grid controller columsn return true if success private boolean init info table get query columns string sql select c column name t ad table id t table name from ad table t inner join ad column c on t ad table id c ad table id where c ad reference id 10 and t table name 1 displayed in window and exists select from ad field f where f ad column id c ad column id and f is displayed y and f is encrypted n and f obscure type is null order by c is identifier desc c seq no int ad table id 0 string table name null try prepared statement pstmt db prepare statement sql null pstmt set string 1 p tablename result set rs pstmt execute query while rs next m querycolumns add rs get string 1 if ad table id 0 ad table id rs get int 2 table name rs get string 3 rs close pstmt close catch sql exception e log log level severe sql e return false miminum check if m querycolumns size 0 log log level severe no query columns found return false log finest table table name id ad table id query columns m querycolumns size only 4 query columns while m querycolumns size 4 m querycolumns remove m querycolumns size 1 set title string title msg translate env get ctx table name id best bet if title ends with id title msg translate env get ctx table name second best bet set title get title title get display columns array list info column list new array list info column sql select c column name c ad reference id c is key f is displayed c ad reference value id from ad column c inner join ad table t on c ad table id t ad table id inner join ad tab tab on t ad window id tab ad window id inner join ad field f on tab ad tab id f ad tab id and f ad column id c ad column id where t ad table id and c is key y or f is displayed y and f is encrypted n and f obscure type is null f is encrypted n and f obscure type is null order by c is key desc f seq no try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query while rs next string column name rs get string 1 int display type rs get int 2 boolean is key rs get string 3 equals y boolean is displayed rs get string 4 equals y int ad reference value id rs get int 5 default string buffer col sql new string buffer column name class col class null if is key col class id column class else if is displayed else if display type display type yes no col class boolean class else if display type display type amount col class big decimal class else if display type display type number display type display type quantity col class double class else if display type display type integer col class integer class else if display type display type string display type display type text display type display type memo col class string class else if display type is date display type col class timestamp class ignore binary button id rowid else if display type display type account else if display type display type location else if display type display type locator else if display type display type list if env is base language env get ctx ad ref list col sql new string buffer select l name from ad ref list l where l ad reference id append ad reference value id append and l value append column name append as append column name else col sql new string buffer select t name from ad ref list l ad ref list trl t where l ad ref list id t ad ref list id and l ad reference id append ad reference value id append and l value append column name append and t ad language append env getad language env get ctx append as append column name col class string class else if display type display type table else if display type display type table dir display type display type search if col class null list add new info column msg translate env get ctx column name col sql to string col class log finest added column column name else log finest not added column column name rs close pstmt close catch sql exception e log log level severe sql e return false if list size 0 a dialog error p windowno this error no info columns log log level severe no info for ad table id ad table id sql return false log finest info columns list size convert array list to array m generallayout new info column list size list to array m generallayout return true querycolumns gridcontroller initinfotable columnname ad_table_id tablename ad_table ad_column ad_table_id ad_table_id ad_reference_id tablename ad_field ad_column_id ad_column_id isdisplayed isencrypted obscuretype isidentifier seqno ad_table_id tablename preparedstatement preparestatement setstring p_tablename resultset executequery m_querycolumns getstring ad_table_id ad_table_id getint tablename getstring sqlexception m_querycolumns tablename ad_table_id querycolumns m_querycolumns m_querycolumns m_querycolumns m_querycolumns getctx tablename _id endswith _id getctx tablename settitle gettitle arraylist info_column arraylist info_column columnname ad_reference_id iskey isdisplayed ad_reference_value_id ad_column ad_table ad_table_id ad_table_id ad_tab ad_window_id ad_window_id ad_field ad_tab_id ad_tab_id ad_column_id ad_column_id ad_table_id iskey isdisplayed isencrypted obscuretype isencrypted obscuretype iskey seqno preparedstatement preparestatement setint ad_table_id resultset executequery columnname getstring displaytype getint iskey getstring isdisplayed getstring ad_reference_value_id getint stringbuffer colsql stringbuffer columnname colclass iskey colclass idcolumn isdisplayed displaytype displaytype yesno colclass displaytype displaytype colclass bigdecimal displaytype displaytype displaytype displaytype colclass displaytype displaytype colclass displaytype displaytype displaytype displaytype displaytype displaytype colclass displaytype isdate displaytype colclass displaytype displaytype displaytype displaytype displaytype displaytype displaytype displaytype isbaselanguage getctx ad_ref_list colsql stringbuffer ad_ref_list ad_reference_id ad_reference_value_id columnname columnname colsql stringbuffer ad_ref_list ad_ref_list_trl ad_ref_list_id ad_ref_list_id ad_reference_id ad_reference_value_id columnname ad_language getad_language getctx columnname colclass displaytype displaytype displaytype displaytype tabledir displaytype displaytype colclass info_column getctx columnname colsql tostring colclass columnname columnname sqlexception adialog p_windowno ad_table_id ad_table_id infocolumns arraylist m_generallayout info_column toarray m_generallayout construct sql where clause and define parameters set parameters needs to set parameters includes first and return where clause string getsql where string buffer sql new string buffer addsql where sql 0 text field1 get text to upper case addsql where sql 1 text field2 get text to upper case addsql where sql 2 text field3 get text to upper case addsql where sql 3 text field4 get text to upper case return sql to string setparameters getsqlwhere stringbuffer stringbuffer addsqlwhere textfield1 gettext touppercase addsqlwhere textfield2 gettext touppercase addsqlwhere textfield3 gettext touppercase addsqlwhere textfield4 gettext touppercase tostring add directly query as strings param sql sql buffer param index index param value value private void addsql where string buffer sql int index string value if value equals value equals index m querycolumns size sql append and upper append m querycolumns get index to string append like sql append value if value ends with sql append else sql append addsqlwhere stringbuffer m_querycolumns m_querycolumns tostring endswith set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception standard constructor public x c jobassignment properties ctx int c jobassignment id string trx name super ctx c jobassignment id trx name if c jobassignment id 0 setad user id 0 setc jobassignment id 0 setc job id 0 set valid from new timestamp system current time millis x_c_jobassignment c_jobassignment_id trxname c_jobassignment_id trxname c_jobassignment_id setad_user_id setc_jobassignment_id setc_job_id setvalidfrom currenttimemillis load constructor public x c jobassignment properties ctx result set rs string trx name super ctx rs trx name x_c_jobassignment resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c jobassignment append get id append return sb to string tostring stringbuffer stringbuffer x_c_jobassignment get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set position assignment assignemt of employee user to job position public void setc jobassignment id int c jobassignment id if c jobassignment id 1 throw new illegal argument exception c jobassignment id is mandatory set valuenocheck c jobassignment id new integer c jobassignment id setc_jobassignment_id c_jobassignment_id c_jobassignment_id illegalargumentexception c_jobassignment_id set_valuenocheck c_jobassignment_id c_jobassignment_id get position assignment assignemt of employee user to job position public int getc jobassignment id integer ii integer get value c jobassignment id if ii null return 0 return ii int value getc_jobassignment_id get_value c_jobassignment_id intvalue set position job position public void setc job id int c job id if c job id 1 throw new illegal argument exception c job id is mandatory set valuenocheck c job id new integer c job id setc_job_id c_job_id c_job_id illegalargumentexception c_job_id set_valuenocheck c_job_id c_job_id get position job position public int getc job id integer ii integer get value c job id if ii null return 0 return ii int value getc_job_id get_value c_job_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc job id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_job_id set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto get contsnts return contents public object get contents return contents getcontents standard constructor public x ad printgraph properties ctx int ad printgraph id string trx name super ctx ad printgraph id trx name if ad printgraph id 0 setad printformat id 0 0 setad printgraph id 0 setdata printformatitem id 0 setdescription printformatitem id 0 set graph type null set name null x_ad_printgraph ad_printgraph_id trxname ad_printgraph_id trxname ad_printgraph_id setad_printformat_id setad_printgraph_id setdata_printformatitem_id setdescription_printformatitem_id setgraphtype setname load constructor public x ad printgraph properties ctx result set rs string trx name super ctx rs trx name x_ad_printgraph resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printgraph append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printgraph get_id tostring set print format data print format public void setad printformat id int ad printformat id if ad printformat id 1 throw new illegal argument exception ad printformat id is mandatory set value ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id illegalargumentexception ad_printformat_id set_value ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set graph graph included in reports public void setad printgraph id int ad printgraph id if ad printgraph id 1 throw new illegal argument exception ad printgraph id is mandatory set valuenocheck ad printgraph id new integer ad printgraph id setad_printgraph_id ad_printgraph_id ad_printgraph_id illegalargumentexception ad_printgraph_id set_valuenocheck ad_printgraph_id ad_printgraph_id get graph graph included in reports public int getad printgraph id integer ii integer get value ad printgraph id if ii null return 0 return ii int value getad_printgraph_id get_value ad_printgraph_id intvalue public static final int data1 printformatitem id ad reference id 264 set data column 2 data column for line charts public void setdata1 printformatitem id int data1 printformatitem id if data1 printformatitem id 0 set value data1 printformatitem id null else set value data1 printformatitem id new integer data1 printformatitem id data1_printformatitem_id_ad_reference_id setdata1_printformatitem_id data1_printformatitem_id data1_printformatitem_id set_value data1_printformatitem_id set_value data1_printformatitem_id data1_printformatitem_id get data column 2 data column for line charts public int getdata1 printformatitem id integer ii integer get value data1 printformatitem id if ii null return 0 return ii int value getdata1_printformatitem_id get_value data1_printformatitem_id intvalue public static final int data2 printformatitem id ad reference id 264 set data column 3 data column for line charts public void setdata2 printformatitem id int data2 printformatitem id if data2 printformatitem id 0 set value data2 printformatitem id null else set value data2 printformatitem id new integer data2 printformatitem id data2_printformatitem_id_ad_reference_id setdata2_printformatitem_id data2_printformatitem_id data2_printformatitem_id set_value data2_printformatitem_id set_value data2_printformatitem_id data2_printformatitem_id get data column 3 data column for line charts public int getdata2 printformatitem id integer ii integer get value data2 printformatitem id if ii null return 0 return ii int value getdata2_printformatitem_id get_value data2_printformatitem_id intvalue public static final int data3 printformatitem id ad reference id 264 set data column 4 data column for line charts public void setdata3 printformatitem id int data3 printformatitem id if data3 printformatitem id 0 set value data3 printformatitem id null else set value data3 printformatitem id new integer data3 printformatitem id data3_printformatitem_id_ad_reference_id setdata3_printformatitem_id data3_printformatitem_id data3_printformatitem_id set_value data3_printformatitem_id set_value data3_printformatitem_id data3_printformatitem_id get data column 4 data column for line charts public int getdata3 printformatitem id integer ii integer get value data3 printformatitem id if ii null return 0 return ii int value getdata3_printformatitem_id get_value data3_printformatitem_id intvalue public static final int data4 printformatitem id ad reference id 264 set data column 5 data column for line charts public void setdata4 printformatitem id int data4 printformatitem id if data4 printformatitem id 0 set value data4 printformatitem id null else set value data4 printformatitem id new integer data4 printformatitem id data4_printformatitem_id_ad_reference_id setdata4_printformatitem_id data4_printformatitem_id data4_printformatitem_id set_value data4_printformatitem_id set_value data4_printformatitem_id data4_printformatitem_id get data column 5 data column for line charts public int getdata4 printformatitem id integer ii integer get value data4 printformatitem id if ii null return 0 return ii int value getdata4_printformatitem_id get_value data4_printformatitem_id intvalue public static final int data printformatitem id ad reference id 264 set data column data column for pie and line charts public void setdata printformatitem id int data printformatitem id if data printformatitem id 1 throw new illegal argument exception data printformatitem id is mandatory set value data printformatitem id new integer data printformatitem id data_printformatitem_id_ad_reference_id setdata_printformatitem_id data_printformatitem_id data_printformatitem_id illegalargumentexception data_printformatitem_id set_value data_printformatitem_id data_printformatitem_id get data column data column for pie and line charts public int getdata printformatitem id integer ii integer get value data printformatitem id if ii null return 0 return ii int value getdata_printformatitem_id get_value data_printformatitem_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final int description printformatitem id ad reference id 264 set description column description column for pie line bar charts public void setdescription printformatitem id int description printformatitem id if description printformatitem id 1 throw new illegal argument exception description printformatitem id is mandatory set value description printformatitem id new integer description printformatitem id description_printformatitem_id_ad_reference_id setdescription_printformatitem_id description_printformatitem_id description_printformatitem_id illegalargumentexception description_printformatitem_id set_value description_printformatitem_id description_printformatitem_id get description column description column for pie line bar charts public int getdescription printformatitem id integer ii integer get value description printformatitem id if ii null return 0 return ii int value getdescription_printformatitem_id get_value description_printformatitem_id intvalue public static final string graphtype piechart p set graph type type of graph to be painted public void set graph type string graph type if graph type null throw new illegal argument exception graph type is mandatory if graph type equals b graph type equals l graph type equals p else throw new illegal argument exception graph type invalid value graph type reference id 265 b l p if graph type length 1 log warning length 1 truncated graph type graph type substring 0 0 set value graph type graph type graphtype_piechart setgraphtype graphtype graphtype illegalargumentexception graphtype graphtype graphtype graphtype illegalargumentexception graphtype graphtype reference_id graphtype graphtype graphtype set_value graphtype graphtype get graph type type of graph to be painted public string get graph type return string get value graph type getgraphtype get_value graphtype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname basic constructor use set methods public tr basic constructor use set methods public tr element element add element element addelement basic constructor use set methods public tr string element add element element addelement sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public tr set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param align sets the valign attribute public tr setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public tr set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tr set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tr set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the bgcolor attribute param color sets the background color of the cell public tr set bg color string color add attribute bgcolor html color convert color color return this setbgcolor addattribute htmlcolor convertcolor sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tr add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tr add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tr add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tr add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public tr remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get default client role return role public static m role get default if s defaultrole null ini is client return get default env get ctx false return s defaultrole mrole getdefault s_defaultrole isclient getdefault getctx s_defaultrole get set default role param ctx context param reload if true forces load return role see org compiere util login load preferences key name pair key name pair java sql timestamp string public static m role get default properties ctx boolean reload int ad role id env get context as int ctx ad role id int ad user id env get context as int ctx ad user id if ini is client none for server ad user id 0 if reload s defaultrole null s defaultrole get ctx ad role id ad user id reload else if s defaultrole getad role id ad role id s defaultrole getad user id ad user id s defaultrole get ctx ad role id ad user id reload return s defaultrole loadpreferences keynamepair keynamepair mrole getdefault ad_role_id getcontextasint ad_role_id ad_user_id getcontextasint ad_user_id isclient ad_user_id s_defaultrole s_defaultrole ad_role_id ad_user_id s_defaultrole getad_role_id ad_role_id s_defaultrole getad_user_id ad_user_id s_defaultrole ad_role_id ad_user_id s_defaultrole get role for user param ctx context param ad role id role param ad user id user param reload if true forces load return role public static m role get properties ctx int ad role id int ad user id boolean reload s log info ad role id ad role id ad user id ad user id reload reload string key ad role id ad user id m role role m role s roles get key if role null reload role new m role ctx ad role id null s roles put key role if ad role id 0 string trx name null role load trx name special handling role setad user id ad user id role load access reload s log info role to string return role ad_role_id ad_user_id mrole ad_role_id ad_user_id s_log ad_role_id ad_role_id ad_user_id ad_user_id ad_role_id _ ad_user_id mrole mrole s_roles mrole ad_role_id s_roles ad_role_id trxname trxname setad_user_id ad_user_id loadaccess s_log tostring get role cached did not set user so no access loaded param ctx context param ad role id role return role public static m role get properties ctx int ad role id string key string value of ad role id m role role m role s roles get key string trx name null if role null role new m role ctx ad role id trx name s roles put key role if ad role id 0 system role role load trx name special handling return role ad_role_id mrole ad_role_id valueof ad_role_id mrole mrole s_roles trxname mrole ad_role_id trxname s_roles ad_role_id trxname get roles of client param ctx context return roles of client public static m role get of client properties ctx string sql select from ad role where ad client id array list m role list new array list m role prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next list add new m role ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m role ret value new m role list size list to array ret value return ret value mrole getofclient ad_role ad_client_id arraylist mrole arraylist mrole preparedstatement preparestatement setint getad_client_id resultset executequery mrole s_log mrole retvalue mrole toarray retvalue retvalue get roles with where clause param ctx context param where clause where clause return roles of client public static m role get of properties ctx string where clause string sql select from ad role if where clause null where clause length 0 sql where where clause array list m role list new array list m role prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m role ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m role ret value new m role list size list to array ret value return ret value whereclause mrole getof whereclause ad_role whereclause whereclause whereclause arraylist mrole arraylist mrole preparedstatement preparestatement resultset executequery mrole s_log mrole retvalue mrole toarray retvalue retvalue standard constructor param ctx context param ad role id id public m role properties ctx int ad role id string trx name super ctx ad role id trx name id 0 system administrator if ad role id 0 set name null set is can export true set is can report true set is manual false set is personal access false set is personal lock false set is show acct false set is access all orgs false set user level userlevel organization set preference type preferencetype organization set is change log false set overwrite price limit false set is use user org access false set max query records 0 set confirm query records 0 ad_role_id mrole ad_role_id trxname ad_role_id trxname ad_role_id setname setiscanexport setiscanreport setismanual setispersonalaccess setispersonallock setisshowacct setisaccessallorgs setuserlevel userlevel_organization setpreferencetype preferencetype_organization setischangelog setoverwritepricelimit setisuseuserorgaccess setmaxqueryrecords setconfirmqueryrecords load constructor param ctx context param rs result set public m role properties ctx result set rs string trx name super ctx rs trx name mrole resultset trxname trxname get confirm query records return entered records or 500 default public int get confirm query records int no super get confirm query records if no 0 return 500 return no getconfirmqueryrecords getconfirmqueryrecords require query param no records records return true if query required public boolean is query require int no records if no records 2 return false int max get max query records if max 0 no records max return true int qu get confirm query records return no records qu norecords isqueryrequire norecords norecords getmaxqueryrecords norecords getconfirmqueryrecords norecords over max query param no records records return true if over max query public boolean is query max int no records int max get max query records return max 0 no records max norecords isquerymax norecords getmaxqueryrecords norecords after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success add role to super user m user roles su new m user roles get ctx superuser user id getad role id get trxname su save add role to user if get created by superuser user id m user roles ur new m user roles get ctx get created by getad role id get trxname ur save update access records else if is valuechanged user level update access records default role changed if s defaultrole null s defaultrole get id get id s defaultrole this return success newrecord aftersave newrecord newrecord superuser muserroles muserroles getctx superuser_user_id getad_role_id get_trxname getcreatedby superuser_user_id muserroles muserroles getctx getcreatedby getad_role_id get_trxname updateaccessrecords is_valuechanged userlevel updateaccessrecords s_defaultrole s_defaultrole get_id get_id s_defaultrole create access records return info public string update access records if is manual return string role client org user getad role id getad client id getad org id y sys date get updated by sys date get updated by y is read write string sql window insert into ad window access ad window id ad role id ad client id ad org id is active created created by updated updated by is read write select distinct w ad window id role client org user from ad window w inner join ad tab t on w ad window id t ad window id inner join ad table tt on t ad table id tt ad table id where t seq no select min seq no from ad tab xt only check first tab where xt ad window id w ad window id and tt access level in string sql process insert into ad process access ad process id ad role id ad client id ad org id is active created created by updated updated by is read write select distinct p ad process id role client org user from ad process p where access level in string sql form insert into ad form access ad form id ad role id ad client id ad org id is active created created by updated updated by is read write select f ad form id role client org user from ad form f where access level in string sql workflow insert into ad workflow access ad workflow id ad role id ad client id ad org id is active created created by updated updated by is read write select w ad workflow id role client org user from ad workflow w where access level in fill ad xx access sco levels s 100 4 system info sco 111 7 system shared info sc 110 6 system client info co 011 3 client shared info c 011 2 client o 001 1 organization info roles s 4 7 6 co 7 6 3 2 1 o 3 1 7 string access level null if userlevel system equals get user level access level 4 7 6 else if userlevel client equals get user level access level 7 6 3 2 else if userlevel clientplusorganization equals get user level access level 7 6 3 2 1 else if userlevel organization equals get user level access level 3 1 7 string where del where ad role id getad role id int win del db execute update delete ad window access where del get trxname int win db execute update sql window access level get trxname int proc del db execute update delete ad process access where del get trxname int proc db execute update sql process access level get trxname int form del db execute update delete ad form access where del get trxname int form db execute update sql form access level get trxname int wf del db execute update delete ad workflow access where del get trxname int wf db execute update sql workflow access level get trxname log fine ad window id win del win ad process id proc del proc ad form id form del form ad workflow id wf del wf load access true return ad window id win ad process id proc ad form id form ad workflow id wf updateaccessrecords ismanual roleclientorguser getad_role_id getad_client_id getad_org_id sysdate getupdatedby sysdate getupdatedby isreadwrite sqlwindow ad_window_access ad_window_id ad_role_id ad_client_id ad_org_id isactive createdby updatedby isreadwrite ad_window_id roleclientorguser ad_window ad_tab ad_window_id ad_window_id ad_table ad_table_id ad_table_id seqno seqno ad_tab ad_window_id ad_window_id accesslevel sqlprocess ad_process_access ad_process_id ad_role_id ad_client_id ad_org_id isactive createdby updatedby isreadwrite ad_process_id roleclientorguser ad_process accesslevel sqlform ad_form_access ad_form_id ad_role_id ad_client_id ad_org_id isactive createdby updatedby isreadwrite ad_form_id roleclientorguser ad_form accesslevel sqlworkflow ad_workflow_access ad_workflow_id ad_role_id ad_client_id ad_org_id isactive createdby updatedby isreadwrite ad_workflow_id roleclientorguser ad_workflow accesslevel ad_xx_access s__ sc_ _co _c_ __o _co __o accesslevel userlevel_system getuserlevel accesslevel userlevel_client getuserlevel accesslevel userlevel_clientplusorganization getuserlevel accesslevel userlevel_organization getuserlevel accesslevel wheredel ad_role_id getad_role_id windel executeupdate ad_window_access wheredel get_trxname executeupdate sqlwindow accesslevel get_trxname procdel executeupdate ad_process_access wheredel get_trxname executeupdate sqlprocess accesslevel get_trxname formdel executeupdate ad_form_access wheredel get_trxname executeupdate sqlform accesslevel get_trxname wfdel executeupdate ad_workflow_access wheredel get_trxname executeupdate sqlworkflow accesslevel get_trxname ad_window_id windel ad_process_id procdel ad_form_id formdel ad_workflow_id wfdel loadaccess ad_window_id ad_process_id ad_form_id ad_workflow_id string representation return info public string to string string buffer sb new string buffer m role sb append getad role id append append get name append user level append get user level append append get client where false append append get org where false append return sb to string tostring stringbuffer stringbuffer mrole getad_role_id getname userlevel getuserlevel getclientwhere getorgwhere tostring extended string representation param ctx properties return extended info public string to stringx properties ctx string buffer sb new string buffer sb append msg translate ctx ad role id append append get name append append msg translate ctx is can export append append is can export append append msg translate ctx is can report append append is can report append env nl append env nl for int i 0 i m orgaccess length i sb append m orgaccess i to string append env nl sb append env nl load table access false for int i 0 i m tableaccess length i sb append m tableaccess i to stringx ctx append env nl if m tableaccess length 0 sb append env nl load column access false for int i 0 i m columnaccess length i sb append m columnaccess i to stringx ctx append env nl if m columnaccess length 0 sb append env nl load record access false for int i 0 i m recordaccess length i sb append m recordaccess i to stringx ctx append env nl return sb to string tostringx stringbuffer stringbuffer ad_role_id getname iscanexport iscanexport iscanreport iscanreport m_orgaccess m_orgaccess tostring loadtableaccess m_tableaccess m_tableaccess tostringx m_tableaccess loadcolumnaccess m_columnaccess m_columnaccess tostringx m_columnaccess loadrecordaccess m_recordaccess m_recordaccess tostringx tostring set logged in user param ad user id user requesting info public void setad user id int ad user id m ad user id ad user id ad_user_id setad_user_id ad_user_id m_ad_user_id ad_user_id get logged in user return ad user id user requesting info public int getad user id return m ad user id ad_user_id getad_user_id m_ad_user_id load access info param reload re load from disk public void load access boolean reload load org access reload load table access reload load table info reload load column access reload load record access reload if reload m windowaccess null m processaccess null m taskaccess null m workflowaccess null m formaccess null loadaccess loadorgaccess loadtableaccess loadtableinfo loadcolumnaccess loadrecordaccess m_windowaccess m_processaccess m_taskaccess m_workflowaccess m_formaccess load org access param reload reload private void load org access boolean reload if reload m orgaccess null return array list org access list new array list org access if is use user org access load org access user list else load org access role list m orgaccess new org access list size list to array m orgaccess log fine m orgaccess length reload reload if ini is client string buffer sb new string buffer for int i 0 i m orgaccess length i if i 0 sb append sb append m orgaccess i ad org id env set context env get ctx user org sb to string loadorgaccess m_orgaccess arraylist orgaccess arraylist orgaccess isuseuserorgaccess loadorgaccessuser loadorgaccessrole m_orgaccess orgaccess toarray m_orgaccess m_orgaccess isclient stringbuffer stringbuffer m_orgaccess m_orgaccess ad_org_id setcontext getctx user_org tostring load org access user param list list private void load org access user array list org access list prepared statement pstmt null string sql select from ad user orgaccess where ad user id and is active y try pstmt db prepare statement sql get trxname pstmt set int 1 getad user id result set rs pstmt execute query while rs next m user org access oa new m user org access get ctx rs get trxname load org access add list new org access oa getad client id oa getad org id oa is read only rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null loadorgaccessuser arraylist orgaccess preparedstatement ad_user_orgaccess ad_user_id isactive preparestatement get_trxname setint getad_user_id resultset executequery muserorgaccess muserorgaccess getctx get_trxname loadorgaccessadd orgaccess getad_client_id getad_org_id isreadonly load org access role param list list private void load org access role array list org access list prepared statement pstmt null string sql select from ad role orgaccess where ad role id and is active y try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m role org access oa new m role org access get ctx rs get trxname load org access add list new org access oa getad client id oa getad org id oa is read only rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null loadorgaccessrole arraylist orgaccess preparedstatement ad_role_orgaccess ad_role_id isactive preparestatement get_trxname setint getad_role_id resultset executequery mroleorgaccess mroleorgaccess getctx get_trxname loadorgaccessadd orgaccess getad_client_id getad_org_id isreadonly load org access add tree to list param list list param oa org access see org compiere util login private void load org access add array list org access list org access oa if list contains oa return list add oa do we look for trees if getad tree org id 0 return m org org m org get get ctx oa ad org id if org is summary return summary org get dependents mtree base tree mtree base get get ctx getad tree org id get trxname string sql select ad client id ad org id from ad org where is active y and ad org id in select node id from tree get node table name where ad tree id and parent id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 tree getad tree id pstmt set int 2 org getad org id result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 load org access add list new org access ad client id ad org id oa read only rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null loadorgaccessadd arraylist orgaccess orgaccess getad_tree_org_id morg morg getctx ad_org_id issummary mtree_base mtree_base getctx getad_tree_org_id get_trxname ad_client_id ad_org_id ad_org isactive ad_org_id node_id getnodetablename ad_tree_id parent_id isactive preparedstatement preparestatement get_trxname setint getad_tree_id setint getad_org_id resultset executequery ad_client_id getint ad_org_id getint loadorgaccessadd orgaccess ad_client_id ad_org_id readonly load table access param reload reload private void load table access boolean reload if m tableaccess null reload return array list m table access list new array list m table access prepared statement pstmt null string sql select from ad table access where ad role id and is active y try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next list add new m table access get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m tableaccess new m table access list size list to array m tableaccess log fine m tableaccess length loadtableaccess m_tableaccess arraylist mtableaccess arraylist mtableaccess preparedstatement ad_table_access ad_role_id isactive preparestatement get_trxname setint getad_role_id resultset executequery mtableaccess getctx get_trxname m_tableaccess mtableaccess toarray m_tableaccess m_tableaccess load table access and name param reload reload private void load table info boolean reload if m tableaccesslevel null m tablename null reload return m tableaccesslevel new hash map integer string 300 m tablename new hash map string integer 300 prepared statement pstmt null string sql select ad table id access level table name from ad table where is active y try pstmt db prepare statement sql get trxname result set rs pstmt execute query while rs next integer ii new integer rs get int 1 m tableaccesslevel put ii rs get string 2 m tablename put rs get string 3 ii rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log fine m tableaccesslevel size loadtableinfo m_tableaccesslevel m_tablename m_tableaccesslevel hashmap m_tablename hashmap preparedstatement ad_table_id accesslevel tablename ad_table isactive preparestatement get_trxname resultset executequery getint m_tableaccesslevel getstring m_tablename getstring m_tableaccesslevel load column access param reload reload private void load column access boolean reload if m columnaccess null reload return array list m column access list new array list m column access prepared statement pstmt null string sql select from ad column access where ad role id and is active y try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next list add new m column access get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m columnaccess new m column access list size list to array m columnaccess log fine m columnaccess length loadcolumnaccess m_columnaccess arraylist mcolumnaccess arraylist mcolumnaccess preparedstatement ad_column_access ad_role_id isactive preparestatement get_trxname setint getad_role_id resultset executequery mcolumnaccess getctx get_trxname m_columnaccess mcolumnaccess toarray m_columnaccess m_columnaccess load record access param reload reload private void load record access boolean reload if reload m recordaccess null m recorddependentaccess null return array list m record access list new array list m record access array list m record access dependent new array list m record access prepared statement pstmt null string sql select from ad record access where ad role id and is active y order by ad table id try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m record access ra new m record access get ctx rs get trxname list add ra if ra is dependent entities dependent add ra rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m recordaccess new m record access list size list to array m recordaccess m recorddependentaccess new m record access dependent size dependent to array m recorddependentaccess log fine m recordaccess length dependent m recorddependentaccess length loadrecordaccess m_recordaccess m_recorddependentaccess arraylist mrecordaccess arraylist mrecordaccess arraylist mrecordaccess arraylist mrecordaccess preparedstatement ad_record_access ad_role_id isactive ad_table_id preparestatement get_trxname setint getad_role_id resultset executequery mrecordaccess mrecordaccess getctx get_trxname isdependententities m_recordaccess mrecordaccess toarray m_recordaccess m_recorddependentaccess mrecordaccess toarray m_recorddependentaccess m_recordaccess m_recorddependentaccess get client where clause value param rw read write return ad client id 0 or ad client id in 0 1 public string get client where boolean rw all orgs use client of role if is access all orgs if rw getad client id 0 return ad client id getad client id return ad client id in 0 getad client id get client from org list load org access false unique strings hash set string set new hash set string if rw set add 0 positive list for int i 0 i m orgaccess length i set add string value of m orgaccess i ad client id string buffer sb new string buffer iterator it set iterator boolean one only true while it has next if sb length 0 sb append one only false sb append it next if one only if sb length 0 return ad client id sb to string else log log level severe no access org records return ad client id 1 no access record return ad client id in sb to string ad_client_id ad_client_id getclientwhere isaccessallorgs getad_client_id ad_client_id getad_client_id ad_client_id getad_client_id loadorgaccess hashset hashset m_orgaccess valueof m_orgaccess ad_client_id stringbuffer stringbuffer oneonly hasnext oneonly oneonly ad_client_id tostring ad_client_id ad_client_id tostring access to client param ad client id client param rw read write access return true if access public boolean is client access int ad client id boolean rw if ad client id 0 rw can always read system return true load org access false positive list for int i 0 i m orgaccess length i if m orgaccess i ad client id ad client id if rw return true if m orgaccess i read only rw return true return false ad_client_id isclientaccess ad_client_id ad_client_id loadorgaccess m_orgaccess m_orgaccess ad_client_id ad_client_id m_orgaccess readonly get org where clause value param rw read write return ad org id 0 or ad org id in 0 1 or null if access all org public string get org where boolean rw if is access all orgs return null load org access false unique strings hash set string set new hash set string if rw set add 0 positive list for int i 0 i m orgaccess length i if rw set add string value of m orgaccess i ad org id else if m orgaccess i read only rw set add string value of m orgaccess i ad org id string buffer sb new string buffer iterator it set iterator boolean one only true while it has next if sb length 0 sb append one only false sb append it next if one only if sb length 0 return ad org id sb to string else log log level severe no access org records return ad org id 1 no access record return ad org id in sb to string ad_org_id ad_org_id getorgwhere isaccessallorgs loadorgaccess hashset hashset m_orgaccess valueof m_orgaccess ad_org_id m_orgaccess readonly valueof m_orgaccess ad_org_id stringbuffer stringbuffer oneonly hasnext oneonly oneonly ad_org_id tostring ad_org_id ad_org_id tostring access to org param ad org id org param rw read write access return true if access public boolean is org access int ad org id boolean rw if is access all orgs return true if ad org id 0 rw can always read common org return true load org access false positive list for int i 0 i m orgaccess length i if m orgaccess i ad org id ad org id if rw return true if m orgaccess i read only rw return true return false return false ad_org_id isorgaccess ad_org_id isaccessallorgs ad_org_id loadorgaccess m_orgaccess m_orgaccess ad_org_id ad_org_id m_orgaccess readonly can report on table param ad table id table return true if access public boolean is can report int ad table id if is can report role level block log warning role denied return false if is table access ad table id true no r o access to table return false boolean can report true for int i 0 i m tableaccess length i if m table access accesstyperule reporting equals m tableaccess i get access type rule continue if m tableaccess i is exclude exclude if m tableaccess i getad table id ad table id can report m tableaccess i is can report log fine exclude ad table id can report return can report else include can report false if m tableaccess i getad table id ad table id can report m tableaccess i is can report log fine include ad table id can report return can report for all table access log fine ad table id can report return can report ad_table_id iscanreport ad_table_id iscanreport istableaccess ad_table_id canreport m_tableaccess mtableaccess accesstyperule_reporting m_tableaccess getaccesstyperule m_tableaccess isexclude m_tableaccess getad_table_id ad_table_id canreport m_tableaccess iscanreport ad_table_id canreport canreport canreport m_tableaccess getad_table_id ad_table_id canreport m_tableaccess iscanreport ad_table_id canreport canreport ad_table_id canreport canreport can export table param ad table id return true if access public boolean is can export int ad table id if is can export role level block log warning role denied return false if is table access ad table id true no r o access to table return false if is can report ad table id we cannot export if we cannot report return false boolean can export true for int i 0 i m tableaccess length i if m table access accesstyperule exporting equals m tableaccess i get access type rule continue if m tableaccess i is exclude exclude can export m tableaccess i is can export log fine exclude ad table id can export return can export else include can export false can export m tableaccess i is can export log fine include ad table id can export return can export for all table access log fine ad table id can export return can export ad_table_id iscanexport ad_table_id iscanexport istableaccess ad_table_id iscanreport ad_table_id canexport m_tableaccess mtableaccess accesstyperule_exporting m_tableaccess getaccesstyperule m_tableaccess isexclude canexport m_tableaccess iscanexport ad_table_id canexport canexport canexport canexport m_tableaccess iscanexport ad_table_id canexport canexport ad_table_id canexport canexport access to table param ad table id table param ro check read only access otherwise read write access level return has ro rw access to table public boolean is table access int ad table id boolean ro if is table access level ad table id ro role based access return false load table access false boolean has access true assuming exclusive rule for int i 0 i m tableaccess length i if m table access accesstyperule accessing equals m tableaccess i get access type rule continue if m tableaccess i is exclude exclude if you exclude access to a table and select read only you can only read data otherwise no access if m tableaccess i getad table id ad table id if ro has access m tableaccess i is read only else has access false log fine exclude ad table id ad table id ro ro table accessro m tableaccess i is read only has access return has access else include if you include access to a table and select read only you can only read data otherwise full access has access false if m tableaccess i getad table id ad table id if ro rw only if not r o has access m tableaccess i is read only else has access true log fine include ad table id ad table id ro ro table accessro m tableaccess i is read only has access return has access for all table access if has access log fine ad table id ad table id ro ro has access return has access ad_table_id istableaccess ad_table_id istableaccesslevel ad_table_id loadtableaccess hasaccess m_tableaccess mtableaccess accesstyperule_accessing m_tableaccess getaccesstyperule m_tableaccess isexclude m_tableaccess getad_table_id ad_table_id hasaccess m_tableaccess isreadonly hasaccess ad_table_id ad_table_id tableaccessro m_tableaccess isreadonly hasaccess hasaccess hasaccess m_tableaccess getad_table_id ad_table_id hasaccess m_tableaccess isreadonly hasaccess ad_table_id ad_table_id tableaccessro m_tableaccess isreadonly hasaccess hasaccess hasaccess ad_table_id ad_table_id hasaccess hasaccess access to table based on role user level table access level param ad table id table param ro check read only access otherwise read write access level return has ro rw access to table public boolean is table access level int ad table id boolean ro if ro role can always read return true load table info false access level 1 org 2 client 4 system 3 org client 6 client system 7 all string access level string m tableaccesslevel get new integer ad table id if access level null log fine no no access level ad table id ad table id return false access to all user levels if access level equals x ad table accesslevel all return true user level sco string user level get user level if user level char at 0 s access level equals x ad table accesslevel systemonly access level equals x ad table accesslevel systemplusclient return true if user level char at 1 c access level equals x ad table accesslevel clientonly access level equals x ad table accesslevel systemplusclient return true if user level char at 2 o access level equals x ad table accesslevel organization access level equals x ad table accesslevel clientplusorganization return true log fine no ad table id ad table id user lebel user level access level access level return false ad_table_id istableaccesslevel ad_table_id loadtableinfo accesslevel accesslevel m_tableaccesslevel ad_table_id accesslevel accesslevel ad_table_id ad_table_id accesslevel x_ad_table accesslevel_all userlevel getuserlevel userlevel charat accesslevel x_ad_table accesslevel_systemonly accesslevel x_ad_table accesslevel_systemplusclient userlevel charat accesslevel x_ad_table accesslevel_clientonly accesslevel x_ad_table accesslevel_systemplusclient userlevel charat accesslevel x_ad_table accesslevel_organization accesslevel x_ad_table accesslevel_clientplusorganization ad_table_id ad_table_id userlebel userlevel accesslevel accesslevel access to column param ad table id table param ad column id column param ro read only return true if access public boolean is column access int ad table id int ad column id boolean ro if is table access ad table id ro no access to table return false load column access false boolean ret value true assuming exclusive for int i 0 i m columnaccess length i if m columnaccess i is exclude exclude if you exclude access to a column and select read only you can only read data otherwise no access if m columnaccess i getad table id ad table id m columnaccess i getad column id ad column id if ro just r o access requested ret value m columnaccess i is read only else ret value false if ret value log fine exclude ad table id ad table id ad column id ad column id ro ro column accessro m columnaccess i is read only ret value return ret value else include if you include access to a column and select read only you can only read data otherwise full access if m columnaccess i getad table id ad table id ret value false if m columnaccess i getad column id ad column id if ro rw only if not r o ret value m columnaccess i is read only else ret value true if ret value log fine include ad table id ad table id ad column id ad column id ro ro column accessro m columnaccess i is read only ret value return ret value same table include for all table access if ret value log fine ad table id ad table id ad column id ad column id ro ro ret value return ret value ad_table_id ad_column_id iscolumnaccess ad_table_id ad_column_id istableaccess ad_table_id loadcolumnaccess retvalue m_columnaccess m_columnaccess isexclude m_columnaccess getad_table_id ad_table_id m_columnaccess getad_column_id ad_column_id retvalue m_columnaccess isreadonly retvalue retvalue ad_table_id ad_table_id ad_column_id ad_column_id columnaccessro m_columnaccess isreadonly retvalue retvalue m_columnaccess getad_table_id ad_table_id retvalue m_columnaccess getad_column_id ad_column_id retvalue m_columnaccess isreadonly retvalue retvalue ad_table_id ad_table_id ad_column_id ad_column_id columnaccessro m_columnaccess isreadonly retvalue retvalue retvalue ad_table_id ad_table_id ad_column_id ad_column_id retvalue retvalue access to record no check of table param ad table id table param record id record param ro read only return boolean public boolean is record access int ad table id int record id boolean ro if is table access ad table id ro no access to table return false load record access false boolean negative list true for int i 0 i m recordaccess length i m record access ra m recordaccess i if ra getad table id ad table id continue if ra is exclude exclude if you exclude access to a column and select read only you can only read data otherwise no access if ra getrecord id record id if ro return ra is read only else return false else include if you include access to a column and select read only you can only read data otherwise full access negative list false has to be defined if ra getrecord id record id if ro return ra is read only else ro return true for all table access return negative list ad_table_id record_id isrecordaccess ad_table_id record_id istableaccess ad_table_id loadrecordaccess negativelist m_recordaccess mrecordaccess m_recordaccess getad_table_id ad_table_id isexclude getrecord_id record_id isreadonly negativelist getrecord_id record_id isreadonly negativelist get window access param ad window id window return null in no access true if r w and false if r o public boolean get window access int ad window id if m windowaccess null m windowaccess new hash map integer boolean 100 string sql select ad window id is read write from ad window access where ad role id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m windowaccess put new integer rs get int 1 new boolean y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log fine m windowaccess size reload boolean ret value boolean m windowaccess get new integer ad window id log fine get window access ad window id ad window id ret value return ret value ad_window_id getwindowaccess ad_window_id m_windowaccess m_windowaccess hashmap ad_window_id isreadwrite ad_window_access ad_role_id isactive preparedstatement preparestatement get_trxname setint getad_role_id resultset executequery m_windowaccess getint getstring m_windowaccess retvalue m_windowaccess ad_window_id getwindowaccess ad_window_id ad_window_id retvalue retvalue get process access param ad process id process return null in no access true if r w and false if r o public boolean get process access int ad process id if m processaccess null m processaccess new hash map integer boolean 50 string sql select ad process id is read write from ad process access where ad role id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m processaccess put new integer rs get int 1 new boolean y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null reload return boolean m processaccess get new integer ad process id ad_process_id getprocessaccess ad_process_id m_processaccess m_processaccess hashmap ad_process_id isreadwrite ad_process_access ad_role_id isactive preparedstatement preparestatement get_trxname setint getad_role_id resultset executequery m_processaccess getint getstring m_processaccess ad_process_id get task access param ad task id task return null in no access true if r w and false if r o public boolean get task access int ad task id if m taskaccess null m taskaccess new hash map integer boolean 10 string sql select ad task id is read write from ad task access where ad role id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m taskaccess put new integer rs get int 1 new boolean y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null reload return boolean m taskaccess get new integer ad task id ad_task_id gettaskaccess ad_task_id m_taskaccess m_taskaccess hashmap ad_task_id isreadwrite ad_task_access ad_role_id isactive preparedstatement preparestatement get_trxname setint getad_role_id resultset executequery m_taskaccess getint getstring m_taskaccess ad_task_id get form access param ad form id form return null in no access true if r w and false if r o public boolean get form access int ad form id if m formaccess null m formaccess new hash map integer boolean 20 string sql select ad form id is read write from ad form access where ad role id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m formaccess put new integer rs get int 1 new boolean y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null reload return boolean m formaccess get new integer ad form id ad_form_id getformaccess ad_form_id m_formaccess m_formaccess hashmap ad_form_id isreadwrite ad_form_access ad_role_id isactive preparedstatement preparestatement get_trxname setint getad_role_id resultset executequery m_formaccess getint getstring m_formaccess ad_form_id get workflow access param ad workflow id workflow return null in no access true if r w and false if r o public boolean get workflow access int ad workflow id if m workflowaccess null m workflowaccess new hash map integer boolean 20 string sql select ad workflow id is read write from ad workflow access where ad role id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad role id result set rs pstmt execute query while rs next m workflowaccess put new integer rs get int 1 new boolean y equals rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null reload return boolean m workflowaccess get new integer ad workflow id ad_workflow_id getworkflowaccess ad_workflow_id m_workflowaccess m_workflowaccess hashmap ad_workflow_id isreadwrite ad_workflow_access ad_role_id isactive preparedstatement preparestatement get_trxname setint getad_role_id resultset executequery m_workflowaccess getint getstring m_workflowaccess ad_workflow_id appends where clause to sql statement for table param sql existing sql statement param table name in table name or list of table names aaa bbb or aaa a bbb b param fully qualified fully qualified names param rw if false includes system data return updated sql statement public string add accesssql string sql string table name in boolean fully qualified boolean rw string buffer retsql new string buffer cut off last order by clause string order by int pos order sql last index of order by if pos order 1 order by sql substring pos order retsql append sql substring 0 pos order else retsql append sql parse sql access sql parser asp new access sql parser retsql to string access sql parser table info ti asp get table info asp get main sql index do we have to add where or and if asp get main sql index of where 1 retsql append where else retsql append and use first table string table name if ti length 0 table name ti 0 get synonym if table name length 0 table name ti 0 get table name if table name in null table name equals table name in string msg table name not correctly parsed table name in table name in asp if ti length 0 msg 1 ti 0 msg n sql log log level severe msg trace print stack table name table name in client access if fully qualified retsql append table name append retsql append get client where rw org access if is access all orgs retsql append and if fully qualified retsql append table name append retsql append get org where rw data access for int i 0 i ti length i string table name ti i get table name int ad table id getad table id table name data table access if ad table id 0 is table access ad table id rw retsql append and 1 3 prevent access at all log fine no access to ad table id ad table id table name retsql break no need to check further data column access data record access string key column name if fully qualified key column name ti i get synonym table synonym if key column name length 0 key column name table name key column name key column name table name id derived from table log fine add accesssql table name ad table id key column name string record where get record where ad table id key column name rw if record where length 0 retsql append and append record where log finest record access record where for all table info dependent records only for main sql string main sql asp get main sql load record access false int ad table id 0 string where column name null array list integer includes new array list integer array list integer excludes new array list integer for int i 0 i m recorddependentaccess length i string column name m recorddependentaccess i get key column name asp get table info asp get main sql index if column name null continue no key column int pos column main sql index of column name if pos column 1 continue we found the column name make sure it s a clumn name char char check main sql char at pos column 1 before if char check char check char check char check continue char check main sql char at pos column column name length after if char check char check char check continue if ad table id 0 ad table id m recorddependentaccess i getad table id retsql append get dependent access where column name includes excludes ad table id m recorddependentaccess i getad table id we found the column in the main query if m recorddependentaccess i is exclude excludes add m recorddependentaccess i getrecord id log fine exclude column name m recorddependentaccess i else if rw m recorddependentaccess i is read only includes add m recorddependentaccess i getrecord id log fine include column name m recorddependentaccess i where column name get dependent record where column main sql column name for all dependent records retsql append get dependent access where column name includes excludes retsql append order by log finest retsql to string return retsql to string tablenamein fullyqualified fullyqualified addaccesssql tablenamein fullyqualified stringbuffer stringbuffer orderby posorder lastindexof posorder orderby posorder posorder accesssqlparser accesssqlparser tostring accesssqlparser tableinfo gettableinfo getmainsqlindex getmainsql indexof tablename tablename getsynonym tablename tablename gettablename tablenamein tablename tablenamein tablename tablenamein tablenamein printstack tablename tablenamein fullyqualified tablename getclientwhere isaccessallorgs fullyqualified tablename getorgwhere tablename gettablename ad_table_id getad_table_id tablename ad_table_id istableaccess ad_table_id ad_table_id ad_table_id tablename keycolumnname fullyqualified keycolumnname getsynonym keycolumnname keycolumnname tablename keycolumnname keycolumnname tablename _id addaccesssql tablename ad_table_id keycolumnname recordwhere getrecordwhere ad_table_id keycolumnname recordwhere recordwhere recordwhere mainsql getmainsql loadrecordaccess ad_table_id wherecolumnname arraylist arraylist arraylist arraylist m_recorddependentaccess columnname m_recorddependentaccess getkeycolumnname gettableinfo getmainsqlindex columnname poscolumn mainsql indexof columnname poscolumn charcheck mainsql charat poscolumn charcheck charcheck charcheck charcheck charcheck mainsql charat poscolumn columnname charcheck charcheck charcheck ad_table_id ad_table_id m_recorddependentaccess getad_table_id getdependentaccess wherecolumnname ad_table_id m_recorddependentaccess getad_table_id m_recorddependentaccess isexclude m_recorddependentaccess getrecord_id columnname m_recorddependentaccess m_recorddependentaccess isreadonly m_recorddependentaccess getrecord_id columnname m_recorddependentaccess wherecolumnname getdependentrecordwherecolumn mainsql columnname getdependentaccess wherecolumnname orderby tostring tostring get dependent access param where column name column param includes ids to include param excludes ids to exclude return where clause starting with and or private string get dependent access string where column name array list integer includes array list integer excludes if includes size 0 excludes size 0 return if includes size 0 excludes size 0 log warning mixing include and excluse rules will not return values string buffer where new string buffer and if includes size 1 where append where column name append append includes get 0 else if includes size 1 where append where column name append in for int ii 0 ii includes size ii if ii 0 where append where append includes get ii where append else if excludes size 1 where append where column name append append excludes get 0 else if excludes size 1 where append where column name append not in for int ii 0 ii excludes size ii if ii 0 where append where append excludes get ii where append log finest where to string return where to string wherecolumnname getdependentaccess wherecolumnname arraylist arraylist stringbuffer stringbuffer wherecolumnname wherecolumnname wherecolumnname wherecolumnname tostring tostring get dependent record where clause param main sql sql to examine param column name column name return where clause column x column name private string get dependent record where column string main sql string column name string ret value column name if nothing else found int index main sql index of column name see if there are table synonym int offset index 1 char c main sql char at offset if c string buffer sb new string buffer while c c c delimeter sb insert 0 c c main sql char at offset sb append column name return sb to string return ret value mainsql columnname columnname columnname getdependentrecordwherecolumn mainsql columnname retvalue columnname mainsql indexof columnname mainsql charat stringbuffer stringbuffer mainsql charat columnname tostring retvalue upadate can i update the record access error info access table no update is saved in the log param ad client id comntext to derive client org user level param ad org id number of the current window to retrieve context param ad table id int param create error boolean return true if you can update see org compiere model m table data save boolean public boolean can update int ad client id int ad org id int ad table id int record id boolean create error string user level get user level format sco if user level index of s 1 system cannot change anything return true boolean ret value true string what missing system client 0 org 0 if ad client id 0 ad org id 0 user level char at 0 s ret value false what missing s client client 0 org 0 else if ad client id 0 ad org id 0 user level char at 1 c if user level char at 2 o is org access ad org id true client org with access to else ret value false what missing c organization client 0 org 0 else if ad client id 0 ad org id 0 user level char at 2 o ret value false what missing o data access if ret value ret value is table access ad table id false if ret value record id 0 ret value is record access ad table id record id false if ret value create error log save error access table no update ad client id ad client id ad org id ad org id user level user level missing what missing log warning to string return ret value accesstablenoupdate ad_client_id ad_org_id ad_table_id createerror mtable datasave canupdate ad_client_id ad_org_id ad_table_id record_id createerror userlevel getuserlevel userlevel indexof retvalue whatmissing ad_client_id ad_org_id userlevel charat retvalue whatmissing ad_client_id ad_org_id userlevel charat userlevel charat isorgaccess ad_org_id retvalue whatmissing ad_client_id ad_org_id userlevel charat retvalue whatmissing retvalue retvalue istableaccess ad_table_id retvalue record_id retvalue isrecordaccess ad_table_id record_id retvalue createerror saveerror accesstablenoupdate ad_client_id ad_client_id ad_org_id ad_org_id userlevel userlevel whatmissing tostring retvalue view can i view record in table with given table level code table level s 100 4 system info sco 111 7 system shared info sc 110 6 system client info co 011 3 client shared info c 011 2 client shared info o 001 1 organization info code param ctx context param table level access level return true false access error info access table no update access table no view is saved in the log see org compiere model m tabvo load tab details m tabvo result set public boolean can view properties ctx string table level string user level get user level format sco boolean ret value true 7 all if x ad table accesslevel all equals table level ret value true 4 system data requires s else if x ad table accesslevel systemonly equals table level user level char at 0 s ret value false 2 client data requires c else if x ad table accesslevel clientonly equals table level user level char at 1 c ret value false 1 organization data requires o else if x ad table accesslevel organization equals table level user level char at 2 o ret value false 3 client shared requires c or o else if x ad table accesslevel clientplusorganization equals table level user level char at 1 c user level char at 2 o ret value false 6 system client requires s or c else if x ad table accesslevel systemplusclient equals table level user level char at 0 s user level char at 1 c ret value false if ret value return ret value notification if for insert log save error access table no update required table level get table level string env getad language ctx table level user level user level else log save error access table no view required table level get table level string env getad language ctx table level user level user level log info to string return ret value tablelevel tablelevel s__ sc_ _co _c_ __o tablelevel accesslevel accesstablenoupdate accesstablenoview mtabvo loadtabdetails mtabvo resultset canview tablelevel userlevel getuserlevel retvalue x_ad_table accesslevel_all tablelevel retvalue x_ad_table accesslevel_systemonly tablelevel userlevel charat retvalue x_ad_table accesslevel_clientonly tablelevel userlevel charat retvalue x_ad_table accesslevel_organization tablelevel userlevel charat retvalue x_ad_table accesslevel_clientplusorganization tablelevel userlevel charat userlevel charat retvalue x_ad_table accesslevel_systemplusclient tablelevel userlevel charat userlevel charat retvalue retvalue retvalue forinsert saveerror accesstablenoupdate tablelevel gettablelevelstring getad_language tablelevel userlevel userlevel saveerror accesstablenoview tablelevel gettablelevelstring getad_language tablelevel userlevel userlevel tostring retvalue returns clear text string of table level param ad language language param table level level return info private string get table level string string ad language string table level string level table level if table level equals 1 level access org else if table level equals 2 level access client else if table level equals 3 level access client org else if table level equals 4 level access system else if table level equals 6 level access system client else if table level equals 7 level access shared return msg get msg ad language level tablelevel ad_language tablelevel gettablelevelstring ad_language tablelevel tablelevel tablelevel accessorg tablelevel accessclient tablelevel accessclientorg tablelevel accesssystem tablelevel accesssystemclient tablelevel accessshared getmsg ad_language get table id from name param table name table name return ad table id or 0 private int getad table id string table name load table info false integer ii integer m tablename get table name if ii null return ii int value log log level warning getad table id not found table name return 0 tablename ad_table_id getad_table_id tablename loadtableinfo m_tablename tablename intvalue getad_table_id tablename return where clause for record access param ad table id table param key column name fully qualified key column name param rw true if read write return where clause or private string get record where int ad table id string key column name boolean rw load record access false string buffer sb include new string buffer string buffer sb exclude new string buffer role access for int i 0 i m recordaccess length i if m recordaccess i getad table id ad table id not in x if m recordaccess i is exclude if sb exclude length 0 sb exclude append key column name append not in else sb exclude append sb exclude append m recordaccess i getrecord id in x else if rw m recordaccess i is read only include if sb include length 0 sb include append key column name append in else sb include append sb include append m recordaccess i getrecord id for all table access string buffer sb new string buffer if sb exclude length 0 sb append sb exclude append if sb include length 0 if sb length 0 sb append and sb append sb include append don t ignore privacy access if is personal access string lockedi ds m private access get locked record where ad table id m ad user id if lockedi ds null if sb length 0 sb append and sb append key column name append lockedi ds return sb to string ad_table_id keycolumnname getrecordwhere ad_table_id keycolumnname loadrecordaccess stringbuffer sbinclude stringbuffer stringbuffer sbexclude stringbuffer m_recordaccess m_recordaccess getad_table_id ad_table_id m_recordaccess isexclude sbexclude sbexclude keycolumnname sbexclude sbexclude m_recordaccess getrecord_id m_recordaccess isreadonly sbinclude sbinclude keycolumnname sbinclude sbinclude m_recordaccess getrecord_id stringbuffer stringbuffer sbexclude sbexclude sbinclude sbinclude ispersonalaccess lockedids mprivateaccess getlockedrecordwhere ad_table_id m_ad_user_id lockedids keycolumnname lockedids tostring show value preference menu return true if preference type is not none public boolean is show preference return m role preferencetype none equals get preference type isshowpreference mrole preferencetype_none getpreferencetype org access constructor param ad client id client param ad org id org param read only r o public org access int ad client id int ad org id boolean read only this ad client id ad client id this ad org id ad org id this read only read only ad_client_id ad_org_id readonly orgaccess ad_client_id ad_org_id readonly ad_client_id ad_client_id ad_org_id ad_org_id readonly readonly equals param obj object to compare return true if equals public boolean equals object obj if obj null obj instanceof org access org access comp org access obj return comp ad client id ad client id comp ad org id ad org id return false orgaccess orgaccess orgaccess ad_client_id ad_client_id ad_org_id ad_org_id hash code return hash code public int hash code return ad client id 7 ad org id hashcode ad_client_id ad_org_id extended string representation return extended info public string to string string client name system if ad client id 0 client name m client get get ctx ad client id get name string org name if ad org id 0 org name m org get get ctx ad org id get name string buffer sb new string buffer sb append msg translate get ctx ad client id append append client name append append msg translate get ctx ad org id append append org name if read only sb append r o return sb to string tostring clientname ad_client_id clientname mclient getctx ad_client_id getname orgname ad_org_id orgname morg getctx ad_org_id getname stringbuffer stringbuffer getctx ad_client_id clientname getctx ad_org_id orgname readonly tostring constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param m location location model public v location string column name boolean mandatory boolean is read only boolean is updateable m location lookup m location super super set name column name m columnname column name m mlocation m location look and feel install border this text field border this set layout new border layout size this set preferred size m text get preferred size causes r o to be the same length int height m text get preferred size height button m button set icon env get image icon location10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this this add m button border layout east button text m text set border null m text set editable false m text set focusable false m text set font compiereplaf getfont field m text set foreground compiereplaf gettextcolor normal m text add mouse listener new vlocation mouseadapter this this add m text border layout center editable if is read only is updateable set read write false else set read write true set mandatory mandatory m delete new c menu item msg get msg env get ctx delete env get image icon delete16 gif m delete add action listener this popup menu add m delete columnname isreadonly isupdateable mlocation vlocation columnname isreadonly isupdateable mlocationlookup mlocation setname columnname m_columnname columnname m_mlocation mlocation lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize m_button seticon getimageicon m_button setmargin m_button setpreferredsize m_button addactionlistener m_button borderlayout m_text setborder m_text seteditable m_text setfocusable m_text setfont getfont_field m_text setforeground gettextcolor_normal m_text addmouselistener vlocation_mouseadapter m_text borderlayout isreadonly isupdateable setreadwrite setreadwrite setmandatory mdelete cmenuitem getmsg getctx getimageicon mdelete addactionlistener popupmenu mdelete dispose public void dispose m text null m button null m mlocation null m_text m_button m_mlocation enable disable param value true if read write public void set read write boolean value m button set read write value if m button is visible value m button set visible value set background false readwrite setreadwrite m_button setreadwrite m_button isvisible m_button setvisible setbackground is read write return value true if read write public boolean is read write return m button is read write isreadwrite readwrite isreadwrite m_button isreadwrite set mandatory and back bolor param mandatory true if mandatory public void set mandatory boolean mandatory m button set mandatory mandatory set background false setmandatory m_button setmandatory setbackground is it mandatory return true if mandatory public boolean is mandatory return m button is mandatory ismandatory m_button ismandatory set background param color color public void set background color color if color equals m text get background m text set background color setbackground m_text getbackground m_text setbackground set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if is mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive ismandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set foreground param fg color public void set foreground color fg m text set foreground fg setforeground m_text setforeground set editor to value param value value public void set value object value if value null m value null m text set text null else m value m mlocation get location value null if m value null m text set text value else m text set text m value to string setvalue m_value m_text settext m_value m_mlocation getlocation m_value m_text settext m_text settext m_value tostring request focus public void request focus m text request focus requestfocus m_text requestfocus property change listener param evt property change event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychangeevent propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value if m value null return null return new integer m value getc location id getvalue m_value m_value getc_location_id return editor value return value public int getc location id if m value null return 0 return m value getc location id getc_location_id m_value m_value getc_location_id return display value return display value public string get display return m text get text getdisplay m_text gettext action listener button start dialog param e action event public void action performed action event e if e get source m delete m value null create new log config action performed m value v location dialog ld new v location dialog env get frame this msg get msg env get ctx location m value ld set visible true m value ld get value if e get source m delete else if ld is changed return data binding try int c location id 0 if m value null c location id m value getc location id integer ii new integer c location id force change user does not realize that embedded object is already saved fire vetoable change m columnname null null resets m mlocation if c location id 0 fire vetoable change m columnname null ii set value ii catch property veto exception pve log log level severe v location action performed pve actionlistener actionevent actionperformed actionevent getsource mdelete m_value actionperformed m_value vlocationdialog vlocationdialog getframe getmsg getctx m_value setvisible m_value getvalue getsource mdelete ischanged c_location_id m_value c_location_id m_value getc_location_id c_location_id firevetoablechange m_columnname m_mlocation c_location_id firevetoablechange m_columnname setvalue propertyvetoexception vlocation actionperformed action listener interface param listener listener public void add action listener action listener listener m text add action listener listener addactionlistener actionlistener m_text addactionlistener set field window no for value preference nop param m field model field public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield constructor param adaptee adaptee vlocation mouseadapter v location adaptee this adaptee adaptee vlocation_mouseadapter vlocation mouse listener param e mouse event public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseevent mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource get all asset registration attributes not cached refreshes cache for direct addess param ctx context return array of registration attributes public static m registration attribute get all properties ctx store refresh cache and add to list array list m registration attribute list new array list m registration attribute string sql select from a registrationattribute where ad client id order by seq no int ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next m registration attribute value new m registration attribute ctx rs null integer key new integer value geta registrationattribute id s cache put key value list add value rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m registration attribute ret value new m registration attribute list size list to array ret value return ret value mregistrationattribute getall arraylist mregistrationattribute arraylist mregistrationattribute a_registrationattribute ad_client_id seqno ad_client_id getad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery mregistrationattribute mregistrationattribute geta_registrationattribute_id s_cache s_log mregistrationattribute retvalue mregistrationattribute toarray retvalue retvalue get registration attribute cached param ctx context param a registrationattribute id id return registration attribute public static m registration attribute get properties ctx int a registrationattribute id string trx name integer key new integer a registrationattribute id m registration attribute ret value m registration attribute s cache get key if ret value null ret value new m registration attribute ctx a registrationattribute id trx name s cache put key ret value return ret value a_registrationattribute_id mregistrationattribute a_registrationattribute_id trxname a_registrationattribute_id mregistrationattribute retvalue mregistrationattribute s_cache retvalue retvalue mregistrationattribute a_registrationattribute_id trxname s_cache retvalue retvalue standard constructor param ctx context param a registrationattribute id id public m registration attribute properties ctx int a registrationattribute id string trx name super ctx a registrationattribute id trx name a_registrationattribute_id mregistrationattribute a_registrationattribute_id trxname a_registrationattribute_id trxname load constructor param ctx context param rs result set public m registration attribute properties ctx result set rs string trx name super ctx rs trx name mregistrationattribute resultset trxname trxname standard constructor public x ad treenodepr properties ctx int ad treenodepr id string trx name super ctx ad treenodepr id trx name if ad treenodepr id 0 setad tree id 0 setnode id 0 x_ad_treenodepr ad_treenodepr_id trxname ad_treenodepr_id trxname ad_treenodepr_id setad_tree_id setnode_id load constructor public x ad treenodepr properties ctx result set rs string trx name super ctx rs trx name x_ad_treenodepr resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad treenodepr append get id append return sb to string tostring stringbuffer stringbuffer x_ad_treenodepr get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set node id public void setnode id int node id if node id 0 throw new illegal argument exception node id is mandatory set valuenocheck node id new integer node id node_id setnode_id node_id node_id illegalargumentexception node_id set_valuenocheck node_id node_id get node id public int getnode id integer ii integer get value node id if ii null return 0 return ii int value node_id getnode_id get_value node_id intvalue set parent parent of entity public void setparent id int parent id if parent id 0 set value parent id null else set value parent id new integer parent id setparent_id parent_id parent_id set_value parent_id set_value parent_id parent_id get parent parent of entity public int getparent id integer ii integer get value parent id if ii null return 0 return ii int value getparent_id get_value parent_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x ad pinstance para properties ctx int ad pinstance para id string trx name super ctx ad pinstance para id trx name if ad pinstance para id 0 setad pinstance id 0 set seq no 0 x_ad_pinstance_para ad_pinstance_para_id trxname ad_pinstance_para_id trxname ad_pinstance_para_id setad_pinstance_id setseqno load constructor public x ad pinstance para properties ctx result set rs string trx name super ctx rs trx name x_ad_pinstance_para resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad pinstance para append get id append return sb to string tostring stringbuffer stringbuffer x_ad_pinstance_para get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set info information public void set info string info if info null info length 60 log warning length 60 truncated info info substring 0 59 set value info info setinfo set_value get info information public string get info return string get value info getinfo get_value set info to public void setinfo to string info to if info to null info to length 60 log warning length 60 truncated info to info to substring 0 59 set value info to info to setinfo_to info_to info_to info_to info_to info_to set_value info_to info_to get info to public string getinfo to return string get value info to getinfo_to get_value info_to set process date process parameter public void setp date timestamp p date set value p date p date setp_date p_date set_value p_date p_date get process date process parameter public timestamp getp date return timestamp get value p date getp_date get_value p_date set process date to process parameter public void setp date to timestamp p date to set value p date to p date to setp_date_to p_date_to set_value p_date_to p_date_to get process date to process parameter public timestamp getp date to return timestamp get value p date to getp_date_to get_value p_date_to set process number process parameter public void setp number big decimal p number set value p number p number setp_number bigdecimal p_number set_value p_number p_number get process number process parameter public big decimal getp number big decimal bd big decimal get value p number if bd null return env zero return bd bigdecimal getp_number bigdecimal bigdecimal get_value p_number set process number to process parameter public void setp number to big decimal p number to set value p number to p number to setp_number_to bigdecimal p_number_to set_value p_number_to p_number_to get process number to process parameter public big decimal getp number to big decimal bd big decimal get value p number to if bd null return env zero return bd bigdecimal getp_number_to bigdecimal bigdecimal get_value p_number_to set process string process parameter public void setp string string p string if p string null p string length 60 log warning length 60 truncated p string p string substring 0 59 set value p string p string setp_string p_string p_string p_string p_string p_string set_value p_string p_string get process string process parameter public string getp string return string get value p string getp_string get_value p_string set process string to process parameter public void setp string to string p string to if p string to null p string to length 60 log warning length 60 truncated p string to p string to substring 0 59 set value p string to p string to setp_string_to p_string_to p_string_to p_string_to p_string_to p_string_to set_value p_string_to p_string_to get process string to process parameter public string getp string to return string get value p string to getp_string_to get_value p_string_to set parameter name public void set parameter name string parameter name if parameter name null parameter name length 60 log warning length 60 truncated parameter name parameter name substring 0 59 set value parameter name parameter name setparametername parametername parametername parametername parametername parametername set_value parametername parametername get parameter name public string get parameter name return string get value parameter name getparametername get_value parametername return string get value parameter name public key name pair get key name pair return new key name pair get id get parameter name get_value parametername keynamepair getkeynamepair keynamepair get_id getparametername set sequence method of ordering records lowest number comes first public void set seq no int seq no set valuenocheck seq no new integer seq no setseqno seqno set_valuenocheck seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x c bankstatementmatcher properties ctx int c bankstatementmatcher id string trx name super ctx c bankstatementmatcher id trx name if c bankstatementmatcher id 0 setc bankstatementmatcher id 0 set classname null set name null set seq no 0 x_c_bankstatementmatcher c_bankstatementmatcher_id trxname c_bankstatementmatcher_id trxname c_bankstatementmatcher_id setc_bankstatementmatcher_id setclassname setname setseqno load constructor public x c bankstatementmatcher properties ctx result set rs string trx name super ctx rs trx name x_c_bankstatementmatcher resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankstatementmatcher append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankstatementmatcher get_id tostring set bank statement matcher algorithm to match bank statement info to business partners invoices and payments public void setc bankstatementmatcher id int c bankstatementmatcher id if c bankstatementmatcher id 1 throw new illegal argument exception c bankstatementmatcher id is mandatory set valuenocheck c bankstatementmatcher id new integer c bankstatementmatcher id setc_bankstatementmatcher_id c_bankstatementmatcher_id c_bankstatementmatcher_id illegalargumentexception c_bankstatementmatcher_id set_valuenocheck c_bankstatementmatcher_id c_bankstatementmatcher_id get bank statement matcher algorithm to match bank statement info to business partners invoices and payments public int getc bankstatementmatcher id integer ii integer get value c bankstatementmatcher id if ii null return 0 return ii int value getc_bankstatementmatcher_id get_value c_bankstatementmatcher_id intvalue set classname java classname public void set classname string classname if classname null throw new illegal argument exception classname is mandatory if classname length 60 log warning length 60 truncated classname classname substring 0 59 set value classname classname setclassname illegalargumentexception set_value get classname java classname public string get classname return string get value classname getclassname get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x m distributionrun properties ctx int m distributionrun id string trx name super ctx m distributionrun id trx name if m distributionrun id 0 set is create single order false n setm distributionrun id 0 set name null x_m_distributionrun m_distributionrun_id trxname m_distributionrun_id trxname m_distributionrun_id setiscreatesingleorder setm_distributionrun_id setname load constructor public x m distributionrun properties ctx result set rs string trx name super ctx rs trx name x_m_distributionrun resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m distributionrun append get id append return sb to string tostring stringbuffer stringbuffer x_m_distributionrun get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set create single order for all shipments create one order public void set is create single order boolean is create single order set value is create single order new boolean is create single order setiscreatesingleorder iscreatesingleorder set_value iscreatesingleorder iscreatesingleorder get create single order for all shipments create one order public boolean is create single order object oo get value is create single order if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatesingleorder get_value iscreatesingleorder booleanvalue set distribution run distribution run create orders to distribute products to a selected list of partners public void setm distributionrun id int m distributionrun id if m distributionrun id 1 throw new illegal argument exception m distributionrun id is mandatory set valuenocheck m distributionrun id new integer m distributionrun id setm_distributionrun_id m_distributionrun_id m_distributionrun_id illegalargumentexception m_distributionrun_id set_valuenocheck m_distributionrun_id m_distributionrun_id get distribution run distribution run create orders to distribute products to a selected list of partners public int getm distributionrun id integer ii integer get value m distributionrun id if ii null return 0 return ii int value getm_distributionrun_id get_value m_distributionrun_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue get contents return context public object get contents return contents getcontents set ad wf activity id param info el activity info public void set activityid string info el m activityid el info el ad_wf_activity_id info_el setactivityid info_el m_activityid_el info_el start tag return skip body throws jsp exception public int do start tag throws jsp exception properties ctx jsp env get ctx http servlet request page context get request activity int ad wf activity id 0 string info null try info string expression util eval not null workflow activityid m activityid el string class this page context if info null info length 0 ad wf activity id integer parse int info catch exception e log severe do start tag activity e mwf activity act new mwf activity ctx ad wf activity id null if ad wf activity id 0 act null act get id ad wf activity id log severe do start tag activity not found m activityid el info return skip body string name null if act is user approval name is approved else if act is user manual name is confirmed else return skip body yes no option yes no options new option 3 yes no options 0 new option yes no options 0 add element yes no options 0 set selected true yes no options 1 new option y yes no options 1 add element util maskhtml msg translate ctx yes yes no options 2 new option n yes no options 2 add element util maskhtml msg translate ctx no select yes no select new select name yes no options yes no select setid id name yes no select set class c mandatory string name trl msg translate ctx name assemble html code html new html code html add element new b name trl html add element yes no select html add element new br jsp writer out page context get out html output out return skip body skip_body jspexception dostarttag jspexception jspenv getctx httpservletrequest pagecontext getrequest ad_wf_activity_id expressionutil evalnotnull m_activityid_el pagecontext ad_wf_activity_id parseint dostarttag mwfactivity mwfactivity ad_wf_activity_id ad_wf_activity_id get_id ad_wf_activity_id dostarttag m_activityid_el skip_body isuserapproval isapproved isusermanual isconfirmed skip_body yesno yesnooptions yesnooptions yesnooptions addelement yesnooptions setselected yesnooptions yesnooptions addelement yesnooptions yesnooptions addelement yesnoselect yesnooptions yesnoselect id_ yesnoselect setclass c_mandatory nametrl htmlcode htmlcode addelement nametrl addelement yesnoselect addelement jspwriter pagecontext getout skip_body end tag nop return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page construct the dialog need to call init login for dynamic start param parent parent public a login frame parent super parent login true modal log finer set default close operation j dialog dispose on close m windowno env create window no null res resource bundle get bundle resource try jb init catch exception e log severe e to string focus to ok this get root pane set default button confirm panel getok button parent set icon image compiere get image16 initlogin alogin setdefaultcloseoperation jdialog dispose_on_close m_windowno createwindowno resourcebundle getbundle jbinit tostring getrootpane setdefaultbutton confirmpanel getokbutton seticonimage getimage16 component initialization throws exception private void jb init throws exception this set name login title label set font new java awt font serif 2 10 title label set foreground color blue title label set request focus enabled false title label set tool tip text compiere geturl title label set horizontal text position swing constants center title label set icon compiere get image icon logo title label set text compiere get subtitle title label set vertical text position swing constants bottom version label set request focus enabled false version label set horizontal alignment swing constants right version label set horizontal text position swing constants right host label set request focus enabled false host label set label for host field host field add action listener this user label set request focus enabled false user label set label for user text field password label set request focus enabled false password label set label for password field language label set label for language combo copy0 label set font new java awt font serif 2 10 copy0 label set foreground color blue copy0 label set request focus enabled false copy1 label set request focus enabled false role label set request focus enabled false role label set label for role combo client label set request focus enabled false org label set request focus enabled false date label set request focus enabled false warehouse label set request focus enabled false printer label set request focus enabled false compile date set horizontal alignment swing constants right compile date set horizontal text position swing constants right compile date set text compiere date version compile date set tool tip text compiere get implementation vendor south panel set layout south layout login tab pane add change listener this connection tab connection panel set layout connection layout title label set horizontal alignment swing constants center version label set text compiere main version version label set tool tip text compiere get implementation version host label set horizontal alignment swing constants right host label set text host connection panel add host label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 connection panel add host field new grid bag constraints 1 2 3 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 user label set horizontal alignment swing constants right user label set text user connection panel add user label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 user text field set text system default connection panel add user text field new grid bag constraints 1 3 3 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 password label set horizontal alignment swing constants right password label set text password connection panel add password label new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 password field set text system default connection panel add password field new grid bag constraints 1 4 3 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 language label set horizontal alignment swing constants right language label set text language connection panel add language label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 language combo add action listener this connection panel add language combo new grid bag constraints 1 5 3 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 copy0 label set horizontal alignment swing constants right connection panel add copy0 label new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 copy1 label set text compiere copyright connection panel add copy1 label new grid bag constraints 1 6 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 12 12 0 0 connection panel add compile date new grid bag constraints 2 1 2 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 2 0 0 12 0 0 connection panel add title label new grid bag constraints 0 0 2 2 0 0 0 0 grid bag constraints west grid bag constraints none new insets 12 12 5 5 0 0 connection panel add version label new grid bag constraints 2 0 2 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 5 0 12 0 0 login tab pane add connection panel res get string connection default tab default panel set layout default panel layout role label set text role role label set horizontal alignment swing constants right role combo add action listener this default panel add role label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 12 5 5 0 0 default panel add role combo new grid bag constraints 1 0 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 12 0 0 client label set text client client label set horizontal alignment swing constants right default panel add client label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 client combo add action listener this default panel add client combo new grid bag constraints 1 1 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 org label set text organization org label set horizontal alignment swing constants right default panel add org label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 org combo add action listener this default panel add org combo new grid bag constraints 1 2 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 date label set text date date label set horizontal alignment swing constants right default panel add date label new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 default panel add date field new grid bag constraints 1 4 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 warehouse label set text warehouse warehouse label set horizontal alignment swing constants right printer label set text printer printer label set horizontal alignment swing constants right default panel add printer label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 12 5 0 0 default panel add printer field new grid bag constraints 1 5 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 12 12 0 0 default panel add warehouse label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 default panel add warehouse combo new grid bag constraints 1 3 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 login tab pane add default panel res get string defaults help help panel set layout help layout help panel set preferred size new dimension 100 100 help panel add help scoll pane border layout center login tab pane add help panel this get content pane add main panel main panel add login tab pane border layout center main panel set name login main panel main panel add south panel border layout south south panel add confirm panel border layout north south panel add status bar border layout south help scoll pane get viewport add online help null confirm panel add action listener this status bar set statusdb null jbinit setname titlelabel setfont titlelabel setforeground titlelabel setrequestfocusenabled titlelabel settooltiptext titlelabel sethorizontaltextposition swingconstants titlelabel seticon getimageiconlogo titlelabel settext getsubtitle titlelabel setverticaltextposition swingconstants versionlabel setrequestfocusenabled versionlabel sethorizontalalignment swingconstants versionlabel sethorizontaltextposition swingconstants hostlabel setrequestfocusenabled hostlabel setlabelfor hostfield hostfield addactionlistener userlabel setrequestfocusenabled userlabel setlabelfor usertextfield passwordlabel setrequestfocusenabled passwordlabel setlabelfor passwordfield languagelabel setlabelfor languagecombo copy0label setfont copy0label setforeground copy0label setrequestfocusenabled copy1label setrequestfocusenabled rolelabel setrequestfocusenabled rolelabel setlabelfor rolecombo clientlabel setrequestfocusenabled orglabel setrequestfocusenabled datelabel setrequestfocusenabled warehouselabel setrequestfocusenabled printerlabel setrequestfocusenabled compiledate sethorizontalalignment swingconstants compiledate sethorizontaltextposition swingconstants compiledate settext date_version compiledate settooltiptext getimplementationvendor southpanel setlayout southlayout logintabpane addchangelistener connectiontab connectionpanel setlayout connectionlayout titlelabel sethorizontalalignment swingconstants versionlabel settext main_version versionlabel settooltiptext getimplementationversion hostlabel sethorizontalalignment swingconstants hostlabel settext connectionpanel hostlabel gridbagconstraints gridbagconstraints gridbagconstraints connectionpanel hostfield gridbagconstraints gridbagconstraints gridbagconstraints userlabel sethorizontalalignment swingconstants userlabel settext connectionpanel userlabel gridbagconstraints gridbagconstraints gridbagconstraints usertextfield settext connectionpanel usertextfield gridbagconstraints gridbagconstraints gridbagconstraints passwordlabel sethorizontalalignment swingconstants passwordlabel settext connectionpanel passwordlabel gridbagconstraints gridbagconstraints gridbagconstraints passwordfield settext connectionpanel passwordfield gridbagconstraints gridbagconstraints gridbagconstraints languagelabel sethorizontalalignment swingconstants languagelabel settext connectionpanel languagelabel gridbagconstraints gridbagconstraints gridbagconstraints languagecombo addactionlistener connectionpanel languagecombo gridbagconstraints gridbagconstraints gridbagconstraints copy0label sethorizontalalignment swingconstants connectionpanel copy0label gridbagconstraints gridbagconstraints gridbagconstraints copy1label settext connectionpanel copy1label gridbagconstraints gridbagconstraints gridbagconstraints connectionpanel compiledate gridbagconstraints gridbagconstraints gridbagconstraints connectionpanel titlelabel gridbagconstraints gridbagconstraints gridbagconstraints connectionpanel versionlabel gridbagconstraints gridbagconstraints gridbagconstraints logintabpane connectionpanel getstring defaulttab defaultpanel setlayout defaultpanellayout rolelabel settext rolelabel sethorizontalalignment swingconstants rolecombo addactionlistener defaultpanel rolelabel gridbagconstraints gridbagconstraints gridbagconstraints defaultpanel rolecombo gridbagconstraints gridbagconstraints gridbagconstraints clientlabel settext clientlabel sethorizontalalignment swingconstants defaultpanel clientlabel gridbagconstraints gridbagconstraints gridbagconstraints clientcombo addactionlistener defaultpanel clientcombo gridbagconstraints gridbagconstraints gridbagconstraints orglabel settext orglabel sethorizontalalignment swingconstants defaultpanel orglabel gridbagconstraints gridbagconstraints gridbagconstraints orgcombo addactionlistener defaultpanel orgcombo gridbagconstraints gridbagconstraints gridbagconstraints datelabel settext datelabel sethorizontalalignment swingconstants defaultpanel datelabel gridbagconstraints gridbagconstraints gridbagconstraints defaultpanel datefield gridbagconstraints gridbagconstraints gridbagconstraints warehouselabel settext warehouselabel sethorizontalalignment swingconstants printerlabel settext printerlabel sethorizontalalignment swingconstants defaultpanel printerlabel gridbagconstraints gridbagconstraints gridbagconstraints defaultpanel printerfield gridbagconstraints gridbagconstraints gridbagconstraints defaultpanel warehouselabel gridbagconstraints gridbagconstraints gridbagconstraints defaultpanel warehousecombo gridbagconstraints gridbagconstraints gridbagconstraints logintabpane defaultpanel getstring helppanel setlayout helplayout helppanel setpreferredsize helppanel helpscollpane borderlayout logintabpane helppanel getcontentpane mainpanel mainpanel logintabpane borderlayout mainpanel setname loginmainpanel mainpanel southpanel borderlayout southpanel confirmpanel borderlayout southpanel statusbar borderlayout helpscollpane getviewport onlinehelp confirmpanel addactionlistener statusbar setstatusdb set initial ini parameters optional automatic login return true if connected parameters set public boolean init login m cc c connection get compiere get code base host host field set value m cc validate connection application pwd user text field set text ini get property ini p uid if ini is property bool ini p store pwd password field set text ini get property ini p pwd else password field set text language combo set selected item ini get property ini p language auto login assumes that connection is ok if ini is property bool ini p a login connectionok defaultsok if m connectionok simulate m okpressed true return m connectionok return false initlogin m_cc cconnection getcodebasehost hostfield setvalue m_cc validateconnection usertextfield settext getproperty p_uid ispropertybool p_store_pwd passwordfield settext getproperty p_pwd passwordfield settext languagecombo setselecteditem getproperty p_language autologin ispropertybool p_a_login m_connectionok m_okpressed m_connectionok window events request focus param e event protected void process window event window event e super process window event e if e getid window event window opened this to front confirm panel getok button request focus in window requestfocus processwindowevent windowevent processwindowevent windowevent window_opened tofront confirmpanel getokbutton requestfocusinwindow validate connection private void validate connection m connectionok false m cc test apps server m cc test database false host field set display validateconnection m_connectionok m_cc testappsserver m_cc testdatabase hostfield setdisplay exit action performed private void app exit m connectionok false dispose appexit m_connectionok return true if logged in return true if connected public boolean is connected return m connectionok isconnected m_connectionok did the user press ok return true if user pressed final ok button public boolean iso kpressed return m okpressed isokpressed m_okpressed action event handler param e event public void action performed action event e if e get action command equals confirm panel a ok if login tab pane get selected index 0 connectionok first ok else m okpressed true defaultsok disposes else if e get action command equals confirm panel a cancel app exit else if e get source host field validate connection else if e get source language combo language combo changed else if e get source role combo role combo changed else if e get source client combo client combo changed else if e get source org combo org combo changed actionperformed actionevent getactioncommand confirmpanel a_ok logintabpane getselectedindex m_okpressed getactioncommand confirmpanel a_cancel appexit getsource hostfield validateconnection getsource languagecombo languagecombochanged getsource rolecombo rolecombochanged getsource clientcombo clientcombochanged getsource orgcombo orgcombochanged connection ok pressed private void connectionok log info set cursor cursor get predefined cursor cursor wait cursor confirm panel getok button set enabled false m connectionok try connection if m connectionok verify language load msg language l language get login language env verify language m ctx l env set context m ctx env language l getad language msg get msg m ctx 0 migration m system system m system get m ctx if system is just migrated status bar set status line running after migration true a dialog info m windowno this after migration thread yield db after migration m ctx set defaults printer field set value ini get property ini p printer change tab to default login tab pane set selected index 1 confirm panel getok button set enabled true set cursor cursor get default cursor setcursor getpredefinedcursor wait_cursor confirmpanel getokbutton setenabled m_connectionok tryconnection m_connectionok getloginlanguage verifylanguage m_ctx setcontext m_ctx getad_language getmsg m_ctx msystem msystem m_ctx isjustmigrated statusbar setstatusline adialog m_windowno aftermigration aftermigration m_ctx printerfield setvalue getproperty p_printer logintabpane setselectedindex confirmpanel getokbutton setenabled setcursor getdefaultcursor change of tab param e event public void state changed change event e if login tab pane get selected index 2 allow access to help return if string value of password field get password equals m pwd user text field get text equals m user m connectionok false if m connectionok status bar set status line txt loggedin else status bar set status line txt notconnected true login tab pane set selected index 0 confirm panel getok button request focus statechanged changeevent logintabpane getselectedindex valueof passwordfield getpassword m_pwd usertextfield gettext m_user m_connectionok m_connectionok statusbar setstatusline txt_loggedin statusbar setstatusline txt_notconnected logintabpane setselectedindex confirmpanel getokbutton requestfocus defaults ok pressed return true if ok private boolean defaultsok log info key name pair org key name pair org combo get selected item if org null return false set properties ini set property ini p connection c connection get to string long ini set property ini p language string language combo get selected item string error m login validate login org if error null error length 0 a dialog info m windowno this error app exit return false load properties and save ini values status bar set status line loading preferences string msg m login load preferences org key name pair warehouse combo get selected item date field get timestamp printer field get display if msg length 0 a dialog info m windowno this msg check apps server db checked in menu check version exits if conflict close we are done if m connectionok this dispose return m connectionok keynamepair keynamepair orgcombo getselecteditem setproperty p_connection cconnection tostringlong setproperty p_language languagecombo getselecteditem m_login validatelogin adialog m_windowno appexit statusbar setstatusline m_login loadpreferences keynamepair warehousecombo getselecteditem datefield gettimestamp printerfield getdisplay adialog m_windowno checkversion m_connectionok m_connectionok try to connect get connection compare user info return true if connected private boolean try connection m user user text field get text m pwd new string password field get password establish connection db setdb target c connection get if db is connected status bar set status line txt nodatabase true host field set background compiereplaf getfieldbackground error return false reference check ini set property ini p compieresys reference equals ignore case c connection get get db uid get roles m login new login m ctx key name pair roles m login get roles m user m pwd if roles null roles length 0 status bar set status line txt userpwderror true user text field set background compiereplaf getfieldbackground error password field set background compiereplaf getfieldbackground error return false delete existing role items m comboactive true if role combo get item count 0 role combo remove all items initial role key name pair ini value null string ini default ini get property ini p role fill roles for int i 0 i roles length i role combo add item roles i if roles i get name equals ini default ini value roles i if ini value null role combo set selected item ini value user text field set background compiereplaf getfieldbackground normal password field set background compiereplaf getfieldbackground normal status bar set status line txt loggedin m comboactive false role combo changed return true tryconnection m_user usertextfield gettext m_pwd passwordfield getpassword setdbtarget cconnection isconnected statusbar setstatusline txt_nodatabase hostfield setbackground getfieldbackground_error setproperty p_compieresys equalsignorecase cconnection getdbuid m_login m_ctx keynamepair m_login getroles m_user m_pwd statusbar setstatusline txt_userpwderror usertextfield setbackground getfieldbackground_error passwordfield setbackground getfieldbackground_error m_comboactive rolecombo getitemcount rolecombo removeallitems keynamepair inivalue inidefault getproperty p_role rolecombo additem getname inidefault inivalue inivalue rolecombo setselecteditem inivalue usertextfield setbackground getfieldbackground_normal passwordfield setbackground getfieldbackground_normal statusbar setstatusline txt_loggedin m_comboactive rolecombochanged role changed fill client list private void role combo changed key name pair role key name pair role combo get selected item if role null m comboactive return log config role m comboactive true key name pair clients m login get clients role delete existing client org items if client combo get item count 0 client combo remove all items if org combo get item count 0 org combo remove all items no clients if clients null clients length 0 status bar set status line txt roleerror true m comboactive false return initial client key name pair ini value null string ini default ini get property ini p client fill clients for int i 0 i clients length i client combo add item clients i if clients i get name equals ini default ini value clients i fini if ini value null client combo set selected item ini value m comboactive false client combo changed rolecombochanged keynamepair keynamepair rolecombo getselecteditem m_comboactive m_comboactive keynamepair m_login getclients clientcombo getitemcount clientcombo removeallitems orgcombo getitemcount orgcombo removeallitems statusbar setstatusline txt_roleerror m_comboactive keynamepair inivalue inidefault getproperty p_client clientcombo additem getname inidefault inivalue inivalue clientcombo setselecteditem inivalue m_comboactive clientcombochanged client changed fill org warehouse list private void client combo changed key name pair client key name pair client combo get selected item if client null m comboactive return log config client m comboactive true key name pair orgs m login get orgs client delete existing cleint items if org combo get item count 0 org combo remove all items no orgs if orgs null orgs length 0 status bar set status line txt roleerror true m comboactive false return initial client key name pair org value null key name pair org value2 null string ini default ini get property ini p org fill orgs for int i 0 i orgs length i org combo add item orgs i if orgs i get name equals ini default org value orgs i if org value2 null orgs i get key 0 org value2 orgs i first non 0 org non 0 org exists and last login was with 0 if org value2 null org value null org value get key 0 org value org value2 last org if org value null org combo set selected item org value get first org else org value key name pair org combo get selected item m comboactive false org combo changed clientcombochanged keynamepair keynamepair clientcombo getselecteditem m_comboactive m_comboactive keynamepair m_login getorgs orgcombo getitemcount orgcombo removeallitems statusbar setstatusline txt_roleerror m_comboactive keynamepair orgvalue keynamepair orgvalue2 inidefault getproperty p_org orgcombo additem getname inidefault orgvalue orgvalue2 getkey orgvalue2 orgvalue2 orgvalue orgvalue getkey orgvalue orgvalue2 orgvalue orgcombo setselecteditem orgvalue orgvalue keynamepair orgcombo getselecteditem m_comboactive orgcombochanged org changed fill warehouse list private void org combo changed key name pair org key name pair org combo get selected item if org null m comboactive return log config org m comboactive true key name pair whs m login get warehouses org delete existing warehouse items if warehouse combo get item count 0 warehouse combo remove all items fill warehouses if whs null initial warehouse key name pair ini value null string ini default ini get property ini p warehouse for int i 0 i whs length i warehouse combo add item whs i if whs i get name equals ini default ini value whs i if ini value null warehouse combo set selected item ini value m comboactive false orgcombochanged keynamepair keynamepair orgcombo getselecteditem m_comboactive m_comboactive keynamepair m_login getwarehouses warehousecombo getitemcount warehousecombo removeallitems keynamepair inivalue inidefault getproperty p_warehouse warehousecombo additem getname inidefault inivalue inivalue warehousecombo setselecteditem inivalue m_comboactive check version return true if version is ok and false if version could not be checked or is not the same see a env get server version private boolean check version boolean ret value false try string version a env get server version if compiere date version equals version log config server client version ret value true else if version null string buffer msg new string buffer n msg append res get string version conflict append n append res get string version info append n msg append version null null version append append compiere date version append n msg append res get string please upgrade append n j option pane show message dialog null msg to string compiere get name res get string version conflict j option pane error message a env exit 1 catch exception e log severe contact server failed e get class to string e get message return ret value aenv getserverversion checkversion retvalue aenv getserverversion date_version retvalue stringbuffer stringbuffer getstring versionconflict getstring versioninfo date_version getstring pleaseupgrade joptionpane showmessagedialog tostring getname getstring versionconflict joptionpane error_message aenv getclass tostring getmessage retvalue change language private void language combo changed string lang name string language combo get selected item log info language lang name language language language get language lang name language set login language language env set context m ctx env language language getad language locales locale loc language get locale locale set default loc this set locale loc res resource bundle get bundle resource loc this set title res get string login host label set text res get string host user label set text res get string user user label set tool tip text res get string enter user password label set text res get string password password label set tool tip text res get string enter password language label set text res get string language language label set tool tip text res get string select language role label set text res get string role client label set text res get string client org label set text res get string organization date label set text res get string date warehouse label set text res get string warehouse printer label set text res get string printer default panel set tool tip text res get string defaults connection panel set tool tip text res get string connection txt connected res get string connected txt notconnected res get string not connected txt nodatabase res get string database not found txt userpwderror res get string user pwd error txt roleerror res get string role not found txt loggedin res get string authorized login tab pane set title at 0 res get string connection login tab pane set title at 1 res get string defaults confirm panel getok button set tool tip text res get string ok confirm panel get cancel button set tool tip text res get string cancel date field with new format date field set format date field set value new timestamp system current time millis if m connectionok status bar set status line txt loggedin else status bar set status line txt notconnected true languagecombochanged langname languagecombo getselecteditem langname getlanguage langname setloginlanguage setcontext m_ctx getad_language getlocale setdefault setlocale resourcebundle getbundle settitle getstring hostlabel settext getstring userlabel settext getstring userlabel settooltiptext getstring enteruser passwordlabel settext getstring passwordlabel settooltiptext getstring enterpassword languagelabel settext getstring languagelabel settooltiptext getstring selectlanguage rolelabel settext getstring clientlabel settext getstring orglabel settext getstring datelabel settext getstring warehouselabel settext getstring printerlabel settext getstring defaultpanel settooltiptext getstring connectionpanel settooltiptext getstring txt_connected getstring txt_notconnected getstring notconnected txt_nodatabase getstring databasenotfound txt_userpwderror getstring userpwderror txt_roleerror getstring rolenotfound txt_loggedin getstring logintabpane settitleat getstring logintabpane settitleat getstring confirmpanel getokbutton settooltiptext getstring confirmpanel getcancelbutton settooltiptext getstring datefield datefield setformat datefield setvalue currenttimemillis m_connectionok statusbar setstatusline txt_loggedin statusbar setstatusline txt_notconnected create new project by copying param ctx context param c project id project param date doc date of the document date return project public static m project copy from properties ctx int c project id timestamp date doc string trx name m project from new m project ctx c project id trx name if from getc project id 0 throw new illegal argument exception from project not found c project id c project id m project to new m project ctx 0 trx name po copy values from to from getad client id from getad org id to set valuenocheck c project id i zero set value with time string value to get value string time date doc to string int length value length time length if length 40 value time else value time substring length 40 to set value value to set invoiced amt env zero to set project balance amt env zero to set processed false if to save throw new illegal state exception could not create project if to copy details from from 0 throw new illegal state exception could not create project details return to c_project_id datedoc mproject copyfrom c_project_id datedoc trxname mproject mproject c_project_id trxname getc_project_id illegalargumentexception c_project_id c_project_id mproject mproject trxname copyvalues getad_client_id getad_org_id set_valuenocheck c_project_id i_zero getvalue datedoc tostring setvalue setinvoicedamt setprojectbalanceamt setprocessed illegalstateexception copydetailsfrom illegalstateexception standard constructor param ctx context param c project id id public m project properties ctx int c project id string trx name super ctx c project id trx name if c project id 0 setc project id 0 set value null setc currency id 0 set committed amt env zero set committed qty env zero set invoiced amt env zero set invoiced qty env zero set planned amt env zero set planned margin amt env zero set planned qty env zero set project balance amt env zero set project category projectcategory general set is commit ceiling false set is commitment false set is summary false set processed false c_project_id mproject c_project_id trxname c_project_id trxname c_project_id setc_project_id setvalue setc_currency_id setcommittedamt setcommittedqty setinvoicedamt setinvoicedqty setplannedamt setplannedmarginamt setplannedqty setprojectbalanceamt setprojectcategory projectcategory_general setiscommitceiling setiscommitment setissummary setprocessed load constructor param ctx context param rs result set public m project properties ctx result set rs string trx name super ctx rs trx name mproject resultset trxname trxname get project type as int is button return c projecttype id id public int getc projecttype id int string pj super getc projecttype id if pj null return 0 int c projecttype id 0 try c projecttype id integer parse int pj catch exception ex log log level severe pj ex return c projecttype id c_projecttype_id getc_projecttype_id_int getc_projecttype_id c_projecttype_id c_projecttype_id parseint c_projecttype_id set project type overwrite r o param c projecttype id id public void setc projecttype id int c projecttype id if c projecttype id 0 super setc projecttype id null else super setc projecttype id string value of c projecttype id c_projecttype_id setc_projecttype_id c_projecttype_id c_projecttype_id setc_projecttype_id setc_projecttype_id valueof c_projecttype_id string representation return info public string to string string buffer sb new string buffer m project append get id append append get value append project category append get project category append return sb to string tostring stringbuffer stringbuffer mproject get_id getvalue projectcategory getprojectcategory tostring get price list from price list version return price list or 0 public int getm pricelist id if getm pricelist version id 0 return 0 if m m pricelist id 0 return m m pricelist id string sql select m pricelist id from m pricelist version where m pricelist version id m m pricelist id db getsql value null sql getm pricelist version id return m m pricelist id getm_pricelist_id getm_pricelist_version_id m_m_pricelist_id m_m_pricelist_id m_pricelist_id m_pricelist_version m_pricelist_version_id m_m_pricelist_id getsqlvalue getm_pricelist_version_id m_m_pricelist_id set pl version param m pricelist version id id public void setm pricelist version id int m pricelist version id super setm pricelist version id m pricelist version id m m pricelist id 0 reset m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id m_m_pricelist_id get project lines return array of lines public m project line get lines array list m project line list new array list m project line string sql select from c projectline where c project id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc project id result set rs pstmt execute query while rs next list add new m project line get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project line ret value new m project line list size list to array ret value return ret value mprojectline getlines arraylist mprojectline arraylist mprojectline c_projectline c_project_id preparedstatement preparestatement get_trxname setint getc_project_id resultset executequery mprojectline getctx get_trxname sqlexception sqlexception mprojectline retvalue mprojectline toarray retvalue retvalue get project issues return array of issues public m project issue get issues array list m project issue list new array list m project issue string sql select from c projectissue where c project id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc project id result set rs pstmt execute query while rs next list add new m project issue get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project issue ret value new m project issue list size list to array ret value return ret value mprojectissue getissues arraylist mprojectissue arraylist mprojectissue c_projectissue c_project_id preparedstatement preparestatement get_trxname setint getc_project_id resultset executequery mprojectissue getctx get_trxname sqlexception sqlexception mprojectissue retvalue mprojectissue toarray retvalue retvalue get project phases return array of phases public m project phase get phases array list m project phase list new array list m project phase string sql select from c projectphase where c project id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc project id result set rs pstmt execute query while rs next list add new m project phase get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project phase ret value new m project phase list size list to array ret value return ret value mprojectphase getphases arraylist mprojectphase arraylist mprojectphase c_projectphase c_project_id seqno preparedstatement preparestatement get_trxname setint getc_project_id resultset executequery mprojectphase getctx get_trxname sqlexception sqlexception mprojectphase retvalue mprojectphase toarray retvalue retvalue copy lines phase task from other project param project project return number of total lines copied public int copy details from m project project if is processed project null return 0 int count copy lines from project copy phases from project return count copydetailsfrom mproject isprocessed copylinesfrom copyphasesfrom copy lines from other project param project project return number of lines copied public int copy lines from m project project if is processed project null return 0 int count 0 m project line from lines project get lines for int i 0 i from lines length i m project line line new m project line get ctx 0 project get trxname po copy values from lines i line getad client id getad org id line setc project id getc project id line set invoiced amt env zero line set invoiced qty env zero line setc orderpo id 0 line setc order id 0 line set processed false if line save count if from lines length count log log level severe lines difference project from lines length saved count return count copylinesfrom mproject isprocessed mprojectline fromlines getlines fromlines mprojectline mprojectline getctx get_trxname copyvalues fromlines getad_client_id getad_org_id setc_project_id getc_project_id setinvoicedamt setinvoicedqty setc_orderpo_id setc_order_id setprocessed fromlines fromlines copy phases tasks from other project param from project project return number of items copied public int copy phases from m project from project if is processed from project null return 0 int count 0 int task count 0 get phases m project phase my phases get phases m project phase from phases from project get phases copy phases for int i 0 i from phases length i check if phase already exists int c phase id from phases i getc phase id boolean exists false if c phase id 0 exists false else for int ii 0 ii my phases length ii if my phases ii getc phase id c phase id exists true break phase exist if exists log info phase already exists here ignored from phases i else m project phase to phase new m project phase get ctx 0 get trxname po copy values from phases i to phase getad client id getad org id to phase setc project id getc project id to phase setc order id 0 to phase set is complete false if to phase save count task count to phase copy tasks from from phases i if from phases length count log warning count difference project from phases length saved count return count task count fromproject copyphasesfrom mproject fromproject isprocessed fromproject taskcount mprojectphase myphases getphases mprojectphase fromphases fromproject getphases fromphases c_phase_id fromphases getc_phase_id c_phase_id myphases myphases getc_phase_id c_phase_id fromphases mprojectphase tophase mprojectphase getctx get_trxname copyvalues fromphases tophase getad_client_id getad_org_id tophase setc_project_id getc_project_id tophase setc_order_id tophase setiscomplete tophase taskcount tophase copytasksfrom fromphases fromphases fromphases taskcount set project type and category if service project copy projet type phase tasks param type project type public void set project type m project type type if type null return setc projecttype id type getc projecttype id set project category type get project category if projectcategory servicechargeproject equals get project category copy phases from type setprojecttype mprojecttype setc_projecttype_id getc_projecttype_id setprojectcategory getprojectcategory projectcategory_servicechargeproject getprojectcategory copyphasesfrom copy phases from type param type project type return count public int copy phases from m project type type create phases int count 0 int task count 0 m project type phase type phases type get phases for int i 0 i type phases length i m project phase to phase new m project phase this type phases i if to phase save count task count to phase copy tasks from type phases i log fine count task count type if type phases length count log log level severe count difference type type phases length saved count return count copyphasesfrom mprojecttype taskcount mprojecttypephase typephases getphases typephases mprojectphase tophase mprojectphase typephases tophase taskcount tophase copytasksfrom typephases taskcount typephases typephases before save param new record new return true protected boolean before save boolean new record if getad user id 1 summary project in dimensions setad user id 0 return true newrecord beforesave newrecord getad_user_id setad_user_id after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting c project acct c acctschema default null insert tree mtree base treetype project value name change if success new record is valuechanged value is valuechanged name m account update value description get ctx c project id getc project id get trxname return success newrecord aftersave newrecord newrecord insert_accounting c_project_acct c_acctschema_default insert_tree mtree_base treetype_project newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_project_id getc_project_id get_trxname before delete return true protected boolean before delete return delete accounting c project acct beforedelete delete_accounting c_project_acct after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype project return success afterdelete delete_tree mtree_base treetype_project standard constructor public x m edi info properties ctx int m edi info id string trx name super ctx m edi info id trx name if m edi info id 0 set info null setm edi id 0 setm edi info id 0 x_m_edi_info m_edi_info_id trxname m_edi_info_id trxname m_edi_info_id setinfo setm_edi_id setm_edi_info_id load constructor public x m edi info properties ctx result set rs string trx name super ctx rs trx name x_m_edi_info resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m edi info append get id append return sb to string tostring stringbuffer stringbuffer x_m_edi_info get_id tostring set info information public void set info string info if info null throw new illegal argument exception info is mandatory if info length 4000 log warning length 4000 truncated info info substring 0 3999 set value info info setinfo illegalargumentexception set_value get info information public string get info return string get value info getinfo get_value set edi transaction public void setm edi id int m edi id if m edi id 1 throw new illegal argument exception m edi id is mandatory set valuenocheck m edi id new integer m edi id setm_edi_id m_edi_id m_edi_id illegalargumentexception m_edi_id set_valuenocheck m_edi_id m_edi_id get edi transaction public int getm edi id integer ii integer get value m edi id if ii null return 0 return ii int value getm_edi_id get_value m_edi_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm edi id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_edi_id set edi log public void setm edi info id int m edi info id if m edi info id 1 throw new illegal argument exception m edi info id is mandatory set valuenocheck m edi info id new integer m edi info id setm_edi_info_id m_edi_info_id m_edi_info_id illegalargumentexception m_edi_info_id set_valuenocheck m_edi_info_id m_edi_info_id get edi log public int getm edi info id integer ii integer get value m edi info id if ii null return 0 return ii int value getm_edi_info_id get_value m_edi_info_id intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals a asset group id m a asset group id para i get parameter as int else if name equals m product id m m product id para i get parameter as int else if name equals c bpartner id m c bpartner id para i get parameter as int else if name equals a asset id m a asset id para i get parameter as int else if name equals guarantee date m guaranteedate timestamp para i get parameter else if name equals noguarantee mailtext id m noguarantee mailtext id para i get parameter as int else if name equals attach asset m attachasset y equals para i get parameter else log log level severe unknown parameter name if m guaranteedate null m guaranteedate new timestamp system current time millis m client m client get get ctx processinfoparameter getparameter getparametername getparameter a_asset_group_id m_a_asset_group_id getparameterasint m_product_id m_m_product_id getparameterasint c_bpartner_id m_c_bpartner_id getparameterasint a_asset_id m_a_asset_id getparameterasint guaranteedate m_guaranteedate getparameter noguarantee_mailtext_id m_noguarantee_mailtext_id getparameterasint attachasset m_attachasset getparameter m_guaranteedate m_guaranteedate currenttimemillis m_client mclient getctx perrform process return message to be translated throws exception protected string do it throws java lang exception log info long start system current time millis test if m client getsmtp host null throw new exception no client smtp info if m client get requeste mail null throw new exception no client request user asset selected if m a asset id 0 string msg deliver it m a asset id add log m a asset id null null msg return msg string buffer sql new string buffer select a asset id guarantee date from a asset a inner join m product p on a m product id p m product id where if m a asset group id 0 sql append a a asset group id append m a asset group id append and if m m product id 0 sql append p m product id append m m product id append and if m c bpartner id 0 sql append a c bpartner id append m c bpartner id append and string s sql to string if s ends with where throw new exception restrict selection no mail to expired if m noguarantee mailtext id 0 sql append trunc guarantee date append db to date m guaranteedate true s sql to string clean up if s ends with and s sql substring 0 sql length 5 statement stmt null int count 0 int errors 0 int reminders 0 try stmt db create statement result set rs stmt execute query s while rs next int a asset id rs get int 1 timestamp guarantee date rs get timestamp 2 guarantee expired if guarantee date null guarantee date before m guaranteedate if m noguarantee mailtext id 0 send no guarantee mail a asset id m noguarantee mailtext id get trxname reminders else guarantee valid string msg deliver it a asset id add log a asset id null null msg if msg starts with errors else count rs close stmt close stmt null catch exception e log log level severe s e finally try if stmt null stmt close catch exception e stmt null log info count count errors errors reminder reminders system current time millis start ms return sent count errors errors doit currenttimemillis m_client getsmtphost m_client getrequestemail m_a_asset_id deliverit m_a_asset_id addlog m_a_asset_id stringbuffer stringbuffer a_asset_id guaranteedate a_asset m_product m_product_id m_product_id m_a_asset_group_id a_asset_group_id m_a_asset_group_id m_m_product_id m_product_id m_m_product_id m_c_bpartner_id c_bpartner_id m_c_bpartner_id tostring endswith restrictselection m_noguarantee_mailtext_id guaranteedate to_date m_guaranteedate tostring endswith createstatement resultset executequery a_asset_id getint guaranteedate gettimestamp guaranteedate guaranteedate m_guaranteedate m_noguarantee_mailtext_id sendnoguaranteemail a_asset_id m_noguarantee_mailtext_id get_trxname deliverit a_asset_id addlog a_asset_id startswith currenttimemillis send no guarantee e mail param a asset id asset param r mailtext id mail to send return message delivery errors start with private string send no guarantee mail int a asset id int r mailtext id string trx name m asset asset new m asset get ctx a asset id trx name if asset getad user id 0 return no asset user m user user new m user get ctx asset getad user id get trxname if user gete mail null user gete mail length 0 return no asset user email if m mailtext null m mailtext getr mailtext id r mailtext id m mailtext new m mail text get ctx r mailtext id get trxname if m mailtext get mail header null m mailtext get mail header length 0 return no subject create mail e mail email m client createe mail user gete mail null null m mailtext setpo user m mailtext setpo asset string message m mailtext get mail text true if m mailtext is html email set messagehtml m mailtext get mail header message else email set subject m mailtext get mail header email set message text message string msg email send new m user mail m mailtext asset getad user id email save if e mail sent ok equals msg return not delivered user gete mail msg return user gete mail email a_asset_id r_mailtext_id sendnoguaranteemail a_asset_id r_mailtext_id trxname masset masset getctx a_asset_id trxname getad_user_id muser muser getctx getad_user_id get_trxname getemail getemail m_mailtext m_mailtext getr_mailtext_id r_mailtext_id m_mailtext mmailtext getctx r_mailtext_id get_trxname m_mailtext getmailheader m_mailtext getmailheader email m_client createemail getemail m_mailtext m_mailtext m_mailtext getmailtext m_mailtext ishtml setmessagehtml m_mailtext getmailheader setsubject m_mailtext getmailheader setmessagetext musermail m_mailtext getad_user_id email sent_ok getemail getemail deliver asset param a asset id asset return message delivery errors start with private string deliver it int a asset id log fine a asset id a asset id long start system current time millis m asset asset new m asset get ctx a asset id get trxname if asset getad user id 0 return no asset user m user user new m user get ctx asset getad user id get trxname if user gete mail null user gete mail length 0 return no asset user email if asset getproductr mailtext id 0 return product mail text if m mailtext null m mailtext getr mailtext id asset getproductr mailtext id m mailtext new m mail text get ctx asset getproductr mailtext id get trxname if m mailtext get mail header null m mailtext get mail header length 0 return no subject create mail e mail email m client createe mail user gete mail null null if email is valid asset set help asset get help invalid e mail asset set is active false return invalid e mail user gete mail if m client is smtp authorization email create authenticator m client get request user m client get request userpw m mailtext set user user m mailtext setpo asset string message m mailtext get mail text true if m mailtext is html m attachasset email set messagehtml m mailtext get mail header message else email set subject m mailtext get mail header email set message text message if m attachasset m product download pdls asset get product downloads if pdls null for int i 0 i pdls length i url url pdls i get downloadurl m client get document dir if url null email add attachment url else log warning no dowloadurl for a asset id a asset id string msg email send new m user mail m mailtext asset getad user id email save if e mail sent ok equals msg return not delivered user gete mail msg m asset delivery ad asset confirm delivery email user getad user id ad save asset save log fine system current time millis start ms success return user gete mail asset get product version no a_asset_id deliverit a_asset_id a_asset_id a_asset_id currenttimemillis masset masset getctx a_asset_id get_trxname getad_user_id muser muser getctx getad_user_id get_trxname getemail getemail getproductr_mailtext_id m_mailtext m_mailtext getr_mailtext_id getproductr_mailtext_id m_mailtext mmailtext getctx getproductr_mailtext_id get_trxname m_mailtext getmailheader m_mailtext getmailheader email m_client createemail getemail isvalid sethelp gethelp email setisactive email getemail m_client issmtpauthorization createauthenticator m_client getrequestuser m_client getrequestuserpw m_mailtext setuser m_mailtext m_mailtext getmailtext m_mailtext ishtml m_attachasset setmessagehtml m_mailtext getmailheader setsubject m_mailtext getmailheader setmessagetext m_attachasset mproductdownload getproductdownloads getdownloadurl m_client getdocumentdir addattachment a_asset_id a_asset_id musermail m_mailtext getad_user_id email sent_ok getemail massetdelivery confirmdelivery getad_user_id currenttimemillis getemail getproductversionno constructs a new text pane html public c text pane this new j text pane textpane ctextpane jtextpane constructs a new j text pane with the given document param doc the model to use public c text pane styled document doc this new j text pane doc jtextpane ctextpane styleddocument jtextpane create a j scroll area with a j text editor param text pane public c text pane j text pane text pane super text pane m textpane text pane super set opaque false super get viewport set opaque false m textpane set content type text html m textpane set font compiereplaf getfont field m textpane set foreground compiereplaf gettextcolor normal jscrollarea jtexteditor textpane ctextpane jtextpane textpane textpane m_textpane textpane setopaque getviewport setopaque m_textpane setcontenttype m_textpane setfont getfont_field m_textpane setforeground gettextcolor_normal set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if m textpane is editable rw m textpane set editable rw set background false setreadwrite m_textpane iseditable m_textpane seteditable setbackground is it possible to edit return true if editable public boolean is read write return m textpane is editable isreadwrite m_textpane iseditable set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set background param color color public void set background color color if color equals get background return if m textpane null during init super set background color else m textpane set background color setbackground getbackground m_textpane setbackground m_textpane setbackground get background return color public color get background if m textpane null during init return super get background else return m textpane get background getbackground m_textpane getbackground m_textpane getbackground set foreground param color color public void set foreground color color if m textpane null during init super set foreground color else m textpane set foreground color setforeground m_textpane setforeground m_textpane setforeground get foreground return color public color get foreground if m textpane null during init return super get foreground else return m textpane get foreground getforeground m_textpane getforeground m_textpane getforeground set content type param type e g text html public void set content type string type if m textpane null during init m textpane set content type type setcontenttype m_textpane m_textpane setcontenttype set editor to value param value value of the editor public void set value object value if value null m textpane set text else m textpane set text value to string setvalue m_textpane settext m_textpane settext tostring return editor value return current value public object get value return m textpane get text getvalue m_textpane gettext return display value return displayed string value public string get display return m textpane get text getdisplay m_textpane gettext set text and position top param text public void set text string text m textpane set text text m textpane set caret position 0 settext m_textpane settext m_textpane setcaretposition m textpane set caret position 0 public string get text return m textpane get text m_textpane setcaretposition gettext m_textpane gettext public void set caret position int pos m textpane set caret position pos setcaretposition m_textpane setcaretposition m textpane set caret position pos public int get caret position return m textpane get caret position m_textpane setcaretposition getcaretposition m_textpane getcaretposition public void set editable boolean edit m textpane set editable edit seteditable m_textpane seteditable m textpane set editable edit public boolean is editable return m textpane is editable m_textpane seteditable iseditable m_textpane iseditable public void set opaque boolean is opaque j scroll pane viewport is always not opaque if m textpane null during init of j scroll pane super set opaque is opaque else m textpane set opaque is opaque setopaque isopaque jscrollpane m_textpane jscrollpane setopaque isopaque m_textpane setopaque isopaque public void add focus listener focus listener l if m textpane null during init super add focus listener l else m textpane add focus listener l addfocuslistener focuslistener m_textpane addfocuslistener m_textpane addfocuslistener m textpane add focus listener l public void add mouse listener mouse listener l m textpane add mouse listener l m_textpane addfocuslistener addmouselistener mouselistener m_textpane addmouselistener m textpane add mouse listener l public void add key listener key listener l m textpane add key listener l m_textpane addmouselistener addkeylistener keylistener m_textpane addkeylistener public void add input method listener input method listener l m textpane add input method listener l addinputmethodlistener inputmethodlistener m_textpane addinputmethodlistener m textpane add input method listener l public input method requests get input method requests return m textpane get input method requests m_textpane addinputmethodlistener inputmethodrequests getinputmethodrequests m_textpane getinputmethodrequests return m textpane get input method requests public void set input verifier input verifier l m textpane set input verifier l m_textpane getinputmethodrequests setinputverifier inputverifier m_textpane setinputverifier prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals maintenance mode p maintenancemode string para i get parameter else log log level severe unknown parameter name p ad language id getrecord id processinfoparameter getparameter getparametername getparameter maintenancemode p_maintenancemode getparameter p_ad_language_id getrecord_id perform process return message clear text throws exception if not successful protected string do it throws exception m language new m language get ctx p ad language id get trxname log info mode p maintenancemode id p ad language id m language if m language is base language throw new exception base language has no translations int delete no 0 int insert no 0 delete if maintenancemode delete equals p maintenancemode maintenancemode recreate equals p maintenancemode delete no m language maintain false add if maintenancemode add equals p maintenancemode maintenancemode recreate equals p maintenancemode if m language is active m language is system language insert no m language maintain true else throw new exception language not active system language delete if maintenancemode delete equals p maintenancemode if m language is system language m language set is system language false m language save return deleted delete no inserted insert no doit m_language mlanguage getctx p_ad_language_id get_trxname p_maintenancemode p_ad_language_id m_language m_language isbaselanguage deleteno insertno maintenancemode_delete p_maintenancemode maintenancemode_recreate p_maintenancemode deleteno m_language maintenancemode_add p_maintenancemode maintenancemode_recreate p_maintenancemode m_language isactive m_language issystemlanguage insertno m_language maintenancemode_delete p_maintenancemode m_language issystemlanguage m_language setissystemlanguage m_language deleteno insertno fill background with color ususlly called from update methods param g2d graphics param c component param round paint round corners public static void fill rectange graphics2d g2d j component c boolean round paint in compiere color compiere color cc null boolean stdcc c get client property compiereplaf background fill null try cc compiere color c get client property compiereplaf background catch exception e stdcc true if stdcc cc compiere color get default background paint compiere color if cc null bounds is often not within panel bouunds cc paint g2d c paint flat color else paint paint c get background g2d set paint paint rectangular shape rec null if round rec new round rectangle2d float 0 0 c get width c get height 15 15 else rec new rectangle 0 0 c get width c get height g2d fill rec fillrectange jcomponent compierecolor compierecolor getclientproperty background_fill compierecolor getclientproperty compierecolor getdefaultbackground compierecolor getbackground setpaint rectangularshape roundrectangle2d getwidth getheight getwidth getheight paint 3d effect in lighten in upper half darken in lowerhalf called from paint methods param g2d graphics param r ractangle param round paint round corners param out paint sticking out not pressed public static void paint3 deffect graphics2d g2d rectangle r boolean round boolean out paint upper gradient gradient paint top paint null if out top paint new gradient paint r x r y col 1top r x r y r height 2 col 1end else top paint new gradient paint r x r y col 2end r x r y r height 2 col 2top g2d set paint top paint rectangular shape top rec null if round top rec new round rectangle2d float r x r y r width r height 2 15 15 else top rec new rectangle r x r y r width r height 2 g2d fill top rec paint lower gradient gradient paint end paint null upper left corner to lower left if out end paint new gradient paint r x r y r height 2 col 2top r x r y r height col 2end else end paint new gradient paint r x r y r height 2 col 1end r x r y r height col 1top g2d set paint end paint rectangular shape end rec null if round end rec new round rectangle2d float r x r y r height 2 r width r height 2 15 15 else end rec new rectangle r x r y r height 2 r width r height 2 g2d fill end rec paint3deffect gradientpaint toppaint toppaint gradientpaint col_1top col_1end toppaint gradientpaint col_2end col_2top setpaint toppaint rectangularshape toprec toprec roundrectangle2d toprec toprec gradientpaint endpaint endpaint gradientpaint col_2top col_2end endpaint gradientpaint col_1end col_1top setpaint endpaint rectangularshape endrec endrec roundrectangle2d endrec endrec paint 3d effect in lighten in upper half darken in lowerhalf called from paint methods param g2d graphics param c component param round paint round corners param out paint sticking out not pressed public static void paint3 deffect graphics2d g2d j component c boolean round boolean out paint upper gradient gradient paint top paint null if out top paint new gradient paint 0 0 col 1top 0 c get height 2 col 1end else top paint new gradient paint 0 0 col 2end 0 c get height 2 col 2top g2d set paint top paint rectangular shape top rec null if round top rec new round rectangle2d float 0 0 c get width c get height 2 15 15 else top rec new rectangle 0 0 c get width c get height 2 g2d fill top rec paint lower gradient gradient paint end paint null if out end paint new gradient paint 0 c get height 2 col 2top 0 c get height col 2end else end paint new gradient paint 0 c get height 2 col 1end 0 c get height col 1top g2d set paint end paint rectangular shape end rec null if round end rec new round rectangle2d float 0 c get height 2 c get width c get height 2 15 15 else end rec new rectangle 0 c get height 2 c get width c get height 2 g2d fill end rec paint3deffect jcomponent gradientpaint toppaint toppaint gradientpaint col_1top getheight col_1end toppaint gradientpaint col_2end getheight col_2top setpaint toppaint rectangularshape toprec toprec roundrectangle2d getwidth getheight toprec getwidth getheight toprec gradientpaint endpaint endpaint gradientpaint getheight col_2top getheight col_2end endpaint gradientpaint getheight col_1end getheight col_1top setpaint endpaint rectangularshape endrec endrec roundrectangle2d getheight getwidth getheight endrec getheight getwidth getheight endrec helper to simplify creation of translucent colors param c color param alpha alpha return translucent color static public color get translucent color color c int alpha return new color c get red c get green c get blue alpha gettranslucentcolor getred getgreen getblue set not buffered recursive for all contained components param c static public void set not buffered component c if c instanceof j component j component c set double buffered false if c instanceof container component cc container c get components for int i 0 i cc length i set not buffered cc i setnotbuffered jcomponent jcomponent setdoublebuffered getcomponents setnotbuffered load the image located at path param path location of image file in local file system otherwise relative to class return loaded image at path or url see java io file tourl public static synchronized image load image string path image image null try file file new file path url url file tourl image load image url catch malformedurl exception e log severe path path e get message return image loadimage loadimage malformedurlexception getmessage load the image located at url param url url where the image file is located return loaded image at path or url see java io file tourl public static synchronized image load image url url image image null image toolkit get default toolkit get image url if image null s tracker add image image 0 try s tracker wait for all catch interrupted exception e log severe url url e get message s tracker remove image image image null finally if image null s tracker remove image image if s tracker is error any log severe tracker s tracker get errors any 0 image null if image null if image get width null 0 image get height null 0 log severe image 0 image null return image loadimage getdefaulttoolkit getimage s_tracker addimage s_tracker waitforall interruptedexception getmessage s_tracker removeimage s_tracker removeimage s_tracker iserrorany s_tracker geterrorsany getwidth getheight load an image from a given file into a buffered image the image is returned in the format defined by the image type parameter note that this is special cased for jpeg images where loading is performed outside the standard media tracker for efficiency reasons param file file where the image file is located param image type one of the image type defined in the buffered image class return loaded image at path or url see java awt image buffered image public static synchronized buffered image load buffered image file file int image type buffered image image null try url url file tourl image load buffered image url image type catch malformedurl exception e log severe file file e get message return image bufferedimage imagetype imagetype bufferedimage bufferedimage bufferedimage loadbufferedimage imagetype bufferedimage loadbufferedimage imagetype malformedurlexception getmessage load an image from a given path into a buffered image the image is returned in the format defined by the image type parameter note that this is special cased for jpeg images where loading is performed outside the standard media tracker for efficiency reasons param path name of file where the image file is located param image type one of the image type defined in the buffered image class return loaded image at path or url see java awt image buffered image public static synchronized buffered image load buffered image string path int image type file file new file path buffered image image null try url url file tourl image load buffered image url image type catch malformedurl exception e log severe path path e get message return image bufferedimage imagetype imagetype bufferedimage bufferedimage bufferedimage loadbufferedimage imagetype bufferedimage loadbufferedimage imagetype malformedurlexception getmessage loads an image from a given url into a buffered image the image is returned in the format defined by the image type parameter note that this is special cased for jpeg images where loading is performed outside the standard media tracker for efficiency reasons param url url where the image file is located param image type one of the image type defined in the buffered image class return loaded image at path or url see java awt image buffered image public static synchronized buffered image load buffered image url url int image type buffered image image null special handling for jpeg images to avoid extra processing if possible if url null url to string to lower case ends with jpg image tmp image load image url if tmp image null image new buffered image tmp image get width null tmp image get height null image type graphics2d g image create graphics g draw image tmp image 0 0 null g dispose else buffered image tmp image load bufferedjpeg image url if tmp image null if tmp image get type image type log config incompatible jpeg image type creating new buffer image image new buffered image tmp image get width null tmp image get height null image type graphics2d g image create graphics g draw image tmp image 0 0 null g dispose else image tmp image return image bufferedimage imagetype imagetype bufferedimage bufferedimage bufferedimage loadbufferedimage imagetype bufferedimage tostring tolowercase endswith tmpimage loadimage tmpimage bufferedimage tmpimage getwidth tmpimage getheight imagetype creategraphics drawimage tmpimage bufferedimage tmpimage loadbufferedjpegimage tmpimage tmpimage gettype imagetype bufferedimage tmpimage getwidth tmpimage getheight imagetype creategraphics drawimage tmpimage tmpimage load a jpeg image from a given location param url url where the image file is located return loaded image at path or url public static synchronized buffered image load bufferedjpeg image url url buffered image image null if url null input stream in null try in url open stream jpeg image decoder decoder jpeg codec createjpeg decoder in image decoder decode as buffered image catch exception e log severe url url e get message image null finally try if in null in close catch io exception ioe log severe url url ioe get message if image null log config image type image get type if image get width 0 image get height 0 log severe url url 0 image null return image bufferedimage loadbufferedjpegimage bufferedimage inputstream openstream jpegimagedecoder jpegcodec createjpegdecoder decodeasbufferedimage getmessage ioexception getmessage gettype getwidth getheight convenience function for determining component orientation copied from metal utils param c component return true if left to right public static boolean is left to right component c return c get component orientation is left to right componentorientation metalutils islefttoright getcomponentorientation islefttoright print oarent of component param c component static void print parents j component c if c get name null c set name c string value of s no system out print c get name system out print c get class get name system out println c is opaque bg c get client property compiereplaf background null container container c get parent while container null system out print container get name container get class get name container is opaque if container instanceof j component system out print bg j component container get client property compiereplaf background null system out println container container get parent printparents jcomponent getname setname valueof s_no getname getclass getname isopaque getclientproperty getparent getname getclass getname isopaque jcomponent jcomponent getclientproperty getparent get content return content public object get contents return contents getcontents standard constructor public x m discountschema properties ctx int m discountschema id string trx name super ctx m discountschema id trx name if m discountschema id 0 set discount type null set isb partner flat discount false set is quantity based true y setm discountschema id 0 set name null set valid from new timestamp system current time millis x_m_discountschema m_discountschema_id trxname m_discountschema_id trxname m_discountschema_id setdiscounttype setisbpartnerflatdiscount setisquantitybased setm_discountschema_id setname setvalidfrom currenttimemillis load constructor public x m discountschema properties ctx result set rs string trx name super ctx rs trx name x_m_discountschema resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m discountschema append get id append return sb to string tostring stringbuffer stringbuffer x_m_discountschema get_id tostring public static final string cumulativelevel line l set accumulation level level for accumulative calculations public void set cumulative level string cumulative level if cumulative level null throw new illegal argument exception cumulative level is mandatory if cumulative level null cumulative level equals l else throw new illegal argument exception cumulative level invalid value cumulative level reference id 246 l if cumulative level null cumulative level length 1 log warning length 1 truncated cumulative level cumulative level substring 0 0 set value cumulative level cumulative level cumulativelevel_line setcumulativelevel cumulativelevel cumulativelevel illegalargumentexception cumulativelevel cumulativelevel cumulativelevel illegalargumentexception cumulativelevel cumulativelevel reference_id cumulativelevel cumulativelevel cumulativelevel cumulativelevel set_value cumulativelevel cumulativelevel get accumulation level level for accumulative calculations public string get cumulative level return string get value cumulative level getcumulativelevel get_value cumulativelevel set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string discounttype formula s set discount type type of trade discount calculation public void set discount type string discount type if discount type null throw new illegal argument exception discount type is mandatory if discount type equals b discount type equals f discount type equals p discount type equals s else throw new illegal argument exception discount type invalid value discount type reference id 247 b f p s if discount type length 1 log warning length 1 truncated discount type discount type substring 0 0 set value discount type discount type discounttype_formula setdiscounttype discounttype discounttype illegalargumentexception discounttype discounttype discounttype discounttype discounttype illegalargumentexception discounttype discounttype reference_id discounttype discounttype discounttype set_value discounttype discounttype get discount type type of trade discount calculation public string get discount type return string get value discount type getdiscounttype get_value discounttype set flat discount flat discount percentage public void set flat discount big decimal flat discount set value flat discount flat discount setflatdiscount bigdecimal flatdiscount set_value flatdiscount flatdiscount get flat discount flat discount percentage public big decimal get flat discount big decimal bd big decimal get value flat discount if bd null return env zero return bd bigdecimal getflatdiscount bigdecimal bigdecimal get_value flatdiscount set b partner flat discount use flat discount defined on business partner level public void set isb partner flat discount boolean isb partner flat discount set value isb partner flat discount new boolean isb partner flat discount setisbpartnerflatdiscount isbpartnerflatdiscount set_value isbpartnerflatdiscount isbpartnerflatdiscount get b partner flat discount use flat discount defined on business partner level public boolean isb partner flat discount object oo get value isb partner flat discount if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbpartnerflatdiscount get_value isbpartnerflatdiscount booleanvalue set quantity based trade discount break level based on quantity not value public void set is quantity based boolean is quantity based set value is quantity based new boolean is quantity based setisquantitybased isquantitybased set_value isquantitybased isquantitybased get quantity based trade discount break level based on quantity not value public boolean is quantity based object oo get value is quantity based if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isquantitybased get_value isquantitybased booleanvalue set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 1 throw new illegal argument exception m discountschema id is mandatory set valuenocheck m discountschema id new integer m discountschema id setm_discountschema_id m_discountschema_id m_discountschema_id illegalargumentexception m_discountschema_id set_valuenocheck m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set script dynamic java language script to calculate result public void set script string script if script null script length 2000 log warning length 2000 truncated script script substring 0 1999 set value script script setscript set_value get script dynamic java language script to calculate result public string get script return string get value script getscript get_value set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m locator id p m locator id para i get parameter as int else if name equals locator value p locatorvalue string para i get parameter else if name equals product value p productvalue string para i get parameter else if name equals m product category id p m product category id para i get parameter as int else if name equals qty range p qtyrange string para i get parameter else if name equals inventory count set p inventorycountsetzero z equals para i get parameter else if name equals delete old p deleteold y equals para i get parameter else log log level severe unknown parameter name p m inventory id getrecord id processinfoparameter getparameter getparametername getparameter m_locator_id p_m_locator_id getparameterasint locatorvalue p_locatorvalue getparameter productvalue p_productvalue getparameter m_product_category_id p_m_product_category_id getparameterasint qtyrange p_qtyrange getparameter inventorycountset p_inventorycountsetzero getparameter deleteold p_deleteold getparameter p_m_inventory_id getrecord_id process return message throws exception protected string do it throws exception log info m inventory id p m inventory id m locator id p m locator id locator value p locatorvalue product value p productvalue m product category id p m product category id qty range p qtyrange delete old p deleteold m inventory new m inventory get ctx p m inventory id get trxname if m inventory get id 0 throw new compiere system error not found m inventory id p m inventory id if m inventory is processed throw new compiere system error m inventory id processed if p deleteold string sql delete m inventoryline where processed n and m inventory id p m inventory id int no db execute update sql get trxname log fine do it deleted no create null storage records if p qtyrange null p qtyrange equals string sql insert into m storage ad client id ad org id is active created created by updated updated by m locator id m product id m attributesetinstance id qty on hand qty reserved qty ordered date last inventory select l ad client id l ad org id y sys date 0 sys date 0 l m locator id p m product id 0 0 0 0 null from m locator l inner join m product p on l ad client id p ad client id where l m warehouse id m inventory getm warehouse id if p m locator id 0 sql and l m locator id p m locator id sql and l is default y and p is active y and p is stocked y and p product type i and not exists select from m storage s inner join m locator sl on s m locator id sl m locator id where sl m warehouse id l m warehouse id and s m product id p m product id int no db execute update sql get trxname log fine 0 inserted no string buffer sql new string buffer select s m product id s m locator id s m attributesetinstance id s qty on hand p m attributeset id from m product p inner join m storage s on s m product id p m product id inner join m locator l on s m locator id l m locator id where l m warehouse id and p is active y and p is stocked y and p product type i if p m locator id 0 sql append and s m locator id if p locatorvalue null p locatorvalue trim length 0 p locatorvalue equals p locatorvalue null if p locatorvalue null sql append and upper l value like if p productvalue null p productvalue trim length 0 p productvalue equals p productvalue null if p productvalue null sql append and upper p value like if p m product category id 0 sql append and p m product category id do not overwrite existing records if p deleteold sql append and not exists select from m inventoryline il where il m inventory id and il m product id s m product id and il m locator id s m locator id and coalesce il m attributesetinstance id 0 coalesce s m attributesetinstance id 0 sql append order by l value p value s qty on hand desc locator product int count 0 prepared statement pstmt null try pstmt db prepare statement sql to string get trxname int index 1 pstmt set int index m inventory getm warehouse id if p m locator id 0 pstmt set int index p m locator id if p locatorvalue null pstmt set string index p locatorvalue to upper case if p productvalue null pstmt set string index p productvalue to upper case if p m product category id 0 pstmt set int index p m product category id if p deleteold pstmt set int index p m inventory id result set rs pstmt execute query while rs next int m product id rs get int 1 int m locator id rs get int 2 int m attributesetinstance id rs get int 3 big decimal qty on hand rs get big decimal 4 if qty on hand null qty on hand env zero int m attributeset id rs get int 5 int compare qty on hand compare to env zero if p qtyrange null p qtyrange equals compare 0 p qtyrange equals compare 0 p qtyrange equals compare 0 p qtyrange equals n compare 0 count create inventory line m locator id m product id m attributesetinstance id qty on hand m attributeset id rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null set count to zero if p inventorycountsetzero string sql1 update m inventoryline l set qty count 0 where m inventory id p m inventory id int no db execute update sql1 get trxname log info set cont to zero no return m inventoryline id count doit m_inventory_id p_m_inventory_id m_locator_id p_m_locator_id locatorvalue p_locatorvalue productvalue p_productvalue m_product_category_id p_m_product_category_id qtyrange p_qtyrange deleteold p_deleteold m_inventory minventory getctx p_m_inventory_id get_trxname m_inventory get_id compieresystemerror m_inventory_id p_m_inventory_id m_inventory isprocessed compieresystemerror m_inventory_id p_deleteold m_inventoryline m_inventory_id p_m_inventory_id executeupdate get_trxname doit p_qtyrange p_qtyrange m_storage ad_client_id ad_org_id isactive createdby updatedby m_locator_id m_product_id m_attributesetinstance_id qtyonhand qtyreserved qtyordered datelastinventory ad_client_id ad_org_id sysdate sysdate m_locator_id m_product_id m_locator m_product ad_client_id ad_client_id m_warehouse_id m_inventory getm_warehouse_id p_m_locator_id m_locator_id p_m_locator_id isdefault isactive isstocked producttype m_storage m_locator m_locator_id m_locator_id m_warehouse_id m_warehouse_id m_product_id m_product_id executeupdate get_trxname stringbuffer stringbuffer m_product_id m_locator_id m_attributesetinstance_id qtyonhand m_attributeset_id m_product m_storage m_product_id m_product_id m_locator m_locator_id m_locator_id m_warehouse_id isactive isstocked producttype p_m_locator_id m_locator_id p_locatorvalue p_locatorvalue p_locatorvalue p_locatorvalue p_locatorvalue p_productvalue p_productvalue p_productvalue p_productvalue p_productvalue p_m_product_category_id m_product_category_id p_deleteold m_inventoryline m_inventory_id m_product_id m_product_id m_locator_id m_locator_id m_attributesetinstance_id m_attributesetinstance_id qtyonhand preparedstatement preparestatement tostring get_trxname setint m_inventory getm_warehouse_id p_m_locator_id setint p_m_locator_id p_locatorvalue setstring p_locatorvalue touppercase p_productvalue setstring p_productvalue touppercase p_m_product_category_id setint p_m_product_category_id p_deleteold setint p_m_inventory_id resultset executequery m_product_id getint m_locator_id getint m_attributesetinstance_id getint bigdecimal qtyonhand getbigdecimal qtyonhand qtyonhand m_attributeset_id getint qtyonhand compareto p_qtyrange p_qtyrange p_qtyrange p_qtyrange p_qtyrange createinventoryline m_locator_id m_product_id m_attributesetinstance_id qtyonhand m_attributeset_id tostring p_inventorycountsetzero m_inventoryline qtycount m_inventory_id p_m_inventory_id executeupdate get_trxname m_inventoryline_id create add to inventory line param m product id product param m locator id locator param m attributesetinstance id asi param qty on hand qty param m attributeset id as return lines added private int create inventory line int m locator id int m product id int m attributesetinstance id big decimal qty on hand int m attributeset id boolean one line perasi false if m attributeset id 0 m attribute set mas m attribute set get get ctx m attributeset id one line perasi mas is instance attribute if one line perasi m inventory line line new m inventory line m inventory m locator id m product id m attributesetinstance id qty on hand qty on hand book count if line save return 1 return 0 if qty on hand signum 0 m attributesetinstance id 0 if m line null m line getm locator id m locator id m line getm product id m product id if qty on hand signum 0 return 0 same asi usually 0 if m line getm attributesetinstance id m attributesetinstance id m line set qty book m line get qty book add qty on hand m line set qty count m line get qty count add qty on hand m line save return 0 save old line info else if m line getm attributesetinstance id 0 m inventory linema ma new m inventory linema m line m line getm attributesetinstance id m line get qty book if ma save m line setm attributesetinstance id 0 m line set qty book m line get qty book add qty on hand m line set qty count m line get qty count add qty on hand m line save m inventory linema ma new m inventory linema m line m attributesetinstance id qty on hand if ma save return 0 new line m line new m inventory line m inventory m locator id m product id m attributesetinstance id qty on hand qty on hand book count if m line save return 1 return 0 m_product_id m_locator_id m_attributesetinstance_id qtyonhand m_attributeset_id createinventoryline m_locator_id m_product_id m_attributesetinstance_id bigdecimal qtyonhand m_attributeset_id onelineperasi m_attributeset_id mattributeset mattributeset getctx m_attributeset_id onelineperasi isinstanceattribute onelineperasi minventoryline minventoryline m_inventory m_locator_id m_product_id m_attributesetinstance_id qtyonhand qtyonhand qtyonhand m_attributesetinstance_id m_line m_line getm_locator_id m_locator_id m_line getm_product_id m_product_id qtyonhand m_line getm_attributesetinstance_id m_attributesetinstance_id m_line setqtybook m_line getqtybook qtyonhand m_line setqtycount m_line getqtycount qtyonhand m_line m_line getm_attributesetinstance_id minventorylinema minventorylinema m_line m_line getm_attributesetinstance_id m_line getqtybook m_line setm_attributesetinstance_id m_line setqtybook m_line getqtybook qtyonhand m_line setqtycount m_line getqtycount qtyonhand m_line minventorylinema minventorylinema m_line m_attributesetinstance_id qtyonhand m_line minventoryline m_inventory m_locator_id m_product_id m_attributesetinstance_id qtyonhand qtyonhand m_line standard constructor public x m productoperation properties ctx int m productoperation id string trx name super ctx m productoperation id trx name if m productoperation id 0 setm productoperation id 0 setm product id 0 set name null x_m_productoperation m_productoperation_id trxname m_productoperation_id trxname m_productoperation_id setm_productoperation_id setm_product_id setname load constructor public x m productoperation properties ctx result set rs string trx name super ctx rs trx name x_m_productoperation resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productoperation append get id append return sb to string tostring stringbuffer stringbuffer x_m_productoperation get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set product operation product manufacturing operation public void setm productoperation id int m productoperation id if m productoperation id 1 throw new illegal argument exception m productoperation id is mandatory set valuenocheck m productoperation id new integer m productoperation id setm_productoperation_id m_productoperation_id m_productoperation_id illegalargumentexception m_productoperation_id set_valuenocheck m_productoperation_id m_productoperation_id get product operation product manufacturing operation public int getm productoperation id integer ii integer get value m productoperation id if ii null return 0 return ii int value getm_productoperation_id get_value m_productoperation_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set setup time setup time before starting production public void set setup time big decimal setup time set value setup time setup time setsetuptime bigdecimal setuptime set_value setuptime setuptime get setup time setup time before starting production public big decimal get setup time big decimal bd big decimal get value setup time if bd null return env zero return bd bigdecimal getsetuptime bigdecimal bigdecimal get_value setuptime set teardown time time at the end of the operation public void set teardown time big decimal teardown time set value teardown time teardown time setteardowntime bigdecimal teardowntime set_value teardowntime teardowntime get teardown time time at the end of the operation public big decimal get teardown time big decimal bd big decimal get value teardown time if bd null return env zero return bd bigdecimal getteardowntime bigdecimal bigdecimal get_value teardowntime set runtime per unit time to produce one unit public void set unit runtime big decimal unit runtime set value unit runtime unit runtime setunitruntime bigdecimal unitruntime set_value unitruntime unitruntime get runtime per unit time to produce one unit public big decimal get unit runtime big decimal bd big decimal get value unit runtime if bd null return env zero return bd bigdecimal getunitruntime bigdecimal bigdecimal get_value unitruntime layout for page param page no page param ctx context public page properties ctx int page no m ctx ctx m pageno page no if m pageinfo null m pageinfo length 0 m pageinfo string value of m pageno pageno pageno m_ctx m_pageno pageno m_pageinfo m_pageinfo m_pageinfo valueof m_pageno get page no return page no public int get page no return m pageno getpageno m_pageno get page info return page info public string get page info return m pageinfo getpageinfo m_pageinfo set page info enhanced pagae no e g 7 2 3 param page info page info public void set page info string page info if m pageinfo null m pageinfo length 0 m pageinfo string value of m pageno m pageinfo page info pageinfo setpageinfo pageinfo m_pageinfo m_pageinfo m_pageinfo valueof m_pageno m_pageinfo pageinfo set page info param page count page count public void set page count int page count m pagecount page count pagecount setpagecount pagecount m_pagecount pagecount add print element to page param element print element public void add element print element element if element null m elements add element addelement printelement m_elements paint page on graphics in bounds param g2d graphics param bounds page bounds param is view true if online view i ds are links param is copy this print is a copy public void paint graphics2d g2d rectangle bounds boolean is view boolean is copy m ctx put context page m pageinfo log finest print context context page m pageinfo string buffer sb new string buffer if m pagecount 1 set to page 1 of 2 sb append msg get msg m ctx page append append m pageno append append msg get msg m ctx of append append m pagecount else sb append m ctx put context multipage sb to string log finest print context context multipage sb to string sb new string buffer if is copy set to copy sb append append msg get msg m ctx document copy append else sb append m ctx put context copy sb to string log finest print context copy is copy context copy sb to string paint background g2d set color color white g2d fill rect bounds x bounds y bounds width bounds height point page start new point bounds get location for int i 0 i m elements size i print element e print element m elements get i e paint g2d m pageno page start m ctx is view isview ids iscopy isview iscopy m_ctx context_page m_pageinfo printcontext context_page m_pageinfo stringbuffer stringbuffer m_pagecount getmsg m_ctx m_pageno getmsg m_ctx m_pagecount m_ctx context_multipage tostring printcontext context_multipage tostring stringbuffer iscopy getmsg m_ctx documentcopy m_ctx context_copy tostring printcontext iscopy context_copy tostring setcolor fillrect pagestart getlocation m_elements printelement printelement m_elements m_pageno pagestart m_ctx isview get drill down value param relative point relative point return if found name pait or null public m query get drill down point relative point m query ret value null for int i 0 i m elements size ret value null i print element element print element m elements get i ret value element get drill down relative point m pageno return ret value drilldown relativepoint namepait mquery getdrilldown relativepoint mquery retvalue m_elements retvalue printelement printelement m_elements retvalue getdrilldown relativepoint m_pageno retvalue get drill across value param relative point relative point return if found query or null public m query get drill across point relative point m query ret value null for int i 0 i m elements size ret value null i print element element print element m elements get i ret value element get drill across relative point m pageno return ret value drillacross relativepoint mquery getdrillacross relativepoint mquery retvalue m_elements retvalue printelement printelement m_elements retvalue getdrillacross relativepoint m_pageno retvalue string representation return info public string to string string buffer sb new string buffer page sb append m pageno append elements append m elements size sb append return sb to string tostring stringbuffer stringbuffer m_pageno m_elements tostring standard constructor public x m warehouse acct properties ctx int m warehouse acct id string trx name super ctx m warehouse acct id trx name if m warehouse acct id 0 setc acctschema id 0 setm warehouse id 0 setw differences acct 0 setw invactualadjust acct 0 setw inventory acct 0 setw revaluation acct 0 x_m_warehouse_acct m_warehouse_acct_id trxname m_warehouse_acct_id trxname m_warehouse_acct_id setc_acctschema_id setm_warehouse_id setw_differences_acct setw_invactualadjust_acct setw_inventory_acct setw_revaluation_acct load constructor public x m warehouse acct properties ctx result set rs string trx name super ctx rs trx name x_m_warehouse_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m warehouse acct append get id append return sb to string tostring stringbuffer stringbuffer x_m_warehouse_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set warehouse differences warehouse differences account public void setw differences acct int w differences acct set value w differences acct new integer w differences acct setw_differences_acct w_differences_acct set_value w_differences_acct w_differences_acct get warehouse differences warehouse differences account public int getw differences acct integer ii integer get value w differences acct if ii null return 0 return ii int value getw_differences_acct get_value w_differences_acct intvalue set inventory adjustment account for inventory value adjustments for actual costing public void setw invactualadjust acct int w invactualadjust acct set value w invactualadjust acct new integer w invactualadjust acct setw_invactualadjust_acct w_invactualadjust_acct set_value w_invactualadjust_acct w_invactualadjust_acct get inventory adjustment account for inventory value adjustments for actual costing public int getw invactualadjust acct integer ii integer get value w invactualadjust acct if ii null return 0 return ii int value getw_invactualadjust_acct get_value w_invactualadjust_acct intvalue set not used warehouse inventory asset account currently not used public void setw inventory acct int w inventory acct set value w inventory acct new integer w inventory acct setw_inventory_acct w_inventory_acct set_value w_inventory_acct w_inventory_acct get not used warehouse inventory asset account currently not used public int getw inventory acct integer ii integer get value w inventory acct if ii null return 0 return ii int value getw_inventory_acct get_value w_inventory_acct intvalue set inventory revaluation account for inventory revaluation public void setw revaluation acct int w revaluation acct set value w revaluation acct new integer w revaluation acct setw_revaluation_acct w_revaluation_acct set_value w_revaluation_acct w_revaluation_acct get inventory revaluation account for inventory revaluation public int getw revaluation acct integer ii integer get value w revaluation acct if ii null return 0 return ii int value getw_revaluation_acct get_value w_revaluation_acct intvalue print data column param ad column id column param column name column name param display type display type param column size column size param alias alias in query or the same as column name or null param is page break if true force page break after function public print data column int ad column id string column name int display type int column size string alias boolean is page break m ad column id ad column id m columnname column name m displaytype display type m columnsize column size m alias alias if m alias null m alias column name m pagebreak is page break ad_column_id columnname displaytype columnsize ispagebreak printdatacolumn ad_column_id columnname displaytype columnsize ispagebreak m_ad_column_id ad_column_id m_columnname columnname m_displaytype displaytype m_columnsize columnsize m_alias m_alias m_alias columnname m_pagebreak ispagebreak get ad column id return ad column id public int getad column id return m ad column id ad_column_id ad_column_id getad_column_id m_ad_column_id get column name return column name public string get column name return m columnname getcolumnname m_columnname get display type return display type public int get display type return m displaytype getdisplaytype m_displaytype get alias name return alias column name public string get alias return m alias getalias m_alias column has alias i e has a key return true if alias public boolean has alias return m columnname equals m alias hasalias m_columnname m_alias column value forces page break return true if page break public boolean is page break return m pagebreak ispagebreak m_pagebreak string representation return info public string to string string buffer sb new string buffer print data column sb append id append m ad column id append append m columnname if has alias sb append append m alias append sb append display type append m displaytype append size append m columnsize append return sb to string tostring stringbuffer stringbuffer printdatacolumn m_ad_column_id m_columnname hasalias m_alias displaytype m_displaytype m_columnsize tostring standard constructor public x ad userbpaccess properties ctx int ad userbpaccess id string trx name super ctx ad userbpaccess id trx name if ad userbpaccess id 0 setad userbpaccess id 0 setad user id 0 setbp access type null x_ad_userbpaccess ad_userbpaccess_id trxname ad_userbpaccess_id trxname ad_userbpaccess_id setad_userbpaccess_id setad_user_id setbpaccesstype load constructor public x ad userbpaccess properties ctx result set rs string trx name super ctx rs trx name x_ad_userbpaccess resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad userbpaccess append get id append return sb to string tostring stringbuffer stringbuffer x_ad_userbpaccess get_id tostring set user bp access user concat access to business partner information and resources public void setad userbpaccess id int ad userbpaccess id if ad userbpaccess id 1 throw new illegal argument exception ad userbpaccess id is mandatory set valuenocheck ad userbpaccess id new integer ad userbpaccess id setad_userbpaccess_id ad_userbpaccess_id ad_userbpaccess_id illegalargumentexception ad_userbpaccess_id set_valuenocheck ad_userbpaccess_id ad_userbpaccess_id get user bp access user concat access to business partner information and resources public int getad userbpaccess id integer ii integer get value ad userbpaccess id if ii null return 0 return ii int value getad_userbpaccess_id get_value ad_userbpaccess_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue public static final string bpaccesstype requests r set access type type of access of the user contact to business partner information and resources public void setbp access type string bp access type if bp access type null throw new illegal argument exception bp access type is mandatory if bp access type equals a bp access type equals b bp access type equals r else throw new illegal argument exception bp access type invalid value bp access type reference id 358 a b r if bp access type length 1 log warning length 1 truncated bp access type bp access type substring 0 0 set value bp access type bp access type bpaccesstype_requests setbpaccesstype bpaccesstype bpaccesstype illegalargumentexception bpaccesstype bpaccesstype bpaccesstype bpaccesstype illegalargumentexception bpaccesstype bpaccesstype reference_id bpaccesstype bpaccesstype bpaccesstype set_value bpaccesstype bpaccesstype get access type type of access of the user contact to business partner information and resources public string getbp access type return string get value bp access type getbpaccesstype get_value bpaccesstype public static final string docbasetype salesorder soo set document base type logical type of document public void set doc base type string doc base type if doc base type null throw new illegal argument exception doc base type is mandatory if doc base type null doc base type equals apc doc base type equals api doc base type equals app doc base type equals arc doc base type equals arf doc base type equals ari doc base type equals arr doc base type equals cma doc base type equals cmb doc base type equals cmc doc base type equals gld doc base type equals glj doc base type equals mmi doc base type equals mmm doc base type equals mmp doc base type equals mmr doc base type equals mms doc base type equals mxi doc base type equals mxp doc base type equals pji doc base type equals poo doc base type equals por doc base type equals soo else throw new illegal argument exception doc base type invalid value doc base type reference id 183 apc api app arc arf ari arr cma cmb cmc gld glj mmi mmm mmp mmr mms mxi mxp pji poo por soo if doc base type null doc base type length 10 log warning length 10 truncated doc base type doc base type substring 0 9 set value doc base type doc base type docbasetype_salesorder basetype setdocbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype docbasetype illegalargumentexception docbasetype docbasetype reference_id docbasetype docbasetype docbasetype docbasetype set_value docbasetype docbasetype get document base type logical type of document public string get doc base type return string get value doc base type basetype getdocbasetype get_value docbasetype set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 0 set value r requesttype id null else set value r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id set_value r_requesttype_id set_value r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue initialize panel param window no window param frame frame public void init int window no form frame frame log info v pay print init m windowno window no m frame frame try jb init dyn init frame get content pane add center panel border layout center frame get content pane add south panel border layout south catch exception e log log level severe e windowno windowno formframe vpayprint m_windowno windowno m_frame jbinit dyninit getcontentpane centerpanel borderlayout getcontentpane southpanel borderlayout static init throws exception private void jb init throws exception compiere color set background this south panel set layout south layout south layout set alignment flow layout right center panel set layout center layout b print add action listener this b export add action listener this b cancel add action listener this b process set text msg get msg env get ctx eft b process set enabled false b process add action listener this l pay select set text msg translate env get ctx c payselection id f pay select add action listener this l bank set text msg translate env get ctx c bankaccount id l payment rule set text msg translate env get ctx payment rule f payment rule add action listener this l document no set text msg translate env get ctx document no f document no set display type display type integer l no payments set text msg get msg env get ctx no of payments f no payments set text 0 l balance set text msg translate env get ctx current balance f balance set read write false f balance set display type display type amount l currency set text msg translate env get ctx c currency id south panel add b cancel null south panel add b export null south panel add b print null south panel add b process null center panel add l pay select new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 12 5 5 0 0 center panel add f pay select new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 12 0 0 center panel add l bank new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add f bank new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add l payment rule new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add f payment rule new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add l document no new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add f document no new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add l no payments new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add f no payments new grid bag constraints 3 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add l balance new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 center panel add f balance new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 center panel add l currency new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 12 5 0 0 center panel add f currency new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 12 12 0 0 jbinit compierecolor setbackground southpanel setlayout southlayout southlayout setalignment flowlayout centerpanel setlayout centerlayout bprint addactionlistener bexport addactionlistener bcancel addactionlistener bprocess settext getmsg getctx bprocess setenabled bprocess addactionlistener lpayselect settext getctx c_payselection_id fpayselect addactionlistener lbank settext getctx c_bankaccount_id lpaymentrule settext getctx paymentrule fpaymentrule addactionlistener ldocumentno settext getctx documentno fdocumentno setdisplaytype displaytype lnopayments settext getmsg getctx noofpayments fnopayments settext lbalance settext getctx currentbalance fbalance setreadwrite fbalance setdisplaytype displaytype lcurrency settext getctx c_currency_id southpanel bcancel southpanel bexport southpanel bprint southpanel bprocess centerpanel lpayselect gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fpayselect gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lbank gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fbank gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lpaymentrule gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fpaymentrule gridbagconstraints gridbagconstraints gridbagconstraints centerpanel ldocumentno gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fdocumentno gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lnopayments gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fnopayments gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lbalance gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fbalance gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lcurrency gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fcurrency gridbagconstraints gridbagconstraints gridbagconstraints dynamic init private void dyn init log config int ad client id env getad client id env get ctx load pay select string sql select c payselection id name total amt from c payselection where ad client id and processed y and is active y order by pay date desc try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next key name pair pp new key name pair rs get int 1 rs get string 2 f pay select add item pp rs close pstmt close catch sql exception e log log level severe sql e if f pay select get item count 0 a dialog info m windowno this v pay print no records dyninit ad_client_id getad_client_id getctx payselect c_payselection_id totalamt c_payselection ad_client_id isactive paydate preparedstatement preparestatement setint ad_client_id resultset executequery keynamepair keynamepair getint getstring fpayselect additem sqlexception fpayselect getitemcount adialog m_windowno vpayprintnorecords dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame set payment selection param c payselection id id public void set pay selection int c payselection id if c payselection id 0 return for int i 0 i f pay select get item count i key name pair pp key name pair f pay select get item at i if pp get key c payselection id f pay select set selected index i return c_payselection_id setpayselection c_payselection_id c_payselection_id fpayselect getitemcount keynamepair keynamepair fpayselect getitemat getkey c_payselection_id fpayselect setselectedindex action listener param e event public void action performed action event e log config v pay print action performed e to string if e get source f pay select load pay select info else if e get source f payment rule load payment rule info else if e get source b cancel dispose else if e get source b export cmd export else if e get source b process cmd eft else if e get source b print cmd print actionperformed actionevent vpayprint actionperformed tostring getsource fpayselect loadpayselectinfo getsource fpaymentrule loadpaymentruleinfo getsource bcancel getsource bexport cmd_export getsource bprocess cmd_eft getsource bprint cmd_print pay select changed load bank private void load pay select info log info v pay print load pay select info if f pay select get selected index 1 return load banks from pay select line int c payselection id key name pair f pay select get selected item get key m c bankaccount id 1 string sql select ps c bankaccount id b name ba account no 1 2 c iso code current balance 3 4 from c payselection ps inner join c bankaccount ba on ps c bankaccount id ba c bankaccount id inner join c bank b on ba c bank id b c bank id inner join c currency c on ba c currency id c c currency id where ps c payselection id and ps processed y and ba is active y try prepared statement pstmt db prepare statement sql null pstmt set int 1 c payselection id result set rs pstmt execute query if rs next m c bankaccount id rs get int 1 f bank set text rs get string 2 f currency set text rs get string 3 f balance set value rs get big decimal 4 else m c bankaccount id 1 f bank set text f currency set text f balance set value env zero log log level severe no active bank account for c payselection id c payselection id rs close pstmt close catch sql exception e log log level severe sql e load payment rule payselect loadpayselectinfo vpayprint loadpayselectinfo fpayselect getselectedindex payselectline c_payselection_id keynamepair fpayselect getselecteditem getkey m_c_bankaccount_id c_bankaccount_id accountno iso_code currentbalance c_payselection c_bankaccount c_bankaccount_id c_bankaccount_id c_bank c_bank_id c_bank_id c_currency c_currency_id c_currency_id c_payselection_id isactive preparedstatement preparestatement setint c_payselection_id resultset executequery m_c_bankaccount_id getint fbank settext getstring fcurrency settext getstring fbalance setvalue getbigdecimal m_c_bankaccount_id fbank settext fcurrency settext fbalance setvalue bankaccount c_payselection_id c_payselection_id sqlexception loadpaymentrule bank changed load payment rule private void load payment rule log info if m c bankaccount id 1 return load payment rule for bank int c payselection id key name pair f pay select get selected item get key f payment rule remove all items int ad reference id 195 m lookup info getad reference id all payment rule language language language get language env getad language env get ctx m lookup info info m lookup factory getlookup list language ad reference id string sql info query substring 0 info query index of order by and info key column in select payment rule from c payselectioncheck where c payselection id info query substring info query index of order by try prepared statement pstmt db prepare statement sql null pstmt set int 1 c payselection id result set rs pstmt execute query while rs next value name pair pp new value name pair rs get string 2 rs get string 3 f payment rule add item pp rs close pstmt close catch sql exception e log log level severe sql e if f payment rule get item count 0 log config pay sel c payselection id b acct m c bankaccount id sql load payment rule info paymentrule loadpaymentrule m_c_bankaccount_id paymentrule c_payselection_id keynamepair fpayselect getselecteditem getkey fpaymentrule removeallitems ad_reference_id mlookupinfo getad_reference_id all_payment getlanguage getad_language getctx mlookupinfo mlookupfactory getlookup_list ad_reference_id indexof keycolumn paymentrule c_payselectioncheck c_payselection_id indexof preparedstatement preparestatement setint c_payselection_id resultset executequery valuenamepair valuenamepair getstring getstring fpaymentrule additem sqlexception fpaymentrule getitemcount paysel c_payselection_id bacct m_c_bankaccount_id loadpaymentruleinfo payment rule changed load document no no payments enable disable eft print private void load payment rule info value name pair pp value name pair f payment rule get selected item if pp null return string payment rule pp get value log info payment rule payment rule f no payments set text int c payselection id key name pair f pay select get selected item get key string sql select count from c payselectioncheck where c payselection id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c payselection id result set rs pstmt execute query if rs next f no payments set text string value of rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e b process set enabled payment rule equals t document no sql select current next from c bankaccountdoc where c bankaccount id and payment rule and is active y try prepared statement pstmt db prepare statement sql null pstmt set int 1 m c bankaccount id pstmt set string 2 payment rule result set rs pstmt execute query if rs next f document no set value new integer rs get int 1 else log log level severe v pay print load payment rule info no active bank account doc for c bankaccount id m c bankaccount id and payment rule payment rule a dialog error m windowno this v pay print no doc rs close pstmt close catch sql exception e log log level severe sql e paymentrule documentno nopayments loadpaymentruleinfo valuenamepair valuenamepair fpaymentrule getselecteditem paymentrule getvalue paymentrule paymentrule fnopayments settext c_payselection_id keynamepair fpayselect getselecteditem getkey c_payselectioncheck c_payselection_id preparedstatement preparestatement setint c_payselection_id resultset executequery fnopayments settext valueof getint sqlexception bprocess setenabled paymentrule documentno currentnext c_bankaccountdoc c_bankaccount_id paymentrule isactive preparedstatement preparestatement setint m_c_bankaccount_id setstring paymentrule resultset executequery fdocumentno setvalue getint vpayprint loadpaymentruleinfo bankaccountdoc c_bankaccount_id m_c_bankaccount_id paymentrule paymentrule adialog m_windowno vpayprintnodoc sqlexception export payments to file private void cmd export string payment rule value name pair f payment rule get selected item get value log info payment rule if get checks payment rule return get file info j file chooser fc new j file chooser fc set dialog title msg get msg env get ctx export fc set file selection mode j file chooser files only fc set multi selection enabled false fc set selected file new java io file payment export txt if fc show save dialog this j file chooser approve option return create file int no m pay selection check export to file m checks fc get selected file a dialog info m windowno this saved fc get selected file get absolute path n msg get msg env get ctx no of lines no if a dialog ask m windowno this v pay print success int last document no m pay selection check confirm print m checks m batch document no not updated dispose cmd_export paymentrule valuenamepair fpaymentrule getselecteditem getvalue paymentrule getchecks paymentrule jfilechooser jfilechooser setdialogtitle getmsg getctx setfileselectionmode jfilechooser files_only setmultiselectionenabled setselectedfile paymentexport showsavedialog jfilechooser approve_option mpayselectioncheck exporttofile m_checks getselectedfile adialog m_windowno getselectedfile getabsolutepath getmsg getctx nooflines adialog m_windowno vpayprintsuccess lastdocumentno mpayselectioncheck confirmprint m_checks m_batch create eft payment private void cmd eft string payment rule value name pair f payment rule get selected item get value log info payment rule if get checks payment rule return dispose cmd_eft paymentrule valuenamepair fpaymentrule getselecteditem getvalue paymentrule getchecks paymentrule print checks and or remittance private void cmd print string payment rule value name pair f payment rule get selected item get value log info payment rule if get checks payment rule return this set cursor cursor get predefined cursor cursor wait cursor boolean something printed false boolean direct print ini is property bool ini p printpreview for all checks for int i 0 i m checks length i m pay selection check check m checks i report ctrl will check bank account doc for print format boolean ok report ctl start document print report engine check check get id direct print if something printed ok something printed true confirm print and update bank account doc if something printed a dialog ask m windowno this v pay print success int last document no m pay selection check confirm print m checks m batch if last document no 0 string buffer sb new string buffer sb append update c bankaccountdoc set current next append last document no append where c bankaccount id append m c bankaccount id append and payment rule append payment rule append db execute update sb to string null confirm if a dialog ask m windowno this v pay print print remittance for int i 0 i m checks length i m pay selection check check m checks i report ctl start document print report engine remittance check get id direct print remittance this set cursor cursor get default cursor dispose cmd_print paymentrule valuenamepair fpaymentrule getselecteditem getvalue paymentrule getchecks paymentrule setcursor getpredefinedcursor wait_cursor somethingprinted directprint ispropertybool p_printpreview m_checks mpayselectioncheck m_checks reportctrl bankaccountdoc printformat reportctl startdocumentprint reportengine get_id directprint somethingprinted somethingprinted bankaccountdoc somethingprinted adialog m_windowno vpayprintsuccess lastdocumentno mpayselectioncheck confirmprint m_checks m_batch lastdocumentno stringbuffer stringbuffer c_bankaccountdoc currentnext lastdocumentno c_bankaccount_id m_c_bankaccount_id paymentrule paymentrule executeupdate tostring adialog m_windowno vpayprintprintremittance m_checks mpayselectioncheck m_checks reportctl startdocumentprint reportengine get_id directprint setcursor getdefaultcursor get checks param payment rule payment rule return true if payments were created private boolean get checks string payment rule do we have values if f pay select get selected index 1 m c bankaccount id 1 f payment rule get selected index 1 f document no get value null a dialog error m windowno this v pay print no records msg translate env get ctx c payselectionline id 0 return false get data int c payselection id key name pair f pay select get selected item get key int start document no number f document no get value int value log config c payselection id c payselection id payment rule payment rule document no start document no this set cursor cursor get predefined cursor cursor wait cursor get checks m checks m pay selection check get c payselection id payment rule start document no null this set cursor cursor get default cursor if m checks null m checks length 0 a dialog error m windowno this v pay print no records msg translate env get ctx c payselectionline id 0 return false m batch m payment batch get for pay selection env get ctx c payselection id null return true paymentrule getchecks paymentrule fpayselect getselectedindex m_c_bankaccount_id fpaymentrule getselectedindex fdocumentno getvalue adialog m_windowno vpayprintnorecords getctx c_payselectionline_id c_payselection_id keynamepair fpayselect getselecteditem getkey startdocumentno fdocumentno getvalue intvalue c_payselection_id c_payselection_id paymentrule paymentrule documentno startdocumentno setcursor getpredefinedcursor wait_cursor m_checks mpayselectioncheck c_payselection_id paymentrule startdocumentno setcursor getdefaultcursor m_checks m_checks adialog m_windowno vpayprintnorecords getctx c_payselectionline_id m_batch mpaymentbatch getforpayselection getctx c_payselection_id get contents return contents public object get contents return contents getcontents constructor public a glass pane this set opaque false this set visible false this add mouse listener this aglasspane setopaque setvisible addmouselistener set message param ad message to be translated null resets to default message public void set message string ad message if ad message null m message msg get msg env get ctx processing else if ad message length 0 m message ad message nothing else m message msg get msg env get ctx ad message if is visible repaint ad_message setmessage ad_message ad_message m_message getmsg getctx ad_message m_message ad_message m_message getmsg getctx ad_message isvisible get message return displayed message public string get message return m message getmessage m_message set and start busy counter if over 2 seconds param time in seconds public void set busy timer int time log config time time should we display a progress bar if time 2 c connection get is terminal server m timermax 0 if is visible repaint return m timermax time m timervalue 0 start timer m timer new timer 1000 this every second m timer start if is visible set visible true repaint setbusytimer cconnection isterminalserver m_timermax isvisible m_timermax m_timervalue m_timer m_timer isvisible setvisible action listener param e event public void action performed action event e if m timermax 0 m timervalue if m timervalue m timermax m timervalue 0 repaint actionlistener actionperformed actionevent m_timermax m_timervalue m_timervalue m_timermax m_timervalue paint component pre image message progress bar pre param g public void paint component graphics g dimension panel size get size g set color new color 1f 1f 1f 0 4f 5 is a bit too light g fill rect 0 0 panel size width panel size height g set font s font g set color s color font metrics fm g get font metrics dimension message size new dimension fm string width m message fm get ascent fm get descent dimension image size new dimension s image get width this s image get height this dimension progress size new dimension 150 15 system out println panel panel size message message size image image size progress progress size horizontal layout int height image size height gap message size height gap progress size height if height panel size height log log level severe panel too small height panel size height return int y image panel size height 2 height 2 int y message y image image size height gap fm get ascent int y progress y message fm get descent gap system out println y image y image y message y message vertical layout if image size width panel size width message size width panel size width log log level severe panel too small width panel size width return int x image panel size width 2 image size width 2 int x message panel size width 2 message size width 2 int x progress panel size width 2 progress size width 2 g draw image s image x image y image this g draw string m message x message y message if m timermax 0 int p width progress size width m timermax m timervalue g set color compiereplaf get primary3 g fill3d rect x progress y progress p width progress size height true g set color compiereplaf get primary2 g draw3d rect x progress y progress progress size width progress size height true progressbar paintcomponent panelsize getsize setcolor fillrect panelsize panelsize setfont s_font setcolor s_color fontmetrics getfontmetrics messagesize stringwidth m_message getascent getdescent imagesize s_image getwidth s_image getheight progresssize panelsize messagesize imagesize progresssize imagesize messagesize progresssize panelsize panelsize yimage panelsize ymessage yimage imagesize getascent yprogress ymessage getdescent yimage yimage ymessage ymessage imagesize panelsize messagesize panelsize panelsize ximage panelsize imagesize xmessage panelsize messagesize xprogress panelsize progresssize drawimage s_image ximage yimage drawstring m_message xmessage ymessage m_timermax pwidth progresssize m_timermax m_timervalue setcolor getprimary3 fill3drect xprogress yprogress pwidth progresssize setcolor getprimary2 draw3drect xprogress yprogress progresssize progresssize mouse listener param e public void mouse clicked mouse event e if is visible e consume mouseclicked mouseevent isvisible mouse listener param e public void mouse pressed mouse event e if is visible e consume mousepressed mouseevent isvisible mouse listener param e public void mouse released mouse event e if is visible e consume mousereleased mouseevent isvisible mouse listener param e public void mouse entered mouse event e if is visible e consume mouseentered mouseevent isvisible mouse listener param e public void mouse exited mouse event e if is visible e consume mouseexited mouseevent isvisible prepared statement constructor param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable param trx name transaction name or null public c statement int result set type int result set concurrency string trx name p vo new c statementvo result set type result set concurrency local access if db is remote objects try connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else if result set concurrency result set concur updatable conn db get connectionrw else conn db get connectionro if conn null throw new db exception no connection p stmt conn create statement result set type result set concurrency return catch sql exception e log log level severe c statement e resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable trxname cstatement resultsettype resultsetconcurrency trxname p_vo cstatementvo resultsettype resultsetconcurrency isremoteobjects trxname trxname getconnection resultsetconcurrency resultset concur_updatable getconnectionrw getconnectionro dbexception p_stmt createstatement resultsettype resultsetconcurrency sqlexception cstatement minimum constructor for sub classes protected c statement super cstatement remote constructor param vo value object public c statement c statementvo vo p vo vo cstatement cstatementvo p_vo execute query param sql0 unconverted sql to execute return result set or row set throws sql exception see java sql statement execute query string public result set execute query string sql0 throws sql exception convert sql p vo set sql db get database convert statement sql0 if p stmt null local return p stmt execute query p vo get sql client remote sever log finest server p vo remote db is remote objects try boolean remote db is remote objects c connection get is apps serverok false if remote p remoteerrors 1 remote c connection get is apps serverok true if remote server server c connection get get server if server null result set rs server stmt getrowset p vo if rs null log warning result set is null p vo else p remoteerrors 0 return rs log log level severe apps server not found p remoteerrors catch remote exception ex log log level severe apps server error ex p remoteerrors try locally log warning execute locally statement stmt local getstatement false null shared connection return stmt execute query p vo get sql resultset rowset sqlexception executequery resultset executequery sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executequery p_vo getsql p_vo isremoteobjects isremoteobjects cconnection isappsserverok p_remoteerrors cconnection isappsserverok cconnection getserver resultset stmt_getrowset p_vo resultset p_vo p_remoteerrors appsserver p_remoteerrors remoteexception appsserver p_remoteerrors local_getstatement executequery p_vo getsql execute update param sql0 unconverted sql return no of updated rows throws sql exception see java sql statement execute update string public int execute update string sql0 throws sql exception convert sql p vo set sql db get database convert statement sql0 if p stmt null local return p stmt execute update p vo get sql client remote sever log finest server p vo remote db is remote objects try boolean remote db is remote objects c connection get is apps serverok false if remote p remoteerrors 1 remote c connection get is apps serverok true if remote server server c connection get get server if server null int result server stmt executeupdate p vo p vo clear parameters re use of result set return result log log level severe apps server not found p remoteerrors catch remote exception ex log log level severe apps server error ex p remoteerrors try locally log warning execute locally statement pstmt local getstatement false null shared connection return pstmt execute update p vo get sql sqlexception executeupdate executeupdate sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executeupdate p_vo getsql p_vo isremoteobjects isremoteobjects cconnection isappsserverok p_remoteerrors cconnection isappsserverok cconnection getserver stmt_executeupdate p_vo p_vo clearparameters appsserver p_remoteerrors remoteexception appsserver p_remoteerrors local_getstatement executeupdate p_vo getsql get sql return sql public string get sql if p vo null return p vo get sql return null getsql p_vo p_vo getsql get connection return connection for local or null for remote throws sql exception see java sql statement get connection public connection get connection throws sql exception if p stmt null return p stmt get connection return null sqlexception getconnection getconnection sqlexception p_stmt p_stmt getconnection commit if local throws sql exception public void commit throws sql exception connection conn get connection if conn null conn get auto commit conn commit log fine commit sqlexception sqlexception getconnection getautocommit method execute update param sql0 string param auto generated keys int return int throws sql exception see java sql statement execute update string int public int execute update string sql0 int auto generated keys throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute update p vo get sql auto generated keys throw new java lang unsupported operation exception method execute update not yet implemented executeupdate autogeneratedkeys sqlexception executeupdate executeupdate autogeneratedkeys sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executeupdate p_vo getsql autogeneratedkeys unsupportedoperationexception executeupdate method execute update param sql0 string param column indexes int return int throws sql exception see java sql statement execute update string int public int execute update string sql0 int column indexes throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute update p vo get sql column indexes throw new java lang unsupported operation exception method execute update not yet implemented executeupdate columnindexes sqlexception executeupdate executeupdate columnindexes sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executeupdate p_vo getsql columnindexes unsupportedoperationexception executeupdate method execute update param sql0 string param column names string return int throws sql exception see java sql statement execute update string string public int execute update string sql0 string column names throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute update p vo get sql column names throw new java lang unsupported operation exception method execute update not yet implemented executeupdate columnnames sqlexception executeupdate executeupdate columnnames sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt executeupdate p_vo getsql columnnames unsupportedoperationexception executeupdate method execute param sql0 string return boolean throws sql exception see java sql statement execute string public boolean execute string sql0 throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute p vo get sql throw new java lang unsupported operation exception method execute not yet implemented sqlexception sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt p_vo getsql unsupportedoperationexception method execute param sql0 string param auto generated keys int return boolean throws sql exception see java sql statement execute string int public boolean execute string sql0 int auto generated keys throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute p vo get sql auto generated keys throw new java lang unsupported operation exception method execute not yet implemented autogeneratedkeys sqlexception autogeneratedkeys sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt p_vo getsql autogeneratedkeys unsupportedoperationexception method execute param sql0 string param column indexes int return boolean throws sql exception see java sql statement execute string int public boolean execute string sql0 int column indexes throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute p vo get sql column indexes throw new java lang unsupported operation exception method execute not yet implemented columnindexes sqlexception columnindexes sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt p_vo getsql columnindexes unsupportedoperationexception method execute param sql0 string param column names string return boolean throws sql exception see java sql statement execute string string public boolean execute string sql0 string column names throws sql exception p vo set sql db get database convert statement sql0 if p stmt null return p stmt execute p vo get sql column names throw new java lang unsupported operation exception method execute not yet implemented columnnames sqlexception columnnames sqlexception p_vo setsql getdatabase convertstatement p_stmt p_stmt p_vo getsql columnnames unsupportedoperationexception get max field size return field size throws sql exception see java sql statement get max field size public int get max field size throws sql exception if p stmt null return p stmt get max field size throw new java lang unsupported operation exception method get max field size not yet implemented sqlexception getmaxfieldsize getmaxfieldsize sqlexception p_stmt p_stmt getmaxfieldsize unsupportedoperationexception getmaxfieldsize method set max field size param max int throws sql exception see java sql statement set max field size int public void set max field size int max throws sql exception if p stmt null p stmt set max field size max else throw new java lang unsupported operation exception method set max field size not yet implemented setmaxfieldsize sqlexception setmaxfieldsize setmaxfieldsize sqlexception p_stmt p_stmt setmaxfieldsize unsupportedoperationexception setmaxfieldsize method get max rows return int throws sql exception see java sql statement get max rows public int get max rows throws sql exception if p stmt null return p stmt get max rows throw new java lang unsupported operation exception method get max rows not yet implemented getmaxrows sqlexception getmaxrows getmaxrows sqlexception p_stmt p_stmt getmaxrows unsupportedoperationexception getmaxrows method set max rows param max int throws sql exception see java sql statement set max rows int public void set max rows int max throws sql exception if p stmt null p stmt set max rows max else throw new java lang unsupported operation exception method set max rows not yet implemented setmaxrows sqlexception setmaxrows setmaxrows sqlexception p_stmt p_stmt setmaxrows unsupportedoperationexception setmaxrows add batch param sql sql throws sql exception see java sql statement add batch string public void add batch string sql throws sql exception if p stmt null p stmt add batch sql else throw new java lang unsupported operation exception method add batch not yet implemented sqlexception addbatch addbatch sqlexception p_stmt p_stmt addbatch unsupportedoperationexception addbatch method clear batch throws sql exception see java sql statement clear batch public void clear batch throws sql exception if p stmt null p stmt clear batch else throw new java lang unsupported operation exception method clear batch not yet implemented clearbatch sqlexception clearbatch clearbatch sqlexception p_stmt p_stmt clearbatch unsupportedoperationexception clearbatch method execute batch return int throws sql exception see java sql statement execute batch public int execute batch throws sql exception if p stmt null return p stmt execute batch throw new java lang unsupported operation exception method execute batch not yet implemented executebatch sqlexception executebatch executebatch sqlexception p_stmt p_stmt executebatch unsupportedoperationexception executebatch method get more results param current int return boolean throws sql exception see java sql statement get more results int public boolean get more results int current throws sql exception if p stmt null return p stmt get more results current throw new java lang unsupported operation exception method get more results not yet implemented getmoreresults sqlexception getmoreresults getmoreresults sqlexception p_stmt p_stmt getmoreresults unsupportedoperationexception getmoreresults method get generated keys return result set throws sql exception see java sql statement get generated keys public result set get generated keys throws sql exception if p stmt null return p stmt get generated keys throw new java lang unsupported operation exception method get generated keys not yet implemented getgeneratedkeys resultset sqlexception getgeneratedkeys resultset getgeneratedkeys sqlexception p_stmt p_stmt getgeneratedkeys unsupportedoperationexception getgeneratedkeys method get result set holdability return int throws sql exception see java sql statement get result set holdability public int get result set holdability throws sql exception if p stmt null return p stmt get result set holdability throw new java lang unsupported operation exception method get result set holdability not yet implemented getresultsetholdability sqlexception getresultsetholdability getresultsetholdability sqlexception p_stmt p_stmt getresultsetholdability unsupportedoperationexception getresultsetholdability method set escape processing param enable boolean throws sql exception see java sql statement set escape processing boolean public void set escape processing boolean enable throws sql exception if p stmt null p stmt set escape processing enable else throw new java lang unsupported operation exception method set escape processing not yet implemented setescapeprocessing sqlexception setescapeprocessing setescapeprocessing sqlexception p_stmt p_stmt setescapeprocessing unsupportedoperationexception setescapeprocessing method get query timeout return int throws sql exception see java sql statement get query timeout public int get query timeout throws sql exception if p stmt null return p stmt get query timeout throw new java lang unsupported operation exception method get query timeout not yet implemented getquerytimeout sqlexception getquerytimeout getquerytimeout sqlexception p_stmt p_stmt getquerytimeout unsupportedoperationexception getquerytimeout method set query timeout param seconds int throws sql exception see java sql statement set query timeout int public void set query timeout int seconds throws sql exception if p stmt null p stmt set query timeout seconds else throw new java lang unsupported operation exception method set query timeout not yet implemented setquerytimeout sqlexception setquerytimeout setquerytimeout sqlexception p_stmt p_stmt setquerytimeout unsupportedoperationexception setquerytimeout method cancel throws sql exception see java sql statement cancel public void cancel throws sql exception if p stmt null p stmt cancel else throw new java lang unsupported operation exception method cancel not yet implemented sqlexception sqlexception p_stmt p_stmt unsupportedoperationexception method get warnings return sql warning throws sql exception see java sql statement get warnings public sql warning get warnings throws sql exception if p stmt null return p stmt get warnings throw new java lang unsupported operation exception method get warnings not yet implemented getwarnings sqlwarning sqlexception getwarnings sqlwarning getwarnings sqlexception p_stmt p_stmt getwarnings unsupportedoperationexception getwarnings method clear warnings throws sql exception see java sql statement clear warnings public void clear warnings throws sql exception if p stmt null p stmt clear warnings else throw new java lang unsupported operation exception method clear warnings not yet implemented clearwarnings sqlexception clearwarnings clearwarnings sqlexception p_stmt p_stmt clearwarnings unsupportedoperationexception clearwarnings method set cursor name param name string throws sql exception see java sql statement set cursor name string public void set cursor name string name throws sql exception if p stmt null p stmt set cursor name name else throw new java lang unsupported operation exception method set cursor name not yet implemented setcursorname sqlexception setcursorname setcursorname sqlexception p_stmt p_stmt setcursorname unsupportedoperationexception setcursorname method get result set return result set throws sql exception see java sql statement get result set public result set get result set throws sql exception if p stmt null return p stmt get result set throw new java lang unsupported operation exception method get result set not yet implemented getresultset resultset sqlexception getresultset resultset getresultset sqlexception p_stmt p_stmt getresultset unsupportedoperationexception getresultset method get update count return int throws sql exception see java sql statement get update count public int get update count throws sql exception if p stmt null return p stmt get update count throw new java lang unsupported operation exception method get update count not yet implemented getupdatecount sqlexception getupdatecount getupdatecount sqlexception p_stmt p_stmt getupdatecount unsupportedoperationexception getupdatecount method get more results return boolean throws sql exception see java sql statement get more results public boolean get more results throws sql exception if p stmt null return p stmt get more results throw new java lang unsupported operation exception method get more results not yet implemented getmoreresults sqlexception getmoreresults getmoreresults sqlexception p_stmt p_stmt getmoreresults unsupportedoperationexception getmoreresults method set fetch direction param direction int throws sql exception see java sql statement set fetch direction int public void set fetch direction int direction throws sql exception if p stmt null p stmt set fetch direction direction else throw new java lang unsupported operation exception method set fetch direction not yet implemented setfetchdirection sqlexception setfetchdirection setfetchdirection sqlexception p_stmt p_stmt setfetchdirection unsupportedoperationexception setfetchdirection method get fetch direction return int throws sql exception see java sql statement get fetch direction public int get fetch direction throws sql exception if p stmt null return p stmt get fetch direction throw new java lang unsupported operation exception method get fetch direction not yet implemented getfetchdirection sqlexception getfetchdirection getfetchdirection sqlexception p_stmt p_stmt getfetchdirection unsupportedoperationexception getfetchdirection method set fetch size param rows int throws sql exception see java sql statement set fetch size int public void set fetch size int rows throws sql exception if p stmt null p stmt set fetch size rows else throw new java lang unsupported operation exception method set fetch size not yet implemented setfetchsize sqlexception setfetchsize setfetchsize sqlexception p_stmt p_stmt setfetchsize unsupportedoperationexception setfetchsize method get fetch size return int throws sql exception see java sql statement get fetch size public int get fetch size throws sql exception if p stmt null return p stmt get fetch size throw new java lang unsupported operation exception method get fetch size not yet implemented getfetchsize sqlexception getfetchsize getfetchsize sqlexception p_stmt p_stmt getfetchsize unsupportedoperationexception getfetchsize method get result set concurrency return int throws sql exception see java sql statement get result set concurrency public int get result set concurrency throws sql exception if p stmt null return p stmt get result set concurrency throw new java lang unsupported operation exception method get result set concurrency not yet implemented getresultsetconcurrency sqlexception getresultsetconcurrency getresultsetconcurrency sqlexception p_stmt p_stmt getresultsetconcurrency unsupportedoperationexception getresultsetconcurrency method get result set type return int throws sql exception see java sql statement get result set type public int get result set type throws sql exception if p stmt null return p stmt get result set type throw new java lang unsupported operation exception method get result set type not yet implemented getresultsettype sqlexception getresultsettype getresultsettype sqlexception p_stmt p_stmt getresultsettype unsupportedoperationexception getresultsettype close throws sql exception see java sql statement close public void close throws sql exception if p stmt null p stmt close sqlexception sqlexception p_stmt p_stmt execute update return row count public int remote executeupdate log finest try compiere database db c connection get get database if db null throw new null pointer exception remote no database statement pstmt local getstatement false null shared connection int result pstmt execute update p vo get sql pstmt close return result catch exception ex log log level severe p vo to string ex throw new runtime exception ex remote_executeupdate compieredatabase cconnection getdatabase nullpointerexception local_getstatement executeupdate p_vo getsql p_vo tostring runtimeexception get prepared statement to create row set method called on remote to execute locally param dedicated connection if true gets new connection if false gets anormal ro rw connection return prepared statement private statement local getstatement boolean dedicated connection string trx name log finest connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else if dedicated connection conn db create connection false connection transaction read committed else conn local getconnection trx name statement stmt null try stmt conn create statement p vo get result set type p vo get result set concurrency catch sql exception ex log log level severe local ex try if stmt null stmt close stmt null catch sql exception ex1 return stmt rowset dedicatedconnection local_getstatement dedicatedconnection trxname trxname trxname getconnection dedicatedconnection createconnection transaction_read_committed local_getconnection trxname createstatement p_vo getresultsettype p_vo getresultsetconcurrency sqlexception sqlexception get local connection return connection protected connection local getconnection string trx name connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else if p vo get result set concurrency result set concur updatable conn db get connectionrw else conn db get connectionro return conn local_getconnection trxname trxname trxname getconnection p_vo getresultsetconcurrency resultset concur_updatable getconnectionrw getconnectionro get result as row set for remote get shared connection for rmi if row set is transfred via rmi closing the row set does not close the connection return result as row set public row set remote getrowset log finest remote try compiere database db c connection get get database if db null log log level severe no database throw new null pointer exception remote no database statement stmt local getstatement false null shared connection result set rs stmt execute query p vo get sql row set row set db get row set rs rs close stmt close if row set null return row set else log log level severe no row set throw new null pointer exception remore no row set catch exception ex log log level severe p vo to string ex throw new runtime exception ex return null shared connection connection conn local getconnection null prepared statement pstmt null row set row set null try pstmt conn prepare statement p vo get sql result set type scroll insensitive result set concur read only set parameters array list parameters p vo get parameters for int i 0 i parameters size i object o parameters get i if o null throw new illegal argument exception null parameter i else if o instanceof null parameter int type null parameter o get type pstmt set null i 1 type log finest i 1 null else if o instanceof integer pstmt set int i 1 integer o int value log finest i 1 int o else if o instanceof string pstmt set string i 1 string o log finest i 1 string o else if o instanceof timestamp pstmt set timestamp i 1 timestamp o log finest i 1 timestamp o else if o instanceof big decimal pstmt set big decimal i 1 big decimal o log finest i 1 big decimal o else throw new java lang unsupported operation exception unknown parameter class o get class result set rs pstmt execute query row set c cached row set get row set rs pstmt close pstmt null catch exception ex log log level severe p vo to string ex throw new runtime exception ex close cursor try if pstmt null pstmt close pstmt null catch exception e log log level severe close pstmt e return row set rowset rowset rowset rowset rowset remote_getrowset compieredatabase cconnection getdatabase nullpointerexception local_getstatement resultset executequery p_vo getsql rowset rowset getrowset rowset rowset rowset nullpointerexception rowset p_vo tostring runtimeexception local_getconnection preparedstatement rowset rowset preparestatement p_vo getsql resultset type_scroll_insensitive resultset concur_read_only arraylist p_vo getparameters illegalargumentexception nullparameter nullparameter gettype setnull setint intvalue setstring settimestamp bigdecimal setbigdecimal bigdecimal bigdecimal unsupportedoperationexception getclass resultset executequery rowset ccachedrowset getrowset p_vo tostring runtimeexception rowset constructor param is info schedule for call back param type type of schedule type public v schedule info schedule is int type m type type m model new m schedule env get ctx schedule panel set type m type schedule panel set time panel time panel schedule panel set info schedule is for callback try jb init catch exception e log log level severe v schedule e infoschedule type_ vschedule infoschedule m_type m_model mschedule getctx schedulepanel settype m_type schedulepanel settimepanel timepanel schedulepanel setinfoschedule jbinit vschedule static init pre time panel west schedle panel in schedule pane center pre throws exception private void jb init throws exception this set layout main layout this add time panel border layout west schedule pane set horizontal scroll bar policy j scroll pane horizontal scrollbar always schedule pane set vertical scroll bar policy j scroll pane vertical scrollbar never schedule pane get viewport add schedule panel null schedule pane set preferred size new dimension 200 200 schedule pane set border null this add schedule pane border layout center timepanel schedlepanel schedulepane jbinit setlayout mainlayout timepanel borderlayout schedulepane sethorizontalscrollbarpolicy jscrollpane horizontal_scrollbar_always schedulepane setverticalscrollbarpolicy jscrollpane vertical_scrollbar_never schedulepane getviewport schedulepanel schedulepane setpreferredsize schedulepane setborder schedulepane borderlayout recreate view param s resource id resource param date date public void recreate int s resource id timestamp date calculate start day gregorian calendar cal new gregorian calendar cal set time date cal set calendar hour 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 if m type type week cal set calendar day of week cal get first day of week else if m type type month cal set calendar day of month 1 m startdate new timestamp cal get time in millis calculate end date cal add m type 1 m enddate new timestamp cal get time in millis log config m type resource id s resource id m startdate m enddate create slots m assignment slot mas m model get assignment slots s resource id m startdate m enddate null true null m assignment slot mts m model get day time slots set panels time panel set time slots mts schedule panel set assignment slots mas s resource id m startdate m enddate set height schedule panel set height time panel get preferred size height repaint s_resource_id s_resource_id gregoriancalendar gregoriancalendar settime m_type type_week day_of_week getfirstdayofweek m_type type_month day_of_month m_startdate gettimeinmillis m_type m_enddate gettimeinmillis m_type resource_id s_resource_id m_startdate m_enddate massignmentslot m_model getassignmentslots s_resource_id m_startdate m_enddate massignmentslot m_model getdaytimeslots timepanel settimeslots schedulepanel setassignmentslots s_resource_id m_startdate m_enddate schedulepanel setheight timepanel getpreferredsize enable disable to create new assignments param create new if true allows to create new assignments public void set create new boolean create new schedule panel set create new create new createnew setcreatenew createnew schedulepanel setcreatenew createnew dispose public void dispose m model null time panel null if schedule panel null schedule panel dispose schedule panel null this remove all m_model timepanel schedulepanel schedulepanel schedulepanel removeall get start date return start date public timestamp get start date return m startdate getstartdate m_startdate convert dialog public convert dialog try jb init f select file add item d compiere db database create views sql f select file add item d compiere db database create temporary sql f select file add item d compiere db database create sequences sql f select file add item d compiere db database create compiere sql set up environment f connect set value c connection get database db db2 linux db db2 default port adempiere f target set selected item database db postgresql f execute set selected true cmd execute set ui pack set visible true catch exception e system err println e convertdialog jbinit fselectfile additem fselectfile additem fselectfile additem fselectfile additem fconnect setvalue cconnection db_db2 db_db2 default_port ftarget setselecteditem db_postgresql fexecute setselected cmd_execute setvisible static layout throws exception private void jb init throws exception component1 box create horizontal strut 8 component2 box create horizontal strut 8 component3 box create vertical strut 8 component4 box create vertical strut 8 this set default close operation j frame exit on close this set title db convert dialog parameter panel set layout grid bag layout1 l select file set text select file f select file set editable true b select file set text add file b select file add action listener this f execute set text execute directly f execute add action listener this l connect set text connection b start set text start b start add action listener this info pane set background color light gray info pane set editable false scroll pane set preferred size new dimension 200 200 l target set text target f verbose set text verbose this get content pane add parameter panel border layout north parameter panel add l select file new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 parameter panel add f select file new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add b select file new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints southwest grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add f execute new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add l connect new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 parameter panel add f connect new grid bag constraints 2 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 5 5 5 0 0 parameter panel add b start new grid bag constraints 3 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add component1 new grid bag constraints 5 0 1 2 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 parameter panel add component2 new grid bag constraints 0 0 1 2 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 parameter panel add component3 new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 parameter panel add component4 new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 0 0 0 0 parameter panel add l target new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 this get content pane add scroll pane border layout center scroll pane get viewport add info pane null parameter panel add f target new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add f verbose new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 jbinit createhorizontalstrut createhorizontalstrut createverticalstrut createverticalstrut setdefaultcloseoperation jframe exit_on_close settitle parameterpanel setlayout gridbaglayout1 lselectfile settext fselectfile seteditable bselectfile settext bselectfile addactionlistener fexecute settext fexecute addactionlistener lconnect settext bstart settext bstart addactionlistener infopane setbackground lightgray infopane seteditable scrollpane setpreferredsize ltarget settext fverbose settext getcontentpane parameterpanel borderlayout parameterpanel lselectfile gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fselectfile gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel bselectfile gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fexecute gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel lconnect gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fconnect gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel bstart gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel ltarget gridbagconstraints gridbagconstraints gridbagconstraints getcontentpane scrollpane borderlayout scrollpane getviewport infopane parameterpanel ftarget gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fverbose gridbagconstraints gridbagconstraints gridbagconstraints action listener param e event public void action performed action event e set cursor cursor get predefined cursor cursor wait cursor if e get source b start b start set enabled false cmd start b start set enabled true else if e get source b select file cmd selectfile else if e get source f execute cmd execute set cursor cursor get default cursor actionperformed actionevent setcursor getpredefinedcursor wait_cursor getsource bstart bstart setenabled cmd_start bstart setenabled getsource bselectfile cmd_selectfile getsource fexecute cmd_execute setcursor getdefaultcursor execute toggle private void cmd execute l connect set enabled f execute is selected f connect set read write f execute is selected l target set enabled f execute is selected f target set enabled f execute is selected cmd_execute lconnect setenabled fexecute isselected fconnect setreadwrite fexecute isselected ltarget setenabled fexecute isselected ftarget setenabled fexecute isselected select file and add to selection private void cmd selectfile j file chooser fc new j file chooser fc set multi selection enabled false if fc show open dialog this j file chooser approve option return file f fc get selected file if f null f is file return string file name f get absolute path f select file add item file name f select file set selected item file name cmd_selectfile jfilechooser jfilechooser setmultiselectionenabled showopendialog jfilechooser approve_option getselectedfile isfile filename getabsolutepath fselectfile additem filename fselectfile setselecteditem filename start pressed private void cmd start open and read file file file new file string f select file get selected item if file exists file is directory info pane append file does not exist or a directory file n return info pane append opening file file n string buffer sb new string buffer 1000 try file reader fr new file reader file buffered reader in new buffered reader fr string line null int lines 0 while line in read line null lines sb append line append n in close fr close info pane append read lines lines size sb length n catch file not found exception fnf info pane append error fnf n return catch io exception ioe info pane append error ioe n return target system if f execute is selected c connection cc c connection f connect get value convert convert new convert cc get type convert set verbose f verbose is selected connection conn cc get connection true connection transaction read committed convert execute sb to string conn if convert has error string buffer sbb new string buffer error if convert get conversion error null sbb append convert get conversion error append if convert get exception null sbb append convert get exception convert get exception print stack trace sbb append n info pane append sbb to string else info pane append ok n else string target string f target get selected item if database db oracle equals target info pane append no conversion needed n return convert convert new convert target string cc convert convert all sb to string output file name string file name file get absolute path int pos file name last index of if pos 1 file name target else file name file name substring 0 pos target file name substring pos info pane append writing to file name n write to file try file writer fw new file writer file name false buffered writer out new buffered writer fw out write a dempiere db port convert oracle to target out new line out write compiere get summary out new line out write cc out close fw close catch io exception ioe info pane append error ioe n info pane append written cc length n cmd_start fselectfile getselecteditem isdirectory infopane infopane stringbuffer stringbuffer filereader filereader bufferedreader bufferedreader readline infopane filenotfoundexception infopane ioexception infopane fexecute isselected cconnection cconnection fconnect getvalue gettype setverbose fverbose isselected getconnection transaction_read_committed tostring haserror stringbuffer stringbuffer getconversionerror getconversionerror getexception getexception getexception printstacktrace infopane tostring infopane ftarget getselecteditem db_oracle infopane convertall tostring filename getabsolutepath filename lastindexof filename filename filename filename infopane filename filewriter filewriter filename bufferedwriter bufferedwriter adempiere dbport newline getsummary newline ioexception infopane infopane start dialog param args ignored public static void main string args new convert dialog convertdialog project planned price qty called from planned price planned qty calculates planned amt same as trigger public string planned properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true big decimal planned qty planned price int std precision env get context as int ctx window no std precision get values planned qty big decimal m tab get value planned qty if planned qty null planned qty env one planned price big decimal m tab get value planned price if planned price null planned price env zero big decimal planned amt planned qty multiply planned price if planned amt scale std precision planned amt planned amt set scale std precision big decimal round half up log fine planned qty planned qty planned price planned price planned amt planned amt precision std precision m tab set value planned amt planned amt set callout active false return plannedprice plannedqty plannedamt windowno mtab mtab mfield mfield iscalloutactive setcalloutactive bigdecimal plannedqty plannedprice stdprecision getcontextasint windowno stdprecision plannedqty bigdecimal mtab getvalue plannedqty plannedqty plannedqty plannedprice bigdecimal mtab getvalue plannedprice plannedprice plannedprice bigdecimal plannedamt plannedqty plannedprice plannedamt stdprecision plannedamt plannedamt setscale stdprecision bigdecimal round_half_up plannedqty plannedqty plannedprice plannedprice plannedamt plannedamt stdprecision mtab setvalue plannedamt plannedamt setcalloutactive public load bank statement super log info load bank statement loadbankstatement loadbankstatement prepare e g get parameters protected void prepare log info m ctx env get ctx process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if name equals c bankstatementloader id m c bankstmtloader id big decimal para i get parameter int value else if name equals file name file name string para i get parameter else log log level severe unknown parameter name m ad client id env getad client id m ctx log info ad client id m ad client id m ad org id env getad org id m ctx log info ad org id m ad org id log info c bankstatementloader id m c bankstmtloader id m_ctx getctx processinfoparameter getparameter getparametername c_bankstatementloader_id m_c_bankstmtloader_id bigdecimal getparameter intvalue filename filename getparameter m_ad_client_id getad_client_id m_ctx ad_client_id m_ad_client_id m_ad_org_id getad_org_id m_ctx ad_org_id m_ad_org_id c_bankstatementloader_id m_c_bankstmtloader_id perform process return message throws exception protected string do it throws java lang exception log info load bank statement do it string message error m controller new m bank statement loader m ctx m c bankstmtloader id file name get trxname log info m controller to string if m controller null m controller get id 0 log log level severe invalid loader start loading bank statement lines else if m controller load lines log log level severe m controller get error message m controller get error description else log info imported m controller get load count add log 0 null new big decimal m controller get load count loaded message ok return message doit loadbankstatement doit m_controller mbankstatementloader m_ctx m_c_bankstmtloader_id filename get_trxname m_controller tostring m_controller m_controller get_id m_controller loadlines m_controller geterrormessage m_controller geterrordescription m_controller getloadcount addlog bigdecimal m_controller getloadcount standard constructor public x c taxdeclaration properties ctx int c taxdeclaration id string trx name super ctx c taxdeclaration id trx name if c taxdeclaration id 0 setc taxdeclaration id 0 set date from new timestamp system current time millis set date to new timestamp system current time millis set date trx new timestamp system current time millis set name null set processed false x_c_taxdeclaration c_taxdeclaration_id trxname c_taxdeclaration_id trxname c_taxdeclaration_id setc_taxdeclaration_id setdatefrom currenttimemillis setdateto currenttimemillis setdatetrx currenttimemillis setname setprocessed load constructor public x c taxdeclaration properties ctx result set rs string trx name super ctx rs trx name x_c_taxdeclaration resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c taxdeclaration append get id append return sb to string tostring stringbuffer stringbuffer x_c_taxdeclaration get_id tostring set tax declaration define the declaration to the tax authorities public void setc taxdeclaration id int c taxdeclaration id if c taxdeclaration id 1 throw new illegal argument exception c taxdeclaration id is mandatory set valuenocheck c taxdeclaration id new integer c taxdeclaration id setc_taxdeclaration_id c_taxdeclaration_id c_taxdeclaration_id illegalargumentexception c_taxdeclaration_id set_valuenocheck c_taxdeclaration_id c_taxdeclaration_id get tax declaration define the declaration to the tax authorities public int getc taxdeclaration id integer ii integer get value c taxdeclaration id if ii null return 0 return ii int value getc_taxdeclaration_id get_value c_taxdeclaration_id intvalue set date from starting date for a range public void set date from timestamp date from if date from null throw new illegal argument exception date from is mandatory set value date from date from setdatefrom datefrom datefrom illegalargumentexception datefrom set_value datefrom datefrom get date from starting date for a range public timestamp get date from return timestamp get value date from getdatefrom get_value datefrom set date to end date of a date range public void set date to timestamp date to if date to null throw new illegal argument exception date to is mandatory set value date to date to setdateto dateto dateto illegalargumentexception dateto set_value dateto dateto get date to end date of a date range public timestamp get date to return timestamp get value date to getdateto get_value dateto set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set value date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_value datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x c payschedule properties ctx int c payschedule id string trx name super ctx c payschedule id trx name if c payschedule id 0 setc payschedule id 0 setc paymentterm id 0 set discount env zero set discount days 0 set grace days 0 set is valid false set net days 0 set percentage env zero x_c_payschedule c_payschedule_id trxname c_payschedule_id trxname c_payschedule_id setc_payschedule_id setc_paymentterm_id setdiscount setdiscountdays setgracedays setisvalid setnetdays setpercentage load constructor public x c payschedule properties ctx result set rs string trx name super ctx rs trx name x_c_payschedule resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c payschedule append get id append return sb to string tostring stringbuffer stringbuffer x_c_payschedule get_id tostring set payment schedule payment schedule template public void setc payschedule id int c payschedule id if c payschedule id 1 throw new illegal argument exception c payschedule id is mandatory set valuenocheck c payschedule id new integer c payschedule id setc_payschedule_id c_payschedule_id c_payschedule_id illegalargumentexception c_payschedule_id set_valuenocheck c_payschedule_id c_payschedule_id get payment schedule payment schedule template public int getc payschedule id integer ii integer get value c payschedule id if ii null return 0 return ii int value getc_payschedule_id get_value c_payschedule_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set valuenocheck c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_valuenocheck c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc paymentterm id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_paymentterm_id set discount discount in percent public void set discount big decimal discount if discount null throw new illegal argument exception discount is mandatory set value discount discount setdiscount bigdecimal illegalargumentexception set_value get discount discount in percent public big decimal get discount big decimal bd big decimal get value discount if bd null return env zero return bd bigdecimal getdiscount bigdecimal bigdecimal get_value set discount days number of days from invoice date to be eligible for discount public void set discount days int discount days set value discount days new integer discount days setdiscountdays discountdays set_value discountdays discountdays get discount days number of days from invoice date to be eligible for discount public int get discount days integer ii integer get value discount days if ii null return 0 return ii int value getdiscountdays get_value discountdays intvalue set grace days days after due date to send first dunning letter public void set grace days int grace days set value grace days new integer grace days setgracedays gracedays set_value gracedays gracedays get grace days days after due date to send first dunning letter public int get grace days integer ii integer get value grace days if ii null return 0 return ii int value getgracedays get_value gracedays intvalue set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue public static final string netday sunday 7 set net day day when payment is due net public void set net day string net day if net day null throw new illegal argument exception net day is mandatory if net day null net day equals 1 net day equals 2 net day equals 3 net day equals 4 net day equals 5 net day equals 6 net day equals 7 else throw new illegal argument exception net day invalid value net day reference id 167 1 2 3 4 5 6 7 if net day null net day length 1 log warning length 1 truncated net day net day substring 0 0 set value net day net day netday_sunday setnetday netday netday illegalargumentexception netday netday netday netday netday netday netday netday netday illegalargumentexception netday netday reference_id netday netday netday netday set_value netday netday get net day day when payment is due net public string get net day return string get value net day getnetday get_value netday set net days net days in which payment is due public void set net days int net days set value net days new integer net days setnetdays netdays set_value netdays netdays get net days net days in which payment is due public int get net days integer ii integer get value net days if ii null return 0 return ii int value getnetdays get_value netdays intvalue set percentage percent of the entire amount public void set percentage big decimal percentage if percentage null throw new illegal argument exception percentage is mandatory set value percentage percentage setpercentage bigdecimal illegalargumentexception set_value get percentage percent of the entire amount public big decimal get percentage big decimal bd big decimal get value percentage if bd null return env zero return bd bigdecimal getpercentage bigdecimal bigdecimal get_value standard cinstructor param ctx context param m pricelist version id id public m price list version properties ctx int m pricelist version id string trx name super ctx m pricelist version id trx name if m pricelist version id 0 set name null date setm pricelist id 0 set valid from time util get day null date setm discountschema id 0 m_pricelist_version_id mpricelistversion m_pricelist_version_id trxname m_pricelist_version_id trxname m_pricelist_version_id setname setm_pricelist_id setvalidfrom timeutil getday setm_discountschema_id load constructor param ctx context param rs result set public m price list version properties ctx result set rs string trx name super ctx rs trx name mpricelistversion resultset trxname trxname parent constructor param pl parent public m price list version m price list pl this pl get ctx 0 pl get trxname set client org pl setm pricelist id pl getm pricelist id mpricelistversion mpricelist getctx get_trxname setclientorg setm_pricelist_id getm_pricelist_id set name to valid from date if valid from not set use today public void set name if get valid from null set valid from time util get day null if get name null string name display type get date format display type date format get valid from set name name setname getvalidfrom setvalidfrom timeutil getday getname displaytype getdateformat displaytype getvalidfrom setname before save param new record new return true protected boolean before save boolean new record set name return true newrecord beforesave newrecord setname standard constructor param ctx context param m requisitionline id id public m requisition line properties ctx int m requisitionline id string trx name super ctx m requisitionline id trx name if m requisitionline id 0 setm requisition id 0 set line 0 sql select coalesce max line 0 10 as default value from m requisitionline where m requisition id m requisition id set line net amt env zero set price actual env zero set qty env one 1 m_requisitionline_id mrequisitionline m_requisitionline_id trxname m_requisitionline_id trxname m_requisitionline_id setm_requisition_id setline defaultvalue m_requisitionline m_requisition_id m_requisition_id setlinenetamt setpriceactual setqty load constructor param ctx context param rs result set public m requisition line properties ctx result set rs string trx name super ctx rs trx name mrequisitionline resultset trxname trxname parent constructor param req requisition public m requisition line m requisition req this req get ctx 0 req get trxname set client org req setm requisition id req getm requisition id m m pricelist id req getm pricelist id m parent req mrequisitionline mrequisition getctx get_trxname setclientorg setm_requisition_id getm_requisition_id m_m_pricelist_id getm_pricelist_id m_parent return returns the c bpartner id public int getc bpartner id return m c bpartner id c_bpartner_id getc_bpartner_id m_c_bpartner_id param partner id the c bpartner id to set public void setc bpartner id int partner id m c bpartner id partner id partner_id c_bpartner_id setc_bpartner_id partner_id m_c_bpartner_id partner_id get parent return parent public m requisition get parent if m parent null m parent new m requisition get ctx getm requisition id get trxname return m parent mrequisition getparent m_parent m_parent mrequisition getctx getm_requisition_id get_trxname m_parent set price public void set price if getc charge id 0 m charge charge m charge get get ctx getc charge id set price actual charge get charge amt if getm product id 0 return if m m pricelist id 0 m m pricelist id get parent getm pricelist id if m m pricelist id 0 log log level severe price list unknown return set price m m pricelist id setprice getc_charge_id mcharge mcharge getctx getc_charge_id setpriceactual getchargeamt getm_product_id m_m_pricelist_id m_m_pricelist_id getparent getm_pricelist_id m_m_pricelist_id pricelist setprice m_m_pricelist_id set price for product and price list param m pricelist id price list public void set price int m pricelist id if getm product id 0 return log fine m pricelist id m pricelist id boolean isso trx false m product pricing pp new m product pricing getm product id getc bpartner id get qty isso trx pp setm pricelist id m pricelist id pp set price date get date ordered set price actual pp get price std pricelist m_pricelist_id setprice m_pricelist_id getm_product_id m_pricelist_id m_pricelist_id issotrx mproductpricing mproductpricing getm_product_id getc_bpartner_id getqty issotrx setm_pricelist_id m_pricelist_id setpricedate getdateordered setpriceactual getpricestd calculate line net amt public void set line net amt big decimal line net amt get qty multiply get price actual super set line net amt line net amt setlinenetamt bigdecimal linenetamt getqty getpriceactual setlinenetamt linenetamt before save param new record new return true protected boolean before save boolean new record if get line 0 string sql select coalesce max line 0 10 from m requisitionline where m requisition id int ii db getsql value get trxname sql getm requisition id set line ii product asi charge if getm product id 0 getc charge id 0 setc charge id 0 if getm attributesetinstance id 0 getc charge id 0 setm attributesetinstance id 0 if get price actual compare to env zero 0 set price set line net amt return true newrecord beforesave newrecord getline m_requisitionline m_requisition_id getsqlvalue get_trxname getm_requisition_id setline getm_product_id getc_charge_id setc_charge_id getm_attributesetinstance_id getc_charge_id setm_attributesetinstance_id getpriceactual compareto setprice setlinenetamt after save update total on header param new record if new record param success save was success protected boolean after save boolean new record boolean success if success return success return update header newrecord aftersave newrecord updateheader after delete param success return true false protected boolean after delete boolean success if success return success return update header afterdelete updateheader update header return header updated private boolean update header log fine string sql update m requisition r set total lines select coalesce sum line net amt 0 from m requisitionline rl where r m requisition id rl m requisition id where m requisition id getm requisition id int no db execute update sql get trxname if no 1 log log level severe header update no m parent null return no 1 updateheader m_requisition totallines linenetamt m_requisitionline m_requisition_id m_requisition_id m_requisition_id getm_requisition_id executeupdate get_trxname m_parent standard constructor public x m transaction properties ctx int m transaction id string trx name super ctx m transaction id trx name if m transaction id 0 setm attributesetinstance id 0 setm locator id 0 setm product id 0 setm transaction id 0 set movement date new timestamp system current time millis set movement qty env zero set movement type null x_m_transaction m_transaction_id trxname m_transaction_id trxname m_transaction_id setm_attributesetinstance_id setm_locator_id setm_product_id setm_transaction_id setmovementdate currenttimemillis setmovementqty setmovementtype load constructor public x m transaction properties ctx result set rs string trx name super ctx rs trx name x_m_transaction resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m transaction append get id append return sb to string tostring stringbuffer stringbuffer x_m_transaction get_id tostring set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 0 set valuenocheck c projectissue id null else set valuenocheck c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id set_valuenocheck c_projectissue_id set_valuenocheck c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set valuenocheck m inoutline id null else set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_valuenocheck m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set valuenocheck m inventoryline id null else set valuenocheck m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_valuenocheck m_inventoryline_id set_valuenocheck m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set valuenocheck m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_valuenocheck m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 0 set valuenocheck m movementline id null else set valuenocheck m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id set_valuenocheck m_movementline_id set_valuenocheck m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 0 set valuenocheck m productionline id null else set valuenocheck m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id set_valuenocheck m_productionline_id set_valuenocheck m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue set inventory transaction public void setm transaction id int m transaction id if m transaction id 1 throw new illegal argument exception m transaction id is mandatory set valuenocheck m transaction id new integer m transaction id setm_transaction_id m_transaction_id m_transaction_id illegalargumentexception m_transaction_id set_valuenocheck m_transaction_id m_transaction_id get inventory transaction public int getm transaction id integer ii integer get value m transaction id if ii null return 0 return ii int value getm_transaction_id get_value m_transaction_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set valuenocheck movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_valuenocheck movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate return timestamp get value movement date public key name pair get key name pair return new key name pair get id string value of get movement date get_value movementdate keynamepair getkeynamepair keynamepair get_id valueof getmovementdate set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set valuenocheck movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_valuenocheck movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty public static final string movementtype workorder w set movement type method of moving the inventory public void set movement type string movement type if movement type null throw new illegal argument exception movement type is mandatory if movement type equals c movement type equals c movement type equals i movement type equals i movement type equals m movement type equals m movement type equals p movement type equals p movement type equals v movement type equals v movement type equals w movement type equals w else throw new illegal argument exception movement type invalid value movement type reference id 189 c c i i m m p p v v w w if movement type length 2 log warning length 2 truncated movement type movement type substring 0 1 set valuenocheck movement type movement type movementtype_workorder_ setmovementtype movementtype movementtype illegalargumentexception movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype movementtype illegalargumentexception movementtype movementtype reference_id movementtype movementtype movementtype set_valuenocheck movementtype movementtype get movement type method of moving the inventory public string get movement type return string get value movement type getmovementtype get_value movementtype get content return content public object get contents return contents getcontents standard constructor public x m product acct properties ctx int m product acct id string trx name super ctx m product acct id trx name if m product acct id 0 setc acctschema id 0 setm product id 0 setp asset acct 0 setp cogs acct 0 setp costadjustment acct 0 setp expense acct 0 setp inventoryclearing acct 0 setp invoicepricevariance acct 0 setp purchasepricevariance acct 0 setp revenue acct 0 setp tradediscountgrant acct 0 setp tradediscountrec acct 0 x_m_product_acct m_product_acct_id trxname m_product_acct_id trxname m_product_acct_id setc_acctschema_id setm_product_id setp_asset_acct setp_cogs_acct setp_costadjustment_acct setp_expense_acct setp_inventoryclearing_acct setp_invoicepricevariance_acct setp_purchasepricevariance_acct setp_revenue_acct setp_tradediscountgrant_acct setp_tradediscountrec_acct load constructor public x m product acct properties ctx result set rs string trx name super ctx rs trx name x_m_product_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product acct append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set product asset account for product asset inventory public void setp asset acct int p asset acct set value p asset acct new integer p asset acct setp_asset_acct p_asset_acct set_value p_asset_acct p_asset_acct get product asset account for product asset inventory public int getp asset acct integer ii integer get value p asset acct if ii null return 0 return ii int value getp_asset_acct get_value p_asset_acct intvalue set product cogs account for cost of goods sold public void setp cogs acct int p cogs acct set value p cogs acct new integer p cogs acct setp_cogs_acct p_cogs_acct set_value p_cogs_acct p_cogs_acct get product cogs account for cost of goods sold public int getp cogs acct integer ii integer get value p cogs acct if ii null return 0 return ii int value getp_cogs_acct get_value p_cogs_acct intvalue set cost adjustment product cost adjustment account public void setp costadjustment acct int p costadjustment acct set value p costadjustment acct new integer p costadjustment acct setp_costadjustment_acct p_costadjustment_acct set_value p_costadjustment_acct p_costadjustment_acct get cost adjustment product cost adjustment account public int getp costadjustment acct integer ii integer get value p costadjustment acct if ii null return 0 return ii int value getp_costadjustment_acct get_value p_costadjustment_acct intvalue set product expense account for product expense public void setp expense acct int p expense acct set value p expense acct new integer p expense acct setp_expense_acct p_expense_acct set_value p_expense_acct p_expense_acct get product expense account for product expense public int getp expense acct integer ii integer get value p expense acct if ii null return 0 return ii int value getp_expense_acct get_value p_expense_acct intvalue set inventory clearing product inventory clearing account public void setp inventoryclearing acct int p inventoryclearing acct set value p inventoryclearing acct new integer p inventoryclearing acct setp_inventoryclearing_acct p_inventoryclearing_acct set_value p_inventoryclearing_acct p_inventoryclearing_acct get inventory clearing product inventory clearing account public int getp inventoryclearing acct integer ii integer get value p inventoryclearing acct if ii null return 0 return ii int value getp_inventoryclearing_acct get_value p_inventoryclearing_acct intvalue set invoice price variance difference between costs and invoice price ipv public void setp invoicepricevariance acct int p invoicepricevariance acct set value p invoicepricevariance acct new integer p invoicepricevariance acct setp_invoicepricevariance_acct p_invoicepricevariance_acct set_value p_invoicepricevariance_acct p_invoicepricevariance_acct get invoice price variance difference between costs and invoice price ipv public int getp invoicepricevariance acct integer ii integer get value p invoicepricevariance acct if ii null return 0 return ii int value getp_invoicepricevariance_acct get_value p_invoicepricevariance_acct intvalue set purchase price variance difference between standard cost and purchase price ppv public void setp purchasepricevariance acct int p purchasepricevariance acct set value p purchasepricevariance acct new integer p purchasepricevariance acct setp_purchasepricevariance_acct p_purchasepricevariance_acct set_value p_purchasepricevariance_acct p_purchasepricevariance_acct get purchase price variance difference between standard cost and purchase price ppv public int getp purchasepricevariance acct integer ii integer get value p purchasepricevariance acct if ii null return 0 return ii int value getp_purchasepricevariance_acct get_value p_purchasepricevariance_acct intvalue set product revenue account for product revenue sales account public void setp revenue acct int p revenue acct set value p revenue acct new integer p revenue acct setp_revenue_acct p_revenue_acct set_value p_revenue_acct p_revenue_acct get product revenue account for product revenue sales account public int getp revenue acct integer ii integer get value p revenue acct if ii null return 0 return ii int value getp_revenue_acct get_value p_revenue_acct intvalue set trade discount granted trade discount granted account public void setp tradediscountgrant acct int p tradediscountgrant acct set value p tradediscountgrant acct new integer p tradediscountgrant acct setp_tradediscountgrant_acct p_tradediscountgrant_acct set_value p_tradediscountgrant_acct p_tradediscountgrant_acct get trade discount granted trade discount granted account public int getp tradediscountgrant acct integer ii integer get value p tradediscountgrant acct if ii null return 0 return ii int value getp_tradediscountgrant_acct get_value p_tradediscountgrant_acct intvalue set trade discount received trade discount receivable account public void setp tradediscountrec acct int p tradediscountrec acct set value p tradediscountrec acct new integer p tradediscountrec acct setp_tradediscountrec_acct p_tradediscountrec_acct set_value p_tradediscountrec_acct p_tradediscountrec_acct get trade discount received trade discount receivable account public int getp tradediscountrec acct integer ii integer get value p tradediscountrec acct if ii null return 0 return ii int value getp_tradediscountrec_acct get_value p_tradediscountrec_acct intvalue get contents return contents public object get contents return contents getcontents standard constructor param ctx context param ignored public m workflow access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key else setad role id 0 setad workflow id 0 set is read write true mworkflowaccess trxname trxname illegalargumentexception setad_role_id setad_workflow_id setisreadwrite load constructor param ctx context param rs result set public m workflow access properties ctx result set rs string trx name super ctx rs trx name mworkflowaccess resultset trxname trxname parent constructor param parent parent param ad role id role id public m workflow access m workflow parent int ad role id super parent get ctx 0 parent get trxname set client org parent setad workflow id parent getad workflow id setad role id ad role id ad_role_id mworkflowaccess mworkflow ad_role_id getctx get_trxname setclientorg setad_workflow_id getad_workflow_id setad_role_id ad_role_id default constructor use set methods public del set the url that designates a source doument or message param url set the url that designates a source document or message public del set cite string url add attribute cite url return this setcite addattribute sets the date and time the change was made param datetime the date and time the change was made public del set date time string datetime add attribute datetime datetime return this setdatetime addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public del add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public del add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public del add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public del add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public del remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute public thead sets the span attribute param span sets the span attribute public thead set span string span add attribute span span return this setspan addattribute sets the span attribute param span sets the span attribute public thead set span int span add attribute span integer to string span return this setspan addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public thead set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public thead set width string width add attribute width width return this setwidth addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public thead set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public thead setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public thead set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public thead set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public thead set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public thead add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public thead add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public thead add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public thead add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public thead remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute create new order cost detail for purchase orders called from doc matchpo param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param c orderline id order param m costelement id optional cost element for freight param amt amt total amount param qty qty param description optional description public static boolean create order m acct schema as int ad org id int m product id int m attributesetinstance id int c orderline id int m costelement id big decimal amt big decimal qty string description string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and c orderline id c orderline id and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx c orderline id and m attributesetinstance id c orderline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setc orderline id c orderline id else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_matchpo ad_org_id m_product_id m_attributesetinstance_id c_orderline_id m_costelement_id createorder macctschema ad_org_id m_product_id m_attributesetinstance_id c_orderline_id m_costelement_id bigdecimal bigdecimal trxname m_costdetail deltaamt deltaqty c_orderline_id c_orderline_id m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx c_orderline_id m_attributesetinstance_id c_orderline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setc_orderline_id c_orderline_id setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log create new invoice cost detail for ap invoices called from doc invoice for invoice adjustments param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param c invoiceline id invoice param m costelement id optional cost element for freight param amt amt param qty qty param description optional description return true if created public static boolean create invoice m acct schema as int ad org id int m product id int m attributesetinstance id int c invoiceline id int m costelement id big decimal amt big decimal qty string description string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and c invoiceline id c invoiceline id and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx c invoiceline id and m attributesetinstance id c invoiceline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setc invoiceline id c invoiceline id else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_invoice ad_org_id m_product_id m_attributesetinstance_id c_invoiceline_id m_costelement_id createinvoice macctschema ad_org_id m_product_id m_attributesetinstance_id c_invoiceline_id m_costelement_id bigdecimal bigdecimal trxname m_costdetail deltaamt deltaqty c_invoiceline_id c_invoiceline_id m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx c_invoiceline_id m_attributesetinstance_id c_invoiceline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setc_invoiceline_id c_invoiceline_id setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log create new shipment cost detail for so shipments called from doc minout for so shipments param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param m inoutline id shipment param m costelement id optional cost element for freight param amt amt param qty qty param description optional description param isso trx sales order public static boolean create shipment m acct schema as int ad org id int m product id int m attributesetinstance id int m inoutline id int m costelement id big decimal amt big decimal qty string description boolean isso trx string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and m inoutline id m inoutline id and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx m inoutline id and m attributesetinstance id m inoutline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setm inoutline id m inoutline id cd set isso trx isso trx else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_minout ad_org_id m_product_id m_attributesetinstance_id m_inoutline_id m_costelement_id issotrx createshipment macctschema ad_org_id m_product_id m_attributesetinstance_id m_inoutline_id m_costelement_id bigdecimal bigdecimal issotrx trxname m_costdetail deltaamt deltaqty m_inoutline_id m_inoutline_id m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx m_inoutline_id m_attributesetinstance_id m_inoutline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setm_inoutline_id m_inoutline_id setissotrx issotrx setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log create new order cost detail for physical inventory called from doc inventory param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param m inventoryline id order param m costelement id optional cost element param amt amt total amount param qty qty param description optional description public static boolean create inventory m acct schema as int ad org id int m product id int m attributesetinstance id int m inventoryline id int m costelement id big decimal amt big decimal qty string description string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and m inventoryline id m inventoryline id and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx m inventoryline id and m attributesetinstance id m inventoryline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setm inventoryline id m inventoryline id else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_inventory ad_org_id m_product_id m_attributesetinstance_id m_inventoryline_id m_costelement_id createinventory macctschema ad_org_id m_product_id m_attributesetinstance_id m_inventoryline_id m_costelement_id bigdecimal bigdecimal trxname m_costdetail deltaamt deltaqty m_inventoryline_id m_inventoryline_id m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx m_inventoryline_id m_attributesetinstance_id m_inventoryline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setm_inventoryline_id m_inventoryline_id setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log create new order cost detail for movements called from doc movement param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param m movementline id movement param m costelement id optional cost element for freight param amt amt total amount param qty qty param from if true the from reduction param description optional description public static boolean create movement m acct schema as int ad org id int m product id int m attributesetinstance id int m movementline id int m costelement id big decimal amt big decimal qty boolean from string description string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and m movementline id m movementline id and isso trx from y n and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx m movementline id and m attributesetinstance id and isso trx from y n m movementline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setm movementline id m movementline id cd set isso trx from else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_movement ad_org_id m_product_id m_attributesetinstance_id m_movementline_id m_costelement_id createmovement macctschema ad_org_id m_product_id m_attributesetinstance_id m_movementline_id m_costelement_id bigdecimal bigdecimal trxname m_costdetail deltaamt deltaqty m_movementline_id m_movementline_id issotrx m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx m_movementline_id m_attributesetinstance_id issotrx m_movementline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setm_movementline_id m_movementline_id setissotrx setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log create new order cost detail for production called from doc production param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param m productionline id production line param m costelement id optional cost element param amt amt total amount param qty qty param description optional description public static boolean create production m acct schema as int ad org id int m product id int m attributesetinstance id int m productionline id int m costelement id big decimal amt big decimal qty string description string trx name delete unprocessed zero differences string sql delete m costdetail where processed n and coalesce delta amt 0 0 and coalesce delta qty 0 0 and m productionline id m productionline id and m attributesetinstance id m attributesetinstance id int no db execute update sql trx name if no 0 s log config deleted no m cost detail cd get as get ctx m productionline id and m attributesetinstance id m productionline id m attributesetinstance id trx name if cd null create new cd new m cost detail as ad org id m product id m attributesetinstance id m costelement id amt qty description trx name cd setm productionline id m productionline id else cd set delta amt cd get amt subtract amt cd set delta qty cd get qty subtract qty if cd is delta cd set processed false else return true nothing to do boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process s log config ok cd return ok doc_production ad_org_id m_product_id m_attributesetinstance_id m_productionline_id m_costelement_id createproduction macctschema ad_org_id m_product_id m_attributesetinstance_id m_productionline_id m_costelement_id bigdecimal bigdecimal trxname m_costdetail deltaamt deltaqty m_productionline_id m_productionline_id m_attributesetinstance_id m_attributesetinstance_id executeupdate trxname s_log mcostdetail getctx m_productionline_id m_attributesetinstance_id m_productionline_id m_attributesetinstance_id trxname createnew mcostdetail ad_org_id m_product_id m_attributesetinstance_id m_costelement_id trxname setm_productionline_id m_productionline_id setdeltaamt getamt setdeltaqty getqty isdelta setprocessed isprocessed mclient mclient getctx getad_client_id iscostimmediate s_log get cost detail param ctx context param where clause where clause param id 1st parameter param id2 2nd parameter param trx name trx return cost detail private static m cost detail get properties ctx string where clause int id int id2 string trx name string sql select from m costdetail where where clause m cost detail ret value null prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 id pstmt set int 2 id2 result set rs pstmt execute query if rs next ret value new m cost detail ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql id e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value whereclause trxname mcostdetail whereclause trxname m_costdetail whereclause mcostdetail retvalue preparedstatement preparestatement setint setint resultset executequery retvalue mcostdetail trxname s_log retvalue process cost details for product param product product param trx name public static boolean process product m product product string trx name string sql select from m costdetail where m product id and processed n order by c acctschema id m costelement id ad org id m attributesetinstance id created int counterok 0 int counter error 0 prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 product getm product id result set rs pstmt execute query while rs next m cost detail cd new m cost detail product get ctx rs trx name if cd process saves counterok else counter error rs close pstmt close pstmt null catch exception e s log log level severe sql e counter error try if pstmt null pstmt close pstmt null catch exception e pstmt null s log config ok counterok errors counter error return counter error 0 trxname processproduct mproduct trxname m_costdetail m_product_id c_acctschema_id m_costelement_id ad_org_id m_attributesetinstance_id countererror preparedstatement preparestatement trxname setint getm_product_id resultset executequery mcostdetail mcostdetail getctx trxname countererror s_log countererror s_log countererror countererror standard constructor param ctx context param m costdetail id id param trx name trx public m cost detail properties ctx int m costdetail id string trx name super ctx m costdetail id trx name if m costdetail id 0 setc acctschema id 0 setm product id 0 setm attributesetinstance id 0 setc orderline id 0 setm inoutline id 0 setc invoiceline id 0 set processed false set amt env zero set qty env zero set isso trx false set delta amt env zero set delta qty env zero m_costdetail_id trxname mcostdetail m_costdetail_id trxname m_costdetail_id trxname m_costdetail_id setc_acctschema_id setm_product_id setm_attributesetinstance_id setc_orderline_id setm_inoutline_id setc_invoiceline_id setprocessed setamt setqty setissotrx setdeltaamt setdeltaqty load constructor param ctx context param rs result set param trx name trx public m cost detail properties ctx result set rs string trx name super ctx rs trx name trxname mcostdetail resultset trxname trxname new constructor param as accounting schema param ad org id org param m product id product param m attributesetinstance id asi param m costelement id optional cost element for freight param amt amt param qty qty param description optional description public m cost detail m acct schema as int ad org id int m product id int m attributesetinstance id int m costelement id big decimal amt big decimal qty string description string trx name this as get ctx 0 trx name set client org as getad client id ad org id setc acctschema id as getc acctschema id setm product id m product id setm attributesetinstance id m attributesetinstance id setm costelement id m costelement id set amt amt set qty qty set description description ad_org_id m_product_id m_attributesetinstance_id m_costelement_id mcostdetail macctschema ad_org_id m_product_id m_attributesetinstance_id m_costelement_id bigdecimal bigdecimal trxname getctx trxname setclientorg getad_client_id ad_org_id setc_acctschema_id getc_acctschema_id setm_product_id m_product_id setm_attributesetinstance_id m_attributesetinstance_id setm_costelement_id m_costelement_id setamt setqty setdescription set amt param amt amt public void set amt big decimal amt if is processed throw new illegal state exception cannot change amt processed if amt null super set amt env zero else super set amt amt setamt bigdecimal isprocessed illegalstateexception setamt setamt set qty param qty qty public void set qty big decimal qty if is processed throw new illegal state exception cannot change qty processed if qty null super set qty env zero else super set qty qty setqty bigdecimal isprocessed illegalstateexception setqty setqty is order return true if order line public boolean is order return getc orderline id 0 isorder getc_orderline_id is invoice return true if invoice line public boolean is invoice return getc invoiceline id 0 isinvoice getc_invoiceline_id is shipment return true if sales order shipment public boolean is shipment return isso trx getm inoutline id 0 isshipment issotrx getm_inoutline_id is this a delta record previously processed return true if delta is not null public boolean is delta return get delta amt signum 0 get delta qty signum 0 isdelta getdeltaamt getdeltaqty after save param new record new param success success return true protected boolean after save boolean new record boolean success return true newrecord aftersave newrecord before delete return false if processed protected boolean before delete return is processed beforedelete isprocessed string representation return info public string to string string buffer sb new string buffer m cost detail sb append get id if getc orderline id 0 sb append c orderline id append getc orderline id if getm inoutline id 0 sb append m inoutline id append getm inoutline id if getc invoiceline id 0 sb append c invoiceline id append getc invoiceline id if getc projectissue id 0 sb append c projectissue id append getc projectissue id if getm movementline id 0 sb append m movementline id append getm movementline id if getm inventoryline id 0 sb append m inventoryline id append getm inventoryline id if getm productionline id 0 sb append m productionline id append getm productionline id sb append amt append get amt append qty append get qty if is delta sb append delta amt append get delta amt append delta qty append get delta qty sb append return sb to string tostring stringbuffer stringbuffer mcostdetail get_id getc_orderline_id c_orderline_id getc_orderline_id getm_inoutline_id m_inoutline_id getm_inoutline_id getc_invoiceline_id c_invoiceline_id getc_invoiceline_id getc_projectissue_id c_projectissue_id getc_projectissue_id getm_movementline_id m_movementline_id getm_movementline_id getm_inventoryline_id m_inventoryline_id getm_inventoryline_id getm_productionline_id m_productionline_id getm_productionline_id getamt getqty isdelta deltaamt getdeltaamt deltaqty getdeltaqty tostring process cost detail record the record is saved if processed return true if processed public synchronized boolean process if is processed log info already processed return true boolean ok false get costing level for product m acct schema as new m acct schema get ctx getc acctschema id null string costing level as get costing level m product product m product get get ctx getm product id m product category acct pca m product category acct get get ctx product getm product category id getc acctschema id null if pca get costing level null costing level pca get costing level org element int org id getad org id int m asi id getm attributesetinstance id if m acct schema costinglevel client equals costing level org id 0 m asi id 0 else if m acct schema costinglevel organization equals costing level m asi id 0 else if m acct schema costinglevel batchlot equals costing level org id 0 create material cost elements if getm costelement id 0 m cost element ces m cost element get costing methods this for int i 0 i ces length i m cost element ce ces i ok process as product ce org id m asi id if ok break material cost elements else m cost element ce m cost element get get ctx getm costelement id ok process as product ce org id m asi id save it if ok set delta amt null set delta qty null set processed true ok save log info ok to string return ok isprocessed macctschema macctschema getctx getc_acctschema_id costinglevel getcostinglevel mproduct mproduct getctx getm_product_id mproductcategoryacct mproductcategoryacct getctx getm_product_category_id getc_acctschema_id getcostinglevel costinglevel getcostinglevel org_id getad_org_id m_asi_id getm_attributesetinstance_id macctschema costinglevel_client costinglevel org_id m_asi_id macctschema costinglevel_organization costinglevel m_asi_id macctschema costinglevel_batchlot costinglevel org_id getm_costelement_id mcostelement mcostelement getcostingmethods mcostelement org_id m_asi_id mcostelement mcostelement getctx getm_costelement_id org_id m_asi_id setdeltaamt setdeltaqty setprocessed tostring process cost detail for cost record param as accounting schema param product product param ce cost element param org id org corrected for costing level param m asi id asi corrected for costing level return true if cost ok private boolean process m acct schema as m product product m cost element ce int org id int m asi id m cost cost m cost get product m asi id as org id ce getm costelement id if cost null cost new m cost product m asi id as org id ce getm costelement id big decimal qty get qty big decimal amt get amt int precision as get costing precision big decimal price amt if qty signum 0 price amt divide qty precision big decimal round half up all costing methods if ce is average invoice else if ce is averagepo else if ce is fifo else if ce is lifo else if ce is last invoice else if ce is lastpo price else if ce is standard costing else if ce is user defined else if ce is costing method purchase order detail record if getc orderline id 0 if ce is averagepo cost set weighted average amt qty log finer po averagepo cost else if ce is lastpo price if qty signum 0 cost set current cost price price else big decimal c costs cost get current cost price add amt cost set current cost price c costs cost add amt qty log finer po lastpo cost else if ce is user defined interface log finer po user def cost else if ce is costing method log finer po ce cost else log warning po ce cost ap invoice detail record else if getc invoiceline id 0 if ce is average invoice cost set weighted average amt qty log finer inv average inv cost else if ce is fifo ce is lifo real asi costing level org m cost queue cq m cost queue get product getm attributesetinstance id as org id ce getm costelement id get trxname cq set costs amt qty precision cq save get costs costing level org asi m cost queue c queue m cost queue get queue product m asi id as org id ce get trxname if c queue null c queue length 0 cost set current cost price c queue 0 get current cost price cost add amt qty log finer inv fi fo li fo cost else if ce is last invoice if qty signum 0 cost set current cost price price else big decimal c costs cost get current cost price add amt cost set current cost price c costs cost add amt qty log finer inv last inv cost else if ce is standard costing if cost get current cost price signum 0 cost set current cost price price seed initial price if cost get current cost price signum 0 cost get id 0 cost set current cost price m cost get seed costs product m asi id as org id ce get costing method getc orderline id cost add amt qty log finer inv standard cost else if ce is user defined interface cost add amt qty log finer inv user def cost else if ce is costing method cost adjustments big decimal c costs cost get current cost price add amt cost set current cost price c costs cost add amt qty log finer inv none cost else log warning inv ce cost qty adjustment detail record else if getm inoutline id 0 ar shipment detail record getm movementline id 0 getm inventoryline id 0 getm productionline id 0 getc projectissue id 0 boolean addition qty signum 0 if ce is average invoice if addition cost set weighted average amt qty else cost set current qty cost get current qty add qty log finer qty adjust average inv cost else if ce is averagepo if addition cost set weighted average amt qty else cost set current qty cost get current qty add qty log finer qty adjust averagepo cost else if ce is fifo ce is lifo if addition real asi costing level org m cost queue cq m cost queue get product getm attributesetinstance id as org id ce getm costelement id get trxname cq set costs amt qty precision cq save else adjust queue costing level org asi m cost queue adjust qty product m asi id as org id ce qty negate get trxname get costs costing level org asi m cost queue c queue m cost queue get queue product m asi id as org id ce get trxname if c queue null c queue length 0 cost set current cost price c queue 0 get current cost price cost set current qty cost get current qty add qty log finer qty adjust fi fo lifo cost else if ce is last invoice cost set current qty cost get current qty add qty log finer qty adjust last inv cost else if ce is lastpo price cost set current qty cost get current qty add qty log finer qty adjust lastpo cost else if ce is standard costing if addition cost add amt qty initial if cost get current cost price signum 0 cost get id 0 cost set current cost price price else cost set current qty cost get current qty add qty log finer qty adjust standard cost else if ce is user defined interface if addition cost add amt qty else cost set current qty cost get current qty add qty log finer qty adjust user def cost else if ce is costing method should not happen log finer qty adjust none cost else log warning qty adjust ce cost else unknown or no id log warning unknown type to string return false return cost save org_id m_asi_id macctschema mproduct mcostelement org_id m_asi_id mcost mcost m_asi_id org_id getm_costelement_id mcost m_asi_id org_id getm_costelement_id bigdecimal getqty bigdecimal getamt getcostingprecision bigdecimal bigdecimal round_half_up isaverageinvoice isaveragepo isfifo islifo islastinvoice islastpoprice isstandardcosting isuserdefined iscostingmethod getc_orderline_id isaveragepo setweightedaverage islastpoprice setcurrentcostprice bigdecimal ccosts getcurrentcostprice setcurrentcostprice ccosts isuserdefined userdef iscostingmethod getc_invoiceline_id isaverageinvoice setweightedaverage averageinv isfifo islifo mcostqueue mcostqueue getm_attributesetinstance_id org_id getm_costelement_id get_trxname setcosts mcostqueue cqueue mcostqueue getqueue m_asi_id org_id get_trxname cqueue cqueue setcurrentcostprice cqueue getcurrentcostprice fifo lifo islastinvoice setcurrentcostprice bigdecimal ccosts getcurrentcostprice setcurrentcostprice ccosts lastinv isstandardcosting getcurrentcostprice setcurrentcostprice getcurrentcostprice get_id setcurrentcostprice mcost getseedcosts m_asi_id org_id getcostingmethod getc_orderline_id isuserdefined userdef iscostingmethod bigdecimal ccosts getcurrentcostprice setcurrentcostprice ccosts getm_inoutline_id getm_movementline_id getm_inventoryline_id getm_productionline_id getc_projectissue_id isaverageinvoice setweightedaverage setcurrentqty getcurrentqty qtyadjust averageinv isaveragepo setweightedaverage setcurrentqty getcurrentqty qtyadjust isfifo islifo mcostqueue mcostqueue getm_attributesetinstance_id org_id getm_costelement_id get_trxname setcosts mcostqueue adjustqty m_asi_id org_id get_trxname mcostqueue cqueue mcostqueue getqueue m_asi_id org_id get_trxname cqueue cqueue setcurrentcostprice cqueue getcurrentcostprice setcurrentqty getcurrentqty qtyadjust fifo islastinvoice setcurrentqty getcurrentqty qtyadjust lastinv islastpoprice setcurrentqty getcurrentqty qtyadjust isstandardcosting getcurrentcostprice get_id setcurrentcostprice setcurrentqty getcurrentqty qtyadjust isuserdefined setcurrentqty getcurrentqty qtyadjust userdef iscostingmethod qtyadjust qtyadjust tostring initialize global variables param config config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w location init servletexception servletconfig servletexception webenv initweb servletexception wlocation process the http get request initial start needs to have parameters form name and column name param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log fine http session sess request get session w window status ws w window status get request if ws null web util create timeout page request response this null return get mandatory parameters string column name web util get parameter request column name log info column name column name ws to string m field m field ws cur tab get field column name log config column name column name m field m field if m field null column name null column name equals web util create error page request response this msg get msg ws ctx parameter missing return m location location null object value m field get value if value null value instanceof integer location new m location ws ctx integer value int value null else location new m location ws ctx 0 null string target base parent w window w window form name column name string action request get requesturi create document web doc doc web doc create popup m field get header doc add popup close boolean has dependents ws cur tab has dependants column name boolean has callout m field get callout length 0 reset button reset new button reset add element reset translate string script target base f value target base d value close popup if has dependents has callout script start update target base f reset set on click script doc get table add element new tr add element fill form ws action location target base has dependents has callout add element reset doc add popup close log trace log l6 database doc to string web util create response request response this null doc false formname columnname servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception httpsession getsession wwindowstatus wwindowstatus webutil createtimeoutpage columnname webutil getparameter columnname columnname columnname tostring mfield mfield curtab getfield columnname columnname columnname mfield mfield mfield columnname columnname webutil createerrorpage getmsg parametermissing mlocation mfield getvalue mlocation intvalue mlocation targetbase wwindow wwindow form_name columnname getrequesturi webdoc webdoc createpopup mfield getheader addpopupclose hasdependents curtab hasdependants columnname hascallout mfield getcallout addelement targetbase targetbase closepopup hasdependents hascallout startupdate targetbase setonclick gettable addelement addelement fillform targetbase hasdependents hascallout addelement addpopupclose l6_database tostring webutil createresponse process the http post request update address param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log fine http session sess request get session w window status ws w window status get request if ws null web util create timeout page request response this null return int c location id web util get parameter as int request p c location id string target base parent w window w window form name c location id create location m location location new m location ws ctx c location id null log fine do post updating c location id c location id target base location set address1 web util get parameter request p address1 location set address2 web util get parameter request p address2 location set city web util get parameter request p city location set postal web util get parameter request p postal location setc country id web util get parameter as int request p c country id location setc region id web util get parameter as int request p c region id document web doc doc web doc create popup w location doc add popup close save location location save c location id location getc location id td center doc add popup center false if c location id 0 center add element new p new b error location 0 center add element new p add element location to string update target script script new script new string buffer append target base append d value append c location id append append target base append f value append location to string append close popup to string doc get body add element script log fine script script to string web util create response request response this null doc false servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception httpsession getsession wwindowstatus wwindowstatus webutil createtimeoutpage c_location_id webutil getparameterasint p_c_location_id targetbase wwindow wwindow form_name c_location_id mlocation mlocation c_location_id dopost c_location_id c_location_id targetbase setaddress1 webutil getparameter p_address1 setaddress2 webutil getparameter p_address2 setcity webutil getparameter p_city setpostal webutil getparameter p_postal setc_country_id webutil getparameterasint p_c_country_id setc_region_id webutil getparameterasint p_c_region_id webdoc webdoc createpopup wlocation addpopupclose c_location_id getc_location_id addpopupcenter c_location_id addelement addelement addelement tostring stringbuffer targetbase c_location_id targetbase tostring closepopup tostring getbody addelement tostring webutil createresponse fill address form param ws window status param location location param target base target field string add field type param add start add start update return table with selection private form fill form w window status ws string action m location location string target base boolean add start form my form null my form new form action my form add element new input input type hidden p target target base my form add element new input input type hidden p c location id location getc location id table table new table table setid w location line 1 tr line new tr line add element new td msg get msg ws ctx address 1 set align align type right input my input null my input new input input type text p address1 location get address1 my input set maxlength 50 set size 50 line add element new td my input set align align type left set col span 5 table add element line line 2 line new tr line add element new td msg get msg ws ctx address 2 set align align type right my input new input input type text p address2 location get address2 my input set maxlength 50 set size 50 line add element new td my input set align align type left set col span 5 table add element line line 3 line new tr line add element new td msg get msg ws ctx city set align align type right 1 my input new input input type text p city location get city my input set maxlength 30 set size 30 line add element new td my input set align align type left 2 if location get country is has region line add element new td msg get msg ws ctx region set align align type right 3 line add element new td get region location ws set align align type left 4 line add element new td msg get msg ws ctx postal set align align type right 5 my input new input input type text p postal location get postal my input set maxlength 10 set size 6 line add element new td my input set align align type left 6 input new input input type text postal add m location postal add line add element new td input set align align type left table add element line line 4 line new tr line add element new td msg get msg ws ctx country set align align type right line add element new td this get country location ws set align align type left set col span 5 table add element line line 5 line new tr submit line add element new td nbsp input submit new input input type submit submit submit translate line add element new td submit set align align type right set col span 5 table add element line button button new button button add element gt string buffer script new string buffer script append target base append d value append np get key append append target base append f value append np get name append close popup if add start script append start update append target base append f button set on click script to string my form add element table return my form windowstatus targetbase addstart startupdate fillform wwindowstatus mlocation targetbase addstart myform myform myform addelement type_hidden p_target targetbase myform addelement type_hidden p_c_location_id getc_location_id wlocation addelement getmsg setalign aligntype myinput myinput type_text p_address1 getaddress1 myinput setmaxlength setsize addelement myinput setalign aligntype setcolspan addelement addelement getmsg setalign aligntype myinput type_text p_address2 getaddress2 myinput setmaxlength setsize addelement myinput setalign aligntype setcolspan addelement addelement getmsg setalign aligntype myinput type_text p_city getcity myinput setmaxlength setsize addelement myinput setalign aligntype getcountry ishasregion addelement getmsg setalign aligntype addelement getregion setalign aligntype addelement getmsg setalign aligntype myinput type_text p_postal getpostal myinput setmaxlength setsize addelement myinput setalign aligntype type_text postaladd mlocation postaladd addelement setalign aligntype addelement addelement getmsg setalign aligntype addelement getcountry setalign aligntype setcolspan addelement addelement type_submit addelement setalign aligntype setcolspan addelement addelement stringbuffer stringbuffer targetbase getkey targetbase getname closepopup addstart startupdate targetbase setonclick tostring myform addelement myform get country pick list param location location model param ws window status return select field with countries private select get country m location location w window status ws m country countries m country get countries location get ctx int comp location getc country id if comp 0 comp env get context as int ws ctx c country id option options new option countries length for int i 0 i countries length i options i new option string value of countries i getc country id options i add element util maskhtml countries i get name if comp countries i getc country id options i set selected true select select new select p c country id options return select getcountry mlocation wwindowstatus mcountry mcountry getcountries getctx getc_country_id getcontextasint c_country_id valueof getc_country_id addelement getname getc_country_id setselected p_c_country_id get region pick list param location localion model param ws window status return select field with region private select get region m location location w window status ws m region regions m region get regions location get ctx location getc country id int comp location getc region id if comp 0 comp env get context as int ws ctx c region id option options new option regions length for int i 0 i regions length i options i new option string value of regions i getc region id options i add element util maskhtml regions i get name if comp regions i getc region id options i set selected true select select new select p c region id options return select getregion mlocation wwindowstatus mregion mregion getregions getctx getc_country_id getc_region_id getcontextasint c_region_id valueof getc_region_id addelement getname getc_region_id setselected p_c_region_id standard constructor param ctx context param c paymentterm id id public m payment term properties ctx int c paymentterm id string trx name super ctx c paymentterm id trx name if c paymentterm id 0 set after delivery false set net days 0 set discount env zero set discount2 env zero set discount days 0 set discount days2 0 set grace days 0 set is due fixed false set is valid false c_paymentterm_id mpaymentterm c_paymentterm_id trxname c_paymentterm_id trxname c_paymentterm_id setafterdelivery setnetdays setdiscount setdiscount2 setdiscountdays setdiscountdays2 setgracedays setisduefixed setisvalid load constructor param ctx context param rs result set public m payment term properties ctx result set rs string trx name super ctx rs trx name mpaymentterm resultset trxname trxname get payment schedule param requery if true re query return array of schedule public m pay schedule get schedule boolean requery if m schedule null requery return m schedule string sql select from c payschedule where c paymentterm id order by net days array list m pay schedule list new array list m pay schedule prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc paymentterm id result set rs pstmt execute query while rs next m pay schedule ps new m pay schedule get ctx rs get trxname ps set parent this list add ps rs close pstmt close pstmt null catch exception e log log level severe get schedule e try if pstmt null pstmt close pstmt null catch exception e pstmt null m schedule new m pay schedule list size list to array m schedule return m schedule mpayschedule getschedule m_schedule m_schedule c_payschedule c_paymentterm_id netdays arraylist mpayschedule arraylist mpayschedule preparedstatement preparestatement get_trxname setint getc_paymentterm_id resultset executequery mpayschedule mpayschedule getctx get_trxname setparent getschedule m_schedule mpayschedule toarray m_schedule m_schedule validate payment term schedule return validation message ok or error public string validate get schedule true if m schedule length 0 set is valid true return ok if m schedule length 1 set is valid false return invalid count 1 c payschedule id add up big decimal total env zero for int i 0 i m schedule length i big decimal percent m schedule i get percentage if percent null total total add percent boolean valid total compare to hundred 0 set is valid valid for int i 0 i m schedule length i if m schedule i is valid valid m schedule i set is valid valid m schedule i save string msg ok if valid msg total total difference hundred subtract total return msg parse translation get ctx msg getschedule m_schedule setisvalid m_schedule setisvalid c_payschedule_id bigdecimal m_schedule bigdecimal m_schedule getpercentage compareto setisvalid m_schedule m_schedule isvalid m_schedule setisvalid m_schedule parsetranslation getctx apply payment term to invoice param c invoice id invoice return true if payment schedule is valid public boolean apply int c invoice id m invoice invoice new m invoice get ctx c invoice id get trxname if invoice null invoice get id 0 log log level severe apply not valid c invoice id c invoice id return false return apply invoice c_invoice_id c_invoice_id minvoice minvoice getctx c_invoice_id get_trxname get_id c_invoice_id c_invoice_id apply payment term to invoice param invoice invoice return true if payment schedule is valid public boolean apply m invoice invoice if invoice null invoice get id 0 log log level severe no valid invoice invoice return false if is valid return apply no schedule invoice get schedule true if m schedule length 1 return apply no schedule invoice else only if valid return apply schedule invoice minvoice get_id isvalid applynoschedule getschedule m_schedule applynoschedule applyschedule apply payment term without schedule to invoice param invoice invoice return false as no payment schedule private boolean apply no schedule m invoice invoice delete invoice pay schedule invoice getc invoice id invoice get trxname update invoice if invoice getc paymentterm id getc paymentterm id invoice setc paymentterm id getc paymentterm id if invoice is pay schedule valid invoice set is pay schedule valid false return false applynoschedule minvoice deleteinvoicepayschedule getc_invoice_id get_trxname updateinvoice getc_paymentterm_id getc_paymentterm_id setc_paymentterm_id getc_paymentterm_id ispayschedulevalid setispayschedulevalid apply payment term with schedule to invoice param invoice invoice return true if payment schedule is valid private boolean apply schedule m invoice invoice delete invoice pay schedule invoice getc invoice id invoice get trxname create schedule m invoice pay schedule ips null big decimal remainder invoice get grand total for int i 0 i m schedule length i ips new m invoice pay schedule invoice m schedule i ips save invoice get trxname log fine ips to string remainder remainder subtract ips get due amt for all schedules remainder update last if remainder compare to env zero 0 ips null ips set due amt ips get due amt add remainder ips save invoice get trxname log fine remainder remainder ips update invoice if invoice getc paymentterm id getc paymentterm id invoice setc paymentterm id getc paymentterm id return invoice validate pay schedule applyschedule minvoice deleteinvoicepayschedule getc_invoice_id get_trxname minvoicepayschedule bigdecimal getgrandtotal m_schedule minvoicepayschedule m_schedule get_trxname tostring getdueamt compareto setdueamt getdueamt get_trxname updateinvoice getc_paymentterm_id getc_paymentterm_id setc_paymentterm_id getc_paymentterm_id validatepayschedule delete existing invoice payment schedule param c invoice id id private void delete invoice pay schedule int c invoice id string trx name string sql delete c invoicepayschedule where c invoice id c invoice id int no db execute update sql trx name log fine c invoice id c invoice id no c_invoice_id deleteinvoicepayschedule c_invoice_id trxname c_invoicepayschedule c_invoice_id c_invoice_id executeupdate trxname c_invoice_id c_invoice_id string representation return info public string to string string buffer sb new string buffer m payment term sb append get id append append get name append valid append is valid append return sb to string tostring stringbuffer stringbuffer mpaymentterm get_id getname isvalid tostring before save param new record new return true protected boolean before save boolean new record if is due fixed int dd get fix month day if dd 1 dd 31 log save error error msg parse translation get ctx invalid fix month day return false dd get fix month cutoff if dd 1 dd 31 log save error error msg parse translation get ctx invalid fix month cutoff return false if new record is valid validate return true newrecord beforesave newrecord isduefixed getfixmonthday saveerror parsetranslation getctx fixmonthday getfixmonthcutoff saveerror parsetranslation getctx fixmonthcutoff newrecord isvalid get locations for b partner param ctx context param c bpartner id bp return array of locations public static mb partner location get forb partner properties ctx int c bpartner id array list mb partner location list new array list mb partner location string sql select from c bpartner location where c bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next list add new mb partner location ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get forb partner e try if pstmt null pstmt close pstmt null catch exception e pstmt null mb partner location ret value new mb partner location list size list to array ret value return ret value bpartner c_bpartner_id mbpartnerlocation getforbpartner c_bpartner_id arraylist mbpartnerlocation arraylist mbpartnerlocation c_bpartner_location c_bpartner_id preparedstatement preparestatement setint c_bpartner_id resultset executequery mbpartnerlocation s_log getforbpartner mbpartnerlocation retvalue mbpartnerlocation toarray retvalue retvalue default constructor param ctx context param c bpartner location id id public mb partner location properties ctx int c bpartner location id string trx name super ctx c bpartner location id trx name if c bpartner location id 0 set name set is ship to true set is remit to true set is pay from true set is bill to true c_bpartner_location_id mbpartnerlocation c_bpartner_location_id trxname c_bpartner_location_id trxname c_bpartner_location_id setname setisshipto setisremitto setispayfrom setisbillto bp parent constructor param bp partner public mb partner location mb partner bp this bp get ctx 0 bp get trxname set client org bp may still be 0 set valuenocheck c bpartner id new integer bp getc bpartner id mbpartnerlocation mbpartner getctx get_trxname setclientorg set_valuenocheck c_bpartner_id getc_bpartner_id constructor from result set row param ctx context param rs current row of result set to be loaded public mb partner location properties ctx result set rs string trx name super ctx rs trx name resultset mbpartnerlocation resultset trxname trxname get loaction address param requery requery return location public m location get location boolean requery if m location null m location m location get get ctx getc location id get trxname return m location mlocation getlocation m_location m_location mlocation getctx getc_location_id get_trxname m_location string representation return info public string to string string buffer sb new string buffer mbpartner location id append get id append c location id append getc location id append name append get name append return sb to string tostring stringbuffer stringbuffer mbpartner_location get_id c_location_id getc_location_id getname tostring before save set name param new record new return save protected boolean before save boolean new record if getc location id 0 return false set new name if new record return true m location address get location true m uniquename get name if m uniquename null m uniquename equals default m uniquename null m unique 0 make unique address check uniqueness mb partner location locations mb partner location get forb partner get ctx getc bpartner id boolean unique locations length 0 while unique unique true for int i 0 i locations length i mb partner location location locations i if location getc bpartner location id get id continue if m uniquename equals location get name make unique address unique false break set name m uniquename return true newrecord beforesave newrecord getc_location_id newrecord mlocation getlocation m_uniquename getname m_uniquename m_uniquename m_uniquename m_unique makeunique mbpartnerlocation mbpartnerlocation getforbpartner getctx getc_bpartner_id mbpartnerlocation getc_bpartner_location_id get_id m_uniquename getname makeunique setname m_uniquename make name unique private void make unique m location address m uniquename address to string return if m uniquename null m uniquename m unique 0 city if m uniquename length 0 string xx address get city if xx null xx length 0 m uniquename xx m unique 0 1 address1 if m unique 1 m uniquename length 0 string xx address get address1 if xx null xx length 0 if m uniquename length 0 m uniquename m uniquename xx m unique 1 2 address2 if m unique 2 m uniquename length 0 string xx address get address2 if xx null xx length 0 if m uniquename length 0 m uniquename m uniquename xx m unique 2 3 region if m unique 3 m uniquename length 0 string xx address get region name true if m uniquename length 0 m uniquename m uniquename xx m unique 3 4 id if m unique 4 m uniquename length 0 int id get id if id 0 id address get id m uniquename id m unique 4 makeunique mlocation m_uniquename tostring m_uniquename m_uniquename m_unique m_uniquename getcity m_uniquename m_unique m_unique m_uniquename getaddress1 m_uniquename m_uniquename m_uniquename m_unique m_unique m_uniquename getaddress2 m_uniquename m_uniquename m_uniquename m_unique m_unique m_uniquename getregionname m_uniquename m_uniquename m_uniquename m_unique m_unique m_uniquename get_id get_id m_uniquename m_unique get from cache param ctx context param m product category id id return category public static m product category get properties ctx int m product category id integer ii new integer m product category id m product category pc m product category s cache get ii if pc null pc new m product category ctx m product category id null return pc m_product_category_id mproductcategory m_product_category_id m_product_category_id mproductcategory mproductcategory s_cache mproductcategory m_product_category_id is product in category param m product category id category param m product id product return true if product has category public static boolean is category int m product category id int m product id if m product id 0 m product category id 0 return false look up integer product new integer m product id integer category integer s products get product if category null return category int value m product category id string sql select m product category id from m product where m product id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m product id result set rs pstmt execute query if rs next category new integer rs get int 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if category null todo lru logic s products put product category s log fine m product id m product id category in m product category id m product category id category int value m product category id return category int value m product category id s log log level severe not found m product id m product id return false m_product_category_id m_product_id iscategory m_product_category_id m_product_id m_product_id m_product_category_id m_product_id s_products intvalue m_product_category_id m_product_category_id m_product m_product_id preparedstatement preparestatement setint m_product_id resultset executequery getint s_log s_products s_log m_product_id m_product_id m_product_category_id m_product_category_id intvalue m_product_category_id intvalue m_product_category_id s_log m_product_id m_product_id default constructor param ctx context param m product category id id public m product category properties ctx int m product category id string trx name super ctx m product category id trx name if m product category id 0 set name null set value null setmm policy mmpolicy fifo f set planned margin env zero set is default false set is self service true y m_product_category_id mproductcategory m_product_category_id trxname m_product_category_id trxname m_product_category_id setname setvalue setmmpolicy mmpolicy_fifo setplannedmargin setisdefault setisselfservice load constructor param ctx context param rs result set public m product category properties ctx result set rs string trx name super ctx rs trx name mproductcategory resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting m product category acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting m_product_category_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting m product category acct beforedelete delete_accounting m_product_category_acct fi fo material movement policy return true if fi fo public boolean is fi fo return mmpolicy fifo equals getmm policy fifo fifo isfifo mmpolicy_fifo getmmpolicy default constructor with spacing of 2 and columns filled public a layout this 2 4 true alayout detail contructor param spaceh horizontal space top between rows button param spacev vertical space left between columns right param col fill fields are fully filled rather then preferred size public a layout int spaceh int spacev boolean col fill set spaceh spaceh set spacev spacev m colfill col fill colfill alayout colfill setspaceh setspacev m_colfill colfill add to layout with null constraint param name the string to be associated with the component ignored param comp the component to be added public void add layout component string name component comp add layout component comp null addlayoutcomponent addlayoutcomponent adds the specified component to the layout using the specified constraint object if the constraint is not a a layout constraint the component is added with a null constraint p components with a null constraint are added as the next column to the last row param component the component to be added param constraint where how the component is added to the layout see a layout constraint public void add layout component component component object constraint a layout constraint con null if constraint instanceof a layout constraint con a layout constraint constraint m data put con component alayoutconstraint alayoutconstraint addlayoutcomponent alayoutconstraint alayoutconstraint alayoutconstraint m_data removes the specified component from the layout param comp the component to be removed public void remove layout component component comp if m data contains value comp return iterator it m data key set iterator while it has next object key it next if m data get key equals comp m data remove key return removelayoutcomponent m_data containsvalue m_data keyset hasnext m_data m_data calculates the preferred size dimensions for the specified container given the components it contains param parent the container to be laid out return size see minimum layout size public dimension preferred layout size container parent return calculate layout size parent p minimumlayoutsize preferredlayoutsize calculatelayoutsize calculates the minimum size dimensions for the specified container given the components it contains param parent the component to be laid out return size see preferred layout size public dimension minimum layout size container parent return calculate layout size parent m preferredlayoutsize minimumlayoutsize calculatelayoutsize calculates the maximum size dimensions for the specified container given the components it contains param parent parent container return size see java awt component get maximum size see layout manager public dimension maximum layout size container parent return calculate layout size parent m getmaximumsize layoutmanager maximumlayoutsize calculatelayoutsize calculate layout size param parent parent container param how p preferred m maximum m mimimum return size private dimension calculate layout size container parent char how check components parent create 2d dimension array int rows get row count int cols get col count dimension dim new dimension rows cols object keys m data key set to array arrays sort keys for int i 0 i keys length i a layout constraint constraint a layout constraint keys i component component component m data get keys i dimension d null if how p d component get preferred size else if how m d component get maximum size else d component get minimum size if component is visible dim constraint get row constraint get col d else dim constraint get row constraint get col null calculate 2d dimension size insets insets parent get insets dimension ret value new dimension insets left insets right insets top insets bottom ret value height m spaceh ret value width m spacev int max width 0 for int r 0 r rows r int height 0 int width 0 for int c 0 c cols c dimension d dim r c if d null width d width height math max height d height width m spacev for all columns ret value height height m spaceh max width math max max width width for all rows ret value width max width log trace this log l6 database a layout calculate layout size ret value to string return ret value calculatelayoutsize checkcomponents getrowcount getcolcount m_data keyset toarray alayoutconstraint alayoutconstraint m_data getpreferredsize getmaximumsize getminimumsize isvisible getrow getcol getrow getcol getinsets retvalue retvalue m_spaceh retvalue m_spacev maxwidth m_spacev retvalue m_spaceh maxwidth maxwidth retvalue maxwidth l6_database alayout calculatelayoutsize retvalue tostring retvalue lays out the specified container param parent the container to be laid out public void layout container container parent check components parent create 2d component array int rows get row count int cols get col count component com new component rows cols object keys m data key set to array arrays sort keys for int i 0 i keys length i a layout constraint constraint a layout constraint keys i component component component m data get keys i if component is visible com constraint get row constraint get col component else com constraint get row constraint get col null calculate column size int col width new int cols int row height new int rows int column width m spacev for int c 0 c cols c int width 0 for int r 0 r rows r component component com r c if component null width math max width component get preferred size width row height r math max row height r component get preferred size height col width c width column width width m spacev stretch squeeze columns to fit target width int parent width parent get size width double multiplier double parent width double column width if multiplier 5 limit sqeezing multiplier 5 for int c 0 c cols c col width c int col width c multiplier int spacev int m spacev multiplier log fine a layout layout container parent width parent width column width column width spacev spacev multiplier multiplier lay out components insets insets parent get insets int posh insets top m spaceh for int r 0 r rows r int posv insets left spacev int height 0 for int c 0 c cols c component component com r c if component null dimension ps component get preferred size int w ps width if m colfill w col width c limit or stretch w col width c int h ps height int top space 0 if h row height r push a little bit lower top space row height r h 3 height math max height h component set bounds posv posh top space w h log fine a layout layout container row r col c posv posv posh posh top space width w height h posv col width c spacev for all columns posh height m spaceh for all rows layoutcontainer checkcomponents getrowcount getcolcount m_data keyset toarray alayoutconstraint alayoutconstraint m_data isvisible getrow getcol getrow getcol colwidth rowheight columnwidth m_spacev getpreferredsize rowheight rowheight getpreferredsize colwidth columnwidth m_spacev parentwidth getsize parentwidth columnwidth colwidth colwidth m_spacev alayout layoutcontainer parentwidth parentwidth columnwidth columnwidth getinsets m_spaceh getpreferredsize m_colfill colwidth colwidth topspace rowheight topspace rowheight setbounds topspace alayout layoutcontainer topspace colwidth m_spaceh returns the alignment along the x axis this specifies how the component would like to be aligned relative to other components the value should be a number between 0 and 1 where 0 represents alignment along the origin 1 is aligned the furthest away from the origin 0 5 is centered etc param target target return 0f public float get layout alignmentx container target return 0f getlayoutalignmentx returns the alignment along the y axis this specifies how the component would like to be aligned relative to other components the value should be a number between 0 and 1 where 0 represents alignment along the origin 1 is aligned the furthest away from the origin 0 5 is centered etc param target target return 0f public float get layout alignmenty container target return 0f getlayoutalignmenty invalidates the layout indicating that if the layout manager has cached information it should be discarded param target target public void invalidate layout container target invalidatelayout check target components and add components which don t have no constraints param target target private void check components container target int size target get component count for int i 0 i size i component comp target get component i if m data contains value comp m data put null comp checkcomponents getcomponentcount getcomponent m_data containsvalue m_data get number of rows return no pf rows public int get row count return m data get max row 1 getrowcount m_data getmaxrow get number of columns return no of cols public int get col count return m data get max col 1 getcolcount m_data getmaxcol set horizontal space top between rows button param spaceh horizontal space top between rows button public void set spaceh int spaceh m spaceh spaceh setspaceh m_spaceh get horizontal space top between rows button return spaceh horizontal space top between rows button public int get spaceh return m spaceh getspaceh m_spaceh set vertical space left between columns right param spacev vertical space left between columns right public void set spacev int spacev m spacev spacev setspacev m_spacev get vertical space left between columns right return spacev vertical space left between columns right public int get spacev return m spacev getspacev m_spacev initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception registration servlet init servletexception servletconfig servletexception webenv initweb servletexception registrationservlet get servlet information return info public string get servlet info return a dempiere web registration servlet getservletinfo adempiere clean up resources public void destroy log fine process the http get request if not system registration forward to registration jsp param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr if process system registration request response log info forward to registration jsp response send redirect registration jsp servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr processsystemregistration sendredirect process system registration param request request param response response return true if system registration private boolean process system registration http servlet request request http servlet response response throws servlet exception io exception system info string name web util get parameter request name string user name web util get parameter request user name string password web util get parameter request password not a system registration if name null name length 0 user name null user name length 0 password null password length 0 return false log info name name user user name registration info string description web util get parameter request description boolean in production web util get parameter as boolean request is in production y timestamp start date web util get parameter as date request start production date if start date null start date new timestamp system current time millis boolean allow publish web util get parameter as boolean request is allow publish y boolean registered web util get parameter as boolean request is registered y int record id web util get parameter as int request record id find user properties ctx jsp env get ctx request m user user null int ad user id db getsql value null select ad user id from ad user where e mail user name if ad user id 0 user m user get ctx ad user id else log warning user not found user name registration m registration reg null if record id 0 reg new m registration ctx record id null if reg get id record id log warning registration not found record id reg null else if user null if reg getc bpartner id user getc bpartner id log warning registration for different bp ad user id ad user id user gete mail bp registrationbp reg getc bpartner id userbp user getc bpartner id reg null if password equals user get password log warning password does not match ad user id ad user id user gete mail if reg null log fine new registration reg new m registration ctx name allow publish in production start date null record id 0 common update reg set description description reg setremote addr request get remote addr reg setremote host request get remote host user if user null reg setad user id user getad user id reg setc bpartner id user getc bpartner id if reg save if record id 0 reg load attribute values request new else reg update attribute values request existing send answer response thanks record id reg geta registration id else log log level severe registration not saved send answer response problem record id 0 return true processsystemregistration httpservletrequest httpservletresponse servletexception ioexception webutil getparameter username webutil getparameter username webutil getparameter username username username webutil getparameter inproduction webutil getparameterasboolean isinproduction startdate webutil getparameterasdate startproductiondate startdate startdate currenttimemillis allowpublish webutil getparameterasboolean isallowpublish webutil getparameterasboolean isregistered record_id webutil getparameterasint record_id jspenv getctx muser ad_user_id getsqlvalue ad_user_id ad_user email username ad_user_id muser ad_user_id username mregistration record_id mregistration record_id get_id record_id record_id getc_bpartner_id getc_bpartner_id ad_user_id ad_user_id getemail getc_bpartner_id getc_bpartner_id getpassword ad_user_id ad_user_id getemail mregistration allowpublish inproduction startdate record_id setdescription setremote_addr getremoteaddr setremote_host getremotehost setad_user_id getad_user_id setc_bpartner_id getc_bpartner_id record_id loadattributevalues updateattributevalues sendanswer record_id geta_registration_id sendanswer record_id send answer param response response param answer answer throws io exception private void send answer http servlet response response string answer throws io exception response set header cache control no cache response set content type text html charset utf 8 print writer out response get writer with character encoding support out print answer out flush ioexception sendanswer httpservletresponse ioexception setheader setcontenttype printwriter getwriter process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to registration jsp entry return int a registration id web util get parameter as int request p registration id m registration reg null if a registration id 0 reg new m registration ctx a registration id null if reg null reg new m registration ctx 0 null a registration id 0 string name web util get parameter request name if name null name length 0 web util create forward page response name is mandatory registrations jsp 4 return reg set name name string description web util get parameter request description if description null description length 0 reg set description description boolean is in production web util get parameter as boolean request is in production reg set is in production is in production timestamp asset service date web util get parameter as date request asset service date if asset service date null asset service date new timestamp system current time millis reg set asset service date asset service date boolean is allow publish web util get parameter as boolean request is allow publish reg set is allow publish is allow publish if reg save if a registration id 0 reg load attribute values request new else reg update attribute values request existing web util create forward page response thanks registrations jsp 3 else log log level severe registration not saved web util create forward page response problem registrations jsp 3 servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser sendredirect loginservlet forwardto a_registration_id webutil getparameterasint p_registration_id mregistration a_registration_id mregistration a_registration_id mregistration a_registration_id webutil getparameter webutil createforwardpage setname webutil getparameter setdescription isinproduction webutil getparameterasboolean isinproduction setisinproduction isinproduction assetservicedate webutil getparameterasdate assetservicedate assetservicedate assetservicedate currenttimemillis setassetservicedate assetservicedate isallowpublish webutil getparameterasboolean isallowpublish setisallowpublish isallowpublish a_registration_id loadattributevalues updateattributevalues webutil createforwardpage webutil createforwardpage public pp optimal super pp optimal pp_optimal pp_optimal get version return version public string get version return optimal client version getversion _client_version process cc return true if ok throws illegal argument exception public boolean processcc throws illegal argument exception log fine p mpp get host address p mpp get host port timeout get timeout proxy p mpp get proxy address p mpp get proxy port p mpp get proxy logon p mpp get proxy password set encoded true string url string p mpp get host address https realtime firepay com servlet dp servlet https realtime test firepay com servlet dp servlet if p mpp get host port 0 url string p mpp get host port general parameters string buffer param new string buffer 200 merchant username and password param append create pair merchant id p mpp get userid 80 append amp append create pair merchant pwd p mpp get password 20 append amp append create pair account id p mpp get partnerid 10 param append amp append create pair merchant data comment 255 cipher supported ssl rsa with rc4 128 md5 ssl rsa with rc4 128 sha ssl rsa with des cbc sha ssl rsa with 3des ede cbc sha ssl rsa export with rc4 40 md5 param append cipher ssl rsa with rc4 128 md5 http version param append http version 1 0 path to the keystore cacerts file param append amp append create pair card type vi 6 param append amp append create pair card number p mp get credit card number 19 param append amp append create pair card expiration p mp get credit card exp 5 param append amp append create pair amount p mp get pay amt in cents 10 param append amp append create pair operation operation purchase 1 param append amp append create pair merchant txn p mp getc payment id 255 param append amp append create pair client version client version 4 param append amp append create pair cust name1 p mp geta name 255 param append amp append create pair street p mp geta street 255 param append amp append create pair city p mp geta city 255 param append amp append create pair province p mp geta state 2 param append amp append create pair zip p mp geta zip 10 param append amp append create pair country p mp geta country 2 param append amp append create pair phone p mp geta phone 40 param append amp append create pair email p mp geta email 40 param append amp append create pair cvd indicator cvd indicator provided 1 param append amp append create pair cvd value 123 4 try log fine param to string properties prop get connect post properties url string param to string m ok prop null auth code auth time 1132330817 sub error string card has expired 04 04 err code 91 client version 1 1 status e sub error 0 action code cp err string invalid payment information please verify request parameters auth code 197705 auth time 1132336527 cur amount 0 avs info b client version 1 1 status sp amount 200 cvd info m txn number 1000000 if m ok string status prop get property status m ok status null status equals sp successful purchase string auth code prop get property auth code string auth time prop get property auth time string err code prop get property error code string err string prop get property error string string sub error prop get property sub error string sub error string prop get property sub error string string action code prop get property action code string authorised amount prop get property current amount string amount prop get property amount string avs info prop get property avs info string cvd info prop get property cvd info log fine status status auth code auth code error err string if m ok log warning prop catch exception e log log level severe param to string e m ok false return m ok illegalargumentexception illegalargumentexception p_mpp gethostaddress p_mpp gethostport gettimeout p_mpp getproxyaddress p_mpp getproxyport p_mpp getproxylogon p_mpp getproxypassword setencoded urlstring p_mpp gethostaddress dpservlet dpservlet p_mpp gethostport urlstring p_mpp gethostport stringbuffer stringbuffer createpair merchant_id p_mpp getuserid createpair merchant_pwd p_mpp getpassword createpair account_id p_mpp getpartnerid createpair merchant_data ssl_rsa_with_rc4_128_md5 ssl_rsa_with_rc4_128_sha ssl_rsa_with_des_cbc_sha ssl_rsa_with_3des_ede_cbc_sha ssl_rsa_export_with_rc4_40_md5 ssl_rsa_with_rc4_128_md5 httpversion createpair card_type createpair card_number p_mp getcreditcardnumber createpair card_expiration p_mp getcreditcardexp createpair p_mp getpayamtincents createpair operation_purchase createpair merchant_txn p_mp getc_payment_id createpair client_version _client_version createpair cust_name1 p_mp geta_name createpair p_mp geta_street createpair p_mp geta_city createpair p_mp geta_state createpair p_mp geta_zip createpair p_mp geta_country createpair p_mp geta_phone createpair p_mp geta_email createpair cvd_indicator cvd_indicator_provided createpair cvd_value tostring getconnectpostproperties urlstring tostring m_ok authcode authtime suberrorstring errcode clientversion suberror actioncode errstring authcode authtime curamount avsinfo clientversion cvdinfo txnnumber m_ok getproperty m_ok authcode getproperty auth_code authtime getproperty auth_time errcode getproperty error_code errstring getproperty error_string suberror getproperty sub_error suberrorstring getproperty sub_error_string actioncode getproperty actioncode authorisedamount getproperty current_amount getproperty avsinfo getproperty avs_info cvdinfo getproperty cvd_info authcode authcode errstring m_ok tostring m_ok m_ok is processed ok return true of ok public boolean is processedok return m ok isprocessedok m_ok test param args ifnored public static void main string args test administration server and login the information you require to access the test administration server is case sensitivity matters web site https admin test firepay com test account 2 username sparctwo001 user password abcd1234 test payment server url to connect your web site to our test payment service your technical people will use the following url https realtime test firepay com servlet dp servlet test cards below are the cards you can use in the test environment transactions done with these cards will either be successful or fail depending on the amount provided with the transaction see below visa 4387751111011 4387751111029 4387751111111038 4387751111111053 master card 5442981111111015 5442981111111023 5442981111111031 5442981111111056 the following amounts will cause either approval or various declines with the cards mentioned above amount less than 20 00 approval 20 00 to 29 99 221 1002 reenter 30 00 to 39 99 221 1003 referral 40 00 to 49 99 221 1004 pick up 50 00 to 59 99 34 1005 decline 60 00 to 69 99 2 timeout amount greater than 69 99 approval c log mgt initialize true c log mgt set level level all pp optimal pp new pp optimal pp processcc pp is processedok dpservlet mastercard pickup clogmgt clogmgt setlevel pp_optimal pp_optimal isprocessedok get active users of b partner param ctx context param c bpartner id id return array of users public static m user get ofb partner properties ctx int c bpartner id array list m user list new array list m user string sql select from ad user where c bpartner id and is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next list add new m user ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m user ret value new m user list size list to array ret value return ret value bpartner c_bpartner_id muser getofbpartner c_bpartner_id arraylist muser arraylist muser ad_user c_bpartner_id isactive preparedstatement preparestatement setint c_bpartner_id resultset executequery muser s_log muser retvalue muser toarray retvalue retvalue get users with role param role role return array of users public static m user get with role m role role array list m user list new array list m user string sql select from ad user u where u is active y and exists select from ad user roles ur where ur ad user id u ad user id and ur ad role id and ur is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 role getad role id result set rs pstmt execute query while rs next list add new m user role get ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m user ret value new m user list size list to array ret value return ret value muser getwithrole mrole arraylist muser arraylist muser ad_user isactive ad_user_roles ad_user_id ad_user_id ad_role_id isactive preparedstatement preparestatement setint getad_role_id resultset executequery muser getctx s_log muser retvalue muser toarray retvalue retvalue get user cached also loads admninistrator 0 param ctx context param ad user id id return user public static m user get properties ctx int ad user id integer key new integer ad user id m user ret value m user s cache get key if ret value null ret value new m user ctx ad user id null if ad user id 0 string trx name null ret value load trx name load system record s cache put key ret value return ret value ad_user_id muser ad_user_id ad_user_id muser retvalue muser s_cache retvalue retvalue muser ad_user_id ad_user_id trxname retvalue trxname s_cache retvalue retvalue get current user cached param ctx context return user public static m user get properties ctx return get ctx env getad user id ctx muser getad_user_id get user param ctx context param name name param password password return user or null public static m user get properties ctx string name string password if name null name length 0 password null password length 0 s log warning invalid name password name password return null int ad client id env getad client id ctx m user ret value null string sql select from ad user where name and password and is active y and ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 name pstmt set string 2 password pstmt set int 3 ad client id result set rs pstmt execute query if rs next ret value new m user ctx rs null if rs next s log warning more then one user with name password name else s log fine no record rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value muser s_log ad_client_id getad_client_id muser retvalue ad_user isactive ad_client_id preparedstatement preparestatement setstring setstring setint ad_client_id resultset executequery retvalue muser s_log s_log s_log retvalue get name of ad user param ad user id system user return name of user or public static string get name of user int ad user id string name get id string sql select name from ad user where ad user id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad user id result set rs pstmt execute query if rs next name rs get string 1 rs close pstmt close catch sql exception e s log log level severe sql e return name ad_user ad_user_id getnameofuser ad_user_id ad_user ad_user_id preparedstatement preparestatement setint ad_user_id resultset executequery getstring sqlexception s_log user is sales rep param ad user id user return true if sales rep public static boolean is sales rep int ad user id if ad user id 0 return false string sql select max ad user id from ad user u inner join c bpartner bp on u c bpartner id bp c bpartner id where bp is sales rep y and ad user id int no db getsql value null sql ad user id return no ad user id salesrep ad_user_id issalesrep ad_user_id ad_user_id ad_user_id ad_user c_bpartner c_bpartner_id c_bpartner_id issalesrep ad_user_id getsqlvalue ad_user_id ad_user_id default constructor param ctx context param ad user id id public m user properties ctx int ad user id string trx name super ctx ad user id trx name 0 is also system if ad user id 0 set is fullbp access true set notification type notificationtype email ad_user_id muser ad_user_id trxname ad_user_id trxname ad_user_id setisfullbpaccess setnotificationtype notificationtype_email parent constructor param partner partner public m user x c bpartner partner this partner get ctx 0 partner get trxname set client org partner setc bpartner id partner getc bpartner id set name partner get name muser x_c_bpartner getctx get_trxname setclientorg setc_bpartner_id getc_bpartner_id setname getname load constructor param ctx context param rs current row of result set to be loaded public m user properties ctx result set rs string trx name super ctx rs trx name muser resultset trxname trxname add to description param description description to be added public void add description string description if description null description length 0 return string descr get description if descr null descr length 0 set description description else set description descr description adddescription getdescription setdescription setdescription string representation return info public string to string string buffer sb new string buffer m user append get id append name append get name append e mail userid append gete mail user append return sb to string tostring stringbuffer stringbuffer muser get_id getname emailuserid getemailuser tostring is it an online access user return true if it has an email and password public boolean is online if gete mail null get password null return false return true isonline getemail getpassword convert e mail return valid internet address public internet address get internet address string email gete mail if email null email length 0 return null try internet address ia new internet address email true if ia null ia validate throws address exception return ia catch address exception ex log warning email ex get localized message return null email internetaddress getinternetaddress getemail internetaddress internetaddress addressexception addressexception getlocalizedmessage validate email does not work check dns mx record param ia email return error message or private string validate email internet address ia if ia null return no email if true return null hashtable string string env new hashtable string string env put context initial context factory com sun jndi dns dns context factory env put context provider url dns admin adempiere org try dir context ctx new initial dir context env attributes atts ctx get attributes admin attributes atts ctx get attributes dns admin adempiere org new string mx naming enumeration en atts get all naming enumeration en ctx list adempiere org while en has more system out println en next catch exception e e print stack trace return e get localized message return null validateemail internetaddress noemail initial_context_factory dnscontextfactory provider_url dircontext initialdircontext getattributes getattributes namingenumeration getall namingenumeration hasmore printstacktrace getlocalizedmessage is the email valid return return true if email is valid artificial check public boolean ise mail valid return validate email get internet address null isemailvalid validateemail getinternetaddress could we send an email return true if e mail uwer pw exists public boolean is can sende mail string s gete mail user if s null s length 0 return false s gete mail userpw return s null s length 0 email iscansendemail getemailuser getemailuserpw get e mail validation code return code public string gete mail verify code long code getad user id get name hash code return c string value of math abs code c email getemailverifycode getad_user_id getname hashcode valueof check set e mail validation code param code code param info info return true if valid public boolean sete mail verify code string code string info boolean ok code null code equals gete mail verify code if ok sete mail verify date new timestamp system current time millis else sete mail verify date null sete mail verify info return ok email setemailverifycode getemailverifycode setemailverifydate currenttimemillis setemailverifydate setemailverify is e mail verified by response return true if verified public boolean ise mail verified update ad user set e mail verify date sys date e mail verify direct where ad user id 1 return gete mail verify date null gete mail verify null gete mail verify length 0 email isemailverified ad_user emailverifydate sysdate emailverify ad_user_id getemailverifydate getemailverify getemailverify get notification via e mail return true if email public boolean is notificatione mail string s get notification type return s null notificationtype email equals s email isnotificationemail getnotificationtype notificationtype_email get notification via note return true if note public boolean is notification note string s get notification type return s null notificationtype notice equals s isnotificationnote getnotificationtype notificationtype_notice get user roles for org param ad org id org return array of roles public m role get roles int ad org id if m roles null m rolesad org id ad org id return m roles array list m role list new array list m role string sql select from ad role r where r is active y and exists select from ad role orgaccess ro where r ad role id ro ad role id and ro is active y and ro ad org id and exists select from ad user roles ur where r ad role id ur ad role id and ur is active y and ur ad user id order by ad role id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 ad org id pstmt set int 2 getad user id result set rs pstmt execute query while rs next list add new m role get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rolesad org id ad org id m roles new m role list size list to array m roles return m roles ad_org_id mrole getroles ad_org_id m_roles m_rolesad_org_id ad_org_id m_roles arraylist mrole arraylist mrole ad_role isactive ad_role_orgaccess ad_role_id ad_role_id isactive ad_org_id ad_user_roles ad_role_id ad_role_id isactive ad_user_id ad_role_id preparedstatement preparestatement get_trxname setint ad_org_id setint getad_user_id resultset executequery mrole getctx get_trxname m_rolesad_org_id ad_org_id m_roles mrole toarray m_roles m_roles is user an administrator return true id admin public boolean is administrator if m isadministrator null m isadministrator boolean false m role roles get roles 0 for int i 0 i roles length i if roles i getad role id 0 m isadministrator boolean true break return m isadministrator boolean value isadministrator m_isadministrator m_isadministrator mrole getroles getad_role_id m_isadministrator m_isadministrator booleanvalue has the user access to bp info and resources param bp access type access type param params opt parameter return true if access public boolean hasbp access string bp access type object params if is fullbp access return true getbp access false for int i 0 i m bpaccess length i if m bpaccess i getbp access type equals bp access type return true return false bpaccesstype hasbpaccess bpaccesstype isfullbpaccess getbpaccess m_bpaccess m_bpaccess getbpaccesstype bpaccesstype get active bp access records param requery requery return access list public x ad userbpaccess getbp access boolean requery if m bpaccess null requery return m bpaccess string sql select from ad userbpaccess where ad user id and is active y array list x ad userbpaccess list new array list x ad userbpaccess prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad user id result set rs pstmt execute query while rs next list add new x ad userbpaccess get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m bpaccess new x ad userbpaccess list size list to array m bpaccess return m bpaccess x_ad_userbpaccess getbpaccess m_bpaccess m_bpaccess ad_userbpaccess ad_user_id isactive arraylist x_ad_userbpaccess arraylist x_ad_userbpaccess preparedstatement preparestatement setint getad_user_id resultset executequery x_ad_userbpaccess getctx m_bpaccess x_ad_userbpaccess toarray m_bpaccess m_bpaccess before save param new record new return true protected boolean before save boolean new record new address invalidates verification if new record is valuechanged e mail sete mail verify date null return true newrecord beforesave newrecord newrecord is_valuechanged email setemailverifydate initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame try jb init dyn init frame get content pane add north panel border layout north frame get content pane add center panel border layout center frame get content pane add confirm panel border layout south catch exception e log log level severe init e windowno windowno formframe m_windowno windowno m_frame jbinit dyninit getcontentpane northpanel borderlayout getcontentpane centerpanel borderlayout getcontentpane confirmpanel borderlayout static init throws exception private void jb init throws exception compiere color set background this b file set text msg get msg env get ctx file import file b file set tool tip text msg get msg env get ctx file import file info b file add action listener this info set text label format set text msg translate env get ctx ad impformat id b next set tool tip text msg get msg env get ctx next b next set margin new insets 2 2 2 2 b next set text b next add action listener this record set text b previous set tool tip text msg get msg env get ctx previous b previous set margin new insets 2 2 2 2 b previous set text b previous add action listener this north panel set border border factory create etched border north panel add b file null north panel add info null north panel add label format null north panel add pick format null north panel add b previous null north panel add record null north panel add b next null center panel set layout center layout raw data set font new java awt font monospaced 0 10 raw data set columns 80 raw data set rows 5 raw data pane get viewport add raw data null center panel add raw data pane border layout north center panel add preview pane border layout center preview panel set layout preview layout preview pane get viewport add preview panel null preview pane set preferred size new dimension 700 80 confirm panel add action listener this jbinit compierecolor setbackground bfile settext getmsg getctx fileimportfile bfile settooltiptext getmsg getctx fileimportfileinfo bfile addactionlistener settext labelformat settext getctx ad_impformat_id bnext settooltiptext getmsg getctx bnext setmargin bnext settext bnext addactionlistener settext bprevious settooltiptext getmsg getctx bprevious setmargin bprevious settext bprevious addactionlistener northpanel setborder borderfactory createetchedborder northpanel bfile northpanel northpanel labelformat northpanel pickformat northpanel bprevious northpanel northpanel bnext centerpanel setlayout centerlayout rawdata setfont rawdata setcolumns rawdata setrows rawdatapane getviewport rawdata centerpanel rawdatapane borderlayout centerpanel previewpane borderlayout previewpanel setlayout previewlayout previewpane getviewport previewpanel previewpane setpreferredsize confirmpanel addactionlistener dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame dynamic init private void dyn init load formats pick format add item s none string sql select name from ad impformat try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next pick format add item rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e pick format set selected index 0 pick format add action listener this confirm panel getok button set enabled false dyninit pickformat additem s_none ad_impformat preparedstatement preparestatement resultset executequery pickformat additem getstring sqlexception pickformat setselectedindex pickformat addactionlistener confirmpanel getokbutton setenabled action listener param e event public void action performed action event e if e get source b file cmd loadfile invalidate m frame pack else if e get source pick format cmd loadformat invalidate m frame pack else if e get source b next cmd applyformat true else if e get source b previous cmd applyformat false else if e get action command equals confirm panel a ok m frame set cursor cursor get predefined cursor cursor wait cursor confirm panel set enabled false m frame set busy true swing worker worker new swing worker public object construct cmd process return boolean true worker start when you need the result x worker get this blocks the ui else if e get action command equals confirm panel a cancel dispose if m data null m data size 0 file loaded m format null m format get row count 0 format loaded confirm panel getok button set enabled true else confirm panel getok button set enabled false actionperformed actionevent getsource bfile cmd_loadfile m_frame getsource pickformat cmd_loadformat m_frame getsource bnext cmd_applyformat getsource bprevious cmd_applyformat getactioncommand confirmpanel a_ok m_frame setcursor getpredefinedcursor wait_cursor confirmpanel setenabled m_frame setbusy swingworker swingworker cmd_process getactioncommand confirmpanel a_cancel m_data m_data m_format m_format getrowcount confirmpanel getokbutton setenabled confirmpanel getokbutton setenabled public object construct cmd process return boolean true cmd_process load file private void cmd loadfile string directory org compiere compiere get compiere home file separator data file separator import log config directory j file chooser chooser new j file chooser directory chooser set file selection mode j file chooser files only chooser set multi selection enabled false chooser set dialog title msg get msg env get ctx file import file info if chooser show open dialog this j file chooser approve option return string file name chooser get selected file get name log config file name b file set text file name set cursor cursor get predefined cursor cursor wait cursor m data clear raw data set text try see natural account map buffered reader in new buffered reader new file reader chooser get selected file 10240 not safe see p108 network pgm string s null while s in read line null m data add s if m data size 100 raw data append s raw data append n in close raw data set caret position 0 catch exception e log log level severe e b file set text msg get msg env get ctx file import file int index 1 second line as first may be heading if m data size 1 index 0 int length 0 if m data size 0 length m data get index to string length info set text msg get msg env get ctx records m data size msg get msg env get ctx length length set cursor cursor get default cursor log config records m data size length length cmd_loadfile getcompierehome jfilechooser jfilechooser setfileselectionmode jfilechooser files_only setmultiselectionenabled setdialogtitle getmsg getctx fileimportfileinfo showopendialog jfilechooser approve_option filename getselectedfile getname filename bfile settext filename setcursor getpredefinedcursor wait_cursor m_data rawdata settext naturalaccountmap bufferedreader bufferedreader filereader getselectedfile readline m_data m_data rawdata rawdata rawdata setcaretposition bfile settext getmsg getctx fileimportfile m_data m_data m_data tostring settext getmsg getctx m_data getmsg getctx setcursor getdefaultcursor m_data load format private void cmd loadformat clear panel preview panel remove all string format name pick format get selected item to string if format name equals s none return m format imp format load format name if m format null a dialog error m windowno this file import no format format name return pointers int size m format get row count m labels new j label size m fields new j text field size for int i 0 i size i imp format row row m format get row i m labels i new j label row get column name preview panel add m labels i new grid bag constraints i 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 2 2 2 2 0 0 int length row get end no row get start no if length 5 length 5 else if length 20 length 20 m fields i new j text field length preview panel add m fields i new grid bag constraints i 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 2 2 2 2 0 0 m record 1 record set text preview panel invalidate preview panel repaint cmd_loadformat previewpanel removeall formatname pickformat getselecteditem tostring formatname s_none m_format impformat formatname m_format adialog m_windowno fileimportnoformat formatname m_format getrowcount m_labels jlabel m_fields jtextfield impformatrow m_format getrow m_labels jlabel getcolumnname previewpanel m_labels gridbagconstraints gridbagconstraints gridbagconstraints getendno getstartno m_fields jtextfield previewpanel m_fields gridbagconstraints gridbagconstraints gridbagconstraints m_record settext previewpanel previewpanel apply current pattern param next next private void cmd applyformat boolean next if m format null return set position if next m record else m record if m record 0 m record 0 else if m record m data size m record m data size 1 record set text string value of m record 1 line info string l info m format parse line m data get m record to string false true false no label trace no ignore int size m format get row count if l info length size log log level severe format elements size fields l info length for int i 0 i size i m fields i set text l info i m fields i set caret position 0 cmd_applyformat m_format m_record m_record m_record m_record m_record m_data m_record m_data settext valueof m_record linfo m_format parseline m_data m_record tostring m_format getrowcount linfo formatelements linfo m_fields settext linfo m_fields setcaretposition process file private void cmd process if m format null a dialog error m windowno this file import no format return log config m format get name for all rows update insert db table int row 0 int imported 0 for row 0 row m data size row if m format updatedb env get ctx m data get row to string null imported a dialog info m windowno this file importr i row imported dispose cmd_process m_format adialog m_windowno fileimportnoformat m_format getname m_data m_format getctx m_data tostring adialog m_windowno fileimportr standard constructor param ctx context param m rmaline id id public mrma line properties ctx int m rmaline id string trx name super ctx m rmaline id trx name if m rmaline id 0 set qty env one m_rmaline_id mrmaline m_rmaline_id trxname m_rmaline_id trxname m_rmaline_id setqty load cosntructor param ctx context param rs result set public mrma line properties ctx result set rs string trx name super ctx rs trx name mrmaline resultset trxname trxname set m inoutline id param m inoutline id public void setm inoutline id int m inoutline id super setm inoutline id m inoutline id m ioline null m_inoutline_id m_inoutline_id setm_inoutline_id m_inoutline_id setm_inoutline_id m_inoutline_id m_ioline get ship line return ship line public m in out line get ship line if m ioline null getm inoutline id 0 m ioline new m in out line get ctx getm inoutline id get trxname return m ioline minoutline getshipline m_ioline getm_inoutline_id m_ioline minoutline getctx getm_inoutline_id get_trxname m_ioline get total amt return amt public big decimal get amt big decimal amt env zero get ship line if m ioline null if m ioline getc orderline id 0 m order line ol new m order line get ctx m ioline getc orderline id get trxname amt ol get price actual return amt multiply get qty bigdecimal getamt bigdecimal getshipline m_ioline m_ioline getc_orderline_id morderline morderline getctx m_ioline getc_orderline_id get_trxname getpriceactual getqty prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m shipper id p m shipper id para i get parameter as int else if name equals c invoice id p m inout id para i get parameter as int else log log level severe prepare unknown parameter name if p m inout id 0 p m inout id getrecord id processinfoparameter getparameter getparametername getparameter m_shipper_id p_m_shipper_id getparameterasint c_invoice_id p_m_inout_id getparameterasint p_m_inout_id p_m_inout_id getrecord_id process return message throws exception protected string do it throws exception log info do it m inout id p m inout id m shipper id p m shipper id if p m inout id 0 throw new illegal argument exception no shipment if p m shipper id 0 throw new illegal argument exception no shipper m in out shipment new m in out get ctx p m inout id null if shipment get id p m inout id throw new illegal argument exception cannot find shipment id p m inout id m shipper shipper new m shipper get ctx p m shipper id get trxname if shipper get id p m shipper id throw new illegal argument exception cannot find shipper id p m inout id m package pack m package create shipment shipper null return pack get document no doit doit m_inout_id p_m_inout_id m_shipper_id p_m_shipper_id p_m_inout_id illegalargumentexception p_m_shipper_id illegalargumentexception minout minout getctx p_m_inout_id get_id p_m_inout_id illegalargumentexception p_m_inout_id mshipper mshipper getctx p_m_shipper_id get_trxname get_id p_m_shipper_id illegalargumentexception p_m_inout_id mpackage mpackage getdocumentno constructor called from info product cmd infopattribute param parent public infop attribute j dialog parent super parent msg get msg env get ctx infop attribute true try jb init dyn init catch exception e log log level severe infop attribute e a env show center window parent this infoproduct cmd_infopattribute infopattribute jdialog getmsg getctx infopattribute jbinit dyninit infopattribute aenv showcenterwindow static init throws exception private void jb init throws exception this get content pane add main panel border layout center main panel set layout main layout main panel add center panel border layout center center panel set layout new a layout confirm panel confirm panel add action listener this main panel add confirm panel border layout south jbinit getcontentpane mainpanel borderlayout mainpanel setlayout mainlayout mainpanel centerpanel borderlayout centerpanel setlayout alayout confirmpanel confirmpanel addactionlistener mainpanel confirmpanel borderlayout dynamic init of the center panel private void dyn init int row add attributes string s msg translate env get ctx guarantee date guarantee date selection new v combo box new object s s s guarantee date selection set preferred size init lot selection fixed instance selection fields center panel add ser no label new a layout constraint row 0 center panel add ser no field null center panel add lot label new a layout constraint row 0 center panel add lot field null center panel add lot label2 new a layout constraint row 0 center panel add lot selection null center panel add guarantee date selection new a layout constraint row 0 center panel add guarantee date field null dimension d center panel get preferred size d width 400 center panel set preferred size d dyninit addattributes getctx guaranteedate guaranteedateselection vcombobox guaranteedateselection setpreferredsize initlotselection centerpanel sernolabel alayoutconstraint centerpanel sernofield centerpanel lotlabel alayoutconstraint centerpanel lotfield centerpanel lotlabel2 alayoutconstraint centerpanel lotselection centerpanel guaranteedateselection alayoutconstraint centerpanel guaranteedatefield centerpanel getpreferredsize centerpanel setpreferredsize add attributes return rows private int add attributes int row 0 prepared statement pstmt null string sql m role get default add accesssql select m attribute id name description attribute value type is instance attribute from m attribute where is active y order by is instance attribute name m attribute m role sql notqualified m role sql ro try pstmt db prepare statement sql null result set rs pstmt execute query boolean instance line false while rs next int attribute id rs get int 1 string name rs get string 2 string description rs get string 3 string attribute value type rs get string 4 boolean is instance attribute y equals rs get string 5 instance switch if instance line is instance attribute c panel group new c panel group set border new v line msg translate env get ctx is instance attribute group add box create vertical strut v line space center panel add group new a layout constraint row 0 instance line true c label label new c label name if description null description length 0 label set tool tip text description center panel add label new a layout constraint row 0 component field null if m attribute attributevaluetype list equals attribute value type field new v combo box get attribute list attribute id else if m attribute attributevaluetype number equals attribute value type field new v number name false false true display type number name else field new v string name false false true 10 40 null null label set label for field center panel add field null field set name string value of attribute id if is instance attribute m instanceeditors add field else m producteditors add field to numbers component field to null if m attribute attributevaluetype number equals attribute value type field to new v number name false false true display type number name center panel add new c label null center panel add field to null if is instance attribute m instanceeditorsto add field to else m producteditorsto add field to rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return row addattributes preparedstatement mrole getdefault addaccesssql m_attribute_id attributevaluetype isinstanceattribute m_attribute isactive isinstanceattribute m_attribute mrole sql_notqualified mrole sql_ro preparestatement resultset executequery instanceline attribute_id getint getstring getstring attributevaluetype getstring isinstanceattribute getstring instanceline isinstanceattribute cpanel cpanel setborder vline getctx isinstanceattribute createverticalstrut vline centerpanel alayoutconstraint instanceline clabel clabel settooltiptext centerpanel alayoutconstraint mattribute attributevaluetype_list attributevaluetype vcombobox getattributelist attribute_id mattribute attributevaluetype_number attributevaluetype vnumber displaytype vstring setlabelfor centerpanel setname valueof attribute_id isinstanceattribute m_instanceeditors m_producteditors fieldto mattribute attributevaluetype_number attributevaluetype fieldto vnumber displaytype centerpanel clabel centerpanel fieldto isinstanceattribute m_instanceeditorsto fieldto m_producteditorsto fieldto get attribute list param m attribute id attribure return array private key name pair get attribute list int m attribute id array list key name pair list new array list key name pair list add new key name pair 1 prepared statement pstmt null string sql m role get default add accesssql select m attributevalue id value name from m attributevalue where m attribute id order by 2 m attributevalue m role sql notqualified m role sql ro try pstmt db prepare statement sql null pstmt set int 1 m attribute id result set rs pstmt execute query while rs next list add new key name pair rs get int 1 rs get string 3 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null key name pair ret value new key name pair list size list to array ret value return ret value m_attribute_id keynamepair getattributelist m_attribute_id arraylist keynamepair arraylist keynamepair keynamepair preparedstatement mrole getdefault addaccesssql m_attributevalue_id m_attributevalue m_attribute_id m_attributevalue mrole sql_notqualified mrole sql_ro preparestatement setint m_attribute_id resultset executequery keynamepair getint getstring keynamepair retvalue keynamepair toarray retvalue retvalue initialize lot selection private void init lot selection array list key name pair list new array list key name pair list add new key name pair 1 string sql m role get default add accesssql select m lot id name from m lot where is active y order by 2 m lot m role sql notqualified m role sql ro prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new key name pair rs get int 1 rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null create list key name pair items new key name pair list size list to array items lot selection new v combo box items initlotselection arraylist keynamepair arraylist keynamepair keynamepair mrole getdefault addaccesssql m_lot_id m_lot isactive m_lot mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery keynamepair getint getstring keynamepair keynamepair toarray lotselection vcombobox action listener param e event public void action performed action event e if e get action command equals confirm panel a ok create query dispose else if e get action command equals confirm panel a cancel m query null dispose actionperformed actionevent getactioncommand confirmpanel a_ok createquery getactioncommand confirmpanel a_cancel m_query create query code available synonyms m product p m productprice pr m attributeset pa code return query private string create query base query select from m product p inner join m productprice pr on p m product id pr m product id left outer join m attributeset pa on p m attributeset id pa m attributeset id where instance attributes string buffer sb new string buffer serial no string s ser no field get text if s null s length 0 sb append and asi ser no if s index of 1 s index of 1 sb append else sb append like sb append db to string s lot number s lot field get text if s null s length 0 sb append and asi lot if s index of 1 s index of 1 sb append else sb append like sb append db to string s lot id key name pair pp key name pair lot selection get selected item if pp null pp get key 1 int id pp get key sb append and asi m lot id append id guarantee date timestamp ts timestamp guarantee date field get value if ts null sb append and trunc asi guarantee date int index guarantee date selection get selected index if index 0 sb append else if index 1 sb append else sb append sb append db to date ts true instance editors for int i 0 i m instanceeditors size i string buffer i attr new string buffer component c component m instanceeditors get i component c to component m instanceeditorsto get i int m attribute id integer parse int c get name if c instanceof v combo box v combo box field v combo box c pp key name pair field get selected item if pp null pp get key 1 i attr append m attribute id append m attribute id append and m attributevalue id append pp get key else if c instanceof v number v number field v number c big decimal value big decimal field get value v number field to v number c to big decimal value to big decimal field to get value if value null value to null i attr append m attribute id append m attribute id append and value number if value null value to null i attr append append value else if value null value to null i attr append append value to else if value null value to null i attr append between append value append and append value to else v string field v string c string value field get text if value null value length 0 i attr append m attribute id append m attribute id append and value if value index of 1 value index of 1 i attr append else i attr append like i attr append db to string value add to where if i attr length 0 sb append and asi m attributesetinstance id in select m attributesetinstance id from m attributeinstance where append i attr append finish instance attributes if sb length 0 sb insert 0 and exists select from m storage s inner join m attributesetinstance asi on s m attributesetinstance id asi m attributesetinstance id where s m product id p m product id sb append product attributes for int i 0 i m producteditors size i string buffer p attr new string buffer component c component m producteditors get i component c to component m producteditorsto get i int m attribute id integer parse int c get name if c instanceof v combo box v combo box field v combo box c pp key name pair field get selected item if pp null pp get key 1 p attr append m attribute id append m attribute id append and m attributevalue id append pp get key else if c instanceof v number v number field v number c big decimal value big decimal field get value v number field to v number c to big decimal value to big decimal field to get value if value null value to null p attr append m attribute id append m attribute id append and value number if value null value to null p attr append append value else if value null value to null p attr append append value to else if value null value to null p attr append between append value append and append value to else v string field v string c string value field get text if value null value length 0 p attr append m attribute id append m attribute id append and value if value index of 1 value index of 1 p attr append else p attr append like p attr append db to string value add to where if p attr length 0 sb append and p m attributesetinstance id in select m attributesetinstance id from m attributeinstance where append p attr append m query null if sb length 0 m query sb to string log config m query return m query m_product m_productprice m_attributeset createquery m_product m_productprice m_product_id m_product_id m_attributeset m_attributeset_id m_attributeset_id stringbuffer stringbuffer sernofield gettext serno indexof indexof _ to_string lotfield gettext indexof indexof _ to_string keynamepair keynamepair lotselection getselecteditem getkey getkey m_lot_id guaranteedatefield getvalue guaranteedate guaranteedateselection getselectedindex to_date m_instanceeditors stringbuffer iattr stringbuffer m_instanceeditors cto m_instanceeditorsto m_attribute_id parseint getname vcombobox vcombobox vcombobox keynamepair getselecteditem getkey iattr m_attribute_id m_attribute_id m_attributevalue_id getkey vnumber vnumber vnumber bigdecimal bigdecimal getvalue vnumber fieldto vnumber cto bigdecimal valueto bigdecimal fieldto getvalue valueto iattr m_attribute_id m_attribute_id valuenumber valueto iattr valueto iattr valueto valueto iattr valueto vstring vstring gettext iattr m_attribute_id m_attribute_id indexof indexof _ iattr iattr iattr to_string iattr m_attributesetinstance_id m_attributesetinstance_id m_attributeinstance iattr m_storage m_attributesetinstance m_attributesetinstance_id m_attributesetinstance_id m_product_id m_product_id m_producteditors stringbuffer pattr stringbuffer m_producteditors cto m_producteditorsto m_attribute_id parseint getname vcombobox vcombobox vcombobox keynamepair getselecteditem getkey pattr m_attribute_id m_attribute_id m_attributevalue_id getkey vnumber vnumber vnumber bigdecimal bigdecimal getvalue vnumber fieldto vnumber cto bigdecimal valueto bigdecimal fieldto getvalue valueto pattr m_attribute_id m_attribute_id valuenumber valueto pattr valueto pattr valueto valueto pattr valueto vstring vstring gettext pattr m_attribute_id m_attribute_id indexof indexof _ pattr pattr pattr to_string pattr m_attributesetinstance_id m_attributesetinstance_id m_attributeinstance pattr m_query m_query tostring m_query m_query get resulting query where return query or null public string get where clause return m query getwhereclause m_query initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception click init servletexception servletconfig servletexception webenv initweb servletexception get servlet information return info public string get servlet info return a dempiere click servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception long time system current time millis request get session true force create session for ctx string url get targeturl request response send redirect url response flush buffer log fine redirect url save click save click request url log fine url system current time millis time ms servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception currenttimemillis getsession gettargeturl sendredirect flushbuffer saveclick currenttimemillis process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception doget get target url 1 target parameter 3 parameter 2 path param request request return url private string get targeturl http servlet request request get named parameter click target www string url web util get parameter request para target check parameters click www if url null url length 0 enumeration e request get parameter names if e has more elements url string e next element check path click www if url null url length 0 url request get path info if url null url url substring 1 cut off initial still nothing if url null url length 0 url default target add http protocol if url index of 1 url http url return url gettargeturl httpservletrequest webutil getparameter para_target getparameternames hasmoreelements nextelement getpathinfo default_target indexof save click private boolean save click http servlet request request string url properties ctx jsp env get ctx request m click mc new m click ctx url null mc setremote addr request get remote addr mc setremote host request get remote host string ref request get header referer if ref null ref length 0 ref request get requesturl to string mc set referrer ref mc set accept language request get header accept language mc set user agent request get header user agent http session session request get session false if session null web user wu web user session get attribute web user name if wu null mc sete mail wu get email mc setad user id wu getad user id return mc save saveclick httpservletrequest jspenv getctx mclick mclick setremote_addr getremoteaddr setremote_host getremotehost getheader getrequesturl tostring setreferrer setacceptlanguage getheader setuseragent getheader httpsession getsession webuser webuser getattribute webuser setemail getemail setad_user_id getad_user_id standard constructor public x t reportstatement properties ctx int t reportstatement id string trx name super ctx t reportstatement id trx name if t reportstatement id 0 setad pinstance id 0 set date acct new timestamp system current time millis setfact acct id 0 set level no 0 x_t_reportstatement t_reportstatement_id trxname t_reportstatement_id trxname t_reportstatement_id setad_pinstance_id setdateacct currenttimemillis setfact_acct_id setlevelno load constructor public x t reportstatement properties ctx result set rs string trx name super ctx rs trx name x_t_reportstatement resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t reportstatement append get id append return sb to string tostring stringbuffer stringbuffer x_t_reportstatement get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr set valuenocheck amt acct cr amt acct cr setamtacctcr bigdecimal amtacctcr set_valuenocheck amtacctcr amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr set valuenocheck amt acct dr amt acct dr setamtacctdr bigdecimal amtacctdr set_valuenocheck amtacctdr amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set balance public void set balance big decimal balance set valuenocheck balance balance setbalance bigdecimal set_valuenocheck get balance public big decimal get balance big decimal bd big decimal get value balance if bd null return env zero return bd bigdecimal getbalance bigdecimal bigdecimal get_value set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set valuenocheck date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_valuenocheck dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set valuenocheck description description setdescription set_valuenocheck get description optional short description of the record public string get description return string get value description getdescription get_value set accounting fact public void setfact acct id int fact acct id if fact acct id 1 throw new illegal argument exception fact acct id is mandatory set valuenocheck fact acct id new integer fact acct id setfact_acct_id fact_acct_id fact_acct_id illegalargumentexception fact_acct_id set_valuenocheck fact_acct_id fact_acct_id get accounting fact public int getfact acct id integer ii integer get value fact acct id if ii null return 0 return ii int value getfact_acct_id get_value fact_acct_id intvalue set level no public void set level no int level no set valuenocheck level no new integer level no setlevelno levelno set_valuenocheck levelno levelno get level no public int get level no integer ii integer get value level no if ii null return 0 return ii int value getlevelno get_value levelno intvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set valuenocheck name name setname set_valuenocheck get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set quantity quantity public void set qty big decimal qty set valuenocheck qty qty setqty bigdecimal set_valuenocheck get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value get contents return context public object get contents return contents getcontents show history param c bpartner id partner param m product id product param m warehouse id warehouse param m attributesetinstance id asi public invoice history dialog frame int c bpartner id int m product id int m warehouse id int m attributesetinstance id super frame msg get msg env get ctx price history true log config c bpartner id c bpartner id m product id m product id m warehouse id m warehouse id m attributesetinstance id m attributesetinstance id m c bpartner id c bpartner id m m product id m product id m m warehouse id m warehouse id m m attributesetinstance id m attributesetinstance id try jb init dyn init catch exception ex log log level severe ex main panel set preferred size new dimension 700 400 a env position center window frame this c_bpartner_id m_product_id m_warehouse_id m_attributesetinstance_id invoicehistory c_bpartner_id m_product_id m_warehouse_id m_attributesetinstance_id getmsg getctx pricehistory c_bpartner_id c_bpartner_id m_product_id m_product_id m_warehouse_id m_warehouse_id m_attributesetinstance_id m_attributesetinstance_id m_c_bpartner_id c_bpartner_id m_m_product_id m_product_id m_m_warehouse_id m_warehouse_id m_m_attributesetinstance_id m_attributesetinstance_id jbinit dyninit mainpanel setpreferredsize aenv positioncenterwindow ststic init void jb init throws exception this set default close operation window constants dispose on close main panel set layout main layout label set text label north panel set layout north layout north layout set alignment flow layout left get content pane add main panel main panel add north panel border layout north north panel add label null main panel add confirm panel border layout south main panel add center tabbed pane border layout center center tabbed pane add change listener this center tabbed pane add price pane msg get msg env get ctx price history center tabbed pane add reserved pane msg translate env get ctx qty reserved center tabbed pane add ordered pane msg translate env get ctx qty ordered center tabbed pane add unconfirmed pane msg get msg env get ctx qty unconfirmed if m m product id 0 center tabbed pane add atp pane msg get msg env get ctx atp price pane get viewport add m tableprice null reserved pane get viewport add m tablereserved null ordered pane get viewport add m tableordered null unconfirmed pane get viewport add m tableunconfirmed null if m m product id 0 atp pane get viewport add m tableatp null confirm panel add action listener this jbinit setdefaultcloseoperation windowconstants dispose_on_close mainpanel setlayout mainlayout settext northpanel setlayout northlayout northlayout setalignment flowlayout getcontentpane mainpanel mainpanel northpanel borderlayout northpanel mainpanel confirmpanel borderlayout mainpanel centertabbedpane borderlayout centertabbedpane addchangelistener centertabbedpane pricepane getmsg getctx pricehistory centertabbedpane reservedpane getctx qtyreserved centertabbedpane orderedpane getctx qtyordered centertabbedpane unconfirmedpane getmsg getctx qtyunconfirmed m_m_product_id centertabbedpane atppane getmsg getctx pricepane getviewport m_tableprice reservedpane getviewport m_tablereserved orderedpane getviewport m_tableordered unconfirmedpane getviewport m_tableunconfirmed m_m_product_id atppane getviewport m_tableatp confirmpanel addactionlistener dynamic init for price tab private boolean dyn init header vector string column names new vector string column names add msg translate env get ctx m c bpartner id 0 c bpartner id m product id column names add msg translate env get ctx price actual column names add msg translate env get ctx qty invoiced column names add msg translate env get ctx discount column names add msg translate env get ctx document no column names add msg translate env get ctx date invoiced column names add msg translate env get ctx ad org id fill data vector vector object data null if m c bpartner id 0 data queryb partner b partner of product else data query product product of b partner table m modelprice new default table model data column names m tableprice set model m modelprice m tableprice set column class 0 string class true product partner m tableprice set column class 1 double class true price m tableprice set column class 2 double class true quantity m tableprice set column class 3 big decimal class true discount to limit precision m tableprice set column class 4 string class true doc no m tableprice set column class 5 timestamp class true date m tableprice set column class 6 string class true org m tableprice auto size return data size 0 dyninit columnnames columnnames getctx m_c_bpartner_id c_bpartner_id m_product_id columnnames getctx priceactual columnnames getctx qtyinvoiced columnnames getctx columnnames getctx documentno columnnames getctx dateinvoiced columnnames getctx ad_org_id m_c_bpartner_id querybpartner bpartner queryproduct bpartner m_modelprice defaulttablemodel columnnames m_tableprice setmodel m_modelprice m_tableprice setcolumnclass m_tableprice setcolumnclass m_tableprice setcolumnclass m_tableprice setcolumnclass bigdecimal m_tableprice setcolumnclass docno m_tableprice setcolumnclass m_tableprice setcolumnclass m_tableprice autosize get info for product for given business parner private vector vector object query product string sql select p name l price actual l price list l qty invoiced i date invoiced dt print name i document no as document no o name from c invoice i inner join c invoiceline l on i c invoice id l c invoice id inner join c doctype dt on i c doctype id dt c doctype id inner join ad org o on i ad org id o ad org id inner join m product p on l m product id p m product id where i c bpartner id order by i date invoiced desc vector vector object data fill table sql m c bpartner id sql select name from c bpartner where c bpartner id fill label sql m c bpartner id return data queryproduct priceactual pricelist qtyinvoiced dateinvoiced printname documentno documentno c_invoice c_invoiceline c_invoice_id c_invoice_id c_doctype c_doctype_id c_doctype_id ad_org ad_org_id ad_org_id m_product m_product_id m_product_id c_bpartner_id dateinvoiced filltable m_c_bpartner_id c_bpartner c_bpartner_id filllabel m_c_bpartner_id get info for business partners for given product private vector vector object queryb partner string sql select bp name l price actual l price list l qty invoiced 1 2 3 4 i date invoiced dt print name i document no as document no 5 6 o name from c invoice i inner join c invoiceline l on i c invoice id l c invoice id inner join c doctype dt on i c doctype id dt c doctype id inner join ad org o on i ad org id o ad org id inner join c bpartner bp on i c bpartner id bp c bpartner id where l m product id order by i date invoiced desc vector vector object data fill table sql m m product id sql select name from m product where m product id fill label sql m m product id return data querybpartner priceactual pricelist qtyinvoiced dateinvoiced printname documentno documentno c_invoice c_invoiceline c_invoice_id c_invoice_id c_doctype c_doctype_id c_doctype_id ad_org ad_org_id ad_org_id c_bpartner c_bpartner_id c_bpartner_id m_product_id dateinvoiced filltable m_m_product_id m_product m_product_id filllabel m_m_product_id fill table private vector vector object fill table string sql int parameter log fine sql parameter parameter vector vector object data new vector vector object try prepared statement pstmt db prepare statement sql null pstmt set int 1 parameter result set rs pstmt execute query while rs next vector object line new vector object 6 0 name 1 price actual 2 qty invoiced 3 discount 4 document no 5 date invoiced line add rs get string 1 name line add rs get big decimal 2 price line add new double rs get double 4 qty big decimal discountbd env zero try discoint can be indefinate double discountd rs get double 3 rs get double 2 rs get double 3 100 discountbd new big decimal discountd catch exception e discountbd env zero line add discountbd discount line add rs get string 6 doc no line add rs get timestamp 5 date line add rs get string 7 org warehouse data add line rs close pstmt close catch sql exception e log log level severe sql e log fine data size return data filltable preparedstatement preparestatement setint resultset executequery priceactual qtyinvoiced documentno dateinvoiced getstring getbigdecimal getdouble bigdecimal getdouble getdouble getdouble bigdecimal getstring docno gettimestamp getstring sqlexception set label to product or bp name private void fill label string sql int parameter log fine sql parameter parameter try prepared statement pstmt db prepare statement sql null pstmt set int 1 parameter result set rs pstmt execute query if rs next label set text rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e filllabel preparedstatement preparestatement setint resultset executequery settext getstring sqlexception action listener public void action performed action event e if e get action command equals confirm panel a ok dispose actionperformed actionevent getactioncommand confirmpanel a_ok tab changed param e event public void state changed change event e if center tabbed pane get selected index 1 init reserved ordered tab true else if center tabbed pane get selected index 2 init reserved ordered tab false else if center tabbed pane get selected index 3 init unconfirmed tab else if center tabbed pane get selected index 4 init atp tab statechanged changeevent centertabbedpane getselectedindex initreservedorderedtab centertabbedpane getselectedindex initreservedorderedtab centertabbedpane getselectedindex initunconfirmedtab centertabbedpane getselectedindex initatptab query reserved ordered param reserved po so private void init reserved ordered tab boolean reserved done already if reserved m modelreserved null return if reserved m modelordered null return header vector string column names new vector string column names add msg translate env get ctx m c bpartner id 0 c bpartner id m product id column names add msg translate env get ctx price actual column names add msg translate env get ctx reserved qty reserved qty ordered column names add msg translate env get ctx discount column names add msg translate env get ctx document no column names add msg translate env get ctx date ordered column names add msg translate env get ctx m warehouse id fill data vector vector object data null if m c bpartner id 0 string sql select bp name ol price actual ol price list ol qty reserved o date ordered dt print name o document no as document no w name from c order o inner join c orderline ol on o c order id ol c order id inner join c doctype dt on o c doctype id dt c doctype id inner join m warehouse w on ol m warehouse id w m warehouse id inner join c bpartner bp on o c bpartner id bp c bpartner id where ol qty reserved 0 and ol m product id and o isso trx reserved y n order by o date ordered data fill table sql m m product id product by b partner else string sql select p name ol price actual ol price list ol qty reserved o date ordered dt print name o document no as document no w name from c order o inner join c orderline ol on o c order id ol c order id inner join c doctype dt on o c doctype id dt c doctype id inner join m warehouse w on ol m warehouse id w m warehouse id inner join m product p on ol m product id p m product id where ol qty reserved 0 and o c bpartner id and o isso trx reserved y n order by o date ordered data fill table sql m c bpartner id product of bp table mini table table null if reserved m modelreserved new default table model data column names m tablereserved set model m modelreserved table m tablereserved else m modelordered new default table model data column names m tableordered set model m modelordered table m tableordered table set column class 0 string class true product partner table set column class 1 big decimal class true price table set column class 2 double class true quantity table set column class 3 big decimal class true discount table set column class 4 string class true doc no table set column class 5 timestamp class true date table set column class 6 string class true warehouse table auto size initreservedorderedtab m_modelreserved m_modelordered columnnames columnnames getctx m_c_bpartner_id c_bpartner_id m_product_id columnnames getctx priceactual columnnames getctx qtyreserved qtyordered columnnames getctx columnnames getctx documentno columnnames getctx dateordered columnnames getctx m_warehouse_id m_c_bpartner_id priceactual pricelist qtyreserved dateordered printname documentno documentno c_order c_orderline c_order_id c_order_id c_doctype c_doctype_id c_doctype_id m_warehouse m_warehouse_id m_warehouse_id c_bpartner c_bpartner_id c_bpartner_id qtyreserved m_product_id issotrx dateordered filltable m_m_product_id bpartner priceactual pricelist qtyreserved dateordered printname documentno documentno c_order c_orderline c_order_id c_order_id c_doctype c_doctype_id c_doctype_id m_warehouse m_warehouse_id m_warehouse_id m_product m_product_id m_product_id qtyreserved c_bpartner_id issotrx dateordered filltable m_c_bpartner_id minitable m_modelreserved defaulttablemodel columnnames m_tablereserved setmodel m_modelreserved m_tablereserved m_modelordered defaulttablemodel columnnames m_tableordered setmodel m_modelordered m_tableordered setcolumnclass setcolumnclass bigdecimal setcolumnclass setcolumnclass bigdecimal setcolumnclass docno setcolumnclass setcolumnclass autosize query unconfirmed private void init unconfirmed tab done already if m modelunconfirmed null return header vector string column names new vector string column names add msg translate env get ctx m c bpartner id 0 c bpartner id m product id column names add msg translate env get ctx movement qty column names add msg translate env get ctx movement date column names add msg translate env get ctx isso trx column names add msg translate env get ctx document no column names add msg translate env get ctx m warehouse id fill data string sql null int parameter 0 if m c bpartner id 0 sql select bp name case when io isso trx y then iol movement qty 1 else iol movement qty end as movement qty io movement date io isso trx dt print name io document no as document no w name from m inoutline iol inner join m inout io on iol m inout id io m inout id inner join c bpartner bp on io c bpartner id bp c bpartner id inner join c doctype dt on io c doctype id dt c doctype id inner join m warehouse w on io m warehouse id w m warehouse id inner join m inoutlineconfirm lc on iol m inoutline id lc m inoutline id where iol m product id and lc processed n order by io movement date io isso trx parameter m m product id else sql select p name case when io isso trx y then iol movement qty 1 else iol movement qty end as movement qty io movement date io isso trx dt print name io document no as document no w name from m inoutline iol inner join m inout io on iol m inout id io m inout id inner join m product p on iol m product id p m product id inner join c doctype dt on io c doctype id dt c doctype id inner join m warehouse w on io m warehouse id w m warehouse id inner join m inoutlineconfirm lc on iol m inoutline id lc m inoutline id where io c bpartner id and lc processed n order by io movement date io isso trx parameter m c bpartner id vector vector object data new vector vector object try prepared statement pstmt db prepare statement sql null pstmt set int 1 parameter result set rs pstmt execute query while rs next vector object line new vector object 6 1 name 2 movement qty 3 movement date 4 isso trx 5 document no line add rs get string 1 name line add new double rs get double 2 qty line add rs get timestamp 3 date line add new boolean y equals rs get string 4 isso trx line add rs get string 5 doc no line add rs get string 6 warehouse data add line rs close pstmt close catch sql exception e log log level severe sql e log fine data size table m modelunconfirmed new default table model data column names m tableunconfirmed set model m modelunconfirmed mini table table m tableunconfirmed table set column class 0 string class true product partner table set column class 1 double class true movement qty table set column class 2 timestamp class true movement date table set column class 3 boolean class true isso trx table set column class 4 string class true doc no table auto size initunconfirmedtab m_modelunconfirmed columnnames columnnames getctx m_c_bpartner_id c_bpartner_id m_product_id columnnames getctx movementqty columnnames getctx movementdate columnnames getctx issotrx columnnames getctx documentno columnnames getctx m_warehouse_id m_c_bpartner_id issotrx movementqty movementqty movementqty movementdate issotrx printname documentno documentno m_inoutline m_inout m_inout_id m_inout_id c_bpartner c_bpartner_id c_bpartner_id c_doctype c_doctype_id c_doctype_id m_warehouse m_warehouse_id m_warehouse_id m_inoutlineconfirm m_inoutline_id m_inoutline_id m_product_id movementdate issotrx m_m_product_id issotrx movementqty movementqty movementqty movementdate issotrx printname documentno documentno m_inoutline m_inout m_inout_id m_inout_id m_product m_product_id m_product_id c_doctype c_doctype_id c_doctype_id m_warehouse m_warehouse_id m_warehouse_id m_inoutlineconfirm m_inoutline_id m_inoutline_id c_bpartner_id movementdate issotrx m_c_bpartner_id preparedstatement preparestatement setint resultset executequery movementqty movementdate issotrx documentno getstring getdouble gettimestamp getstring issotrx getstring docno getstring sqlexception m_modelunconfirmed defaulttablemodel columnnames m_tableunconfirmed setmodel m_modelunconfirmed minitable m_tableunconfirmed setcolumnclass setcolumnclass movementqty setcolumnclass movementdate setcolumnclass issotrx setcolumnclass docno autosize query atp private void init atp tab done already if m modelatp null return header vector string column names new vector string column names add msg translate env get ctx date column names add msg translate env get ctx qty on hand column names add msg translate env get ctx c bpartner id column names add msg translate env get ctx qty ordered column names add msg translate env get ctx qty reserved column names add msg translate env get ctx m locator id column names add msg translate env get ctx m attributesetinstance id column names add msg translate env get ctx document no column names add msg translate env get ctx m warehouse id fill storage data boolean show detail c log mgt is level fine string sql select s qty on hand s qty reserved s qty ordered product attribute s m attributesetinstance id s m attributesetinstance id if show detail sql select sum s qty on hand sum s qty reserved sum s qty ordered product attribute s m attributesetinstance id 0 sql w name l value from m storage s inner join m locator l on s m locator id l m locator id inner join m warehouse w on l m warehouse id w m warehouse id where m product id if m m warehouse id 0 sql and l m warehouse id if m m attributesetinstance id 0 sql and s m attributesetinstance id sql and s qty on hand 0 or s qty reserved 0 or s qty ordered 0 if show detail sql group by product attribute s m attributesetinstance id w name l value sql order by l value vector vector object data new vector vector object double qty 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id if m m warehouse id 0 pstmt set int 2 m m warehouse id if m m attributesetinstance id 0 pstmt set int 3 m m attributesetinstance id result set rs pstmt execute query while rs next vector object line new vector object 9 line add null date double qty on hand rs get double 1 qty qty on hand line add new double qty on hand qty line add null b partner line add new double rs get double 3 qty ordered line add new double rs get double 2 qty reserved line add rs get string 7 locator string asi rs get string 4 if show detail asi null asi length 0 asi rs get int 5 line add asi asi line add null document no line add rs get string 6 warehouse data add line rs close pstmt close catch sql exception e log log level severe sql e orders sql select o date promised ol qty reserved product attribute ol m attributesetinstance id ol m attributesetinstance id dt doc base type bp name dt print name o document no as document no w name from c order o inner join c orderline ol on o c order id ol c order id inner join c doctype dt on o c doctype id dt c doctype id inner join m warehouse w on ol m warehouse id w m warehouse id inner join c bpartner bp on o c bpartner id bp c bpartner id where ol qty reserved 0 and ol m product id if m m warehouse id 0 sql and ol m warehouse id if m m attributesetinstance id 0 sql and ol m attributesetinstance id sql order by o date promised try prepared statement pstmt db prepare statement sql null pstmt set int 1 m m product id if m m warehouse id 0 pstmt set int 2 m m warehouse id if m m attributesetinstance id 0 pstmt set int 3 m m attributesetinstance id result set rs pstmt execute query while rs next vector object line new vector object 9 line add rs get timestamp 1 date double oq rs get double 2 string doc base type rs get string 5 double qty reserved null double qty ordered null if m doc type docbasetype purchaseorder equals doc base type qty ordered new double oq qty oq else qty reserved new double oq qty oq line add new double qty qty line add rs get string 6 b partner line add qty ordered qty ordered line add qty reserved qty reserved line add null locator string asi rs get string 3 if show detail asi null asi length 0 asi rs get int 4 line add asi asi line add rs get string 7 document no line add rs get string 8 warehouse data add line rs close pstmt close catch sql exception e log log level severe sql e table mini table table null m modelatp new default table model data column names m tableatp set model m modelatp table m tableatp table set column class 0 timestamp class true date table set column class 1 double class true quantity table set column class 2 string class true partner table set column class 3 double class true quantity table set column class 4 double class true quantity table set column class 5 string class true locator table set column class 6 string class true asi table set column class 7 string class true doc no table set column class 8 string class true warehouse table auto size initatptab m_modelatp columnnames columnnames getctx columnnames getctx qtyonhand columnnames getctx c_bpartner_id columnnames getctx qtyordered columnnames getctx qtyreserved columnnames getctx m_locator_id columnnames getctx m_attributesetinstance_id columnnames getctx documentno columnnames getctx m_warehouse_id showdetail clogmgt islevelfine qtyonhand qtyreserved qtyordered productattribute m_attributesetinstance_id m_attributesetinstance_id showdetail qtyonhand qtyreserved qtyordered productattribute m_attributesetinstance_id m_storage m_locator m_locator_id m_locator_id m_warehouse m_warehouse_id m_warehouse_id m_product_id m_m_warehouse_id m_warehouse_id m_m_attributesetinstance_id m_attributesetinstance_id qtyonhand qtyreserved qtyordered showdetail productattribute m_attributesetinstance_id preparedstatement preparestatement setint m_m_product_id m_m_warehouse_id setint m_m_warehouse_id m_m_attributesetinstance_id setint m_m_attributesetinstance_id resultset executequery qtyonhand getdouble qtyonhand qtyonhand bpartner getdouble qtyordered getdouble qtyreserved getstring getstring showdetail getint documentno getstring sqlexception datepromised qtyreserved productattribute m_attributesetinstance_id m_attributesetinstance_id docbasetype printname documentno documentno c_order c_orderline c_order_id c_order_id c_doctype c_doctype_id c_doctype_id m_warehouse m_warehouse_id m_warehouse_id c_bpartner c_bpartner_id c_bpartner_id qtyreserved m_product_id m_m_warehouse_id m_warehouse_id m_m_attributesetinstance_id m_attributesetinstance_id datepromised preparedstatement preparestatement setint m_m_product_id m_m_warehouse_id setint m_m_warehouse_id m_m_attributesetinstance_id setint m_m_attributesetinstance_id resultset executequery gettimestamp getdouble docbasetype getstring qtyreserved qtyordered mdoctype docbasetype_purchaseorder docbasetype qtyordered qtyreserved getstring bpartner qtyordered qtyordered qtyreserved qtyreserved getstring showdetail getint getstring documentno getstring sqlexception minitable m_modelatp defaulttablemodel columnnames m_tableatp setmodel m_modelatp m_tableatp setcolumnclass setcolumnclass setcolumnclass setcolumnclass setcolumnclass setcolumnclass setcolumnclass setcolumnclass docno setcolumnclass autosize standard constructor public x c invoiceschedule properties ctx int c invoiceschedule id string trx name super ctx c invoiceschedule id trx name if c invoiceschedule id 0 set amt env zero setc invoiceschedule id 0 set invoice day 0 1 set invoice frequency null set invoice week day null set is amount false set is default false set name null x_c_invoiceschedule c_invoiceschedule_id trxname c_invoiceschedule_id trxname c_invoiceschedule_id setamt setc_invoiceschedule_id setinvoiceday setinvoicefrequency setinvoiceweekday setisamount setisdefault setname load constructor public x c invoiceschedule properties ctx result set rs string trx name super ctx rs trx name x_c_invoiceschedule resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoiceschedule append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoiceschedule get_id tostring set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set invoice schedule schedule for generating invoices public void setc invoiceschedule id int c invoiceschedule id if c invoiceschedule id 1 throw new illegal argument exception c invoiceschedule id is mandatory set valuenocheck c invoiceschedule id new integer c invoiceschedule id setc_invoiceschedule_id c_invoiceschedule_id c_invoiceschedule_id illegalargumentexception c_invoiceschedule_id set_valuenocheck c_invoiceschedule_id c_invoiceschedule_id get invoice schedule schedule for generating invoices public int getc invoiceschedule id integer ii integer get value c invoiceschedule id if ii null return 0 return ii int value getc_invoiceschedule_id get_value c_invoiceschedule_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set invoice on even weeks send invoices on even weeks public void set even invoice week boolean even invoice week set value even invoice week new boolean even invoice week seteveninvoiceweek eveninvoiceweek set_value eveninvoiceweek eveninvoiceweek get invoice on even weeks send invoices on even weeks public boolean is even invoice week object oo get value even invoice week if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iseveninvoiceweek get_value eveninvoiceweek booleanvalue set invoice day day of invoice generation public void set invoice day int invoice day set value invoice day new integer invoice day setinvoiceday invoiceday set_value invoiceday invoiceday get invoice day day of invoice generation public int get invoice day integer ii integer get value invoice day if ii null return 0 return ii int value getinvoiceday get_value invoiceday intvalue set invoice day cut off last day for including shipments public void set invoice day cutoff int invoice day cutoff set value invoice day cutoff new integer invoice day cutoff setinvoicedaycutoff invoicedaycutoff set_value invoicedaycutoff invoicedaycutoff get invoice day cut off last day for including shipments public int get invoice day cutoff integer ii integer get value invoice day cutoff if ii null return 0 return ii int value getinvoicedaycutoff get_value invoicedaycutoff intvalue public static final string invoicefrequency weekly w set invoice frequency how often invoices will be generated public void set invoice frequency string invoice frequency if invoice frequency null throw new illegal argument exception invoice frequency is mandatory if invoice frequency equals d invoice frequency equals m invoice frequency equals t invoice frequency equals w else throw new illegal argument exception invoice frequency invalid value invoice frequency reference id 168 d m t w if invoice frequency length 1 log warning length 1 truncated invoice frequency invoice frequency substring 0 0 set value invoice frequency invoice frequency invoicefrequency_weekly setinvoicefrequency invoicefrequency invoicefrequency illegalargumentexception invoicefrequency invoicefrequency invoicefrequency invoicefrequency invoicefrequency illegalargumentexception invoicefrequency invoicefrequency reference_id invoicefrequency invoicefrequency invoicefrequency set_value invoicefrequency invoicefrequency get invoice frequency how often invoices will be generated public string get invoice frequency return string get value invoice frequency getinvoicefrequency get_value invoicefrequency public static final string invoiceweekday sunday 7 set invoice week day day to generate invoices public void set invoice week day string invoice week day if invoice week day null throw new illegal argument exception invoice week day is mandatory if invoice week day equals 1 invoice week day equals 2 invoice week day equals 3 invoice week day equals 4 invoice week day equals 5 invoice week day equals 6 invoice week day equals 7 else throw new illegal argument exception invoice week day invalid value invoice week day reference id 167 1 2 3 4 5 6 7 if invoice week day length 1 log warning length 1 truncated invoice week day invoice week day substring 0 0 set value invoice week day invoice week day invoiceweekday_sunday setinvoiceweekday invoiceweekday invoiceweekday illegalargumentexception invoiceweekday invoiceweekday invoiceweekday invoiceweekday invoiceweekday invoiceweekday invoiceweekday invoiceweekday illegalargumentexception invoiceweekday invoiceweekday reference_id invoiceweekday invoiceweekday invoiceweekday set_value invoiceweekday invoiceweekday get invoice week day day to generate invoices public string get invoice week day return string get value invoice week day getinvoiceweekday get_value invoiceweekday public static final string invoiceweekdaycutoff sunday 7 set invoice weekday cutoff last day in the week for shipments to be included public void set invoice week day cutoff string invoice week day cutoff if invoice week day cutoff null throw new illegal argument exception invoice week day cutoff is mandatory if invoice week day cutoff null invoice week day cutoff equals 1 invoice week day cutoff equals 2 invoice week day cutoff equals 3 invoice week day cutoff equals 4 invoice week day cutoff equals 5 invoice week day cutoff equals 6 invoice week day cutoff equals 7 else throw new illegal argument exception invoice week day cutoff invalid value invoice week day cutoff reference id 167 1 2 3 4 5 6 7 if invoice week day cutoff null invoice week day cutoff length 1 log warning length 1 truncated invoice week day cutoff invoice week day cutoff substring 0 0 set value invoice week day cutoff invoice week day cutoff invoiceweekdaycutoff_sunday setinvoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff illegalargumentexception invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff illegalargumentexception invoiceweekdaycutoff invoiceweekdaycutoff reference_id invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff invoiceweekdaycutoff set_value invoiceweekdaycutoff invoiceweekdaycutoff get invoice weekday cutoff last day in the week for shipments to be included public string get invoice week day cutoff return string get value invoice week day cutoff getinvoiceweekdaycutoff get_value invoiceweekdaycutoff set amount limit send invoices only if the amount exceeds the limit public void set is amount boolean is amount set value is amount new boolean is amount setisamount isamount set_value isamount isamount get amount limit send invoices only if the amount exceeds the limit public boolean is amount object oo get value is amount if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isamount get_value isamount booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x m pricelist properties ctx int m pricelist id string trx name super ctx m pricelist id trx name if m pricelist id 0 setc currency id 0 set enforce price limit false set is default false set isso price list false set is tax included false setm pricelist id 0 set name null set price precision env zero 2 x_m_pricelist m_pricelist_id trxname m_pricelist_id trxname m_pricelist_id setc_currency_id setenforcepricelimit setisdefault setissopricelist setistaxincluded setm_pricelist_id setname setpriceprecision load constructor public x m pricelist properties ctx result set rs string trx name super ctx rs trx name x_m_pricelist resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m pricelist append get id append return sb to string tostring stringbuffer stringbuffer x_m_pricelist get_id tostring public static final int basepricelist id ad reference id 166 set base pricelist pricelist to be used if product not found on this pricelist public void setbasepricelist id int basepricelist id if basepricelist id 0 set value basepricelist id null else set value basepricelist id new integer basepricelist id basepricelist_id_ad_reference_id setbasepricelist_id basepricelist_id basepricelist_id set_value basepricelist_id set_value basepricelist_id basepricelist_id get base pricelist pricelist to be used if product not found on this pricelist public int getbasepricelist id integer ii integer get value basepricelist id if ii null return 0 return ii int value getbasepricelist_id get_value basepricelist_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set enforce price limit do not allow prices below the limit price public void set enforce price limit boolean enforce price limit set value enforce price limit new boolean enforce price limit setenforcepricelimit enforcepricelimit set_value enforcepricelimit enforcepricelimit get enforce price limit do not allow prices below the limit price public boolean is enforce price limit object oo get value enforce price limit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isenforcepricelimit get_value enforcepricelimit booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set sales price list this is a sales price list public void set isso price list boolean isso price list set value isso price list new boolean isso price list setissopricelist issopricelist set_value issopricelist issopricelist get sales price list this is a sales price list public boolean isso price list object oo get value isso price list if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issopricelist get_value issopricelist booleanvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set valuenocheck m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_valuenocheck m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set price precision precision number of decimals for the price public void set price precision big decimal price precision if price precision null throw new illegal argument exception price precision is mandatory set value price precision price precision setpriceprecision bigdecimal priceprecision priceprecision illegalargumentexception priceprecision set_value priceprecision priceprecision get price precision precision number of decimals for the price public big decimal get price precision big decimal bd big decimal get value price precision if bd null return env zero return bd bigdecimal getpriceprecision bigdecimal bigdecimal get_value priceprecision public tbody sets the span attribute param span sets the span attribute public tbody set span string span add attribute span span return this setspan addattribute sets the span attribute param span sets the span attribute public tbody set span int span add attribute span integer to string span return this setspan addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public tbody set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public tbody set width string width add attribute width width return this setwidth addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public tbody set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public tbody setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public tbody set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tbody set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public tbody set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tbody add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tbody add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tbody add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tbody add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public tbody remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x ad workbenchwindow properties ctx int ad workbenchwindow id string trx name super ctx ad workbenchwindow id trx name if ad workbenchwindow id 0 setad workbenchwindow id 0 setad workbench id 0 set entity type null u set is primary false set seq no 0 x_ad_workbenchwindow ad_workbenchwindow_id trxname ad_workbenchwindow_id trxname ad_workbenchwindow_id setad_workbenchwindow_id setad_workbench_id setentitytype setisprimary setseqno load constructor public x ad workbenchwindow properties ctx result set rs string trx name super ctx rs trx name x_ad_workbenchwindow resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workbenchwindow append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workbenchwindow get_id tostring set special form special form public void setad form id int ad form id if ad form id 0 set value ad form id null else set value ad form id new integer ad form id setad_form_id ad_form_id ad_form_id set_value ad_form_id set_value ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set os task operation system task public void setad task id int ad task id if ad task id 0 set value ad task id null else set value ad task id new integer ad task id setad_task_id ad_task_id ad_task_id set_value ad_task_id set_value ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set workbench window public void setad workbenchwindow id int ad workbenchwindow id if ad workbenchwindow id 1 throw new illegal argument exception ad workbenchwindow id is mandatory set valuenocheck ad workbenchwindow id new integer ad workbenchwindow id setad_workbenchwindow_id ad_workbenchwindow_id ad_workbenchwindow_id illegalargumentexception ad_workbenchwindow_id set_valuenocheck ad_workbenchwindow_id ad_workbenchwindow_id get workbench window public int getad workbenchwindow id integer ii integer get value ad workbenchwindow id if ii null return 0 return ii int value getad_workbenchwindow_id get_value ad_workbenchwindow_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad workbenchwindow id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_workbenchwindow_id set workbench collection of windows reports public void setad workbench id int ad workbench id if ad workbench id 1 throw new illegal argument exception ad workbench id is mandatory set valuenocheck ad workbench id new integer ad workbench id setad_workbench_id ad_workbench_id ad_workbench_id illegalargumentexception ad_workbench_id set_valuenocheck ad_workbench_id ad_workbench_id get workbench collection of windows reports public int getad workbench id integer ii integer get value ad workbench id if ii null return 0 return ii int value getad_workbench_id get_value ad_workbench_id intvalue public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set primary indicates if this is the primary budget public void set is primary boolean is primary set value is primary new boolean is primary setisprimary isprimary set_value isprimary isprimary get primary indicates if this is the primary budget public boolean is primary object oo get value is primary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprimary get_value isprimary booleanvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x c bp group properties ctx int c bp group id string trx name super ctx c bp group id trx name if c bp group id 0 setc bp group id 0 set is confidential info false n set is default false set name null set value null x_c_bp_group c_bp_group_id trxname c_bp_group_id trxname c_bp_group_id setc_bp_group_id setisconfidentialinfo setisdefault setname setvalue load constructor public x c bp group properties ctx result set rs string trx name super ctx rs trx name x_c_bp_group resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp group append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_group get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 1 throw new illegal argument exception c bp group id is mandatory set valuenocheck c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id illegalargumentexception c_bp_group_id set_valuenocheck c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set credit watch credit watch percent of credit limit when ok switches to watch public void set credit watch percent big decimal credit watch percent set value credit watch percent credit watch percent setcreditwatchpercent bigdecimal creditwatchpercent set_value creditwatchpercent creditwatchpercent get credit watch credit watch percent of credit limit when ok switches to watch public big decimal get credit watch percent big decimal bd big decimal get value credit watch percent if bd null return env zero return bd bigdecimal getcreditwatchpercent bigdecimal bigdecimal get_value creditwatchpercent set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set confidential info can enter confidential information public void set is confidential info boolean is confidential info set value is confidential info new boolean is confidential info setisconfidentialinfo isconfidentialinfo set_value isconfidentialinfo isconfidentialinfo get confidential info can enter confidential information public boolean is confidential info object oo get value is confidential info if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isconfidentialinfo get_value isconfidentialinfo booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue public static final int m discountschema id ad reference id 325 set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 0 set value m discountschema id null else set value m discountschema id new integer m discountschema id m_discountschema_id_ad_reference_id setm_discountschema_id m_discountschema_id m_discountschema_id set_value m_discountschema_id set_value m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set value m pricelist id null else set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_value m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int po discountschema id ad reference id 325 set po discount schema schema to calculate the purchase trade discount percentage public void setpo discountschema id int po discountschema id if po discountschema id 0 set value po discountschema id null else set value po discountschema id new integer po discountschema id po_discountschema_id_ad_reference_id setpo_discountschema_id po_discountschema_id po_discountschema_id set_value po_discountschema_id set_value po_discountschema_id po_discountschema_id get po discount schema schema to calculate the purchase trade discount percentage public int getpo discountschema id integer ii integer get value po discountschema id if ii null return 0 return ii int value getpo_discountschema_id get_value po_discountschema_id intvalue public static final int po pricelist id ad reference id 166 set purchase pricelist price list used by this business partner public void setpo pricelist id int po pricelist id if po pricelist id 0 set value po pricelist id null else set value po pricelist id new integer po pricelist id po_pricelist_id_ad_reference_id setpo_pricelist_id po_pricelist_id po_pricelist_id set_value po_pricelist_id set_value po_pricelist_id po_pricelist_id get purchase pricelist price list used by this business partner public int getpo pricelist id integer ii integer get value po pricelist id if ii null return 0 return ii int value getpo_pricelist_id get_value po_pricelist_id intvalue set price match tolerance po invoice match price tolerance in percent of the purchase price public void set price match tolerance big decimal price match tolerance set value price match tolerance price match tolerance setpricematchtolerance bigdecimal pricematchtolerance set_value pricematchtolerance pricematchtolerance get price match tolerance po invoice match price tolerance in percent of the purchase price public big decimal get price match tolerance big decimal bd big decimal get value price match tolerance if bd null return env zero return bd bigdecimal getpricematchtolerance bigdecimal bigdecimal get_value pricematchtolerance public static final string prioritybase same s set priority base base of priority public void set priority base string priority base if priority base null throw new illegal argument exception priority base is mandatory if priority base null priority base equals h priority base equals l priority base equals s else throw new illegal argument exception priority base invalid value priority base reference id 350 h l s if priority base null priority base length 1 log warning length 1 truncated priority base priority base substring 0 0 set value priority base priority base prioritybase_same setprioritybase prioritybase prioritybase illegalargumentexception prioritybase prioritybase prioritybase prioritybase prioritybase illegalargumentexception prioritybase prioritybase reference_id prioritybase prioritybase prioritybase prioritybase set_value prioritybase prioritybase get priority base base of priority public string get priority base return string get value priority base getprioritybase get_value prioritybase set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor param ctx context param ad alertprocessorlog id id public m alert processor log properties ctx int ad alertprocessorlog id string trx name super ctx ad alertprocessorlog id trx name ad_alertprocessorlog_id malertprocessorlog ad_alertprocessorlog_id trxname ad_alertprocessorlog_id trxname load constructor param ctx context param rs result set public m alert processor log properties ctx result set rs string trx name super ctx rs trx name malertprocessorlog resultset trxname trxname parent constructor param parent parent param summary summary public m alert processor log m alert processor parent string summary this parent get ctx 0 parent get trxname set client org parent setad alertprocessor id parent getad alertprocessor id set summary summary malertprocessorlog malertprocessor getctx get_trxname setclientorg setad_alertprocessor_id getad_alertprocessor_id setsummary load regions cached param ctx context private static void load all regions properties ctx s regions new c cache string m region c region 100 string sql select from c region where is active y try statement stmt db create statement result set rs stmt execute query sql while rs next m region r new m region ctx rs null s regions put string value of r getc region id r if r is default s default r rs close stmt close catch sql exception e s log log level severe sql e s log fine s regions size default s default loadallregions s_regions ccache mregion c_region c_region isactive createstatement resultset executequery mregion mregion s_regions valueof getc_region_id isdefault s_default sqlexception s_log s_log s_regions s_default get country cached param ctx context param c region id id return country public static m region get properties ctx int c region id if s regions null s regions size 0 load all regions ctx string key string value of c region id m region r m region s regions get key if r null return r r new m region ctx c region id null if r getc region id c region id s regions put key r return r return null c_region_id mregion c_region_id s_regions s_regions loadallregions valueof c_region_id mregion mregion s_regions mregion c_region_id getc_region_id c_region_id s_regions get default region param ctx context return region or null public static m region get default properties ctx if s regions null s regions size 0 load all regions ctx return s default mregion getdefault s_regions s_regions loadallregions s_default return regions as array param ctx context return m country array suppress warnings unchecked public static m region get regions properties ctx if s regions null s regions size 0 load all regions ctx m region ret value new m region s regions size s regions values to array ret value arrays sort ret value new m region ctx 0 null return ret value mcountry suppresswarnings mregion getregions s_regions s_regions loadallregions mregion retvalue mregion s_regions s_regions toarray retvalue retvalue mregion retvalue return array of regions of country param ctx context param c country id country return m region array suppress warnings unchecked public static m region get regions properties ctx int c country id if s regions null s regions size 0 load all regions ctx array list m region list new array list m region iterator it s regions values iterator while it has next m region r m region it next if r getc country id c country id list add r sort it m region ret value new m region list size list to array ret value arrays sort ret value new m region ctx 0 null return ret value c_country_id mregion suppresswarnings mregion getregions c_country_id s_regions s_regions loadallregions arraylist mregion arraylist mregion s_regions hasnext mregion mregion getc_country_id c_country_id mregion retvalue mregion toarray retvalue retvalue mregion retvalue create empty region param ctx context param c region id id public m region properties ctx int c region id string trx name super ctx c region id trx name if c region id 0 c_region_id mregion c_region_id trxname c_region_id trxname c_region_id create region from current row in result set param ctx context param rs result set public m region properties ctx result set rs string trx name super ctx rs trx name resultset mregion resultset trxname trxname return name return name public string to string return get name tostring getname compare param o1 object 1 param o2 object 2 return 1 0 1 public int compare object o1 object o2 string s1 o1 to string if s1 null s1 string s2 o2 to string if s2 null s2 return s1 compare to s2 tostring tostring compareto set price list param var price list public void setpricelist id string var try m pricelist id integer parse int var catch number format exception ex log warning setpricelist id ex to string setpricelist_id m_pricelist_id parseint numberformatexception setpricelist_id tostring start tag return skip body throws jsp exception public int do start tag throws jsp exception create price list properties ctx jsp env get ctx http servlet request page context get request int ad client id env get context as int ctx ad client id int m pricelist id m pricelist id if m pricelist id 0 m pricelist id env get context as int ctx m pricelist id check business partner web user wu web user page context get session get attribute web user name if wu null int pricelist id wu getm pricelist id if pricelist id 0 log fine using bp pricelist id pricelist id m pricelist id pricelist id get parameters string search string ctx get property product servlet p searchstring string product category ctx get property product servlet p m product category id get price list m pricelist price list get ctx ad client id m pricelist id search string product category false if m pricelist id 0 env set context ctx m pricelist id m pricelist getpricelist id set price list http session session page context get session session set attribute price list name m pricelist log fine pl m pricelist set locale from price list string ad language m pricelist getad language if ad language null ad language length 0 ad language en us config set session config fmt locale ad language config set session config fmt fallback locale en us return skip body skip_body jspexception dostarttag jspexception jspenv getctx httpservletrequest pagecontext getrequest ad_client_id getcontextasint ad_client_id m_pricelist_id m_pricelist_id m_pricelist_id m_pricelist_id getcontextasint m_pricelist_id webuser webuser pagecontext getsession getattribute webuser pricelist_id getm_pricelist_id pricelist_id pricelist_id pricelist_id m_pricelist_id pricelist_id searchstring getproperty productservlet p_searchstring productcategory getproperty productservlet p_m_product_category_id m_pricelist pricelist ad_client_id m_pricelist_id searchstring productcategory m_pricelist_id setcontext m_pricelist_id m_pricelist getpricelist_id httpsession pagecontext getsession setattribute pricelist m_pricelist m_pricelist ad_language m_pricelist getad_language ad_language ad_language ad_language en_us fmt_locale ad_language fmt_fallback_locale en_us skip_body end tag return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page factory start editor param jc container to get parent frame param header heading param text initial text param editable if false r o return edited string public static string start editor container jc string header string text boolean editable find frame j frame frame env get frame jc start it html editor ed new html editor frame header text editable string s ed get html text ed null return s starteditor jframe getframe htmleditor htmleditor gethtmltext standard constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display length display length param field length field length public v text long string column name boolean mandatory boolean is read only boolean is updateable int display length int field length super super set name column name look and feel install border this text field border set preferred size new dimension 500 80 create editor set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal set mandatory mandatory m columnname column name if is read only is updateable set read write false add key listener this popup add mouse listener new vtextlong mouseadapter this menu editor new c menu item msg get msg env get ctx editor env get image icon editor16 gif menu editor add action listener this popup menu add menu editor columnname isreadonly isupdateable displaylength fieldlength vtextlong columnname isreadonly isupdateable displaylength fieldlength setname columnname lookandfeel installborder textfield setpreferredsize setforeground gettextcolor_normal setbackground getfieldbackground_normal setmandatory m_columnname columnname isreadonly isupdateable setreadwrite addkeylistener addmouselistener vtextlong_mouseadapter menueditor cmenuitem getmsg getctx getimageicon menueditor addactionlistener popupmenu menueditor dispose public void dispose set editor to value param value value public void set value object value if value null m oldtext else m oldtext value to string if m setting return super set value m oldtext m initialtext m oldtext always position top set caret position 0 setvalue m_oldtext m_oldtext tostring m_setting setvalue m_oldtext m_initialtext m_oldtext setcaretposition property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue action listener param e event public void action performed action event e log finest v test long action performed e get action command if e get source menu editor menu editor set enabled false string s v text long start editor this msg translate env get ctx m columnname get text is editable menu editor set enabled true data binding try fire vetoable change m columnname m oldtext s catch property veto exception pve actionlistener actionperformed actionevent vtestlong actionperformed getactioncommand getsource menueditor menueditor setenabled vtextlong starteditor getctx m_columnname gettext iseditable menueditor setenabled firevetoablechange m_columnname m_oldtext propertyvetoexception action listener interface nop param listener listener public void add action listener action listener listener addactionlistener actionlistener key listener interface param e event public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent key released if escape restore old text param e event public void key released key event e esc if e get key code key event vk escape set text m initialtext m setting true try fire vetoable change m columnname m oldtext get text catch property veto exception pve m setting false keyreleased keyevent getkeycode keyevent vk_escape settext m_initialtext m_setting firevetoablechange m_columnname m_oldtext gettext propertyvetoexception m_setting set field window no for value preference nop param m field field model public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield constructor param adaptee v text vtextlong mouseadapter v text long adaptee this adaptee adaptee vtext vtextlong_mouseadapter vtextlong mouse listener param e event public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource get period from cache param ctx context param c period id id return m period public static m period get properties ctx int c period id string trx name integer key new integer c period id m period ret value m period s cache get key if ret value null return ret value ret value new m period ctx c period id trx name if ret value get id 0 s cache put key ret value return ret value c_period_id mperiod mperiod c_period_id trxname c_period_id mperiod retvalue mperiod s_cache retvalue retvalue retvalue mperiod c_period_id trxname retvalue get_id s_cache retvalue retvalue find standard period of date acct based on client calendar param ctx context param date acct date return period or null public static m period get properties ctx timestamp date acct if date acct null return null search in cache first iterator it s cache values iterator while it has next m period period m period it next if period is standard period period is in period date acct return period get it from db m period ret value null int ad client id env getad client id ctx string sql select from c period where c year id in select c year id from c year where c calendar id select c calendar id from ad clientinfo where ad client id and between trunc start date and trunc end date globalqss cruiz bug 1577712 financial period bug and is active y and period type s try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set timestamp 2 time util get day date acct result set rs pstmt execute query while rs next m period period new m period ctx rs null integer key new integer period getc period id s cache put key period if period is standard period ret value period rs close pstmt close pstmt null catch sql exception e s log log level severe date acct e if ret value null s log warning no standard period for date acct ad client id ad client id return ret value dateacct dateacct mperiod dateacct dateacct s_cache hasnext mperiod mperiod isstandardperiod isinperiod dateacct mperiod retvalue ad_client_id getad_client_id c_period c_year_id c_year_id c_year c_calendar_id c_calendar_id ad_clientinfo ad_client_id startdate enddate isactive periodtype preparedstatement preparestatement setint ad_client_id settimestamp timeutil getday dateacct resultset executequery mperiod mperiod getc_period_id s_cache isstandardperiod retvalue sqlexception s_log dateacct retvalue s_log dateacct ad_client_id ad_client_id retvalue find valid standard period of date acct based on client calendar param ctx context param date acct date return c period id or 0 public static int getc period id properties ctx timestamp date acct m period period get ctx date acct if period null return 0 return period getc period id dateacct dateacct c_period_id getc_period_id dateacct mperiod dateacct getc_period_id is standard period open for document base type param ctx context param date acct date param doc base type base type return true if open public static boolean is open properties ctx timestamp date acct string doc base type if date acct null s log warning no date acct return false if doc base type null s log warning no doc base type return false m period period m period get ctx date acct if period null s log warning no period for date acct doc base type return false boolean open period is open doc base type if open s log warning period get name not open for doc base type date acct return open dateacct docbasetype isopen dateacct docbasetype dateacct s_log dateacct docbasetype s_log docbasetype mperiod mperiod dateacct s_log dateacct docbasetype isopen docbasetype s_log getname docbasetype dateacct find first year period of date acct based on client calendar param ctx context param date acct date return period public static m period get first in year properties ctx timestamp date acct m period ret value null int ad client id env getad client id ctx string sql select from c period where c year id in select p c year id from ad clientinfo c inner join c year y on c c calendar id y c calendar id inner join c period p on y c year id p c year id where c ad client id and between start date and end date globalqss cruiz bug 1577712 financial period bug and is active y and period type s order by start date try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set timestamp 2 date acct result set rs pstmt execute query if rs next first only ret value new m period ctx rs null rs close pstmt close catch sql exception e s log log level severe get firstin year e return ret value dateacct dateacct mperiod getfirstinyear dateacct mperiod retvalue ad_client_id getad_client_id c_period c_year_id c_year_id ad_clientinfo c_year c_calendar_id c_calendar_id c_period c_year_id c_year_id ad_client_id startdate enddate isactive periodtype startdate preparedstatement preparestatement setint ad_client_id settimestamp dateacct resultset executequery retvalue mperiod sqlexception s_log getfirstinyear retvalue standard constructor param ctx context param c period id id public m period properties ctx int c period id string trx name super ctx c period id trx name if c period id 0 setc period id 0 pk setc year id 0 parent set name null set period no 0 set start date new timestamp system current time millis set period type periodtype standardcalendarperiod c_period_id mperiod c_period_id trxname c_period_id trxname c_period_id setc_period_id setc_year_id setname setperiodno setstartdate currenttimemillis setperiodtype periodtype_standardcalendarperiod load constructor param ctx context param rs result set public m period properties ctx result set rs string trx name super ctx rs trx name mperiod resultset trxname trxname parent constructor param year year param period no no param name name param start date start param end date end public m period m year year int period no string name timestamp start date timestamp end date this year get ctx 0 year get trxname set client org year setc year id year getc year id set period no period no set name name set start date start date set end date end date periodno startdate enddate mperiod myear periodno startdate enddate getctx get_trxname setclientorg setc_year_id getc_year_id setperiodno periodno setname setstartdate startdate setenddate enddate get period control param requery requery return period controls public m period control get period controls boolean requery if m controls null requery return m controls array list m period control list new array list m period control string sql select from c periodcontrol where c period id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc period id result set rs pstmt execute query while rs next list add new m period control get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m controls new m period control list size list to array m controls return m controls mperiodcontrol getperiodcontrols m_controls m_controls arraylist mperiodcontrol arraylist mperiodcontrol c_periodcontrol c_period_id preparedstatement preparestatement setint getc_period_id resultset executequery mperiodcontrol getctx m_controls mperiodcontrol toarray m_controls m_controls get period control param doc base type document base type return period control or null public m period control get period control string doc base type if doc base type null return null get period controls false for int i 0 i m controls length i log fine get period control 1 m controls i if doc base type equals m controls i get doc base type return m controls i return null docbasetype mperiodcontrol getperiodcontrol docbasetype docbasetype getperiodcontrols m_controls getperiodcontrol m_controls docbasetype m_controls getdocbasetype m_controls date in period param date date return true if in period public boolean is in period timestamp date if date null return false timestamp date only time util get day date timestamp from time util get day get start date if date only before from return false timestamp to time util get day get end date if date only after to return false return true isinperiod dateonly timeutil getday timeutil getday getstartdate dateonly timeutil getday getenddate dateonly is period open for doc base type param doc base type document base type return true if open public boolean is open string doc base type m acct schema as m client get get ctx getad client id get acct schema if as null as is auto period control if as getc period id getc period id return true not in as current period timestamp today new timestamp system current time millis timestamp first time util add days today as getperiod openhistory timestamp last time util add days today as getperiod openfuture if today before first log warning today before first day first return false if today after last log warning today after last day first return false we are ok if is in period today as setc period id getc period id as save return true standard period control if doc base type null log warning get name no doc base type return false m period control pc get period control doc base type if pc null log warning get name period control not found for doc base type return false log fine get name doc base type return pc is open docbasetype isopen docbasetype macctschema mclient getctx getad_client_id getacctschema isautoperiodcontrol getc_period_id getc_period_id currenttimemillis timeutil adddays getperiod_openhistory timeutil adddays getperiod_openfuture isinperiod setc_period_id getc_period_id docbasetype getname docbasetype mperiodcontrol getperiodcontrol docbasetype getname docbasetype getname docbasetype isopen standard period return true if standard calendar perios public boolean is standard period return periodtype standardcalendarperiod equals get period type isstandardperiod periodtype_standardcalendarperiod getperiodtype before save truncate dates param new record new return true protected boolean before save boolean new record truncate dates timestamp date get start date if date null set start date time util get day date else return false date get end date if date null set end date time util get day date else set end date time util get month last day get start date return true newrecord beforesave newrecord getstartdate setstartdate timeutil getday getenddate setenddate timeutil getday setenddate timeutil getmonthlastday getstartdate after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record select value from ad ref list where ad reference id 183 m doc type types m doc type get of client get ctx int count 0 for int i 0 i types length i m doc type type types i m period control pc new m period control this type get doc base type if pc save count log fine period control count return success newrecord aftersave newrecord newrecord ad_ref_list ad_reference_id mdoctype mdoctype getofclient getctx mdoctype mperiodcontrol mperiodcontrol getdocbasetype periodcontrol string representation return info public string to string string buffer sb new string buffer m period sb append get id append append get name append append get start date append append get end date append return sb to string tostring stringbuffer stringbuffer mperiod get_id getname getstartdate getenddate tostring standard constructor param ctx context param c dunning id id public m dunning properties ctx int c dunning id string trx name super ctx c dunning id trx name c_dunning_id mdunning c_dunning_id trxname c_dunning_id trxname load constructor param ctx context param rs result set public m dunning properties ctx result set rs string trx name super ctx rs trx name mdunning resultset trxname trxname basic construtor use set methods public caption set the align attribute param align set the align attribute public caption set align string align add attribute align align return this setalign addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public caption add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public caption add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add an element to the element param element a string representation of the element public caption add element string element add element to registry integer to string element hash code element return this addelement addelementtoregistry tostring hashcode add an element to the element param element an element to add public caption add element element element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public caption remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param ctx context param pa goalrestriction id id param trx name trx public m goal restriction properties ctx int pa goalrestriction id string trx name super ctx pa goalrestriction id trx name pa_goalrestriction_id trxname mgoalrestriction pa_goalrestriction_id trxname pa_goalrestriction_id trxname load constructor param ctx context param rs result set param trx name trx public m goal restriction properties ctx result set rs string trx name super ctx rs trx name trxname mgoalrestriction resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m goal restriction sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mgoalrestriction get_id getname tostring standard constructor public x c payment properties ctx int c payment id string trx name super ctx c payment id trx name if c payment id 0 setc bpartner id 0 setc bankaccount id 0 setc currency id 0 setc doctype id 0 setc payment id 0 set date acct new timestamp system current time millis date set date trx new timestamp system current time millis date set doc action null co set doc status null dr set document no null set is allocated false set is approved false n set is delayed capture false set is online false set is over under payment false n set is prepayment false set is receipt false set is reconciled false set is self service false set pay amt env zero 0 set posted false n set processed false set tender type null k set trx type null s x_c_payment c_payment_id trxname c_payment_id trxname c_payment_id setc_bpartner_id setc_bankaccount_id setc_currency_id setc_doctype_id setc_payment_id setdateacct currenttimemillis setdatetrx currenttimemillis setdocaction setdocstatus setdocumentno setisallocated setisapproved setisdelayedcapture setisonline setisoverunderpayment setisprepayment setisreceipt setisreconciled setisselfservice setpayamt setposted setprocessed settendertype settrxtype load constructor public x c payment properties ctx result set rs string trx name super ctx rs trx name x_c_payment resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c payment append get id append return sb to string tostring stringbuffer stringbuffer x_c_payment get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set account city city or the credit card or account holder public void seta city string a city if a city null a city length 60 log warning length 60 truncated a city a city substring 0 59 set value a city a city seta_city a_city a_city a_city a_city a_city set_value a_city a_city get account city city or the credit card or account holder public string geta city return string get value a city geta_city get_value a_city set account country country public void seta country string a country if a country null a country length 40 log warning length 40 truncated a country a country substring 0 39 set value a country a country seta_country a_country a_country a_country a_country a_country set_value a_country a_country get account country country public string geta country return string get value a country geta_country get_value a_country set account e mail email address public void seta email string a email if a email null a email length 60 log warning length 60 truncated a email a email substring 0 59 set value a email a email email seta_email a_email a_email a_email a_email a_email set_value a_email a_email get account e mail email address public string geta email return string get value a email email geta_email get_value a_email set driver license payment identification driver license public void seta ident dl string a ident dl if a ident dl null a ident dl length 20 log warning length 20 truncated a ident dl a ident dl substring 0 19 set value a ident dl a ident dl seta_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl set_value a_ident_dl a_ident_dl get driver license payment identification driver license public string geta ident dl return string get value a ident dl geta_ident_dl get_value a_ident_dl set social security no payment identification social security no public void seta ident ssn string a ident ssn if a ident ssn null a ident ssn length 20 log warning length 20 truncated a ident ssn a ident ssn substring 0 19 set value a ident ssn a ident ssn seta_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn set_value a_ident_ssn a_ident_ssn get social security no payment identification social security no public string geta ident ssn return string get value a ident ssn geta_ident_ssn get_value a_ident_ssn set account name name on credit card or account holder public void seta name string a name if a name null a name length 60 log warning length 60 truncated a name a name substring 0 59 set value a name a name seta_name a_name a_name a_name a_name a_name set_value a_name a_name get account name name on credit card or account holder public string geta name return string get value a name geta_name get_value a_name set account state state of the credit card or account holder public void seta state string a state if a state null a state length 40 log warning length 40 truncated a state a state substring 0 39 set value a state a state seta_state a_state a_state a_state a_state a_state set_value a_state a_state get account state state of the credit card or account holder public string geta state return string get value a state geta_state get_value a_state set account street street address of the credit card or account holder public void seta street string a street if a street null a street length 60 log warning length 60 truncated a street a street substring 0 59 set value a street a street seta_street a_street a_street a_street a_street a_street set_value a_street a_street get account street street address of the credit card or account holder public string geta street return string get value a street geta_street get_value a_street set account zip postal zip code of the credit card or account holder public void seta zip string a zip if a zip null a zip length 20 log warning length 20 truncated a zip a zip substring 0 19 set value a zip a zip seta_zip a_zip a_zip a_zip a_zip a_zip set_value a_zip a_zip get account zip postal zip code of the credit card or account holder public string geta zip return string get value a zip geta_zip get_value a_zip set account no account number public void set account no string account no if account no null account no length 20 log warning length 20 truncated account no account no substring 0 19 set value account no account no setaccountno accountno accountno accountno accountno accountno set_value accountno accountno get account no account number public string get account no return string get value account no getaccountno get_value accountno set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set partner bank account bank account of the business partner public void setc bp bankaccount id int c bp bankaccount id if c bp bankaccount id 0 set value c bp bankaccount id null else set value c bp bankaccount id new integer c bp bankaccount id setc_bp_bankaccount_id c_bp_bankaccount_id c_bp_bankaccount_id set_value c_bp_bankaccount_id set_value c_bp_bankaccount_id c_bp_bankaccount_id get partner bank account bank account of the business partner public int getc bp bankaccount id integer ii integer get value c bp bankaccount id if ii null return 0 return ii int value getc_bp_bankaccount_id get_value c_bp_bankaccount_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment batch payment batch for eft public void setc paymentbatch id int c paymentbatch id if c paymentbatch id 0 set value c paymentbatch id null else set value c paymentbatch id new integer c paymentbatch id setc_paymentbatch_id c_paymentbatch_id c_paymentbatch_id set_value c_paymentbatch_id set_value c_paymentbatch_id c_paymentbatch_id get payment batch payment batch for eft public int getc paymentbatch id integer ii integer get value c paymentbatch id if ii null return 0 return ii int value getc_paymentbatch_id get_value c_paymentbatch_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 1 throw new illegal argument exception c payment id is mandatory set valuenocheck c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id illegalargumentexception c_payment_id set_valuenocheck c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set charge amount charge amount public void set charge amt int charge amt set value charge amt new integer charge amt setchargeamt chargeamt set_value chargeamt chargeamt get charge amount charge amount public int get charge amt integer ii integer get value charge amt if ii null return 0 return ii int value getchargeamt get_value chargeamt intvalue set check no check number public void set check no string check no if check no null check no length 20 log warning length 20 truncated check no check no substring 0 19 set value check no check no setcheckno checkno checkno checkno checkno checkno set_value checkno checkno get check no check number public string get check no return string get value check no getcheckno get_value checkno set exp month expiry month public void set credit card expmm int credit card expmm set value credit card expmm new integer credit card expmm setcreditcardexpmm creditcardexpmm set_value creditcardexpmm creditcardexpmm get exp month expiry month public int get credit card expmm integer ii integer get value credit card expmm if ii null return 0 return ii int value getcreditcardexpmm get_value creditcardexpmm intvalue set exp year expiry year public void set credit card expyy int credit card expyy set value credit card expyy new integer credit card expyy setcreditcardexpyy creditcardexpyy set_value creditcardexpyy creditcardexpyy get exp year expiry year public int get credit card expyy integer ii integer get value credit card expyy if ii null return 0 return ii int value getcreditcardexpyy get_value creditcardexpyy intvalue set number credit card number public void set credit card number string credit card number if credit card number null credit card number length 20 log warning length 20 truncated credit card number credit card number substring 0 19 set value credit card number credit card number setcreditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber set_value creditcardnumber creditcardnumber get number credit card number public string get credit card number return string get value credit card number getcreditcardnumber get_value creditcardnumber public static final string creditcardtype visa v set credit card credit card visa mc am ex public void set credit card type string credit card type if credit card type null throw new illegal argument exception credit card type is mandatory if credit card type null credit card type equals a credit card type equals c credit card type equals d credit card type equals m credit card type equals n credit card type equals p credit card type equals v else throw new illegal argument exception credit card type invalid value credit card type reference id 149 a c d m n p v if credit card type null credit card type length 1 log warning length 1 truncated credit card type credit card type substring 0 0 set value credit card type credit card type creditcardtype_visa amex setcreditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype reference_id creditcardtype creditcardtype creditcardtype creditcardtype set_value creditcardtype creditcardtype get credit card credit card visa mc am ex public string get credit card type return string get value credit card type amex getcreditcardtype get_value creditcardtype set verification code credit card verification code on credit card public void set credit cardvv string credit cardvv if credit cardvv null credit cardvv length 4 log warning length 4 truncated credit cardvv credit cardvv substring 0 3 set value credit cardvv credit cardvv setcreditcardvv creditcardvv creditcardvv creditcardvv creditcardvv creditcardvv set_value creditcardvv creditcardvv get verification code credit card verification code on credit card public string get credit cardvv return string get value credit cardvv getcreditcardvv get_value creditcardvv set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set value date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_value datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set discount amount calculated amount of discount public void set discount amt big decimal discount amt set value discount amt discount amt setdiscountamt bigdecimal discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set allocated indicates if the payment has been allocated public void set is allocated boolean is allocated set value is allocated new boolean is allocated setisallocated isallocated set_value isallocated isallocated get allocated indicates if the payment has been allocated public boolean is allocated object oo get value is allocated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallocated get_value isallocated booleanvalue set approved indicates if this document requires approval public void set is approved boolean is approved set valuenocheck is approved new boolean is approved setisapproved isapproved set_valuenocheck isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set delayed capture charge after shipment public void set is delayed capture boolean is delayed capture set value is delayed capture new boolean is delayed capture setisdelayedcapture isdelayedcapture set_value isdelayedcapture isdelayedcapture get delayed capture charge after shipment public boolean is delayed capture object oo get value is delayed capture if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdelayedcapture get_value isdelayedcapture booleanvalue set online access can be accessed online public void set is online boolean is online set value is online new boolean is online setisonline isonline set_value isonline isonline get online access can be accessed online public boolean is online object oo get value is online if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonline get_value isonline booleanvalue set over under payment over payment unallocated or under payment partial payment public void set is over under payment boolean is over under payment set value is over under payment new boolean is over under payment setisoverunderpayment isoverunderpayment set_value isoverunderpayment isoverunderpayment get over under payment over payment unallocated or under payment partial payment public boolean is over under payment object oo get value is over under payment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverunderpayment get_value isoverunderpayment booleanvalue set prepayment the payment receipt is a prepayment public void set is prepayment boolean is prepayment set value is prepayment new boolean is prepayment setisprepayment isprepayment set_value isprepayment isprepayment get prepayment the payment receipt is a prepayment public boolean is prepayment object oo get value is prepayment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprepayment get_value isprepayment booleanvalue set receipt this is a sales transaction receipt public void set is receipt boolean is receipt set value is receipt new boolean is receipt setisreceipt isreceipt set_value isreceipt isreceipt get receipt this is a sales transaction receipt public boolean is receipt object oo get value is receipt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreceipt get_value isreceipt booleanvalue set reconciled payment is reconciled with bank statement public void set is reconciled boolean is reconciled set value is reconciled new boolean is reconciled setisreconciled isreconciled set_value isreconciled isreconciled get reconciled payment is reconciled with bank statement public boolean is reconciled object oo get value is reconciled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreconciled get_value isreconciled booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set micr combination of routing no account and check no public void set micr string micr if micr null micr length 20 log warning length 20 truncated micr micr substring 0 19 set value micr micr setmicr set_value get micr combination of routing no account and check no public string get micr return string get value micr getmicr get_value set online processing this payment can be processed online public void seto processing string o processing if o processing null o processing length 1 log warning length 1 truncated o processing o processing substring 0 0 set value o processing o processing setoprocessing oprocessing oprocessing oprocessing oprocessing oprocessing set_value oprocessing oprocessing get online processing this payment can be processed online public string geto processing return string get value o processing getoprocessing get_value oprocessing set original transaction id original transaction id public void setorig trxid string orig trxid if orig trxid null orig trxid length 20 log warning length 20 truncated orig trxid orig trxid substring 0 19 set value orig trxid orig trxid setorig_trxid orig_trxid orig_trxid orig_trxid orig_trxid orig_trxid set_value orig_trxid orig_trxid get original transaction id original transaction id public string getorig trxid return string get value orig trxid getorig_trxid get_value orig_trxid set over under payment over payment unallocated or under payment partial payment amount public void set over under amt big decimal over under amt set value over under amt over under amt setoverunderamt bigdecimal overunderamt set_value overunderamt overunderamt get over under payment over payment unallocated or under payment partial payment amount public big decimal get over under amt big decimal bd big decimal get value over under amt if bd null return env zero return bd bigdecimal getoverunderamt bigdecimal bigdecimal get_value overunderamt set po number purchase order number public void setpo num string po num if po num null po num length 60 log warning length 60 truncated po num po num substring 0 59 set value po num po num setponum ponum ponum ponum ponum ponum set_value ponum ponum get po number purchase order number public string getpo num return string get value po num getponum get_value ponum set payment amount amount being paid public void set pay amt big decimal pay amt if pay amt null throw new illegal argument exception pay amt is mandatory set value pay amt pay amt setpayamt bigdecimal payamt payamt illegalargumentexception payamt set_value payamt payamt get payment amount amount being paid public big decimal get pay amt big decimal bd big decimal get value pay amt if bd null return env zero return bd bigdecimal getpayamt bigdecimal bigdecimal get_value payamt set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set authorization code authorization code returned public void setr authcode string r authcode if r authcode null r authcode length 20 log warning length 20 truncated r authcode r authcode substring 0 19 set valuenocheck r authcode r authcode setr_authcode r_authcode r_authcode r_authcode r_authcode r_authcode set_valuenocheck r_authcode r_authcode get authorization code authorization code returned public string getr authcode return string get value r authcode getr_authcode get_value r_authcode set authorization code dc authorization code delayed capture returned public void setr authcode dc string r authcode dc if r authcode dc null r authcode dc length 20 log warning length 20 truncated r authcode dc r authcode dc substring 0 19 set valuenocheck r authcode dc r authcode dc setr_authcode_dc r_authcode_dc r_authcode_dc r_authcode_dc r_authcode_dc r_authcode_dc set_valuenocheck r_authcode_dc r_authcode_dc get authorization code dc authorization code delayed capture returned public string getr authcode dc return string get value r authcode dc getr_authcode_dc get_value r_authcode_dc public static final string r avsaddr match y set address verified this address has been verified public void setr avsaddr string r avsaddr if r avsaddr null throw new illegal argument exception r avsaddr is mandatory if r avsaddr null r avsaddr equals n r avsaddr equals x r avsaddr equals y else throw new illegal argument exception r avsaddr invalid value r avsaddr reference id 213 n x y if r avsaddr null r avsaddr length 1 log warning length 1 truncated r avsaddr r avsaddr substring 0 0 set valuenocheck r avsaddr r avsaddr r_avsaddr_match setr_avsaddr r_avsaddr r_avsaddr illegalargumentexception r_avsaddr r_avsaddr r_avsaddr r_avsaddr r_avsaddr illegalargumentexception r_avsaddr r_avsaddr reference_id r_avsaddr r_avsaddr r_avsaddr r_avsaddr set_valuenocheck r_avsaddr r_avsaddr get address verified this address has been verified public string getr avsaddr return string get value r avsaddr getr_avsaddr get_value r_avsaddr public static final string r avszip match y set zip verified the zip code has been verified public void setr avszip string r avszip if r avszip null throw new illegal argument exception r avszip is mandatory if r avszip null r avszip equals n r avszip equals x r avszip equals y else throw new illegal argument exception r avszip invalid value r avszip reference id 213 n x y if r avszip null r avszip length 1 log warning length 1 truncated r avszip r avszip substring 0 0 set valuenocheck r avszip r avszip r_avszip_match setr_avszip r_avszip r_avszip illegalargumentexception r_avszip r_avszip r_avszip r_avszip r_avszip illegalargumentexception r_avszip r_avszip reference_id r_avszip r_avszip r_avszip r_avszip set_valuenocheck r_avszip r_avszip get zip verified the zip code has been verified public string getr avszip return string get value r avszip getr_avszip get_value r_avszip set cvv match credit card verification code match public void setr cvv2match boolean r cvv2match set valuenocheck r cvv2match new boolean r cvv2match setr_cvv2match r_cvv2match set_valuenocheck r_cvv2match r_cvv2match get cvv match credit card verification code match public boolean isr cvv2match object oo get value r cvv2match if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isr_cvv2match get_value r_cvv2match booleanvalue set info response info public void setr info string r info if r info null r info length 2000 log warning length 2000 truncated r info r info substring 0 1999 set valuenocheck r info r info setr_info r_info r_info r_info r_info r_info set_valuenocheck r_info r_info get info response info public string getr info return string get value r info getr_info get_value r_info set reference payment reference public void setr pnref string r pnref if r pnref null r pnref length 20 log warning length 20 truncated r pnref r pnref substring 0 19 set valuenocheck r pnref r pnref setr_pnref r_pnref r_pnref r_pnref r_pnref r_pnref set_valuenocheck r_pnref r_pnref get reference payment reference public string getr pnref return string get value r pnref getr_pnref get_value r_pnref set reference dc payment reference delayed capture public void setr pnref dc string r pnref dc if r pnref dc null r pnref dc length 20 log warning length 20 truncated r pnref dc r pnref dc substring 0 19 set valuenocheck r pnref dc r pnref dc setr_pnref_dc r_pnref_dc r_pnref_dc r_pnref_dc r_pnref_dc r_pnref_dc set_valuenocheck r_pnref_dc r_pnref_dc get reference dc payment reference delayed capture public string getr pnref dc return string get value r pnref dc getr_pnref_dc get_value r_pnref_dc set response message response message public void setr respmsg string r respmsg if r respmsg null r respmsg length 60 log warning length 60 truncated r respmsg r respmsg substring 0 59 set valuenocheck r respmsg r respmsg setr_respmsg r_respmsg r_respmsg r_respmsg r_respmsg r_respmsg set_valuenocheck r_respmsg r_respmsg get response message response message public string getr respmsg return string get value r respmsg getr_respmsg get_value r_respmsg set result result of transmission public void setr result string r result if r result null r result length 20 log warning length 20 truncated r result r result substring 0 19 set valuenocheck r result r result setr_result r_result r_result r_result r_result r_result set_valuenocheck r_result r_result get result result of transmission public string getr result return string get value r result getr_result get_value r_result public static final int ref payment id ad reference id 343 set referenced payment public void setref payment id int ref payment id if ref payment id 0 set valuenocheck ref payment id null else set valuenocheck ref payment id new integer ref payment id ref_payment_id_ad_reference_id setref_payment_id ref_payment_id ref_payment_id set_valuenocheck ref_payment_id set_valuenocheck ref_payment_id ref_payment_id get referenced payment public int getref payment id integer ii integer get value ref payment id if ii null return 0 return ii int value getref_payment_id get_value ref_payment_id intvalue set routing no bank routing number public void set routing no string routing no if routing no null routing no length 20 log warning length 20 truncated routing no routing no substring 0 19 set value routing no routing no setroutingno routingno routingno routingno routingno routingno set_value routingno routingno get routing no bank routing number public string get routing no return string get value routing no getroutingno get_value routingno set swipe track 1 and 2 of the credit card public void set swipe string swipe if swipe null swipe length 80 log warning length 80 truncated swipe swipe substring 0 79 set valuenocheck swipe swipe setswipe set_valuenocheck get swipe track 1 and 2 of the credit card public string get swipe return string get value swipe getswipe get_value set tax amount tax amount for a document public void set tax amt big decimal tax amt set value tax amt tax amt settaxamt bigdecimal taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt public static final string tendertype check k set tender type method of payment public void set tender type string tender type if tender type null throw new illegal argument exception tender type is mandatory if tender type equals a tender type equals c tender type equals d tender type equals k else throw new illegal argument exception tender type invalid value tender type reference id 214 a c d k if tender type length 1 log warning length 1 truncated tender type tender type substring 0 0 set value tender type tender type tendertype_check settendertype tendertype tendertype illegalargumentexception tendertype tendertype tendertype tendertype tendertype illegalargumentexception tendertype tendertype reference_id tendertype tendertype tendertype set_value tendertype tendertype get tender type method of payment public string get tender type return string get value tender type gettendertype get_value tendertype public static final string trxtype void v set transaction type type of credit card transaction public void set trx type string trx type if trx type null throw new illegal argument exception trx type is mandatory if trx type equals a trx type equals c trx type equals d trx type equals f trx type equals s trx type equals v else throw new illegal argument exception trx type invalid value trx type reference id 215 a c d f s v if trx type length 1 log warning length 1 truncated trx type trx type substring 0 0 set value trx type trx type trxtype_void settrxtype trxtype trxtype illegalargumentexception trxtype trxtype trxtype trxtype trxtype trxtype trxtype illegalargumentexception trxtype trxtype reference_id trxtype trxtype trxtype set_value trxtype trxtype get transaction type type of credit card transaction public string get trx type return string get value trx type gettrxtype get_value trxtype public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue set voice authorization code voice authorization code from credit card company public void set voice auth code string voice auth code if voice auth code null voice auth code length 20 log warning length 20 truncated voice auth code voice auth code substring 0 19 set value voice auth code voice auth code setvoiceauthcode voiceauthcode voiceauthcode voiceauthcode voiceauthcode voiceauthcode set_value voiceauthcode voiceauthcode get voice authorization code voice authorization code from credit card company public string get voice auth code return string get value voice auth code getvoiceauthcode get_value voiceauthcode set write off amount amount to write off public void set write off amt big decimal write off amt set value write off amt write off amt setwriteoffamt bigdecimal writeoffamt set_value writeoffamt writeoffamt get write off amount amount to write off public big decimal get write off amt big decimal bd big decimal get value write off amt if bd null return env zero return bd bigdecimal getwriteoffamt bigdecimal bigdecimal get_value writeoffamt stnadard constructor param ctx param s resourceassignment id public m resource assignment properties ctx int s resourceassignment id string trx name super ctx s resourceassignment id trx name p info set updateable true default table is not updateable default values if s resourceassignment id 0 set assign date from new timestamp system current time millis set qty new big decimal 1 0 set name set is confirmed false s_resourceassignment_id mresourceassignment s_resourceassignment_id trxname s_resourceassignment_id trxname p_info setupdateable s_resourceassignment_id setassigndatefrom currenttimemillis setqty bigdecimal setname setisconfirmed load contsructor param ctx context param rs result set public m resource assignment properties ctx result set rs string trx name super ctx rs trx name mresourceassignment resultset trxname trxname after save param new record new param success success return true protected boolean after save boolean new record boolean success v description new name if new description is not null and length new description 0 then v description v description new description end if update expense line update s timeexpenseline set description v description qty new qty where s resourceassignment id new s resourceassignment id and description v description or qty new qty update order line update c orderline set description v description qty ordered new qty where s resourceassignment id new s resourceassignment id and description v description or qty ordered new qty update invoice line update c invoiceline set description v description qty invoiced new qty where s resourceassignment id new s resourceassignment id and description v description or qty invoiced new qty return success newrecord aftersave newrecord v_description v_description v_description s_timeexpenseline v_description s_resourceassignment_id s_resourceassignment_id v_description c_orderline v_description qtyordered s_resourceassignment_id s_resourceassignment_id v_description qtyordered c_invoiceline v_description qtyinvoiced s_resourceassignment_id s_resourceassignment_id v_description qtyinvoiced string representation return string public string to string string buffer sb new string buffer m resource assignment id sb append get id append s resource id append gets resource id append from append get assign date from append to append get assign date to append qty append get qty append return sb to string tostring stringbuffer stringbuffer mresourceassignment get_id s_resource_id gets_resource_id getassigndatefrom getassigndateto getqty tostring before delete return true if not confirmed protected boolean before delete allow to delete when not confirmed if is confirmed return false return true beforedelete isconfirmed standard constructor public x fact acct properties ctx int fact acct id string trx name super ctx fact acct id trx name if fact acct id 0 setad table id 0 setaccount id 0 set amt acct cr env zero set amt acct dr env zero set amt source cr env zero set amt source dr env zero setc acctschema id 0 setc currency id 0 setc period id 0 set date acct new timestamp system current time millis set date trx new timestamp system current time millis setfact acct id 0 setgl category id 0 set posting type null setrecord id 0 x_fact_acct fact_acct_id trxname fact_acct_id trxname fact_acct_id setad_table_id setaccount_id setamtacctcr setamtacctdr setamtsourcecr setamtsourcedr setc_acctschema_id setc_currency_id setc_period_id setdateacct currenttimemillis setdatetrx currenttimemillis setfact_acct_id setgl_category_id setpostingtype setrecord_id load constructor public x fact acct properties ctx result set rs string trx name super ctx rs trx name x_fact_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x fact acct append get id append return sb to string tostring stringbuffer stringbuffer x_fact_acct get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set valuenocheck ad orgtrx id null else set valuenocheck ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_valuenocheck ad_orgtrx_id set_valuenocheck ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue public static final int account id ad reference id 132 set account account used public void setaccount id int account id if account id 1 throw new illegal argument exception account id is mandatory set valuenocheck account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id illegalargumentexception account_id set_valuenocheck account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr if amt acct cr null throw new illegal argument exception amt acct cr is mandatory set valuenocheck amt acct cr amt acct cr setamtacctcr bigdecimal amtacctcr amtacctcr illegalargumentexception amtacctcr set_valuenocheck amtacctcr amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr if amt acct dr null throw new illegal argument exception amt acct dr is mandatory set valuenocheck amt acct dr amt acct dr setamtacctdr bigdecimal amtacctdr amtacctdr illegalargumentexception amtacctdr set_valuenocheck amtacctdr amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set source credit source credit amount public void set amt source cr big decimal amt source cr if amt source cr null throw new illegal argument exception amt source cr is mandatory set valuenocheck amt source cr amt source cr setamtsourcecr bigdecimal amtsourcecr amtsourcecr illegalargumentexception amtsourcecr set_valuenocheck amtsourcecr amtsourcecr get source credit source credit amount public big decimal get amt source cr big decimal bd big decimal get value amt source cr if bd null return env zero return bd bigdecimal getamtsourcecr bigdecimal bigdecimal get_value amtsourcecr set source debit source debit amount public void set amt source dr big decimal amt source dr if amt source dr null throw new illegal argument exception amt source dr is mandatory set valuenocheck amt source dr amt source dr setamtsourcedr bigdecimal amtsourcedr amtsourcedr illegalargumentexception amtsourcedr set_valuenocheck amtsourcedr amtsourcedr get source debit source debit amount public big decimal get amt source dr big decimal bd big decimal get value amt source dr if bd null return env zero return bd bigdecimal getamtsourcedr bigdecimal bigdecimal get_value amtsourcedr set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set valuenocheck c activity id null else set valuenocheck c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_valuenocheck c_activity_id set_valuenocheck c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set valuenocheck c bpartner id null else set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_valuenocheck c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set valuenocheck c campaign id null else set valuenocheck c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_valuenocheck c_campaign_id set_valuenocheck c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set valuenocheck c locfrom id null else set valuenocheck c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_valuenocheck c_locfrom_id set_valuenocheck c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set valuenocheck c locto id null else set valuenocheck c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_valuenocheck c_locto_id set_valuenocheck c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue set project financial project public void setc project id int c project id if c project id 0 set valuenocheck c project id null else set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id set_valuenocheck c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set valuenocheck c salesregion id null else set valuenocheck c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_valuenocheck c_salesregion_id set_valuenocheck c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set sub account sub account for element value public void setc subacct id int c subacct id if c subacct id 0 set value c subacct id null else set value c subacct id new integer c subacct id setc_subacct_id c_subacct_id c_subacct_id set_value c_subacct_id set_value c_subacct_id c_subacct_id get sub account sub account for element value public int getc subacct id integer ii integer get value c subacct id if ii null return 0 return ii int value getc_subacct_id get_value c_subacct_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 0 set valuenocheck c tax id null else set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id set_valuenocheck c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set valuenocheck c uom id null else set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_valuenocheck c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set valuenocheck date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_valuenocheck dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set valuenocheck date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_valuenocheck datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set accounting fact public void setfact acct id int fact acct id if fact acct id 1 throw new illegal argument exception fact acct id is mandatory set valuenocheck fact acct id new integer fact acct id setfact_acct_id fact_acct_id fact_acct_id illegalargumentexception fact_acct_id set_valuenocheck fact_acct_id fact_acct_id get accounting fact public int getfact acct id integer ii integer get value fact acct id if ii null return 0 return ii int value getfact_acct_id get_value fact_acct_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getfact acct id intvalue keynamepair getkeynamepair keynamepair get_id valueof getfact_acct_id set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set valuenocheck gl budget id null else set valuenocheck gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_valuenocheck gl_budget_id set_valuenocheck gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set gl category general ledger category public void setgl category id int gl category id if gl category id 1 throw new illegal argument exception gl category id is mandatory set valuenocheck gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id illegalargumentexception gl_category_id set_valuenocheck gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set line id transaction line id internal public void setline id int line id if line id 0 set valuenocheck line id null else set valuenocheck line id new integer line id setline_id line_id line_id set_valuenocheck line_id set_valuenocheck line_id line_id get line id transaction line id internal public int getline id integer ii integer get value line id if ii null return 0 return ii int value getline_id get_value line_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set valuenocheck m locator id null else set valuenocheck m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_valuenocheck m_locator_id set_valuenocheck m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 0 set valuenocheck m product id null else set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id set_valuenocheck m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set valuenocheck posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype set_valuenocheck postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set quantity quantity public void set qty big decimal qty set valuenocheck qty qty setqty bigdecimal set_valuenocheck get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set valuenocheck user1 id null else set valuenocheck user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_valuenocheck user1_id set_valuenocheck user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set valuenocheck user2 id null else set valuenocheck user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_valuenocheck user2_id set_valuenocheck user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue set user element 1 user defined accounting element public void setuserelement1 id int userelement1 id if userelement1 id 0 set valuenocheck userelement1 id null else set valuenocheck userelement1 id new integer userelement1 id setuserelement1_id userelement1_id userelement1_id set_valuenocheck userelement1_id set_valuenocheck userelement1_id userelement1_id get user element 1 user defined accounting element public int getuserelement1 id integer ii integer get value userelement1 id if ii null return 0 return ii int value getuserelement1_id get_value userelement1_id intvalue set user element 2 user defined accounting element public void setuserelement2 id int userelement2 id if userelement2 id 0 set valuenocheck userelement2 id null else set valuenocheck userelement2 id new integer userelement2 id setuserelement2_id userelement2_id userelement2_id set_valuenocheck userelement2_id set_valuenocheck userelement2_id userelement2_id get user element 2 user defined accounting element public int getuserelement2 id integer ii integer get value userelement2 id if ii null return 0 return ii int value getuserelement2_id get_value userelement2_id intvalue set to one line param var y or something else public void set one line string var m oneline y equals var setoneline m_oneline start tag return skip body throws jsp exception public int do start tag throws jsp exception http servlet request request http servlet request page context get request properties ctx jsp env get ctx request creates wsc wu web session ctx wsc web session ctx get request http session session page context get session web user wu web user session get attribute web user name if wu null wu is logged in if ctx null info info info session get attribute info name if info null wu getad user id info getad user id session set attribute info name new info ctx wu log fine web user exists wu jsp writer out page context get out html code html new html code if wu is customer menu customer html wsc wstore if wu is sales rep menu sales rep html wsc wstore if wu is employee wu is sales rep menu user html wu is employee wsc wstore menu all html wsc wstore html output out else if c log mgt is level finer log fine no web user if session get attribute info name null session set attribute info name info get general return skip body skip_body jspexception dostarttag jspexception httpservletrequest httpservletrequest pagecontext getrequest jspenv getctx websessionctx websessionctx httpsession pagecontext getsession webuser webuser getattribute webuser isloggedin getattribute getad_user_id getad_user_id setattribute webuser jspwriter pagecontext getout htmlcode htmlcode iscustomer menucustomer issalesrep menusalesrep isemployee issalesrep menuuser isemployee menuall clogmgt islevelfiner webuser getattribute setattribute getgeneral skip_body add customer links param html code private void menu customer html code html m store wstore boolean first true if wstore is menu assets nl html first assets first false a a new a assets jsp a set class menu sub a add element my assets html add element a if wstore is menu invoices nl html first invoices first false a a new a invoices jsp a set class menu sub a add element my invoices html add element a if wstore is menu payments nl html first payments first false a a new a payments jsp a set class menu sub a add element my payments html add element a if wstore is menu orders nl html first orders first false a a new a orders jsp a set class menu sub a add element my orders html add element a if wstore is menu shipments nl html first shipments first false a a new a shipments jsp a set class menu sub a add element my shipments html add element a if wstore is menu rf qs nl html first rf qs first false a a new a rfqs jsp a set class menu sub a add element my rf qs html add element a menucustomer htmlcode mstore ismenuassets setclass menusub addelement addelement ismenuinvoices setclass menusub addelement addelement ismenupayments setclass menusub addelement addelement ismenuorders setclass menusub addelement addelement ismenushipments setclass menusub addelement addelement ismenurfqs rfqs setclass menusub addelement rfqs addelement add links for all param html code private void menu all html code html m store wstore if wstore is menu requests nl html true requests a a new a requests jsp a set class menu main a add element my requests html add element a if wstore is menu interests nl html true interest area a a new a info jsp a set class menu sub a add element interest area html add element a if wstore is menu registrations nl html false registration a a new a registrations jsp a set class menu sub a add element registration html add element a menuall htmlcode mstore ismenurequests setclass menumain addelement addelement ismenuinterests setclass menusub addelement addelement ismenuregistrations setclass menusub addelement addelement add links for sales reps param html code private void menu sales rep html code html m store wstore nl html true assigned requests a a new a requests sr jsp a set class menu sub a add element open requests html add element a nl html false advertisements a new a advertisements jsp a set class menu sub a add element advertisements html add element a nl html false commissions a new a commission runs jsp a set class menu sub a add element commissions html add element a c invoices a new a commissioned invoices jsp a set class menu detail a add element c invoices html add element a nl html false menusalesrep htmlcode mstore requests_sr setclass menusub addelement addelement setclass menusub addelement addelement commissionruns setclass menusub addelement addelement commissionedinvoices setclass menudetail addelement addelement add links for users param html code param is employee employee private void menu user html code html boolean is employee m store wstore nl html true notices if is employee a a new a notes jsp a set class menu main a add element notices html add element a nl html false expense a a new a expenses jsp a set class menu sub a add element expenses html add element a isemployee menuuser htmlcode isemployee mstore isemployee setclass menumain addelement addelement setclass menusub addelement addelement add new line break param html code param hr insert hr rather br private void nl html code html boolean hr if m oneline html add element nbsp else if hr html add element new hr 90 left else html add element new br htmlcode m_oneline addelement addelement addelement end tag return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page standard constructor param ctx context param ad printgraph id graph id param trx name trx public m print graph properties ctx int ad printgraph id string trx name super ctx ad printgraph id trx name ad_printgraph_id trxname mprintgraph ad_printgraph_id trxname ad_printgraph_id trxname load constructor param ctx context param rs result set param trx name trx public m print graph properties ctx result set rs string trx name super ctx rs trx name trxname mprintgraph resultset trxname trxname standard constructor public x c acctprocessor properties ctx int c acctprocessor id string trx name super ctx c acctprocessor id trx name if c acctprocessor id 0 setc acctprocessor id 0 set frequency 0 set frequency type null set keep log days 0 7 set name null setsupervisor id 0 x_c_acctprocessor c_acctprocessor_id trxname c_acctprocessor_id trxname c_acctprocessor_id setc_acctprocessor_id setfrequency setfrequencytype setkeeplogdays setname setsupervisor_id load constructor public x c acctprocessor properties ctx result set rs string trx name super ctx rs trx name x_c_acctprocessor resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctprocessor append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctprocessor get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set accounting processor accounting processor server parameters public void setc acctprocessor id int c acctprocessor id if c acctprocessor id 1 throw new illegal argument exception c acctprocessor id is mandatory set valuenocheck c acctprocessor id new integer c acctprocessor id setc_acctprocessor_id c_acctprocessor_id c_acctprocessor_id illegalargumentexception c_acctprocessor_id set_valuenocheck c_acctprocessor_id c_acctprocessor_id get accounting processor accounting processor server parameters public int getc acctprocessor id integer ii integer get value c acctprocessor id if ii null return 0 return ii int value getc_acctprocessor_id get_value c_acctprocessor_id intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 0 set value c acctschema id null else set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id set_value c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run set value date next run date next run setdatenextrun datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int supervisor id ad reference id 286 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 1 throw new illegal argument exception supervisor id is mandatory set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id illegalargumentexception supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue standard constructor public x c taxpostal properties ctx int c taxpostal id string trx name super ctx c taxpostal id trx name if c taxpostal id 0 setc taxpostal id 0 setc tax id 0 set postal null x_c_taxpostal c_taxpostal_id trxname c_taxpostal_id trxname c_taxpostal_id setc_taxpostal_id setc_tax_id setpostal load constructor public x c taxpostal properties ctx result set rs string trx name super ctx rs trx name x_c_taxpostal resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c taxpostal append get id append return sb to string tostring stringbuffer stringbuffer x_c_taxpostal get_id tostring set tax zip tax postal zip public void setc taxpostal id int c taxpostal id if c taxpostal id 1 throw new illegal argument exception c taxpostal id is mandatory set valuenocheck c taxpostal id new integer c taxpostal id setc_taxpostal_id c_taxpostal_id c_taxpostal_id illegalargumentexception c_taxpostal_id set_valuenocheck c_taxpostal_id c_taxpostal_id get tax zip tax postal zip public int getc taxpostal id integer ii integer get value c taxpostal id if ii null return 0 return ii int value getc_taxpostal_id get_value c_taxpostal_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set zip postal code public void set postal string postal if postal null throw new illegal argument exception postal is mandatory if postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal illegalargumentexception set_value get zip postal code public string get postal return string get value postal getpostal get_value return string get value postal public key name pair get key name pair return new key name pair get id get postal get_value keynamepair getkeynamepair keynamepair get_id getpostal set zip to postal code to public void setpostal to string postal to if postal to null postal to length 10 log warning length 10 truncated postal to postal to substring 0 9 set value postal to postal to setpostal_to postal_to postal_to postal_to postal_to postal_to set_value postal_to postal_to get zip to postal code to public string getpostal to return string get value postal to getpostal_to get_value postal_to standard constructor param ctx context param c withholding id id public m withholding properties ctx int c withholding id string trx name super ctx c withholding id trx name c_withholding_id mwithholding c_withholding_id trxname c_withholding_id trxname load constructor param ctx context param rs result set public m withholding properties ctx result set rs string trx name super ctx rs trx name mwithholding resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting c withholding acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_withholding_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c withholding acct beforedelete delete_accounting c_withholding_acct basic constructor public em basic constructor param element adds an element to the element public em element element add element element addelement basic constructor param element adds an element to the element public em string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public em add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public em add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public em add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public em add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public em remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x ad note properties ctx int ad note id string trx name super ctx ad note id trx name if ad note id 0 setad message id 0 setad note id 0 x_ad_note ad_note_id trxname ad_note_id trxname ad_note_id setad_message_id setad_note_id load constructor public x ad note properties ctx result set rs string trx name super ctx rs trx name x_ad_note resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad note append get id append return sb to string tostring stringbuffer stringbuffer x_ad_note get_id tostring public static final int ad message id ad reference id 102 set message system message public void setad message id int ad message id if ad message id 1 throw new illegal argument exception ad message id is mandatory set valuenocheck ad message id new integer ad message id ad_message_id_ad_reference_id setad_message_id ad_message_id ad_message_id illegalargumentexception ad_message_id set_valuenocheck ad_message_id ad_message_id get message system message public int getad message id integer ii integer get value ad message id if ii null return 0 return ii int value getad_message_id get_value ad_message_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad message id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_message_id set notice system notice public void setad note id int ad note id if ad note id 1 throw new illegal argument exception ad note id is mandatory set valuenocheck ad note id new integer ad note id setad_note_id ad_note_id ad_note_id illegalargumentexception ad_note_id set_valuenocheck ad_note_id ad_note_id get notice system notice public int getad note id integer ii integer get value ad note id if ii null return 0 return ii int value getad_note_id get_value ad_note_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set valuenocheck ad table id null else set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_valuenocheck ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set workflow activity workflow activity public void setad wf activity id int ad wf activity id if ad wf activity id 0 set value ad wf activity id null else set value ad wf activity id new integer ad wf activity id setad_wf_activity_id ad_wf_activity_id ad_wf_activity_id set_value ad_wf_activity_id set_value ad_wf_activity_id ad_wf_activity_id get workflow activity workflow activity public int getad wf activity id integer ii integer get value ad wf activity id if ii null return 0 return ii int value getad_wf_activity_id get_value ad_wf_activity_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 set valuenocheck record id null else set valuenocheck record id new integer record id setrecord_id record_id record_id set_valuenocheck record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg standard constructor public x m relatedproduct properties ctx int m relatedproduct id string trx name super ctx m relatedproduct id trx name if m relatedproduct id 0 setm product id 0 set name null set related product type null setrelatedproduct id 0 x_m_relatedproduct m_relatedproduct_id trxname m_relatedproduct_id trxname m_relatedproduct_id setm_product_id setname setrelatedproducttype setrelatedproduct_id load constructor public x m relatedproduct properties ctx result set rs string trx name super ctx rs trx name x_m_relatedproduct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m relatedproduct append get id append return sb to string tostring stringbuffer stringbuffer x_m_relatedproduct get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value public static final string relatedproducttype supplemental s set related product type public void set related product type string related product type if related product type null throw new illegal argument exception related product type is mandatory if related product type equals a related product type equals p related product type equals s else throw new illegal argument exception related product type invalid value related product type reference id 313 a p s if related product type length 1 log warning length 1 truncated related product type related product type substring 0 0 set value related product type related product type relatedproducttype_supplemental setrelatedproducttype relatedproducttype relatedproducttype illegalargumentexception relatedproducttype relatedproducttype relatedproducttype relatedproducttype illegalargumentexception relatedproducttype relatedproducttype reference_id relatedproducttype relatedproducttype relatedproducttype set_value relatedproducttype relatedproducttype get related product type public string get related product type return string get value related product type getrelatedproducttype get_value relatedproducttype public static final int relatedproduct id ad reference id 162 set related product related product public void setrelatedproduct id int relatedproduct id if relatedproduct id 1 throw new illegal argument exception relatedproduct id is mandatory set valuenocheck relatedproduct id new integer relatedproduct id relatedproduct_id_ad_reference_id setrelatedproduct_id relatedproduct_id relatedproduct_id illegalargumentexception relatedproduct_id set_valuenocheck relatedproduct_id relatedproduct_id get related product related product public int getrelatedproduct id integer ii integer get value relatedproduct id if ii null return 0 return ii int value getrelatedproduct_id get_value relatedproduct_id intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals entity type p entitytype string para i get parameter else if name equals all tables p alltables y equals para i get parameter else log log level severe unknown parameter name p ad table id getrecord id processinfoparameter getparameter getparametername getparameter entitytype p_entitytype getparameter alltables p_alltables getparameter p_ad_table_id getrecord_id process return info throws exception protected string do it throws exception if p ad table id 0 throw new compiere system error not found ad table id p ad table id log info entity type p entitytype all tables p alltables ad table id p ad table id connection conn db get connectionro compiere database db db get database database meta data md conn get meta data string catalog db get catalog string schema db get schema if p alltables add table md catalog schema else m table table new m table get ctx p ad table id get trxname if table null table get id 0 throw new compiere system error not found ad table id p ad table id log info table get table name entity type p entitytype string table name table get table name if db is oracle table name table name to upper case globalqss 2005 10 24 if db is postgresql table name table name to lower case end globalqss 2005 10 24 result set rs md get columns catalog schema table name null add table column rs table return m count doit p_ad_table_id compieresystemerror notfound ad_table_id p_ad_table_id entitytype p_entitytype alltables p_alltables ad_table_id p_ad_table_id getconnectionro compieredatabase getdatabase databasemetadata getmetadata getcatalog getschema p_alltables addtable m_table m_table getctx p_ad_table_id get_trxname get_id compieresystemerror notfound ad_table_id p_ad_table_id gettablename entitytype p_entitytype tablename gettablename isoracle tablename tablename touppercase ispostgresql tablename tablename tolowercase resultset getcolumns tablename addtablecolumn m_count add table param md meta data param catalog catalog param schema schema throws exception private void add table database meta data md string catalog string schema throws exception globalqss 2005 10 25 result set rs md get tables catalog schema null null result set rs if db is postgresql rs md get tables catalog schema null new string table view else rs md get tables catalog schema null null end globalqss 2005 10 25 while rs next string table name rs get string table name string table type rs get string table type try to find m table table m table get get ctx table name create new if table null string tn table name to upper case if tn starts with t selection temp table tn ends with vt print trl views tn ends with v views tn ends with v1 views tn starts with a a asset tables not yet tn starts with a d asset tables not yet tn index of 1 oracle system tables tn index of explain 1 explain plan log fine ignored table name table type continue log info table name table type create new table new m table get ctx 0 get trxname table set entity type p entitytype table set name table name table set table name table name table set is view view equals table type if table save continue check columns if db is oracle table name table name to upper case globalqss 2005 10 24 if db is postgresql table name table name to lower case end globalqss 2005 10 24 result set rsc md get columns catalog schema table name null add table column rsc table addtable databasemetadata resultset gettables resultset ispostgresql gettables gettables tablename getstring table_name tabletype getstring table_type m_table m_table getctx tablename tablename touppercase startswith t_selection endswith _vt endswith _v endswith _v1 startswith a_a startswith a_d indexof indexof tablename tabletype tablename tabletype m_table getctx get_trxname setentitytype p_entitytype setname tablename settablename tablename setisview tabletype isoracle tablename tablename touppercase ispostgresql tablename tablename tolowercase resultset getcolumns tablename addtablecolumn add table column param rs result set with meta data param table table throws exception private void add table column result set rs m table table throws exception string table name table get table name if db is oracle table name table name to upper case globalqss 2005 10 24 if db is postgresql table name table name to lower case end globalqss 2005 10 24 while rs next string tn rs get string table name if table name equals ignore case tn continue string column name rs get string column name m column column table get column column name if column null continue int data type rs get int data type string type name rs get string type name string nullable rs get string is nullable int size rs get int column size int digits rs get int decimal digits log config column name data type data type type name nullable nullable size size digits digits column new m column table column set entity type p entitytype m element element m element get get ctx column name if element null element new m element get ctx column name p entitytype get trxname element save column set column name element get column name column set name element get name column set description element get description column set help element get help column setad element id element getad element id column set is mandatory no equals nullable key if column name equals ignore case table name id column set is key true column setad reference id display type id column set is updateable false account else if column name to upper case index of acct 1 size 10 column setad reference id display type account account else if column name equals ignore case c location id column setad reference id display type location product attribute else if column name equals ignore case m attributesetinstance id column setad reference id display type p attribute salesrep id user else if column name equals ignore case salesrep id column setad reference id display type table column setad reference value id 190 id else if column name ends with id column setad reference id display type table dir date else if data type types date data type types time data type types timestamp column name to upper case index of date 1 column name equals ignore case created column name equals ignore case updated column setad reference id display type date time created by updated by user else if column name equals ignore case created by column name equals ignore case updated by column setad reference id display type table column setad reference value id 110 column set is updateable false clob else if data type types clob column setad reference id display type text long blob else if data type types blob column setad reference id display type binary amount else if column name to upper case index of amt 1 column setad reference id display type amount qty else if column name to upper case index of qty 1 column setad reference id display type quantity boolean else if size 1 column name to upper case starts with is data type types char column setad reference id display type yes no list else if size 4 data type types char column setad reference id display type list name document no else if column name equals ignore case name column name equals document no column setad reference id display type string column set is identifier true column set seq no 1 string text else if data type types char data type types varchar type name starts with nvar type name starts with nchar if type name starts with n multi byte size 2 if size 255 column setad reference id display type text else column setad reference id display type string number else if data type types integer data type types smallint data type types decimal data type types numeric if size 10 column setad reference id display type integer else column setad reference id display type number else column setad reference id display type string column set field length size if column is updateable table is view column name equals ignore case ad client id column name equals ignore case ad org id column name to upper case starts with created column name to upper case equals updated column set is updateable false done if column save add log 0 null null table get table name column get column name m count while columns addtablecolumn resultset m_table tablename gettablename isoracle tablename tablename touppercase ispostgresql tablename tablename tolowercase getstring table_name tablename equalsignorecase columnname getstring column_name m_column getcolumn columnname datatype getint data_type typename getstring type_name getstring is_nullable getint column_size getint decimal_digits columnname datatype datatype typename m_column setentitytype p_entitytype m_element m_element getctx columnname m_element getctx columnname p_entitytype get_trxname setcolumnname getcolumnname setname getname setdescription getdescription sethelp gethelp setad_element_id getad_element_id setismandatory columnname equalsignorecase tablename _id setiskey setad_reference_id displaytype setisupdateable columnname touppercase indexof setad_reference_id displaytype columnname equalsignorecase c_location_id setad_reference_id displaytype columnname equalsignorecase m_attributesetinstance_id setad_reference_id displaytype pattribute salesrep_id columnname equalsignorecase salesrep_id setad_reference_id displaytype setad_reference_value_id columnname endswith _id setad_reference_id displaytype tabledir datatype datatype datatype columnname touppercase indexof columnname equalsignorecase columnname equalsignorecase setad_reference_id displaytype datetime createdby updatedby columnname equalsignorecase createdby columnname equalsignorecase updatedby setad_reference_id displaytype setad_reference_value_id setisupdateable datatype setad_reference_id displaytype textlong datatype setad_reference_id displaytype columnname touppercase indexof setad_reference_id displaytype columnname touppercase indexof setad_reference_id displaytype columnname touppercase startswith datatype setad_reference_id displaytype yesno datatype setad_reference_id displaytype documentno columnname equalsignorecase columnname documentno setad_reference_id displaytype setisidentifier setseqno datatype datatype typename startswith typename startswith typename startswith multibyte setad_reference_id displaytype setad_reference_id displaytype datatype datatype datatype datatype setad_reference_id displaytype setad_reference_id displaytype setad_reference_id displaytype setfieldlength isupdateable isview columnname equalsignorecase ad_client_id columnname equalsignorecase ad_org_id columnname touppercase startswith columnname touppercase setisupdateable addlog gettablename getcolumnname m_count standard constructor param ctx context public header footer properties ctx m ctx ctx headerfooter m_ctx add print element to page param element print element public void add element print element element if element null m elements add element m pe null addelement printelement m_elements m_pe get elements return array of elements public print element get elements if m pe null m pe new print element m elements size m elements to array m pe return m pe printelement getelements m_pe m_pe printelement m_elements m_elements toarray m_pe m_pe paint page header footer on graphics in bounds param g2d graphics param bounds page bounds param is view true if online view i ds are links public void paint graphics2d g2d rectangle bounds boolean is view point page start new point bounds get location get elements for int i 0 i m pe length i m pe i paint g2d 0 page start m ctx is view isview ids isview pagestart getlocation getelements m_pe m_pe pagestart m_ctx isview get drill down value param relative point relative point return if found name pait or null public m query get drill down point relative point m query ret value null for int i 0 i m elements size ret value null i print element element print element m elements get i ret value element get drill down relative point 1 return ret value drilldown relativepoint namepait mquery getdrilldown relativepoint mquery retvalue m_elements retvalue printelement printelement m_elements retvalue getdrilldown relativepoint retvalue get create web session context param request request return ctx or null public static web session ctx get http servlet request request http session session request get session false if session null session request get session true if session null return null web session ctx wsc web session ctx session get attribute name create new if wsc null wsc new web session ctx request session set attribute name wsc return wsc websessionctx httpservletrequest httpsession getsession getsession websessionctx websessionctx getattribute websessionctx setattribute web session context param request request private web session ctx http servlet request request log info request get context path request get remote addr request get locale counter ctx new properties set language request http session session request get session false add servlet init parameters web store src web web inf web xml servlet context sc session get servlet context enumeration en sc get init parameter names while en has more elements string key string en next element string value sc get init parameter key ctx set property key value log config key value setw store request get context path ctx get defaults server context dev2 wstore ctx put ctx server context request get server name request get context path make context directly availabe to jsp s session set attribute ctx ctx log fine ctx size websessionctx httpservletrequest getcontextpath getremoteaddr getlocale setlanguage httpsession getsession webstore servletcontext getservletcontext getinitparameternames hasmoreelements nextelement getinitparameter setproperty setwstore getcontextpath getdefaults servercontext ctx_server_context getservername getcontextpath setattribute set web store param context path web server context path private void setw store string context path get from context int w store id env get context as int ctx w store id if w store id 0 wstore m store get ctx w store id if wstore getw store id 0 log info from web xml wstore return if adempiere equals context path html ui return wstore m store get ctx context path if wstore null throw new illegal state exception no web store found context path contextpath setwstore contextpath w_store_id getcontextasint w_store_id w_store_id mstore w_store_id getw_store_id contextpath mstore contextpath illegalstateexception contextpath get web store defaults return context private properties get defaults no web store if wstore null return new properties integer key new integer wstore getw store id properties new ctx properties s cachectx get key create new context if new ctx null log info wstore get web context new ctx new properties copy explicitly enumeration e ctx keys while e has more elements string p key string e next element new ctx set property p key ctx get property p key env set context new ctx ad client id wstore getad client id env set context new ctx ad org id wstore getad org id env set context new ctx salesrep id wstore getsalesrep id env set context new ctx m pricelist id wstore getm pricelist id env set context new ctx m warehouse id wstore getm warehouse id string s wstore get web param1 env set context new ctx web param1 s null s s wstore get web param2 env set context new ctx web param2 s null s s wstore get web param3 env set context new ctx web param3 s null s s wstore get web param4 env set context new ctx web param4 s null s s wstore get web param5 env set context new ctx web param5 s null s s wstore get web param6 env set context new ctx web param6 s null s s wstore get web info if s null s length 0 env set context new ctx hdr info s payment term env set context new ctx m pricelist id wstore getm pricelist id default user sales rep if env get context as int new ctx ad user id 0 env set context new ctx ad user id wstore getsalesrep id default role for access if env get context as int new ctx ad role id 0 int ad role id 0 hardcoded system env set context new ctx ad role id ad role id client m client client m client get new ctx wstore getad client id name description smtp host requeste mail request user request user pw env set context new ctx name client get name env set context new ctx description client get description ad language if new ctx get property ad language null client getad language null env set context new ctx ad language client getad language document dir string doc dir client get document dir env set context new ctx ctx document dir doc dir null doc dir default language if new ctx get property ad language null env set context new ctx ad language en us save context key is ad client id s cachectx put key new ctx return new properties pp seems not to work with jsp enumeration e new ctx keys while e has more elements string p key string e next element ctx set property p key new ctx get property p key return ctx getdefaults getw_store_id newctx s_cachectx newctx getwebcontext newctx hasmoreelements pkey nextelement newctx setproperty pkey getproperty pkey setcontext newctx ad_client_id getad_client_id setcontext newctx ad_org_id getad_org_id setcontext newctx salesrep_id getsalesrep_id setcontext newctx m_pricelist_id getm_pricelist_id setcontext newctx m_warehouse_id getm_warehouse_id getwebparam1 setcontext newctx webparam1 getwebparam2 setcontext newctx webparam2 getwebparam3 setcontext newctx webparam3 getwebparam4 setcontext newctx webparam4 getwebparam5 setcontext newctx webparam5 getwebparam6 setcontext newctx webparam6 getwebinfo setcontext newctx hdr_info setcontext newctx m_pricelist_id getm_pricelist_id salesrep getcontextasint newctx ad_user_id setcontext newctx ad_user_id getsalesrep_id getcontextasint newctx ad_role_id ad_role_id setcontext newctx ad_role_id ad_role_id mclient mclient newctx getad_client_id smtphost requestemail requestuser requestuserpw setcontext newctx getname setcontext newctx getdescription ad_language newctx getproperty ad_language getad_language setcontext newctx ad_language getad_language documentdir docdir getdocumentdir setcontext newctx ctx_document_dir docdir docdir newctx getproperty ad_language setcontext newctx ad_language en_us ad_client_id s_cachectx newctx newctx hasmoreelements pkey nextelement setproperty pkey newctx getproperty pkey set language from request or session in properties cookie session param request request private void set language http servlet request request get cookie properties c prop web util get cookie proprties request get set parameter language string ad language web util get parameter request env language if ad language null check cookie ad language c prop get property env language if ad language null check request locale locale locale request get locale ad language language getad language locale if ad language null language lang language get language ad language env verify language ctx lang env set context ctx env language lang getad language msg get msg ctx 0 c prop set property env language lang getad language set language lang else if language null set base language set language language get base language setlanguage httpservletrequest cprop webutil getcookieproprties ad_language webutil getparameter ad_language ad_language cprop getproperty ad_language getlocale ad_language getad_language ad_language getlanguage ad_language verifylanguage setcontext getad_language getmsg cprop setproperty getad_language setlanguage setlanguage getbaselanguage set language and init formats param lang language private void set language language lang language lang date format display type get date format display type date language date time format display type get date format display type date time language amount format display type get number format display type amount language integer format display type get number format display type integer language number format display type get number format display type number language quantity format display type get number format display type quantity language setlanguage dateformat displaytype getdateformat displaytype datetimeformat displaytype getdateformat displaytype datetime amountformat displaytype getnumberformat displaytype integerformat displaytype getnumberformat displaytype numberformat displaytype getnumberformat displaytype quantityformat displaytype getnumberformat displaytype finalize throws java lang throwable protected void finalize throws throwable super finalize string representation return session count public string to string return w session ctx counter tostring wsessionctx construct model tree node param node id node param seq no sequence param name name param description description param parent id parent param is summary summary param image indicator image indicator param on bar on bar public m tree node int node id int seq no string name string description int parent id boolean is summary string image indicator boolean on bar color color super log fine m tree node node id node id parent id parent id name m node id node id m seqno seq no m name name m description description if m description null m description m parent id parent id set summary is summary set image indicator image indicator m onbar on bar m color color treenode node_id seqno parent_id issummary imageindicator onbar mtreenode node_id seqno parent_id issummary imageindicator onbar mtreenode node_id node_id parent_id parent_id m_node_id node_id m_seqno seqno m_name m_description m_description m_description m_parent_id parent_id setsummary issummary setimageindicator imageindicator m_onbar onbar m_color get node id return node id e g ad menu id public int getnode id return m node id ad_menu_id getnode_id m_node_id set name param name name public void set name string name if name null m name else m name name setname m_name m_name get name return name public string get name return m name getname m_name get seq no index as formatted string 0000 for sorting return seq no as string public string get seq no string ret value 0000 m seqno not more than 100 000 nodes if m seqno 99999 log log level severe m tree node get index tree node index is higher than 99999 if ret value length 5 ret value ret value substring ret value length 5 last 5 return ret value seqno seqno getseqno retvalue m_seqno m_seqno mtreenode getindex treenode retvalue retvalue retvalue retvalue retvalue return parent return parent id e g ad menu id public int getparent id return m parent id parent_id ad_menu_id getparent_id m_parent_id print name return info public string to string return m node id m parent id m seqno m name tostring m_node_id m_parent_id m_seqno m_name get description return description public string get description return m description getdescription m_description set summary allow children param is summary summary node public void set summary boolean is summary m issummary is summary super set allows children is summary issummary setsummary issummary m_issummary issummary setallowschildren issummary set summary allow children param is summary true if summary public void set allows children boolean is summary super set allows children is summary m issummary is summary issummary setallowschildren issummary setallowschildren issummary m_issummary issummary allow children to be added to this node return true if summary node public boolean is summary return m issummary issummary m_issummary get image indicator index param image indicator image indicator w x r p f t b mwf node action return index of image public static int get image index string image indicator int image index 0 if image indicator null else if image indicator equals mwf node action userwindow window image indicator equals mwf node action userform image index type window else if image indicator equals mwf node action appsreport report image index type report else if image indicator equals mwf node action appsprocess process image indicator equals mwf node action appstask image index type process else if image indicator equals mwf node action subworkflow work flow image index type workflow else if image indicator equals mwf node action userworkbench workbench image index type workbench else if image indicator equals mwf node action setvariable set variable image index type setvariable else if image indicator equals mwf node action userchoice user choice image index type userchoice else if image indicator equals mwf node action documentaction document action image index type docaction else if image indicator equals mwf node action waitsleep sleep return image index imageindicator mwfnode action_ getimageindex imageindicator imageindex imageindicator imageindicator mwfnode action_userwindow imageindicator mwfnode action_userform imageindex type_window imageindicator mwfnode action_appsreport imageindex type_report imageindicator mwfnode action_appsprocess imageindicator mwfnode action_appstask imageindex type_process imageindicator mwfnode action_subworkflow workflow imageindex type_workflow imageindicator mwfnode action_userworkbench imageindex type_workbench imageindicator mwfnode action_setvariable imageindex type_setvariable imageindicator mwfnode action_userchoice imageindex type_userchoice imageindicator mwfnode action_documentaction imageindex type_docaction imageindicator mwfnode action_waitsleep imageindex set image indicator and index param image indicator image indicator w x r p f t b mwf node action public void set image indicator string image indicator if image indicator null m imageindicator image indicator m imageindex get image index m imageindicator imageindicator mwfnode action_ setimageindicator imageindicator imageindicator m_imageindicator imageindicator m_imageindex getimageindex m_imageindicator get image indicator return image indicator public string get image indiactor return m imageindicator getimageindiactor m_imageindicator get image icon param index image index return icon public static icon get icon int index if index 0 images null index images length return null return images index geticon get image icon return icon public icon get icon return get icon m imageindex geticon geticon m_imageindex get shortcut bar info return true if node on bar public boolean is on bar return m onbar isonbar m_onbar is process return true if process public boolean is process return x ad menu action process equals m imageindicator isprocess x_ad_menu action_process m_imageindicator is report return true if report public boolean is report return x ad menu action report equals m imageindicator isreport x_ad_menu action_report m_imageindicator is window return true if window public boolean is window return x ad menu action window equals m imageindicator iswindow x_ad_menu action_window m_imageindicator is workbench return true if workbench public boolean is workbench return x ad menu action workbench equals m imageindicator isworkbench x_ad_menu action_workbench m_imageindicator is workflow return true if workflow public boolean is work flow return x ad menu action workflow equals m imageindicator isworkflow x_ad_menu action_workflow m_imageindicator is form return true if form public boolean is form return x ad menu action form equals m imageindicator isform x_ad_menu action_form m_imageindicator is task return true if task public boolean is task return x ad menu action task equals m imageindicator istask x_ad_menu action_task m_imageindicator get color return color or black if not set public color get color if m color null return m color return color black getcolor m_color m_color return the node with id in list of children param id id return v tree node with id or null public m tree node find node int id if m node id id return this if id m lastid m lastnode null return m lastnode enumeration en preorder enumeration while en has more elements m tree node nd m tree node en next element if id nd getnode id m lastid id m lastnode nd return nd return null vtreenode mtreenode findnode m_node_id m_lastid m_lastnode m_lastnode preorderenumeration hasmoreelements mtreenode mtreenode nextelement getnode_id m_lastid m_lastnode standard constructor public x pa hierarchy properties ctx int pa hierarchy id string trx name super ctx pa hierarchy id trx name if pa hierarchy id 0 setad tree account id 0 setad tree activity id 0 setad tree bpartner id 0 setad tree campaign id 0 setad tree org id 0 setad tree product id 0 setad tree project id 0 setad tree salesregion id 0 set name null setpa hierarchy id 0 x_pa_hierarchy pa_hierarchy_id trxname pa_hierarchy_id trxname pa_hierarchy_id setad_tree_account_id setad_tree_activity_id setad_tree_bpartner_id setad_tree_campaign_id setad_tree_org_id setad_tree_product_id setad_tree_project_id setad_tree_salesregion_id setname setpa_hierarchy_id load constructor public x pa hierarchy properties ctx result set rs string trx name super ctx rs trx name x_pa_hierarchy resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa hierarchy append get id append return sb to string tostring stringbuffer stringbuffer x_pa_hierarchy get_id tostring public static final int ad tree account id ad reference id 184 set account tree tree for natural account tree public void setad tree account id int ad tree account id if ad tree account id 1 throw new illegal argument exception ad tree account id is mandatory set value ad tree account id new integer ad tree account id ad_tree_account_id_ad_reference_id setad_tree_account_id ad_tree_account_id ad_tree_account_id illegalargumentexception ad_tree_account_id set_value ad_tree_account_id ad_tree_account_id get account tree tree for natural account tree public int getad tree account id integer ii integer get value ad tree account id if ii null return 0 return ii int value getad_tree_account_id get_value ad_tree_account_id intvalue public static final int ad tree activity id ad reference id 184 set activity tree tree to determine activity hierarchy public void setad tree activity id int ad tree activity id if ad tree activity id 1 throw new illegal argument exception ad tree activity id is mandatory set value ad tree activity id new integer ad tree activity id ad_tree_activity_id_ad_reference_id setad_tree_activity_id ad_tree_activity_id ad_tree_activity_id illegalargumentexception ad_tree_activity_id set_value ad_tree_activity_id ad_tree_activity_id get activity tree tree to determine activity hierarchy public int getad tree activity id integer ii integer get value ad tree activity id if ii null return 0 return ii int value getad_tree_activity_id get_value ad_tree_activity_id intvalue public static final int ad tree bpartner id ad reference id 184 set b partner tree tree to determine business partner hierarchy public void setad tree bpartner id int ad tree bpartner id if ad tree bpartner id 1 throw new illegal argument exception ad tree bpartner id is mandatory set value ad tree bpartner id new integer ad tree bpartner id ad_tree_bpartner_id_ad_reference_id bpartner setad_tree_bpartner_id ad_tree_bpartner_id ad_tree_bpartner_id illegalargumentexception ad_tree_bpartner_id set_value ad_tree_bpartner_id ad_tree_bpartner_id get b partner tree tree to determine business partner hierarchy public int getad tree bpartner id integer ii integer get value ad tree bpartner id if ii null return 0 return ii int value bpartner getad_tree_bpartner_id get_value ad_tree_bpartner_id intvalue public static final int ad tree campaign id ad reference id 184 set campaign tree tree to determine marketing campaign hierarchy public void setad tree campaign id int ad tree campaign id if ad tree campaign id 1 throw new illegal argument exception ad tree campaign id is mandatory set value ad tree campaign id new integer ad tree campaign id ad_tree_campaign_id_ad_reference_id setad_tree_campaign_id ad_tree_campaign_id ad_tree_campaign_id illegalargumentexception ad_tree_campaign_id set_value ad_tree_campaign_id ad_tree_campaign_id get campaign tree tree to determine marketing campaign hierarchy public int getad tree campaign id integer ii integer get value ad tree campaign id if ii null return 0 return ii int value getad_tree_campaign_id get_value ad_tree_campaign_id intvalue public static final int ad tree org id ad reference id 184 set organization tree tree to determine organizational hierarchy public void setad tree org id int ad tree org id if ad tree org id 1 throw new illegal argument exception ad tree org id is mandatory set value ad tree org id new integer ad tree org id ad_tree_org_id_ad_reference_id setad_tree_org_id ad_tree_org_id ad_tree_org_id illegalargumentexception ad_tree_org_id set_value ad_tree_org_id ad_tree_org_id get organization tree tree to determine organizational hierarchy public int getad tree org id integer ii integer get value ad tree org id if ii null return 0 return ii int value getad_tree_org_id get_value ad_tree_org_id intvalue public static final int ad tree product id ad reference id 184 set product tree tree to determine product hierarchy public void setad tree product id int ad tree product id if ad tree product id 1 throw new illegal argument exception ad tree product id is mandatory set value ad tree product id new integer ad tree product id ad_tree_product_id_ad_reference_id setad_tree_product_id ad_tree_product_id ad_tree_product_id illegalargumentexception ad_tree_product_id set_value ad_tree_product_id ad_tree_product_id get product tree tree to determine product hierarchy public int getad tree product id integer ii integer get value ad tree product id if ii null return 0 return ii int value getad_tree_product_id get_value ad_tree_product_id intvalue public static final int ad tree project id ad reference id 184 set project tree tree to determine project hierarchy public void setad tree project id int ad tree project id if ad tree project id 1 throw new illegal argument exception ad tree project id is mandatory set value ad tree project id new integer ad tree project id ad_tree_project_id_ad_reference_id setad_tree_project_id ad_tree_project_id ad_tree_project_id illegalargumentexception ad_tree_project_id set_value ad_tree_project_id ad_tree_project_id get project tree tree to determine project hierarchy public int getad tree project id integer ii integer get value ad tree project id if ii null return 0 return ii int value getad_tree_project_id get_value ad_tree_project_id intvalue public static final int ad tree salesregion id ad reference id 184 set sales region tree tree to determine sales regional hierarchy public void setad tree salesregion id int ad tree salesregion id if ad tree salesregion id 1 throw new illegal argument exception ad tree salesregion id is mandatory set value ad tree salesregion id new integer ad tree salesregion id ad_tree_salesregion_id_ad_reference_id setad_tree_salesregion_id ad_tree_salesregion_id ad_tree_salesregion_id illegalargumentexception ad_tree_salesregion_id set_value ad_tree_salesregion_id ad_tree_salesregion_id get sales region tree tree to determine sales regional hierarchy public int getad tree salesregion id integer ii integer get value ad tree salesregion id if ii null return 0 return ii int value getad_tree_salesregion_id get_value ad_tree_salesregion_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set reporting hierarchy optional reporting hierarchy if not selected the default hierarchy trees are used public void setpa hierarchy id int pa hierarchy id if pa hierarchy id 1 throw new illegal argument exception pa hierarchy id is mandatory set valuenocheck pa hierarchy id new integer pa hierarchy id setpa_hierarchy_id pa_hierarchy_id pa_hierarchy_id illegalargumentexception pa_hierarchy_id set_valuenocheck pa_hierarchy_id pa_hierarchy_id get reporting hierarchy optional reporting hierarchy if not selected the default hierarchy trees are used public int getpa hierarchy id integer ii integer get value pa hierarchy id if ii null return 0 return ii int value getpa_hierarchy_id get_value pa_hierarchy_id intvalue standard constructor public x b offer properties ctx int b offer id string trx name super ctx b offer id trx name if b offer id 0 setad user id 0 setb offer id 0 setb sellerfunds id 0 setb topic id 0 set is willing to commit false set name null x_b_offer b_offer_id trxname b_offer_id trxname b_offer_id setad_user_id setb_offer_id setb_sellerfunds_id setb_topic_id setiswillingtocommit setname load constructor public x b offer properties ctx result set rs string trx name super ctx rs trx name x_b_offer resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b offer append get id append return sb to string tostring stringbuffer stringbuffer x_b_offer get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set offer offer for a topic public void setb offer id int b offer id if b offer id 1 throw new illegal argument exception b offer id is mandatory set valuenocheck b offer id new integer b offer id setb_offer_id b_offer_id b_offer_id illegalargumentexception b_offer_id set_valuenocheck b_offer_id b_offer_id get offer offer for a topic public int getb offer id integer ii integer get value b offer id if ii null return 0 return ii int value getb_offer_id get_value b_offer_id intvalue set seller funds seller funds from offers on topics public void setb sellerfunds id int b sellerfunds id if b sellerfunds id 1 throw new illegal argument exception b sellerfunds id is mandatory set value b sellerfunds id new integer b sellerfunds id setb_sellerfunds_id b_sellerfunds_id b_sellerfunds_id illegalargumentexception b_sellerfunds_id set_value b_sellerfunds_id b_sellerfunds_id get seller funds seller funds from offers on topics public int getb sellerfunds id integer ii integer get value b sellerfunds id if ii null return 0 return ii int value getb_sellerfunds_id get_value b_sellerfunds_id intvalue set topic auction topic public void setb topic id int b topic id if b topic id 1 throw new illegal argument exception b topic id is mandatory set value b topic id new integer b topic id setb_topic_id b_topic_id b_topic_id illegalargumentexception b_topic_id set_value b_topic_id b_topic_id get topic auction topic public int getb topic id integer ii integer get value b topic id if ii null return 0 return ii int value getb_topic_id get_value b_topic_id intvalue set willing to commit public void set is willing to commit boolean is willing to commit set value is willing to commit new boolean is willing to commit setiswillingtocommit iswillingtocommit set_value iswillingtocommit iswillingtocommit get willing to commit public boolean is willing to commit object oo get value is willing to commit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iswillingtocommit get_value iswillingtocommit booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set private note private note not visible to the other parties public void set private note string private note if private note null private note length 2000 log warning length 2000 truncated private note private note substring 0 1999 set value private note private note setprivatenote privatenote privatenote privatenote privatenote privatenote set_value privatenote privatenote get private note private note not visible to the other parties public string get private note return string get value private note getprivatenote get_value privatenote set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg manual lookup param key column key column public x lookup string key column super display type table dir 0 m keycolumn key column keycolumn xlookup keycolumn displaytype tabledir m_keycolumn keycolumn get display string of key value param key key return display public string get display object key linear seatch in m data for int i 0 i p data size i object oo p data get i if oo null oo instanceof name pair name pair pp name pair oo if pp getid equals key return pp get name return key getdisplay m_data p_data p_data namepair namepair namepair getname the lookup contains the key param key key return true if contains key public boolean contains key object key linear seatch in p data for int i 0 i p data size i object oo p data get i if oo null oo instanceof name pair name pair pp name pair oo if pp getid equals key return true return false containskey p_data p_data p_data namepair namepair namepair get object of key value param key key return object or null public name pair get object key linear seatch in m data for int i 0 i p data size i object oo p data get i if oo null oo instanceof name pair name pair pp name pair oo if pp getid equals key return pp return null namepair m_data p_data p_data namepair namepair namepair return data as sorted array param mandatory mandatory param only validated only validated param only active only active param temporary force load for temporary display return list of data suppress warnings unchecked public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary array list object list new array list object p data sort data if m keycolumn ends with id key name pair p new key name pair 1 if mandatory list add p collections sort list p else value name pair p new value name pair null if mandatory list add p collections sort list p return list onlyvalidated onlyactive suppresswarnings arraylist getdata onlyvalidated onlyactive arraylist arraylist p_data m_keycolumn endswith _id keynamepair keynamepair valuenamepair valuenamepair refresh values nop return number of cache public int refresh return p data size p_data get underlying fully qualified table column name return column name public string get column name return m keycolumn getcolumnname m_keycolumn prepare e g get parameters protected void prepare string buffer sb new string buffer record id append getrecord id parameter process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p c acctschema id big decimal para i get parameter int value else if name equals posting type p postingtype string para i get parameter else if name equals c period id p c period id big decimal para i get parameter int value else if name equals date acct p dateacct from timestamp para i get parameter p dateacct to timestamp para i getparameter to else if name equals pa hierarchy id p pa hierarchy id para i get parameter as int else if name equals ad org id p ad org id big decimal para i get parameter int value else if name equals account id p account id big decimal para i get parameter int value else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else if name equals m product id p m product id big decimal para i get parameter int value else if name equals c project id p c project id big decimal para i get parameter int value else if name equals c activity id p c activity id big decimal para i get parameter int value else if name equals c salesregion id p c salesregion id big decimal para i get parameter int value else if name equals c campaign id p c campaign id big decimal para i get parameter int value else if name equals update balances p updatebalances y equals para i get parameter else log log level severe unknown parameter name mandatory c acctschema id posting type m parameterwhere append c acctschema id append p c acctschema id append and posting type append p postingtype append optional account id if p account id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype account p account id optional org if p ad org id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype organization p ad org id optional b partner if p c bpartner id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype bpartner p c bpartner id optional product if p m product id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype product p m product id optional project if p c project id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype project p c project id optional activity if p c activity id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype activity p c activity id optional campaign if p c campaign id 0 m parameterwhere append and c campaign id append p c campaign id m parameterwhere append and append m report tree get where clause get ctx m acct schema element elementtype campaign p c campaign id optional sales region if p c salesregion id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype salesregion p c salesregion id set date acct sb append date acct append p dateacct from append append p dateacct to sb append where append m parameterwhere log fine sb to string stringbuffer stringbuffer record_id getrecord_id processinfoparameter getparameter getparametername getparameter c_acctschema_id p_c_acctschema_id bigdecimal getparameter intvalue postingtype p_postingtype getparameter c_period_id p_c_period_id bigdecimal getparameter intvalue dateacct p_dateacct_from getparameter p_dateacct_to getparameter_to pa_hierarchy_id p_pa_hierarchy_id getparameterasint ad_org_id p_ad_org_id bigdecimal getparameter intvalue account_id p_account_id bigdecimal getparameter intvalue c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue m_product_id p_m_product_id bigdecimal getparameter intvalue c_project_id p_c_project_id bigdecimal getparameter intvalue c_activity_id p_c_activity_id bigdecimal getparameter intvalue c_salesregion_id p_c_salesregion_id bigdecimal getparameter intvalue c_campaign_id p_c_campaign_id bigdecimal getparameter intvalue updatebalances p_updatebalances getparameter c_acctschema_id postingtype m_parameterwhere c_acctschema_id p_c_acctschema_id postingtype p_postingtype account_id p_account_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_account p_account_id p_ad_org_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_organization p_ad_org_id bpartner p_c_bpartner_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_bpartner p_c_bpartner_id p_m_product_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_product p_m_product_id p_c_project_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_project p_c_project_id p_c_activity_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_activity p_c_activity_id p_c_campaign_id m_parameterwhere c_campaign_id p_c_campaign_id m_parameterwhere mreporttree getwhereclause getctx macctschemaelement elementtype_campaign p_c_campaign_id p_c_salesregion_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_salesregion p_c_salesregion_id setdateacct dateacct p_dateacct_from p_dateacct_to m_parameterwhere tostring set start end date of report if not defined current month private void set date acct date defined if p dateacct from null if p dateacct to null p dateacct to new timestamp system current time millis return get date from period if p c period id 0 gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis system current time millis cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 cal set calendar day of month 1 set to first of month p dateacct from new timestamp cal get time in millis cal add calendar month 1 cal add calendar day of year 1 last of month p dateacct to new timestamp cal get time in millis return string sql select start date end date from c period where c period id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 p c period id result set rs pstmt execute query if rs next p dateacct from rs get timestamp 1 p dateacct to rs get timestamp 2 rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null setdateacct p_dateacct_from p_dateacct_to p_dateacct_to currenttimemillis p_c_period_id gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis currenttimemillis hour_of_day day_of_month p_dateacct_from gettimeinmillis day_of_year p_dateacct_to gettimeinmillis startdate enddate c_period c_period_id preparedstatement preparestatement setint p_c_period_id resultset executequery p_dateacct_from gettimestamp p_dateacct_to gettimestamp perform process return message to be translated protected string do it update acct schema balances if p updatebalances fin balance update balance p c acctschema id false create balance line create detail lines int ad printformat id 134 if ini is client get process info set transient object m print format get get ctx ad printformat id false else get process info set serializable object m print format get get ctx ad printformat id false log fine system current time millis m start ms return doit acctschema p_updatebalances finbalance updatebalance p_c_acctschema_id createbalanceline createdetaillines ad_printformat_id isclient getprocessinfo settransientobject mprintformat getctx ad_printformat_id getprocessinfo setserializableobject mprintformat getctx ad_printformat_id currenttimemillis m_start create beginning balance line private void create balance line string buffer sb new string buffer insert into t reportstatement ad pinstance id fact acct id level no date acct name description amt acct dr amt acct cr balance qty sb append select append getad pinstance id append 0 0 append db to date p dateacct from true append append db to string msg get msg env get ctx beginning balance append null coalesce sum amt acct dr 0 coalesce sum amt acct cr 0 coalesce sum amt acct dr amt acct cr 0 coalesce sum qty 0 from fact acct balance where append m parameterwhere append and date acct append db to date p dateacct from start beginning of year if p account id 0 m acct new m element value get ctx p account id get trxname if m acct is balance sheet m period first m period get first in year get ctx p dateacct from if first null sb append and date acct append db to date first get start date else log log level severe first period not found int no db execute update sb to string get trxname log fine no account id p account id log finest sb to string createbalanceline stringbuffer stringbuffer t_reportstatement ad_pinstance_id fact_acct_id levelno dateacct amtacctdr amtacctcr getad_pinstance_id to_date p_dateacct_from to_string getmsg getctx beginningbalance amtacctdr amtacctcr amtacctdr amtacctcr fact_acct_balance m_parameterwhere dateacct to_date p_dateacct_from p_account_id m_acct melementvalue getctx p_account_id get_trxname m_acct isbalancesheet mperiod mperiod getfirstinyear getctx p_dateacct_from dateacct to_date getstartdate executeupdate tostring get_trxname account_id p_account_id tostring create beginning balance line private void create detail lines string buffer sb new string buffer insert into t reportstatement ad pinstance id fact acct id level no date acct name description amt acct dr amt acct cr balance qty sb append select append getad pinstance id append fact acct id 1 append date acct null null amt acct dr amt acct cr amt acct dr amt acct cr qty from fact acct where append m parameterwhere append and date acct between append db to date p dateacct from append and append db to date p dateacct to int no db execute update sb to string get trxname log fine no log finest sb to string set name description string sql select select e name fa description from fact acct fa inner join ad table t on fa ad table id t ad table id inner join ad element e on t table name id e column name where r fact acct id fa fact acct id translated version sb new string buffer update t reportstatement r set name description append sql select append where fact acct id 0 and ad pinstance id append getad pinstance id no db execute update sb to string get trxname log fine name no log finest name sb createdetaillines stringbuffer stringbuffer t_reportstatement ad_pinstance_id fact_acct_id levelno dateacct amtacctdr amtacctcr getad_pinstance_id fact_acct_id dateacct amtacctdr amtacctcr amtacctdr amtacctcr fact_acct m_parameterwhere dateacct to_date p_dateacct_from to_date p_dateacct_to executeupdate tostring get_trxname tostring sql_select fact_acct ad_table ad_table_id ad_table_id ad_element tablename _id columnname fact_acct_id fact_acct_id stringbuffer t_reportstatement sql_select fact_acct_id ad_pinstance_id getad_pinstance_id executeupdate tostring get_trxname standard constructor public x c servicelevelline properties ctx int c servicelevelline id string trx name super ctx c servicelevelline id trx name if c servicelevelline id 0 setc servicelevelline id 0 setc servicelevel id 0 set service date new timestamp system current time millis set service level provided env zero x_c_servicelevelline c_servicelevelline_id trxname c_servicelevelline_id trxname c_servicelevelline_id setc_servicelevelline_id setc_servicelevel_id setservicedate currenttimemillis setservicelevelprovided load constructor public x c servicelevelline properties ctx result set rs string trx name super ctx rs trx name x_c_servicelevelline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c servicelevelline append get id append return sb to string tostring stringbuffer stringbuffer x_c_servicelevelline get_id tostring set service level line product revenue recognition service level line public void setc servicelevelline id int c servicelevelline id if c servicelevelline id 1 throw new illegal argument exception c servicelevelline id is mandatory set valuenocheck c servicelevelline id new integer c servicelevelline id setc_servicelevelline_id c_servicelevelline_id c_servicelevelline_id illegalargumentexception c_servicelevelline_id set_valuenocheck c_servicelevelline_id c_servicelevelline_id get service level line product revenue recognition service level line public int getc servicelevelline id integer ii integer get value c servicelevelline id if ii null return 0 return ii int value getc_servicelevelline_id get_value c_servicelevelline_id intvalue set service level product revenue recognition service level public void setc servicelevel id int c servicelevel id if c servicelevel id 1 throw new illegal argument exception c servicelevel id is mandatory set valuenocheck c servicelevel id new integer c servicelevel id setc_servicelevel_id c_servicelevel_id c_servicelevel_id illegalargumentexception c_servicelevel_id set_valuenocheck c_servicelevel_id c_servicelevel_id get service level product revenue recognition service level public int getc servicelevel id integer ii integer get value c servicelevel id if ii null return 0 return ii int value getc_servicelevel_id get_value c_servicelevel_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set service date date service was provided public void set service date timestamp service date if service date null throw new illegal argument exception service date is mandatory set valuenocheck service date service date setservicedate servicedate servicedate illegalargumentexception servicedate set_valuenocheck servicedate servicedate get service date date service was provided public timestamp get service date return timestamp get value service date getservicedate get_value servicedate return timestamp get value service date public key name pair get key name pair return new key name pair get id string value of get service date get_value servicedate keynamepair getkeynamepair keynamepair get_id valueof getservicedate set quantity provided quantity of service or product provided public void set service level provided big decimal service level provided if service level provided null throw new illegal argument exception service level provided is mandatory set valuenocheck service level provided service level provided setservicelevelprovided bigdecimal servicelevelprovided servicelevelprovided illegalargumentexception servicelevelprovided set_valuenocheck servicelevelprovided servicelevelprovided get quantity provided quantity of service or product provided public big decimal get service level provided big decimal bd big decimal get value service level provided if bd null return env zero return bd bigdecimal getservicelevelprovided bigdecimal bigdecimal get_value servicelevelprovided constructor param language language of the data for translation public data engine language language if language null m language language dataengine m_language load data param format print format param query query param ctx context return print data or null public print data get print data properties ctx m print format format m query query if format null throw new illegal state exception no print format string table name null string report name format get name if format getad reportview id 0 string sql select t ad table id t table name rv name from ad table t inner join ad reportview rv on t ad table id rv ad table id where rv ad reportview id 1 try prepared statement pstmt db prepare statement sql null pstmt set int 1 format getad reportview id result set rs pstmt execute query if rs next table name rs get string 2 table name report name rs get string 3 rs close pstmt close catch sql exception e log log level severe sql e return null else string sql select table name from ad table where ad table id 1 try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 format getad table id result set rs pstmt execute query if rs next table name rs get string 1 table name rs close pstmt close catch sql exception e1 log log level severe sql e1 return null if table name null log log level severe not found format format return null if format is translation view table name to lower case ends with v vt not just v table name t format set translation view query query print data pd get print data info ctx format query report name table name if pd null return null load print data pd format return pd printdata printdata getprintdata mprintformat mquery illegalstateexception tablename reportname getname getad_reportview_id ad_table_id tablename ad_table ad_reportview ad_table_id ad_table_id ad_reportview_id preparedstatement preparestatement setint getad_reportview_id resultset executequery tablename getstring tablename reportname getstring sqlexception tablename ad_table ad_table_id preparedstatement preparestatement tostring setint getad_table_id resultset executequery tablename getstring tablename sqlexception tablename istranslationview tablename tolowercase endswith _v _vt _v tablename settranslationviewquery printdata getprintdatainfo reportname tablename loadprintdata create load sql and update print data info param ctx context param format print format param query query param report name report name param table name table name return print data or null private print data get print data info properties ctx m print format format m query query string report name string table name m starttime system current time millis log info report name m language getad language log fine table name table name query query log fine format format array list print data column columns new array list print data column m group new print data group order columns identifed by non zero null sort no int orderad column ids format getorderad column ids array list string order columns new array list string orderad column ids length for int i 0 i orderad column ids length i log finest order ad column id orderad column ids i order columns add initial value overwritten with fully qualified name direct sql w o reference info string buffer sqlselect new string buffer select string buffer sqlfrom new string buffer from sqlfrom append table name string buffer sqlgroup new string buffer group by boolean is grouped by false string sql select c ad column id c column name 1 2 c ad reference id c ad reference value id 3 4 c field length c is mandatory c is key c is parent 5 8 coalesce rvc is group function n rvc function column 9 10 pfi is group by pfi is summarized pfi is averaged pfi is counted 11 14 pfi is printed pfi sort no pfi is page break 15 17 pfi is min calc pfi is max calc 18 19 pfi is running total pfi running total lines 20 21 pfi is variance calc pfi is deviation calc 22 23 c columnsql 24 from ad printformat pf inner join ad printformatitem pfi on pf ad printformat id pfi ad printformat id inner join ad column c on pfi ad column id c ad column id left outer join ad reportview col rvc on pf ad reportview id rvc ad reportview id and c ad column id rvc ad column id where pf ad printformat id 1 and pfi is active y and pfi is printed y or c is key y or pfi sort no 0 order by pfi is printed desc pfi seq no functions are put in first column try prepared statement pstmt db prepare statement sql null pstmt set int 1 format get id result set rs pstmt execute query m synonym a synonym while rs next get values from record int ad column id rs get int 1 string column name rs get string 2 string columnsql rs get string 24 int ad reference id rs get int 3 int ad reference value id rs get int 4 column info int field length rs get int 5 boolean is mandatory y equals rs get string 6 boolean is key y equals rs get string 7 boolean is parent y equals rs get string 8 sql group by boolean is group function y equals rs get string 9 if is group function is grouped by true string function column rs get string 10 if function column null function column breaks column functions if y equals rs get string 11 m group add group column column name if y equals rs get string 12 m group add function column name print data function f sum if y equals rs get string 13 m group add function column name print data function f mean if y equals rs get string 14 m group add function column name print data function f count if y equals rs get string 18 is min calc m group add function column name print data function f min if y equals rs get string 19 is max calc m group add function column name print data function f max if y equals rs get string 22 is variance calc m group add function column name print data function f variance if y equals rs get string 23 is deviation calc m group add function column name print data function f deviation if y equals rs get string 20 is running total running total lines only once use max m runningtotallines math max m runningtotallines rs get int 21 general info boolean is printed y equals rs get string 15 int sort no rs get int 16 boolean is page break y equals rs get string 17 fully qualified table column for ordering string order name table name column name print data column pdc null key if is key table column sqlselect append table name append append column name append sqlgroup append table name append append column name append pdc new print data column ad column id column name ad reference id field length key is page break key column else if is printed not printed sort columns parent table dir and unqualified search else if is parent ad reference id display type table dir ad reference id display type search ad reference value id 0 creates embedded sql in the form select column table name from column table where table name column name column table column name string e sql m lookup factory getlookup tabledirembed m language column name table name table name string table column name if table ends with id table table substring 0 table length 3 display column string display column name as a name table id sqlselect append append e sql append as append m synonym append display append append table name append append column name append sqlgroup append m synonym append display append append table name append append column name append order name m synonym display pdc new print data column ad column id column name ad reference id field length order name is page break synonym next table else if ad reference id display type table ad reference id display type search ad reference value id 0 table reference tr get table reference ad reference value id string display tr display column a name as a name table id if tr is value displayed sqlselect append m synonym append value sqlselect append m synonym append append display sqlselect append as append m synonym append display append append table name append append column name append sqlgroup append m synonym append append display append append table name append append column name append order name m synonym display x join table a on x key column a key if is mandatory sqlfrom append inner join else sqlfrom append left outer join sqlfrom append tr table name append append m synonym append on append table name append append column name append append m synonym append append tr key column append pdc new print data column ad column id column name ad reference id field length order name is page break synonym next list or button with reference value else if ad reference id display type list ad reference id display type button ad reference value id 0 if env is base language m language ad ref list a name as a name sqlselect append m synonym append name as append m synonym append name sqlgroup append m synonym append name order name m synonym name x join ad ref list a on x key column a value and a ad reference id 123 if is mandatory sqlfrom append inner join else sqlfrom append left outer join sqlfrom append ad ref list append m synonym append on append table name append append column name append append m synonym append value append and append m synonym append ad reference id append ad reference value id append else a name as a name sqlselect append m synonym append name as append m synonym append name sqlgroup append m synonym append name order name m synonym name left outer join ad ref list xa on ad table entity type xa value and xa ad reference id 245 left outer join ad ref list trl a on xa ad ref list id a ad ref list id and a ad language de de if is mandatory sqlfrom append inner join else sqlfrom append left outer join sqlfrom append ad ref list x append m synonym append on append table name append append column name append x append m synonym append value and x append m synonym append ad reference id append ad reference value id append if is mandatory sqlfrom append inner join else sqlfrom append left outer join sqlfrom append ad ref list trl append m synonym append on x append m synonym append ad ref list id append m synonym append ad ref list id append and append m synonym append ad language append m language getad language append table name column name sqlselect append table name append append co printdata reportname tablename printdata printdata getprintdatainfo mprintformat mquery reportname tablename m_starttime currenttimemillis reportname m_language getad_language tablename tablename arraylist printdatacolumn arraylist printdatacolumn m_group printdatagroup sortno orderad_column_ids getorderad_column_ids arraylist ordercolumns arraylist orderad_column_ids orderad_column_ids ad_column_id orderad_column_ids ordercolumns stringbuffer stringbuffer stringbuffer stringbuffer tablename stringbuffer stringbuffer isgroupedby ad_column_id columnname ad_reference_id ad_reference_value_id fieldlength ismandatory iskey isparent isgroupfunction functioncolumn isgroupby issummarized isaveraged iscounted isprinted sortno ispagebreak ismincalc ismaxcalc isrunningtotal runningtotallines isvariancecalc isdeviationcalc ad_printformat ad_printformatitem ad_printformat_id ad_printformat_id ad_column ad_column_id ad_column_id ad_reportview_col ad_reportview_id ad_reportview_id ad_column_id ad_column_id ad_printformat_id isactive isprinted iskey sortno isprinted seqno preparedstatement preparestatement setint get_id resultset executequery m_synonym ad_column_id getint columnname getstring getstring ad_reference_id getint ad_reference_value_id getint columninfo fieldlength getint ismandatory getstring iskey getstring isparent getstring groupby isgroupfunction getstring isgroupfunction isgroupedby functioncolumn getstring functioncolumn functioncolumn getstring m_group addgroupcolumn columnname getstring m_group addfunction columnname printdatafunction f_sum getstring m_group addfunction columnname printdatafunction f_mean getstring m_group addfunction columnname printdatafunction f_count getstring ismincalc m_group addfunction columnname printdatafunction f_min getstring ismaxcalc m_group addfunction columnname printdatafunction f_max getstring isvariancecalc m_group addfunction columnname printdatafunction f_variance getstring isdeviationcalc m_group addfunction columnname printdatafunction f_deviation getstring isrunningtotal runningtotallines m_runningtotallines m_runningtotallines getint isprinted getstring sortno getint ispagebreak getstring ordername tablename columnname printdatacolumn iskey tablename columnname tablename columnname printdatacolumn ad_column_id columnname ad_reference_id fieldlength ispagebreak keycolumn isprinted tabledir isparent ad_reference_id displaytype tabledir ad_reference_id displaytype ad_reference_value_id columntable columntable tablename columnname columntable columnname esql mlookupfactory getlookup_tabledirembed m_language columnname tablename tablename columnname endswith _id displaycolumn columnname aname esql m_synonym tablename columnname m_synonym tablename columnname ordername m_synonym printdatacolumn ad_column_id columnname ad_reference_id fieldlength ordername ispagebreak synonymnext ad_reference_id displaytype ad_reference_id displaytype ad_reference_value_id tablereference gettablereference ad_reference_value_id displaycolumn aname isvaluedisplayed m_synonym m_synonym m_synonym tablename columnname m_synonym tablename columnname ordername m_synonym keycolumn ismandatory tablename m_synonym tablename columnname m_synonym keycolumn printdatacolumn ad_column_id columnname ad_reference_id fieldlength ordername ispagebreak synonymnext referencevalue ad_reference_id displaytype ad_reference_id displaytype ad_reference_value_id isbaselanguage m_language ad_ref_list aname m_synonym m_synonym m_synonym ordername m_synonym ad_ref_list keycolumn ad_reference_id ismandatory ad_ref_list m_synonym tablename columnname m_synonym m_synonym ad_reference_id ad_reference_value_id aname m_synonym m_synonym m_synonym ordername m_synonym ad_ref_list ad_table entitytype ad_reference_id ad_ref_list_trl ad_ref_list_id ad_ref_list_id ad_language de_de ismandatory ad_ref_list m_synonym tablename columnname m_synonym m_synonym ad_reference_id ad_reference_value_id ismandatory ad_ref_list_trl m_synonym m_synonym ad_ref_list_id m_synonym ad_ref_list_id m_synonym ad_language m_language getad_language tablename columnname tablename next synonym creates next synonym a z aa zz aaa zzz private void synonym next int length m synonym length char cc m synonym char at 0 if cc z cc a length else cc m synonym string value of cc if length 1 return m synonym string value of cc if length 2 return m synonym string value of cc synonymnext m_synonym m_synonym charat m_synonym valueof m_synonym valueof m_synonym valueof get table name and column name for reference tables param ad reference value id reference value return 0 table name 1 key column 2 display column public static table reference get table reference int ad reference value id table reference tr new table reference string sql select t table name ck column name as key column 1 2 cd column name as display column rt is value displayed cd is translated from ad ref table rt inner join ad table t on rt ad table id t ad table id inner join ad column ck on rt ad key ck ad column id inner join ad column cd on rt ad display cd ad column id where rt ad reference id 1 and rt is active y and t is active y try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad reference value id result set rs pstmt execute query if rs next tr table name rs get string 1 tr key column rs get string 2 tr display column rs get string 3 tr is value displayed y equals rs get string 4 tr is translated y equals rs get string 5 rs close pstmt close catch sql exception ex log log level severe sql ex return tr tablename columnname ad_reference_value_id tablename keycolumn displaycolumn tablereference gettablereference ad_reference_value_id tablereference tablereference tablename columnname keycolumn columnname displaycolumn isvaluedisplayed istranslated ad_ref_table ad_table ad_table_id ad_table_id ad_column ad_key ad_column_id ad_column ad_display ad_column_id ad_reference_id isactive isactive preparedstatement preparestatement setint ad_reference_value_id resultset executequery tablename getstring keycolumn getstring displaycolumn getstring isvaluedisplayed getstring istranslated getstring sqlexception load data into print data param pd print data with sql and column info set param format print format private void load print data print data pd m print format format translate spool output boolean translate spool pd get table name equals t spool m runningtotalstring msg get msg format get language running total int row no 0 print data column pdc null boolean has level no pd has level no int level no 0 try prepared statement pstmt db prepare statement pd getsql null result set rs pstmt execute query row loop while rs next if has level no level no rs get int level no else level no 0 check group change if m group get group column count 1 one is grandtotal check columns for function columns for int i pd get column info length 1 i 0 i backwards leaset group first print data column group pdc pd get column info i if m group is group column group pdc get column name continue group change object value m group group change group pdc get column name rs get object group pdc get alias if value null group change char functions m group get functions group pdc get column name for int f 0 f functions length f print running total pd level no row no pd add row true level no get columns for int c 0 c pd get column info length c pdc pd get column info c log fine load print data page break pdc is page break if group pdc get column name equals pdc get column name string value string value to string if value instanceof timestamp value string display type get date format pdc get display type m language format value value string print data function get function symbol functions f pd add node new print data element pdc get column name value string display type string false pdc is page break else if m group is function column pdc get column name functions f pd add node new print data element pdc get column name m group get value group pdc get column name pdc get column name functions f print data function get function display type functions f false pdc is page break for all columns for all functions reset group values for int c 0 c pd get column info length c pdc pd get column info c m group reset group pdc get column name pdc get column name group change for all columns group change new row print running total pd level no row no pd add row false level no int counter 1 get columns for int i 0 i pd get column info length i pdc pd get column info i print data element pde null key column no display column if pdc get alias equals key if pdc get column name ends with id int id rs get int pdc get columnid name int id rs get int counter if rs was null key name pair pp new key name pair id key key pde new print data element pdc get column name pp pdc get display type true pdc is page break else string id rs get string pdc get columnid name string id rs get string counter if rs was null value name pair pp new value name pair id key key pde new print data element pdc get column name pp pdc get display type true pdc is page break non key column else display and value column if pdc has alias display column first string display rs get string counter if pdc get column name ends with id int id rs get int counter if display null rs was null key name pair pp new key name pair id display pde new print data element pdc get column name pp pdc get display type else string id rs get string counter if display null rs was null value name pair pp new value name pair id display pde new print data element pdc get column name pp pdc get display type display value only else transformation for booleans if pdc get display type display type yes no string s rs get string counter if rs was null boolean b s equals y pde new print data element pdc get column name new boolean b pdc get display type else if pdc get display type display type text long clob clob rs get clob counter string value if clob null long length clob length value clob get sub string 1 int length pde new print data element pdc get column name value pdc get display type else the general case object obj rs get object counter if obj null obj instanceof string obj string obj trim if string obj length 0 obj null if obj null translate spool output if translate spool obj instanceof string string s string obj s msg parse translation pd get ctx s pde new print data element pdc get column name s pdc get display type else pde new print data element pdc get column name obj pdc get display type value only non key column if pde null pd add node pde m group add value pde get column name pde get function value for all columns for all rows rs close pstmt close catch sql exception e log log level severe pdc e get message nsql pd getsql we have all rows finish check last group change if m group get group column count 1 one is total for int i pd get column info length 1 i 0 i backwards leaset group first print data column group pdc pd get column info i if m group is group column group pdc get column name continue object value m group group change group pdc get column name new object if value null group change char functions m group get functions group pdc get column name for int f 0 f functions length f print running total pd level no row no pd add row true level no get columns for int c 0 c pd get column info length c pdc pd get column info c if group pdc get column name equals pdc get column name string value string value to string if value instanceof timestamp value string display type get date format pdc get display type m language format value value string print data function get function symbol functions f pd add node new print data element pdc get column name value string display type string else if m group is function column pdc get column name functions f pd add node new print data element pdc get column name m group get value group pdc get column name pdc get column name functions f print data function get function display type functions f for all functions no need to reset group change last group change add total lines if m group is group column print data group total char functions m group get functions print data group total for int f 0 f functions length f print running total pd level no row no pd add row true level no get columns for int c 0 c pd get column info length c pdc pd get column info c if c 0 put function in first column string name if format get table format is print function symbols translate sum etc name msg get msg format get language print data function get function name functions f name print data function get function symbol functions f symbol pd add node new print data element pdc get column name name trim display type string else if m group is function column pdc get column name functions f pd add node new print data element pdc get column name m group get value print data group total pdc get column name functions f print data function get function display type functions f for all columns for all functions no need to reset total line if pd get row count 0 if c log mgt is level finer log warning no rows ms system current time millis m starttime pd getsql else log warning no rows ms system current time millis m starttime else log info rows pd get row count ms system curren printdata columninfo loadprintdata printdata mprintformat translatespool gettablename t_spool m_runningtotalstring getmsg getlanguage runningtotal rowno printdatacolumn haslevelno haslevelno levelno preparedstatement preparestatement resultset executequery haslevelno levelno getint levelno levelno m_group getgroupcolumncount grandtotal_ getcolumninfo printdatacolumn group_pdc getcolumninfo m_group isgroupcolumn group_pdc getcolumnname m_group groupchange group_pdc getcolumnname getobject group_pdc getalias m_group getfunctions group_pdc getcolumnname printrunningtotal levelno rowno addrow levelno getcolumninfo getcolumninfo loadprintdata pagebreak ispagebreak group_pdc getcolumnname getcolumnname valuestring tostring valuestring displaytype getdateformat getdisplaytype m_language valuestring printdatafunction getfunctionsymbol addnode printdataelement getcolumnname valuestring displaytype ispagebreak m_group isfunctioncolumn getcolumnname addnode printdataelement getcolumnname m_group getvalue group_pdc getcolumnname getcolumnname printdatafunction getfunctiondisplaytype ispagebreak getcolumninfo getcolumninfo m_group group_pdc getcolumnname getcolumnname printrunningtotal levelno rowno addrow levelno getcolumninfo getcolumninfo printdataelement displaycolumn getalias getcolumnname endswith _id getint getcolumnidname getint wasnull keynamepair keynamepair printdataelement getcolumnname getdisplaytype ispagebreak getstring getcolumnidname getstring wasnull valuenamepair valuenamepair printdataelement getcolumnname getdisplaytype ispagebreak hasalias displaycolumn getstring getcolumnname endswith _id getint wasnull keynamepair keynamepair printdataelement getcolumnname getdisplaytype getstring wasnull valuenamepair valuenamepair printdataelement getcolumnname getdisplaytype getdisplaytype displaytype yesno getstring wasnull printdataelement getcolumnname getdisplaytype getdisplaytype displaytype textlong getclob getsubstring printdataelement getcolumnname getdisplaytype getobject translatespool parsetranslation getctx printdataelement getcolumnname getdisplaytype printdataelement getcolumnname getdisplaytype addnode m_group addvalue getcolumnname getfunctionvalue sqlexception getmessage m_group getgroupcolumncount getcolumninfo printdatacolumn group_pdc getcolumninfo m_group isgroupcolumn group_pdc getcolumnname m_group groupchange group_pdc getcolumnname m_group getfunctions group_pdc getcolumnname printrunningtotal levelno rowno addrow levelno getcolumninfo getcolumninfo group_pdc getcolumnname getcolumnname valuestring tostring valuestring displaytype getdateformat getdisplaytype m_language valuestring printdatafunction getfunctionsymbol addnode printdataelement getcolumnname valuestring displaytype m_group isfunctioncolumn getcolumnname addnode printdataelement getcolumnname m_group getvalue group_pdc getcolumnname getcolumnname printdatafunction getfunctiondisplaytype m_group isgroupcolumn printdatagroup m_group getfunctions printdatagroup printrunningtotal levelno rowno addrow levelno getcolumninfo getcolumninfo gettableformat isprintfunctionsymbols getmsg getlanguage printdatafunction getfunctionname printdatafunction getfunctionsymbol addnode printdataelement getcolumnname displaytype m_group isfunctioncolumn getcolumnname addnode printdataelement getcolumnname m_group getvalue printdatagroup getcolumnname printdatafunction getfunctiondisplaytype totalline getrowcount clogmgt islevelfiner currenttimemillis m_starttime currenttimemillis m_starttime getrowcount print running total param pd print data to add lines to param level no level no param row no row no private void print running total print data pd int level no int row no if m runningtotallines 1 1 none return log fine m runningtotallines row row no mod row no m runningtotallines if row no m runningtotallines 0 return log fine row row no print data column pdc null int start 0 if row no 0 no page break on page 1 start 1 for int rt start rt 2 rt pd add row true level no get sum columns for int c 0 c pd get column info length c pdc pd get column info c if c 0 string title running total pd add node new print data element pdc get column name title display type string false rt 0 page break else if m group is function column pdc get column name print data function f sum pd add node new print data element pdc get column name m group get value print data group total pdc get column name print data function f sum print data function get function display type print data function f sum false false for all sum columns two lines levelno rowno printrunningtotal printdata levelno rowno m_runningtotallines m_runningtotallines rowno rowno m_runningtotallines rowno m_runningtotallines rowno printdatacolumn rowno addrow levelno getcolumninfo getcolumninfo runningtotal addnode printdataelement getcolumnname displaytype m_group isfunctioncolumn getcolumnname printdatafunction f_sum addnode printdataelement getcolumnname m_group getvalue printdatagroup getcolumnname printdatafunction f_sum printdatafunction getfunctiondisplaytype printdatafunction f_sum test param args args public static void main string args org compiere compiere startup true data engine de new data engine null data engine de new data engine language get language de de m query query new m query query add restriction ad table id m query less 105 print data pd de load fromtable 100 query null null false pd dump pd createxml new javax xml transform stream stream result system out dataengine dataengine dataengine dataengine getlanguage de_de mquery mquery addrestriction ad_table_id mquery printdata load_fromtable streamresult prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p c rfqresponse id getrecord id processinfoparameter getparameter getparametername getparameter p_c_rfqresponse_id getrecord_id perform process return message throws exception if not successful protected string do it throws exception m rfq response response new m rfq response get ctx p c rfqresponse id get trxname log info do it response string error response check complete if error null error length 0 throw new exception error response save return ok doit mrfqresponse mrfqresponse getctx p_c_rfqresponse_id get_trxname doit checkcomplete get client info param ctx context param ad client id id return client info public static m client info get properties ctx int ad client id return get ctx ad client id null ad_client_id mclientinfo ad_client_id ad_client_id get client info param ctx context param ad client id id param trx name optional trx return client info public static m client info get properties ctx int ad client id string trx name integer key new integer ad client id m client info info m client info s cache get key if info null return info string sql select from ad clientinfo where ad client id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad client id result set rs pstmt execute query if rs next info new m client info ctx rs null if trx name null s cache put key info rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return info ad_client_id trxname mclientinfo ad_client_id trxname ad_client_id mclientinfo mclientinfo s_cache ad_clientinfo ad_client_id preparedstatement preparestatement trxname setint ad_client_id resultset executequery mclientinfo trxname s_cache sqlexception s_log sqlexception get optionally cached client param ctx context return client public static m client info get properties ctx return get ctx env getad client id ctx null mclientinfo getad_client_id standard constructor param ctx context param ignored ignored public m client info properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 throw new illegal argument exception multi key mclientinfo trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m client info properties ctx result set rs string trx name super ctx rs trx name mclientinfo resultset trxname trxname parent constructor param client client param ad tree org id org tree param ad tree bpartner id bp tree param ad tree project id project tree param ad tree salesregion id sr tree param ad tree product id product tree public m client info m client client int ad tree org id int ad tree bpartner id int ad tree project id int ad tree salesregion id int ad tree product id int ad tree campaign id int ad tree activity id string trx name super client get ctx 0 trx name setad client id client getad client id to make sure setad org id 0 set is discount line amt false setad tree menu id 10 hardcoded setad tree org id ad tree org id setad tree bpartner id ad tree bpartner id setad tree project id ad tree project id setad tree salesregion id ad tree salesregion id setad tree product id ad tree product id setad tree campaign id ad tree campaign id setad tree activity id ad tree activity id m createnew true ad_tree_org_id ad_tree_bpartner_id ad_tree_project_id ad_tree_salesregion_id ad_tree_product_id mclientinfo mclient ad_tree_org_id ad_tree_bpartner_id ad_tree_project_id ad_tree_salesregion_id ad_tree_product_id ad_tree_campaign_id ad_tree_activity_id trxname getctx trxname setad_client_id getad_client_id setad_org_id setisdiscountlineamt setad_tree_menu_id setad_tree_org_id ad_tree_org_id setad_tree_bpartner_id ad_tree_bpartner_id setad_tree_project_id ad_tree_project_id setad_tree_salesregion_id ad_tree_salesregion_id setad_tree_product_id ad_tree_product_id setad_tree_campaign_id ad_tree_campaign_id setad_tree_activity_id ad_tree_activity_id m_createnew get primary acct schema return acct schema public m acct schema getm acct schema1 if m acctschema null getc acctschema1 id 0 m acctschema new m acct schema get ctx getc acctschema1 id null return m acctschema macctschema getmacctschema1 m_acctschema getc_acctschema1_id m_acctschema macctschema getctx getc_acctschema1_id m_acctschema get default accounting currency return currency or 0 public int getc currency id if m acctschema null getm acct schema1 if m acctschema null return m acctschema getc currency id return 0 getc_currency_id m_acctschema getmacctschema1 m_acctschema m_acctschema getc_currency_id overwrite save overwrite return true if saved public boolean save if getad org id 0 setad org id 0 if m createnew return super save return save update getad_org_id setad_org_id m_createnew saveupdate creates an initially unselected check box button with no text no icon public c check box super init ccheckbox creates an initially unselected check box with an icon param icon the icon image to display public c check box icon icon super icon init ccheckbox creates a check box with an icon and specifies whether or not it is initially selected param icon the icon image to display param selected a boolean value indicating the initial selection state if code true code the check box is selected public c check box icon icon boolean selected super icon selected init ccheckbox creates an initially unselected check box with text param text the text of the check box public c check box string text super text init ccheckbox creates a check box where properties are taken from the action supplied param a public c check box action a super a init ccheckbox creates a check box with text and specifies whether or not it is initially selected param text the text of the check box param selected a boolean value indicating the initial selection state if code true code the check box is selected public c check box string text boolean selected super text selected init ccheckbox creates an initially unselected check box with the specified text and icon param text the text of the check box param icon the icon image to display public c check box string text icon icon super text icon false init ccheckbox creates a check box with text and icon and specifies whether or not it is initially selected param text the text of the check box param icon the icon image to display param selected a boolean value indicating the initial selection state if code true code the check box is selected public c check box string text icon icon boolean selected super text icon selected init ccheckbox common init private void init set font compiereplaf getfont label set foreground compiereplaf gettextcolor label setfont getfont_label setforeground gettextcolor_label set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is enabled rw super set enabled rw set background false m readwrite rw setreadwrite isenabled setenabled setbackground m_readwrite is it possible to edit return true if editable public boolean is read write return m readwrite isreadwrite m_readwrite set background based on editable mandatory error ignored param error if true set background to error color otherwise mandatory editable public void set background boolean error setbackground set background param bg public void set background color bg if bg equals get background return super set background bg setbackground getbackground setbackground set editor to value interpret y n and boolean param value value of the editor public void set value object value m value value boolean sel false if value null sel false else if value to string equals y sel true else if value to string equals n sel false else if value instanceof boolean sel boolean value boolean value else try sel boolean get boolean value to string catch exception e this set selected sel setvalue m_value tostring tostring booleanvalue getboolean tostring setselected return editor value return current value as string or boolean public object get value if m value instanceof string return super is selected y n return new boolean is selected getvalue m_value isselected isselected return display value return displayed string value public string get display if m value instanceof string return super is selected y n return boolean to string super is selected getdisplay m_value isselected tostring isselected set text param mnemonic label text public void set text string mnemonic label super set text create mnemonic mnemonic label mnemoniclabel settext mnemoniclabel settext createmnemonic mnemoniclabel create mnemonics of text containing based on ms notation of help h is mnemonics creates alt param text test with mnemonics return text w o private string create mnemonic string text if text null return text int pos text index of if pos 1 we have a nemonic char ch text char at pos 1 if ch is the character set mnemonic ch return text substring 0 pos text substring pos 1 return text alt_ createmnemonic indexof charat _ setmnemonic standard constructor param ctx context param m discountschemabreak id id public m discount schema break properties ctx int m discountschemabreak id string trx name super ctx m discountschemabreak id trx name m_discountschemabreak_id mdiscountschemabreak m_discountschemabreak_id trxname m_discountschemabreak_id trxname load constructor param ctx context param rs result set public m discount schema break properties ctx result set rs string trx name super ctx rs trx name mdiscountschemabreak resultset trxname trxname criteria apply param value amt or qty param m product id product return true if criteria met public boolean applies big decimal value int m product id int m product category id if is active return false below break value if value compare to get break value 0 return false no product category if getm product id 0 getm product category id 0 return true product if getm product id m product id return true category if m product category id 0 return getm product category id m product category id look up category of product return m product category is category getm product category id m product id m_product_id bigdecimal m_product_id m_product_category_id isactive compareto getbreakvalue getm_product_id getm_product_category_id getm_product_id m_product_id m_product_category_id getm_product_category_id m_product_category_id mproductcategory iscategory getm_product_category_id m_product_id string representation return info public string to string string buffer sb new string buffer m discount schema break sb append get id append seq append get seq no if getm product category id 0 sb append m product category id append getm product category id if getm product id 0 sb append m product id append getm product id sb append break append get break value if isb partner flat discount sb append flat discount else sb append discount append get break discount sb append return sb to string tostring stringbuffer stringbuffer mdiscountschemabreak get_id getseqno getm_product_category_id m_product_category_id getm_product_category_id getm_product_id m_product_id getm_product_id getbreakvalue isbpartnerflatdiscount flatdiscount getbreakdiscount tostring standard constructor param ctx context param a registration id id public m registration properties ctx int a registration id string trx name super ctx a registration id trx name if a registration id 0 set is registered true a_registration_id mregistration a_registration_id trxname a_registration_id trxname a_registration_id setisregistered new constructor param ctx context param name name param is allow publish allow publication param is in production production param asset service date start date param trx name trx public m registration properties ctx string name boolean is allow publish boolean is in production timestamp asset service date string trx name this ctx 0 trx name set name name set is allow publish is allow publish set is in production is in production set asset service date asset service date isallowpublish isinproduction assetservicedate trxname mregistration isallowpublish isinproduction assetservicedate trxname trxname setname setisallowpublish isallowpublish setisinproduction isinproduction setassetservicedate assetservicedate load constructor param ctx context param rs result set public m registration properties ctx result set rs string trx name super ctx rs trx name mregistration resultset trxname trxname get all attributes return registration attributes public m registration attribute get attributes if m allattributes null m allattributes m registration attribute get all get ctx return m allattributes mregistrationattribute getattributes m_allattributes m_allattributes mregistrationattribute getall getctx m_allattributes get all active self service attribute values return registration attribute values public m registration value get values return get values true mregistrationvalue getvalues getvalues get all attribute values param only self service only active self service return sorted registration attribute values public m registration value get values boolean only self service create missing values string sql select from a registrationvalue rv where a registration id if only self service sql and exists select from a registrationattribute ra where rv a registrationattribute id ra a registrationattribute id and ra is active y and ra is self service y sql order by a registrationattribute id array list m registration value list new array list m registration value prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 geta registration id result set rs pstmt execute query while rs next list add new m registration value get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert and sort m registration value ret value new m registration value list size list to array ret value arrays sort ret value return ret value onlyselfservice mregistrationvalue getvalues onlyselfservice createmissingvalues a_registrationvalue a_registration_id onlyselfservice a_registrationattribute a_registrationattribute_id a_registrationattribute_id isactive isselfservice a_registrationattribute_id arraylist mregistrationvalue arraylist mregistrationvalue preparedstatement preparestatement get_trxname setint geta_registration_id resultset executequery mregistrationvalue getctx get_trxname mregistrationvalue retvalue mregistrationvalue toarray retvalue retvalue retvalue create missing attribute values private void create missing values string sql select ra a registrationattribute id from a registrationattribute ra left outer join a registrationproduct rp on rp a registrationattribute id ra a registrationattribute id left outer join a registration r on r m product id rp m product id where r a registration id not in registration and not exists select a registrationattribute id from a registrationvalue v where ra a registrationattribute id v a registrationattribute id and r a registration id v a registration id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 geta registration id result set rs pstmt execute query while rs next m registration value v new m registration value this rs get int 1 v save rs close pstmt close pstmt null catch exception e log log level severe null e try if pstmt null pstmt close pstmt null catch exception e pstmt null createmissingvalues a_registrationattribute_id a_registrationattribute a_registrationproduct a_registrationattribute_id a_registrationattribute_id a_registration m_product_id m_product_id a_registration_id a_registrationattribute_id a_registrationvalue a_registrationattribute_id a_registrationattribute_id a_registration_id a_registration_id preparedstatement preparestatement get_trxname setint geta_registration_id resultset executequery mregistrationvalue mregistrationvalue getint load attributes from request param request request return number of attributes read public int load attribute values http servlet request request save if not saved if get id 0 save int count 0 read values for all attributes m registration attribute attributes get attributes for int i 0 i attributes length i m registration attribute attribute attributes i string value web util get parameter request attribute get name if value null continue m registration value reg value new m registration value this attribute geta registrationattribute id value if reg value save count log fine load attribute values count of attributes length return count loadattributevalues httpservletrequest get_id mregistrationattribute getattributes mregistrationattribute webutil getparameter getname mregistrationvalue regvalue mregistrationvalue geta_registrationattribute_id regvalue loadattributevalues update attributes from request param request request return number of attributes read public int update attribute values http servlet request request save if not saved if get id 0 save int count 0 get all values m registration value reg values get values false for int i 0 i reg values length i m registration value reg value reg values i string attribute name reg value get registration attribute string data value web util get parameter request attribute name if data value null continue reg value set description previous reg value get name reg value set name data value if reg value save count log fine update attribute values count of reg values length return count updateattributevalues httpservletrequest get_id mregistrationvalue regvalues getvalues regvalues mregistrationvalue regvalue regvalues attributename regvalue getregistrationattribute datavalue webutil getparameter attributename datavalue regvalue setdescription regvalue getname regvalue setname datavalue regvalue updateattributevalues regvalues return the sql statement used for the m fieldvo create param ctx context return sql with or w o translation and 1 parameter public static string getsql properties ctx is active is part of view string sql select from ad field v where ad tab id order by is displayed desc seq no if env is base language ctx ad tab sql select from ad field vt where ad tab id and ad language env getad language ctx order by is displayed desc seq no return sql mfieldvo isactive ad_field_v ad_tab_id isdisplayed seqno isbaselanguage ad_tab ad_field_vt ad_tab_id ad_language getad_language isdisplayed seqno create field value object param ctx context param window no window param tab no tab param ad window id window param read only r o param rs resultset ad field v return m fieldvo public static m fieldvo create properties ctx int window no int tab no int ad window id boolean read only result set rs m fieldvo vo new m fieldvo ctx window no tab no ad window id read only try vo column name rs get string column name if vo column name null return null c logger get fine vo column name result set meta data rsmd rs get meta data for int i 1 i rsmd get column count i string column name rsmd get column name i if column name equals ignore case name vo header rs get string i else if column name equals ignore case ad reference id vo display type rs get int i else if column name equals ignore case ad column id vo ad column id rs get int i else if column name equals ignore case ad table id vo ad table id rs get int i else if column name equals ignore case display length vo display length rs get int i else if column name equals ignore case is same line vo is same line y equals rs get string i else if column name equals ignore case is displayed vo is displayed y equals rs get string i else if column name equals ignore case display logic vo display logic rs get string i else if column name equals ignore case default value vo default value rs get string i else if column name equals ignore case is mandatory vo is mandatory y equals rs get string i else if column name equals ignore case is read only vo is read only y equals rs get string i else if column name equals ignore case is updateable vo is updateable y equals rs get string i else if column name equals ignore case is always updateable vo is always updateable y equals rs get string i else if column name equals ignore case is heading vo is heading y equals rs get string i else if column name equals ignore case is field only vo is field only y equals rs get string i else if column name equals ignore case is encrypted field vo is encrypted field y equals rs get string i else if column name equals ignore case is encrypted column vo is encrypted column y equals rs get string i else if column name equals ignore case is selection column vo is selection column y equals rs get string i else if column name equals ignore case sort no vo sort no rs get int i else if column name equals ignore case field length vo field length rs get int i else if column name equals ignore case v format vo v format rs get string i else if column name equals ignore case value min vo value min rs get string i else if column name equals ignore case value max vo value max rs get string i else if column name equals ignore case field group vo field group rs get string i else if column name equals ignore case is key vo is key y equals rs get string i else if column name equals ignore case is parent vo is parent y equals rs get string i else if column name equals ignore case description vo description rs get string i else if column name equals ignore case help vo help rs get string i else if column name equals ignore case callout vo callout rs get string i else if column name equals ignore case ad process id vo ad process id rs get int i else if column name equals ignore case read only logic vo read only logic rs get string i else if column name equals ignore case obscure type vo obscure type rs get string i else if column name equals ignore case ad reference value id vo ad reference value id rs get int i else if column name equals ignore case validation code vo validation code rs get string i else if column name equals ignore case columnsql vo columnsql rs get string i if vo header null vo header vo column name catch sql exception e c logger get log level severe create e return null vo init finish return vo windowno tabno ad_window_id readonly ad_field_v mfieldvo mfieldvo windowno tabno ad_window_id readonly resultset mfieldvo mfieldvo windowno tabno ad_window_id readonly columnname getstring columnname columnname clogger columnname resultsetmetadata getmetadata getcolumncount columnname getcolumnname columnname equalsignorecase getstring columnname equalsignorecase ad_reference_id displaytype getint columnname equalsignorecase ad_column_id ad_column_id getint columnname equalsignorecase ad_table_id ad_table_id getint columnname equalsignorecase displaylength displaylength getint columnname equalsignorecase issameline issameline getstring columnname equalsignorecase isdisplayed isdisplayed getstring columnname equalsignorecase displaylogic displaylogic getstring columnname equalsignorecase defaultvalue defaultvalue getstring columnname equalsignorecase ismandatory ismandatory getstring columnname equalsignorecase isreadonly isreadonly getstring columnname equalsignorecase isupdateable isupdateable getstring columnname equalsignorecase isalwaysupdateable isalwaysupdateable getstring columnname equalsignorecase isheading isheading getstring columnname equalsignorecase isfieldonly isfieldonly getstring columnname equalsignorecase isencryptedfield isencryptedfield getstring columnname equalsignorecase isencryptedcolumn isencryptedcolumn getstring columnname equalsignorecase isselectioncolumn isselectioncolumn getstring columnname equalsignorecase sortno sortno getint columnname equalsignorecase fieldlength fieldlength getint columnname equalsignorecase vformat vformat getstring columnname equalsignorecase valuemin valuemin getstring columnname equalsignorecase valuemax valuemax getstring columnname equalsignorecase fieldgroup fieldgroup getstring columnname equalsignorecase iskey iskey getstring columnname equalsignorecase isparent isparent getstring columnname equalsignorecase getstring columnname equalsignorecase getstring columnname equalsignorecase getstring columnname equalsignorecase ad_process_id ad_process_id getint columnname equalsignorecase readonlylogic readonlylogic getstring columnname equalsignorecase obscuretype obscuretype getstring columnname equalsignorecase ad_reference_value_id ad_reference_value_id getint columnname equalsignorecase validationcode validationcode getstring columnname equalsignorecase getstring columnname sqlexception clogger initfinish init field for process parameter param ctx context param window no window param rs result set ad process para return m fieldvo public static m fieldvo create parameter properties ctx int window no result set rs m fieldvo vo new m fieldvo ctx window no 0 0 false vo is process true vo is displayed true vo is read only false vo is updateable true try vo ad table id 0 vo ad column id rs get int ad process para id vo column name rs get string column name vo header rs get string name vo description rs get string description vo help rs get string help vo display type rs get int ad reference id vo is mandatory rs get string is mandatory equals y vo field length rs get int field length vo display length vo field length vo default value rs get string default value vo default value2 rs get string default value2 vo v format rs get string v format vo value min rs get string value min vo value max rs get string value max vo is range rs get string is range equals y vo ad reference value id rs get int ad reference value id vo validation code rs get string validation code catch sql exception e c logger get log level severe create parameter e vo init finish if vo default value2 null vo default value2 return vo windowno ad_process_para mfieldvo mfieldvo createparameter windowno resultset mfieldvo mfieldvo windowno isprocess isdisplayed isreadonly isupdateable ad_table_id ad_column_id getint ad_process_para_id columnname getstring columnname getstring getstring getstring displaytype getint ad_reference_id ismandatory getstring ismandatory fieldlength getint fieldlength displaylength fieldlength defaultvalue getstring defaultvalue defaultvalue2 getstring defaultvalue2 vformat getstring vformat valuemin getstring valuemin valuemax getstring valuemax isrange getstring isrange ad_reference_value_id getint ad_reference_value_id validationcode getstring validationcode sqlexception clogger createparameter initfinish defaultvalue2 defaultvalue2 create range to parameter field from from parameter field param vof field value object return to m fieldvo public static m fieldvo create parameter m fieldvo vof m fieldvo vot new m fieldvo vof ctx vof window no vof tab no vof ad window id vof tab read only vot is process true vot is displayed true vot is read only false vot is updateable true vot ad table id vof ad table id vot ad column id vof ad column id ad process para id vot column name vof column name vot header vof header vot description vof description vot help vof help vot display type vof display type vot is mandatory vof is mandatory vot field length vof field length vot display length vof field length vot default value vof default value2 vot v format vof v format vot value min vof value min vot value max vof value max vot is range vof is range return vot mfieldvo mfieldvo createparameter mfieldvo mfieldvo mfieldvo windowno tabno ad_window_id tabreadonly isprocess isdisplayed isreadonly isupdateable ad_table_id ad_table_id ad_column_id ad_column_id ad_process_para_id columnname columnname displaytype displaytype ismandatory ismandatory fieldlength fieldlength displaylength fieldlength defaultvalue defaultvalue2 vformat vformat valuemin valuemin valuemax valuemax isrange isrange make a standard field created updated by param ctx context param window no window param tab no tab param ad window id window param tab read only rab is r o param is created is created field param is timestamp is the timestamp not by return m fieldvo public static m fieldvo create std field properties ctx int window no int tab no int ad window id boolean tab read only boolean is created boolean is timestamp m fieldvo vo new m fieldvo ctx window no tab no ad window id tab read only vo column name is created created updated if is timestamp vo column name by vo display type is timestamp display type date time display type table if is timestamp vo ad reference value id 110 ad user table reference vo is displayed false vo is mandatory false vo is read only false vo is updateable true vo init finish return vo windowno tabno ad_window_id tabreadonly iscreated istimestamp mfieldvo mfieldvo createstdfield windowno tabno ad_window_id tabreadonly iscreated istimestamp mfieldvo mfieldvo windowno tabno ad_window_id tabreadonly columnname iscreated istimestamp columnname displaytype istimestamp displaytype datetime displaytype istimestamp ad_reference_value_id ad_user isdisplayed ismandatory isreadonly isupdateable initfinish private constructor param ctx context param window no window param tab no tab param ad window id window param tab read only read only private m fieldvo properties ctx int window no int tab no int ad window id boolean tab read only this ctx ctx this window no window no this tab no tab no this ad window id ad window id this tab read only tab read only windowno tabno ad_window_id tabreadonly mfieldvo windowno tabno ad_window_id tabreadonly windowno windowno tabno tabno ad_window_id ad_window_id tabreadonly tabreadonly set context including contained elements param new ctx new context public void set ctx properties new ctx ctx new ctx if lookup info null lookup info ctx new ctx newctx setctx newctx newctx lookupinfo lookupinfo newctx validate fields and create lookup info if required protected void init finish not null fields if display logic null display logic if default value null default value if field group null field group if description null description if help null help if callout null callout if read only logic null read only logic create lookup if not id if display type is lookup display type try lookup info m lookup factory get lookup info ctx window no ad column id display type env get language ctx column name ad reference value id is parent validation code catch exception e cannot create lookup c logger get log level severe no lookup info for column name e display type display type id lookupinfo initfinish displaylogic displaylogic defaultvalue defaultvalue fieldgroup fieldgroup readonlylogic readonlylogic displaytype islookup displaytype lookupinfo mlookupfactory getlookupinfo windowno ad_column_id displaytype getlanguage columnname ad_reference_value_id isparent validationcode clogger lookupinfo columnname displaytype displaytype clone field param ctx ctx param window no window no param tab no tab no param ad window id window id param tab read only r o return field or null protected m fieldvo clone properties ctx int window no int tab no int ad window id boolean tab read only m fieldvo clone new m fieldvo ctx window no tab no ad window id tab read only clone is process false database fields clone column name column name clone columnsql columnsql clone header header clone display type display type clone ad table id ad table id clone ad column id ad column id clone display length display length clone is same line is same line clone is displayed is displayed clone display logic display logic clone default value default value clone is mandatory is mandatory clone is read only is read only clone is updateable is updateable clone is always updateable is always updateable clone is heading is heading clone is field only is field only clone is encrypted field is encrypted field clone is encrypted column is encrypted column clone is selection column is selection column clone sort no sort no clone field length field length clone v format v format clone value min value min clone value max value max clone field group field group clone is key is key clone is parent is parent clone callout callout clone ad process id ad process id clone description description clone help help clone read only logic read only logic clone obscure type obscure type lookup clone validation code validation code clone ad reference value id ad reference value id clone lookup info lookup info process parameter clone is range is range clone default value2 default value2 return clone windowno tabno ad_window_id tabreadonly mfieldvo windowno tabno ad_window_id tabreadonly mfieldvo mfieldvo windowno tabno ad_window_id tabreadonly isprocess columnname columnname displaytype displaytype ad_table_id ad_table_id ad_column_id ad_column_id displaylength displaylength issameline issameline isdisplayed isdisplayed displaylogic displaylogic defaultvalue defaultvalue ismandatory ismandatory isreadonly isreadonly isupdateable isupdateable isalwaysupdateable isalwaysupdateable isheading isheading isfieldonly isfieldonly isencryptedfield isencryptedfield isencryptedcolumn isencryptedcolumn isselectioncolumn isselectioncolumn sortno sortno fieldlength fieldlength vformat vformat valuemin valuemin valuemax valuemax fieldgroup fieldgroup iskey iskey isparent isparent ad_process_id ad_process_id readonlylogic readonlylogic obscuretype obscuretype validationcode validationcode ad_reference_value_id ad_reference_value_id lookupinfo lookupinfo isrange isrange defaultvalue2 defaultvalue2 string representation return info public string to string string buffer sb new string buffer m fieldvo sb append ad column id append append column name append return sb to string tostring stringbuffer stringbuffer mfieldvo ad_column_id columnname tostring basic constructor public sup basic constructor param element adds an element to the element public sup element element add element element addelement basic constructor param element adds an element to the element public sup string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public sup add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public sup add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public sup add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public sup add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public sup remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get discount schema from cache param ctx context param m discountschema id id return m discount schema public static m discount schema get properties ctx int m discountschema id integer key new integer m discountschema id m discount schema ret value m discount schema s cache get key if ret value null return ret value ret value new m discount schema ctx m discountschema id null if ret value get id 0 s cache put key ret value return ret value m_discountschema_id mdiscountschema mdiscountschema m_discountschema_id m_discountschema_id mdiscountschema retvalue mdiscountschema s_cache retvalue retvalue retvalue mdiscountschema m_discountschema_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param m discountschema id id public m discount schema properties ctx int m discountschema id string trx name super ctx m discountschema id trx name if m discountschema id 0 set name set discount type discounttype flatpercent set flat discount env zero set isb partner flat discount false set is quantity based true y set cumulative level cumulativelevel line set valid from new timestamp system current time millis m_discountschema_id mdiscountschema m_discountschema_id trxname m_discountschema_id trxname m_discountschema_id setname setdiscounttype discounttype_flatpercent setflatdiscount setisbpartnerflatdiscount setisquantitybased setcumulativelevel cumulativelevel_line setvalidfrom currenttimemillis load constructor param ctx context param rs result set public m discount schema properties ctx result set rs string trx name super ctx rs trx name mdiscountschema resultset trxname trxname get breaks param reload reload return breaks public m discount schema break get breaks boolean reload if m breaks null reload return m breaks string sql select from m discountschemabreak where m discountschema id order by seq no array list m discount schema break list new array list m discount schema break prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm discountschema id result set rs pstmt execute query while rs next list add new m discount schema break get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m breaks new m discount schema break list size list to array m breaks return m breaks mdiscountschemabreak getbreaks m_breaks m_breaks m_discountschemabreak m_discountschema_id seqno arraylist mdiscountschemabreak arraylist mdiscountschemabreak preparedstatement preparestatement get_trxname setint getm_discountschema_id resultset executequery mdiscountschemabreak getctx get_trxname m_breaks mdiscountschemabreak toarray m_breaks m_breaks get lines param reload reload return lines public m discount schema line get lines boolean reload if m lines null reload return m lines string sql select from m discountschemaline where m discountschema id order by seq no array list m discount schema line list new array list m discount schema line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm discountschema id result set rs pstmt execute query while rs next list add new m discount schema line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m discount schema line list size list to array m lines return m lines mdiscountschemaline getlines m_lines m_lines m_discountschemaline m_discountschema_id seqno arraylist mdiscountschemaline arraylist mdiscountschemaline preparedstatement preparestatement get_trxname setint getm_discountschema_id resultset executequery mdiscountschemaline getctx get_trxname m_lines mdiscountschemaline toarray m_lines m_lines calculate discounted price param qty quantity param price price param m product id product param b partner flat discount flat discount return discount or zero public big decimal calculate price big decimal qty big decimal price int m product id int m product category id big decimal b partner flat discount log fine price price qty qty if price null env zero compare to price 0 return price big decimal discount calculate discount qty price m product id m product category id b partner flat discount nothing to calculate if discount null discount signum 0 return price big decimal onehundred new big decimal 100 big decimal multiplier onehundred subtract discount multiplier multiplier divide onehundred 6 big decimal round half up big decimal new price price multiply multiplier log fine new price return new price m_product_id bpartnerflatdiscount bigdecimal calculateprice bigdecimal bigdecimal m_product_id m_product_category_id bigdecimal bpartnerflatdiscount compareto bigdecimal calculatediscount m_product_id m_product_category_id bpartnerflatdiscount bigdecimal bigdecimal bigdecimal bigdecimal round_half_up bigdecimal newprice newprice newprice calculate discount percentage param qty quantity param price price param m product id product param b partner flat discount flat discount return discount or zero public big decimal calculate discount big decimal qty big decimal price int m product id int m product category id big decimal b partner flat discount if b partner flat discount null b partner flat discount env zero if discounttype flatpercent equals get discount type if isb partner flat discount return b partner flat discount return get flat discount not supported else if discounttype formula equals get discount type discounttype pricelist equals get discount type log info not supported yet discount type get discount type return env zero price breaks get breaks false boolean found false big decimal amt price multiply qty if is quantity based log finer qty qty m product id m product id m product category id m product category id else log finer amt amt m product id m product id m product category id m product category id for int i 0 i m breaks length i m discount schema break br m breaks i if br is active continue if is quantity based if br applies qty m product id m product category id log finer no br continue log finer yes br else if br applies amt m product id m product category id log finer no br continue log finer yes br line applies big decimal discount null if br isb partner flat discount discount b partner flat discount else discount br get break discount log fine discount discount return discount for all breaks return env zero m_product_id bpartnerflatdiscount bigdecimal calculatediscount bigdecimal bigdecimal m_product_id m_product_category_id bigdecimal bpartnerflatdiscount bpartnerflatdiscount bpartnerflatdiscount discounttype_flatpercent getdiscounttype isbpartnerflatdiscount bpartnerflatdiscount getflatdiscount discounttype_formula getdiscounttype discounttype_pricelist getdiscounttype discounttype getdiscounttype getbreaks bigdecimal isquantitybased m_product_id m_product_id m_product_category_id m_product_category_id m_product_id m_product_id m_product_category_id m_product_category_id m_breaks mdiscountschemabreak m_breaks isactive isquantitybased m_product_id m_product_category_id m_product_id m_product_category_id bigdecimal isbpartnerflatdiscount bpartnerflatdiscount getbreakdiscount before save param new record new return true protected boolean before save boolean new record if get valid from null set valid from time util get day null return true newrecord beforesave newrecord getvalidfrom setvalidfrom timeutil getday renumber return lines updated public int re seq int count 0 lines m discount schema line lines get lines true for int i 0 i lines length i int line i 1 10 if line lines i get seq no lines i set seq no line if lines i save count m lines null breaks m discount schema break breaks get breaks true for int i 0 i breaks length i int line i 1 10 if line breaks i get seq no breaks i set seq no line if breaks i save count m breaks null return count reseq mdiscountschemaline getlines getseqno setseqno m_lines mdiscountschemabreak getbreaks getseqno setseqno m_breaks get contents return contents public object get contents return contents getcontents prepare protected void prepare p c year id getrecord id p_c_year_id getrecord_id process return info throws exception protected string do it throws exception m year year new m year get ctx p c year id get trxname if p c year id 0 year get id p c year id throw new compiere user error not found c year id p c year id log info year to string if year create std periods null return ok return error doit myear myear getctx p_c_year_id get_trxname p_c_year_id get_id p_c_year_id compiereusererror notfound c_year_id p_c_year_id tostring createstdperiods prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p c periodcontrol id getrecord id processinfoparameter getparameter getparametername getparameter p_c_periodcontrol_id getrecord_id process return message throws exception protected string do it throws exception log info c periodcontrol id p c periodcontrol id m period control pc new m period control get ctx p c periodcontrol id get trxname if pc get id 0 throw new compiere user error not found c periodcontrol id p c periodcontrol id permanently closed if m period control periodaction permanentlycloseperiod equals pc get period status throw new compiere user error period status pc get period status no action if m period control periodaction noaction equals pc get period action return ok open if m period control periodaction openperiod equals pc get period action pc set period status m period control periodstatus open close if m period control periodaction closeperiod equals pc get period action pc set period status m period control periodstatus closed close permanently if m period control periodaction permanentlycloseperiod equals pc get period action pc set period status m period control periodstatus permanentlyclosed pc set period action m period control periodaction noaction boolean ok pc save reset cache cache mgt get reset c periodcontrol 0 cache mgt get reset c period pc getc period id if ok return error return ok doit c_periodcontrol_id p_c_periodcontrol_id mperiodcontrol mperiodcontrol getctx p_c_periodcontrol_id get_trxname get_id compiereusererror notfound c_periodcontrol_id p_c_periodcontrol_id mperiodcontrol periodaction_permanentlycloseperiod getperiodstatus compiereusererror periodstatus getperiodstatus mperiodcontrol periodaction_noaction getperiodaction mperiodcontrol periodaction_openperiod getperiodaction setperiodstatus mperiodcontrol periodstatus_open mperiodcontrol periodaction_closeperiod getperiodaction setperiodstatus mperiodcontrol periodstatus_closed mperiodcontrol periodaction_permanentlycloseperiod getperiodaction setperiodstatus mperiodcontrol periodstatus_permanentlyclosed setperiodaction mperiodcontrol periodaction_noaction cachemgt c_periodcontrol cachemgt c_period getc_period_id standard constructor public x ad sequence no properties ctx int ad sequence no id string trx name super ctx ad sequence no id trx name if ad sequence no id 0 setad sequence id 0 set current next 0 set year null x_ad_sequence_no ad_sequence_no_id trxname ad_sequence_no_id trxname ad_sequence_no_id setad_sequence_id setcurrentnext setyear load constructor public x ad sequence no properties ctx result set rs string trx name super ctx rs trx name x_ad_sequence_no resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad sequence no append get id append return sb to string tostring stringbuffer stringbuffer x_ad_sequence_no get_id tostring set sequence document sequence public void setad sequence id int ad sequence id if ad sequence id 1 throw new illegal argument exception ad sequence id is mandatory set valuenocheck ad sequence id new integer ad sequence id setad_sequence_id ad_sequence_id ad_sequence_id illegalargumentexception ad_sequence_id set_valuenocheck ad_sequence_id ad_sequence_id get sequence document sequence public int getad sequence id integer ii integer get value ad sequence id if ii null return 0 return ii int value getad_sequence_id get_value ad_sequence_id intvalue set current next the next number to be used public void set current next int current next set value current next new integer current next setcurrentnext currentnext set_value currentnext currentnext get current next the next number to be used public int get current next integer ii integer get value current next if ii null return 0 return ii int value getcurrentnext get_value currentnext intvalue set year calendar year public void set year string year if year null throw new illegal argument exception year is mandatory if year length 4 log warning length 4 truncated year year substring 0 3 set valuenocheck year year setyear illegalargumentexception set_valuenocheck get year calendar year public string get year return string get value year getyear get_value standard constructor public x m matchinv properties ctx int m matchinv id string trx name super ctx m matchinv id trx name if m matchinv id 0 setc invoiceline id 0 set date acct new timestamp system current time millis set date trx new timestamp system current time millis setm inoutline id 0 setm matchinv id 0 setm product id 0 set posted false set processed false set processing false set qty env zero x_m_matchinv m_matchinv_id trxname m_matchinv_id trxname m_matchinv_id setc_invoiceline_id setdateacct currenttimemillis setdatetrx currenttimemillis setm_inoutline_id setm_matchinv_id setm_product_id setposted setprocessed setprocessing setqty load constructor public x m matchinv properties ctx result set rs string trx name super ctx rs trx name x_m_matchinv resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m matchinv append get id append return sb to string tostring stringbuffer stringbuffer x_m_matchinv get_id tostring set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 1 throw new illegal argument exception c invoiceline id is mandatory set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id illegalargumentexception c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set valuenocheck date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_valuenocheck datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 set valuenocheck m attributesetinstance id null else set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set match invoice match shipment receipt to invoice public void setm matchinv id int m matchinv id if m matchinv id 1 throw new illegal argument exception m matchinv id is mandatory set valuenocheck m matchinv id new integer m matchinv id setm_matchinv_id m_matchinv_id m_matchinv_id illegalargumentexception m_matchinv_id set_valuenocheck m_matchinv_id m_matchinv_id get match invoice match shipment receipt to invoice public int getm matchinv id integer ii integer get value m matchinv id if ii null return 0 return ii int value getm_matchinv_id get_value m_matchinv_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set posted posting status public void set posted boolean posted set valuenocheck posted new boolean posted setposted set_valuenocheck get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set valuenocheck qty qty setqty bigdecimal illegalargumentexception set_valuenocheck get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value creates a ui for a j text area tab is the normal focus traversal key to enter tab enter ctrl tab param ta a text area return the ui public static componentui createui j component ta return new compiere text areaui ta jtextarea jcomponent compieretextareaui constructor param ta text area public compiere text areaui j component ta if ta instanceof j text component m editor j text component ta compieretextareaui jcomponent jtextcomponent m_editor jtextcomponent create keymap return key map protected keymap create keymap keymap map super create keymap map add action for key stroke s stroke s action return map createkeymap createkeymap addactionforkeystroke s_stroke s_action property change param evt event protected void property change property change event evt string name evt get property name if editable equals name update focus traversal keysx else super property change evt propertychange propertychangeevent getpropertyname updatefocustraversalkeysx propertychange update focus traversal keysx void update focus traversal keysx if m editor null return editor kit editor kit get editor kit m editor if editor kit null editor kit instanceof default editor kit set awt key stroke stored forward traversal keys m editor get focus traversal keys keyboard focus manager forward traversal keys set awt key stroke stored backward traversal keys m editor get focus traversal keys keyboard focus manager backward traversal keys set awt key stroke forward traversal keys new hash set awt key stroke stored forward traversal keys set awt key stroke backward traversal keys new hash set awt key stroke stored backward traversal keys forward traversal keys add key stroke get key stroke key event vk tab 0 forward traversal keys remove s stroke backward traversal keys add key stroke get key stroke key event vk tab input event shift mask look and feel install property m editor focus traversal keys forward forward traversal keys look and feel install property m editor focus traversal keys backward backward traversal keys updatefocustraversalkeysx updatefocustraversalkeysx m_editor editorkit editorkit geteditorkit m_editor editorkit editorkit defaulteditorkit awtkeystroke storedforwardtraversalkeys m_editor getfocustraversalkeys keyboardfocusmanager forward_traversal_keys awtkeystroke storedbackwardtraversalkeys m_editor getfocustraversalkeys keyboardfocusmanager backward_traversal_keys awtkeystroke forwardtraversalkeys hashset awtkeystroke storedforwardtraversalkeys awtkeystroke backwardtraversalkeys hashset awtkeystroke storedbackwardtraversalkeys forwardtraversalkeys keystroke getkeystroke keyevent vk_tab forwardtraversalkeys s_stroke backwardtraversalkeys keystroke getkeystroke keyevent vk_tab inputevent shift_mask lookandfeel installproperty m_editor focustraversalkeysforward forwardtraversalkeys lookandfeel installproperty m_editor focustraversalkeysbackward backwardtraversalkeys constructor public v schedule panel set height 250 add mouse listener this vschedulepanel setheight addmouselistener set type calculate number of days and set param type schedule type see v schedule type public void set type int type if type v schedule type month m nodays 31 else if type v schedule type week m nodays 7 else m nodays 1 set size vschedule type_ settype vschedule type_month m_nodays vschedule type_week m_nodays m_nodays setsize set info schedule for callback param is info schedule public void set info schedule info schedule is m infoschedule is infoschedule infoschedule setinfoschedule infoschedule m_infoschedule enable disable to create new assignments param create new if true allows to create new assignments public void set create new boolean create new m createnew create new createnew setcreatenew createnew m_createnew createnew from height calculate set size param height height in pixels public void set height int height m height height set size setheight m_height setsize set size public void set size width font metrics fm null graphics g get graphics if g null g env get graphics this if g null fm g get font metrics g get font the correct way m daywidth 0 for int i 0 i m nodays i if fm null string string get heading i int width fm string width string if width m daywidth m daywidth width m daywidth 20 if m daywidth 180 minimum width m daywidth 180 int w m nodays m daywidth dimension size new dimension w m height set preferred size size set minimum size size set maximum size size setsize fontmetrics getgraphics getgraphics getfontmetrics getfont m_daywidth m_nodays getheading stringwidth m_daywidth m_daywidth m_daywidth m_daywidth m_daywidth m_nodays m_daywidth m_height setpreferredsize setminimumsize setmaximumsize set time panel for info about tile slots param time panel time panel public void set time panel v schedule time panel time panel m timepanel time panel timepanel settimepanel vscheduletimepanel timepanel m_timepanel timepanel set slots param mass assignment slots param s resource id resource param start date start date param end date end date public void set assignment slots m assignment slot mass int s resource id timestamp start date timestamp end date log fine s resource id s resource id m s resource id s resource id m nodays time util get days between start date end date m startdate start date m slots mass m where new rectangle m slots length calculate assignments for int i 0 m slots null i m slots length i m assignment slot mas m slots i int day index time util get days between m startdate mas get start time if day index 0 day index m nodays system out println assignment i invalid date range mas get info int x width m daywidth mas getx max int x start day index m daywidth start day slot x start mas getx pos x width offset int x end x start x width int y start m timepanel get sloty start mas gety start int y end m timepanel get sloty end mas gety end system out println assignment i xpos mas getx pos xmax mas getx max ystart mas gety start yend mas gety end mas get info m where i new rectangle x start 1 y start 1 x width 1 y end y start 1 calculate assignments set size repaint s_resource_id startdate enddate setassignmentslots massignmentslot s_resource_id startdate enddate s_resource_id s_resource_id m_s_resource_id s_resource_id m_nodays timeutil getdaysbetween startdate enddate m_startdate startdate m_slots m_where m_slots m_slots m_slots massignmentslot m_slots dayindex timeutil getdaysbetween m_startdate getstarttime dayindex dayindex m_nodays daterange getinfo xwidth m_daywidth getxmax xstart dayindex m_daywidth xstart getxpos xwidth xend xstart xwidth ystart m_timepanel getslotystart getystart yend m_timepanel getslotyend getyend getxpos getxmax getystart getyend getinfo m_where xstart ystart xwidth yend ystart setsize paint it param g the code graphics code object public void paint graphics g log fine v schedule panel paint g get clip graphics2d g2d graphics2d g dimension size get preferred size rectangle clip bounds g2d get clip bounds int w size width int h size height paint background g2d set paint color white g2d fill3d rect 1 1 w 2 h 2 true if m timepanel null required return int header height m timepanel get header height horizontal lines g2d set stroke v schedule time panel get stroke true for int i 1 i m timepanel get slot count i g2d set paint color gray int yy m timepanel get sloty start i g2d draw line 1 yy w 2 yy top horiz line heading and right vertical lines g2d set stroke v schedule time panel get stroke false for int i 0 i m nodays i rectangle where new rectangle i m daywidth 0 m daywidth header height if where intersects clip bounds continue header background compiere utils paint3 deffect g2d where false true g2d set paint color blue text layout layout new text layout get heading i g2d get font g2d get font render context float hh layout get ascent layout get descent layout draw g2d where x m daywidth layout get advance 2 center where height hh 2 layout get ascent center line g2d set paint color black int x end i 1 m daywidth g2d draw line x end 1 x end h 1 right part paint assignments for int i 0 m slots null i m slots length i if m where i intersects clip bounds continue background g2d set color m slots i get color true g2d fill m where i text string string m slots i get info name description attributed string as new attributed string string as add attribute text attribute font g2d get font as add attribute text attribute foreground m slots i get color false italics for description int start it string index of int end it string last index of if start it 1 end it 1 as add attribute text attribute posture text attribute posture oblique start it end it paint multiple lines if required attributed character iterator aci as get iterator line break measurer measurer new line break measurer aci g2d get font render context float wrapping width m where i width 2 margin float cury m where i y margin text layout layout null int y end m where i y m where i height while measurer get position aci get end index cury y end layout measurer next layout wrapping width cury layout get ascent if cury y end layout draw g2d m where i x margin cury assignments paint borders g2d set paint color black g2d set stroke v schedule time panel get stroke false g2d draw line 1 1 1 h 1 left g2d draw line 1 1 w 1 1 top heading line g2d draw line 1 header height w 1 header height final lines g2d set stroke v schedule time panel get stroke false g2d draw line w 1 1 w 1 h 1 right g2d draw line 1 h 1 w 1 h 1 bottom line vschedulepanel getclip getpreferredsize clipbounds getclipbounds setpaint fill3drect m_timepanel headerheight m_timepanel getheaderheight setstroke vscheduletimepanel getstroke m_timepanel getslotcount setpaint m_timepanel getslotystart drawline setstroke vscheduletimepanel getstroke m_nodays m_daywidth m_daywidth headerheight clipbounds compiereutils paint3deffect setpaint textlayout textlayout getheading getfont getfontrendercontext getascent getdescent m_daywidth getadvance getascent setpaint xend m_daywidth drawline xend xend m_slots m_slots m_where clipbounds setcolor m_slots getcolor m_where m_slots getinfonamedescription attributedstring attributedstring addattribute textattribute getfont addattribute textattribute m_slots getcolor startit indexof endit lastindexof startit endit addattribute textattribute textattribute posture_oblique startit endit attributedcharacteriterator getiterator linebreakmeasurer linebreakmeasurer getfontrendercontext wrappingwidth m_where m_where textlayout yend m_where m_where getposition getendindex yend nextlayout wrappingwidth getascent yend m_where setpaint setstroke vscheduletimepanel getstroke drawline drawline drawline headerheight headerheight setstroke vscheduletimepanel getstroke drawline drawline return heading for index param index index return heading private string get heading int index gregorian calendar cal new gregorian calendar if m startdate null cal set time m startdate cal add java util calendar day of year index simple date format format simple date format date format get date instance date format full language get login language get locale return format format cal get time getheading gregoriancalendar gregoriancalendar m_startdate settime m_startdate day_of_year simpledateformat simpledateformat dateformat getdateinstance dateformat getloginlanguage getlocale gettime mouse clicked start assignment dialog param e event public void mouse clicked mouse event e if e get click count 2 return log finer e to string rectangle hit rect new rectangle e getx 1 e gety 1 3 3 day int day index e getx m daywidth if day index m nodays day index m nodays 1 system out println day index day index time util add days m startdate day index time int time index m timepanel get time slot index e gety system out println time index time index m timepanel get time slot time index check if there is an existing assignment for int i 0 i m slots length i if m where i intersects hit rect m assignment slot mas m slots i system out println existing mas get info if mas is assignment return v assignment dialog vad new v assignment dialog env get frame this m slots i getm assignment false m createnew m infoschedule m assignment callback vad getm resource assignment return if m createnew m resource assignment ma new m resource assignment env get ctx 0 null ma sets resource id m s resource id ma set assign date from time util get day time time util add days m startdate day index m timepanel get time slot time index get start time ma set qty new big decimal 1 v assignment dialog vad new v assignment dialog env get frame this ma false m createnew m infoschedule m assignment callback vad getm resource assignment return assignmentdialog mouseclicked mouseevent getclickcount tostring hitrect dayindex m_daywidth dayindex m_nodays dayindex m_nodays dayindex dayindex timeutil adddays m_startdate dayindex timeindex m_timepanel gettimeslotindex timeindex timeindex m_timepanel gettimeslot timeindex m_slots m_where hitrect massignmentslot m_slots getinfo isassignment vassignmentdialog vassignmentdialog getframe m_slots getmassignment m_createnew m_infoschedule massignmentcallback getmresourceassignment m_createnew mresourceassignment mresourceassignment getctx sets_resource_id m_s_resource_id setassigndatefrom timeutil getdaytime timeutil adddays m_startdate dayindex m_timepanel gettimeslot timeindex getstarttime setqty bigdecimal vassignmentdialog vassignmentdialog getframe m_createnew m_infoschedule massignmentcallback getmresourceassignment public void mouse pressed mouse event e mousepressed mouseevent public void mouse released mouse event e mousereleased mouseevent public void mouse entered mouse event e mouseentered mouseevent public void mouse exited mouse event e mouseexited mouseevent dispose public void dispose m infoschedule null m timepanel null m where null m slots null this remove all m_infoschedule m_timepanel m_where m_slots removeall main test start param args public static void main string args try load the jdbc driver driver manager register driver new oracle jdbc oracle driver s ds new oracle data source s ds set driver type driver s ds set server name dev s ds set network protocol tcp s ds set database name dev1 s ds set port number 1521 s ds set user adempiere s ds set password adempiere s cc new oracle connection cache impl s cc set driver type driver s cc set server name dev s cc set network protocol tcp s cc set database name dev1 s cc set port number 1521 s cc set user adempiere s cc set password adempiere s cc set max limit num of threads 4 s cc set cache scheme oracle connection cache impl fixed wait scheme s cc set cache scheme oracle connection cache impl dynamic scheme s fetchsize 10 s ctype c multiple statement timing statement timing statement timing s ctype c datasource statement timing statement timing statement timing s ctype c cache statement timing statement timing statement timing s fetchsize 20 s ctype c multiple statement timing statement timing statement timing s ctype c datasource statement timing statement timing statement timing s ctype c cache statement timing statement timing statement timing s fetchsize 10 standard value s rtype r jdbc rowset row set timing row set timing row set timing s rtype r cached rowset row set timing row set timing row set timing s ctype c shared s do yield false run test run test s do yield true run test run test s ctype c multiple s do yield false run test run test s do yield true run test run test s ctype c precreated s do yield false run test run test s do yield true run test run test s ctype c datasource s do yield false run test run test s do yield true run test run test s ctype c cache s do yield false run test run test s do yield true run test run test catch exception e e print stack trace drivermanager registerdriver oracledriver s_ds oracledatasource s_ds setdrivertype s_ds setservername s_ds setnetworkprotocol s_ds setdatabasename s_ds setportnumber s_ds setuser s_ds setpassword s_cc oracleconnectioncacheimpl s_cc setdrivertype s_cc setservername s_cc setnetworkprotocol s_cc setdatabasename s_cc setportnumber s_cc setuser s_cc setpassword s_cc setmaxlimit num_of_threads s_cc setcachescheme oracleconnectioncacheimpl fixed_wait_scheme s_cc setcachescheme oracleconnectioncacheimpl dynamic_scheme s_fetchsize s_ctype c_multiple statementtiming statementtiming statementtiming s_ctype c_datasource statementtiming statementtiming statementtiming s_ctype c_cache statementtiming statementtiming statementtiming s_fetchsize s_ctype c_multiple statementtiming statementtiming statementtiming s_ctype c_datasource statementtiming statementtiming statementtiming s_ctype c_cache statementtiming statementtiming statementtiming s_fetchsize s_rtype r_jdbc_rowset rowsettiming rowsettiming rowsettiming s_rtype r_cached_rowset rowsettiming rowsettiming rowsettiming s_ctype c_shared s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_multiple s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_precreated s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_datasource s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_cache s_do_yield runtest runtest s_do_yield runtest runtest printstacktrace run the test throws exception static void run test throws exception create the threads thread thread list new thread num of threads s conn new connection num of threads if s ctype c shared s sconn driver manager get connection connection uid pwd spawn threads for int i 0 i num of threads i if s ctype c precreated s conn i driver manager get connection connection uid pwd thread list i new jdbc test i thread list i start start everyone at the same time long start system current time millis set green light wait for all threads to end for int i 0 i num of threads i thread list i join if s sconn null s sconn close s sconn null for int i 0 i num of threads i if s conn i null s conn i close s conn i null long result system current time millis start system out print c info s ctype threads num of threads t yield s do yield tms result teach result num of threads if s ctype c cache system out print t cache size s cc get cache size active s cc get active size system out println runtest threadlist num_of_threads s_conn num_of_threads s_ctype c_shared s_sconn drivermanager getconnection num_of_threads s_ctype c_precreated s_conn drivermanager getconnection threadlist jdbctest threadlist currenttimemillis setgreenlight num_of_threads threadlist s_sconn s_sconn s_sconn num_of_threads s_conn s_conn s_conn currenttimemillis c_info s_ctype num_of_threads tyield s_do_yield num_of_threads s_ctype c_cache tcachesize s_cc getcachesize s_cc getactivesize statement timing private static void statement timing try long start connection system current time millis connection conn null if s ctype c multiple conn driver manager get connection connection uid pwd if s ctype c datasource conn s ds get connection if s ctype c cache conn s cc get connection long start statement system current time millis statement stmt conn create statement stmt set fetch size s fetchsize long start query system current time millis result set rs stmt execute query statement int i 0 long start retrieve system current time millis while rs next rs get string 1 i long end retrieve system current time millis system out println i rs close rs null long end query system current time millis stmt close stmt null long end statement system current time millis conn close conn null long end connection system current time millis system out println c info s ctype fetch s fetchsize t conn start statement start connection t stmt start query start statement t query start retrieve start query t retrieve end retrieve start retrieve t cl rs end query end retrieve t cl stmt end statement end query t cl conn end connection end statement t total end connection start connection t stmt end statement start statement t query end query start query catch sql exception e e print stack trace statementtiming startconnection currenttimemillis s_ctype c_multiple drivermanager getconnection s_ctype c_datasource s_ds getconnection s_ctype c_cache s_cc getconnection startstatement currenttimemillis createstatement setfetchsize s_fetchsize startquery currenttimemillis resultset executequery startretrieve currenttimemillis getstring endretrieve currenttimemillis endquery currenttimemillis endstatement currenttimemillis endconnection currenttimemillis c_info s_ctype s_fetchsize tconn startstatement startconnection tstmt startquery startstatement tquery startretrieve startquery tretrieve endretrieve startretrieve tclrs endquery endretrieve tclstmt endstatement endquery tclconn endconnection endstatement endconnection startconnection tstmt endstatement startstatement tquery endquery startquery sqlexception printstacktrace row set timing private static void row set timing try long start connection system current time millis row set rowset null if s rtype r jdbc rowset rowset new oraclejdbc row set else if s rtype r cached rowset rowset new oracle cached row set rowset set url connection rowset set username uid rowset set password pwd rowset set fetch size s fetchsize long start statement system current time millis rowset set command statement long start query system current time millis rowset execute long start retrieve system current time millis while rowset next long end retrieve system current time millis long end query system current time millis rowset close long end statement system current time millis long end connection system current time millis system out println r info s rtype fetch s fetchsize t conn start statement start connection t stmt start query start statement t query start retrieve start query t retrieve end retrieve start retrieve t cl rs end query end retrieve t cl stmt end statement end query t cl conn end connection end statement t total end connection start connection t stmt end statement start statement t query end query start query catch sql exception e e print stack trace rowsettiming startconnection currenttimemillis rowset s_rtype r_jdbc_rowset oraclejdbcrowset s_rtype r_cached_rowset oraclecachedrowset seturl setusername setpassword setfetchsize s_fetchsize startstatement currenttimemillis setcommand startquery currenttimemillis startretrieve currenttimemillis endretrieve currenttimemillis endquery currenttimemillis endstatement currenttimemillis endconnection currenttimemillis r_info s_rtype s_fetchsize tconn startstatement startconnection tstmt startquery startstatement tquery startretrieve startquery tretrieve endretrieve startretrieve tclrs endquery endretrieve tclstmt endstatement endquery tclconn endconnection endstatement endconnection startconnection tstmt endstatement startstatement tquery endquery startquery sqlexception printstacktrace jdbc test param id thread id public jdbc test int id super m myid id jdbctest m_myid async worker public void run result set rs null statement stmt null try while get green light yield if with output system out println thread m myid started get the connection statement if s ctype c shared stmt s sconn create statement else if s ctype c multiple s conn m myid driver manager get connection connection uid pwd stmt s conn m myid create statement else if s ctype c precreated stmt s conn m myid create statement else if s ctype c datasource s conn m myid s ds get connection stmt s conn m myid create statement else if s ctype c cache s conn m myid s cc get connection stmt s conn m myid create statement stmt set fetch size s fetchsize execute the query rs stmt execute query statement loop through the results while rs next if s do yield yield yield to other threads close all the resources rs close rs null close the statement stmt close stmt null close the local connection if s ctype c shared s ctype c precreated else s conn m myid close s conn m myid null catch exception e system out println thread m myid got exception e e print stack trace return if with output system out println thread m myid finished resultset getgreenlight with_output m_myid s_ctype c_shared s_sconn createstatement s_ctype c_multiple s_conn m_myid drivermanager getconnection s_conn m_myid createstatement s_ctype c_precreated s_conn m_myid createstatement s_ctype c_datasource s_conn m_myid s_ds getconnection s_conn m_myid createstatement s_ctype c_cache s_conn m_myid s_cc getconnection s_conn m_myid createstatement setfetchsize s_fetchsize executequery s_do_yield s_ctype c_shared s_ctype c_precreated s_conn m_myid s_conn m_myid m_myid printstacktrace with_output m_myid static boolean green light false static synchronized void set green light green light true greenlight setgreenlight greenlight static boolean green light false static synchronized void set green light green light true synchronized boolean get green light return green light greenlight setgreenlight greenlight getgreenlight greenlight get m invoice schedule from cache param ctx context param c invoiceschedule id id return m invoice schedule public static m invoice schedule get properties ctx int c invoiceschedule id string trx name integer key new integer c invoiceschedule id m invoice schedule ret value m invoice schedule s cache get key if ret value null return ret value ret value new m invoice schedule ctx c invoiceschedule id trx name if ret value get id 0 s cache put key ret value return ret value minvoiceschedule c_invoiceschedule_id minvoiceschedule minvoiceschedule c_invoiceschedule_id trxname c_invoiceschedule_id minvoiceschedule retvalue minvoiceschedule s_cache retvalue retvalue retvalue minvoiceschedule c_invoiceschedule_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c invoiceschedule id id public m invoice schedule properties ctx int c invoiceschedule id string trx name super ctx c invoiceschedule id trx name c_invoiceschedule_id minvoiceschedule c_invoiceschedule_id trxname c_invoiceschedule_id trxname load constructor param ctx context param rs result set public m invoice schedule properties ctx result set rs string trx name super ctx rs trx name minvoiceschedule resultset trxname trxname can i send invoice return true if i can send invoice public boolean can invoice timestamp x date big decimal order amt amount if is amount get amt null order amt null order amt compare to get amt 0 return true daily if invoicefrequency daily equals get invoice frequency return true remove time x date time util get day x date calendar today time util get today weekly if invoicefrequency weekly equals get invoice frequency calendar cutoff time util get today cutoff set calendar day of week get calendar day get invoice week day cutoff if cutoff after today cutoff add calendar day of year 7 timestamp cutoff date new timestamp cutoff get time in millis log fine can invoice date x date cutoff cutoff date x date after cutoff date if x date after cutoff date return false calendar invoice time util get today invoice set calendar day of week get calendar day get invoice week day if invoice after today invoice add calendar day of year 7 timestamp invoice date new timestamp invoice get time in millis log fine can invoice date x date invoice invoice date x date after invoice date if x date after invoice date return false return true monthly if invoicefrequency monthly equals get invoice frequency invoicefrequency twicemonthly equals get invoice frequency if get invoice day cutoff 0 calendar cutoff time util get today cutoff set calendar day of month get invoice day cutoff if cutoff after today cutoff add calendar month 1 timestamp cutoff date new timestamp cutoff get time in millis log fine can invoice date x date cutoff cutoff date x date after cutoff date if x date after cutoff date return false calendar invoice time util get today invoice set calendar day of month get invoice day if invoice after today invoice add calendar month 1 timestamp invoice date new timestamp invoice get time in millis log fine can invoice date x date invoice invoice date x date after invoice date if x date after invoice date return false return true bi monthly 15 if invoicefrequency twicemonthly equals get invoice frequency if get invoice day cutoff 0 calendar cutoff time util get today cutoff set calendar day of month get invoice day cutoff 15 if cutoff after today cutoff add calendar month 1 timestamp cutoff date new timestamp cutoff get time in millis if x date after cutoff date return false calendar invoice time util get today invoice set calendar day of month get invoice day 15 if invoice after today invoice add calendar month 1 timestamp invoice date new timestamp invoice get time in millis if x date after invoice date return false return true return false caninvoice xdate bigdecimal orderamt isamount getamt orderamt orderamt compareto getamt invoicefrequency_daily getinvoicefrequency xdate timeutil getday xdate timeutil gettoday invoicefrequency_weekly getinvoicefrequency timeutil gettoday day_of_week getcalendarday getinvoiceweekdaycutoff day_of_year cutoffdate gettimeinmillis caninvoice xdate cutoffdate xdate cutoffdate xdate cutoffdate timeutil gettoday day_of_week getcalendarday getinvoiceweekday day_of_year invoicedate gettimeinmillis caninvoice xdate invoicedate xdate invoicedate xdate invoicedate invoicefrequency_monthly getinvoicefrequency invoicefrequency_twicemonthly getinvoicefrequency getinvoicedaycutoff timeutil gettoday day_of_month getinvoicedaycutoff cutoffdate gettimeinmillis caninvoice xdate cutoffdate xdate cutoffdate xdate cutoffdate timeutil gettoday day_of_month getinvoiceday invoicedate gettimeinmillis caninvoice xdate invoicedate xdate invoicedate xdate invoicedate invoicefrequency_twicemonthly getinvoicefrequency getinvoicedaycutoff timeutil gettoday day_of_month getinvoicedaycutoff cutoffdate gettimeinmillis xdate cutoffdate timeutil gettoday day_of_month getinvoiceday invoicedate gettimeinmillis xdate invoicedate convert to calendar day param day invoice week day return day private int get calendar day string day if invoiceweekday friday equals day return calendar friday if invoiceweekday saturday equals day return calendar saturday if invoiceweekday sunday equals day return calendar sunday if invoiceweekday monday equals day return calendar monday if invoiceweekday tuesday equals day return calendar tuesday if invoiceweekday wednesday equals day return calendar wednesday if invoiceweekday thursday equals day return calendar thursday getcalendarday invoiceweekday_friday invoiceweekday_saturday invoiceweekday_sunday invoiceweekday_monday invoiceweekday_tuesday invoiceweekday_wednesday invoiceweekday_thursday get content return content public object get contents return contents getcontents html string constructor param html html code public html element string html if html null html equals throw new illegal argument exception html element is null log fine length html length create view m renderer html renderer get html htmlelement illegalargumentexception htmlelement m_renderer htmlrenderer layout and calculate size set p width p height return size protected boolean calculate size if p sizecalculated return true p height m renderer get height p width m renderer get width limits if p maxwidth 0f p width p maxwidth if p maxheight 0f if p maxheight 1f one line only p height m renderer get height one line else p height p maxheight system out println html element calculate size width p width p maxwidth height p height p maxheight m renderer set allocation int p width int p height return true p_width p_height calculatesize p_sizecalculated p_height m_renderer getheight p_width m_renderer getwidth p_maxwidth p_width p_maxwidth p_maxheight p_maxheight p_height m_renderer getheightoneline p_height p_maxheight htmlelement p_width p_maxwidth p_height p_maxheight m_renderer setallocation p_width p_height paint print calculate actual size the text is printed in the topmost left position i e the leading is below the line param g2d graphics param page start top left location of page param page no page number for multi page support 0 header footer ignored param ctx print context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view 36 0 137 015625 clip java awt rectangle x 0 y 0 width 639 height 804 translate 1 0 56 0 scale 1 0 1 0 shear 0 0 0 0 log finest html element paint p pagelocation x p pagelocation y clip g2d get clip translate g2d get transform get translatex g2d get transform get translatey scale g2d get transform get scalex g2d get transform get scaley shear g2d get transform get shearx g2d get transform get sheary point2d double location get absolute location page start log finest html element paint page start page start location location rectangle allocation m renderer get allocation g2d translate location x location y m renderer paint g2d allocation g2d translate location x location y pagestart pageno isview ids pageno pagestart isview htmlelement p_pagelocation p_pagelocation getclip gettransform gettranslatex gettransform gettranslatey gettransform getscalex gettransform getscaley gettransform getshearx gettransform getsheary getabsolutelocation pagestart htmlelement pagestart pagestart m_renderer getallocation m_renderer string representation return info public string to string string buffer sb new string buffer html element sb append bounds append get bounds append height append p height append append p maxheight append width append p width append append p maxheight append page location append p pagelocation append sb append return sb to string tostring stringbuffer stringbuffer htmlelement getbounds p_height p_maxheight p_width p_maxheight pagelocation p_pagelocation tostring is content html param content content return true if html public static boolean ishtml object content if content null return false string s content to string if s length 20 assumption return false s s trim to upper case if s starts with html return true return false tostring touppercase startswith prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals must be stocked must be stocked string para i get parameter else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter mustbestocked mustbestocked getparameter p_record_id getrecord_id process return message throws exception protected string do it throws exception string sql string sqlupd string sqlins string sqldel int cntu 0 int cntd 0 int cnti 0 int totu 0 int toti 0 int totd 0 int next no boolean is created false boolean processed false int ad client id 0 int ad org id 0 log info search fields in m production get info lock sql select is created processed ad client id ad org id from m production where m production id p record id prepared statement pstmt db prepare statement sql result set rs pstmt execute query while rs next is created rs get string is created equals y processed rs get string processed equals y ad client id rs get int ad client id ad org id rs get int ad org id rs close pstmt close pstmt null no action if processed log info already posted return already posted create lines if is created for every production plan sql select m productionplan id ad client id ad org id isactive created createdby updated updatedby m production id line m product id productionqty m locator id description processed from m productionplan where m production id p record id order by line m product id prepared statement curpp null curpp db prepare statement sql result set pp curpp execute query while pp next delete prior lines sqldel delete m productionline where m productionplan id pp get int m productionplan id cntd db execute update sqldel if cntd 1 raise error deleting production line error sqldel totd cntd origin line int line 100 getsequenses next no m sequence get nextid ad client id m productionline get trxname insert in m productionline sqlins insert into m productionline m productionline id m productionplan id line ad client id ad org id is active created created by updated updated by m product id movement qty m locator id description values next no pp get int m productionplan id line pp get int ad client id pp get int ad org id y sysdate 0 sysdate 0 pp get int m product id pp get int production qty pp get int m locator id pp get string description cnti db execute update sqlins if cnti 1 raise error insert in m productionline sqlins toti cnti create first level sql select m product bom id ad client id ad org id isactive created createdby updated updatedby line m product id m productbom id bomqty description bomtype from m product bom where m product id pp get int m product id order by line prepared statement curbom null curbom db prepare statement sql result set bom curbom execute query while bom next line line 100 next no m sequence get nextid pp get int ad client id m productionline get trxname sqlins insert into m productionline m productionline id m productionplan id line ad client id ad org id is active created created by updated updated by m product id movement qty m locator id values next no pp get int m productionplan id line pp get int ad client id pp get int ad org id y sys date 0 sys date 0 bom get int m productbom id pp get int production qty bom get int bom qty pp get int m locator id cnti db execute update sqlins if cnti 1 raise error insert in m productionline first level sqlins toti cnti bom close curbom close curbom null while we have bo ms while true are there non stored bo ms to list details sql select count from m productionline pl m product p where pl m product id p m product id and pl m productionplan id pp get int m productionplan id and pl line 100 origin line and p isbom y and p is stocked n prepared statement cntlp null cntlp db prepare statement sql result set ct cntlp execute query int count no 0 if ct next count no ct get int 1 ct close cntlp close cntlp null nothing to do if count no 0 break resolve bo ms in product line which are not stocked sql select pl m productionline id pl line pl m product id pl movement qty from m productionline pl m product p where pl m productionplan id pp get int m productionplan id and pl m product id p m product id and pl line 100 origin line and p isbom y and p is stocked n prepared statement curp linebom null curp linebom db prepare statement sql result set pl curp linebom execute query while pl next line pl get int line resolve bom line in product line sql select m product bom id ad client id ad org id isactive created createdby updated updatedby line m product id m productbom id bomqty description bomtype from m product bom where m product id pl get int m product id order by line prepared statement curbom1 null curbom1 db prepare statement sql result set bom1 curbom1 execute query while bom1 next line line 10 next no m sequence get nextid pp get int ad client id m productionline get trxname sqlins insert into m productionline m productionline id m productionplan id line ad client id ad org id is active created created by updated updated by m product id movement qty m locator id values next no pp get int m productionplan id line pp get int ad client id pp get int ad org id y sys date 0 sys date 0 bom1 get int m productbom id pl get int movement qty bom1 get int bom qty pp get int m locator id cnti db execute update sqlins if cnti 1 raise error insert in m productionline for resolve bom line in product line sqlins toti cnti bom1 close curbom1 close curbom1 null delete bom line sqldel delete m productionline where m productionline id pl get int m productionline id cntd db execute update sqldel if cntd 1 raise error delete bom line sqldel totd cntd pl close curp linebom close curp linebom null pp close curpp close curpp null modifying locator to have sufficient stock indicate that it is created sqlupd update m production set is created y where m production id p record id cntu db execute update sqlupd if cntu 1 raise error modifying locator to have sufficient stock sqlupd totu cntu post lines else all production lines sql select pl m productionline id pl ad client id pl ad org id p movement date pl m product id pl m attributesetinstance id pl movement qty pl m locator id from m production p m productionline pl m productionplan pp where p m production id pp m production id and pp m productionplan id pl m productionplan id and pp m production id p record id order by pp line pl line prepared statement cur pl post null cur pl post db prepare statement sql result set pl cur pl post execute query while pl next sql select bom qty on hand pl get int m product id null pl get int m locator id prepared statement cnsql null cnsql db prepare statement sql result set cs cnsql execute query int count to 0 if cs next count to cs get int 1 cs close cnsql close cnsql null check stock levels for reductions if pl get int movement qty 0 count to pl get int movement qty 0 db rollback true get trxname sql select note doit nextno iscreated ad_client_id ad_org_id m_production iscreated ad_client_id ad_org_id m_production m_production_id p_record_id preparedstatement preparestatement resultset executequery iscreated getstring iscreated getstring ad_client_id getint ad_client_id ad_org_id getint ad_org_id alreadyposted iscreated m_productionplan_id ad_client_id ad_org_id m_production_id m_product_id m_locator_id m_productionplan m_production_id p_record_id m_product_id preparedstatement preparestatement resultset executequery m_productionline m_productionplan_id getint m_productionplan_id executeupdate raiseerror originline nextno msequence getnextid ad_client_id m_productionline get_trxname m_productionline m_productionline m_productionline_id m_productionplan_id ad_client_id ad_org_id isactive createdby updatedby m_product_id movementqty m_locator_id nextno getint m_productionplan_id getint ad_client_id getint ad_org_id getint m_product_id getint productionqty getint m_locator_id getstring executeupdate raiseerror m_productionline m_product_bom_id ad_client_id ad_org_id m_product_id m_productbom_id m_product_bom m_product_id getint m_product_id preparedstatement preparestatement resultset executequery nextno msequence getnextid getint ad_client_id m_productionline get_trxname m_productionline m_productionline_id m_productionplan_id ad_client_id ad_org_id isactive createdby updatedby m_product_id movementqty m_locator_id nextno getint m_productionplan_id getint ad_client_id getint ad_org_id sysdate sysdate getint m_productbom_id getint productionqty getint bomqty getint m_locator_id executeupdate raiseerror m_productionline boms boms m_productionline m_product m_product_id m_product_id m_productionplan_id getint m_productionplan_id isstocked preparedstatement preparestatement resultset executequery countno countno getint countno boms productline m_productionline_id m_product_id movementqty m_productionline m_product m_productionplan_id getint m_productionplan_id m_product_id m_product_id isstocked preparedstatement curplinebom curplinebom preparestatement resultset curplinebom executequery getint m_product_bom_id ad_client_id ad_org_id m_product_id m_productbom_id m_product_bom m_product_id getint m_product_id preparedstatement preparestatement resultset executequery nextno msequence getnextid getint ad_client_id m_productionline get_trxname m_productionline m_productionline_id m_productionplan_id ad_client_id ad_org_id isactive createdby updatedby m_product_id movementqty m_locator_id nextno getint m_productionplan_id getint ad_client_id getint ad_org_id sysdate sysdate getint m_productbom_id getint movementqty getint bomqty getint m_locator_id executeupdate raiseerror m_productionline m_productionline m_productionline_id getint m_productionline_id executeupdate raiseerror curplinebom curplinebom m_production iscreated m_production_id p_record_id executeupdate raiseerror m_productionline_id ad_client_id ad_org_id movementdate m_product_id m_attributesetinstance_id movementqty m_locator_id m_production m_productionline m_productionplan m_production_id m_production_id m_productionplan_id m_productionplan_id m_production_id p_record_id preparedstatement cur_pl_post cur_pl_post preparestatement resultset cur_pl_post executequery bomqtyonhand getint m_product_id getint m_locator_id preparedstatement preparestatement resultset executequery countto countto getint getint movementqty countto getint movementqty get_trxname private void raise error string string string sql throws exception db rollback false get trxname string msg string value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg raiseerror get_trxname valuenamepair clogger retrieveerror getname compiereusererror initialize panel param window no window param frame frame public void init int window no form frame frame m windowno window no m frame frame log info v merge init win no m windowno try pre init jb init frame get content pane add this border layout center frame get content pane add status bar border layout south catch exception ex log log level severe ex windowno windowno formframe m_windowno windowno m_frame vmerge winno m_windowno preinit jbinit getcontentpane borderlayout getcontentpane statusbar borderlayout pre init private void pre init int count 4 update m columnname new string count m label new c label count m from new v lookup count m to new v lookup count update pre init 0 2163 display type table dir ad org id c order ad org id pre init 1 2762 display type search c bpartner id c order c bpartner id pre init 2 971 display type search ad user id ad user roles ad user id pre init 3 2221 display type search m product id c orderline m product id preinit m_columnname m_label clabel m_from vlookup m_to vlookup preinit displaytype tabledir ad_org_id c_order ad_org_id preinit displaytype c_bpartner_id c_order c_bpartner_id preinit displaytype ad_user_id ad_user_roles ad_user_id preinit displaytype m_product_id c_orderline m_product_id pre init line param index index param ad column id id param display type display type param column name column name private void pre init int index int ad column id int display type string column name m columnname index column name string what msg translate env get ctx column name m label index new c label what m from index new v lookup column name false false true m lookup factory get env get ctx m windowno 0 ad column id display type m to index new v lookup column name false false true m lookup factory get env get ctx m windowno 0 ad column id display type ad_column_id displaytype columnname preinit ad_column_id displaytype columnname m_columnname columnname getctx columnname m_label clabel m_from vlookup columnname mlookupfactory getctx m_windowno ad_column_id displaytype m_to vlookup columnname mlookupfactory getctx m_windowno ad_column_id displaytype static init throws java lang exception void jb init throws exception this set layout main layout main layout set hgap 5 main layout set vgap 5 this add confirm panel border layout south confirm panel add action listener this center layout set hgap 5 center layout set vgap 5 center layout set columns 3 center layout set rows m label length 1 center panel set layout center layout this add center panel border layout center center panel add new c label null center panel add merge from label null center panel add merge to label null font heading merge from label get font heading new font heading get name font bold heading get size merge from label set font heading merge from label set request focus enabled false merge from label set text msg get msg env get ctx merge from merge to label set font heading merge to label set text msg get msg env get ctx merge to for int i 0 i m label length i center panel add m label i null center panel add m from i null center panel add m to i null jbinit setlayout mainlayout mainlayout sethgap mainlayout setvgap confirmpanel borderlayout confirmpanel addactionlistener centerlayout sethgap centerlayout setvgap centerlayout setcolumns centerlayout setrows m_label centerpanel setlayout centerlayout centerpanel borderlayout centerpanel clabel centerpanel mergefromlabel centerpanel mergetolabel mergefromlabel getfont getname getsize mergefromlabel setfont mergefromlabel setrequestfocusenabled mergefromlabel settext getmsg getctx mergefrom mergetolabel setfont mergetolabel settext getmsg getctx mergeto m_label centerpanel m_label centerpanel m_from centerpanel m_to dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e if e get action command equals confirm panel a cancel dispose return string column name null string from info null string to info null int from id 0 int to id 0 get first merge pair for int i 0 i m columnname length from id 0 to id 0 i object value m from i get value if value null if value instanceof integer from id integer value int value else continue value m to i get value if value null value instanceof integer to id integer value int value else from id 0 if from id 0 column name m columnname i from info m from i get display to info m to i get display get first merge pair if from id 0 from id to id return string msg msg get msg env get ctx merge from from info n msg get msg env get ctx merge to to info if a dialog ask m windowno this merge question msg return update if column name equals ad org id m deletetables s delete org else if column name equals ad user id m deletetables s delete user else if column name equals c bpartner id m deletetables s delete bpartner else if column name equals m product id m deletetables s delete product set cursor cursor get predefined cursor cursor wait cursor confirm panel getok button set enabled false boolean success merge column name from id to id post merge column name to id confirm panel getok button set enabled true set cursor cursor get default cursor if success a dialog info m windowno this merge success msg m totalcount else a dialog error m windowno this merge error m errorlog to string return dispose actionperformed actionevent getactioncommand confirmpanel a_cancel columnname from_info to_info from_id to_id m_columnname from_id to_id m_from getvalue from_id intvalue m_to getvalue to_id intvalue from_id from_id columnname m_columnname from_info m_from getdisplay to_info m_to getdisplay from_id from_id to_id getmsg getctx mergefrom from_info getmsg getctx mergeto to_info adialog m_windowno mergequestion columnname ad_org_id m_deletetables s_delete_org columnname ad_user_id m_deletetables s_delete_user columnname c_bpartner_id m_deletetables s_delete_bpartner columnname m_product_id m_deletetables s_delete_product setcursor getpredefinedcursor wait_cursor confirmpanel getokbutton setenabled columnname from_id to_id postmerge columnname to_id confirmpanel getokbutton setenabled setcursor getdefaultcursor adialog m_windowno mergesuccess m_totalcount adialog m_windowno mergeerror m_errorlog tostring merge param column name column param from id from param to id to return true if merged private boolean merge string column name int from id int to id string table name column name substring 0 column name length 3 log config column name from from id to to id boolean success true m totalcount 0 m errorlog new string buffer string sql select t table name c column name from ad table t inner join ad column c on t ad table id c ad table id where t is view n and t table name not in c taxdeclarationacct and c column name and c is key n 1 direct or c ad reference value id in table reference select rt ad reference id from ad ref table rt inner join ad column cc on rt ad table id cc ad table id and rt ad key cc ad column id where cc is key y and cc column name 2 order by t load seq desc prepared statement pstmt null savepoint sp null try m con db create connection false connection transaction read committed sp m con set savepoint merge pstmt db prepare statement sql null pstmt set string 1 column name pstmt set string 2 column name result set rs pstmt execute query while rs next string t name rs get string 1 string c name rs get string 2 if table name equals t name to be sure sql should prevent it int count merge table t name c name from id to id if count 0 success false else m totalcount count rs close pstmt close pstmt null log config success success column name from from id to to id if success sql delete table name where column name from id statement stmt m con create statement int count 0 try count stmt execute update sql if count 1 m errorlog append env nl append delete append table name append count append count success false catch sql exception ex1 m errorlog append env nl append delete append table name append append ex1 to string success false stmt close stmt null if success m con commit else m con rollback sp m con close m con null catch exception ex log log level severe column name ex cleanup try if pstmt null pstmt close if m con null m con close catch exception ex pstmt null m con null return success columnname from_id to_id columnname from_id to_id tablename columnname columnname columnname from_id to_id m_totalcount m_errorlog stringbuffer tablename columnname ad_table ad_column ad_table_id ad_table_id isview tablename c_taxdeclarationacct columnname iskey ad_reference_value_id ad_reference_id ad_ref_table ad_column ad_table_id ad_table_id ad_key ad_column_id iskey columnname loadseq preparedstatement m_con createconnection transaction_read_committed m_con setsavepoint preparestatement setstring columnname setstring columnname resultset executequery tname getstring cname getstring tablename tname mergetable tname cname from_id to_id m_totalcount columnname from_id to_id tablename columnname from_id m_con createstatement executeupdate m_errorlog tablename sqlexception m_errorlog tablename tostring m_con m_con m_con m_con columnname m_con m_con m_con merge table param table name table param column name column param from id from param to id to return 1 for error or number of changes private int merge table string table name string column name int from id int to id log fine table name column name from from id to to id string sql update table name set column name to id where column name from id boolean delete false for int i 0 i m deletetables length i if m deletetables i equals table name delete true sql delete table name where column name from id int count 1 try statement stmt m con create statement try count stmt execute update sql log fine count delete delete update table name catch sql exception ex1 count 1 m errorlog append env nl append delete delete update append table name append append ex1 to string append append sql stmt close stmt null catch sql exception ex count 1 m errorlog append env nl append delete delete update append table name append append ex to string append append sql return count tablename columnname from_id to_id mergetable tablename columnname from_id to_id tablename columnname from_id to_id tablename columnname to_id columnname from_id m_deletetables m_deletetables tablename tablename columnname from_id m_con createstatement executeupdate tablename sqlexception m_errorlog tablename tostring sqlexception m_errorlog tablename tostring post merge param column name column name param to id id private void post merge string column name int to id if column name equals ad org id else if column name equals ad user id else if column name equals c bpartner id mb partner bp new mb partner env get ctx to id null if bp get id 0 m payment payments m payment get ofb partner env get ctx bp getc bpartner id null for int i 0 i payments length i m payment payment payments i if payment test allocation payment save m invoice invoices m invoice get ofb partner env get ctx bp getc bpartner id null for int i 0 i invoices length i m invoice invoice invoices i if invoice test allocation invoice save bp set total open balance bp set actual life time value bp save else if column name equals m product id columnname to_id postmerge columnname to_id columnname ad_org_id columnname ad_user_id columnname c_bpartner_id mbpartner mbpartner getctx to_id get_id mpayment mpayment getofbpartner getctx getc_bpartner_id mpayment testallocation minvoice minvoice getofbpartner getctx getc_bpartner_id minvoice testallocation settotalopenbalance setactuallifetimevalue columnname m_product_id standard constructor public x ad scheduler properties ctx int ad scheduler id string trx name super ctx ad scheduler id trx name if ad scheduler id 0 setad process id 0 setad scheduler id 0 set frequency 0 set frequency type null set keep log days 0 7 set name null set schedule type null f setsupervisor id 0 x_ad_scheduler ad_scheduler_id trxname ad_scheduler_id trxname ad_scheduler_id setad_process_id setad_scheduler_id setfrequency setfrequencytype setkeeplogdays setname setscheduletype setsupervisor_id load constructor public x ad scheduler properties ctx result set rs string trx name super ctx rs trx name x_ad_scheduler resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad scheduler append get id append return sb to string tostring stringbuffer stringbuffer x_ad_scheduler get_id tostring set process process or report public void setad process id int ad process id if ad process id 1 throw new illegal argument exception ad process id is mandatory set valuenocheck ad process id new integer ad process id setad_process_id ad_process_id ad_process_id illegalargumentexception ad_process_id set_valuenocheck ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set scheduler schedule processes public void setad scheduler id int ad scheduler id if ad scheduler id 1 throw new illegal argument exception ad scheduler id is mandatory set valuenocheck ad scheduler id new integer ad scheduler id setad_scheduler_id ad_scheduler_id ad_scheduler_id illegalargumentexception ad_scheduler_id set_valuenocheck ad_scheduler_id ad_scheduler_id get scheduler schedule processes public int getad scheduler id integer ii integer get value ad scheduler id if ii null return 0 return ii int value getad_scheduler_id get_value ad_scheduler_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run set value date next run date next run setdatenextrun datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue set day of the month day of the month 1 to 28 29 30 31 public void set month day int month day set value month day new integer month day setmonthday monthday set_value monthday monthday get day of the month day of the month 1 to 28 29 30 31 public int get month day integer ii integer get value month day if ii null return 0 return ii int value getmonthday get_value monthday intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final string scheduletype weekday w set schedule type type of schedule public void set schedule type string schedule type if schedule type null throw new illegal argument exception schedule type is mandatory if schedule type equals f schedule type equals m schedule type equals w else throw new illegal argument exception schedule type invalid value schedule type reference id 318 f m w if schedule type length 1 log warning length 1 truncated schedule type schedule type substring 0 0 set value schedule type schedule type scheduletype_weekday setscheduletype scheduletype scheduletype illegalargumentexception scheduletype scheduletype scheduletype scheduletype illegalargumentexception scheduletype scheduletype reference_id scheduletype scheduletype scheduletype set_value scheduletype scheduletype get schedule type type of schedule public string get schedule type return string get value schedule type getscheduletype get_value scheduletype public static final int supervisor id ad reference id 316 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 1 throw new illegal argument exception supervisor id is mandatory set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id illegalargumentexception supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue public static final string weekday sunday 7 set day of the week day of the week public void set week day string week day if week day null throw new illegal argument exception week day is mandatory if week day null week day equals 1 week day equals 2 week day equals 3 week day equals 4 week day equals 5 week day equals 6 week day equals 7 else throw new illegal argument exception week day invalid value week day reference id 167 1 2 3 4 5 6 7 if week day null week day length 1 log warning length 1 truncated week day week day substring 0 0 set value week day week day weekday_sunday setweekday weekday weekday illegalargumentexception weekday weekday weekday weekday weekday weekday weekday weekday weekday illegalargumentexception weekday weekday reference_id weekday weekday weekday weekday set_value weekday weekday get day of the week day of the week public string get week day return string get value week day getweekday get_value weekday standard constructor public x c cyclestep properties ctx int c cyclestep id string trx name super ctx c cyclestep id trx name if c cyclestep id 0 setc cyclestep id 0 setc cycle id 0 set name null set relative weight env zero 1 set seq no 0 sql select nvl max seq no 0 10 as default value from c cyclestep where c cycle id c cycle id x_c_cyclestep c_cyclestep_id trxname c_cyclestep_id trxname c_cyclestep_id setc_cyclestep_id setc_cycle_id setname setrelativeweight setseqno seqno defaultvalue c_cyclestep c_cycle_id c_cycle_id load constructor public x c cyclestep properties ctx result set rs string trx name super ctx rs trx name x_c_cyclestep resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cyclestep append get id append return sb to string tostring stringbuffer stringbuffer x_c_cyclestep get_id tostring set cycle step the step for this cycle public void setc cyclestep id int c cyclestep id if c cyclestep id 1 throw new illegal argument exception c cyclestep id is mandatory set valuenocheck c cyclestep id new integer c cyclestep id setc_cyclestep_id c_cyclestep_id c_cyclestep_id illegalargumentexception c_cyclestep_id set_valuenocheck c_cyclestep_id c_cyclestep_id get cycle step the step for this cycle public int getc cyclestep id integer ii integer get value c cyclestep id if ii null return 0 return ii int value getc_cyclestep_id get_value c_cyclestep_id intvalue set project cycle identifier for this project reporting cycle public void setc cycle id int c cycle id if c cycle id 1 throw new illegal argument exception c cycle id is mandatory set valuenocheck c cycle id new integer c cycle id setc_cycle_id c_cycle_id c_cycle_id illegalargumentexception c_cycle_id set_valuenocheck c_cycle_id c_cycle_id get project cycle identifier for this project reporting cycle public int getc cycle id integer ii integer get value c cycle id if ii null return 0 return ii int value getc_cycle_id get_value c_cycle_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set relative weight relative weight of this step 0 ignored public void set relative weight big decimal relative weight if relative weight null throw new illegal argument exception relative weight is mandatory set value relative weight relative weight setrelativeweight bigdecimal relativeweight relativeweight illegalargumentexception relativeweight set_value relativeweight relativeweight get relative weight relative weight of this step 0 ignored public big decimal get relative weight big decimal bd big decimal get value relative weight if bd null return env zero return bd bigdecimal getrelativeweight bigdecimal bigdecimal get_value relativeweight set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue constructor for grid param m field public v cell editor m field m field super m mfield m field click mfield vcelleditor mfield mfield m_mfield mfield create editor private void create editor m editor v editor factory get editor m mfield true m editor add vetoable change listener this m editor add action listener this createeditor m_editor veditorfactory geteditor m_mfield m_editor addvetoablechangelistener m_editor addactionlistener ask the editor if it can start editing using an event if editing can be started this method returns true previously called m table is cell editable param an event event return true if editable public boolean is cell editable event object an event if m mfield is editable true row data is in context return false log fine m mfield get header event may be null if cell edit not enough mouse clicks if an event instanceof mouse event mouse event an event get click count click to start return false if m editor null create editor return true anevent mtable iscelleditable anevent iscelleditable eventobject anevent m_mfield iseditable m_mfield getheader celledit anevent mouseevent mouseevent anevent getclickcount click_to_start m_editor createeditor sets an initial value for the editor this will cause the editor to stop editing and lose any partially edited value if the editor is editing when this method is called returns the component that should be added to the client s component hierarchy once installed in the client s hierarchy this component will then be able to draw and receive user input param table param value param is selected param row param col return component public component get table cell editor component j table table object value boolean is selected int row int col log finest m mfield get column name value value row row col col if row 0 table set row selection interval row row force moving to new row if m editor null create editor m table table set value m editor set value value set background foreground to normal unselected colors m editor set background m mfield is error m editor set foreground compiereplaf gettextcolor normal other ui m editor set font table get font m editor set border ui manager get border table focus cell highlight border return component m editor stopediting isselected gettablecelleditorcomponent jtable isselected m_mfield getcolumnname setrowselectioninterval m_editor createeditor m_table m_editor setvalue m_editor setbackground m_mfield iserror m_editor setforeground gettextcolor_normal m_editor setfont getfont m_editor setborder uimanager getborder focuscellhighlightborder m_editor the editing cell should be selected or not param e event return true constant public boolean should select cell event object e log finest m mfield get column name return true shouldselectcell eventobject m_mfield getcolumnname returns the value contained in the editor return value public object get cell editor value log finest m mfield get column name m editor get value return m editor get value getcelleditorvalue m_mfield getcolumnname m_editor getvalue m_editor getvalue v editor change listener property name is column name indicate change for string text br when editing is complete the value is retrieved via get cell editor value param e event public void vetoable change property change event e if m table null return log fine e get property name e get new value m table m table get model set changed true veditor columnname getcelleditorvalue vetoablechange propertychangeevent m_table getpropertyname getnewvalue mtable m_table getmodel setchanged get actual editor called from grid controller to add action listener to button return v editor public v editor get editor return m editor gridcontroller actionlistener veditor veditor geteditor m_editor action editor stop editor param e event public void action performed action event e log finer m mfield get column name value m editor get value super stop cell editing causes v lookup search text not to work actionperformed actionevent m_mfield getcolumnname m_editor getvalue stopcellediting vlookup dispose public void dispose m editor null m mfield null m table null m_editor m_mfield m_table request processor param model model public request processor m request processor model super model 60 1 minute delay m model model m client m client get model get ctx model getad client id requestprocessor requestprocessor mrequestprocessor m_model m_client mclient getctx getad_client_id do the actual work protected void do work m summary new string buffer processe mail find sales rep process requests process status processecr int no m model delete log m summary append logs deleted append no m request processor log p log new m request processor log m model m summary to string p log set reference string value of p runcount time util format elapsed new timestamp p startwork p log save dowork m_summary stringbuffer processemail findsalesrep processrequests processstatus m_model deletelog m_summary mrequestprocessorlog plog mrequestprocessorlog m_model m_summary tostring plog setreference valueof p_runcount timeutil formatelapsed p_startwork plog process requests scheduled are they due private void process requests due requests string sql select from r request where due type m request duetype scheduled and processed n and date next action sys date and ad client id if m model getr requesttype id 0 sql and r requesttype id prepared statement pstmt null int count 0 int counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request get ctx rs null request set due type if request is due if request get request type ise mail when due if send email request request due request set date last alert counte mails request save count rs close pstmt close pstmt null catch exception e log log level severe sql e m summary append new due append count if counte mails 0 m summary append append counte mails append e mail m summary append overdue requests due requests are they overdue sql select from r request r where r due type m request duetype due and r processed n and ad client id and exists select from r requesttype rt where r r requesttype id rt r requesttype id and r date next action rt due date tolerance sys date if m model getr requesttype id 0 sql and r r requesttype id count 0 counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request get ctx rs null request set due type if request is overdue if request get request type ise mail when overdue time util is same day request get date last alert null if send email request request due request set date last alert counte mails request save count rs close pstmt close pstmt null catch exception e log log level severe sql e m summary append new overdue append count if counte mails 0 m summary append append counte mails append e mail m summary append send over due alerts if m model get overdue alert days 0 sql select from r request where processed n and ad client id and date next action m model get overdue alert days sys date and date last alert is null if m model get remind days 0 sql or date last alert m model get remind days sys date sql if m model getr requesttype id 0 sql and r requesttype id count 0 counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request get ctx rs null request set due type if request get request type ise mail when overdue request get date last alert null time util is same day request get date last alert null if send email request request alert request set date last alert counte mails request save count rs close pstmt close catch sql exception e log log level severe sql e m summary append alerts append count if counte mails 0 m summary append append counte mails append e mail m summary append overdue escalate if m model get overdue assign days 0 sql select from r request where processed n and ad client id and is escalated n and date next action m model get overdue assign days sys date if m model getr requesttype id 0 sql and r requesttype id count 0 counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request get ctx rs null if escalate request count rs close pstmt close catch sql exception e log log level severe sql e m summary append escalated append count append esacalate send inactivity alerts if m model get inactivity alert days 0 sql select from r request where processed n and ad client id and updated m model get inactivity alert days sys date and date last alert is null if m model get remind days 0 sql or date last alert m model get remind days sys date sql if m model getr requesttype id 0 sql and r requesttype id count 0 counte mails 0 try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request get ctx rs null request set due type if request get date last alert null time util is same day request get date last alert null if send email request request inactive request set date last alert counte mails request save count rs close pstmt close catch sql exception e log log level severe sql e m summary append inactivity append count if counte mails 0 m summary append append counte mails append e mail m summary append inactivity try if pstmt null pstmt close pstmt null catch exception e pstmt null processrequests r_request duetype mrequest duetype_scheduled datenextaction sysdate ad_client_id m_model getr_requesttype_id r_requesttype_id preparedstatement countemails preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getctx setduetype isdue getrequesttype isemailwhendue sendemail requestdue setdatelastalert countemails m_summary countemails m_summary countemails email m_summary r_request duetype mrequest duetype_due ad_client_id r_requesttype r_requesttype_id r_requesttype_id datenextaction duedatetolerance sysdate m_model getr_requesttype_id r_requesttype_id countemails preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getctx setduetype isoverdue getrequesttype isemailwhenoverdue timeutil issameday getdatelastalert sendemail requestdue setdatelastalert countemails m_summary countemails m_summary countemails email m_summary m_model getoverduealertdays r_request ad_client_id datenextaction m_model getoverduealertdays sysdate datelastalert m_model getreminddays datelastalert m_model getreminddays sysdate m_model getr_requesttype_id r_requesttype_id countemails preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getctx setduetype getrequesttype isemailwhenoverdue getdatelastalert timeutil issameday getdatelastalert sendemail requestalert setdatelastalert countemails sqlexception m_summary countemails m_summary countemails email m_summary m_model getoverdueassigndays r_request ad_client_id isescalated datenextaction m_model getoverdueassigndays sysdate m_model getr_requesttype_id r_requesttype_id countemails preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getctx sqlexception m_summary m_model getinactivityalertdays r_request ad_client_id m_model getinactivityalertdays sysdate datelastalert m_model getreminddays datelastalert m_model getreminddays sysdate m_model getr_requesttype_id r_requesttype_id countemails preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getctx setduetype getdatelastalert timeutil issameday getdatelastalert sendemail requestinactive setdatelastalert countemails sqlexception m_summary countemails m_summary countemails email m_summary send alert e mail param request request param ad message message private boolean send email m request request string ad message alert request 0 overdue string subject msg get msg m client getad language ad message new string request get document no return m client sende mail request getsalesrep id subject request get summary request createpdf email ad_message sendemail mrequest ad_message getmsg m_client getad_language ad_message getdocumentno m_client sendemail getsalesrep_id getsummary escalate param request request return true if saved private boolean escalate m request request get supervisor m user supervisor request get sales rep self int supervisor id request get sales rep getsupervisor id if supervisor id 0 m model getsupervisor id 0 supervisor id m model getsupervisor id if supervisor id 0 supervisor id request getad user id supervisor m user get get ctx supervisor id escalated request 0 to 1 string subject msg get msg m client getad language request escalate new string request get document no supervisor get name string to request get sales rep gete mail if to null to length 0 log warning sales rep has no e mail request get sales rep else m client sende mail request getsalesrep id subject request get summary request createpdf not the same send mail to supervisor if request getsalesrep id supervisor getad user id to supervisor gete mail if to null to length 0 log warning supervisor has no e mail supervisor else m client sende mail supervisor getad user id subject request get summary request createpdf request set due type request set is escalated true request set result subject return request save mrequest muser getsalesrep supervisor_id getsalesrep getsupervisor_id supervisor_id m_model getsupervisor_id supervisor_id m_model getsupervisor_id supervisor_id supervisor_id getad_user_id muser getctx supervisor_id getmsg m_client getad_language requestescalate getdocumentno getname getsalesrep getemail salesrep email getsalesrep m_client sendemail getsalesrep_id getsummary getsalesrep_id getad_user_id getemail email m_client sendemail getad_user_id getsummary setduetype setisescalated setresult process request status private void process status int count 0 requests with status with after timeout string sql select from r request r where exists select from r status s where r r status id s r status id and s timeout days 0 and s next status id 0 and r updated s timeout days sys date order by r status id prepared statement pstmt null m status status null m status next null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m request r new m request get ctx rs null get check status if status null status getr status id r getr status id status m status get get ctx r getr status id if status get timeout days 0 status getnext status id 0 continue next status if next null next getr status id status getnext status id next m status get get ctx status getnext status id string result msg get msg get ctx request status timeout status get name next get name r set result result r setr status id status getnext status id if r save count rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m summary append status timeout append count append processstatus r_request r_status r_status_id r_status_id timeoutdays next_status_id timeoutdays sysdate r_status_id preparedstatement mstatus mstatus preparestatement resultset executequery mrequest mrequest getctx getr_status_id getr_status_id mstatus getctx getr_status_id gettimeoutdays getnext_status_id getr_status_id getnext_status_id mstatus getctx getnext_status_id getmsg getctx requeststatustimeout getname getname setresult setr_status_id getnext_status_id m_summary create ecr private void processecr get requests with request type auto change request and group with info string sql select from r request r where m changerequest id is null and exists select from r requesttype rt where rt r requesttype id r r requesttype id and rt is auto change request y and exists select from r group g where g r group id r r group id and g m bom id is not null or g m changenotice id is not null int count 0 int failure 0 prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m request r new m request get ctx rs null m group rg m group get get ctx r getr group id m change request ecr new m change request r rg if r save r setm changerequest id ecr getm changerequest id if r save count else failure else failure rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m summary append auto change request append count if failure 0 m summary append fail append failure append m summary append autochangerequest r_request m_changerequest_id r_requesttype r_requesttype_id r_requesttype_id isautochangerequest r_group r_group_id r_group_id m_bom_id m_changenotice_id preparedstatement preparestatement resultset executequery mrequest mrequest getctx mgroup mgroup getctx getr_group_id mchangerequest mchangerequest setm_changerequest_id getm_changerequest_id m_summary m_summary m_summary create reauest updates from e mail private void processe mail m summary append mail append count append email processemail m_summary allocate sales rep private void find sales rep int changed 0 int not found 0 properties ctx new properties string sql select from r request where ad client id and salesrep id 0 and processed n if m model getr requesttype id 0 sql and r requesttype id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m model getad client id if m model getr requesttype id 0 pstmt set int 2 m model getr requesttype id result set rs pstmt execute query while rs next m request request new m request ctx rs null if request getsalesrep id 0 continue int salesrep id find sales rep request if salesrep id 0 request setsalesrep id salesrep id request save changed else not found rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if changed 0 not found 0 m summary append no unallocated requests else m summary append allocated sales rep append changed if not found 0 m summary append not append not found m summary append findsalesrep notfound r_request ad_client_id salesrep_id m_model getr_requesttype_id r_requesttype_id preparedstatement preparestatement setint m_model getad_client_id m_model getr_requesttype_id setint m_model getr_requesttype_id resultset executequery mrequest mrequest getsalesrep_id salesrep_id findsalesrep salesrep_id setsalesrep_id salesrep_id notfound sqlexception sqlexception notfound m_summary m_summary salesrep notfound m_summary notfound m_summary find sales rep user based on request type and question param request request return salesrep id user private int find sales rep m request request string q text request get summary if q text null q text else q text q text to upper case m request processor route routes m model get routes false for int i 0 i routes length i m request processor route route routes i match first on request type if request getr requesttype id route getr requesttype id route getr requesttype id 0 return route getad user id match on element of keyword string keyword route get keyword if keyword null string tokenizer st new string tokenizer keyword to upper case t n r f while st has more elements if q text index of st next token 1 return route getad user id for all routes return m model getsupervisor id salesrep salesrep_id findsalesrep mrequest qtext getsummary qtext qtext qtext qtext touppercase mrequestprocessorroute m_model getroutes mrequestprocessorroute getr_requesttype_id getr_requesttype_id getr_requesttype_id getad_user_id getkeyword stringtokenizer stringtokenizer touppercase hasmoreelements qtext indexof nexttoken getad_user_id m_model getsupervisor_id get server info return info public string get server info return p runcount last m summary to string getserverinfo p_runcount m_summary tostring get message cached param ctx context param value message value public static m message get properties ctx string value if value null value length 0 return null m message ret value m message s cache get value if ret value null string sql select from ad message where value prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 value result set rs pstmt execute query if rs next ret value new m message ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s cache put value ret value return ret value mmessage mmessage retvalue mmessage s_cache retvalue ad_message preparedstatement preparestatement setstring resultset executequery retvalue mmessage s_log retvalue s_cache retvalue retvalue get message cached param ctx context param ad message id id public static m message get properties ctx int ad message id string key string value of ad message id m message ret value m message s cache get key if ret value null ret value new m message ctx ad message id null s cache put key ret value return ret value ad_message_id mmessage ad_message_id valueof ad_message_id mmessage retvalue mmessage s_cache retvalue retvalue mmessage ad_message_id s_cache retvalue retvalue get message id cached param ctx context param value message value return ad message id public static int getad message id properties ctx string value m message msg get ctx value if msg null return 0 return msg getad message id ad_message_id getad_message_id mmessage getad_message_id standard constructor param ctx context param ad message id id public m message properties ctx int ad message id string trx name super ctx ad message id trx name ad_message_id mmessage ad_message_id trxname ad_message_id trxname load cosntructor param ctx context param rs result set public m message properties ctx result set rs string trx name super ctx rs trx name mmessage resultset trxname trxname standard constructor public x c recurring properties ctx int c recurring id string trx name super ctx c recurring id trx name if c recurring id 0 setc recurring id 0 set date next run new timestamp system current time millis set frequency type null m set name null set recurring type null set runs max 0 set runs remaining 0 x_c_recurring c_recurring_id trxname c_recurring_id trxname c_recurring_id setc_recurring_id setdatenextrun currenttimemillis setfrequencytype setname setrecurringtype setrunsmax setrunsremaining load constructor public x c recurring properties ctx result set rs string trx name super ctx rs trx name x_c_recurring resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c recurring append get id append return sb to string tostring stringbuffer stringbuffer x_c_recurring get_id tostring set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set recurring recurring document public void setc recurring id int c recurring id if c recurring id 1 throw new illegal argument exception c recurring id is mandatory set valuenocheck c recurring id new integer c recurring id setc_recurring_id c_recurring_id c_recurring_id illegalargumentexception c_recurring_id set_valuenocheck c_recurring_id c_recurring_id get recurring recurring document public int getc recurring id integer ii integer get value c recurring id if ii null return 0 return ii int value getc_recurring_id get_value c_recurring_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set valuenocheck date last run date last run setdatelastrun datelastrun set_valuenocheck datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run if date next run null throw new illegal argument exception date next run is mandatory set value date next run date next run setdatenextrun datenextrun datenextrun illegalargumentexception datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype weekly w set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals m frequency type equals q frequency type equals w else throw new illegal argument exception frequency type invalid value frequency type reference id 283 d m q w if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_weekly setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set journal batch general ledger journal batch public void setgl journalbatch id int gl journalbatch id if gl journalbatch id 0 set value gl journalbatch id null else set value gl journalbatch id new integer gl journalbatch id setgl_journalbatch_id gl_journalbatch_id gl_journalbatch_id set_value gl_journalbatch_id set_value gl_journalbatch_id gl_journalbatch_id get journal batch general ledger journal batch public int getgl journalbatch id integer ii integer get value gl journalbatch id if ii null return 0 return ii int value getgl_journalbatch_id get_value gl_journalbatch_id intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final string recurringtype order o set recurring type type of recurring document public void set recurring type string recurring type if recurring type null throw new illegal argument exception recurring type is mandatory if recurring type equals g recurring type equals i recurring type equals j recurring type equals o else throw new illegal argument exception recurring type invalid value recurring type reference id 282 g i j o if recurring type length 1 log warning length 1 truncated recurring type recurring type substring 0 0 set value recurring type recurring type recurringtype_order setrecurringtype recurringtype recurringtype illegalargumentexception recurringtype recurringtype recurringtype recurringtype recurringtype illegalargumentexception recurringtype recurringtype reference_id recurringtype recurringtype recurringtype set_value recurringtype recurringtype get recurring type type of recurring document public string get recurring type return string get value recurring type getrecurringtype get_value recurringtype set maximum runs number of recurring runs public void set runs max int runs max set value runs max new integer runs max setrunsmax runsmax set_value runsmax runsmax get maximum runs number of recurring runs public int get runs max integer ii integer get value runs max if ii null return 0 return ii int value getrunsmax get_value runsmax intvalue set remaining runs number of recurring runs remaining public void set runs remaining int runs remaining set valuenocheck runs remaining new integer runs remaining setrunsremaining runsremaining set_valuenocheck runsremaining runsremaining get remaining runs number of recurring runs remaining public int get runs remaining integer ii integer get value runs remaining if ii null return 0 return ii int value getrunsremaining get_value runsremaining intvalue create collection public a layout collection super alayoutcollection add a component if constraint is null it is added to the last row as additional column param constraint param component return component throws illegal argument exception if component is not a component public object put object constraint object component if component instanceof component throw new illegal argument exception a layout collection can only add component values if constraint null contains key constraint constraint instanceof a layout constraint log trace this log l6 database a layout collection put constraint to string return super put constraint component we need to create constraint if super size 0 log trace this log l6 database a layout collection put first return super put new a layout constraint 0 0 component add to end of list int row get max row if row 1 row 0 int col get max col row 1 a layout constraint next new a layout constraint row col log trace this log l6 database a layout collection put add end next to string return super put next component illegalargumentexception illegalargumentexception alayoutcollection containskey alayoutconstraint l6_database alayoutcollection tostring l6_database alayoutcollection alayoutconstraint getmaxrow getmaxcol alayoutconstraint alayoutconstraint l6_database alayoutcollection addend tostring get maximum row number return max row no or 1 if no row public int get max row int max row 1 iterator i key set iterator while i has next a layout constraint c a layout constraint i next max row math max max row c get row return max row getmaxrow maxrow keyset hasnext alayoutconstraint alayoutconstraint maxrow maxrow getrow maxrow get maximum column number return max col no or 1 if no column public int get max col int max col 1 iterator i key set iterator while i has next a layout constraint c a layout constraint i next max col math max max col c get col return max col getmaxcol maxcol keyset hasnext alayoutconstraint alayoutconstraint maxcol maxcol getcol maxcol get maximum column number for row param row return max col no for row or 1 if no col in row public int get max col int row int max col 1 iterator i key set iterator while i has next a layout constraint c a layout constraint i next if c get row row max col math max max col c get col return max col getmaxcol maxcol keyset hasnext alayoutconstraint alayoutconstraint getrow maxcol maxcol getcol maxcol ide bean constructor public v number this number false false true display type number number vnumber displaytype create right aligned number field no popup if window no 0 for i ds param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display type display type param title title public v number string column name boolean mandatory boolean is read only boolean is updateable int display type string title super super set name column name m columnname column name m title title set display type display type look and feel install border this text field border this set layout new border layout this set preferred size m text get preferred size causes r o to be the same length int height m text get preferred size height set minimum size new dimension 30 height text m text set border null m text set horizontal alignment j text field trailing m text add key listener this m text add focus listener this background set mandatory mandatory this add m text border layout center button m button set icon env get image icon calculator10 gif m button set margin new insets 0 0 0 0 m button set focusable false m button add action listener this this add m button border layout east prefereed size this set preferred size this get preferred size causes r o to be the same length size set columns size c combo box field hight 4 read write if is read only is updateable set read write false else set read write true windowno ids columnname isreadonly isupdateable displaytype vnumber columnname isreadonly isupdateable displaytype setname columnname m_columnname columnname m_title setdisplaytype displaytype lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize setminimumsize m_text setborder m_text sethorizontalalignment jtextfield m_text addkeylistener m_text addfocuslistener setmandatory m_text borderlayout m_button seticon getimageicon m_button setmargin m_button setfocusable m_button addactionlistener m_button borderlayout setpreferredsize getpreferredsize setcolumns ccombobox field_hight readwrite isreadonly isupdateable setreadwrite setreadwrite dispose public void dispose m text null m button null m mfield null m_text m_button m_mfield set document param doc document protected void set document document doc m text set document doc setdocument m_text setdocument set no of columns param columns columns public void set columns int columns int height m text set preferred size null m text set columns columns dimension size m text get preferred size if height size height default 16 size height height if c combo box field hight 4 size height size height v lookup field hight 4 this set preferred size size causes r o to be the same length this set minimum size new dimension columns 10 size height m button set preferred size new dimension size height size height setcolumns m_text setpreferredsize m_text setcolumns m_text getpreferredsize ccombobox field_hight vlookup field_hight setpreferredsize setminimumsize m_button setpreferredsize set range with min max param min value min value param max value max value return true if accepted public boolean set range double min value double max value m rangeset true m minvalue min value m maxvalue max value return m rangeset minvalue maxvalue setrange minvalue maxvalue m_rangeset m_minvalue minvalue m_maxvalue maxvalue m_rangeset set range with min max parse us style number w o gouping param min value min value param max value max value return true if accepted public boolean set range string min value string max value if min value null max value null return false try m minvalue double value of min value m maxvalue double value of max value catch number format exception nfe return false m rangeset true return m rangeset minvalue maxvalue setrange minvalue maxvalue minvalue maxvalue m_minvalue valueof minvalue m_maxvalue valueof maxvalue numberformatexception m_rangeset m_rangeset set and check display type param display type display type public void set display type int display type m displaytype display type if display type is numeric display type m displaytype display type number m format display type get number format display type m text set document new m doc number display type m format m text m title displaytype displaytype setdisplaytype displaytype m_displaytype displaytype displaytype isnumeric displaytype m_displaytype displaytype m_format displaytype getnumberformat displaytype m_text setdocument mdocnumber displaytype m_format m_text m_title set read write param value value public void set read write boolean value if m text is read write value m text set read write value if m button is read write value m button set read write value don t show button if not read write if m button is visible value m button set visible value readwrite setreadwrite m_text isreadwrite m_text setreadwrite m_button isreadwrite m_button setreadwrite readwrite m_button isvisible m_button setvisible is read write return true if rw public boolean is read write return m text is read write isreadwrite isreadwrite m_text isreadwrite set mandatory and back bolor param mandatory mandatory public void set mandatory boolean mandatory m text set mandatory mandatory setmandatory m_text setmandatory is it mandatory return true if mandatory public boolean is mandatory return m text is mandatory ismandatory m_text ismandatory set background param color color public void set background color color m text set background color setbackground m_text setbackground set background param error error public void set background boolean error m text set background error setbackground m_text setbackground set foreground param fg foreground public void set foreground color fg m text set foreground fg setforeground m_text setforeground set editor to value param value value public void set value object value log finest value value if value null m oldtext else m oldtext m format format value only set when not updated here if m setting return m text set text m oldtext m initialtext m oldtext m modified false setvalue m_oldtext m_oldtext m_format m_setting m_text settext m_oldtext m_initialtext m_oldtext m_modified request focus public void request focus m text request focus requestfocus m_text requestfocus property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value value big decimal or integer public object get value if m text null m text get text null m text get text length 0 return null string value m text get text return 0 if text deleted if value null value length 0 if m modified return null if m displaytype display type integer return new integer 0 return env zero if value equals value equals value equals value 0 try number number m format parse value value number to string converts it to us w o thousands big decimal bd new big decimal value if m displaytype display type integer return new integer bd int value if bd signum 0 return bd return bd set scale m format get maximum fraction digits big decimal round half up catch exception e log log level severe value value e if m displaytype display type integer return new integer 0 return env zero getvalue m_text m_text gettext m_text gettext m_text gettext m_modified m_displaytype displaytype m_format tostring bigdecimal bigdecimal m_displaytype displaytype intvalue setscale m_format getmaximumfractiondigits bigdecimal round_half_up m_displaytype displaytype return display value return value public string get display return m text get text getdisplay m_text gettext get title return title public string get title return m title gettitle m_title plus add one also sets value return new value public object plus object value get value if value null if m displaytype display type integer value new integer 0 else value env zero add if value instanceof big decimal value big decimal value add env one else value new integer integer value int value 1 set value value return value getvalue m_displaytype displaytype bigdecimal bigdecimal intvalue setvalue minus subtract one but not below minimum also sets value param minimum minimum return new value public object minus int minimum object value get value if value null if m displaytype display type integer value new integer minimum else value new big decimal minimum set value value return value subtract if value instanceof big decimal big decimal bd big decimal value subtract env one big decimal min new big decimal minimum if bd compare to min 0 value min else value bd else int i integer value int value i if i minimum i minimum value new integer i set value value return value getvalue m_displaytype displaytype bigdecimal setvalue bigdecimal bigdecimal bigdecimal bigdecimal bigdecimal compareto intvalue setvalue action listener param e event public void action performed action event e log config e get action command if value preference name equals e get action command if m role get default is show preference value preference start m mfield get value return if e get source m button m button set enabled false string str start calculator this m text get text m format m displaytype m title m text set text str m button set enabled true try fire vetoable change m columnname m oldtext get value catch property veto exception pve m text request focus actionperformed actionevent getactioncommand valuepreference getactioncommand mrole getdefault isshowpreference valuepreference m_mfield getvalue getsource m_button m_button setenabled startcalculator m_text gettext m_format m_displaytype m_title m_text settext m_button setenabled firevetoablechange m_columnname m_oldtext getvalue propertyvetoexception m_text requestfocus key listener interface param e event public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent key listener escape restore old text first change signal change param e event public void key released key event e log finest key e get key code e get key char m text get text esc if e get key code key event vk escape m text set text m initialtext m modified true m setting true try if e get key code key event vk enter 10 fire vetoable change m columnname m oldtext get value fire action performed else indicate change fire vetoable change m columnname m oldtext null catch property veto exception pve m setting false firstchange keyreleased keyevent getkeycode getkeychar m_text gettext getkeycode keyevent vk_escape m_text settext m_initialtext m_modified m_setting getkeycode keyevent vk_enter firevetoablechange m_columnname m_oldtext getvalue fireactionperformed firevetoablechange m_columnname m_oldtext propertyvetoexception m_setting focus gained param e event public void focus gained focus event e if m text null m text select all focusgained focusevent m_text m_text selectall data binding to m table via grid controller vetoable change param e event public void focus lost focus event e log finest e to string a panel escape if e get opposite component instanceof a glass pane m text set text m initialtext return try fire vetoable change m columnname m initialtext get value fire action performed catch property veto exception pve mtable gridcontroller vetoablechange focuslost focusevent tostring apanel getoppositecomponent aglasspane m_text settext m_initialtext firevetoablechange m_columnname m_initialtext getvalue fireactionperformed propertyvetoexception invalid entry start calculator param jc parent param value value param format format param display type display type param title title return value public static string start calculator container jc string value decimal format format int display type string title log config value value big decimal start value new big decimal 0 0 try if value null value length 0 number number format parse value start value new big decimal number to string catch parse exception pe log info invalid entry pe get message find frame frame frame env get frame jc actual call calculator calc new calculator frame title display type format start value a env show center window frame calc big decimal result calc get number log config result result calc null if result null return format format result else return value original value displaytype startcalculator decimalformat displaytype bigdecimal startvalue bigdecimal startvalue bigdecimal tostring parseexception invalidentry getmessage getframe displaytype startvalue aenv showcenterwindow bigdecimal getnumber set field window no for value preference param m field field public void set field m field m field m mfield m field if m mfield null m role get default is show preference value preference add menu this popup menu windowno valuepreference mfield setfield mfield mfield m_mfield mfield m_mfield mrole getdefault isshowpreference valuepreference addmenu popupmenu remove action listner param l action listener public void remove action listener action listener l listener list remove action listener class l removeactionlistener actionlistener listenerlist actionlistener add action listner param l action listener public void add action listener action listener l listener list add action listener class l addactionlistener actionlistener listenerlist actionlistener fire action event to listeners protected void fire action performed int modifiers 0 awt event current event event queue get current event if current event instanceof input event modifiers input event current event get modifiers else if current event instanceof action event modifiers action event current event get modifiers action event ae new action event this action event action performed v number event queue get most recent event time modifiers guaranteed to return a non null array object listeners listener list get listener list process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i action listener class action listener listeners i 1 action performed ae fireactionperformed awtevent currentevent eventqueue getcurrentevent currentevent inputevent inputevent currentevent getmodifiers currentevent actionevent actionevent currentevent getmodifiers actionevent actionevent actionevent action_performed vnumber eventqueue getmostrecenteventtime listenerlist getlistenerlist actionlistener actionlistener actionperformed get contents return contents public object get contents return contents getcontents standard constructor param ctx context param c allocationline id id param trx name name public m allocation line properties ctx int c allocationline id string trx name super ctx c allocationline id trx name if c allocationline id 0 setc allocationhdr id 0 set amount env zero set discount amt env zero set write off amt env zero set over under amt env zero c_allocationline_id trxname mallocationline c_allocationline_id trxname c_allocationline_id trxname c_allocationline_id setc_allocationhdr_id setamount setdiscountamt setwriteoffamt setoverunderamt load constructor param ctx ctx param rs result set public m allocation line properties ctx result set rs string trx name super ctx rs trx name mallocationline resultset trxname trxname parent constructor param parent parent public m allocation line m allocation hdr parent this parent get ctx 0 parent get trxname set client org parent setc allocationhdr id parent getc allocationhdr id m parent parent set trxname parent get trxname mallocationline mallocationhdr getctx get_trxname setclientorg setc_allocationhdr_id getc_allocationhdr_id m_parent set_trxname get_trxname parent constructor param parent parent param amount amount param discount amt optional discount param write off amt optional write off public m allocation line m allocation hdr parent big decimal amount big decimal discount amt big decimal write off amt big decimal over under amt this parent set amount amount set discount amt discount amt null env zero discount amt set write off amt write off amt null env zero write off amt set over under amt over under amt null env zero over under amt discountamt writeoffamt mallocationline mallocationhdr bigdecimal bigdecimal discountamt bigdecimal writeoffamt bigdecimal overunderamt setamount setdiscountamt discountamt discountamt setwriteoffamt writeoffamt writeoffamt setoverunderamt overunderamt overunderamt get parent return parent public m allocation hdr get parent if m parent null m parent new m allocation hdr get ctx getc allocationhdr id get trxname return m parent mallocationhdr getparent m_parent m_parent mallocationhdr getctx getc_allocationhdr_id get_trxname m_parent set parent param parent parent protected void set parent m allocation hdr parent m parent parent setparent mallocationhdr m_parent get parent trx date return date trx public timestamp get date trx return get parent get date trx getdatetrx getparent getdatetrx set document info param c bpartner id partner param c order id order param c invoice id invoice public void set doc info int c bpartner id int c order id int c invoice id setc bpartner id c bpartner id setc order id c order id setc invoice id c invoice id c_bpartner_id c_order_id c_invoice_id setdocinfo c_bpartner_id c_order_id c_invoice_id setc_bpartner_id c_bpartner_id setc_order_id c_order_id setc_invoice_id c_invoice_id set payment info param c payment id payment param c cashline id cash line public void set payment info int c payment id int c cashline id if c payment id 0 setc payment id c payment id if c cashline id 0 setc cashline id c cashline id c_payment_id c_cashline_id setpaymentinfo c_payment_id c_cashline_id c_payment_id setc_payment_id c_payment_id c_cashline_id setc_cashline_id c_cashline_id get invoice return invoice or null public m invoice get invoice if m invoice null getc invoice id 0 m invoice new m invoice get ctx getc invoice id get trxname return m invoice minvoice getinvoice m_invoice getc_invoice_id m_invoice minvoice getctx getc_invoice_id get_trxname m_invoice before save param new record return save protected boolean before save boolean new record if new record is valuechanged c bpartner id is valuechanged c invoice id log severe cannot change business partner or invoice return false set b partner order from invoice if getc bpartner id 0 get invoice null setc bpartner id get invoice getc bpartner id if getc order id 0 get invoice null setc order id get invoice getc order id return true newrecord beforesave newrecord newrecord is_valuechanged c_bpartner_id is_valuechanged c_invoice_id bpartner getc_bpartner_id getinvoice setc_bpartner_id getinvoice getc_bpartner_id getc_order_id getinvoice setc_order_id getinvoice getc_order_id before delete return true if reversed protected boolean before delete set is active false process it true return true beforedelete setisactive processit string representation return info public string to string string buffer sb new string buffer m allocation line sb append get id if getc payment id 0 sb append c payment id append getc payment id if getc cashline id 0 sb append c cashline id append getc cashline id if getc invoice id 0 sb append c invoice id append getc invoice id if getc bpartner id 0 sb append c bpartner id append getc bpartner id sb append amount append get amount append discount append get discount amt append write off append get write off amt append over under append get over under amt sb append return sb to string tostring stringbuffer stringbuffer mallocationline get_id getc_payment_id c_payment_id getc_payment_id getc_cashline_id c_cashline_id getc_cashline_id getc_invoice_id c_invoice_id getc_invoice_id getc_bpartner_id c_bpartner_id getc_bpartner_id getamount getdiscountamt writeoff getwriteoffamt overunder getoverunderamt tostring process allocation does not update line update and link invoice payment cash param reverse if true allocation is reversed return c bpartner id protected int process it boolean reverse log fine reverse reverse to string int c invoice id getc invoice id m invoice invoice get invoice if invoice null getc bpartner id invoice getc bpartner id setc bpartner id invoice getc bpartner id int c payment id getc payment id int c cashline id getc cashline id update payment if c payment id 0 m payment payment new m payment get ctx c payment id get trxname if getc bpartner id payment getc bpartner id log warning c bpartner id different invoice getc bpartner id payment payment getc bpartner id if reverse if payment is cash trx payment set is allocated false payment save else if payment test allocation payment save payment invoice if c payment id 0 invoice null link to invoice if reverse invoice setc payment id 0 log fine c payment id c payment id unlinked from c invoice id c invoice id else if invoice is paid invoice setc payment id c payment id log fine c payment id c payment id linked to c invoice id c invoice id link to order string update update c order o set c payment id reverse null select c payment id from c invoice where c invoice id c invoice id where exists select from c invoice i where o c order id i c order id and i c invoice id c invoice id if db execute update update get trxname 0 log fine c payment id c payment id reverse un linked from linked to order of c invoice id c invoice id cash invoice if c cashline id 0 invoice null link to invoice if reverse invoice setc cashline id 0 log fine c cashline id c cashline id unlinked from c invoice id c invoice id else invoice setc cashline id c cashline id log fine c cashline id c cashline id linked to c invoice id c invoice id link to order string update update c order o set c cashline id reverse null select c cashline id from c invoice where c invoice id c invoice id where exists select from c invoice i where o c order id i c order id and i c invoice id c invoice id if db execute update update get trxname 0 log fine c cashline id c cashline id reverse un linked from linked to order of c invoice id c invoice id update balance credit used counterpart of m invoice complete it if invoice null if invoice test allocation invoice save log log level severe invoice not updated invoice return getc bpartner id c_bpartner_id processit tostring c_invoice_id getc_invoice_id minvoice getinvoice getc_bpartner_id getc_bpartner_id setc_bpartner_id getc_bpartner_id c_payment_id getc_payment_id c_cashline_id getc_cashline_id c_payment_id mpayment mpayment getctx c_payment_id get_trxname getc_bpartner_id getc_bpartner_id c_bpartner_id getc_bpartner_id getc_bpartner_id iscashtrx setisallocated testallocation c_payment_id setc_payment_id c_payment_id c_payment_id c_invoice_id c_invoice_id ispaid setc_payment_id c_payment_id c_payment_id c_payment_id c_invoice_id c_invoice_id c_order c_payment_id c_payment_id c_invoice c_invoice_id c_invoice_id c_invoice c_order_id c_order_id c_invoice_id c_invoice_id executeupdate get_trxname c_payment_id c_payment_id unlinked c_invoice_id c_invoice_id c_cashline_id setc_cashline_id c_cashline_id c_cashline_id c_invoice_id c_invoice_id setc_cashline_id c_cashline_id c_cashline_id c_cashline_id c_invoice_id c_invoice_id c_order c_cashline_id c_cashline_id c_invoice c_invoice_id c_invoice_id c_invoice c_order_id c_order_id c_invoice_id c_invoice_id executeupdate get_trxname c_cashline_id c_cashline_id unlinked c_invoice_id c_invoice_id minvoice completeit testallocation getc_bpartner_id expense report line called from m product id s resourceassignment id set expense amt public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set callout active true big decimal price actual null get expense date or default to today s date timestamp date expense env get context as date ctx window no date expense if date expense null date expense new timestamp system current time millis string sql null try boolean no price true search pricelist for current version sql select bom price std p m product id pv m pricelist version id as price std bom price list p m product id pv m pricelist version id as price list bom price limit p m product id pv m pricelist version id as price limit p c uom id pv valid from pl c currency id from m product p m productprice pp m pricelist pl m pricelist version pv where p m product id pp m product id and pp m pricelist version id pv m pricelist version id and pv m pricelist id pl m pricelist id and pv is active y and p m product id 1 and pl m pricelist id 2 order by pv valid from desc prepared statement pstmt db prepare statement sql null pstmt set int 1 m product id int value pstmt set int 2 env get context as int ctx window no m pricelist id result set rs pstmt execute query while rs next no price java sql date pl date rs get date valid from we have the price list if order date is after or equal price list valid from if pl date null date expense before pl date no price false price price actual rs get big decimal price std if price actual null price actual rs get big decimal price list if price actual null price actual rs get big decimal price limit currency integer ii new integer rs get int c currency id if rs was null m tab set value c currency id ii rs close pstmt close no prices yet look base pricelist if no price find if via base pricelist sql select bom price std p m product id pv m pricelist version id as price std bom price list p m product id pv m pricelist version id as price list bom price limit p m product id pv m pricelist version id as price limit p c uom id pv valid from pl c currency id from m product p m productprice pp m pricelist pl m pricelist bpl m pricelist version pv where p m product id pp m product id and pp m pricelist version id pv m pricelist version id and pv m pricelist id bpl m pricelist id and pv is active y and bpl m pricelist id pl basepricelist id base and p m product id 1 and pl m pricelist id 2 order by pv valid from desc pstmt db prepare statement sql null pstmt set int 1 m product id int value pstmt set int 2 env get context as int ctx window no m pricelist id rs pstmt execute query while rs next no price java sql date pl date rs get date valid from we have the price list if order date is after or equal price list valid from if pl date null date expense before pl date no price false price price actual rs get big decimal price std if price actual null price actual rs get big decimal price list if price actual null price actual rs get big decimal price limit currency integer ii new integer rs get int c currency id if rs was null m tab set value c currency id ii rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message finish set callout active false calculate amount if price actual null price actual env zero m tab set value expense amt price actual return m_product_id s_resourceassignment_id expenseamt windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue setcalloutactive bigdecimal priceactual dateexpense getcontextasdate windowno dateexpense dateexpense dateexpense currenttimemillis noprice bompricestd m_product_id m_pricelist_version_id pricestd bompricelist m_product_id m_pricelist_version_id pricelist bompricelimit m_product_id m_pricelist_version_id pricelimit c_uom_id validfrom c_currency_id m_product m_productprice m_pricelist m_pricelist_version m_product_id m_product_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id isactive m_product_id m_pricelist_id validfrom preparedstatement preparestatement setint m_product_id intvalue setint getcontextasint windowno m_pricelist_id resultset executequery noprice pldate getdate validfrom pricelist validfrom pldate dateexpense pldate noprice priceactual getbigdecimal pricestd priceactual priceactual getbigdecimal pricelist priceactual priceactual getbigdecimal pricelimit getint c_currency_id wasnull mtab setvalue c_currency_id noprice bompricestd m_product_id m_pricelist_version_id pricestd bompricelist m_product_id m_pricelist_version_id pricelist bompricelimit m_product_id m_pricelist_version_id pricelimit c_uom_id validfrom c_currency_id m_product m_productprice m_pricelist m_pricelist m_pricelist_version m_product_id m_product_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id isactive m_pricelist_id basepricelist_id m_product_id m_pricelist_id validfrom preparestatement setint m_product_id intvalue setint getcontextasint windowno m_pricelist_id executequery noprice pldate getdate validfrom pricelist validfrom pldate dateexpense pldate noprice priceactual getbigdecimal pricestd priceactual priceactual getbigdecimal pricelist priceactual priceactual getbigdecimal pricelimit getint c_currency_id wasnull mtab setvalue c_currency_id sqlexception setcalloutactive getlocalizedmessage setcalloutactive priceactual priceactual mtab setvalue expenseamt priceactual expense amount called from expense amt c currency id calculates converted amt public string amount properties ctx int window no m tab m tab m field m field object value if is callout active return set callout active true get values big decimal expense amt big decimal m tab get value expense amt integer c currency from id integer m tab get value c currency id int c currency to id env get context as int ctx c currency id timestamp date expense env get context as date ctx window no date expense log fine amt expense amt c currency id c currency from id converted amount unit price big decimal converted amt expense amt convert if required if converted amt equals env zero c currency to id c currency from id int value int ad client id env get context as int ctx window no ad client id int ad org id env get context as int ctx window no ad org id converted amt m conversion rate convert ctx converted amt c currency from id int value c currency to id date expense 0 ad client id ad org id m tab set value converted amt converted amt log fine converted amt converted amt set callout active false return expenseamt c_currency_id convertedamt windowno mtab mtab mfield mfield iscalloutactive setcalloutactive bigdecimal expenseamt bigdecimal mtab getvalue expenseamt c_currency_from_id mtab getvalue c_currency_id c_currency_to_id getcontextasint c_currency_id dateexpense getcontextasdate windowno dateexpense expenseamt c_currency_id c_currency_from_id bigdecimal convertedamt expenseamt convertedamt c_currency_to_id c_currency_from_id intvalue ad_client_id getcontextasint windowno ad_client_id ad_org_id getcontextasint windowno ad_org_id convertedamt mconversionrate convertedamt c_currency_from_id intvalue c_currency_to_id dateexpense ad_client_id ad_org_id mtab setvalue convertedamt convertedamt convertedamt convertedamt setcalloutactive standard constructor public x i inventory properties ctx int i inventory id string trx name super ctx i inventory id trx name if i inventory id 0 seti inventory id 0 seti isimported false x_i_inventory i_inventory_id trxname i_inventory_id trxname i_inventory_id seti_inventory_id seti_isimported load constructor public x i inventory properties ctx result set rs string trx name super ctx rs trx name x_i_inventory resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i inventory append get id append return sb to string tostring stringbuffer stringbuffer x_i_inventory get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set import inventory import inventory transactions public void seti inventory id int i inventory id if i inventory id 1 throw new illegal argument exception i inventory id is mandatory set valuenocheck i inventory id new integer i inventory id seti_inventory_id i_inventory_id i_inventory_id illegalargumentexception i_inventory_id set_valuenocheck i_inventory_id i_inventory_id get import inventory import inventory transactions public int geti inventory id integer ii integer get value i inventory id if ii null return 0 return ii int value geti_inventory_id get_value i_inventory_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geti inventory id intvalue keynamepair getkeynamepair keynamepair get_id valueof geti_inventory_id set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set locator key key of the warehouse locator public void set locator value string locator value if locator value null locator value length 40 log warning length 40 truncated locator value locator value substring 0 39 set value locator value locator value setlocatorvalue locatorvalue locatorvalue locatorvalue locatorvalue locatorvalue set_value locatorvalue locatorvalue get locator key key of the warehouse locator public string get locator value return string get value locator value getlocatorvalue get_value locatorvalue set lot no lot number alphanumeric public void set lot string lot if lot null lot length 20 log warning length 20 truncated lot lot substring 0 19 set value lot lot setlot set_value get lot no lot number alphanumeric public string get lot return string get value lot getlot get_value set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 0 set value m inventory id null else set value m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id set_value m_inventory_id set_value m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set value m locator id null else set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_value m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date set value movement date movement date setmovementdate movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set quantity book book quantity public void set qty book big decimal qty book set value qty book qty book setqtybook bigdecimal qtybook set_value qtybook qtybook get quantity book book quantity public big decimal get qty book big decimal bd big decimal get value qty book if bd null return env zero return bd bigdecimal getqtybook bigdecimal bigdecimal get_value qtybook set quantity count counted quantity public void set qty count big decimal qty count set value qty count qty count setqtycount bigdecimal qtycount set_value qtycount qtycount get quantity count counted quantity public big decimal get qty count big decimal bd big decimal get value qty count if bd null return env zero return bd bigdecimal getqtycount bigdecimal bigdecimal get_value qtycount set serial no product serial number public void set ser no string ser no if ser no null ser no length 20 log warning length 20 truncated ser no ser no substring 0 19 set value ser no ser no setserno serno serno serno serno serno set_value serno serno get serial no product serial number public string get ser no return string get value ser no getserno get_value serno set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set search key search key for the record in the format required must be unique public void set value string value if value null value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set warehouse key key of the warehouse public void set warehouse value string warehouse value if warehouse value null warehouse value length 40 log warning length 40 truncated warehouse value warehouse value substring 0 39 set value warehouse value warehouse value setwarehousevalue warehousevalue warehousevalue warehousevalue warehousevalue warehousevalue set_value warehousevalue warehousevalue get warehouse key key of the warehouse public string get warehouse value return string get value warehouse value getwarehousevalue get_value warehousevalue set aisle x x dimension e g aisle public void setx string x if x null x length 60 log warning length 60 truncated x x substring 0 59 set value x x set_value get aisle x x dimension e g aisle public string getx return string get value x get_value set bin y y dimension e g bin public void sety string y if y null y length 60 log warning length 60 truncated y y substring 0 59 set value y y set_value get bin y y dimension e g bin public string gety return string get value y get_value set level z z dimension e g level public void setz string z if z null z length 60 log warning length 60 truncated z z substring 0 59 set value z z set_value get level z z dimension e g level public string getz return string get value z get_value constructor param goal goal model public performance indicator m goal goal super m goal goal set name m goal get name initialize graph kinamo pelgrim init get preferred size calculate size set border border factory create bevel border bevel border raised set opaque true update display m refresh add action listener this popup menu add m refresh add mouse listener this performanceindicator mgoal m_goal setname m_goal getname getpreferredsize setborder borderfactory createbevelborder bevelborder setopaque updatedisplay mrefresh addactionlistener popupmenu mrefresh addmouselistener get goal return goal public m goal get goal return m goal mgoal getgoal m_goal init graph display kinamo pelgrim private void init set text string buffer text new string buffer m goal get name if m goal is target text append append m goal get percent append else text append append s format format m goal get measure actual m text text to string tool tip text new string buffer if m goal get description null text append m goal get description append text append s format format m goal get measure actual if m goal is target text append append msg get msg env get ctx of append append s format format m goal get measure target set tool tip text text to string set background m goal get color set foreground graph util get foreground get background performance line int percent m goal get percent if percent 100 draw 100 line m line s width100 else draw performance line m line s width100 m goal get goal performance double vpj cd e evolution plot meter j free chart chart null string title m text default value dataset data new default value dataset float m goal get percent meter plot plot new meter plot data plot add interval new meter interval normal new range 0 0 100 0 plot set units m goal get name plot set range new range 0 100 plot set dial shape dial shape circle plot set dial background paint m goal get color plot set needle paint color white plot set tick size 10 plot set tick label font new font sans serif font bold 10 plot set insets new rectangle insets 1 0 2 0 3 0 4 0 chart new j free chart m text new font sans serif font bold 10 plot false try buffered image image new buffered image 200 100 buffered image type int rgb graphics2d g2 image create graphics chart draw g2 new rectangle2d double 0 0 200 100 null null g2 dispose catch exception e chart set background paint new gradient paint 0 0 color white 0 1000 color orange chart panel chart panel new chart panel chart this add chart panel border layout north c panel textpanel new c panel c label textlabel new c label msg get msg env get ctx zoom textpanel add textlabel this add textpanel border layout west this set preferred size paneldimension invalidate stringbuffer stringbuffer m_goal getname m_goal istarget m_goal getpercent s_format m_goal getmeasureactual m_text tostring tooltip stringbuffer m_goal getdescription m_goal getdescription s_format m_goal getmeasureactual m_goal istarget getmsg getctx s_format m_goal getmeasuretarget settooltiptext tostring setbackground m_goal getcolor setforeground graphutil getforeground getbackground m_goal getpercent m_line s_width100 m_line s_width100 m_goal getgoalperformancedouble jfreechart m_text defaultvaluedataset defaultvaluedataset m_goal getpercent meterplot meterplot addinterval meterinterval setunits m_goal getname setrange setdialshape dialshape setdialbackgroundpaint m_goal getcolor setneedlepaint setticksize setticklabelfont sansserif setinsets rectangleinsets jfreechart m_text sansserif bufferedimage bufferedimage bufferedimage type_int_rgb creategraphics setbackgroundpaint gradientpaint chartpanel chartpanel chartpanel chartpanel borderlayout cpanel cpanel clabel clabel getmsg getctx borderlayout setpreferredsize update display data protected void update display update graph kinamo pelgrim indicatormodel new default category graph2d model string categories m goal get percent 100 m goal get percent indicatormodel set categories categories float series float m goal get percent float 100 m goal get percent indicatormodel add series series indicator set model indicatormodel indicator update indicator get graphics vpj cd e evolution plot meter j free chart chart null string title m text default value dataset data new default value dataset float m goal get percent meter plot plot new meter plot data plot add interval new meter interval normal new range 0 0 100 0 plot set units m goal get name plot set range new range 0 100 plot set dial shape dial shape circle plot set dial background paint m goal get color plot set needle paint color white plot set tick size 10 plot set tick label font new font sans serif font bold 10 plot set insets new rectangle insets 1 0 2 0 3 0 4 0 chart new j free chart m text new font sans serif font bold 10 plot false try buffered image image new buffered image 200 100 buffered image type int rgb graphics2d g2 image create graphics chart draw g2 new rectangle2d double 0 0 200 100 null null g2 dispose catch exception e chart set background paint new gradient paint 0 0 color white 0 1000 color orange chart panel chart panel new chart panel chart this add chart panel border layout north invalidate updatedisplay defaultcategorygraph2dmodel m_goal getpercent m_goal getpercent setcategories m_goal getpercent m_goal getpercent addseries setmodel getgraphics jfreechart m_text defaultvaluedataset defaultvaluedataset m_goal getpercent meterplot meterplot addinterval meterinterval setunits m_goal getname setrange setdialshape dialshape setdialbackgroundpaint m_goal getcolor setneedlepaint setticksize setticklabelfont sansserif setinsets rectangleinsets jfreechart m_text sansserif bufferedimage bufferedimage bufferedimage type_int_rgb creategraphics setbackgroundpaint gradientpaint chartpanel chartpanel chartpanel chartpanel borderlayout adds an code action listener code to the indicator param l the code action listener code to be added public void add action listener action listener l if l null listener list add action listener class l actionlistener actionlistener addactionlistener actionlistener listenerlist actionlistener removes an code action listener code from the indicator param l the listener to be removed public void remove action listener action listener l if l null listener list remove action listener class l actionlistener removeactionlistener actionlistener listenerlist actionlistener returns an array of all the code action listener code s added to this indicator with add action listener return all of the code action listener code s added or an empty array if no listeners have been added public action listener get action listeners return action listener listener list get listeners action listener class actionlistener addactionlistener actionlistener actionlistener getactionlisteners actionlistener listenerlist getlisteners actionlistener notifies all listeners that have registered interest for notification on this event type the event instance is lazily created using the code event code parameter param event the code action event code object see event listener list protected void fire action performed mouse event event guaranteed to return a non null array action listener listeners get action listeners action event e null process the listeners first to last for int i 0 i listeners length i lazily create the event if e null e new action event this action event action performed pi event get when event get modifiers listeners i action performed e actionevent eventlistenerlist fireactionperformed mouseevent actionlistener getactionlisteners actionevent actionevent actionevent action_performed getwhen getmodifiers actionperformed mouse clicked param e mouse event public void mouse clicked mouse event e if swing utilities is left mouse button e e get click count 1 fire action performed e if swing utilities is right mouse button e popup menu show component e get source e getx e gety mouseclicked mouseevent swingutilities isleftmousebutton getclickcount fireactionperformed swingutilities isrightmousebutton popupmenu getsource mouse clicked public void mouse pressed mouse event e mouseclicked mousepressed mouseevent public void mouse released mouse event e mousereleased mouseevent public void mouse entered mouse event e mouseentered mouseevent public void mouse exited mouse event e mouseexited mouseevent action listener update display param e event public void action performed action event e if e get source m refresh m goal update goal true update display container parent get parent if parent null parent invalidate invalidate if parent null parent repaint else repaint else update display actionperformed actionevent getsource mrefresh m_goal updategoal updatedisplay getparent updatedisplay get contents return context public object get contents return contents getcontents dynamic generated parameter dialog screen called from process ctl process param frame frame param window no window param pi process info public process parameter frame frame int window no process info pi super frame pi get title true m frame frame try jb init catch exception ex log log level severe ex get message m windowno window no m processinfo pi processctl windowno processparameter windowno processinfo gettitle m_frame jbinit getmessage m_windowno windowno m_processinfo static layout throws exception void jb init throws exception main panel set layout main layout center panel set layout center layout this get content pane add main panel main panel add center panel border layout center main panel add confirm panel border layout south confirm panel add action listener this jbinit mainpanel setlayout mainlayout centerpanel setlayout centerlayout getcontentpane mainpanel mainpanel centerpanel borderlayout mainpanel confirmpanel borderlayout confirmpanel addactionlistener dispose public void dispose m veditors clear m veditors2 clear m mfields clear m mfields2 clear this remove all super dispose m_veditors m_veditors2 m_mfields m_mfields2 removeall read fields to display return true if loaded ok public boolean init dialog log config prepare panel gbc anchor grid bag constraints northwest gbc weightx 0 gbc weighty 0 gbc gridy m line gbc gridx 0 gbc gridwidth 1 gbc insets null inset gbc fill grid bag constraints horizontal center panel add box create vertical strut 10 gbc top gap 10 2 12 string sql null if env is base language env get ctx ad process para sql select p name p description p help p ad reference id p ad process para id p field length p is mandatory p is range p column name p default value p default value2 p v format p value min p value max p seq no p ad reference value id vr code as validation code from ad process para p left outer join ad val rule vr on p ad val rule id vr ad val rule id where p ad process id 1 and p is active y order by seq no else sql select t name t description t help p ad reference id p ad process para id p field length p is mandatory p is range p column name p default value p default value2 p v format p value min p value max p seq no p ad reference value id vr code as validation code from ad process para p inner join ad process para trl t on p ad process para id t ad process para id left outer join ad val rule vr on p ad val rule id vr ad val rule id where p ad process id 1 and t ad language env getad language env get ctx and p is active y order by seq no create fields boolean has fields false try prepared statement pstmt db prepare statement sql null pstmt set int 1 m processinfo getad process id result set rs pstmt execute query while rs next has fields true create field rs rs close pstmt close catch sql exception e log log level severe sql e both vectors the same if m mfields size m mfields2 size m mfields size m veditors size m mfields2 size m veditors2 size log log level severe view model vector size is different clean up if has fields gbc gridy m line center panel add box create vertical strut 10 gbc bottom gap gbc gridx 3 center panel add box create horizontal strut 12 gbc right gap a env position center window m frame this else dispose return has fields initdialog gridbagconstraints m_line nullinset gridbagconstraints centerpanel createverticalstrut isbaselanguage getctx ad_process_para ad_reference_id ad_process_para_id fieldlength ismandatory isrange columnname defaultvalue defaultvalue2 vformat valuemin valuemax seqno ad_reference_value_id validationcode ad_process_para ad_val_rule ad_val_rule_id ad_val_rule_id ad_process_id isactive seqno ad_reference_id ad_process_para_id fieldlength ismandatory isrange columnname defaultvalue defaultvalue2 vformat valuemin valuemax seqno ad_reference_value_id validationcode ad_process_para ad_process_para_trl ad_process_para_id ad_process_para_id ad_val_rule ad_val_rule_id ad_val_rule_id ad_process_id ad_language getad_language getctx isactive seqno hasfields preparedstatement preparestatement setint m_processinfo getad_process_id resultset executequery hasfields createfield sqlexception m_mfields m_mfields2 m_mfields m_veditors m_mfields2 m_veditors2 hasfields m_line centerpanel createverticalstrut centerpanel createhorizontalstrut aenv positioncenterwindow m_frame hasfields create field creates fields and adds it to m mfields list creates editor and adds it to m veditors list handeles ranges by adding additional m field v editor p m fields are used for default value and mandatory checking v editors are used to retrieve the value no data binding param rs result set private void create field result set rs create field m fieldvo vof m fieldvo create parameter env get ctx m windowno rs m field m field new m field vof m mfields add m field add to fields label preparation gbc gridy m line gbc gridwidth 1 gbc fill grid bag constraints horizontal required for right justified gbc gridx 0 gbc weightx 0 j label label v editor factory get label m field if label null gbc insets null inset center panel add box create horizontal strut 12 gbc left gap else gbc insets label inset center panel add label gbc field preparation gbc insets field inset gbc fill grid bag constraints horizontal gbc gridwidth 1 gbc gridx 1 gbc weightx 1 the editor v editor v editor v editor factory get editor m field false v editor add vetoable change listener this m field v editor new field value to be updated to editor m field add property change listener v editor set default object default object m field get default m field set value default object true center panel add component v editor gbc m veditors add v editor add to editors if vof is range to label gbc gridx 2 center panel add new j label gbc to field gbc gridx 3 gbc insets field inset right m fieldvo vof2 m fieldvo create parameter vof m field m field2 new m field vof2 m mfields2 add m field2 the editor v editor v editor2 v editor factory get editor m field2 false new field value to be updated to editor m field2 add property change listener v editor2 set default object default object2 m field2 get default m field2 set value default object2 true center panel add component v editor2 gbc m veditors2 add v editor2 else m mfields2 add null m veditors2 add null m_mfields m_veditors mfield veditor mfields veditors createfield resultset mfieldvo mfieldvo createparameter getctx m_windowno mfield mfield mfield m_mfields mfield m_line gridbagconstraints jlabel veditorfactory getlabel mfield nullinset centerpanel createhorizontalstrut labelinset centerpanel fieldinset gridbagconstraints veditor veditor veditorfactory geteditor mfield veditor addvetoablechangelistener mfield veditor mfield addpropertychangelistener veditor defaultobject mfield getdefault mfield setvalue defaultobject centerpanel veditor m_veditors veditor isrange centerpanel jlabel fieldinsetright mfieldvo mfieldvo createparameter mfield mfield2 mfield m_mfields2 mfield2 veditor veditor2 veditorfactory geteditor mfield2 mfield2 addpropertychangelistener veditor2 defaultobject2 mfield2 getdefault mfield2 setvalue defaultobject2 centerpanel veditor2 m_veditors2 veditor2 m_mfields2 m_veditors2 action listener param e event public void action performed action event e m isok false if e get action command equals confirm panel a ok check if saving parameters is complete if save parameters m isok true dispose else if e get action command equals confirm panel a cancel dispose actionperformed actionevent m_isok getactioncommand confirmpanel a_ok saveparameters m_isok getactioncommand confirmpanel a_cancel editor listener param evt event exception property veto exception if the recipient wishes to roll back public void vetoable change property change event evt throws property veto exception log fine process parameter vetoable change string value evt get new value null evt get new value to string env set context env get ctx m windowno evt get property name value propertyvetoexception vetoablechange propertychangeevent propertyvetoexception processparameter vetoablechange getnewvalue getnewvalue tostring setcontext getctx m_windowno getpropertyname save parameter values return true if parameters saved private boolean save parameters log config mandatory fields see m table get mandatory string buffer sb new string buffer int size m mfields size for int i 0 i size i m field field m field m mfields get i if field is mandatory true check context v editor v editor v editor m veditors get i object data v editor get value if data null data to string length 0 field set inserting true set editable i e updateable otherwise deadlock field set error true if sb length 0 sb append sb append field get header else field set error false check for range v editor v editor2 v editor m veditors2 get i if v editor2 null object data2 v editor get value m field field2 m field m mfields2 get i if data2 null data2 to string length 0 field set inserting true set editable i e updateable otherwise deadlock field2 set error true if sb length 0 sb append sb append field get header else field2 set error false range field mandatory field loop if sb length 0 a dialog error m windowno this fill mandatory sb to string return false save now for int i 0 i m mfields size i get values v editor editor v editor m veditors get i v editor editor2 v editor m veditors2 get i object result editor get value object result2 null if editor2 null result2 editor2 get value don t save null values if result null result2 null continue create parameter mp instance para para new mp instance para env get ctx m processinfo getad pinstance id i m field m field m field m mfields get i para set parameter name m field get column name date if result instanceof timestamp result2 instanceof timestamp para setp date timestamp result if editor2 null result2 null para setp date to timestamp result2 integer else if result instanceof integer result2 instanceof integer if result null integer ii integer result para setp number ii int value if editor2 null result2 null integer ii integer result2 para setp number to ii int value big decimal else if result instanceof big decimal result2 instanceof big decimal para setp number big decimal result if editor2 null result2 null para setp number to big decimal result2 boolean else if result instanceof boolean boolean bb boolean result string value bb boolean value y n para setp string value to does not make sense string else if result null para setp string result to string if editor2 null result2 null para setp string to result2 to string info para set info editor get display if editor2 null para setinfo to editor2 get display para save log fine para to string for every parameter return true saveparameters mtable getmandatory stringbuffer stringbuffer m_mfields mfield mfield m_mfields ismandatory veditor veditor veditor m_veditors veditor getvalue tostring setinserting seterror getheader seterror veditor veditor2 veditor m_veditors2 veditor2 veditor getvalue mfield mfield m_mfields2 tostring setinserting seterror getheader seterror adialog m_windowno fillmandatory tostring m_mfields veditor veditor m_veditors veditor veditor m_veditors2 getvalue getvalue mpinstancepara mpinstancepara getctx m_processinfo getad_pinstance_id mfield mfield mfield m_mfields setparametername mfield getcolumnname setp_date setp_date_to setp_number intvalue setp_number_to intvalue bigdecimal bigdecimal bigdecimal setp_number bigdecimal setp_number_to bigdecimal booleanvalue setp_string setp_string tostring setp_string_to tostring setinfo getdisplay setinfo_to getdisplay tostring is everything ok return true if parameters saved correctly public boolean isok return m isok m_isok show in the center of the screen pack set location and set visibility param window window to position public static void show center screen window window position center screen window window set visible true window to front showcenterscreen positioncenterscreen setvisible tofront position window in center of the screen param window window to position public static void position center screen window window position screen window swing constants center positioncenterscreen positionscreen swingconstants show in the center of the screen pack set location and set visibility param window window to position param position swing constants public static void show screen window window int position position screen window position window set visible true window to front swingconstants showscreen positionscreen setvisible tofront position window in center of the screen param window window to position param position swing constants public static void position screen window window int position window pack dimension s size toolkit get default toolkit get screen size dimension w size window get size int max width int s size width 97 int max height int s size height 97 fit on window if w size height max height w size height max height if w size width max width w size width max width window set size w size center int x s size width w size width 2 int y s size height w size height 2 if position swing constants center else if position swing constants north west x 0 y 0 else if position swing constants north y 0 else if position swing constants north east x s size width w size width y 0 else if position swing constants west x 0 else if position swing constants east x s size width w size width else if position swing constants south y s size height w size height else if position swing constants south west x 0 y s size height w size height else if position swing constants south east x s size width w size width y s size height w size height window set location x y swingconstants positionscreen ssize getdefaulttoolkit getscreensize wsize getsize maxwidth ssize maxheight ssize wsize maxheight wsize maxheight wsize maxwidth wsize maxwidth setsize wsize ssize wsize ssize wsize swingconstants swingconstants north_west swingconstants swingconstants north_east ssize wsize swingconstants swingconstants ssize wsize swingconstants ssize wsize swingconstants south_west ssize wsize swingconstants south_east ssize wsize ssize wsize setlocation position in center of the parent window pack set location and set visibility param parent parent window param window window to position public static void show center window window parent window window position center window parent window window set visible true window to front showcenterwindow positioncenterwindow setvisible tofront position in center of the parent window param parent parent window param window window to position public static void position center window window parent window window if parent null position center screen window return window pack dimension s size toolkit get default toolkit get screen size dimension w size window get size int max width int s size width 97 int max height int s size height 97 fit on window if w size height max height w size height max height if w size width max width w size width max width window set size w size center in parent rectangle p bounds parent get bounds parent is in upper left corner if p bounds x p bounds y p bounds x 0 position center screen window return find middle int x p bounds x p bounds width w size width 2 if x 0 x 0 int y p bounds y p bounds height w size height 2 if y 0 y 0 is it on screen if x w size width s size width x s size width w size width if y w size height s size height y s size height w size height system out println position x x y y w w size get width h w size get height parent loc x p loc x y y w p size get width h p size get height window set location x y positioncenterwindow positioncenterscreen ssize getdefaulttoolkit getscreensize wsize getsize maxwidth ssize maxheight ssize wsize maxheight wsize maxheight wsize maxwidth wsize maxwidth setsize wsize pbounds getbounds pbounds pbounds pbounds positioncenterscreen pbounds pbounds wsize pbounds pbounds wsize wsize ssize ssize wsize wsize ssize ssize wsize wsize getwidth wsize getheight ploc psize getwidth psize getheight setlocation get button param icon name return button public static c button get button string icon name c button button new c button env get image icon icon name 16 gif button set margin new insets 0 0 0 0 button set tool tip text msg get msg env get ctx icon name button set default capable false return button iconname cbutton getbutton iconname cbutton cbutton getimageicon iconname setmargin settooltiptext getmsg getctx iconname setdefaultcapable create menu title translate it and set mnemonics based on ms notation of help h is mnemonics param ad message message return j menu public static j menu get menu string ad message j menu menu new j menu string text msg get msg env get ctx ad message int pos text index of if pos 1 text length pos we have a nemonic char ch text to upper case char at pos 1 if ch text text substring 0 pos text substring pos 1 menu set mnemonic ch menu set text text return menu ad_message jmenu jmenu getmenu ad_message jmenu jmenu getmsg getctx ad_message indexof touppercase charat setmnemonic settext create menu item param action name action command param icon name optional name of the icon defaults to action if null param ks optional key stroke param menu menu to add menu item to param al action listener to register return menu item public static j menu item add menu item string action name string icon name key stroke ks j menu menu action listener al if icon name null icon name action name string text msg get msg env get ctx action name c menu item mi new c menu item text env get image icon icon name 16 gif mi set action command action name if ks null mi set accelerator ks if menu null menu add mi if al null mi add action listener al return mi actionname iconname menuitem jmenuitem addmenuitem actionname iconname keystroke jmenu actionlistener iconname iconname actionname getmsg getctx actionname cmenuitem cmenuitem getimageicon iconname setactioncommand actionname setaccelerator addactionlistener perform action command for common menu items created in a menu create menu a panel create menu form frame create menu param action command known action command param window no window no param c container parent return true if action command was found and performed public static boolean action performed string action command int window no container c m role role m role get default file menu if action command equals print screen print screen painter print screen env get frame c else if action command equals screen shot screen shot createjpeg env get frame c null else if action command equals report a env show center screen new process start else if action command equals exit if a dialog ask window no c exit application env exit env 0 view menu else if action command equals info product org compiere apps search info show product env get frame c window no else if action command equals infob partner org compiere apps search info showb partner env get frame c window no else if action command equals info asset org compiere apps search info show asset env get frame c window no else if action command equals info account m role get default is show acct new org compiere acct acct viewer else if action command equals info schedule new org compiere apps search info schedule env get frame c null false else if action command equals info order org compiere apps search info show order env get frame c window no else if action command equals info invoice org compiere apps search info show invoice env get frame c window no else if action command equals info in out org compiere apps search info show in out env get frame c window no else if action command equals info payment org compiere apps search info show payment env get frame c window no else if action command equals info cash line org compiere apps search info show cash line env get frame c window no else if action command equals info assignment org compiere apps search info show assignment env get frame c window no go menu else if action command equals work flow start workflow process 0 0 else if action command equals home env get window 0 to front tools menu else if action command equals calculator a env show center screen new org compiere grid ed calculator env get frame c else if action command equals calendar a env show center screen new org compiere grid ed calendar env get frame c else if action command equals editor a env show center screen new org compiere grid ed editor env get frame c else if action command equals script new script editor else if action command equals preference if role is show preference a env show center screen new preference env get frame c window no help menu else if action command equals online env start browser org compiere compiere geturl else if action command equals e mail support a dialog create supporte mail env get frame c env get frame c get title n n else if action command equals about a env show center screen new about box env get frame c else return false return true amenu createmenu apanel createmenu formframe createmenu actioncommand windowno actioncommand actionperformed actioncommand windowno mrole mrole getdefault actioncommand printscreen printscreenpainter printscreen getframe actioncommand screenshot screenshot getframe actioncommand aenv showcenterscreen processstart actioncommand adialog windowno exitapplication exitenv actioncommand infoproduct showproduct getframe windowno actioncommand infobpartner showbpartner getframe windowno actioncommand infoasset showasset getframe windowno actioncommand infoaccount mrole getdefault isshowacct acctviewer actioncommand infoschedule infoschedule getframe actioncommand infoorder showorder getframe windowno actioncommand infoinvoice showinvoice getframe windowno actioncommand infoinout showinout getframe windowno actioncommand infopayment showpayment getframe windowno actioncommand infocashline showcashline getframe windowno actioncommand infoassignment showassignment getframe windowno actioncommand workflow startworkflowprocess actioncommand getwindow tofront actioncommand aenv showcenterscreen getframe actioncommand aenv showcenterscreen getframe actioncommand aenv showcenterscreen getframe actioncommand scripteditor actioncommand isshowpreference aenv showcenterscreen getframe windowno actioncommand startbrowser actioncommand emailsupport adialog createsupportemail getframe getframe gettitle actioncommand aenv showcenterscreen aboutbox getframe set text and mnemonic for button create mnemonics of text containing based on ms notation of help h is mnemonics param b the button param text the text with optional mnemonics public static void set text mnemonic j button b string text if text null b null return int pos text index of if pos 1 we have a nemonic char ch text char at pos 1 b set mnemonic ch b set text text substring 0 pos text substring pos 1 b set text text settextmnemonic jbutton indexof charat setmnemonic settext settext get mnemonic character from text param text text with return mnemonic or 0 public static char get mnemonic string text int pos text index of if pos 1 we have a nemonic return text char at pos 1 return 0 getmnemonic indexof charat zoom param ad table id param record id public static void zoom int ad table id int record id string table name null int ad window id 0 int po window id 0 string sql select table name ad window id po window id from ad table where ad table id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query if rs next table name rs get string 1 ad window id rs get int 2 po window id rs get int 3 rs close pstmt close catch sql exception e log log level severe sql e nothing to zoom to if table name null ad window id 0 return po zoom boolean isso trx true if po window id 0 string where clause table name id record id isso trx db isso trx table name where clause if isso trx ad window id po window id log config table name record id record id isso trx isso trx a window frame new a window if frame init window ad window id m query get equal query table name id record id return a env show center screen frame frame null ad_table_id record_id ad_table_id record_id tablename ad_window_id po_window_id tablename ad_window_id po_window_id ad_table ad_table_id preparedstatement preparestatement setint ad_table_id resultset executequery tablename getstring ad_window_id getint po_window_id getint sqlexception tablename ad_window_id issotrx po_window_id whereclause tablename _id record_id issotrx issotrx tablename whereclause issotrx ad_window_id po_window_id tablename record_id record_id issotrx issotrx awindow awindow initwindow ad_window_id mquery getequalquery tablename _id record_id aenv showcenterscreen zoom param query query public static void zoom m query query if query null query get table name null query get table name length 0 return string table name query get table name int ad window id 0 int po window id 0 string sql select ad window id po window id from ad table where table name try prepared statement pstmt db prepare statement sql null pstmt set string 1 table name result set rs pstmt execute query if rs next ad window id rs get int 1 po window id rs get int 2 rs close pstmt close catch sql exception e log log level severe sql e nothing to zoom to if ad window id 0 return po zoom boolean isso trx true if po window id 0 isso trx db isso trx table name query get where clause false if isso trx ad window id po window id log config query isso trx isso trx a window frame new a window if frame init window ad window id query return a env show center screen frame frame null mquery gettablename gettablename tablename gettablename ad_window_id po_window_id ad_window_id po_window_id ad_table tablename preparedstatement preparestatement setstring tablename resultset executequery ad_window_id getint po_window_id getint sqlexception ad_window_id issotrx po_window_id issotrx issotrx tablename getwhereclause issotrx ad_window_id po_window_id issotrx issotrx awindow awindow initwindow ad_window_id aenv showcenterscreen exit system param status system exit status usually 0 for no error public static void exit int status if s server null try s server remove catch exception ex env exit env status s_server s_server exitenv is workflow process view enabled return true if enabled public static boolean is workflow process if s workflow null s workflow boolean false int ad table id 645 ad wf process if m role get default is table access ad table id true ro s workflow boolean true else ad table id 644 ad wf activity if m role get default is table access ad table id true ro s workflow boolean true else log config s workflow to string get window if s workflow boolean value s workflow window id db getsql value null select ad window id from ad table where ad table id ad table id if s workflow window id 0 s workflow window id 297 fallback hardcoded s workflow boolean false log config s workflow window s workflow window id return s workflow boolean value isworkflowprocess s_workflow s_workflow ad_table_id ad_wf_process mrole getdefault istableaccess ad_table_id s_workflow ad_table_id ad_wf_activity mrole getdefault istableaccess ad_table_id s_workflow s_workflow tostring s_workflow booleanvalue s_workflow_window_id getsqlvalue ad_window_id ad_table ad_table_id ad_table_id s_workflow_window_id s_workflow_window_id s_workflow s_workflow s_workflow_window_id s_workflow booleanvalue start workflow process window param ad table id optional table param record id optional record public static void start workflow process int ad table id int record id if s workflow window id 0 return m query query null if ad table id 0 record id 0 query new m query ad wf process query add restriction ad table id m query equal ad table id query add restriction record id m query equal record id a window frame new a window if frame init window s workflow window id query return a env show center screen frame frame null ad_table_id record_id startworkflowprocess ad_table_id record_id s_workflow_window_id mquery ad_table_id record_id mquery ad_wf_process addrestriction ad_table_id mquery ad_table_id addrestriction record_id mquery record_id awindow awindow initwindow s_workflow_window_id aenv showcenterscreen is apps server active return true if active public static boolean is server active boolean contact again s server null s servertries 0 boolean ok c connection get is apps serverok contact again if ok s servertries 0 return true if s servertries 1 try twice return false try to connect c log mgt enable false try s servertries log config try s servertries ok c connection get is apps serverok true if ok s servertries 0 catch exception ex ok false s server null c log mgt enable true return ok appsserver isserveractive contactagain s_server s_servertries cconnection isappsserverok contactagain s_servertries s_servertries clogmgt s_servertries s_servertries cconnection isappsserverok s_servertries s_server clogmgt get server version return apps server version see a login check version public static string get server version return c connection get get server version alogin checkversion getserverversion cconnection getserverversion get window model param window no window no param ad window id window param ad menu id menu return model window value obkect public static m windowvo getm windowvo int window no int ad window id int ad menu id log config window window no ad window id ad window id m windowvo m windowvo null if ad window id 0 ini is cache window try cache m windowvo s windows get ad window id if m windowvo null m windowvo m windowvo clone window no log info cached m windowvo try to get from server when enabled if m windowvo null db is remote objects is server active log config trying server try s server c connection get get server if s server null m windowvo s server get windowvo env get ctx window no ad window id ad menu id log config from server success catch remote exception e log log level severe re e m windowvo null s server null catch exception e throwable tt e get cause if tt null tt instanceof invalid class exception log log level severe server client class tt else if tt null tt instanceof not serializable exception log log level severe serialization tt get message e else log log level severe ex e m windowvo null s server null catch throwable t log log level severe t to string m windowvo null s server null if m windowvo null s windows put ad window id m windowvo from server create window model on client if m windowvo null log config create local m windowvo m windowvo create env get ctx window no ad window id ad menu id if m windowvo null s windows put ad window id m windowvo from client if m windowvo null return null check remote context if m windowvo ctx equals env get ctx remote context is called by value not reference add window properties to context enumeration key enum m windowvo ctx keys while key enum has more elements string key string key enum next element if key starts with window no string value m windowvo ctx get property key env set context env get ctx key value sync context m windowvo set ctx env get ctx return m windowvo windowno ad_window_id ad_menu_id mwindowvo getmwindowvo windowno ad_window_id ad_menu_id windowno ad_window_id ad_window_id mwindowvo mwindowvo ad_window_id iscachewindow mwindowvo s_windows ad_window_id mwindowvo mwindowvo mwindowvo windowno mwindowvo mwindowvo isremoteobjects isserveractive s_server cconnection getserver s_server mwindowvo s_server getwindowvo getctx windowno ad_window_id ad_menu_id remoteexception mwindowvo s_server getcause invalidclassexception notserializableexception getmessage mwindowvo s_server tostring mwindowvo s_server mwindowvo s_windows ad_window_id mwindowvo mwindowvo mwindowvo mwindowvo getctx windowno ad_window_id ad_menu_id mwindowvo s_windows ad_window_id mwindowvo mwindowvo mwindowvo getctx keyenum mwindowvo keyenum hasmoreelements keyenum nextelement startswith windowno mwindowvo getproperty setcontext getctx mwindowvo setctx getctx mwindowvo post immediate param window no window param ad table id table id of document param ad client id client id of document param record id record id of this document param force force posting return null if success otherwise error public static string post immediate int window no int ad client id int ad table id int record id boolean force log config window window no ad table id ad table id record id force force string error null try to get from server when enabled if is server active log config trying server try s server c connection get get server if s server null error s server post immediate env get ctx ad client id ad table id record id force null log config from server error null ok error else a dialog error window no null no apps server return no apps server catch remote exception e log log level severe re e error e get message s server null catch exception e log log level severe ex e error e get message s server null else a dialog error window no null no apps server return no apps server return error windowno ad_table_id ad_client_id record_id postimmediate windowno ad_client_id ad_table_id record_id windowno ad_table_id ad_table_id record_id isserveractive s_server cconnection getserver s_server s_server postimmediate getctx ad_client_id ad_table_id record_id adialog windowno noappsserver noappsserver remoteexception getmessage s_server getmessage s_server adialog windowno noappsserver noappsserver cache reset param table name table name param record id record id public static void cache reset string table name int record id log config table name table name record id record id try to get from server when enabled if is server active log config trying server try server server c connection get get server if server null server cache reset table name record id catch remote exception e log log level severe re e s server null catch exception e log log level severe ex e s server null tablename record_id cachereset tablename record_id tablename tablename record_id record_id isserveractive cconnection getserver cachereset tablename record_id remoteexception s_server s_server standard constructor param ctx context param ad task id id param trx name trx public m task properties ctx int ad task id string trx name super ctx ad task id trx name ad_task_id trxname mtask ad_task_id trxname ad_task_id trxname load cosntructor param ctx ctx param rs result set param trx name trx public m task properties ctx result set rs string trx name super ctx rs trx name trxname mtask resultset trxname trxname execute task and wait return execution info public string execute string cmd msg parse translation env get ctx getos command trim if cmd null cmd equals return cannot execute getos command if is server process return execute remote cmd return execute local cmd parsetranslation getctx getos_command getos_command isserverprocess executeremote executelocal execute task locally and wait param cmd command return execution info public string execute local string cmd log config cmd if m task null m task is alive m task interrupt m task new task cmd m task start string buffer sb new string buffer while true give it a bit of time try thread sleep 500 catch interrupted exception ioe log log level severe cmd ioe info to user sb append m task get out append n n append m task get err append n are we done if m task is alive break log config done return sb to string executelocal m_task m_task isalive m_task m_task m_task stringbuffer stringbuffer interruptedexception m_task getout m_task geterr m_task isalive tostring execute task locally and wait param cmd command return execution info public string execute remote string cmd log config cmd return remote n executeremote string representation return info public string to string string buffer sb new string buffer m task sb append get id append append get name append server append is server process append append getos command append return sb to string tostring stringbuffer stringbuffer mtask get_id getname isserverprocess getos_command tostring standard constructor public x ad wf responsible properties ctx int ad wf responsible id string trx name super ctx ad wf responsible id trx name if ad wf responsible id 0 setad role id 0 setad wf responsible id 0 set entity type null u set name null set responsible type null x_ad_wf_responsible ad_wf_responsible_id trxname ad_wf_responsible_id trxname ad_wf_responsible_id setad_role_id setad_wf_responsible_id setentitytype setname setresponsibletype load constructor public x ad wf responsible properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_responsible resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf responsible append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_responsible get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue public static final int ad user id ad reference id 286 set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id ad_user_id_ad_reference_id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 1 throw new illegal argument exception ad wf responsible id is mandatory set valuenocheck ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id illegalargumentexception ad_wf_responsible_id set_valuenocheck ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string responsibletype systemresource s set responsible type type of the responsibility for a workflow public void set responsible type string responsible type if responsible type null throw new illegal argument exception responsible type is mandatory if responsible type equals h responsible type equals o responsible type equals r responsible type equals s else throw new illegal argument exception responsible type invalid value responsible type reference id 304 h o r s if responsible type length 1 log warning length 1 truncated responsible type responsible type substring 0 0 set value responsible type responsible type responsibletype_systemresource setresponsibletype responsibletype responsibletype illegalargumentexception responsibletype responsibletype responsibletype responsibletype responsibletype illegalargumentexception responsibletype responsibletype reference_id responsibletype responsibletype responsibletype set_value responsibletype responsibletype get responsible type type of the responsibility for a workflow public string get responsible type return string get value responsible type getresponsibletype get_value responsibletype get contents return contents public object get contents return contents getcontents get tree node param tree tree param node id node return node or null public static mtree nodepr get mtree base tree int node id mtree nodepr ret value null string sql select from ad treenodepr where ad tree id and node id prepared statement pstmt null try pstmt db prepare statement sql tree get trxname pstmt set int 1 tree getad tree id pstmt set int 2 node id result set rs pstmt execute query if rs next ret value new mtree nodepr tree get ctx rs tree get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value node_id mtree_nodepr mtree_base node_id mtree_nodepr retvalue ad_treenodepr ad_tree_id node_id preparedstatement preparestatement get_trxname setint getad_tree_id setint node_id resultset executequery retvalue mtree_nodepr getctx get_trxname s_log retvalue load constructor param ctx context param rs result set public mtree nodepr properties ctx result set rs string trx name super ctx rs trx name mtree_nodepr resultset trxname trxname full constructor param tree tree param node id node public mtree nodepr mtree base tree int node id super tree get ctx 0 tree get trxname set client org tree setad tree id tree getad tree id setnode id node id add to root setparent id 0 set seq no 0 node_id mtree_nodepr mtree_base node_id getctx get_trxname setclientorg setad_tree_id getad_tree_id setnode_id node_id setparent_id setseqno run script param variable param script param ctx param window no included window variables return result static object run string variable string script properties ctx int window no scriptlet scr new scriptlet variable script ctx window no scr execute return scr get result false windowno windowno windowno getresult constructor public scriptlet this variable env get ctx 0 getctx full constructor param variable variable name param script the script param prop environment param window no included window variables public scriptlet string variable string script properties prop int window no set variable variable set script script set environment prop window no windowno windowno setvariable setscript setenvironment windowno full constructor param variable variable name param script the script param ctx environment public scriptlet string variable string script hash map string object ctx set variable variable set script script set environment ctx hashmap setvariable setscript setenvironment execute script loads environment and saves result return null or exception public exception execute m result null if m variable null m variable length 0 m script null m script length 0 illegal argument exception e new illegal argument exception no variable script log config e to string return e interpreter i new interpreter load environment i try log config m script i eval m script catch exception e log config e to string return e try m result i get m variable log config result m result get class get name m result catch exception e log config result e if e instanceof null pointer exception e new illegal argument exception result variable not found m variable return e return null m_result m_variable m_variable m_script m_script illegalargumentexception illegalargumentexception tostring loadenvironment m_script m_script tostring m_result m_variable m_result getclass getname m_result nullpointerexception illegalargumentexception m_variable set environment for interpreter param i interpreter private void load environment interpreter i if m ctx null return iterator it m ctx key set iterator while it has next string key string it next object value m ctx get key try if value instanceof boolean i set key boolean value boolean value else if value instanceof integer i set key integer value int value else if value instanceof double i set key double value double value else i set key value catch eval error ee log log level severe ee loadenvironment m_ctx m_ctx keyset hasnext m_ctx booleanvalue intvalue doublevalue evalerror get variable return variable public string get variable return m variable getvariable m_variable set variable param variable if null set to variable public void set variable string variable if variable null variable length 0 m variable variable else m variable variable setvariable m_variable m_variable set script param script public void set script string script if script null m script else m script script setscript m_script m_script get script return script public string get script return m script getscript m_script set environment param prop param window no included window variables public void set environment properties prop int window no if prop null prop env get ctx m ctx new hash map string object convert properties to hash map enumeration en prop keys while en has more elements string key en next element to string filter if key null key length 0 key starts with p preferences key index of 1 key starts with string value of window no other window settings continue string value prop get property key set environment key value windowno setenvironment windowno getctx m_ctx hashmap hashmap hasmoreelements nextelement tostring startswith indexof startswith valueof windowno getproperty setenvironment set environment key to value param key variable name will be converted to param string value try to convert to object public void set environment string key string string value if key null key length 0 return log fine scriptlet set environment key string value if string value null m ctx remove key return boolean if string value equals y m ctx put convert key key new boolean true return if string value equals n m ctx put convert key key new boolean false return timestamp timestamp time value null try time value timestamp value of string value m ctx put convert key key time value return catch exception e numeric integer int value null try int value integer value of string value catch exception e double double value null try double value double value of string value catch exception e if double value null if int value null double di double parse double int value to string the numbers are the same integer if double compare di double value double value 0 m ctx put convert key key int value return m ctx put convert key key double value return if int value null m ctx put convert key key int value return m ctx put convert key key string value _ stringvalue setenvironment stringvalue setenvironment stringvalue stringvalue m_ctx stringvalue m_ctx convertkey stringvalue m_ctx convertkey timevalue timevalue valueof stringvalue m_ctx convertkey timevalue intvalue intvalue valueof stringvalue doublevalue doublevalue valueof stringvalue doublevalue intvalue parsedouble intvalue tostring doublevalue doublevalue m_ctx convertkey intvalue m_ctx convertkey doublevalue intvalue m_ctx convertkey intvalue m_ctx convertkey stringvalue set environment key to value param key variable name will be vonverted to param value public void set environment string key object value if key null key length 0 log fine scriptlet set environment key value if value null m ctx remove key else m ctx put convert key key value _ setenvironment setenvironment m_ctx m_ctx convertkey convert key param key return converted key private string convert key string key string ret value util replace key return ret value _ convertkey retvalue _ retvalue set environment param ctx public void set environment hash map string object ctx if ctx null m ctx new hash map string object else m ctx ctx setenvironment hashmap m_ctx hashmap m_ctx get environment return environment public hash map string object get environment return m ctx hashmap getenvironment m_ctx get result param run it if true execute script return result or null public object get result boolean run it if run it execute return m result runit getresult runit runit m_result string representation incl result return scipt public string to string string buffer sb new string buffer m variable sb append append m script append append get result true return sb to string tostring stringbuffer stringbuffer m_variable m_script getresult tostring standard constructor public x ad wf nodenext properties ctx int ad wf nodenext id string trx name super ctx ad wf nodenext id trx name if ad wf nodenext id 0 setad wf next id 0 setad wf nodenext id 0 setad wf node id 0 set entity type null u set is std user workflow false set seq no 0 10 x_ad_wf_nodenext ad_wf_nodenext_id trxname ad_wf_nodenext_id trxname ad_wf_nodenext_id setad_wf_next_id setad_wf_nodenext_id setad_wf_node_id setentitytype setisstduserworkflow setseqno load constructor public x ad wf nodenext properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_nodenext resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf nodenext append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_nodenext get_id tostring public static final int ad wf next id ad reference id 109 set next node next node in workflow public void setad wf next id int ad wf next id if ad wf next id 1 throw new illegal argument exception ad wf next id is mandatory set value ad wf next id new integer ad wf next id ad_wf_next_id_ad_reference_id setad_wf_next_id ad_wf_next_id ad_wf_next_id illegalargumentexception ad_wf_next_id set_value ad_wf_next_id ad_wf_next_id get next node next node in workflow public int getad wf next id integer ii integer get value ad wf next id if ii null return 0 return ii int value getad_wf_next_id get_value ad_wf_next_id intvalue set node transition workflow node transition public void setad wf nodenext id int ad wf nodenext id if ad wf nodenext id 1 throw new illegal argument exception ad wf nodenext id is mandatory set valuenocheck ad wf nodenext id new integer ad wf nodenext id setad_wf_nodenext_id ad_wf_nodenext_id ad_wf_nodenext_id illegalargumentexception ad_wf_nodenext_id set_valuenocheck ad_wf_nodenext_id ad_wf_nodenext_id get node transition workflow node transition public int getad wf nodenext id integer ii integer get value ad wf nodenext id if ii null return 0 return ii int value getad_wf_nodenext_id get_value ad_wf_nodenext_id intvalue set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 1 throw new illegal argument exception ad wf node id is mandatory set valuenocheck ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception ad_wf_node_id set_valuenocheck ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf node id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_node_id set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set std user workflow standard manual user approval workflow public void set is std user workflow boolean is std user workflow set value is std user workflow new boolean is std user workflow setisstduserworkflow isstduserworkflow set_value isstduserworkflow isstduserworkflow get std user workflow standard manual user approval workflow public boolean is std user workflow object oo get value is std user workflow if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isstduserworkflow get_value isstduserworkflow booleanvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set transition code code resulting in true of false public void set transition code string transition code if transition code null transition code length 2000 log warning length 2000 truncated transition code transition code substring 0 1999 set value transition code transition code settransitioncode transitioncode transitioncode transitioncode transitioncode transitioncode set_value transitioncode transitioncode get transition code code resulting in true of false public string get transition code return string get value transition code gettransitioncode get_value transitioncode standard constructor public x t inventoryvalue properties ctx int t inventoryvalue id string trx name super ctx t inventoryvalue id trx name if t inventoryvalue id 0 setad pinstance id 0 setm attributesetinstance id 0 setm product id 0 setm warehouse id 0 x_t_inventoryvalue t_inventoryvalue_id trxname t_inventoryvalue_id trxname t_inventoryvalue_id setad_pinstance_id setm_attributesetinstance_id setm_product_id setm_warehouse_id load constructor public x t inventoryvalue properties ctx result set rs string trx name super ctx rs trx name x_t_inventoryvalue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t inventoryvalue append get id append return sb to string tostring stringbuffer stringbuffer x_t_inventoryvalue get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set cost cost information public void set cost big decimal cost set value cost cost setcost bigdecimal set_value get cost cost information public big decimal get cost big decimal bd big decimal get value cost if bd null return env zero return bd bigdecimal getcost bigdecimal bigdecimal get_value set cost value value with cost public void set cost amt big decimal cost amt set value cost amt cost amt setcostamt bigdecimal costamt set_value costamt costamt get cost value value with cost public big decimal get cost amt big decimal bd big decimal get value cost amt if bd null return env zero return bd bigdecimal getcostamt bigdecimal bigdecimal get_value costamt set standard cost standard costs public void set cost standard big decimal cost standard set value cost standard cost standard setcoststandard bigdecimal coststandard set_value coststandard coststandard get standard cost standard costs public big decimal get cost standard big decimal bd big decimal get value cost standard if bd null return env zero return bd bigdecimal getcoststandard bigdecimal bigdecimal get_value coststandard set standard cost value value in standard costs public void set cost standard amt big decimal cost standard amt set value cost standard amt cost standard amt setcoststandardamt bigdecimal coststandardamt set_value coststandardamt coststandardamt get standard cost value value in standard costs public big decimal get cost standard amt big decimal bd big decimal get value cost standard amt if bd null return env zero return bd bigdecimal getcoststandardamt bigdecimal bigdecimal get_value coststandardamt set valuation date date of valuation public void set date value timestamp date value set value date value date value setdatevalue datevalue set_value datevalue datevalue get valuation date date of valuation public timestamp get date value return timestamp get value date value getdatevalue get_value datevalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 0 set value m costelement id null else set value m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id set_value m_costelement_id set_value m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set price list version identifies a unique instance of a price list public void setm pricelist version id int m pricelist version id if m pricelist version id 0 set value m pricelist version id null else set value m pricelist version id new integer m pricelist version id setm_pricelist_version_id m_pricelist_version_id m_pricelist_version_id set_value m_pricelist_version_id set_value m_pricelist_version_id m_pricelist_version_id get price list version identifies a unique instance of a price list public int getm pricelist version id integer ii integer get value m pricelist version id if ii null return 0 return ii int value getm_pricelist_version_id get_value m_pricelist_version_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set limit price lowest price for a product public void set price limit big decimal price limit set value price limit price limit setpricelimit bigdecimal pricelimit set_value pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set limit price value value with limit price public void set price limit amt big decimal price limit amt set value price limit amt price limit amt setpricelimitamt bigdecimal pricelimitamt set_value pricelimitamt pricelimitamt get limit price value value with limit price public big decimal get price limit amt big decimal bd big decimal get value price limit amt if bd null return env zero return bd bigdecimal getpricelimitamt bigdecimal bigdecimal get_value pricelimitamt set list price list price public void set price list big decimal price list set value price list price list setpricelist bigdecimal pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set list price value valuation with list price public void set price list amt big decimal price list amt set value price list amt price list amt setpricelistamt bigdecimal pricelistamt set_value pricelistamt pricelistamt get list price value valuation with list price public big decimal get price list amt big decimal bd big decimal get value price list amt if bd null return env zero return bd bigdecimal getpricelistamt bigdecimal bigdecimal get_value pricelistamt set po price price based on a purchase order public void set pricepo big decimal pricepo set value pricepo pricepo setpricepo bigdecimal set_value get po price price based on a purchase order public big decimal get pricepo big decimal bd big decimal get value pricepo if bd null return env zero return bd bigdecimal getpricepo bigdecimal bigdecimal get_value set po price value valuation with po price public void set pricepo amt big decimal pricepo amt set value pricepo amt pricepo amt setpricepoamt bigdecimal pricepoamt set_value pricepoamt pricepoamt get po price value valuation with po price public big decimal get pricepo amt big decimal bd big decimal get value pricepo amt if bd null return env zero return bd bigdecimal getpricepoamt bigdecimal bigdecimal get_value pricepoamt set standard price standard price public void set price std big decimal price std set value price std price std setpricestd bigdecimal pricestd set_value pricestd pricestd get standard price standard price public big decimal get price std big decimal bd big decimal get value price std if bd null return env zero return bd bigdecimal getpricestd bigdecimal bigdecimal get_value pricestd set std price value valuation with standard price public void set price std amt big decimal price std amt set value price std amt price std amt setpricestdamt bigdecimal pricestdamt set_value pricestdamt pricestdamt get std price value valuation with standard price public big decimal get price std amt big decimal bd big decimal get value price std amt if bd null return env zero return bd bigdecimal getpricestdamt bigdecimal bigdecimal get_value pricestdamt set on hand quantity on hand quantity public void set qty on hand big decimal qty on hand set value qty on hand qty on hand setqtyonhand bigdecimal qtyonhand set_value qtyonhand qtyonhand get on hand quantity on hand quantity public big decimal get qty on hand big decimal bd big decimal get value qty on hand if bd null return env zero return bd bigdecimal getqtyonhand bigdecimal bigdecimal get_value qtyonhand basic constructor use the set methods to set the attibutes public img creates an img tag param src the src attribute public img string src set src src setsrc creates an img tag param src the src attribute param border the border attribute public img string src int border set src src set border border setsrc setborder creates an img tag param src the src attribute param name the name attribute public img string src string name set src src set name name setsrc setname creates an img tag param src the src attribute param name the name attribute param border the border attribute public img string src string name int border set src src set name name set border border setsrc setname setborder sets the src attribute param src the src attribute public img set src string src add attribute src src return this setsrc addattribute sets the border attribute param border the border attribute public img set border int border add attribute border integer to string border return this setborder addattribute tostring sets the name attribute param name the name attribute public img set name string name add attribute name name return this setname addattribute sets the height attribute param height the height attribute public img set height string height add attribute height height return this setheight addattribute sets the height attribute param height the height attribute public img set height int height add attribute height integer to string height return this setheight addattribute tostring sets the width attribute param width the width attribute public img set width string width add attribute width width return this setwidth addattribute sets the width attribute param width the width attribute public img set width int width add attribute width integer to string width return this setwidth addattribute tostring sets the alt attribute param alt the alt attribute public img set alt string alt add attribute alt alt return this setalt addattribute sets the ismap attribute param ismap the ismap attribute public img set is map boolean ismap if ismap true add attribute ismap ismap else remove attribute ismap return this setismap addattribute removeattribute sets the usmap attribute param usemap the usmap attribute public img set use map string usemap add attribute usemap usemap return this setusemap addattribute sets the align attribute param align the align attribute public img set align string align add attribute align align return this setalign addattribute sets the hspace attribute param hspace the hspace attribute public img set hspace string hspace add attribute hspace hspace return this sethspace addattribute sets the hspace attribute param hspace the hspace attribute public img set hspace int hspace add attribute hspace integer to string hspace return this sethspace addattribute tostring sets the vspace attribute param vspace the vspace attribute public img set vspace string vspace add attribute vspace vspace return this setvspace addattribute sets the vspace attribute param vspace the vspace attribute public img set vspace int vspace add attribute vspace integer to string vspace return this setvspace addattribute tostring sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public img add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public img add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public img add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public img add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public img remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x c landedcost properties ctx int c landedcost id string trx name super ctx c landedcost id trx name if c landedcost id 0 setc invoiceline id 0 setc landedcost id 0 set landed cost distribution null q setm costelement id 0 x_c_landedcost c_landedcost_id trxname c_landedcost_id trxname c_landedcost_id setc_invoiceline_id setc_landedcost_id setlandedcostdistribution setm_costelement_id load constructor public x c landedcost properties ctx result set rs string trx name super ctx rs trx name x_c_landedcost resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c landedcost append get id append return sb to string tostring stringbuffer stringbuffer x_c_landedcost get_id tostring set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 1 throw new illegal argument exception c invoiceline id is mandatory set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id illegalargumentexception c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoiceline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoiceline_id set landed cost landed cost to be allocated to material receipts public void setc landedcost id int c landedcost id if c landedcost id 1 throw new illegal argument exception c landedcost id is mandatory set valuenocheck c landedcost id new integer c landedcost id setc_landedcost_id c_landedcost_id c_landedcost_id illegalargumentexception c_landedcost_id set_valuenocheck c_landedcost_id c_landedcost_id get landed cost landed cost to be allocated to material receipts public int getc landedcost id integer ii integer get value c landedcost id if ii null return 0 return ii int value getc_landedcost_id get_value c_landedcost_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string landedcostdistribution weight w set cost distribution landed cost distribution public void set landed cost distribution string landed cost distribution if landed cost distribution null throw new illegal argument exception landed cost distribution is mandatory if landed cost distribution equals c landed cost distribution equals l landed cost distribution equals q landed cost distribution equals v landed cost distribution equals w else throw new illegal argument exception landed cost distribution invalid value landed cost distribution reference id 339 c l q v w if landed cost distribution length 1 log warning length 1 truncated landed cost distribution landed cost distribution substring 0 0 set value landed cost distribution landed cost distribution landedcostdistribution_weight setlandedcostdistribution landedcostdistribution landedcostdistribution illegalargumentexception landedcostdistribution landedcostdistribution landedcostdistribution landedcostdistribution landedcostdistribution landedcostdistribution illegalargumentexception landedcostdistribution landedcostdistribution reference_id landedcostdistribution landedcostdistribution landedcostdistribution set_value landedcostdistribution landedcostdistribution get cost distribution landed cost distribution public string get landed cost distribution return string get value landed cost distribution getlandedcostdistribution get_value landedcostdistribution set cost element product cost element public void setm costelement id int m costelement id if m costelement id 1 throw new illegal argument exception m costelement id is mandatory set value m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id illegalargumentexception m_costelement_id set_value m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set value m inoutline id null else set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_value m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 0 set value m inout id null else set value m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id set_value m_inout_id set_value m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue m lookup loader starts loading ignore for now param info m lookup info protected static void load start m lookup info info mlookup mlookupinfo loadstart mlookupinfo m lookup loader ends loading so add it to cache param info param lookup protected static void load end m lookup info info hash map lookup if info is validated lookup size 0 s loadedlookups put get key info lookup mlookup loadend mlookupinfo hashmap isvalidated s_loadedlookups getkey get storage key param info lookup info return key private static string get key m lookup info info if info null return string value of system current time millis string buffer sb new string buffer sb append info window no append append info column id append info key column append info ad reference value id append info query append info validation code does not include ctx return sb to string getkey mlookupinfo valueof currenttimemillis stringbuffer stringbuffer windowno column_id keycolumn ad_reference_value_id validationcode tostring load from cache if applicable called from m lookup constructor param info m lookup info to search param lookup target target hash map return true if lookup found protected static boolean load from cache m lookup info info hash map object object lookup target string key get key info hash map cache hash map s loadedlookups get key if cache null return false nothing cached if cache size 0 s loadedlookups remove key return false copy asynchronously to speed things up if cache size copy async copy cache we can use iterator as the lookup loading is complete i e no additional entries iterator iterator cache key set iterator while iterator has next object cache key iterator next object cache data cache get cache key lookup target put cache key cache data s log fine lookup target size return true mlookup mlookupinfo lookuptarget hashmap loadfromcache mlookupinfo hashmap lookuptarget getkey hashmap hashmap s_loadedlookups s_loadedlookups copyasync keyset hasnext cachekey cachedata cachekey lookuptarget cachekey cachedata s_log lookuptarget clear static lookup cache for window param window no window no of cache entries to delete public static void cache reset int window no string key string value of window no int start no s loadedlookups size find keys of lookups to delete array list string to delete new array list string iterator iterator s loadedlookups key set iterator while iterator has next string info string iterator next if info null info starts with key to delete add info do the actual delete for int i 0 i to delete size i s loadedlookups remove to delete get i int end no s loadedlookups size s log fine window no window no start no end no windowno windowno cachereset windowno valueof windowno startno s_loadedlookups arraylist todelete arraylist s_loadedlookups keyset hasnext startswith todelete todelete s_loadedlookups todelete endno s_loadedlookups s_log windowno windowno startno endno private constructor private m lookup cache mlookupcache standard constructor public x ad wf node properties ctx int ad wf node id string trx name super ctx ad wf node id trx name if ad wf node id 0 setad wf node id 0 setad workflow id 0 set action null n set cost env zero set duration 0 set entity type null u set is centrally maintained true y set join element null x set limit 0 set name null set split element null x set value null set waiting time 0 setx position 0 sety position 0 x_ad_wf_node ad_wf_node_id trxname ad_wf_node_id trxname ad_wf_node_id setad_wf_node_id setad_workflow_id setaction setcost setduration setentitytype setiscentrallymaintained setjoinelement setlimit setname setsplitelement setvalue setwaitingtime setxposition setyposition load constructor public x ad wf node properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_node resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf node append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_node get_id tostring set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set special form special form public void setad form id int ad form id if ad form id 0 set value ad form id null else set value ad form id new integer ad form id setad_form_id ad_form_id ad_form_id set_value ad_form_id set_value ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue set image system image or icon public void setad image id int ad image id if ad image id 0 set value ad image id null else set value ad image id new integer ad image id setad_image_id ad_image_id ad_image_id set_value ad_image_id set_value ad_image_id ad_image_id get image system image or icon public int getad image id integer ii integer get value ad image id if ii null return 0 return ii int value getad_image_id get_value ad_image_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set os task operation system task public void setad task id int ad task id if ad task id 0 set value ad task id null else set value ad task id new integer ad task id setad_task_id ad_task_id ad_task_id set_value ad_task_id set_value ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue set workflow block workflow transaction execution block public void setad wf block id int ad wf block id if ad wf block id 0 set value ad wf block id null else set value ad wf block id new integer ad wf block id setad_wf_block_id ad_wf_block_id ad_wf_block_id set_value ad_wf_block_id set_value ad_wf_block_id ad_wf_block_id get workflow block workflow transaction execution block public int getad wf block id integer ii integer get value ad wf block id if ii null return 0 return ii int value getad_wf_block_id get_value ad_wf_block_id intvalue set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 1 throw new illegal argument exception ad wf node id is mandatory set valuenocheck ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception ad_wf_node_id set_valuenocheck ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 0 set value ad wf responsible id null else set value ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id set_value ad_wf_responsible_id set_value ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set valuenocheck ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_valuenocheck ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue public static final string action waitsleep z set action indicates the action to be performed public void set action string action if action null throw new illegal argument exception action is mandatory if action equals b action equals c action equals d action equals f action equals m action equals p action equals r action equals t action equals v action equals w action equals x action equals z else throw new illegal argument exception action invalid value action reference id 302 b c d f m p r t v w x z if action length 1 log warning length 1 truncated action action substring 0 0 set value action action action_waitsleep setaction illegalargumentexception illegalargumentexception reference_id set_value get action indicates the action to be performed public string get action return string get value action getaction get_value set attribute name name of the attribute public void set attribute name string attribute name if attribute name null attribute name length 60 log warning length 60 truncated attribute name attribute name substring 0 59 set value attribute name attribute name setattributename attributename attributename attributename attributename attributename set_value attributename attributename get attribute name name of the attribute public string get attribute name return string get value attribute name getattributename get_value attributename set attribute value value of the attribute public void set attribute value string attribute value if attribute value null attribute value length 60 log warning length 60 truncated attribute value attribute value substring 0 59 set value attribute value attribute value setattributevalue attributevalue attributevalue attributevalue attributevalue attributevalue set_value attributevalue attributevalue get attribute value value of the attribute public string get attribute value return string get value attribute value getattributevalue get_value attributevalue set cost cost information public void set cost big decimal cost if cost null throw new illegal argument exception cost is mandatory set value cost cost setcost bigdecimal illegalargumentexception set_value get cost cost information public big decimal get cost big decimal bd big decimal get value cost if bd null return env zero return bd bigdecimal getcost bigdecimal bigdecimal get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action null doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action null doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction set duration normal duration in duration unit public void set duration int duration set value duration new integer duration setduration set_value get duration normal duration in duration unit public int get duration integer ii integer get value duration if ii null return 0 return ii int value getduration get_value intvalue set dynamic priority change change of priority when activity is suspended waiting for user public void set dyn priority change big decimal dyn priority change set value dyn priority change dyn priority change setdynprioritychange bigdecimal dynprioritychange set_value dynprioritychange dynprioritychange get dynamic priority change change of priority when activity is suspended waiting for user public big decimal get dyn priority change big decimal bd big decimal get value dyn priority change if bd null return env zero return bd bigdecimal getdynprioritychange bigdecimal bigdecimal get_value dynprioritychange public static final string dynpriorityunit minute m set dynamic priority unit change of priority when activity is suspended waiting for user public void set dyn priority unit string dyn priority unit if dyn priority unit null throw new illegal argument exception dyn priority unit is mandatory if dyn priority unit null dyn priority unit equals d dyn priority unit equals h dyn priority unit equals m else throw new illegal argument exception dyn priority unit invalid value dyn priority unit reference id 221 d h m if dyn priority unit null dyn priority unit length 1 log warning length 1 truncated dyn priority unit dyn priority unit substring 0 0 set value dyn priority unit dyn priority unit dynpriorityunit_minute setdynpriorityunit dynpriorityunit dynpriorityunit illegalargumentexception dynpriorityunit dynpriorityunit dynpriorityunit dynpriorityunit dynpriorityunit illegalargumentexception dynpriorityunit dynpriorityunit reference_id dynpriorityunit dynpriorityunit dynpriorityunit dynpriorityunit set_value dynpriorityunit dynpriorityunit get dynamic priority unit change of priority when activity is suspended waiting for user public string get dyn priority unit return string get value dyn priority unit getdynpriorityunit get_value dynpriorityunit set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email public static final string emailrecipient wfresponsible r set e mail recipient recipient of the e mail public void sete mail recipient string e mail recipient if e mail recipient null throw new illegal argument exception e mail recipient is mandatory if e mail recipient null e mail recipient equals b e mail recipient equals d e mail recipient equals r else throw new illegal argument exception e mail recipient invalid value e mail recipient reference id 363 b d r if e mail recipient null e mail recipient length 1 log warning length 1 truncated e mail recipient e mail recipient substring 0 0 set value e mail recipient e mail recipient emailrecipient_wfresponsible email email setemailrecipient emailrecipient emailrecipient illegalargumentexception emailrecipient emailrecipient emailrecipient emailrecipient emailrecipient illegalargumentexception emailrecipient emailrecipient reference_id emailrecipient emailrecipient emailrecipient emailrecipient set_value emailrecipient emailrecipient get e mail recipient recipient of the e mail public string gete mail recipient return string get value e mail recipient email email getemailrecipient get_value emailrecipient public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype public static final string finishmode manual m set finish mode workflow activity finish mode public void set finish mode string finish mode if finish mode null throw new illegal argument exception finish mode is mandatory if finish mode null finish mode equals a finish mode equals m else throw new illegal argument exception finish mode invalid value finish mode reference id 303 a m if finish mode null finish mode length 1 log warning length 1 truncated finish mode finish mode substring 0 0 set value finish mode finish mode finishmode_manual setfinishmode finishmode finishmode illegalargumentexception finishmode finishmode finishmode finishmode illegalargumentexception finishmode finishmode reference_id finishmode finishmode finishmode finishmode set_value finishmode finishmode get finish mode workflow activity finish mode public string get finish mode return string get value finish mode getfinishmode get_value finishmode set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set centrally maintained information maintained in system element table public void set is centrally maintained boolean is centrally maintained set value is centrally maintained new boolean is centrally maintained setiscentrallymaintained iscentrallymaintained set_value iscentrallymaintained iscentrallymaintained get centrally maintained information maintained in system element table public boolean is centrally maintained object oo get value is centrally maintained if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscentrallymaintained get_value iscentrallymaintained booleanvalue public static final string joinelement xor x set join element semantics for multiple incoming transitions public void set join element string join element if join element null throw new illegal argument exception join element is mandatory if join element equals a join element equals x else throw new illegal argument exception join element invalid value join element reference id 301 a x if join element length 1 log warning length 1 truncated join element join element substring 0 0 set value join element join element joinelement_xor setjoinelement joinelement joinelement illegalargumentexception joinelement joinelement joinelement illegalargumentexception joinelement joinelement reference_id joinelement joinelement joinelement set_value joinelement joinelement get join element semantics for multiple incoming transitions public string get join element return string get value join element getjoinelement get_value joinelement set duration limit maximum duration in duration unit public void set limit int limit set value limit new integer limit setlimit set_value get duration limit maximum duration in duration unit public int get limit integer ii integer get value limit if ii null return 0 return ii int value getlimit get_value intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set priority indicates if this request is of a high medium or low priority public void set priority int priority set value priority new integer priority setpriority set_value get priority indicates if this request is of a high medium or low priority public int get priority integer ii integer get value priority if ii null return 0 return ii int value getpriority get_value intvalue set mail template text templates for mailings public void setr mailtext id int r mailtext id if r mailtext id 0 set value r mailtext id null else set value r mailtext id new integer r mailtext id setr_mailtext_id r_mailtext_id r_mailtext_id set_value r_mailtext_id set_value r_mailtext_id r_mailtext_id get mail template text templates for mailings public int getr mailtext id integer ii integer get value r mailtext id if ii null return 0 return ii int value getr_mailtext_id get_value r_mailtext_id intvalue public static final string splitelement xor x set split element semantics for multiple outgoing transitions public void set split element string split element if split element null throw new illegal argument exception split element is mandatory if split element equals a split element equals x else throw new illegal argument exception split element invalid value split element reference id 301 a x if split element length 1 log warning length 1 truncated split element split element substring 0 0 set value split element split element splitelement_xor setsplitelement splitelement splitelement illegalargumentexception splitelement splitelement splitelement illegalargumentexception splitelement splitelement reference_id splitelement splitelement splitelement set_value splitelement splitelement get split element semantics for multiple outgoing transitions public string get split element return string get value split element getsplitelement get_value splitelement public static final string startmode manual m set start mode workflow activity start mode public void set start mode string start mode if start mode null throw new illegal argument exception start mode is mandatory if start mode null start mode equals a start mode equals m else throw new illegal argument exception start mode invalid value start mode reference id 303 a m if start mode null start mode length 1 log warning length 1 truncated start mode start mode substring 0 0 set value start mode start mode startmode_manual setstartmode startmode startmode illegalargumentexception startmode startmode startmode startmode illegalargumentexception startmode startmode reference_id startmode startmode startmode startmode set_value startmode startmode get start mode workflow activity start mode public string get start mode return string get value start mode getstartmode get_value startmode public static final string subflowexecution synchronously s set subflow execution mode how the sub workflow is executed public void set subflow execution string subflow execution if subflow execution null throw new illegal argument exception subflow execution is mandatory if subflow execution null subflow execution equals a subflow execution equals s else throw new illegal argument exception subflow execution invalid value subflow execution reference id 307 a s if subflow execution null subflow execution length 1 log warning length 1 truncated subflow execution subflow execution substring 0 0 set value subflow execution subflow execution subflowexecution_synchronously setsubflowexecution subflowexecution subflowexecution illegalargumentexception subflowexecution subflowexecution subflowexecution subflowexecution illegalargumentexception subflowexecution subflowexecution reference_id subflowexecution subflowexecution subflowexecution subflowexecution set_value subflowexecution subflowexecution get subflow execution mode how the sub workflow is executed public string get subflow execution return string get value subflow execution getsubflowexecution get_value subflowexecution set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set wait time time in minutes to wait sleep public void set wait time int wait time set value wait time new integer wait time setwaittime waittime set_value waittime waittime get wait time time in minutes to wait sleep public int get wait time integer ii integer get value wait time if ii null return 0 return ii int value getwaittime get_value waittime intvalue set waiting time workflow simulation waiting time public void set waiting time int waiting time set value waiting time new integer waiting time setwaitingtime waitingtime set_value waitingtime waitingtime get waiting time workflow simulation waiting time public int get waiting time integer ii integer get value waiting time if ii null return 0 return ii int value getwaitingtime get_value waitingtime intvalue public static final int workflow id ad reference id 174 set workflow workflow or tasks public void setworkflow id int workflow id if workflow id 0 set value workflow id null else set value workflow id new integer workflow id workflow_id_ad_reference_id setworkflow_id workflow_id workflow_id set_value workflow_id set_value workflow_id workflow_id get workflow workflow or tasks public int getworkflow id integer ii integer get value workflow id if ii null return 0 return ii int value getworkflow_id get_value workflow_id intvalue set working time workflow simulation execution time public void set working time int working time set value working time new integer working time setworkingtime workingtime set_value workingtime workingtime get working time workflow simulation execution time public int get working time integer ii integer get value working time if ii null return 0 return ii int value getworkingtime get_value workingtime intvalue set x position absolute x horizontal position in 1 72 of an inch public void setx position int x position set value x position new integer x position setxposition xposition set_value xposition xposition get x position absolute x horizontal position in 1 72 of an inch public int getx position integer ii integer get value x position if ii null return 0 return ii int value getxposition get_value xposition intvalue set y position absolute y vertical position in 1 72 of an inch public void sety position int y position set value y position new integer y position setyposition yposition set_value yposition yposition get y position absolute y vertical position in 1 72 of an inch public int gety position integer ii integer get value y position if ii null return 0 return ii int value getyposition get_value yposition intvalue constructor param ctx context param pf print format param query optional query public report engine properties ctx m print format pf m query query print info info if pf null throw new illegal argument exception report engine no print format log info pf query m ctx ctx m printformat pf m info info set query query loads data reportengine mprintformat mquery printinfo illegalargumentexception reportengine printformat m_ctx m_printformat m_info setquery set print format if layout was created re create layout param pf print format protected void set print format m print format pf m printformat pf if m layout null set print data m layout set print format pf false m layout set print data m printdata m query true format changes data if m view null m view revalidate printformat setprintformat mprintformat m_printformat m_layout setprintdata m_layout setprintformat m_layout setprintdata m_printdata m_query m_view m_view set query and generate print data if layout was created re create layout param query query protected void set query m query query m query query if query null return set print data if m layout null m layout set print data m printdata m query true if m view null m view revalidate printdata setquery mquery m_query setprintdata m_layout m_layout setprintdata m_printdata m_query m_view m_view get query return query public m query get query return m query mquery getquery m_query set print data for format restricted by query nothing set if there is no query sets m printdata private void set print data if m query null return data engine de new data engine m printformat get language set print data de get print data m ctx m printformat m query m printdata dump printdata m_printdata setprintdata m_query dataengine dataengine m_printformat getlanguage setprintdata getprintdata m_ctx m_printformat m_query m_printdata get print data return print data public print data get print data return m printdata printdata printdata getprintdata m_printdata set print data param print data print data public void set print data print data print data if print data null return m printdata print data printdata printdata printdata setprintdata printdata printdata printdata m_printdata printdata layout private void layout if m printformat null throw new illegal state exception no print format if m printdata null throw new illegal state exception no print data delete print format and restart m layout new layout engine m printformat m printdata m query m_printformat illegalstateexception m_printdata illegalstateexception m_layout layoutengine m_printformat m_printdata m_query get layout return layout protected layout engine get layout if m layout null layout return m layout layoutengine getlayout m_layout m_layout get print format report name return name public string get name return m printformat get name printformat getname m_printformat getname get print format return print format public m print format get print format return m printformat printformat mprintformat getprintformat m_printformat get print info return info public print info get print info return m info printinfo getprintinfo m_info get print layout report context return context public properties get ctx return m layout get ctx printlayout getctx m_layout getctx get row count return row count public int get row count return m printdata get row count getrowcount m_printdata getrowcount get column count return column count public int get column count if m layout null return m layout get column count return 0 getcolumncount m_layout m_layout getcolumncount get view panel return view panel public view get view if m layout null layout if m view null m view new view m layout return m view getview m_layout m_view m_view m_layout m_view print report public void print log info m info to string if m layout null layout paper attributes media printable area orientation requested media print request attribute set prats m layout get paper get print request attribute set add copies job name priority if m info is document copy m info get copies 1 prats add new copies 1 else prats add new copies m info get copies locale locale language get login language get locale prats add new job name m printformat get name locale prats add print util get job priority m layout get number of pages m info get copies true try printer job printer job job get printer job m info get printer name job get print service add print service attribute listener this job set pageable m layout get pageable false no copy dialog try if m info is with dialog job print dialog prats return catch exception e log log level warning operating system print issue check try again e return submit boolean print copy m info is document copy m info get copies 1 archive engine get archive m layout m info print util print job prats false print copy document print copies if print copy log info copy m info get copies 1 prats add new copies m info get copies 1 job get printer job m info get printer name job get print service add print service attribute listener this job set pageable m layout get pageable true copy print util print job prats false false catch exception e log log level severe e m_info tostring m_layout printrequestattributeset m_layout getpaper getprintrequestattributeset m_info isdocumentcopy m_info getcopies m_info getcopies getloginlanguage getlocale jobname m_printformat getname printutil getjobpriority m_layout getnumberofpages m_info getcopies printerjob printerjob getprinterjob m_info getprintername getprintservice addprintserviceattributelistener setpageable m_layout getpageable m_info iswithdialog printdialog printcopy m_info isdocumentcopy m_info getcopies archiveengine m_layout m_info printutil printcopy printcopy m_info getcopies m_info getcopies getprinterjob m_info getprintername getprintservice addprintserviceattributelistener setpageable m_layout getpageable printutil print service attribute listener param psae event public void attribute update print service attribute event psae print event on win32 printer main hp laser jet 5l print service attribute set length 2 queued job count 0 class javax print attribute standard queued job count printer is accepting jobs accepting jobs class javax print attribute standard printer is accepting jobs print event on win32 printer main hp laser jet 5l print service attribute set length 1 queued job count 1 class javax print attribute standard queued job count print event on win32 printer main hp laser jet 5l print service attribute set length 1 queued job count 0 class javax print attribute standard queued job count log fine attribute update psae print util dump psae get attributes attributeupdate printserviceattributeevent printevent laserjet printserviceattributeset queuedjobcount printerisacceptingjobs printevent laserjet printserviceattributeset queuedjobcount printevent laserjet printserviceattributeset queuedjobcount attributeupdate printutil getattributes get printer job based on printer name param printer name optional printer name return printer job private printer job get printer job string printer name if printer name null printer name length 0 return c printer get printer job printer name return c printer get printer job m printername printerjob printername printername printerjob printerjob getprinterjob printername printername printername cprinter getprinterjob printername cprinter getprinterjob m_printername show dialog and set paper optionally re calculate layout public void page setup dialog if m layout null layout m layout page setup dialog get printer job m printername if m view null m view revalidate pagesetupdialog m_layout m_layout pagesetupdialog getprinterjob m_printername m_view m_view set printer name param printer name valid printer name public void set printer name string printer name if printer name null m printername ini get property ini p printer else m printername printer name printername setprintername printername printername m_printername getproperty p_printer m_printername printername get printer name return printer name public string get printer name return m printername getprintername m_printername create html file param file file param only table if false create complete html document param language optional language if null the default language is used to format nubers dates return true if success public boolean createhtml file file boolean only table language language try language lang language if lang null lang language get login language file writer fw new file writer file false return createhtml new buffered writer fw only table lang catch file not found exception fnfe log log level severe f fnfe to string catch exception e log log level severe f e return false onlytable onlytable getloginlanguage filewriter filewriter bufferedwriter onlytable filenotfoundexception tostring write html to writer param writer writer param only table if false create complete html document param language optional language if null nubers dates are not formatted return true if success public boolean createhtml writer writer boolean only table language language try table table new table for all rows 1 header row for int row 1 row m printdata get row count row tr tr new tr table add element tr if row 1 m printdata set row index row for all columns for int col 0 col m printformat get item count col m print format item item m printformat get item col if item is printed header row if row 1 th th new th tr add element th th add element util maskhtml item get print name language else td td new td tr add element td object obj m printdata get node new integer item getad column id if obj null td add element nbsp else if obj instanceof print data element string value print data element obj get value display language formatted td add element util maskhtml value else if obj instanceof print data ignore contained data else log log level severe element not print data element obj get class printed for all columns for all rows print writer w new print writer writer if only table table output w else xhtml document doc new xhtml document doc append body table doc output w w flush w close catch exception e log log level severe w e return false onlytable onlytable m_printdata getrowcount addelement m_printdata setrowindex m_printformat getitemcount mprintformatitem m_printformat getitem isprinted addelement addelement getprintname addelement m_printdata getnode getad_column_id addelement printdataelement printdataelement getvaluedisplay addelement printdata printdata getclass printwriter printwriter onlytable xhtmldocument xhtmldocument appendbody create csv file param file file param delimiter delimiter e g comma tab param language translation language return true if success public boolean createcsv file file char delimiter language language try file writer fw new file writer file false return createcsv new buffered writer fw delimiter language catch file not found exception fnfe log log level severe f fnfe to string catch exception e log log level severe f e return false filewriter filewriter bufferedwriter filenotfoundexception tostring write csv to writer param writer writer param delimiter delimiter e g comma tab param language translation language return true if success public boolean createcsv writer writer char delimiter language language if delimiter 0 delimiter t try for all rows 1 header row for int row 1 row m printdata get row count row string buffer sb new string buffer if row 1 m printdata set row index row for all columns boolean first true first column to print for int col 0 col m printformat get item count col m print format item item m printformat get item col if item is printed column delimiter comma or tab if first first false else sb append delimiter header row if row 1 createcs vvalue sb delimiter m printformat get item col get print name language else object obj m printdata get node new integer item getad column id string data if obj null else if obj instanceof print data element print data element pde print data element obj if pde isp key data pde get value as string else data pde get value display language formatted else if obj instanceof print data else log log level severe element not print data element obj get class createcs vvalue sb delimiter data printed for all columns writer write sb to string writer write env nl for all rows writer flush writer close catch exception e log log level severe w e return false m_printdata getrowcount stringbuffer stringbuffer m_printdata setrowindex m_printformat getitemcount mprintformatitem m_printformat getitem isprinted createcsvvalue m_printformat getitem getprintname m_printdata getnode getad_column_id printdataelement printdataelement printdataelement ispkey getvalueasstring getvaluedisplay printdata printdata getclass createcsvvalue tostring add content to csv string encapsulate mask content in if required param sb string buffer to add to param delimiter delimiter param content column value private void createcs vvalue string buffer sb char delimiter string content nothing to add if content null content length 0 return boolean need mask false string buffer buff new string buffer char chars content to char array for int i 0 i chars length i char c chars i if c need mask true buff append c repeat twice mask if any control character else if need mask c delimiter character is letter or digit c need mask true buff append c optionally mask value if need mask sb append append buff append else sb append buff stringbuffer createcsvvalue stringbuffer needmask stringbuffer stringbuffer tochararray needmask needmask isletterordigit needmask needmask create xml file param file file return true if success public boolean createxml file file try file writer fw new file writer file false return createxml new buffered writer fw catch file not found exception fnfe log log level severe f fnfe to string catch exception e log log level severe f e return false filewriter filewriter bufferedwriter filenotfoundexception tostring write xml to writer param writer writer return true if success public boolean createxml writer writer try m printdata createxml new stream result writer writer flush writer close catch exception e log log level severe w e return false m_printdata streamresult create pdf file created in temporary storage return pdf file public file getpdf return getpdf null create pdf file param file file return pdf file public file getpdf file file try if file null file file create temp file report engine pdf catch io exception e log log level severe e if createpdf file return file return null createtempfile reportengine ioexception create pdf file param file file return true if success public boolean createpdf file file string file name null uri uri null try if file null file file create temp file report engine pdf file name file get absolute path uri file touri if file exists file delete catch exception e log log level severe file e return false log fine uri to string try if m layout null layout archive engine get archive m layout m info document getpdf as file file name m layout get pageable false catch exception e log log level severe pdf e return false file file2 new file file name log info file2 get absolute path file2 length return file2 exists filename createtempfile reportengine filename getabsolutepath tostring m_layout archiveengine m_layout m_info getpdfasfile filename m_layout getpageable filename getabsolutepath create pdf as data array return pdf data public byte createpdf data try if m layout null layout return document getpdf as array m layout get pageable false catch exception e log log level severe pdf e return null createpdfdata m_layout getpdfasarray m_layout getpageable create post script file param file file return true if success public boolean createps file file try return createps new file output stream file catch file not found exception fnfe log log level severe f fnfe to string catch exception e log log level severe f e return false postscript fileoutputstream filenotfoundexception tostring write post script to writer param fos file output stream return true if success public boolean createps file output stream fos try string output mime type doc flavor byte array postscript get mime type doc flavor doc flavor doc flavor service formatted pageable stream print service factory spsfactories stream print service factory lookup stream print service factories doc flavor output mime type if spsfactories length 0 log log level severe fos no stream print service return false just use first one sun print ps stream printer factory system out println spsfactories 0 stream print service sps spsfactories 0 get print service fos get format if m layout null layout print it sps create print job print m layout get pageable false new hash print request attribute set fos flush fos close catch exception e log log level severe fos e return false postscript fileoutputstream outputmimetype docflavor byte_array getmimetype docflavor docflavor docflavor service_formatted streamprintservicefactory streamprintservicefactory lookupstreamprintservicefactories docflavor outputmimetype streamprintservice psstreamprinterfactory streamprintservice getprintservice m_layout createprintjob m_layout getpageable hashprintrequestattributeset get report engine for process info param ctx context param pi process info with ad pinstance id return report engine or null static public report engine get properties ctx process info pi int ad client id env getad client id ctx int ad table id 0 int ad reportview id 0 string table name null string where clause int ad printformat id 0 boolean is form false int client id 1 get ad table id and table name string sql select rv ad reportview id rv where clause t ad table id t table name pf ad printformat id pf is form pf ad client id from ad pinstance pi inner join ad process p on pi ad process id p ad process id inner join ad reportview rv on p ad reportview id rv ad reportview id inner join ad table t on rv ad table id t ad table id left outer join ad printformat pf on p ad reportview id pf ad reportview id and pf ad client id in 0 where pi ad pinstance id 2 order by pf ad client id desc pf is default desc own first try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set int 2 pi getad pinstance id result set rs pstmt execute query just get first if rs next ad reportview id rs get int 1 required where clause rs get string 2 if rs was null where clause ad table id rs get int 3 table name rs get string 4 required for query ad printformat id rs get int 5 required is form y equals rs get string 6 required client id rs get int 7 rs close pstmt close catch sql exception e1 log log level severe 1 sql e1 nothing found if ad reportview id 0 check print format in report directly sql select t ad table id t table name pf ad printformat id pf is form from ad pinstance pi inner join ad process p on pi ad process id p ad process id inner join ad printformat pf on p ad printformat id pf ad printformat id inner join ad table t on pf ad table id t ad table id where pi ad pinstance id try prepared statement pstmt db prepare statement sql null pstmt set int 1 pi getad pinstance id result set rs pstmt execute query if rs next where clause ad table id rs get int 1 table name rs get string 2 required for query ad printformat id rs get int 3 required is form y equals rs get string 4 required client id ad client id rs close pstmt close catch sql exception e1 log log level severe 2 sql e1 if ad printformat id 0 log log level severe report info not found ad pinstance id pi getad pinstance id ad client id ad client id return null create query from parameters m query query null if is form pi getrecord id 0 form one record query m query get equal query table name id pi getrecord id else query m query get ctx pi getad pinstance id table name add to static where clause from report view if where clause length 0 query add restriction where clause get print format m print format format null if ad printformat id 0 we have a print format with the correct client if client id ad client id format m print format get ctx ad printformat id false else format m print format copy to client ctx ad printformat id ad client id if format null format get item count 0 log info no items recreating format format delete true format null create it if format null ad reportview id 0 format m print format create from report view ctx ad reportview id pi get title if format null return null print info info new print info pi info setad table id ad table id return new report engine ctx format query info ad_pinstance_id reportengine processinfo ad_client_id getad_client_id ad_table_id ad_reportview_id tablename whereclause ad_printformat_id isform client_id ad_table_id tablename ad_reportview_id whereclause ad_table_id tablename ad_printformat_id isform ad_client_id ad_pinstance ad_process ad_process_id ad_process_id ad_reportview ad_reportview_id ad_reportview_id ad_table ad_table_id ad_table_id ad_printformat ad_reportview_id ad_reportview_id ad_client_id ad_pinstance_id ad_client_id isdefault preparedstatement preparestatement setint ad_client_id setint getad_pinstance_id resultset executequery ad_reportview_id getint whereclause getstring wasnull whereclause ad_table_id getint tablename getstring ad_printformat_id getint isform getstring client_id getint sqlexception ad_reportview_id ad_table_id tablename ad_printformat_id isform ad_pinstance ad_process ad_process_id ad_process_id ad_printformat ad_printformat_id ad_printformat_id ad_table ad_table_id ad_table_id ad_pinstance_id preparedstatement preparestatement setint getad_pinstance_id resultset executequery whereclause ad_table_id getint tablename getstring ad_printformat_id getint isform getstring client_id ad_client_id sqlexception ad_printformat_id ad_pinstance_id getad_pinstance_id ad_client_id ad_client_id mquery isform getrecord_id mquery getequalquery tablename _id getrecord_id mquery getad_pinstance_id tablename reportview whereclause addrestriction whereclause printformat mprintformat ad_printformat_id printformat client_id ad_client_id mprintformat ad_printformat_id mprintformat copytoclient ad_printformat_id ad_client_id getitemcount ad_reportview_id mprintformat createfromreportview ad_reportview_id gettitle printinfo printinfo setad_table_id ad_table_id reportengine get document print engine for document type param ctx context param type document type param record id id return report engine or null public static report engine get properties ctx int type int record id order print shipment or invoice if type order int what get document what record id if what null type what 0 record id what 1 order string job name doc basetables type print int ad printformat id 0 int c bpartner id 0 string document no null int copies 1 language m client client m client get ctx language language client get language get document info string sql null if type check sql select bad check printformat id 1 c is multi lingual document bp ad language bp c bpartner id d document no 2 5 from c payselectioncheck d inner join c payselection ps on d c payselection id ps c payselection id inner join c bankaccountdoc bad on ps c bankaccount id bad c bankaccount id and d payment rule bad payment rule inner join ad client c on d ad client id c ad client id inner join c bpartner bp on d c bpartner id bp c bpartner id where d c payselectioncheck id info from bank account else if type dunning sql select dl dunning printformat id c is multi lingual document bp ad language bp c bpartner id dr dunning date from c dunningrunentry d inner join ad client c on d ad client id c ad client id inner join c bpartner bp on d c bpartner id bp c bpartner id inner join c dunningrun dr on d c dunningrun id dr c dunningrun id inner join c dunninglevel dl on dl c dunninglevel id dr c dunninglevel id where d c dunningrunentry id info from dunning else if type remittance sql select pf remittance printformat id c is multi lingual document bp ad language bp c bpartner id d document no from c payselectioncheck d inner join ad client c on d ad client id c ad client id inner join ad printform pf on c ad client id pf ad client id inner join c bpartner bp on d c bpartner id bp c bpartner id where d c payselectioncheck id info from print form and pf ad org id in 0 d ad org id order by pf ad org id desc else if type project sql select pf project printformat id c is multi lingual document bp ad language bp c bpartner id d value from c project d inner join ad client c on d ad client id c ad client id inner join ad printform pf on c ad client id pf ad client id left outer join c bpartner bp on d c bpartner id bp c bpartner id where d c project id info from print form and pf ad org id in 0 d ad org id order by pf ad org id desc else if type rfq sql select coalesce t ad printformat id pf ad printformat id c is multi lingual document bp ad language bp c bpartner id rr name from c rfqresponse rr inner join c rfq r on rr c rfq id r c rfq id inner join c rfq topic t on r c rfq topic id t c rfq topic id inner join ad client c on rr ad client id c ad client id inner join c bpartner bp on rr c bpartner id bp c bpartner id ad printformat pf where pf ad client id in 0 rr ad client id and pf ad table id 725 and pf is table based n from rfq print format and rr c rfqresponse id info from rfq topic order by t ad printformat id pf ad client id desc pf ad org id desc else get print format from org or 0 of document client sql select pf order printformat id pf shipment printformat id 1 2 prio 1 b partner 2 doc type 3 print format org see invoice print coalesce bp invoice printformat id dt ad printformat id pf invoice printformat id 3 pf project printformat id pf remittance printformat id 4 5 c is multi lingual document bp ad language 6 7 coalesce dt document copies 0 coalesce bp document copies 1 8 dt ad printformat id bp c bpartner id d document no 9 11 from doc basetables type d inner join ad client c on d ad client id c ad client id inner join ad printform pf on c ad client id pf ad client id inner join c bpartner bp on d c bpartner id bp c bpartner id left outer join c doctype dt on d c doctype id dt c doctype id where d doc ids type info from print form and pf ad org id in 0 d ad org id order by pf ad org id desc try prepared statement pstmt db prepare statement sql null pstmt set int 1 record id result set rs pstmt execute query if rs next first record only if type check type dunning type remittance type project type rfq ad printformat id rs get int 1 copies 1 set language when enabled string ad language rs get string 3 if ad language null y equals rs get string 2 is multi lingual document language language get language ad language c bpartner id rs get int 4 if type dunning timestamp ts rs get timestamp 5 document no ts to string else document no rs get string 5 else set print format ad printformat id rs get int type 1 if rs get int 9 0 c doctype ad printformat id ad printformat id rs get int 9 copies rs get int 8 set language when enabled string ad language rs get string 7 if ad language null y equals rs get string 6 is multi lingual document language language get language ad language c bpartner id rs get int 10 document no rs get string 11 rs close pstmt close catch exception e log log level severe record id record id sql sql e if ad printformat id 0 log log level severe no print format found for type type record id record id return null get format data m print format format m print format get ctx ad printformat id false format set language language bp language if multi lingual if env is base language language doc tables type format set translation language language query m query query new m query doc tables type query add restriction doc ids type m query equal new integer record id log config report ctrl start document print format query language getad language if document no null document no length 0 document no doc print print info info new print info document no doc table id type record id c bpartner id info set copies copies info set document copy false true prints copy on second info set printer name format get printer name engine report engine re new report engine ctx format query info return re record_id reportengine record_id getdocumentwhat record_id record_id jobname doc_basetables _print ad_printformat_id c_bpartner_id documentno mclient mclient getlanguage check_printformat_id ismultilingualdocument ad_language c_bpartner_id documentno c_payselectioncheck c_payselection c_payselection_id c_payselection_id c_bankaccountdoc c_bankaccount_id c_bankaccount_id paymentrule paymentrule ad_client ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id c_payselectioncheck_id bankaccount dunning_printformat_id ismultilingualdocument ad_language c_bpartner_id dunningdate c_dunningrunentry ad_client ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id c_dunningrun c_dunningrun_id c_dunningrun_id c_dunninglevel c_dunninglevel_id c_dunninglevel_id c_dunningrunentry_id remittance_printformat_id ismultilingualdocument ad_language c_bpartner_id documentno c_payselectioncheck ad_client ad_client_id ad_client_id ad_printform ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id c_payselectioncheck_id printform ad_org_id ad_org_id ad_org_id project_printformat_id ismultilingualdocument ad_language c_bpartner_id c_project ad_client ad_client_id ad_client_id ad_printform ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id c_project_id printform ad_org_id ad_org_id ad_org_id ad_printformat_id ad_printformat_id ismultilingualdocument ad_language c_bpartner_id c_rfqresponse c_rfq c_rfq_id c_rfq_id c_rfq_topic c_rfq_topic_id c_rfq_topic_id ad_client ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id ad_printformat ad_client_id ad_client_id ad_table_id istablebased printformat c_rfqresponse_id rfqtopic ad_printformat_id ad_client_id ad_org_id printformat order_printformat_id shipment_printformat_id bpartner doctype printformat invoiceprint invoice_printformat_id ad_printformat_id invoice_printformat_id project_printformat_id remittance_printformat_id ismultilingualdocument ad_language documentcopies documentcopies ad_printformat_id c_bpartner_id documentno doc_basetables ad_client ad_client_id ad_client_id ad_printform ad_client_id ad_client_id c_bpartner c_bpartner_id c_bpartner_id c_doctype c_doctype_id c_doctype_id doc_ids printform ad_org_id ad_org_id ad_org_id preparedstatement preparestatement setint record_id resultset executequery ad_printformat_id getint ad_language getstring ad_language getstring ismultilingualdocument getlanguage ad_language c_bpartner_id getint gettimestamp documentno tostring documentno getstring printformat ad_printformat_id getint getint c_doctype ad_printformat_id ad_printformat_id getint getint ad_language getstring ad_language getstring ismultilingualdocument getlanguage ad_language c_bpartner_id getint documentno getstring record_id record_id ad_printformat_id printformat record_id record_id mprintformat mprintformat ad_printformat_id setlanguage isbaselanguage doc_tables settranslationlanguage mquery mquery doc_tables addrestriction doc_ids mquery record_id reportctrl startdocumentprint getad_language documentno documentno documentno docprint printinfo printinfo documentno doc_table_id record_id c_bpartner_id setcopies setdocumentcopy setprintername getprintername reportengine reportengine determine what order document to print param c order id id return int array with print what id private static int get document what int c order id int what new int 2 what 0 order what 1 c order id string sql select dt doc sub typeso from c doctype dt c order o where o c doctype id dt c doctype id and o c order id string doc sub typeso null try prepared statement pstmt db prepare statement sql null pstmt set int 1 c order id result set rs pstmt execute query if rs next doc sub typeso rs get string 1 rs close pstmt close catch sql exception e1 log log level severe 1 sql e1 return null error if doc sub typeso null doc sub typeso walk in receipt walk in invoice if doc sub typeso equals wr doc sub typeso equals wi what 0 invoice walk in pickup else if doc sub typeso equals wp what 0 shipment offer binding offer nonbinding standard order else return what get record id of invoice receipt if what 0 invoice sql select c invoice id rec from c invoice where c order id 1 order by c invoice id desc else sql select m inout id rec from m inout where c order id 1 order by m inout id desc try prepared statement pstmt db prepare statement sql null pstmt set int 1 c order id result set rs pstmt execute query if rs next if i 1 a dialog ask 0 null what 0 invoice print only recent invoice print only recent shipment break what 1 rs get int 1 else no document found what 0 order rs close pstmt close catch sql exception e2 log log level severe 2 sql e2 return null log fine order what 0 id what 1 return what c_order_id printwhat getdocumentwhat c_order_id c_order_id docsubtypeso c_doctype c_order c_doctype_id c_doctype_id c_order_id docsubtypeso preparedstatement preparestatement setint c_order_id resultset executequery docsubtypeso getstring sqlexception docsubtypeso docsubtypeso walkin walkin docsubtypeso docsubtypeso walkin docsubtypeso record_id c_invoice_id c_invoice c_order_id c_invoice_id m_inout_id m_inout c_order_id m_inout_id preparedstatement preparestatement setint c_order_id resultset executequery adialog printonlyrecentinvoice printonlyrecentshipment getint sqlexception print confirm update date printed param type document type param record id record id public static void print confirm int type int record id string buffer sql new string buffer if type order type shipment type invoice sql append update append doc basetables type append set date printed sys date is printed y where append doc ids type append append record id if sql length 0 int no db execute update sql to string null if no 1 log log level severe updated records no should be just one record_id printconfirm record_id stringbuffer stringbuffer doc_basetables dateprinted sysdate isprinted doc_ids record_id executeupdate tostring test param args args public static void main string args org compiere compiere startup environment true int ad table id 100 m query q new m query ad table q add restriction ad table id 108 m print format f m print format create from table env get ctx ad table id print info i new print info test ad table id 108 0 i setad table id ad table id report engine re new report engine env get ctx f q i re layout re createcsv new file c temp test csv language get language re createhtml new file c temp test html false language get language re createxml new file c temp test xml re createps new file c temp test ps re createpdf new file c temp test pdf re print re print true 1 false epson stylus color 900 esc p 2 dialog re print true 1 false hp laser jet 3300 series pcl 6 dialog re print false 1 false epson stylus color 900 esc p 2 dialog system exit 0 startupenvironment ad_table_id mquery mquery ad_table addrestriction ad_table_id mprintformat mprintformat createfromtable getctx ad_table_id printinfo printinfo ad_table_id setad_table_id ad_table_id reportengine reportengine getctx getlanguage getlanguage laserjet standard constructor public x c cashbook acct properties ctx int c cashbook acct id string trx name super ctx c cashbook acct id trx name if c cashbook acct id 0 setcb asset acct 0 setcb cashtransfer acct 0 setcb differences acct 0 setcb expense acct 0 setcb receipt acct 0 setc acctschema id 0 setc cashbook id 0 x_c_cashbook_acct c_cashbook_acct_id trxname c_cashbook_acct_id trxname c_cashbook_acct_id setcb_asset_acct setcb_cashtransfer_acct setcb_differences_acct setcb_expense_acct setcb_receipt_acct setc_acctschema_id setc_cashbook_id load constructor public x c cashbook acct properties ctx result set rs string trx name super ctx rs trx name x_c_cashbook_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cashbook acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_cashbook_acct get_id tostring set cash book asset cash book asset account public void setcb asset acct int cb asset acct set value cb asset acct new integer cb asset acct setcb_asset_acct cb_asset_acct set_value cb_asset_acct cb_asset_acct get cash book asset cash book asset account public int getcb asset acct integer ii integer get value cb asset acct if ii null return 0 return ii int value getcb_asset_acct get_value cb_asset_acct intvalue set cash transfer cash transfer clearing account public void setcb cashtransfer acct int cb cashtransfer acct set value cb cashtransfer acct new integer cb cashtransfer acct setcb_cashtransfer_acct cb_cashtransfer_acct set_value cb_cashtransfer_acct cb_cashtransfer_acct get cash transfer cash transfer clearing account public int getcb cashtransfer acct integer ii integer get value cb cashtransfer acct if ii null return 0 return ii int value getcb_cashtransfer_acct get_value cb_cashtransfer_acct intvalue set cash book differences cash book differences account public void setcb differences acct int cb differences acct set value cb differences acct new integer cb differences acct setcb_differences_acct cb_differences_acct set_value cb_differences_acct cb_differences_acct get cash book differences cash book differences account public int getcb differences acct integer ii integer get value cb differences acct if ii null return 0 return ii int value getcb_differences_acct get_value cb_differences_acct intvalue set cash book expense cash book expense account public void setcb expense acct int cb expense acct set value cb expense acct new integer cb expense acct setcb_expense_acct cb_expense_acct set_value cb_expense_acct cb_expense_acct get cash book expense cash book expense account public int getcb expense acct integer ii integer get value cb expense acct if ii null return 0 return ii int value getcb_expense_acct get_value cb_expense_acct intvalue set cash book receipt cash book receipts account public void setcb receipt acct int cb receipt acct set value cb receipt acct new integer cb receipt acct setcb_receipt_acct cb_receipt_acct set_value cb_receipt_acct cb_receipt_acct get cash book receipt cash book receipts account public int getcb receipt acct integer ii integer get value cb receipt acct if ii null return 0 return ii int value getcb_receipt_acct get_value cb_receipt_acct intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set cash book cash book for recording petty cash transactions public void setc cashbook id int c cashbook id if c cashbook id 1 throw new illegal argument exception c cashbook id is mandatory set valuenocheck c cashbook id new integer c cashbook id setc_cashbook_id c_cashbook_id c_cashbook_id illegalargumentexception c_cashbook_id set_valuenocheck c_cashbook_id c_cashbook_id get cash book cash book for recording petty cash transactions public int getc cashbook id integer ii integer get value c cashbook id if ii null return 0 return ii int value getc_cashbook_id get_value c_cashbook_id intvalue get contents return contents public object get contents return contents getcontents get m measure calc from cache param ctx context param pa measurecalc id id return m measure calc public static m measure calc get properties ctx int pa measurecalc id integer key new integer pa measurecalc id m measure calc ret value m measure calc s cache get key if ret value null return ret value ret value new m measure calc ctx pa measurecalc id null if ret value get id 0 s cache put key ret value return ret value mmeasurecalc pa_measurecalc_id mmeasurecalc mmeasurecalc pa_measurecalc_id pa_measurecalc_id mmeasurecalc retvalue mmeasurecalc s_cache retvalue retvalue retvalue mmeasurecalc pa_measurecalc_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param pa measurecalc id id param trx name trx public m measure calc properties ctx int pa measurecalc id string trx name super ctx pa measurecalc id trx name pa_measurecalc_id trxname mmeasurecalc pa_measurecalc_id trxname pa_measurecalc_id trxname load constructor param ctx context param rs result set param trx name trx public m measure calc properties ctx result set rs string trx name super ctx rs trx name trxname mmeasurecalc resultset trxname trxname get sql to return single value for the performance indicator param restrictions array of goal restrictions param measure scope scope of this value oaram measure data type data type param report date optional report date return sql for performance indicator public string get sqlpi m goal restriction restrictions string measure scope string measure data type timestamp report date m role role string buffer sb new string buffer get select clause append append get where clause date restriction if get date column null m measure measuredatatype qtyamountintime equals measure data type m goal measuredisplay total equals measure scope if report date null report date new timestamp system current time millis string date string db to date report date string trunc d if m goal measuredisplay year equals measure scope trunc y else if m goal measuredisplay quarter equals measure scope trunc q else if m goal measuredisplay month equals measure scope trunc mm else if m goal measuredisplay week equals measure scope trunc w else if m goal measuredisplay day equals measure display sb append and trunc append get date column append append trunc append trunc append db to date report date append append trunc append date string sql add restrictions sb to string restrictions role log fine sql return sql measurescope measuredatatype reportdate getsqlpi mgoalrestriction measurescope measuredatatype reportdate mrole stringbuffer stringbuffer getselectclause getwhereclause getdatecolumn mmeasure measuredatatype_qtyamountintime measuredatatype mgoal measuredisplay_total measurescope reportdate reportdate currenttimemillis datestring to_date reportdate mgoal measuredisplay_year measurescope mgoal measuredisplay_quarter measurescope mgoal measuredisplay_month measurescope mgoal measuredisplay_week measurescope mgoal measuredisplay_day measuredisplay getdatecolumn to_date reportdate addrestrictions tostring get sql to value for the bar chart param restrictions array of goal restrictions param measure display scope of this value param start date optional report start date return sql for bar chart public string get sql bar chart m goal restriction restrictions string measure display timestamp start date m role role string buffer sb new string buffer string date col null string group by null if get date column null m goal measuredisplay total equals measure display string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display date col trunc get date column trunc group by date col else date col max get date column string select from get select clause int index select from index of from if index 1 index select from to upper case index of from if index 1 throw new illegal argument exception cannot find from in sql select from sb append select from substring 0 index append append date col append select from substring index where sb append append get where clause date restriction if get date column null start date null m goal measuredisplay total equals measure display string date string db to date start date sb append and append get date column append append date string date string sql add restrictions sb to string restrictions role if group by null sql group by group by log fine sql return sql measuredisplay startdate getsqlbarchart mgoalrestriction measuredisplay startdate mrole stringbuffer stringbuffer datecol groupby getdatecolumn mgoal measuredisplay_total measuredisplay mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay datecol getdatecolumn groupby datecol datecol getdatecolumn selectfrom getselectclause selectfrom indexof selectfrom touppercase indexof illegalargumentexception selectfrom selectfrom datecol selectfrom getwhereclause getdatecolumn startdate mgoal measuredisplay_total measuredisplay datestring to_date startdate getdatecolumn datestring addrestrictions tostring groupby groupby get zoom query return query public m query get query m goal restriction restrictions string measure display timestamp date m role role m query query new m query getad table id string buffer sql new string buffer select append get key column append string from get select clause int index from index of from if index 1 throw new illegal argument exception cannot find from from sql append from substring index append append get where clause date range if get date column null m goal measuredisplay total equals measure display string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display trunc d sql append and trunc append get date column append append trunc append trunc append db to date date append append trunc append string finalsql add restrictions sql to string restrictions role execute string buffer where new string buffer prepared statement pstmt null try pstmt db prepare statement finalsql null result set rs pstmt execute query while rs next int id rs get int 1 if where length 0 where append where append id rs close pstmt close pstmt null catch exception e log log level severe finalsql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if where length 0 return m query get no record query query get table name false string buffer where clause new string buffer get key column append in append where append query add restriction where clause to string query set record count 1 return query mquery getquery mgoalrestriction measuredisplay mrole mquery mquery getad_table_id stringbuffer stringbuffer getkeycolumn getselectclause indexof illegalargumentexception getwhereclause getdatecolumn mgoal measuredisplay_total measuredisplay mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay getdatecolumn to_date addrestrictions tostring stringbuffer stringbuffer preparedstatement preparestatement resultset executequery getint mquery getnorecordquery gettablename stringbuffer whereclause stringbuffer getkeycolumn addrestriction whereclause tostring setrecordcount add restrictions param sql existing sql param restrictions restrictions return updated sql private string add restrictions string sql m goal restriction restrictions m role role return add restrictions sql false restrictions role get table name get org column getb partner column get product column addrestrictions mgoalrestriction mrole addrestrictions gettablename getorgcolumn getbpartnercolumn getproductcolumn add restrictions to sql param sql orig sql param query only incomplete sql for query restriction param restrictions restrictions param role role param table name table name param org column org column param bp column bpartner column param p column product column return updated sql public static string add restrictions string sql boolean query only m goal restriction restrictions m role role string table name string org column string bp column string p column string buffer sb new string buffer sql org restrictions if org column null array list integer list new array list integer for int i 0 i restrictions length i if m goal restriction goalrestrictiontype organization equals restrictions i get goal restriction type list add restrictions i getorg id hierarchy comes here if list size 1 sb append and append org column append append list get 0 else if list size 1 sb append and append org column append in for int i 0 i list size i if i 0 sb append sb append list get i sb append org b partner restrictions if bp column null array list integer listbp new array list integer array list integer listbpg new array list integer for int i 0 i restrictions length i if m goal restriction goalrestrictiontype businesspartner equals restrictions i get goal restriction type listbp add restrictions i getc bpartner id hierarchy comes here if m goal restriction goalrestrictiontype buspartnergroup equals restrictions i get goal restriction type listbpg add restrictions i getc bp group id bp if listbp size 1 sb append and append bp column append append listbp get 0 else if listbp size 1 sb append and append bp column append in for int i 0 i listbp size i if i 0 sb append sb append listbp get i sb append bpg if bp column index of 1 bp column table name bp column if listbpg size 1 sb append and exists select from c bpartner bpx where append bp column append bpx c bpartner id and bpx c bp group id append listbpg get 0 append else if listbpg size 1 sb append and exists select from c bpartner bpx where append bp column append bpx c bpartner id and bpx c bp group id in for int i 0 i listbpg size i if i 0 sb append sb append listbpg get i sb append bp product restrictions if p column null array list integer listp new array list integer array list integer listpc new array list integer for int i 0 i restrictions length i if m goal restriction goalrestrictiontype product equals restrictions i get goal restriction type listp add restrictions i getm product id hierarchy comes here if m goal restriction goalrestrictiontype productcategory equals restrictions i get goal restriction type listpc add restrictions i getm product category id product if listp size 1 sb append and append p column append append listp get 0 else if listp size 1 sb append and append p column append in for int i 0 i listp size i if i 0 sb append sb append listp get i sb append category if p column index of 1 p column table name p column if listpc size 1 sb append and exists select from m product px where append p column append px m product id and px m product category id append listpc get 0 append else if listpc size 1 sb append and exists select from m product px where append p column append px m product id and px m product category id in for int i 0 i listpc size i if i 0 sb append sb append listpc get i sb append product string finalsql sb to string if query only return finalsql if role null role m role get default string ret value role add accesssql finalsql table name true false return ret value queryonly tablename orgcolumn bpcolumn pcolumn addrestrictions queryonly mgoalrestriction mrole tablename orgcolumn bpcolumn pcolumn stringbuffer stringbuffer orgcolumn arraylist arraylist mgoalrestriction goalrestrictiontype_organization getgoalrestrictiontype getorg_id orgcolumn orgcolumn bpartner bpcolumn arraylist arraylist arraylist arraylist mgoalrestriction goalrestrictiontype_businesspartner getgoalrestrictiontype getc_bpartner_id mgoalrestriction goalrestrictiontype_buspartnergroup getgoalrestrictiontype getc_bp_group_id bpcolumn bpcolumn bpcolumn indexof bpcolumn tablename bpcolumn c_bpartner bpcolumn c_bpartner_id c_bp_group_id c_bpartner bpcolumn c_bpartner_id c_bp_group_id pcolumn arraylist arraylist arraylist arraylist mgoalrestriction goalrestrictiontype_product getgoalrestrictiontype getm_product_id mgoalrestriction goalrestrictiontype_productcategory getgoalrestrictiontype getm_product_category_id pcolumn pcolumn pcolumn indexof pcolumn tablename pcolumn m_product pcolumn m_product_id m_product_category_id m_product pcolumn m_product_id m_product_category_id tostring queryonly mrole getdefault retvalue addaccesssql tablename retvalue get table name return table name public string get table name return m table get table name env get ctx getad table id gettablename m_table gettablename getctx getad_table_id string representation return info public string to string string buffer sb new string buffer m measure calc sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mmeasurecalc get_id getname tostring standard constructor public x ad image properties ctx int ad image id string trx name super ctx ad image id trx name if ad image id 0 setad image id 0 set entity type null set name null x_ad_image ad_image_id trxname ad_image_id trxname ad_image_id setad_image_id setentitytype setname load constructor public x ad image properties ctx result set rs string trx name super ctx rs trx name x_ad_image resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad image append get id append return sb to string tostring stringbuffer stringbuffer x_ad_image get_id tostring set image system image or icon public void setad image id int ad image id if ad image id 1 throw new illegal argument exception ad image id is mandatory set valuenocheck ad image id new integer ad image id setad_image_id ad_image_id ad_image_id illegalargumentexception ad_image_id set_valuenocheck ad_image_id ad_image_id get image system image or icon public int getad image id integer ii integer get value ad image id if ii null return 0 return ii int value getad_image_id get_value ad_image_id intvalue set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname protected constructor param m tab m tab v create from shipment m tab m tab super m tab log info v create from shipment mtab mtab vcreatefromshipment mtab mtab mtab vcreatefromshipment dynamic init throws exception if lookups cannot be initialized return true if initialized protected boolean dyn init throws exception log config set title msg get element env get ctx m inout id false msg translate env get ctx create from parameter bank panel set visible false shipment label set visible false shipment field set visible false load locator int ad column id 3537 m inout m locator id m locator lookup locator new m locator lookup env get ctx p windowno locator field new v locator m locator id true false true locator p windowno initb partner false b partner field add vetoable change listener this return true dyninit settitle getelement getctx m_inout_id getctx createfrom parameterbankpanel setvisible shipmentlabel setvisible shipmentfield setvisible ad_column_id m_inout m_locator_id mlocatorlookup mlocatorlookup getctx p_windowno locatorfield vlocator m_locator_id p_windowno initbpartner bpartnerfield addvetoablechangelistener init details load invoices not shipped param c bpartner id b partner protected void initbp details int c bpartner id log config c bpartner id c bpartner id load ap invoice closed or complete invoice field remove action listener this invoice field remove all items none key name pair pp new key name pair 0 invoice field add item pp string buffer display new string buffer i document no append db to char date invoiced display type date env getad language env get ctx append append db to char grand total display type amount env getad language env get ctx string buffer sql new string buffer select i c invoice id append display append from c invoice i where i c bpartner id and i isso trx n and i doc status in cl co and i c invoice id in select il c invoice id from c invoiceline il left outer join m matchinv mi on il c invoiceline id mi c invoiceline id group by il c invoice id mi c invoiceline id il qty invoiced having il qty invoiced sum mi qty and mi c invoiceline id is not null or mi c invoiceline id is null order by i date invoiced try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 invoice field add item pp rs close pstmt close catch sql exception e log log level severe sql to string e invoice field set selected index 0 invoice field add action listener this c_bpartner_id bpartner initbpdetails c_bpartner_id c_bpartner_id c_bpartner_id invoicefield removeactionlistener invoicefield removeallitems keynamepair keynamepair invoicefield additem stringbuffer stringbuffer documentno to_char dateinvoiced displaytype getad_language getctx to_char grandtotal displaytype getad_language getctx stringbuffer stringbuffer c_invoice_id c_invoice c_bpartner_id issotrx docstatus c_invoice_id c_invoice_id c_invoiceline m_matchinv c_invoiceline_id c_invoiceline_id c_invoice_id c_invoiceline_id qtyinvoiced qtyinvoiced c_invoiceline_id c_invoiceline_id dateinvoiced preparedstatement preparestatement tostring setint c_bpartner_id resultset executequery keynamepair getint getstring invoicefield additem sqlexception tostring invoicefield setselectedindex invoicefield addactionlistener action listener param e event public void action performed action event e super action performed e log config action e get action command order if e get source equals order field key name pair pp key name pair order field get selected item if pp null pp get key 0 else int c order id pp get key set invoice and shipment to null invoice field set selected index 1 shipment field set selected index 1 load order c order id false m invoice null invoice else if e get source equals invoice field key name pair pp key name pair invoice field get selected item if pp null pp get key 0 else int c invoice id pp get key set order and shipment to null order field set selected index 1 shipment field set selected index 1 load invoice c invoice id actionperformed actionevent actionperformed getactioncommand getsource orderfield keynamepair keynamepair orderfield getselecteditem getkey c_order_id getkey invoicefield setselectedindex shipmentfield setselectedindex loadorder c_order_id m_invoice getsource invoicefield keynamepair keynamepair invoicefield getselecteditem getkey c_invoice_id getkey orderfield setselectedindex shipmentfield setselectedindex loadinvoice c_invoice_id change listener param e event public void vetoable change property change event e log config e get property name e get new value b partner load order invoice shipment if e get property name c bpartner id int c bpartner id integer e get new value int value initb partnerois c bpartner id false table changed null vetoablechange propertychangeevent getpropertyname getnewvalue bpartner getpropertyname c_bpartner_id c_bpartner_id getnewvalue intvalue initbpartnerois c_bpartner_id tablechanged load data invoice param c invoice id invoice private void load invoice int c invoice id log config c invoice id c invoice id m invoice new m invoice env get ctx c invoice id null save p order null vector vector data new vector vector string buffer sql new string buffer select entered uom l qty invoiced sum nvl mi qty 0 l qty entered l qty invoiced l c uom id coalesce uom uom symbol uom name 3 4 l m product id p name l c invoiceline id l line 5 8 l c orderline id 9 if env is base language env get ctx c uom sql append from c uom uom c invoiceline l m product p m matchinv mi sql append where l c uom id uom c uom id else sql append from c uom trl uom c invoiceline v l m product p m matchinv mi sql append where l c uom id uom c uom id and uom ad language append env getad language env get ctx append sql append and l m product id p m product id and l c invoiceline id mi c invoiceline id and l c invoice id 1 group by l qty invoiced l qty entered l qty invoiced l c uom id coalesce uom uom symbol uom name l m product id p name l c invoiceline id l line l c orderline id order by l line try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 c invoice id result set rs pstmt execute query while rs next vector object line new vector object 7 line add new boolean false 0 selection big decimal qty invoiced rs get big decimal 1 big decimal multiplier rs get big decimal 2 big decimal qty entered qty invoiced multiply multiplier line add new double qty entered double value 1 qty key name pair pp new key name pair rs get int 3 rs get string 4 trim line add pp 2 uom pp new key name pair rs get int 5 rs get string 6 line add pp 3 product int c orderline id rs get int 9 if rs was null line add null 4 order else line add new key name pair c orderline id line add null 5 ship pp new key name pair rs get int 7 rs get string 8 line add pp 6 invoice data add line rs close pstmt close catch sql exception e log log level severe sql to string e load tableois data c_invoice_id loadinvoice c_invoice_id c_invoice_id c_invoice_id m_invoice minvoice getctx c_invoice_id p_order stringbuffer stringbuffer qtyinvoiced qtyentered qtyinvoiced c_uom_id uomsymbol m_product_id c_invoiceline_id c_orderline_id isbaselanguage getctx c_uom c_uom c_invoiceline m_product m_matchinv c_uom_id c_uom_id c_uom_trl c_invoiceline_v m_product m_matchinv c_uom_id c_uom_id ad_language getad_language getctx m_product_id m_product_id c_invoiceline_id c_invoiceline_id c_invoice_id qtyinvoiced qtyentered qtyinvoiced c_uom_id uomsymbol m_product_id c_invoiceline_id c_orderline_id preparedstatement preparestatement tostring setint c_invoice_id resultset executequery bigdecimal qtyinvoiced getbigdecimal bigdecimal getbigdecimal bigdecimal qtyentered qtyinvoiced qtyentered doublevalue keynamepair keynamepair getint getstring keynamepair getint getstring c_orderline_id getint wasnull keynamepair c_orderline_id keynamepair getint getstring sqlexception tostring loadtableois list number of rows selected protected void info table model model data table get model int rows model get row count int count 0 for int i 0 i rows i if boolean model get value at i 0 boolean value count status bar set status line string value of count tablemodel datatable getmodel getrowcount getvalueat booleanvalue statusbar setstatusline valueof save create shipments return true if saved protected boolean save log config table model model data table get model int rows model get row count if rows 0 return false integer loc integer locator field get value if loc null loc int value 0 locator field set background compiereplaf getfieldbackground error return false int m locator id loc int value get shipment int m inout id integer p mtab get value m inout id int value m in out inout new m in out env get ctx m inout id null log config inout c locator id m locator id selected 0 qty entered 1 c uom id 2 m product id 3 order line 4 shipment line 5 invoice line 6 lines for int i 0 i rows i if boolean model get value at i 0 boolean value variable values double d double model get value at i 1 1 qty big decimal qty entered new big decimal d double value key name pair pp key name pair model get value at i 2 2 product int c uom id pp get key pp key name pair model get value at i 3 3 product int m product id pp get key int c orderline id 0 pp key name pair model get value at i 4 4 order line if pp null c orderline id pp get key int c invoiceline id 0 m invoice line il null pp key name pair model get value at i 6 6 invoice line if pp null c invoiceline id pp get key if c invoiceline id 0 il new m invoice line env get ctx c invoiceline id null boolean is invoiced c invoiceline id 0 log fine line qty entered qty entered product m product id order line c orderline id invoice line c invoiceline id credit memo negative qty if m invoice null m invoice is credit memo qty entered qty entered negate m in out line iol new m in out line inout iol setm product id m product id c uom id line uom iol set qty qty entered movement entered m order line ol null if c orderline id 0 iol setc orderline id c orderline id ol new m order line env get ctx c orderline id null if ol get qty entered compare to ol get qty ordered 0 iol set movement qty qty entered multiply ol get qty ordered divide ol get qty entered 12 big decimal round half up iol setc uom id ol getc uom id iol setm attributesetinstance id ol getm attributesetinstance id iol set description ol get description else if il null if il get qty entered compare to il get qty invoiced 0 iol set qty entered qty entered multiply il get qty invoiced divide il get qty entered 12 big decimal round half up iol setc uom id il getc uom id iol set description il get description charge if m product id 0 if ol null ol getc charge id 0 from order iol setc charge id ol getc charge id else if il null il getc charge id 0 from invoice iol setc charge id il getc charge id iol setm locator id m locator id if iol save log log level severe line not created i create invoice line link else if il null il setm inoutline id iol getm inoutline id il save if selected for all rows update header if linked to another order invoice remove link if no link set it if p order null inout setc order id p order getc order id inout setad orgtrx id p order getad orgtrx id inout setc project id p order getc project id inout setc campaign id p order getc campaign id inout setc activity id p order getc activity id inout setuser1 id p order getuser1 id inout setuser2 id p order getuser2 id if m invoice null m invoice getc invoice id 0 if inout getc order id 0 inout setc order id m invoice getc order id inout setc invoice id m invoice getc invoice id inout setad orgtrx id m invoice getad orgtrx id inout setc project id m invoice getc project id inout setc campaign id m invoice getc campaign id inout setc activity id m invoice getc activity id inout setuser1 id m invoice getuser1 id inout setuser2 id m invoice getuser2 id inout save return true tablemodel datatable getmodel getrowcount locatorfield getvalue intvalue locatorfield setbackground getfieldbackground_error m_locator_id intvalue m_inout_id p_mtab getvalue m_inout_id intvalue minout minout getctx m_inout_id c_locator_id m_locator_id qtyentered c_uom_id m_product_id orderline shipmentline invoiceline getvalueat booleanvalue getvalueat bigdecimal qtyentered bigdecimal doublevalue keynamepair keynamepair getvalueat c_uom_id getkey keynamepair getvalueat m_product_id getkey c_orderline_id keynamepair getvalueat orderline c_orderline_id getkey c_invoiceline_id minvoiceline keynamepair getvalueat invoiceline c_invoiceline_id getkey c_invoiceline_id minvoiceline getctx c_invoiceline_id isinvoiced c_invoiceline_id qtyentered qtyentered m_product_id orderline c_orderline_id invoiceline c_invoiceline_id m_invoice m_invoice iscreditmemo qtyentered qtyentered minoutline minoutline setm_product_id m_product_id c_uom_id setqty qtyentered morderline c_orderline_id setc_orderline_id c_orderline_id morderline getctx c_orderline_id getqtyentered compareto getqtyordered setmovementqty qtyentered getqtyordered getqtyentered bigdecimal round_half_up setc_uom_id getc_uom_id setm_attributesetinstance_id getm_attributesetinstance_id setdescription getdescription getqtyentered compareto getqtyinvoiced setqtyentered qtyentered getqtyinvoiced getqtyentered bigdecimal round_half_up setc_uom_id getc_uom_id setdescription getdescription m_product_id getc_charge_id setc_charge_id getc_charge_id getc_charge_id setc_charge_id getc_charge_id setm_locator_id m_locator_id setm_inoutline_id getm_inoutline_id p_order setc_order_id p_order getc_order_id setad_orgtrx_id p_order getad_orgtrx_id setc_project_id p_order getc_project_id setc_campaign_id p_order getc_campaign_id setc_activity_id p_order getc_activity_id setuser1_id p_order getuser1_id setuser2_id p_order getuser2_id m_invoice m_invoice getc_invoice_id getc_order_id setc_order_id m_invoice getc_order_id setc_invoice_id m_invoice getc_invoice_id setad_orgtrx_id m_invoice getad_orgtrx_id setc_project_id m_invoice getc_project_id setc_campaign_id m_invoice getc_campaign_id setc_activity_id m_invoice getc_activity_id setuser1_id m_invoice getuser1_id setuser2_id m_invoice getuser2_id standard constructor public x i elementvalue properties ctx int i elementvalue id string trx name super ctx i elementvalue id trx name if i elementvalue id 0 seti elementvalue id 0 seti isimported false x_i_elementvalue i_elementvalue_id trxname i_elementvalue_id trxname i_elementvalue_id seti_elementvalue_id seti_isimported load constructor public x i elementvalue properties ctx result set rs string trx name super ctx rs trx name x_i_elementvalue resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i elementvalue append get id append return sb to string tostring stringbuffer stringbuffer x_i_elementvalue get_id tostring public static final int ad column id ad reference id 272 set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id ad_column_id_ad_reference_id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue public static final string accountsign natural n set account sign indicates the natural sign of the account as a debit or credit public void set account sign string account sign if account sign null throw new illegal argument exception account sign is mandatory if account sign null account sign equals c account sign equals d account sign equals n else throw new illegal argument exception account sign invalid value account sign reference id 118 c d n if account sign null account sign length 1 log warning length 1 truncated account sign account sign substring 0 0 set value account sign account sign accountsign_natural setaccountsign accountsign accountsign illegalargumentexception accountsign accountsign accountsign accountsign accountsign illegalargumentexception accountsign accountsign reference_id accountsign accountsign accountsign accountsign set_value accountsign accountsign get account sign indicates the natural sign of the account as a debit or credit public string get account sign return string get value account sign getaccountsign get_value accountsign public static final string accounttype revenue r set account type indicates the type of account public void set account type string account type if account type null throw new illegal argument exception account type is mandatory if account type null account type equals a account type equals e account type equals l account type equals m account type equals o account type equals r else throw new illegal argument exception account type invalid value account type reference id 117 a e l m o r if account type null account type length 1 log warning length 1 truncated account type account type substring 0 0 set value account type account type accounttype_revenue setaccounttype accounttype accounttype illegalargumentexception accounttype accounttype accounttype accounttype accounttype accounttype accounttype accounttype illegalargumentexception accounttype accounttype reference_id accounttype accounttype accounttype accounttype set_value accounttype accounttype get account type indicates the type of account public string get account type return string get value account type getaccounttype get_value accounttype set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 0 set value c elementvalue id null else set value c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id set_value c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set element accounting element public void setc element id int c element id if c element id 0 set value c element id null else set value c element id new integer c element id setc_element_id c_element_id c_element_id set_value c_element_id set_value c_element_id c_element_id get element accounting element public int getc element id integer ii integer get value c element id if ii null return 0 return ii int value getc_element_id get_value c_element_id intvalue set default account name of the default account column public void setdefault account string default account if default account null default account length 30 log warning length 30 truncated default account default account substring 0 29 set value default account default account setdefault_account default_account default_account default_account default_account default_account set_value default_account default_account get default account name of the default account column public string getdefault account return string get value default account getdefault_account get_value default_account set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set element name name of the element public void set element name string element name if element name null element name length 60 log warning length 60 truncated element name element name substring 0 59 set value element name element name setelementname elementname elementname elementname elementname elementname set_value elementname elementname get element name name of the element public string get element name return string get value element name getelementname get_value elementname set import account import account value public void seti elementvalue id int i elementvalue id if i elementvalue id 1 throw new illegal argument exception i elementvalue id is mandatory set valuenocheck i elementvalue id new integer i elementvalue id seti_elementvalue_id i_elementvalue_id i_elementvalue_id illegalargumentexception i_elementvalue_id set_valuenocheck i_elementvalue_id i_elementvalue_id get import account import account value public int geti elementvalue id integer ii integer get value i elementvalue id if ii null return 0 return ii int value geti_elementvalue_id get_value i_elementvalue_id intvalue set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set document controlled control account if an account is controlled by a document you cannot post manually to it public void set is doc controlled boolean is doc controlled set value is doc controlled new boolean is doc controlled setisdoccontrolled isdoccontrolled set_value isdoccontrolled isdoccontrolled get document controlled control account if an account is controlled by a document you cannot post manually to it public boolean is doc controlled object oo get value is doc controlled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdoccontrolled get_value isdoccontrolled booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value public static final int parentelementvalue id ad reference id 362 set parent account the parent summary account public void setparentelementvalue id int parentelementvalue id if parentelementvalue id 0 set value parentelementvalue id null else set value parentelementvalue id new integer parentelementvalue id parentelementvalue_id_ad_reference_id setparentelementvalue_id parentelementvalue_id parentelementvalue_id set_value parentelementvalue_id set_value parentelementvalue_id parentelementvalue_id get parent account the parent summary account public int getparentelementvalue id integer ii integer get value parentelementvalue id if ii null return 0 return ii int value getparentelementvalue_id get_value parentelementvalue_id intvalue set parent key key if the parent public void set parent value string parent value if parent value null parent value length 40 log warning length 40 truncated parent value parent value substring 0 39 set value parent value parent value setparentvalue parentvalue parentvalue parentvalue parentvalue parentvalue set_value parentvalue parentvalue get parent key key if the parent public string get parent value return string get value parent value getparentvalue get_value parentvalue set post actual actual values can be posted public void set post actual boolean post actual set value post actual new boolean post actual setpostactual postactual set_value postactual postactual get post actual actual values can be posted public boolean is post actual object oo get value post actual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostactual get_value postactual booleanvalue set post budget budget values can be posted public void set post budget boolean post budget set value post budget new boolean post budget setpostbudget postbudget set_value postbudget postbudget get post budget budget values can be posted public boolean is post budget object oo get value post budget if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostbudget get_value postbudget booleanvalue set post encumbrance post commitments to this account public void set post encumbrance boolean post encumbrance set value post encumbrance new boolean post encumbrance setpostencumbrance postencumbrance set_value postencumbrance postencumbrance get post encumbrance post commitments to this account public boolean is post encumbrance object oo get value post encumbrance if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostencumbrance get_value postencumbrance booleanvalue set post statistical post statistical quantities to this account public void set post statistical boolean post statistical set value post statistical new boolean post statistical setpoststatistical poststatistical set_value poststatistical poststatistical get post statistical post statistical quantities to this account public boolean is post statistical object oo get value post statistical if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispoststatistical get_value poststatistical booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set search key search key for the record in the format required must be unique public void set value string value if value null value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue standard constructor public x m movementlinema properties ctx int m movementlinema id string trx name super ctx m movementlinema id trx name if m movementlinema id 0 setm attributesetinstance id 0 setm movementline id 0 x_m_movementlinema m_movementlinema_id trxname m_movementlinema_id trxname m_movementlinema_id setm_attributesetinstance_id setm_movementline_id load constructor public x m movementlinema properties ctx result set rs string trx name super ctx rs trx name x_m_movementlinema resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m movementlinema append get id append return sb to string tostring stringbuffer stringbuffer x_m_movementlinema get_id tostring set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 1 throw new illegal argument exception m movementline id is mandatory set valuenocheck m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id illegalargumentexception m_movementline_id set_valuenocheck m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm movementline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_movementline_id set movement quantity quantity of a product moved public void set movement qty big decimal movement qty set value movement qty movement qty setmovementqty bigdecimal movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty standard constructor public x k topic properties ctx int k topic id string trx name super ctx k topic id trx name if k topic id 0 set is public true y set is public write true y setk topic id 0 setk type id 0 set name null x_k_topic k_topic_id trxname k_topic_id trxname k_topic_id setispublic setispublicwrite setk_topic_id setk_type_id setname load constructor public x k topic properties ctx result set rs string trx name super ctx rs trx name x_k_topic resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k topic append get id append return sb to string tostring stringbuffer stringbuffer x_k_topic get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set public public can read entry public void set is public boolean is public set value is public new boolean is public setispublic ispublic set_value ispublic ispublic get public public can read entry public boolean is public object oo get value is public if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublic get_value ispublic booleanvalue set public write public can write entries public void set is public write boolean is public write set value is public write new boolean is public write setispublicwrite ispublicwrite set_value ispublicwrite ispublicwrite get public write public can write entries public boolean is public write object oo get value is public write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublicwrite get_value ispublicwrite booleanvalue set knowledge topic knowledge topic public void setk topic id int k topic id if k topic id 1 throw new illegal argument exception k topic id is mandatory set valuenocheck k topic id new integer k topic id setk_topic_id k_topic_id k_topic_id illegalargumentexception k_topic_id set_valuenocheck k_topic_id k_topic_id get knowledge topic knowledge topic public int getk topic id integer ii integer get value k topic id if ii null return 0 return ii int value getk_topic_id get_value k_topic_id intvalue set knowldge type knowledge type public void setk type id int k type id if k type id 1 throw new illegal argument exception k type id is mandatory set valuenocheck k type id new integer k type id setk_type_id k_type_id k_type_id illegalargumentexception k_type_id set_valuenocheck k_type_id k_type_id get knowldge type knowledge type public int getk type id integer ii integer get value k type id if ii null return 0 return ii int value getk_type_id get_value k_type_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname constructor param invoker button param ad table id table param record id record public a archive j component invoker int ad table id int record id super log config ad table id ad table id record id record id m ad table id ad table id m record id record id get archives invoker ad_table_id record_id aarchive jcomponent ad_table_id record_id ad_table_id ad_table_id record_id record_id m_ad_table_id ad_table_id m_record_id record_id getarchives display request options new existing param invoker button private void get archives j component invoker int report count 0 int document count 0 m where new string buffer m where append ad table id append m ad table id append and record id append m record id append get all for bp if m ad table id mb partner table id m where append or c bpartner id append m record id string buffer sql new string buffer select is report count from ad archive append where ad table id and record id if m ad table id mb partner table id sql append or c bpartner id sql append group by is report prepared statement pstmt null try pstmt db prepare statement sql to string null pstmt set int 1 m ad table id pstmt set int 2 m record id if m ad table id mb partner table id pstmt set int 3 m record id result set rs pstmt execute query while rs next if y equals rs get string 1 report count rs get int 2 else document count rs get int 2 rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null if document count 0 m documents new c menu item msg get msg env get ctx archived documents document count m popup add m documents add action listener this if report count 0 m reports new c menu item msg get msg env get ctx archived reports report count m popup add m reports add action listener this all reports string sql1 select count from ad archive where ad table id and is report y int all reports db getsql value null sql1 m ad table id if all reports 0 m reportsall new c menu item msg get msg env get ctx archived reports all report count m popup add m reportsall add action listener this if document count 0 report count 0 all reports 0 m popup add msg get msg env get ctx archived none if invoker is showing m popup show invoker 0 invoker get height below button getarchives jcomponent reportcount documentcount m_where stringbuffer m_where ad_table_id m_ad_table_id record_id m_record_id m_ad_table_id mbpartner table_id m_where c_bpartner_id m_record_id stringbuffer stringbuffer isreport ad_archive ad_table_id record_id m_ad_table_id mbpartner table_id c_bpartner_id isreport preparedstatement preparestatement tostring setint m_ad_table_id setint m_record_id m_ad_table_id mbpartner table_id setint m_record_id resultset executequery getstring reportcount getint documentcount getint tostring documentcount m_documents cmenuitem getmsg getctx archiveddocuments documentcount m_popup m_documents addactionlistener reportcount m_reports cmenuitem getmsg getctx archivedreports reportcount m_popup m_reports addactionlistener ad_archive ad_table_id isreport allreports getsqlvalue m_ad_table_id allreports m_reportsall cmenuitem getmsg getctx archivedreportsall reportcount m_popup m_reportsall addactionlistener documentcount reportcount allreports m_popup getmsg getctx archivednone isshowing m_popup getheight listner param e event public void action performed action event e int ad form id 118 archive viewer form frame ff new form frame ff open form ad form id archive viewer av archive viewer ff get form panel if e get source m documents av query false m ad table id m record id else if e get source m reports av query true m ad table id m record id else all reports av query true m ad table id 0 ff pack a env show center screen ff ff null actionperformed actionevent ad_form_id archiveviewer formframe formframe openform ad_form_id archiveviewer archiveviewer getformpanel getsource m_documents m_ad_table_id m_record_id getsource m_reports m_ad_table_id m_record_id m_ad_table_id aenv showcenterscreen get content return content public object get contents return contents getcontents standard constructor public x r status properties ctx int r status id string trx name super ctx r status id trx name if r status id 0 set is closed false n set is default false set is final close false n set is open false set is web can update false set name null setr statuscategory id 0 setr status id 0 set seq no 0 set value null x_r_status r_status_id trxname r_status_id trxname r_status_id setisclosed setisdefault setisfinalclose setisopen setiswebcanupdate setname setr_statuscategory_id setr_status_id setseqno setvalue load constructor public x r status properties ctx result set rs string trx name super ctx rs trx name x_r_status resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r status append get id append return sb to string tostring stringbuffer stringbuffer x_r_status get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set closed status the status is closed public void set is closed boolean is closed set value is closed new boolean is closed setisclosed isclosed set_value isclosed isclosed get closed status the status is closed public boolean is closed object oo get value is closed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isclosed get_value isclosed booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set final close entries with final close cannot be re opened public void set is final close boolean is final close set value is final close new boolean is final close setisfinalclose isfinalclose set_value isfinalclose isfinalclose get final close entries with final close cannot be re opened public boolean is final close object oo get value is final close if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfinalclose get_value isfinalclose booleanvalue set open status the status is closed public void set is open boolean is open set value is open new boolean is open setisopen isopen set_value isopen isopen get open status the status is closed public boolean is open object oo get value is open if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isopen get_value isopen booleanvalue set web can update entry can be updated from the web public void set is web can update boolean is web can update set value is web can update new boolean is web can update setiswebcanupdate iswebcanupdate set_value iswebcanupdate iswebcanupdate get web can update entry can be updated from the web public boolean is web can update object oo get value is web can update if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iswebcanupdate get_value iswebcanupdate booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value public static final int next status id ad reference id 345 set next status move to next status automatically after timeout public void setnext status id int next status id if next status id 0 set value next status id null else set value next status id new integer next status id next_status_id_ad_reference_id setnext_status_id next_status_id next_status_id set_value next_status_id set_value next_status_id next_status_id get next status move to next status automatically after timeout public int getnext status id integer ii integer get value next status id if ii null return 0 return ii int value getnext_status_id get_value next_status_id intvalue set status category request status category public void setr statuscategory id int r statuscategory id if r statuscategory id 1 throw new illegal argument exception r statuscategory id is mandatory set value r statuscategory id new integer r statuscategory id setr_statuscategory_id r_statuscategory_id r_statuscategory_id illegalargumentexception r_statuscategory_id set_value r_statuscategory_id r_statuscategory_id get status category request status category public int getr statuscategory id integer ii integer get value r statuscategory id if ii null return 0 return ii int value getr_statuscategory_id get_value r_statuscategory_id intvalue set status request status public void setr status id int r status id if r status id 1 throw new illegal argument exception r status id is mandatory set valuenocheck r status id new integer r status id setr_status_id r_status_id r_status_id illegalargumentexception r_status_id set_valuenocheck r_status_id r_status_id get status request status public int getr status id integer ii integer get value r status id if ii null return 0 return ii int value getr_status_id get_value r_status_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno set timeout in days timeout in days to change status automatically public void set timeout days int timeout days set value timeout days new integer timeout days settimeoutdays timeoutdays set_value timeoutdays timeoutdays get timeout in days timeout in days to change status automatically public int get timeout days integer ii integer get value timeout days if ii null return 0 return ii int value gettimeoutdays get_value timeoutdays intvalue public static final int update status id ad reference id 345 set update status automatically change the status after entry from web public void setupdate status id int update status id if update status id 0 set value update status id null else set value update status id new integer update status id update_status_id_ad_reference_id setupdate_status_id update_status_id update_status_id set_value update_status_id set_value update_status_id update_status_id get update status automatically change the status after entry from web public int getupdate status id integer ii integer get value update status id if ii null return 0 return ii int value getupdate_status_id get_value update_status_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value create upload form you need to add the hidden parameter param action form action return form public static form create form string action form upload new form action form method post form enc upload upload add element new label file set for file upload add element new input input type file file set size 40 upload add element new input input type submit upload upload return upload createform method_post enc_upload addelement setfor addelement type_file setsize addelement type_submit upload file from requesr param request request public file upload http servlet request request super try m error upload request catch exception e log log level severe file upload e m error e get localized message if m error null m error length 0 m error e to string fileupload httpservletrequest m_error fileupload m_error getlocalizedmessage m_error m_error m_error tostring return returns the data public byte get data return m data getdata m_data return returns the actual file name without path public string get file name if m filename null eliminate path int index math max m filename last index of m filename last index of if index 0 return m filename substring index 1 return m filename filename getfilename m_filename m_filename lastindexof m_filename lastindexof m_filename m_filename return returns the error message or null public string get error return m error geterror m_error upload file param request request throws servlet exception throws io exception return error message or null private string upload http servlet request request throws servlet exception io exception final int max kb 250 max upload size in kb int form data length request get content length string content type request get content type int index content type last index of string boundary content type substring index 1 log fine form data length boundary int sizekb form data length 1024 if sizekb max kb 250k log warning file too large sizekb return file too large sizekb kb allowed max kb kb data input stream in new data input stream request get input stream byte data new byte form data length int bytes read 0 int total bytes read 0 while total bytes read form data length bytes read in read data total bytes read form data length total bytes read bytes read convert to string for easy manipulation m requestdatastring new string data iso 8859 1 if m requestdatastring length data length return internal conversion error file name content disposition form data name file filename c documents and settings jjanke my documents desktop ini index m requestdatastring index of filename m filename m requestdatastring substring index 10 index m filename index of if index 1 return no file name m filename m filename substring 0 index log fine upload m filename content content disposition form data name file filename c documents and settings jjanke my documents desktop ini content type application octet stream delete on copy owner jjanke personalized 5 personalized name my documents 7d433475038e int pos start m requestdatastring index of filename pos start m requestdatastring index of n pos start 1 end of context disposition pos start m requestdatastring index of n pos start 1 end of content type pos start m requestdatastring index of n pos start 1 end of empty line int pos end m requestdatastring index of boundary pos start 4 int length pos end pos start log fine upload file start pos start end pos end length length final copy m data new byte length for int i 0 i length i m data i data pos start i return null servletexception ioexception httpservletrequest servletexception ioexception max_kb formdatalength getcontentlength contenttype getcontenttype contenttype lastindexof contenttype formdatalength formdatalength max_kb max_kb datainputstream datainputstream getinputstream formdatalength bytesread totalbytesread totalbytesread formdatalength bytesread totalbytesread formdatalength totalbytesread bytesread m_requestdatastring m_requestdatastring m_requestdatastring indexof m_filename m_requestdatastring m_filename indexof m_filename m_filename m_filename deleteoncopy personalizedname posstart m_requestdatastring indexof posstart m_requestdatastring indexof posstart posstart m_requestdatastring indexof posstart posstart m_requestdatastring indexof posstart posend m_requestdatastring indexof posstart posend posstart uploadfile posstart posend m_data m_data posstart get multi part form parameter assumes single line no cr code request 7d433475038e content disposition form data name r request id 1000000 7d433475038e code param parameter name name of parameter return parameter or null of mot found public string get parameter string parameter name if m requestdatastring null return null string ret value null string search name parameter name int index m requestdatastring index of search if index 0 ret value m requestdatastring substring index ret value ret value substring ret value index of n 1 eol ret value ret value substring ret value index of n 1 empty line ret value ret value substring 0 ret value index of n cr ret value ret value trim else log warning get parameter not found parameter name return null log fine get parameter parameter name ret value return ret value multipart r_request_id parametername getparameter parametername m_requestdatastring retvalue parametername m_requestdatastring indexof retvalue m_requestdatastring retvalue retvalue retvalue indexof retvalue retvalue retvalue indexof retvalue retvalue retvalue indexof retvalue retvalue getparameter parametername getparameter parametername retvalue retvalue get multi part parameter as int param parameter name name return result or 0 public int get parameter as int string parameter name string result get parameter parameter name try if result null result length 0 return integer parse int result catch exception e log log level severe get parameter as int parameter name result e return 0 parametername getparameterasint parametername getparameter parametername parseint getparameterasint parametername string representation return info public string to string string buffer sb new string buffer file upload if m filename null sb append m filename if m error null sb append error append m error if m data null sb append length append m data length sb append return sb to string tostring stringbuffer stringbuffer fileupload m_filename m_filename m_error m_error m_data m_data tostring constructor public vo super get size return size public int size return m keys size m_keys is empty return true if empty public boolean is empty return m keys is empty isempty m_keys isempty contains key param key key return true if contains public boolean contains key object key if key null return false return m keys contains key containskey m_keys contains value param value value return true if contains value public boolean contains value object value if value null return false return m values contains value containsvalue m_values get value with key param key key return value or null public synchronized object get object key if key null return null int index m keys index of key if index 1 return m values get index return null m_keys indexof m_values put key value param key key param value value return previous value or null public synchronized object put object key object value if key null return null if value null return remove key string string key key to string string string value value to string int index m keys index of key if index 1 return m values set index string value m values add string key m values add string value return null stringkey tostring stringvalue tostring m_keys indexof m_values stringvalue m_values stringkey m_values stringvalue remove param key key return previous value or null public synchronized object remove object key if key null return null int index m keys index of key object old null if index 1 old m values get index m keys remove index m values remove index return old m_keys indexof m_values m_keys m_values put all param t map public void put all map t iterator it t key set iterator while it has next object key it next object value t get key put key value putall keyset hasnext clear keys values public void clear m keys clear m values clear m_keys m_values get key set return key set public set string key set hash set string set new hash set string m keys return set keyset hashset hashset m_keys key set public collection values return m values values keyset m_values get values set return values set public set string entry set hash set string set new hash set string m values return set entryset hashset hashset m_values create confirmation or return existing one param ship shipment param confirm type confirmation type param check existing if false new confirmation is created return confirmation public static m in out confirm create m in out ship string confirm type boolean check existing if check existing m in out confirm confirmations ship get confirmations false for int i 0 i confirmations length i m in out confirm confirm confirmations i if confirm get confirm type equals confirm type s log info create existing confirm return confirm m in out confirm confirm new m in out confirm ship confirm type confirm save ship get trxname m in out line ship lines ship get lines false for int i 0 i ship lines length i m in out line s line ship lines i m in out line confirm c line new m in out line confirm confirm c line set in out line s line c line save ship get trxname s log info new confirm return confirm confirmtype checkexisting minoutconfirm minout confirmtype checkexisting checkexisting minoutconfirm getconfirmations minoutconfirm getconfirmtype confirmtype s_log minoutconfirm minoutconfirm confirmtype get_trxname minoutline shiplines getlines shiplines minoutline sline shiplines minoutlineconfirm cline minoutlineconfirm cline setinoutline sline cline get_trxname s_log standard constructor param ctx context param m inoutconfirm id id param trx name transaction public m in out confirm properties ctx int m inoutconfirm id string trx name super ctx m inoutconfirm id trx name if m inoutconfirm id 0 set confirm type null set doc action docaction complete co set doc status docstatus drafted dr set is approved false set is cancelled false set is in dispute false super set processed false m_inoutconfirm_id trxname minoutconfirm m_inoutconfirm_id trxname m_inoutconfirm_id trxname m_inoutconfirm_id setconfirmtype setdocaction docaction_complete setdocstatus docstatus_drafted setisapproved setiscancelled setisindispute setprocessed load constructor param ctx context param rs result set public m in out confirm properties ctx result set rs string trx name super ctx rs trx name minoutconfirm resultset trxname trxname parent constructor param ship shipment param confirm type confirmation type public m in out confirm m in out ship string confirm type this ship get ctx 0 ship get trxname set client org ship setm inout id ship getm inout id set confirm type confirm type confirmtype minoutconfirm minout confirmtype getctx get_trxname setclientorg setm_inout_id getm_inout_id setconfirmtype confirmtype get lines param requery requery return array of lines public m in out line confirm get lines boolean requery if m lines null requery return m lines string sql select from m inoutlineconfirm where m inoutconfirm id array list m in out line confirm list new array list m in out line confirm prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm inoutconfirm id result set rs pstmt execute query while rs next list add new m in out line confirm get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m in out line confirm list size list to array m lines return m lines minoutlineconfirm getlines m_lines m_lines m_inoutlineconfirm m_inoutconfirm_id arraylist minoutlineconfirm arraylist minoutlineconfirm preparedstatement preparestatement get_trxname setint getm_inoutconfirm_id resultset executequery minoutlineconfirm getctx get_trxname m_lines minoutlineconfirm toarray m_lines m_lines add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get name of confirm type return confirm type public string get confirm type name return m ref list get list name get ctx confirmtype ad reference id get confirm type confirmtype getconfirmtypename mreflist getlistname getctx confirmtype_ad_reference_id getconfirmtype string representation return info public string to string string buffer sb new string buffer m in out confirm sb append get id append append get summary append return sb to string tostring stringbuffer stringbuffer minoutconfirm get_id getsummary tostring get document info return document info untranslated public string get document info return msg get element get ctx m inoutconfirm id get document no getdocumentinfo getelement getctx m_inoutconfirm_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id set approved param is approved approval public void set is approved boolean is approved if is approved is approved int ad user id env getad user id get ctx m user user m user get get ctx ad user id string info user get name msg translate get ctx is approved new timestamp system current time millis add description info super set is approved is approved isapproved setisapproved isapproved isapproved isapproved ad_user_id getad_user_id getctx muser muser getctx ad_user_id getname getctx isapproved currenttimemillis adddescription setisapproved isapproved process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctypetarget id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid m in out line confirm lines get lines true if lines length 0 m processmsg no lines return doc action status invalid set dispute if not fully confirmed boolean difference false for int i 0 i lines length i if lines i is fully confirmed difference true break set is in dispute difference m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctypetarget_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid minoutlineconfirm getlines m_processmsg nolines docaction status_invalid isfullyconfirmed setisindispute m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string m in out inout new m in out get ctx getm inout id get trxname m in out line confirm lines get lines false check if we need to split shipment if is in dispute m doc type dt m doc type get get ctx inout getc doctype id if dt is split when difference if dt getc doctypedifference id 0 m processmsg no split document type defined for dt get name return doc action status invalid split in out inout dt getc doctypedifference id lines m lines null all lines for int i 0 i lines length i m in out line confirm confirm line lines i confirm line set trxname get trxname if confirm line process line inout isso trx get confirm type m processmsg ship line not saved confirm line return doc action status invalid if confirm line is fully confirmed confirm line set processed true confirm line save get trxname else if create difference doc inout confirm line confirm line set processed true confirm line save get trxname else log log level severe scrapped confirm line get scrapped qty difference confirm line get difference qty return doc action status invalid for all lines if m creditmemo null m processmsg c invoice id m creditmemo get document no if m inventory null m processmsg m inventory id m inventory get document no try to complete shipment if inout process it doc action action complete m processmsg m inout id inout get document no completed user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring minout minout getctx getm_inout_id get_trxname minoutlineconfirm getlines isindispute mdoctype mdoctype getctx getc_doctype_id issplitwhendifference getc_doctypedifference_id m_processmsg getname docaction status_invalid splitinout getc_doctypedifference_id m_lines minoutlineconfirm confirmline confirmline set_trxname get_trxname confirmline processline issotrx getconfirmtype m_processmsg shipline confirmline docaction status_invalid confirmline isfullyconfirmed confirmline setprocessed confirmline get_trxname createdifferencedoc confirmline confirmline setprocessed confirmline get_trxname confirmline getscrappedqty confirmline getdifferenceqty docaction status_invalid m_creditmemo m_processmsg c_invoice_id m_creditmemo getdocumentno m_inventory m_processmsg m_inventory_id m_inventory getdocumentno processit docaction action_complete m_processmsg m_inout_id getdocumentno modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed split shipment into confirmed and dispute param original original shipment param c doctype id target doc type param confirm lines confirm lines private void split in out m in out original int c doctype id m in out line confirm confirm lines m in out split new m in out original c doctype id original get movement date split add description splitted from original get document no split set is in dispute true if split save get trxname throw new illegal state exception cannot save split original add description split split get document no if original save get trxname throw new illegal state exception cannot update original shipment go through confirmations for int i 0 i confirm lines length i m in out line confirm confirm line confirm lines i big decimal difference qty confirm line get difference qty if difference qty compare to env zero 0 continue m in out line old line confirm line get line log fine qty difference qty old old line m in out line split line new m in out line split split line setc orderline id old line getc orderline id split line setc uom id old line getc uom id split line set description old line get description split line set is description old line is description split line set line old line get line split line setm attributesetinstance id old line getm attributesetinstance id split line setm locator id old line getm locator id split line setm product id old line getm product id split line setm warehouse id old line getm warehouse id split line setref inoutline id old line getref inoutline id split line add description split from old line get movement qty qtys split line set qty difference qty entered movement if split line save get trxname throw new illegal state exception cannot save split line old old line add description splitted from old line get movement qty old line set qty old line get movement qty subtract difference qty if old line save get trxname throw new illegal state exception cannot save splited line update confirmation line confirm line set target qty confirm line get target qty subtract difference qty confirm line set difference qty env zero if confirm line save get trxname throw new illegal state exception cannot save split confirmation for all confirmations m processmsg split m inout id split get document no m inoutconfirm id create dispute confirmation split process it doc action action prepare split create confirmation split save get trxname m in out confirm split confirms split get confirmations true if split confirms length 0 int index 0 if split confirms index is processed if split confirms length 1 index try just next if split confirms index is processed m processmsg split confirms index get document no processed return split confirms index set is in dispute true split confirms index save get trxname m processmsg split confirms index get document no set lines to unconfirmed m in out line confirm split confirm lines split confirms index get lines false for int i 0 i split confirm lines length i m in out line confirm split confirm line split confirm lines i split confirm line set scrapped qty env zero split confirm line set confirmed qty env zero split confirm line save get trxname else m processmsg c_doctype_id doctype confirmlines splitinout minout c_doctype_id minoutlineconfirm confirmlines minout minout c_doctype_id getmovementdate adddescription getdocumentno setisindispute get_trxname illegalstateexception adddescription getdocumentno get_trxname illegalstateexception confirmlines minoutlineconfirm confirmline confirmlines bigdecimal differenceqty confirmline getdifferenceqty differenceqty compareto minoutline oldline confirmline getline differenceqty oldline minoutline splitline minoutline splitline setc_orderline_id oldline getc_orderline_id splitline setc_uom_id oldline getc_uom_id splitline setdescription oldline getdescription splitline setisdescription oldline isdescription splitline setline oldline getline splitline setm_attributesetinstance_id oldline getm_attributesetinstance_id splitline setm_locator_id oldline getm_locator_id splitline setm_product_id oldline getm_product_id splitline setm_warehouse_id oldline getm_warehouse_id splitline setref_inoutline_id oldline getref_inoutline_id splitline adddescription oldline getmovementqty splitline setqty differenceqty splitline get_trxname illegalstateexception oldline adddescription oldline getmovementqty oldline setqty oldline getmovementqty differenceqty oldline get_trxname illegalstateexception confirmline settargetqty confirmline gettargetqty differenceqty confirmline setdifferenceqty confirmline get_trxname illegalstateexception m_processmsg m_inout_id getdocumentno m_inoutconfirm_id processit docaction action_prepare createconfirmation get_trxname minoutconfirm splitconfirms getconfirmations splitconfirms splitconfirms isprocessed splitconfirms splitconfirms isprocessed m_processmsg splitconfirms getdocumentno splitconfirms setisindispute splitconfirms get_trxname m_processmsg splitconfirms getdocumentno minoutlineconfirm splitconfirmlines splitconfirms getlines splitconfirmlines minoutlineconfirm splitconfirmline splitconfirmlines splitconfirmline setscrappedqty splitconfirmline setconfirmedqty splitconfirmline get_trxname m_processmsg create difference document param confirm confirm line return true if created private boolean create difference doc m in out inout m in out line confirm confirm if m processmsg null m processmsg else if m processmsg length 0 m processmsg credit memo if linked document if confirm get difference qty signum 0 inout isso trx inout getref inout id 0 log info difference confirm get difference qty if m creditmemo null m creditmemo new m invoice inout null m creditmemo set description msg translate get ctx m inoutconfirm id get document no m creditmemo setc doctypetarget id m doc type docbasetype apcreditmemo if m creditmemo save get trxname m processmsg credit memo not created return false setc invoice id m creditmemo getc invoice id m invoice line line new m invoice line m creditmemo line set ship line confirm get line line set qty confirm get difference qty entered invoiced if line save get trxname m processmsg credit memo line not created return false confirm setc invoiceline id line getc invoiceline id create inventory difference if confirm get scrapped qty signum 0 log info scrapped confirm get scrapped qty if m inventory null m warehouse wh m warehouse get get ctx inout getm warehouse id m inventory new m inventory wh m inventory set description msg translate get ctx m inoutconfirm id get document no if m inventory save get trxname m processmsg inventory not created return false setm inventory id m inventory getm inventory id m in out line io line confirm get line m inventory line line new m inventory line m inventory io line getm locator id io line getm product id io line getm attributesetinstance id confirm get scrapped qty env zero if line save get trxname m processmsg inventory line not created return false confirm setm inventoryline id line getm inventoryline id if confirm save get trxname m processmsg confirmation line not saved return false return true createdifferencedoc minout minoutlineconfirm m_processmsg m_processmsg m_processmsg m_processmsg getdifferenceqty issotrx getref_inout_id getdifferenceqty m_creditmemo m_creditmemo minvoice m_creditmemo setdescription getctx m_inoutconfirm_id getdocumentno m_creditmemo setc_doctypetarget_id mdoctype docbasetype_apcreditmemo m_creditmemo get_trxname m_processmsg setc_invoice_id m_creditmemo getc_invoice_id minvoiceline minvoiceline m_creditmemo setshipline getline setqty getdifferenceqty get_trxname m_processmsg setc_invoiceline_id getc_invoiceline_id getscrappedqty getscrappedqty m_inventory mwarehouse mwarehouse getctx getm_warehouse_id m_inventory minventory m_inventory setdescription getctx m_inoutconfirm_id getdocumentno m_inventory get_trxname m_processmsg setm_inventory_id m_inventory getm_inventory_id minoutline ioline getline minventoryline minventoryline m_inventory ioline getm_locator_id ioline getm_product_id ioline getm_attributesetinstance_id getscrappedqty get_trxname m_processmsg setm_inventoryline_id getm_inventoryline_id get_trxname m_processmsg void document return false public boolean void it log info to string return false voidit tostring close document return true if success public boolean close it log info to string set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info to string return false reversecorrectit tostring reverse accrual none return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return false public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get updated by ad_user_id getdoc_user_id getupdatedby get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id standard constructor public x ad element properties ctx int ad element id string trx name super ctx ad element id trx name if ad element id 0 setad element id 0 set column name null set entity type null u set name null set print name null x_ad_element ad_element_id trxname ad_element_id trxname ad_element_id setad_element_id setcolumnname setentitytype setname setprintname load constructor public x ad element properties ctx result set rs string trx name super ctx rs trx name x_ad_element resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad element append get id append return sb to string tostring stringbuffer stringbuffer x_ad_element get_id tostring set system element system element enables the central maintenance of column description and help public void setad element id int ad element id if ad element id 1 throw new illegal argument exception ad element id is mandatory set valuenocheck ad element id new integer ad element id setad_element_id ad_element_id ad_element_id illegalargumentexception ad_element_id set_valuenocheck ad_element_id ad_element_id get system element system element enables the central maintenance of column description and help public int getad element id integer ii integer get value ad element id if ii null return 0 return ii int value getad_element_id get_value ad_element_id intvalue set db column name name of the column in the database public void set column name string column name if column name null throw new illegal argument exception column name is mandatory if column name length 40 log warning length 40 truncated column name column name substring 0 39 set value column name column name setcolumnname columnname columnname illegalargumentexception columnname columnname columnname columnname set_value columnname columnname get db column name name of the column in the database public string get column name return string get value column name getcolumnname get_value columnname return string get value column name public key name pair get key name pair return new key name pair get id get column name get_value columnname keynamepair getkeynamepair keynamepair get_id getcolumnname set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set po description description in po screens public void setpo description string po description if po description null po description length 255 log warning length 255 truncated po description po description substring 0 254 set value po description po description setpo_description po_description po_description po_description po_description po_description set_value po_description po_description get po description description in po screens public string getpo description return string get value po description getpo_description get_value po_description set po help help for po screens public void setpo help string po help if po help null po help length 2000 log warning length 2000 truncated po help po help substring 0 1999 set value po help po help setpo_help po_help po_help po_help po_help po_help set_value po_help po_help get po help help for po screens public string getpo help return string get value po help getpo_help get_value po_help set po name name on po screens public void setpo name string po name if po name null po name length 60 log warning length 60 truncated po name po name substring 0 59 set value po name po name setpo_name po_name po_name po_name po_name po_name set_value po_name po_name get po name name on po screens public string getpo name return string get value po name getpo_name get_value po_name set po print name print name on po screens reports public void setpo printname string po printname if po printname null po printname length 60 log warning length 60 truncated po printname po printname substring 0 59 set value po printname po printname setpo_printname po_printname po_printname po_printname po_printname po_printname set_value po_printname po_printname get po print name print name on po screens reports public string getpo printname return string get value po printname getpo_printname get_value po_printname set print text the label text to be printed on a document or correspondence public void set print name string print name if print name null throw new illegal argument exception print name is mandatory if print name length 60 log warning length 60 truncated print name print name substring 0 59 set value print name print name setprintname printname printname illegalargumentexception printname printname printname printname set_value printname printname get print text the label text to be printed on a document or correspondence public string get print name return string get value print name getprintname get_value printname create a j table model from report model param report model public result table model r model report model m model report model jtable reportmodel reportmodel resulttablemodel rmodel reportmodel m_model reportmodel get row count return row count public int get row count return m model get row count getrowcount m_model getrowcount get column count return column count public int get column count return m model get column count columncount getcolumncount m_model getcolumncount get column name param column index return column name public string get column name int column index return m model get column name column index columnindex getcolumnname columnindex m_model getcolumnname columnindex get column class param column index return column class public class get column class int column index return m model get column class column index columnindex getcolumnclass columnindex m_model getcolumnclass columnindex is cell editable param row index param column index return true if editable public boolean is cell editable int row index int column index return false rowindex columnindex iscelleditable rowindex columnindex get value at param row param col return value public object get value at int row int col return m model get value at row col getvalueat m_model getvalueat set value at param a value param row param col public void set value at object a value int row int col m model set value at a value row col fire table changed new table model event this row row col table model event update avalue setvalueat avalue m_model setvalueat avalue firetablechanged tablemodelevent tablemodelevent move row param from index param to index public void move row int from int to m model move row from to moverow m_model moverow standard constructor public x m lotctl properties ctx int m lotctl id string trx name super ctx m lotctl id trx name if m lotctl id 0 set current next 0 100 set increment no 0 1 setm lotctl id 0 set name null set start no 0 100 x_m_lotctl m_lotctl_id trxname m_lotctl_id trxname m_lotctl_id setcurrentnext setincrementno setm_lotctl_id setname setstartno load constructor public x m lotctl properties ctx result set rs string trx name super ctx rs trx name x_m_lotctl resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m lotctl append get id append return sb to string tostring stringbuffer stringbuffer x_m_lotctl get_id tostring set current next the next number to be used public void set current next int current next set value current next new integer current next setcurrentnext currentnext set_value currentnext currentnext get current next the next number to be used public int get current next integer ii integer get value current next if ii null return 0 return ii int value getcurrentnext get_value currentnext intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set increment the number to increment the last document number by public void set increment no int increment no set value increment no new integer increment no setincrementno incrementno set_value incrementno incrementno get increment the number to increment the last document number by public int get increment no integer ii integer get value increment no if ii null return 0 return ii int value getincrementno get_value incrementno intvalue set lot control product lot control public void setm lotctl id int m lotctl id if m lotctl id 1 throw new illegal argument exception m lotctl id is mandatory set valuenocheck m lotctl id new integer m lotctl id setm_lotctl_id m_lotctl_id m_lotctl_id illegalargumentexception m_lotctl_id set_valuenocheck m_lotctl_id m_lotctl_id get lot control product lot control public int getm lotctl id integer ii integer get value m lotctl id if ii null return 0 return ii int value getm_lotctl_id get_value m_lotctl_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set prefix prefix before the sequence number public void set prefix string prefix if prefix null prefix length 10 log warning length 10 truncated prefix prefix substring 0 9 set value prefix prefix setprefix set_value get prefix prefix before the sequence number public string get prefix return string get value prefix getprefix get_value set start no starting number position public void set start no int start no set value start no new integer start no setstartno startno set_value startno startno get start no starting number position public int get start no integer ii integer get value start no if ii null return 0 return ii int value getstartno get_value startno intvalue set suffix suffix after the number public void set suffix string suffix if suffix null suffix length 10 log warning length 10 truncated suffix suffix substring 0 9 set value suffix suffix setsuffix set_value get suffix suffix after the number public string get suffix return string get value suffix getsuffix get_value prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name log fine prepare para i if para i get parameter null else if name equals m product category id p m product category id para i get parameter as int else if name equals set future cost to p setfuturecostto string para i get parameter else if name equals set standard cost to p setstandardcostto string para i get parameter else if name equals m pricelist version id p m pricelist version id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter m_product_category_id p_m_product_category_id getparameterasint setfuturecostto p_setfuturecostto getparameter setstandardcostto p_setstandardcostto getparameter m_pricelist_version_id p_m_pricelist_version_id getparameterasint process return info throws exception protected string do it throws exception log info m product category id p m product category id future p setfuturecostto standard p setstandardcostto m pricelist version id p m pricelist version id if p setfuturecostto null p setfuturecostto if p setstandardcostto null p setstandardcostto nothing to do if p setfuturecostto length 0 p setstandardcostto length 0 return plv required if p m pricelist version id 0 p setfuturecostto equals to pricelistlimit p setstandardcostto equals to pricelistlimit throw new compiere user error fill mandatory m pricelist version id validate source if is valid p setfuturecostto throw new compiere user error not found m costelement id future p setfuturecostto if is valid p setstandardcostto throw new compiere user error not found m costelement id standard p setstandardcostto prepare m client client m client get get ctx m ce m cost element get material cost element client m acct schema costingmethod standardcosting if m ce get id 0 throw new compiere user error not found m costelement id std cost log config m ce to string m ass m acct schema get client acct schema get ctx client getad client id for int i 0 i m ass length i create new m ass i commit update cost int counter update return counter doit m_product_category_id p_m_product_category_id p_setfuturecostto p_setstandardcostto m_pricelist_version_id p_m_pricelist_version_id p_setfuturecostto p_setfuturecostto p_setstandardcostto p_setstandardcostto p_setfuturecostto p_setstandardcostto p_m_pricelist_version_id p_setfuturecostto to_pricelistlimit p_setstandardcostto to_pricelistlimit compiereusererror fillmandatory m_pricelist_version_id isvalid p_setfuturecostto compiereusererror notfound m_costelement_id p_setfuturecostto isvalid p_setstandardcostto compiereusererror notfound m_costelement_id p_setstandardcostto mclient mclient getctx m_ce mcostelement getmaterialcostelement macctschema costingmethod_standardcosting m_ce get_id compiereusererror notfound m_costelement_id stdcost m_ce tostring m_ass macctschema getclientacctschema getctx getad_client_id m_ass createnew m_ass costing method must exist param to test return true valid private boolean is valid string to if p setfuturecostto length 0 return true string to target to if to equals to averageinvoicehistory to to averageinvoice if to equals to averagepohistory to to averagepo if to equals to futurestandardcost to to standardcost if to equals to averageinvoice to equals to averagepo to equals to fifo to equals to lifo to equals to standardcost m cost element ce get cost element p setfuturecostto return ce null return true isvalid p_setfuturecostto totarget to_averageinvoicehistory to_averageinvoice to_averagepohistory to_averagepo to_futurestandardcost to_standardcost to_averageinvoice to_averagepo to_fifo to_lifo to_standardcost mcostelement getcostelement p_setfuturecostto create new standard costs private void create new m acct schema as if as get costing level equals m acct schema costinglevel client string txt costing level prevents creating new costing records for as get name log warning txt add log 0 null null txt return string sql select from m product p where not exists select from m cost c where c m product id p m product id and c m costtype id and c c acctschema id and c m costelement id and c m attributesetinstance id 0 and ad client id if p m product category id 0 sql and m product category id int counter 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 as getm costtype id pstmt set int 2 as getc acctschema id pstmt set int 3 m ce getm costelement id pstmt set int 4 as getad client id if p m product category id 0 pstmt set int 5 p m product category id result set rs pstmt execute query while rs next if create new new m product get ctx rs null as counter rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info counter add log 0 null new big decimal counter created for as get name createnew macctschema getcostinglevel macctschema costinglevel_client getname addlog m_product m_cost m_product_id m_product_id m_costtype_id c_acctschema_id m_costelement_id m_attributesetinstance_id ad_client_id p_m_product_category_id m_product_category_id preparedstatement preparestatement setint getm_costtype_id setint getc_acctschema_id setint m_ce getm_costelement_id setint getad_client_id p_m_product_category_id setint p_m_product_category_id resultset executequery createnew mproduct getctx addlog bigdecimal getname create new client level costing record param product product param as acct schema return true if created private boolean create new m product product m acct schema as m cost cost m cost get product 0 as 0 m ce getm costelement id if cost is new return cost save return false createnew mproduct macctschema mcost mcost m_ce getm_costelement_id is_new update cost records return no updated private int update int counter 0 string sql select from m cost c where m costelement id if p m product category id 0 sql and exists select from m product p where c m product id p m product id and p m product category id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m ce getm costelement id if p m product category id 0 pstmt set int 2 p m product category id result set rs pstmt execute query while rs next m cost cost new m cost get ctx rs get trxname for int i 0 i m ass length i update costs only for default cost type if m ass i getc acctschema id cost getc acctschema id m ass i getm costtype id cost getm costtype id if update cost counter rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info counter add log 0 null new big decimal counter updated return counter m_cost m_costelement_id p_m_product_category_id m_product m_product_id m_product_id m_product_category_id preparedstatement preparestatement setint m_ce getm_costelement_id p_m_product_category_id setint p_m_product_category_id resultset executequery mcost mcost getctx get_trxname m_ass m_ass getc_acctschema_id getc_acctschema_id m_ass getm_costtype_id getm_costtype_id addlog bigdecimal update cost records param cost cost return true if updated private boolean update m cost cost throws exception boolean updated false if p setfuturecostto equals p setstandardcostto big decimal costs get costs cost p setfuturecostto if costs null costs signum 0 cost set future cost price costs cost set current cost price costs updated true else if p setstandardcostto length 0 big decimal costs get costs cost p setstandardcostto if costs null costs signum 0 cost set current cost price costs updated true if p setfuturecostto length 0 big decimal costs get costs cost p setfuturecostto if costs null costs signum 0 cost set future cost price costs updated true if updated updated cost save return updated mcost p_setfuturecostto p_setstandardcostto bigdecimal getcosts p_setfuturecostto setfuturecostprice setcurrentcostprice p_setstandardcostto bigdecimal getcosts p_setstandardcostto setcurrentcostprice p_setfuturecostto bigdecimal getcosts p_setfuturecostto setfuturecostprice get costs param cost cost param to where to get costs from return costs could be 0 or null if not found private big decimal get costs m cost cost string to throws exception big decimal ret value null average invoice if to equals to averageinvoice m cost element ce get cost element to averageinvoice if ce null throw new compiere system error cost element not found to averageinvoice m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price average invoice history else if to equals to averageinvoicehistory m cost element ce get cost element to averageinvoice if ce null throw new compiere system error cost element not found to averageinvoice m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get history average average po else if to equals to averagepo m cost element ce get cost element to averagepo if ce null throw new compiere system error cost element not found to averagepo m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price average po history else if to equals to averagepohistory m cost element ce get cost element to averagepo if ce null throw new compiere system error cost element not found to averagepo m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get history average fi fo else if to equals to fifo m cost element ce get cost element to fifo if ce null throw new compiere system error cost element not found to fifo m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price future std costs else if to equals to futurestandardcost ret value cost get future cost price last inv price else if to equals to lastinvoiceprice m cost element ce get cost element to lastinvoiceprice if ce null m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price if ret value null m product product m product get get ctx cost getm product id m acct schema as m acct schema get get ctx cost getc acctschema id ret value m cost get last invoice price product cost getm attributesetinstance id cost getad org id as getc currency id last po price else if to equals to lastpoprice m cost element ce get cost element to lastpoprice if ce null m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price if ret value null m product product m product get get ctx cost getm product id m acct schema as m acct schema get get ctx cost getc acctschema id ret value m cost get lastpo price product cost getm attributesetinstance id cost getad org id as getc currency id fi fo else if to equals to lifo m cost element ce get cost element to lifo if ce null throw new compiere system error cost element not found to lifo m cost x cost m cost get get ctx cost getad client id cost getad org id cost getm product id cost getm costtype id cost getc acctschema id ce getm costelement id cost getm attributesetinstance id if x cost null ret value x cost get current cost price old std costs else if to equals to oldstandardcost ret value get old current cost price cost price list else if to equals to pricelistlimit ret value get price cost standard costs else if to equals to standardcost ret value cost get current cost price return ret value bigdecimal getcosts mcost bigdecimal retvalue to_averageinvoice mcostelement getcostelement to_averageinvoice compieresystemerror costelement to_averageinvoice mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice to_averageinvoicehistory mcostelement getcostelement to_averageinvoice compieresystemerror costelement to_averageinvoice mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost gethistoryaverage to_averagepo mcostelement getcostelement to_averagepo compieresystemerror costelement to_averagepo mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice to_averagepohistory mcostelement getcostelement to_averagepo compieresystemerror costelement to_averagepo mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost gethistoryaverage fifo to_fifo mcostelement getcostelement to_fifo compieresystemerror costelement to_fifo mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice to_futurestandardcost retvalue getfuturecostprice to_lastinvoiceprice mcostelement getcostelement to_lastinvoiceprice mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice retvalue mproduct mproduct getctx getm_product_id macctschema macctschema getctx getc_acctschema_id retvalue mcost getlastinvoiceprice getm_attributesetinstance_id getad_org_id getc_currency_id to_lastpoprice mcostelement getcostelement to_lastpoprice mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice retvalue mproduct mproduct getctx getm_product_id macctschema macctschema getctx getc_acctschema_id retvalue mcost getlastpoprice getm_attributesetinstance_id getad_org_id getc_currency_id fifo to_lifo mcostelement getcostelement to_lifo compieresystemerror costelement to_lifo mcost xcost mcost getctx getad_client_id getad_org_id getm_product_id getm_costtype_id getc_acctschema_id getm_costelement_id getm_attributesetinstance_id xcost retvalue xcost getcurrentcostprice to_oldstandardcost retvalue getoldcurrentcostprice to_pricelistlimit retvalue getprice to_standardcost retvalue getcurrentcostprice retvalue get cost element param costing method method return costing element or null private m cost element get cost element string costing method m cost element ce m ces get costing method if ce null ce m cost element get material cost element get ctx costing method m ces put costing method ce return ce costingmethod mcostelement getcostelement costingmethod mcostelement m_ces costingmethod mcostelement getmaterialcostelement getctx costingmethod m_ces costingmethod get old current cost price param cost costs return price if found private big decimal get old current cost price m cost cost big decimal ret value null string sql select cost standard current cost price from m product costing where m product id and c acctschema id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 cost getm product id pstmt set int 2 cost getc acctschema id result set rs pstmt execute query if rs next ret value rs get big decimal 1 if ret value null ret value signum 0 ret value rs get big decimal 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value bigdecimal getoldcurrentcostprice mcost bigdecimal retvalue coststandard currentcostprice m_product_costing m_product_id c_acctschema_id preparedstatement preparestatement setint getm_product_id setint getc_acctschema_id resultset executequery retvalue getbigdecimal retvalue retvalue retvalue getbigdecimal retvalue get price from price list return price or null private big decimal get price m cost cost big decimal ret value null string sql select price limit from m productprice where m product id and m pricelist version id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 cost getm product id pstmt set int 2 p m pricelist version id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value bigdecimal getprice mcost bigdecimal retvalue pricelimit m_productprice m_product_id m_pricelist_version_id preparedstatement preparestatement setint getm_product_id setint p_m_pricelist_version_id resultset executequery retvalue getbigdecimal retvalue private string icon mono32x32 filename public v text bean info iconmono32x32filename vtextbeaninfo public property descriptor get property descriptors try property descriptor background new property descriptor background bean class null set background property descriptor border new property descriptor border bean class null set border property descriptor display new property descriptor display bean class get display null property descriptor editable new property descriptor editable bean class is editable set editable property descriptor font new property descriptor font bean class null set font property descriptor foreground new property descriptor foreground bean class null set foreground property descriptor mandatory new property descriptor mandatory bean class is mandatory set mandatory property descriptor value new property descriptor value bean class get value set value property descriptor pds new property descriptor background border display editable font foreground mandatory value return pds catch introspection exception ex ex print stack trace return null propertydescriptor getpropertydescriptors propertydescriptor _background propertydescriptor beanclass setbackground propertydescriptor _border propertydescriptor beanclass setborder propertydescriptor _display propertydescriptor beanclass getdisplay propertydescriptor _editable propertydescriptor beanclass iseditable seteditable propertydescriptor _font propertydescriptor beanclass setfont propertydescriptor _foreground propertydescriptor beanclass setforeground propertydescriptor _mandatory propertydescriptor beanclass ismandatory setmandatory propertydescriptor _value propertydescriptor beanclass getvalue setvalue propertydescriptor propertydescriptor _background _border _display _editable _font _foreground _mandatory _value introspectionexception printstacktrace public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename public bean info get additional bean info class superclass bean class get superclass try bean info super bean info introspector get bean info superclass return new bean info super bean info catch introspection exception ex ex print stack trace return null beaninfo getadditionalbeaninfo beanclass getsuperclass beaninfo superbeaninfo getbeaninfo beaninfo superbeaninfo introspectionexception printstacktrace constructor param win window param l listener public a window listener window win window state listener l m window win m listener l win add window listener this awindowlistener windowstatelistener m_window m_listener addwindowlistener invoked when a window has been closed forwarded param e event to be forwarded public void window closed window event e m listener window state changed e windowclosed windowevent m_listener windowstatechanged standard constructor public x m freightcategory properties ctx int m freightcategory id string trx name super ctx m freightcategory id trx name if m freightcategory id 0 setm freightcategory id 0 set name null set value null x_m_freightcategory m_freightcategory_id trxname m_freightcategory_id trxname m_freightcategory_id setm_freightcategory_id setname setvalue load constructor public x m freightcategory properties ctx result set rs string trx name super ctx rs trx name x_m_freightcategory resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m freightcategory append get id append return sb to string tostring stringbuffer stringbuffer x_m_freightcategory get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set freight category category of the freight public void setm freightcategory id int m freightcategory id if m freightcategory id 1 throw new illegal argument exception m freightcategory id is mandatory set valuenocheck m freightcategory id new integer m freightcategory id setm_freightcategory_id m_freightcategory_id m_freightcategory_id illegalargumentexception m_freightcategory_id set_valuenocheck m_freightcategory_id m_freightcategory_id get freight category category of the freight public int getm freightcategory id integer ii integer get value m freightcategory id if ii null return 0 return ii int value getm_freightcategory_id get_value m_freightcategory_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x ad sequence properties ctx int ad sequence id string trx name super ctx ad sequence id trx name if ad sequence id 0 setad sequence id 0 set current next 0 1000000 set current next sys 0 100 set increment no 0 1 set is auto sequence false set name null set start no 0 1000000 x_ad_sequence ad_sequence_id trxname ad_sequence_id trxname ad_sequence_id setad_sequence_id setcurrentnext setcurrentnextsys setincrementno setisautosequence setname setstartno load constructor public x ad sequence properties ctx result set rs string trx name super ctx rs trx name x_ad_sequence resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad sequence append get id append return sb to string tostring stringbuffer stringbuffer x_ad_sequence get_id tostring set sequence document sequence public void setad sequence id int ad sequence id if ad sequence id 1 throw new illegal argument exception ad sequence id is mandatory set valuenocheck ad sequence id new integer ad sequence id setad_sequence_id ad_sequence_id ad_sequence_id illegalargumentexception ad_sequence_id set_valuenocheck ad_sequence_id ad_sequence_id get sequence document sequence public int getad sequence id integer ii integer get value ad sequence id if ii null return 0 return ii int value getad_sequence_id get_value ad_sequence_id intvalue set current next the next number to be used public void set current next int current next set value current next new integer current next setcurrentnext currentnext set_value currentnext currentnext get current next the next number to be used public int get current next integer ii integer get value current next if ii null return 0 return ii int value getcurrentnext get_value currentnext intvalue set current next system next sequence for system use public void set current next sys int current next sys set value current next sys new integer current next sys setcurrentnextsys currentnextsys set_value currentnextsys currentnextsys get current next system next sequence for system use public int get current next sys integer ii integer get value current next sys if ii null return 0 return ii int value getcurrentnextsys get_value currentnextsys intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set increment the number to increment the last document number by public void set increment no int increment no set value increment no new integer increment no setincrementno incrementno set_value incrementno incrementno get increment the number to increment the last document number by public int get increment no integer ii integer get value increment no if ii null return 0 return ii int value getincrementno get_value incrementno intvalue set activate audit activate audit trail of what numbers are generated public void set is audited boolean is audited set value is audited new boolean is audited setisaudited isaudited set_value isaudited isaudited get activate audit activate audit trail of what numbers are generated public boolean is audited object oo get value is audited if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaudited get_value isaudited booleanvalue set auto numbering automatically assign the next number public void set is auto sequence boolean is auto sequence set value is auto sequence new boolean is auto sequence setisautosequence isautosequence set_value isautosequence isautosequence get auto numbering automatically assign the next number public boolean is auto sequence object oo get value is auto sequence if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isautosequence get_value isautosequence booleanvalue set used for record id the document number will be used as the record key public void set is tableid boolean is tableid set value is tableid new boolean is tableid setistableid istableid set_value istableid istableid get used for record id the document number will be used as the record key public boolean is tableid object oo get value is tableid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istableid get_value istableid booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set prefix prefix before the sequence number public void set prefix string prefix if prefix null prefix length 10 log warning length 10 truncated prefix prefix substring 0 9 set value prefix prefix setprefix set_value get prefix prefix before the sequence number public string get prefix return string get value prefix getprefix get_value set restart sequence every year restart the sequence with start on every 1 1 public void set start new year boolean start new year set value start new year new boolean start new year setstartnewyear startnewyear set_value startnewyear startnewyear get restart sequence every year restart the sequence with start on every 1 1 public boolean is start new year object oo get value start new year if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isstartnewyear get_value startnewyear booleanvalue set start no starting number position public void set start no int start no set value start no new integer start no setstartno startno set_value startno startno get start no starting number position public int get start no integer ii integer get value start no if ii null return 0 return ii int value getstartno get_value startno intvalue set suffix suffix after the number public void set suffix string suffix if suffix null suffix length 10 log warning length 10 truncated suffix suffix substring 0 9 set value suffix suffix setsuffix set_value get suffix suffix after the number public string get suffix return string get value suffix getsuffix get_value set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 40 log warning length 40 truncated v format v format substring 0 39 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat initialize global variables param config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w lookup init servletexception servletconfig servletexception webenv initweb servletexception wlookup process the http get request initial start needs to have parameters form name and column name param request param response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception web env dump request web env dump request get session w window status ws w window status get request if ws null web util create timeout page request response this null return get mandatory parameters string column name web util get parameter request column name log info column name column name ws to string m field m field ws cur tab get field column name log config column name column name m field m field if m field null column name null column name equals web util create error page request response this msg get msg ws ctx parameter missing return parent frameset window label dtata field button string target base parent w window w window form name column name object value ws cur tab get value column name create document web doc doc web doc create popup m field get header doc add popup close boolean has dependents ws cur tab has dependants column name boolean has callout m field get callout length 0 reset button reset new button reset add element reset translate string script target base f value target base d value close popup if has dependents has callout script start update target base f reset set on click script doc get table add element new tr add element fill table ws m field target base has dependents has callout add element reset doc add popup close log trace log l6 database doc to string web util create response request response this null doc false formname columnname servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception webenv webenv getsession wwindowstatus wwindowstatus webutil createtimeoutpage columnname webutil getparameter columnname columnname columnname tostring mfield mfield curtab getfield columnname columnname columnname mfield mfield mfield columnname columnname webutil createerrorpage getmsg parametermissing framesetwindow targetbase wwindow wwindow form_name columnname curtab getvalue columnname webdoc webdoc createpopup mfield getheader addpopupclose hasdependents curtab hasdependants columnname hascallout mfield getcallout addelement targetbase targetbase closepopup hasdependents hascallout startupdate targetbase setonclick gettable addelement addelement filltable mfield targetbase hasdependents hascallout addelement addpopupclose l6_database tostring webutil createresponse process the http post request perform get param request param response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log config do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception doget fill table generic param ws window status param m field the field param target base target field string add field type param add start add start update return table with selection private table fill table w window status ws m field m field string target base boolean add start if m field get column name equals c bpartner id return filltable bpartner ws m field target else if m field get column name equals m product id return filltable product ws m field target table table new table 1 border 1 table setid w lookup tr line new tr line add element new th nbsp add element new th msg translate ws ctx name table add element line lookup lookup m field get lookup log info m field get column name fill list options lookup fill combo box m field is mandatory false true true true no context check int size lookup get size for int i 0 i size i object l value lookup get element at i if l value null l value instanceof key name pair continue log trace log l6 database l value to string key name pair np key name pair l value button button new button button add element gt string buffer script new string buffer script append target base append d value append np get key append append target base append f value append np get name append close popup if add start script append start update append target base append f button set on click script to string line new tr line add element new td button string name np get name if name null name length 0 name nbsp line add element new td name table add element line restore lookup fill combo box true return table windowstatus mfield targetbase addstart startupdate filltable wwindowstatus mfield mfield targetbase addstart mfield getcolumnname c_bpartner_id filltable_bpartner mfield mfield getcolumnname m_product_id filltable_product mfield wlookup addelement addelement addelement mfield getlookup mfield getcolumnname fillcombobox mfield ismandatory getsize lvalue getelementat lvalue lvalue keynamepair l6_database lvalue tostring keynamepair keynamepair lvalue addelement stringbuffer stringbuffer targetbase getkey targetbase getname closepopup addstart startupdate targetbase setonclick tostring addelement getname addelement addelement fillcombobox fill table b partner param ws window status param m field the field param target base target field string return table with selection private table filltable bpartner w window status ws m field m field string target base return null bpartner windowstatus mfield targetbase filltable_bpartner wwindowstatus mfield mfield targetbase fill table product param ws window status param m field the field param target base target field string return table with selection private table filltable product w window status ws m field m field string target base return null windowstatus mfield targetbase filltable_product wwindowstatus mfield mfield targetbase standard constructor param ctx context param ignored public m window access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key else setad role id 0 setad window id 0 set is read write true mwindowaccess trxname trxname illegalargumentexception setad_role_id setad_window_id setisreadwrite m window access param ctx param rs public m window access properties ctx result set rs string trx name super ctx rs trx name mwindowaccess mwindowaccess resultset trxname trxname parent constructor param parent parent param ad role id role id public m window access m window parent int ad role id super parent get ctx 0 parent get trxname set client org parent setad window id parent getad window id setad role id ad role id ad_role_id mwindowaccess m_window ad_role_id getctx get_trxname setclientorg setad_window_id getad_window_id setad_role_id ad_role_id standard constructor public x c commissionamt properties ctx int c commissionamt id string trx name super ctx c commissionamt id trx name if c commissionamt id 0 set actual qty env zero setc commissionamt id 0 setc commissionline id 0 setc commissionrun id 0 set commission amt env zero set converted amt env zero x_c_commissionamt c_commissionamt_id trxname c_commissionamt_id trxname c_commissionamt_id setactualqty setc_commissionamt_id setc_commissionline_id setc_commissionrun_id setcommissionamt setconvertedamt load constructor public x c commissionamt properties ctx result set rs string trx name super ctx rs trx name x_c_commissionamt resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c commissionamt append get id append return sb to string tostring stringbuffer stringbuffer x_c_commissionamt get_id tostring set actual quantity the actual quantity public void set actual qty big decimal actual qty if actual qty null throw new illegal argument exception actual qty is mandatory set value actual qty actual qty setactualqty bigdecimal actualqty actualqty illegalargumentexception actualqty set_value actualqty actualqty get actual quantity the actual quantity public big decimal get actual qty big decimal bd big decimal get value actual qty if bd null return env zero return bd bigdecimal getactualqty bigdecimal bigdecimal get_value actualqty set commission amount generated commission amount public void setc commissionamt id int c commissionamt id if c commissionamt id 1 throw new illegal argument exception c commissionamt id is mandatory set valuenocheck c commissionamt id new integer c commissionamt id setc_commissionamt_id c_commissionamt_id c_commissionamt_id illegalargumentexception c_commissionamt_id set_valuenocheck c_commissionamt_id c_commissionamt_id get commission amount generated commission amount public int getc commissionamt id integer ii integer get value c commissionamt id if ii null return 0 return ii int value getc_commissionamt_id get_value c_commissionamt_id intvalue set commission line commission line public void setc commissionline id int c commissionline id if c commissionline id 1 throw new illegal argument exception c commissionline id is mandatory set value c commissionline id new integer c commissionline id setc_commissionline_id c_commissionline_id c_commissionline_id illegalargumentexception c_commissionline_id set_value c_commissionline_id c_commissionline_id get commission line commission line public int getc commissionline id integer ii integer get value c commissionline id if ii null return 0 return ii int value getc_commissionline_id get_value c_commissionline_id intvalue set commission run commission run or process public void setc commissionrun id int c commissionrun id if c commissionrun id 1 throw new illegal argument exception c commissionrun id is mandatory set valuenocheck c commissionrun id new integer c commissionrun id setc_commissionrun_id c_commissionrun_id c_commissionrun_id illegalargumentexception c_commissionrun_id set_valuenocheck c_commissionrun_id c_commissionrun_id get commission run commission run or process public int getc commissionrun id integer ii integer get value c commissionrun id if ii null return 0 return ii int value getc_commissionrun_id get_value c_commissionrun_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc commissionrun id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_commissionrun_id set commission amount commission amount public void set commission amt big decimal commission amt if commission amt null throw new illegal argument exception commission amt is mandatory set value commission amt commission amt setcommissionamt bigdecimal commissionamt commissionamt illegalargumentexception commissionamt set_value commissionamt commissionamt get commission amount commission amount public big decimal get commission amt big decimal bd big decimal get value commission amt if bd null return env zero return bd bigdecimal getcommissionamt bigdecimal bigdecimal get_value commissionamt set converted amount converted amount public void set converted amt big decimal converted amt if converted amt null throw new illegal argument exception converted amt is mandatory set value converted amt converted amt setconvertedamt bigdecimal convertedamt convertedamt illegalargumentexception convertedamt set_value convertedamt convertedamt get converted amount converted amount public big decimal get converted amt big decimal bd big decimal get value converted amt if bd null return env zero return bd bigdecimal getconvertedamt bigdecimal bigdecimal get_value convertedamt table cell none constructor param column name name public table cell none string column name m columnname column name columnname tablecellnone columnname m_columnname columnname get table cell renderer component param table param value param is selected param has focus param row param col return null public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int col log finest m columnname value value row row col col m value value return null isselected hasfocus gettablecellrenderercomponent jtable isselected hasfocus m_columnname m_value get table cell editor component param table param value param is selected param row param col return null public component get table cell editor component j table table object value boolean is selected int row int col log finest m columnname value value row row col col m value value return null isselected gettablecelleditorcomponent jtable isselected m_columnname m_value get cell editor value return null public object get cell editor value log finest m columnname m value return m value getcelleditorvalue m_columnname m_value m_value is cell editable param an event return false public boolean is cell editable event object an event log finest m columnname return false anevent iscelleditable eventobject anevent m_columnname should select cell param an event return false public boolean should select cell event object an event log finest m columnname return false anevent shouldselectcell eventobject anevent m_columnname stop cell editing return true public boolean stop cell editing return true stopcellediting cancel cell editing public void cancel cell editing cancelcellediting public void add cell editor listener cell editor listener l addcelleditorlistener celleditorlistener public void remove cell editor listener cell editor listener l removecelleditorlistener celleditorlistener get existing or create local session param ctx context param create new create if not found return session session public static m session get properties ctx boolean create new int ad session id env get context as int ctx ad session id m session session null if ad session id 0 session m session s sessions get new integer ad session id if session null create new session new m session ctx null local session session save ad session id session getad session id env set context ctx ad session id ad session id s sessions put new integer ad session id session return session createnew msession createnew ad_session_id getcontextasint ad_session_id msession ad_session_id msession s_sessions ad_session_id createnew msession ad_session_id getad_session_id setcontext ad_session_id ad_session_id s_sessions ad_session_id get existing or create remote session param ctx context public static m session get properties ctx string remote addr string remote host string web session int ad session id env get context as int ctx ad session id m session session null if ad session id 0 session m session s sessions get new integer ad session id if session null session new m session ctx remote addr remote host web session null remote session session save ad session id session getad session id env set context ctx ad session id ad session id s sessions put new integer ad session id session return session msession remote_addr remote_host websession ad_session_id getcontextasint ad_session_id msession ad_session_id msession s_sessions ad_session_id msession remote_addr remote_host websession ad_session_id getad_session_id setcontext ad_session_id ad_session_id s_sessions ad_session_id standard constructor param ctx context param ad session id id public m session properties ctx int ad session id string trx name super ctx ad session id trx name if ad session id 0 set processed false ad_session_id msession ad_session_id trxname ad_session_id trxname ad_session_id setprocessed load costructor param ctx context param rs result set public m session properties ctx result set rs string trx name super ctx rs trx name msession resultset trxname trxname new remote constructor param ctx context public m session properties ctx string remote addr string remote host string web session string trx name this ctx 0 trx name if remote addr null setremote addr remote addr if remote host null setremote host remote host if web session null set web session web session msession remote_addr remote_host websession trxname trxname remote_addr setremote_addr remote_addr remote_host setremote_host remote_host websession setwebsession websession new local constructor param ctx context public m session properties ctx string trx name this ctx 0 trx name try inet address lh inet address get local host setremote addr lh get host address setremote host lh get host name catch unknown host exception e log log level severe m session no local host e msession trxname trxname inetaddress inetaddress getlocalhost setremote_addr gethostaddress setremote_host gethostname unknownhostexception msession is it a web store session return returns true if web store session public boolean is web store session return m webstoresession iswebstoresession m_webstoresession set web store session param web store session the web store session to set public void set web store session boolean web store session m webstoresession web store session webstoresession webstoresession setwebstoresession webstoresession m_webstoresession webstoresession string representation return info public string to string string buffer sb new string buffer m session append getad session id append ad user id append get created by append append get created append remote append getremote addr string s getremote host if s null s length 0 sb append append s if m webstoresession sb append web store session sb append return sb to string tostring stringbuffer stringbuffer msession getad_session_id ad_user_id getcreatedby getcreated getremote_addr getremote_host m_webstoresession webstoresession tostring session logout public void logout set processed true save s sessions remove new integer getad session id log info logout time util format elapsed get created get updated setprocessed s_sessions getad_session_id timeutil formatelapsed getcreated getupdated create change log only if table is logged param trx name transaction name param ad changelog id 0 for new change log param ad table id table param ad column id column param record id record param ad client id client param ad org id org param old value old param new value new return saved change log or null public m change log change log string trx name int ad changelog id int ad table id int ad column id int record id int ad client id int ad org id object old value object new value null handling if old value null new value null return null equal value if old value null new value null old value equals new value return null no log if ad column id 6652 ad column id 6653 ad process statistics return null role logging m role role m role get default get ctx false do we need to log if m webstoresession log if web store m change log is logged ad table id im explicit log role null role is change log role logging else return null log finest ad changelog id ad changelog id ad session id getad session id ad table id ad table id ad column id ad column id old value new value boolean success false try m change log cl new m change log get ctx ad changelog id trx name getad session id ad table id ad column id record id ad client id ad org id old value new value if cl save return cl catch exception e log log level severe ad changelog id ad changelog id ad session id getad session id ad table id ad table id ad column id ad column id e return null log log level severe ad changelog id ad changelog id ad session id getad session id ad table id ad table id ad column id ad column id return null trxname ad_changelog_id ad_table_id ad_column_id record_id ad_client_id ad_org_id oldvalue newvalue mchangelog changelog trxname ad_changelog_id ad_table_id ad_column_id record_id ad_client_id ad_org_id oldvalue newvalue oldvalue newvalue oldvalue newvalue oldvalue newvalue ad_column_id ad_column_id ad_process statistics_ mrole mrole getdefault getctx m_webstoresession webstore mchangelog islogged ad_table_id ischangelog ad_changelog_id ad_changelog_id ad_session_id getad_session_id ad_table_id ad_table_id ad_column_id ad_column_id oldvalue newvalue mchangelog mchangelog getctx ad_changelog_id trxname getad_session_id ad_table_id ad_column_id record_id ad_client_id ad_org_id oldvalue newvalue ad_changelog_id ad_changelog_id ad_session_id getad_session_id ad_table_id ad_table_id ad_column_id ad_column_id ad_changelog_id ad_changelog_id ad_session_id getad_session_id ad_table_id ad_table_id ad_column_id ad_column_id standard constructor param ctx context param c invoicebatchline id id param trx name trx public m invoice batch line properties ctx int c invoicebatchline id string trx name super ctx c invoicebatchline id trx name if c invoicebatchline id 0 setc invoicebatch id 0 setc bpartner id 0 setc bpartner location id 0 setc charge id 0 setc doctype id 0 c doctype id setc tax id 0 set document no null set line 0 sql select nvl max line 0 10 as default value from c invoicebatchline where c invoicebatch id c invoicebatch id set date acct new timestamp system current time millis date doc set date invoiced new timestamp system current time millis date doc set is tax included false set line net amt env zero set line total amt env zero set price entered env zero set qty entered env one 1 set tax amt env zero set processed false c_invoicebatchline_id trxname minvoicebatchline c_invoicebatchline_id trxname c_invoicebatchline_id trxname c_invoicebatchline_id setc_invoicebatch_id setc_bpartner_id setc_bpartner_location_id setc_charge_id setc_doctype_id c_doctype_id setc_tax_id setdocumentno setline defaultvalue c_invoicebatchline c_invoicebatch_id c_invoicebatch_id setdateacct currenttimemillis datedoc setdateinvoiced currenttimemillis datedoc setistaxincluded setlinenetamt setlinetotalamt setpriceentered setqtyentered settaxamt setprocessed load constructor param ctx context param rs result set param trx name trx public m invoice batch line properties ctx result set rs string trx name super ctx rs trx name trxname minvoicebatchline resultset trxname trxname before save param new record new return true protected boolean before save boolean new record amount if get price entered signum 0 log save error fill mandatory msg get element get ctx price entered return false return true newrecord beforesave newrecord getpriceentered saveerror fillmandatory getelement getctx priceentered after save update header param new record new param success success return success protected boolean after save boolean new record boolean success if success string sql update c invoicebatch h set document amt nvl select sum line total amt from c invoicebatchline l where h c invoicebatch id l c invoicebatch id and l is active y 0 where c invoicebatch id getc invoicebatch id db execute update sql get trxname return success newrecord aftersave newrecord c_invoicebatch documentamt linetotalamt c_invoicebatchline c_invoicebatch_id c_invoicebatch_id isactive c_invoicebatch_id getc_invoicebatch_id executeupdate get_trxname db sybase port public db sybase try get driver catch exception e log log level severe e get message db_sybase getdriver getmessage get database name return database short name public string get name return database db sybase getname db_sybase get description return info public string get description return s driver to string s driver get major version s driver get minor version getdescription s_driver tostring s_driver getmajorversion s_driver getminorversion get standard port return port public int get standard port return default port getstandardport default_port get driver return driver throws sql exception public driver get driver throws sql exception if s driver null if jtds s driver new net sourceforge jtds jdbc driver else s driver new com sybase jdbc3 jdbc syb driver driver manager register driver s driver driver manager set login timeout database connection timeout return s driver sqlexception getdriver sqlexception s_driver s_driver s_driver sybdriver drivermanager registerdriver s_driver drivermanager setlogintimeout connection_timeout s_driver get connection url param connection connection return url public string get connectionurl c connection connection string buffer sb null if jtds sb new string buffer jdbc jtds sybase else sb new string buffer jdbc sybase tds sb append connection get db host append append connection get db port append append connection get db name optional parameters via m connectionurl sb to string m dbname connection get db name return m connectionurl getconnectionurl cconnection stringbuffer stringbuffer stringbuffer getdbhost getdbport getdbname m_connectionurl tostring m_dbname getdbname m_connectionurl get connection url mainly used for connection test param db host db host param db port db port param db name db name optional param user name user name ignored return connection url public string get connectionurl string db host int db port string db name string user name string buffer sb null if jtds sb new string buffer jdbc jtds sybase else sb new string buffer jdbc sybase tds sb append db host append append db port if db name null db name length 0 m dbname db name sb append append db name return sb to string dbhost dbport dbname username getconnectionurl dbhost dbport dbname username stringbuffer stringbuffer stringbuffer dbhost dbport dbname dbname m_dbname dbname dbname tostring get jdbc catalog return catalog database name public string get catalog if m dbname null return m dbname log severe database name not set yet call get connectionurl first return null getcatalog m_dbname m_dbname getconnectionurl get jdbc schema return schema dbo public string get schema return dbo getschema supports blob return true public boolean supportsblob return true string representation return info public string to string string buffer sb new string buffer db sybase sb append m connectionurl sb append return sb to string tostring stringbuffer stringbuffer db_sybase m_connectionurl tostring get status return status info public string get status string buffer sb new string buffer status return sb to string getstatus stringbuffer stringbuffer tostring convert oracle style statement param ora statement oracle style statement return statement public string convert statement string ora statement string ret value m convert convert ora statement if ret value null throw new illegal argument exception not converted ora statement m convert get conversion error if ret value length 1 throw new illegal argument exception convert command number ret value length ora statement m convert get conversion error diagnostics show changed but not if ad error if ora statement equals ret value 0 ret value 0 index of ad error 1 log finest ret value 0 ora statement return ret value 0 orastatement convertstatement orastatement retvalue m_convert orastatement retvalue illegalargumentexception orastatement m_convert getconversionerror retvalue illegalargumentexception retvalue orastatement m_convert getconversionerror ad_error orastatement retvalue retvalue indexof ad_error retvalue orastatement retvalue get name of system user return e g sa system public string get system user return sa getsystemuser get name of system database param database name database name ignored return e g master or database name public string get system database string database name return master databasename getsystemdatabase databasename create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return date function public string to date timestamp time boolean day only if time null if day only return convert date getdate return getdate gregorian calendar cal new gregorian calendar cal set time time string buffer date string new string buffer convert datetime yyyy mm dd format 2 p 411 if day only int yyyy cal get calendar year string format 102 sql standard format if yyyy 100 format 2 date string append yyyy append append getxx cal get calendar month 1 append append getxx cal get calendar day of month append append format append mon dd yyy hh mi ss format 116 else int yyyy cal get calendar year string format 116 n a format if yyyy 100 format 16 date string append months cal get calendar month append append getxx cal get calendar day of month append append getxx cal get calendar year append append getxx cal get calendar hour of day append append getxx cal get calendar minute append append getxx cal get calendar second append append format append return date string to string dayonly to_date dayonly dayonly gregoriancalendar gregoriancalendar settime stringbuffer datestring stringbuffer dayonly datestring day_of_month datestring day_of_month hour_of_day datestring tostring get integer as two string digits leading zero param x integer return string of x private string getxx int x if x 10 return 0 x return string value of x valueof create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env public string to char string column name int display type string ad language return columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype to_char columnname displaytype ad_language return number as string for insert statements with correct precision param number number param display type display type return number as string public string to number big decimal number int display type if number null return null big decimal result number int scale display type get default precision display type if number scale scale try result number set scale scale big decimal round half up catch exception e log severe number number scale e get message return result to string displaytype to_number bigdecimal displaytype bigdecimal displaytype getdefaultprecision displaytype setscale bigdecimal round_half_up getmessage tostring get sql commands the following variables are resolved system password compiere user compiere password system password database name database device param cmd type cmd return array of commands to be executed public string get commands int cmd type if cmd create user cmd type return new string if cmd create database cmd type return new string create database database name on database device 200 sp configure enable java 1 if cmd drop database cmd type return new string drop database database name return null systempassword compiereuser compierepassword systempassword databasename databasedevice cmdtype cmd_ getcommands cmdtype cmd_create_user cmdtype cmd_create_database cmdtype databasename databasedevice sp_configure cmd_drop_database cmdtype databasename get cached connection param connection connection param auto commit auto commit param transaction isolation trx isolation return connection throws exception public connection get cached connection c connection connection boolean auto commit int transaction isolation throws exception if m ds null get data source connection connection conn m ds get connection connection conn get driver connection connection conn set auto commit auto commit conn set transaction isolation transaction isolation return conn autocommit transactionisolation getcachedconnection cconnection autocommit transactionisolation m_ds getdatasource m_ds getconnection getdriverconnection setautocommit autocommit settransactionisolation transactionisolation get driver connection param connection connection info return new connection throws sql exception public connection get driver connection c connection connection throws sql exception get driver return driver manager get connection get connectionurl connection connection get db uid connection get db pwd sqlexception getdriverconnection cconnection sqlexception getdriver drivermanager getconnection getconnectionurl getdbuid getdbpwd get driver connection param db url url param db uid user param db pwd password return connection throws sql exception public connection get driver connection string db url string db uid string db pwd throws sql exception get driver return driver manager get connection db url db uid db pwd dburl dbuid dbpwd sqlexception getdriverconnection dburl dbuid dbpwd sqlexception getdriver drivermanager getconnection dburl dbuid dbpwd get data source param connection connection return n a public data source get data source c connection connection if m ds null return m ds if jtds net sourceforge jtds jdbcx jtds data source ds new net sourceforge jtds jdbcx jtds data source ds set server type net sourceforge jtds jdbc driver sybase ds set tds 5 0 ds set server name connection get db host ds set port number connection get db port ds set database name connection get db name ds set user connection get db uid ds set password connection get db pwd m ds ds else com sybase jdbc3 jdbc syb data source ds new com sybase jdbc3 jdbc syb data source ds set server name connection get db host ds set port number connection get db port ds set database name connection get db name ds set data source name sybaseds ds set user connection get db uid ds set password connection get db pwd m ds ds m ds set login timeout 10 return m ds datasource getdatasource cconnection m_ds m_ds jtdsdatasource jtdsdatasource setservertype settds setservername getdbhost setportnumber getdbport setdatabasename getdbname setuser getdbuid setpassword getdbpwd m_ds sybdatasource sybdatasource setservername getdbhost setportnumber getdbport setdatabasename getdbname setdatasourcename setuser getdbuid setpassword getdbpwd m_ds m_ds setlogintimeout m_ds close public void close m ds null m_ds test param args ignored public static void main string args db sybase sybase new db sybase string database name adempiere string uid adempiere string pwd adempiere string jdbcurl sybase get connectionurl dev2 default port database name uid system out println jdbcurl try sybase get driver connection conn driver manager get connection jdbcurl uid pwd row set rs c cached row set get row set select from ad client conn conn close conn null catch exception ex ex print stack trace db_sybase db_sybase databasename getconnectionurl default_port databasename getdriver drivermanager getconnection rowset ccachedrowset getrowset ad_client printstacktrace constructor param type see m tree node type public wf icon int type if type 0 type m tree node images length m type type mtreenode type_ wficon mtreenode m_type constructor param action image indicator public wf icon string action if action null m type m tree node get image index action wficon m_type mtreenode getimageindex draw the icon at the specified location icon implementations may use the component argument to get properties useful for painting e g the foreground or background color param c component param g graphics param x x param y y see javax swing icon paint icon component graphics int int public void paint icon component c graphics g int x int y graphics2d g2d graphics2d g icon icon m tree node get icon m type if icon null int xi x width icon get icon width 2 int yi y height icon get icon height 2 icon paint icon c g xi yi else draw dot int size 10 int xi x width size 2 int yi y height size 2 g2d set color color magenta g2d fill oval xi yi size size painticon painticon mtreenode geticon m_type geticonwidth geticonheight painticon setcolor filloval returns the icon s width return an int specifying the fixed width of the icon see javax swing icon get icon width public int get icon width return width geticonwidth geticonwidth returns the icon s height return an int specifying the fixed height of the icon see javax swing icon get icon height public int get icon height return height geticonheight geticonheight standard constructor public x c jobcategory properties ctx int c jobcategory id string trx name super ctx c jobcategory id trx name if c jobcategory id 0 setc jobcategory id 0 set name null x_c_jobcategory c_jobcategory_id trxname c_jobcategory_id trxname c_jobcategory_id setc_jobcategory_id setname load constructor public x c jobcategory properties ctx result set rs string trx name super ctx rs trx name x_c_jobcategory resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c jobcategory append get id append return sb to string tostring stringbuffer stringbuffer x_c_jobcategory get_id tostring set position category job position category public void setc jobcategory id int c jobcategory id if c jobcategory id 1 throw new illegal argument exception c jobcategory id is mandatory set valuenocheck c jobcategory id new integer c jobcategory id setc_jobcategory_id c_jobcategory_id c_jobcategory_id illegalargumentexception c_jobcategory_id set_valuenocheck c_jobcategory_id c_jobcategory_id get position category job position category public int getc jobcategory id integer ii integer get value c jobcategory id if ii null return 0 return ii int value getc_jobcategory_id get_value c_jobcategory_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x a registration properties ctx int a registration id string trx name super ctx a registration id trx name if a registration id 0 seta registration id 0 set asset service date new timestamp system current time millis set is allow publish false set is in production false set is registered false set name null x_a_registration a_registration_id trxname a_registration_id trxname a_registration_id seta_registration_id setassetservicedate currenttimemillis setisallowpublish setisinproduction setisregistered setname load constructor public x a registration properties ctx result set rs string trx name super ctx rs trx name x_a_registration resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a registration append get id append return sb to string tostring stringbuffer stringbuffer x_a_registration get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set registration user asset registration public void seta registration id int a registration id if a registration id 1 throw new illegal argument exception a registration id is mandatory set valuenocheck a registration id new integer a registration id seta_registration_id a_registration_id a_registration_id illegalargumentexception a_registration_id set_valuenocheck a_registration_id a_registration_id get registration user asset registration public int geta registration id integer ii integer get value a registration id if ii null return 0 return ii int value geta_registration_id get_value a_registration_id intvalue set in service date date when asset was put into service public void set asset service date timestamp asset service date if asset service date null throw new illegal argument exception asset service date is mandatory set valuenocheck asset service date asset service date setassetservicedate assetservicedate assetservicedate illegalargumentexception assetservicedate set_valuenocheck assetservicedate assetservicedate get in service date date when asset was put into service public timestamp get asset service date return timestamp get value asset service date getassetservicedate get_value assetservicedate set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set allowed to be published you allow to publish the information not just statistical summary info public void set is allow publish boolean is allow publish set value is allow publish new boolean is allow publish setisallowpublish isallowpublish set_value isallowpublish isallowpublish get allowed to be published you allow to publish the information not just statistical summary info public boolean is allow publish object oo get value is allow publish if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallowpublish get_value isallowpublish booleanvalue set in production the system is in production public void set is in production boolean is in production set value is in production new boolean is in production setisinproduction isinproduction set_value isinproduction isinproduction get in production the system is in production public boolean is in production object oo get value is in production if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinproduction get_value isinproduction booleanvalue set registered the application is registered public void set is registered boolean is registered set value is registered new boolean is registered setisregistered isregistered set_value isregistered isregistered get registered the application is registered public boolean is registered object oo get value is registered if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isregistered get_value isregistered booleanvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set value remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_value remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set value remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_value remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host get m project type from cache param ctx context param c projecttype id id return m project type public static m project type get properties ctx int c projecttype id integer key new integer c projecttype id m project type ret value m project type s cache get key if ret value null return ret value ret value new m project type ctx c projecttype id null if ret value get id 0 s cache put key ret value return ret value mprojecttype c_projecttype_id mprojecttype mprojecttype c_projecttype_id c_projecttype_id mprojecttype retvalue mprojecttype s_cache retvalue retvalue retvalue mprojecttype c_projecttype_id retvalue get_id s_cache retvalue retvalue standrad constructor param ctx context param c projecttype id id param trx name trx public m project type properties ctx int c projecttype id string trx name super ctx c projecttype id trx name if c projecttype id 0 setc projecttype id 0 set name null c_projecttype_id trxname mprojecttype c_projecttype_id trxname c_projecttype_id trxname c_projecttype_id setc_projecttype_id setname load constructor param ctx context param rs result set param trx name trx public m project type properties ctx result set rs string trx name super ctx rs trx name trxname mprojecttype resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m project type append get id append append get name append return sb to string tostring stringbuffer stringbuffer mprojecttype get_id getname tostring get project type phases return array of phases public m project type phase get phases array list m project type phase list new array list m project type phase string sql select from c phase where c projecttype id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc projecttype id result set rs pstmt execute query while rs next list add new m project type phase get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project type phase ret value new m project type phase list size list to array ret value return ret value mprojecttypephase getphases arraylist mprojecttypephase arraylist mprojecttypephase c_phase c_projecttype_id seqno preparedstatement preparestatement get_trxname setint getc_projecttype_id resultset executequery mprojecttypephase getctx get_trxname sqlexception sqlexception mprojecttypephase retvalue mprojecttypephase toarray retvalue retvalue get sql to return single value for the performance indicator param restrictions array of goal restrictions param measure scope scope of this value oaram measure data type data type param report date optional report date return sql for performance indicator public string get sqlpi m goal restriction restrictions string measure scope string measure data type timestamp report date m role role string date column created string org column ad org id string bp column c bpartner id string p column null planned amt planned qty count string buffer sb new string buffer select coalesce sum planned amt coalesce sum planned qty count from c project where c projecttype id getc projecttype id and processed y date restriction if m measure measuredatatype qtyamountintime equals measure data type m goal measuredisplay total equals measure scope if report date null report date new timestamp system current time millis string date string db to date report date string trunc d if m goal measuredisplay year equals measure scope trunc y else if m goal measuredisplay quarter equals measure scope trunc q else if m goal measuredisplay month equals measure scope trunc mm else if m goal measuredisplay week equals measure scope trunc w else if m goal measuredisplay day equals measure display sb append and trunc append date column append append trunc append trunc append db to date report date append append trunc append date string sql m measure calc add restrictions sb to string false restrictions role c project org column bp column p column log fine sql return sql measurescope measuredatatype reportdate getsqlpi mgoalrestriction measurescope measuredatatype reportdate mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn plannedamt plannedqty stringbuffer stringbuffer plannedamt plannedqty c_project c_projecttype_id getc_projecttype_id mmeasure measuredatatype_qtyamountintime measuredatatype mgoal measuredisplay_total measurescope reportdate reportdate currenttimemillis datestring to_date reportdate mgoal measuredisplay_year measurescope mgoal measuredisplay_quarter measurescope mgoal measuredisplay_month measurescope mgoal measuredisplay_week measurescope mgoal measuredisplay_day measuredisplay datecolumn to_date reportdate mmeasurecalc addrestrictions tostring c_project orgcolumn bpcolumn pcolumn get sql to value for the bar chart param restrictions array of goal restrictions param measure display scope of this value param measure data type data type param start date optional report start date return sql for bar chart public string get sql bar chart m goal restriction restrictions string measure display string measure data type timestamp start date m role role string date column created string org column ad org id string bp column c bpartner id string p column null string buffer sb new string buffer select coalesce sum planned amt coalesce sum planned qty count string order by null string group by null if m measure measuredatatype qtyamountintime equals measure data type m goal measuredisplay total equals measure display string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display order by trunc date column trunc group by order by 0 sb append group by append from c project else order by p seq no group by coalesce p name to nchar p c phase id p seq no sb append group by append from c project left outer join c phase p on c project c phase id p c phase id where sb append where c project c projecttype id append getc projecttype id append and c project processed y date restriction if start date null m goal measuredisplay total equals measure display string date string db to date start date sb append and append date column append append date string date string sql m measure calc add restrictions sb to string false restrictions role c project org column bp column p column if group by null sql group by group by order by order by log fine sql return sql measuredisplay measuredatatype startdate getsqlbarchart mgoalrestriction measuredisplay measuredatatype startdate mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn stringbuffer stringbuffer plannedamt plannedqty orderby groupby mmeasure measuredatatype_qtyamountintime measuredatatype mgoal measuredisplay_total measuredisplay mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay orderby datecolumn groupby orderby groupby c_project orderby seqno groupby to_nchar c_phase_id seqno groupby c_project c_phase c_project c_phase_id c_phase_id c_project c_projecttype_id getc_projecttype_id c_project startdate mgoal measuredisplay_total measuredisplay datestring to_date startdate datecolumn datestring mmeasurecalc addrestrictions tostring c_project orgcolumn bpcolumn pcolumn groupby groupby orderby get zoom query return query public m query get query m goal restriction restrictions string measure display timestamp date int c phase id m role role string date column created string org column ad org id string bp column c bpartner id string p column null m query query new m query c project query add range restriction c projecttype id getc projecttype id string where null if c phase id 0 where c phase id c phase id else string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display trunc d where trunc date column trunc trunc db to date date trunc string sql m measure calc add restrictions where and processed y true restrictions role c project org column bp column p column query add restriction sql query set record count 1 return query mquery getquery mgoalrestriction measuredisplay c_phase_id mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn mquery mquery c_project addrangerestriction c_projecttype_id getc_projecttype_id c_phase_id c_phase_id c_phase_id mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay datecolumn to_date mmeasurecalc addrestrictions c_project orgcolumn bpcolumn pcolumn addrestriction setrecordcount standard constructor public x c doctypecounter properties ctx int c doctypecounter id string trx name super ctx c doctypecounter id trx name if c doctypecounter id 0 setc doctypecounter id 0 setc doctype id 0 setcounter c doctype id 0 set is create counter true y set is valid false set name null x_c_doctypecounter c_doctypecounter_id trxname c_doctypecounter_id trxname c_doctypecounter_id setc_doctypecounter_id setc_doctype_id setcounter_c_doctype_id setiscreatecounter setisvalid setname load constructor public x c doctypecounter properties ctx result set rs string trx name super ctx rs trx name x_c_doctypecounter resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c doctypecounter append get id append return sb to string tostring stringbuffer stringbuffer x_c_doctypecounter get_id tostring set counter document counter document relationship public void setc doctypecounter id int c doctypecounter id if c doctypecounter id 1 throw new illegal argument exception c doctypecounter id is mandatory set valuenocheck c doctypecounter id new integer c doctypecounter id setc_doctypecounter_id c_doctypecounter_id c_doctypecounter_id illegalargumentexception c_doctypecounter_id set_valuenocheck c_doctypecounter_id c_doctypecounter_id get counter document counter document relationship public int getc doctypecounter id integer ii integer get value c doctypecounter id if ii null return 0 return ii int value getc_doctypecounter_id get_value c_doctypecounter_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue public static final int counter c doctype id ad reference id 170 set counter document type generated counter document type to public void setcounter c doctype id int counter c doctype id if counter c doctype id 1 throw new illegal argument exception counter c doctype id is mandatory set value counter c doctype id new integer counter c doctype id counter_c_doctype_id_ad_reference_id setcounter_c_doctype_id counter_c_doctype_id counter_c_doctype_id illegalargumentexception counter_c_doctype_id set_value counter_c_doctype_id counter_c_doctype_id get counter document type generated counter document type to public int getcounter c doctype id integer ii integer get value counter c doctype id if ii null return 0 return ii int value getcounter_c_doctype_id get_value counter_c_doctype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action null doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action null doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction set create counter document create counter document public void set is create counter boolean is create counter set value is create counter new boolean is create counter setiscreatecounter iscreatecounter set_value iscreatecounter iscreatecounter get create counter document create counter document public boolean is create counter object oo get value is create counter if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatecounter get_value iscreatecounter booleanvalue set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public single part element singlepartelement standard constructor public x m distributionlistline properties ctx int m distributionlistline id string trx name super ctx m distributionlistline id trx name if m distributionlistline id 0 setc bpartner id 0 setc bpartner location id 0 setm distributionlistline id 0 setm distributionlist id 0 set min qty env zero x_m_distributionlistline m_distributionlistline_id trxname m_distributionlistline_id trxname m_distributionlistline_id setc_bpartner_id setc_bpartner_location_id setm_distributionlistline_id setm_distributionlist_id setminqty load constructor public x m distributionlistline properties ctx result set rs string trx name super ctx rs trx name x_m_distributionlistline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m distributionlistline append get id append return sb to string tostring stringbuffer stringbuffer x_m_distributionlistline get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set distribution list line distribution list line with business partner and quantity percentage public void setm distributionlistline id int m distributionlistline id if m distributionlistline id 1 throw new illegal argument exception m distributionlistline id is mandatory set valuenocheck m distributionlistline id new integer m distributionlistline id setm_distributionlistline_id m_distributionlistline_id m_distributionlistline_id illegalargumentexception m_distributionlistline_id set_valuenocheck m_distributionlistline_id m_distributionlistline_id get distribution list line distribution list line with business partner and quantity percentage public int getm distributionlistline id integer ii integer get value m distributionlistline id if ii null return 0 return ii int value getm_distributionlistline_id get_value m_distributionlistline_id intvalue set distribution list distribution lists allow to distribute products to a selected list of partners public void setm distributionlist id int m distributionlist id if m distributionlist id 1 throw new illegal argument exception m distributionlist id is mandatory set valuenocheck m distributionlist id new integer m distributionlist id setm_distributionlist_id m_distributionlist_id m_distributionlist_id illegalargumentexception m_distributionlist_id set_valuenocheck m_distributionlist_id m_distributionlist_id get distribution list distribution lists allow to distribute products to a selected list of partners public int getm distributionlist id integer ii integer get value m distributionlist id if ii null return 0 return ii int value getm_distributionlist_id get_value m_distributionlist_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm distributionlist id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_distributionlist_id set minimum quantity minimum quantity for the business partner public void set min qty big decimal min qty if min qty null throw new illegal argument exception min qty is mandatory set value min qty min qty setminqty bigdecimal minqty minqty illegalargumentexception minqty set_value minqty minqty get minimum quantity minimum quantity for the business partner public big decimal get min qty big decimal bd big decimal get value min qty if bd null return env zero return bd bigdecimal getminqty bigdecimal bigdecimal get_value minqty set ratio relative ratio for distributions public void set ratio big decimal ratio set value ratio ratio setratio bigdecimal set_value get ratio relative ratio for distributions public big decimal get ratio big decimal bd big decimal get value ratio if bd null return env zero return bd bigdecimal getratio bigdecimal bigdecimal get_value constructor param frame frame param modal modal param window no window no param value query value name or value if contains numbers param multi selection multiple selection param where clause where clause public info assignment frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no ra s resourceassigment id multi selection where clause log info value set title msg get msg env get ctx info assignment if init lookups return stat init init info value where clause int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no auto query if value null value length 0 execute query p loadedok true a env position center window frame this windowno windowno multiselection whereclause infoassignment windowno multiselection whereclause windowno s_resourceassigment_id multiselection whereclause settitle getmsg getctx infoassignment initlookups statinit initinfo whereclause p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring autoquery executequery p_loadedok aenv positioncenterwindow initialize lookups return true if ok private boolean init lookups try int ad column id 6851 s resource s resourcetype id lookup lookup m lookup factory get env get ctx p windowno 0 ad column id display type table dir field resource type new v lookup s resourcetype id false false true lookup ad column id 6826 s resourceassignment s resource id lookup m lookup factory get env get ctx p windowno 0 ad column id display type table dir field resource new v lookup s resource id false false true lookup catch exception e log log level severe info assignment init lookup return false b new set icon env get image icon new16 gif return true initlookups ad_column_id s_resource s_resourcetype_id mlookupfactory getctx p_windowno ad_column_id displaytype tabledir fieldresourcetype vlookup s_resourcetype_id ad_column_id s_resourceassignment s_resource_id mlookupfactory getctx p_windowno ad_column_id displaytype tabledir fieldresource vlookup s_resource_id infoassignment initlookup bnew seticon getimageicon static setup add fields to parameter panel pre resource type resource date time from date time to new pre private void stat init parameter panel set layout new a layout parameter panel add label resource type new a layout constraint 0 0 parameter panel add label resource null parameter panel add label from null parameter panel add label to null parameter panel add label phone null parameter panel add check fuzzy null parameter panel add field resource type new a layout constraint 1 0 parameter panel add field resource null parameter panel add field from null parameter panel add field to null parameter panel add b new null parameter panel add check customer null parameterpanel resourcetype datetimefrom datetimeto statinit parameterpanel setlayout alayout parameterpanel labelresourcetype alayoutconstraint parameterpanel labelresource parameterpanel labelfrom parameterpanel labelto parameterpanel labelphone parameterpanel checkfuzzy parameterpanel fieldresourcetype alayoutconstraint parameterpanel fieldresource parameterpanel fieldfrom parameterpanel fieldto parameterpanel bnew parameterpanel checkcustomer dynamic init param value value param where clause where clause private void init info string value string where clause c bpartner bp ad user c c bpartner location l c location a create grid string buffer where new string buffer s assignmentwhere if where clause null where clause length 0 where append and append where clause prepare table s assignmentlayout s assignmentfrom where to string rt name r name ra assign date from whereclause initinfo whereclause c_bpartner ad_user c_bpartner_location c_location stringbuffer stringbuffer s_assignmentwhere whereclause whereclause whereclause preparetable s_assignmentlayout s_assignmentfrom tostring assigndatefrom action listner param e event public void action performed action event e don t requery if field value and field name are empty return super action performed e actionperformed actionevent fieldvalue fieldname actionperformed get dynamic where part of sql to be overwritten by concrete classes return where clause string getsql where string buffer sql new string buffer integer s resourcetype id integer field resource type get value if s resourcetype id null sql append and rt s resourcetype id append s resourcetype id int value integer s resource id integer field resource get value if s resource id null sql append and r s resource id append s resource id int value timestamp ts field from get timestamp if ts null sql append and trunc ra assign date from append db to date ts false ts field to get timestamp if ts null sql append and trunc ra assign date to append db to date ts false return sql to string getsqlwhere stringbuffer stringbuffer s_resourcetype_id fieldresourcetype getvalue s_resourcetype_id s_resourcetype_id s_resourcetype_id intvalue s_resource_id fieldresource getvalue s_resource_id s_resource_id s_resource_id intvalue fieldfrom gettimestamp assigndatefrom to_date fieldto gettimestamp assigndateto to_date tostring set parameters for query to be overwritten by concrete classes param pstmt pstmt param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception forcount sqlexception setparameters preparedstatement forcount sqlexception history dialog to be overwritten by concrete classes void show history showhistory has history false to be overwritten by concrete classes return true if it has history default false boolean has history return false hashistory customize dialog to be overwritten by concrete classes void customize has customize false to be overwritten by concrete classes return true if it has customize default false boolean has customize return false hascustomize zoom action to be overwritten by concrete classes void zoom has zoom false to be overwritten by concrete classes return true if it has zoom default false boolean has zoom return false haszoom save selection details to be overwritten by concrete classes void save selection detail saveselectiondetail standard constructor public x i inoutlineconfirm properties ctx int i inoutlineconfirm id string trx name super ctx i inoutlineconfirm id trx name if i inoutlineconfirm id 0 set confirmation no null set confirmed qty env zero set difference qty env zero seti inoutlineconfirm id 0 seti isimported false setm inoutlineconfirm id 0 set scrapped qty env zero x_i_inoutlineconfirm i_inoutlineconfirm_id trxname i_inoutlineconfirm_id trxname i_inoutlineconfirm_id setconfirmationno setconfirmedqty setdifferenceqty seti_inoutlineconfirm_id seti_isimported setm_inoutlineconfirm_id setscrappedqty load constructor public x i inoutlineconfirm properties ctx result set rs string trx name super ctx rs trx name x_i_inoutlineconfirm resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i inoutlineconfirm append get id append return sb to string tostring stringbuffer stringbuffer x_i_inoutlineconfirm get_id tostring set confirmation no confirmation number public void set confirmation no string confirmation no if confirmation no null throw new illegal argument exception confirmation no is mandatory if confirmation no length 20 log warning length 20 truncated confirmation no confirmation no substring 0 19 set value confirmation no confirmation no setconfirmationno confirmationno confirmationno illegalargumentexception confirmationno confirmationno confirmationno confirmationno set_value confirmationno confirmationno get confirmation no confirmation number public string get confirmation no return string get value confirmation no getconfirmationno get_value confirmationno set confirmed quantity confirmation of a received quantity public void set confirmed qty big decimal confirmed qty if confirmed qty null throw new illegal argument exception confirmed qty is mandatory set value confirmed qty confirmed qty setconfirmedqty bigdecimal confirmedqty confirmedqty illegalargumentexception confirmedqty set_value confirmedqty confirmedqty get confirmed quantity confirmation of a received quantity public big decimal get confirmed qty big decimal bd big decimal get value confirmed qty if bd null return env zero return bd bigdecimal getconfirmedqty bigdecimal bigdecimal get_value confirmedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set difference difference quantity public void set difference qty big decimal difference qty if difference qty null throw new illegal argument exception difference qty is mandatory set value difference qty difference qty setdifferenceqty bigdecimal differenceqty differenceqty illegalargumentexception differenceqty set_value differenceqty differenceqty get difference difference quantity public big decimal get difference qty big decimal bd big decimal get value difference qty if bd null return env zero return bd bigdecimal getdifferenceqty bigdecimal bigdecimal get_value differenceqty set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set ship receipt confirmation import line material shipment or receipt confirmation import line public void seti inoutlineconfirm id int i inoutlineconfirm id if i inoutlineconfirm id 1 throw new illegal argument exception i inoutlineconfirm id is mandatory set valuenocheck i inoutlineconfirm id new integer i inoutlineconfirm id seti_inoutlineconfirm_id i_inoutlineconfirm_id i_inoutlineconfirm_id illegalargumentexception i_inoutlineconfirm_id set_valuenocheck i_inoutlineconfirm_id i_inoutlineconfirm_id get ship receipt confirmation import line material shipment or receipt confirmation import line public int geti inoutlineconfirm id integer ii integer get value i inoutlineconfirm id if ii null return 0 return ii int value geti_inoutlineconfirm_id get_value i_inoutlineconfirm_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geti inoutlineconfirm id intvalue keynamepair getkeynamepair keynamepair get_id valueof geti_inoutlineconfirm_id set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set ship receipt confirmation line material shipment or receipt confirmation line public void setm inoutlineconfirm id int m inoutlineconfirm id if m inoutlineconfirm id 1 throw new illegal argument exception m inoutlineconfirm id is mandatory set value m inoutlineconfirm id new integer m inoutlineconfirm id setm_inoutlineconfirm_id m_inoutlineconfirm_id m_inoutlineconfirm_id illegalargumentexception m_inoutlineconfirm_id set_value m_inoutlineconfirm_id m_inoutlineconfirm_id get ship receipt confirmation line material shipment or receipt confirmation line public int getm inoutlineconfirm id integer ii integer get value m inoutlineconfirm id if ii null return 0 return ii int value getm_inoutlineconfirm_id get_value m_inoutlineconfirm_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set scrapped quantity the quantity scrapped due to qa issues public void set scrapped qty big decimal scrapped qty if scrapped qty null throw new illegal argument exception scrapped qty is mandatory set value scrapped qty scrapped qty setscrappedqty bigdecimal scrappedqty scrappedqty illegalargumentexception scrappedqty set_value scrappedqty scrappedqty get scrapped quantity the quantity scrapped due to qa issues public big decimal get scrapped qty big decimal bd big decimal get value scrapped qty if bd null return env zero return bd bigdecimal getscrappedqty bigdecimal bigdecimal get_value scrappedqty save translation for po param po persistent object param new record new return true if no active language or translation saved reset public static boolean save po po boolean new record if translation table is active languages false return true translation table table translation table get po get tablename if new record return table create translation po return table reset translation flag po newrecord newrecord translationtable isactivelanguages translationtable translationtable get_tablename newrecord createtranslation resettranslationflag delete translation for po param po persistent object return true if no active language or translation deleted public static boolean delete po po if translation table is active languages false return true translation table table translation table get po get tablename return table delete translation po translationtable isactivelanguages translationtable translationtable get_tablename deletetranslation get number of active translation languages param requery requery return number of active translations public static int get active languages boolean requery if s activelanguages null requery return s activelanguages int value int no db getsql value null select count from ad language where is active y and is system language y s activelanguages new integer no return s activelanguages int value getactivelanguages s_activelanguages s_activelanguages intvalue getsqlvalue ad_language isactive issystemlanguage s_activelanguages s_activelanguages intvalue are there active translation languages param requery requery return true active translations public static boolean is active languages boolean requery int no get active languages requery return no 0 isactivelanguages getactivelanguages get translation table from cache param base table name base table name return translation table public static translation table get string base table name translation table ret value translation table s cache get base table name if ret value null return ret value ret value new translation table base table name s cache put base table name ret value return ret value translationtable basetablename translationtable translationtable basetablename translationtable retvalue translationtable s_cache basetablename retvalue retvalue retvalue translationtable basetablename s_cache basetablename retvalue retvalue translation table param base table name base table name protected translation table string base table name if base table name null throw new illegal argument exception base table name is null m basetablename base table name m trltablename base table name trl init columns log fine to string basetablename translationtable basetablename basetablename illegalargumentexception m_basetablename basetablename m_trltablename basetablename _trl initcolumns tostring add translation columns private void init columns m table table m table get env get ctx m trltablename if table null throw new illegal argument exception table not found m trltablename m column columns table get columns false for int i 0 i columns length i m column column columns i if column is standard column continue string column name column get column name if column name ends with id column name starts with ad language column name equals is translated continue m columns add column name if m columns size 0 throw new illegal argument exception no columns found m trltablename initcolumns m_table m_table getctx m_trltablename illegalargumentexception m_trltablename m_column getcolumns m_column isstandardcolumn columnname getcolumnname columnname endswith _id columnname startswith ad_language columnname istranslated m_columns columnname m_columns illegalargumentexception m_trltablename create translation record from po param po base table record return true if inserted or no translation public boolean create translation po po if is active languages false return true if po get id 0 throw new illegal argument exception po id is 0 string buffer sql1 new string buffer sql1 append insert into append m trltablename append string buffer sql2 new string buffer sql2 append select key columns sql1 append m basetablename append id ad language sql2 append b append m basetablename append id l ad language base columns sql1 append ad client id ad org id is active created created by updated updated by is translated sql2 append b ad client id b ad org id b is active b created b created by b updated b updated by n for int i 0 i m columns size i string column name string m columns get i object value po get value column name if value null continue sql1 append append column name sql2 append b append column name string buffer sql new string buffer sql append sql1 append sql2 append from ad language l m basetablename b where l is active y and l is system language y and b m basetablename id append po get id int no db execute update sql to string po get trxname log fine m trltablename id po get id no return no 0 createtranslation isactivelanguages get_id illegalargumentexception stringbuffer stringbuffer m_trltablename stringbuffer stringbuffer m_basetablename _id ad_language m_basetablename _id ad_language ad_client_id ad_org_id isactive createdby updatedby istranslated ad_client_id ad_org_id isactive createdby updatedby m_columns columnname m_columns get_value columnname columnname columnname stringbuffer stringbuffer ad_language m_basetablename isactive issystemlanguage m_basetablename _id get_id executeupdate tostring get_trxname m_trltablename get_id reset translation flag param po po return true if updated or no translations public boolean reset translation flag po po if is active languages false return true if po get id 0 throw new illegal argument exception po id is 0 string buffer sb new string buffer update sb append m trltablename append set is translated n updated sys date where append m basetablename append id append po get id int no db execute update sb to string po get trxname log fine m trltablename id po get id no return no 0 resettranslationflag isactivelanguages get_id illegalargumentexception stringbuffer stringbuffer m_trltablename istranslated sysdate m_basetablename _id get_id executeupdate tostring get_trxname m_trltablename get_id delete translation param po po return true if udeleted or no translations public boolean delete translation po po if is active languages false return true if po get idold 0 throw new illegal argument exception po old id is 0 string buffer sb new string buffer delete sb append m trltablename append where append m basetablename append id append po get idold int no db execute update sb to string po get trxname log fine m trltablename id po get idold no return no 0 deletetranslation isactivelanguages get_idold illegalargumentexception stringbuffer stringbuffer m_trltablename m_basetablename _id get_idold executeupdate tostring get_trxname m_trltablename get_idold string representation return info public string to string string buffer sb new string buffer translation table sb append m trltablename append append m basetablename append for int i 0 i m columns size i sb append append m columns get i sb append return sb to string tostring stringbuffer stringbuffer translationtable m_trltablename m_basetablename m_columns m_columns tostring standard constructor public x m cost properties ctx int m cost id string trx name super ctx m cost id trx name if m cost id 0 setc acctschema id 0 set current cost price env zero set current qty env zero set future cost price env zero setm attributesetinstance id 0 setm costelement id 0 setm costtype id 0 setm product id 0 x_m_cost m_cost_id trxname m_cost_id trxname m_cost_id setc_acctschema_id setcurrentcostprice setcurrentqty setfuturecostprice setm_attributesetinstance_id setm_costelement_id setm_costtype_id setm_product_id load constructor public x m cost properties ctx result set rs string trx name super ctx rs trx name x_m_cost resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m cost append get id append return sb to string tostring stringbuffer stringbuffer x_m_cost get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue public static final string costingmethod x set costing method indicates how costs will be calculated public void set costing method string costing method if costing method null throw new illegal argument exception costing method is mandatory if costing method null costing method equals a costing method equals f costing method equals i costing method equals l costing method equals s costing method equals u costing method equals i costing method equals p costing method equals x else throw new illegal argument exception costing method invalid value costing method reference id 122 a f i l s u i p x throw new illegal argument exception costing method is virtual column costingmethod__ setcostingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod reference_id illegalargumentexception costingmethod get costing method indicates how costs will be calculated public string get costing method return string get value costing method getcostingmethod get_value costingmethod set accumulated amt total amount public void set cumulated amt big decimal cumulated amt set valuenocheck cumulated amt cumulated amt setcumulatedamt bigdecimal cumulatedamt set_valuenocheck cumulatedamt cumulatedamt get accumulated amt total amount public big decimal get cumulated amt big decimal bd big decimal get value cumulated amt if bd null return env zero return bd bigdecimal getcumulatedamt bigdecimal bigdecimal get_value cumulatedamt set accumulated qty total quantity public void set cumulated qty big decimal cumulated qty set valuenocheck cumulated qty cumulated qty setcumulatedqty bigdecimal cumulatedqty set_valuenocheck cumulatedqty cumulatedqty get accumulated qty total quantity public big decimal get cumulated qty big decimal bd big decimal get value cumulated qty if bd null return env zero return bd bigdecimal getcumulatedqty bigdecimal bigdecimal get_value cumulatedqty set current cost price the currently used cost price public void set current cost price big decimal current cost price if current cost price null throw new illegal argument exception current cost price is mandatory set value current cost price current cost price setcurrentcostprice bigdecimal currentcostprice currentcostprice illegalargumentexception currentcostprice set_value currentcostprice currentcostprice get current cost price the currently used cost price public big decimal get current cost price big decimal bd big decimal get value current cost price if bd null return env zero return bd bigdecimal getcurrentcostprice bigdecimal bigdecimal get_value currentcostprice set current quantity current quantity public void set current qty big decimal current qty if current qty null throw new illegal argument exception current qty is mandatory set value current qty current qty setcurrentqty bigdecimal currentqty currentqty illegalargumentexception currentqty set_value currentqty currentqty get current quantity current quantity public big decimal get current qty big decimal bd big decimal get value current qty if bd null return env zero return bd bigdecimal getcurrentqty bigdecimal bigdecimal get_value currentqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set future cost price public void set future cost price big decimal future cost price if future cost price null throw new illegal argument exception future cost price is mandatory set value future cost price future cost price setfuturecostprice bigdecimal futurecostprice futurecostprice illegalargumentexception futurecostprice set_value futurecostprice futurecostprice get future cost price public big decimal get future cost price big decimal bd big decimal get value future cost price if bd null return env zero return bd bigdecimal getfuturecostprice bigdecimal bigdecimal get_value futurecostprice set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 1 throw new illegal argument exception m costelement id is mandatory set valuenocheck m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id illegalargumentexception m_costelement_id set_valuenocheck m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set cost type type of cost e g current plan future public void setm costtype id int m costtype id if m costtype id 1 throw new illegal argument exception m costtype id is mandatory set valuenocheck m costtype id new integer m costtype id setm_costtype_id m_costtype_id m_costtype_id illegalargumentexception m_costtype_id set_valuenocheck m_costtype_id m_costtype_id get cost type type of cost e g current plan future public int getm costtype id integer ii integer get value m costtype id if ii null return 0 return ii int value getm_costtype_id get_value m_costtype_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set percent percentage public void set percent int percent set value percent new integer percent setpercent set_value get percent percentage public int get percent integer ii integer get value percent if ii null return 0 return ii int value getpercent get_value intvalue set processed the document has been processed public void set processed boolean processed throw new illegal argument exception processed is virtual column setprocessed illegalargumentexception get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue get workflow from cache param ctx context param ad workflow id id return workflow public static m workflow get properties ctx int ad workflow id integer key new integer ad workflow id m workflow ret value m workflow s cache get key if ret value null return ret value ret value new m workflow ctx ad workflow id null if ret value get id 0 s cache put key ret value return ret value ad_workflow_id mworkflow ad_workflow_id ad_workflow_id mworkflow retvalue mworkflow s_cache retvalue retvalue retvalue mworkflow ad_workflow_id retvalue get_id s_cache retvalue retvalue get doc value workflow param ctx context param ad client id client param ad table id table return document value workflow array or null public static m workflow get doc value properties ctx int ad client id int ad table id string trx name bug 1568766 trx should be kept all along the road string key c ad client id t ad table id reload if s cachedocvalue is reset string sql select from ad workflow where workflow type v and is active y and is valid y order by ad client id ad table id array list m workflow list new array list m workflow string old key string new key null prepared statement pstmt null try pstmt db prepare statement sql trx name bug 1568766 result set rs pstmt execute query while rs next m workflow wf new m workflow ctx rs null new key c wf getad client id t wf getad table id if new key equals old key list size 0 m workflow wfs new m workflow list size list to array wfs s cachedocvalue put old key wfs list new array list m workflow old key new key list add wf rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null last one if list size 0 m workflow wfs new m workflow list size list to array wfs s cachedocvalue put old key wfs s log config s cachedocvalue size look for entry m workflow ret value m workflow s cachedocvalue get key return ret value ad_client_id ad_table_id mworkflow getdocvalue ad_client_id ad_table_id trxname ad_client_id ad_table_id s_cachedocvalue isreset ad_workflow workflowtype isactive isvalid ad_client_id ad_table_id arraylist mworkflow arraylist mworkflow oldkey newkey preparedstatement preparestatement trxname resultset executequery mworkflow mworkflow newkey getad_client_id getad_table_id newkey oldkey mworkflow mworkflow toarray s_cachedocvalue oldkey arraylist mworkflow oldkey newkey s_log mworkflow mworkflow toarray s_cachedocvalue oldkey s_log s_cachedocvalue mworkflow retvalue mworkflow s_cachedocvalue retvalue create load workflow param ctx context param ad workflow id id public m workflow properties ctx int ad workflow id string trx name super ctx ad workflow id trx name if ad workflow id 0 setad workflow id 0 set value null set name null set access level accesslevel organization set author com piere inc set duration unit durationunit day set duration 1 set entity type entitytype usermaintained u set is default false set publish status publishstatus underrevision u set version 0 set cost 0 set waiting time 0 set working time 0 load trl load nodes ad_workflow_id mworkflow ad_workflow_id trxname ad_workflow_id trxname ad_workflow_id setad_workflow_id setvalue setname setaccesslevel accesslevel_organization setauthor compiere setdurationunit durationunit_day setduration setentitytype entitytype_usermaintained setisdefault setpublishstatus publishstatus_underrevision setversion setcost setwaitingtime setworkingtime loadtrl loadnodes load constructor param ctx context param rs result set public m workflow properties ctx result set rs string trx name super ctx rs trx name load trl load nodes mworkflow resultset trxname trxname loadtrl loadnodes load translation private void load trl if env is base language get ctx ad workflow get id 0 return string sql select name description help from ad workflow trl where ad workflow id and ad language try prepared statement pstmt db prepare statement sql null pstmt set int 1 get id pstmt set string 2 env getad language get ctx result set rs pstmt execute query if rs next m name trl rs get string 1 m description trl rs get string 2 m help trl rs get string 3 m translated true rs close pstmt close catch sql exception e log log level severe sql e log fine translated m translated loadtrl isbaselanguage getctx ad_workflow get_id ad_workflow_trl ad_workflow_id ad_language preparedstatement preparestatement setint get_id setstring getad_language getctx resultset executequery m_name_trl getstring m_description_trl getstring m_help_trl getstring m_translated sqlexception m_translated load all nodes private void load nodes string sql select from ad wf node where ad workflow id and is active y try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 get id result set rs pstmt execute query while rs next m nodes add new mwf node get ctx rs get trxname rs close pstmt close catch sql exception e log log level severe sql e log fine m nodes size loadnodes ad_wf_node ad_workflow_id isactive preparedstatement preparestatement get_trxname setint get_id resultset executequery m_nodes mwfnode getctx get_trxname sqlexception m_nodes get number of nodes return number of nodes public int get node count return m nodes size getnodecount m_nodes get the nodes param ordered ordered array param ad client id for client return array of nodes public mwf node get nodes boolean ordered int ad client id if ordered return get nodes in order ad client id array list mwf node list new array list mwf node for int i 0 i m nodes size i mwf node node m nodes get i if node getad client id 0 node getad client id ad client id list add node mwf node ret value new mwf node list size list to array ret value return ret value ad_client_id mwfnode getnodes ad_client_id getnodesinorder ad_client_id arraylist mwfnode arraylist mwfnode m_nodes mwfnode m_nodes getad_client_id getad_client_id ad_client_id mwfnode retvalue mwfnode toarray retvalue retvalue get the first node return array of next nodes public mwf node get first node return get node getad wf node id mwfnode getfirstnode getnode getad_wf_node_id get node with id in workflow param ad wf node id id return node or null protected mwf node get node int ad wf node id for int i 0 i m nodes size i mwf node node mwf node m nodes get i if node getad wf node id ad wf node id return node return null ad_wf_node_id mwfnode getnode ad_wf_node_id m_nodes mwfnode mwfnode m_nodes getad_wf_node_id ad_wf_node_id get the next nodes param ad wf node id id param ad client id for client return array of next nodes or null public mwf node get next nodes int ad wf node id int ad client id mwf node node get node ad wf node id if node null node get next node count 0 return null mwf node next nexts node get transitions ad client id array list mwf node list new array list mwf node for int i 0 i nexts length i mwf node next get node nexts i getad wf next id if next null list add next return nodes mwf node ret value new mwf node list size list to array ret value return ret value ad_wf_node_id ad_client_id mwfnode getnextnodes ad_wf_node_id ad_client_id mwfnode getnode ad_wf_node_id getnextnodecount mwfnodenext gettransitions ad_client_id arraylist mwfnode arraylist mwfnode mwfnode getnode getad_wf_next_id mwfnode retvalue mwfnode toarray retvalue retvalue get the nodes in sequence order param ad client id client return nodes in sequence private mwf node get nodes in order int ad client id array list mwf node list new array list mwf node add nodessf list getad wf node id ad client id start with first remaining nodes if m nodes size list size add stand alone for int n 0 n m nodes size n mwf node node mwf node m nodes get n if node getad client id 0 node getad client id ad client id boolean found false for int i 0 i list size i mwf node existing mwf node list get i if existing getad wf node id node getad wf node id found true break if found log log level warning added node w o transition node list add node mwf node node array new mwf node list size list to array node array return node array ad_client_id mwfnode getnodesinorder ad_client_id arraylist mwfnode arraylist mwfnode addnodessf getad_wf_node_id ad_client_id m_nodes m_nodes mwfnode mwfnode m_nodes getad_client_id getad_client_id ad_client_id mwfnode mwfnode getad_wf_node_id getad_wf_node_id mwfnode nodearray mwfnode toarray nodearray nodearray add nodes recursively depth first to ordered list param list list to add to param ad wf node id start node id param ad client id for client private void add nodesdf array list mwf node list int ad wf node id int ad client id mwf node node get node ad wf node id if node null list contains node list add node get dependent mwf node next nexts node get transitions ad client id for int i 0 i nexts length i add nodesdf list nexts i getad wf next id ad client id ad_wf_node_id ad_client_id addnodesdf arraylist mwfnode ad_wf_node_id ad_client_id mwfnode getnode ad_wf_node_id mwfnodenext gettransitions ad_client_id addnodesdf getad_wf_next_id ad_client_id add nodes recursively sibling first to ordered list param list list to add to param ad wf node id start node id param ad client id for client private void add nodessf array list mwf node list int ad wf node id int ad client id mwf node node get node ad wf node id if node null node getad client id 0 node getad client id ad client id if list contains node list add node mwf node next nexts node get transitions ad client id for int i 0 i nexts length i mwf node child get node nexts i getad wf next id if child getad client id 0 child getad client id ad client id if list contains child list add child for int i 0 i nexts length i add nodessf list nexts i getad wf next id ad client id ad_wf_node_id ad_client_id addnodessf arraylist mwfnode ad_wf_node_id ad_client_id mwfnode getnode ad_wf_node_id getad_client_id getad_client_id ad_client_id mwfnodenext gettransitions ad_client_id mwfnode getnode getad_wf_next_id getad_client_id getad_client_id ad_client_id addnodessf getad_wf_next_id ad_client_id get first transition next node of id param ad wf node id id param ad client id for client return next ad wf node id or 0 public int get next int ad wf node id int ad client id mwf node nodes get nodes in order ad client id for int i 0 i nodes length i if nodes i getad wf node id ad wf node id mwf node next nexts nodes i get transitions ad client id if nexts length 0 return nexts 0 getad wf next id return 0 return 0 ad_wf_node_id ad_client_id ad_wf_node_id getnext ad_wf_node_id ad_client_id mwfnode getnodesinorder ad_client_id getad_wf_node_id ad_wf_node_id mwfnodenext gettransitions ad_client_id getad_wf_next_id get transitions node next of id param ad wf node id id param ad client id for client return array of next nodes public mwf node next get node nexts int ad wf node id int ad client id mwf node nodes get nodes in order ad client id for int i 0 i nodes length i if nodes i getad wf node id ad wf node id return nodes i get transitions ad client id return null nodenext ad_wf_node_id ad_client_id mwfnodenext getnodenexts ad_wf_node_id ad_client_id mwfnode getnodesinorder ad_client_id getad_wf_node_id ad_wf_node_id gettransitions ad_client_id get first previous node of id param ad wf node id id param ad client id for client return next ad wf node id or 0 public int get previous int ad wf node id int ad client id mwf node nodes get nodes in order ad client id for int i 0 i nodes length i if nodes i getad wf node id ad wf node id if i 0 return nodes i 1 getad wf node id return 0 return 0 ad_wf_node_id ad_client_id ad_wf_node_id getprevious ad_wf_node_id ad_client_id mwfnode getnodesinorder ad_client_id getad_wf_node_id ad_wf_node_id getad_wf_node_id get very last node param ad wf node id ignored param ad client id for client return next ad wf node id or 0 public int get last int ad wf node id int ad client id mwf node nodes get nodes in order ad client id if nodes length 0 return nodes nodes length 1 getad wf node id return 0 ad_wf_node_id ad_client_id ad_wf_node_id getlast ad_wf_node_id ad_client_id mwfnode getnodesinorder ad_client_id getad_wf_node_id is this the first node param ad wf node id id param ad client id for client return true if first node public boolean is first int ad wf node id int ad client id return ad wf node id getad wf node id ad_wf_node_id ad_client_id isfirst ad_wf_node_id ad_client_id ad_wf_node_id getad_wf_node_id is this the last node param ad wf node id id param ad client id for client return true if last node public boolean is last int ad wf node id int ad client id mwf node nodes get nodes in order ad client id return ad wf node id nodes nodes length 1 getad wf node id ad_wf_node_id ad_client_id islast ad_wf_node_id ad_client_id mwfnode getnodesinorder ad_client_id ad_wf_node_id getad_wf_node_id get name param translated translated return name public string get name boolean translated if translated m translated return m name trl return get name getname m_translated m_name_trl getname get description param translated translated return description public string get description boolean translated if translated m translated return m description trl return get description getdescription m_translated m_description_trl getdescription get help param translated translated return name public string get help boolean translated if translated m translated return m help trl return get help gethelp m_translated m_help_trl gethelp string representation return info public string to string string buffer sb new string buffer m workflow sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mworkflow get_id getname tostring before save param new record new return true protected boolean before save boolean new record validate return true newrecord beforesave newrecord after save param new record new record param success success return true if save complete if not overwritten true protected boolean after save boolean new record boolean success log fine success success if success new record save all nodes creating new workflow mwf node nodes get nodes in order 0 for int i 0 i nodes length i nodes i save get trxname if new record int ad role id env getad role id get ctx m workflow access wa new m workflow access this ad role id wa save menu workflow else if is valuechanged is active is valuechanged name is valuechanged description is valuechanged help m menu menues m menu get get ctx ad workflow id getad workflow id for int i 0 i menues length i menues i set is active is active menues i set name get name menues i set description get description menues i save x ad wf node nodes m window getwf nodes get ctx ad workflow id getad workflow id for int i 0 i nodes length i boolean changed false if nodes i is active is active nodes i set is active is active changed true if nodes i is centrally maintained nodes i set name get name nodes i set description get description nodes i set help get help changed true if changed nodes i save return success newrecord aftersave newrecord newrecord mwfnode getnodesinorder get_trxname newrecord ad_role_id getad_role_id getctx mworkflowaccess mworkflowaccess ad_role_id is_valuechanged isactive is_valuechanged is_valuechanged is_valuechanged mmenu mmenu getctx ad_workflow_id getad_workflow_id setisactive isactive setname getname setdescription getdescription x_ad_wf_node m_window getwfnodes getctx ad_workflow_id getad_workflow_id isactive isactive setisactive isactive iscentrallymaintained setname getname setdescription getdescription sethelp gethelp start workflow param pi process info record id return process public mwf process start process info pi mwf process ret value null try ret value new mwf process this pi ret value save ret value start work catch exception e log log level severe e get localized message e pi set summary e get message true ret value null return ret value record_id mwfprocess processinfo mwfprocess retvalue retvalue mwfprocess retvalue retvalue startwork getlocalizedmessage setsummary getmessage retvalue retvalue start workflow and wait for completion param pi process info with record id record for the workflow return process public mwf process start wait process info pi final int sleep 500 1 2 sec final int maxloops 30 15 sec mwf process process start pi if process null return null thread yield state engine state process get state int loops 0 while state is closed state is suspended if loops maxloops log warning timeout after sec sleep maxloops 1000 pi set summary started still running requery later return process system out println loops state try thread sleep sleep loops catch interrupted exception e log log level severe start wait interrupted e pi set summary interrupted return process thread yield state process get state string summary process get process msg if summary null summary trim length 0 summary state to string pi set summary summary state is terminated state is aborted log fine summary return process record_id mwfprocess startwait processinfo mwfprocess stateengine getstate isclosed issuspended setsummary interruptedexception startwait setsummary getstate getprocessmsg tostring setsummary isterminated isaborted get duration base in seconds return duration unit in seconds public long get duration base sec if get duration unit null return 0 else if durationunit second equals get duration unit return 1 else if durationunit minute equals get duration unit return 60 else if durationunit hour equals get duration unit return 3600 else if durationunit day equals get duration unit return 86400 else if durationunit month equals get duration unit return 2592000 else if durationunit year equals get duration unit return 31536000 return 0 getdurationbasesec getdurationunit durationunit_second getdurationunit durationunit_minute getdurationunit durationunit_hour getdurationunit durationunit_day getdurationunit durationunit_month getdurationunit durationunit_year getdurationunit get duration calendar field return calendar minute etc public int get duration calendar field if get duration unit null return calendar minute else if durationunit second equals get duration unit return calendar second else if durationunit minute equals get duration unit return calendar minute else if durationunit hour equals get duration unit return calendar hour else if durationunit day equals get duration unit return calendar day of year else if durationunit month equals get duration unit return calendar month else if durationunit year equals get duration unit return calendar year return calendar minute calendarfield getdurationcalendarfield getdurationunit durationunit_second getdurationunit durationunit_minute getdurationunit durationunit_hour getdurationunit durationunit_day getdurationunit day_of_year durationunit_month getdurationunit durationunit_year getdurationunit validate workflow sets valid flag return errors or public string validate string buffer errors new string buffer if getad wf node id 0 errors append no start node if workflowtype documentvalue equals get workflow type get doc value logic null get doc value logic length 0 errors append no document value logic final boolean valid errors length 0 set is valid valid if valid log info validate errors return errors to string stringbuffer stringbuffer getad_wf_node_id workflowtype_documentvalue getworkflowtype getdocvaluelogic getdocvaluelogic setisvalid tostring main param args public static void main string args org compiere compiere startup true create standard document process m workflow wf new m workflow env get ctx 0 null wf set value process xx wf set name wf get value wf set description standard wf get value wf set entity type entitytype dictionary wf save mwf node node10 new mwf node wf 10 start node10 set description standard node node10 set entity type entitytype dictionary node10 set action mwf node action waitsleep node10 set wait time 0 node10 set position 5 5 node10 save wf setad wf node id node10 getad wf node id wf save mwf node node20 new mwf node wf 20 doc auto node20 set description standard node node20 set entity type entitytype dictionary node20 set action mwf node action documentaction node20 set doc action mwf node docaction none node20 set position 5 120 node20 save mwf node next tr10 20 new mwf node next node10 node20 getad wf node id tr10 20 set entity type entitytype dictionary tr10 20 set description standard transition tr10 20 set seq no 100 tr10 20 save mwf node node100 new mwf node wf 100 doc prepare node100 set description standard node node100 set entity type entitytype dictionary node100 set action mwf node action documentaction node100 set doc action mwf node docaction prepare node100 set position 170 5 node100 save mwf node next tr10 100 new mwf node next node10 node100 getad wf node id tr10 100 set entity type entitytype dictionary tr10 100 set description standard approval tr10 100 set is std user workflow true tr10 100 set seq no 10 tr10 100 save mwf node node200 new mwf node wf 200 doc complete node200 set description standard node node200 set entity type entitytype dictionary node200 set action mwf node action documentaction node200 set doc action mwf node docaction complete node200 set position 170 120 node200 save mwf node next tr100 200 new mwf node next node100 node200 getad wf node id tr100 200 set entity type entitytype dictionary tr100 200 set description standard transition tr100 200 set seq no 100 tr100 200 save env set context env get ctx ad client id 11 env set context env get ctx ad org id 11 env set context env get ctx ad user id 100 int ad workflow id 115 requisition wf int m requsition id 100 m requisition req new m requisition env get ctx m requsition id req set doc status doc action docstatus drafted req save log set trace level 8 system out println m workflow wf m workflow get env get ctx ad workflow id wf start m requsition id mworkflow mworkflow getctx setvalue process_xx setname getvalue setdescription getvalue setentitytype entitytype_dictionary mwfnode mwfnode setdescription setentitytype entitytype_dictionary setaction mwfnode action_waitsleep setwaittime setposition setad_wf_node_id getad_wf_node_id mwfnode mwfnode docauto setdescription setentitytype entitytype_dictionary setaction mwfnode action_documentaction setdocaction mwfnode docaction_none setposition mwfnodenext tr10_20 mwfnodenext getad_wf_node_id tr10_20 setentitytype entitytype_dictionary tr10_20 setdescription tr10_20 setseqno tr10_20 mwfnode mwfnode docprepare setdescription setentitytype entitytype_dictionary setaction mwfnode action_documentaction setdocaction mwfnode docaction_prepare setposition mwfnodenext tr10_100 mwfnodenext getad_wf_node_id tr10_100 setentitytype entitytype_dictionary tr10_100 setdescription tr10_100 setisstduserworkflow tr10_100 setseqno tr10_100 mwfnode mwfnode doccomplete setdescription setentitytype entitytype_dictionary setaction mwfnode action_documentaction setdocaction mwfnode docaction_complete setposition mwfnodenext tr100_200 mwfnodenext getad_wf_node_id tr100_200 setentitytype entitytype_dictionary tr100_200 setdescription tr100_200 setseqno tr100_200 setcontext getctx ad_client_id setcontext getctx ad_org_id setcontext getctx ad_user_id ad_workflow_id m_requsition_id mrequisition mrequisition getctx m_requsition_id setdocstatus docaction docstatus_drafted settracelevel mworkflow mworkflow getctx ad_workflow_id m_requsition_id get contsnts return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals pa reportlineset id m pa reportlineset id big decimal para i get parameter int value else if name equals delete old imported m deleteoldimported y equals para i get parameter else log log level severe unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername getparameter ad_client_id m_ad_client_id bigdecimal getparameter intvalue pa_reportlineset_id m_pa_reportlineset_id bigdecimal getparameter intvalue deleteoldimported m_deleteoldimported getparameter m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i reportline where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i reportline set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id 0 is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log fine reset no report line set name default if m pa reportlineset id 0 sql new string buffer update i reportline i set report line set name select name from pa reportlineset r where pa reportlineset id append m pa reportlineset id append and i ad client id r ad client id where report line set name is null and pa reportlineset id is null and i isimported y append client check no db execute update sql to string get trxname log fine set report line set name default no set pa reportlineset id sql new string buffer update i reportline i set pa reportlineset id select pa reportlineset id from pa reportlineset r where i report line set name r name and i ad client id r ad client id where pa reportlineset id is null and i isimported y append client check no db execute update sql to string get trxname log fine set pa reportlineset id no sql new string buffer update i reportline set i isimported e i errormsg i errormsg err invalid report line set where pa reportlineset id is null and i isimported y append client check no db execute update sql to string get trxname log config invalid report line set no ignore if there is no report line name or id sql new string buffer update i reportline set i isimported e i errormsg i errormsg ignored no line name where pa reportline id is null and name is null and i isimported y append client check no db execute update sql to string get trxname log config invalid line name no validate element value sql new string buffer update i reportline i set c elementvalue id select c elementvalue id from c elementvalue e where i element value e value and i ad client id e ad client id where c elementvalue id is null and element value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set c elementvalue id no validate c elementvalue id sql new string buffer update i reportline set i isimported e i errormsg i errormsg err invalid element value where c elementvalue id is null and line type c m report line linetype calculation and i isimported y append client check no db execute update sql to string get trxname log config invalid account type no set seq no sql new string buffer update i reportline set seq no i reportline id where seq no is null and i isimported n append client check no db execute update sql to string get trxname log fine set seq no default no copy sync from first row of line sql new string buffer update i reportline i set description seq no is summary is printed line type calculation type amount type posting type select description seq no is summary is printed line type calculation type amount type posting type from i reportline ii where i name ii name and i pa reportlineset id ii pa reportlineset id and ii i reportline id select min i reportline id from i reportline iii where i name iii name and i pa reportlineset id iii pa reportlineset id where exists select from i reportline ii where i name ii name and i pa reportlineset id ii pa reportlineset id and ii i reportline id select min i reportline id from i reportline iii where i name iii name and i pa reportlineset id iii pa reportlineset id and i isimported n append client check not if previous error no db execute update sql to string get trxname log fine sync from first row of line no validate is summary n y sql new string buffer update i reportline set is summary n where is summary is null or is summary not in y n and i isimported y append client check no db execute update sql to string get trxname log fine set is summary default no validate is printed y n sql new string buffer update i reportline set is printed y where is printed is null or is printed not in y n and i isimported y append client check no db execute update sql to string get trxname log fine set is printed default no validate line type s c sql new string buffer update i reportline set line type s where line type is null or line type not in s c and i isimported y append client check no db execute update sql to string get trxname log fine set line type default no validate optional calculation type a p r s sql new string buffer update i reportline set i isimported e i errormsg i errormsg err invalid calculation type where calculation type is not null and calculation type not in a p r s and i isimported y append client check no db execute update sql to string get trxname log config invalid calculation type no validate optional amount type sql new string buffer update i reportline set i isimported e i errormsg i errormsg err invalid calculation type where amount type is not null and upper amount type not in bp cp dp qp by cy dy qy bt ct dt qt and i isimported y append client check no db execute update sql to string get trxname log config invalid amount type no validate optional posting type a b e s r sql new string buffer update i reportline set i isimported e i errormsg i errormsg err invalid calculation type where posting type is not null and posting type not in a b e s r and i isimported y append client check no db execute update sql to string get trxname log config invalid posting type no set pa reportline id sql new string buffer update i reportline i set pa reportline id select pa reportline id from pa reportline r where i name r name and i pa reportlineset id r pa reportlineset id and rownum 1 where pa reportline id is null and pa reportlineset id is not null and i isimported n append client check no db execute update sql to string get trxname log fine set pa reportline id no commit int no insert line 0 int no update line 0 create missing report lines sql new string buffer select distinct pa reportlineset id name from i reportline where i isimported n and pa reportline id is null and i isimported n append client check try insert report line prepared statement pstmt insertline db prepare statement insert into pa reportline pa reportline id pa reportlineset id ad client id ad org id is active created created by updated updated by name seq no is printed is summary line type select pa reportlineset id ad client id ad org id y sys date created by sys date updated by name seq no is printed is summary line type from i reportline where pa reportlineset id and name and rownum 1 2 3 client check get trxname prepared statement pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next int pa reportlineset id rs get int 1 string name rs get string 2 try int pa reportline id db get nextid m ad client id pa reportline get trxname if pa reportline id 0 throw new db exception no nextid pa reportline id pstmt insertline set int 1 pa reportline id pstmt insertline set int 2 pa reportlineset id pstmt insertline set string 3 name no pstmt insertline execute update log finest insert report line no pa reportline id pa reportline id no insert line catch exception ex log finest ex to string continue rs close pstmt close pstmt insertline close catch sql exception e log log level severe create report line e set pa reportline id for newly created sql new string buffer update i reportline i set pa reportline id select pa reportline id from pa reportline r where i name r name and i pa reportlineset id r pa reportlineset id and rownum 1 wher doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_reportline i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_reportline ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname reportlinesetname m_pa_reportlineset_id stringbuffer i_reportline reportlinesetname pa_reportlineset pa_reportlineset_id m_pa_reportlineset_id ad_client_id ad_client_id reportlinesetname pa_reportlineset_id i_isimported clientcheck executeupdate tostring get_trxname reportlinesetname pa_reportlineset_id stringbuffer i_reportline pa_reportlineset_id pa_reportlineset_id pa_reportlineset reportlinesetname ad_client_id ad_client_id pa_reportlineset_id i_isimported clientcheck executeupdate tostring get_trxname pa_reportlineset_id stringbuffer i_reportline i_isimported i_errormsg i_errormsg reportlineset pa_reportlineset_id i_isimported clientcheck executeupdate tostring get_trxname reportlineset stringbuffer i_reportline i_isimported i_errormsg i_errormsg nolinename pa_reportline_id i_isimported clientcheck executeupdate tostring get_trxname linename elementvalue stringbuffer i_reportline c_elementvalue_id c_elementvalue_id c_elementvalue elementvalue ad_client_id ad_client_id c_elementvalue_id elementvalue i_isimported clientcheck executeupdate tostring get_trxname c_elementvalue_id c_elementvalue_id stringbuffer i_reportline i_isimported i_errormsg i_errormsg elementvalue c_elementvalue_id linetype mreportline linetype_calculation i_isimported clientcheck executeupdate tostring get_trxname accounttype seqno stringbuffer i_reportline seqno i_reportline_id seqno i_isimported clientcheck executeupdate tostring get_trxname seqno stringbuffer i_reportline seqno issummary isprinted linetype calculationtype amounttype postingtype seqno issummary isprinted linetype calculationtype amounttype postingtype i_reportline pa_reportlineset_id pa_reportlineset_id i_reportline_id i_reportline_id i_reportline pa_reportlineset_id pa_reportlineset_id i_reportline pa_reportlineset_id pa_reportlineset_id i_reportline_id i_reportline_id i_reportline pa_reportlineset_id pa_reportlineset_id i_isimported clientcheck executeupdate tostring get_trxname issummary stringbuffer i_reportline issummary issummary issummary i_isimported clientcheck executeupdate tostring get_trxname issummary isprinted stringbuffer i_reportline isprinted isprinted isprinted i_isimported clientcheck executeupdate tostring get_trxname isprinted stringbuffer i_reportline linetype linetype linetype i_isimported clientcheck executeupdate tostring get_trxname linetype stringbuffer i_reportline i_isimported i_errormsg i_errormsg calculationtype calculationtype calculationtype i_isimported clientcheck executeupdate tostring get_trxname calculationtype stringbuffer i_reportline i_isimported i_errormsg i_errormsg calculationtype amounttype amounttype i_isimported clientcheck executeupdate tostring get_trxname amounttype stringbuffer i_reportline i_isimported i_errormsg i_errormsg calculationtype postingtype postingtype i_isimported clientcheck executeupdate tostring get_trxname postingtype pa_reportline_id stringbuffer i_reportline pa_reportline_id pa_reportline_id pa_reportline pa_reportlineset_id pa_reportlineset_id pa_reportline_id pa_reportlineset_id i_isimported clientcheck executeupdate tostring get_trxname pa_reportline_id noinsertline noupdateline reportlines stringbuffer pa_reportlineset_id i_reportline i_isimported pa_reportline_id i_isimported clientcheck reportline preparedstatement pstmt_insertline preparestatement pa_reportline pa_reportline_id pa_reportlineset_id ad_client_id ad_org_id isactive createdby updatedby seqno isprinted issummary linetype pa_reportlineset_id ad_client_id ad_org_id sysdate createdby sysdate updatedby seqno isprinted issummary linetype i_reportline pa_reportlineset_id clientcheck get_trxname preparedstatement preparestatement tostring get_trxname resultset executequery pa_reportlineset_id getint getstring pa_reportline_id getnextid m_ad_client_id pa_reportline get_trxname pa_reportline_id dbexception pa_reportline_id pstmt_insertline setint pa_reportline_id pstmt_insertline setint pa_reportlineset_id pstmt_insertline setstring pstmt_insertline executeupdate reportline pa_reportline_id pa_reportline_id noinsertline tostring pstmt_insertline sqlexception reportline pa_reportline_id stringbuffer i_reportline pa_reportline_id pa_reportline_id pa_reportline pa_reportlineset_id pa_reportlineset_id ide bean constructor for 30 character updateable field public v password this password false false true 30 30 vpassword detail constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display length display length param field length field length param v format format public v password string column name boolean mandatory boolean is read only boolean is updateable int display length int field length string v format super display length v string maxdisplay length v string maxdisplay length display length super set name column name m columnname column name if v format null v format m vformat v format m fieldlength field length if m vformat length 0 m fieldlength 0 set document new m doc string m vformat m fieldlength this if m vformat length 0 set caret new v ovr caret set mandatory mandatory editable if is read only is updateable set editable false set background compiereplaf getfieldbackground inactive this add key listener this this add action listener this set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal columnname isreadonly isupdateable displaylength fieldlength vformat vpassword columnname isreadonly isupdateable displaylength fieldlength vformat displaylength vstring maxdisplay_length vstring maxdisplay_length displaylength setname columnname m_columnname columnname vformat vformat m_vformat vformat m_fieldlength fieldlength m_vformat m_fieldlength setdocument mdocstring m_vformat m_fieldlength m_vformat setcaret vovrcaret setmandatory isreadonly isupdateable seteditable setbackground getfieldbackground_inactive addkeylistener addactionlistener setforeground gettextcolor_normal setbackground getfieldbackground_normal dispose public void dispose m mfield null m_mfield set editor to value param value value public void set value object value if value null m oldtext else m oldtext value to string if m setting set text m oldtext setvalue m_oldtext m_oldtext tostring m_setting settext m_oldtext property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value return string value of get password getvalue valueof getpassword return display value return value public string get display return string value of get password getdisplay valueof getpassword key listener interface param e event public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent key listener param e event public void key released key event e string new text string value of get password m setting true try fire vetoable change m columnname m oldtext new text catch property veto exception pve m setting false keyreleased keyevent newtext valueof getpassword m_setting firevetoablechange m_columnname m_oldtext newtext propertyvetoexception m_setting data binding to m table via grid controller enter pressed param e event public void action performed action event e string new text string value of get password data binding try fire vetoable change m columnname m oldtext new text catch property veto exception pve mtable gridcontroller actionperformed actionevent newtext valueof getpassword firevetoablechange m_columnname m_oldtext newtext propertyvetoexception set field window no for value preference param m field field public void set field m field m field m mfield m field windowno valuepreference mfield setfield mfield mfield m_mfield mfield standard constructor param ctx context param c activity id id public m activity properties ctx int c activity id string trx name super ctx c activity id trx name c_activity_id mactivity c_activity_id trxname c_activity_id trxname load constructor param ctx context param rs result set public m activity properties ctx result set rs string trx name super ctx rs trx name mactivity resultset trxname trxname after save insert create tree param new record insert param success save success protected boolean after save boolean new record boolean success if success return success if new record insert tree mtree base treetype activity value name change if new record is valuechanged value is valuechanged name m account update value description get ctx c activity id getc activity id get trxname return true newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_activity newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_activity_id getc_activity_id get_trxname after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype activity return success afterdelete delete_tree mtree_base treetype_activity standard constructor param ctx context param c bankstatement id id public m bank statement properties ctx int c bankstatement id string trx name super ctx c bankstatement id trx name if c bankstatement id 0 setc bankaccount id 0 parent set statement date new timestamp system current time millis date set doc action docaction complete co set doc status docstatus drafted dr set beginning balance env zero set statement difference env zero set ending balance env zero set is approved false n set is manual true y set posted false n super set processed false c_bankstatement_id mbankstatement c_bankstatement_id trxname c_bankstatement_id trxname c_bankstatement_id setc_bankaccount_id setstatementdate currenttimemillis setdocaction docaction_complete setdocstatus docstatus_drafted setbeginningbalance setstatementdifference setendingbalance setisapproved setismanual setposted setprocessed load constructor param ctx current context param rs result set public m bank statement properties ctx result set rs string trx name super ctx rs trx name mbankstatement resultset trxname trxname parent constructor param account bank account param is manual manual statement public m bank statement m bank account account boolean is manual this account get ctx 0 account get trxname set client org account setc bankaccount id account getc bankaccount id set statement date new timestamp system current time millis set beginning balance account get current balance set name get statement date to string set is manual is manual ismanual mbankstatement mbankaccount ismanual getctx get_trxname setclientorg setc_bankaccount_id getc_bankaccount_id setstatementdate currenttimemillis setbeginningbalance getcurrentbalance setname getstatementdate tostring setismanual ismanual create a new bank statement param account bank account public m bank statement m bank account account this account false mbankstatement mbankaccount get bank statement lines param requery requery return line array public m bank statement line get lines boolean requery if m lines null requery return m lines array list m bank statement line list new array list m bank statement line string sql select from c bankstatementline where c bankstatement id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc bankstatement id result set rs pstmt execute query while rs next list add new m bank statement line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m bank statement line ret value new m bank statement line list size list to array ret value return ret value mbankstatementline getlines m_lines m_lines arraylist mbankstatementline arraylist mbankstatementline c_bankstatementline c_bankstatement_id preparedstatement preparestatement get_trxname setint getc_bankstatement_id resultset executequery mbankstatementline getctx get_trxname getlines mbankstatementline retvalue mbankstatementline toarray retvalue retvalue add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update c bankstatementline set processed processed y n where c bankstatement id getc bankstatement id int no line db execute update sql get trxname m lines null log fine set processed processed lines no line setprocessed setprocessed get_id c_bankstatementline c_bankstatement_id getc_bankstatement_id noline executeupdate get_trxname m_lines setprocessed noline get bank account return bank account public m bank account get bank account return m bank account get get ctx getc bankaccount id mbankaccount getbankaccount mbankaccount getctx getc_bankaccount_id get document no return name public string get document no return get name getdocumentno getname get document info return document info untranslated public string get document info return get bank account get name get document no getdocumentinfo getbankaccount getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save param new record new return true protected boolean before save boolean new record if get beginning balance compare to env zero 0 m bank account ba m bank account get get ctx getc bankaccount id set beginning balance ba get current balance set ending balance get beginning balance add get statement difference return true newrecord beforesave newrecord getbeginningbalance compareto mbankaccount mbankaccount getctx getc_bankaccount_id setbeginningbalance getcurrentbalance setendingbalance getbeginningbalance getstatementdifference process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get statement date m doc type docbasetype bankstatement m processmsg period closed return doc action status invalid m bank statement line lines get lines true if lines length 0 m processmsg no lines return doc action status invalid lines big decimal total env zero timestamp min date get statement date timestamp max date min date for int i 0 i lines length i m bank statement line line lines i total total add line get stmt amt if line get date acct before min date min date line get date acct if line get date acct after max date max date line get date acct set statement difference total set ending balance get beginning balance add total if m period is open get ctx min date m doc type docbasetype bankstatement m period is open get ctx max date m doc type docbasetype bankstatement m processmsg period closed return doc action status invalid m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getstatementdate mdoctype docbasetype_bankstatement m_processmsg periodclosed docaction status_invalid mbankstatementline getlines m_processmsg nolines docaction status_invalid bigdecimal mindate getstatementdate maxdate mindate mbankstatementline getstmtamt getdateacct mindate mindate getdateacct getdateacct maxdate maxdate getdateacct setstatementdifference setendingbalance getbeginningbalance mperiod isopen getctx mindate mdoctype docbasetype_bankstatement mperiod isopen getctx maxdate mdoctype docbasetype_bankstatement m_processmsg periodclosed docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info complete it to string set payment reconciled m bank statement line lines get lines false for int i 0 i lines length i m bank statement line line lines i if line getc payment id 0 m payment payment new m payment get ctx line getc payment id get trxname payment set is reconciled true payment save get trxname update bank account m bank account ba m bank account get get ctx getc bankaccount id ba set current balance get ending balance ba save get trxname user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit completeit tostring mbankstatementline getlines mbankstatementline getc_payment_id mpayment mpayment getctx getc_payment_id get_trxname setisreconciled get_trxname mbankaccount mbankaccount getctx getc_bankaccount_id setcurrentbalance getendingbalance get_trxname modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document return false public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status set doc action docaction none return false not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status std period open else if m period is open get ctx get statement date m doc type docbasetype bankstatement m processmsg period closed return false if m fact acct delete table id getc bankstatement id get trxname 0 return false could not delete set lines to 0 m bank statement line lines get lines true for int i 0 i lines length i m bank statement line line lines i big decimal old line get stmt amt if line get stmt amt compare to env zero 0 string description msg get msg get ctx voided msg translate get ctx stmt amt line get stmt amt if line get trx amt compare to env zero 0 description msg translate get ctx trx amt line get trx amt if line get charge amt compare to env zero 0 description msg translate get ctx charge amt line get charge amt if line get interest amt compare to env zero 0 description msg translate get ctx interest amt line get interest amt description line add description description line set stmt amt env zero line set trx amt env zero line set charge amt env zero line set interest amt env zero line save get trxname if line getc payment id 0 m payment payment new m payment get ctx line getc payment id get trxname payment set is reconciled false payment save get trxname add description msg get msg get ctx voided set statement difference env zero set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus setdocaction docaction_none docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus mperiod isopen getctx getstatementdate mdoctype docbasetype_bankstatement m_processmsg periodclosed mfactacct table_id getc_bankstatement_id get_trxname mbankstatementline getlines mbankstatementline bigdecimal getstmtamt getstmtamt compareto getmsg getctx getctx stmtamt getstmtamt gettrxamt compareto getctx trxamt gettrxamt getchargeamt compareto getctx chargeamt getchargeamt getinterestamt compareto getctx interestamt getinterestamt adddescription setstmtamt settrxamt setchargeamt setinterestamt get_trxname getc_payment_id mpayment mpayment getctx getc_payment_id get_trxname setisreconciled get_trxname adddescription getmsg getctx setstatementdifference setprocessed setdocaction docaction_none close document return true if success public boolean close it log info close it to string set doc action docaction none return true closeit closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual return false public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return false public boolean re activate it log info re activate it to string return false reactivateit reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get name total lines 123 00 1 sb append append msg translate get ctx statement difference append append get statement difference append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getname getctx statementdifference getstatementdifference getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get updated by ad_user_id getdoc_user_id getupdatedby get document approval amount statement difference return amount public big decimal get approval amt return get statement difference bigdecimal getapprovalamt getstatementdifference get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id print format utility param ctx context public print format util properties ctx super m ctx ctx printformatutil m_ctx add missing columns for all print format public void add missing columns int total 0 string sql select from ad printformat pf order by name prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next total add missing columns new m print format m ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log info total total addmissingcolumns ad_printformat preparedstatement preparestatement resultset executequery addmissingcolumns mprintformat m_ctx add missing columns for print format param pf print format return no of columns created public int add missing columns m print format pf log config pf to string string sql select c ad column id c column name from ad column c where not exists select from ad printformatitem pfi inner join ad printformat pf on pfi ad printformat id pf ad printformat id where pf ad table id c ad table id and pfi ad column id c ad column id and pfi ad printformat id 1 and c ad table id 2 order by 1 prepared statement pstmt null int counter 0 try pstmt db prepare statement sql null pstmt set int 1 pf getad printformat id pstmt set int 2 pf getad table id result set rs pstmt execute query while rs next int ad column id rs get int 1 string column name rs get string 2 m print format item pfi m print format item create from column pf ad column id 0 if pfi get id 0 log fine counter added column name else log warning not added column name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if counter 0 log fine none sql ad printformat id pf getad printformat id ad table id pf getad table id else log fine added counter return counter addmissingcolumns mprintformat tostring ad_column_id columnname ad_column ad_printformatitem ad_printformat ad_printformat_id ad_printformat_id ad_table_id ad_table_id ad_column_id ad_column_id ad_printformat_id ad_table_id preparedstatement preparestatement setint getad_printformat_id setint getad_table_id resultset executequery ad_column_id getint columnname getstring mprintformatitem mprintformatitem createfromcolumn ad_column_id get_id columnname columnname ad_printformat_id getad_printformat_id ad_table_id getad_table_id main param args arguments public static void main string args org compiere compiere startup environment true print format util pfu new print format util env get ctx pfu add missing columns startupenvironment printformatutil printformatutil getctx addmissingcolumns standard constructor public x c currency properties ctx int c currency id string trx name super ctx c currency id trx name if c currency id 0 setc currency id 0 set costing precision 0 4 set description null setiso code null set isemu member false n set is euro false n set std precision 0 2 x_c_currency c_currency_id trxname c_currency_id trxname c_currency_id setc_currency_id setcostingprecision setdescription setiso_code setisemumember setiseuro setstdprecision load constructor public x c currency properties ctx result set rs string trx name super ctx rs trx name x_c_currency resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c currency append get id append return sb to string tostring stringbuffer stringbuffer x_c_currency get_id tostring set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set costing precision rounding used costing calculations public void set costing precision int costing precision set value costing precision new integer costing precision setcostingprecision costingprecision set_value costingprecision costingprecision get costing precision rounding used costing calculations public int get costing precision integer ii integer get value costing precision if ii null return 0 return ii int value getcostingprecision get_value costingprecision intvalue set symbol symbol of the currency opt used for printing only public void set cur symbol string cur symbol if cur symbol null cur symbol length 10 log warning length 10 truncated cur symbol cur symbol substring 0 9 set value cur symbol cur symbol setcursymbol cursymbol cursymbol cursymbol cursymbol cursymbol set_value cursymbol cursymbol get symbol symbol of the currency opt used for printing only public string get cur symbol return string get value cur symbol getcursymbol get_value cursymbol set description optional short description of the record public void set description string description if description null throw new illegal argument exception description is mandatory if description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription illegalargumentexception set_value get description optional short description of the record public string get description return string get value description getdescription get_value set emu entry date date when the currency joined will join the emu public void setemu entry date timestamp emu entry date set value emu entry date emu entry date setemuentrydate emuentrydate set_value emuentrydate emuentrydate get emu entry date date when the currency joined will join the emu public timestamp getemu entry date return timestamp get value emu entry date getemuentrydate get_value emuentrydate set emu rate official rate to the euro public void setemu rate big decimal emu rate set value emu rate emu rate setemurate bigdecimal emurate set_value emurate emurate get emu rate official rate to the euro public big decimal getemu rate big decimal bd big decimal get value emu rate if bd null return env zero return bd bigdecimal getemurate bigdecimal bigdecimal get_value emurate set iso currency code three letter iso 4217 code of the currency public void setiso code string iso code if iso code null throw new illegal argument exception iso code is mandatory if iso code length 3 log warning length 3 truncated iso code iso code substring 0 2 set value iso code iso code setiso_code iso_code iso_code illegalargumentexception iso_code iso_code iso_code iso_code set_value iso_code iso_code get iso currency code three letter iso 4217 code of the currency public string getiso code return string get value iso code getiso_code get_value iso_code return string get value iso code public key name pair get key name pair return new key name pair get id getiso code get_value iso_code keynamepair getkeynamepair keynamepair get_id getiso_code set emu member this currency is member if the european monetary union public void set isemu member boolean isemu member set value isemu member new boolean isemu member setisemumember isemumember set_value isemumember isemumember get emu member this currency is member if the european monetary union public boolean isemu member object oo get value isemu member if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isemumember get_value isemumember booleanvalue set the euro currency this currency is the euro public void set is euro boolean is euro set value is euro new boolean is euro setiseuro iseuro set_value iseuro iseuro get the euro currency this currency is the euro public boolean is euro object oo get value is euro if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iseuro get_value iseuro booleanvalue set standard precision rule for rounding calculated amounts public void set std precision int std precision set value std precision new integer std precision setstdprecision stdprecision set_value stdprecision stdprecision get standard precision rule for rounding calculated amounts public int get std precision integer ii integer get value std precision if ii null return 0 return ii int value getstdprecision get_value stdprecision intvalue standard constructor public x c paymentallocate properties ctx int c paymentallocate id string trx name super ctx c paymentallocate id trx name if c paymentallocate id 0 set amount env zero setc invoice id 0 setc paymentallocate id 0 setc payment id 0 set discount amt env zero set over under amt env zero set write off amt env zero x_c_paymentallocate c_paymentallocate_id trxname c_paymentallocate_id trxname c_paymentallocate_id setamount setc_invoice_id setc_paymentallocate_id setc_payment_id setdiscountamt setoverunderamt setwriteoffamt load constructor public x c paymentallocate properties ctx result set rs string trx name super ctx rs trx name x_c_paymentallocate resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c paymentallocate append get id append return sb to string tostring stringbuffer stringbuffer x_c_paymentallocate get_id tostring set amount amount in a defined currency public void set amount big decimal amount if amount null throw new illegal argument exception amount is mandatory set value amount amount setamount bigdecimal illegalargumentexception set_value get amount amount in a defined currency public big decimal get amount big decimal bd big decimal get value amount if bd null return env zero return bd bigdecimal getamount bigdecimal bigdecimal get_value set allocation line allocation line public void setc allocationline id int c allocationline id if c allocationline id 0 set value c allocationline id null else set value c allocationline id new integer c allocationline id setc_allocationline_id c_allocationline_id c_allocationline_id set_value c_allocationline_id set_value c_allocationline_id c_allocationline_id get allocation line allocation line public int getc allocationline id integer ii integer get value c allocationline id if ii null return 0 return ii int value getc_allocationline_id get_value c_allocationline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoice id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoice_id set allocate payment allocate payment to invoices public void setc paymentallocate id int c paymentallocate id if c paymentallocate id 1 throw new illegal argument exception c paymentallocate id is mandatory set valuenocheck c paymentallocate id new integer c paymentallocate id setc_paymentallocate_id c_paymentallocate_id c_paymentallocate_id illegalargumentexception c_paymentallocate_id set_valuenocheck c_paymentallocate_id c_paymentallocate_id get allocate payment allocate payment to invoices public int getc paymentallocate id integer ii integer get value c paymentallocate id if ii null return 0 return ii int value getc_paymentallocate_id get_value c_paymentallocate_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 1 throw new illegal argument exception c payment id is mandatory set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id illegalargumentexception c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set discount amount calculated amount of discount public void set discount amt big decimal discount amt if discount amt null throw new illegal argument exception discount amt is mandatory set value discount amt discount amt setdiscountamt bigdecimal discountamt discountamt illegalargumentexception discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set invoice amt public void set invoice amt big decimal invoice amt set value invoice amt invoice amt setinvoiceamt bigdecimal invoiceamt set_value invoiceamt invoiceamt get invoice amt public big decimal get invoice amt big decimal bd big decimal get value invoice amt if bd null return env zero return bd bigdecimal getinvoiceamt bigdecimal bigdecimal get_value invoiceamt set over under payment over payment unallocated or under payment partial payment amount public void set over under amt big decimal over under amt if over under amt null throw new illegal argument exception over under amt is mandatory set value over under amt over under amt setoverunderamt bigdecimal overunderamt overunderamt illegalargumentexception overunderamt set_value overunderamt overunderamt get over under payment over payment unallocated or under payment partial payment amount public big decimal get over under amt big decimal bd big decimal get value over under amt if bd null return env zero return bd bigdecimal getoverunderamt bigdecimal bigdecimal get_value overunderamt set remaining amt remaining amount public void set remaining amt big decimal remaining amt throw new illegal argument exception remaining amt is virtual column setremainingamt bigdecimal remainingamt illegalargumentexception remainingamt get remaining amt remaining amount public big decimal get remaining amt big decimal bd big decimal get value remaining amt if bd null return env zero return bd bigdecimal getremainingamt bigdecimal bigdecimal get_value remainingamt set write off amount amount to write off public void set write off amt big decimal write off amt if write off amt null throw new illegal argument exception write off amt is mandatory set value write off amt write off amt setwriteoffamt bigdecimal writeoffamt writeoffamt illegalargumentexception writeoffamt set_value writeoffamt writeoffamt get write off amount amount to write off public big decimal get write off amt big decimal bd big decimal get value write off amt if bd null return env zero return bd bigdecimal getwriteoffamt bigdecimal bigdecimal get_value writeoffamt create color in database and save param color color param name name return m print color static m print color create color color string name m print color pc new m print color env get ctx 0 null pc set name name pc set color color pc save return pc mprintcolor mprintcolor mprintcolor mprintcolor getctx setname setcolor get color if id 0 it returns a new color black but do not modify save as cached param ctx context param ad printcolor id id return color static public m print color get properties ctx int ad printcolor id if ad printcolor id 0 return new m print color ctx 0 integer key new integer ad printcolor id m print color pc m print color s colors get key if pc null pc new m print color ctx ad printcolor id null s colors put key pc return pc ad_printcolor_id mprintcolor ad_printcolor_id ad_printcolor_id mprintcolor ad_printcolor_id mprintcolor mprintcolor s_colors mprintcolor ad_printcolor_id s_colors get color param ctx context param ad printcolor id id return color or null static public m print color get properties ctx string ad printcolor id if ad printcolor id null ad printcolor id length 0 return null try int id integer parse int ad printcolor id return get ctx id catch exception e s log log level severe ad printcolor id ad printcolor id e to string return null ad_printcolor_id mprintcolor ad_printcolor_id ad_printcolor_id ad_printcolor_id parseint ad_printcolor_id s_log ad_printcolor_id ad_printcolor_id tostring constructor param ctx context param ad printcolor id id public m print color properties ctx int ad printcolor id string trx name super ctx ad printcolor id trx name if ad printcolor id 0 set is default false ad_printcolor_id mprintcolor ad_printcolor_id trxname ad_printcolor_id trxname ad_printcolor_id setisdefault get color return color public color get color if m cachecolor null return m cachecolor string code get code if code null code equals m cachecolor color black try if code null code equals int rgba integer parse int code m cachecolor new color rgba false catch exception e log log level severe m print color get color e if code null m cachecolor color black log fine m print color get color code m cachecolor return m cachecolor getcolor m_cachecolor m_cachecolor getcode m_cachecolor parseint m_cachecolor mprintcolor getcolor m_cachecolor mprintcolor getcolor m_cachecolor m_cachecolor set color param color color public void set color color color int rgba color getrgb super set code string value of rgba setcolor setcode valueof get color as rrggbb hex string for html font tag return rgb hex value public string getrrggbb color color get color string buffer sb new string buffer sb append util to hex byte color get red append util to hex byte color get green append util to hex byte color get blue return sb to string getcolor stringbuffer stringbuffer tohex getred tohex getgreen tohex getblue tostring string representation return info public string to string string buffer sb new string buffer m print color sb append id append get id append name append get name append rgb append get code append append get color append return sb to string tostring stringbuffer stringbuffer mprintcolor get_id getname getcode getcolor tostring create standard colors param args args public static void main string args org compiere compiere startup environment true color colors new color color black color red color green color blue color dark gray color gray color light gray color white color cyan color magenta color orange color pink color yellow system color text highlight string names new string black red green blue gray dark gray gray light white cyan magenta orange pink yellow blue dark for int i 0 i colors length i system out println names i colors i rgb colors i getrgb new color colors i getrgb false new color colors i getrgb true create colors for int i 0 i colors length i create colors i names i create white gray gray white create dark green green dark create black green green black create black blue blue black create brown brown create dark brown brown dark read all colors int i ds po get alli ds ad printcolor null null for int i 0 i i ds length i m print color pc new m print color env get ctx i ds i null system out println i ds i pc pc get color rgb pc get color getrgb startupenvironment darkgray lightgray systemcolor texthighlight whitegray darkgreen blackgreen blackblue darkbrown ids getallids ad_printcolor ids mprintcolor mprintcolor getctx ids ids getcolor getcolor prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c rfq id p from rfq id big decimal para i get parameter int value else log log level severe prepare unknown parameter name p to rfq id getrecord id processinfoparameter getparameter getparametername getparameter c_rfq_id p_from_rfq_id bigdecimal getparameter intvalue p_to_rfq_id getrecord_id process see org compiere process svr process do it return message protected string do it throws exception log info do it from rfq id p from rfq id to rfq id p to rfq id m rfq to new m rfq get ctx p to rfq id get trxname if to get id 0 throw new illegal argument exception no to rfq found m rfq from new m rfq get ctx p from rfq id get trxname if from get id 0 throw new illegal argument exception no from rfq found copy lines int counter 0 m rfq line lines from get lines for int i 0 i lines length i m rfq line new line new m rfq line to new line set line lines i get line new line set description lines i get description new line set help lines i get help new line setm product id lines i getm product id new line setm attributesetinstance id lines i getm attributesetinstance id new line set date work start new line set date work complete new line set delivery days lines i get delivery days new line save copy qtys m rfq line qty qtys lines i get qtys for int j 0 j qtys length j m rfq line qty new qty new m rfq line qty new line new qty setc uom id qtys j getc uom id new qty set qty qtys j get qty new qty set is offer qty qtys j is offer qty new qty set is purchase qty qtys j is purchase qty new qty set margin qtys j get margin new qty save counter copy all lines return counter svrprocess doit doit doit from_rfq_id p_from_rfq_id to_rfq_id p_to_rfq_id mrfq mrfq getctx p_to_rfq_id get_trxname get_id illegalargumentexception mrfq mrfq getctx p_from_rfq_id get_trxname get_id illegalargumentexception mrfqline getlines mrfqline newline mrfqline newline setline getline newline setdescription getdescription newline sethelp gethelp newline setm_product_id getm_product_id newline setm_attributesetinstance_id getm_attributesetinstance_id newline setdateworkstart newline setdateworkcomplete newline setdeliverydays getdeliverydays newline mrfqlineqty getqtys mrfqlineqty newqty mrfqlineqty newline newqty setc_uom_id getc_uom_id newqty setqty getqty newqty setisofferqty isofferqty newqty setispurchaseqty ispurchaseqty newqty setmargin getmargin newqty get pos key layout from cache param ctx context param c poskeylayout id id return mpos key layout public static mpos key layout get properties ctx int c poskeylayout id integer key new integer c poskeylayout id mpos key layout ret value mpos key layout s cache get key if ret value null return ret value ret value new mpos key layout ctx c poskeylayout id null if ret value get id 0 s cache put key ret value return ret value c_poskeylayout_id mposkeylayout mposkeylayout c_poskeylayout_id c_poskeylayout_id mposkeylayout retvalue mposkeylayout s_cache retvalue retvalue retvalue mposkeylayout c_poskeylayout_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c poskeylayout id id public mpos key layout properties ctx int c poskeylayout id string trx name super ctx c poskeylayout id trx name c_poskeylayout_id mposkeylayout c_poskeylayout_id trxname c_poskeylayout_id trxname load constructor param ctx context param rs result set public mpos key layout properties ctx result set rs string trx name super ctx rs trx name mposkeylayout resultset trxname trxname get keys param requery requery return keys public mpos key get keys boolean requery if m keys null requery return m keys array list mpos key list new array list mpos key string sql select from c poskey where c poskeylayout id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc poskeylayout id result set rs pstmt execute query while rs next list add new mpos key get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m keys new mpos key list size list to array m keys return m keys mposkey getkeys m_keys m_keys arraylist mposkey arraylist mposkey c_poskey c_poskeylayout_id seqno preparedstatement preparestatement get_trxname setint getc_poskeylayout_id resultset executequery mposkey getctx get_trxname m_keys mposkey toarray m_keys m_keys get number of keys return keys public int get no of keys return get keys false length getnoofkeys getkeys get bank account payment processor param ctx context param tender optional tender see tender param cc type optional cc type see cc param ad client id client param c currency id currency ignored param amt amount ignored return array of bank account 0 payment processor 1 or null protected static m payment processor find properties ctx string tender string cc type int ad client id int c currency id big decimal amt string trx name array list m payment processor list new array list m payment processor string buffer sql new string buffer select from c paymentprocessor where ad client id and is active y 1 and c currency id is null or c currency id 2 and minimum amt is null or minimum amt 0 or minimum amt 3 if m payment tendertype directdeposit equals tender sql append and accept direct deposit y else if m payment tendertype directdebit equals tender sql append and accept direct debit y else if m payment tendertype check equals tender sql append and accept check y credit cards else if m payment creditcardtype atm equals cc type sql append and acceptatm y else if m payment creditcardtype amex equals cc type sql append and acceptamex y else if m payment creditcardtype visa equals cc type sql append and acceptvisa y else if m payment creditcardtype mastercard equals cc type sql append and acceptmc y else if m payment creditcardtype diners equals cc type sql append and accept diners y else if m payment creditcardtype discover equals cc type sql append and accept discover y else if m payment creditcardtype purchasecard equals cc type sql append and acceptcorporate y try prepared statement pstmt db prepare statement sql to string trx name pstmt set int 1 ad client id pstmt set int 2 c currency id pstmt set big decimal 3 amt result set rs pstmt execute query while rs next list add new m payment processor ctx rs trx name rs close pstmt close catch sql exception e s log log level severe find sql e return null if list size 0 s log warning find not found ad client id ad client id c currency id c currency id amt amt else s log fine find list size ad client id ad client id c currency id c currency id amt amt m payment processor ret value new m payment processor list size list to array ret value return ret value bankaccount paymentprocessor tender_ cctype cc_ ad_client_id c_currency_id bankaccount paymentprocessor mpaymentprocessor cctype ad_client_id c_currency_id bigdecimal trxname arraylist mpaymentprocessor arraylist mpaymentprocessor stringbuffer stringbuffer c_paymentprocessor ad_client_id isactive c_currency_id c_currency_id minimumamt minimumamt minimumamt mpayment tendertype_directdeposit acceptdirectdeposit mpayment tendertype_directdebit acceptdirectdebit mpayment tendertype_check acceptcheck creditcards mpayment creditcardtype_atm cctype mpayment creditcardtype_amex cctype mpayment creditcardtype_visa cctype mpayment creditcardtype_mastercard cctype mpayment creditcardtype_diners cctype acceptdiners mpayment creditcardtype_discover cctype acceptdiscover mpayment creditcardtype_purchasecard cctype preparedstatement preparestatement tostring trxname setint ad_client_id setint c_currency_id setbigdecimal resultset executequery mpaymentprocessor trxname sqlexception s_log s_log ad_client_id ad_client_id c_currency_id c_currency_id s_log ad_client_id ad_client_id c_currency_id c_currency_id mpaymentprocessor retvalue mpaymentprocessor toarray retvalue retvalue payment processor model param ctx context param c paymentprocessor id payment processor public m payment processor properties ctx int c paymentprocessor id string trx name super ctx c paymentprocessor id trx name if c paymentprocessor id 0 setc bankaccount id 0 parent set userid null set password null set host address null set host port 0 set commission env zero set accept visa false set acceptmc false set acceptamex false set accept diners false set cost per trx env zero set accept check false set requirevv false set accept corporate false set accept discover false set acceptatm false set accept direct deposit false set accept direct debit false set name null c_paymentprocessor_id mpaymentprocessor c_paymentprocessor_id trxname c_paymentprocessor_id trxname c_paymentprocessor_id setc_bankaccount_id setuserid setpassword sethostaddress sethostport setcommission setacceptvisa setacceptmc setacceptamex setacceptdiners setcostpertrx setacceptcheck setrequirevv setacceptcorporate setacceptdiscover setacceptatm setacceptdirectdeposit setacceptdirectdebit setname payment processor model param ctx context param rs result set public m payment processor properties ctx result set rs string trx name super ctx rs trx name mpaymentprocessor resultset trxname trxname public string to string string buffer sb new string buffer m payment processor append get id append append get name append return sb to string tostring stringbuffer stringbuffer mpaymentprocessor get_id getname tostring does payment processor accepts tender cc param tender type tender type param credit card type credit card type return true if acceptes public boolean accepts string tender type string credit card type if m payment tendertype directdeposit equals tender type is accept direct deposit m payment tendertype directdebit equals tender type is accept direct debit m payment tendertype check equals tender type is accept check m payment creditcardtype atm equals credit card type is acceptatm m payment creditcardtype amex equals credit card type is acceptamex m payment creditcardtype purchasecard equals credit card type is accept corporate m payment creditcardtype diners equals credit card type is accept diners m payment creditcardtype discover equals credit card type is accept discover m payment creditcardtype mastercard equals credit card type is acceptmc m payment creditcardtype visa equals credit card type is accept visa return true return false tendertype creditcardtype tendertype creditcardtype mpayment tendertype_directdeposit tendertype isacceptdirectdeposit mpayment tendertype_directdebit tendertype isacceptdirectdebit mpayment tendertype_check tendertype isacceptcheck mpayment creditcardtype_atm creditcardtype isacceptatm mpayment creditcardtype_amex creditcardtype isacceptamex mpayment creditcardtype_purchasecard creditcardtype isacceptcorporate mpayment creditcardtype_diners creditcardtype isacceptdiners mpayment creditcardtype_discover creditcardtype isacceptdiscover mpayment creditcardtype_mastercard creditcardtype isacceptmc mpayment creditcardtype_visa creditcardtype isacceptvisa get lots for product param ctx context param m product id product return array of lots for product public static m lot get product lots properties ctx int m product id string trx name string sql select from m lot where m product id array list m lot list new array list m lot prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new m lot ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m lot ret value new m lot list size list to array ret value return ret value m_product_id mlot getproductlots m_product_id trxname m_lot m_product_id arraylist mlot arraylist mlot preparedstatement preparestatement trxname setint m_product_id resultset executequery mlot trxname sqlexception s_log sqlexception mlot retvalue mlot toarray retvalue retvalue get lot for product param ctx context param m product id product param lot return array of lots for product public static m lot get product lot properties ctx int m product id string lot string trx name string sql select from m lot where m product id and name m lot ret value null prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id pstmt set string 2 lot result set rs pstmt execute query while rs next ret value new m lot ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return ret value m_product_id mlot getproductlot m_product_id trxname m_lot m_product_id mlot retvalue preparedstatement preparestatement trxname setint m_product_id setstring resultset executequery retvalue mlot trxname sqlexception s_log sqlexception retvalue get lot key name pairs for product param m product id product return array of lot key name pairs for product public static key name pair get product lot pairs int m product id string trx name string sql select m lot id name from m lot where m product id array list key name pair list new array list key name pair prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new key name pair rs get int 1 rs get string 2 rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null key name pair ret value new key name pair list size list to array ret value return ret value m_product_id keynamepair getproductlotpairs m_product_id trxname m_lot_id m_lot m_product_id arraylist keynamepair arraylist keynamepair preparedstatement preparestatement trxname setint m_product_id resultset executequery keynamepair getint getstring sqlexception s_log sqlexception keynamepair retvalue keynamepair toarray retvalue retvalue standard constructor param ctx context param m lot id id public m lot properties ctx int m lot id string trx name super ctx m lot id trx name if m lot id 0 setm lot id 0 setm product id 0 set name null m_lot_id mlot m_lot_id trxname m_lot_id trxname m_lot_id setm_lot_id setm_product_id setname load constructor param ctx context param rs result set public m lot properties ctx result set rs string trx name super ctx rs trx name mlot resultset trxname trxname parent constructor param ctl lot control param m product id product param name name public m lot m lot ctl ctl int m product id string name this ctl get ctx 0 ctl get trxname set client org ctl setm lotctl id ctl getm lotctl id setm product id m product id set name name m_product_id mlot mlotctl m_product_id getctx get_trxname setclientorg setm_lotctl_id getm_lotctl_id setm_product_id m_product_id setname string representation return info public string to string return get name tostring getname standard constructor param ctx context param ad printtableformat id table format public m print table format properties ctx int ad printtableformat id string trx name super ctx ad printtableformat id trx name if ad printtableformat id 0 set name null set is default false set is paint header lines true y set is paint boundary lines false set is painth lines false set is paintv lines false set is print function symbols true ad_printtableformat_id mprinttableformat ad_printtableformat_id trxname ad_printtableformat_id trxname ad_printtableformat_id setname setisdefault setispaintheaderlines setispaintboundarylines setispainthlines setispaintvlines setisprintfunctionsymbols load constructor param ctx context param rs result set public m print table format properties ctx result set rs string trx name super ctx rs trx name mprinttableformat resultset trxname trxname set standard font to derive other fonts if not defined param standard font standard font public void setstandard font font standard font if standard font null this standard font standard font standard_font setstandard_font standard_font standard_font standard_font standard_font get stndard font return stndard font public font getstandard font return standard font getstandard_font standard_font get table header font return table header font or bold standard font public font getheader font if header font null return header font int i gethdr printfont id if i 0 header font m print font get i get font if header font null header font new font standard font get name font bold standard font get size return header font getheader_font header_font header_font gethdr_printfont_id header_font mprintfont getfont header_font header_font standard_font getname standard_font getsize header_font get header foreground return color or blue black public color getheaderfg color if headerfg color null return headerfg color int i gethdrtextfg printcolor id if i 0 headerfg color m print color get get ctx i get color if headerfg color null headerfg color m print color black blue return headerfg color getheaderfg_color headerfg_color headerfg_color gethdrtextfg_printcolor_id headerfg_color mprintcolor getctx getcolor headerfg_color headerfg_color mprintcolor blackblue headerfg_color get header bg color return color or cyan public color getheaderbg color if headerbg color null return headerbg color int i gethdrtextbg printcolor id if i 0 headerbg color m print color get get ctx i get color if headerbg color null headerbg color color cyan return headerbg color getheaderbg_color headerbg_color headerbg_color gethdrtextbg_printcolor_id headerbg_color mprintcolor getctx getcolor headerbg_color headerbg_color headerbg_color get header line color return color or blue black public color getheaderline color if hdrline color null return hdrline color int i gethdrline printcolor id if i 0 hdrline color m print color get get ctx i get color if hdrline color null hdrline color m print color black blue return hdrline color getheaderline_color hdrline_color hdrline_color gethdrline_printcolor_id hdrline_color mprintcolor getctx getcolor hdrline_color hdrline_color mprintcolor blackblue hdrline_color get header stroke return header stroke default solid 2pt public stroke getheader stroke if header stroke null float width get hdr stroke float value if get hdr stroke type null hdrstroketype solidline equals get hdr stroke type header stroke new basic stroke width else if hdrstroketype dashedline equals get hdr stroke type header stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dashed width 0 0f else if hdrstroketype dottedline equals get hdr stroke type header stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dotted width 0 0f else if hdrstroketype dash dottedline equals get hdr stroke type header stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f getpatterndash dotted width 0 0f default fallback if header stroke null header stroke new basic stroke width return header stroke getheader_stroke header_stroke gethdrstroke floatvalue gethdrstroketype hdrstroketype_solidline gethdrstroketype header_stroke basicstroke hdrstroketype_dashedline gethdrstroketype header_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndashed hdrstroketype_dottedline gethdrstroketype header_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndotted hdrstroketype_dash_dottedline gethdrstroketype header_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndash_dotted header_stroke header_stroke basicstroke header_stroke get header stroke for horizontal lines return stroke in pt default 2 public big decimal get hdr stroke big decimal ret value super get hdr stroke if ret value null env zero compare to ret value 0 ret value new big decimal 2 0 return ret value bigdecimal gethdrstroke bigdecimal retvalue gethdrstroke retvalue compareto retvalue retvalue bigdecimal retvalue get function font return function font or bold italic standard font public font getfunct font if funct font null return funct font int i getfunct printfont id if i 0 funct font m print font get i get font if funct font null funct font new font standard font get name font bold font italic standard font get size return funct font bolditalic getfunct_font funct_font funct_font getfunct_printfont_id funct_font mprintfont getfont funct_font funct_font standard_font getname standard_font getsize funct_font get function bg color return color or white public color getfunctbg color if functbg color null return functbg color int i getfunctbg printcolor id if i 0 functbg color m print color get get ctx i get color if functbg color null functbg color color white return functbg color getfunctbg_color functbg_color functbg_color getfunctbg_printcolor_id functbg_color mprintcolor getctx getcolor functbg_color functbg_color functbg_color get function fg color return color or green dark public color getfunctfg color if functfg color null return functfg color int i getfunctfg printcolor id if i 0 functfg color m print color get get ctx i get color if functfg color null functfg color m print color dark green return functfg color getfunctfg_color functfg_color functfg_color getfunctfg_printcolor_id functfg_color mprintcolor getctx getcolor functfg_color functfg_color mprintcolor darkgreen functfg_color get parameter font return italic standard font public font getparameter font if parameter font null parameter font new font standard font get name font italic standard font get size return parameter font getparameter_font parameter_font parameter_font standard_font getname standard_font getsize parameter_font get parameter color return dark gray public color getparameter color if parameter color null parameter color color dark gray return parameter color getparameter_color parameter_color parameter_color darkgray parameter_color get top page header font return bold standard font public font getpageheader font if pageheader font null pageheader font new font standard font get name font bold standard font get size return pageheader font getpageheader_font pageheader_font pageheader_font standard_font getname standard_font getsize pageheader_font get page header fg color return color or blue black public color getpageheaderfg color if pageheaderfg color null pageheaderfg color m print color black blue return pageheaderfg color fg_color getpageheaderfg_color pageheaderfg_color pageheaderfg_color mprintcolor blackblue pageheaderfg_color get page header bg color return color or white public color getpageheaderbg color if pageheaderbg color null pageheaderbg color color white return pageheaderbg color bg_color getpageheaderbg_color pageheaderbg_color pageheaderbg_color pageheaderbg_color get page footer font return 2pt smaller standard font public font getpagefooter font if pagefooter font null pagefooter font new font standard font get name font plain standard font get size 2 return pagefooter font getpagefooter_font pagefooter_font pagefooter_font standard_font getname standard_font getsize pagefooter_font get page footer fg color return blue black public color getpagefooterfg color if pagefooterfg color null pagefooterfg color m print color black blue return pagefooterfg color pagefooter fg_color getpagefooterfg_color pagefooterfg_color pagefooterfg_color mprintcolor blackblue pagefooterfg_color get page footer bg color return white public color getpagefooterbg color if pagefooterbg color null pagefooterbg color color white return pagefooterbg color bg_color getpagefooterbg_color pagefooterbg_color pagefooterbg_color pagefooterbg_color get horizontal line color one db attribute for line color return color or gray light public color gethline color if lineh color null return lineh color int i getline printcolor id if i 0 lineh color m print color get get ctx i get color if lineh color null lineh color color light gray return lineh color gethline_color lineh_color lineh_color getline_printcolor_id lineh_color mprintcolor getctx getcolor lineh_color lineh_color lightgray lineh_color get verical line color one db attribute for line color return color or gray light public color getvline color if linev color null return linev color int i getline printcolor id if i 0 linev color m print color get get ctx i get color if linev color null linev color color light gray return linev color getvline_color linev_color linev_color getline_printcolor_id linev_color mprintcolor getctx getcolor linev_color linev_color lightgray linev_color get horizontal line stroke same db line column return solid line baded on line width default solid 1p public stroke gethline stroke if lineh stroke null float width get line stroke float value 2 if get hdr stroke type null linestroketype dottedline equals get line stroke type lineh stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dotted width 0 0f else if linestroketype solidline equals get line stroke type lineh stroke new basic stroke width else if linestroketype dashedline equals get line stroke type lineh stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dashed width 0 0f else if linestroketype dash dottedline equals get line stroke type lineh stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f getpatterndash dotted width 0 0f default fallback if lineh stroke null lineh stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dotted width 0 0f return lineh stroke gethline_stroke lineh_stroke getlinestroke floatvalue gethdrstroketype linestroketype_dottedline getlinestroketype lineh_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndotted linestroketype_solidline getlinestroketype lineh_stroke basicstroke linestroketype_dashedline getlinestroketype lineh_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndashed linestroketype_dash_dottedline getlinestroketype lineh_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndash_dotted lineh_stroke lineh_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndotted lineh_stroke get vertical line stroke same db line column return line based on line 1 2 of width and stroke default dotted 1 2p public stroke getvline stroke if linev stroke null float width get line stroke float value 2 if get hdr stroke type null linestroketype dottedline equals get line stroke type linev stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dotted width 0 0f else if linestroketype solidline equals get line stroke type linev stroke new basic stroke width else if linestroketype dashedline equals get line stroke type linev stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dashed width 0 0f else if linestroketype dash dottedline equals get line stroke type linev stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f getpatterndash dotted width 0 0f default fallback if linev stroke null linev stroke new basic stroke width basic stroke cap butt basic stroke join bevel 1 0f get pattern dotted width 0 0f return linev stroke getvline_stroke linev_stroke getlinestroke floatvalue gethdrstroketype linestroketype_dottedline getlinestroketype linev_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndotted linestroketype_solidline getlinestroketype linev_stroke basicstroke linestroketype_dashedline getlinestroketype linev_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndashed linestroketype_dash_dottedline getlinestroketype linev_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndash_dotted linev_stroke linev_stroke basicstroke basicstroke cap_butt basicstroke join_bevel getpatterndotted linev_stroke get horizontal stroke for lines return stroke in pt default 1 public big decimal get line stroke big decimal ret value super get line stroke if ret value null env zero compare to ret value 0 ret value new big decimal 1 0 return ret value bigdecimal getlinestroke bigdecimal retvalue getlinestroke retvalue compareto retvalue retvalue bigdecimal retvalue get vertical stroke for lines return stroke in pt default 1 public big decimal getv line stroke big decimal ret value super get line stroke if ret value null env zero compare to ret value 0 ret value new big decimal 1 0 return ret value bigdecimal getvlinestroke bigdecimal retvalue getlinestroke retvalue compareto retvalue retvalue bigdecimal retvalue get pattern dotted param width width of line return pattern private float get pattern dotted float width return new float 2 width 2 width getpatterndotted get pattern dashed param width width of line return pattern private float get pattern dashed float width return new float 10 width 4 width getpatterndashed get pattern dash dotted param width width of line return pattern private float getpatterndash dotted float width return new float 10 width 2 width 2 width 2 width getpatterndash_dotted get table format param ctx context param ad printtableformat id table format param standard font standard font return table format static public m print table format get properties ctx int ad printtableformat id font standard font integer ii new integer ad printtableformat id m print table format tf m print table format s cache get ii if tf null if ad printtableformat id 0 tf get default ctx else tf new m print table format ctx ad printtableformat id null s cache put ii tf tf setstandard font standard font return tf ad_printtableformat_id standard_font mprinttableformat ad_printtableformat_id standard_font ad_printtableformat_id mprinttableformat mprinttableformat s_cache ad_printtableformat_id getdefault mprinttableformat ad_printtableformat_id s_cache setstandard_font standard_font get table format param ctx context param ad printtableformat id table format param ad printfont id standard font return table format static public m print table format get properties ctx int ad printtableformat id int ad printfont id return get ctx ad printtableformat id m print font get ad printfont id get font ad_printtableformat_id ad_printfont_id mprinttableformat ad_printtableformat_id ad_printfont_id ad_printtableformat_id mprintfont ad_printfont_id getfont get default table format param ctx context return default table format need to set standard font static public m print table format get default properties ctx m print table format tf null string sql select from ad printtableformat where ad client id in 0 and is active y order by is default desc ad client id desc int ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next tf new m print table format ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return tf mprinttableformat getdefault mprinttableformat ad_printtableformat ad_client_id isactive isdefault ad_client_id ad_client_id getad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery mprinttableformat s_log public class emerald theme extends default metal theme public string get name return emerald emeraldtheme defaultmetaltheme getname private final colorui resource primary3 new colorui resource 153 244 173 protected colorui resource get primary1 return primary1 coloruiresource coloruiresource coloruiresource getprimary1 protected colorui resource get primary2 return primary2 coloruiresource getprimary2 protected colorui resource get primary3 return primary3 coloruiresource getprimary3 standard constructor public x t replenish properties ctx int t replenish id string trx name super ctx t replenish id trx name if t replenish id 0 setad pinstance id 0 setc bpartner id 0 setlevel max env zero setlevel min env zero setm product id 0 setm warehouse id 0 set replenish type null x_t_replenish t_replenish_id trxname t_replenish_id trxname t_replenish_id setad_pinstance_id setc_bpartner_id setlevel_max setlevel_min setm_product_id setm_warehouse_id setreplenishtype load constructor public x t replenish properties ctx result set rs string trx name super ctx rs trx name x_t_replenish resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t replenish append get id append return sb to string tostring stringbuffer stringbuffer x_t_replenish get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set maximum level maximum inventory level for this product public void setlevel max big decimal level max if level max null throw new illegal argument exception level max is mandatory set value level max level max setlevel_max bigdecimal level_max level_max illegalargumentexception level_max set_value level_max level_max get maximum level maximum inventory level for this product public big decimal getlevel max big decimal bd big decimal get value level max if bd null return env zero return bd bigdecimal getlevel_max bigdecimal bigdecimal get_value level_max set minimum level minimum inventory level for this product public void setlevel min big decimal level min if level min null throw new illegal argument exception level min is mandatory set value level min level min setlevel_min bigdecimal level_min level_min illegalargumentexception level_min set_value level_min level_min get minimum level minimum inventory level for this product public big decimal getlevel min big decimal bd big decimal get value level min if bd null return env zero return bd bigdecimal getlevel_min bigdecimal bigdecimal get_value level_min set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int m warehousesource id ad reference id 197 set source warehouse optional warehouse to replenish from public void setm warehousesource id int m warehousesource id if m warehousesource id 0 set value m warehousesource id null else set value m warehousesource id new integer m warehousesource id m_warehousesource_id_ad_reference_id setm_warehousesource_id m_warehousesource_id m_warehousesource_id set_value m_warehousesource_id set_value m_warehousesource_id m_warehousesource_id get source warehouse optional warehouse to replenish from public int getm warehousesource id integer ii integer get value m warehousesource id if ii null return 0 return ii int value getm_warehousesource_id get_value m_warehousesource_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set minimum order qty minimum order quantity in uom public void setorder min big decimal order min set value order min order min setorder_min bigdecimal order_min set_value order_min order_min get minimum order qty minimum order quantity in uom public big decimal getorder min big decimal bd big decimal get value order min if bd null return env zero return bd bigdecimal getorder_min bigdecimal bigdecimal get_value order_min set order pack qty package order size in uom e g order set of 5 units public void setorder pack big decimal order pack set value order pack order pack setorder_pack bigdecimal order_pack set_value order_pack order_pack get order pack qty package order size in uom e g order set of 5 units public big decimal getorder pack big decimal bd big decimal get value order pack if bd null return env zero return bd bigdecimal getorder_pack bigdecimal bigdecimal get_value order_pack set on hand quantity on hand quantity public void set qty on hand big decimal qty on hand set value qty on hand qty on hand setqtyonhand bigdecimal qtyonhand set_value qtyonhand qtyonhand get on hand quantity on hand quantity public big decimal get qty on hand big decimal bd big decimal get value qty on hand if bd null return env zero return bd bigdecimal getqtyonhand bigdecimal bigdecimal get_value qtyonhand set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered set value qty ordered qty ordered setqtyordered bigdecimal qtyordered set_value qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set reserved quantity reserved quantity public void set qty reserved big decimal qty reserved set value qty reserved qty reserved setqtyreserved bigdecimal qtyreserved set_value qtyreserved qtyreserved get reserved quantity reserved quantity public big decimal get qty reserved big decimal bd big decimal get value qty reserved if bd null return env zero return bd bigdecimal getqtyreserved bigdecimal bigdecimal get_value qtyreserved set quantity to order public void set qty to order big decimal qty to order set value qty to order qty to order setqtytoorder bigdecimal qtytoorder set_value qtytoorder qtytoorder get quantity to order public big decimal get qty to order big decimal bd big decimal get value qty to order if bd null return env zero return bd bigdecimal getqtytoorder bigdecimal bigdecimal get_value qtytoorder public static final string replenishtype custom 9 set replenish type method for re ordering a product public void set replenish type string replenish type if replenish type null throw new illegal argument exception replenish type is mandatory if replenish type equals 0 replenish type equals 1 replenish type equals 2 replenish type equals 9 else throw new illegal argument exception replenish type invalid value replenish type reference id 164 0 1 2 9 if replenish type length 1 log warning length 1 truncated replenish type replenish type substring 0 0 set value replenish type replenish type replenishtype_custom setreplenishtype replenishtype replenishtype illegalargumentexception replenishtype replenishtype replenishtype replenishtype replenishtype illegalargumentexception replenishtype replenishtype reference_id replenishtype replenishtype replenishtype set_value replenishtype replenishtype get replenish type method for re ordering a product public string get replenish type return string get value replenish type getreplenishtype get_value replenishtype public static final string replenishmentcreate requisition por set create create from replenishment public void set replenishment create string replenishment create if replenishment create null throw new illegal argument exception replenishment create is mandatory if replenishment create null replenishment create equals mmm replenishment create equals poo replenishment create equals por else throw new illegal argument exception replenishment create invalid value replenishment create reference id 329 mmm poo por if replenishment create null replenishment create length 1 log warning length 1 truncated replenishment create replenishment create substring 0 0 set value replenishment create replenishment create replenishmentcreate_requisition setreplenishmentcreate replenishmentcreate replenishmentcreate illegalargumentexception replenishmentcreate replenishmentcreate replenishmentcreate replenishmentcreate replenishmentcreate illegalargumentexception replenishmentcreate replenishmentcreate reference_id replenishmentcreate replenishmentcreate replenishmentcreate replenishmentcreate set_value replenishmentcreate replenishmentcreate get create create from replenishment public string get replenishment create return string get value replenishment create getreplenishmentcreate get_value replenishmentcreate persistency constructor param ctx context param ignored ignored public m table access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mtableaccess trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m table access properties ctx result set rs string trx name super ctx rs trx name mtableaccess resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m table access sb append ad role id append getad role id append ad table id append getad table id append exclude append is exclude append type append get access type rule if accesstyperule accessing equals get access type rule sb append read only append is read only else if accesstyperule exporting equals get access type rule sb append can export append is can export else if accesstyperule reporting equals get access type rule sb append can report append is can report sb append return sb to string tostring stringbuffer stringbuffer mtableaccess ad_role_id getad_role_id ad_table_id getad_table_id isexclude getaccesstyperule accesstyperule_accessing getaccesstyperule readonly isreadonly accesstyperule_exporting getaccesstyperule canexport iscanexport accesstyperule_reporting getaccesstyperule canreport iscanreport tostring extended string representation return extended info public string to stringx properties ctx string in msg get msg ctx include string ex msg get msg ctx exclude string buffer sb new string buffer sb append msg translate ctx ad table id append append get table name ctx if accesstyperule accessing equals get access type rule sb append append msg translate ctx is read only append append is read only else if accesstyperule exporting equals get access type rule sb append append msg translate ctx is can export append append is can export else if accesstyperule reporting equals get access type rule sb append append msg translate ctx is can report append append is can report sb append append is exclude ex in return sb to string tostringx getmsg getmsg stringbuffer stringbuffer ad_table_id gettablename accesstyperule_accessing getaccesstyperule isreadonly isreadonly accesstyperule_exporting getaccesstyperule iscanexport iscanexport accesstyperule_reporting getaccesstyperule iscanreport iscanreport isexclude tostring get table name param ctx context return table name public string get table name properties ctx if m tablename null string sql select table name from ad table where ad table id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad table id result set rs pstmt execute query if rs next m tablename rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe get table name e try if pstmt null pstmt close pstmt null catch exception e pstmt null get clear text string real name msg translate ctx m tablename id if real name equals m tablename id m tablename real name return m tablename gettablename m_tablename tablename ad_table ad_table_id preparedstatement preparestatement get_trxname setint getad_table_id resultset executequery m_tablename getstring gettablename realname m_tablename _id realname m_tablename _id m_tablename realname m_tablename prepare e g get parameters protected void prepare string buffer sb new string buffer ad pinstance id append getad pinstance id parameter process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c acctschema id p c acctschema id big decimal para i get parameter int value else if name equals c period id p c period id big decimal para i get parameter int value else if name equals date acct p dateacct from timestamp para i get parameter p dateacct to timestamp para i getparameter to else if name equals pa hierarchy id p pa hierarchy id para i get parameter as int else if name equals ad org id p ad org id big decimal para i get parameter int value else if name equals account id p account id big decimal para i get parameter int value else if name equals account value p accountvalue from string para i get parameter p accountvalue to string para i getparameter to else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else if name equals m product id p m product id big decimal para i get parameter int value else if name equals c project id p c project id big decimal para i get parameter int value else if name equals c activity id p c activity id big decimal para i get parameter int value else if name equals c salesregion id p c salesregion id big decimal para i get parameter int value else if name equals c campaign id p c campaign id big decimal para i get parameter int value else if name equals posting type p postingtype string para i get parameter else log log level severe unknown parameter name mandatory c acctschema id m parameterwhere append c acctschema id append p c acctschema id optional account id if p account id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype account p account id if p accountvalue from null p accountvalue from length 0 p accountvalue from null if p accountvalue to null p accountvalue to length 0 p accountvalue to null if p accountvalue from null p accountvalue to null m parameterwhere append and account id is null or exists select from c elementvalue ev append where account id ev c elementvalue id and ev value append db to string p accountvalue from append and ev value append db to string p accountvalue to append else if p accountvalue from null p accountvalue to null m parameterwhere append and account id is null or exists select from c elementvalue ev append where account id ev c elementvalue id and ev value append db to string p accountvalue from append else if p accountvalue from null p accountvalue to null m parameterwhere append and account id is null or exists select from c elementvalue ev append where account id ev c elementvalue id and ev value append db to string p accountvalue to append optional org if p ad org id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype organization p ad org id optional b partner if p c bpartner id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype bpartner p c bpartner id optional product if p m product id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype product p m product id optional project if p c project id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype project p c project id optional activity if p c activity id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype activity p c activity id optional campaign if p c campaign id 0 m parameterwhere append and c campaign id append p c campaign id m parameterwhere append and append m report tree get where clause get ctx m acct schema element elementtype campaign p c campaign id optional sales region if p c salesregion id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype salesregion p c salesregion id mandatory posting type m parameterwhere append and posting type append p postingtype append set date acct sb append date acct append p dateacct from append append p dateacct to sb append where append m parameterwhere log fine sb to string stringbuffer stringbuffer ad_pinstance_id getad_pinstance_id processinfoparameter getparameter getparametername getparameter c_acctschema_id p_c_acctschema_id bigdecimal getparameter intvalue c_period_id p_c_period_id bigdecimal getparameter intvalue dateacct p_dateacct_from getparameter p_dateacct_to getparameter_to pa_hierarchy_id p_pa_hierarchy_id getparameterasint ad_org_id p_ad_org_id bigdecimal getparameter intvalue account_id p_account_id bigdecimal getparameter intvalue accountvalue p_accountvalue_from getparameter p_accountvalue_to getparameter_to c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue m_product_id p_m_product_id bigdecimal getparameter intvalue c_project_id p_c_project_id bigdecimal getparameter intvalue c_activity_id p_c_activity_id bigdecimal getparameter intvalue c_salesregion_id p_c_salesregion_id bigdecimal getparameter intvalue c_campaign_id p_c_campaign_id bigdecimal getparameter intvalue postingtype p_postingtype getparameter c_acctschema_id m_parameterwhere c_acctschema_id p_c_acctschema_id account_id p_account_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_account p_account_id p_accountvalue_from p_accountvalue_from p_accountvalue_from p_accountvalue_to p_accountvalue_to p_accountvalue_to p_accountvalue_from p_accountvalue_to m_parameterwhere account_id c_elementvalue account_id c_elementvalue_id to_string p_accountvalue_from to_string p_accountvalue_to p_accountvalue_from p_accountvalue_to m_parameterwhere account_id c_elementvalue account_id c_elementvalue_id to_string p_accountvalue_from p_accountvalue_from p_accountvalue_to m_parameterwhere account_id c_elementvalue account_id c_elementvalue_id to_string p_accountvalue_to p_ad_org_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_organization p_ad_org_id bpartner p_c_bpartner_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_bpartner p_c_bpartner_id p_m_product_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_product p_m_product_id p_c_project_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_project p_c_project_id p_c_activity_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_activity p_c_activity_id p_c_campaign_id m_parameterwhere c_campaign_id p_c_campaign_id m_parameterwhere mreporttree getwhereclause getctx macctschemaelement elementtype_campaign p_c_campaign_id p_c_salesregion_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_salesregion p_c_salesregion_id m_parameterwhere postingtype p_postingtype setdateacct dateacct p_dateacct_from p_dateacct_to m_parameterwhere tostring set start end date of report if not defined current month private void set date acct date defined if p dateacct from null if p dateacct to null p dateacct to new timestamp system current time millis return get date from period if p c period id 0 gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis system current time millis cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 cal set calendar day of month 1 set to first of month p dateacct from new timestamp cal get time in millis cal add calendar month 1 cal add calendar day of year 1 last of month p dateacct to new timestamp cal get time in millis return string sql select start date end date from c period where c period id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 p c period id result set rs pstmt execute query if rs next p dateacct from rs get timestamp 1 p dateacct to rs get timestamp 2 rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null setdateacct p_dateacct_from p_dateacct_to p_dateacct_to currenttimemillis p_c_period_id gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis currenttimemillis hour_of_day day_of_month p_dateacct_from gettimeinmillis day_of_year p_dateacct_to gettimeinmillis startdate enddate c_period c_period_id preparedstatement preparestatement setint p_c_period_id resultset executequery p_dateacct_from gettimestamp p_dateacct_to gettimestamp perform process return message to be translated protected string do it create balance line create detail lines int ad printformat id 134 get process info set transient object m print format get get ctx ad printformat id false log fine system current time millis m start ms return doit createbalanceline createdetaillines ad_printformat_id getprocessinfo settransientobject mprintformat getctx ad_printformat_id currenttimemillis m_start create beginning balance line private void create balance line string buffer sql new string buffer s insert ad pinstance id fact acct id sql append select append getad pinstance id append 0 ad client id ad org id created created by updated updated by sql append getad client id append if p ad org id 0 sql append 0 else sql append p ad org id sql append sys date append getad user id append sys date append getad user id append c acctschema id account id account value date trx date acct c period id sql append p c acctschema id append if p account id 0 sql append null else sql append p account id if p accountvalue from null sql append append db to string p accountvalue from else if p accountvalue to null sql append else sql append null timestamp balance day p dateacct from time util add days p dateacct from 1 sql append null append db to date balance day true append if p c period id 0 sql append null else sql append p c period id sql append ad table id record id line id sql append null null null gl category id gl budget id c tax id m locator id posting type sql append null null null null append p postingtype append c currency id amt source dr amt source cr amt source balance sql append null null null null amt acct dr amt acct cr amt acct balance c uom id qty sql append coalesce sum amt acct dr 0 coalesce sum amt acct cr 0 coalesce sum amt acct dr 0 coalesce sum amt acct cr 0 null coalesce sum qty 0 m product id c bpartner id ad orgtrx id c locfrom id c locto id if p m product id 0 sql append null else sql append p m product id sql append if p c bpartner id 0 sql append null else sql append p c bpartner id sql append if p ad orgtrx id 0 sql append null else sql append p ad orgtrx id sql append if p c locfrom id 0 sql append null else sql append p c locfrom id sql append if p c locto id 0 sql append null else sql append p c locto id sql append c salesregion id c project id c campaign id c activity id if p c salesregion id 0 sql append null else sql append p c salesregion id sql append if p c project id 0 sql append null else sql append p c project id sql append if p c campaign id 0 sql append null else sql append p c campaign id sql append if p c activity id 0 sql append null else sql append p c activity id sql append user1 id user2 id a asset id description if p user1 id 0 sql append null else sql append p user1 id sql append if p user2 id 0 sql append null else sql append p user2 id sql append null null sql append from fact acct where ad client id append getad client id append and append m parameterwhere append and date acct append db to date p dateacct from true start beginning of year if p account id 0 m acct new m element value get ctx p account id get trxname if m acct is balance sheet m period first m period get first in year get ctx p dateacct from if first null sql append and date acct append db to date first get start date true else log log level severe first period not found int no db execute update sql to string get trxname if no 0 log fine sql to string log fine no account id p account id createbalanceline stringbuffer stringbuffer s_insert ad_pinstance_id fact_acct_id getad_pinstance_id ad_client_id ad_org_id createdby updatedby getad_client_id p_ad_org_id p_ad_org_id sysdate getad_user_id sysdate getad_user_id c_acctschema_id account_id accountvalue datetrx dateacct c_period_id p_c_acctschema_id p_account_id p_account_id p_accountvalue_from to_string p_accountvalue_from p_accountvalue_to balanceday p_dateacct_from timeutil adddays p_dateacct_from to_date balanceday p_c_period_id p_c_period_id ad_table_id record_id line_id gl_category_id gl_budget_id c_tax_id m_locator_id postingtype p_postingtype c_currency_id amtsourcedr amtsourcecr amtsourcebalance amtacctdr amtacctcr amtacctbalance c_uom_id amtacctdr amtacctcr amtacctdr amtacctcr m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id p_m_product_id p_m_product_id p_c_bpartner_id p_c_bpartner_id p_ad_orgtrx_id p_ad_orgtrx_id p_c_locfrom_id p_c_locfrom_id p_c_locto_id p_c_locto_id c_salesregion_id c_project_id c_campaign_id c_activity_id p_c_salesregion_id p_c_salesregion_id p_c_project_id p_c_project_id p_c_campaign_id p_c_campaign_id p_c_activity_id p_c_activity_id user1_id user2_id a_asset_id p_user1_id p_user1_id p_user2_id p_user2_id fact_acct ad_client_id getad_client_id m_parameterwhere dateacct to_date p_dateacct_from p_account_id m_acct melementvalue getctx p_account_id get_trxname m_acct isbalancesheet mperiod mperiod getfirstinyear getctx p_dateacct_from dateacct to_date getstartdate executeupdate tostring get_trxname tostring account_id p_account_id create beginning balance line private void create detail lines string buffer sql new string buffer s insert ad pinstance id fact acct id sql append select append getad pinstance id append fact acct id ad client id ad org id created created by updated updated by sql append getad client id append ad org id created created by updated updated by c acctschema id account id date trx account value date acct c period id sql append c acctschema id account id null date trx date acct c period id ad table id record id line id sql append ad table id record id line id gl category id gl budget id c tax id m locator id posting type sql append gl category id gl budget id c tax id m locator id posting type c currency id amt source dr amt source cr amt source balance sql append c currency id amt source dr amt source cr amt source dr amt source cr amt acct dr amt acct cr amt acct balance c uom id qty sql append amt acct dr amt acct cr amt acct dr amt acct cr c uom id qty m product id c bpartner id ad orgtrx id c locfrom id c locto id sql append m product id c bpartner id ad orgtrx id c locfrom id c locto id c salesregion id c project id c campaign id c activity id sql append c salesregion id c project id c campaign id c activity id user1 id user2 id a asset id description sql append user1 id user2 id a asset id description sql append from fact acct where ad client id append getad client id append and append m parameterwhere append and date acct append db to date p dateacct from true append and trunc date acct append db to date p dateacct to true int no db execute update sql to string get trxname if no 0 log fine sql to string log fine no account id p account id update account value string sql2 update t trialbalance tb set account value select value from c elementvalue ev where ev c elementvalue id tb account id where tb account id is not null no db execute update sql2 get trxname if no 0 log fine set account value no createdetaillines stringbuffer stringbuffer s_insert ad_pinstance_id fact_acct_id getad_pinstance_id fact_acct_id ad_client_id ad_org_id createdby updatedby getad_client_id ad_org_id createdby updatedby c_acctschema_id account_id datetrx accountvalue dateacct c_period_id c_acctschema_id account_id datetrx dateacct c_period_id ad_table_id record_id line_id ad_table_id record_id line_id gl_category_id gl_budget_id c_tax_id m_locator_id postingtype gl_category_id gl_budget_id c_tax_id m_locator_id postingtype c_currency_id amtsourcedr amtsourcecr amtsourcebalance c_currency_id amtsourcedr amtsourcecr amtsourcedr amtsourcecr amtacctdr amtacctcr amtacctbalance c_uom_id amtacctdr amtacctcr amtacctdr amtacctcr c_uom_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_salesregion_id c_project_id c_campaign_id c_activity_id c_salesregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id a_asset_id user1_id user2_id a_asset_id fact_acct ad_client_id getad_client_id m_parameterwhere dateacct to_date p_dateacct_from dateacct to_date p_dateacct_to executeupdate tostring get_trxname tostring account_id p_account_id accountvalue t_trialbalance accountvalue c_elementvalue c_elementvalue_id account_id account_id executeupdate get_trxname accountvalue create m lookup param ctx context for access param window no window no param ad reference id display type param column id ad column id or ad process para id param language report language param column name key column name param ad reference value id ad reference list table param is parent parent prevents query to directly access value param validation code optional sql validation throws exception if lookup could not be created return m lookup public static m lookup get properties ctx int window no int column id int ad reference id language language string column name int ad reference value id boolean is parent string validation code throws exception m lookup info info get lookup info ctx window no column id ad reference id language column name ad reference value id is parent validation code if info null throw new exception m lookup create no lookup info return new m lookup info 0 mlookup windowno ad_reference_id column_id ad_column_id ad_process_para_id columnname ad_reference_value_id ad_reference isparent validationcode mlookup mlookup windowno column_id ad_reference_id columnname ad_reference_value_id isparent validationcode mlookupinfo getlookupinfo windowno column_id ad_reference_id columnname ad_reference_value_id isparent validationcode mlookup lookupinfo mlookup create m lookup param ctx context for access param window no window no param tab no tab no param column id ad column id or ad process para id param ad reference id display type return m lookup public static m lookup get properties ctx int window no int tab no int column id int ad reference id string column name int ad reference value id 0 boolean is parent false string validation code string sql select c column name c ad reference value id c is parent vr code from ad column c left outer join ad val rule vr on c ad val rule id vr ad val rule id where c ad column id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 column id result set rs pstmt execute query if rs next column name rs get string 1 ad reference value id rs get int 2 is parent y equals rs get string 3 validation code rs get string 4 else s log log level severe column not found ad column id column id rs close pstmt close pstmt null catch sql exception ex s log log level severe create ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m lookup info info get lookup info ctx window no column id ad reference id env get language ctx column name ad reference value id is parent validation code return new m lookup info tab no mlookup windowno tabno tabno column_id ad_column_id ad_process_para_id ad_reference_id mlookup mlookup windowno tabno column_id ad_reference_id columnname ad_reference_value_id isparent validationcode columnname ad_reference_value_id isparent ad_column ad_val_rule ad_val_rule_id ad_val_rule_id ad_column_id preparedstatement preparestatement setint column_id resultset executequery columnname getstring ad_reference_value_id getint isparent getstring validationcode getstring s_log ad_column_id column_id sqlexception s_log sqlexception mlookupinfo getlookupinfo windowno column_id ad_reference_id getlanguage columnname ad_reference_value_id isparent validationcode mlookup tabno get information for lookups based on column id for table columns or process parameters the sql returns three columns pre key value name is active where either key or value is null pre param ctx context for access param language report language param window no window no param column id ad column id or ad process para id param column name key column name param ad reference id display type param ad reference value id ad reference list table param is parent parent prevents query to directly access value param validation code optional sql validation return lookup info structure static public m lookup info get lookup info properties ctx int window no int column id int ad reference id language language string column name int ad reference value id boolean is parent string validation code m lookup info info null boolean need to add security true list if ad reference id display type list 17 info getlookup list language ad reference value id need to add security false table or search with reference value else if ad reference id display type table ad reference id display type search ad reference value id 0 info getlookup table ctx language window no ad reference value id table dir search id else info getlookup tabledir ctx language window no column name do we have basic info if info null s log severe no sql column name return null remaining values info ctx ctx info window no window no info column id column id info display type ad reference id info ad reference value id ad reference value id info is parent is parent info validation code validation code if info validation code null info validation code variables in sql where if info query index of 1 string newsql env parse context ctx window no info query false string newsql env parse context ctx 0 info query false only global if newsql length 0 s log severe sql parse error info query return null info query newsql direct query no validation security int pos order info query last index of order by boolean has where info query last index of where 1 if has where might be for a select sub query select select from where from select from where exists select from where access sql parser asp new access sql parser info query string main query asp get main sql has where main query index of where 1 if pos order 1 info query direct info query has where and where info key column else info query direct info query substring 0 pos order has where and where info key column validation string local validationcode if info validation code length 0 info is validated true else local validationcode env parse context ctx window no info validation code true if local validationcode length 0 returns if not all variables were parsed info is validated false else info is validated true add local validation if local validationcode length 0 info query info query substring 0 pos order has where and where local validationcode info query substring pos order add security if need to add security info query m role get default ctx false add accesssql info query info table name m role sql fullyqualified m role sql ro s log finest query info query s log finest direct info query direct return info column_id isactive windowno column_id ad_column_id ad_process_para_id columnname ad_reference_id ad_reference_value_id ad_reference isparent validationcode mlookupinfo getlookupinfo windowno column_id ad_reference_id columnname ad_reference_value_id isparent validationcode mlookupinfo needtoaddsecurity ad_reference_id displaytype getlookup_list ad_reference_value_id needtoaddsecurity reference_value ad_reference_id displaytype ad_reference_id displaytype ad_reference_value_id getlookup_table windowno ad_reference_value_id tabledir getlookup_tabledir windowno columnname s_log columnname windowno windowno column_id column_id displaytype ad_reference_id ad_reference_value_id ad_reference_value_id isparent isparent validationcode validationcode validationcode validationcode indexof parsecontext windowno parsecontext s_log posorder lastindexof haswhere lastindexof haswhere accesssqlparser accesssqlparser mainquery getmainsql haswhere mainquery indexof posorder querydirect haswhere keycolumn querydirect posorder haswhere keycolumn local_validationcode validationcode isvalidated local_validationcode parsecontext windowno validationcode local_validationcode isvalidated isvalidated local_validationcode posorder haswhere local_validationcode posorder needtoaddsecurity mrole getdefault addaccesssql tablename mrole sql_fullyqualified mrole sql_ro s_log s_log querydirect get lookup sql for lists param language report language param ad reference value id reference value return select null value name is active from ad ref list static public m lookup info getlookup list language language int ad reference value id string buffer realsql new string buffer select null ad ref list value if env is base language language ad ref list realsql append ad ref list name ad ref list is active from ad ref list else realsql append trl name ad ref list is active from ad ref list inner join ad ref list trl trl on ad ref list ad ref list id trl ad ref list id and trl ad language append language getad language append realsql append where ad ref list ad reference id append ad reference value id realsql append order by 2 return new m lookup info realsql to string ad ref list ad ref list value 101 101 m query get equal query ad reference id ad reference value id zoom window query ad_reference_value_id isactive ad_ref_list mlookupinfo getlookup_list ad_reference_value_id stringbuffer stringbuffer ad_ref_list isbaselanguage ad_ref_list ad_ref_list ad_ref_list isactive ad_ref_list ad_ref_list isactive ad_ref_list ad_ref_list_trl ad_ref_list ad_ref_list_id ad_ref_list_id ad_language getad_language ad_ref_list ad_reference_id ad_reference_value_id mlookupinfo tostring ad_ref_list ad_ref_list mquery getequalquery ad_reference_id ad_reference_value_id get lookup sql for list param language report language param ad reference value id reference value return select name from ad ref list where ad reference id x and value link column static public string getlookup listembed language language int ad reference value id string link column name string buffer realsql new string buffer select if env is base language language ad ref list realsql append ad ref list name from ad ref list else realsql append trl name from ad ref list inner join ad ref list trl trl on ad ref list ad ref list id trl ad ref list id and trl ad language append language getad language append realsql append where ad ref list ad reference id append ad reference value id append and ad ref list value append link column name return realsql to string ad_reference_value_id ad_ref_list ad_reference_id linkcolumn getlookup_listembed ad_reference_value_id linkcolumnname stringbuffer stringbuffer isbaselanguage ad_ref_list ad_ref_list ad_ref_list ad_ref_list ad_ref_list_trl ad_ref_list ad_ref_list_id ad_ref_list_id ad_language getad_language ad_ref_list ad_reference_id ad_reference_value_id ad_ref_list linkcolumnname tostring get lookup sql for table lookup param ctx context for access and dynamic access param language report language param window no window no param ad reference value id reference value return select key null name is active from table if key column end with id otherwise select null key name is active from table static private m lookup info getlookup table properties ctx language language int window no int ad reference value id try cache assume no language change string key string value of ad reference value id m lookup info ret value m lookup info s cachereftable get key if ret value null s log finest cache ret value return ret value clone it string sql0 select t table name ck column name as key column 1 2 cd column name as display column rt is value displayed cd is translated 3 5 rt where clause rt order by clause t ad window id t po window id 6 9 t ad table id 10 from ad ref table rt inner join ad table t on rt ad table id t ad table id inner join ad column ck on rt ad key ck ad column id inner join ad column cd on rt ad display cd ad column id where rt ad reference id and rt is active y and t is active y string key column null display column null table name null where clause null order by clause null boolean is translated false is value displayed false boolean isso trx n equals env get context ctx window no isso trx int zoom window 0 int zoom windowpo 0 int ad table id 0 boolean loaded false try prepared statement pstmt db prepare statement sql0 null pstmt set int 1 ad reference value id result set rs pstmt execute query if rs next table name rs get string 1 key column rs get string 2 display column rs get string 3 is value displayed y equals rs get string 4 is translated y equals rs get string 5 where clause rs get string 6 order by clause rs get string 7 zoom window rs get int 8 zoom windowpo rs get int 9 ad table id rs get int 10 loaded true rs close pstmt close catch sql exception e s log log level severe sql0 e return null if loaded s log log level severe no table reference table id ad reference value id return null string buffer realsql new string buffer select if key column ends with id realsql append null translated if is translated env is base language language table name realsql append table name append append key column append if key column ends with id realsql append null if is value displayed realsql append table name append value realsql append table name append trl append display column append append table name append is active realsql append from append table name append inner join append table name append trl on append table name append append key column append append table name append trl append key column append and append table name append trl ad language append language getad language append not translated else realsql append table name append append key column append if key column ends with id realsql append null if is value displayed realsql append table name append value realsql append table name append append display column realsql append append table name append is active realsql append from append table name add where clause m query zoom query null if where clause null string where where clause if where index of 1 where env parse context ctx window no where false if where length 0 where clause length 0 s log severe could not resolve where clause we have no context if where length 0 realsql append where append where if where index of 1 s log log level severe getlookup table table name where should be fully qualified where clause zoom query new m query table name zoom query add restriction where order by qualified term or by name if order by clause null realsql append order by append order by clause if order by clause index of 1 s log log level severe getlookup table table name order by must fully qualified order by clause else realsql append order by 3 s log finest ad reference value id ad reference value id realsql ret value new m lookup info realsql to string table name table name key column zoom window zoom windowpo zoom query s cachereftable put key ret value clone it return ret value windowno ad_reference_value_id isactive keycolumn _id isactive mlookupinfo getlookup_table windowno ad_reference_value_id valueof ad_reference_value_id mlookupinfo retvalue mlookupinfo s_cachereftable retvalue s_log retvalue retvalue cloneit tablename columnname keycolumn columnname displaycolumn isvaluedisplayed istranslated whereclause orderbyclause ad_window_id po_window_id ad_table_id ad_ref_table ad_table ad_table_id ad_table_id ad_column ad_key ad_column_id ad_column ad_display ad_column_id ad_reference_id isactive isactive keycolumn displaycolumn tablename whereclause orderbyclause istranslated isvaluedisplayed issotrx getcontext windowno issotrx zoomwindow zoomwindowpo ad_table_id preparedstatement preparestatement setint ad_reference_value_id resultset executequery tablename getstring keycolumn getstring displaycolumn getstring isvaluedisplayed getstring istranslated getstring whereclause getstring orderbyclause getstring zoomwindow getint zoomwindowpo getint ad_table_id getint sqlexception s_log s_log ad_reference_value_id stringbuffer stringbuffer keycolumn endswith _id istranslated isbaselanguage tablename tablename keycolumn keycolumn endswith _id isvaluedisplayed tablename tablename _trl displaycolumn tablename isactive tablename tablename _trl tablename keycolumn tablename _trl keycolumn tablename _trl ad_language getad_language tablename keycolumn keycolumn endswith _id isvaluedisplayed tablename tablename displaycolumn tablename isactive tablename mquery zoomquery whereclause whereclause indexof parsecontext windowno whereclause s_log whereclause indexof s_log getlookup_table tablename whereclause zoomquery mquery tablename zoomquery addrestriction orderbyclause orderbyclause orderbyclause indexof s_log getlookup_table tablename orderbyclause s_log ad_reference_value_id ad_reference_value_id retvalue mlookupinfo tostring tablename tablename keycolumn zoomwindow zoomwindowpo zoomquery s_cachereftable retvalue cloneit retvalue get embedded lookup sql for table lookup param language report language param base column base column name param base table base table name param ad reference value id reference value return select name from table static public string getlookup tableembed language language string base column string base table int ad reference value id string sql select t table name ck column name as key column cd column name as display column rt is value displayed cd is translated from ad ref table rt inner join ad table t on rt ad table id t ad table id inner join ad column ck on rt ad key ck ad column id inner join ad column cd on rt ad display cd ad column id where rt ad reference id and rt is active y and t is active y string key column display column table name boolean is translated is value displayed try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad reference value id result set rs pstmt execute query if rs next s log log level severe cannot find reference table id ad reference value id base base table base column rs close pstmt close return null table name rs get string 1 key column rs get string 2 display column rs get string 3 is value displayed rs get string 4 equals y is translated rs get string 5 equals y rs close pstmt close catch sql exception e s log log level severe sql e return null string buffer embedsql new string buffer select translated if is translated env is base language language table name if is value displayed embedsql append table name append value embedsql append table name append trl append display column embedsql append from append table name append inner join append table name append trl on append table name append append key column append append table name append trl append key column append and append table name append trl ad language append language getad language append not translated else if is value displayed embedsql append table name append value embedsql append table name append append display column embedsql append from append table name embedsql append where append base table append append base column embedsql append append table name append append key column return embedsql to string basecolumn basetable ad_reference_value_id getlookup_tableembed basecolumn basetable ad_reference_value_id tablename columnname keycolumn columnname displaycolumn isvaluedisplayed istranslated ad_ref_table ad_table ad_table_id ad_table_id ad_column ad_key ad_column_id ad_column ad_display ad_column_id ad_reference_id isactive isactive keycolumn displaycolumn tablename istranslated isvaluedisplayed preparedstatement preparestatement setint ad_reference_value_id resultset executequery s_log ad_reference_value_id basetable basecolumn tablename getstring keycolumn getstring displaycolumn getstring isvaluedisplayed getstring istranslated getstring sqlexception s_log stringbuffer stringbuffer istranslated isbaselanguage tablename isvaluedisplayed tablename tablename _trl displaycolumn tablename tablename _trl tablename keycolumn tablename _trl keycolumn tablename _trl ad_language getad_language isvaluedisplayed tablename tablename displaycolumn tablename basetable basecolumn tablename keycolumn tostring get lookup sql for direct table lookup param ctx context for access param language report language param column name column name param window no window for so trx return select key null name is active from table fully qualified static private m lookup info getlookup tabledir properties ctx language language int window no string column name if column name ends with id s log log level severe key does not end with id column name return null hardcoded b partner org if column name equals ad orgbp id column name ad org id string table name column name substring 0 column name length 3 boolean isso trx n equals env get context ctx window no isso trx int zoom window 0 int zoom windowpo 0 get display column names string sql0 select c column name c is translated c ad reference id c ad reference value id t ad window id t po window id from ad table t inner join ad column c on t ad table id c ad table id where table name and c is identifier y order by c seq no string key column column name array list lookup display column list new array list lookup display column boolean is translated false try prepared statement pstmt db prepare statement sql0 null pstmt set string 1 table name result set rs pstmt execute query while rs next lookup display column ldc new lookup display column rs get string 1 y equals rs get string 2 rs get int 3 rs get int 4 list add ldc s log fine getlookup tabledir column name ldc if is translated ldc is translated is translated true zoom window rs get int 5 zoom windowpo rs get int 6 rs close pstmt close catch sql exception e s log log level severe sql0 e return null do we have columns if list size 0 s log log level severe no identifier records found column name return null string buffer realsql new string buffer select realsql append table name append append key column append null string buffer display column new string buffer int size list size get display column for int i 0 i size i if i 0 display column append lookup display column ldc lookup display column list get i translated if ldc is translated env is base language language table name display column append table name append trl append ldc column name date else if display type is date ldc display type display column append db to char table name ldc column name ldc display type language getad language table dir else if ldc display type display type table dir ldc display type display type search ldc column name ends with id string embeddedsql getlookup tabledirembed language ldc column name table name if embeddedsql null display column append append embeddedsql append table else if ldc display type display type table ldc ad reference id 0 string embeddedsql getlookup tableembed language ldc column name table name ldc ad reference id if embeddedsql null display column append append embeddedsql append number else if display type is numeric ldc display type display column append db to char table name ldc column name ldc display type language getad language string else display column append table name append append ldc column name realsql append display column to string realsql append append table name append is active translation if is translated env is base language language table name realsql append from append table name append inner join append table name append trl on append table name append append key column append append table name append trl append key column append and append table name append trl ad language append language getad language append else no translation realsql append from append table name order by display realsql append order by 3 m query zoom query null corrected in v lookup if c log mgt is level finest s log fine column name column name realsql m lookup info l info new m lookup info realsql to string table name table name key column zoom window zoom windowpo zoom query return l info columnname windowno sotrx isactive mlookupinfo getlookup_tabledir windowno columnname columnname endswith _id s_log _id columnname bpartner columnname ad_orgbp_id columnname ad_org_id tablename columnname columnname issotrx getcontext windowno issotrx zoomwindow zoomwindowpo columnname istranslated ad_reference_id ad_reference_value_id ad_window_id po_window_id ad_table ad_column ad_table_id ad_table_id tablename isidentifier seqno keycolumn columnname arraylist lookupdisplaycolumn arraylist lookupdisplaycolumn istranslated preparedstatement preparestatement setstring tablename resultset executequery lookupdisplaycolumn lookupdisplaycolumn getstring getstring getint getint s_log getlookup_tabledir columnname istranslated istranslated istranslated zoomwindow getint zoomwindowpo getint sqlexception s_log s_log columnname stringbuffer stringbuffer tablename keycolumn stringbuffer displaycolumn stringbuffer displaycolumn _ lookupdisplaycolumn lookupdisplaycolumn istranslated isbaselanguage tablename displaycolumn tablename _trl columnname displaytype isdate displaytype displaycolumn to_char tablename columnname displaytype getad_language tabledir displaytype displaytype tabledir displaytype displaytype columnname endswith _id getlookup_tabledirembed columnname tablename displaycolumn displaytype displaytype ad_reference_id getlookup_tableembed columnname tablename ad_reference_id displaycolumn displaytype isnumeric displaytype displaycolumn to_char tablename columnname displaytype getad_language displaycolumn tablename columnname displaycolumn tostring tablename isactive istranslated isbaselanguage tablename tablename tablename _trl tablename keycolumn tablename _trl keycolumn tablename _trl ad_language getad_language tablename mquery zoomquery vlookup clogmgt islevelfinest s_log columnname columnname mlookupinfo linfo mlookupinfo tostring tablename tablename keycolumn zoomwindow zoomwindowpo zoomquery linfo get embedded sql for table dir lookup no translation param language report language param column name column name param base table base table return select column from table name where base table column name table name column name static public string getlookup tabledirembed language language string column name string base table return getlookup tabledirembed language column name base table column name tabledir columnname basetable tablename basetable columnname tablename columnname getlookup_tabledirembed columnname basetable getlookup_tabledirembed columnname basetable columnname get embedded sql for table dir lookup no translation param language report language param column name column name param base table base table param base column base column return select column from table name where base table base column table name column name static public string getlookup tabledirembed language language string column name string base table string base column string table name column name substring 0 column name length 3 get display column name first identifier column string sql select c column name c is translated c ad reference id c ad reference value id from ad table t inner join ad column c on t ad table id c ad table id where table name and c is identifier y order by c seq no array list lookup display column list new array list lookup display column try prepared statement pstmt db prepare statement sql null pstmt set string 1 table name result set rs pstmt execute query while rs next lookup display column ldc new lookup display column rs get string 1 y equals rs get string 2 rs get int 3 rs get int 4 list add ldc s log fine getlookup tabledirembed column name ldc rs close pstmt close catch sql exception e s log log level severe sql e return do we have columns if list size 0 s log log level severe no identifier records found column name return string buffer embedsql new string buffer select int size list size for int i 0 i size i if i 0 embedsql append lookup display column ldc lookup display column list get i date number if display type is date ldc display type display type is numeric ldc display type embedsql append db to char table name ldc column name ldc display type language getad language table dir else if ldc display type display type table dir ldc display type display type search ldc column name ends with id string embeddedsql getlookup tabledirembed language ldc column name table name embedsql append append embeddedsql append string else embedsql append table name append append ldc column name embedsql append from append table name embedsql append where append base table append append base column embedsql append append table name append append column name return embedsql to string tabledir columnname basetable basecolumn tablename basetable basecolumn tablename columnname getlookup_tabledirembed columnname basetable basecolumn tablename columnname columnname columnname istranslated ad_reference_id ad_reference_value_id ad_table ad_column ad_table_id ad_table_id tablename isidentifier seqno arraylist lookupdisplaycolumn arraylist lookupdisplaycolumn preparedstatement preparestatement setstring tablename resultset executequery lookupdisplaycolumn lookupdisplaycolumn getstring getstring getint getint s_log getlookup_tabledirembed columnname sqlexception s_log s_log columnname stringbuffer stringbuffer lookupdisplaycolumn lookupdisplaycolumn displaytype isdate displaytype displaytype isnumeric displaytype to_char tablename columnname displaytype getad_language tabledir displaytype displaytype tabledir displaytype displaytype columnname endswith _id getlookup_tabledirembed columnname tablename tablename columnname tablename basetable basecolumn tablename columnname tostring constructor param ad table id table of document source param record id record of document param line id optional line id public fact line properties ctx int ad table id int record id int line id string trx name super ctx 0 trx name setad client id 0 do not derive setad org id 0 do not derive set amt acct cr env zero set amt acct dr env zero set amt source cr env zero set amt source dr env zero log trace this log l1 user fact line ad table id record id setad table id ad table id setrecord id record id setline id line id ad_table_id record_id line_id factline ad_table_id record_id line_id trxname trxname setad_client_id setad_org_id setamtacctcr setamtacctdr setamtsourcecr setamtsourcedr l1_user factline ad_table_id record_id setad_table_id ad_table_id setrecord_id record_id setline_id line_id create reversal negate dr cr of the line param description new description return reversal line public fact line reverse string description fact line reversal new fact line get ctx getad table id getrecord id getline id get trxname reversal set client org this needs to be set explicitly reversal set document info m doc m docline reversal set account m acctschema m acct reversal set posting type get posting type reversal set amt source getc currency id get amt source dr negate get amt source cr negate reversal convert reversal set description description return reversal factline factline factline getctx getad_table_id getrecord_id getline_id get_trxname setclientorg setdocumentinfo m_doc m_docline setaccount m_acctschema m_acct setpostingtype getpostingtype setamtsource getc_currency_id getamtsourcedr getamtsourcecr setdescription create accrual flip cr dr of the line param description new description return accrual line public fact line accrue string description fact line accrual new fact line get ctx getad table id getrecord id getline id get trxname accrual set client org this needs to be set explicitly accrual set document info m doc m docline accrual set account m acctschema m acct accrual set posting type get posting type accrual set amt source getc currency id get amt source cr get amt source dr accrual convert accrual set description description return accrual factline factline factline getctx getad_table_id getrecord_id getline_id get_trxname setclientorg setdocumentinfo m_doc m_docline setaccount m_acctschema m_acct setpostingtype getpostingtype setamtsource getc_currency_id getamtsourcecr getamtsourcedr setdescription set account info param acct schema account schema param acct account public void set account m acct schema acct schema m account acct m acctschema acct schema setc acctschema id acct schema getc acctschema id m acct acct if getad client id 0 setad client id m acct getad client id setaccount id m acct getaccount id setc subacct id m acct getc subacct id acctschema setaccount macctschema acctschema maccount m_acctschema acctschema setc_acctschema_id acctschema getc_acctschema_id m_acct getad_client_id setad_client_id m_acct getad_client_id setaccount_id m_acct getaccount_id setc_subacct_id m_acct getc_subacct_id set source amounts param c currency id currency param amt source dr source amount dr param amt source cr source amount cr return true if any if the amount is not zero public boolean set amt source int c currency id big decimal amt source dr big decimal amt source cr setc currency id c currency id if amt source dr null set amt source dr amt source dr if amt source cr null set amt source cr amt source cr one needs to be non zero if get amt source dr equals env zero get amt source cr equals env zero return false return true c_currency_id amtsourcedr amtsourcecr setamtsource c_currency_id bigdecimal amtsourcedr bigdecimal amtsourcecr setc_currency_id c_currency_id amtsourcedr setamtsourcedr amtsourcedr amtsourcecr setamtsourcecr amtsourcecr getamtsourcedr getamtsourcecr set accounted amounts alternative call convert param amt acct dr acct amount dr param amt acct cr acct amount cr public void set amt acct big decimal amt acct dr big decimal amt acct cr set amt acct dr amt acct dr set amt acct cr amt acct cr amtacctdr amtacctcr setamtacct bigdecimal amtacctdr bigdecimal amtacctcr setamtacctdr amtacctdr setamtacctcr amtacctcr set document info param doc document param doc line doc line public void set document info doc doc doc line doc line m doc doc m docline doc line reset setad org id 0 setc salesregion id 0 client if getad client id 0 setad client id m doc getad client id date trx set date trx m doc get date doc if m docline null m docline get date doc null set date trx m docline get date doc date acct set date acct m doc get date acct if m docline null m docline get date acct null set date acct m docline get date acct period tax if m docline null m docline getc period id 0 setc period id m docline getc period id else setc period id m doc getc period id if m docline null setc tax id m docline getc tax id description string buffer description new string buffer m doc get document no if m docline null description append append m docline get line if m docline get description null description append append m docline get description append else if m doc get description null m doc get description length 0 description append append m doc get description append else if m doc get description null m doc get description length 0 description append append m doc get description append set description description to string journal info setgl budget id m doc getgl budget id setgl category id m doc getgl category id product if m docline null setm product id m docline getm product id if getm product id 0 setm product id m doc getm product id uom if m docline null setc uom id m docline getc uom id qty if get value qty null not previously set set qty m doc get qty neg outgoing if m docline null set qty m docline get qty loc from maybe set earlier if getc locfrom id 0 m docline null setc locfrom id m docline getc locfrom id if getc locfrom id 0 setc locfrom id m doc getc locfrom id loc to maybe set earlier if getc locto id 0 m docline null setc locto id m docline getc locto id if getc locto id 0 setc locto id m doc getc locto id b partner if m docline null setc bpartner id m docline getc bpartner id if getc bpartner id 0 setc bpartner id m doc getc bpartner id sales region from bp location sales rep trx org if m docline null setad orgtrx id m docline getad orgtrx id if getad orgtrx id 0 setad orgtrx id m doc getad orgtrx id project if m docline null setc project id m docline getc project id if getc project id 0 setc project id m doc getc project id campaign if m docline null setc campaign id m docline getc campaign id if getc campaign id 0 setc campaign id m doc getc campaign id activity if m docline null setc activity id m docline getc activity id if getc activity id 0 setc activity id m doc getc activity id user list 1 if m docline null setuser1 id m docline getuser1 id if getuser1 id 0 setuser1 id m doc getuser1 id user list 2 if m docline null setuser2 id m docline getuser2 id if getuser2 id 0 setuser2 id m doc getuser2 id user defined docline setdocumentinfo docline docline m_doc m_docline docline setad_org_id setc_salesregion_id getad_client_id setad_client_id m_doc getad_client_id setdatetrx m_doc getdatedoc m_docline m_docline getdatedoc setdatetrx m_docline getdatedoc setdateacct m_doc getdateacct m_docline m_docline getdateacct setdateacct m_docline getdateacct m_docline m_docline getc_period_id setc_period_id m_docline getc_period_id setc_period_id m_doc getc_period_id m_docline setc_tax_id m_docline getc_tax_id stringbuffer stringbuffer m_doc getdocumentno m_docline m_docline getline m_docline getdescription m_docline getdescription m_doc getdescription m_doc getdescription m_doc getdescription m_doc getdescription m_doc getdescription m_doc getdescription setdescription tostring setgl_budget_id m_doc getgl_budget_id setgl_category_id m_doc getgl_category_id m_docline setm_product_id m_docline getm_product_id getm_product_id setm_product_id m_doc getm_product_id m_docline setc_uom_id m_docline getc_uom_id get_value setqty m_doc getqty m_docline setqty m_docline getqty getc_locfrom_id m_docline setc_locfrom_id m_docline getc_locfrom_id getc_locfrom_id setc_locfrom_id m_doc getc_locfrom_id getc_locto_id m_docline setc_locto_id m_docline getc_locto_id getc_locto_id setc_locto_id m_doc getc_locto_id bpartner m_docline setc_bpartner_id m_docline getc_bpartner_id getc_bpartner_id setc_bpartner_id m_doc getc_bpartner_id bplocation m_docline setad_orgtrx_id m_docline getad_orgtrx_id getad_orgtrx_id setad_orgtrx_id m_doc getad_orgtrx_id m_docline setc_project_id m_docline getc_project_id getc_project_id setc_project_id m_doc getc_project_id m_docline setc_campaign_id m_docline getc_campaign_id getc_campaign_id setc_campaign_id m_doc getc_campaign_id m_docline setc_activity_id m_docline getc_activity_id getc_activity_id setc_activity_id m_doc getc_activity_id m_docline setuser1_id m_docline getuser1_id getuser1_id setuser1_id m_doc getuser1_id m_docline setuser2_id m_docline getuser2_id getuser2_id setuser2_id m_doc getuser2_id get document line return doc line protected doc line get doc line return m docline docline getdocline m_docline set description param description description public void add description string description string original get description if original null original trim length 0 super set description description else super set description original description adddescription getdescription setdescription setdescription set warehouse locator will overwrite organization param m locator id locator public void setm locator id int m locator id super setm locator id m locator id setad org id 0 reset m_locator_id setm_locator_id m_locator_id setm_locator_id m_locator_id setad_org_id set location param c location id location param is from from public void set location int c location id boolean is from if is from setc locfrom id c location id else setc locto id c location id c_location_id isfrom setlocation c_location_id isfrom isfrom setc_locfrom_id c_location_id setc_locto_id c_location_id set location from locator param m locator id locator param is from from public void set location from locator int m locator id boolean is from if m locator id 0 return int c location id 0 string sql select w c location id from m warehouse w m locator l where w m warehouse id l m warehouse id and l m locator id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 m locator id result set rs pstmt execute query if rs next c location id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return if c location id 0 set location c location id is from m_locator_id isfrom setlocationfromlocator m_locator_id isfrom m_locator_id c_location_id c_location_id m_warehouse m_locator m_warehouse_id m_warehouse_id m_locator_id preparedstatement preparestatement get_trxname setint m_locator_id resultset executequery c_location_id getint sqlexception c_location_id setlocation c_location_id isfrom set location from busoness partner location param c bpartner location id bp location param is from from public void set location fromb partner int c bpartner location id boolean is from if c bpartner location id 0 return int c location id 0 string sql select c location id from c bpartner location where c bpartner location id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 c bpartner location id result set rs pstmt execute query if rs next c location id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return if c location id 0 set location c location id is from c_bpartner_location_id isfrom setlocationfrombpartner c_bpartner_location_id isfrom c_bpartner_location_id c_location_id c_location_id c_bpartner_location c_bpartner_location_id preparedstatement preparestatement get_trxname setint c_bpartner_location_id resultset executequery c_location_id getint sqlexception c_location_id setlocation c_location_id isfrom set location from organization param ad org id org param is from from public void set location from org int ad org id boolean is from if ad org id 0 return int c location id 0 string sql select c location id from ad orginfo where ad org id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 ad org id result set rs pstmt execute query if rs next c location id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return if c location id 0 set location c location id is from ad_org_id isfrom setlocationfromorg ad_org_id isfrom ad_org_id c_location_id c_location_id ad_orginfo ad_org_id preparedstatement preparestatement get_trxname setint ad_org_id resultset executequery c_location_id getint sqlexception c_location_id setlocation c_location_id isfrom returns source balance of line return source balance public big decimal get source balance if get amt source dr null set amt source dr env zero if get amt source cr null set amt source cr env zero return get amt source dr subtract get amt source cr bigdecimal getsourcebalance getamtsourcedr setamtsourcedr getamtsourcecr setamtsourcecr getamtsourcedr getamtsourcecr is debit source balance return true if dr source balance public boolean is dr source balance return get source balance compare to env zero 1 isdrsourcebalance getsourcebalance compareto get accounted balance return accounting balance public big decimal get acct balance if get amt acct dr null set amt acct dr env zero if get amt acct cr null set amt acct cr env zero return get amt acct dr subtract get amt acct cr bigdecimal getacctbalance getamtacctdr setamtacctdr getamtacctcr setamtacctcr getamtacctdr getamtacctcr is account on balance sheet return true if account is a balance sheet account public boolean is balance sheet return m acct is balance sheet isbalancesheet m_acct isbalancesheet currect accounting amount pre example 1 1 1 1 old 100 0 100 0 0 100 0 100 new 99 0 101 0 0 99 0 101 pre param delta amount delta amount public void currency correct big decimal delta amount boolean negative delta amount compare to env zero 0 boolean adjust dr get amt acct dr abs compare to get amt acct cr abs 0 log fine delta amount to string old acct dr get amt acct dr acct cr get amt acct cr negative negative adjust dr adjust dr if adjust dr if negative set amt acct dr get amt acct dr subtract delta amount else set amt acct dr get amt acct dr subtract delta amount else if negative set amt acct cr get amt acct cr add delta amount else set amt acct cr get amt acct cr add delta amount log fine new acct dr get amt acct dr acct cr get amt acct cr deltaamount currencycorrect bigdecimal deltaamount deltaamount compareto adjustdr getamtacctdr compareto getamtacctcr deltaamount tostring acctdr getamtacctdr acctcr getamtacctcr adjustdr adjustdr adjustdr setamtacctdr getamtacctdr deltaamount setamtacctdr getamtacctdr deltaamount setamtacctcr getamtacctcr deltaamount setamtacctcr getamtacctcr deltaamount acctdr getamtacctdr acctcr getamtacctcr convert to accounted currency return true if converted public boolean convert document has no currency if getc currency id doc no currency setc currency id m acctschema getc currency id if m acctschema getc currency id getc currency id set amt acct dr get amt source dr set amt acct cr get amt source cr return true get conversion type from line or header int c conversiontype id 0 int ad org id 0 if m docline null get from line c conversiontype id m docline getc conversiontype id ad org id m docline getad org id if c conversiontype id 0 get from header if m doc null log severe no document vo return false c conversiontype id m doc getc conversiontype id if ad org id 0 ad org id m doc getad org id set amt acct dr m conversion rate convert get ctx get amt source dr getc currency id m acctschema getc currency id get date acct c conversiontype id m doc getad client id ad org id if get amt acct dr null return false set amt acct cr m conversion rate convert get ctx get amt source cr getc currency id m acctschema getc currency id get date acct c conversiontype id m doc getad client id ad org id return true getc_currency_id no_currency setc_currency_id m_acctschema getc_currency_id m_acctschema getc_currency_id getc_currency_id setamtacctdr getamtsourcedr setamtacctcr getamtsourcecr c_conversiontype_id ad_org_id m_docline c_conversiontype_id m_docline getc_conversiontype_id ad_org_id m_docline getad_org_id c_conversiontype_id m_doc c_conversiontype_id m_doc getc_conversiontype_id ad_org_id ad_org_id m_doc getad_org_id setamtacctdr mconversionrate getctx getamtsourcedr getc_currency_id m_acctschema getc_currency_id getdateacct c_conversiontype_id m_doc getad_client_id ad_org_id getamtacctdr setamtacctcr mconversionrate getctx getamtsourcecr getc_currency_id m_acctschema getc_currency_id getdateacct c_conversiontype_id m_doc getad_client_id ad_org_id get account return account public m account get account return m acct maccount getaccount m_acct to string return string public string to string string buffer sb new string buffer fact line sb append getad table id append append getrecord id append append m acct append cur append getc currency id append dr append get amt source dr append append get amt acct dr append cr append get amt source cr append append get amt acct cr append return sb to string tostring stringbuffer stringbuffer factline getad_table_id getrecord_id m_acct getc_currency_id getamtsourcedr getamtacctdr getamtsourcecr getamtacctcr tostring get ad org id balancing segment if not set directly from document line document account locator p note that locator needs to be set before otherwise segment balancing might produce the wrong results return ad org id public int getad org id if super getad org id 0 set earlier return super getad org id prio 1 get from locator if exist if getm locator id 0 string sql select ad org id from m locator where m locator id and ad client id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 getm locator id pstmt set int 2 getad client id result set rs pstmt execute query if rs next setad org id rs get int 1 log finer ad org id super getad org id 1 from m locator id getm locator id else log log level severe ad org id did not find m locator id getm locator id rs close pstmt close catch sql exception e log log level severe sql e m locator id 0 prio 2 get from doc line if exists document context overwrites if m docline null super getad org id 0 setad org id m docline getad org id log finer ad org id super getad org id 2 from document line prio 3 get from doc if not gl if m doc null super getad org id 0 if doc doctype gljournal equals m doc get document type setad org id m acct getad org id inter company gl log finer ad org id super getad org id 3 from acct else setad org id m doc getad org id log finer ad org id super getad org id 3 from document prio 4 get from account if not gl if m doc null super getad org id 0 if doc doctype gljournal equals m doc get document type setad org id m doc getad org id log finer ad org id super getad org id 4 from document else setad org id m acct getad org id log finer ad org id super getad org id 4 from acct return super getad org id ad_org_id ad_org_id getad_org_id getad_org_id getad_org_id getm_locator_id ad_org_id m_locator m_locator_id ad_client_id preparedstatement preparestatement get_trxname setint getm_locator_id setint getad_client_id resultset executequery setad_org_id getint ad_org_id getad_org_id m_locator_id getm_locator_id ad_org_id m_locator_id getm_locator_id sqlexception m_locator_id m_docline getad_org_id setad_org_id m_docline getad_org_id ad_org_id getad_org_id documentline m_doc getad_org_id doctype_gljournal m_doc getdocumenttype setad_org_id m_acct getad_org_id ad_org_id getad_org_id setad_org_id m_doc getad_org_id ad_org_id getad_org_id m_doc getad_org_id doctype_gljournal m_doc getdocumenttype setad_org_id m_doc getad_org_id ad_org_id getad_org_id setad_org_id m_acct getad_org_id ad_org_id getad_org_id getad_org_id get derive sales region return sales region public int getc salesregion id if super getc salesregion id 0 return super getc salesregion id if m docline null setc salesregion id m docline getc salesregion id if m doc null if super getc salesregion id 0 setc salesregion id m doc getc salesregion id if super getc salesregion id 0 m doc getbp c salesregion id 0 setc salesregion id m doc getbp c salesregion id derive sales region if acct segment if super getc salesregion id 0 m doc getc bpartner location id 0 m doc getbp c salesregion id 1 never tried m acctschema is acct schema element m acct schema element elementtype salesregion string sql select coalesce c salesregion id 0 from c bpartner location where c bpartner location id setc salesregion id db getsql value null sql m doc getc bpartner location id if super getc salesregion id 0 save in vo m doc setbp c salesregion id super getc salesregion id log fine c salesregion id super getc salesregion id from bpl else from sales rep of document sales region sql select coalesce max c salesregion id 0 from c salesregion where salesrep id setc salesregion id db getsql value null sql m doc getsalesrep id if super getc salesregion id 0 save in vo m doc setbp c salesregion id super getc salesregion id log fine c salesregion id super getc salesregion id from sr else m doc setbp c salesregion id 2 don t try again if m acct null super getc salesregion id 0 setc salesregion id m acct getc salesregion id log fine c salesregion id super getc salesregion id c bpartner location id m docvo c bpartner location id bp c salesregion id m docvo bp c salesregion id sr m acctschema is acct schema element m acct schema element elementtype salesregion return super getc salesregion id getc_salesregion_id getc_salesregion_id getc_salesregion_id m_docline setc_salesregion_id m_docline getc_salesregion_id m_doc getc_salesregion_id setc_salesregion_id m_doc getc_salesregion_id getc_salesregion_id m_doc getbp_c_salesregion_id setc_salesregion_id m_doc getbp_c_salesregion_id salesregion acctsegment getc_salesregion_id m_doc getc_bpartner_location_id m_doc getbp_c_salesregion_id m_acctschema isacctschemaelement macctschemaelement elementtype_salesregion c_salesregion_id c_bpartner_location c_bpartner_location_id setc_salesregion_id getsqlvalue m_doc getc_bpartner_location_id getc_salesregion_id m_doc setbp_c_salesregion_id getc_salesregion_id c_salesregion_id getc_salesregion_id c_salesregion_id c_salesregion salesrep_id setc_salesregion_id getsqlvalue m_doc getsalesrep_id getc_salesregion_id m_doc setbp_c_salesregion_id getc_salesregion_id c_salesregion_id getc_salesregion_id m_doc setbp_c_salesregion_id m_acct getc_salesregion_id setc_salesregion_id m_acct getc_salesregion_id c_salesregion_id getc_salesregion_id c_bpartner_location_id m_docvo c_bpartner_location_id bp_c_salesregion_id m_docvo bp_c_salesregion_id m_acctschema isacctschemaelement macctschemaelement elementtype_salesregion getc_salesregion_id before save param new record new return true protected boolean before save boolean new record if new record log fine to string getad org id getc salesregion id set default account info if getm product id 0 setm product id m acct getm product id if getc locfrom id 0 setc locfrom id m acct getc locfrom id if getc locto id 0 setc locto id m acct getc locto id if getc bpartner id 0 setc bpartner id m acct getc bpartner id if getad orgtrx id 0 setad orgtrx id m acct getad orgtrx id if getc project id 0 setc project id m acct getc project id if getc campaign id 0 setc campaign id m acct getc campaign id if getc activity id 0 setc activity id m acct getc activity id if getuser1 id 0 setuser1 id m acct getuser1 id if getuser2 id 0 setuser2 id m acct getuser2 id revenue recognition for ar invoices if m doc get document type equals doc doctype arinvoice m docline null m docline getc revenuerecognition id 0 int ad user id 0 setaccount id create revenue recognition m docline getc revenuerecognition id m docline get id getad client id getad org id ad user id getaccount id getc subacct id getm product id getc bpartner id getad orgtrx id getc locfrom id getc locto id getc salesregion id getc project id getc campaign id getc activity id getuser1 id getuser2 id getuserelement1 id getuserelement2 id return true newrecord beforesave newrecord newrecord tostring getad_org_id getc_salesregion_id getm_product_id setm_product_id m_acct getm_product_id getc_locfrom_id setc_locfrom_id m_acct getc_locfrom_id getc_locto_id setc_locto_id m_acct getc_locto_id getc_bpartner_id setc_bpartner_id m_acct getc_bpartner_id getad_orgtrx_id setad_orgtrx_id m_acct getad_orgtrx_id getc_project_id setc_project_id m_acct getc_project_id getc_campaign_id setc_campaign_id m_acct getc_campaign_id getc_activity_id setc_activity_id m_acct getc_activity_id getuser1_id setuser1_id m_acct getuser1_id getuser2_id setuser2_id m_acct getuser2_id m_doc getdocumenttype doctype_arinvoice m_docline m_docline getc_revenuerecognition_id ad_user_id setaccount_id createrevenuerecognition m_docline getc_revenuerecognition_id m_docline get_id getad_client_id getad_org_id ad_user_id getaccount_id getc_subacct_id getm_product_id getc_bpartner_id getad_orgtrx_id getc_locfrom_id getc_locto_id getc_salesregion_id getc_project_id getc_campaign_id getc_activity_id getuser1_id getuser2_id getuserelement1_id getuserelement2_id revenue recognition called from fact line save p create revenue recognition plan and return unearned revenue account to be used instead of revenue account if not found it returns the revenue account param c revenuerecognition id revenue recognition param c invoiceline id invoice line param ad client id client param ad org id org param ad user id user param account id of revenue account param m product id product param c bpartner id bpartner param ad orgtrx id trx org param c locfrom id loc from param c locto id loc to param c sregion id sales region param c project id project param c campaign id campaign param c activity id activity param user1 id user1 param user2 id user2 return account id for unearned revenue or revenue account if not found private int create revenue recognition int c revenuerecognition id int c invoiceline id int ad client id int ad org id int ad user id int account id int c subacct id int m product id int c bpartner id int ad orgtrx id int c locfrom id int c locto id int c sregion id int c project id int c campaign id int c activity id int user1 id int user2 id int userelement1 id int userelement2 id log fine from accout id account id get vc for p revenue from product m account revenue m account get get ctx ad client id ad org id getc acctschema id account id c subacct id m product id c bpartner id ad orgtrx id c locfrom id c locto id c sregion id c project id c campaign id c activity id user1 id user2 id userelement1 id userelement2 id if revenue null revenue get id 0 revenue save if revenue null revenue get id 0 log severe revenue acct not found return account id int p revenue acct revenue get id get unearned revenue acct from b partner group int unearnedrevenue acct 0 int new account id 0 string sql select ga unearnedrevenue acct vc account id from c bp group acct ga c bpartner p c validcombination vc where ga c bp group id p c bp group id and ga unearnedrevenue acct vc c validcombination id and ga c acctschema id and p c bpartner id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 getc acctschema id pstmt set int 2 c bpartner id result set rs pstmt execute query if rs next unearnedrevenue acct rs get int 1 new account id rs get int 2 rs close pstmt close catch sql exception e log log level severe sql e if new account id 0 log severe unearnedrevenue acct not found return account id m revenue recognition plan plan new m revenue recognition plan get ctx 0 null plan setc revenuerecognition id c revenuerecognition id plan setc acctschema id getc acctschema id plan setc invoiceline id c invoiceline id plan setunearnedrevenue acct unearnedrevenue acct plan setp revenue acct p revenue acct plan setc currency id getc currency id plan set total amt get acct balance if plan save get trxname log severe plan not created return account id log fine from acctount id account id to new account id plan from unearnedrevenue acct unearnedrevenue acct to revenue acct p revenue acct return new account id factline c_revenuerecognition_id c_invoiceline_id ad_client_id ad_org_id ad_user_id account_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_sregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id account_id createrevenuerecognition c_revenuerecognition_id c_invoiceline_id ad_client_id ad_org_id ad_user_id account_id c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_sregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id userelement1_id userelement2_id accout_id account_id p_revenue maccount maccount getctx ad_client_id ad_org_id getc_acctschema_id account_id c_subacct_id m_product_id c_bpartner_id ad_orgtrx_id c_locfrom_id c_locto_id c_sregion_id c_project_id c_campaign_id c_activity_id user1_id user2_id userelement1_id userelement2_id get_id get_id revenue_acct account_id p_revenue_acct get_id bpartner unearnedrevenue_acct new_account_id unearnedrevenue_acct account_id c_bp_group_acct c_bpartner c_validcombination c_bp_group_id c_bp_group_id unearnedrevenue_acct c_validcombination_id c_acctschema_id c_bpartner_id preparedstatement preparestatement get_trxname setint getc_acctschema_id setint c_bpartner_id resultset executequery unearnedrevenue_acct getint new_account_id getint sqlexception new_account_id unearnedrevenue_acct account_id mrevenuerecognitionplan mrevenuerecognitionplan getctx setc_revenuerecognition_id c_revenuerecognition_id setc_acctschema_id getc_acctschema_id setc_invoiceline_id c_invoiceline_id setunearnedrevenue_acct unearnedrevenue_acct setp_revenue_acct p_revenue_acct setc_currency_id getc_currency_id settotalamt getacctbalance get_trxname account_id acctount_id account_id new_account_id unearnedrevenue_acct unearnedrevenue_acct revenue_acct p_revenue_acct new_account_id update line with reversed original amount in accounting currency also copies original dimensions like project etc called from doc matchinv param ad table id table param record id record param line id line param multiplier target qty document qty return true if success public boolean update reverse line int ad table id int record id int line id big decimal multiplier boolean success false string sql select from fact acct where c acctschema id and ad table id and record id and line id and account id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 getc acctschema id pstmt set int 2 ad table id pstmt set int 3 record id pstmt set int 4 line id pstmt set int 5 m acct getaccount id result set rs pstmt execute query if rs next m fact acct fact new m fact acct get ctx rs get trxname accounted amounts reverse big decimal dr fact get amt acct dr big decimal cr fact get amt acct cr set amt acct dr cr multiply multiplier set amt acct cr dr multiply multiplier source amounts set amt source dr get amt acct dr set amt source cr get amt acct cr success true log fine new string buffer table append ad table id append record id append record id append line append record id append account append m acct append dr append dr append cr append cr append dr append get amt source dr append append get amt acct dr append cr append get amt source cr append append get amt acct cr to string dimensions setad orgtrx id fact getad orgtrx id setc project id fact getc project id setc activity id fact getc activity id setc campaign id fact getc campaign id setc salesregion id fact getc salesregion id setc locfrom id fact getc locfrom id setc locto id fact getc locto id setm product id fact getm product id setm locator id fact getm locator id setuser1 id fact getuser1 id setuser2 id fact getuser2 id setc uom id fact getc uom id setc tax id fact getc tax id org for cross charge setad org id fact getad org id else log warning new string buffer not found try later append c acctschema id append getc acctschema id append ad table id append ad table id append record id append record id append line id append line id append account id append m acct getaccount id to string rs close pstmt close catch sql exception e log log level severe sql e return success doc_matchinv ad_table_id record_id line_id targetqty documentqty updatereverseline ad_table_id record_id line_id bigdecimal fact_acct c_acctschema_id ad_table_id record_id line_id account_id preparedstatement preparestatement get_trxname setint getc_acctschema_id setint ad_table_id setint record_id setint line_id setint m_acct getaccount_id resultset executequery mfactacct mfactacct getctx get_trxname bigdecimal getamtacctdr bigdecimal getamtacctcr setamtacctdr setamtacctcr setamtsourcedr getamtacctdr setamtsourcecr getamtacctcr stringbuffer ad_table_id record_id record_id record_id m_acct getamtsourcedr getamtacctdr getamtsourcecr getamtacctcr tostring setad_orgtrx_id getad_orgtrx_id setc_project_id getc_project_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_salesregion_id getc_salesregion_id setc_locfrom_id getc_locfrom_id setc_locto_id getc_locto_id setm_product_id getm_product_id setm_locator_id getm_locator_id setuser1_id getuser1_id setuser2_id getuser2_id setc_uom_id getc_uom_id setc_tax_id getc_tax_id setad_org_id getad_org_id stringbuffer c_acctschema_id getc_acctschema_id ad_table_id ad_table_id record_id record_id line_id line_id account_id m_acct getaccount_id tostring sqlexception standard constructor param ctx context param w clickcount id id public m click count properties ctx int w clickcount id string trx name super ctx w clickcount id trx name if w clickcount id 0 set name null set targeturl null w_clickcount_id mclickcount w_clickcount_id trxname w_clickcount_id trxname w_clickcount_id setname settargeturl load constructor param ctx context param rs result set public m click count properties ctx result set rs string trx name super ctx rs trx name mclickcount resultset trxname trxname parent constructor param ad parent public m click count m advertisement ad this ad get ctx 0 ad get trxname set name ad get name set targeturl setc bpartner id ad getc bpartner id mclickcount madvertisement getctx get_trxname setname getname settargeturl setc_bpartner_id getc_bpartner_id get clicks return clicks public m click getm clicks array list m click list new array list m click todo clicks m click ret value new m click list size list to array ret value return ret value mclick getmclicks arraylist mclick arraylist mclick mclick retvalue mclick toarray retvalue retvalue get count for date format param date format valid trunc date format return count protected value name pair get count string date format array list value name pair list new array list value name pair string sql select trunc created date format count from w click where w clickcount id group by trunc created date format prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getw clickcount id result set rs pstmt execute query while rs next string value m dateformat format rs get timestamp 1 string name m intformat format rs get int 2 value name pair pp new value name pair value name list add pp rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null value name pair ret value new value name pair list size list to array ret value return ret value dateformat valuenamepair getcount dateformat arraylist valuenamepair arraylist valuenamepair dateformat w_click w_clickcount_id dateformat preparedstatement preparestatement setint getw_clickcount_id resultset executequery m_dateformat gettimestamp m_intformat getint valuenamepair valuenamepair sqlexception sqlexception valuenamepair retvalue valuenamepair toarray retvalue retvalue get monthly count return monthly count public value name pair get count quarter return get count q valuenamepair getcountquarter getcount get monthly count return monthly count public value name pair get count month return get count mm valuenamepair getcountmonth getcount get weekly count return weekly count public value name pair get count week return get count dy valuenamepair getcountweek getcount get daily count return dailt count public value name pair get count day return get count j valuenamepair getcountday getcount get from cache param ctx context param a asset group id id return category public static m asset group get properties ctx int a asset group id integer ii new integer a asset group id m asset group pc m asset group s cache get ii if pc null pc new m asset group ctx a asset group id null return pc a_asset_group_id massetgroup a_asset_group_id a_asset_group_id massetgroup massetgroup s_cache massetgroup a_asset_group_id standard constructor param ctx context param a asset group id id param trx name trx public m asset group properties ctx int a asset group id string trx name super ctx a asset group id trx name if a asset group id 0 set name null set is depreciated false set is one asset peruom false set is owned false set is create as active true set is track issues false a_asset_group_id trxname massetgroup a_asset_group_id trxname a_asset_group_id trxname a_asset_group_id setname setisdepreciated setisoneassetperuom setisowned setiscreateasactive setistrackissues load cosntructor param ctx context param rs result set param trx name trx public m asset group properties ctx result set rs string trx name super ctx rs trx name trxname massetgroup resultset trxname trxname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m warehouse id p m warehouse id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals date promised p datepromised timestamp para i get parameter else if name equals selection p selection y equals para i get parameter else if name equals is unconfirmed in out p isunconfirmedinout y equals para i get parameter else if name equals consolidate document p consolidatedocument y equals para i get parameter else if name equals doc action p docaction string para i get parameter else log log level severe unknown parameter name login date m movementdate env get context as date get ctx date if m movementdate null m movementdate new timestamp system current time millis doc action check if doc action action complete equals p docaction p docaction doc action action prepare processinfoparameter getparameter getparametername getparameter m_warehouse_id p_m_warehouse_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint datepromised p_datepromised getparameter p_selection getparameter isunconfirmedinout p_isunconfirmedinout getparameter consolidatedocument p_consolidatedocument getparameter docaction p_docaction getparameter m_movementdate getcontextasdate getctx m_movementdate m_movementdate currenttimemillis docaction docaction action_complete p_docaction p_docaction docaction action_prepare generate shipments return info throws exception protected string do it throws exception log info selection p selection m warehouse id p m warehouse id c bpartner id p c bpartner id consolidate p consolidatedocument is unconfirmed p isunconfirmedinout movement m movementdate if p m warehouse id 0 throw new compiere user error not found m warehouse id if p selection v in out gen m sql select from c order where is selected y and doc status co and isso trx y and ad client id else m sql select from c order o where doc status co and isso trx y no offer pos and o c doctype id in select c doctype id from c doctype where doc base type soo and doc sub typeso not in on ob wr and o is drop ship n no manual and o delivery rule m open order lines with warehouse and exists select from c orderline ol where ol m warehouse id and o c order id ol c order id and ol qty ordered ol qty delivered if p c bpartner id 0 m sql and c bpartner id if p datepromised null m sql and trunc date promised m sql order by m warehouse id priority rule m shipper id c bpartner id c bpartner location id c order id m sql for update prepared statement pstmt null try pstmt db prepare statement m sql get trxname int index 1 if p selection pstmt set int index env getad client id get ctx else pstmt set int index p m warehouse id if p c bpartner id 0 pstmt set int index p c bpartner id if p datepromised null pstmt set timestamp index p datepromised catch exception e log log level severe m sql e return generate pstmt doit p_selection m_warehouse_id p_m_warehouse_id c_bpartner_id p_c_bpartner_id p_consolidatedocument isunconfirmed p_isunconfirmedinout m_movementdate p_m_warehouse_id compiereusererror notfound m_warehouse_id p_selection vinoutgen m_sql c_order isselected docstatus issotrx ad_client_id m_sql c_order docstatus issotrx c_doctype_id c_doctype_id c_doctype docbasetype docsubtypeso isdropship deliveryrule c_orderline m_warehouse_id c_order_id c_order_id qtyordered qtydelivered p_c_bpartner_id m_sql c_bpartner_id p_datepromised m_sql datepromised m_sql m_warehouse_id priorityrule m_shipper_id c_bpartner_id c_bpartner_location_id c_order_id m_sql preparedstatement preparestatement m_sql get_trxname p_selection setint getad_client_id getctx setint p_m_warehouse_id p_c_bpartner_id setint p_c_bpartner_id p_datepromised settimestamp p_datepromised m_sql generate shipments param pstmt order query return info private string generate prepared statement pstmt m client client m client get get ctx try result set rs pstmt execute query while rs next order m order order new m order get ctx rs get trxname new header different shipper shipment location if p consolidatedocument m shipment null m shipment getc bpartner location id order getc bpartner location id m shipment getm shipper id order getm shipper id complete shipment log fine check order delivery rule order get delivery rule timestamp min guarantee date m movementdate boolean complete order m order deliveryrule completeorder equals order get delivery rule string where and m warehouse id p m warehouse id exclude auto delivery if not force if m order deliveryrule force equals order get delivery rule where and c orderline m product id is null or exists select from m product p where c orderline m product id p m product id and is exclude auto delivery n exclude unconfirmed if p isunconfirmedinout where and not exists select from m inoutline iol inner join m inout io on iol m inout id io m inout id where iol c orderline id c orderline c orderline id and io doc status in ip wc deadlock prevention order by m product id m order line lines order get lines where order by c bpartner location id m product id for int i 0 i lines length i m order line line lines i if line getm warehouse id p m warehouse id continue log fine check line big decimal on hand env zero big decimal to deliver line get qty ordered subtract line get qty delivered m product product line get product nothing to deliver if product null to deliver signum 0 continue check adjust for confirmations big decimal unconfirmed shipped qty env zero if p isunconfirmedinout product null to deliver signum 0 string where2 exists select from m inout io where io m inout id m inoutline m inout id and io doc status in ip wc m in out line iols m in out line get of order line get ctx line getc orderline id where2 null for int j 0 j iols length j unconfirmed shipped qty unconfirmed shipped qty add iols j get movement qty string log info unconfirmed qty unconfirmed shipped qty to deliver to deliver to deliver to deliver subtract unconfirmed shipped qty log info to deliver if to deliver signum 0 to deliver env zero log info set to 0 adjust on hand on hand on hand subtract unconfirmed shipped qty log fine log info comments lines w o product services if product null product is stocked line get qty ordered signum 0 comments to deliver signum 0 lines w o product if m order deliveryrule completeorder equals order get delivery rule printed later create line order line to deliver null false continue stored product m product category pc m product category get order get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy m storage storages get storages line getm warehouse id line getm product id line getm attributesetinstance id product getm attributeset id line getm attributesetinstance id 0 min guarantee date m client mmpolicy fifo equals mm policy for int j 0 j storages length j m storage storage storages j on hand on hand add storage get qty on hand boolean full line on hand compare to to deliver 0 to deliver signum 0 complete order if complete order full line log fine failed complete order on hand on hand unconfirmed unconfirmed shipped qty to deliver to deliver line complete order false break complete line else if full line m order deliveryrule completeline equals order get delivery rule log fine complete line on hand on hand unconfirmed unconfirmed shipped qty to deliver to deliver line create line order line to deliver storages false availability else if m order deliveryrule availability equals order get delivery rule on hand signum 0 to deliver signum 0 big decimal deliver to deliver if deliver compare to on hand 0 deliver on hand log fine available on hand on hand unconfirmed unconfirmed shipped qty to deliver to deliver delivering deliver line create line order line deliver storages false force else if m order deliveryrule force equals order get delivery rule big decimal deliver to deliver log fine force on hand on hand unconfirmed unconfirmed shipped qty to deliver to deliver delivering deliver line create line order line deliver storages true manual else if m order deliveryrule manual equals order get delivery rule log fine manual on hand on hand unconfirmed unconfirmed shipped qty line else log fine failed order get delivery rule on hand on hand unconfirmed unconfirmed shipped qty to deliver to deliver line for all order lines complete order successful if complete order m order deliveryrule completeorder equals order get delivery rule for int i 0 i lines length i m order line line lines i if line getm warehouse id p m warehouse id continue m product product line get product big decimal to deliver line get qty ordered subtract line get qty delivered m storage storages null if product null product is stocked m product category pc m product category get order get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy storages get storages line getm warehouse id line getm product id line getm attributesetinstance id product getm attributeset id line getm attributesetinstance id 0 min guarantee date m client mmpolicy fifo equals mm policy create line order line to deliver storages false m line 1000 while order rs close pstmt close pstmt null catch exception e log log level severe m sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null complete shipment return created m created preparedstatement mclient mclient getctx resultset executequery morder morder getctx get_trxname p_consolidatedocument m_shipment m_shipment getc_bpartner_location_id getc_bpartner_location_id m_shipment getm_shipper_id getm_shipper_id completeshipment deliveryrule getdeliveryrule minguaranteedate m_movementdate completeorder morder deliveryrule_completeorder getdeliveryrule m_warehouse_id p_m_warehouse_id morder deliveryrule_force getdeliveryrule c_orderline m_product_id m_product c_orderline m_product_id m_product_id isexcludeautodelivery p_isunconfirmedinout m_inoutline m_inout m_inout_id m_inout_id c_orderline_id c_orderline c_orderline_id docstatus m_product_id morderline getlines c_bpartner_location_id m_product_id morderline getm_warehouse_id p_m_warehouse_id bigdecimal onhand bigdecimal todeliver getqtyordered getqtydelivered mproduct getproduct todeliver bigdecimal unconfirmedshippedqty p_isunconfirmedinout todeliver m_inout m_inout_id m_inoutline m_inout_id docstatus minoutline minoutline getoforderline getctx getc_orderline_id unconfirmedshippedqty unconfirmedshippedqty getmovementqty loginfo unconfirmedshippedqty todeliver todeliver todeliver todeliver unconfirmedshippedqty loginfo todeliver todeliver todeliver loginfo onhand onhand unconfirmedshippedqty loginfo isstocked getqtyordered todeliver morder deliveryrule_completeorder getdeliveryrule createline todeliver mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy mstorage getstorages getm_warehouse_id getm_product_id getm_attributesetinstance_id getm_attributeset_id getm_attributesetinstance_id minguaranteedate mclient mmpolicy_fifo mmpolicy mstorage onhand onhand getqtyonhand fullline onhand compareto todeliver todeliver completeorder fullline completeorder onhand onhand unconfirmedshippedqty todeliver todeliver completeorder fullline morder deliveryrule_completeline getdeliveryrule completeline onhand onhand unconfirmedshippedqty todeliver todeliver createline todeliver morder deliveryrule_availability getdeliveryrule onhand todeliver bigdecimal todeliver compareto onhand onhand onhand onhand unconfirmedshippedqty todeliver todeliver createline morder deliveryrule_force getdeliveryrule bigdecimal todeliver onhand onhand unconfirmedshippedqty todeliver todeliver createline morder deliveryrule_manual getdeliveryrule onhand onhand unconfirmedshippedqty getdeliveryrule onhand onhand unconfirmedshippedqty todeliver todeliver completeorder morder deliveryrule_completeorder getdeliveryrule morderline getm_warehouse_id p_m_warehouse_id mproduct getproduct bigdecimal todeliver getqtyordered getqtydelivered mstorage isstocked mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy getstorages getm_warehouse_id getm_product_id getm_attributesetinstance_id getm_attributeset_id getm_attributesetinstance_id minguaranteedate mclient mmpolicy_fifo mmpolicy createline todeliver m_line m_sql completeshipment m_created create line param order order param order line line param qty qty param force force delivery private void create line m order order m order line order line big decimal qty m storage storages boolean force complete last shipment can have multiple shipments if m lastc bpartner location id order line getc bpartner location id complete shipment m lastc bpartner location id order line getc bpartner location id create new shipment if m shipment null m shipment new m in out order 0 m movementdate m shipment setm warehouse id order line getm warehouse id sets org too if order getc bpartner id order line getc bpartner id m shipment setc bpartner id order line getc bpartner id if order getc bpartner location id order line getc bpartner location id m shipment setc bpartner location id order line getc bpartner location id if m shipment save throw new illegal state exception could not create shipment non inventory lines if storages null m in out line line new m in out line m shipment line set order line order line 0 env zero line set qty qty correct uom if order line get qty entered compare to order line get qty ordered 0 line set qty entered qty multiply order line get qty entered divide order line get qty ordered 12 big decimal round half up line set line m line order line get line if line save throw new illegal state exception could not create shipment line log fine line to string return product m product product order line get product boolean line perasi false if product getm attributeset id 0 m attribute set mas m attribute set get get ctx product getm attributeset id line perasi mas is instance attribute inventory lines array list m in out line list new array list m in out line big decimal to deliver qty for int i 0 i storages length i m storage storage storages i big decimal deliver to deliver not enough on hand if deliver compare to storage get qty on hand 0 storage get qty on hand signum 0 positive storage if force adjust to on hand qty force i 1 storages length if force not on last location deliver storage get qty on hand if deliver signum 0 zero deliver continue int m locator id storage getm locator id m in out line line null if line perasi find line with locator for int ll 0 ll list size ll m in out line test m in out line list get ll if test getm locator id m locator id line test break if line null new line line new m in out line m shipment line set order line order line m locator id order isso trx deliver env zero line set qty deliver list add line else existing line line set qty line get movement qty add deliver if order line get qty entered compare to order line get qty ordered 0 line set qty entered line get movement qty multiply order line get qty entered divide order line get qty ordered 12 big decimal round half up line set line m line order line get line if line perasi line setm attributesetinstance id storage getm attributesetinstance id if line save throw new illegal state exception could not create shipment line log fine to deliver qty deliver line to deliver to deliver subtract deliver temp adjustment storage set qty on hand storage get qty on hand subtract deliver if to deliver signum 0 break if to deliver signum 0 throw new illegal state exception not all delivered remainder to deliver orderline createline morder morderline orderline bigdecimal mstorage m_lastc_bpartner_location_id orderline getc_bpartner_location_id completeshipment m_lastc_bpartner_location_id orderline getc_bpartner_location_id m_shipment m_shipment minout m_movementdate m_shipment setm_warehouse_id orderline getm_warehouse_id getc_bpartner_id orderline getc_bpartner_id m_shipment setc_bpartner_id orderline getc_bpartner_id getc_bpartner_location_id orderline getc_bpartner_location_id m_shipment setc_bpartner_location_id orderline getc_bpartner_location_id m_shipment illegalstateexception minoutline minoutline m_shipment setorderline orderline setqty orderline getqtyentered compareto orderline getqtyordered setqtyentered orderline getqtyentered orderline getqtyordered bigdecimal round_half_up setline m_line orderline getline illegalstateexception tostring mproduct orderline getproduct lineperasi getm_attributeset_id mattributeset mattributeset getctx getm_attributeset_id lineperasi isinstanceattribute arraylist minoutline arraylist minoutline bigdecimal todeliver mstorage bigdecimal todeliver compareto getqtyonhand getqtyonhand onhand getqtyonhand m_locator_id getm_locator_id minoutline lineperasi minoutline minoutline getm_locator_id m_locator_id minoutline m_shipment setorderline orderline m_locator_id issotrx setqty setqty getmovementqty orderline getqtyentered compareto orderline getqtyordered setqtyentered getmovementqty orderline getqtyentered orderline getqtyordered bigdecimal round_half_up setline m_line orderline getline lineperasi setm_attributesetinstance_id getm_attributesetinstance_id illegalstateexception todeliver todeliver todeliver setqtyonhand getqtyonhand todeliver todeliver illegalstateexception todeliver get storages param m warehouse id param m product id param m attributesetinstance id param m attributeset id param all attribute instances param min guarantee date param fi fo return storages private m storage get storages int m warehouse id int m product id int m attributesetinstance id int m attributeset id boolean all attribute instances timestamp min guarantee date boolean fi fo m lastpp new s parameter m warehouse id m product id m attributesetinstance id m attributeset id all attribute instances min guarantee date fi fo m laststorages m map get m lastpp if m laststorages null m laststorages m storage get warehouse get ctx m warehouse id m product id m attributesetinstance id m attributeset id all attribute instances min guarantee date fi fo get trxname m map put m lastpp m laststorages return m laststorages m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo mstorage getstorages m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo m_lastpp sparameter m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo m_laststorages m_map m_lastpp m_laststorages m_laststorages mstorage getwarehouse getctx m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo get_trxname m_map m_lastpp m_laststorages m_laststorages complete shipment private void complete shipment if m shipment null fails if there is a confirmation if m shipment process it p docaction log warning failed m shipment m shipment save add log m shipment getm inout id m shipment get movement date null m shipment get document no m created m map new hash map s parameter m storage if m lastpp null m laststorages null m map put m lastpp m laststorages m shipment null m line 0 completeshipment m_shipment m_shipment processit p_docaction m_shipment m_shipment addlog m_shipment getm_inout_id m_shipment getmovementdate m_shipment getdocumentno m_created m_map hashmap sparameter mstorage m_lastpp m_laststorages m_map m_lastpp m_laststorages m_shipment m_line parameter param m warehouse id param m product id param m attributesetinstance id param m attributeset id param all attribute instances param min guarantee date param fi fo protected s parameter int m warehouse id int m product id int m attributesetinstance id int m attributeset id boolean all attribute instances timestamp min guarantee date boolean fi fo this m warehouse id m warehouse id this m product id m product id this m attributesetinstance id m attributesetinstance id this m attributeset id m attributeset id this all attribute instances all attribute instances this min guarantee date min guarantee date this fi fo fi fo m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo sparameter m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo m_warehouse_id m_warehouse_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id m_attributeset_id m_attributeset_id allattributeinstances allattributeinstances minguaranteedate minguaranteedate fifo fifo equals param obj return true if equal public boolean equals object obj if obj null obj instanceof s parameter s parameter cmp s parameter obj boolean eq cmp m warehouse id m warehouse id cmp m product id m product id cmp m attributesetinstance id m attributesetinstance id cmp m attributeset id m attributeset id cmp all attribute instances all attribute instances cmp fi fo fi fo if eq if cmp min guarantee date null min guarantee date null else if cmp min guarantee date null min guarantee date null cmp min guarantee date equals min guarantee date else eq false return eq return false sparameter sparameter sparameter m_warehouse_id m_warehouse_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id m_attributeset_id m_attributeset_id allattributeinstances allattributeinstances fifo fifo minguaranteedate minguaranteedate minguaranteedate minguaranteedate minguaranteedate minguaranteedate hash code return hash code public int hash code long hash m warehouse id m product id 2 m attributesetinstance id 3 m attributeset id 4 if all attribute instances hash 1 if fi fo hash 2 if hash 0 hash hash 7 while hash integer max value hash integer max value if min guarantee date null hash min guarantee date hash code while hash integer max value hash integer max value return int hash hashcode hashcode m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances fifo max_value max_value minguaranteedate minguaranteedate hashcode max_value max_value constructor param combo public compiere combo popup j combo box combo super combo compierecombopopup jcombobox conditionally show the popup if the combo is a c combo box c field the return value of the method display popup determines if the popup is actually displayed see c combo box display popup see c field display popup public void show check combo box if popup should be displayed if combo box instanceof c combo box c combo box combo box display popup return check field if popup should be displayed if combo box instanceof c field c field combo box display popup return super show ccombobox cfield displaypopup ccombobox displaypopup cfield displaypopup combobox combobox ccombobox ccombobox combobox displaypopup combobox cfield cfield combobox displaypopup get from request param request request return web user if exists public static web user get http servlet request request http session session request get session false if session null return null return web user session get attribute web user name webuser httpservletrequest httpsession getsession webuser getattribute webuser get user unconditional from cache param ctx context param email email return web user public static web user get properties ctx string email return get ctx email null true webuser get user param ctx context param email email param password optional password param use cache use cache return web user public static web user get properties ctx string email string password boolean use cache if use cache s cache null if s cache null email null email equals s cache get email if password is null don t check it if password null password equals s cache get password return s cache s cache set passwordok false null return s cache s cache new web user ctx email password return s cache usecache webuser usecache usecache s_cache s_cache s_cache getemail s_cache getpassword s_cache s_cache setpasswordok s_cache s_cache webuser s_cache get user unconditional from cache param ctx context param ad user id bp contact return web user public static web user get properties ctx int ad user id if s cache null s cache getad user id ad user id return s cache s cache new web user ctx ad user id null return s cache ad_user_id webuser ad_user_id s_cache s_cache getad_user_id ad_user_id s_cache s_cache webuser ad_user_id s_cache load user with password param ctx context param email email param password password private web user properties ctx string email string password m ctx ctx m ad client id env getad client id ctx load email password webuser m_ctx m_ad_client_id getad_client_id load user with password param ctx context param ad user id bp contact private web user properties ctx int ad user id string trx name m ctx ctx m ad client id env getad client id ctx load ad user id ad_user_id webuser ad_user_id trxname m_ctx m_ad_client_id getad_client_id ad_user_id load contact param email email param password optional password private void load string email string password log info email ad client id m ad client id string sql select from ad user where ad client id and trim e mail if email null email prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m ad client id pstmt set string 2 email trim result set rs pstmt execute query if rs next m bpc new m user m ctx rs null log fine found bpc m bpc rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null check password m passwordok false user has no password if m bpc null m bpc get password null if password null m bpc set password password m passwordok true we have a password if m bpc null password null password equals m bpc get password m passwordok true if m passwordok m bpc null m passwordmessage null else set passwordok false password load b partner if m bpc null m bp new mb partner m ctx m bpc getc bpartner id null log fine found bp m bp else m bp null load loacation if m bpc null if m bpc getc bpartner location id 0 m bpl new mb partner location m ctx m bpc getc bpartner location id null log fine found bpl m bpl else mb partner location bpls m bp get locations false if bpls null bpls length 0 m bpl bpls 0 log fine found bpl m bpl if m bpl null m loc m location get m ctx m bpl getc location id null log fine found loc m loc else m loc null else m bpl null m loc null make sure that all entities exist if m bpc null m bpc new m user m ctx 0 null m bpc sete mail email m bpc set password password if m bp null m bp new mb partner m ctx template m bp set is customer true if m bpl null m bpl new mb partner location m bp if m loc null m loc new m location m ctx 0 null log config m bp m bpc ad_client_id m_ad_client_id ad_user ad_client_id email preparedstatement preparestatement setint m_ad_client_id setstring resultset executequery m_bpc muser m_ctx m_bpc m_passwordok m_bpc m_bpc getpassword m_bpc setpassword m_passwordok m_bpc m_bpc getpassword m_passwordok m_passwordok m_bpc m_passwordmessage setpasswordok bpartner m_bpc m_bp mbpartner m_ctx m_bpc getc_bpartner_id m_bp m_bp m_bpc m_bpc getc_bpartner_location_id m_bpl mbpartnerlocation m_ctx m_bpc getc_bpartner_location_id m_bpl mbpartnerlocation m_bp getlocations m_bpl m_bpl m_bpl m_loc mlocation m_ctx m_bpl getc_location_id m_loc m_loc m_bpl m_loc m_bpc m_bpc muser m_ctx m_bpc setemail m_bpc setpassword m_bp m_bp mbpartner m_ctx m_bp setiscustomer m_bpl m_bpl mbpartnerlocation m_bp m_loc m_loc mlocation m_ctx m_bp m_bpc load contact param ad user id bp contact private void load int ad user id log info id ad user id ad client id m ad client id string sql select from ad user where ad client id and ad user id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m ad client id pstmt set int 2 ad user id result set rs pstmt execute query if rs next m bpc new m user m ctx rs null log fine found bpc m bpc rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null password not entered m passwordok false m loggedin false load b partner if m bpc null m bp new mb partner m ctx m bpc getc bpartner id null log fine found bp m bp else m bp null load loacation if m bpc null if m bpc getc bpartner location id 0 m bpl new mb partner location m ctx m bpc getc bpartner location id null log fine found bpl m bpl else mb partner location bpls m bp get locations false if bpls null bpls length 0 m bpl bpls 0 log fine found bpl m bpl if m bpl null m loc m location get m ctx m bpl getc location id null log fine found loc m loc else m loc null else m bpl null m loc null make sure that all entities exist if m bpc null m bpc new m user m ctx 0 null m bpc sete mail m bpc set password if m bp null m bp new mb partner m ctx template m bp set is customer true if m bpl null m bpl new mb partner location m bp if m loc null m loc new m location m ctx 0 null log info m bp m bpc ad_user_id ad_user_id ad_user_id ad_client_id m_ad_client_id ad_user ad_client_id ad_user_id preparedstatement preparestatement setint m_ad_client_id setint ad_user_id resultset executequery m_bpc muser m_ctx m_bpc m_passwordok m_loggedin bpartner m_bpc m_bp mbpartner m_ctx m_bpc getc_bpartner_id m_bp m_bp m_bpc m_bpc getc_bpartner_location_id m_bpl mbpartnerlocation m_ctx m_bpc getc_bpartner_location_id m_bpl mbpartnerlocation m_bp getlocations m_bpl m_bpl m_bpl m_loc mlocation m_ctx m_bpl getc_location_id m_loc m_loc m_bpl m_loc m_bpc m_bpc muser m_ctx m_bpc setemail m_bpc setpassword m_bp m_bp mbpartner m_ctx m_bp setiscustomer m_bpl m_bpl mbpartnerlocation m_bp m_loc m_loc mlocation m_ctx m_bp m_bpc return valid return return true if found public boolean is valid if m bpc null return false boolean ok m bpc getad user id 0 return ok isvalid m_bpc m_bpc getad_user_id return email validation return return true if email is valid public boolean ise mail valid if m bpc null web util exists get email log fine get email bpc m bpc return false boolean ok m bpc getad user id 0 m bpc ise mail valid if ok log fine get email id m bpc getad user id online m bpc is online e mail valid m bpc ise mail valid return ok isemailvalid m_bpc webutil getemail getemail m_bpc m_bpc getad_user_id m_bpc isemailvalid getemail m_bpc getad_user_id m_bpc isonline emailvalid m_bpc isemailvalid return email verification reply return return true if reply received public boolean ise mail verified return m bpc null m bpc ise mail verified isemailverified m_bpc m_bpc isemailverified info return info public string to string string buffer sb new string buffer web user sb append get email append logged in append m loggedin append append m bpc append passwordok append m passwordok append valid append is valid append append m bp append customer append is customer append return sb to string tostring stringbuffer stringbuffer webuser getemail loggedin m_loggedin m_bpc m_passwordok isvalid m_bp iscustomer tostring save b partner objects return true if saved public boolean save m saveerrormessage null log info bp value m bp get value name m bp get name try check if b partner exists if m bp getc bpartner id 0 string sql select from c bpartner where ad client id and value prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m ad client id pstmt set string 2 m bp get value result set rs pstmt execute query if rs next m bp new mb partner m ctx m bpc getc bpartner id null log fine bp loaded m bp rs close pstmt close pstmt null catch exception e log log level severe save check e finally try if pstmt null pstmt close catch exception e pstmt null save b partner if m bp get name null m bp get name length 0 m bp set name m bpc get name if m bp get value null m bp get value length 0 m bp set value m bpc gete mail log fine bp m bp if m bp save m saveerrormessage could not save business partner return false save location log fine loc m loc m loc save save bp location if m bpl getc bpartner id m bp getc bpartner id m bpl setc bpartner id m bp getc bpartner id if m bpl getc location id m loc getc location id m bpl setc location id m loc getc location id log fine bpl m bpl if m bpl save m saveerrormessage could not save location return false save contact if m bpc getc bpartner id m bp getc bpartner id m bpc setc bpartner id m bp getc bpartner id if m bpc getc bpartner location id m bpl getc bpartner location id m bpc setc bpartner location id m bpl getc bpartner location id log fine bpc m bpc if m bpc save m saveerrormessage could not save contact return false catch exception ex log log level severe save ex m saveerrormessage ex to string return false return true bpartner m_saveerrormessage m_bp getvalue m_bp getname bpartner m_bp getc_bpartner_id c_bpartner ad_client_id preparedstatement preparestatement setint m_ad_client_id setstring m_bp getvalue resultset executequery m_bp mbpartner m_ctx m_bpc getc_bpartner_id m_bp bpartner m_bp getname m_bp getname m_bp setname m_bpc getname m_bp getvalue m_bp getvalue m_bp setvalue m_bpc getemail m_bp m_bp m_saveerrormessage m_loc m_loc m_bpl getc_bpartner_id m_bp getc_bpartner_id m_bpl setc_bpartner_id m_bp getc_bpartner_id m_bpl getc_location_id m_loc getc_location_id m_bpl setc_location_id m_loc getc_location_id m_bpl m_bpl m_saveerrormessage m_bpc getc_bpartner_id m_bp getc_bpartner_id m_bpc setc_bpartner_id m_bp getc_bpartner_id m_bpc getc_bpartner_location_id m_bpl getc_bpartner_location_id m_bpc setc_bpartner_location_id m_bpl getc_bpartner_location_id m_bpc m_bpc m_saveerrormessage m_saveerrormessage tostring save public void set save error message string msg m saveerrormessage msg setsaveerrormessage m_saveerrormessage m saveerrormessage msg public string get save error message return m saveerrormessage m_saveerrormessage getsaveerrormessage m_saveerrormessage get e mail address used as jsp parameter return email address of contact public string get email return m bpc gete mail email getemail m_bpc getemail public void set email string email m bpc sete mail email setemail m_bpc setemail public string get name return m bpc get name getname m_bpc getname public void set name string name m bpc set name name setname m_bpc setname public string get title return m bpc get title gettitle m_bpc gettitle public void set title string title m bpc set title title settitle m_bpc settitle get password return password public string get password string pwd m bpc get password if pwd null pwd length 0 if no password use time pwd string value of system current time millis return pwd getpassword m_bpc getpassword valueof currenttimemillis check save password public void set password string pwd m bpc get password if pwd null pwd length 0 no password set m bpc getc bpartner id 0 m bpc getad user id 0 existing b partner pwd string value of system current time millis m bpc set password pwd m bpc save setpassword m_bpc getpassword m_bpc getc_bpartner_id m_bpc getad_user_id bpartner valueof currenttimemillis m_bpc setpassword m_bpc set password param password new password public void set password string password if password null password length 0 m passwordmessage enter password m bpc set password password setpassword m_passwordmessage m_bpc setpassword set password ok param ok password valid param password password private void set passwordok boolean ok string password m passwordok ok if ok m passwordmessage null else if password null password length 0 m passwordmessage enter password else m passwordmessage invalid password setpasswordok m_passwordok m_passwordmessage m_passwordmessage m_passwordmessage is password ok return true if ok public boolean is passwordok if m bpc null web util exists m bpc get password return false return m passwordok ispasswordok m_bpc webutil m_bpc getpassword m_passwordok set password message return error message or null public string get password message return m passwordmessage getpasswordmessage m_passwordmessage set password message param password message message protected void set password message string password message m passwordmessage password message passwordmessage setpasswordmessage passwordmessage m_passwordmessage passwordmessage log in with password param password password return true if the user is logged in public boolean login string password m loggedin is valid we have a contact web util exists password we have a password password equals get password set passwordok m loggedin password log fine success m loggedin if m loggedin env set context m ctx ad user id getad user id return m loggedin m_loggedin isvalid webutil getpassword setpasswordok m_loggedin m_loggedin m_loggedin setcontext m_ctx ad_user_id getad_user_id m_loggedin log in with oassword public void logout m loggedin false m_loggedin is user logged in return is the user logged in public boolean is logged in return m loggedin isloggedin m_loggedin is logged in public string get phone return m bpc get phone isloggedin getphone m_bpc getphone public void set phone string phone m bpc set phone phone setphone m_bpc setphone public string get phone2 return m bpc get phone2 getphone2 m_bpc getphone2 public void set phone2 string phone2 m bpc set phone2 phone2 setphone2 m_bpc setphone2 public string get fax return m bpc get fax getfax m_bpc getfax public void set fax string fax m bpc set fax fax setfax m_bpc setfax public timestamp get birthday return m bpc get birthday getbirthday m_bpc getbirthday public void set birthday timestamp birthday m bpc set birthday birthday setbirthday m_bpc setbirthday public string get taxid return m bp get taxid gettaxid m_bp gettaxid public void set taxid string taxid m bp set taxid taxid settaxid m_bp settaxid public int getad client id return m bpc getad client id getad_client_id m_bpc getad_client_id public int getad user id return m bpc getad user id getad_user_id m_bpc getad_user_id public int get contactid return getad user id getcontactid getad_user_id get company name return company name public string get company return m bp get name getcompany m_bp getname public void set company string company m bp set name company setcompany m_bp setname public int getc bpartner id return m bp getc bpartner id getc_bpartner_id m_bp getc_bpartner_id public int get bpartnerid return m bp getc bpartner id getbpartnerid m_bp getc_bpartner_id public int getm pricelist id return m bp getm pricelist id getm_pricelist_id m_bp getm_pricelist_id get bp location id return bp loaction public int getc bpartner location id return m bpl getc bpartner location id getc_bpartner_location_id m_bpl getc_bpartner_location_id get location return location address public string get address return m loc get address1 getaddress m_loc getaddress1 public void set address string address m loc set address1 address setaddress m_loc setaddress1 public string get address2 return m loc get address2 getaddress2 m_loc getaddress2 public void set address2 string address2 m loc set address2 address2 setaddress2 m_loc setaddress2 public string get city return m loc get city getcity m_loc getcity public void set city string city m loc set city city setcity m_loc setcity public string get postal return m loc get postal getpostal m_loc getpostal public void set postal string postal m loc set postal postal setpostal m_loc setpostal get additional region name return location region name public string get region name return m loc get region name false getregionname m_loc getregionname public void set region name string region m loc set region name region setregionname m_loc setregionname public int getc region id return m loc getc region id getc_region_id m_loc getc_region_id public string get regionid return string value of getc region id getregionid valueof getc_region_id public void setc region id int c region id m loc setc region id c region id setc_region_id c_region_id m_loc setc_region_id c_region_id public void setc region id string c region id try if c region id null c region id length 0 setc region id 0 else setc region id integer parse int c region id catch exception e setc region id 0 log log level warning c region id e setc_region_id c_region_id c_region_id c_region_id setc_region_id setc_region_id parseint c_region_id setc_region_id c_region_id public string get country name return m loc get country name getcountryname m_loc getcountryname public void set country name string country log warning country ignored c country id m loc getc country id m loc set country name country setcountryname c_country_id m_loc getc_country_id m_loc setcountryname public int getc country id return m loc getc country id getc_country_id m_loc getc_country_id public string get countryid return string value of getc country id getcountryid valueof getc_country_id public void setc country id int c country id m loc setc country id c country id setc_country_id c_country_id m_loc setc_country_id c_country_id public void setc country id string c country id try if c country id null c country id length 0 setc country id 0 else setc country id integer parse int c country id catch exception e setc country id 0 log log level warning c country id e setc_country_id c_country_id c_country_id c_country_id setc_country_id setc_country_id parseint c_country_id setc_country_id c_country_id public boolean is employee return m bp is employee isemployee m_bp isemployee public boolean is sales rep return m bp is sales rep issalesrep m_bp issalesrep public boolean is customer return m bp is customer iscustomer m_bp iscustomer public void set is customer boolean is customer m bp set is customer is customer setiscustomer iscustomer m_bp setiscustomer iscustomer public boolean is vendor return m bp is vendor isvendor m_bp isvendor public int getsalesrep id return m bp getsalesrep id getsalesrep_id m_bp getsalesrep_id public boolean hasbp access string bp access type object params return m bpc hasbp access bp access type params hasbpaccess bpaccesstype m_bpc hasbpaccess bpaccesstype credit status is stop or hold used in asset download return true if stop hold public boolean is credit stop hold return m bp is credit stop hold iscreditstophold m_bp iscreditstophold credit status is critical used in web ui return true if stop hold watch public boolean is credit critical string status m bp getso credit status return mb partner socreditstatus creditstop equals status mb partner socreditstatus credithold equals status mb partner socreditstatus creditwatch equals status iscreditcritical m_bp getsocreditstatus mbpartner socreditstatus_creditstop mbpartner socreditstatus_credithold mbpartner socreditstatus_creditwatch credit status clear text used in web ui return clear text credit status public string getso credit status return m ref list get list name m ctx mb partner socreditstatus ad reference id m bp getso credit status getsocreditstatus mreflist getlistname m_ctx mbpartner socreditstatus_ad_reference_id m_bp getsocreditstatus get bp bank account or create it return bank account public mbp bank account get bank account mbp bank account ret value null find bank account for exact user mbp bank account bas m bp get bank accounts false for int i 0 i bas length i if bas i getad user id getad user id bas i is active ret value bas i create new if ret value null ret value new mbp bank account m ctx m bp m bpc m loc ret value setad user id getad user id ret value save return ret value mbpbankaccount getbankaccount mbpbankaccount retvalue mbpbankaccount m_bp getbankaccounts getad_user_id getad_user_id isactive retvalue retvalue retvalue mbpbankaccount m_ctx m_bp m_bpc m_loc retvalue setad_user_id getad_user_id retvalue retvalue public string gete mail verify code return m bpc gete mail verify code getemailverifycode m_bpc getemailverifycode check set e mail validation code param code code param info info public void sete mail verify code string code string info if m bpc sete mail verify code code info set password message null else set password message invalid code m bpc save email setemailverifycode m_bpc setemailverifycode setpasswordmessage setpasswordmessage m_bpc vo constructor param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable public c statementvo int result set type int result set concurrency set result set type result set type set result set concurrency result set concurrency resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable cstatementvo resultsettype resultsetconcurrency setresultsettype resultsettype setresultsetconcurrency resultsetconcurrency vo constructor param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable param sql sql public c statementvo int result set type int result set concurrency string sql this result set type result set concurrency set sql sql resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable cstatementvo resultsettype resultsetconcurrency resultsettype resultsetconcurrency setsql string representation return info public string to string string buffer sb new string buffer c statementvo sb append get sql for int i 0 i m parameters size i sb append append i 1 append append m parameters get i sb append return sb to string tostring stringbuffer stringbuffer cstatementvo getsql m_parameters m_parameters tostring set parameter param index1 1 based index param element element public void set parameter int index1 object element if element null element instanceof serializable throw new java lang runtime exception set parameter not serializable element get class to string int zero index index1 1 if m parameters size zero index m parameters add element else if m parameters size zero index while m parameters size zero index m parameters add null fill with nulls m parameters add element else m parameters set zero index element setparameter runtimeexception setparameter getclass tostring zeroindex m_parameters zeroindex m_parameters m_parameters zeroindex m_parameters zeroindex m_parameters m_parameters m_parameters zeroindex clear parameters public void clear parameters m parameters new array list object clearparameters m_parameters arraylist get parameters return arraylist public array list get parameters return m parameters arraylist getparameters m_parameters get parameter count return arraylist public int get parameter count return m parameters size getparametercount m_parameters get sql return sql public string get sql return m sql getsql m_sql set sql replace rowid with trim rowid for remote sql to convert into string as rowid is not serialized param sql sql public void set sql string sql if sql null db is remote objects handle rowid in the select part not where clause int pos sql index of rowid int pos trim sql index of trim rowid int pos where sql index of where if pos 1 pos trim 1 pos where 1 pos pos where m sql sql substring 0 pos trim rowid sql substring pos 5 else m sql sql else m sql sql setsql isremoteobjects indexof postrim indexof poswhere indexof postrim poswhere poswhere m_sql m_sql m_sql get result set concurrency return rs concurrency public int get result set concurrency return m resultsetconcurrency resultset getresultsetconcurrency m_resultsetconcurrency get result set type return rs type public int get result set type return m resultsettype resultset getresultsettype m_resultsettype set result set type param result set type type public void set result set type int result set type m resultsettype result set type resultset resultsettype setresultsettype resultsettype m_resultsettype resultsettype set result set concurrency param result set concurrency concurrency public void set result set concurrency int result set concurrency m resultsetconcurrency result set concurrency resultset resultsetconcurrency setresultsetconcurrency resultsetconcurrency m_resultsetconcurrency resultsetconcurrency get contents return contents public object get contents return contents getcontents standard constructor public x ad window access properties ctx int ad window access id string trx name super ctx ad window access id trx name if ad window access id 0 setad role id 0 setad window id 0 set is read write false x_ad_window_access ad_window_access_id trxname ad_window_access_id trxname ad_window_access_id setad_role_id setad_window_id setisreadwrite load constructor public x ad window access properties ctx result set rs string trx name super ctx rs trx name x_ad_window_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad window access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_window_access get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 1 throw new illegal argument exception ad window id is mandatory set valuenocheck ad window id new integer ad window id setad_window_id ad_window_id ad_window_id illegalargumentexception ad_window_id set_valuenocheck ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set read write field is read write public void set is read write boolean is read write set value is read write new boolean is read write setisreadwrite isreadwrite set_value isreadwrite isreadwrite get read write field is read write public boolean is read write object oo get value is read write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadwrite get_value isreadwrite booleanvalue standard constructor public x pa reportsource properties ctx int pa reportsource id string trx name super ctx pa reportsource id trx name if pa reportsource id 0 set element type null setpa reportline id 0 setpa reportsource id 0 x_pa_reportsource pa_reportsource_id trxname pa_reportsource_id trxname pa_reportsource_id setelementtype setpa_reportline_id setpa_reportsource_id load constructor public x pa reportsource properties ctx result set rs string trx name super ctx rs trx name x_pa_reportsource resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa reportsource append get id append return sb to string tostring stringbuffer stringbuffer x_pa_reportsource get_id tostring set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c elementvalue id ad reference id 182 set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 0 set value c elementvalue id null else set value c elementvalue id new integer c elementvalue id c_elementvalue_id_ad_reference_id setc_elementvalue_id c_elementvalue_id c_elementvalue_id set_value c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string elementtype userelement2 x2 set type element type account or user defined public void set element type string element type if element type null throw new illegal argument exception element type is mandatory if element type equals ac element type equals ay element type equals bp element type equals lf element type equals lt element type equals mc element type equals oo element type equals ot element type equals pj element type equals pr element type equals sa element type equals sr element type equals u1 element type equals u2 element type equals x1 element type equals x2 else throw new illegal argument exception element type invalid value element type reference id 181 ac ay bp lf lt mc oo ot pj pr sa sr u1 u2 x1 x2 if element type length 2 log warning length 2 truncated element type element type substring 0 1 set value element type element type elementtype_userelement2 setelementtype elementtype elementtype illegalargumentexception elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype illegalargumentexception elementtype elementtype reference_id elementtype elementtype elementtype set_value elementtype elementtype get type element type account or user defined public string get element type return string get value element type getelementtype get_value elementtype return string get value element type public key name pair get key name pair return new key name pair get id string value of get element type get_value elementtype keynamepair getkeynamepair keynamepair get_id valueof getelementtype set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int org id ad reference id 322 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set report line public void setpa reportline id int pa reportline id if pa reportline id 1 throw new illegal argument exception pa reportline id is mandatory set valuenocheck pa reportline id new integer pa reportline id setpa_reportline_id pa_reportline_id pa_reportline_id illegalargumentexception pa_reportline_id set_valuenocheck pa_reportline_id pa_reportline_id get report line public int getpa reportline id integer ii integer get value pa reportline id if ii null return 0 return ii int value getpa_reportline_id get_value pa_reportline_id intvalue set report source restriction of what will be shown in report line public void setpa reportsource id int pa reportsource id if pa reportsource id 1 throw new illegal argument exception pa reportsource id is mandatory set valuenocheck pa reportsource id new integer pa reportsource id setpa_reportsource_id pa_reportsource_id pa_reportsource_id illegalargumentexception pa_reportsource_id set_valuenocheck pa_reportsource_id pa_reportsource_id get report source restriction of what will be shown in report line public int getpa reportsource id integer ii integer get value pa reportsource id if ii null return 0 return ii int value getpa_reportsource_id get_value pa_reportsource_id intvalue factory constructor param frame parent frame param modal new window is modal param window no window no param table name table name of the search param key column key column of the search param value query value param multi selection allow to select more than one row param where clause fully qualified where clause for the search return special or general info window public static info create frame frame boolean modal int window no string table name string key column string value boolean multi selection string where clause info info null if table name equals c bpartner info new infob partner frame modal window no value env get context env get ctx isso trx equals n multi selection where clause else if table name equals m product info new info product frame modal window no 0 0 value multi selection where clause else if table name equals c invoice info new info invoice frame modal window no value multi selection where clause else if table name equals a asset info new info asset frame modal window no 0 value multi selection where clause else if table name equals c order info new info order frame modal window no value multi selection where clause else if table name equals m inout info new info in out frame modal window no value multi selection where clause else if table name equals c payment info new info payment frame modal window no value multi selection where clause else if table name equals c cashline info new info cash line frame modal window no value multi selection where clause else if table name equals s resourceassigment info new info assignment frame modal window no value multi selection where clause else info new info general frame modal window no value table name key column multi selection where clause a env position center window frame info return info windowno tablename keycolumn multiselection whereclause windowno tablename keycolumn multiselection whereclause tablename c_bpartner infobpartner windowno getcontext getctx issotrx multiselection whereclause tablename m_product infoproduct windowno multiselection whereclause tablename c_invoice infoinvoice windowno multiselection whereclause tablename a_asset infoasset windowno multiselection whereclause tablename c_order infoorder windowno multiselection whereclause tablename m_inout infoinout windowno multiselection whereclause tablename c_payment infopayment windowno multiselection whereclause tablename c_cashline infocashline windowno multiselection whereclause tablename s_resourceassigment infoassignment windowno multiselection whereclause infogeneral windowno tablename keycolumn multiselection whereclause aenv positioncenterwindow show b partner info non modal param frame parent frame param window no window no public static void showb partner frame frame int window no info info new infob partner frame false window no env get context env get ctx isso trx equals n false a env show center window frame info bpartner windowno showbpartner windowno infobpartner windowno getcontext getctx issotrx aenv showcenterwindow show asset info non modal param frame parent frame param window no window no public static void show asset frame frame int window no info info new info asset frame false window no 0 false a env show center window frame info windowno showasset windowno infoasset windowno aenv showcenterwindow show product info non modal param frame parent frame param window no window no public static void show product frame frame int window no info info new info product frame false window no env get context as int env get ctx window no m warehouse id env get context as int env get ctx window no m pricelist id value false a env show center window frame info windowno showproduct windowno infoproduct windowno getcontextasint getctx windowno m_warehouse_id getcontextasint getctx windowno m_pricelist_id aenv showcenterwindow show order info non modal param frame parent frame param window no window no param value query value public static void show order frame frame int window no string value info info new info order frame false window no value false a env show center window frame info windowno showorder windowno infoorder windowno aenv showcenterwindow show invoice info non modal param frame parent frame param window no window no param value query value public static void show invoice frame frame int window no string value info info new info invoice frame false window no value false a env show center window frame info windowno showinvoice windowno infoinvoice windowno aenv showcenterwindow show shipment info non modal param frame parent frame param window no window no param value query value public static void show in out frame frame int window no string value info info new info in out frame false window no value false a env show center window frame info windowno showinout windowno infoinout windowno aenv showcenterwindow show payment info non modal param frame parent frame param window no window no param value query value public static void show payment frame frame int window no string value info info new info payment frame false window no value false a env show center window frame info windowno showpayment windowno infopayment windowno aenv showcenterwindow show cash line info non modal param frame parent frame param window no window no param value query value public static void show cash line frame frame int window no string value info info new info cash line frame false window no value false a env show center window frame info windowno showcashline windowno infocashline windowno aenv showcenterwindow show assignment info non modal param frame parent frame param window no window no param value query value public static void show assignment frame frame int window no string value info info new info assignment frame false window no value false a env show center window frame info windowno showassignment windowno infoassignment windowno aenv showcenterwindow detail constructor param frame parent frame param modal modal param window no window no param table name table name param key column key column name param multi selection muiliple selection param where clause where clause protected info frame frame boolean modal int window no string table name string key column boolean multi selection string where clause super frame modal log info win no p windowno where clause p windowno window no p tablename table name p keycolumn key column p multiselection multi selection if where clause null where clause index of 1 p whereclause where clause else p whereclause env parse context env get ctx p windowno where clause false false if p whereclause length 0 log log level severe cannot parse context where clause try jb init catch exception ex log log level severe info ex windowno tablename keycolumn multiselection whereclause windowno tablename keycolumn multiselection whereclause winno p_windowno whereclause p_windowno windowno p_tablename tablename p_keycolumn keycolumn p_multiselection multiselection whereclause whereclause indexof p_whereclause whereclause p_whereclause parsecontext getctx p_windowno whereclause p_whereclause whereclause jbinit static init throws exception protected void jb init throws exception this set default close operation j frame dispose on close south panel set layout south layout south panel add confirm panel border layout center south panel add status bar border layout south get content pane add south panel border layout south this get content pane add parameter panel border layout north this get content pane add scroll pane border layout center scroll pane get viewport add p table null confirm panel add action listener this confirm panel get reset button set visible has reset confirm panel get customize button set visible has customize confirm panel get history button set visible has history confirm panel get zoom button set visible has zoom j button print confirm panel create print button true print add action listener this confirm panel add button print popup add calc menu calc menu set text msg get msg env get ctx calculator calc menu set icon new image icon org compiere compiere class get resource images calculator16 gif calc menu add action listener this p table get selection model add list selection listener this enable buttons jbinit setdefaultcloseoperation jframe dispose_on_close southpanel setlayout southlayout southpanel confirmpanel borderlayout southpanel statusbar borderlayout getcontentpane southpanel borderlayout getcontentpane parameterpanel borderlayout getcontentpane scrollpane borderlayout scrollpane getviewport p_table confirmpanel addactionlistener confirmpanel getresetbutton setvisible hasreset confirmpanel getcustomizebutton setvisible hascustomize confirmpanel gethistorybutton setvisible hashistory confirmpanel getzoombutton setvisible haszoom jbutton confirmpanel createprintbutton addactionlistener confirmpanel addbutton calcmenu calcmenu settext getmsg getctx calcmenu seticon imageicon getresource calcmenu addactionlistener p_table getselectionmodel addlistselectionlistener enablebuttons loaded correctly return true if loaded ok public boolean loadedok return p loadedok p_loadedok set status line param text text param error error public void set status line string text boolean error status bar set status line text error thread yield setstatusline statusbar setstatusline set status db param text text public void set statusdb string text status bar set statusdb text setstatusdb statusbar setstatusdb prepare table construct sql m m sqlmain m sqladd and size window param layout layout array param from from clause param static where where clause param order by order by clause protected void prepare table info column layout string from string static where string order by p layout layout string buffer sql new string buffer select add columns sql for int i 0 i layout length i if i 0 sql append sql append layout i get colsql adding id column if layout i isi dcol sql append append layout i geti dcolsql add to model p table add column layout i get col header if layout i is color column p table set color column i if layout i get col class id column class m keycolumnindex i set editors two steps for int i 0 i layout length i p table set column class i layout i get col class layout i is read only layout i get col header sql append from append from sql append where append static where m sqlmain sql to string m sqlcount select count from from where static where m sqlorder if order by null order by length 0 m sqlorder order by order by if m keycolumnindex 1 log log level severe no key column sql table selection p table set row selection allowed true p table add mouse listener this p table set multi selection p multiselection window sizing parameter panel set preferred size new dimension info width parameter panel get preferred size height scroll pane set preferred size new dimension info width 400 m_m_sqlmain m_sqladd staticwhere orderby preparetable info_column staticwhere orderby p_layout stringbuffer stringbuffer getcolsql isidcol getidcolsql p_table addcolumn getcolheader iscolorcolumn p_table setcolorcolumn getcolclass idcolumn m_keycolumnindex p_table setcolumnclass getcolclass isreadonly getcolheader staticwhere m_sqlmain tostring m_sqlcount staticwhere m_sqlorder orderby orderby m_sqlorder orderby m_keycolumnindex keycolumn p_table setrowselectionallowed p_table addmouselistener p_table setmultiselection p_multiselection parameterpanel setpreferredsize info_width parameterpanel getpreferredsize scrollpane setpreferredsize info_width execute query void execute query ignore when running if m worker null m worker is alive return if test count return set cursor cursor get predefined cursor cursor wait cursor set status line msg get msg env get ctx start search false m worker new worker m worker start executequery m_worker m_worker isalive testcount setcursor getpredefinedcursor wait_cursor setstatusline getmsg getctx startsearch m_worker m_worker test row count return true if display private boolean test count long start system current time millis string dyn where getsql where string buffer sql new string buffer m sqlcount if dyn where length 0 sql append dyn where includes first and string count sql msg parse translation env get ctx sql to string variables count sql m role get default add accesssql count sql get table name m role sql fullyqualified m role sql ro log finer count sql int no 1 try prepared statement pstmt db prepare statement count sql null set parameters pstmt true result set rs pstmt execute query if rs next no rs get int 1 rs close pstmt close catch exception e log log level severe count sql e no 2 log fine no system current time millis start ms if no 1000 return a dialog ask p windowno this info high record count string value of no return true testcount currenttimemillis dynwhere getsqlwhere stringbuffer stringbuffer m_sqlcount dynwhere dynwhere countsql parsetranslation getctx tostring countsql mrole getdefault addaccesssql countsql gettablename mrole sql_fullyqualified mrole sql_ro countsql preparedstatement preparestatement countsql setparameters resultset executequery getint countsql currenttimemillis adialog p_windowno infohighrecordcount valueof save selection called by dispose protected void save selection already disposed if p table null return log config ok m ok if m ok did not press ok m results clear p table remove all p table null return multi selection if p multiselection else single selection integer data get selected row key if data null m results add data log config get selectedsql save settings of detail info screens save selection detail clean up p table remove all p table null saveselection p_table m_ok m_ok m_results p_table removeall p_table p_multiselection singleselection getselectedrowkey m_results getselectedsql saveselectiondetail p_table removeall p_table get the key of currently selected row return selected key protected integer get selected row key int row p table get selected row if row 1 m keycolumnindex 1 object data p table get model get value at row m keycolumnindex if data instanceof id column data id column data getrecord id if data instanceof integer return integer data return null getselectedrowkey p_table getselectedrow m_keycolumnindex p_table getmodel getvalueat m_keycolumnindex idcolumn idcolumn getrecord_id get selected keys return selected keys integers public object get selected keys if m ok m results size 0 return null return m results to array getselectedkeys m_ok m_results m_results toarray get first selected key return selected key public object get selected key if m ok m results size 0 return null return m results get 0 getselectedkey m_ok m_results m_results is cancelled if pressed cancel true if pressed ok or window closed false return true if cancelled public boolean is cancelled return m cancel iscancelled m_cancel get where clause for first selected key return where clause public string get selectedsql no results object keys get selected keys if keys null keys length 0 log config no results ok m ok cancel m cancel return string buffer sb new string buffer get key column if keys length 1 sb append in else sb append add elements for int i 0 i keys length i if get key column ends with id sb append keys i to string append else sb append append keys i to string append sb replace sb length 1 sb length if keys length 1 sb append return sb to string getselectedsql getselectedkeys m_ok m_cancel stringbuffer stringbuffer getkeycolumn getkeycolumn endswith _id tostring tostring tostring button action listener popup menu param e event public void action performed action event e popup calculator if e get source equals calc menu big decimal number null object data p table get selected value try if data null if data instanceof big decimal number big decimal data else number new big decimal data to string catch exception ex calculator c new calculator null number c set visible true return popup confirm panel string cmd e get action command if cmd equals confirm panel a ok dispose true else if cmd equals confirm panel a cancel m cancel true dispose false else if cmd equals confirm panel a history show history else if cmd equals confirm panel a customize customize else if cmd equals confirm panel a zoom zoom else if cmd equals confirm panel a reset do reset else if cmd equals confirm panel a print print screen painter print screen this default else execute query actionperformed actionevent getsource calcmenu bigdecimal p_table getselectedvalue bigdecimal bigdecimal bigdecimal tostring setvisible getactioncommand confirmpanel a_ok confirmpanel a_cancel m_cancel confirmpanel a_history showhistory confirmpanel a_customize confirmpanel a_zoom confirmpanel a_reset doreset confirmpanel a_print printscreenpainter printscreen executequery zoom to target param ad window id window id param zoom query zoom query void zoom int ad window id m query zoom query set cursor cursor get predefined cursor cursor wait cursor final a window frame new a window if frame init window ad window id zoom query return modal window causes ui lock if is modal set modal false remove modal option has no effect dispose v lookup action button result null not cancelled else set cursor cursor get default cursor v lookup gets info after method finishes new thread public void run try sleep 50 catch exception e a env show center screen frame start ad_window_id zoomquery ad_window_id mquery zoomquery setcursor getpredefinedcursor wait_cursor awindow awindow initwindow ad_window_id zoomquery ismodal setmodal vlookup actionbutton setcursor getdefaultcursor vlookup aenv showcenterscreen public void run try sleep 50 catch exception e a env show center screen frame aenv showcenterscreen dispose not ok public void dispose dispose false dispose and save selection param ok ok pressed public void dispose boolean ok log config ok ok m ok ok end worker if m worker null worker continues but it does not block ui if m worker is alive m worker interrupt log config worker alive m worker is alive m worker null save selection remove all super dispose m_ok m_worker m_worker isalive m_worker m_worker isalive m_worker saveselection removeall get table name synonym return table name string get table name return p tablename gettablename p_tablename get key column name return column name string get key column return p keycolumn getkeycolumn p_keycolumn table selection changed param e event public void value changed list selection event e if e get value is adjusting return enable buttons valuechanged listselectionevent getvalueisadjusting enablebuttons enable ok history zoom if row selected void enable buttons boolean enable p table get selected row 1 confirm panel getok button set enabled enable if has history confirm panel get history button set enabled enable if has zoom confirm panel get zoom button set enabled enable enablebuttons p_table getselectedrow confirmpanel getokbutton setenabled hashistory confirmpanel gethistorybutton setenabled haszoom confirmpanel getzoombutton setenabled get dynamic where part of sql to be overwritten by concrete classes return where clause set parameters for query to be overwritten by concrete classes param pstmt statement param for count for counting records throws sql exception abstract void set parameters prepared statement pstmt boolean for count forcount sqlexception setparameters preparedstatement forcount reset parameters to be overwritten by concrete classes void do reset has reset false to be overwritten by concrete classes return true if it has reset default false doreset boolean has reset return false history dialog to be overwritten by concrete classes hasreset void show history has history false to be overwritten by concrete classes return true if it has history default false showhistory boolean has history return false customize dialog to be overwritten by concrete classes hashistory void customize has customize false to be overwritten by concrete classes return true if it has customize default false boolean has customize return false zoom action to be overwritten by concrete classes hascustomize void zoom has zoom false to be overwritten by concrete classes return true if it has zoom default false boolean has zoom return false save selection details to be overwritten by concrete classes haszoom get zoom window param table name table name param isso trx sales trx return ad window id protected int getad window id string table name boolean isso trx if isso trx m po window id 0 return m po window id if m so window id 0 return m so window id string sql select ad window id po window id from ad table where table name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 table name result set rs pstmt execute query if rs next m so window id rs get int 1 m po window id rs get int 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if isso trx m po window id 0 return m po window id return m so window id tablename issotrx ad_window_id getad_window_id tablename issotrx issotrx m_po_window_id m_po_window_id m_so_window_id m_so_window_id ad_window_id po_window_id ad_table tablename preparedstatement preparestatement setstring tablename resultset executequery m_so_window_id getint m_po_window_id getint issotrx m_po_window_id m_po_window_id m_so_window_id mouse clicked param e event public void mouse clicked mouse event e log fine info mouse clicked click count e get click count right swing utilities is right mouse button e r m table get selected row c m table get selected column double click with selected row exit if e get click count 1 p table get selected row 1 dispose true double click same as ok right click start calculator else if swing utilities is right mouse button e popup show e get component e getx e gety mouseclicked mouseevent mouseclicked clickcount getclickcount swingutilities isrightmousebutton m_table getselectedrow m_table getselectedcolumn getclickcount p_table getselectedrow double_click swingutilities isrightmousebutton getcomponent do work load data public void run set cursor cursor get predefined cursor cursor wait cursor set status line msg get msg env get ctx start search false long start system current time millis clear table p table set row count 0 string dyn where getsql where string buffer sql new string buffer m sqlmain if dyn where length 0 sql append dyn where includes first and sql append m sqlorder string data sql msg parse translation env get ctx sql to string variables data sql m role get default add accesssql data sql get table name m role sql fullyqualified m role sql ro log finer data sql try prepared statement pstmt db prepare statement data sql null set parameters pstmt false no count log fine start query system current time millis start ms result set rs pstmt execute query log fine end query system current time millis start ms while is interrupted rs next int row p table get row count p table set row count row 1 int col offset 1 columns start with 1 for int col 0 col p layout length col object data null class c p layout col get col class int col index col col offset if c id column class data new id column rs get int col index else if c boolean class data new boolean y equals rs get string col index else if c timestamp class data rs get timestamp col index else if c big decimal class data rs get big decimal col index else if c double class data new double rs get double col index else if c integer class data new integer rs get int col index else if c key name pair class string display rs get string col index int key rs get int col index 1 data new key name pair key display col offset else data rs get string col index store p table set value at data row col log fine r row c col m layout col get col header data data to string data get class get name m table get cell renderer row col if is interrupted log finer interrupted rs close pstmt close catch sql exception e log log level severe data sql e int no p table get row count log fine no system current time millis start ms p table auto size set cursor cursor get default cursor set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if no 0 log fine data sql else p table get selection model set selection interval 0 0 p table request focus setcursor getpredefinedcursor wait_cursor setstatusline getmsg getctx startsearch currenttimemillis p_table setrowcount dynwhere getsqlwhere stringbuffer stringbuffer m_sqlmain dynwhere dynwhere m_sqlorder datasql parsetranslation getctx tostring datasql mrole getdefault addaccesssql datasql gettablename mrole sql_fullyqualified mrole sql_ro datasql preparedstatement preparestatement datasql setparameters currenttimemillis resultset executequery currenttimemillis isinterrupted p_table getrowcount p_table setrowcount coloffset p_layout p_layout getcolclass colindex coloffset idcolumn idcolumn getint colindex getstring colindex gettimestamp colindex bigdecimal getbigdecimal colindex getdouble colindex getint colindex keynamepair getstring colindex getint colindex keynamepair coloffset getstring colindex p_table setvalueat m_layout getcolheader tostring getclass getname m_table getcellrenderer isinterrupted sqlexception datasql p_table getrowcount currenttimemillis p_table autosize setcursor getdefaultcursor setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring datasql p_table getselectionmodel setselectioninterval p_table requestfocus create report column param ctx context param column name column name param display type display type public r column properties ctx string column name int display type this ctx column name display type null 0 columnname displaytype rcolumn columnname displaytype columnname displaytype create report column param ctx context param column name column name param display type display type param ad reference value id list table reference public r column properties ctx string column name int display type int ad reference value id this ctx column name display type null ad reference value id columnname displaytype ad_reference_value_id rcolumn columnname displaytype ad_reference_value_id columnname displaytype ad_reference_value_id create report column param ctx context param column name column name param display type display type param sql sql if null then column name is used will be overwritten if table dir or search public r column properties ctx string column name int display type string sql this ctx column name display type sql 0 columnname displaytype columnname tabledir rcolumn columnname displaytype columnname displaytype create report column param ctx context param column name column name param display type display type param sql sql if null then column name is used param ad reference value id list table reference will be overwritten if table dir or search public r column properties ctx string column name int display type string sql int ad reference value id m colheader msg translate ctx column name m displaytype display type m colsql sql if m colsql null m colsql length 0 m colsql column name strings if display type display type string display type display type text display type display type memo m colclass string class default size 30 amounts else if display type display type amount m colclass big decimal class m colsize 70 boolean else if display type display type yes no m colclass boolean class date else if display type is date display type m colclass timestamp class number else if display type display type quantity display type display type number display type display type cost price m colclass double class m colsize 70 integer else if display type display type integer m colclass integer class list else if display type display type list language language language get language env getad language ctx m colsql m lookup factory getlookup listembed language ad reference value id column name m colclass string class m isidcol false table else if display type display type table language language language get language env getad language ctx m colsql m lookup factory getlookup tableembed language column name r model table alias ad reference value id m colclass string class m isidcol false table dir search else m colclass string class language language language get language env getad language ctx if column name equals account id column name equals user1 id column name equals user2 id m colsql m lookup factory getlookup tabledirembed language c elementvalue id r model table alias column name m isidcol true else if column name equals c locfrom id column name equals c locto id m colsql m lookup factory getlookup tabledirembed language c location id r model table alias column name m isidcol true else if column name equals ad orgtrx id m colsql m lookup factory getlookup tabledirembed language ad org id r model table alias column name m isidcol true else if display type display type table dir m colsql m lookup factory getlookup tabledirembed language column name r model table alias m isidcol true columnname displaytype columnname ad_reference_value_id tabledir rcolumn columnname displaytype ad_reference_value_id m_colheader columnname m_displaytype displaytype m_colsql m_colsql m_colsql m_colsql columnname displaytype displaytype displaytype displaytype displaytype displaytype m_colclass displaytype displaytype m_colclass bigdecimal m_colsize displaytype displaytype yesno m_colclass displaytype isdate displaytype m_colclass displaytype displaytype displaytype displaytype displaytype displaytype costprice m_colclass m_colsize displaytype displaytype m_colclass displaytype displaytype getlanguage getad_language m_colsql mlookupfactory getlookup_listembed ad_reference_value_id columnname m_colclass m_isidcol displaytype displaytype getlanguage getad_language m_colsql mlookupfactory getlookup_tableembed columnname rmodel table_alias ad_reference_value_id m_colclass m_isidcol tabledir m_colclass getlanguage getad_language columnname account_id columnname user1_id columnname user2_id m_colsql mlookupfactory getlookup_tabledirembed c_elementvalue_id rmodel table_alias columnname m_isidcol columnname c_locfrom_id columnname c_locto_id m_colsql mlookupfactory getlookup_tabledirembed c_location_id rmodel table_alias columnname m_isidcol columnname ad_orgtrx_id m_colsql mlookupfactory getlookup_tabledirembed ad_org_id rmodel table_alias columnname m_isidcol displaytype displaytype tabledir m_colsql mlookupfactory getlookup_tabledirembed columnname rmodel table_alias m_isidcol create info column r o and not color column param col header column header param colsql sql select code for column param col class class of column determines display public r column string col header string colsql class col class m colheader col header m colsql colsql m colclass col class colheader colclass rcolumn colheader colclass m_colheader colheader m_colsql m_colclass colclass column header public string get col header return m colheader getcolheader m_colheader return m colheader public void set col header string col header m colheader col header m_colheader setcolheader colheader m_colheader colheader column sql public string get colsql return m colsql getcolsql m_colsql return m colsql public void set colsql string colsql m colsql colsql m_colsql setcolsql m_colsql this column is an id column i e two values int string are read public boolean isi dcol return m isidcol isidcol m_isidcol column display class public class get col class return m colclass getcolclass m_colclass return m colclass public void set col class class col class m colclass col class m_colclass setcolclass colclass m_colclass colclass column size in px public int get col size return m colsize getcolsize m_colsize column size in px public void set col size int col size m colsize col size setcolsize colsize m_colsize colsize get display type public int get display type return m displaytype displaytype getdisplaytype m_displaytype column is readonly public boolean is read only return m readonly isreadonly m_readonly return m readonly public void set read only boolean read only m readonly read only m_readonly setreadonly readonly m_readonly readonly this color determines the color of the row public void set color column boolean color column m colorcolumn color column setcolorcolumn colorcolumn m_colorcolumn colorcolumn m colorcolumn color column public boolean is color column return m colorcolumn m_colorcolumn colorcolumn iscolorcolumn m_colorcolumn string representation return info public string to string string buffer sb new string buffer r column sb append m colsql append append m colheader append return sb to string tostring stringbuffer stringbuffer rcolumn m_colsql m_colheader tostring private string icon mono32x32 filename public v table bean info iconmono32x32filename vtablebeaninfo public property descriptor get property descriptors property descriptor pds new property descriptor return pds propertydescriptor getpropertydescriptors propertydescriptor propertydescriptor public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename pos keyboard focus manager public pos keyboard focus manager super poskeyboardfocusmanager poskeyboardfocusmanager dispose public void dispose if m timer null m timer stop m timer null if m fifo null m fifo clear m fifo null m_timer m_timer m_timer m_fifo m_fifo m_fifo start timer public void start unqueue time 200 ms int delay 200 log fine delay if m timer null m timer new javax swing timer delay this if m timer is running m timer start m_timer m_timer m_timer isrunning m_timer stop timer public void stop log fine m timer if m timer null m timer stop m_timer m_timer m_timer dispatch key event queue param event event return true public boolean dispatch key event key event event if event getid key event key pressed keyboard repeat 485 then 31 log fine pos keyboard focus manager dispatch key event event get when event get when m lastwhen m lastwhen event get when if m timer null super dispatch key event event else m fifo add event return true dispatchkeyevent keyevent keyevent key_pressed poskeyboardfocusmanager dispatchkeyevent getwhen getwhen m_lastwhen m_lastwhen getwhen m_timer dispatchkeyevent m_fifo action performed unqueue param e event public void action performed action event e if m timer null return log fine action performed m fifo size while m fifo size 0 key event event key event m fifo remove first super dispatch key event event actionperformed actionevent m_timer actionperformed m_fifo m_fifo keyevent keyevent m_fifo removefirst dispatchkeyevent standard constructor public x c city properties ctx int c city id string trx name super ctx c city id trx name if c city id 0 setc city id 0 set name null x_c_city c_city_id trxname c_city_id trxname c_city_id setc_city_id setname load constructor public x c city properties ctx result set rs string trx name super ctx rs trx name x_c_city resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c city append get id append return sb to string tostring stringbuffer stringbuffer x_c_city get_id tostring set area code phone area code public void set area code string area code if area code null area code length 10 log warning length 10 truncated area code area code substring 0 9 set value area code area code setareacode areacode areacode areacode areacode areacode set_value areacode areacode get area code phone area code public string get area code return string get value area code getareacode get_value areacode set city city public void setc city id int c city id if c city id 1 throw new illegal argument exception c city id is mandatory set valuenocheck c city id new integer c city id setc_city_id c_city_id c_city_id illegalargumentexception c_city_id set_valuenocheck c_city_id c_city_id get city city public int getc city id integer ii integer get value c city id if ii null return 0 return ii int value getc_city_id get_value c_city_id intvalue set country country public void setc country id int c country id if c country id 0 set valuenocheck c country id null else set valuenocheck c country id new integer c country id setc_country_id c_country_id c_country_id set_valuenocheck c_country_id set_valuenocheck c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue public static final int c region id ad reference id 157 set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id c_region_id_ad_reference_id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set coordinates location coordinate public void set coordinates string coordinates if coordinates null coordinates length 15 log warning length 15 truncated coordinates coordinates substring 0 14 set value coordinates coordinates setcoordinates set_value get coordinates location coordinate public string get coordinates return string get value coordinates getcoordinates get_value set locode location code un locode public void set locode string locode if locode null locode length 10 log warning length 10 truncated locode locode substring 0 9 set value locode locode setlocode set_value get locode location code un locode public string get locode return string get value locode getlocode get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal set_value get zip postal code public string get postal return string get value postal getpostal get_value basic constructor public code basic constructor param element adds an element to the element public code element element add element element addelement basic constructor param element adds an element to the element public code string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public code add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public code add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public code add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public code add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public code remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param ctx context param r requestupdate id id param trx name trx public m request update properties ctx int r requestupdate id string trx name super ctx r requestupdate id trx name r_requestupdate_id trxname mrequestupdate r_requestupdate_id trxname r_requestupdate_id trxname load constructor param ctx context param rs result set param trx name trx public m request update properties ctx result set rs string trx name super ctx rs trx name trxname mrequestupdate resultset trxname trxname parent constructor param parent request public m request update m request parent super parent get ctx 0 parent get trxname set client org parent setr request id parent getr request id set start time parent get start time set end time parent get end time set result parent get result set qty spent parent get qty spent set qty invoiced parent get qty invoiced setm productspent id parent getm productspent id set confidential type entry parent get confidential type entry mrequestupdate mrequest getctx get_trxname setclientorg setr_request_id getr_request_id setstarttime getstarttime setendtime getendtime setresult getresult setqtyspent getqtyspent setqtyinvoiced getqtyinvoiced setm_productspent_id getm_productspent_id setconfidentialtypeentry getconfidentialtypeentry do we have new info return true if new info public boolean is new info return get result null isnewinfo getresult get name of creator return name public string get created by name m user user m user get get ctx get created by return user get name getcreatedbyname muser muser getctx getcreatedby getname get confidential entry text for jsp return text public string get confidential entry text return m ref list get list name get ctx confidentialtypeentry ad reference id get confidential type entry getconfidentialentrytext mreflist getlistname getctx confidentialtypeentry_ad_reference_id getconfidentialtypeentry before save param new record new return true protected boolean before save boolean new record if get confidential type entry null set confidential type entry confidentialtypeentry publicinformation return true newrecord beforesave newrecord getconfidentialtypeentry setconfidentialtypeentry confidentialtypeentry_publicinformation get contsnts return contents public object get contents return contents getcontents constructor param find find param value to true if it is the to value column public find value renderer find find boolean value to super m find find m valuetocolumn value to valueto findvaluerenderer valueto m_find m_valuetocolumn valueto get check box return check box private j check box get check if m check null m check new j check box m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center return m check jcheckbox getcheck m_check m_check jcheckbox m_check setmargin m_check sethorizontalalignment jlabel m_check get table cell renderer component param table table param value value param is selected selected param has focus focus param row row param col col return renderer component label or check box public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int col log config find value renderer get table cell renderer component r row c col column m columnname null object column table get model get value at row find index columnname if column null m columnname value name pair column get value between enables value to column m between false object between value table get model get value at row find index operator if m valuetocolumn between value null between value equals m query operators m query between index m between true boolean enabled m valuetocolumn m valuetocolumn m between set background if enabled set background compiereplaf getfieldbackground normal else set background compiereplaf getfieldbackground inactive log config find value renderer get table cell renderer component value enabled enabled component c super get table cell renderer component table value is selected has focus row col if value null m valuetocolumn m between return c m field field getm field if field null field get display type display type yes no j check box cb get check if value instanceof boolean cb set selected boolean value boolean value else cb set selected value to string index of y 1 return cb return c tablecell renderercomponent isselected hasfocus checkbox gettablecellrenderercomponent jtable isselected hasfocus findvaluerenderer gettablecellrenderercomponent m_columnname getmodel getvalueat index_columnname m_columnname valuenamepair getvalue valuetocolumn m_between betweenvalue getmodel getvalueat index_operator m_valuetocolumn betweenvalue betweenvalue mquery mquery between_index m_between m_valuetocolumn m_valuetocolumn m_between setbackground getfieldbackground_normal setbackground getfieldbackground_inactive findvaluerenderer gettablecellrenderercomponent gettablecellrenderercomponent isselected hasfocus m_valuetocolumn m_between mfield getmfield getdisplaytype displaytype yesno jcheckbox getcheck setselected booleanvalue setselected tostring indexof format display value param value value protected void set value object value boolean enabled m valuetocolumn m valuetocolumn m between log trace log l4 data find value renderer set value value enabled enabled if value null enabled super set value null return string ret value null strip if value null string str value to string if str starts with str ends with str str substring 1 str length 1 value str int display type 0 m field field getm field if field null display type field get display type else log log level severe find value renderer set value value column name m columnname no target column set horizontal alignment j label left number if display type is numeric display type set horizontal alignment j label right ret value display type get number format display type format value date else if display type is date display type if value instanceof date ret value display type get date format display type format value set horizontal alignment j label right else if value instanceof string jdbc format try java util date date display type getdateformat jdbc parse string value ret value display type get date format display type format date set horizontal alignment j label right catch exception e log log level severe find value renderer set value e ret value value to string else ret value value to string row id else if display type display type rowid ret value lookup else if display type is lookup display type field null lookup lookup field get lookup if lookup null ret value lookup get display value other else super set value value return log config find value renderer set value ret value dt display type super set value ret value setvalue m_valuetocolumn m_valuetocolumn m_between l4_data findvaluerenderer setvalue setvalue retvalue tostring startswith endswith displaytype mfield getmfield displaytype getdisplaytype findvaluerenderer setvalue columnname m_columnname sethorizontalalignment jlabel displaytype isnumeric displaytype sethorizontalalignment jlabel retvalue displaytype getnumberformat displaytype displaytype isdate displaytype retvalue displaytype getdateformat displaytype sethorizontalalignment jlabel displaytype getdateformat_jdbc retvalue displaytype getdateformat displaytype sethorizontalalignment jlabel findvaluerenderer setvalue retvalue tostring retvalue tostring displaytype displaytype retvalue displaytype islookup displaytype getlookup retvalue getdisplay setvalue findvaluerenderer setvalue retvalue displaytype setvalue retvalue get m field return field private m field getm field return m find get targetm field m columnname mfield mfield getmfield m_find gettargetmfield m_columnname standard constructor public x c acctschema default properties ctx int c acctschema default id string trx name super ctx c acctschema default id trx name if c acctschema default id 0 setb asset acct 0 setb expense acct 0 setb intransit acct 0 setb interestexp acct 0 setb interestrev acct 0 setb paymentselect acct 0 setb revaluationgain acct 0 setb revaluationloss acct 0 setb settlementgain acct 0 setb settlementloss acct 0 setb unallocatedcash acct 0 setb unidentified acct 0 setcb asset acct 0 setcb cashtransfer acct 0 setcb differences acct 0 setcb expense acct 0 setcb receipt acct 0 setc acctschema id 0 setc prepayment acct 0 setc receivable acct 0 setc receivable services acct 0 setch expense acct 0 setch revenue acct 0 sete expense acct 0 sete prepayment acct 0 setnotinvoicedreceipts acct 0 setnotinvoicedreceivables acct 0 setnotinvoicedrevenue acct 0 setpj asset acct 0 setpj wip acct 0 setp asset acct 0 setp cogs acct 0 setp costadjustment acct 0 setp expense acct 0 setp inventoryclearing acct 0 setp invoicepricevariance acct 0 setp purchasepricevariance acct 0 setp revenue acct 0 setp tradediscountgrant acct 0 setp tradediscountrec acct 0 setpaydiscount exp acct 0 setpaydiscount rev acct 0 setrealizedgain acct 0 setrealizedloss acct 0 sett credit acct 0 sett due acct 0 sett expense acct 0 sett liability acct 0 sett receivables acct 0 setunearnedrevenue acct 0 setunrealizedgain acct 0 setunrealizedloss acct 0 setv liability acct 0 setv liability services acct 0 setv prepayment acct 0 setw differences acct 0 setw invactualadjust acct 0 setw inventory acct 0 setw revaluation acct 0 setwithholding acct 0 setwriteoff acct 0 x_c_acctschema_default c_acctschema_default_id trxname c_acctschema_default_id trxname c_acctschema_default_id setb_asset_acct setb_expense_acct setb_intransit_acct setb_interestexp_acct setb_interestrev_acct setb_paymentselect_acct setb_revaluationgain_acct setb_revaluationloss_acct setb_settlementgain_acct setb_settlementloss_acct setb_unallocatedcash_acct setb_unidentified_acct setcb_asset_acct setcb_cashtransfer_acct setcb_differences_acct setcb_expense_acct setcb_receipt_acct setc_acctschema_id setc_prepayment_acct setc_receivable_acct setc_receivable_services_acct setch_expense_acct setch_revenue_acct sete_expense_acct sete_prepayment_acct setnotinvoicedreceipts_acct setnotinvoicedreceivables_acct setnotinvoicedrevenue_acct setpj_asset_acct setpj_wip_acct setp_asset_acct setp_cogs_acct setp_costadjustment_acct setp_expense_acct setp_inventoryclearing_acct setp_invoicepricevariance_acct setp_purchasepricevariance_acct setp_revenue_acct setp_tradediscountgrant_acct setp_tradediscountrec_acct setpaydiscount_exp_acct setpaydiscount_rev_acct setrealizedgain_acct setrealizedloss_acct sett_credit_acct sett_due_acct sett_expense_acct sett_liability_acct sett_receivables_acct setunearnedrevenue_acct setunrealizedgain_acct setunrealizedloss_acct setv_liability_acct setv_liability_services_acct setv_prepayment_acct setw_differences_acct setw_invactualadjust_acct setw_inventory_acct setw_revaluation_acct setwithholding_acct setwriteoff_acct load constructor public x c acctschema default properties ctx result set rs string trx name super ctx rs trx name x_c_acctschema_default resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctschema default append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctschema_default get_id tostring set bank asset bank asset account public void setb asset acct int b asset acct set value b asset acct new integer b asset acct setb_asset_acct b_asset_acct set_value b_asset_acct b_asset_acct get bank asset bank asset account public int getb asset acct integer ii integer get value b asset acct if ii null return 0 return ii int value getb_asset_acct get_value b_asset_acct intvalue set bank expense bank expense account public void setb expense acct int b expense acct set value b expense acct new integer b expense acct setb_expense_acct b_expense_acct set_value b_expense_acct b_expense_acct get bank expense bank expense account public int getb expense acct integer ii integer get value b expense acct if ii null return 0 return ii int value getb_expense_acct get_value b_expense_acct intvalue set bank in transit bank in transit account public void setb intransit acct int b intransit acct set value b intransit acct new integer b intransit acct setb_intransit_acct b_intransit_acct set_value b_intransit_acct b_intransit_acct get bank in transit bank in transit account public int getb intransit acct integer ii integer get value b intransit acct if ii null return 0 return ii int value getb_intransit_acct get_value b_intransit_acct intvalue set bank interest expense bank interest expense account public void setb interestexp acct int b interestexp acct set value b interestexp acct new integer b interestexp acct setb_interestexp_acct b_interestexp_acct set_value b_interestexp_acct b_interestexp_acct get bank interest expense bank interest expense account public int getb interestexp acct integer ii integer get value b interestexp acct if ii null return 0 return ii int value getb_interestexp_acct get_value b_interestexp_acct intvalue set bank interest revenue bank interest revenue account public void setb interestrev acct int b interestrev acct set value b interestrev acct new integer b interestrev acct setb_interestrev_acct b_interestrev_acct set_value b_interestrev_acct b_interestrev_acct get bank interest revenue bank interest revenue account public int getb interestrev acct integer ii integer get value b interestrev acct if ii null return 0 return ii int value getb_interestrev_acct get_value b_interestrev_acct intvalue set payment selection ap payment selection clearing account public void setb paymentselect acct int b paymentselect acct set value b paymentselect acct new integer b paymentselect acct setb_paymentselect_acct b_paymentselect_acct set_value b_paymentselect_acct b_paymentselect_acct get payment selection ap payment selection clearing account public int getb paymentselect acct integer ii integer get value b paymentselect acct if ii null return 0 return ii int value getb_paymentselect_acct get_value b_paymentselect_acct intvalue set bank revaluation gain bank revaluation gain account public void setb revaluationgain acct int b revaluationgain acct set value b revaluationgain acct new integer b revaluationgain acct setb_revaluationgain_acct b_revaluationgain_acct set_value b_revaluationgain_acct b_revaluationgain_acct get bank revaluation gain bank revaluation gain account public int getb revaluationgain acct integer ii integer get value b revaluationgain acct if ii null return 0 return ii int value getb_revaluationgain_acct get_value b_revaluationgain_acct intvalue set bank revaluation loss bank revaluation loss account public void setb revaluationloss acct int b revaluationloss acct set value b revaluationloss acct new integer b revaluationloss acct setb_revaluationloss_acct b_revaluationloss_acct set_value b_revaluationloss_acct b_revaluationloss_acct get bank revaluation loss bank revaluation loss account public int getb revaluationloss acct integer ii integer get value b revaluationloss acct if ii null return 0 return ii int value getb_revaluationloss_acct get_value b_revaluationloss_acct intvalue set bank settlement gain bank settlement gain account public void setb settlementgain acct int b settlementgain acct set value b settlementgain acct new integer b settlementgain acct setb_settlementgain_acct b_settlementgain_acct set_value b_settlementgain_acct b_settlementgain_acct get bank settlement gain bank settlement gain account public int getb settlementgain acct integer ii integer get value b settlementgain acct if ii null return 0 return ii int value getb_settlementgain_acct get_value b_settlementgain_acct intvalue set bank settlement loss bank settlement loss account public void setb settlementloss acct int b settlementloss acct set value b settlementloss acct new integer b settlementloss acct setb_settlementloss_acct b_settlementloss_acct set_value b_settlementloss_acct b_settlementloss_acct get bank settlement loss bank settlement loss account public int getb settlementloss acct integer ii integer get value b settlementloss acct if ii null return 0 return ii int value getb_settlementloss_acct get_value b_settlementloss_acct intvalue set unallocated cash unallocated cash clearing account public void setb unallocatedcash acct int b unallocatedcash acct set value b unallocatedcash acct new integer b unallocatedcash acct setb_unallocatedcash_acct b_unallocatedcash_acct set_value b_unallocatedcash_acct b_unallocatedcash_acct get unallocated cash unallocated cash clearing account public int getb unallocatedcash acct integer ii integer get value b unallocatedcash acct if ii null return 0 return ii int value getb_unallocatedcash_acct get_value b_unallocatedcash_acct intvalue set bank unidentified receipts bank unidentified receipts account public void setb unidentified acct int b unidentified acct set value b unidentified acct new integer b unidentified acct setb_unidentified_acct b_unidentified_acct set_value b_unidentified_acct b_unidentified_acct get bank unidentified receipts bank unidentified receipts account public int getb unidentified acct integer ii integer get value b unidentified acct if ii null return 0 return ii int value getb_unidentified_acct get_value b_unidentified_acct intvalue set cash book asset cash book asset account public void setcb asset acct int cb asset acct set value cb asset acct new integer cb asset acct setcb_asset_acct cb_asset_acct set_value cb_asset_acct cb_asset_acct get cash book asset cash book asset account public int getcb asset acct integer ii integer get value cb asset acct if ii null return 0 return ii int value getcb_asset_acct get_value cb_asset_acct intvalue set cash transfer cash transfer clearing account public void setcb cashtransfer acct int cb cashtransfer acct set value cb cashtransfer acct new integer cb cashtransfer acct setcb_cashtransfer_acct cb_cashtransfer_acct set_value cb_cashtransfer_acct cb_cashtransfer_acct get cash transfer cash transfer clearing account public int getcb cashtransfer acct integer ii integer get value cb cashtransfer acct if ii null return 0 return ii int value getcb_cashtransfer_acct get_value cb_cashtransfer_acct intvalue set cash book differences cash book differences account public void setcb differences acct int cb differences acct set value cb differences acct new integer cb differences acct setcb_differences_acct cb_differences_acct set_value cb_differences_acct cb_differences_acct get cash book differences cash book differences account public int getcb differences acct integer ii integer get value cb differences acct if ii null return 0 return ii int value getcb_differences_acct get_value cb_differences_acct intvalue set cash book expense cash book expense account public void setcb expense acct int cb expense acct set value cb expense acct new integer cb expense acct setcb_expense_acct cb_expense_acct set_value cb_expense_acct cb_expense_acct get cash book expense cash book expense account public int getcb expense acct integer ii integer get value cb expense acct if ii null return 0 return ii int value getcb_expense_acct get_value cb_expense_acct intvalue set cash book receipt cash book receipts account public void setcb receipt acct int cb receipt acct set value cb receipt acct new integer cb receipt acct setcb_receipt_acct cb_receipt_acct set_value cb_receipt_acct cb_receipt_acct get cash book receipt cash book receipts account public int getcb receipt acct integer ii integer get value cb receipt acct if ii null return 0 return ii int value getcb_receipt_acct get_value cb_receipt_acct intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc acctschema id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_acctschema_id set customer prepayment account for customer prepayments public void setc prepayment acct int c prepayment acct set value c prepayment acct new integer c prepayment acct setc_prepayment_acct c_prepayment_acct set_value c_prepayment_acct c_prepayment_acct get customer prepayment account for customer prepayments public int getc prepayment acct integer ii integer get value c prepayment acct if ii null return 0 return ii int value getc_prepayment_acct get_value c_prepayment_acct intvalue set customer receivables account for customer receivables public void setc receivable acct int c receivable acct set value c receivable acct new integer c receivable acct setc_receivable_acct c_receivable_acct set_value c_receivable_acct c_receivable_acct get customer receivables account for customer receivables public int getc receivable acct integer ii integer get value c receivable acct if ii null return 0 return ii int value getc_receivable_acct get_value c_receivable_acct intvalue set receivable services customer accounts receivables services account public void setc receivable services acct int c receivable services acct set value c receivable services acct new integer c receivable services acct setc_receivable_services_acct c_receivable_services_acct set_value c_receivable_services_acct c_receivable_services_acct get receivable services customer accounts receivables services account public int getc receivable services acct integer ii integer get value c receivable services acct if ii null return 0 return ii int value getc_receivable_services_acct get_value c_receivable_services_acct intvalue set charge expense charge expense account public void setch expense acct int ch expense acct set value ch expense acct new integer ch expense acct setch_expense_acct ch_expense_acct set_value ch_expense_acct ch_expense_acct get charge expense charge expense account public int getch expense acct integer ii integer get value ch expense acct if ii null return 0 return ii int value getch_expense_acct get_value ch_expense_acct intvalue set charge revenue charge revenue account public void setch revenue acct int ch revenue acct set value ch revenue acct new integer ch revenue acct setch_revenue_acct ch_revenue_acct set_value ch_revenue_acct ch_revenue_acct get charge revenue charge revenue account public int getch revenue acct integer ii integer get value ch revenue acct if ii null return 0 return ii int value getch_revenue_acct get_value ch_revenue_acct intvalue set employee expense account for employee expenses public void sete expense acct int e expense acct set value e expense acct new integer e expense acct sete_expense_acct e_expense_acct set_value e_expense_acct e_expense_acct get employee expense account for employee expenses public int gete expense acct integer ii integer get value e expense acct if ii null return 0 return ii int value gete_expense_acct get_value e_expense_acct intvalue set employee prepayment account for employee expense prepayments public void sete prepayment acct int e prepayment acct set value e prepayment acct new integer e prepayment acct sete_prepayment_acct e_prepayment_acct set_value e_prepayment_acct e_prepayment_acct get employee prepayment account for employee expense prepayments public int gete prepayment acct integer ii integer get value e prepayment acct if ii null return 0 return ii int value gete_prepayment_acct get_value e_prepayment_acct intvalue set not invoiced receipts account for not invoiced material receipts public void setnotinvoicedreceipts acct int notinvoicedreceipts acct set value notinvoicedreceipts acct new integer notinvoicedreceipts acct setnotinvoicedreceipts_acct notinvoicedreceipts_acct set_value notinvoicedreceipts_acct notinvoicedreceipts_acct get not invoiced receipts account for not invoiced material receipts public int getnotinvoicedreceipts acct integer ii integer get value notinvoicedreceipts acct if ii null return 0 return ii int value getnotinvoicedreceipts_acct get_value notinvoicedreceipts_acct intvalue set not invoiced receivables account for not invoiced receivables public void setnotinvoicedreceivables acct int notinvoicedreceivables acct set value notinvoicedreceivables acct new integer notinvoicedreceivables acct setnotinvoicedreceivables_acct notinvoicedreceivables_acct set_value notinvoicedreceivables_acct notinvoicedreceivables_acct get not invoiced receivables account for not invoiced receivables public int getnotinvoicedreceivables acct integer ii integer get value notinvoicedreceivables acct if ii null return 0 return ii int value getnotinvoicedreceivables_acct get_value notinvoicedreceivables_acct intvalue set not invoiced revenue account for not invoiced revenue public void setnotinvoicedrevenue acct int notinvoicedrevenue acct set value notinvoicedrevenue acct new integer notinvoicedrevenue acct setnotinvoicedrevenue_acct notinvoicedrevenue_acct set_value notinvoicedrevenue_acct notinvoicedrevenue_acct get not invoiced revenue account for not invoiced revenue public int getnotinvoicedrevenue acct integer ii integer get value notinvoicedrevenue acct if ii null return 0 return ii int value getnotinvoicedrevenue_acct get_value notinvoicedrevenue_acct intvalue set project asset project asset account public void setpj asset acct int pj asset acct set value pj asset acct new integer pj asset acct setpj_asset_acct pj_asset_acct set_value pj_asset_acct pj_asset_acct get project asset project asset account public int getpj asset acct integer ii integer get value pj asset acct if ii null return 0 return ii int value getpj_asset_acct get_value pj_asset_acct intvalue set work in progress account for work in progress public void setpj wip acct int pj wip acct set value pj wip acct new integer pj wip acct setpj_wip_acct pj_wip_acct set_value pj_wip_acct pj_wip_acct get work in progress account for work in progress public int getpj wip acct integer ii integer get value pj wip acct if ii null return 0 return ii int value getpj_wip_acct get_value pj_wip_acct intvalue set product asset account for product asset inventory public void setp asset acct int p asset acct set value p asset acct new integer p asset acct setp_asset_acct p_asset_acct set_value p_asset_acct p_asset_acct get product asset account for product asset inventory public int getp asset acct integer ii integer get value p asset acct if ii null return 0 return ii int value getp_asset_acct get_value p_asset_acct intvalue set product cogs account for cost of goods sold public void setp cogs acct int p cogs acct set value p cogs acct new integer p cogs acct setp_cogs_acct p_cogs_acct set_value p_cogs_acct p_cogs_acct get product cogs account for cost of goods sold public int getp cogs acct integer ii integer get value p cogs acct if ii null return 0 return ii int value getp_cogs_acct get_value p_cogs_acct intvalue set cost adjustment product cost adjustment account public void setp costadjustment acct int p costadjustment acct set value p costadjustment acct new integer p costadjustment acct setp_costadjustment_acct p_costadjustment_acct set_value p_costadjustment_acct p_costadjustment_acct get cost adjustment product cost adjustment account public int getp costadjustment acct integer ii integer get value p costadjustment acct if ii null return 0 return ii int value getp_costadjustment_acct get_value p_costadjustment_acct intvalue set product expense account for product expense public void setp expense acct int p expense acct set value p expense acct new integer p expense acct setp_expense_acct p_expense_acct set_value p_expense_acct p_expense_acct get product expense account for product expense public int getp expense acct integer ii integer get value p expense acct if ii null return 0 return ii int value getp_expense_acct get_value p_expense_acct intvalue set inventory clearing product inventory clearing account public void setp inventoryclearing acct int p inventoryclearing acct set value p inventoryclearing acct new integer p inventoryclearing acct setp_inventoryclearing_acct p_inventoryclearing_acct set_value p_inventoryclearing_acct p_inventoryclearing_acct get inventory clearing product inventory clearing account public int getp inventoryclearing acct integer ii integer get value p inventoryclearing acct if ii null return 0 return ii int value getp_inventoryclearing_acct get_value p_inventoryclearing_acct intvalue set invoice price variance difference between costs and invoice price ipv public void setp invoicepricevariance acct int p invoicepricevariance acct set value p invoicepricevariance acct new integer p invoicepricevariance acct setp_invoicepricevariance_acct p_invoicepricevariance_acct set_value p_invoicepricevariance_acct p_invoicepricevariance_acct get invoice price variance difference between costs and invoice price ipv public int getp invoicepricevariance acct integer ii integer get value p invoicepricevariance acct if ii null return 0 return ii int value getp_invoicepricevariance_acct get_value p_invoicepricevariance_acct intvalue set purchase price variance difference between standard cost and purchase price ppv public void setp purchasepricevariance acct int p purchasepricevariance acct set value p purchasepricevariance acct new integer p purchasepricevariance acct setp_purchasepricevariance_acct p_purchasepricevariance_acct set_value p_purchasepricevariance_acct p_purchasepricevariance_acct get purchase price variance difference between standard cost and purchase price ppv public int getp purchasepricevariance acct integer ii integer get value p purchasepricevariance acct if ii null return 0 return ii int value getp_purchasepricevariance_acct get_value p_purchasepricevariance_acct intvalue set product revenue account for product revenue sales account public void setp revenue acct int p revenue acct set value p revenue acct new integer p revenue acct setp_revenue_acct p_revenue_acct set_value p_revenue_acct p_revenue_acct get product revenue account for product revenue sales account public int getp revenue acct integer ii integer get value p revenue acct if ii null return 0 return ii int value getp_revenue_acct get_value p_revenue_acct intvalue set trade discount granted trade discount granted account public void setp tradediscountgrant acct int p tradediscountgrant acct set value p tradediscountgrant acct new integer p tradediscountgrant acct setp_tradediscountgrant_acct p_tradediscountgrant_acct set_value p_tradediscountgrant_acct p_tradediscountgrant_acct get trade discount granted trade discount granted account public int getp tradediscountgrant acct integer ii integer get value p tradediscountgrant acct if ii null return 0 return ii int value getp_tradediscountgrant_acct get_value p_tradediscountgrant_acct intvalue set trade discount received trade discount receivable account public void setp tradediscountrec acct int p tradediscountrec acct set value p tradediscountrec acct new integer p tradediscountrec acct setp_tradediscountrec_acct p_tradediscountrec_acct set_value p_tradediscountrec_acct p_tradediscountrec_acct get trade discount received trade discount receivable account public int getp tradediscountrec acct integer ii integer get value p tradediscountrec acct if ii null return 0 return ii int value getp_tradediscountrec_acct get_value p_tradediscountrec_acct intvalue set payment discount expense payment discount expense account public void setpaydiscount exp acct int paydiscount exp acct set value paydiscount exp acct new integer paydiscount exp acct setpaydiscount_exp_acct paydiscount_exp_acct set_value paydiscount_exp_acct paydiscount_exp_acct get payment discount expense payment discount expense account public int getpaydiscount exp acct integer ii integer get value paydiscount exp acct if ii null return 0 return ii int value getpaydiscount_exp_acct get_value paydiscount_exp_acct intvalue set payment discount revenue payment discount revenue account public void setpaydiscount rev acct int paydiscount rev acct set value paydiscount rev acct new integer paydiscount rev acct setpaydiscount_rev_acct paydiscount_rev_acct set_value paydiscount_rev_acct paydiscount_rev_acct get payment discount revenue payment discount revenue account public int getpaydiscount rev acct integer ii integer get value paydiscount rev acct if ii null return 0 return ii int value getpaydiscount_rev_acct get_value paydiscount_rev_acct intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set realized gain acct realized gain account public void setrealizedgain acct int realizedgain acct set value realizedgain acct new integer realizedgain acct setrealizedgain_acct realizedgain_acct set_value realizedgain_acct realizedgain_acct get realized gain acct realized gain account public int getrealizedgain acct integer ii integer get value realizedgain acct if ii null return 0 return ii int value getrealizedgain_acct get_value realizedgain_acct intvalue set realized loss acct realized loss account public void setrealizedloss acct int realizedloss acct set value realizedloss acct new integer realizedloss acct setrealizedloss_acct realizedloss_acct set_value realizedloss_acct realizedloss_acct get realized loss acct realized loss account public int getrealizedloss acct integer ii integer get value realizedloss acct if ii null return 0 return ii int value getrealizedloss_acct get_value realizedloss_acct intvalue set tax credit account for tax you can reclaim public void sett credit acct int t credit acct set value t credit acct new integer t credit acct sett_credit_acct t_credit_acct set_value t_credit_acct t_credit_acct get tax credit account for tax you can reclaim public int gett credit acct integer ii integer get value t credit acct if ii null return 0 return ii int value gett_credit_acct get_value t_credit_acct intvalue set tax due account for tax you have to pay public void sett due acct int t due acct set value t due acct new integer t due acct sett_due_acct t_due_acct set_value t_due_acct t_due_acct get tax due account for tax you have to pay public int gett due acct integer ii integer get value t due acct if ii null return 0 return ii int value gett_due_acct get_value t_due_acct intvalue set tax expense account for paid tax you cannot reclaim public void sett expense acct int t expense acct set value t expense acct new integer t expense acct sett_expense_acct t_expense_acct set_value t_expense_acct t_expense_acct get tax expense account for paid tax you cannot reclaim public int gett expense acct integer ii integer get value t expense acct if ii null return 0 return ii int value gett_expense_acct get_value t_expense_acct intvalue set tax liability account for tax declaration liability public void sett liability acct int t liability acct set value t liability acct new integer t liability acct sett_liability_acct t_liability_acct set_value t_liability_acct t_liability_acct get tax liability account for tax declaration liability public int gett liability acct integer ii integer get value t liability acct if ii null return 0 return ii int value gett_liability_acct get_value t_liability_acct intvalue set tax receivables account for tax credit after tax declaration public void sett receivables acct int t receivables acct set value t receivables acct new integer t receivables acct sett_receivables_acct t_receivables_acct set_value t_receivables_acct t_receivables_acct get tax receivables account for tax credit after tax declaration public int gett receivables acct integer ii integer get value t receivables acct if ii null return 0 return ii int value gett_receivables_acct get_value t_receivables_acct intvalue set unearned revenue account for unearned revenue public void setunearnedrevenue acct int unearnedrevenue acct set value unearnedrevenue acct new integer unearnedrevenue acct setunearnedrevenue_acct unearnedrevenue_acct set_value unearnedrevenue_acct unearnedrevenue_acct get unearned revenue account for unearned revenue public int getunearnedrevenue acct integer ii integer get value unearnedrevenue acct if ii null return 0 return ii int value getunearnedrevenue_acct get_value unearnedrevenue_acct intvalue set unrealized gain acct unrealized gain account for currency revaluation public void setunrealizedgain acct int unrealizedgain acct set value unrealizedgain acct new integer unrealizedgain acct setunrealizedgain_acct unrealizedgain_acct set_value unrealizedgain_acct unrealizedgain_acct get unrealized gain acct unrealized gain account for currency revaluation public int getunrealizedgain acct integer ii integer get value unrealizedgain acct if ii null return 0 return ii int value getunrealizedgain_acct get_value unrealizedgain_acct intvalue set unrealized loss acct unrealized loss account for currency revaluation public void setunrealizedloss acct int unrealizedloss acct set value unrealizedloss acct new integer unrealizedloss acct setunrealizedloss_acct unrealizedloss_acct set_value unrealizedloss_acct unrealizedloss_acct get unrealized loss acct unrealized loss account for currency revaluation public int getunrealizedloss acct integer ii integer get value unrealizedloss acct if ii null return 0 return ii int value getunrealizedloss_acct get_value unrealizedloss_acct intvalue set vendor liability account for vendor liability public void setv liability acct int v liability acct set value v liability acct new integer v liability acct setv_liability_acct v_liability_acct set_value v_liability_acct v_liability_acct get vendor liability account for vendor liability public int getv liability acct integer ii integer get value v liability acct if ii null return 0 return ii int value getv_liability_acct get_value v_liability_acct intvalue set vendor service liability account for vender service liability public void setv liability services acct int v liability services acct set value v liability services acct new integer v liability services acct setv_liability_services_acct v_liability_services_acct set_value v_liability_services_acct v_liability_services_acct get vendor service liability account for vender service liability public int getv liability services acct integer ii integer get value v liability services acct if ii null return 0 return ii int value getv_liability_services_acct get_value v_liability_services_acct intvalue set vendor prepayment account for vendor prepayments public void setv prepayment acct int v prepayment acct set value v prepayment acct new integer v prepayment acct setv_prepayment_acct v_prepayment_acct set_value v_prepayment_acct v_prepayment_acct get vendor prepayment account for vendor prepayments public int getv prepayment acct integer ii integer get value v prepayment acct if ii null return 0 return ii int value getv_prepayment_acct get_value v_prepayment_acct intvalue set warehouse differences warehouse differences account public void setw differences acct int w differences acct set value w differences acct new integer w differences acct setw_differences_acct w_differences_acct set_value w_differences_acct w_differences_acct get warehouse differences warehouse differences account public int getw differences acct integer ii integer get value w differences acct if ii null return 0 return ii int value getw_differences_acct get_value w_differences_acct intvalue set inventory adjustment account for inventory value adjustments for actual costing public void setw invactualadjust acct int w invactualadjust acct set value w invactualadjust acct new integer w invactualadjust acct setw_invactualadjust_acct w_invactualadjust_acct set_value w_invactualadjust_acct w_invactualadjust_acct get inventory adjustment account for inventory value adjustments for actual costing public int getw invactualadjust acct integer ii integer get value w invactualadjust acct if ii null return 0 return ii int value getw_invactualadjust_acct get_value w_invactualadjust_acct intvalue set not used warehouse inventory asset account currently not used public void setw inventory acct int w inventory acct set value w inventory acct new integer w inventory acct setw_inventory_acct w_inventory_acct set_value w_inventory_acct w_inventory_acct get not used warehouse inventory asset account currently not used public int getw inventory acct integer ii integer get value w inventory acct if ii null return 0 return ii int value getw_inventory_acct get_value w_inventory_acct intvalue set inventory revaluation account for inventory revaluation public void setw revaluation acct int w revaluation acct set value w revaluation acct new integer w revaluation acct setw_revaluation_acct w_revaluation_acct set_value w_revaluation_acct w_revaluation_acct get inventory revaluation account for inventory revaluation public int getw revaluation acct integer ii integer get value w revaluation acct if ii null return 0 return ii int value getw_revaluation_acct get_value w_revaluation_acct intvalue set withholding account for withholdings public void setwithholding acct int withholding acct set value withholding acct new integer withholding acct setwithholding_acct withholding_acct set_value withholding_acct withholding_acct get withholding account for withholdings public int getwithholding acct integer ii integer get value withholding acct if ii null return 0 return ii int value getwithholding_acct get_value withholding_acct intvalue set write off account for receivables write off public void setwriteoff acct int writeoff acct set value writeoff acct new integer writeoff acct setwriteoff_acct writeoff_acct set_value writeoff_acct writeoff_acct get write off account for receivables write off public int getwriteoff acct integer ii integer get value writeoff acct if ii null return 0 return ii int value getwriteoff_acct get_value writeoff_acct intvalue standard constructor param ctx context param ad usermail id id param trx name trx public m user mail properties ctx int ad usermail id string trx name super ctx ad usermail id trx name ad_usermail_id trxname musermail ad_usermail_id trxname ad_usermail_id trxname load constructor param ctx context param rs result set param trx name trx public m user mail properties ctx result set rs string trx name super ctx rs trx name trxname musermail resultset trxname trxname user mail param parent request mail text param ad user id recipient user param mail email public m user mail m mail text parent int ad user id e mail mail this parent get ctx 0 parent get trxname set client org parent setad user id ad user id setr mailtext id parent getr mailtext id if mail is sentok set messageid mail get messageid else set messageid mail get sent msg set is delivered isdelivered no ad_user_id musermail mmailtext ad_user_id email getctx get_trxname setclientorg setad_user_id ad_user_id setr_mailtext_id getr_mailtext_id issentok setmessageid getmessageid setmessageid getsentmsg setisdelivered isdelivered_no parent constructor param parent mail message param ad user id recipient user param mail email public m user mail m mail msg parent int ad user id e mail mail this parent get ctx 0 parent get trxname set client org parent setad user id ad user id setw mailmsg id parent getw mailmsg id if mail is sentok set messageid mail get messageid else set messageid mail get sent msg set is delivered isdelivered no ad_user_id musermail mmailmsg ad_user_id email getctx get_trxname setclientorg setad_user_id ad_user_id setw_mailmsg_id getw_mailmsg_id issentok setmessageid getmessageid setmessageid getsentmsg setisdelivered isdelivered_no new user mail no trx param po persistent object param ad user id recipient user param mail email public m user mail po po int ad user id e mail mail this po get ctx 0 null set client org po setad user id ad user id set subject mail get subject set mail text mail get messagecrlf if mail is sentok set messageid mail get messageid else set messageid mail get sent msg set is delivered isdelivered no ad_user_id musermail ad_user_id email getctx setclientorg setad_user_id ad_user_id setsubject getsubject setmailtext getmessagecrlf issentok setmessageid getmessageid setmessageid getsentmsg setisdelivered isdelivered_no is it delivered return true if yes public boolean is delivered string s get is delivered return s null isdelivered yes equals s isdelivered getisdelivered isdelivered_yes is it not delivered return true if null or no public boolean is delivered no string s get is delivered return s null isdelivered no equals s isdeliveredno getisdelivered isdelivered_no is delivered unknown return true if null public boolean is delivered unknown string s get is delivered return s null isdeliveredunknown getisdelivered constructor param username user name param password user password public e mail authenticator string username string password m pass new password authentication username password if username null username length 0 log log level severe username is null thread dump stack if password null password length 0 log log level severe password is null thread dump stack emailauthenticator m_pass passwordauthentication dumpstack dumpstack ger password authentication return password autnetifucation protected password authentication get password authentication return m pass passwordauthentication passwordauthentication getpasswordauthentication m_pass get string representation return info public string to string if m pass null return e mail authenticator if c log mgt is level finest return e mail authenticator m pass get user name m pass get password return e mail authenticator m pass get user name tostring m_pass emailauthenticator clogmgt islevelfinest emailauthenticator m_pass getusername m_pass getpassword emailauthenticator m_pass getusername create optional b partner search lookup param window no window return v lookup public static v lookup createb partner int window no int ad column id 3499 c invoice c bpartner id try lookup lookup m lookup factory get env get ctx window no 0 ad column id display type search return new v lookup c bpartner id false false true lookup catch exception e log log level severe e return null bpartner windowno vlookup vlookup createbpartner windowno ad_column_id c_invoice c_bpartner_id mlookupfactory getctx windowno ad_column_id displaytype vlookup c_bpartner_id create optional product search lookup param window no window return v lookup public static v lookup create product int window no int ad column id 3840 c invoiceline m product id try lookup lookup m lookup factory get env get ctx window no 0 ad column id display type search return new v lookup m product id false false true lookup catch exception e log log level severe e return null windowno vlookup vlookup createproduct windowno ad_column_id c_invoiceline m_product_id mlookupfactory getctx windowno ad_column_id displaytype vlookup m_product_id create optional user search lookup param window no window return v lookup public static v lookup create user int window no int ad column id 10443 ad wf activity ad user ud try lookup lookup m lookup factory get env get ctx window no 0 ad column id display type search return new v lookup ad user id false false true lookup catch exception e log log level severe e return null windowno vlookup vlookup createuser windowno ad_column_id ad_wf_activity ad_user_ud mlookupfactory getctx windowno ad_column_id displaytype vlookup ad_user_id detail constructor param column name column param mandatory mandatory param is read only read only param is updateable updateable param lookup lookup public v lookup string column name boolean mandatory boolean is read only boolean is updateable lookup lookup super super set name column name m combo set name column name m columnname column name set mandatory mandatory m lookup lookup set layout new border layout vlookup mouseadapter mouse new vlookup mouseadapter this popup text button m text add action listener this m text add focus listener this m text add mouse listener mouse button m button add action listener this m button add mouse listener mouse m button set focusable false don t focus when tabbing m button set margin new insets 0 0 0 0 if column name equals c bpartner id m button set icon env get image icon b partner10 gif else if column name equals m product id m button set icon env get image icon product10 gif else m button set icon env get image icon pick open10 gif v combo box if m lookup null m lookup get display type display type search no search memory leak after executing the next two lines m lookup fill combo box is mandatory false false false m combo set model m lookup m combo add action listener this selection m combo add mouse listener mouse popup focus listener to refresh selection before opening m combo add focus listener this setui true read write decides what components to show if is read only is updateable m lookup null set read write false else set read write true popup if m lookup null if m lookup get display type display type list env get context as int env get ctx ad role id 0 m lookup get display type display type list only system admins can change lists so no need to zoom for others m zoom new c menu item msg get msg env get ctx zoom env get image icon zoom16 gif m zoom add action listener this popup menu add m zoom m refresh new c menu item msg get msg env get ctx refresh env get image icon refresh16 gif m refresh add action listener this popup menu add m refresh vb partner quick entry link if column name equals c bpartner id mb partner new new c menu item msg get msg env get ctx new env get image icon infob partner16 gif mb partner new add action listener this popup menu add mb partner new mb partner upd new c menu item msg get msg env get ctx update env get image icon infob partner16 gif mb partner upd add action listener this popup menu add mb partner upd if m lookup null m lookup get zoom 0 m zoom set enabled false columnname isreadonly isupdateable vlookup columnname isreadonly isupdateable setname columnname m_combo setname columnname m_columnname columnname setmandatory m_lookup setlayout borderlayout vlookup_mouseadapter vlookup_mouseadapter m_text addactionlistener m_text addfocuslistener m_text addmouselistener m_button addactionlistener m_button addmouselistener m_button setfocusable m_button setmargin columnname c_bpartner_id m_button seticon getimageicon bpartner10 columnname m_product_id m_button seticon getimageicon m_button seticon getimageicon pickopen10 vcombobox m_lookup m_lookup getdisplaytype displaytype m_lookup fillcombobox ismandatory m_combo setmodel m_lookup m_combo addactionlistener m_combo addmouselistener focuslistener m_combo addfocuslistener readwrite isreadonly isupdateable m_lookup setreadwrite setreadwrite m_lookup m_lookup getdisplaytype displaytype getcontextasint getctx ad_role_id m_lookup getdisplaytype displaytype mzoom cmenuitem getmsg getctx getimageicon mzoom addactionlistener popupmenu mzoom mrefresh cmenuitem getmsg getctx getimageicon mrefresh addactionlistener popupmenu mrefresh vbpartner columnname c_bpartner_id mbpartnernew cmenuitem getmsg getctx getimageicon infobpartner16 mbpartnernew addactionlistener popupmenu mbpartnernew mbpartnerupd cmenuitem getmsg getctx getimageicon infobpartner16 mbpartnerupd addactionlistener popupmenu mbpartnerupd m_lookup m_lookup getzoom mzoom setenabled dispose public void dispose m text null m button null m lookup null m mfield null m combo remove focus listener this m combo remove action listener this m combo set model new default combo box model remove reference m combo remove all items m combo null m_text m_button m_lookup m_mfield m_combo removefocuslistener m_combo removeactionlistener m_combo setmodel defaultcomboboxmodel m_combo removeallitems m_combo set content and size of compoments param initial if true size and margins will be set private void setui boolean initial if initial dimension size m text get preferred size set preferred size new dimension size causes r o to be the same length m combo set preferred size new dimension size set minimum size new dimension 30 size height field hight size height m text set border null dimension b size new dimension size height size height m button set preferred size b size what to show this remove m combo this remove m button this remove m text if is read write r o show text only look and feel install border this text field border this add m text border layout center m text set read write false m combo set read write false m comboactive false else if m lookup null m lookup get display type display type search show combo if not search this set border null this add m combo border layout center m comboactive true else search or unstable show text button look and feel install border this text field border this add m text border layout center this add m button border layout east m text set read write true m comboactive false m_text getpreferredsize setpreferredsize m_combo setpreferredsize setminimumsize field_hight m_text setborder bsize m_button setpreferredsize bsize m_combo m_button m_text isreadwrite lookandfeel installborder textfield m_text borderlayout m_text setreadwrite m_combo setreadwrite m_comboactive m_lookup m_lookup getdisplaytype displaytype setborder m_combo borderlayout m_comboactive lookandfeel installborder textfield m_text borderlayout m_button borderlayout m_text setreadwrite m_comboactive set read write param value read write public void set read write boolean value boolean rw value if m lookup null rw false if m combo is read write value m combo set read write rw setui false if m comboactive set value m value readwrite readwrite setreadwrite m_lookup m_combo isreadwrite m_combo setreadwrite m_comboactive setvalue m_value is editable return is lookup read write public boolean is read write return m combo is read write iseditable readwrite isreadwrite m_combo isreadwrite set mandatory and back bolor param mandatory mandatory public void set mandatory boolean mandatory m combo set mandatory mandatory m text set mandatory mandatory setmandatory m_combo setmandatory m_text setmandatory is it mandatory return true if mandatory public boolean is mandatory return m combo is mandatory ismandatory m_combo ismandatory set background param color color public void set background color color m text set background color m combo set background color setbackground m_text setbackground m_combo setbackground set background param error error public void set background boolean error m text set background error m combo set background error setbackground m_text setbackground m_combo setbackground set foreground param fg foreground color public void set foreground color fg m text set foreground fg m combo set foreground fg setforeground m_text setforeground m_combo setforeground request focus public void request focus if m lookup null m lookup get display type display type search m combo request focus else m text request focus requestfocus m_lookup m_lookup getdisplaytype displaytype m_combo requestfocus m_text requestfocus set editor to value param value new value public void set value object value log fine m columnname value m settingvalue true disable actions m value value set both for switching m combo set value value if value null m text set text null m lastdisplay m settingvalue false return if m lookup null m text set text value to string m lastdisplay value to string m settingvalue false return set display m lastdisplay m lookup get display value if m lastdisplay equals 1 m lastdisplay m value null boolean not found m lastdisplay starts with m lastdisplay starts with m text set text m lastdisplay m text set caret position 0 show beginning nothing showing in combo and should be showing if m combo get selected item null m comboactive m inserting m lookup get display type display type search lookup found nothing too if not found log finest m columnname value not found m lastdisplay we may have a new value m lookup refresh m combo set value value m lastdisplay m lookup get display value m text set text m lastdisplay m text set caret position 0 show beginning not found m lastdisplay starts with m lastdisplay ends with if not found key m value null action combo null data binding log fine m columnname value not found we have lookup else if m combo get selected item null name pair pp m lookup get value if pp null log fine m columnname added to combo pp add to combo m combo add item pp m combo set value value not in lookup set to null if m combo get selected item null log info m columnname value not in lookup set to null action combo null data binding calls set value again m value null m settingvalue false setvalue m_columnname m_settingvalue m_value m_combo setvalue m_text settext m_lastdisplay m_settingvalue m_lookup m_text settext tostring m_lastdisplay tostring m_settingvalue m_lastdisplay m_lookup getdisplay m_lastdisplay m_lastdisplay m_value notfound m_lastdisplay startswith m_lastdisplay startswith m_text settext m_lastdisplay m_text setcaretposition m_combo getselecteditem m_comboactive m_inserting m_lookup getdisplaytype displaytype notfound m_columnname m_lastdisplay m_lookup m_combo setvalue m_lastdisplay m_lookup getdisplay m_text settext m_lastdisplay m_text setcaretposition notfound m_lastdisplay startswith m_lastdisplay endswith notfound m_value actioncombo m_columnname m_combo getselecteditem namepair m_lookup m_columnname m_combo additem m_combo setvalue m_combo getselecteditem m_columnname actioncombo setvalue m_value m_settingvalue property change listener param evt property change event public void property change property change event evt log fine v lookup property change evt if evt get property name equals m field property m inserting m field inserting equals evt get old value m field set value set value evt get new value m inserting false propertychangeevent propertychange propertychangeevent vlookup propertychange getpropertyname mfield m_inserting mfield getoldvalue mfield setvalue setvalue getnewvalue m_inserting return editor value integer return value public object get value if m comboactive return m combo get value return m value getvalue m_comboactive m_combo getvalue m_value return editor display return display value public string get display string ret value null if m comboactive ret value m combo get display check lookup else if m lookup null ret value m value null null m value to string else ret value m lookup get display m value log fine v lookup get display ret value combo active m comboactive return ret value getdisplay retvalue m_comboactive retvalue m_combo getdisplay m_lookup retvalue m_value m_value tostring retvalue m_lookup getdisplay m_value vlookup getdisplay retvalue comboactive m_comboactive retvalue set field window no for value preference param m field model field for lookup public void set field m field m field m mfield m field if m mfield null m role get default is show preference value preference add menu this popup menu windowno valuepreference mfield setfield mfield mfield m_mfield mfield m_mfield mrole getdefault isshowpreference valuepreference addmenu popupmenu action listener data binding param e action event public void action performed action event e if m settingvalue m settingfocus return log config m columnname e get action command combo value m combo get selected item log fine v lookup hash this hash code preference if e get action command equals value preference name if m role get default is show preference value preference start m mfield get value get display return combo selection else if e get source m combo object value get value object o m combo get selected item if o null string s o to string don t allow selection of inactive if s starts with m lookup inactive s s ends with m lookup inactive e log info m columnname selection inactive set to null value null action combo value data binding button pressed else if e get source m button action button text entered else if e get source m text action text popup menu else if e get source m zoom action zoom m combo get selected item else if e get source m refresh action refresh else if e get source mb partner new actionb partner true else if e get source mb partner upd actionb partner false actionevent actionperformed actionevent m_settingvalue m_settingfocus m_columnname getactioncommand combovalue m_combo getselecteditem vlookuphash hashcode getactioncommand valuepreference mrole getdefault isshowpreference valuepreference m_mfield getvalue getdisplay getsource m_combo getvalue m_combo getselecteditem tostring startswith mlookup inactive_s endswith mlookup inactive_e m_columnname actioncombo getsource m_button actionbutton getsource m_text actiontext getsource mzoom actionzoom m_combo getselecteditem getsource mrefresh actionrefresh getsource mbpartnernew actionbpartner getsource mbpartnerupd actionbpartner action listener interface param listener listener public void add action listener action listener listener m combo add action listener listener m text add action listener listener addactionlistener actionlistener m_combo addactionlistener m_text addactionlistener action combo br data binding inform of new value pre v lookup action combo grid controller vetoable change m table set value at m field set value v lookup set value m tab data status changed pre param value new value private void action combo object value log fine value value try grid controller vetoable change fire vetoable change m columnname null value catch property veto exception pve log log level severe m columnname pve is the value updated boolean updated false if value null m value null updated true else if value null value equals m value updated true if updated happens if v lookup is used outside of a panel grid controller no property listener log fine m columnname value explicitly set new value old m value set value value databinding vlookup actioncombo gridcontroller vetoablechange mtable setvalueat mfield setvalue vlookup setvalue mtab datastatuschanged actioncombo gridcontroller vetoablechange firevetoablechange m_columnname propertyvetoexception m_columnname m_value m_value vlookup apanel gridcontroller m_columnname m_value setvalue action button call info param query value initial query value private void action button string query value m button set enabled false disable double click if m lookup null return leave button disabled m text request focus closes other editors frame frame env get frame this three return options value selected ok pressed store result result has value cancel pressed store null result null cancelled window closed ignore result null cancalled object result null boolean cancelled false string col m lookup get column name fully qualified name if col index of 1 col col substring col index of 1 zoom validation string where clause get where clause log fine col zoom m lookup get zoom where clause boolean reset value false reset value so that is always treated as new entry if col equals m product id reset env set context env get ctx env window info env tab info m product id 0 env set context env get ctx env window info env tab info m attributesetinstance id 0 replace value with name if no value exists if query value length 0 m text get text length 0 query value m text get text name indicator otherwise value int m warehouse id env get context as int env get ctx m lookup get window no m warehouse id int m pricelist id env get context as int env get ctx m lookup get window no m pricelist id show info info product ip new info product frame true m lookup get window no m warehouse id m pricelist id query value false where clause ip set visible true cancelled ip is cancelled result ip get selected key reset value true else if col equals c bpartner id replace value with name if no value exists if query value length 0 m text get text length 0 query value m text get text boolean isso trx true default if env get context env get ctx m lookup get window no isso trx equals n isso trx false infob partner ip new infob partner frame true m lookup get window no query value isso trx false where clause ip set visible true cancelled ip is cancelled result ip get selected key else general info if m tablename null sets table name key column get direct accesssql info ig info create frame true m lookup get window no m tablename m keycolumnname query value false where clause ig set visible true cancelled ig is cancelled result ig get selected key result if result null log config m columnname result result to string result get class get name make sure that value is in cache m lookup get direct result false true if reset value action combo null action combo result data binding else if cancelled log config m columnname result null cancelled action combo null else log config m columnname result null not cancelled set value m value to re display value m button set enabled true m text request focus queryvalue actionbutton queryvalue m_button setenabled m_lookup m_text requestfocus getframe m_lookup getcolumnname indexof indexof whereclause getwhereclause m_lookup getzoom whereclause resetvalue m_product_id setcontext getctx window_info tab_info m_product_id setcontext getctx window_info tab_info m_attributesetinstance_id queryvalue m_text gettext queryvalue m_text gettext m_warehouse_id getcontextasint getctx m_lookup getwindowno m_warehouse_id m_pricelist_id getcontextasint getctx m_lookup getwindowno m_pricelist_id infoproduct infoproduct m_lookup getwindowno m_warehouse_id m_pricelist_id queryvalue whereclause setvisible iscancelled getselectedkey resetvalue c_bpartner_id queryvalue m_text gettext queryvalue m_text gettext issotrx getcontext getctx m_lookup getwindowno issotrx issotrx infobpartner infobpartner m_lookup getwindowno queryvalue issotrx whereclause setvisible iscancelled getselectedkey m_tablename getdirectaccesssql m_lookup getwindowno m_tablename m_keycolumnname queryvalue whereclause setvisible iscancelled getselectedkey m_columnname tostring getclass getname m_lookup getdirect resetvalue actioncombo actioncombo m_columnname actioncombo m_columnname setvalue m_value m_button setenabled m_text requestfocus get where clause return where clause or private string get where clause string where clause if m lookup null return if m lookup get zoom query null where clause m lookup get zoom query get where clause string validation m lookup get validation if validation null validation if where clause length 0 where clause validation else if validation length 0 where clause and validation log finest zoom query m lookup get zoom query null m lookup get zoom query get where clause validation m lookup get validation if where clause index of 1 string validated env parse context env get ctx m lookup get window no where clause false if validated length 0 log severe m columnname cannot parse where clause else log fine m columnname parsed validated return validated return where clause getwhereclause whereclause m_lookup m_lookup getzoomquery whereclause m_lookup getzoomquery getwhereclause m_lookup getvalidation whereclause whereclause whereclause zoomquery m_lookup getzoomquery m_lookup getzoomquery getwhereclause m_lookup getvalidation whereclause indexof parsecontext getctx m_lookup getwindowno whereclause m_columnname whereclause m_columnname whereclause check if data returns unique entry otherwise involve info via button private void action text string text m text get text nothing entered if text null text length 0 text equals action button text return text text to upper case log config m columnname text exact first prepared statement pstmt null string finalsql msg parse translation env get ctx get direct accesssql text int id 3 try pstmt db prepare statement finalsql null result set rs pstmt execute query if rs next id rs get int 1 first if rs next id 1 only if unique rs close pstmt close catch exception e log log level severe finalsql e id 2 try like if id 3 text ends with text finalsql msg parse translation env get ctx get direct accesssql text try pstmt db prepare statement finalsql null result set rs pstmt execute query if rs next id rs get int 1 first if rs next id 1 only if unique rs close pstmt close catch exception e log log level severe finalsql e id 2 try if pstmt null pstmt close catch exception e no unique result if id 0 if id 3 log fine m columnname not found finalsql else log fine m columnname not unique finalsql m value null force re display action button m text get text return log fine m columnname unique id id m value null forces re display if value is unchanged but text updated and still unique action combo new integer id data binding m text request focus actiontext m_text gettext actionbutton touppercase m_columnname preparedstatement parsetranslation getctx getdirectaccesssql preparestatement resultset executequery getint endswith parsetranslation getctx getdirectaccesssql preparestatement resultset executequery getint m_columnname m_columnname m_value actionbutton m_text gettext m_columnname m_value actioncombo m_text requestfocus generate access sql for search the sql returns the id of the value entered also sets m tablename and m keycolumnname param text uppercase text for like comparison return sql or example select c payment id from c payment where upper document no like x or private string get direct accesssql string text string buffer sql new string buffer m tablename m columnname substring 0 m columnname length 3 m keycolumnname m columnname if m columnname equals m product id reset env set context env get ctx env window info env tab info m product id 0 env set context env get ctx env window info env tab info m attributesetinstance id 0 sql append select m product id from m product where upper value like append db to string text append or upper name like append db to string text append or upc like append db to string text append else if m columnname equals c bpartner id sql append select c bpartner id from c bpartner where upper value like append db to string text append or upper name like append db to string text append else if m columnname equals c order id sql append select c order id from c order where upper document no like append db to string text else if m columnname equals c invoice id sql append select c invoice id from c invoice where upper document no like append db to string text else if m columnname equals m inout id sql append select m inout id from m inout where upper document no like append db to string text else if m columnname equals c payment id sql append select c payment id from c payment where upper document no like append db to string text else if m columnname equals gl journalbatch id sql append select gl journalbatch id from gl journalbatch where upper document no like append db to string text else if m columnname equals salesrep id sql append select ad user id from ad user where upper name like append db to string text m tablename ad user m keycolumnname ad user id predefined if sql length 0 string wc get where clause if wc null wc length 0 sql append and append wc sql append and is active y log finest m columnname predefined sql to string return m role get default add accesssql sql to string m tablename m role sql notqualified m role sql ro check if it is a table reference if m lookup null m lookup instanceof m lookup int ad reference id m lookup m lookup getad reference value id if ad reference id 0 string query select kc column name dc column name t table name from ad ref table rt inner join ad column kc on rt ad key kc ad column id inner join ad column dc on rt ad display dc ad column id inner join ad table t on rt ad table id t ad table id where rt ad reference id string display column name null prepared statement pstmt null try pstmt db prepare statement query null pstmt set int 1 ad reference id result set rs pstmt execute query if rs next m keycolumnname rs get string 1 display column name rs get string 2 m tablename rs get string 3 rs close pstmt close pstmt null catch exception e log log level severe query e try if pstmt null pstmt close pstmt null catch exception e pstmt null if display column name null sql new string buffer sql append select append m keycolumnname append from append m tablename append where upper append display column name append like append db to string text append and is active y string wc get where clause if wc null wc length 0 sql append and append wc log finest m columnname table sql to string return m role get default add accesssql sql to string m tablename m role sql notqualified m role sql ro table reference m lookup check well known columns of table assumes table dir string query select t table name c column name from ad column c inner join ad table t on c ad table id t ad table id and t is view n where c column name in document no value name or c is identifier y and c ad reference id in 10 14 and exists select from ad column cc where cc ad table id t ad table id and cc is key y and cc column name m keycolumnname m columnname sql new string buffer prepared statement pstmt null try pstmt db prepare statement query null pstmt set string 1 m keycolumnname result set rs pstmt execute query while rs next if sql length 0 sql append or m tablename rs get string 1 sql append upper append rs get string 2 append like append db to string text rs close pstmt close pstmt null catch sql exception ex log log level severe query ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if sql length 0 log log level severe m columnname table dir no standard identifier columns return string buffer ret value new string buffer select append m columnname append from append m tablename append where append sql append and is active y string wc get where clause if wc null wc length 0 ret value append and append wc log finest m columnname table dir sql to string return m role get default add accesssql ret value to string m tablename m role sql notqualified m role sql ro m_tablename m_keycolumnname c_payment_id c_payment documentno getdirectaccesssql stringbuffer stringbuffer m_tablename m_columnname m_columnname m_keycolumnname m_columnname m_columnname m_product_id setcontext getctx window_info tab_info m_product_id setcontext getctx window_info tab_info m_attributesetinstance_id m_product_id m_product to_string to_string to_string m_columnname c_bpartner_id c_bpartner_id c_bpartner to_string to_string m_columnname c_order_id c_order_id c_order documentno to_string m_columnname c_invoice_id c_invoice_id c_invoice documentno to_string m_columnname m_inout_id m_inout_id m_inout documentno to_string m_columnname c_payment_id c_payment_id c_payment documentno to_string m_columnname gl_journalbatch_id gl_journalbatch_id gl_journalbatch documentno to_string m_columnname salesrep_id ad_user_id ad_user to_string m_tablename ad_user m_keycolumnname ad_user_id getwhereclause isactive m_columnname tostring mrole getdefault addaccesssql tostring m_tablename mrole sql_notqualified mrole sql_ro m_lookup m_lookup mlookup ad_reference_id mlookup m_lookup getad_reference_value_id ad_reference_id columnname columnname tablename ad_ref_table ad_column ad_key ad_column_id ad_column ad_display ad_column_id ad_table ad_table_id ad_table_id ad_reference_id displaycolumnname preparedstatement preparestatement setint ad_reference_id resultset executequery m_keycolumnname getstring displaycolumnname getstring m_tablename getstring displaycolumnname stringbuffer m_keycolumnname m_tablename displaycolumnname to_string isactive getwhereclause m_columnname tostring mrole getdefault addaccesssql tostring m_tablename mrole sql_notqualified mrole sql_ro mlookup tabledir tablename columnname ad_column ad_table ad_table_id ad_table_id isview columnname documentno isidentifier ad_reference_id ad_column ad_table_id ad_table_id iskey columnname m_keycolumnname m_columnname stringbuffer preparedstatement preparestatement setstring m_keycolumnname resultset executequery m_tablename getstring getstring to_string sqlexception sqlexception m_columnname tabledir stringbuffer retvalue stringbuffer m_columnname m_tablename isactive getwhereclause retvalue m_columnname tabledir tostring mrole getdefault addaccesssql retvalue tostring m_tablename mrole sql_notqualified mrole sql_ro action special b partner screen param new record true if new record should be created private void actionb partner boolean new record vb partner vbp new vb partner env get frame this m lookup get window no int bpartner id 0 if update get current value if new record if m value instanceof integer bpartner id integer m value int value else if m value null bpartner id integer parse int m value to string vbp loadb partner bpartner id vbp set visible true get result int result vbp getc bpartner id if result 0 0 not saved result bpartner id the same return maybe new b partner put in cache m lookup get direct new integer result false true action combo new integer result data binding bpartner newrecord actionbpartner newrecord vbpartner vbpartner getframe m_lookup getwindowno bpartner_id newrecord m_value bpartner_id m_value intvalue m_value bpartner_id parseint m_value tostring loadbpartner bpartner_id setvisible getc_bpartner_id bpartner_id bpartner m_lookup getdirect actioncombo action zoom param selected item item private void action zoom object selected item if m lookup null return m query zoom query m lookup get zoom query object value get value if value null value selected item if not already exist or exact value if zoom query null value null zoom query new m query column name might be changed in m tab validate query zoom query add restriction m columnname m query equal value zoom query set record count 1 guess int ad window id m lookup get zoom zoom query log info m columnname ad window id ad window id query zoom query value value set cursor cursor get predefined cursor cursor wait cursor a window frame new a window if frame init window ad window id zoom query set cursor cursor get default cursor value name pair pp c logger retrieve error string msg pp null access table no view pp get value a dialog error m lookup get window no this msg pp null pp get name else a env show center screen frame async window not able to get feedback frame null set cursor cursor get default cursor selecteditem actionzoom selecteditem m_lookup mquery zoomquery m_lookup getzoomquery getvalue selecteditem zoomquery zoomquery mquery columnname mtab validatequery zoomquery addrestriction m_columnname mquery zoomquery setrecordcount ad_window_id m_lookup getzoom zoomquery m_columnname ad_window_id ad_window_id zoomquery setcursor getpredefinedcursor wait_cursor awindow awindow initwindow ad_window_id zoomquery setcursor getdefaultcursor valuenamepair clogger retrieveerror accesstablenoview getvalue adialog m_lookup getwindowno getname aenv showcenterscreen setcursor getdefaultcursor action refresh private void action refresh if m lookup null return set cursor cursor get predefined cursor cursor wait cursor object obj m combo get selected item log info m columnname m lookup get size selected obj m lookup refresh if m lookup is validated m lookup fill combo box is mandatory false false false else m lookup fill combo box is mandatory true false false m combo set selected item obj m combo revalidate set cursor cursor get default cursor log info m columnname m lookup get size selected m combo get selected item actionrefresh m_lookup setcursor getpredefinedcursor wait_cursor m_combo getselecteditem m_columnname m_lookup getsize m_lookup m_lookup isvalidated m_lookup fillcombobox ismandatory m_lookup fillcombobox ismandatory m_combo setselecteditem m_combo setcursor getdefaultcursor m_columnname m_lookup getsize m_combo getselecteditem focus listener for combo boxes with missing validation or invalid entries requery listener for updated list param e focus event public void focus gained focus event e if e get source m combo e is temporary m havefocus m lookup null return if m lookup is validated m lookup has inactive return m havefocus true prevents calling focus gained twice m settingfocus true prevents action performed object obj m lookup get selected item log config m columnname start count m combo get item count selected obj log fine v lookup hash this hash code m lookup fill combo box is mandatory true true true only validated active temporary log config m columnname update count m combo get item count selected m lookup get selected item m lookup set selected item obj log config m columnname selected count m combo get item count selected m lookup get selected item m settingfocus false comboboxes focusevent focusgained focusevent getsource m_combo istemporary m_havefocus m_lookup m_lookup isvalidated m_lookup hasinactive m_havefocus m_settingfocus actionperformed m_lookup getselecteditem m_columnname m_combo getitemcount vlookuphash hashcode m_lookup fillcombobox ismandatory m_columnname m_combo getitemcount m_lookup getselecteditem m_lookup setselecteditem m_columnname m_combo getitemcount m_lookup getselecteditem m_settingfocus reset selection list param e focus event public void focus lost focus event e if e is temporary m lookup null m button is enabled set by action button return text lost focus if e get source m text string text m text get text log config m columnname text m columnname m value text m havefocus false skip if empty if m value null m text get text length 0 return if m lastdisplay equals text return action text re display return combo lost focus if e get source m combo return if m lookup is validated m lookup has inactive return m settingfocus true prevents action performed log config m columnname m combo get selected item object obj m combo get selected item set original model if m lookup is validated m lookup fill combo box true previous selection set value if obj null m combo set selected item obj original model may not have item if m combo get selected item equals obj log fine m columnname added to combo obj m combo add item obj m combo set selected item obj action combo get value m settingfocus false m havefocus false can gain focus again focusevent focuslost focusevent istemporary m_lookup m_button isenabled actionbutton getsource m_text m_text gettext m_columnname m_columnname m_value m_havefocus m_value m_text gettext m_lastdisplay actiontext getsource m_combo m_lookup isvalidated m_lookup hasinactive m_settingfocus actionperformed m_columnname m_combo getselecteditem m_combo getselecteditem m_lookup isvalidated m_lookup fillcombobox m_combo setselecteditem m_combo getselecteditem m_columnname m_combo additem m_combo setselecteditem actioncombo getvalue m_settingfocus m_havefocus set tool tip param text tool tip text public void set tool tip text string text super set tool tip text text m button set tool tip text text m text set tool tip text text m combo set tool tip text text tooltip settooltiptext settooltiptext m_button settooltiptext m_text settooltiptext m_combo settooltiptext refresh query return count public int refresh if m lookup null return 1 return m lookup refresh m_lookup m_lookup constructor param adaptee adaptee vlookup mouseadapter v lookup adaptee this adaptee adaptee vlookup_mouseadapter vlookup mouse listener param e mouse event public void mouse clicked mouse event e system out println mouse clicked e getid e get source get class to string popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseevent mouseclicked mouseevent mouseclicked getsource getclass tostring swingutilities isrightmousebutton popupmenu getsource get event audit for node param ctx context param ad wf process id process param ad wf node id optional node return event audit or null public static mwf event audit get properties ctx int ad wf process id int ad wf node id array list mwf event audit list new array list mwf event audit string sql select from ad wf eventaudit where ad wf process id if ad wf node id 0 sql and ad wf node id sql order by ad wf eventaudit id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad wf process id if ad wf node id 0 pstmt set int 2 ad wf node id result set rs pstmt execute query while rs next list add new mwf event audit ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null mwf event audit ret value new mwf event audit list size list to array ret value return ret value ad_wf_process_id ad_wf_node_id mwfeventaudit ad_wf_process_id ad_wf_node_id arraylist mwfeventaudit arraylist mwfeventaudit ad_wf_eventaudit ad_wf_process_id ad_wf_node_id ad_wf_node_id ad_wf_eventaudit_id preparedstatement preparestatement setint ad_wf_process_id ad_wf_node_id setint ad_wf_node_id resultset executequery mwfeventaudit s_log mwfeventaudit retvalue mwfeventaudit toarray retvalue retvalue get event audit for node param ctx context param ad wf process id process return event audit or null public static mwf event audit get properties ctx int ad wf process id return get ctx ad wf process id 0 ad_wf_process_id mwfeventaudit ad_wf_process_id ad_wf_process_id standard constructor param ad wf eventaudit id id public mwf event audit properties ctx int ad wf eventaudit id string trx name super ctx ad wf eventaudit id trx name ad_wf_eventaudit_id mwfeventaudit ad_wf_eventaudit_id trxname ad_wf_eventaudit_id trxname load cosntructors param ctx context param rs result set public mwf event audit properties ctx result set rs string trx name super ctx rs trx name mwfeventaudit resultset trxname trxname activity constructor param activity activity public mwf event audit mwf activity activity super activity get ctx 0 activity get trxname setad wf process id activity getad wf process id setad wf node id activity getad wf node id setad table id activity getad table id setrecord id activity getrecord id setad wf responsible id activity getad wf responsible id setad user id activity getad user id setwf state activity getwf state set event type eventtype processcreated set elapsed timems env zero mwf node node activity get node if node null node get id 0 string action node get action if mwf node action setvariable equals action mwf node action userchoice equals action set attribute name node get attribute name set old value string value of activity get attribute value if mwf node action setvariable equals action set new value node get attribute value mwfeventaudit mwfactivity getctx get_trxname setad_wf_process_id getad_wf_process_id setad_wf_node_id getad_wf_node_id setad_table_id getad_table_id setrecord_id getrecord_id setad_wf_responsible_id getad_wf_responsible_id setad_user_id getad_user_id setwfstate getwfstate seteventtype eventtype_processcreated setelapsedtimems mwfnode getnode get_id getaction mwfnode action_setvariable mwfnode action_userchoice setattributename getattributename setoldvalue valueof getattributevalue mwfnode action_setvariable setnewvalue getattributevalue get node name return node name public string get node name mwf node node mwf node get get ctx getad wf node id if node get id 0 return return node get name true getnodename mwfnode mwfnode getctx getad_wf_node_id get_id getname get user goals param ctx context param ad user id user return array of goals public static m goal get user goals properties ctx int ad user id if ad user id 0 return get test goals ctx array list m goal list new array list m goal string sql select from pa goal g where is active y and ad client id 1 and ad user id is null and ad role id is null or ad user id 2 or exists select from ad user roles ur where g ad user id ur ad user id and g ad role id ur ad role id and ur is active y order by seq no prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx pstmt set int 2 ad user id result set rs pstmt execute query while rs next m goal goal new m goal ctx rs null goal update goal false list add goal rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m goal ret value new m goal list size list to array ret value return ret value ad_user_id mgoal getusergoals ad_user_id ad_user_id gettestgoals arraylist mgoal arraylist mgoal pa_goal isactive ad_client_id ad_user_id ad_role_id ad_user_id ad_user_roles ad_user_id ad_user_id ad_role_id ad_role_id isactive seqno preparedstatement preparestatement setint getad_client_id setint ad_user_id resultset executequery mgoal mgoal updategoal s_log mgoal retvalue mgoal toarray retvalue retvalue get accessible goals param ctx context return array of goals public static m goal get goals properties ctx array list m goal list new array list m goal string sql select from pa goal where is active y order by seq no sql m role get default ctx false add accesssql sql pa goal false true rw to restrict access prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m goal goal new m goal ctx rs null goal update goal false list add goal rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m goal ret value new m goal list size list to array ret value return ret value mgoal getgoals arraylist mgoal arraylist mgoal pa_goal isactive seqno mrole getdefault addaccesssql pa_goal preparedstatement preparestatement resultset executequery mgoal mgoal updategoal s_log mgoal retvalue mgoal toarray retvalue retvalue create test goals param ctx context return array of goals public static m goal get test goals properties ctx m goal ret value new m goal 4 ret value 0 new m goal ctx test 1 description 1 new big decimal 1000 null ret value 0 set measure actual new big decimal 200 ret value 1 new m goal ctx test 2 description 2 new big decimal 1000 null ret value 1 set measure actual new big decimal 900 ret value 2 new m goal ctx test 3 description 3 new big decimal 1000 null ret value 2 set measure actual new big decimal 1200 ret value 3 new m goal ctx test 4 description 4 new big decimal 1000 null ret value 3 set measure actual new big decimal 3200 return ret value mgoal gettestgoals mgoal retvalue mgoal retvalue mgoal bigdecimal retvalue setmeasureactual bigdecimal retvalue mgoal bigdecimal retvalue setmeasureactual bigdecimal retvalue mgoal bigdecimal retvalue setmeasureactual bigdecimal retvalue mgoal bigdecimal retvalue setmeasureactual bigdecimal retvalue get goals with measure param ctx context param pa measure id measure return goals public static m goal get measure goals properties ctx int pa measure id array list m goal list new array list m goal string sql select from pa goal where is active y and pa measure id order by seq no prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 pa measure id result set rs pstmt execute query while rs next list add new m goal ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m goal ret value new m goal list size list to array ret value return ret value pa_measure_id mgoal getmeasuregoals pa_measure_id arraylist mgoal arraylist mgoal pa_goal isactive pa_measure_id seqno preparedstatement preparestatement setint pa_measure_id resultset executequery mgoal s_log mgoal retvalue mgoal toarray retvalue retvalue get multiplier from scope to display param goal goal return null if error or multiplier public static big decimal get multiplier m goal goal string measure scope goal get measure scope string measure display goal get measure display if measure display null measure scope equals measure display return env one 1 1 if measure scope equals measurescope total measure display equals measuredisplay total return null error big decimal multiplier null if measure scope equals measurescope year if measure display equals measuredisplay quarter multiplier new big decimal 1 0 4 0 else if measure display equals measuredisplay month multiplier new big decimal 1 0 12 0 else if measure display equals measuredisplay week multiplier new big decimal 1 0 52 0 else if measure display equals measuredisplay day multiplier new big decimal 1 0 364 0 else if measure scope equals measurescope quarter if measure display equals measuredisplay year multiplier new big decimal 4 0 else if measure display equals measuredisplay month multiplier new big decimal 1 0 3 0 else if measure display equals measuredisplay week multiplier new big decimal 1 0 13 0 else if measure display equals measuredisplay day multiplier new big decimal 1 0 91 0 else if measure scope equals measurescope month if measure display equals measuredisplay year multiplier new big decimal 12 0 else if measure display equals measuredisplay quarter multiplier new big decimal 3 0 else if measure display equals measuredisplay week multiplier new big decimal 1 0 4 0 else if measure display equals measuredisplay day multiplier new big decimal 1 0 30 0 else if measure scope equals measurescope week if measure display equals measuredisplay year multiplier new big decimal 52 0 else if measure display equals measuredisplay quarter multiplier new big decimal 13 0 else if measure display equals measuredisplay month multiplier new big decimal 4 0 else if measure display equals measuredisplay day multiplier new big decimal 1 0 7 0 else if measure scope equals measurescope day if measure display equals measuredisplay year multiplier new big decimal 364 0 else if measure display equals measuredisplay quarter multiplier new big decimal 91 0 else if measure display equals measuredisplay month multiplier new big decimal 30 0 else if measure display equals measuredisplay week multiplier new big decimal 7 0 return multiplier bigdecimal getmultiplier mgoal measurescope getmeasurescope measuredisplay getmeasuredisplay measuredisplay measurescope measuredisplay measurescope measurescope_total measuredisplay measuredisplay_total bigdecimal measurescope measurescope_year measuredisplay measuredisplay_quarter bigdecimal measuredisplay measuredisplay_month bigdecimal measuredisplay measuredisplay_week bigdecimal measuredisplay measuredisplay_day bigdecimal measurescope measurescope_quarter measuredisplay measuredisplay_year bigdecimal measuredisplay measuredisplay_month bigdecimal measuredisplay measuredisplay_week bigdecimal measuredisplay measuredisplay_day bigdecimal measurescope measurescope_month measuredisplay measuredisplay_year bigdecimal measuredisplay measuredisplay_quarter bigdecimal measuredisplay measuredisplay_week bigdecimal measuredisplay measuredisplay_day bigdecimal measurescope measurescope_week measuredisplay measuredisplay_year bigdecimal measuredisplay measuredisplay_quarter bigdecimal measuredisplay measuredisplay_month bigdecimal measuredisplay measuredisplay_day bigdecimal measurescope measurescope_day measuredisplay measuredisplay_year bigdecimal measuredisplay measuredisplay_quarter bigdecimal measuredisplay measuredisplay_month bigdecimal measuredisplay measuredisplay_week bigdecimal standard constructor param ctx context param pa goal id id param trx name trx public m goal properties ctx int pa goal id string trx name super ctx pa goal id trx name if pa goal id 0 set name null setad user id 0 setpa colorschema id 0 set seq no 0 set is summary false set measure scope measuredisplay year set goal performance env zero set relative weight env one set measure target env zero set measure actual env zero pa_goal_id trxname mgoal pa_goal_id trxname pa_goal_id trxname pa_goal_id setname setad_user_id setpa_colorschema_id setseqno setissummary setmeasurescope measuredisplay_year setgoalperformance setrelativeweight setmeasuretarget setmeasureactual load constructor param ctx context param rs result set param trx name trx public m goal properties ctx result set rs string trx name super ctx rs trx name trxname mgoal resultset trxname trxname base constructor param ctx context param name name param description decsription param measure target target param trx name trx public m goal properties ctx string name string description big decimal measure target string trx name super ctx 0 trx name set name name set description description set measure target measure target measuretarget trxname mgoal bigdecimal measuretarget trxname trxname setname setdescription setmeasuretarget measuretarget get restriction lines param reload reload data return array of lines public m goal restriction get restrictions boolean reload if m restrictions null reload return m restrictions array list m goal restriction list new array list m goal restriction string sql select from pa goalrestriction where pa goal id and is active y order by org id c bpartner id m product id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa goal id result set rs pstmt execute query while rs next list add new m goal restriction get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m restrictions new m goal restriction list size list to array m restrictions return m restrictions mgoalrestriction getrestrictions m_restrictions m_restrictions arraylist mgoalrestriction arraylist mgoalrestriction pa_goalrestriction pa_goal_id isactive org_id c_bpartner_id m_product_id preparedstatement preparestatement get_trxname setint getpa_goal_id resultset executequery mgoalrestriction getctx get_trxname m_restrictions mgoalrestriction toarray m_restrictions m_restrictions get measure return measure or null public m measure get measure if getpa measure id 0 return m measure get get ctx getpa measure id return null mmeasure getmeasure getpa_measure_id mmeasure getctx getpa_measure_id update save goals for the same measure param force force to update goal default once per day return true if updated public boolean update goal boolean force log config force force m measure measure m measure get get ctx getpa measure id if force get date last run null time util is same hour get date last run null if measure update goals saves load get id get trxname return true return false updategoal mmeasure mmeasure getctx getpa_measure_id getdatelastrun timeutil issamehour getdatelastrun updategoals get_id get_trxname set measure actual param measure actual actual public void set measure actual big decimal measure actual if measure actual null return super set measure actual measure actual set date last run new timestamp system current time millis set goal performance measureactual setmeasureactual bigdecimal measureactual measureactual setmeasureactual measureactual setdatelastrun currenttimemillis setgoalperformance calculate performance goal as multiplier public void set goal performance big decimal measure target get measure target big decimal measure actual get measure actual big decimal goal performance env zero if measure target signum 0 goal performance measure actual divide measure target 6 big decimal round half up super set goal performance goal performance m color null setgoalperformance bigdecimal measuretarget getmeasuretarget bigdecimal measureactual getmeasureactual bigdecimal goalperformance measuretarget goalperformance measureactual measuretarget bigdecimal round_half_up setgoalperformance goalperformance m_color get goal performance as double return performance as multipier public double get goal performance double big decimal bd get goal performance return bd double value getgoalperformancedouble bigdecimal getgoalperformance doublevalue get goal performance in percent return performance in percent public int get percent big decimal bd get goal performance multiply env onehundred return bd int value getpercent bigdecimal getgoalperformance intvalue get color return color white if no target public color get color if m color null if get measure target signum 0 m color color white else m color m color schema get color get ctx getpa colorschema id get percent return m color getcolor m_color getmeasuretarget m_color m_color mcolorschema getcolor getctx getpa_colorschema_id getpercent m_color get measure display return measure display public string get measure display string s super get measure display if s null if measurescope week equals get measure scope s measuredisplay week else if measurescope day equals get measure scope s measuredisplay day else s measuredisplay month return s getmeasuredisplay getmeasuredisplay measurescope_week getmeasurescope measuredisplay_week measurescope_day getmeasurescope measuredisplay_day measuredisplay_month get measure display text return measure display text public string getx axis text m measure measure get measure if measure null m measure measuredatatype statusqtyamount equals measure get measure data type if m measure measuretype request equals measure get measure type return msg get element get ctx r status id if m measure measuretype project equals measure get measure type return msg get element get ctx c phase id string value get measure display string display m ref list get list name get ctx measuredisplay ad reference id value return display null value display getxaxistext mmeasure getmeasure mmeasure measuredatatype_statusqtyamount getmeasuredatatype mmeasure measuretype_request getmeasuretype getelement getctx r_status_id mmeasure measuretype_project getmeasuretype getelement getctx c_phase_id getmeasuredisplay mreflist getlistname getctx measuredisplay_ad_reference_id goal has target return true if target public boolean is target return get measure target signum 0 istarget getmeasuretarget string representation return info public string to string string buffer sb new string buffer m goal sb append get id append append get name append append get goal performance append return sb to string tostring stringbuffer stringbuffer mgoal get_id getname getgoalperformance tostring before save param new record new return true protected boolean before save boolean new record if get multiplier this null error set measure display get measure scope measure required if nor summary if is summary getpa measure id 0 log save error fill mandatory msg get element get ctx pa measure id return false if is summary getpa measure id 0 setpa measure id 0 user role check if new record is valuechanged ad user id is valuechanged ad role id getad user id 0 m user user m user get get ctx getad user id m role roles user get roles getad org id if roles length 0 no role setad role id 0 else if roles length 1 one setad role id roles 0 getad role id else int ad role id getad role id if ad role id 0 validate boolean found false for int i 0 i roles length i if ad role id roles i getad role id found true break if found ad role id 0 if ad role id 0 set to first one setad role id roles 0 getad role id multiple roles user check return true newrecord beforesave newrecord getmultiplier setmeasuredisplay getmeasurescope issummary getpa_measure_id saveerror fillmandatory getelement getctx pa_measure_id issummary getpa_measure_id setpa_measure_id newrecord is_valuechanged ad_user_id is_valuechanged ad_role_id getad_user_id muser muser getctx getad_user_id mrole getroles getad_org_id setad_role_id setad_role_id getad_role_id ad_role_id getad_role_id ad_role_id ad_role_id getad_role_id ad_role_id ad_role_id setad_role_id getad_role_id after save param new record new param success success return true protected boolean after save boolean new record boolean success if success return success update goal if target scope changed if new record is valuechanged measure target is valuechanged measure scope update goal true return success newrecord aftersave newrecord newrecord is_valuechanged measuretarget is_valuechanged measurescope updategoal public setupres ru setupres_ru public object get contents return contents getcontents basic constructor use the set methods to set the values of the attributes public body use the set methods to set the values of the attributes param color the bgcolor attribute public body string color set bg color color setbgcolor sets the bgcolor attribute param color the bgcolor attribute public body set bg color string color add attribute bgcolor html color convert color color return this setbgcolor addattribute htmlcolor convertcolor sets the background attribute param url the background attribute public body set background string url add attribute background url return this setbackground addattribute sets the text attribute param text the text attribute public body set text string text add attribute text text return this settext addattribute sets the link attribute param color the link attribute public body set link string color add attribute link html color convert color color return this setlink addattribute htmlcolor convertcolor sets the vlink attribute param color the vlink attribute public body set vlink string color add attribute vlink html color convert color color return this setvlink addattribute htmlcolor convertcolor sets the alink attribute param color the alink attribute public body set alink string color add attribute alink html color convert color color return this setalink addattribute htmlcolor convertcolor sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public body add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public body add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public body add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public body add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public body remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param script script public void set on load string script add attribute onload script setonload addattribute on blur param script script public void set on blur string script add attribute onblur script setonblur addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param script script public void set on unload string script add attribute onunload script setonunload addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param ctx context param ad tab id id public m tab properties ctx int ad tab id string trx name super ctx ad tab id trx name if ad tab id 0 setad window id 0 setad table id 0 set name null set entity type entitytype usermaintained u set has tree false set is read only false set is single row false set is sort tab false n set is translation tab false set seq no 0 set tab level 0 set is insert record true set is advanced tab false ad_tab_id m_tab ad_tab_id trxname ad_tab_id trxname ad_tab_id setad_window_id setad_table_id setname setentitytype entitytype_usermaintained sethastree setisreadonly setissinglerow setissorttab setistranslationtab setseqno settablevel setisinsertrecord setisadvancedtab load constructor param ctx context param rs result set public m tab properties ctx result set rs string trx name super ctx rs trx name m_tab resultset trxname trxname parent constructor param parent parent public m tab m window parent this parent get ctx 0 parent get trxname set client org parent setad window id parent getad window id set entity type parent get entity type m_tab m_window getctx get_trxname setclientorg setad_window_id getad_window_id setentitytype getentitytype parent constructor param parent parent param from copy from public m tab m window parent m tab from this parent get ctx 0 parent get trxname copy values from this set client org parent setad window id parent getad window id set entity type parent get entity type m_tab m_window m_tab getctx get_trxname copyvalues setclientorg setad_window_id getad_window_id setentitytype getentitytype get fields param reload reload data return array of lines public m field get fields boolean reload string trx name if m fields null reload return m fields string sql select from ad field where ad tab id order by seq no array list m field list new array list m field prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 getad tab id result set rs pstmt execute query while rs next list add new m field get ctx rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m fields new m field list size list to array m fields return m fields m_field getfields trxname m_fields m_fields ad_field ad_tab_id seqno arraylist m_field arraylist m_field preparedstatement preparestatement trxname setint getad_tab_id resultset executequery m_field getctx trxname m_fields m_field toarray m_fields m_fields before save param new record new return true protected boolean before save boolean new record update ad tab set is insert record n where is insert record y and is read only y if is read only is insert record set is insert record false return true newrecord beforesave newrecord ad_tab isinsertrecord isinsertrecord isreadonly isreadonly isinsertrecord setisinsertrecord get po match with order invoice param ctx context param c orderline id order param c invoiceline id invoice return array of matches public static m matchpo get properties ctx int c orderline id int c invoiceline id string trx name if c orderline id 0 c invoiceline id 0 return new m matchpo string sql select from m matchpo where c orderline id and c invoiceline id array list m matchpo list new array list m matchpo prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c orderline id pstmt set int 2 c invoiceline id result set rs pstmt execute query while rs next list add new m matchpo ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m matchpo ret value new m matchpo list size list to array ret value return ret value c_orderline_id c_invoiceline_id mmatchpo c_orderline_id c_invoiceline_id trxname c_orderline_id c_invoiceline_id mmatchpo m_matchpo c_orderline_id c_invoiceline_id arraylist mmatchpo arraylist mmatchpo preparedstatement preparestatement trxname setint c_orderline_id setint c_invoiceline_id resultset executequery mmatchpo trxname s_log mmatchpo retvalue mmatchpo toarray retvalue retvalue get po matches of receipt param ctx context param m inout id receipt return array of matches public static m matchpo get in out properties ctx int m inout id string trx name if m inout id 0 return new m matchpo string sql select from m matchpo m inner join m inoutline l on m m inoutline id l m inoutline id where l m inout id array list m matchpo list new array list m matchpo prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inout id result set rs pstmt execute query while rs next list add new m matchpo ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m matchpo ret value new m matchpo list size list to array ret value return ret value m_inout_id mmatchpo getinout m_inout_id trxname m_inout_id mmatchpo m_matchpo m_inoutline m_inoutline_id m_inoutline_id m_inout_id arraylist mmatchpo arraylist mmatchpo preparedstatement preparestatement trxname setint m_inout_id resultset executequery mmatchpo trxname s_log mmatchpo retvalue mmatchpo toarray retvalue retvalue get po matches of invoice param ctx context param c invoice id invoice return array of matches public static m matchpo get invoice properties ctx int c invoice id string trx name if c invoice id 0 return new m matchpo string sql select from m matchpo mi inner join c invoiceline il on mi c invoiceline id il c invoiceline id where il c invoice id array list m matchpo list new array list m matchpo prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c invoice id result set rs pstmt execute query while rs next list add new m matchpo ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m matchpo ret value new m matchpo list size list to array ret value return ret value c_invoice_id mmatchpo getinvoice c_invoice_id trxname c_invoice_id mmatchpo m_matchpo c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice_id arraylist mmatchpo arraylist mmatchpo preparedstatement preparestatement trxname setint c_invoice_id resultset executequery mmatchpo trxname s_log mmatchpo retvalue mmatchpo toarray retvalue retvalue find create po inv match param i line invoice line param s line receipt line param date trx date param qty qty return match record public static m matchpo create m invoice line i line m in out line s line timestamp date trx big decimal qty string trx name null properties ctx null int c orderline id 0 if i line null trx name i line get trxname ctx i line get ctx c orderline id i line getc orderline id if s line null trx name s line get trxname ctx s line get ctx c orderline id s line getc orderline id m matchpo ret value null string sql select from m matchpo where c orderline id array list list new array list prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c orderline id result set rs pstmt execute query while rs next m matchpo mpo new m matchpo ctx rs trx name if qty compare to mpo get qty 0 if i line null if mpo getc invoiceline id 0 mpo getc invoiceline id i line getc invoiceline id mpo setc invoiceline id i line if i line getm attributesetinstance id 0 if mpo getm attributesetinstance id 0 mpo setm attributesetinstance id i line getm attributesetinstance id else if mpo getm attributesetinstance id i line getm attributesetinstance id continue else continue if s line null if mpo getm inoutline id 0 mpo getm inoutline id s line getm inoutline id mpo setm inoutline id s line getm inoutline id if s line getm attributesetinstance id 0 if mpo getm attributesetinstance id 0 mpo setm attributesetinstance id s line getm attributesetinstance id else if mpo getm attributesetinstance id s line getm attributesetinstance id continue else continue ret value mpo break rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null create new if ret value null if s line null ret value new m matchpo s line date trx qty if i line null ret value setc invoiceline id i line else if i line null ret value new m matchpo i line date trx qty return ret value iline sline datetrx mmatchpo minvoiceline iline minoutline sline datetrx bigdecimal trxname c_orderline_id iline trxname iline get_trxname iline getctx c_orderline_id iline getc_orderline_id sline trxname sline get_trxname sline getctx c_orderline_id sline getc_orderline_id mmatchpo retvalue m_matchpo c_orderline_id arraylist arraylist preparedstatement preparestatement trxname setint c_orderline_id resultset executequery mmatchpo mmatchpo trxname compareto getqty iline getc_invoiceline_id getc_invoiceline_id iline getc_invoiceline_id setc_invoiceline_id iline iline getm_attributesetinstance_id getm_attributesetinstance_id setm_attributesetinstance_id iline getm_attributesetinstance_id getm_attributesetinstance_id iline getm_attributesetinstance_id sline getm_inoutline_id getm_inoutline_id sline getm_inoutline_id setm_inoutline_id sline getm_inoutline_id sline getm_attributesetinstance_id getm_attributesetinstance_id setm_attributesetinstance_id sline getm_attributesetinstance_id getm_attributesetinstance_id sline getm_attributesetinstance_id retvalue s_log retvalue sline retvalue mmatchpo sline datetrx iline retvalue setc_invoiceline_id iline iline retvalue mmatchpo iline datetrx retvalue standard constructor param ctx context param m matchpo id id public m matchpo properties ctx int m matchpo id string trx name super ctx m matchpo id trx name if m matchpo id 0 setc orderline id 0 set date trx new timestamp system current time millis setm inoutline id 0 setm product id 0 setm attributesetinstance id 0 set qty env zero set posted false set processed false set processing false m_matchpo_id mmatchpo m_matchpo_id trxname m_matchpo_id trxname m_matchpo_id setc_orderline_id setdatetrx currenttimemillis setm_inoutline_id setm_product_id setm_attributesetinstance_id setqty setposted setprocessed setprocessing load construor param ctx context param rs result set public m matchpo properties ctx result set rs string trx name super ctx rs trx name mmatchpo resultset trxname trxname shipment line constructor param s line shipment line param date trx optional date param qty matched quantity public m matchpo m in out line s line timestamp date trx big decimal qty this s line get ctx 0 s line get trxname set client org s line setm inoutline id s line getm inoutline id setc orderline id s line getc orderline id if date trx null set date trx date trx setm product id s line getm product id setm attributesetinstance id s line getm attributesetinstance id set qty qty set processed true auto sline datetrx mmatchpo minoutline sline datetrx bigdecimal sline getctx sline get_trxname setclientorg sline setm_inoutline_id sline getm_inoutline_id setc_orderline_id sline getc_orderline_id datetrx setdatetrx datetrx setm_product_id sline getm_product_id setm_attributesetinstance_id sline getm_attributesetinstance_id setqty setprocessed invoice line constructor param i line invoice line param date trx optional date param qty matched quantity public m matchpo m invoice line i line timestamp date trx big decimal qty this i line get ctx 0 i line get trxname set client org i line setc invoiceline id i line if i line getc orderline id 0 setc orderline id i line getc orderline id if date trx null set date trx date trx setm product id i line getm product id setm attributesetinstance id i line getm attributesetinstance id set qty qty set processed true auto iline datetrx mmatchpo minvoiceline iline datetrx bigdecimal iline getctx iline get_trxname setclientorg iline setc_invoiceline_id iline iline getc_orderline_id setc_orderline_id iline getc_orderline_id datetrx setdatetrx datetrx setm_product_id iline getm_product_id setm_attributesetinstance_id iline getm_attributesetinstance_id setqty setprocessed set c invoiceline id param line line public void setc invoiceline id m invoice line line m iline line if line null setc invoiceline id 0 else setc invoiceline id line getc invoiceline id c_invoiceline_id setc_invoiceline_id minvoiceline m_iline setc_invoiceline_id setc_invoiceline_id getc_invoiceline_id set c invoiceline id param c invoiceline id id public void setc invoiceline id int c invoiceline id int old getc invoiceline id if old c invoiceline id super setc invoiceline id c invoiceline id m isinvoicelinechange true c_invoiceline_id c_invoiceline_id setc_invoiceline_id c_invoiceline_id getc_invoiceline_id c_invoiceline_id setc_invoiceline_id c_invoiceline_id m_isinvoicelinechange get invoice line return invoice line or null public m invoice line get invoice line if m iline null getc invoiceline id 0 m iline new m invoice line get ctx getc invoiceline id get trxname return m iline minvoiceline getinvoiceline m_iline getc_invoiceline_id m_iline minvoiceline getctx getc_invoiceline_id get_trxname m_iline set m inoutline id param m inoutline id id public void setm inoutline id int m inoutline id int old getm inoutline id if old m inoutline id super setm inoutline id m inoutline id m isinoutlinechange true m_inoutline_id m_inoutline_id setm_inoutline_id m_inoutline_id getm_inoutline_id m_inoutline_id setm_inoutline_id m_inoutline_id m_isinoutlinechange set c orderline id param line line public void setc orderline id m order line line m oline line if line null setc orderline id 0 else setc orderline id line getc orderline id c_orderline_id setc_orderline_id morderline m_oline setc_orderline_id setc_orderline_id getc_orderline_id get order line return order line or null public m order line get order line if m oline null getc orderline id 0 getc orderline id m oline getc orderline id m oline new m order line get ctx getc orderline id get trxname return m oline morderline getorderline m_oline getc_orderline_id getc_orderline_id m_oline getc_orderline_id m_oline morderline getctx getc_orderline_id get_trxname m_oline before save param new record new return true protected boolean before save boolean new record set trx date if get date trx null set date trx new timestamp system current time millis set acct date if get date acct null timestamp ts get newer date acct if ts null ts get date trx set date acct ts set asi from receipt if getm attributesetinstance id 0 getm inoutline id 0 m in out line iol new m in out line get ctx getm inoutline id get trxname setm attributesetinstance id iol getm attributesetinstance id find order line if getc orderline id 0 m invoice line il null if getc invoiceline id 0 il get invoice line if il getc orderline id 0 setc orderline id il getc orderline id get from invoice if getc orderline id 0 getm inoutline id 0 m in out line iol new m in out line get ctx getm inoutline id get trxname if iol getc orderline id 0 setc orderline id iol getc orderline id if il null il setc orderline id iol getc orderline id il save get from shipment find order line price match approval if getc orderline id 0 getc invoiceline id 0 new record is valuechanged c orderline id is valuechanged c invoiceline id big decimal po price get order line get price actual big decimal inv price get invoice line get price actual big decimal difference po price subtract inv price if difference signum 0 difference difference multiply get qty set price match difference difference approval mbp group group mbp group get ofb partner get ctx get order line getc bpartner id big decimal mt group get price match tolerance if mt null mt signum 0 big decimal po amt po price multiply get qty big decimal max tolerance po amt multiply mt max tolerance max tolerance abs divide env onehundred 2 big decimal round half up difference difference abs boolean ok difference compare to max tolerance 0 log config difference get price match difference max max tolerance ok set is approved ok else set price match difference difference set is approved true return true newrecord beforesave newrecord getdatetrx setdatetrx currenttimemillis getdateacct getnewerdateacct getdatetrx setdateacct getm_attributesetinstance_id getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname setm_attributesetinstance_id getm_attributesetinstance_id orderline getc_orderline_id minvoiceline getc_invoiceline_id getinvoiceline getc_orderline_id setc_orderline_id getc_orderline_id getc_orderline_id getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname getc_orderline_id setc_orderline_id getc_orderline_id setc_orderline_id getc_orderline_id getc_orderline_id getc_invoiceline_id newrecord is_valuechanged c_orderline_id is_valuechanged c_invoiceline_id bigdecimal poprice getorderline getpriceactual bigdecimal invprice getinvoiceline getpriceactual bigdecimal poprice invprice getqty setpricematchdifference mbpgroup mbpgroup getofbpartner getctx getorderline getc_bpartner_id bigdecimal getpricematchtolerance bigdecimal poamt poprice getqty bigdecimal maxtolerance poamt maxtolerance maxtolerance bigdecimal round_half_up compareto maxtolerance getpricematchdifference maxtolerance setisapproved setpricematchdifference setisapproved after save set order qty delivered invoiced param new record new param success success return success protected boolean after save boolean new record boolean success purchase order delivered invoiced reserved in v match and m in out complete it if success getc orderline id 0 m order line order line get order line if m isinoutlinechange if getm inoutline id 0 new delivery order line set qty delivered order line get qty delivered add get qty else if getm inoutline id 0 reset to 0 order line set qty delivered order line get qty delivered subtract get qty order line set date delivered get date trx overwrite last if m isinvoicelinechange if getc invoiceline id 0 first time order line set qty invoiced order line get qty invoiced add get qty else if getc invoiceline id 0 set to 0 order line set qty invoiced order line get qty invoiced subtract get qty order line set date invoiced get date trx overwrite last update order asi if full match if order line getm attributesetinstance id 0 getm inoutline id 0 m in out line iol new m in out line get ctx getm inoutline id get trxname if iol get movement qty compare to order line get qty ordered 0 order line setm attributesetinstance id iol getm attributesetinstance id return order line save return success newrecord aftersave newrecord vmatch minout completeit getc_orderline_id morderline orderline getorderline m_isinoutlinechange getm_inoutline_id orderline setqtydelivered orderline getqtydelivered getqty getm_inoutline_id orderline setqtydelivered orderline getqtydelivered getqty orderline setdatedelivered getdatetrx m_isinvoicelinechange getc_invoiceline_id orderline setqtyinvoiced orderline getqtyinvoiced getqty getc_invoiceline_id orderline setqtyinvoiced orderline getqtyinvoiced getqty orderline setdateinvoiced getdatetrx orderline getm_attributesetinstance_id getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname getmovementqty compareto orderline getqtyordered orderline setm_attributesetinstance_id getm_attributesetinstance_id orderline get the later date acct from invoice or shipment return date or null private timestamp get newer date acct timestamp order date null timestamp invoice date null timestamp ship date null string sql select i date acct from c invoiceline il inner join c invoice i on i c invoice id il c invoice id where c invoiceline id prepared statement pstmt null if getc invoiceline id 0 try pstmt db prepare statement sql null pstmt set int 1 getc invoiceline id result set rs pstmt execute query if rs next invoice date rs get timestamp 1 rs close pstmt close pstmt null catch exception e log log level severe sql e sql select io date acct from m inoutline iol inner join m inout io on io m inout id iol m inout id where iol m inoutline id if getm inoutline id 0 try pstmt db prepare statement sql null pstmt set int 1 getm inoutline id result set rs pstmt execute query if rs next ship date rs get timestamp 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null assuming that order date is always earlier if invoice date null return ship date if ship date null return invoice date if invoice date after ship date return invoice date return ship date getnewerdateacct orderdate invoicedate shipdate dateacct c_invoiceline c_invoice c_invoice_id c_invoice_id c_invoiceline_id preparedstatement getc_invoiceline_id preparestatement setint getc_invoiceline_id resultset executequery invoicedate gettimestamp dateacct m_inoutline m_inout m_inout_id m_inout_id m_inoutline_id getm_inoutline_id preparestatement setint getm_inoutline_id resultset executequery shipdate gettimestamp invoicedate shipdate shipdate invoicedate invoicedate shipdate invoicedate shipdate before delete return true if acct was deleted protected boolean before delete if is posted if m period is open get ctx get date trx m doc type docbasetype matchpo return false set posted false return m fact acct delete table id get id get trxname 0 return true beforedelete isposted mperiod isopen getctx getdatetrx mdoctype docbasetype_matchpo setposted mfactacct table_id get_id get_trxname after delete set order qty delivered invoiced param success success return success protected boolean after delete boolean success order delivered invoiced reserved in v match and m in out complete it if success getc orderline id 0 m order line order line new m order line get ctx getc orderline id get trxname if getm inoutline id 0 order line set qty delivered order line get qty delivered subtract get qty if getc invoiceline id 0 order line set qty invoiced order line get qty invoiced subtract get qty return order line save get trxname return success afterdelete vmatch minout completeit getc_orderline_id morderline orderline morderline getctx getc_orderline_id get_trxname getm_inoutline_id orderline setqtydelivered orderline getqtydelivered getqty getc_invoiceline_id orderline setqtyinvoiced orderline getqtyinvoiced getqty orderline get_trxname string representation return info public string to string string buffer sb new string buffer m matchpo sb append get id append qty append get qty append c orderline id append getc orderline id append m inoutline id append getm inoutline id append c invoiceline id append getc invoiceline id append return sb to string tostring stringbuffer stringbuffer mmatchpo get_id getqty c_orderline_id getc_orderline_id m_inoutline_id getm_inoutline_id c_invoiceline_id getc_invoiceline_id tostring consolidate mpo entries data conversion issue public static void consolidate properties ctx string sql select from m matchpo po where exists select from m matchpo x where po c orderline id x c orderline id and po qty x qty group by c orderline id qty having count 2 and ad client id order by c orderline id m inoutline id prepared statement pstmt null int success 0 int errors 0 try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next m matchpo po1 new m matchpo ctx rs null if rs next m matchpo po2 new m matchpo ctx rs null if po1 getm inoutline id 0 po1 getc invoiceline id 0 po2 getm inoutline id 0 po2 getc invoiceline id 0 string s1 update m matchpo set c invoiceline id po2 getc invoiceline id where m matchpo id po1 getm matchpo id int no1 db execute update s1 null if no1 1 errors s log warning not updated m matchpo id po1 getm matchpo id continue string s2 delete from fact acct where ad table id 473 and record id int no2 db execute update s2 po2 getm matchpo id null string s3 delete from m matchpo where m matchpo id int no3 db execute update s3 po2 getm matchpo id null if no2 0 no3 1 success else s log warning m matchpo id po2 getm matchpo id deleted no2 acct no3 errors rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if errors 0 success 0 else s log info success success error errors m_matchpo m_matchpo c_orderline_id c_orderline_id c_orderline_id ad_client_id c_orderline_id m_inoutline_id preparedstatement preparestatement setint getad_client_id resultset executequery mmatchpo mmatchpo mmatchpo mmatchpo getm_inoutline_id getc_invoiceline_id getm_inoutline_id getc_invoiceline_id m_matchpo c_invoiceline_id getc_invoiceline_id m_matchpo_id getm_matchpo_id executeupdate s_log m_matchpo_id getm_matchpo_id fact_acct ad_table_id record_id executeupdate getm_matchpo_id m_matchpo m_matchpo_id executeupdate getm_matchpo_id s_log m_matchpo_id getm_matchpo_id s_log s_log basic constructor use the set methods public strong basic constructor creats a strong object with its contents set param element set the content of the strong element public strong string element add element element addelement basic constructor creats a strong object with its contents set param element set the content of the strong element public strong element element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public strong add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public strong add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public strong add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public strong add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public strong remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x m rmaline properties ctx int m rmaline id string trx name super ctx m rmaline id trx name if m rmaline id 0 setm inoutline id 0 setm rmaline id 0 setm rma id 0 set processed false set qty env zero x_m_rmaline m_rmaline_id trxname m_rmaline_id trxname m_rmaline_id setm_inoutline_id setm_rmaline_id setm_rma_id setprocessed setqty load constructor public x m rmaline properties ctx result set rs string trx name super ctx rs trx name x_m_rmaline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m rmaline append get id append return sb to string tostring stringbuffer stringbuffer x_m_rmaline get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set rma line return material authorization line public void setm rmaline id int m rmaline id if m rmaline id 1 throw new illegal argument exception m rmaline id is mandatory set valuenocheck m rmaline id new integer m rmaline id setm_rmaline_id m_rmaline_id m_rmaline_id illegalargumentexception m_rmaline_id set_valuenocheck m_rmaline_id m_rmaline_id get rma line return material authorization line public int getm rmaline id integer ii integer get value m rmaline id if ii null return 0 return ii int value getm_rmaline_id get_value m_rmaline_id intvalue set rma return material authorization public void setm rma id int m rma id if m rma id 1 throw new illegal argument exception m rma id is mandatory set valuenocheck m rma id new integer m rma id setm_rma_id m_rma_id m_rma_id illegalargumentexception m_rma_id set_valuenocheck m_rma_id m_rma_id get rma return material authorization public int getm rma id integer ii integer get value m rma id if ii null return 0 return ii int value getm_rma_id get_value m_rma_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm rma id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_rma_id set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value get contents return contents public object get contents return contents getcontents constructor param pg graph model public graph element m print graph pg graphelement mprintgraph layout and calculate size set p width p height return true if calculated protected boolean calculate size return false p_width p_height calculatesize paint print param g2d graphics param page no page number for multi page support 0 header footer param page start top left location of page param ctx context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view pageno pagestart isview ids pageno pagestart isview standard constructor public x c subacct properties ctx int c subacct id string trx name super ctx c subacct id trx name if c subacct id 0 setc elementvalue id 0 setc subacct id 0 set name null set value null x_c_subacct c_subacct_id trxname c_subacct_id trxname c_subacct_id setc_elementvalue_id setc_subacct_id setname setvalue load constructor public x c subacct properties ctx result set rs string trx name super ctx rs trx name x_c_subacct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c subacct append get id append return sb to string tostring stringbuffer stringbuffer x_c_subacct get_id tostring set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 1 throw new illegal argument exception c elementvalue id is mandatory set valuenocheck c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id illegalargumentexception c_elementvalue_id set_valuenocheck c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set sub account sub account for element value public void setc subacct id int c subacct id if c subacct id 1 throw new illegal argument exception c subacct id is mandatory set valuenocheck c subacct id new integer c subacct id setc_subacct_id c_subacct_id c_subacct_id illegalargumentexception c_subacct_id set_valuenocheck c_subacct_id c_subacct_id get sub account sub account for element value public int getc subacct id integer ii integer get value c subacct id if ii null return 0 return ii int value getc_subacct_id get_value c_subacct_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue create workflow panel form panel public wf panel this null formpanel wfpanel create workflow panel param menu menu public wf panel a menu menu m menu menu m readwrite menu null log info rw m readwrite try jb init catch exception e log log level severe wf panel e wfpanel amenu m_menu m_readwrite m_readwrite jbinit wfpanel static init pre center scroll pane center panel south panel info scroll pane button panel pre throws exception private void jb init throws exception this set layout main layout compiere color set background this south panel set layout south layout center this add new j scroll pane center panel border layout center info info scroll pane get viewport add info text pane null info scroll pane set preferred size new dimension 200 140 info text pane set background compiereplaf getfieldbackground inactive info text pane set editable false info text pane set request focus enabled false info text pane set content type text html south this add south panel border layout south south panel add info scroll pane border layout center south panel add button panel border layout south wf start set icon env get image icon wf start24 gif wf start set margin new insets 0 10 0 10 wf start set request focus enabled false wf start add action listener this wf start set tool tip text msg get msg m ctx wf start wf back set icon env get image icon wf back24 gif wf back set margin new insets 0 15 0 15 wf back set request focus enabled false wf back add action listener this wf back set tool tip text msg get msg m ctx wf previous wf next set icon env get image icon wf next24 gif wf next set margin new insets 0 15 0 15 wf next set request focus enabled false wf next add action listener this wf next set tool tip text msg get msg m ctx wf next wf end set icon env get image icon wf end24 gif wf end set margin new insets 0 10 0 10 wf end set request focus enabled false wf end add action listener this wf end set tool tip text msg get msg m ctx wf exit button panel add wf start null button panel add wf back null button panel add wf next null button panel add wf end null centerscrollpane centerpanel infoscrollpane buttonpanel jbinit setlayout mainlayout compierecolor setbackground southpanel setlayout southlayout jscrollpane centerpanel borderlayout infoscrollpane getviewport infotextpane infoscrollpane setpreferredsize infotextpane setbackground getfieldbackground_inactive infotextpane seteditable infotextpane setrequestfocusenabled infotextpane setcontenttype southpanel borderlayout southpanel infoscrollpane borderlayout southpanel buttonpanel borderlayout wfstart seticon getimageicon wfstart24 wfstart setmargin wfstart setrequestfocusenabled wfstart addactionlistener wfstart settooltiptext getmsg m_ctx wfstart wfback seticon getimageicon wfback24 wfback setmargin wfback setrequestfocusenabled wfback addactionlistener wfback settooltiptext getmsg m_ctx wfprevious wfnext seticon getimageicon wfnext24 wfnext setmargin wfnext setrequestfocusenabled wfnext addactionlistener wfnext settooltiptext getmsg m_ctx wfnext wfend seticon getimageicon wfend24 wfend setmargin wfend setrequestfocusenabled wfend addactionlistener wfend settooltiptext getmsg m_ctx wfexit buttonpanel wfstart buttonpanel wfback buttonpanel wfnext buttonpanel wfend initialize panel for form panel param window no window param frame frame see org compiere apps form form panel init int form frame public void init int window no form frame frame m windowno window no m frame frame log fine window no window no try load panel frame get content pane add load panel border layout north this set preferred size new dimension 500 500 frame get content pane add this border layout center catch exception e log log level severe init e formpanel windowno formpanel formframe windowno formframe m_windowno windowno m_frame windowno windowno loadpanel getcontentpane loadpanel borderlayout setpreferredsize getcontentpane borderlayout dispose see org compiere apps form form panel dispose public void dispose if m frame null m frame dispose m frame null formpanel m_frame m_frame m_frame workflow add load panel private void load panel string sql m role get default add accesssql select ad workflow id name from ad workflow order by 2 ad workflow m role sql notqualified m role sql ro all key name pair pp db get key name pairs sql true workflow new c combo box pp load panel add workflow workflow add action listener this load panel add b ignore b ignore add action listener this load panel add b reset layout b reset layout add action listener this load panel add b save layout b save layout add action listener this load panel add b zoom b zoom add action listener this loadpanel mrole getdefault addaccesssql ad_workflow_id ad_workflow ad_workflow mrole sql_notqualified mrole sql_ro keynamepair getkeynamepairs ccombobox loadpanel addactionlistener loadpanel bignore bignore addactionlistener loadpanel bresetlayout bresetlayout addactionlistener loadpanel bsavelayout bsavelayout addactionlistener loadpanel bzoom bzoom addactionlistener load workflow nodes param read write if true you can move nodes private void load boolean read write key name pair pp key name pair workflow get selected item if pp null return load pp get key read write readwrite readwrite keynamepair keynamepair getselecteditem getkey readwrite load workflow nodes param ad workflow id id param read write if true nodes can be moved public void load int ad workflow id boolean read write log fine rw read write ad workflow id ad workflow id if ad workflow id 0 return int ad client id env getad client id env get ctx get workflow m wf new m workflow env get ctx ad workflow id null center panel remove all center panel set read write read write if read write center panel set workflow m wf add nodes for paint mwf node nodes m wf get nodes true ad client id for int i 0 i nodes length i wf node wfn new wf node nodes i wfn add property change listener wf node property selected this boolean rw read write in editor mode owned ad client id nodes i getad client id center panel add wfn rw add lines mwf node next nexts nodes i get transitions ad client id for int j 0 j nexts length j center panel add new wf line nexts j false info text string buffer msg new string buffer html msg append h2 append m wf get name true append h2 string s m wf get description true if s null s length 0 msg append b append s append b s m wf get help true if s null s length 0 msg append br append s msg append html info text pane set text msg to string info text pane set caret position 0 layout center panel validate center panel repaint validate ad_workflow_id readwrite ad_workflow_id readwrite readwrite ad_workflow_id ad_workflow_id ad_workflow_id ad_client_id getad_client_id getctx m_wf mworkflow getctx ad_workflow_id centerpanel removeall centerpanel setreadwrite readwrite readwrite centerpanel setworkflow m_wf mwfnode m_wf getnodes ad_client_id wfnode wfnode addpropertychangelistener wfnode property_selected readwrite ad_client_id getad_client_id centerpanel mwfnodenext gettransitions ad_client_id centerpanel wfline stringbuffer stringbuffer m_wf getname m_wf getdescription m_wf gethelp infotextpane settext tostring infotextpane setcaretposition centerpanel centerpanel property change listener param e event see java beans property change listener property change property change event public void property change property change event e if e get new value boolean true start wf node e get source propertychangelistener propertychange propertychangeevent propertychange propertychangeevent getnewvalue wfnode getsource action listener param e event see java awt event action listener action performed action event public void action performed action event e if m wf null e get source workflow return set cursor cursor get predefined cursor cursor wait cursor int ad client id env getad client id env get ctx editing if e get source b zoom zoom else if e get source b ignore load m wf getad workflow id true else if e get source workflow load true else if e get source b save layout if m wf getad client id ad client id m wf save mwf node nodes m wf get nodes false ad client id for int i 0 i nodes length i if nodes i getad client id ad client id nodes i save else if e get source b reset layout reset layout buttons else if e get source wf start m activenode null start m wf getad wf node id else if e get source wf back start m wf get previous m activenode getad wf node id ad client id else if e get source wf next start m wf get next m activenode getad wf node id ad client id else if e get source wf end start m wf get last m activenode getad wf node id ad client id set cursor cursor get default cursor actionlistener actionperformed actionevent actionperformed actionevent m_wf getsource setcursor getpredefinedcursor wait_cursor ad_client_id getad_client_id getctx getsource bzoom getsource bignore m_wf getad_workflow_id getsource getsource bsavelayout m_wf getad_client_id ad_client_id m_wf mwfnode m_wf getnodes ad_client_id getad_client_id ad_client_id getsource bresetlayout resetlayout getsource wfstart m_activenode m_wf getad_wf_node_id getsource wfback m_wf getprevious m_activenode getad_wf_node_id ad_client_id getsource wfnext m_wf getnext m_activenode getad_wf_node_id ad_client_id getsource wfend m_wf getlast m_activenode getad_wf_node_id ad_client_id setcursor getdefaultcursor start node param node node public void start wf node node log fine node node mwf node model node get model info text string buffer msg new string buffer html msg append h2 append model get name true append h2 string s model get description true if s null s length 0 msg append b append s append b s model get help true if s null s length 0 msg append br append s msg append html info text pane set text msg to string info text pane set caret position 0 load window if m menu null new a menu start item model getad wf node id false model get name true m menu start async load m activenode node int ad client id env getad client id env get ctx boolean first m wf is first m activenode getad wf node id ad client id boolean last m wf is last m activenode getad wf node id ad client id wf start set enabled first wf back set enabled first wf next set enabled last wf end set enabled last wfnode mwfnode getmodel stringbuffer stringbuffer getname getdescription gethelp infotextpane settext tostring infotextpane setcaretposition m_menu amenustartitem getad_wf_node_id getname m_menu m_activenode ad_client_id getad_client_id getctx m_wf isfirst m_activenode getad_wf_node_id ad_client_id m_wf islast m_activenode getad_wf_node_id ad_client_id wfstart setenabled wfback setenabled wfnext setenabled wfend setenabled start node param ad wf node id node id public void start int ad wf node id if ad wf node id 0 return for int i 0 i center panel get component count i component comp center panel get component i if comp instanceof wf node wf node node wf node comp if node getad wf node id ad wf node id start node return wf node for all components ad_wf_node_id ad_wf_node_id ad_wf_node_id centerpanel getcomponentcount centerpanel getcomponent wfnode wfnode wfnode getad_wf_node_id ad_wf_node_id wfnode reset layout public void reset layout point p0 new point 0 0 for int i 0 i center panel get component count i component comp center panel get component i comp set location p0 center panel validate resetlayout centerpanel getcomponentcount centerpanel getcomponent setlocation centerpanel zoom to work flow private void zoom int ad window id 113 m query query null if m wf null query m query get equal query ad workflow id m wf getad workflow id a window frame new a window if frame init window ad window id query return a env show center screen frame frame null workflow ad_window_id mquery m_wf mquery getequalquery ad_workflow_id m_wf getad_workflow_id awindow awindow initwindow ad_window_id aenv showcenterscreen string representation return info public string to string string buffer sb new string buffer wf panel if m wf null sb append m wf getad workflow id sb append return sb to string tostring stringbuffer stringbuffer wfpanel m_wf m_wf getad_workflow_id tostring test param args ignored public static void main string args org compiere compiere startup environment true j frame jf new j frame wf wf panel pp new wf panel null pp load 101 true jf get content pane add pp jf pack jf set visible true startupenvironment jframe jframe wfpanel wfpanel getcontentpane setvisible default constructor don t show example public compiereplaf editor super init false compiereplafeditor constructor param show example if true show example public compiereplaf editor boolean show example super init show example showexample compiereplafeditor showexample showexample modal dialog constructor param owner param show example if true show example public compiereplaf editor dialog owner boolean show example super owner true init show example showexample compiereplafeditor showexample showexample modal frame constructor param owner param show example if true show example public compiereplaf editor frame owner boolean show example super owner true init show example showexample compiereplafeditor showexample showexample init editor param show example if true show example private void init boolean show example try jb init dyn init display example set visible show example blind label set visible show example blind field set visible show example compiereplaf show center screen this catch exception e log log level severe e compiere utils set not buffered this showexample showexample jbinit dyninit setvisible showexample blindlabel setvisible showexample blindfield setvisible showexample showcenterscreen compiereutils setnotbuffered static layout throws exception private void jb init throws exception this set default close operation window constants dispose on close this set title s res get string look and feel editor compiereplaf version main panel set layout main layout main layout set hgap 5 main layout set vgap 5 j text field flat set columns 10 j text field gradient set columns 10 j text field texture set columns 10 j text field lines set columns 10 j check box lines set text j check box j check box texture set text j check box j check box gradient set text j check box j check box flat set text j check box j panel gradient set tool tip text indented level 1 j panel texture set tool tip text indented level 2 j panel lines set tool tip text indented level 1 this get content pane add main panel border layout center compiere color set background this lf label set text s res get string look and feel lf field add action listener this theme label set text s res get string theme theme field add action listener this c button set text s res get string edit compiere theme c button add action listener this r button set text s res get string reset r button add action listener this c default set text s res get string set default c default add action listener this b set color set text s res get string set default color b set color add action listener this blind label set text s res get string color blind blind field add action listener this flat field set text s res get string flat color flat field set selected ini is property bool ini p ui flat flat field add action listener this bok add action listener this b cancel add action listener this b help add action listener this north panel set layout north layout south panel set layout south layout south layout set alignment flow layout right example border new titled border s res get string example example set border example border j label1 set text j label j text field1 set text j text field j check box1 set text j check box j radio button1 set text j radio button j button1 set text j button j toggle button1 set text j toggle button j text area1 set text j text area j text pane1 set text j text pane j editor pane1 set text j editor pane j password field1 set text j password field j panel2 set layout border layout1 j panel1 set layout grid bag layout1 j scroll pane1 set preferred size new dimension 100 200 j scroll pane2 set preferred size new dimension 100 200 j button flat set text confirm j button gardient set text input j button texture set text message j button lines set text error j text field flat set text j text field j label flat set text j label j text field gradient set text j text field j label gradient set text j label j text field texture set text j text field j label texture set text j label j text field lines set text j text field j label lines set text j label main panel add north panel border layout north north panel add lf label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 12 5 5 0 0 north panel add lf field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 12 0 0 north panel add theme label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 north panel add theme field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 12 0 0 north panel add c button new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 north panel add r button new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 north panel add b set color new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 12 0 0 north panel add c default new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 north panel add flat field new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 12 0 0 north panel add blind label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 north panel add blind field new grid bag constraints 1 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 12 0 0 main panel add south panel border layout south south panel add b cancel null south panel add bok null main panel add example border layout center example add j panel1 j panel j panel1 add j text pane1 new grid bag constraints 2 3 1 1 0 0 0 2 grid bag constraints center grid bag constraints both new insets 5 5 5 5 0 0 j panel1 add j editor pane1 new grid bag constraints 1 3 1 1 0 0 0 2 grid bag constraints center grid bag constraints both new insets 5 5 5 5 0 0 j panel1 add j list1 new grid bag constraints 1 2 1 1 0 0 0 2 grid bag constraints center grid bag constraints both new insets 5 5 5 5 0 0 j panel1 add j label1 new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 j panel1 add j text field1 new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 5 5 5 5 0 0 j panel1 add j check box1 new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 1 1 1 1 0 0 j panel1 add j radio button1 new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 j panel1 add j button1 new grid bag constraints 2 0 1 1 0 0 0 1 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 j panel1 add j toggle button1 new grid bag constraints 2 1 1 1 0 0 0 1 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 j panel1 add j text area1 new grid bag constraints 0 3 1 1 0 0 0 2 grid bag constraints center grid bag constraints both new insets 5 5 5 5 0 0 j panel1 add j combo box1 new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 j panel1 add j password field1 new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 5 5 5 5 0 0 example add j panel2 j panel j panel2 add j split pane1 border layout center j split pane1 add j scroll pane1 j split pane left j split pane1 add j scroll pane2 j split pane right j panel flat set name flatp j panel gradient set name gradientp j panel texture set name texturep j panel lines set name linep example add j panel flat j panel flat j panel flat add j button flat null j panel flat add j combo box flat null example add j panel gradient j panel gradient 1 j panel gradient add j button gardient null j panel gradient add j combo box gradient null j panel gradient add j label gradient null j panel gradient add j text field gradient null example add j panel texture j panel texture 2 j panel texture add j button texture null j panel texture add j combo box texture null j panel texture add j label texture null j panel texture add j text field texture null example add j panel lines j panel lines 1 j panel lines add j button lines null j panel lines add j combo box lines null j panel lines add j label lines null j panel lines add j text field lines null j scroll pane2 get viewport add j table1 null j scroll pane1 get viewport add j tree1 null j panel flat add j label flat null j panel flat add j text field flat null j panel lines add j check box lines null j panel texture add j check box texture null j panel gradient add j check box gradient null j panel flat add j check box flat null jbinit setdefaultcloseoperation windowconstants dispose_on_close settitle s_res getstring lookandfeeleditor mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap jtextfieldflat setcolumns jtextfieldgradient setcolumns jtextfieldtexture setcolumns jtextfieldlines setcolumns jcheckboxlines settext jcheckbox jcheckboxtexture settext jcheckbox jcheckboxgradient settext jcheckbox jcheckboxflat settext jcheckbox jpanelgradient settooltiptext jpaneltexture settooltiptext jpanellines settooltiptext getcontentpane mainpanel borderlayout compierecolor setbackground lflabel settext s_res getstring lookandfeel lffield addactionlistener themelabel settext s_res getstring themefield addactionlistener cbutton settext s_res getstring editcompieretheme cbutton addactionlistener rbutton settext s_res getstring rbutton addactionlistener cdefault settext s_res getstring setdefault cdefault addactionlistener bsetcolor settext s_res getstring setdefaultcolor bsetcolor addactionlistener blindlabel settext s_res getstring colorblind blindfield addactionlistener flatfield settext s_res getstring flatcolor flatfield setselected ispropertybool p_ui_flat flatfield addactionlistener addactionlistener bcancel addactionlistener bhelp addactionlistener northpanel setlayout northlayout southpanel setlayout southlayout southlayout setalignment flowlayout exampleborder titledborder s_res getstring setborder exampleborder jlabel1 settext jlabel jtextfield1 settext jtextfield jcheckbox1 settext jcheckbox jradiobutton1 settext jradiobutton jbutton1 settext jbutton jtogglebutton1 settext jtogglebutton jtextarea1 settext jtextarea jtextpane1 settext jtextpane jeditorpane1 settext jeditorpane jpasswordfield1 settext jpasswordfield jpanel2 setlayout borderlayout1 jpanel1 setlayout gridbaglayout1 jscrollpane1 setpreferredsize jscrollpane2 setpreferredsize jbuttonflat settext jbuttongardient settext jbuttontexture settext jbuttonlines settext jtextfieldflat settext jtextfield jlabelflat settext jlabel jtextfieldgradient settext jtextfield jlabelgradient settext jlabel jtextfieldtexture settext jtextfield jlabeltexture settext jlabel jtextfieldlines settext jtextfield jlabellines settext jlabel mainpanel northpanel borderlayout northpanel lflabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel lffield gridbagconstraints gridbagconstraints gridbagconstraints northpanel themelabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel themefield gridbagconstraints gridbagconstraints gridbagconstraints northpanel cbutton gridbagconstraints gridbagconstraints gridbagconstraints northpanel rbutton gridbagconstraints gridbagconstraints gridbagconstraints northpanel bsetcolor gridbagconstraints gridbagconstraints gridbagconstraints northpanel cdefault gridbagconstraints gridbagconstraints gridbagconstraints northpanel flatfield gridbagconstraints gridbagconstraints gridbagconstraints northpanel blindlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel blindfield gridbagconstraints gridbagconstraints gridbagconstraints mainpanel southpanel borderlayout southpanel bcancel southpanel mainpanel borderlayout jpanel1 jpanel jpanel1 jtextpane1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jeditorpane1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jlist1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jlabel1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jtextfield1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jcheckbox1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jradiobutton1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jbutton1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jtogglebutton1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jtextarea1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jcombobox1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel1 jpasswordfield1 gridbagconstraints gridbagconstraints gridbagconstraints jpanel2 jpanel jpanel2 jsplitpane1 borderlayout jsplitpane1 jscrollpane1 jsplitpane jsplitpane1 jscrollpane2 jsplitpane jpanelflat setname jpanelgradient setname jpaneltexture setname jpanellines setname jpanelflat jpanel jpanelflat jbuttonflat jpanelflat jcomboboxflat jpanelgradient jpanel jpanelgradient jbuttongardient jpanelgradient jcomboboxgradient jpanelgradient jlabelgradient jpanelgradient jtextfieldgradient jpaneltexture jpanel jpaneltexture jbuttontexture jpaneltexture jcomboboxtexture jpaneltexture jlabeltexture jpaneltexture jtextfieldtexture jpanellines jpanel jpanellines jbuttonlines jpanellines jcomboboxlines jpanellines jlabellines jpanellines jtextfieldlines jscrollpane2 getviewport jtable1 jscrollpane1 getviewport jtree1 jpanelflat jlabelflat jpanelflat jtextfieldflat jpanellines jcheckboxlines jpaneltexture jcheckboxtexture jpanelgradient jcheckboxgradient jpanelflat jcheckboxflat dynamic init private void dyn init setlf selection j panel gradient set tab level 1 j panel texture set tab level 2 j panel lines set tab level 1 j combo box flat add action listener this j combo box gradient add action listener this j combo box texture add action listener this j combo box lines add action listener this j button1 add action listener this j button flat add action listener this j button gardient add action listener this j button texture add action listener this j button lines add action listener this compiereplaf setplaf this dyninit setlfselection jpanelgradient settablevel jpaneltexture settablevel jpanellines settablevel jcomboboxflat addactionlistener jcomboboxgradient addactionlistener jcomboboxtexture addactionlistener jcomboboxlines addactionlistener jbutton1 addactionlistener jbuttonflat addactionlistener jbuttongardient addactionlistener jbuttontexture addactionlistener jbuttonlines addactionlistener set picks from environment private void setlf selection m setting true search for plaf value name pair plaf null look and feel look feel ui manager get look and feel string look look feel get class get name for int i 0 i compiereplaf getpla fs length i value name pair vp compiereplaf getpla fs i if vp get value equals look plaf vp break if plaf null lf field set selected item plaf search for theme metal theme metal theme null value name pair theme null boolean metal ui manager get look and feel instanceof metal look and feel theme field set model new default combo box model compiereplaf get themes if metal theme null app context context app context get app context metal theme metal theme context get current metal theme if metal theme null string look theme metal theme get name for int i 0 i compiereplaf get themes length i value name pair vp compiereplaf get themes i if vp get name equals look theme theme vp break if theme null theme field set selected item theme m setting false log info look feel metal theme setlfselection m_setting valuenamepair lookandfeel lookfeel uimanager getlookandfeel lookfeel getclass getname getplafs valuenamepair getplafs getvalue lffield setselecteditem metaltheme metaltheme valuenamepair uimanager getlookandfeel metallookandfeel themefield setmodel defaultcomboboxmodel getthemes appcontext appcontext getappcontext metaltheme metaltheme currentmetaltheme metaltheme looktheme metaltheme getname getthemes valuenamepair getthemes getname looktheme themefield setselecteditem m_setting lookfeel metaltheme action listener param e public void action performed action event e set cursor cursor get predefined cursor cursor wait cursor ok save finish if e get source bok compiere theme save ini save properties true dispose cancel finish else if e get source b cancel dispose else if e get source b help new mini browser http www compiere org looks help html look feel changed else if e get source lf field m setting m setting true disable theme setting set new theme compiereplaf setplaf value name pair lf field get selected item null this setlf selection set background to theme compiereplaf setplaf this twice m setting false enable theme setting theme field changed else if e get source theme field m setting ini set property ini p ui theme theme field get selected item to string compiereplaf setplaf value name pair lf field get selected item value name pair theme field get selected item this compiere theme set theme copy theme set background to theme compiereplaf setplaf this twice start compiere theme editor else if e get source c button new compiere theme editor this set background to theme reset pla fs else if e get source r button compiereplaf reset this setlf selection color blind set color type color blind normal compiereplaf setplaf this twice set default background color else if e get source b set color compiere color cc compiere color editor show dialog this compiere panelui get default background compiere panelui set default background cc compiereplaf updateui this ini set property compiere theme p compierecolor cc to string set background as default else if e get source c default compiere panelui set set default c default is selected compiereplaf updateui this flat else if e get source flat field ini set property ini p ui flat flat field is selected set background to theme color blind else if e get source blind field int sel blind field get selected index if sel color blind get color type test for true color if m colortest m colortest true int size toolkit get default toolkit get color model get pixel size if size 24 j option pane show message dialog this your environment has only a pixel size of size n to see the effect you need to have a pixel size of 24 true color insufficient color capabilities j option pane error message color blind set color type sel compiereplaf updateui this compiereplaf setplaf this twice change tab pacement else if e get source j combo box flat e get source j combo box gradient e get source j combo box texture e get source j combo box lines if m setting m setting true int index j combo box e get source get selected index example set tab placement index 1 j combo box flat set selected index index j combo box gradient set selected index index j combo box texture set selected index index j combo box lines set selected index index m setting false display options else if e get source j button flat j option pane show confirm dialog this confirm dialog else if e get source j button gardient j option pane show input dialog this input dialog else if e get source j button texture j option pane show message dialog this message dialog else if e get source j button lines j option pane show message dialog this message dialog error error j option pane error message test else if e get source j button1 metal boolean metal ui manager get look and feel instanceof metal look and feel theme field set enabled metal theme label set enabled metal boolean compiere ui manager get look and feel instanceof compiere look and feel flat field set enabled compiere color blind only with compiere l f theme boolean enable blind compiere theme field get selected item null theme field get selected item to string index of compiere 1 blind field set enabled enable blind blind label set enabled enable blind if e get source blind field enable blind blind field set selected index 0 done set cursor cursor get default cursor actionlistener actionperformed actionevent setcursor getpredefinedcursor wait_cursor getsource compieretheme saveproperties getsource bcancel getsource bhelp minibrowser getsource lffield m_setting m_setting valuenamepair lffield getselecteditem setlfselection setbackgroundtotheme m_setting getsource themefield m_setting setproperty p_ui_theme themefield getselecteditem tostring valuenamepair lffield getselecteditem valuenamepair themefield getselecteditem compieretheme settheme setbackgroundtotheme getsource cbutton compierethemeeditor setbackgroundtotheme plafs getsource rbutton setlfselection colorblind setcolortype colorblind getsource bsetcolor compierecolor compierecoloreditor showdialog compierepanelui getdefaultbackground compierepanelui setdefaultbackground setproperty compieretheme p_compierecolor tostring getsource cdefault compierepanelui setsetdefault cdefault isselected getsource flatfield setproperty p_ui_flat flatfield isselected setbackgroundtotheme colorblind getsource blindfield blindfield getselectedindex colorblind getcolortype m_colortest m_colortest getdefaulttoolkit getcolormodel getpixelsize joptionpane showmessagedialog nto joptionpane error_message colorblind setcolortype getsource jcomboboxflat getsource jcomboboxgradient getsource jcomboboxtexture getsource jcomboboxlines m_setting m_setting jcombobox getsource getselectedindex settabplacement jcomboboxflat setselectedindex jcomboboxgradient setselectedindex jcomboboxtexture setselectedindex jcomboboxlines setselectedindex m_setting getsource jbuttonflat joptionpane showconfirmdialog getsource jbuttongardient joptionpane showinputdialog getsource jbuttontexture joptionpane showmessagedialog getsource jbuttonlines joptionpane showmessagedialog joptionpane error_message getsource jbutton1 uimanager getlookandfeel metallookandfeel themefield setenabled themelabel setenabled uimanager getlookandfeel compierelookandfeel flatfield setenabled colorblind enableblind themefield getselecteditem themefield getselecteditem tostring indexof blindfield setenabled enableblind blindlabel setenabled enableblind getsource blindfield enableblind blindfield setselectedindex setcursor getdefaultcursor set compiere color background to theme background private void set background to theme not flat for compiere l f boolean flat ini is property bool ini p ui flat compiere color cc new compiere color compiere theme secondary3 flat compiere panelui set default background cc ini set property compiere theme p compierecolor cc to string compiereplaf updateui this compierecolor setbackgroundtotheme ispropertybool p_ui_flat compierecolor compierecolor compieretheme compierepanelui setdefaultbackground setproperty compieretheme p_compierecolor tostring dispose exit if there is no real owning parent not modal shortcut public void dispose super dispose if is modal system exit 0 ismodal create line param next model public wf line mwf node next next m next next set opaque false set focusable false m description next get description if m description null m description length 0 m description string value of next get seq no m description wfline mwfnodenext m_next setopaque setfocusable m_description getdescription m_description m_description m_description valueof getseqno m_description get from rectangle return from node rectangle public rectangle get from return m from getfrom m_from get to rectangle return to node rectangle public rectangle get to return m to getto m_to set from to rectangle called from wf layout manager layout container param from from node rectangle param to to node rectangle public void set from to rectangle from rectangle to m from from m to to wflayoutmanager layoutcontainer setfromto m_from m_to get from node id return from node id public int getad wf node id return m next getad wf node id node getad_wf_node_id m_next getad_wf_node_id get to node id return to node id public int getad wf next id return m next getad wf next id next getad_wf_next_id m_next getad_wf_next_id set visited param visited visited public void set visited boolean visited m visited visited setvisited m_visited from right to top left down private boolean is right top return m from x m from width m to x right bottom left top m from y m from height m to y isrighttop m_from m_from m_to m_from m_from m_to from bottom to top top down private boolean is bottom top return m from y m from height m to y isbottomtop m_from m_from m_to from top to bottom bottom up private boolean is top bottom return m to y m to height m from y istopbottom m_to m_to m_from from left to right right o o left private boolean is left right return m to x m to width m from x isleftright m_to m_to m_from paint it coordinates based on wf content panel param g graph public void paint graphics g if m from null m to null return polygon arrow new polygon point from null point to null if is right top from add point arrow m from swing constants right true to add point arrow m to swing constants top false else if is bottom top from add point arrow m from swing constants bottom true to add point arrow m to swing constants top false else if is top bottom from add point arrow m from swing constants top true to add point arrow m to swing constants bottom false else if is left right from add point arrow m from swing constants left true to add point arrow m to swing constants right false else if is right left from add point arrow m from swing constants right true to add point arrow m to swing constants left false paint arrow unconditional no fill black text conditional red fill red text visited green line not visited black line split join and magenta dot xor if m next is unconditional g set color color red g fill polygon arrow fill if m visited g set color color green else g set color color black g draw polygon arrow line paint dot for and from if m next is from split and g set color color magenta g fill oval from x 3 from y 3 6 6 paint dot for and to if m next is to join and g set color color magenta g fill oval to x 3 to y 3 6 6 paint description in red if m description null graphics2d g2d graphics2d g font font new font dialog font plain 9 if m next is unconditional g2d set color color black else g2d set color color red text layout layout new text layout m description font g2d get font render context mid point int x 0 if from x to x x from x to x from x 2 else x to x from x to x 2 int y 0 if from y to y y from y to y from y 2 else y to y from y to y 2 adjust y layout get ascent 3 above center adjust x layout get advance 2 center if x 2 x 2 layout draw g2d x y wfcontentpanel m_from m_to isrighttop addpoint m_from swingconstants addpoint m_to swingconstants isbottomtop addpoint m_from swingconstants addpoint m_to swingconstants istopbottom addpoint m_from swingconstants addpoint m_to swingconstants isleftright addpoint m_from swingconstants addpoint m_to swingconstants isrightleft addpoint m_from swingconstants addpoint m_to swingconstants notvisited m_next isunconditional setcolor fillpolygon m_visited setcolor setcolor drawpolygon m_next isfromsplitand setcolor filloval m_next istojoinand setcolor filloval m_description m_next isunconditional setcolor setcolor textlayout textlayout m_description getfontrendercontext getascent getadvance get point of rectangle param arrow polygon to draw arrow param rect rectangle icon param pos swing constants bottom top right left param from if true from base else to tip of arrow return point docking position two point away private point add point polygon arrow rectangle rect int pos boolean from int x rect x int y rect y point point null if pos swing constants top x rect width 2 if from arrow add point x 2 y arrow add point x 2 y else arrow add point x y point new point x y 2 else if pos swing constants right x rect width y rect height 2 if from arrow add point x y 2 arrow add point x y 2 else arrow add point x y point new point x 2 y else if pos swing constants left y rect height 2 if from arrow add point x y 2 arrow add point x y 2 else arrow add point x y point new point x 2 y else if pos swing constants bottom x rect width 2 y rect height if from arrow add point x 2 y arrow add point x 2 y else arrow add point x y point new point x y 2 return point swingconstants addpoint swingconstants addpoint addpoint addpoint swingconstants addpoint addpoint addpoint swingconstants addpoint addpoint addpoint swingconstants addpoint addpoint addpoint string representation return info public string to string string buffer sb new string buffer wf line sb append getad wf node id append append getad wf next id sb append return sb to string tostring stringbuffer stringbuffer wfline getad_wf_node_id getad_wf_next_id tostring basic constructor use the set methods to set the values of the attributes public optgroup basic constructor use the set methods to set the values of the attributes param label sets the attribute label public optgroup string label set label label setlabel basic constructor use the set methods to set the values of the attributes param label sets the attribute label param disabled sets the attribute disabled public optgroup string label boolean disabled set label label set disabled disabled setlabel setdisabled sets the label attribute param label the label attribute public optgroup set label string label add attribute label label return this setlabel addattribute sets the value attribute param value the value attribute public optgroup set value string value add attribute value value return this setvalue addattribute sets the disabled value param disabled true or false public optgroup set disabled boolean disabled if disabled true add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public optgroup add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public optgroup add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public optgroup add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public optgroup add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public optgroup remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param the script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param the script public void set on blur string script add attribute onblur script setonblur addattribute the onsubmit event occurs when a form is submitted it only applies to the form element param the script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param the script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param the script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param the script public void set on change string script add attribute onchange script setonchange addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute basic constructor use set methods public th basic constructor use set methods public th element element add element element addelement basic constructor use set methods public th string element add element element addelement constructor param class name class name param h align horizontal e g align type left param v align vertical e g align type top param nowrap no wrap public th string class name string h align string v align boolean nowrap this set class class name set align h align setv align v align set no wrap nowrap classname halign aligntype valign aligntype classname halign valign setclass classname setalign halign setvalign valign setnowrap constructor param class name class name param h align horizontal e g align type left param v align vertical e g align type top param value added element if null nbsp is added param nowrap no wrap public th string class name string h align string v align boolean nowrap element value this class name h align v align nowrap if value null add element nbsp else add element value classname halign aligntype valign aligntype classname halign valign classname halign valign addelement addelement sets the abbr attribute param cdata sets the abbr attribute public th set abbr string cdata add attribute abbr cdata return this setabbr addattribute sets the axis attribute param cdata sets the axis attribute public th set axis string cdata add attribute axis cdata return this setaxis addattribute sets the axes attribute param id refs list of id s for header cells public th set axes string id refs add attribute axes id refs return this id_refs setaxes id_refs addattribute id_refs sets the rowspan attribute param span number of rows spaned by cell public th set row span int span add attribute rowspan integer to string span return this setrowspan addattribute tostring sets the rowspan attribute param span number of rows spaned by cell public th set row span string span add attribute rowspan span return this setrowspan addattribute sets the colspan attribute param span number of columns spanned by cell public th set col span int span add attribute colspan integer to string span return this setcolspan addattribute tostring sets the colspan attribute param span number of columns spanned by cell public th set col span string span add attribute colspan span return this setcolspan addattribute sets word wrap on or off param wrap turn word wrap on or off public th set no wrap boolean wrap if wrap true add attribute nowrap nowrap else remove attribute nowrap return this setnowrap addattribute removeattribute supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public th set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public th set width string width add attribute width width return this setwidth addattribute supplies user agents with a recommended cell height pixel values param height how many pixels to make cell public th set height int height add attribute height integer to string height return this setheight addattribute tostring supplies user agents with a recommended cell height pixel values param height how many pixels to make cell public th set height string height add attribute height height return this setheight addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public th set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public th setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public th set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public th set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public th set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the bgcolor attribute param color sets the background color of the cell public th set bg color string color add attribute bgcolor html color convert color color return this setbgcolor addattribute htmlcolor convertcolor sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public th add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public th add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public th add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public th add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public th remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get number of languages return language count public static int get language count return s languages length getlanguagecount s_languages get language param index index return language public static language get language int index if index 0 index s languages length return s loginlanguage return s languages index getlanguage s_languages s_loginlanguage s_languages add language to supported languages param language new language public static void add language language language if language null return array list language list new array list language arrays as list s languages list add language s languages new language list size list to array s languages addlanguage arraylist arraylist aslist s_languages s_languages toarray s_languages get language if language does not exist create it on the fly assuming taht it is valid param lang info either language en or locale en us or display name return name e g deutsch public static language get language string lang info string lang lang info if lang null lang length 0 lang system get property user language search existing languages for int i 0 i s languages length i if lang equals s languages i get name lang equals s languages i get language code lang equals s languages i getad language return s languages i create language on the fly if lang length 5 standard format language country string language lang substring 0 2 string country lang substring 3 locale locale new locale language country log info adding language language country country locale locale language ll new language lang lang locale add to languages array list language list new array list language arrays as list s languages list add ll s languages new language list size list to array s languages return language return ll get the default one return s loginlanguage langinfo getlanguage langinfo langinfo getproperty s_languages s_languages getname s_languages getlanguagecode s_languages getad_language s_languages _ arraylist arraylist aslist s_languages s_languages toarray s_languages s_loginlanguage is it the base language param lang info either language en or locale en us or display name return true if base language public static boolean is base language string lang info if lang info null lang info length 0 lang info equals s languages 0 get name lang info equals s languages 0 get language code lang info equals s languages 0 getad language return true return false langinfo isbaselanguage langinfo langinfo langinfo langinfo s_languages getname langinfo s_languages getlanguagecode langinfo s_languages getad_language get base language return base language public static language get base language return s languages 0 getbaselanguage s_languages get base language code e g en us return base language public static string getbasead language return s languages 0 getad language getbasead_language s_languages getad_language get supported locale param lang info either language en or locale en us or display name return supported locale public static locale get locale string lang info return get language lang info get locale langinfo getlocale langinfo getlanguage langinfo getlocale get supported language param lang info either language en or locale en us or display name return ad language e g en us public static string getad language string lang info return get language lang info getad language langinfo ad_language getad_language langinfo getlanguage langinfo getad_language get supported language param locale locale return ad language e g en us public static string getad language locale locale if locale null for int i 0 i s languages length i if locale equals s languages i get locale return s languages i getad language return s loginlanguage getad language ad_language getad_language s_languages s_languages getlocale s_languages getad_language s_loginlanguage getad_language get language name param lang info either language en or locale en us or display name return langauge name e g english public static string get name string lang info return get language lang info get name langinfo getname langinfo getlanguage langinfo getname returns true if decimal point not comma param lang info either language en or locale en us or display name return use of decimal point public static boolean is decimal point string lang info return get language lang info is decimal point langinfo isdecimalpoint langinfo getlanguage langinfo isdecimalpoint get display names of supported languages return array of language names public static string get names string ret value new string s languages length for int i 0 i s languages length i ret value i s languages i get name return ret value getnames retvalue s_languages s_languages retvalue s_languages getname retvalue get default login language return default language public static language get login language return s loginlanguage getloginlanguage s_loginlanguage set default login language param language language public static void set login language language language if language null s loginlanguage language log config s loginlanguage to string setloginlanguage s_loginlanguage s_loginlanguage tostring define language param name displayed value e g english param ad language the code of system supported langauge e g en us might be different than locale i e if the system does not support the language param locale the locale e g locale us param decimal point true if decimal point if null derived from locale param java date pattern java date pattern as not all locales are defined if null derived from locale param media size default media size public language string name string ad language locale locale boolean decimal point string java date pattern media size media size if name null ad language null locale null throw new illegal argument exception language parameter is null m name name m ad language ad language m locale locale m decimalpoint decimal point set date format java date pattern set media size media size ad_language en_us decimalpoint javadatepattern mediasize ad_language decimalpoint javadatepattern mediasize mediasize ad_language illegalargumentexception m_name m_ad_language ad_language m_locale m_decimalpoint decimalpoint setdateformat javadatepattern setmediasize mediasize define language with a4 and default decimal point and date format param name displayed value e g english param ad language the code of system supported langauge e g en us might be different than locale i e if the system does not support the language param locale the locale e g locale us public language string name string ad language locale locale this name ad language locale null null null ad_language en_us ad_language ad_language get language name e g english return name public string get name return m name getname m_name get application dictionary language system supported e g en us return ad language public string getad language return m ad language ad_language getad_language m_ad_language set application dictionary language system supported param ad language e g en us public void setad language string ad language if ad language null m ad language ad language log config to string ad_language setad_language ad_language ad_language m_ad_language ad_language tostring get locale return locale public locale get locale return m locale getlocale m_locale overwrite locale param locale locale public void set locale locale locale if locale null return m locale locale m decimalpoint null reset setlocale m_locale m_decimalpoint get language code e g en derived from locale return language code public string get language code return m locale get language getlanguagecode m_locale getlanguage component orientation is left to right return true if left to right public boolean is left to right if m lefttoright null returns true if language not iw ar fa ur m lefttoright new boolean component orientation get orientation m locale is left to right return m lefttoright boolean value islefttoright m_lefttoright m_lefttoright componentorientation getorientation m_locale islefttoright m_lefttoright booleanvalue returns true if decimal point not comma return use of decimal point public boolean is decimal point if m decimalpoint null decimal format symbols dfs new decimal format symbols m locale m decimalpoint new boolean dfs get decimal separator return m decimalpoint boolean value isdecimalpoint m_decimalpoint decimalformatsymbols decimalformatsymbols m_locale m_decimalpoint getdecimalseparator m_decimalpoint booleanvalue is this the base language return true if base language public boolean is base language return this equals get base language isbaselanguage getbaselanguage set date pattern the date format is not checked for correctness param java date pattern for details see java text simple date format format must be able to be converted to database date format by using the upper case function it also must have leading zero for day and month public void set date format string java date pattern if java date pattern null return m dateformat simple date format date format get date instance date format short m locale try m dateformat apply pattern java date pattern catch exception e log severe java date pattern e m dateformat null javadatepattern simpledateformat setdateformat javadatepattern javadatepattern m_dateformat simpledateformat dateformat getdateinstance dateformat m_locale m_dateformat applypattern javadatepattern javadatepattern m_dateformat get short date format the date format must parseable by org compiere grid ed m doc date i e leading zero for date and month return date format mm dd yyyy dd mm yyyy public simple date format get date format if m dateformat null m dateformat simple date format date format get date instance date format short m locale string s format m dateformat to pattern some short formats have only one m and d e g ths us if s format index of mm 1 s format index of dd 1 string n format for int i 0 i s format length i if s format char at i m n format mm else if s format char at i d n format dd else n format s format char at i log finer s format n format m dateformat apply pattern n format unknown short format use jdbc if m dateformat to pattern length 8 m dateformat apply pattern yyyy mm dd 4 digit year if m dateformat to pattern index of yyyy 1 s format m dateformat to pattern string n format for int i 0 i s format length i if s format char at i y n format yy else n format s format char at i m dateformat apply pattern n format m dateformat set lenient true return m dateformat mdocdate simpledateformat getdateformat m_dateformat m_dateformat simpledateformat dateformat getdateinstance dateformat m_locale sformat m_dateformat topattern sformat indexof sformat indexof nformat sformat sformat charat nformat sformat charat nformat nformat sformat charat sformat nformat m_dateformat applypattern nformat m_dateformat topattern m_dateformat applypattern m_dateformat topattern indexof sformat m_dateformat topattern nformat sformat sformat charat nformat nformat sformat charat m_dateformat applypattern nformat m_dateformat setlenient m_dateformat get date time format used for display only return date time format mmm d yyyy h mm ss a z or dd mm yyyy hh mm ss z or j nnn aaaa h m public simple date format get date time format simple date format ret value simple date format date format get date time instance date format medium date format long m locale log finer pattern ret value to localized pattern loc ret value to localized pattern return ret value simpledateformat getdatetimeformat simpledateformat retvalue simpledateformat dateformat getdatetimeinstance dateformat dateformat m_locale retvalue tolocalizedpattern retvalue tolocalizedpattern retvalue get time format used for display only return time format h mm ss z or hh mm ss z public simple date format get time format return simple date format date format get time instance date format long m locale simpledateformat gettimeformat simpledateformat dateformat gettimeinstance dateformat m_locale get database date pattern derive from date pattern make upper case return date pattern public string getd bdate pattern return get date format to pattern to upper case m locale getdbdatepattern getdateformat topattern touppercase m_locale get default media size return media size public media size get media size return m mediasize mediasize mediasize getmediasize m_mediasize set default media size param size media size public void set media size media size size if size null m mediasize size mediasize setmediasize mediasize m_mediasize string representation return string representation public string to string string buffer sb new string buffer language sb append m name append locale append m locale to string append ad language append m ad language append date pattern append getd bdate pattern append decimal point append is decimal point append return sb to string tostring stringbuffer stringbuffer m_name m_locale tostring ad_language m_ad_language datepattern getdbdatepattern decimalpoint isdecimalpoint tostring hash code return hashcode public int hash code return m ad language hash code hashcode m_ad_language hashcode equals two languages are equal if they have the same ad language param obj compare return true if ad language is the same public boolean equals object obj if obj instanceof language language cmp language obj if cmp getad language equals m ad language return true return false ad_language ad_language getad_language m_ad_language test param args ignored public static void main string args system out println locale traditional chinese system out println locale taiwan system out println locale simplified chinese system out println locale chinese system out println locale prc traditional_chinese simplified_chinese constructor created in layout engine the row col maps are organized as follows point row col row data if 0 m if 1 for the entire column column data if 0 n if 1 for the entire row i e point 1 1 is the default for the table param column header array with column headers key column name param column max width array with column max width 0 no restrictions negative supress if null param column max height array with row max height for a column 0 no restrictions 1 one row only param column justification field justification for column param fixed width array with column fixed width param function rows list of function rows param multi line header if true the header is not truncated at max width param data 2d array with data to be printed row col param pk array of primary keys param pk column name primary key name param page no start page number of starting page param first page bounds on first page param next pages bounds on following pages param repeated columns repeat first x columns on x axis follow pages param additional lines map of old colum to below printed column param row col font hash map with point as key with font overwrite param row col color hash map with point as key with foreground color overwrite param row col background hash map with point as key with background color overwrite param t format table format param page break arraylist of rows with page break public table element value name pair column header int column max width int column max height string column justification boolean fixed width array list integer function rows boolean multi line header object data key name pair pk string pk column name int page no start rectangle first page rectangle next pages int repeated columns hash map integer integer additional lines hash map point font row col font hash map point color row col color hash map point color row col background m print table format t format array list integer page break super log fine cols column header length rows data length m columnheader column header m columnmaxwidth column max width m columnmaxheight column max height m columnjustification column justification m functionrows function rows m fixedwidth fixed width m multilineheader multi line header m data data m pk pk m pkcolumnname pk column name m pagenostart page no start m firstpage first page m nextpages next pages m repeatedcolumns repeated columns m additionallines additional lines used fonts colots point p all new point all all m rowcolfont row col font m basefont font m rowcolfont get p all if m basefont null m basefont new font null m rowcolcolor row col color m basecolor color m rowcolcolor get p all if m basecolor null m basecolor color black m rowcolbackground row col background m basebackground color m rowcolbackground get p all if m basebackground null m basebackground color white m tformat t format page break not two after each other m pagebreak page break for int i 0 i m pagebreak size i integer row integer m pagebreak get i while i 1 m pagebreak size integer next row integer m pagebreak get i 1 if row int value 1 next row int value log fine removing page break row row m pagebreak remove i row next row else break for all page breaks load image wait for load layout engine image true wait for load layout engine image false layoutengine rowcol columnheader columnname columnmaxwidth columnmaxheight columnjustification fixedwidth functionrows multilineheader maxwidth pkcolumnname pagenostart firstpage nextpages repeatedcolumns additionallines rowcolfont hashmap rowcolcolor hashmap rowcolbackground hashmap tformat pagebreak tableelement valuenamepair columnheader columnmaxwidth columnmaxheight columnjustification fixedwidth arraylist functionrows multilineheader keynamepair pkcolumnname pagenostart firstpage nextpages repeatedcolumns hashmap additionallines hashmap rowcolfont hashmap rowcolcolor hashmap rowcolbackground mprinttableformat tformat arraylist pagebreak columnheader m_columnheader columnheader m_columnmaxwidth columnmaxwidth m_columnmaxheight columnmaxheight m_columnjustification columnjustification m_functionrows functionrows m_fixedwidth fixedwidth m_multilineheader multilineheader m_data m_pk m_pkcolumnname pkcolumnname m_pagenostart pagenostart m_firstpage firstpage m_nextpages nextpages m_repeatedcolumns repeatedcolumns m_additionallines additionallines pall m_rowcolfont rowcolfont m_basefont m_rowcolfont pall m_basefont m_basefont m_rowcolcolor rowcolcolor m_basecolor m_rowcolcolor pall m_basecolor m_basecolor m_rowcolbackground rowcolbackground m_basebackground m_rowcolbackground pall m_basebackground m_basebackground m_tformat tformat m_pagebreak pagebreak m_pagebreak m_pagebreak m_pagebreak nextrow m_pagebreak intvalue nextrow intvalue pagebreak m_pagebreak nextrow waitforload layoutengine image_true waitforload layoutengine image_false layout and calculate size set p width p height return true if calculated protected boolean calculate size if p sizecalculated return true p width 0 m additionallinedata new hash map point array list object reset max column width 50 of available width used if max width not set float dyn mx column width m firstpage width 2 width caolculation int rows m data length int cols m columnheader length data sizes and header sizes dimension2d impl data sizes new dimension2d impl rows cols dimension2d impl header sizes new dimension2d impl cols font render context frc new font render context null true true data rows for int data col 0 data col cols data col int col data col print below existing column if m additionallines contains key new integer data col col integer m additionallines get new integer data col int value log finest data column data col below column col float col width 0 for int row 0 row rows row object data item m data row data col if data item null data sizes row data col new dimension2d impl continue string string data item to string if string length 0 data sizes row data col new dimension2d impl continue font font get font row data col print below existing column if col data col add additional lines row col data item data sizes row data col new dimension2d impl don t print else data sizes row data col new dimension2d impl if data item instanceof boolean data sizes row col add below layout engine image size continue else if data item instanceof image element data sizes row col add below new dimension int image element data item get width int image element data item get height continue no width limitations if m columnmaxwidth col 0 m columnmaxwidth col 1 if html element ishtml string log finest html no r row c data col text layout layout new text layout string font frc float width layout get advance 2 buffer float height layout get ascent layout get descent layout get leading if width dyn mx column width m columnmaxwidth col int math ceil dyn mx column width else if col width width col width width if data sizes row col null data sizes row col new dimension2d impl log log level severe calculate size no size for r row c col data sizes row col add below width height width limitations if m columnmaxwidth col 0 m columnmaxwidth col 1 float height 0 if html element ishtml string log finest html limit r row c data col html renderer renderer html renderer get string col width renderer get width if m columnmaxheight col 1 one line only height renderer get height one line else height renderer get height renderer set allocation int col width int height log finest calculate size html renderer get allocation m data row data col renderer replace for printing else string lines pattern compile pattern multiline split string for int line no 0 line no lines length line no attributed string a string new attributed string lines line no a string add attribute text attribute font font attributed character iterator iter a string get iterator line break measurer measurer new line break measurer iter frc while measurer get position iter get end index text layout layout measurer next layout math abs m columnmaxwidth col float width layout get advance if col width width col width width float line height layout get ascent layout get descent layout get leading if m columnmaxheight col 1 one line only height line height break else if m columnmaxheight col 0 height line height m columnmaxheight col height line height for all lines if m fixedwidth col col width math abs m columnmaxwidth col data sizes row col add below col width height data sizes row col round up if data item instanceof name pair m rowcoldrilldown put new point row col name pair data item system out println col col row row data sizes row col col width col width for all data rows column width for header string string if m columnheader data col null string m columnheader data col to string print below existing column if col data col header sizes data col new dimension2d impl else if col width 0 m columnmaxwidth data col 0 suppress null string length 0 header sizes data col new dimension2d impl else font font get font header row data col if font is bold font new font font get name font bold font get size no width limitations if m columnmaxwidth data col 0 m columnmaxwidth data col 1 m multilineheader text layout layout new text layout string font frc float width layout get advance 3 buffer float height layout get ascent layout get descent layout get leading if width dyn mx column width m columnmaxwidth data col int math ceil dyn mx column width else if col width width col width width header sizes data col new dimension2d impl width height width limitations if m columnmaxwidth data col 0 m columnmaxwidth data col 1 float height 0 string lines pattern compile pattern multiline split string for int line no 0 line no lines length line no attributed string a string new attributed string lines line no a string add attribute text attribute font font attributed character iterator iter a string get iterator line break measurer measurer new line break measurer iter frc col width math abs m columnmaxwidth data col while measurer get position iter get end index text layout layout measurer next layout col width float line height layout get ascent layout get descent layout get leading if m multilineheader one line only height line height break else if m columnmaxheight data col 0 height line height m columnmaxheight data col height line height for all header lines header sizes data col new dimension2d impl col width height header size header sizes data col round up col width float math ceil col width system out println col data col header sizes data col round column width if data col 0 col width m tformat getv line stroke float value if col width 0 col width 2 h gap m tformat getv line stroke float value print below existing column if col data col m columnwidths add new float 0 0 for the data column float orig width float m columnwidths get col if orig width null log log level severe column data col below col no value for orig width else if orig width compare to new float col width 0 log finest same width col col orig width orig width width col width total p width else m columnwidths set col new float col width p width col width orig width float value log finest new width col col orig width orig width width col width total p width add new column else m columnwidths add new float col width p width col width log finest width col data col width col width total p width for all columns height p height 0 for int row 0 row rows row float row height 0f for int col 0 col cols col if data sizes row col height row height row height float data sizes row col height for all columns row height m tformat get line stroke float value 2 v gap m rowheights add new float row height p height row height for all rows header row m headerheight 0 for int col 0 col cols col if header sizes col height m headerheight m headerheight int header sizes col height for all columns m headerheight 4 m tformat get line stroke float value 2 v gap thick lines p height m headerheight page layout log fine first page m firstpage next pages m nextpages one page on y axis if m firstpage height p height m pagebreak size 0 log finest page y 1 page height m firstpage height table height p height m firstrowonpage add new integer 0 y m pageheight add new float p height y index only multiple pag p_width p_height calculatesize p_sizecalculated p_width m_additionallinedata hashmap arraylist maxwidth dynmxcolumnwidth m_firstpage m_data m_columnheader dimension2dimpl datasizes dimension2dimpl dimension2dimpl headersizes dimension2dimpl fontrendercontext fontrendercontext datacol datacol datacol datacol m_additionallines containskey datacol m_additionallines datacol intvalue datacolumn datacol belowcolumn colwidth dataitem m_data datacol dataitem datasizes datacol dimension2dimpl dataitem tostring datasizes datacol dimension2dimpl getfont datacol datacol addadditionallines dataitem datasizes datacol dimension2dimpl datasizes datacol dimension2dimpl dataitem datasizes addbelow layoutengine image_size dataitem imageelement datasizes addbelow imageelement dataitem getwidth imageelement dataitem getheight m_columnmaxwidth m_columnmaxwidth htmlelement datacol textlayout textlayout getadvance getascent getdescent getleading dynmxcolumnwidth m_columnmaxwidth dynmxcolumnwidth colwidth colwidth datasizes datasizes dimension2dimpl calculatesize datasizes addbelow m_columnmaxwidth m_columnmaxwidth htmlelement datacol htmlrenderer htmlrenderer colwidth getwidth m_columnmaxheight getheightoneline getheight setallocation colwidth calculatesize getallocation m_data datacol lineno lineno lineno attributedstring astring attributedstring lineno astring addattribute textattribute attributedcharacteriterator astring getiterator linebreakmeasurer linebreakmeasurer getposition getendindex textlayout nextlayout m_columnmaxwidth getadvance colwidth colwidth lineheight getascent getdescent getleading m_columnmaxheight lineheight m_columnmaxheight lineheight m_columnmaxheight lineheight m_fixedwidth colwidth m_columnmaxwidth datasizes addbelow colwidth datasizes roundup dataitem namepair m_rowcoldrilldown namepair dataitem datasizes colwidth colwidth m_columnheader datacol m_columnheader datacol tostring datacol headersizes datacol dimension2dimpl colwidth m_columnmaxwidth datacol headersizes datacol dimension2dimpl getfont header_row datacol isbold getname getsize m_columnmaxwidth datacol m_columnmaxwidth datacol m_multilineheader textlayout textlayout getadvance getascent getdescent getleading dynmxcolumnwidth m_columnmaxwidth datacol dynmxcolumnwidth colwidth colwidth headersizes datacol dimension2dimpl m_columnmaxwidth datacol m_columnmaxwidth datacol lineno lineno lineno attributedstring astring attributedstring lineno astring addattribute textattribute attributedcharacteriterator astring getiterator linebreakmeasurer linebreakmeasurer colwidth m_columnmaxwidth datacol getposition getendindex textlayout nextlayout colwidth lineheight getascent getdescent getleading m_multilineheader lineheight m_columnmaxheight datacol lineheight m_columnmaxheight datacol lineheight headersizes datacol dimension2dimpl colwidth headersize headersizes datacol roundup colwidth colwidth datacol headersizes datacol datacol colwidth m_tformat getvlinestroke floatvalue colwidth colwidth h_gap m_tformat getvlinestroke floatvalue datacol m_columnwidths origwidth m_columnwidths origwidth datacol origwidth compareto colwidth origwidth origwidth colwidth p_width m_columnwidths colwidth p_width colwidth origwidth floatvalue origwidth origwidth colwidth p_width m_columnwidths colwidth p_width colwidth datacol colwidth p_width p_height rowheight datasizes rowheight rowheight datasizes rowheight m_tformat getlinestroke floatvalue v_gap m_rowheights rowheight p_height rowheight headerrow m_headerheight headersizes m_headerheight m_headerheight headersizes m_headerheight m_tformat getlinestroke floatvalue v_gap p_height m_headerheight firstpage m_firstpage nextpages m_nextpages m_firstpage p_height m_pagebreak pageheight m_firstpage tableheight p_height m_firstrowonpage m_pageheight p_height distribute columns to fill page param available width width to distribute param from col start column param to col end column not included private void distribute columns int available width int from col int to col log finest available available width columns from col to col int start from col if from col 0 m repeatedcolumns 0 start m repeatedcolumns calculate total width int total width available width for int col start col to col col total width float m columnwidths get col float value int remaining width available width distribute proportionally does not increase zero width columns for int x 0 remaining width 0 x 5 x max 4 iterations log finest total width total width remaining remaining width for int col start col to col remaining width 0 col int column width float m columnwidths get col int value if column width 0 int additional part column width available width total width if remaining width additional part m columnwidths set col new float column width remaining width remaining width 0 else m columnwidths set col new float column width additional part remaining width additional part log finest col col from column width to m columnwidths get col add remainder to last non 0 width column for int c to col 1 remaining width 0 c 0 c int column width float m columnwidths get c int value if column width 0 m columnwidths set c new float column width remaining width log finest final col c from column width to m columnwidths get c remaining width 0 availablewidth fromcol tocol distributecolumns availablewidth fromcol tocol availablewidth fromcol tocol fromcol fromcol m_repeatedcolumns m_repeatedcolumns totalwidth availablewidth tocol totalwidth m_columnwidths floatvalue remainingwidth availablewidth remainingwidth totalwidth totalwidth remainingwidth tocol remainingwidth columnwidth m_columnwidths intvalue columnwidth additionalpart columnwidth availablewidth totalwidth remainingwidth additionalpart m_columnwidths columnwidth remainingwidth remainingwidth m_columnwidths columnwidth additionalpart remainingwidth additionalpart columnwidth m_columnwidths tocol remainingwidth columnwidth m_columnwidths intvalue columnwidth m_columnwidths columnwidth remainingwidth columnwidth m_columnwidths remainingwidth check for for page break param row current row return true if row should be on new page private boolean is page break int row for int i 0 i m pagebreak size i integer rr integer m pagebreak get i if rr int value 1 row return true else if rr int value row return false return false pagebreak ispagebreak m_pagebreak m_pagebreak intvalue intvalue for multi page tables set height to height of last page public void set height to last page int last layout page get page count m pagenostart 1 log fine page count table get page count start m pagenostart layout last layout page old height p height p height get height last layout page log fine new height p height setheighttolastpage lastlayoutpage getpagecount m_pagenostart pagecount getpagecount m_pagenostart lastlayoutpage p_height p_height getheight lastlayoutpage p_height get font based on point row col pre examples from general to specific 1 1 for entire table 1 c for entire column c r 1 for entire row r overwrites column r c for specific cell highest priority header is row 2 2 1 for all header columns 2 c for header column c pre param row row param col column return font for row col private font get font int row int col first specific position font font font m rowcolfont get new point row col if font null return font row next font font m rowcolfont get new point row all if font null return font column then font font m rowcolfont get new point all col if font null return font default return m basefont getfont m_rowcolfont m_rowcolfont m_rowcolfont m_basefont get foreground color param row row param col column return color for row col private color get color int row int col first specific position color color color m rowcolcolor get new point row col if color null return color row next color color m rowcolcolor get new point row all if color null return color column then color color m rowcolcolor get new point all col if color null return color default return m basecolor getcolor m_rowcolcolor m_rowcolcolor m_rowcolcolor m_basecolor get foreground color param row row param col column return color for row col private color get background int row int col first specific position color color color m rowcolbackground get new point row col if color null return color row next color color m rowcolbackground get new point row all if color null return color column then color color m rowcolbackground get new point all col if color null return color default return m basebackground getbackground m_rowcolbackground m_rowcolbackground m_rowcolbackground m_basebackground get calculated height on page param page no layout page number return height public float get height int page no int page index get page index page no int page yindex get pagey index page index log fine page page no page index page index page yindex page yindex float page height float m pageheight get page yindex float value float page height previous 0f if page yindex 0 page height previous float m pageheight get page yindex 1 float value float ret value page height page height previous log fine page page no page index page index page yindex page yindex height string value of ret value return ret value pageno getheight pageno pageindex getpageindex pageno pageyindex getpageyindex pageindex pageno pageindex pageindex pageyindex pageyindex pageheight m_pageheight pageyindex floatvalue pageheightprevious pageyindex pageheightprevious m_pageheight pageyindex floatvalue retvalue pageheight pageheightprevious pageno pageindex pageindex pageyindex pageyindex valueof retvalue retvalue get calculated height on page param page no page number return height public float get width int page no int page index get page index page no if page index 0 return m firstpage width return m nextpages width pageno getwidth pageno pageindex getpageindex pageno pageindex m_firstpage m_nextpages get number of real pages return page count public int get page count return m firstrowonpage size m firstcolumnonpage size getpagecount m_firstrowonpage m_firstcolumnonpage get zero based page index within layout param page no real page no return page index protected int get page index int page no int index page no m pagenostart if index 0 log log level severe index index new exception return index pageno getpageindex pageno pageno m_pagenostart get real page number within layout param page index zero based page index return page number private int get page no int page index return page index m pagenostart pageindex getpageno pageindex pageindex m_pagenostart get x page index zero based page no is the real page no pre the table is 3 pages wide 2 pages high index 0 0 0 1 0 2 1 0 1 1 1 2 page index 0 1 2 3 4 5 pre param page index zero based page index return page index on x axis protected int get pagex index int page index int no xpages m firstcolumnonpage size int no ypages m firstrowonpage size int x page index no xpages return x pageindex getpagexindex pageindex noxpages m_firstcolumnonpage noypages m_firstrowonpage pageindex noxpages get x page count return x page count protected int get pagex count return m firstcolumnonpage size getpagexcount m_firstcolumnonpage get y page index zero based page no is the real page no pre the table is 3 pages wide 2 pages high index 0 0 0 1 0 2 1 0 1 1 1 2 page index 0 1 2 3 4 5 pre param page index zero based page index return page index on y axis protected int get pagey index int page index int no xpages m firstcolumnonpage size int no ypages m firstrowonpage size int y page index page index no xpages no xpages return y pageindex getpageyindex pageindex noxpages m_firstcolumnonpage noypages m_firstrowonpage pageindex pageindex noxpages noxpages get y page count return y page count protected int get pagey count return m firstrowonpage size getpageycount m_firstrowonpage get drill down value param relative point relative point param page no page number return if found qyery or null public m query get drill down point relative point int page no if m rowcoldrilldown size 0 return null if get bounds page no contains relative point return null int row get row relative point y page no if row 1 return null int col get col relative point x page no if col 1 return null log fine row row col col page no page no name pair pp name pair m rowcoldrilldown get new point row col if pp null return null string column name m query get zoom column name m columnheader col getid string table name m query get zoom table name column name object code pp getid if pp instanceof key name pair code new integer key name pair pp get key m query query new m query table name query add restriction column name m query equal code null pp to string return query relativepoint pageno mquery getdrilldown relativepoint pageno m_rowcoldrilldown getbounds pageno relativepoint getrow relativepoint pageno getcol relativepoint pageno pageno pageno namepair namepair m_rowcoldrilldown columnname mquery getzoomcolumnname m_columnheader tablename mquery getzoomtablename columnname keynamepair keynamepair getkey mquery mquery tablename addrestriction columnname mquery tostring get drill across value param relative point relative point param page no page number return if found query or null public m query get drill across point relative point int page no if get bounds page no contains relative point return null int row get row relative point y page no if row 1 return null log fine row row page no page no if m pk row null function rows return null return m query get equal query m pkcolumnname m pk row get key relativepoint pageno mquery getdrillacross relativepoint pageno getbounds pageno relativepoint getrow relativepoint pageno pageno pageno m_pk functionrows mquery getequalquery m_pkcolumnname m_pk getkey get relative bounds of element entire page not just used portion param page no page no return bounds relative position on page public rectangle get bounds int page no int page index get page index page no int page yindex get pagey index page index if page yindex 0 return m firstpage else return m nextpages pageno pageno getbounds pageno pageindex getpageindex pageno pageyindex getpageyindex pageindex pageyindex m_firstpage m_nextpages get row for y pos param y pos y position page relative param page no page number return row index or 1 private int get row int y pos int page no int page index get page index page no int page yindex get pagey index page index int cury page yindex 0 m firstpage y m nextpages y m headerheight if y pos cury return 1 above int first row integer m firstrowonpage get page yindex int value int next page row m data length no of rows if page yindex 1 m firstrowonpage size next page row integer m firstrowonpage get page yindex 1 int value for int row first row row next page row row int row height float m rowheights get row int value includes 2 gaps line if y pos cury y pos cury row height return row cury row height below return 1 ypos ypos pageno getrow ypos pageno pageindex getpageindex pageno pageyindex getpageyindex pageindex pageyindex m_firstpage m_nextpages m_headerheight ypos firstrow m_firstrowonpage pageyindex intvalue nextpagerow m_data pageyindex m_firstrowonpage nextpagerow m_firstrowonpage pageyindex intvalue firstrow nextpagerow rowheight m_rowheights intvalue ypos ypos rowheight rowheight get column for x pos param x pos x position page relative param page no page number return column index or 1 private int get col int x pos int page no int page index get page index page no int page xindex get pagex index page index int curx page xindex 0 m firstpage x m nextpages x if x pos curx return 1 too left int first column integer m firstcolumnonpage get page xindex int value int next page column m columnheader length no of cols if page xindex 1 m firstcolumnonpage size next page column integer m firstcolumnonpage get page xindex 1 int value fixed volumns int regular column start first column for int col 0 col m repeatedcolumns col int col width float m columnwidths get col int value includes 2 gaps line if x pos curx x pos curx col width return col curx col width if regular column start col regular column start regular columns for int col regular column start col next page column col int col width float m columnwidths get col int value includes 2 gaps line if x pos curx x pos curx col width return col curx col width for all columns too right return 1 xpos xpos pageno getcol xpos pageno pageindex getpageindex pageno pagexindex getpagexindex pageindex pagexindex m_firstpage m_nextpages xpos firstcolumn m_firstcolumnonpage pagexindex intvalue nextpagecolumn m_columnheader pagexindex m_firstcolumnonpage nextpagecolumn m_firstcolumnonpage pagexindex intvalue regularcolumnstart firstcolumn m_repeatedcolumns colwidth m_columnwidths intvalue xpos xpos colwidth colwidth regularcolumnstart regularcolumnstart regularcolumnstart nextpagecolumn colwidth m_columnwidths intvalue xpos xpos colwidth colwidth paint print param g2d graphics param page no page number for multi page support 0 header footer param page start top left location of page param ctx context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view int page index get page index page no int page xindex get pagex index page index int page yindex get pagey index page index if debug print log config page page no x page xindex y page yindex int first column integer m firstcolumnonpage get page xindex int value int next page column m columnheader length no of cols if page xindex 1 m firstcolumnonpage size next page column integer m firstcolumnonpage get page xindex 1 int value int first row integer m firstrowonpage get page yindex int value int next page row m data length no of rows if page yindex 1 m firstrowonpage size next page row integer m firstrowonpage get page yindex 1 int value if debug print log finest col first column next page column 1 row first row next page row 1 top left int startx int page start getx int starty int page start gety table start startx page xindex 0 m firstpage x m nextpages x starty page yindex 0 m firstpage y m nextpages y if debug print log finest page start page start start table x startx y starty paint first fixed volumns boolean first column print true int regular column start first column for int col 0 col m repeatedcolumns col m columnwidths size col int col width float m columnwidths get col int value includes 2 gaps line if col width 0 print column g2d col startx starty first column print first row next page row is view startx col width first column print false if regular column start col regular column start paint columns for int col regular column start col next page column col int col width float m columnwidths get col int value includes 2 gaps line if col width 0 print column g2d col startx starty first column print first row next page row is view startx col width first column print false for all columns pageno pagestart isview ids pageno pagestart isview pageindex getpageindex pageno pagexindex getpagexindex pageindex pageyindex getpageyindex pageindex debug_print pageno pagexindex pageyindex firstcolumn m_firstcolumnonpage pagexindex intvalue nextpagecolumn m_columnheader pagexindex m_firstcolumnonpage nextpagecolumn m_firstcolumnonpage pagexindex intvalue firstrow m_firstrowonpage pageyindex intvalue nextpagerow m_data pageyindex m_firstrowonpage nextpagerow m_firstrowonpage pageyindex intvalue debug_print firstcolumn nextpagecolumn firstrow nextpagerow pagestart pagestart pagexindex m_firstpage m_nextpages pageyindex m_firstpage m_nextpages debug_print pagestart pagestart starttable firstcolumnprint regularcolumnstart firstcolumn m_repeatedcolumns m_columnwidths colwidth m_columnwidths intvalue colwidth printcolumn firstcolumnprint firstrow nextpagerow isview colwidth firstcolumnprint regularcolumnstart regularcolumnstart regularcolumnstart nextpagecolumn colwidth m_columnwidths intvalue colwidth printcolumn firstcolumnprint firstrow nextpagerow isview colwidth firstcolumnprint print non zero width column param g2d graphics param col column index param origx start x param origy start y param left vline if true print left vertical line for first column param first row first row index param next page row row index of next page param is view true if online view i ds are links private void print column graphics2d g2d int col final int origx final int origy boolean left vline final int first row final int next page row boolean is view int curx origx int cury origy start from top float col width float m columnwidths get col float value includes 2 gaps line float net width col width 2 h gap m tformat getv line stroke float value if left vline net width m tformat getv line stroke float value int row height m headerheight float net height row height 4 m tformat get line stroke float value 2 v gap if debug print log finer col x curx y cury width col width net width header height row height net height string alignment m columnjustification col paint header if left vline draw left line g2d set paint m tformat getvline color g2d set stroke m tformat getvline stroke if m tformat is paint boundary lines left g2d draw line origx int origy m tformat get line stroke float value origx int origy row height 4 m tformat get line stroke float value curx m tformat getv line stroke float value x start line if m tformat is paint header lines g2d set paint m tformat getheaderline color g2d set stroke m tformat getheader stroke g2d draw line origx origy top int origx col width m tformat getv line stroke float value origy cury 2 m tformat get line stroke float value thick background color bg get background header row col if bg equals color white g2d set paint bg g2d fill rect curx int cury m tformat get line stroke float value int col width m tformat getv line stroke float value int row height 4 m tformat get line stroke float value curx h gap upper left gap cury v gap header attributed string a string null attributed character iterator iter null line break measurer measurer null float used height 0 if m columnheader col to string length 0 a string new attributed string m columnheader col to string a string add attribute text attribute font get font header row col a string add attribute text attribute foreground get color header row col boolean fast draw layout engine s fastdraw if fast draw is view util is8 bit m columnheader col to string fast draw false iter a string get iterator measurer new line break measurer iter g2d get font render context while measurer get position iter get end index print header text layout layout measurer next layout net width 2 if iter get end index measurer get position fast draw false float line height layout get ascent layout get descent layout get leading if m columnmaxheight col 0 1 first line only used height line height m columnmaxheight col if alignment equals m print format item fieldalignmenttype block layout layout get justified layout net width 2 fast draw false cury layout get ascent float penx curx if alignment equals m print format item fieldalignmenttype center penx net width layout get advance 2 else if alignment equals m print format item fieldalignmenttype trailingright layout is left to right alignment equals m print format item fieldalignmenttype leadingleft layout is left to right penx net width layout get advance if fast draw bug set font color explicitly g2d set font get font header row col g2d set color get color header row col g2d draw string iter penx cury else layout draw g2d penx cury text cury layout get descent layout get leading used height line height if m multilineheader one line only break length 0 curx net width h gap cury v gap y end line g2d set paint m tformat getvline color g2d set stroke m tformat getvline stroke if m tformat is paintv lines right g2d draw line curx int origy m tformat get line stroke float value curx int origy row height 4 m tformat get line stroke float value curx m tformat getv line stroke float value x end line if m tformat is paint header lines g2d set paint m tformat getheaderline color g2d set stroke m tformat getheader stroke g2d draw line origx cury button int origx col width m tformat getv line stroke float value cury cury 2 m tformat get line stroke float value thick paint data for int row first row row next page row row row height float m rowheights get row int value includes 2 gaps line net height row height 2 v gap m tformat get line stroke float value int row ystart cury curx origx if left vline draw left line g2d set paint m tformat getvline color g2d set stroke m tformat getvline stroke if m tformat is paint boundary lines g2d draw line curx row ystart left curx int row ystart row height m tformat get line stroke float value curx m tformat getv line stroke float value background bg get background row col if bg equals color white g2d set paint bg g2d fill rect curx cury int col width m tformat getv line stroke float value int row height m tformat get line stroke float value curx h gap upper left gap cury v gap actual data object print items get print items row col float peny cury for int index 0 index print items length index if print items index null else if print items index instanceof image element g2d draw image image element print items index get image curx int peny this else if print items index instanceof boolean int penx curx int net width layout engine image size width 2 center if boolean print items index boolean value g2d draw image layout engine image true penx int peny this else g2d draw image layout engine image false penx int peny this peny layout engine image size height else if print items index instanceof html renderer html renderer renderer html renderer print items index rectangle allocation new rectangle int col width int net height log finest print column html allocation g2d translate curx peny renderer paint g2d allocation g2d translate curx peny peny allocation get height else string str print items index to string if debug print log fine row row col col str 8 bit util is8 bit str if str length 0 used height 0 string lines pattern compile pattern multiline split str for int line no 0 line no lines length line no a string new attributed string lines line no a string add attribute text attribute font get font row col if is view print items index instanceof name pair id a string add attribute text attribute foreground link color a string add attribute text attribute underline text attribute underline low one pixel 0 str length else a string add attribute text attribute foreground get color row col iter a string get iterator boolean fast draw layout engine s fastdraw if fast draw is view util is8 bit lines line no fast draw false measurer new line break measurer iter g2d get font render context while measurer get position iter get end index print element text layout layout measurer next layout net width 2 if iter get end index measurer get position fast draw false float line height layout get ascent layout get descent layout get leading if m columnmaxheight col 0 used height line height m columnmaxheight col used height line height net height if alignment equals m print format item fieldalignmenttype block measurer get position iter get end index layout layout get justified layout net width 2 fast draw false peny layout get ascent float penx curx if alignment equals m print format item fieldalignmenttype center penx net width layout get advance 2 else if alignment equals m print format item fieldalignmenttype trailingright layout is left to right alignment equals m print format item fieldalignmenttype leadingleft layout is left to right penx net width layout get advance if fast draw bug set font color explicitly g2d set font get font row col if is view print items index instanceof name pair id leftvline firstrow nextpagerow isview ids printcolumn leftvline firstrow nextpagerow isview colwidth m_columnwidths floatvalue netwidth colwidth h_gap m_tformat getvlinestroke floatvalue leftvline netwidth m_tformat getvlinestroke floatvalue rowheight m_headerheight netheight rowheight m_tformat getlinestroke floatvalue v_gap debug_print colwidth netwidth headerheight rowheight netheight m_columnjustification leftvline setpaint m_tformat getvline_color setstroke m_tformat getvline_stroke m_tformat ispaintboundarylines drawline m_tformat getlinestroke floatvalue rowheight m_tformat getlinestroke floatvalue m_tformat getvlinestroke floatvalue m_tformat ispaintheaderlines setpaint m_tformat getheaderline_color setstroke m_tformat getheader_stroke drawline colwidth m_tformat getvlinestroke floatvalue m_tformat getlinestroke floatvalue getbackground header_row setpaint fillrect m_tformat getlinestroke floatvalue colwidth m_tformat getvlinestroke floatvalue rowheight m_tformat getlinestroke floatvalue h_gap v_gap attributedstring astring attributedcharacteriterator linebreakmeasurer usedheight m_columnheader tostring astring attributedstring m_columnheader tostring astring addattribute textattribute getfont header_row astring addattribute textattribute getcolor header_row fastdraw layoutengine s_fastdraw fastdraw isview is8bit m_columnheader tostring fastdraw astring getiterator linebreakmeasurer getfontrendercontext getposition getendindex textlayout nextlayout netwidth getendindex getposition fastdraw lineheight getascent getdescent getleading m_columnmaxheight firstlineonly usedheight lineheight m_columnmaxheight mprintformatitem fieldalignmenttype_block getjustifiedlayout netwidth fastdraw getascent mprintformatitem fieldalignmenttype_center netwidth getadvance mprintformatitem fieldalignmenttype_trailingright islefttoright mprintformatitem fieldalignmenttype_leadingleft islefttoright netwidth getadvance fastdraw setfont getfont header_row setcolor getcolor header_row drawstring getdescent getleading usedheight lineheight m_multilineheader netwidth h_gap v_gap setpaint m_tformat getvline_color setstroke m_tformat getvline_stroke m_tformat ispaintvlines drawline m_tformat getlinestroke floatvalue rowheight m_tformat getlinestroke floatvalue m_tformat getvlinestroke floatvalue m_tformat ispaintheaderlines setpaint m_tformat getheaderline_color setstroke m_tformat getheader_stroke drawline colwidth m_tformat getvlinestroke floatvalue m_tformat getlinestroke floatvalue firstrow nextpagerow rowheight m_rowheights intvalue netheight rowheight v_gap m_tformat getlinestroke floatvalue rowystart leftvline setpaint m_tformat getvline_color setstroke m_tformat getvline_stroke m_tformat ispaintboundarylines drawline rowystart rowystart rowheight m_tformat getlinestroke floatvalue m_tformat getvlinestroke floatvalue getbackground setpaint fillrect colwidth m_tformat getvlinestroke floatvalue rowheight m_tformat getlinestroke floatvalue h_gap v_gap printitems getprintitems printitems printitems printitems imageelement drawimage imageelement printitems getimage printitems netwidth layoutengine image_size printitems booleanvalue drawimage layoutengine image_true drawimage layoutengine image_false layoutengine image_size printitems htmlrenderer htmlrenderer htmlrenderer printitems colwidth netheight printcolumn getheight printitems tostring debug_print 8bit is8bit usedheight lineno lineno lineno astring attributedstring lineno astring addattribute textattribute getfont isview printitems namepair astring addattribute textattribute link_color astring addattribute textattribute textattribute underline_low_one_pixel astring addattribute textattribute getcolor astring getiterator fastdraw layoutengine s_fastdraw fastdraw isview is8bit lineno fastdraw linebreakmeasurer getfontrendercontext getposition getendindex textlayout nextlayout netwidth getendindex getposition fastdraw lineheight getascent getdescent getleading m_columnmaxheight usedheight lineheight m_columnmaxheight usedheight lineheight netheight mprintformatitem fieldalignmenttype_block getposition getendindex getjustifiedlayout netwidth fastdraw getascent mprintformatitem fieldalignmenttype_center netwidth getadvance mprintformatitem fieldalignmenttype_trailingright islefttoright mprintformatitem fieldalignmenttype_leadingleft islefttoright netwidth getadvance fastdraw setfont getfont isview printitems namepair add additional lines to row col param row row param col col param data data private void add additional lines int row int col object data point key new point row col array list object list array list object m additionallinedata get key if list null list new array list object list add data m additionallinedata put key list addadditionallines arraylist arraylist m_additionallinedata arraylist m_additionallinedata get print data including additional lines param row row param col col return non null array of print objects may be empty private object get print items int row int col point key new point row col array list object list array list object m additionallinedata get key if list null if m data row col null return new object m data row col else return new object multiple array list object ret list new array list object ret list add m data row col ret list add all list return ret list to array getprintitems arraylist arraylist m_additionallinedata m_data m_data arraylist retlist arraylist retlist m_data retlist addall retlist toarray standard constructors param ctx context param c taxdeclaration id ic param trx name trx public m tax declaration properties ctx int c taxdeclaration id string trx name super ctx c taxdeclaration id trx name c_taxdeclaration_id trxname mtaxdeclaration c_taxdeclaration_id trxname c_taxdeclaration_id trxname load constructor param ctx context param rs result set param trx name trx public m tax declaration properties ctx result set rs string trx name super ctx rs trx name trxname mtaxdeclaration resultset trxname trxname before save param new record new return true protected boolean before save boolean new record if is valuechanged date from set date from time util get day get date from if is valuechanged date to set date to time util get day get date to return true newrecord beforesave newrecord is_valuechanged datefrom setdatefrom timeutil getday getdatefrom is_valuechanged dateto setdateto timeutil getday getdateto get category acct param ctx context param m product category id category param c acctschema id acct schema param trx name trx return category acct public static m product category acct get properties ctx int m product category id int c acctschema id string trx name m product category acct ret value null prepared statement pstmt null string sql select from m product category acct where m product category id and c acctschema id try pstmt db prepare statement sql trx name pstmt set int 1 m product category id pstmt set int 2 c acctschema id result set rs pstmt execute query if rs next ret value new m product category acct ctx rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_product_category_id c_acctschema_id trxname mproductcategoryacct m_product_category_id c_acctschema_id trxname mproductcategoryacct retvalue preparedstatement m_product_category_acct m_product_category_id c_acctschema_id preparestatement trxname setint m_product_category_id setint c_acctschema_id resultset executequery retvalue mproductcategoryacct trxname retvalue standard constructor param ctx context param ignored ignored param trx name public m product category acct properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 throw new illegal argument exception multi key trxname mproductcategoryacct trxname trxname illegalargumentexception load cosntructor param ctx context param rs result set param trx name trx public m product category acct properties ctx result set rs string trx name super ctx rs trx name trxname mproductcategoryacct resultset trxname trxname check costing setup public void check costing create cost elements if get costing method null get costing method length 0 m cost element get material cost element this get costing method checkcosting getcostingmethod getcostingmethod mcostelement getmaterialcostelement getcostingmethod after save param new record new param success success return success protected boolean after save boolean new record boolean success check costing return success newrecord aftersave newrecord checkcosting get default status categpru for client param ctx context return status category or null public static m status category get default properties ctx int ad client id env getad client id ctx string sql select from r statuscategory where ad client id in 0 and is default y order by ad client id desc m status category ret value null prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next ret value new m status category ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value mstatuscategory getdefault ad_client_id getad_client_id r_statuscategory ad_client_id isdefault ad_client_id mstatuscategory retvalue preparedstatement preparestatement setint ad_client_id resultset executequery retvalue mstatuscategory s_log retvalue get default status categpru for client param ctx context return status category or null public static m status category create default properties ctx int ad client id env getad client id ctx m status category ret value new m status category ctx 0 null ret value set client org ad client id 0 ret value set name msg get msg ctx standard ret value set is default true if ret value save return null string sql update r status set r statuscategory id ret value getr statuscategory id where r statuscategory id is null and ad client id ad client id int no db execute update sql null s log info default for ad client id ad client id status no return ret value mstatuscategory createdefault ad_client_id getad_client_id mstatuscategory retvalue mstatuscategory retvalue setclientorg ad_client_id retvalue setname getmsg retvalue setisdefault retvalue r_status r_statuscategory_id retvalue getr_statuscategory_id r_statuscategory_id ad_client_id ad_client_id executeupdate s_log ad_client_id ad_client_id retvalue get request status category from cache param ctx context param r statuscategory id id return r status category public static m status category get properties ctx int r statuscategory id integer key new integer r statuscategory id m status category ret value m status category s cache get key if ret value null return ret value ret value new m status category ctx r statuscategory id null if ret value get id 0 s cache put key ret value return ret value r_statuscategory_id rstatuscategory mstatuscategory r_statuscategory_id r_statuscategory_id mstatuscategory retvalue mstatuscategory s_cache retvalue retvalue retvalue mstatuscategory r_statuscategory_id retvalue get_id s_cache retvalue retvalue default constructor param ctx context param r statuscategory id id param trx name trx public m status category properties ctx int r statuscategory id string trx name super ctx r statuscategory id trx name if r statuscategory id 0 set name null set is default false r_statuscategory_id trxname mstatuscategory r_statuscategory_id trxname r_statuscategory_id trxname r_statuscategory_id setname setisdefault load constructor param ctx context param rs result set param trx name trx public m status category properties ctx result set rs string trx name super ctx rs trx name trxname mstatuscategory resultset trxname trxname get all status param reload reload return status array public m status get status boolean reload if m status null reload return m status string sql select from r status where r statuscategory id order by seq no array list m status list new array list m status prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getr statuscategory id result set rs pstmt execute query while rs next list add new m status get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m status new m status list size list to array m status return m status mstatus getstatus m_status m_status r_status r_statuscategory_id seqno arraylist mstatus arraylist mstatus preparedstatement preparestatement setint getr_statuscategory_id resultset executequery mstatus getctx m_status mstatus toarray m_status m_status get default r status id return id or 0 public int getdefaultr status id if m status null get status false for int i 0 i m status length i if m status i is default m status i is active return m status i getr status id if m status length 0 m status 0 is active return m status 0 getr status id return 0 r_status_id getdefaultr_status_id m_status getstatus m_status m_status isdefault m_status isactive m_status getr_status_id m_status m_status isactive m_status getr_status_id string representation return info public string to string string buffer sb new string buffer r status category sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer rstatuscategory get_id getname tostring standard constructor public x c bank properties ctx int c bank id string trx name super ctx c bank id trx name if c bank id 0 setc bank id 0 set is own bank true y set name null set routing no null x_c_bank c_bank_id trxname c_bank_id trxname c_bank_id setc_bank_id setisownbank setname setroutingno load constructor public x c bank properties ctx result set rs string trx name super ctx rs trx name x_c_bank resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bank append get id append return sb to string tostring stringbuffer stringbuffer x_c_bank get_id tostring set bank bank public void setc bank id int c bank id if c bank id 1 throw new illegal argument exception c bank id is mandatory set valuenocheck c bank id new integer c bank id setc_bank_id c_bank_id c_bank_id illegalargumentexception c_bank_id set_valuenocheck c_bank_id c_bank_id get bank bank public int getc bank id integer ii integer get value c bank id if ii null return 0 return ii int value getc_bank_id get_value c_bank_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set own bank bank for this organization public void set is own bank boolean is own bank set value is own bank new boolean is own bank setisownbank isownbank set_value isownbank isownbank get own bank bank for this organization public boolean is own bank object oo get value is own bank if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isownbank get_value isownbank booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set routing no bank routing number public void set routing no string routing no if routing no null throw new illegal argument exception routing no is mandatory if routing no length 20 log warning length 20 truncated routing no routing no substring 0 19 set value routing no routing no setroutingno routingno routingno illegalargumentexception routingno routingno routingno routingno set_value routingno routingno get routing no bank routing number public string get routing no return string get value routing no getroutingno get_value routingno set swift code swift code or bic public void set swift code string swift code if swift code null swift code length 20 log warning length 20 truncated swift code swift code substring 0 19 set value swift code swift code setswiftcode swiftcode swiftcode swiftcode swiftcode swiftcode set_value swiftcode swiftcode get swift code swift code or bic public string get swift code return string get value swift code getswiftcode get_value swiftcode basic constructor public xhtml document xhtmldocument basic constructor sets the codeset for the page output public xhtml document string codeset set codeset codeset xhtmldocument setcodeset get the doctype element for this xhtml document container public doctype get doctype return doctype xhtmldocument getdoctype set the doctype element for this xhtml document container public xhtml document set doctype doctype set doctype this doctype set doctype return this xhtmldocument xhtmldocument setdoctype set_doctype set_doctype get the html element for this xhtml document container public html get html return html xhtmldocument gethtml set the html element for this xhtml document container public xhtml document set html html set html this html set html return this xhtmldocument xhtmldocument sethtml set_html set_html get the head element for this xhtml document container public head get head return head xhtmldocument gethead set the head element for this xhtml document container public xhtml document set head head set head html add element head set head return this xhtmldocument xhtmldocument sethead set_head addelement set_head append to the head element for this xhtml document container param value adds to the value between the head tags public xhtml document append head element value head add element value return this xhtmldocument xhtmldocument appendhead addelement append to the head element for this xhtml document container param value adds to the value between the head tags public xhtml document append head string value head add element value return this xhtmldocument xhtmldocument appendhead addelement get the body element for this xhtml document container public body get body return body xhtmldocument getbody set the body element for this xhtml document container public xhtml document set body body set body html add element body set body return this xhtmldocument xhtmldocument setbody set_body addelement set_body append to the body element for this xhtml document container param value adds to the value between the body tags public xhtml document append body element value body add element value return this xhtmldocument xhtmldocument appendbody addelement append to the body element for this xhtml document container param value adds to the value between the body tags public xhtml document append body string value body add element value return this xhtmldocument xhtmldocument appendbody addelement get the title element for this xhtml document container public title get title return title xhtmldocument gettitle set the title element for this xhtml document container public xhtml document set title title set title head add element title set title return this xhtmldocument xhtmldocument settitle set_title addelement set_title append to the title element for this xhtml document container param value adds to the value between the title tags public xhtml document append title element value title add element value return this xhtmldocument xhtmldocument appendtitle addelement append to the title element for this xhtml document container param value adds to the value between the title tags public xhtml document append title string value title add element value return this xhtmldocument xhtmldocument appendtitle addelement sets the codeset for this xhtml document public void set codeset string codeset this codeset codeset xhtmldocument setcodeset gets the codeset for this xhtml document return the codeset public string get codeset return this codeset xhtmldocument getcodeset write the container to the output stream public void output output stream out if doctype null doctype output out try out write n catch exception e xhtml document is just a convient wrapper for html call html output html output out outputstream outputstream xhtmldocument write the container to the printe writer public void output print writer out if doctype null doctype output out try out write n catch exception e xhtml document is just a convient wrapper for html call html output html output out printewriter printwriter xhtmldocument override the to string method so that it prints something meaningful public final string to string string buffer sb new string buffer if get codeset null if doctype null sb append doctype to string get codeset sb append html to string get codeset return sb to string else if doctype null sb append doctype to string sb append html to string return sb to string tostring tostring stringbuffer stringbuffer getcodeset tostring getcodeset tostring getcodeset tostring tostring tostring tostring override the to string method so that it prints something meaningful public final string to string string codeset string buffer sb new string buffer if doctype null sb append doctype to string get codeset sb append html to string get codeset return sb to string tostring tostring stringbuffer stringbuffer tostring getcodeset tostring getcodeset tostring allows the document to be cloned doesn t return an instance of document returns instance of html note if you have a doctype set then it will be lost feel free to submit a patch to fix this it isn t trivial public object clone return html clone constructor param source source param total rows total rows param changed changed param auto save auto save param inserting inserting public data status event object source int total rows boolean changed boolean auto save boolean inserting super source m totalrows total rows m changed changed m autosave auto save m inserting inserting totalrows autosave datastatusevent totalrows autosave m_totalrows totalrows m_changed m_autosave autosave m_inserting set loaded info param loaded rows loaded rows public void set loading int loaded rows m allloaded false m loadedrows loaded rows loadedrows setloading loadedrows m_allloaded m_loadedrows loadedrows is loading return true if loading public boolean is loading return m allloaded isloading m_allloaded get loaded rows return loaded rows public int get loaded rows return m loadedrows getloadedrows m_loadedrows set current row zero based param current row current row public void set current row int current row m currentrow current row currentrow setcurrentrow currentrow m_currentrow currentrow get current row zero based return current roe public int get current row return m currentrow getcurrentrow m_currentrow get total rows return total rows public int get total rows return m totalrows gettotalrows m_totalrows set message info param ad message message param info info param is error error public void set info string ad message string info boolean is error boolean is warning m ad message ad message m info info m iserror is error m iswarning is warning ad_message iserror setinfo ad_message iserror iswarning m_ad_message ad_message m_info m_iserror iserror m_iswarning iswarning set inserting param inserting inserting public void set inserting boolean inserting m inserting inserting setinserting m_inserting are we inserting return true if inserting public boolean is inserting return m inserting isinserting m_inserting get message info return message public string getad message return m ad message getad_message m_ad_message get message info return info public string get info return m info getinfo m_info is this an error return true if error public boolean is error return m iserror iserror m_iserror is this a warning return true if warning public boolean is warning return m iswarning iswarning m_iswarning string representation of status return examples 1 20 1 256 2000 public string to string string buffer sb new string buffer data status event if m ad message null sb append m ad message if m info null sb append append m info sb append append get message return sb to string tostring stringbuffer stringbuffer datastatusevent m_ad_message m_ad_message m_info m_info getmessage tostring string representation of status pre 1 20 change automatic commit 1 20 change manual confirm 1 56 200 loading 1 20 normal 1 20 inserting changed automatic commit the row number is converted from zero based representation pre return status info public string get message string buffer ret value new string buffer if m inserting ret value append ret value append m changed m autosave current row if m totalrows 0 ret value append m currentrow else ret value append m currentrow 1 of ret value append if m allloaded ret value append m totalrows else ret value append m loadedrows append append m totalrows return ret value to string getmessage stringbuffer retvalue stringbuffer m_inserting retvalue retvalue m_changed m_autosave m_totalrows retvalue m_currentrow retvalue m_currentrow retvalue m_allloaded retvalue m_totalrows retvalue m_loadedrows m_totalrows retvalue tostring is data changed return true if changed public boolean is changed return m changed ischanged m_changed is first row zero based return true if first row public boolean is first row if m totalrows 0 return true return m currentrow 0 isfirstrow m_totalrows m_currentrow is last row zero based return true if last row public boolean is last row if m totalrows 0 return true return m currentrow m totalrows 1 islastrow m_totalrows m_currentrow m_totalrows set changed column param col column public void set changed column int col m changedcolumn col setchangedcolumn m_changedcolumn get changed column return changed column public int get changed column return m changedcolumn getchangedcolumn m_changedcolumn set confirmed toggle param confirmed confirmed public void set confirmed boolean confirmed m confirmed confirmed setconfirmed m_confirmed is confirmed e g user has seen it return true if confirmed public boolean is confirmed return m confirmed isconfirmed m_confirmed standard constructor public x r issuesystem properties ctx int r issuesystem id string trx name super ctx r issuesystem id trx name if r issuesystem id 0 setdb address null setr issuesystem id 0 set system status null x_r_issuesystem r_issuesystem_id trxname r_issuesystem_id trxname r_issuesystem_id setdbaddress setr_issuesystem_id setsystemstatus load constructor public x r issuesystem properties ctx result set rs string trx name super ctx rs trx name x_r_issuesystem resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issuesystem append get id append return sb to string tostring stringbuffer stringbuffer x_r_issuesystem get_id tostring set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set db address jdbc url of the database server public void setdb address string db address if db address null throw new illegal argument exception db address is mandatory if db address length 255 log warning length 255 truncated db address db address substring 0 254 set valuenocheck db address db address setdbaddress dbaddress dbaddress illegalargumentexception dbaddress dbaddress dbaddress dbaddress set_valuenocheck dbaddress dbaddress get db address jdbc url of the database server public string getdb address return string get value db address getdbaddress get_value dbaddress return string get value db address public key name pair get key name pair return new key name pair get id getdb address get_value dbaddress keynamepair getkeynamepair keynamepair get_id getdbaddress set profile information to help profiling the system for solving support issues public void set profile info string profile info if profile info null profile info length 60 log warning length 60 truncated profile info profile info substring 0 59 set valuenocheck profile info profile info setprofileinfo profileinfo profileinfo profileinfo profileinfo profileinfo set_valuenocheck profileinfo profileinfo get profile information to help profiling the system for solving support issues public string get profile info return string get value profile info getprofileinfo get_value profileinfo set issue system system creating the issue public void setr issuesystem id int r issuesystem id if r issuesystem id 1 throw new illegal argument exception r issuesystem id is mandatory set valuenocheck r issuesystem id new integer r issuesystem id setr_issuesystem_id r_issuesystem_id r_issuesystem_id illegalargumentexception r_issuesystem_id set_valuenocheck r_issuesystem_id r_issuesystem_id get issue system system creating the issue public int getr issuesystem id integer ii integer get value r issuesystem id if ii null return 0 return ii int value getr_issuesystem_id get_value r_issuesystem_id intvalue set statistics information to help profiling the system for solving support issues public void set statistics info string statistics info if statistics info null statistics info length 60 log warning length 60 truncated statistics info statistics info substring 0 59 set valuenocheck statistics info statistics info setstatisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo set_valuenocheck statisticsinfo statisticsinfo get statistics information to help profiling the system for solving support issues public string get statistics info return string get value statistics info getstatisticsinfo get_value statisticsinfo public static final string systemstatus production p set system status status of the system support priority depends on system status public void set system status string system status if system status null throw new illegal argument exception system status is mandatory if system status equals e system status equals i system status equals p else throw new illegal argument exception system status invalid value system status reference id 374 e i p if system status length 1 log warning length 1 truncated system status system status substring 0 0 set value system status system status systemstatus_production setsystemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus reference_id systemstatus systemstatus systemstatus set_value systemstatus systemstatus get system status status of the system support priority depends on system status public string get system status return string get value system status getsystemstatus get_value systemstatus standard constructor param ctx context param c projectphase id id public m project phase properties ctx int c projectphase id string trx name super ctx c projectphase id trx name if c projectphase id 0 setc projectphase id 0 pk setc project id 0 parent setc phase id 0 fk set committed amt env zero set is commit ceiling false set is complete false set seq no 0 set name null set qty env zero c_projectphase_id mprojectphase c_projectphase_id trxname c_projectphase_id trxname c_projectphase_id setc_projectphase_id setc_project_id setc_phase_id setcommittedamt setiscommitceiling setiscomplete setseqno setname setqty load constructor param ctx context param rs result set public m project phase properties ctx result set rs string trx name super ctx rs trx name mprojectphase resultset trxname trxname parent constructor param project parent public m project phase m project project this project get ctx 0 project get trxname set client org project setc project id project getc project id mprojectphase mproject getctx get_trxname setclientorg setc_project_id getc_project_id copy constructor param project parent param phase copy public m project phase m project project m project type phase phase this project setc phase id phase getc phase id fk set name phase get name set seq no phase get seq no set description phase get description set help phase get help if phase getm product id 0 setm product id phase getm product id set qty phase get standard qty mprojectphase mproject mprojecttypephase setc_phase_id getc_phase_id setname getname setseqno getseqno setdescription getdescription sethelp gethelp getm_product_id setm_product_id getm_product_id setqty getstandardqty get project phase tasks return array of tasks public m project task get tasks array list m project task list new array list m project task string sql select from c projecttask where c projectphase id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc projectphase id result set rs pstmt execute query while rs next list add new m project task get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project task ret value new m project task list size list to array ret value return ret value mprojecttask gettasks arraylist mprojecttask arraylist mprojecttask c_projecttask c_projectphase_id seqno preparedstatement preparestatement get_trxname setint getc_projectphase_id resultset executequery mprojecttask getctx get_trxname sqlexception sqlexception mprojecttask retvalue mprojecttask toarray retvalue retvalue copy tasks from other phase param from phase from phase return number of tasks copied public int copy tasks from m project phase from phase if from phase null return 0 int count 0 m project task my tasks get tasks m project task from tasks from phase get tasks copy project tasks for int i 0 i from tasks length i check if task already exists int c task id from tasks i getc task id boolean exists false if c task id 0 exists false else for int ii 0 ii my tasks length ii if my tasks ii getc task id c task id exists true break phase exist if exists log info task already exists here ignored from tasks i else m project task to task new m project task get ctx 0 get trxname po copy values from tasks i to task getad client id getad org id to task setc projectphase id getc projectphase id if to task save count if from tasks length count log warning count difference project phase from tasks length saved count return count fromphase copytasksfrom mprojectphase fromphase fromphase mprojecttask mytasks gettasks mprojecttask fromtasks fromphase gettasks fromtasks c_task_id fromtasks getc_task_id c_task_id mytasks mytasks getc_task_id c_task_id fromtasks mprojecttask totask mprojecttask getctx get_trxname copyvalues fromtasks totask getad_client_id getad_org_id totask setc_projectphase_id getc_projectphase_id totask fromtasks projectphase fromtasks copy tasks from other phase param from phase from phase return number of tasks copied public int copy tasks from m project type phase from phase if from phase null return 0 int count 0 copy type tasks m project type task from tasks from phase get tasks for int i 0 i from tasks length i m project task to task new m project task this from tasks i if to task save count log fine count from phase if from tasks length count log log level severe count difference type phase from tasks length saved count return count fromphase copytasksfrom mprojecttypephase fromphase fromphase mprojecttypetask fromtasks fromphase gettasks fromtasks mprojecttask totask mprojecttask fromtasks totask fromphase fromtasks typephase fromtasks standard constructor param ctx context param m attribute id id public m attribute properties ctx int m attribute id string trx name super ctx m attribute id trx name if m attribute id 0 set attribute value type attributevaluetype stringmax40 set is instance attribute false set is mandatory false m_attribute_id mattribute m_attribute_id trxname m_attribute_id trxname m_attribute_id setattributevaluetype attributevaluetype_stringmax40 setisinstanceattribute setismandatory load constructor param ctx context param rs result set public m attribute properties ctx result set rs string trx name super ctx rs trx name mattribute resultset trxname trxname get values if list return values or null if not list public m attribute value getm attribute values if m values null attributevaluetype list equals get attribute value type array list m attribute value list new array list m attribute value if is mandatory list add null string sql select from m attributevalue where m attribute id order by value prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm attribute id result set rs pstmt execute query while rs next list add new m attribute value get ctx rs null rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m values new m attribute value list size list to array m values return m values mattributevalue getmattributevalues m_values attributevaluetype_list getattributevaluetype arraylist mattributevalue arraylist mattributevalue ismandatory m_attributevalue m_attribute_id preparedstatement preparestatement setint getm_attribute_id resultset executequery mattributevalue getctx sqlexception sqlexception m_values mattributevalue toarray m_values m_values get attribute instance param m attributesetinstance id attribute set instance return attribute instance or null public m attribute instance getm attribute instance int m attributesetinstance id m attribute instance ret value null string sql select from m attributeinstance where m attribute id and m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm attribute id pstmt set int 2 m attributesetinstance id result set rs pstmt execute query if rs next ret value new m attribute instance get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return ret value m_attributesetinstance_id mattributeinstance getmattributeinstance m_attributesetinstance_id mattributeinstance retvalue m_attributeinstance m_attribute_id m_attributesetinstance_id preparedstatement preparestatement get_trxname setint getm_attribute_id setint m_attributesetinstance_id resultset executequery retvalue mattributeinstance getctx get_trxname sqlexception sqlexception retvalue set attribute instance param value value param m attributesetinstance id id public void setm attribute instance int m attributesetinstance id m attribute value value m attribute instance instance getm attribute instance m attributesetinstance id if instance null if value null instance new m attribute instance get ctx getm attribute id m attributesetinstance id value getm attributevalue id value get name get trxname cached else instance new m attribute instance get ctx getm attribute id m attributesetinstance id 0 null get trxname else if value null instance setm attributevalue id value getm attributevalue id instance set value value get name cached else instance setm attributevalue id 0 instance set value null instance save m_attributesetinstance_id setmattributeinstance m_attributesetinstance_id mattributevalue mattributeinstance getmattributeinstance m_attributesetinstance_id mattributeinstance getctx getm_attribute_id m_attributesetinstance_id getm_attributevalue_id getname get_trxname mattributeinstance getctx getm_attribute_id m_attributesetinstance_id get_trxname setm_attributevalue_id getm_attributevalue_id setvalue getname setm_attributevalue_id setvalue set attribute instance param value string value param m attributesetinstance id id public void setm attribute instance int m attributesetinstance id string value m attribute instance instance getm attribute instance m attributesetinstance id if instance null instance new m attribute instance get ctx getm attribute id m attributesetinstance id value get trxname else instance set value value instance save m_attributesetinstance_id setmattributeinstance m_attributesetinstance_id mattributeinstance getmattributeinstance m_attributesetinstance_id mattributeinstance getctx getm_attribute_id m_attributesetinstance_id get_trxname setvalue set attribute instance param value number value param m attributesetinstance id id public void setm attribute instance int m attributesetinstance id big decimal value m attribute instance instance getm attribute instance m attributesetinstance id if instance null instance new m attribute instance get ctx getm attribute id m attributesetinstance id value get trxname else instance set value number value instance save m_attributesetinstance_id setmattributeinstance m_attributesetinstance_id bigdecimal mattributeinstance getmattributeinstance m_attributesetinstance_id mattributeinstance getctx getm_attribute_id m_attributesetinstance_id get_trxname setvaluenumber string representation return info public string to string string buffer sb new string buffer m attribute sb append get id append append get name append type append get attribute value type append instance append is instance attribute append return sb to string tostring stringbuffer stringbuffer mattribute get_id getname getattributevaluetype isinstanceattribute tostring after save param new record new param success success return success protected boolean after save boolean new record boolean success changed to instance attribute if new record is valuechanged is instance attribute is instance attribute string sql update m attributeset mas set is instance attribute y where is instance attribute n and exists select from m attributeuse mau where mas m attributeset id mau m attributeset id and mau m attribute id getm attribute id int no db execute update sql get trxname log fine attribute set instance set no return success aftersave newrecord aftersave newrecord newrecord is_valuechanged isinstanceattribute isinstanceattribute m_attributeset isinstanceattribute isinstanceattribute m_attributeuse m_attributeset_id m_attributeset_id m_attribute_id getm_attribute_id executeupdate get_trxname attributeset constructor param wu web user param wb web basket param ctx context public web order web user wu web basket wb properties ctx m ctx ctx create order wu wb weborder webuser webbasket m_ctx createorder constructor param order existing order public web order m order order m ctx order get ctx m order order weborder morder m_ctx getctx m_order create order from basket param wu web user param wb web basket return true if created processed private boolean create order web user wu web basket wb m order new m order m ctx 0 null log fine ad client id m order getad client id ad org id m order getad org id m order m order setc doctypetarget id m order docsubtypeso prepay m order set payment rule m order paymentrule creditcard m order set delivery rule m order deliveryrule afterreceipt m order set invoice rule m order invoicerule immediate m order set is self service true if wb getm pricelist id 0 m order setm pricelist id wb getm pricelist id if wb getsalesrep id 0 m order setsalesrep id wb getsalesrep id b partner m order setc bpartner id wu getc bpartner id m order setc bpartner location id wu getc bpartner location id m order setad user id wu getad user id m order set sende mail true m order set doc action m order docaction prepare m order save log fine id m order getc order id doc no m order get document no array list lines wb get lines for int i 0 i lines size i web basket line wbl web basket line lines get i m order line ol new m order line m order ol setm product id wbl getm product id true ol set qty wbl get quantity ol set price ol set price wbl get price ol set tax ol save for all lines boolean ok m order process it m order docaction prepare m order save web user customer if wu is customer log info wu is customer wu set is customer true wu save log info wu is customer big decimal amt m order get grand total log info amt amt return ok createorder webuser webbasket m_order morder m_ctx ad_client_id m_order getad_client_id ad_org_id m_order getad_org_id m_order m_order setc_doctypetarget_id morder docsubtypeso_prepay m_order setpaymentrule morder paymentrule_creditcard m_order setdeliveryrule morder deliveryrule_afterreceipt m_order setinvoicerule morder invoicerule_immediate m_order setisselfservice getm_pricelist_id m_order setm_pricelist_id getm_pricelist_id getsalesrep_id m_order setsalesrep_id getsalesrep_id bpartner m_order setc_bpartner_id getc_bpartner_id m_order setc_bpartner_location_id getc_bpartner_location_id m_order setad_user_id getad_user_id m_order setsendemail m_order setdocaction morder docaction_prepare m_order m_order getc_order_id docno m_order getdocumentno arraylist getlines webbasketline webbasketline morderline morderline m_order setm_product_id getm_product_id setqty getquantity setprice setprice getprice settax m_order processit morder docaction_prepare m_order iscustomer iscustomer setiscustomer iscustomer bigdecimal m_order getgrandtotal string representation return info public string to string string buffer sb new string buffer web order sb append m order append return sb to string tostring stringbuffer stringbuffer weborder m_order tostring process complete order param payment payment return true if processed public boolean process m payment payment if m order null return false if payment get id 0 payment save m order setc payment id payment getc payment id m order set doc action m order docaction waitcomplete boolean ok m order process it m order docaction waitcomplete m order save payment setc order id m order getc order id payment setc invoice id getinvoice id return ok mpayment m_order get_id m_order setc_payment_id getc_payment_id m_order setdocaction morder docaction_waitcomplete m_order processit morder docaction_waitcomplete m_order setc_order_id m_order getc_order_id setc_invoice_id getinvoice_id get order id return id public int getc order id if m order null return m order getc order id return 0 getc_order_id m_order m_order getc_order_id get order org id return id public int getad org id if m order null return m order getad org id return 0 getad_org_id m_order m_order getad_org_id is order completed return true if completed or closed public boolean is completed if m order null return false return m order status completed equals m order get doc status m order status closed equals m order get doc status iscompleted m_order morder status_completed m_order getdocstatus morder status_closed m_order getdocstatus is order in progress return true if in progress public boolean is in progress if m order null return false return m order docstatus inprogress equals m order get doc status isinprogress m_order morder docstatus_inprogress m_order getdocstatus get document no return document no public string get document no return m order get document no getdocumentno m_order getdocumentno public big decimal get total lines return m order get total lines bigdecimal gettotallines m_order gettotallines public big decimal get freight amt return m order get freight amt bigdecimal getfreightamt m_order getfreightamt public big decimal get tax amt return m order get grand total subtract m order get total lines subtract m order get freight amt bigdecimal gettaxamt m_order getgrandtotal m_order gettotallines m_order getfreightamt subtract m order get freight amt public big decimal get grand total return m order get grand total m_order getfreightamt bigdecimal getgrandtotal m_order getgrandtotal return m order get grand total public int getsalesrep id return m order getsalesrep id m_order getgrandtotal getsalesrep_id m_order getsalesrep_id protected m order get order return m order morder getorder m_order get invoice info return invoice document no public string get invoice info if m invoiceinfo null m invoice invoices m order get invoices int length invoices length if length 0 get last invoice m c invoice id invoices length 1 getc invoice id m invoiceinfo invoices length 1 get document no return m invoiceinfo getinvoiceinfo m_invoiceinfo minvoice m_order getinvoices m_c_invoice_id getc_invoice_id m_invoiceinfo getdocumentno m_invoiceinfo get invoice id return c invoice id public int getinvoice id if m c invoice id 1 get invoice info return m c invoice id c_ invoice_id getinvoice_id m_c_invoice_id getinvoiceinfo m_c_invoice_id get currency id return currency id public int getc currency id if m order null return 0 return m order getc currency id getc_currency_id m_order m_order getc_currency_id get iso code of currency return currency iso public string get currencyiso if m order null return return m currency getiso code m ctx m order getc currency id getcurrencyiso m_order mcurrency getiso_code m_ctx m_order getc_currency_id standard constructor public x c bankaccount properties ctx int c bankaccount id string trx name super ctx c bankaccount id trx name if c bankaccount id 0 set account no null set bank account type null setc bankaccount id 0 setc bank id 0 setc currency id 0 set credit limit env zero set current balance env zero set is default false x_c_bankaccount c_bankaccount_id trxname c_bankaccount_id trxname c_bankaccount_id setaccountno setbankaccounttype setc_bankaccount_id setc_bank_id setc_currency_id setcreditlimit setcurrentbalance setisdefault load constructor public x c bankaccount properties ctx result set rs string trx name super ctx rs trx name x_c_bankaccount resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankaccount append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankaccount get_id tostring set account no account number public void set account no string account no if account no null throw new illegal argument exception account no is mandatory if account no length 20 log warning length 20 truncated account no account no substring 0 19 set value account no account no setaccountno accountno accountno illegalargumentexception accountno accountno accountno accountno set_value accountno accountno get account no account number public string get account no return string get value account no getaccountno get_value accountno set bban basic bank account number public void setbban string bban if bban null bban length 40 log warning length 40 truncated bban bban substring 0 39 set value bban bban set_value get bban basic bank account number public string getbban return string get value bban get_value public static final string bankaccounttype savings s set bank account type bank account type public void set bank account type string bank account type if bank account type null throw new illegal argument exception bank account type is mandatory if bank account type equals c bank account type equals s else throw new illegal argument exception bank account type invalid value bank account type reference id 216 c s if bank account type length 1 log warning length 1 truncated bank account type bank account type substring 0 0 set value bank account type bank account type bankaccounttype_savings setbankaccounttype bankaccounttype bankaccounttype illegalargumentexception bankaccounttype bankaccounttype bankaccounttype illegalargumentexception bankaccounttype bankaccounttype reference_id bankaccounttype bankaccounttype bankaccounttype set_value bankaccounttype bankaccounttype get bank account type bank account type public string get bank account type return string get value bank account type getbankaccounttype get_value bankaccounttype set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set valuenocheck c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_valuenocheck c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set bank bank public void setc bank id int c bank id if c bank id 1 throw new illegal argument exception c bank id is mandatory set valuenocheck c bank id new integer c bank id setc_bank_id c_bank_id c_bank_id illegalargumentexception c_bank_id set_valuenocheck c_bank_id c_bank_id get bank bank public int getc bank id integer ii integer get value c bank id if ii null return 0 return ii int value getc_bank_id get_value c_bank_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc bank id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_bank_id set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set credit limit amount of credit allowed public void set credit limit big decimal credit limit if credit limit null throw new illegal argument exception credit limit is mandatory set value credit limit credit limit setcreditlimit bigdecimal creditlimit creditlimit illegalargumentexception creditlimit set_value creditlimit creditlimit get credit limit amount of credit allowed public big decimal get credit limit big decimal bd big decimal get value credit limit if bd null return env zero return bd bigdecimal getcreditlimit bigdecimal bigdecimal get_value creditlimit set current balance current balance public void set current balance big decimal current balance if current balance null throw new illegal argument exception current balance is mandatory set value current balance current balance setcurrentbalance bigdecimal currentbalance currentbalance illegalargumentexception currentbalance set_value currentbalance currentbalance get current balance current balance public big decimal get current balance big decimal bd big decimal get value current balance if bd null return env zero return bd bigdecimal getcurrentbalance bigdecimal bigdecimal get_value currentbalance set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set iban international bank account number public void setiban string iban if iban null iban length 40 log warning length 40 truncated iban iban substring 0 39 set value iban iban set_value get iban international bank account number public string getiban return string get value iban get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception note servlet init servletexception servletconfig servletexception webenv initweb servletexception noteservlet get servlet information return info public string get servlet info return a dempiere web note servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request attachment download request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr string url notes jsp http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter note id if is valid and belongs to wu then create pdf stream it string msg stream attachment request response if msg null msg length 0 return if info null info set message msg log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession getattribute removeattribute websessionctx hdr_message getattribute setmessage note_id streamattachment setmessage requestdispatcher getservletcontext getrequestdispatcher stream attachment param request request param response response return or error message private string stream attachment http servlet request request http servlet response response get note id int ad note id web util get parameter as int request p note id if ad note id 0 log fine no ad note id return no notice id int attachment index web util get parameter as int request p attachment index if attachment index 0 log fine no index return no request attachment index log info ad notice id ad note id attachment index get note properties ctx jsp env get ctx request m note doc new m note ctx ad note id null if doc getad note id ad note id log fine note not found id ad note id return notice not found m attachment attachment doc get attachment false if attachment null log fine no attachment for ad note id ad note id return notice attachment not found get web user compare with invoice http session session request get session true web user wu web user session get attribute web user name if wu getad user id doc getad user id log warning ad note id ad note id user id doc getad user id web user wu getad user id return your notice not found stream it return web util stream attachment response attachment attachment index streamattachment httpservletrequest httpservletresponse ad_note_id webutil getparameterasint p_note_id ad_note_id ad_note_id attachmentindex webutil getparameterasint p_attachment_index attachmentindex ad_notice_id ad_note_id attachmentindex jspenv getctx mnote mnote ad_note_id getad_note_id ad_note_id ad_note_id mattachment getattachment ad_note_id ad_note_id webuser httpsession getsession webuser webuser getattribute webuser getad_user_id getad_user_id ad_note_id ad_note_id user_id getad_user_id web_user getad_user_id webutil streamattachment attachmentindex process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr string url notes jsp get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to notes jsp entry return web env dump request int ad note id web util get parameter as int request p note id string processed web util get parameter request processed boolean prc processed null processed length 0 if prc m note note new m note ctx ad note id null if note get id ad note id note set processed true note save log fine do post note redisplay log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser sendredirect loginservlet forwardto webenv ad_note_id webutil getparameterasint p_note_id webutil getparameter mnote mnote ad_note_id get_id ad_note_id setprocessed dopost requestdispatcher getservletcontext getrequestdispatcher standard constructor public x gl journalline properties ctx int gl journalline id string trx name super ctx gl journalline id trx name if gl journalline id 0 set amt acct cr env zero set amt acct dr env zero set amt source cr env zero set amt source dr env zero setc conversiontype id 0 setc currency id 0 c currency id setc validcombination id 0 set currency rate env zero currency rate 1 set date acct new timestamp system current time millis date acct setgl journalline id 0 setgl journal id 0 set is generated false set line 0 sql select nvl max line 0 10 as default value from gl journalline where gl journal id gl journal id set processed false x_gl_journalline gl_journalline_id trxname gl_journalline_id trxname gl_journalline_id setamtacctcr setamtacctdr setamtsourcecr setamtsourcedr setc_conversiontype_id setc_currency_id c_currency_id setc_validcombination_id setcurrencyrate currencyrate setdateacct currenttimemillis dateacct setgl_journalline_id setgl_journal_id setisgenerated setline defaultvalue gl_journalline gl_journal_id gl_journal_id setprocessed load constructor public x gl journalline properties ctx result set rs string trx name super ctx rs trx name x_gl_journalline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl journalline append get id append return sb to string tostring stringbuffer stringbuffer x_gl_journalline get_id tostring set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr if amt acct cr null throw new illegal argument exception amt acct cr is mandatory set valuenocheck amt acct cr amt acct cr setamtacctcr bigdecimal amtacctcr amtacctcr illegalargumentexception amtacctcr set_valuenocheck amtacctcr amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr if amt acct dr null throw new illegal argument exception amt acct dr is mandatory set valuenocheck amt acct dr amt acct dr setamtacctdr bigdecimal amtacctdr amtacctdr illegalargumentexception amtacctdr set_valuenocheck amtacctdr amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set source credit source credit amount public void set amt source cr big decimal amt source cr if amt source cr null throw new illegal argument exception amt source cr is mandatory set value amt source cr amt source cr setamtsourcecr bigdecimal amtsourcecr amtsourcecr illegalargumentexception amtsourcecr set_value amtsourcecr amtsourcecr get source credit source credit amount public big decimal get amt source cr big decimal bd big decimal get value amt source cr if bd null return env zero return bd bigdecimal getamtsourcecr bigdecimal bigdecimal get_value amtsourcecr set source debit source debit amount public void set amt source dr big decimal amt source dr if amt source dr null throw new illegal argument exception amt source dr is mandatory set value amt source dr amt source dr setamtsourcedr bigdecimal amtsourcedr amtsourcedr illegalargumentexception amtsourcedr set_value amtsourcedr amtsourcedr get source debit source debit amount public big decimal get amt source dr big decimal bd big decimal get value amt source dr if bd null return env zero return bd bigdecimal getamtsourcedr bigdecimal bigdecimal get_value amtsourcedr set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 1 throw new illegal argument exception c conversiontype id is mandatory set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id illegalargumentexception c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set combination valid account combination public void setc validcombination id int c validcombination id if c validcombination id 1 throw new illegal argument exception c validcombination id is mandatory set value c validcombination id new integer c validcombination id setc_validcombination_id c_validcombination_id c_validcombination_id illegalargumentexception c_validcombination_id set_value c_validcombination_id c_validcombination_id get combination valid account combination public int getc validcombination id integer ii integer get value c validcombination id if ii null return 0 return ii int value getc_validcombination_id get_value c_validcombination_id intvalue set rate currency conversion rate public void set currency rate big decimal currency rate if currency rate null throw new illegal argument exception currency rate is mandatory set valuenocheck currency rate currency rate setcurrencyrate bigdecimal currencyrate currencyrate illegalargumentexception currencyrate set_valuenocheck currencyrate currencyrate get rate currency conversion rate public big decimal get currency rate big decimal bd big decimal get value currency rate if bd null return env zero return bd bigdecimal getcurrencyrate bigdecimal bigdecimal get_value currencyrate set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set journal line general ledger journal line public void setgl journalline id int gl journalline id if gl journalline id 1 throw new illegal argument exception gl journalline id is mandatory set valuenocheck gl journalline id new integer gl journalline id setgl_journalline_id gl_journalline_id gl_journalline_id illegalargumentexception gl_journalline_id set_valuenocheck gl_journalline_id gl_journalline_id get journal line general ledger journal line public int getgl journalline id integer ii integer get value gl journalline id if ii null return 0 return ii int value getgl_journalline_id get_value gl_journalline_id intvalue set journal general ledger journal public void setgl journal id int gl journal id if gl journal id 1 throw new illegal argument exception gl journal id is mandatory set valuenocheck gl journal id new integer gl journal id setgl_journal_id gl_journal_id gl_journal_id illegalargumentexception gl_journal_id set_valuenocheck gl_journal_id gl_journal_id get journal general ledger journal public int getgl journal id integer ii integer get value gl journal id if ii null return 0 return ii int value getgl_journal_id get_value gl_journal_id intvalue set generated this line is generated public void set is generated boolean is generated set valuenocheck is generated new boolean is generated setisgenerated isgenerated set_valuenocheck isgenerated isgenerated get generated this line is generated public boolean is generated object oo get value is generated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isgenerated get_value isgenerated booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value assignment dialog pre creates a new assignment oor displays an assignment create new id 0 check availability create assignment confirmed when order incoice time expense is processed alternatively let info resource do the assignment return id existing assignment id 0 if confirmed no change ability to delete or change assignment return id pre param frame parent param m assignment assignment param allow zoom allow to zoom to schedule param allow delete allow to delete recorde public v assignment dialog frame frame m resource assignment m assignment boolean allow zoom boolean allow delete super frame msg get msg env get ctx v assignment dialog true log config m assignment to string m massignment m assignment m frame frame try jb init if allow zoom confirm panel get zoom button set visible false delete set visible allow delete catch exception e log log level severe e set display from m assignment a env show center screen this timeexpense inforesource massignment allowzoom allowdelete vassignmentdialog mresourceassignment massignment allowzoom allowdelete getmsg getctx vassignmentdialog massignment tostring m_massignment massignment m_frame jbinit allowzoom confirmpanel getzoombutton setvisible setvisible allowdelete setdisplay massignment aenv showcenterscreen static init throws exception private void jb init throws exception this set default close operation window constants dispose on close f resource add action listener this delete add action listener this confirm panel add button delete confirm panel add action listener this main panel set layout main layout main panel add l resource new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 8 8 4 4 0 0 main panel add f resource new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 8 0 4 4 0 0 main panel add l date new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 8 4 4 0 0 main panel add f date from new grid bag constraints 1 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 0 4 8 100 0 main panel add l qty new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 8 4 4 0 0 main panel add f qty new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 2 0 4 4 0 0 main panel add luom new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 4 4 8 0 0 main panel add l name new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 8 4 4 0 0 main panel add l description new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 8 8 4 0 0 main panel add f name new grid bag constraints 1 3 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 0 4 8 0 0 main panel add f description new grid bag constraints 1 4 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 0 8 8 0 0 this get content pane add main panel border layout center this get content pane add confirm panel border layout south jbinit setdefaultcloseoperation windowconstants dispose_on_close fresource addactionlistener addactionlistener confirmpanel addbutton confirmpanel addactionlistener mainpanel setlayout mainlayout mainpanel lresource gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fresource gridbagconstraints gridbagconstraints gridbagconstraints mainpanel ldate gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fdatefrom gridbagconstraints gridbagconstraints gridbagconstraints mainpanel lqty gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fqty gridbagconstraints gridbagconstraints gridbagconstraints mainpanel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel lname gridbagconstraints gridbagconstraints gridbagconstraints mainpanel ldescription gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fname gridbagconstraints gridbagconstraints gridbagconstraints mainpanel fdescription gridbagconstraints gridbagconstraints gridbagconstraints getcontentpane mainpanel borderlayout getcontentpane confirmpanel borderlayout initialize component values from m massignment private void set display m setting true set resource int s resource id m massignment gets resource id key name pair resources new key name pair m lookup size m lookup key set to array resources for int i 0 i resources length i if resources i get key s resource id f resource set selected item resources i break key name pair check key name pair f resource get selected item if check null check get key s resource id if m massignment gets resourceassignment id 0 new record select first f resource set selected item f resource get selected item initiates uom display else log log level severe resource not found id s resource id set date qty f date from set value m massignment get assign date from f qty set value m massignment get qty name description f name set value m massignment get name f description set value m massignment get description set editor to r o if confirmed boolean read write true if m massignment is confirmed read write false confirm panel get cancel button set visible read write f resource set read write read write f date from set read write read write f qty set read write read write m setting false m_massignment setdisplay m_setting s_resource_id m_massignment gets_resource_id keynamepair keynamepair m_lookup m_lookup keyset toarray getkey s_resource_id fresource setselecteditem keynamepair keynamepair fresource getselecteditem getkey s_resource_id m_massignment gets_resourceassignment_id fresource setselecteditem fresource getselecteditem s_resource_id fdatefrom setvalue m_massignment getassigndatefrom fqty setvalue m_massignment getqty fname setvalue m_massignment getname fdescription setvalue m_massignment getdescription readwrite m_massignment isconfirmed readwrite confirmpanel getcancelbutton setvisible readwrite fresource setreadwrite readwrite fdatefrom setreadwrite readwrite fqty setreadwrite readwrite m_setting action listener param e event public void action performed action event e if m setting return update assignment key name pair resource key name pair f resource get selected item if resource null int s resource id resource get key m massignment sets resource id s resource id timestamp assign date from f date from get timestamp if assign date from null m massignment set assign date from assign date from big decimal qty big decimal f qty get value if qty null m massignment set qty qty m massignment set name string f name get value m massignment set description string f description get value resource look up uom if e get source f resource object o m lookup get f resource get selected item if o null luom set text else luom set text o to string zoom info resource else if e get action command equals confirm panel a zoom info schedule is new info schedule m frame m massignment true if is getm resource assignment null m massignment is getm resource assignment set display dispose is null cancel return else if e get action command equals confirm panel a cancel dispose delete delete and return else if e get action command equals confirm panel a delete if m massignment delete true m massignment null dispose else a dialog error 0 this resource assignment not deleted ok save else if e get action command equals confirm panel a ok if cmd save dispose actionperformed actionevent m_setting keynamepair keynamepair fresource getselecteditem s_resource_id getkey m_massignment sets_resource_id s_resource_id assigndatefrom fdatefrom gettimestamp assigndatefrom m_massignment setassigndatefrom assigndatefrom bigdecimal bigdecimal fqty getvalue m_massignment setqty m_massignment setname fname getvalue m_massignment setdescription fdescription getvalue getsource fresource m_lookup fresource getselecteditem settext settext tostring inforesource getactioncommand confirmpanel a_zoom infoschedule infoschedule m_frame m_massignment getmresourceassignment m_massignment getmresourceassignment setdisplay getactioncommand confirmpanel a_cancel getactioncommand confirmpanel a_delete m_massignment m_massignment adialog resourceassignmentnotdeleted getactioncommand confirmpanel a_ok cmd_save get assignment return assignment public m resource assignment getm resource assignment return m massignment mresourceassignment getmresourceassignment m_massignment check availability and insert record return true if saved updated private boolean cmd save log config set assign date to timestamp assign date from f date from get timestamp big decimal qty big decimal f qty get value key name pair uom key name pair m lookup get f resource get selected item int minutes muom conversion convert to minutes env get ctx uom get key qty timestamp assign date to time util add minutess assign date from minutes m massignment set assign date to assign date to m massignment dump return m massignment save cmd_save assigndateto assigndatefrom fdatefrom gettimestamp bigdecimal bigdecimal fqty getvalue keynamepair keynamepair m_lookup fresource getselecteditem muomconversion converttominutes getctx getkey assigndateto timeutil addminutess assigndatefrom m_massignment setassigndateto assigndateto m_massignment m_massignment load resources called from variable constructor return array with resources private key name pair get resources if m lookup size 0 string sql m role get default add accesssql select r s resource id r name r is active 1 3 uom c uom id uom uom symbol 4 5 from s resource r s resourcetype rt c uom uom where r s resourcetype id rt s resourcetype id and rt c uom id uom c uom id r m role sql fullyqualified m role sql ro try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next string buffer sb new string buffer rs get string 2 if y equals rs get string 3 sb insert 0 append inactive marker key s resource id name key name pair key new key name pair rs get int 1 sb to string value c uom id name key name pair value new key name pair rs get int 4 rs get string 5 trim m lookup put key value rs close pstmt close catch sql exception e log log level severe sql e convert to array key name pair ret value new key name pair m lookup size m lookup key set to array ret value arrays sort ret value return ret value keynamepair getresources m_lookup mrole getdefault addaccesssql s_resource_id isactive c_uom_id uomsymbol s_resource s_resourcetype c_uom s_resourcetype_id s_resourcetype_id c_uom_id c_uom_id mrole sql_fullyqualified mrole sql_ro preparedstatement preparestatement resultset executequery stringbuffer stringbuffer getstring getstring s_resource_id keynamepair keynamepair getint tostring c_uom_id keynamepair keynamepair getint getstring m_lookup sqlexception keynamepair retvalue keynamepair m_lookup m_lookup keyset toarray retvalue retvalue retvalue get m hierarchy from cache param ctx context param pa hierarchy id id return m hierarchy public static m hierarchy get properties ctx int pa hierarchy id integer key new integer pa hierarchy id m hierarchy ret value m hierarchy s cache get key if ret value null return ret value ret value new m hierarchy ctx pa hierarchy id null if ret value get id 0 s cache put key ret value return ret value mhierarchy pa_hierarchy_id mhierarchy mhierarchy pa_hierarchy_id pa_hierarchy_id mhierarchy retvalue mhierarchy s_cache retvalue retvalue retvalue mhierarchy pa_hierarchy_id retvalue get_id s_cache retvalue retvalue default constructor param ctx context param pa hierarchy id id param trx name trx public m hierarchy properties ctx int pa hierarchy id string trx name super ctx pa hierarchy id trx name pa_hierarchy_id trxname mhierarchy pa_hierarchy_id trxname pa_hierarchy_id trxname load constructor param ctx context param rs result set param trx name trx public m hierarchy properties ctx result set rs string trx name super ctx rs trx name trxname mhierarchy resultset trxname trxname get ad tree id based on tree type param tree type tree type return id or 0 public int getad tree id string tree type if m tree treetype activity equals tree type return getad tree activity id if m tree treetype bpartner equals tree type return getad tree bpartner id if m tree treetype campaign equals tree type return getad tree campaign id if m tree treetype elementvalue equals tree type return getad tree account id if m tree treetype organization equals tree type return getad tree org id if m tree treetype product equals tree type return getad tree product id if m tree treetype project equals tree type return getad tree project id if m tree treetype salesregion equals tree type return getad tree salesregion id log warning not supported tree type return 0 ad_tree_id treetype getad_tree_id treetype mtree treetype_activity treetype getad_tree_activity_id mtree treetype_bpartner treetype getad_tree_bpartner_id mtree treetype_campaign treetype getad_tree_campaign_id mtree treetype_elementvalue treetype getad_tree_account_id mtree treetype_organization treetype getad_tree_org_id mtree treetype_product treetype getad_tree_product_id mtree treetype_project treetype getad_tree_project_id mtree treetype_salesregion treetype getad_tree_salesregion_id treetype get bom from cache param ctx context param m bom id id return mbom public static mbom get properties ctx int m bom id integer key new integer m bom id mbom ret value mbom s cache get key if ret value null return ret value ret value new mbom ctx m bom id null if ret value get id 0 s cache put key ret value return ret value m_bom_id m_bom_id m_bom_id retvalue s_cache retvalue retvalue retvalue m_bom_id retvalue get_id s_cache retvalue retvalue get bo ms of product param ctx context param m product id product param trx name trx param where clause optional where clause w o and return array of bo ms public static mbom get of product properties ctx int m product id string trx name string where clause array list mbom list new array list mbom string sql select from m bom where m product id if where clause null where clause length 0 sql and where clause prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new mbom ctx rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null mbom ret value new mbom list size list to array ret value return ret value boms m_product_id trxname whereclause boms getofproduct m_product_id trxname whereclause arraylist arraylist m_bom m_product_id whereclause whereclause whereclause preparedstatement preparestatement trxname setint m_product_id resultset executequery trxname retvalue toarray retvalue retvalue standard constructor param ctx context param m bom id id param trx name trx public mbom properties ctx int m bom id string trx name super ctx m bom id trx name if m bom id 0 setm product id 0 set name null setbom type bomtype currentactive a setbom use bomuse master a m_bom_id trxname m_bom_id trxname m_bom_id trxname m_bom_id setm_product_id setname setbomtype bomtype_currentactive setbomuse bomuse_master load constructor param ctx ctx param rs result set param trx name trx public mbom properties ctx result set rs string trx name super ctx rs trx name trxname resultset trxname trxname before save param new record new return true false protected boolean before save boolean new record bom type if new record is valuechanged bom type only one current active if getbom type equals bomtype currentactive mbom boms get of product get ctx getm product id get trxname bom type a and bom use getbom use and is active y if boms length 0 only one this boms length 1 boms 0 getm bom id getm bom id else log save error error msg parse translation get ctx can only have one current active bom for product bom use getbom type return false only one mto else if getbom type equals bomtype make to order mbom boms get of product get ctx getm product id get trxname is active y if boms length 0 only one this boms length 1 boms 0 getm bom id getm bom id else log save error error msg parse translation get ctx can only have single make to order bom for product return false bom type return true newrecord beforesave newrecord newrecord is_valuechanged bomtype getbomtype bomtype_currentactive getofproduct getctx getm_product_id get_trxname bomtype bomuse getbomuse isactive getm_bom_id getm_bom_id saveerror parsetranslation getctx getbomtype getbomtype bomtype_make_to_order getofproduct getctx getm_product_id get_trxname isactive getm_bom_id getm_bom_id saveerror parsetranslation getctx print preview param layout layout public view layout engine layout m layout layout layoutengine m_layout minimum size return max page size public dimension get minimum size return get maximum size getminimumsize getmaximumsize minimum size return max page size public dimension get maximum size return new dimension get paper width 2 margin get paper height margin get page count margin getmaximumsize getpaperwidth getpaperheight getpagecount preferred size return max page size public dimension get preferred size return get maximum size getpreferredsize getmaximumsize is archivable return true if archivable public boolean is archivable return archive engine is valid m layout isarchivable archiveengine isvalid m_layout paint component param g graphics public void paint component graphics g log fine view paint component g get clip graphics2d g2d graphics2d g rectangle bounds g2d get clip bounds g2d set color color background g2d fill rect bounds x bounds y bounds width bounds height for all pages for int page 0 page m layout get pages size page rectangle page rectangle get rectangle of page page 1 if bounds intersects page rectangle page p page m layout get pages get page p paint g2d page rectangle true false sets context m layout get header footer paint g2d page rectangle true paint page for all pages paintcomponent paintcomponent getclip getclipbounds setcolor color_background fillrect m_layout getpages pagerectangle getrectangleofpage pagerectangle m_layout getpages pagerectangle m_layout getheaderfooter pagerectangle set zoom level param level zoom level public void set zoom level int level m zoomlevel level setzoomlevel m_zoomlevel set zoom level param level string zoom level string public void set zoom level string level string for int i 0 i zoom options length i if zoom options i equals level string m zoomlevel i break levelstring setzoomlevel levelstring zoom_options zoom_options levelstring m_zoomlevel get zoom level return zoom level public int get zoom level return m zoomlevel getzoomlevel m_zoomlevel get rectange of page param page no page no return rectangle public rectangle get rectangle of page int page no int y margin page no 1 get paper height margin return new rectangle margin y get paper width get paper height pageno getrectangleofpage pageno pageno getpaperheight getpaperwidth getpaperheight get page at point param p point return page as float to determine also position on page public float get page no at point p float y p y float page height get paper height margin return 1f y page height getpagenoat pageheight getpaperheight pageheight get page count return page count public int get page count return m layout get pages size getpagecount m_layout getpages get page info for multi page tables param page no page return info e g 1 1 public string get page info int page no return m layout get page info page no pageno getpageinfo pageno m_layout getpageinfo pageno get max page info for multi page tables return info e g 3 2 public string get page info max return m layout get page info max getpageinfomax m_layout getpageinfomax get paper return paper public c paper get paper return m layout get paper cpaper getpaper m_layout getpaper get paper height return paper height public int get paper height return int m layout get paper get height true getpaperheight m_layout getpaper getheight get paper height return paper height public int get paper width return int m layout get paper get width true getpaperwidth m_layout getpaper getwidth get drill down param absolute point point return drill down public m query get drill down point absolute point int page no int get page no at absolute point rectangle page rectangle get rectangle of page page no point relative point new point absolute point x page rectangle x absolute point y page rectangle y page page page m layout get pages get page no 1 log config relative relative point page log config absolute point absolute point page no page no page rectangle page rectangle m query ret value page get drill down relative point if ret value null ret value m layout get header footer get drill down relative point return ret value absolutepoint mquery getdrilldown absolutepoint pageno getpagenoat absolutepoint pagerectangle getrectangleofpage pageno relativepoint absolutepoint pagerectangle absolutepoint pagerectangle m_layout getpages pageno relativepoint absolutepoint absolutepoint pageno pageno pagerectangle pagerectangle mquery retvalue getdrilldown relativepoint retvalue retvalue m_layout getheaderfooter getdrilldown relativepoint retvalue get drill across param absolute point point return drill across public m query get drill across point absolute point int page no int get page no at absolute point rectangle page rectangle get rectangle of page page no point relative point new point absolute point x page rectangle x absolute point y page rectangle y page page page m layout get pages get page no 1 log config relative relative point page log config absolute point absolute point page no page no page rectangle page rectangle return page get drill across relative point absolutepoint mquery getdrillacross absolutepoint pageno getpagenoat absolutepoint pagerectangle getrectangleofpage pageno relativepoint absolutepoint pagerectangle absolutepoint pagerectangle m_layout getpages pageno relativepoint absolutepoint absolutepoint pageno pageno pagerectangle pagerectangle getdrillacross relativepoint prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals r requesttype id p r requesttype id para i get parameter as int else if name equals r group id p r group id para i get parameter as int else if name equals r category id p r category id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals m product id p m product id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter r_requesttype_id p_r_requesttype_id getparameterasint r_group_id p_r_group_id getparameterasint r_category_id p_r_category_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint m_product_id p_m_product_id getparameterasint process return info throws exception protected string do it throws exception log info r requesttype id p r requesttype id r group id p r group id r category id p r category id c bpartner id p c bpartner id p m product id p m product id m request type type m request type get get ctx p r requesttype id if type get id 0 throw new compiere system error r requesttype id not found p r requesttype id if type is invoiced throw new compiere system error r requesttype id is invoiced string sql select from r request r inner join r status s on r r status id s r status id where s is closed y and r r requesttype id if p r group id 0 sql and r r group id if p r category id 0 sql and r r category id if p c bpartner id 0 sql and r c bpartner id sql and r is invoiced y order by c bpartner id prepared statement pstmt null try pstmt db prepare statement sql get trxname int index 1 pstmt set int index p r requesttype id if p r group id 0 pstmt set int index p r group id if p r category id 0 pstmt set int index p r category id if p c bpartner id 0 pstmt set int index p c bpartner id result set rs pstmt execute query int oldc bpartner id 0 while rs next m request request new m request get ctx rs get trxname if request is invoiced continue if oldc bpartner id request getc bpartner id invoice done if m invoice null invoice new request oldc bpartner id request getc bpartner id invoice line request invoice done rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null r category id return null doit r_requesttype_id p_r_requesttype_id r_group_id p_r_group_id r_category_id p_r_category_id c_bpartner_id p_c_bpartner_id p_m_product_id p_m_product_id mrequesttype mrequesttype getctx p_r_requesttype_id get_id compieresystemerror r_requesttype_id notfound p_r_requesttype_id isinvoiced compieresystemerror r_requesttype_id isinvoiced r_request r_status r_status_id r_status_id isclosed r_requesttype_id p_r_group_id r_group_id p_r_category_id r_category_id p_c_bpartner_id c_bpartner_id isinvoiced c_bpartner_id preparedstatement preparestatement get_trxname setint p_r_requesttype_id p_r_group_id setint p_r_group_id p_r_category_id setint p_r_category_id p_c_bpartner_id setint p_c_bpartner_id resultset executequery oldc_bpartner_id mrequest mrequest getctx get_trxname isinvoiced oldc_bpartner_id getc_bpartner_id invoicedone m_invoice invoicenew oldc_bpartner_id getc_bpartner_id invoiceline invoicedone r_category_id done with invoice private void invoice done close old if m invoice null if m linecount 0 m invoice delete false else m invoice process it m invoice action prepare m invoice save add log 0 null m invoice get grand total m invoice get document no m invoice null invoicedone m_invoice m_linecount m_invoice m_invoice processit minvoice action_prepare m_invoice addlog m_invoice getgrandtotal m_invoice getdocumentno m_invoice new invoice param request request private void invoice new m request request m invoice new m invoice get ctx 0 get trxname m invoice set isso trx true mb partner partner new mb partner get ctx request getc bpartner id null m invoice setb partner partner m invoice save m linecount 0 invoicenew mrequest m_invoice minvoice getctx get_trxname m_invoice setissotrx mbpartner mbpartner getctx getc_bpartner_id m_invoice setbpartner m_invoice m_linecount invoice line param request request private void invoice line m request request m request update updates request get updates null for int i 0 i updates length i big decimal qty updates i get qty invoiced if qty null qty signum 0 continue m invoice line il new m invoice line m invoice m linecount il set line m linecount 10 il set qty qty product int m product id updates i getm productspent id if m product id 0 m product id p m product id il setm product id m product id il set price il save invoiceline mrequest mrequestupdate getupdates bigdecimal getqtyinvoiced minvoiceline minvoiceline m_invoice m_linecount setline m_linecount setqty m_product_id getm_productspent_id m_product_id m_product_id p_m_product_id setm_product_id m_product_id setprice prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bpartner id m c bpartner id para i get parameter as int else if name equals date expense m datefrom timestamp para i get parameter m dateto timestamp para i getparameter to else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bpartner_id m_c_bpartner_id getparameterasint dateexpense m_datefrom getparameter m_dateto getparameter_to perform process return message to be translated throws exception protected string do it throws java lang exception string buffer sql new string buffer select from s timeexpenseline el where el ad client id 1 and el c bpartner id 0 and el is invoiced y business partner to be invoiced and el c orderline id is null not invoiced yet and exists select from s timeexpense e processed only where el s timeexpense id e s timeexpense id and e processed y if m c bpartner id 0 sql append and el c bpartner id 2 if m datefrom null m dateto null sql append and exists select from s timeexpense e where el s timeexpense id e s timeexpense id if m datefrom null sql append and e date report 3 if m dateto null sql append and e date report 4 sql append sql append order by el c bpartner id el c project id el s timeexpense id el line mb partner oldb partner null int old project id 1 m time expense te null prepared statement pstmt null try pstmt db prepare statement sql to string get trxname int par 1 pstmt set int par getad client id if m c bpartner id 0 pstmt set int par m c bpartner id if m datefrom null pstmt set timestamp par m datefrom if m dateto null pstmt set timestamp par m dateto result set rs pstmt execute query while rs next expense line loop m time expense line tel new m time expense line get ctx rs get trxname if tel is invoiced continue new b partner new order if oldb partner null oldb partner getc bpartner id tel getc bpartner id complete order oldb partner new mb partner get ctx tel getc bpartner id get trxname new project new order if old project id tel getc project id complete order old project id tel getc project id if te null te gets timeexpense id tel gets timeexpense id te new m time expense get ctx tel gets timeexpense id get trxname process line te tel oldb partner expense line loop rs close pstmt close pstmt null catch exception e log log level severe sql to string e finally try if pstmt null pstmt close catch exception e pstmt null complete order return created m noorders doit stringbuffer stringbuffer s_timeexpenseline ad_client_id c_bpartner_id isinvoiced c_orderline_id s_timeexpense s_timeexpense_id s_timeexpense_id m_c_bpartner_id c_bpartner_id m_datefrom m_dateto s_timeexpense s_timeexpense_id s_timeexpense_id m_datefrom datereport m_dateto datereport c_bpartner_id c_project_id s_timeexpense_id mbpartner oldbpartner old_project_id mtimeexpense preparedstatement preparestatement tostring get_trxname setint getad_client_id m_c_bpartner_id setint m_c_bpartner_id m_datefrom settimestamp m_datefrom m_dateto settimestamp m_dateto resultset executequery mtimeexpenseline mtimeexpenseline getctx get_trxname isinvoiced bpartner oldbpartner oldbpartner getc_bpartner_id getc_bpartner_id completeorder oldbpartner mbpartner getctx getc_bpartner_id get_trxname old_project_id getc_project_id completeorder old_project_id getc_project_id gets_timeexpense_id gets_timeexpense_id mtimeexpense getctx gets_timeexpense_id get_trxname processline oldbpartner tostring completeorder m_noorders process expense line param te header param tel line param bp bp private void process line m time expense te m time expense line tel mb partner bp if m order null log info new order for bp project tel getc project id m order new m order get ctx 0 get trxname m order setad org id tel getad org id m order setc doctypetarget id m order docsubtypeso oncredit m order setb partner bp if m order getc bpartner location id 0 log log level severe no bp location bp add log 0 te get date report null no location te get document no bp get name m order null return m order setm warehouse id te getm warehouse id if tel getc activity id 0 m order setc activity id tel getc activity id if tel getc campaign id 0 m order setc campaign id tel getc campaign id if tel getc project id 0 m order setc project id tel getc project id overwrite price list m project project new m project get ctx tel getc project id get trxname if project getm pricelist id 0 m order setm pricelist id project getm pricelist id m order setsalesrep id te getdoc user id if m order save throw new illegal state exception cannot save order else update header info if tel getc activity id 0 tel getc activity id m order getc activity id m order setc activity id tel getc activity id if tel getc campaign id 0 tel getc campaign id m order getc campaign id m order setc campaign id tel getc campaign id if m order save new illegal state exception cannot save order order line m order line ol new m order line m order if tel getm product id 0 ol setm product id tel getm product id tel getc uom id if tel gets resourceassignment id 0 ol sets resourceassignment id tel gets resourceassignment id ol set qty tel get qty invoiced ol set description tel get description ol setc project id tel getc project id big decimal price tel get price invoiced if price null price compare to env zero 0 if tel getc currency id m order getc currency id price m conversion rate convert get ctx price tel getc currency id m order getc currency id m order getad client id m order getad org id ol set price price else ol set price if tel getc uom id 0 ol getc uom id 0 ol setc uom id tel getc uom id ol set tax if ol save throw new illegal state exception cannot save order line update time expense line tel setc orderline id ol getc orderline id if tel save log fine updated tel with c orderline id else log log level severe not updated tel with c orderline id processline mtimeexpense mtimeexpenseline mbpartner m_order getc_project_id m_order morder getctx get_trxname m_order setad_org_id getad_org_id m_order setc_doctypetarget_id morder docsubtypeso_oncredit m_order setbpartner m_order getc_bpartner_location_id addlog getdatereport getdocumentno getname m_order m_order setm_warehouse_id getm_warehouse_id getc_activity_id m_order setc_activity_id getc_activity_id getc_campaign_id m_order setc_campaign_id getc_campaign_id getc_project_id m_order setc_project_id getc_project_id mproject mproject getctx getc_project_id get_trxname getm_pricelist_id m_order setm_pricelist_id getm_pricelist_id m_order setsalesrep_id getdoc_user_id m_order illegalstateexception getc_activity_id getc_activity_id m_order getc_activity_id m_order setc_activity_id getc_activity_id getc_campaign_id getc_campaign_id m_order getc_campaign_id m_order setc_campaign_id getc_campaign_id m_order illegalstateexception orderline morderline morderline m_order getm_product_id setm_product_id getm_product_id getc_uom_id gets_resourceassignment_id sets_resourceassignment_id gets_resourceassignment_id setqty getqtyinvoiced setdescription getdescription setc_project_id getc_project_id bigdecimal getpriceinvoiced compareto getc_currency_id m_order getc_currency_id mconversionrate getctx getc_currency_id m_order getc_currency_id m_order getad_client_id m_order getad_org_id setprice setprice getc_uom_id getc_uom_id setc_uom_id getc_uom_id settax illegalstateexception timeexpense setc_orderline_id getc_orderline_id c_orderline_id c_orderline_id complete order private void complete order if m order null return m order set doc action doc action action prepare m order process it doc action action prepare if m order save throw new illegal state exception cannot save order m noorders add log m order get id m order get date ordered m order get grand total m order get document no m order null completeorder m_order m_order setdocaction docaction action_prepare m_order processit docaction action_prepare m_order illegalstateexception m_noorders addlog m_order get_id m_order getdateordered m_order getgrandtotal m_order getdocumentno m_order prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id ad client id para i get parameter as int else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter ad_client_id ad_client_id getparameterasint p_record_id getrecord_id process return message throws exception protected string do it throws exception string sql string sqlupd string sqlins int cntu 0 int cnti 0 int totu 0 int toti 0 log info for all accounting schema for all accounting schema sql select from c acctschema default where ad client id ad client id prepared statement pstmt null try pstmt db prepare statement sql result set rs pstmt execute query while rs next update existing product category sqlupd update m product category acct set p revenue acct rs get int p revenue acct p expense acct rs get int p expense acct p asset acct rs get int p asset acct p cogs acct rs get int p cogs acct p purchasepricevariance acct rs get int p purchasepricevariance acct p invoicepricevariance acct rs get int p invoicepricevariance acct p tradediscountrec acct rs get int p tradediscountrec acct p tradediscountgrant acct rs get int p tradediscountgrant acct updated sys date updated by 0 where m product category acct c acctschema id rs get int c acctschema id and exists select from m product category p where p m product category id m product category acct m product category id cntu db execute update sqlupd totu cntu insert new product category sqlins insert into m product category acct m product category id c acctschema id ad client id ad org id is active created created by updated updated by p revenue acct p expense acct p asset acct p cogs acct p purchasepricevariance acct p invoicepricevariance acct p tradediscountrec acct p tradediscountgrant acct select p m product category id rs get int c acctschema id p ad client id p ad org id y sys date 0 sys date 0 rs get int p revenue acct rs get int p expense acct rs get int p asset acct rs get int p cogs acct rs get int p purchasepricevariance acct rs get int p invoicepricevariance acct rs get int p tradediscountrec acct rs get int p tradediscountgrant acct from m product category p where ad client id rs get int ad client id and not exists select from m product category acct pa where pa m product category id p m product category id and pa c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info product category cntu cnti business partner group sqlupd update c bp group acct set c receivable acct rs get int c receivable acct c prepayment acct rs get int c prepayment acct v liability acct rs get int v liability acct v liability services acct rs get int v liability services acct v prepayment acct rs get int v prepayment acct paydiscount exp acct rs get int paydiscount exp acct paydiscount rev acct rs get int paydiscount rev acct writeoff acct rs get int writeoff acct notinvoicedreceipts acct rs get int notinvoicedreceipts acct unearnedrevenue acct rs get int unearnedrevenue acct notinvoicedrevenue acct rs get int notinvoicedrevenue acct notinvoicedreceivables acct rs get int notinvoicedreceivables acct updated sys date updated by 0 where c bp group acct c acctschema id rs get int c acctschema id and exists select from c bp group acct x where x c bp group id c bp group acct c bp group id cntu db execute update sqlupd totu cntu insert new sqlins insert into c bp group acct c bp group id c acctschema id ad client id ad org id is active created created by updated updated by c receivable acct c prepayment acct v liability acct v liability services acct v prepayment acct paydiscount exp acct paydiscount rev acct writeoff acct notinvoicedreceipts acct unearnedrevenue acct notinvoicedrevenue acct notinvoicedreceivables acct select x c bp group id rs get int c acctschema id x ad client id x ad org id y sys date 0 sys date 0 rs get int c receivable acct rs get int c prepayment acct rs get int v liability acct rs get int v liability services acct rs get int v prepayment acct rs get int paydiscount exp acct rs get int paydiscount rev acct rs get int writeoff acct rs get int notinvoicedreceipts acct rs get int unearnedrevenue acct rs get int notinvoicedrevenue acct rs get int notinvoicedreceivables acct from c bp group x where ad client id rs get int ad client id and not exists select from c bp group acct a where a c bp group id x c bp group id and a c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info business group cntu cnti business partner employee sqlupd update c bp employee acct set e expense acct rs get int e expense acct e prepayment acct rs get int e prepayment acct updated sys date updated by 0 where c bp employee acct c acctschema id rs get int c acctschema id and exists select from c bp employee acct x where x c bpartner id c bp employee acct c bpartner id cntu db execute update sqlupd totu cntu insert new sqlins insert into c bp employee acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by e expense acct e prepayment acct select x c bpartner id rs get int c acctschema id x ad client id x ad org id y sys date 0 sys date 0 rs get int e expense acct rs get int e prepayment acct from c bpartner x where ad client id rs get int ad client id and not exists select from c bp employee acct a where a c bpartner id x c bpartner id and a c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info employees cntu cnti warehouse sqlupd update m warehouse acct set w inventory acct rs get int w inventory acct w differences acct rs get int w differences acct w revaluation acct rs get int w revaluation acct w invactualadjust acct rs get int w invactualadjust acct updated sys date updated by 0 where m warehouse acct c acctschema id rs get int c acctschema id and exists select from m warehouse acct x where x m warehouse id m warehouse acct m warehouse id cntu db execute update sqlupd totu cntu insert new sqlins insert into m warehouse acct m warehouse id c acctschema id ad client id ad org id is active created created by updated updated by w inventory acct w differences acct w revaluation acct w invactualadjust acct select x m warehouse id rs get int c acctschema id x ad client id x ad org id y sys date 0 sys date 0 rs get int w inventory acct rs get int w differences acct rs get int w revaluation acct rs get int w invactualadjust acct from m warehouse x where ad client id rs get int ad client id and not exists select from m warehouse acct a where a m warehouse id x m warehouse id and a c acctschema id rs get int c acctschema id cnti db execute update sqlins toti cnti log info warehouse cntu cnti project sqlupd update c project acct set pj asset acct rs get int pj asset acct pj wip acct rs get int pj asset acct updated sys date updated by 0 where c project acct c acctschema id rs get int c acctschema id and exists select from c project acct x where x c project id c project acct c project id cntu db execute update sqlupd totu cntu insert new sqlins insert into c project acct c project id c acctschema id ad client id ad org id is active created created by updated updated by pj asset acct pj wip acct select x c project id rs get int c acctschema id x ad client id x doit c_acctschema_default ad_client_id ad_client_id preparedstatement preparestatement resultset executequery m_product_category_acct p_revenue_acct getint p_revenue_acct p_expense_acct getint p_expense_acct p_asset_acct getint p_asset_acct p_cogs_acct getint p_cogs_acct p_purchasepricevariance_acct getint p_purchasepricevariance_acct p_invoicepricevariance_acct getint p_invoicepricevariance_acct p_tradediscountrec_acct getint p_tradediscountrec_acct p_tradediscountgrant_acct getint p_tradediscountgrant_acct sysdate updatedby m_product_category_acct c_acctschema_id getint c_acctschema_id m_product_category m_product_category_id m_product_category_acct m_product_category_id executeupdate m_product_category_acct m_product_category_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby p_revenue_acct p_expense_acct p_asset_acct p_cogs_acct p_purchasepricevariance_acct p_invoicepricevariance_acct p_tradediscountrec_acct p_tradediscountgrant_acct m_product_category_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint p_revenue_acct getint p_expense_acct getint p_asset_acct getint p_cogs_acct getint p_purchasepricevariance_acct getint p_invoicepricevariance_acct getint p_tradediscountrec_acct getint p_tradediscountgrant_acct m_product_category ad_client_id getint ad_client_id m_product_category_acct m_product_category_id m_product_category_id c_acctschema_id getint c_acctschema_id executeupdate c_bp_group_acct c_receivable_acct getint c_receivable_acct c_prepayment_acct getint c_prepayment_acct v_liability_acct getint v_liability_acct v_liability_services_acct getint v_liability_services_acct v_prepayment_acct getint v_prepayment_acct paydiscount_exp_acct getint paydiscount_exp_acct paydiscount_rev_acct getint paydiscount_rev_acct writeoff_acct getint writeoff_acct notinvoicedreceipts_acct getint notinvoicedreceipts_acct unearnedrevenue_acct getint unearnedrevenue_acct notinvoicedrevenue_acct getint notinvoicedrevenue_acct notinvoicedreceivables_acct getint notinvoicedreceivables_acct sysdate updatedby c_bp_group_acct c_acctschema_id getint c_acctschema_id c_bp_group_acct c_bp_group_id c_bp_group_acct c_bp_group_id executeupdate c_bp_group_acct c_bp_group_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby c_receivable_acct c_prepayment_acct v_liability_acct v_liability_services_acct v_prepayment_acct paydiscount_exp_acct paydiscount_rev_acct writeoff_acct notinvoicedreceipts_acct unearnedrevenue_acct notinvoicedrevenue_acct notinvoicedreceivables_acct c_bp_group_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint c_receivable_acct getint c_prepayment_acct getint v_liability_acct getint v_liability_services_acct getint v_prepayment_acct getint paydiscount_exp_acct getint paydiscount_rev_acct getint writeoff_acct getint notinvoicedreceipts_acct getint unearnedrevenue_acct getint notinvoicedrevenue_acct getint notinvoicedreceivables_acct c_bp_group ad_client_id getint ad_client_id c_bp_group_acct c_bp_group_id c_bp_group_id c_acctschema_id getint c_acctschema_id executeupdate c_bp_employee_acct e_expense_acct getint e_expense_acct e_prepayment_acct getint e_prepayment_acct sysdate updatedby c_bp_employee_acct c_acctschema_id getint c_acctschema_id c_bp_employee_acct c_bpartner_id c_bp_employee_acct c_bpartner_id executeupdate c_bp_employee_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby e_expense_acct e_prepayment_acct c_bpartner_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint e_expense_acct getint e_prepayment_acct c_bpartner ad_client_id getint ad_client_id c_bp_employee_acct c_bpartner_id c_bpartner_id c_acctschema_id getint c_acctschema_id executeupdate m_warehouse_acct w_inventory_acct getint w_inventory_acct w_differences_acct getint w_differences_acct w_revaluation_acct getint w_revaluation_acct w_invactualadjust_acct getint w_invactualadjust_acct sysdate updatedby m_warehouse_acct c_acctschema_id getint c_acctschema_id m_warehouse_acct m_warehouse_id m_warehouse_acct m_warehouse_id executeupdate m_warehouse_acct m_warehouse_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby w_inventory_acct w_differences_acct w_revaluation_acct w_invactualadjust_acct m_warehouse_id getint c_acctschema_id ad_client_id ad_org_id sysdate sysdate getint w_inventory_acct getint w_differences_acct getint w_revaluation_acct getint w_invactualadjust_acct m_warehouse ad_client_id getint ad_client_id m_warehouse_acct m_warehouse_id m_warehouse_id c_acctschema_id getint c_acctschema_id executeupdate c_project_acct pj_asset_acct getint pj_asset_acct pj_wip_acct getint pj_asset_acct sysdate updatedby c_project_acct c_acctschema_id getint c_acctschema_id c_project_acct c_project_id c_project_acct c_project_id executeupdate c_project_acct c_project_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby pj_asset_acct pj_wip_acct c_project_id getint c_acctschema_id ad_client_id prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c doctype id p c doctype id para i get parameter as int else log log level severe prepare unknown parameter name p c rfq id getrecord id processinfoparameter getparameter getparametername getparameter c_doctype_id p_c_doctype_id getparameterasint p_c_rfq_id getrecord_id process a sales order is created for the entered business partner a sales order line is created for each rfq line quantity where offer quantity is selected if on the rfq line quantity an offer amount is entered not 0 that price is used if a magin is entered on rfq line quantity it overwrites the general margin the margin is the percentage added to the best response amount return message protected string do it throws exception m rfq rfq new m rfq get ctx p c rfq id get trxname if rfq get id 0 throw new illegal argument exception no rfq found log info do it rfq if rfq getc bpartner id 0 rfq getc bpartner location id 0 throw new exception no business partner location mb partner bp new mb partner get ctx rfq getc bpartner id get trxname m order order new m order get ctx 0 get trxname order set isso trx true if p c doctype id 0 order setc doctypetarget id p c doctype id else order setc doctypetarget id order setb partner bp order setc bpartner location id rfq getc bpartner location id order setsalesrep id rfq getsalesrep id if rfq get date work complete null order set date promised rfq get date work complete order save m rfq line lines rfq get lines for int i 0 i lines length i m rfq line line lines i m rfq line qty qtys line get qtys for int j 0 j qtys length j m rfq line qty qty qtys j if qty is active qty is offer qty m order line ol new m order line order ol setm product id line getm product id qty getc uom id ol set description line get description ol set qty qty get qty big decimal price qty get offer amt if price null price signum 0 price qty get best response amt if price null price signum 0 price env zero log warning best response 0 qty else big decimal margin qty get margin if margin null margin signum 0 margin rfq get margin if margin null margin signum 0 margin margin add onehundred price price multiply margin divide onehundred 2 big decimal round half up price ol set price price ol save offer qty all qtys all lines rfq setc order id order getc order id rfq save return order get document no doit mrfq mrfq getctx p_c_rfq_id get_trxname get_id illegalargumentexception doit getc_bpartner_id getc_bpartner_location_id mbpartner mbpartner getctx getc_bpartner_id get_trxname morder morder getctx get_trxname setissotrx p_c_doctype_id setc_doctypetarget_id p_c_doctype_id setc_doctypetarget_id setbpartner setc_bpartner_location_id getc_bpartner_location_id setsalesrep_id getsalesrep_id getdateworkcomplete setdatepromised getdateworkcomplete mrfqline getlines mrfqline mrfqlineqty getqtys mrfqlineqty isactive isofferqty morderline morderline setm_product_id getm_product_id getc_uom_id setdescription getdescription setqty getqty bigdecimal getofferamt getbestresponseamt bestresponse bigdecimal getmargin getmargin bigdecimal round_half_up setprice setc_order_id getc_order_id getdocumentno standard constructor public x ad client properties ctx int ad client id string trx name super ctx ad client id trx name if ad client id 0 set auto archive null n set is cost immediate false n set is multi lingual document false set is post immediate false n set is servere mail false set is smtp authorization false n set is use beta functions true y setmm policy null f set name null set value null x_ad_client ad_client_id trxname ad_client_id trxname ad_client_id setautoarchive setiscostimmediate setismultilingualdocument setispostimmediate setisserveremail setissmtpauthorization setisusebetafunctions setmmpolicy setname setvalue load constructor public x ad client properties ctx result set rs string trx name super ctx rs trx name x_ad_client resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad client append get id append return sb to string tostring stringbuffer stringbuffer x_ad_client get_id tostring public static final int ad language ad reference id 327 set language language for this entity public void setad language string ad language if ad language null ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language public static final string autoarchive none n set auto archive enable and level of automatic archive of documents public void set auto archive string auto archive if auto archive null throw new illegal argument exception auto archive is mandatory if auto archive equals 1 auto archive equals 2 auto archive equals 3 auto archive equals n else throw new illegal argument exception auto archive invalid value auto archive reference id 334 1 2 3 n if auto archive length 1 log warning length 1 truncated auto archive auto archive substring 0 0 set value auto archive auto archive autoarchive_none setautoarchive autoarchive autoarchive illegalargumentexception autoarchive autoarchive autoarchive autoarchive autoarchive illegalargumentexception autoarchive autoarchive reference_id autoarchive autoarchive autoarchive set_value autoarchive autoarchive get auto archive enable and level of automatic archive of documents public string get auto archive return string get value auto archive getautoarchive get_value autoarchive set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document directory directory for documents from the application server public void set document dir string document dir if document dir null document dir length 60 log warning length 60 truncated document dir document dir substring 0 59 set value document dir document dir setdocumentdir documentdir documentdir documentdir documentdir documentdir set_value documentdir documentdir get document directory directory for documents from the application server public string get document dir return string get value document dir getdocumentdir get_value documentdir set e mail test test e mail public void sete mail test string e mail test if e mail test null e mail test length 1 log warning length 1 truncated e mail test e mail test substring 0 0 set value e mail test e mail test email email setemailtest emailtest emailtest emailtest emailtest emailtest set_value emailtest emailtest get e mail test test e mail public string gete mail test return string get value e mail test email email getemailtest get_value emailtest set cost immediately update costs immediately for testing public void set is cost immediate boolean is cost immediate set value is cost immediate new boolean is cost immediate setiscostimmediate iscostimmediate set_value iscostimmediate iscostimmediate get cost immediately update costs immediately for testing public boolean is cost immediate object oo get value is cost immediate if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscostimmediate get_value iscostimmediate booleanvalue set multi lingual documents documents are multi lingual public void set is multi lingual document boolean is multi lingual document set value is multi lingual document new boolean is multi lingual document setismultilingualdocument ismultilingualdocument set_value ismultilingualdocument ismultilingualdocument get multi lingual documents documents are multi lingual public boolean is multi lingual document object oo get value is multi lingual document if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismultilingualdocument get_value ismultilingualdocument booleanvalue set post immediately post the accounting immediately for testing public void set is post immediate boolean is post immediate set value is post immediate new boolean is post immediate setispostimmediate ispostimmediate set_value ispostimmediate ispostimmediate get post immediately post the accounting immediately for testing public boolean is post immediate object oo get value is post immediate if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostimmediate get_value ispostimmediate booleanvalue set server e mail send e mail from server public void set is servere mail boolean is servere mail set value is servere mail new boolean is servere mail email email setisserveremail isserveremail set_value isserveremail isserveremail get server e mail send e mail from server public boolean is servere mail object oo get value is servere mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email isserveremail get_value isserveremail booleanvalue set smtp authentification your mail server requires authentification public void set is smtp authorization boolean is smtp authorization set value is smtp authorization new boolean is smtp authorization setissmtpauthorization issmtpauthorization set_value issmtpauthorization issmtpauthorization get smtp authentification your mail server requires authentification public boolean is smtp authorization object oo get value is smtp authorization if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issmtpauthorization get_value issmtpauthorization booleanvalue set use beta functions enable the use of beta functionality public void set is use beta functions boolean is use beta functions set value is use beta functions new boolean is use beta functions setisusebetafunctions isusebetafunctions set_value isusebetafunctions isusebetafunctions get use beta functions enable the use of beta functionality public boolean is use beta functions object oo get value is use beta functions if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isusebetafunctions get_value isusebetafunctions booleanvalue public static final string mmpolicy lifo l set material policy material movement policy public void setmm policy string mm policy if mm policy null throw new illegal argument exception mm policy is mandatory if mm policy equals f mm policy equals l else throw new illegal argument exception mm policy invalid value mm policy reference id 335 f l if mm policy length 1 log warning length 1 truncated mm policy mm policy substring 0 0 set value mm policy mm policy mmpolicy_lifo setmmpolicy mmpolicy mmpolicy illegalargumentexception mmpolicy mmpolicy mmpolicy illegalargumentexception mmpolicy mmpolicy reference_id mmpolicy mmpolicy mmpolicy set_value mmpolicy mmpolicy get material policy material movement policy public string getmm policy return string get value mm policy getmmpolicy get_value mmpolicy set model validation classes list of data model validation classes separated by public void set model validation classes string model validation classes if model validation classes null model validation classes length 255 log warning length 255 truncated model validation classes model validation classes substring 0 254 set value model validation classes model validation classes setmodelvalidationclasses modelvalidationclasses modelvalidationclasses modelvalidationclasses modelvalidationclasses modelvalidationclasses set_value modelvalidationclasses modelvalidationclasses get model validation classes list of data model validation classes separated by public string get model validation classes return string get value model validation classes getmodelvalidationclasses get_value modelvalidationclasses set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set request e mail e mail address to send automated mails from or receive mails for automated processing fully qualified public void set requeste mail string requeste mail if requeste mail null requeste mail length 60 log warning length 60 truncated requeste mail requeste mail substring 0 59 set value requeste mail requeste mail email email setrequestemail requestemail requestemail requestemail requestemail requestemail set_value requestemail requestemail get request e mail e mail address to send automated mails from or receive mails for automated processing fully qualified public string get requeste mail return string get value requeste mail email email getrequestemail get_value requestemail set request folder e mail folder to process incoming emails if empty inbox is used public void set request folder string request folder if request folder null request folder length 20 log warning length 20 truncated request folder request folder substring 0 19 set value request folder request folder email setrequestfolder requestfolder requestfolder requestfolder requestfolder requestfolder set_value requestfolder requestfolder get request folder e mail folder to process incoming emails if empty inbox is used public string get request folder return string get value request folder email getrequestfolder get_value requestfolder set request user user name id of the email owner public void set request user string request user if request user null request user length 60 log warning length 60 truncated request user request user substring 0 59 set value request user request user setrequestuser requestuser requestuser requestuser requestuser requestuser set_value requestuser requestuser get request user user name id of the email owner public string get request user return string get value request user getrequestuser get_value requestuser set request user password password of the user name id for mail processing public void set request userpw string request userpw if request userpw null request userpw length 20 log warning length 20 truncated request userpw request userpw substring 0 19 set value request userpw request userpw setrequestuserpw requestuserpw requestuserpw requestuserpw requestuserpw requestuserpw set_value requestuserpw requestuserpw get request user password password of the user name id for mail processing public string get request userpw return string get value request userpw getrequestuserpw get_value requestuserpw set mail host hostname of mail server for smtp and imap public void setsmtp host string smtp host if smtp host null smtp host length 60 log warning length 60 truncated smtp host smtp host substring 0 59 set value smtp host smtp host setsmtphost smtphost smtphost smtphost smtphost smtphost set_value smtphost smtphost get mail host hostname of mail server for smtp and imap public string getsmtp host return string get value smtp host getsmtphost get_value smtphost set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x m edi properties ctx int m edi id string trx name super ctx m edi id trx name if m edi id 0 setc bp edi id 0 set document no null setedi status null set line 0 setm edi id 0 setm product id 0 setm warehouse id 0 set processed false setrequest qty env zero setrequest shipdate new timestamp system current time millis set trx sent new timestamp system current time millis set trx type null x_m_edi m_edi_id trxname m_edi_id trxname m_edi_id setc_bp_edi_id setdocumentno setedistatus setline setm_edi_id setm_product_id setm_warehouse_id setprocessed setrequest_qty setrequest_shipdate currenttimemillis settrxsent currenttimemillis settrxtype load constructor public x m edi properties ctx result set rs string trx name super ctx rs trx name x_m_edi resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m edi append get id append return sb to string tostring stringbuffer stringbuffer x_m_edi get_id tostring set edi definition electronic data interchange public void setc bp edi id int c bp edi id if c bp edi id 1 throw new illegal argument exception c bp edi id is mandatory set value c bp edi id new integer c bp edi id setc_bp_edi_id c_bp_edi_id c_bp_edi_id illegalargumentexception c_bp_edi_id set_value c_bp_edi_id c_bp_edi_id get edi definition electronic data interchange public int getc bp edi id integer ii integer get value c bp edi id if ii null return 0 return ii int value getc_bp_edi_id get_value c_bp_edi_id intvalue set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno public static final string edistatus sent s set edi status public void setedi status string edi status if edi status null throw new illegal argument exception edi status is mandatory if edi status equals a edi status equals c edi status equals d edi status equals s else throw new illegal argument exception edi status invalid value edi status reference id 202 a c d s if edi status length 1 log warning length 1 truncated edi status edi status substring 0 0 set valuenocheck edi status edi status edistatus_sent setedistatus edistatus edistatus illegalargumentexception edistatus edistatus edistatus edistatus edistatus illegalargumentexception edistatus edistatus reference_id edistatus edistatus edistatus set_valuenocheck edistatus edistatus get edi status public string getedi status return string get value edi status getedistatus get_value edistatus set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set edi transaction public void setm edi id int m edi id if m edi id 1 throw new illegal argument exception m edi id is mandatory set valuenocheck m edi id new integer m edi id setm_edi_id m_edi_id m_edi_id illegalargumentexception m_edi_id set_valuenocheck m_edi_id m_edi_id get edi transaction public int getm edi id integer ii integer get value m edi id if ii null return 0 return ii int value getm_edi_id get_value m_edi_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set reply price confirmed price from edi partner public void setreply price big decimal reply price set value reply price reply price setreply_price bigdecimal reply_price set_value reply_price reply_price get reply price confirmed price from edi partner public big decimal getreply price big decimal bd big decimal get value reply price if bd null return env zero return bd bigdecimal getreply_price bigdecimal bigdecimal get_value reply_price set reply qty available public void setreply qtyavailable big decimal reply qtyavailable set value reply qtyavailable reply qtyavailable setreply_qtyavailable bigdecimal reply_qtyavailable set_value reply_qtyavailable reply_qtyavailable get reply qty available public big decimal getreply qtyavailable big decimal bd big decimal get value reply qtyavailable if bd null return env zero return bd bigdecimal getreply_qtyavailable bigdecimal bigdecimal get_value reply_qtyavailable set reply qty confirmed public void setreply qtyconfirmed big decimal reply qtyconfirmed set value reply qtyconfirmed reply qtyconfirmed setreply_qtyconfirmed bigdecimal reply_qtyconfirmed set_value reply_qtyconfirmed reply_qtyconfirmed get reply qty confirmed public big decimal getreply qtyconfirmed big decimal bd big decimal get value reply qtyconfirmed if bd null return env zero return bd bigdecimal getreply_qtyconfirmed bigdecimal bigdecimal get_value reply_qtyconfirmed set reply received public void setreply received timestamp reply received set value reply received reply received setreply_received reply_received set_value reply_received reply_received get reply received public timestamp getreply received return timestamp get value reply received getreply_received get_value reply_received set reply remarks public void setreply remarks string reply remarks if reply remarks null reply remarks length 2000 log warning length 2000 truncated reply remarks reply remarks substring 0 1999 set value reply remarks reply remarks setreply_remarks reply_remarks reply_remarks reply_remarks reply_remarks reply_remarks set_value reply_remarks reply_remarks get reply remarks public string getreply remarks return string get value reply remarks getreply_remarks get_value reply_remarks set reply ship date public void setreply shipdate timestamp reply shipdate set value reply shipdate reply shipdate setreply_shipdate reply_shipdate set_value reply_shipdate reply_shipdate get reply ship date public timestamp getreply shipdate return timestamp get value reply shipdate getreply_shipdate get_value reply_shipdate set request price public void setrequest price big decimal request price set value request price request price setrequest_price bigdecimal request_price set_value request_price request_price get request price public big decimal getrequest price big decimal bd big decimal get value request price if bd null return env zero return bd bigdecimal getrequest_price bigdecimal bigdecimal get_value request_price set request qty public void setrequest qty big decimal request qty if request qty null throw new illegal argument exception request qty is mandatory set value request qty request qty setrequest_qty bigdecimal request_qty request_qty illegalargumentexception request_qty set_value request_qty request_qty get request qty public big decimal getrequest qty big decimal bd big decimal get value request qty if bd null return env zero return bd bigdecimal getrequest_qty bigdecimal bigdecimal get_value request_qty set request ship date public void setrequest shipdate timestamp request shipdate if request shipdate null throw new illegal argument exception request shipdate is mandatory set value request shipdate request shipdate setrequest_shipdate request_shipdate request_shipdate illegalargumentexception request_shipdate set_value request_shipdate request_shipdate get request ship date public timestamp getrequest shipdate return timestamp get value request shipdate getrequest_shipdate get_value request_shipdate set transaction received public void set trx received timestamp trx received set value trx received trx received settrxreceived trxreceived set_value trxreceived trxreceived get transaction received public timestamp get trx received return timestamp get value trx received gettrxreceived get_value trxreceived set transaction sent public void set trx sent timestamp trx sent if trx sent null throw new illegal argument exception trx sent is mandatory set value trx sent trx sent settrxsent trxsent trxsent illegalargumentexception trxsent set_value trxsent trxsent get transaction sent public timestamp get trx sent return timestamp get value trx sent gettrxsent get_value trxsent public static final string trxtype purchaseorder o set transaction type type of credit card transaction public void set trx type string trx type if trx type null throw new illegal argument exception trx type is mandatory if trx type equals i trx type equals o else throw new illegal argument exception trx type invalid value trx type reference id 203 i o if trx type length 1 log warning length 1 truncated trx type trx type substring 0 0 set valuenocheck trx type trx type trxtype_purchaseorder settrxtype trxtype trxtype illegalargumentexception trxtype trxtype trxtype illegalargumentexception trxtype trxtype reference_id trxtype trxtype trxtype set_valuenocheck trxtype trxtype get transaction type type of credit card transaction public string get trx type return string get value trx type gettrxtype get_value trxtype standard constructor public x m attributesetexclude properties ctx int m attributesetexclude id string trx name super ctx m attributesetexclude id trx name if m attributesetexclude id 0 setad table id 0 set isso trx false setm attributesetexclude id 0 setm attributeset id 0 x_m_attributesetexclude m_attributesetexclude_id trxname m_attributesetexclude_id trxname m_attributesetexclude_id setad_table_id setissotrx setm_attributesetexclude_id setm_attributeset_id load constructor public x m attributesetexclude properties ctx result set rs string trx name super ctx rs trx name x_m_attributesetexclude resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributesetexclude append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributesetexclude get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set exclude attribute set exclude the ability to enter attribute sets public void setm attributesetexclude id int m attributesetexclude id if m attributesetexclude id 1 throw new illegal argument exception m attributesetexclude id is mandatory set valuenocheck m attributesetexclude id new integer m attributesetexclude id setm_attributesetexclude_id m_attributesetexclude_id m_attributesetexclude_id illegalargumentexception m_attributesetexclude_id set_valuenocheck m_attributesetexclude_id m_attributesetexclude_id get exclude attribute set exclude the ability to enter attribute sets public int getm attributesetexclude id integer ii integer get value m attributesetexclude id if ii null return 0 return ii int value getm_attributesetexclude_id get_value m_attributesetexclude_id intvalue set attribute set product attribute set public void setm attributeset id int m attributeset id if m attributeset id 0 throw new illegal argument exception m attributeset id is mandatory set valuenocheck m attributeset id new integer m attributeset id setm_attributeset_id m_attributeset_id m_attributeset_id illegalargumentexception m_attributeset_id set_valuenocheck m_attributeset_id m_attributeset_id get attribute set product attribute set public int getm attributeset id integer ii integer get value m attributeset id if ii null return 0 return ii int value getm_attributeset_id get_value m_attributeset_id intvalue process cc return processed ok throws illegal argument exception public boolean processcc throws illegal argument exception set encoded true return m ok illegalargumentexception illegalargumentexception setencoded m_ok is processed ok return true if ok public boolean is processedok return m ok isprocessedok m_ok standard constructor public x c dunning properties ctx int c dunning id string trx name super ctx c dunning id trx name if c dunning id 0 setc dunning id 0 set is default false set name null set send dunning letter false x_c_dunning c_dunning_id trxname c_dunning_id trxname c_dunning_id setc_dunning_id setisdefault setname setsenddunningletter load constructor public x c dunning properties ctx result set rs string trx name super ctx rs trx name x_c_dunning resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c dunning append get id append return sb to string tostring stringbuffer stringbuffer x_c_dunning get_id tostring set dunning dunning rules for overdue invoices public void setc dunning id int c dunning id if c dunning id 1 throw new illegal argument exception c dunning id is mandatory set valuenocheck c dunning id new integer c dunning id setc_dunning_id c_dunning_id c_dunning_id illegalargumentexception c_dunning_id set_valuenocheck c_dunning_id c_dunning_id get dunning dunning rules for overdue invoices public int getc dunning id integer ii integer get value c dunning id if ii null return 0 return ii int value getc_dunning_id get_value c_dunning_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set send dunning letters indicates if dunning letters will be sent public void set send dunning letter boolean send dunning letter set value send dunning letter new boolean send dunning letter setsenddunningletter senddunningletter set_value senddunningletter senddunningletter get send dunning letters indicates if dunning letters will be sent public boolean is send dunning letter object oo get value send dunning letter if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issenddunningletter get_value senddunningletter booleanvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad window id p ad windowfrom id para i get parameter as int else log log level severe prepare unknown parameter name p ad windowto id getrecord id processinfoparameter getparameter getparametername getparameter ad_window_id p_ad_windowfrom_id getparameterasint p_ad_windowto_id getrecord_id process return message throws exception protected string do it throws exception log info do it to ad window id p ad windowto id from p ad windowfrom id m window from new m window get ctx p ad windowfrom id get trxname if from get id 0 throw new compiere user error not found from ad window id m window to new m window get ctx p ad windowto id get trxname if to get id 0 throw new compiere user error not found to ad window id int tab count 0 int field count 0 m tab old tabs from get tabs false get trxname for int i 0 i old tabs length i m tab old tab old tabs i m tab new tab new m tab to old tab if new tab save tab count copy fields m field old fields old tab get fields false get trxname for int j 0 j old fields length j m field old field old fields j m field new field new m field new tab old field if new field save field count else throw new compiere user error error ad field id else throw new compiere user error error ad tab id return copied tab count field count doit doit ad_window_id p_ad_windowto_id p_ad_windowfrom_id m_window m_window getctx p_ad_windowfrom_id get_trxname get_id compiereusererror notfound ad_window_id m_window m_window getctx p_ad_windowto_id get_trxname get_id compiereusererror notfound ad_window_id tabcount fieldcount m_tab oldtabs gettabs get_trxname oldtabs m_tab oldtab oldtabs m_tab newtab m_tab oldtab newtab tabcount m_field oldfields oldtab getfields get_trxname oldfields m_field oldfield oldfields m_field newfield m_field newtab oldfield newfield fieldcount compiereusererror ad_field_id compiereusererror ad_tab_id tabcount fieldcount constructor param ass accounting schemata param rs record parem trx name trx protected doc cash m acct schema ass result set rs string trx name super ass m cash class rs doctype cashjournal trx name trxname doc_cash macctschema resultset trxname mcash doctype_cashjournal trxname load specific document details return error message or null protected string load document details m cash cash m cash getpo set date doc cash get statement date amounts set amount doc amttype gross cash get statement difference set cash book org currency m cash book cb m cash book get get ctx cash getc cashbook id setc cashbook id cb getc cashbook id setc currency id cb getc currency id contained objects p lines load lines cash cb log fine lines p lines length return null loaddocumentdetails mcash mcash setdatedoc getstatementdate setamount amttype_gross getstatementdifference cashbook mcashbook mcashbook getctx getc_cashbook_id setc_cashbook_id getc_cashbook_id setc_currency_id getc_currency_id p_lines loadlines p_lines load cash line param cash journal return doc line array private doc line load lines m cash cash m cash book cb array list doc line list new array list doc line m cash line lines cash get lines false for int i 0 i lines length i m cash line line lines i docline cash doc line new docline cash line this list add doc line return array doc line dls new doc line list size list to array dls return dls docline docline loadlines mcash mcashbook arraylist docline arraylist docline mcashline getlines mcashline docline_cash docline docline_cash docline docline docline toarray get source currency balance subtracts line amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value env zero string buffer sb new string buffer total ret value ret value add get amount doc amttype gross sb append get amount doc amttype gross lines for int i 0 i p lines length i ret value ret value subtract p lines i get amt source sb append append p lines i get amt source sb append log fine to string balance ret value sb to string return ret value return env zero lines are balanced bigdecimal getbalance bigdecimal retvalue stringbuffer stringbuffer retvalue retvalue getamount amttype_gross getamount amttype_gross p_lines retvalue retvalue p_lines getamtsource p_lines getamtsource tostring retvalue tostring retvalue create facts the accounting logic for cmc pre expense cash expense dr cash asset cr receipt cash asset dr cash receipt cr charge charge dr cash asset cr difference cash difference dr cash asset cr invoice cash asset dr cash transfer cr transfer bank in transit dr cash asset cr pre param as account schema return fact public array list fact create facts m acct schema as need to have cash book if getc cashbook id 0 p error c cashbook id not set log log level severe p error return null create fact header fact fact new fact this as fact post actual header posting amt as invoices and transfer could be differenet currency cash asset total big decimal asset amt env zero lines for int i 0 i p lines length i docline cash line docline cash p lines i string cash type line get cash type if cash type equals docline cash cashtype expense amount is negative cash expense dr cash asset cr fact create line line get account doc accttype cashexpense as getc currency id line get amount negate null fact create line line get account doc accttype cashasset as p vo c currency id null line get amount negate asset amt asset amt subtract line get amount negate else if cash type equals docline cash cashtype receipt amount is positive cash asset dr cash receipt cr fact create line line get account doc accttype cashasset as p vo c currency id line get amount null asset amt asset amt add line get amount fact create line line get account doc accttype cashreceipt as getc currency id null line get amount else if cash type equals docline cash cashtype charge amount is negative charge dr cash asset cr fact create line line line get charge account as get amount getc currency id line get amount negate null fact create line line get account doc accttype cashasset as p vo c currency id null line get amount negate asset amt asset amt subtract line get amount negate else if cash type equals docline cash cashtype difference amount is pos neg cash difference dr cash asset cr fact create line line get account doc accttype cashdifference as getc currency id line get amount negate fact create line line get account doc accttype cashasset as p vo c currency id line get amount asset amt asset amt add line get amount else if cash type equals docline cash cashtype invoice amount is pos neg cash asset dr dr invoice is in invoice currency cash transfer cr cr if line getc currency id getc currency id asset amt asset amt add line get amount else fact create line line get account doc accttype cashasset as line getc currency id line get amount fact create line line get account doc accttype cashtransfer as line getc currency id line get amount negate else if cash type equals docline cash cashtype transfer amount is pos neg bank in transit dr dr transfer is in bank account currency cash asset dr cr int temp getc bankaccount id setc bankaccount id line getc bankaccount id fact create line line get account doc accttype bankintransit as line getc currency id line get amount negate setc bankaccount id temp if line getc currency id getc currency id asset amt asset amt add line get amount else fact create line line get account doc accttype cashasset as line getc currency id line get amount lines cash asset fact create line null get account doc accttype cashasset as getc currency id asset amt array list fact facts new array list fact facts add fact return facts cashexpense cashasset cashasset cashreceipt cashasset cashdifference cashasset cashasset cashtransfer bankintransit cashasset arraylist createfacts macctschema cashbook getc_cashbook_id p_error c_cashbook_id p_error post_actual cashasset bigdecimal assetamt p_lines docline_cash docline_cash p_lines cashtype getcashtype cashtype docline_cash cashtype_expense cashexpense cashasset createline getaccount accttype_cashexpense getc_currency_id getamount createline getaccount accttype_cashasset p_vo c_currency_id getamount assetamt assetamt getamount cashtype docline_cash cashtype_receipt cashasset cashreceipt createline getaccount accttype_cashasset p_vo c_currency_id getamount assetamt assetamt getamount createline getaccount accttype_cashreceipt getc_currency_id getamount cashtype docline_cash cashtype_charge cashasset createline getchargeaccount getamount getc_currency_id getamount createline getaccount accttype_cashasset p_vo c_currency_id getamount assetamt assetamt getamount cashtype docline_cash cashtype_difference cashdifference cashasset createline getaccount accttype_cashdifference getc_currency_id getamount createline getaccount accttype_cashasset p_vo c_currency_id getamount assetamt assetamt getamount cashtype docline_cash cashtype_invoice cashasset cashtransfer getc_currency_id getc_currency_id assetamt assetamt getamount createline getaccount accttype_cashasset getc_currency_id getamount createline getaccount accttype_cashtransfer getc_currency_id getamount cashtype docline_cash cashtype_transfer bankintransit cashasset getc_bankaccount_id setc_bankaccount_id getc_bankaccount_id createline getaccount accttype_bankintransit getc_currency_id getamount setc_bankaccount_id getc_currency_id getc_currency_id assetamt assetamt getamount createline getaccount accttype_cashasset getc_currency_id getamount createline getaccount accttype_cashasset getc_currency_id assetamt arraylist arraylist default constructor param ctx context param id id public mwf next condition properties ctx int id string trx name super ctx id trx name mwfnextcondition trxname trxname load cosntructor param ctx context param rs result set public mwf next condition properties ctx result set rs string trx name super ctx rs trx name mwfnextcondition resultset trxname trxname is or condition return true if or public boolean is or return andor or equals get and or isor andor_or getandor evaluate condition return true if true public boolean evaluate mwf activity activity if getad column id 0 throw new illegal state exception no column defined this po po activity getpo if po null po get id 0 throw new illegal state exception could not evaluate po this object value obj po get valueofcolumn getad column id if value obj null value obj string value1 get value if value1 null value1 string value2 get value2 if value2 null value2 string result str po value obj get operation condition value1 if get operation equals operation sql throw new illegal argument exception sql operator not implemented yet result str if get operation equals operation x result str value2 boolean result false if value obj instanceof number result compare number number value obj value1 value2 else result compare string value obj value1 value2 log fine result str result m numeric return result mwfactivity getad_column_id illegalstateexception get_id illegalstateexception valueobj get_valueofcolumn getad_column_id valueobj valueobj getvalue getvalue2 resultstr valueobj getoperation getoperation operation_sql illegalargumentexception resultstr getoperation operation_x resultstr valueobj comparenumber valueobj comparestring valueobj resultstr m_numeric compare number param value obj comparator return true if operation private boolean compare number number value obj string value1 string value2 big decimal value objb null big decimal value1b null big decimal value2b null try if value obj instanceof big decimal value objb big decimal value obj else if value obj instanceof integer value objb new big decimal integer value obj int value else value objb new big decimal string value of value obj catch exception e log fine compare number value obj value obj e to string return compare string value obj value1 value2 try value1b new big decimal value1 catch exception e log fine compare number value1 value1 e to string return compare string value obj value1 value2 string op get operation if operation eq equals op return value objb compare to value1b 0 else if operation gt equals op return value objb compare to value1b 0 else if operation gteq equals op return value objb compare to value1b 0 else if operation le equals op return value objb compare to value1b 0 else if operation leeq equals op return value objb compare to value1b 0 else if operation like equals op return value objb compare to value1b 0 else if operation noteq equals op return value objb compare to value1b 0 else if operation sql equals op throw new illegal argument exception sql not implemented else if operation x equals op if value objb compare to value1b 0 return false to try value2b new big decimal string value of value2 return value objb compare to value2b 0 catch exception e log fine compare number value2 value2 e to string return false throw new illegal argument exception unknown operation op valueobj comparenumber valueobj bigdecimal valueobjb bigdecimal bigdecimal valueobj bigdecimal valueobjb bigdecimal valueobj valueobj valueobjb bigdecimal valueobj intvalue valueobjb bigdecimal valueof valueobj comparenumber valueobj valueobj tostring comparestring valueobj bigdecimal comparenumber tostring comparestring valueobj getoperation operation_eq valueobjb compareto operation_gt valueobjb compareto operation_gteq valueobjb compareto operation_le valueobjb compareto operation_leeq valueobjb compareto operation_like valueobjb compareto operation_noteq valueobjb compareto operation_sql illegalargumentexception operation_x valueobjb compareto bigdecimal valueof valueobjb compareto comparenumber tostring illegalargumentexception compare string param value obj comparator return true if operation private boolean compare string object value obj string value1s string value2s m numeric false string value objs string value of value obj string op get operation if operation eq equals op return value objs compare to value1s 0 else if operation gt equals op return value objs compare to value1s 0 else if operation gteq equals op return value objs compare to value1s 0 else if operation le equals op return value objs compare to value1s 0 else if operation leeq equals op return value objs compare to value1s 0 else if operation like equals op return value objs compare to value1s 0 else if operation noteq equals op return value objs compare to value1s 0 else if operation sql equals op throw new illegal argument exception sql not implemented else if operation x equals op if value objs compare to value1s 0 return false to return value objs compare to value2s 0 throw new illegal argument exception unknown operation op valueobj comparestring valueobj m_numeric valueobjs valueof valueobj getoperation operation_eq valueobjs compareto operation_gt valueobjs compareto operation_gteq valueobjs compareto operation_le valueobjs compareto operation_leeq valueobjs compareto operation_like valueobjs compareto operation_noteq valueobjs compareto operation_sql illegalargumentexception operation_x valueobjs compareto valueobjs compareto illegalargumentexception string representation return info public string to string string buffer sb new string buffer mwf next condition sb append get id append seq no append get seq no append return sb to string tostring stringbuffer stringbuffer mwfnextcondition get_id seqno getseqno tostring basic constructor use the set methods public select basic constructor param name set the name attribute public select string name set name name setname basic constructor param name set the name attribute param size set the size attribute public select string name string size set name name set size size setname setsize basic constructor param name set the name attribute param size set the size attribute public select string name int size set name name set size size setname setsize basic constructor param name set the name attribute param element provide a group of strings to be converted to options elements public select string name string element set name name add element element setname addelement basic constructor param name set the name attribute param element provide a group of strings to be converted to options elements public select string name option element set name name add element element setname addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public select add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public select add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public select add element element element add element to registry element return this addelement addelementtoregistry adds a group of elements to the select element param element adds a group of elements to the select element public select add element option element for int x 0 x element length x add element to registry element x return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public select add element string element add element to registry element return this addelement addelementtoregistry creates a group of option elements and adds them to this select param element adds a group of option elements to this select public select add element string element option options new option add element element add element options return this addelement addelement addelement sets the name attribute param name the name attribute public select set name string name add attribute name name return this setname addattribute sets the size attribute param size the size attribute public select set size string size add attribute size size return this setsize addattribute sets the size attribute param size the size attribute public select set size int size set size integer to string size return this setsize setsize tostring sets the multiple value param multiple true or false public select set multiple boolean multiple if multiple true add attribute multiple multiple else remove attribute multiple return this setmultiple addattribute removeattribute sets the tabindex attribute param alt the tabindex attribute public select set tabindex string index add attribute tabindex index return this settabindex addattribute sets the tabindex attribute param alt the tabindex attribute public select set tabindex int index set tabindex integer to string index return this settabindex settabindex tostring sets the disabled value param disabled true or false public select set disabled boolean disabled if disabled true add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute removes an element from the element param hashcode the name of the element to be removed public select remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param the script public void set on load string script add attribute onload script setonload addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param the script public void set on unload string script add attribute onunload script setonunload addattribute the onsubmit event occurs when a form is submitted it only applies to the form element param the script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param the script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param the script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param the script public void set on change string script add attribute onchange script setonchange addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute protected constructor param name display name of the pair protected name pair string name m name name if m name null m name namepair m_name m_name m_name returns display value return name public string get name return m name getname m_name returns key or value as string return string or null comparator interface based on to string value param o1 object 1 param o2 object 2 return compare to value public int compare object o1 object o2 string s1 o1 null o1 to string string s2 o2 null o2 to string return s1 compare to s2 sort order tostring compareto tostring tostring compareto comparator interface based on to string value param o1 object 1 param o2 object 2 return compare to value public int compare name pair o1 name pair o2 string s1 o1 null o1 to string string s2 o2 null o2 to string return s1 compare to s2 sort order tostring compareto namepair namepair tostring tostring compareto comparable interface based on to string value param o the object to be compared return a negative integer zero or a positive integer as this object is less than equal to or greater than the specified object public int compare to object o return compare this o tostring compareto comparable interface based on to string value param o the object to be compared return a negative integer zero or a positive integer as this object is less than equal to or greater than the specified object public int compare to name pair o return compare this o tostring compareto namepair to string returns name return name public string to string return m name tostring m_name to string detail return string in format id name public string to stringx string buffer sb new string buffer getid sb append append m name return sb to string tostringx stringbuffer stringbuffer m_name tostring standard constructor public x m costtype properties ctx int m costtype id string trx name super ctx m costtype id trx name if m costtype id 0 setm costtype id 0 set name null x_m_costtype m_costtype_id trxname m_costtype_id trxname m_costtype_id setm_costtype_id setname load constructor public x m costtype properties ctx result set rs string trx name super ctx rs trx name x_m_costtype resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m costtype append get id append return sb to string tostring stringbuffer stringbuffer x_m_costtype get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set cost type type of cost e g current plan future public void setm costtype id int m costtype id if m costtype id 1 throw new illegal argument exception m costtype id is mandatory set valuenocheck m costtype id new integer m costtype id setm_costtype_id m_costtype_id m_costtype_id illegalargumentexception m_costtype_id set_valuenocheck m_costtype_id m_costtype_id get cost type type of cost e g current plan future public int getm costtype id integer ii integer get value m costtype id if ii null return 0 return ii int value getm_costtype_id get_value m_costtype_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c doctype id p c doctype id para i get parameter as int else log log level severe unknown parameter name p c rfq id getrecord id processinfoparameter getparameter getparametername getparameter c_doctype_id p_c_doctype_id getparameterasint p_c_rfq_id getrecord_id process create purchase order s for the resonse s and lines marked as selected winner using the selected purchase quantity in rfq line quantity if a response is marked as selected winner all lines are created and selected winner of other responses ignored if there is no response marked as selected winner the lines are used return message protected string do it throws exception m rfq rfq new m rfq get ctx p c rfq id get trxname if rfq get id 0 throw new illegal argument exception no rfq found log info rfq to string complete m rfq response responses rfq get responses true true log config responses responses length if responses length 0 throw new illegal argument exception no completed rfq responses found winner for entire rfq for int i 0 i responses length i m rfq response response responses i if response is selected winner continue mb partner bp new mb partner get ctx response getc bpartner id get trxname log config winner bp m order order new m order get ctx 0 get trxname order set isso trx false if p c doctype id 0 order setc doctypetarget id p c doctype id else order setc doctypetarget id order setb partner bp order setc bpartner location id response getc bpartner location id order setsalesrep id rfq getsalesrep id if response get date work complete null order set date promised response get date work complete else if rfq get date work complete null order set date promised rfq get date work complete order save m rfq response line lines response get lines false for int j 0 j lines length j respones line m rfq response line line lines j if line is active continue m rfq response line qty qtys line get qtys false response line qty for int k 0 k qtys length k m rfq response line qty qty qtys k create po lline for all purchase line qtys if qty get rfq line qty is active qty get rfq line qty is purchase qty m order line ol new m order line order ol setm product id line get rfq line getm product id qty get rfq line qty getc uom id ol set description line get description ol set qty qty get rfq line qty get qty big decimal price qty get net amt ol set price price ol save response setc order id order getc order id response save return order get document no selected winner on line level int no orders 0 for int i 0 i responses length i m rfq response response responses i mb partner bp null m order order null for all response lines m rfq response line lines response get lines false for int j 0 j lines length j m rfq response line line lines j if line is active line is selected winner continue new different bp if bp null bp new mb partner get ctx response getc bpartner id get trxname order null log config line line winner bp new order if order null order new m order get ctx 0 get trxname order set isso trx false order setc doctypetarget id order setb partner bp order setc bpartner location id response getc bpartner location id order setsalesrep id rfq getsalesrep id order save no orders add log 0 null null order get document no for all qtys m rfq response line qty qtys line get qtys false for int k 0 k qtys length k m rfq response line qty qty qtys k if qty get rfq line qty is active qty get rfq line qty is purchase qty m order line ol new m order line order ol setm product id line get rfq line getm product id qty get rfq line qty getc uom id ol set description line get description ol set qty qty get rfq line qty get qty big decimal price qty get net amt ol set price actual price ol save for all qtys for all response lines if order null response setc order id order getc order id response save return no orders doit mrfq mrfq getctx p_c_rfq_id get_trxname get_id illegalargumentexception tostring mrfqresponse getresponses illegalargumentexception mrfqresponse isselectedwinner mbpartner mbpartner getctx getc_bpartner_id get_trxname morder morder getctx get_trxname setissotrx p_c_doctype_id setc_doctypetarget_id p_c_doctype_id setc_doctypetarget_id setbpartner setc_bpartner_location_id getc_bpartner_location_id setsalesrep_id getsalesrep_id getdateworkcomplete setdatepromised getdateworkcomplete getdateworkcomplete setdatepromised getdateworkcomplete mrfqresponseline getlines mrfqresponseline isactive mrfqresponselineqty getqtys mrfqresponselineqty getrfqlineqty isactive getrfqlineqty ispurchaseqty morderline morderline setm_product_id getrfqline getm_product_id getrfqlineqty getc_uom_id setdescription getdescription setqty getrfqlineqty getqty bigdecimal getnetamt setprice setc_order_id getc_order_id getdocumentno noorders mrfqresponse mbpartner morder mrfqresponseline getlines mrfqresponseline isactive isselectedwinner mbpartner getctx getc_bpartner_id get_trxname morder getctx get_trxname setissotrx setc_doctypetarget_id setbpartner setc_bpartner_location_id getc_bpartner_location_id setsalesrep_id getsalesrep_id noorders addlog getdocumentno mrfqresponselineqty getqtys mrfqresponselineqty getrfqlineqty isactive getrfqlineqty ispurchaseqty morderline morderline setm_product_id getrfqline getm_product_id getrfqlineqty getc_uom_id setdescription getdescription setqty getrfqlineqty getqty bigdecimal getnetamt setpriceactual setc_order_id getc_order_id noorders get contents return contents public object get contents return contents getcontents get transaction param trx name trx name param create new if false null is returned if not found return transaction or null public static synchronized trx get string trx name boolean create new if trx name null trx name length 0 throw new illegal argument exception no transaction name if s cache null s cache new c cache string trx trx 10 1 no expiration s cache add vetoable change listener new trx controller trx ret value trx s cache get trx name if ret value null create new ret value new trx trx name s cache put trx name ret value return ret value trxname createnew trxname createnew trxname trxname illegalargumentexception s_cache s_cache ccache s_cache addvetoablechangelistener retvalue s_cache trxname retvalue createnew retvalue trxname s_cache trxname retvalue retvalue create unique transaction name param prefix optional prefix return unique name public static string create trx name string prefix if prefix null prefix length 0 prefix trx prefix system current time millis return prefix createtrxname _ currenttimemillis create unique transaction name return unique name public static string create trx name return create trx name null createtrxname createtrxname transaction constructor param trx name unique name private trx string trx name this trx name null trxname trxname trxname transaction constructor param trx name unique name param con optional connection private trx string trx name connection con log info trx name set trx name trx name set connection con trxname trxname trxname settrxname trxname setconnection get connection return connection public connection get connection log log level all active is active connection m connection if m connection null get new connection set connection db create connection false connection transaction read committed if is active start system err println trx get connection m name m connection trace print stack return m connection getconnection isactive m_connection m_connection setconnection createconnection transaction_read_committed isactive getconnection m_name m_connection printstack m_connection set connection param conn connection private void set connection connection conn if conn null return m connection conn log finest connection conn try m connection set auto commit false catch sql exception e log log level severe connection e setconnection m_connection m_connection setautocommit sqlexception set trx name param trx name transaction name private void set trx name string trx name if trx name null trx name length 0 throw new illegal argument exception no transaction name m trxname trx name trxname settrxname trxname trxname trxname illegalargumentexception m_trxname trxname get name return name public string get trx name return m trxname gettrxname m_trxname start trx return true if trx started public boolean start if m savepoint null m active log warning trx in progress m trxname m savepoint return false m active true try if m connection null m savepoint m connection set savepoint m trxname log info get trx name catch sql exception e log log level severe m trxname e m savepoint null return false return true m_savepoint m_active m_trxname m_savepoint m_active m_connection m_savepoint m_connection setsavepoint m_trxname gettrxname sqlexception m_trxname m_savepoint get savepoint return savepoint or null public savepoint get savepoint return m savepoint getsavepoint m_savepoint transaction is active return true if transaction active public boolean is active return m active isactive m_active rollback return true if success public boolean rollback try if m connection null if m savepoint null m connection rollback else m connection rollback m savepoint log info m trxname m savepoint null m active false return true catch sql exception e log log level severe m trxname e m savepoint null m active false return false m_connection m_savepoint m_connection m_connection m_savepoint m_trxname m_savepoint m_active sqlexception m_trxname m_savepoint m_active release savepoint return true if released public boolean release if m connection null return false m active false if m savepoint null return true try get connection release savepoint m savepoint log fine release get name m savepoint null catch sql exception e log log level severe release e m savepoint null return false return true release commit public boolean commit try if m connection null m connection commit log info m trxname m savepoint null m active false return true catch sql exception e log log level severe m trxname e m savepoint null m active false return false m_connection m_active m_savepoint getconnection releasesavepoint m_savepoint getname m_savepoint sqlexception m_savepoint m_connection m_connection m_trxname m_savepoint m_active sqlexception m_trxname m_savepoint m_active end transaction and close connection return true if success public synchronized boolean close if s cache null s cache remove get trx name if m connection null return true if m savepoint null is active commit close connection try m connection close catch sql exception e log log level severe m trxname e m savepoint null m connection null m active false log config m trxname return true s_cache s_cache gettrxname m_connection m_savepoint isactive m_connection sqlexception m_trxname m_savepoint m_connection m_active m_trxname string representation return info public string to string string buffer sb new string buffer trx sb append get trx name append active append is active append return sb to string tostring stringbuffer stringbuffer gettrxname isactive tostring vetoable change called from c cache to close connections param evt event throws property veto exception public void vetoable change property change event evt throws property veto exception log info evt to string ccache propertyvetoexception vetoablechange propertychangeevent propertyvetoexception tostring protected constructor param m tab m tab v create from invoice m tab m tab super m tab log info m tab to string mtab mtab vcreatefrominvoice mtab mtab mtab mtab tostring dynamic init throws exception if lookups cannot be initialized return true if initialized protected boolean dyn init throws exception log config set title msg get element env get ctx c invoice id false msg translate env get ctx create from parameter bank panel set visible false invoice label set visible false invoice field set visible false locator label set visible false locator field set visible false initb partner true b partner field add vetoable change listener this return true dyninit settitle getelement getctx c_invoice_id getctx createfrom parameterbankpanel setvisible invoicelabel setvisible invoicefield setvisible locatorlabel setvisible locatorfield setvisible initbpartner bpartnerfield addvetoablechangelistener init details load receipts not invoiced param c bpartner id b partner protected void initbp details int c bpartner id log config c bpartner id c bpartner id load shipments receipts completed closed shipment field remove action listener this shipment field remove all items none key name pair pp new key name pair 0 shipment field add item pp display string buffer display new string buffer s document no append db to char s movement date display type date env getad language env get ctx string buffer sql new string buffer select s m inout id append display append from m inout s where s c bpartner id and s isso trx n and s doc status in cl co and s m inout id in select sl m inout id from m inoutline sl left outer join m matchinv mi on sl m inoutline id mi m inoutline id group by sl m inout id mi m inoutline id sl movement qty having sl movement qty sum mi qty and mi m inoutline id is not null or mi m inoutline id is null order by s movement date try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 shipment field add item pp rs close pstmt close catch sql exception e log log level severe sql to string e shipment field set selected index 0 shipment field add action listener this c_bpartner_id bpartner initbpdetails c_bpartner_id c_bpartner_id c_bpartner_id shipmentfield removeactionlistener shipmentfield removeallitems keynamepair keynamepair shipmentfield additem stringbuffer stringbuffer documentno to_char movementdate displaytype getad_language getctx stringbuffer stringbuffer m_inout_id m_inout c_bpartner_id issotrx docstatus m_inout_id m_inout_id m_inoutline m_matchinv m_inoutline_id m_inoutline_id m_inout_id m_inoutline_id movementqty movementqty m_inoutline_id m_inoutline_id movementdate preparedstatement preparestatement tostring setint c_bpartner_id resultset executequery keynamepair getint getstring shipmentfield additem sqlexception tostring shipmentfield setselectedindex shipmentfield addactionlistener action listener param e event public void action performed action event e super action performed e if m actionactive return m actionactive true log config action e get action command order if e get source equals order field key name pair pp key name pair order field get selected item int c order id 0 if pp null c order id pp get key set invoice and shipment to null invoice field set selected index 1 shipment field set selected index 1 load order c order id true shipment else if e get source equals shipment field key name pair pp key name pair shipment field get selected item int m inout id 0 if pp null m inout id pp get key set order and invoice to null order field set selected index 1 invoice field set selected index 1 load shipment m inout id m actionactive false actionperformed actionevent actionperformed m_actionactive m_actionactive getactioncommand getsource orderfield keynamepair keynamepair orderfield getselecteditem c_order_id c_order_id getkey invoicefield setselectedindex shipmentfield setselectedindex loadorder c_order_id getsource shipmentfield keynamepair keynamepair shipmentfield getselecteditem m_inout_id m_inout_id getkey orderfield setselectedindex invoicefield setselectedindex loadshipment m_inout_id m_actionactive change listener param e event public void vetoable change property change event e log config e get property name e get new value b partner load order invoice shipment if e get property name c bpartner id int c bpartner id integer e get new value int value initb partnerois c bpartner id true table changed null vetoablechange propertychangeevent getpropertyname getnewvalue bpartner getpropertyname c_bpartner_id c_bpartner_id getnewvalue intvalue initbpartnerois c_bpartner_id tablechanged load data shipment not invoiced param m inout id in out private void load shipment int m inout id log config m inout id m inout id m inout new m in out env get ctx m inout id null p order null if m inout getc order id 0 p order new m order env get ctx m inout getc order id null vector vector object data new vector vector object string buffer sql new string buffer select qty entered l movement qty sum nvl mi qty 0 l qty entered l movement qty l c uom id coalesce uom uom symbol uom name 3 4 l m product id p name l m inoutline id l line 5 8 l c orderline id 9 if env is base language env get ctx c uom sql append from c uom uom m inoutline l m product p m matchinv mi sql append where l c uom id uom c uom id else sql append from c uom trl uom m inoutline l m product p m matchinv mi sql append where l c uom id uom c uom id and uom ad language append env getad language env get ctx append sql append and l m product id p m product id append and l m inoutline id mi m inoutline id append and l m inout id 1 append group by l movement qty l qty entered l movement qty l c uom id coalesce uom uom symbol uom name l m product id p name l m inoutline id l line l c orderline id append order by l line try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m inout id result set rs pstmt execute query while rs next vector object line new vector object 7 line add new boolean false 0 selection big decimal qty movement rs get big decimal 1 big decimal multiplier rs get big decimal 2 big decimal qty entered qty movement multiply multiplier line add new double qty entered double value 1 qty key name pair pp new key name pair rs get int 3 rs get string 4 trim line add pp 2 uom pp new key name pair rs get int 5 rs get string 6 line add pp 3 product int c orderline id rs get int 9 if rs was null line add null 4 order else line add new key name pair c orderline id pp new key name pair rs get int 7 rs get string 8 line add pp 5 ship line add null 6 invoice data add line rs close pstmt close catch sql exception e log log level severe sql to string e load tableois data m_inout_id inout loadshipment m_inout_id m_inout_id m_inout_id m_inout minout getctx m_inout_id p_order m_inout getc_order_id p_order morder getctx m_inout getc_order_id stringbuffer stringbuffer qtyentered movementqty qtyentered movementqty c_uom_id uomsymbol m_product_id m_inoutline_id c_orderline_id isbaselanguage getctx c_uom c_uom m_inoutline m_product m_matchinv c_uom_id c_uom_id c_uom_trl m_inoutline m_product m_matchinv c_uom_id c_uom_id ad_language getad_language getctx m_product_id m_product_id m_inoutline_id m_inoutline_id m_inout_id movementqty qtyentered movementqty c_uom_id uomsymbol m_product_id m_inoutline_id c_orderline_id preparedstatement preparestatement tostring setint m_inout_id resultset executequery bigdecimal qtymovement getbigdecimal bigdecimal getbigdecimal bigdecimal qtyentered qtymovement qtyentered doublevalue keynamepair keynamepair getint getstring keynamepair getint getstring c_orderline_id getint wasnull keynamepair c_orderline_id keynamepair getint getstring sqlexception tostring loadtableois list number of rows selected protected void info table model model data table get model int rows model get row count int count 0 for int i 0 i rows i if boolean model get value at i 0 boolean value count status bar set status line string value of count tablemodel datatable getmodel getrowcount getvalueat booleanvalue statusbar setstatusline valueof save create invoice lines return true if saved protected boolean save log config table model model data table get model int rows model get row count if rows 0 return false invoice int c invoice id integer p mtab get value c invoice id int value m invoice invoice new m invoice env get ctx c invoice id null log config invoice to string if p order null invoice set order p order overwrite header values invoice save if m inout null m inout getm inout id 0 m inout getc invoice id 0 only first time m inout setc invoice id c invoice id m inout save lines for int i 0 i rows i if boolean model get value at i 0 boolean value variable values double d double model get value at i 1 1 qty big decimal qty entered new big decimal d double value key name pair pp key name pair model get value at i 2 2 uom int c uom id pp get key pp key name pair model get value at i 3 3 product int m product id 0 if pp null m product id pp get key int c charge id 0 int c orderline id 0 pp key name pair model get value at i 4 4 order line if pp null c orderline id pp get key int m inoutline id 0 pp key name pair model get value at i 5 5 shipment if pp null m inoutline id pp get key log fine line qty entered qty entered product id m product id orderline id c orderline id inoutline id m inoutline id m invoice line invoice line new m invoice line invoice invoice line setm product id m product id c uom id line uom invoice line set qty qty entered invoiced entered info m order line order line null if c orderline id 0 order line new m order line env get ctx c orderline id null m in out line inout line null if m inoutline id 0 inout line new m in out line env get ctx m inoutline id null if order line null inout line getc orderline id 0 c orderline id inout line getc orderline id order line new m order line env get ctx c orderline id null else m in out line lines m in out line get of order line env get ctx c orderline id null null log fine receipt lines with order line lines length if lines length 0 for int j 0 j lines length j m in out line line lines j if line get qty entered compare to qty entered 0 inout line line m inoutline id inout line getm inoutline id break if inout line null inout line lines 0 first as default m inoutline id inout line getm inoutline id get ship info shipment info if inout line null invoice line set ship line inout line overwrites if inout line get qty entered compare to inout line get movement qty 0 invoice line set qty invoiced qty entered multiply inout line get movement qty divide inout line get qty entered 12 big decimal round half up else log fine no receipt line order info if order line null invoice line set order line order line overwrites if order line get qty entered compare to order line get qty ordered 0 invoice line set qty invoiced qty entered multiply order line get qty ordered divide order line get qty entered 12 big decimal round half up else log fine no order line invoice line set price invoice line set tax if invoice line save log log level severe line not created i if selected for all rows return true tablemodel datatable getmodel getrowcount c_invoice_id p_mtab getvalue c_invoice_id intvalue minvoice minvoice getctx c_invoice_id tostring p_order setorder p_order m_inout m_inout getm_inout_id m_inout getc_invoice_id m_inout setc_invoice_id c_invoice_id m_inout getvalueat booleanvalue getvalueat bigdecimal qtyentered bigdecimal doublevalue keynamepair keynamepair getvalueat c_uom_id getkey keynamepair getvalueat m_product_id m_product_id getkey c_charge_id c_orderline_id keynamepair getvalueat orderline c_orderline_id getkey m_inoutline_id keynamepair getvalueat m_inoutline_id getkey qtyentered qtyentered product_id m_product_id orderline_id c_orderline_id inoutline_id m_inoutline_id minvoiceline invoiceline minvoiceline invoiceline setm_product_id m_product_id c_uom_id invoiceline setqty qtyentered morderline orderline c_orderline_id orderline morderline getctx c_orderline_id minoutline inoutline m_inoutline_id inoutline minoutline getctx m_inoutline_id orderline inoutline getc_orderline_id c_orderline_id inoutline getc_orderline_id orderline morderline getctx c_orderline_id minoutline minoutline getoforderline getctx c_orderline_id orderline minoutline getqtyentered compareto qtyentered inoutline m_inoutline_id inoutline getm_inoutline_id inoutline inoutline m_inoutline_id inoutline getm_inoutline_id inoutline invoiceline setshipline inoutline inoutline getqtyentered compareto inoutline getmovementqty invoiceline setqtyinvoiced qtyentered inoutline getmovementqty inoutline getqtyentered bigdecimal round_half_up orderline invoiceline setorderline orderline orderline getqtyentered compareto orderline getqtyordered invoiceline setqtyinvoiced qtyentered orderline getqtyordered orderline getqtyentered bigdecimal round_half_up invoiceline setprice invoiceline settax invoiceline standard constructor public x ad desktop properties ctx int ad desktop id string trx name super ctx ad desktop id trx name if ad desktop id 0 setad desktop id 0 set name null x_ad_desktop ad_desktop_id trxname ad_desktop_id trxname ad_desktop_id setad_desktop_id setname load constructor public x ad desktop properties ctx result set rs string trx name super ctx rs trx name x_ad_desktop resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad desktop append get id append return sb to string tostring stringbuffer stringbuffer x_ad_desktop get_id tostring set system color color for backgrounds or indicators public void setad color id object ad color id set value ad color id ad color id setad_color_id ad_color_id set_value ad_color_id ad_color_id get system color color for backgrounds or indicators public object getad color id return get value ad color id getad_color_id get_value ad_color_id set desktop collection of workbenches public void setad desktop id int ad desktop id if ad desktop id 1 throw new illegal argument exception ad desktop id is mandatory set valuenocheck ad desktop id new integer ad desktop id setad_desktop_id ad_desktop_id ad_desktop_id illegalargumentexception ad_desktop_id set_valuenocheck ad_desktop_id ad_desktop_id get desktop collection of workbenches public int getad desktop id integer ii integer get value ad desktop id if ii null return 0 return ii int value getad_desktop_id get_value ad_desktop_id intvalue set image system image or icon public void setad image id byte ad image id set value ad image id ad image id setad_image_id ad_image_id set_value ad_image_id ad_image_id get image system image or icon public byte getad image id return byte get value ad image id getad_image_id get_value ad_image_id set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname init web environment to be called from every servlet in the init method or any other web resource to make sure that the environment is properly set param config config return false if initialization problems public static boolean init web servlet config config if s initok log info config get servlet name return true enumeration en config get init parameter names string buffer info new string buffer servlet init parameter append config get servlet name while en has more elements string name en next element to string string value config get init parameter name system set property name value info append n append name append append value boolean ret value init web config get servlet context logging now initiated log info info to string return ret value initweb servletconfig s_initok getservletname getinitparameternames stringbuffer stringbuffer getservletname hasmoreelements nextelement tostring getinitparameter setproperty retvalue initweb getservletcontext tostring retvalue init web only call directly for filters etc param context servlet context return false if initialization problems public static boolean init web servlet context context if s initok log info context get servlet context name return true load environment variables server apps src web web inf web xml enumeration en context get init parameter names string buffer info new string buffer servlet context init parameters append context get servlet context name while en has more elements string name en next element to string string value context get init parameter name system set property name value info append n append name append append value try s initok compiere startup false catch exception ex log log level severe startup ex if s initok return false logging now initiated log info info to string properties ctx new properties m client client m client get ctx 0 m system system m system get ctx client sende mail client get requeste mail server started system get name server info context get server info null return s initok initweb servletcontext s_initok getservletcontextname serverapps getinitparameternames stringbuffer stringbuffer getservletcontextname hasmoreelements nextelement tostring getinitparameter setproperty s_initok s_initok tostring mclient mclient msystem msystem sendemail getrequestemail getname serverinfo getserverinfo s_initok get base directory entrry br adempiere param entry file entry or path return url to entry in base directory public static string get base directory string entry string buffer sb new string buffer dir base if entry starts with sb append sb append entry return sb to string getbasedirectory stringbuffer stringbuffer dir_base startswith tostring get image directory entry br adempiere images param entry file entry or path return url to entry in image directory public static string get image directory string entry string buffer sb new string buffer dir base sb append append dir image if entry starts with sb append sb append entry return sb to string getimagedirectory stringbuffer stringbuffer dir_base dir_image startswith tostring get store directory entry br adempiere store param entry file entry or path return url to entry in store directory public static string get store directory string entry string buffer sb new string buffer dir base sb append append dir store if entry starts with sb append sb append entry return sb to string getstoredirectory stringbuffer stringbuffer dir_base dir_store startswith tostring get logo path p adempiere logo small gif return url to logo public static string get logourl return get base directory logo logosmall getlogourl getbasedirectory get logo image html tag return image public static img get logo return new img get logourl set align align type right set alt a dempiere getlogo getlogourl setalign aligntype setalt adempiere get stylesheet path p adempiere standard css return url of stylesheet public static string get stylesheeturl return get base directory style std getstylesheeturl getbasedirectory style_std get cell content param content optional content return string content or non breaking space public static string get cell content object content if content null return nbsp string str content to string if str length 0 return nbsp return str getcellcontent tostring get cell content param content optional content return string content public static string get cell content int content return string value of content getcellcontent valueof dump servlet config param config config public static void dump servlet config config log config servlet config config get servlet name log config context config get servlet context if c log mgt is level finer return boolean first true enumeration e config get init parameter names while e has more elements if first log finer init parameter first false string key string e next element object value config get init parameter key log finer key value servletconfig servletconfig getservletname getservletcontext clogmgt islevelfiner getinitparameternames hasmoreelements initparameter nextelement getinitparameter dump session param ctx servlet context public static void dump servlet context ctx log config servlet context ctx get servlet context name log config server info ctx get server info if c log mgt is level finer return boolean first true enumeration e ctx get init parameter names while e has more elements if first log finer init parameter first false string key string e next element object value ctx get init parameter key log finer key value first true e ctx get attribute names while e has more elements if first log finer attributes first false string key string e next element object value ctx get attribute key log finer key value servletcontext servletcontext getservletcontextname serverinfo getserverinfo clogmgt islevelfiner getinitparameternames hasmoreelements initparameter nextelement getinitparameter getattributenames hasmoreelements nextelement getattribute dump session param session session public static void dump http session session log config session session get id log config created new timestamp session get creation time if c log mgt is level finer return boolean first true enumeration e session get attribute names while e has more elements if first log finer attributes first false string key string e next element object value session get attribute key log finer key value httpsession getid getcreationtime clogmgt islevelfiner getattributenames hasmoreelements nextelement getattribute dump request param request request public static void dump http servlet request request log config request request get protocol request get method if c log mgt is level finer return log finer server request get server name port request get server port log finer context path request get context path servlet path request get servlet path query request get query string log finer from request get remote host request get remote addr request get remote port user request get remote user log finer uri request get requesturi url request get requesturl log finer auth type request get auth type log finer secure request is secure log finer path info request get path info request get path translated log finer user principal request get user principal boolean first true enumeration e request get header names header names while e has more elements if first log finer header first false string key string e next element object value request get header key log finer key value first true parameter try string enc request get character encoding if enc null request set character encoding web env encoding catch exception ee log log level severe set character encoding web env encoding ee e request get parameter names while e has more elements if first log finer parameter first false string key string e next element string value web util get parameter request key log finer key value first true attributes e request get attribute names while e has more elements if first log finer attributes first false string key string e next element object value request get attribute key log finer key value cookies cookie ccc request get cookies if ccc null for int i 0 i ccc length i if i 0 log finer cookies log finer ccc i get name domain ccc i get domain path ccc i get path max age ccc i get max age log finer encoding request get character encoding log finer locale request get locale first true e request get locales while e has more elements if first log finer locales first false log finer e next element log finer class request get class get name httpservletrequest getprotocol getmethod clogmgt islevelfiner getservername getserverport contextpath getcontextpath servletpath getservletpath getquerystring getremotehost getremoteaddr getremoteport getremoteuser getrequesturi getrequesturl authtype getauthtype issecure pathinfo getpathinfo getpathtranslated userprincipal getuserprincipal getheadernames hasmoreelements nextelement getheader getcharacterencoding setcharacterencoding webenv characterencoding webenv getparameternames hasmoreelements nextelement webutil getparameter getattributenames hasmoreelements nextelement getattribute getcookies getname getdomain getpath maxage getmaxage getcharacterencoding getlocale getlocales hasmoreelements nextelement getclass getname add footer with diagnostics param request request param response response param servlet servlet param body body to add footer public static void add footer http servlet request request http servlet response response http servlet servlet body body body add element new hr body add element new comment footer start command line p footer new p footer add element org compiere compiere date version footer add element new a javascript diag window window info footer add element footer add element new a javascript diag navigator browser info footer add element footer add element new a javascript diag request request info footer add element footer add element new a javascript diag document document info footer add element footer add element new a javascript diag form form info footer add element footer add element new a javascript toggle debug servlet info footer add element footer add element new a javascript diag source show source footer add element n body add element footer add servlet info body add element new br body add element get servlet info request response servlet body add element new script hide debug body add element new comment footer end addfooter httpservletrequest httpservletresponse httpservlet addelement addelement addelement date_version addelement diag_window addelement addelement diag_navigator addelement addelement diag_request addelement addelement diag_document addelement addelement diag_form addelement addelement addelement addelement diag_source addelement addelement servletinfo addelement addelement getservletinfo addelement addelement get information and put it in a html table param request request param response response param servlet servlet return table private static table get servlet info http servlet request request http servlet response response http servlet servlet table table new table table setid debug enumeration e tr space new tr add element new td add element request info table add element space table add element new tr add element new td add element new h3 request info table add element new tr add element new td add element method add element new td add element request get method table add element new tr add element new td add element protocol add element new td add element request get protocol table add element new tr add element new td add element uri add element new td add element request get requesturi table add element new tr add element new td add element context path add element new td add element request get context path table add element new tr add element new td add element servlet path add element new td add element request get servlet path table add element new tr add element new td add element path info add element new td add element request get path info table add element new tr add element new td add element path translated add element new td add element request get path translated table add element new tr add element new td add element query string add element new td add element request get query string table add element new tr add element new td add element content length add element new td add element request get content length table add element new tr add element new td add element content type add element new td add element request get content type table add element new tr add element new td add element character encoding add element new td add element request get character encoding table add element new tr add element new td add element locale add element new td add element request get locale to string table add element new tr add element new td add element schema add element new td add element request get scheme table add element new tr add element new td add element server name add element new td add element request get server name table add element new tr add element new td add element server port add element new td add element request get server port table add element new tr add element new td add element remote user add element new td add element request get remote user table add element new tr add element new td add element remote address add element new td add element request get remote addr table add element new tr add element new td add element remote host add element new td add element request get remote host table add element new tr add element new td add element authorization type add element new td add element request get auth type table add element new tr add element new td add element user principal add element new td add element request get user principal null request get user principal to string table add element new tr add element new td add element is secure add element new td add element request is secure true false request attributes table add element space table add element new tr add element new td add element new h3 request attributes e request get attribute names while e has more elements string name e next element to string string attrib request get attribute name to string table add element new tr add element new td add element name add element new td add element attrib request parameter table add element space table add element new tr add element new td add element new h3 req parameters try string enc request get character encoding if enc null request set character encoding web env encoding catch exception ee log log level severe set character encoding web env encoding ee e request get parameter names while e has more elements string name string e next element string para web util get parameter request name table add element new tr add element new td add element name add element new td add element para request header table add element space table add element new tr add element new td add element new h3 req header e request get header names while e has more elements string name string e next element if name equals cockie string hdr request get header name table add element new tr add element new td add element name add element new td add element hdr request cookies table add element space table add element new tr add element new td add element new h3 req cookies cookie cc request get cookies if cc null for int i 0 i cc length i name and comment table add element new tr add element new td add element cc i get name add element new td add element cc i get value table add element new tr add element new td add element cc i get name comment add element new td add element cc i get comment table add element new tr add element new td add element cc i get name domain add element new td add element cc i get domain table add element new tr add element new td add element cc i get name max age add element new td add element cc i get max age table add element new tr add element new td add element cc i get name path add element new td add element cc i get path table add element new tr add element new td add element cc i get name is secure add element new td add element cc i get secure true false table add element new tr add element new td add element cc i get name version add element new td add element cc i get version cookies request session info table add element space table add element new tr add element new td add element new h3 req session http session session request get session true table add element new tr add element new td add element session id add element new td add element session get id timestamp ts new timestamp session get creation time table add element new tr add element new td add element created add element new td add element ts to string ts new timestamp session get last accessed time table add element new tr add element new td add element accessed add element new td add element ts to string table add element new tr add element new td add element request session id add element new td add element request get requested session id table add element new tr add element new td add element via cookie add element new td add element request is requested session id from cookie table add element new tr add element new td add element via url add element new td add element request is requested session id fromurl table add element new tr add element new td add element valid add element new td add element request is requested session id valid request session attributes table add element space table add element new tr add element new td add element new h3 session attributes e session get attribute names while e has more elements string name string e next element string attrib session get attribute name to string table add element new tr add element new td add element name add element new td add element attrib response info table add element space table add element new tr add element new td add element new h3 response table add element new tr add element new td add element buffer size add element new td add element string value of response get buffer size table add element new tr add element new td add element character encoding add element new td add element response get character encoding table add element new tr add element new td add element locale add element new td add element response get locale null null response get locale to string servlet table add element space table add element new tr add element new td add element new h3 servlet table add element new tr add element new td add element name add element new td add element servlet get servlet name table add element new tr add element new td add element info add element new td add element servlet get servlet info servlet init table add element space table add element new tr add element new td add element new h3 servlet init parameter e servlet get init parameter names same as servlet get servlet config get init parameter names while e has more elements string name string e next element string para servlet get init parameter name table add element new tr add element new td add element name add element new td add element para servlet context tab getservletinfo httpservletrequest httpservletresponse httpservlet addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement getmethod addelement addelement addelement addelement addelement getprotocol addelement addelement addelement addelement addelement getrequesturi addelement addelement addelement addelement addelement getcontextpath addelement addelement addelement addelement addelement getservletpath addelement addelement addelement addelement addelement getpathinfo addelement addelement addelement addelement addelement getpathtranslated addelement addelement addelement addelement addelement getquerystring addelement addelement addelement addelement addelement getcontentlength addelement addelement addelement addelement addelement getcontenttype addelement addelement addelement addelement addelement getcharacterencoding addelement addelement addelement addelement addelement getlocale tostring addelement addelement addelement addelement addelement getscheme addelement addelement addelement addelement addelement getservername addelement addelement addelement addelement addelement getserverport addelement addelement addelement addelement addelement getremoteuser addelement addelement addelement addelement addelement getremoteaddr addelement addelement addelement addelement addelement getremotehost addelement addelement addelement addelement addelement getauthtype addelement addelement addelement addelement addelement getuserprincipal getuserprincipal tostring addelement addelement addelement issecure addelement addelement issecure addelement addelement addelement addelement getattributenames hasmoreelements nextelement tostring getattribute tostring addelement addelement addelement addelement addelement addelement addelement addelement addelement getcharacterencoding setcharacterencoding webenv characterencoding webenv getparameternames hasmoreelements nextelement webutil getparameter addelement addelement addelement addelement addelement addelement addelement addelement addelement getheadernames hasmoreelements nextelement getheader addelement addelement addelement addelement addelement addelement addelement addelement addelement getcookies addelement addelement addelement getname addelement addelement getvalue addelement addelement addelement getname addelement addelement getcomment addelement addelement addelement getname addelement addelement getdomain addelement addelement addelement getname addelement addelement getmaxage addelement addelement addelement getname addelement addelement getpath addelement addelement addelement getname addelement addelement getsecure addelement addelement addelement getname addelement addelement getversion addelement addelement addelement addelement httpsession getsession addelement addelement addelement addelement addelement getid getcreationtime addelement addelement addelement addelement addelement tostring getlastaccessedtime addelement addelement addelement addelement addelement tostring addelement addelement addelement addelement addelement getrequestedsessionid addelement addelement addelement addelement addelement isrequestedsessionidfromcookie addelement addelement addelement addelement addelement isrequestedsessionidfromurl addelement addelement addelement addelement addelement isrequestedsessionidvalid addelement addelement addelement addelement getattributenames hasmoreelements nextelement getattribute tostring addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement addelement valueof getbuffersize addelement addelement addelement addelement addelement getcharacterencoding addelement addelement addelement addelement addelement getlocale getlocale tostring addelement addelement addelement addelement addelement addelement addelement addelement addelement getservletname addelement addelement addelement addelement addelement getservletinfo addelement addelement addelement addelement getinitparameternames getservletconfig getinitparameternames hasmoreelements nextelement getinitparameter addelement addelement addelement addelement addelement prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception log info c invoicepayschedule id getrecord id m invoice pay schedule schedule m invoice pay schedule get invoice pay schedule get ctx 0 getrecord id null if schedule length 0 throw new illegal argument exception invoice pay schedule validate no schedule get invoice m invoice invoice new m invoice get ctx schedule 0 getc invoice id null if invoice get id 0 throw new illegal argument exception invoice pay schedule validate no invoice big decimal total env zero for int i 0 i schedule length i big decimal due schedule i get due amt if due null total total add due boolean valid invoice get grand total compare to total 0 invoice set is pay schedule valid valid invoice save schedule for int i 0 i schedule length i if schedule i is valid valid schedule i set is valid valid schedule i save string msg ok if valid msg grand total invoice get grand total total total difference invoice get grand total subtract total return msg parse translation get ctx msg doit c_invoicepayschedule_id getrecord_id minvoicepayschedule minvoicepayschedule getinvoicepayschedule getctx getrecord_id illegalargumentexception invoicepayschedulevalidate minvoice minvoice getctx getc_invoice_id get_id illegalargumentexception invoicepayschedulevalidate bigdecimal bigdecimal getdueamt getgrandtotal compareto setispayschedulevalid isvalid setisvalid grandtotal getgrandtotal getgrandtotal parsetranslation getctx ide baan constructor public v memo this false false true 60 4000 vmemo standard constructor param column name param mandatory param is read only param is updateable param display length param field length public v memo string column name boolean mandatory boolean is read only boolean is updateable int display length int field length super field length 80 50 super set name column name look and feel install border this text field border this add focus listener this to activate editor create editor set columns display length v string maxdisplay length v string maxdisplay length display length 46 set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal set line wrap true set wrap style word true add focus listener this set input verifier new c input verifier must be set after add focus listener in order to work set mandatory mandatory m columnname column name m fieldlength field length if is read only is updateable set read write false add key listener this popup add mouse listener new vmemo mouseadapter this if column name equals script menu editor new c menu item msg get msg env get ctx script env get image icon script16 gif else menu editor new c menu item msg get msg env get ctx editor env get image icon editor16 gif menu editor add action listener this popup menu add menu editor columnname isreadonly isupdateable displaylength fieldlength vmemo columnname isreadonly isupdateable displaylength fieldlength fieldlength setname columnname lookandfeel installborder textfield addfocuslistener setcolumns displaylength vstring maxdisplay_length vstring maxdisplay_length displaylength setforeground gettextcolor_normal setbackground getfieldbackground_normal setlinewrap setwrapstyleword addfocuslistener setinputverifier cinputverifier addfocuslistener setmandatory m_columnname columnname m_fieldlength fieldlength isreadonly isupdateable setreadwrite addkeylistener addmouselistener vmemo_mouseadapter columnname menueditor cmenuitem getmsg getctx getimageicon menueditor cmenuitem getmsg getctx getimageicon menueditor addactionlistener popupmenu menueditor dispose public void dispose set editor to value param value public void set value object value super set value value m firstchange true always position top set caret position 0 setvalue setvalue m_firstchange setcaretposition property change listener param evt public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue action listener param e public void action performed action event e if e get source menu editor menu editor set enabled false string s null if m columnname equals script s script editor start msg translate env get ctx m columnname get text is editable 0 else s editor start editor this msg translate env get ctx m columnname get text is editable m fieldlength menu editor set enabled true set value s try fire vetoable change m columnname null get text m oldtext get text catch property veto exception pve actionlistener actionperformed actionevent getsource menueditor menueditor setenabled m_columnname scripteditor getctx m_columnname gettext iseditable starteditor getctx m_columnname gettext iseditable m_fieldlength menueditor setenabled setvalue firevetoablechange m_columnname gettext m_oldtext gettext propertyvetoexception action listener interface nop param listener public void add action listener action listener listener addactionlistener actionlistener key listener interface param e public void key typed key event e public void key pressed key event e keytyped keyevent keypressed keyevent escape restore old text indicate change param e public void key released key event e esc if e get key code key event vk escape get text equals m oldtext log fine v memo key released esc set text m oldtext return indicate change if m firstchange m oldtext equals get text log fine v memo key released first change m firstchange false try string text get text fire vetoable change m columnname text null no data committed done when focus lost catch property veto exception pve first change keyreleased keyevent getkeycode keyevent vk_escape gettext m_oldtext vmemo keyreleased settext m_oldtext m_firstchange m_oldtext gettext vmemo keyreleased firstchange m_firstchange gettext firevetoablechange m_columnname propertyvetoexception firstchange focus gained save for escape param e public void focus gained focus event e log config e param string if e get source instanceof v memo request focus else m oldtext get text focusgained focusevent paramstring getsource vmemo requestfocus m_oldtext gettext data binding to m table via grid controller param e public void focus lost focus event e log config v memo focus lost e get source e param string something changed return mtable gridcontroller focuslost focusevent vmemo focuslost getsource paramstring set field window no for value preference nop param m field public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield public boolean verify j component input note we return true no matter what since the input verifier is only introduced to fire vetoable change in due time if get text null m oldtext null return true else if get text equals m oldtext return true try string text get text fire vetoable change m columnname null text m oldtext text return true catch property veto exception pve return true jcomponent inputverifier firevetoablechange gettext m_oldtext gettext m_oldtext gettext firevetoablechange m_columnname m_oldtext propertyvetoexception constructor param adaptee vmemo mouseadapter v memo adaptee this adaptee adaptee vmemo_mouseadapter vmemo mouse listener param e public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource check need for post upgrade return true if post upgrade ran false if there was no need public static boolean after migration properties ctx update ad system set is just migrated y m system system m system get ctx if system is just migrated return false role update log info role string sql select from ad role prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m role role new m role ctx rs null role update access records rs close pstmt close pstmt null catch exception e log log level severe 1 e try if pstmt null pstmt close pstmt null catch exception e pstmt null language check log info language m language maintain ctx sequence check log info sequence sequence check validate ctx costing setup log info costing m acct schema ass m acct schema get client acct schema ctx 0 for int i 0 i ass length i ass i check costing ass i save try class clazz class for name org compiere migrate data clazz new instance catch exception e log log level severe data e reset flag system set is just migrated false return system save aftermigration ad_system isjustmigrated msystem msystem isjustmigrated ad_role preparedstatement preparestatement resultset executequery mrole mrole updateaccessrecords mlanguage sequencecheck macctschema macctschema getclientacctschema checkcosting forname migratedata newinstance setisjustmigrated update mail settings for system client and system user public static void update mail get property file string env name ini get compiere home if env name null return env name file separator adempiere env properties file env file new file env name if env file exists return properties env new properties try file input stream in new file input stream env file env load in in close catch exception e return string updated env get property compiere mail updated if updated null updated equals y return see org compiere install configuration data string server env get property compiere mail server if server null server length 0 return string admine mail env get property compiere admin email if admine mail null admine mail length 0 return string mail user env get property compiere mail user if mail user null mail user length 0 return string mail password env get property compiere mail password if mail password null mail password length 0 return string buffer sql new string buffer update ad client set append smtp host append db to string server append requeste mail append db to string admine mail append request user append db to string mail user append request userpw append db to string mail password append issmtp authorization y where ad client id 0 int no db execute update sql to string null sql new string buffer update ad user set append e mail append db to string admine mail append e mail user append db to string mail user append e mail userpw append db to string mail user append where ad user id in 0 100 no db execute update sql to string null try env set property compiere mail updated y file output stream out new file output stream env file env store out out flush out close catch exception e updatemail envname getcompierehome envname envname adempiereenv envfile envname envfile fileinputstream fileinputstream envfile getproperty compiere_mail_updated configurationdata getproperty compiere_mail_server adminemail getproperty compiere_admin_email adminemail adminemail mailuser getproperty compiere_mail_user mailuser mailuser mailpassword getproperty compiere_mail_password mailpassword mailpassword stringbuffer stringbuffer ad_client smtphost to_string requestemail to_string adminemail requestuser to_string mailuser requestuserpw to_string mailpassword issmtpauthorization ad_client_id executeupdate tostring stringbuffer ad_user email to_string adminemail emailuser to_string mailuser emailuserpw to_string mailuser ad_user_id executeupdate tostring setproperty compiere_mail_updated fileoutputstream fileoutputstream envfile set connection param cc connection public static void setdb target c connection cc if cc null throw new illegal argument exception connection is null if s cc null s cc equals cc return db close target if s cc null s cc cc synchronized s cc use as mutex s cc cc s connections null s connectionrw null s cc set data source log config s cc ds s cc is data source trace print stack setdbtarget cconnection illegalargumentexception s_cc s_cc closetarget s_cc s_cc s_cc s_cc s_connections s_connectionrw s_cc setdatasource s_cc s_cc isdatasource printstack is there a connection to the database return true if connected to database public static boolean is connected boolean success false c log error buffer eb c log error buffer get false if eb null eb is issue error eb set issue error false else eb null don t reset try success get connectionrw null try to get a connection catch exception e success false if eb null eb set issue error true return success isconnected clogerrorbuffer clogerrorbuffer isissueerror setissueerror getconnectionrw setissueerror return pooled r w auto commit serializable connection for transaction control use trx get connection return connection r w public static connection get connectionrw check health of connection try if s connectionrw null else if s connectionrw is closed log finest closed s connectionrw null else if s connectionrw instanceof oracle connection oracle connection s connectionrw ping database 1 0 log warning no ping s connectionrw null else if s connectionrw get transaction isolation connection transaction read committed s connectionrw set transaction isolation connection transaction read committed catch exception e s connectionrw null get new if s connectionrw null s connectionrw s cc get connection true connection transaction read committed log finest con s connectionrw if s connectionrw null throw new unsupported operation exception no db connection system err println db get connectionrw s connectionrw trace print stack return s connectionrw autocommit getconnection getconnectionrw s_connectionrw s_connectionrw isclosed s_connectionrw s_connectionrw oracleconnection oracleconnection s_connectionrw pingdatabase s_connectionrw s_connectionrw gettransactionisolation transaction_read_committed s_connectionrw settransactionisolation transaction_read_committed s_connectionrw s_connectionrw s_connectionrw s_cc getconnection transaction_read_committed s_connectionrw s_connectionrw unsupportedoperationexception dbconnection getconnectionrw s_connectionrw printstack s_connectionrw return everytime a new r w no auto commit serializable connection to be used to id return connection r w public static connection get connectionid if s connectionid null try if s connectionid is closed s connectionid null catch exception e s connectionid null if s connectionid null s connectionid s cc get connection false connection transaction read committed if s connectionid null throw new unsupported operation exception no db connection log log level all s connectionid to string return s connectionid autocommit getconnectionid s_connectionid s_connectionid isclosed s_connectionid s_connectionid s_connectionid s_connectionid s_cc getconnection transaction_read_committed s_connectionid unsupportedoperationexception dbconnection s_connectionid tostring s_connectionid return read committed read only from pool return connection r o public static connection get connectionro try synchronized s cc use as mutex as s connection is null the first time if s connections null s connections create connections connection transaction read committed see below catch exception e log log level severe ro e check health of connection int pos s concount int connection no pos s concachesize connection connection s connections connection no try if connection null else if connection is closed row set close also closes connection system out println db get connectionro closed connection no connection null else if connection instanceof oracle connection oracle connection connection ping database 1 0 log warning no ping connection no connection null else if connection is read only connection set read only true if connection get transaction isolation connection transaction read committed connection set transaction isolation connection transaction read committed catch exception e log severe connection no e to string connection null get new if connection null log finest replacing connection connection no connection s cc get connection true connection transaction read committed see above try if connection null connection set read only true catch exception e log severe cannot set to r o e s connections connection no connection if connection null throw new unsupported operation exception db get connectionro nodb connection log log level all connection no connection system err println db get connectionro connection return connection getconnectionro s_cc s_connection s_connections s_connections createconnections transaction_read_committed s_concount connectionno s_concachesize s_connections connectionno isclosed rowset getconnectionro connectionno oracleconnection oracleconnection pingdatabase connectionno isreadonly setreadonly gettransactionisolation transaction_read_committed settransactionisolation transaction_read_committed connectionno tostring connectionno s_cc getconnection transaction_read_committed setreadonly s_connections connectionno unsupportedoperationexception getconnectionro nodbconnection connectionno getconnectionro create new connection the connection must be closed explicitly by the application param auto commit auto commit param trx level connection transaction read uncommitted connection transaction read committed connection transaction repeatable read or connection transaction read committed return connection connection public static connection create connection boolean auto commit int trx level connection conn s cc get connection auto commit trx level if c log mgt is level finest try log finest s cc get connectionurl userid s cc get db uid auto commit conn get auto commit auto commit trx iso conn get transaction isolation trx level catch exception e return conn autocommit trxlevel transaction_read_uncommitted transaction_read_committed transaction_repeatable_read transaction_read_committed createconnection autocommit trxlevel s_cc getconnection autocommit trxlevel clogmgt islevelfinest s_cc getconnectionurl s_cc getdbuid autocommit getautocommit autocommit trxiso gettransactionisolation trxlevel create new set of r o connections r o connection might not be supported by db param trx level connection transaction read uncommitted connection transaction read committed connection transaction repeatable read or connection transaction read committed return array of connections size based on s concachesize private static connection create connections int trx level log finest s concachesize s cc get connectionurl userid s cc get db uid trx level c connection get transaction isolation info trx level connection cons new connection s concachesize try for int i 0 i s concachesize i cons i s cc get connection true trx level auto commit if cons i null log warning connection is null don t use log catch exception e log severe e get message return cons trxlevel transaction_read_uncommitted transaction_read_committed transaction_repeatable_read transaction_read_committed s_concachesize createconnections trxlevel s_concachesize s_cc getconnectionurl s_cc getdbuid trxlevel cconnection gettransactionisolationinfo trxlevel s_concachesize s_concachesize s_cc getconnection trxlevel getmessage get database driver access to database specific functionality return compiere database driver public static compiere database get database if s cc null return s cc get database log severe no database return null compieredatabase getdatabase s_cc s_cc getdatabase do we have an oracle db return true if connected to oracle public static boolean is oracle if s cc null return s cc is oracle log severe no database return false isoracle s_cc s_cc isoracle do we have a sybase db return true if connected to sybase public static boolean is sybase if s cc null return s cc is sybase log severe no database return false issybase s_cc s_cc issybase begin vpj cd e evolution 02 07 2005 postgresql do we have a postgre db return true if connected to postgresql public static boolean is postgresql if s cc null return s cc is postgresql log severe no database return false ispostgresql s_cc s_cc ispostgresql get database info return info public static string get database info if s cc null return s cc getdb info return no database getdatabaseinfo s_cc s_cc getdbinfo check database version with code version param ctx context return true if database version date is the same public static boolean is databaseok properties ctx check version string version string sql select version from ad system try prepared statement pstmt prepare statement sql null result set rs pstmt execute query if rs next version rs get string 1 rs close pstmt close catch sql exception e log log level severe problem with ad system table run system sql script e to string return false log info db version version identical db version if compiere db version equals version return true string ad message database version error string title org compiere compiere get name msg get msg ctx ad message true code assumes database version 0 but database has version 1 string msg msg get msg ctx ad message complete message msg message format format msg new object compiere db version version object options ui manager get option pane no button text migrate int no j option pane show option dialog null msg title j option pane default option j option pane error message ui manager get icon option pane error icon options options 0 if no 1 j option pane show message dialog null start run migrate in utils n see http www compiere com maintain title j option pane information message env exit env 1 return false isdatabaseok ad_system preparedstatement preparestatement resultset executequery getstring sqlexception ad_system tostring db_version db_version ad_message databaseversionerror getname getmsg ad_message getmsg ad_message messageformat db_version uimanager optionpane nobuttontext joptionpane showoptiondialog joptionpane default_option joptionpane error_message uimanager geticon optionpane erroricon joptionpane showmessagedialog run_migrate nsee joptionpane information_message exitenv close target public static void close target boolean closed false ro connection if s connections null for int i 0 i s concachesize i try if s connections i null closed true s connections i close catch sql exception e log warning i e get message s connections i null s connections null rw connection try if s connectionrw null closed true s connectionrw close catch sql exception e log log level severe r w e s connectionrw null c connection if s cc null closed true s cc set data source null s cc null if closed log fine closed closetarget s_connections s_concachesize s_connections s_connections sqlexception getmessage s_connections s_connections s_connectionrw s_connectionrw sqlexception s_connectionrw cconnection s_cc s_cc setdatasource s_cc prepare forward read only call param ro sql sql ro return callable statement public static callable statement prepare call string ro sql if ro sql null ro sql length 0 throw new illegal argument exception required parameter missing ro sql string sql get database convert statement ro sql try return get connectionro prepare call sql result set type forward only result set concur read only catch sql exception e log log level severe sql e throw new db exception e return null ro_sql callablestatement preparecall ro_sql ro_sql ro_sql illegalargumentexception ro_sql getdatabase convertstatement ro_sql getconnectionro preparecall resultset type_forward_only resultset concur_read_only sqlexception dbexception prepare read only statement param ro sql sql ro return prepared statement deprecated public static c prepared statement prepare statement string ro sql return prepare statement ro sql result set type forward only result set concur read only null ro_sql cpreparedstatement preparestatement ro_sql preparestatement ro_sql resultset type_forward_only resultset concur_read_only prepare read only statement param ro sql sql ro param trx name transaction return prepared statement public static c prepared statement prepare statement string ro sql string trx name return prepare statement ro sql result set type forward only result set concur read only trx name ro_sql trxname cpreparedstatement preparestatement ro_sql trxname preparestatement ro_sql resultset type_forward_only resultset concur_read_only trxname prepare statement param sql sql statement param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable return prepared statement r o or r w depending on concur deprecated public static c prepared statement prepare statement string sql int result set type int result set concurrency return prepare statement sql result set type result set concurrency null resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable cpreparedstatement preparestatement resultsettype resultsetconcurrency preparestatement resultsettype resultsetconcurrency prepare statement param sql sql statement param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable param trx name transaction name return prepared statement r o or r w depending on concur public static c prepared statement prepare statement string sql int result set type int result set concurrency string trx name if sql null sql length 0 throw new illegal argument exception db prepare statement no sql return new c prepared statement result set type result set concurrency sql trx name resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable trxname cpreparedstatement preparestatement resultsettype resultsetconcurrency trxname illegalargumentexception preparestatement cpreparedstatement resultsettype resultsetconcurrency trxname create read only statement return statement public static statement create statement return create statement result set type forward only result set concur read only null createstatement createstatement resultset type_forward_only resultset concur_read_only create statement param result set type result set type forward only result set type scroll insensitive result set type scroll sensitive param result set concurrency result set concur read only or result set concur updatable param trx name transaction name return statement either r w ir r o depending on concur public static statement create statement int result set type int result set concurrency string trx name return new c statement result set type result set concurrency trx name resultsettype resultset type_forward_only resultset type_scroll_insensitive resultset type_scroll_sensitive resultsetconcurrency resultset concur_read_only resultset concur_updatable trxname createstatement resultsettype resultsetconcurrency trxname cstatement resultsettype resultsetconcurrency trxname execute update saves db execute error in log param sql sql return number of rows updated or 1 if error deprecated public static int execute update string sql return execute update sql null false null dbexecuteerror executeupdate executeupdate execute update saves db execute error in log param sql sql param trx name optional transaction name return number of rows updated or 1 if error public static int execute update string sql string trx name return execute update sql null false trx name dbexecuteerror trxname executeupdate trxname executeupdate trxname execute update saves db execute error in log param sql sql param ignore error if true no execution error is reported return number of rows updated or 1 if error deprecated public static int execute update string sql boolean ignore error return execute update sql null ignore error null dbexecuteerror ignoreerror executeupdate ignoreerror executeupdate ignoreerror execute update saves db execute error in log param sql sql param ignore error if true no execution error is reported return number of rows updated or 1 if error public static int execute update string sql boolean ignore error string trx name return execute update sql null ignore error trx name dbexecuteerror ignoreerror executeupdate ignoreerror trxname executeupdate ignoreerror trxname execute update saves db execute error in log param sql sql param param int param param trx name trx return number of rows updated or 1 if error public static int execute update string sql int param string trx name return execute update sql new object new integer param false trx name dbexecuteerror trxname executeupdate trxname executeupdate trxname execute update saves db execute error in log param sql sql param param int parameter param ignore error if true no execution error is reported return number of rows updated or 1 if error public static int execute update string sql int param boolean ignore error string trx name return execute update sql new object new integer param ignore error trx name dbexecuteerror ignoreerror executeupdate ignoreerror trxname executeupdate ignoreerror trxname execute update saves db execute error in log param sql sql param ignore error if true no execution error is reported param trx name optional transaction name return number of rows updated or 1 if error public static int execute update string sql object params boolean ignore error string trx name if sql null sql length 0 throw new illegal argument exception required parameter missing sql int no 1 c prepared statement cs new c prepared statement result set type forward only result set concur updatable sql trx name converted in call try set parameter if params null for int i 0 i params length i object param params i if param instanceof string cs set string i 1 string param else if param instanceof integer cs set int i 1 integer param int value else if param instanceof big decimal cs set big decimal i 1 big decimal param else if param instanceof timestamp cs set timestamp i 1 timestamp param no cs execute update no transaction commit if trx name null cs commit local commit connection conn cs get connection if conn null conn get auto commit is null for remote conn commit catch sql exception e if ignore error log log level severe cs get sql trx name e get message else log log level severe cs get sql trx name e log save error db execute error e throw new db exception e finally always close cursor try cs close catch sql exception e2 log log level severe cannot close statement return no dbexecuteerror ignoreerror trxname executeupdate ignoreerror trxname illegalargumentexception cpreparedstatement cpreparedstatement resultset type_forward_only resultset concur_updatable trxname setstring setint intvalue bigdecimal setbigdecimal bigdecimal settimestamp executeupdate trxname getconnection getautocommit sqlexception ignoreerror getsql trxname getmessage getsql trxname saveerror dbexecuteerror dbexception sqlexception execute multiple update statements saves last db execute error in log param sql multiple sql statements separated by sqlstatement separator param ignore error if true no execution error is reported param trx name optional transaction name return number of rows updated or 1 if error public static int execute update multiple string sql boolean ignore error string trx name if sql null sql length 0 throw new illegal argument exception required parameter missing sql int index sql index of sqlstatement separator if index 1 return execute update sql null ignore error trx name int no 0 string statements sql split sqlstatement separator for int i 0 i statements length i log fine statements i no execute update statements i null ignore error trx name return no dbexecuteerror sqlstatement_separator ignoreerror trxname executeupdatemultiple ignoreerror trxname illegalargumentexception indexof sqlstatement_separator executeupdate ignoreerror trxname sqlstatement_separator executeupdate ignoreerror trxname execute update and throw exception param sql sql return number of rows updated or 1 if error throws sql exception public static int execute update ex string sql string trx name throws sql exception if sql null sql length 0 throw new illegal argument exception required parameter missing sql string sql get database convert statement sql int no 1 sql exception ex null connection conn null statement stmt null try trx trx trx name null null trx get trx name true if trx null conn trx get connection else conn db get connectionrw stmt conn create statement no stmt execute update sql catch sql exception e log log level severe sql trx name e ex e finally always close cursor try stmt close catch sql exception e2 log log level severe cannot close statement if ex null throw new sql exception ex get message ex getsql state ex get error code return no sqlexception executeupdateex trxname sqlexception illegalargumentexception getdatabase convertstatement sqlexception trxname trxname getconnection getconnectionrw createstatement executeupdate sqlexception trxname sqlexception sqlexception getmessage getsqlstate geterrorcode commit commit on rw connection is not required as rw connection is auto commit exception with transaction param throw exception if true re throws exception param trx name transaction name return true if not needed or success throws sql exception public static boolean commit boolean throw exception string trx name throws sql exception try connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else conn db get connectionrw if conn get auto commit conn commit catch sql exception e log log level severe trx name e if throw exception throw e return false return true autocommit throwexception trxname sqlexception throwexception trxname sqlexception trxname trxname getconnection getconnectionrw getautocommit sqlexception trxname throwexception rollback rollback on rw connection is has no effect as rw connection is auto commit exception with transaction param throw exception if true re throws exception param trx name transaction name return true if not needed or success throws sql exception public static boolean rollback boolean throw exception string trx name throws sql exception try connection conn null trx trx trx name null null trx get trx name true if trx null conn trx get connection else conn db get connectionrw if conn get auto commit conn rollback catch sql exception e log log level severe trx name e if throw exception throw e return false return true autocommit throwexception trxname sqlexception throwexception trxname sqlexception trxname trxname getconnection getconnectionrw getautocommit sqlexception trxname throwexception get row set when a rowset is closed it also closes the underlying connection if the created row set is transfered by rmi closing it makes no difference param sql sql param local local row set own connection return row set or null public static row set get row set string sql boolean local row set ret value null bugfix gunther hoppe 02 09 2005 add vpj cd e evolution begin c statementvo info new c statementvo row set type scroll insensitive row set concur read only sql c statementvo info new c statementvo row set type scroll insensitive row set concur read only db get database convert statement sql end add vpj cd e evolution c prepared statement stmt new c prepared statement info if local ret value stmt local getrowset else ret value stmt remote getrowset return ret value rowset rowset rowset getrowset rowset retvalue cstatementvo cstatementvo rowset type_scroll_insensitive rowset concur_read_only cstatementvo cstatementvo rowset type_scroll_insensitive rowset concur_read_only getdatabase convertstatement cpreparedstatement cpreparedstatement retvalue local_getrowset retvalue remote_getrowset retvalue get value from sql param trx name trx param sql sql return first value or 1 public static int getsql value string trx name string sql int ret value 1 prepared statement pstmt null try pstmt prepare statement sql trx name result set rs pstmt execute query if rs next ret value rs get int 1 else log fine no value sql rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname getsqlvalue trxname retvalue preparedstatement preparestatement trxname resultset executequery retvalue getint retvalue get value from sql param trx name trx param sql sql param int param1 parameter 1 return first value or 1 public static int getsql value string trx name string sql int int param1 int ret value 1 prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set int 1 int param1 result set rs pstmt execute query if rs next ret value rs get int 1 else log config no value sql param1 int param1 rs close pstmt close pstmt null catch exception e log log level severe sql param1 int param1 trx name e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname int_param1 getsqlvalue trxname int_param1 retvalue preparedstatement preparestatement trxname setint int_param1 resultset executequery retvalue getint int_param1 int_param1 trxname retvalue get value from sql param trx name trx param sql sql param int param1 parameter 1 param int param2 parameter 2 return first value or 1 public static int getsql value string trx name string sql int int param1 int int param2 int ret value 1 prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set int 1 int param1 pstmt set int 2 int param2 result set rs pstmt execute query if rs next ret value rs get int 1 else log info no value sql param1 int param1 param2 int param2 rs close pstmt close pstmt null catch exception e log log level severe sql param1 int param1 param2 int param2 trx name e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname int_param1 int_param2 getsqlvalue trxname int_param1 int_param2 retvalue preparedstatement preparestatement trxname setint int_param1 setint int_param2 resultset executequery retvalue getint int_param1 int_param2 int_param1 int_param2 trxname retvalue get value from sql param trx name trx param sql sql param str param1 parameter 1 return first value or 1 public static int getsql value string trx name string sql string str param1 int ret value 1 prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set string 1 str param1 result set rs pstmt execute query if rs next ret value rs get int 1 else log info no value sql param1 str param1 rs close pstmt close pstmt null catch exception e log log level severe sql param1 str param1 e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname str_param1 getsqlvalue trxname str_param1 retvalue preparedstatement preparestatement trxname setstring str_param1 resultset executequery retvalue getint str_param1 str_param1 retvalue get value from sql param trx name trx param sql sql param int param1 parameter 1 param s param2 parameter 2 return first value or 1 public static int getsql value string trx name string sql int int param1 string s param2 int ret value 1 prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set int 1 int param1 pstmt set string 2 s param2 result set rs pstmt execute query if rs next ret value rs get int 1 else log info no value sql param1 int param1 param2 s param2 rs close pstmt close pstmt null catch exception e log log level severe sql param1 int param1 param2 s param2 e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname int_param1 s_param2 getsqlvalue trxname int_param1 s_param2 retvalue preparedstatement preparestatement trxname setint int_param1 setstring s_param2 resultset executequery retvalue getint int_param1 s_param2 int_param1 s_param2 retvalue get string value from sql param trx name trx param sql sql param int param1 parameter 1 return first value or null public static string getsql value string string trx name string sql int int param1 string ret value null prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set int 1 int param1 result set rs pstmt execute query if rs next ret value rs get string 1 else log info no value sql param1 int param1 rs close pstmt close pstmt null catch exception e log log level severe sql param1 int param1 e finally try if pstmt null pstmt close catch exception e pstmt null return ret value trxname int_param1 getsqlvaluestring trxname int_param1 retvalue preparedstatement preparestatement trxname setint int_param1 resultset executequery retvalue getstring int_param1 int_param1 retvalue get big decimal value from sql param trx name trx param sql sql param int param1 parameter 1 return first value or null public static big decimal getsql valuebd string trx name string sql int int param1 big decimal ret value null prepared statement pstmt null try pstmt prepare statement sql trx name pstmt set int 1 int param1 result set rs pstmt execute query if rs next ret value rs get big decimal 1 else log info no value sql param1 int param1 rs close pstmt close pstmt null catch exception e log log level severe sql param1 int param1 trx name e finally try if pstmt null pstmt close catch exception e pstmt null return ret value bigdecimal trxname int_param1 bigdecimal getsqlvaluebd trxname int_param1 bigdecimal retvalue preparedstatement preparestatement trxname setint int_param1 resultset executequery retvalue getbigdecimal int_param1 int_param1 trxname retvalue get array of key name pairs param sql select with id name as first second column param optional if true 1 is added return array of key name pairs public static key name pair get key name pairs string sql boolean optional prepared statement pstmt null array list key name pair list new array list key name pair if optional list add new key name pair 1 try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new key name pair rs get int 1 rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null key name pair ret value new key name pair list size list to array ret value s log fine get key name pairs ret value length return ret value keynamepair getkeynamepairs preparedstatement arraylist keynamepair arraylist keynamepair keynamepair preparestatement resultset executequery keynamepair getint getstring keynamepair retvalue keynamepair toarray retvalue s_log getkeynamepairs retvalue retvalue is sales order trx assumes sales order queries isso trx of table with where clause param table name table param where clause where clause return true default or false if tested that not so public static boolean isso trx string table name string where clause if table name null table name length 0 log severe no table name return true if where clause null where clause length 0 log severe no where clause return true boolean isso trx true string sql select isso trx from table name where where clause prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next isso trx y equals rs get string 1 rs close pstmt close pstmt null catch exception e if table name ends with line string hdr table name substring 0 table name index of line sql select isso trx from hdr h where exists select from table name l where h hdr id l hdr id and where clause prepared statement pstmt2 null try pstmt2 db prepare statement sql null result set rs2 pstmt2 execute query if rs2 next isso trx y equals rs2 get string 1 rs2 close pstmt2 close pstmt2 null catch exception ee log finest sql e get message try if pstmt2 null pstmt2 close pstmt2 null catch exception ee pstmt2 null else log finest sql e get message try if pstmt null pstmt close pstmt null catch exception e pstmt null return isso trx issotrx tablename whereclause issotrx tablename whereclause tablename tablename tablename whereclause whereclause issotrx issotrx tablename whereclause preparedstatement preparestatement resultset executequery issotrx getstring tablename endswith tablename tablename indexof issotrx tablename _id _id whereclause preparedstatement preparestatement resultset executequery issotrx getstring getmessage getmessage issotrx get next number for key column 0 is error param ctx client param table name table name param trx name optionl transaction name return next no public static int get nextid properties ctx string table name string trx name if ctx null throw new illegal argument exception context missing if table name null table name length 0 throw new illegal argument exception table name missing return get nextid env getad client id ctx table name trx name tablename trxname getnextid tablename trxname illegalargumentexception tablename tablename illegalargumentexception tablename getnextid getad_client_id tablename trxname get next number for key column 0 is error param ad client id client param table name table name param trx name optional transaction name return next no public static int get nextid int ad client id string table name string trx name if trx name null trx name length 0 is remote objects server server c connection get get server try if server null see server bean int id server get nextid ad client id table name null log finest server id if id 0 throw new db exception no nextid return id log log level severe apps server not found table name catch remote exception ex log log level severe apps server error ex try locally int id m sequence get nextid ad client id table name trx name tries 3 times if id 0 throw new db exception no nextid id return id ad_client_id tablename trxname getnextid ad_client_id tablename trxname trxname trxname isremoteobjects cconnection getserver serverbean getnextid ad_client_id tablename dbexception appsserver tablename remoteexception appsserver msequence getnextid ad_client_id tablename trxname dbexception get document no based on document type param c doctype id document type param trx name optional transaction name return document no or null public static string get document no int c doctype id string trx name if trx name null trx name length 0 is remote objects server server c connection get get server try if server null see server bean string dn server get document no c doctype id trx name log finest server dn if dn null return dn log log level severe apps server not found c doctype id catch remote exception ex log log level severe apps server error ex fallback string dn m sequence get document no c doctype id trx name if dn null try again dn m sequence get document no c doctype id trx name if dn null throw new db exception no document no return dn c_doctype_id trxname getdocumentno c_doctype_id trxname trxname trxname isremoteobjects cconnection getserver serverbean getdocumentno c_doctype_id trxname appsserver c_doctype_id remoteexception appsserver msequence getdocumentno c_doctype_id trxname msequence getdocumentno c_doctype_id trxname dbexception documentno get document no from table param ad client id client param table name table name param trx name optional transaction name return document no or null public static string get document no int ad client id string table name string trx name if trx name null trx name length 0 is remote objects server server c connection get get server try if server null see server bean string dn server get document no ad client id table name trx name log finest server dn if dn null return dn log log level severe apps server not found table name catch remote exception ex log log level severe apps server error ex fallback string dn m sequence get document no ad client id table name trx name if dn null try again dn m sequence get document no ad client id table name trx name if dn null throw new db exception no document no return dn ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname trxname trxname isremoteobjects cconnection getserver serverbean getdocumentno ad_client_id tablename trxname appsserver tablename remoteexception appsserver msequence getdocumentno ad_client_id tablename trxname msequence getdocumentno ad_client_id tablename trxname dbexception documentno get document number for current document br first search for doc type based document no then search for document no based on table name param ctx context param window no window param table name table param only doc type do not search for document no based on table name param trx name optional transaction name return document no or null if no doc number defined public static string get document no properties ctx int window no string table name boolean only doc type string trx name if ctx null table name null table name length 0 throw new illegal argument exception required parameter missing int ad client id env get context as int ctx window no ad client id get c doctype id from context no defaults int c doctype id env get context as int ctx window no c doctypetarget id if c doctype id 0 c doctype id env get context as int ctx window no c doctype id if c doctype id 0 log fine window window no target env get context as int ctx window no c doctypetarget id env get context as int ctx window no c doctypetarget id actual env get context as int ctx window no c doctype id env get context as int ctx window no c doctype id return get document no ad client id table name trx name string ret value get document no c doctype id trx name if only doc type ret value null return get document no ad client id table name trx name return ret value doctype documentno tablename windowno tablename onlydoctype tablename trxname documentno getdocumentno windowno tablename onlydoctype trxname tablename tablename illegalargumentexception ad_client_id getcontextasint windowno ad_client_id c_doctype_id c_doctype_id getcontextasint windowno c_doctypetarget_id c_doctype_id c_doctype_id getcontextasint windowno c_doctype_id c_doctype_id windowno getcontextasint windowno c_doctypetarget_id getcontextasint windowno c_doctypetarget_id getcontextasint windowno c_doctype_id getcontextasint windowno c_doctype_id getdocumentno ad_client_id tablename trxname retvalue getdocumentno c_doctype_id trxname onlydoctype retvalue getdocumentno ad_client_id tablename trxname retvalue is this a remote client connection return true if client and rmi or objects on server public static boolean is remote objects return c connection get is server objects c connection get is apps serverok false isremoteobjects cconnection isserverobjects cconnection isappsserverok is this a remote client connection return true if client and rmi or process on server public static boolean is remote process return c connection get is server process c connection get is apps serverok false isremoteprocess cconnection isserverprocess cconnection isappsserverok print sql warnings br usage db print warning comment rs get warnings param comment comment param warning warning public static void print warning string comment sql warning warning if comment null warning null comment length 0 throw new illegal argument exception required parameter missing log warning comment if warning null return sql warning warn warning while warn null string buffer buffer new string buffer buffer append warn get message append state append warn getsql state append error code append warn get error code log warning buffer to string warn warn get next warning printwarning getwarnings printwarning sqlwarning illegalargumentexception sqlwarning stringbuffer stringbuffer getmessage getsqlstate errorcode geterrorcode tostring getnextwarning create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return to date 2001 01 30 18 10 20 yyyy mm dd hh24 mi ss or to date 2001 01 30 yyyy mm dd public static string to date timestamp time boolean day only return s cc get database to date time day only dayonly to_date to_date to_date dayonly s_cc getdatabase to_date dayonly create sql to date string from timestamp param day day time return to date string day only public static string to date timestamp day return to date day true to_date to_date to_date create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env public static string to char string column name int display type string ad language if column name null ad language null column name length 0 throw new illegal argument exception required parameter missing return s cc get database to char column name display type ad language columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype to_char columnname displaytype ad_language columnname ad_language columnname illegalargumentexception s_cc getdatabase to_char columnname displaytype ad_language return number as string for insert statements with correct precision param number number param display type display type return number as string public string to number big decimal number int display type return s cc get database to number number display type displaytype to_number bigdecimal displaytype s_cc getdatabase to_number displaytype package strings for sql command in quotes param txt string with text return escaped string for insert statement null if null public static string to string string txt return to string txt 0 to_string to_string package strings for sql command in quotes pre include in single quotes replace with pre param txt string with text param max length maximum length of content or 0 to ignore return escaped string for insert statement null if null public static string to string string txt int max length if txt null txt length 0 return null length string text txt if max length 0 text length max length text txt substring 0 max length copy characters we need to look through anyway string buffer out new string buffer out append quote for int i 0 i text length i char c text char at i if c quote out append else out append c out append quote return out to string maxlength to_string maxlength maxlength maxlength maxlength stringbuffer stringbuffer charat tostring run post migration manually param args ignored public static void main string args compiere startup true m system system m system get env get ctx system set is just migrated true after migration env get ctx msystem msystem getctx setisjustmigrated aftermigration getctx standard constructor public x m inventoryline properties ctx int m inventoryline id string trx name super ctx m inventoryline id trx name if m inventoryline id 0 set inventory type null d setm attributesetinstance id 0 setm inventoryline id 0 setm inventory id 0 setm locator id 0 m locator id setm product id 0 set processed false set qty book env zero set qty count env zero x_m_inventoryline m_inventoryline_id trxname m_inventoryline_id trxname m_inventoryline_id setinventorytype setm_attributesetinstance_id setm_inventoryline_id setm_inventory_id setm_locator_id m_locator_id setm_product_id setprocessed setqtybook setqtycount load constructor public x m inventoryline properties ctx result set rs string trx name super ctx rs trx name x_m_inventoryline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inventoryline append get id append return sb to string tostring stringbuffer stringbuffer x_m_inventoryline get_id tostring set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string inventorytype inventorydifference d set inventory type type of inventory difference public void set inventory type string inventory type if inventory type null throw new illegal argument exception inventory type is mandatory if inventory type equals c inventory type equals d else throw new illegal argument exception inventory type invalid value inventory type reference id 292 c d if inventory type length 1 log warning length 1 truncated inventory type inventory type substring 0 0 set value inventory type inventory type inventorytype_inventorydifference setinventorytype inventorytype inventorytype illegalargumentexception inventorytype inventorytype inventorytype illegalargumentexception inventorytype inventorytype reference_id inventorytype inventorytype inventorytype set_value inventorytype inventorytype get inventory type type of inventory difference public string get inventory type return string get value inventory type getinventorytype get_value inventorytype set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 1 throw new illegal argument exception m inventoryline id is mandatory set valuenocheck m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id illegalargumentexception m_inventoryline_id set_valuenocheck m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 1 throw new illegal argument exception m inventory id is mandatory set valuenocheck m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id illegalargumentexception m_inventory_id set_valuenocheck m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue public static final int m product id ad reference id 171 set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id m_product_id_ad_reference_id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity book book quantity public void set qty book big decimal qty book if qty book null throw new illegal argument exception qty book is mandatory set valuenocheck qty book qty book setqtybook bigdecimal qtybook qtybook illegalargumentexception qtybook set_valuenocheck qtybook qtybook get quantity book book quantity public big decimal get qty book big decimal bd big decimal get value qty book if bd null return env zero return bd bigdecimal getqtybook bigdecimal bigdecimal get_value qtybook set quantity count counted quantity public void set qty count big decimal qty count if qty count null throw new illegal argument exception qty count is mandatory set value qty count qty count setqtycount bigdecimal qtycount qtycount illegalargumentexception qtycount set_value qtycount qtycount get quantity count counted quantity public big decimal get qty count big decimal bd big decimal get value qty count if bd null return env zero return bd bigdecimal getqtycount bigdecimal bigdecimal get_value qtycount set internal use qty internal use quantity removed from inventory public void set qty internal use big decimal qty internal use set value qty internal use qty internal use setqtyinternaluse bigdecimal qtyinternaluse set_value qtyinternaluse qtyinternaluse get internal use qty internal use quantity removed from inventory public big decimal get qty internal use big decimal bd big decimal get value qty internal use if bd null return env zero return bd bigdecimal getqtyinternaluse bigdecimal bigdecimal get_value qtyinternaluse set upc ean bar code universal product code or its superset european article number public void setupc string upc throw new illegal argument exception upc is virtual column illegalargumentexception get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set search key search key for the record in the format required must be unique public void set value string value throw new illegal argument exception value is virtual column setvalue illegalargumentexception get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x r requestprocessorlog properties ctx int r requestprocessorlog id string trx name super ctx r requestprocessorlog id trx name if r requestprocessorlog id 0 set is error false setr requestprocessorlog id 0 setr requestprocessor id 0 x_r_requestprocessorlog r_requestprocessorlog_id trxname r_requestprocessorlog_id trxname r_requestprocessorlog_id setiserror setr_requestprocessorlog_id setr_requestprocessor_id load constructor public x r requestprocessorlog properties ctx result set rs string trx name super ctx rs trx name x_r_requestprocessorlog resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestprocessorlog append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestprocessorlog get_id tostring set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set error an error occured in the execution public void set is error boolean is error set value is error new boolean is error setiserror iserror set_value iserror iserror get error an error occured in the execution public boolean is error object oo get value is error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iserror get_value iserror booleanvalue set request processor log result of the execution of the request processor public void setr requestprocessorlog id int r requestprocessorlog id if r requestprocessorlog id 1 throw new illegal argument exception r requestprocessorlog id is mandatory set valuenocheck r requestprocessorlog id new integer r requestprocessorlog id setr_requestprocessorlog_id r_requestprocessorlog_id r_requestprocessorlog_id illegalargumentexception r_requestprocessorlog_id set_valuenocheck r_requestprocessorlog_id r_requestprocessorlog_id get request processor log result of the execution of the request processor public int getr requestprocessorlog id integer ii integer get value r requestprocessorlog id if ii null return 0 return ii int value getr_requestprocessorlog_id get_value r_requestprocessorlog_id intvalue set request processor processor for requests public void setr requestprocessor id int r requestprocessor id if r requestprocessor id 1 throw new illegal argument exception r requestprocessor id is mandatory set valuenocheck r requestprocessor id new integer r requestprocessor id setr_requestprocessor_id r_requestprocessor_id r_requestprocessor_id illegalargumentexception r_requestprocessor_id set_valuenocheck r_requestprocessor_id r_requestprocessor_id get request processor processor for requests public int getr requestprocessor id integer ii integer get value r requestprocessor id if ii null return 0 return ii int value getr_requestprocessor_id get_value r_requestprocessor_id intvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg standard constructor param ctx context param s resourcetype id id public m resource type properties ctx int s resourcetype id string trx name super ctx s resourcetype id trx name s_resourcetype_id mresourcetype s_resourcetype_id trxname s_resourcetype_id trxname load constructor param ctx context param rs result set public m resource type properties ctx result set rs string trx name super ctx rs trx name mresourcetype resultset trxname trxname after save param new record new param success success return true protected boolean after save boolean new record boolean success if success return success update products if new record m product products m product get get ctx s resource id in select s resource id from s resource where s resourcetype id gets resourcetype id get trxname for int i 0 i products length i m product product products i if product set resource this product save get trxname return success newrecord aftersave newrecord newrecord mproduct mproduct getctx s_resource_id s_resource_id s_resource s_resourcetype_id gets_resourcetype_id get_trxname mproduct setresource get_trxname constructor public query product pos panel pos panel super pos panel queryproduct pospanel pospanel pospanel set up panel protected void init set layout new border layout 5 5 set visible false north north panel new c panel new grid bag layout add north panel border layout north north panel set border new titled border msg get msg p ctx query grid bag constraints gbc new grid bag constraints gbc insets pos sub panel insets2 gbc gridy 0 gbc gridx grid bag constraints relative c label lvalue new c label msg translate p ctx value gbc anchor grid bag constraints east north panel add lvalue gbc f value new c text field 20 lvalue set label for f value gbc anchor grid bag constraints west north panel add f value gbc f value add action listener this c label lupc new c label msg translate p ctx upc gbc anchor grid bag constraints east north panel add lupc gbc f upc new c text field 15 lupc set label for f upc gbc anchor grid bag constraints west north panel add f upc gbc f upc add action listener this gbc gridy 1 c label lname new c label msg translate p ctx name gbc anchor grid bag constraints east north panel add lname gbc f name new c text field 20 lname set label for f name gbc anchor grid bag constraints west north panel add f name gbc f name add action listener this c label lsku new c label msg translate p ctx sku gbc anchor grid bag constraints east north panel add lsku gbc f sku new c text field 15 lsku set label for f sku gbc anchor grid bag constraints west north panel add f sku gbc f sku add action listener this gbc gridy 0 gbc gridheight 2 gbc anchor grid bag constraints east gbc weightx 1 f up create button action previous key stroke get key stroke key event vk up 0 north panel add f up gbc gbc weightx 0 f down create button action next key stroke get key stroke key event vk down 0 north panel add f down gbc confirm confirm new confirm panel true true true false false false false add confirm border layout south confirm add action listener this center m table new mini table string sql m table prepare table s layout s sqlfrom s sqlwhere false rv warehouseprice order by margin qty available m table set row selection allowed true m table set column selection allowed false m table set multi selection false m table add mouse listener this m table get selection model add list selection listener this enable buttons center scroll new c scroll pane m table add center scroll border layout center setlayout borderlayout setvisible northpanel cpanel gridbaglayout northpanel borderlayout northpanel setborder titledborder getmsg p_ctx gridbagconstraints gridbagconstraints possubpanel gridbagconstraints clabel clabel p_ctx gridbagconstraints northpanel f_value ctextfield setlabelfor f_value gridbagconstraints northpanel f_value f_value addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_upc ctextfield setlabelfor f_upc gridbagconstraints northpanel f_upc f_upc addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_name ctextfield setlabelfor f_name gridbagconstraints northpanel f_name f_name addactionlistener clabel clabel p_ctx gridbagconstraints northpanel f_sku ctextfield setlabelfor f_sku gridbagconstraints northpanel f_sku f_sku addactionlistener gridbagconstraints f_up createbuttonaction keystroke getkeystroke keyevent vk_up northpanel f_up f_down createbuttonaction keystroke getkeystroke keyevent vk_down northpanel f_down confirmpanel borderlayout addactionlistener m_table minitable m_table preparetable s_layout s_sqlfrom s_sqlwhere rv_warehouseprice qtyavailable m_table setrowselectionallowed m_table setcolumnselectionallowed m_table setmultiselection m_table addmouselistener m_table getselectionmodel addlistselectionlistener enablebuttons centerscroll cscrollpane m_table centerscroll borderlayout get grid bag constraints return constraints protected grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy grid bag constraints relative gbc gridwidth 2 grid bag constraints remainder gbc fill grid bag constraints both gbc weightx 0 1 gbc weighty 0 5 return gbc gridbagconstraints gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints gridbagconstraints gridbagconstraints gridbagconstraints dispose public void dispose remove all north panel null center scroll null confirm null m table null removeall northpanel centerscroll m_table set visible param a flag visible public void set visible boolean a flag super set visible a flag if a flag f value request focus aflag setvisible aflag setvisible aflag aflag f_value requestfocus set query data param m pricelist version id plv param m warehouse id wh public void set query data int m pricelist version id int m warehouse id m m pricelist version id m pricelist version id m m warehouse id m warehouse id m_pricelist_version_id m_warehouse_id setquerydata m_pricelist_version_id m_warehouse_id m_m_pricelist_version_id m_pricelist_version_id m_m_warehouse_id m_warehouse_id action listener param e event public void action performed action event e log info e get action command if refresh equals e get action command e get source f value e get source f upc e get source f name e get source f sku set results m warehouse price find p ctx m m pricelist version id m m warehouse id f value get text f name get text f upc get text f sku get text null return else if reset equals e get action command f value set text null f name set text null f sku set text null f upc set text null set results new m warehouse price 0 return else if previous equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row 0 row 0 m table get selection model set selection interval row row return else if next equals ignore case e get action command int rows m table get row count if rows 0 return int row m table get selected row row if row rows row rows 1 m table get selection model set selection interval row row return exit close actionperformed actionevent getactioncommand getactioncommand getsource f_value getsource f_upc getsource f_name getsource f_sku setresults mwarehouseprice p_ctx m_m_pricelist_version_id m_m_warehouse_id f_value gettext f_name gettext f_upc gettext f_sku gettext getactioncommand f_value settext f_name settext f_sku settext f_upc settext setresults mwarehouseprice equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval equalsignorecase getactioncommand m_table getrowcount m_table getselectedrow m_table getselectionmodel setselectioninterval set display results param results results public void set results m warehouse price results m table load table results enable buttons setresults mwarehouseprice m_table loadtable enablebuttons table selection changed param e event public void value changed list selection event e if e get value is adjusting return enable buttons valuechanged listselectionevent getvalueisadjusting enablebuttons enable set buttons and set id private void enable buttons m m product id 1 m productname null m price null int row m table get selected row boolean enabled row 1 if enabled integer id m table get selected row key if id null m m product id id int value m productname string m table get value at row 2 m price big decimal m table get value at row 7 confirm getok button set enabled enabled log fine m product id m m product id m productname m price enablebuttons m_m_product_id m_productname m_price m_table getselectedrow m_table getselectedrowkey m_m_product_id intvalue m_productname m_table getvalueat m_price bigdecimal m_table getvalueat getokbutton setenabled m_product_id m_m_product_id m_productname m_price mouse clicked param e event public void mouse clicked mouse event e double click with selected row exit if e get click count 1 m table get selected row 1 enable buttons close mouseclicked mouseevent getclickcount m_table getselectedrow enablebuttons mouse clicked public void mouse entered mouse event e mouseclicked mouseentered mouseevent public void mouse entered mouse event e public void mouse exited mouse event e mouseentered mouseevent mouseexited mouseevent public void mouse entered mouse event e public void mouse exited mouse event e public void mouse pressed mouse event e mouseentered mouseevent mouseexited mouseevent mousepressed mouseevent public void mouse exited mouse event e public void mouse pressed mouse event e public void mouse released mouse event e mouseexited mouseevent mousepressed mouseevent mousereleased mouseevent close set values on other panels and close private void close log fine m product id m m product id if m m product id 0 p pospanel f product setm product id m m product id p pospanel f curline set price m price else p pospanel f product setm product id 0 p pospanel f curline set price env zero p pospanel close query this m_product_id m_m_product_id m_m_product_id p_pospanel f_product setm_product_id m_m_product_id p_pospanel f_curline setprice m_price p_pospanel f_product setm_product_id p_pospanel f_curline setprice p_pospanel closequery desktop model public m desktop properties ctx m ctx ctx mdesktop m_ctx init desktop public boolean init desktop int ad desktop id ad desktop id ad desktop id get wb info string sql null if env is base language m ctx ad desktop sql select name description help 1 3 ad column id ad image id ad color id pa goal id 4 7 from ad desktop where ad desktop id and is active y else sql select t name t description t help w ad column id w ad image id w ad color id w pa goal id from ad desktop w ad desktop trl t where w ad desktop id and w is active y and w ad desktop id t ad desktop id and t ad language env getad language m ctx try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad desktop id result set rs pstmt execute query if rs next name rs get string 1 description rs get string 2 if description null description help rs get string 3 if help null help ad column id rs get int 4 ad image id rs get int 5 ad color id rs get int 6 pa goal id rs get int 7 else ad desktop id 0 rs close pstmt close catch sql exception e log log level severe sql e if ad desktop id 0 return false return init desktop workbenches initdesktop ad_desktop_id ad_desktop_id ad_desktop_id isbaselanguage m_ctx ad_desktop ad_column_id ad_image_id ad_color_id pa_goal_id ad_desktop ad_desktop_id isactive ad_column_id ad_image_id ad_color_id pa_goal_id ad_desktop ad_desktop_trl ad_desktop_id isactive ad_desktop_id ad_desktop_id ad_language getad_language m_ctx preparedstatement preparestatement setint ad_desktop_id resultset executequery getstring getstring getstring ad_column_id getint ad_image_id getint ad_color_id getint pa_goal_id getint ad_desktop_id sqlexception ad_desktop_id initdesktopworkbenches string representation public string to string return m desktop id ad desktop id name tostring mdesktop ad_desktop_id public int getad desktop id return ad desktop id getad_desktop_id ad_desktop_id return ad desktop id public string get name return name ad_desktop_id getname return name public string get description return description getdescription return description public string get help return help gethelp return help public int getad column id return ad column id getad_column_id ad_column_id return ad column id public int getad image id return ad image id ad_column_id getad_image_id ad_image_id return ad image id public int getad color id return ad color id ad_image_id getad_color_id ad_color_id return ad color id public int getpa goal id return pa goal id ad_color_id getpa_goal_id pa_goal_id init workbench windows private boolean init desktop workbenches string sql select ad workbench id from ad desktopworkbench where ad desktop id and is active y order by seq no try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad desktop id result set rs pstmt execute query while rs next int ad workbench id rs get int 1 m workbenches add new integer ad workbench id rs close pstmt close catch sql exception e log log level severe m workbench init desktop workbenches e return false return true initdesktopworkbenches ad_workbench_id ad_desktopworkbench ad_desktop_id isactive seqno preparedstatement preparestatement setint ad_desktop_id resultset executequery ad_workbench_id getint m_workbenches ad_workbench_id sqlexception mworkbench initdesktopworkbenches get window count public int get window count return m workbenches size getwindowcount m_workbenches get ad workbench id of index return 1 if not valid public int getad workbench id int index if index 0 index m workbenches size return 1 integer id integer m workbenches get index return id int value ad_workbench_id getad_workbench_id m_workbenches m_workbenches intvalue standard constructor param ctx context param c rfq topic id id public m rfq topic properties ctx int c rfq topic id string trx name super ctx c rfq topic id trx name c_rfq_topic_id mrfqtopic c_rfq_topic_id trxname c_rfq_topic_id trxname load constructor param ctx context param rs result set public m rfq topic properties ctx result set rs string trx name super ctx rs trx name mrfqtopic resultset trxname trxname get current topic subscribers return array subscribers public m rfq topic subscriber get subscribers array list m rfq topic subscriber list new array list m rfq topic subscriber string sql select from c rfq topicsubscriber where c rfq topic id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfq topic id result set rs pstmt execute query while rs next list add new m rfq topic subscriber get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get subscribers e try if pstmt null pstmt close pstmt null catch exception e pstmt null m rfq topic subscriber ret value new m rfq topic subscriber list size list to array ret value return ret value mrfqtopicsubscriber getsubscribers arraylist mrfqtopicsubscriber arraylist mrfqtopicsubscriber c_rfq_topicsubscriber c_rfq_topic_id isactive preparedstatement preparestatement get_trxname setint getc_rfq_topic_id resultset executequery mrfqtopicsubscriber getctx get_trxname getsubscribers mrfqtopicsubscriber retvalue mrfqtopicsubscriber toarray retvalue retvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c project id m c project id big decimal para i get parameter int value else if name equals c projectline id m c projectline id big decimal para i get parameter int value else if name equals consolidate document m consolidatedocument y equals para i get parameter else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_project_id m_c_project_id bigdecimal getparameter intvalue c_projectline_id m_c_projectline_id bigdecimal getparameter intvalue consolidatedocument m_consolidatedocument getparameter perrform process return message throws exception if not successful protected string do it throws exception log info do it c project id m c project id c projectline id m c projectline id consolidate m consolidatedocument if m c projectline id 0 m project line project line new m project line get ctx m c projectline id get trxname m project project new m project get ctx project line getc project id get trxname createpo project project line else m project project new m project get ctx m c project id get trxname m project line lines project get lines for int i 0 i lines length i createpo project lines i return doit doit c_project_id m_c_project_id c_projectline_id m_c_projectline_id m_consolidatedocument m_c_projectline_id mprojectline projectline mprojectline getctx m_c_projectline_id get_trxname mproject mproject getctx projectline getc_project_id get_trxname projectline mproject mproject getctx m_c_project_id get_trxname mprojectline getlines create po from planned amt qty param project line project line private void createpo m project project m project line project line if project line getm product id 0 add log project line get line null null line has no product return if project line getc orderpo id 0 add log project line get line null null line was ordered previously return po record m productpo pos m productpo get of product get ctx project line getm product id get trxname if pos null pos length 0 add log project line get line null null product has no po record return create to order m order order null try to find po to c bpartner for int i 0 i m pos size i m order test m order m pos get i if test getc bpartner id pos 0 getc bpartner id order test break if order null create new order vendor mb partner bp new mb partner get ctx pos 0 getc bpartner id get trxname new order order new m order project false null int ad org id project line getad org id if ad org id 0 log warning createp ofrom project line ad org id 0 ad org id env getad org id get ctx if ad org id 0 project line setad org id ad org id order set client org project line getad client id ad org id order setb partner bp order save optionally save for consolidation if m consolidatedocument m pos add order create line m order line order line new m order line order order line setm product id project line getm product id true order line set qty project line get planned qty order line set description project line get description vendor price list price order line set price if order line get price actual signum 0 try to find purchase price big decimal po price pos 0 get pricepo int c currency id pos 0 getc currency id if po price null po price signum 0 po price pos 0 get price lastpo if po price null po price signum 0 po price pos 0 get price list we have a price if po price null po price signum 0 if order getc currency id c currency id po price m conversion rate convert get ctx po price c currency id order getc currency id order get date acct order getc conversiontype id order getad client id order getad org id order line set price po price order line set tax order line save update project line project line setc orderpo id order getc order id project line save add log project line get line null project line get planned qty order get document no projectline mproject mprojectline projectline projectline getm_product_id addlog projectline getline projectline getc_orderpo_id addlog projectline getline mproductpo mproductpo getofproduct getctx projectline getm_product_id get_trxname addlog projectline getline morder c_bpartner m_pos morder morder m_pos getc_bpartner_id getc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id get_trxname morder ad_org_id projectline getad_org_id ad_org_id createpofromprojectline ad_org_id ad_org_id getad_org_id getctx ad_org_id projectline setad_org_id ad_org_id setclientorg projectline getad_client_id ad_org_id setbpartner m_consolidatedocument m_pos morderline orderline morderline orderline setm_product_id projectline getm_product_id orderline setqty projectline getplannedqty orderline setdescription projectline getdescription pricelist orderline setprice orderline getpriceactual bigdecimal poprice getpricepo c_currency_id getc_currency_id poprice poprice poprice getpricelastpo poprice poprice poprice getpricelist poprice poprice getc_currency_id c_currency_id poprice mconversionrate getctx poprice c_currency_id getc_currency_id getdateacct getc_conversiontype_id getad_client_id getad_org_id orderline setprice poprice orderline settax orderline projectline projectline setc_orderpo_id getc_order_id projectline addlog projectline getline projectline getplannedqty getdocumentno prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id para i get parameter as int else if name equals ad workflow id p ad workflow id para i get parameter as int else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id getparameterasint ad_workflow_id p_ad_workflow_id getparameterasint process return message throws exception protected string do it throws exception log info do it ad client id p ad client id ad workflow id p ad workflow id int changes 0 wf string sql update ad workflow set ad client id p ad client id where ad client id 0 and entity type not in d c and ad workflow id p ad workflow id int no db execute update sql get trxname if no 1 throw new compiere system error error updating workflow changes no node sql update ad wf node set ad client id p ad client id where ad client id 0 and entity type not in d c and ad workflow id p ad workflow id no db execute update sql get trxname if no 1 throw new compiere system error error updating workflow node changes no node next sql update ad wf nodenext set ad client id p ad client id where ad client id 0 and entity type not in d c and ad wf node id in select ad wf node id from ad wf node where ad workflow id p ad workflow id or ad wf next id in select ad wf node id from ad wf node where ad workflow id p ad workflow id no db execute update sql get trxname if no 1 throw new compiere system error error updating workflow transition changes no node parameters sql update ad wf node para set ad client id p ad client id where ad client id 0 and entity type not in d c and ad wf node id in select ad wf node id from ad wf node where ad workflow id p ad workflow id no db execute update sql get trxname if no 1 throw new compiere system error error updating workflow node parameters changes no node next condition sql update ad wf nextcondition set ad client id p ad client id where ad client id 0 and entity type not in d c and ad wf nodenext id in select ad wf nodenext id from ad wf nodenext where ad wf node id in select ad wf node id from ad wf node where ad workflow id p ad workflow id or ad wf next id in select ad wf node id from ad wf node where ad workflow id p ad workflow id no db execute update sql get trxname if no 1 throw new compiere system error error updating workflow transition condition changes no return updated changes doit doit ad_client_id p_ad_client_id ad_workflow_id p_ad_workflow_id ad_workflow ad_client_id p_ad_client_id ad_client_id entitytype ad_workflow_id p_ad_workflow_id executeupdate get_trxname compieresystemerror ad_wf_node ad_client_id p_ad_client_id ad_client_id entitytype ad_workflow_id p_ad_workflow_id executeupdate get_trxname compieresystemerror ad_wf_nodenext ad_client_id p_ad_client_id ad_client_id entitytype ad_wf_node_id ad_wf_node_id ad_wf_node ad_workflow_id p_ad_workflow_id ad_wf_next_id ad_wf_node_id ad_wf_node ad_workflow_id p_ad_workflow_id executeupdate get_trxname compieresystemerror ad_wf_node_para ad_client_id p_ad_client_id ad_client_id entitytype ad_wf_node_id ad_wf_node_id ad_wf_node ad_workflow_id p_ad_workflow_id executeupdate get_trxname compieresystemerror ad_wf_nextcondition ad_client_id p_ad_client_id ad_client_id entitytype ad_wf_nodenext_id ad_wf_nodenext_id ad_wf_nodenext ad_wf_node_id ad_wf_node_id ad_wf_node ad_workflow_id p_ad_workflow_id ad_wf_next_id ad_wf_node_id ad_wf_node ad_workflow_id p_ad_workflow_id executeupdate get_trxname compieresystemerror standard constructor public x ad private access properties ctx int ad private access id string trx name super ctx ad private access id trx name if ad private access id 0 setad table id 0 setad user id 0 setrecord id 0 x_ad_private_access ad_private_access_id trxname ad_private_access_id trxname ad_private_access_id setad_table_id setad_user_id setrecord_id load constructor public x ad private access properties ctx result set rs string trx name super ctx rs trx name x_ad_private_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad private access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_private_access get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue standard constructor public x c acctschema element properties ctx int c acctschema element id string trx name super ctx c acctschema element id trx name if c acctschema element id 0 setc acctschema element id 0 setc acctschema id 0 setc element id 0 set element type null set is balanced false set is mandatory false set name null setorg id 0 set seq no 0 sql select coalesce max seq no 0 10 as default value from c acctschema element where c acctschema id c acctschema id x_c_acctschema_element c_acctschema_element_id trxname c_acctschema_element_id trxname c_acctschema_element_id setc_acctschema_element_id setc_acctschema_id setc_element_id setelementtype setisbalanced setismandatory setname setorg_id setseqno seqno defaultvalue c_acctschema_element c_acctschema_id c_acctschema_id load constructor public x c acctschema element properties ctx result set rs string trx name super ctx rs trx name x_c_acctschema_element resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctschema element append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctschema_element get_id tostring set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set acct schema element public void setc acctschema element id int c acctschema element id if c acctschema element id 1 throw new illegal argument exception c acctschema element id is mandatory set valuenocheck c acctschema element id new integer c acctschema element id setc_acctschema_element_id c_acctschema_element_id c_acctschema_element_id illegalargumentexception c_acctschema_element_id set_valuenocheck c_acctschema_element_id c_acctschema_element_id get acct schema element public int getc acctschema element id integer ii integer get value c acctschema element id if ii null return 0 return ii int value getc_acctschema_element_id get_value c_acctschema_element_id intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 0 set value c elementvalue id null else set value c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id set_value c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set element accounting element public void setc element id int c element id if c element id 1 throw new illegal argument exception c element id is mandatory set value c element id new integer c element id setc_element_id c_element_id c_element_id illegalargumentexception c_element_id set_value c_element_id c_element_id get element accounting element public int getc element id integer ii integer get value c element id if ii null return 0 return ii int value getc_element_id get_value c_element_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue public static final string elementtype userelement2 x2 set type element type account or user defined public void set element type string element type if element type null throw new illegal argument exception element type is mandatory if element type equals ac element type equals ay element type equals bp element type equals lf element type equals lt element type equals mc element type equals oo element type equals ot element type equals pj element type equals pr element type equals sa element type equals sr element type equals u1 element type equals u2 element type equals x1 element type equals x2 else throw new illegal argument exception element type invalid value element type reference id 181 ac ay bp lf lt mc oo ot pj pr sa sr u1 u2 x1 x2 if element type length 2 log warning length 2 truncated element type element type substring 0 1 set value element type element type elementtype_userelement2 setelementtype elementtype elementtype illegalargumentexception elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype elementtype illegalargumentexception elementtype elementtype reference_id elementtype elementtype elementtype set_value elementtype elementtype get type element type account or user defined public string get element type return string get value element type getelementtype get_value elementtype set balanced public void set is balanced boolean is balanced set value is balanced new boolean is balanced setisbalanced isbalanced set_value isbalanced isbalanced get balanced public boolean is balanced object oo get value is balanced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbalanced get_value isbalanced booleanvalue set mandatory data entry is required in this column public void set is mandatory boolean is mandatory set value is mandatory new boolean is mandatory setismandatory ismandatory set_value ismandatory ismandatory get mandatory data entry is required in this column public boolean is mandatory object oo get value is mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatory get_value ismandatory booleanvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int org id ad reference id 130 set organization organizational entity within client public void setorg id int org id if org id 1 throw new illegal argument exception org id is mandatory set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id illegalargumentexception org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x s resourcetype properties ctx int s resourcetype id string trx name super ctx s resourcetype id trx name if s resourcetype id 0 set allow uom fractions false n setc taxcategory id 0 setc uom id 0 set is date slot false set is single assignment false set is time slot false setm product category id 0 set name null set on friday true y set on monday true y set on saturday false set on sunday false set on thursday true y set on tuesday true y set on wednesday true y sets resourcetype id 0 set value null x_s_resourcetype s_resourcetype_id trxname s_resourcetype_id trxname s_resourcetype_id setallowuomfractions setc_taxcategory_id setc_uom_id setisdateslot setissingleassignment setistimeslot setm_product_category_id setname setonfriday setonmonday setonsaturday setonsunday setonthursday setontuesday setonwednesday sets_resourcetype_id setvalue load constructor public x s resourcetype properties ctx result set rs string trx name super ctx rs trx name x_s_resourcetype resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s resourcetype append get id append return sb to string tostring stringbuffer stringbuffer x_s_resourcetype get_id tostring set allow uom fractions allow unit of measure fractions public void set allow uom fractions boolean allow uom fractions set value allow uom fractions new boolean allow uom fractions setallowuomfractions allowuomfractions set_value allowuomfractions allowuomfractions get allow uom fractions allow unit of measure fractions public boolean is allow uom fractions object oo get value allow uom fractions if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallowuomfractions get_value allowuomfractions booleanvalue set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set chargeable quantity public void set chargeable qty int chargeable qty set value chargeable qty new integer chargeable qty setchargeableqty chargeableqty set_value chargeableqty chargeableqty get chargeable quantity public int get chargeable qty integer ii integer get value chargeable qty if ii null return 0 return ii int value getchargeableqty get_value chargeableqty intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set day slot resource has day slot availability public void set is date slot boolean is date slot set value is date slot new boolean is date slot setisdateslot isdateslot set_value isdateslot isdateslot get day slot resource has day slot availability public boolean is date slot object oo get value is date slot if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdateslot get_value isdateslot booleanvalue set single assignment only only one assignment at a time no double booking or overlapping public void set is single assignment boolean is single assignment set value is single assignment new boolean is single assignment setissingleassignment issingleassignment set_value issingleassignment issingleassignment get single assignment only only one assignment at a time no double booking or overlapping public boolean is single assignment object oo get value is single assignment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issingleassignment get_value issingleassignment booleanvalue set time slot resource has time slot availability public void set is time slot boolean is time slot set value is time slot new boolean is time slot setistimeslot istimeslot set_value istimeslot istimeslot get time slot resource has time slot availability public boolean is time slot object oo get value is time slot if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istimeslot get_value istimeslot booleanvalue set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set friday available on fridays public void set on friday boolean on friday set value on friday new boolean on friday setonfriday onfriday set_value onfriday onfriday get friday available on fridays public boolean is on friday object oo get value on friday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonfriday get_value onfriday booleanvalue set monday available on mondays public void set on monday boolean on monday set value on monday new boolean on monday setonmonday onmonday set_value onmonday onmonday get monday available on mondays public boolean is on monday object oo get value on monday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonmonday get_value onmonday booleanvalue set saturday available on saturday public void set on saturday boolean on saturday set value on saturday new boolean on saturday setonsaturday onsaturday set_value onsaturday onsaturday get saturday available on saturday public boolean is on saturday object oo get value on saturday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonsaturday get_value onsaturday booleanvalue set sunday available on sundays public void set on sunday boolean on sunday set value on sunday new boolean on sunday setonsunday onsunday set_value onsunday onsunday get sunday available on sundays public boolean is on sunday object oo get value on sunday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonsunday get_value onsunday booleanvalue set thursday available on thursdays public void set on thursday boolean on thursday set value on thursday new boolean on thursday setonthursday onthursday set_value onthursday onthursday get thursday available on thursdays public boolean is on thursday object oo get value on thursday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonthursday get_value onthursday booleanvalue set tuesday available on tuesdays public void set on tuesday boolean on tuesday set value on tuesday new boolean on tuesday setontuesday ontuesday set_value ontuesday ontuesday get tuesday available on tuesdays public boolean is on tuesday object oo get value on tuesday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isontuesday get_value ontuesday booleanvalue set wednesday available on wednesdays public void set on wednesday boolean on wednesday set value on wednesday new boolean on wednesday setonwednesday onwednesday set_value onwednesday onwednesday get wednesday available on wednesdays public boolean is on wednesday object oo get value on wednesday if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonwednesday get_value onwednesday booleanvalue set resource type public void sets resourcetype id int s resourcetype id if s resourcetype id 1 throw new illegal argument exception s resourcetype id is mandatory set valuenocheck s resourcetype id new integer s resourcetype id sets_resourcetype_id s_resourcetype_id s_resourcetype_id illegalargumentexception s_resourcetype_id set_valuenocheck s_resourcetype_id s_resourcetype_id get resource type public int gets resourcetype id integer ii integer get value s resourcetype id if ii null return 0 return ii int value gets_resourcetype_id get_value s_resourcetype_id intvalue set slot end time when timeslot ends public void set time slot end timestamp time slot end set value time slot end time slot end settimeslotend timeslotend set_value timeslotend timeslotend get slot end time when timeslot ends public timestamp get time slot end return timestamp get value time slot end gettimeslotend get_value timeslotend set slot start time when timeslot starts public void set time slot start timestamp time slot start set value time slot start time slot start settimeslotstart timeslotstart set_value timeslotstart timeslotstart get slot start time when timeslot starts public timestamp get time slot start return timestamp get value time slot start gettimeslotstart get_value timeslotstart set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value create window value object param ctx context param window no window no param ad window id window id return m windowvo public static m windowvo create properties ctx int window no int ad window id return create ctx window no ad window id 0 windowno ad_window_id mwindowvo mwindowvo windowno ad_window_id windowno ad_window_id create window value object param ctx context param window no window no param ad window id window id param ad menu id menu id return m windowvo public static m windowvo create properties ctx int window no int ad window id int ad menu id c logger get config window no ad window id ad window id ad menu id ad menu id m windowvo vo new m windowvo ctx window no vo ad window id ad window id get window id if required used by html ui if vo ad window id 0 ad menu id 0 string sql select ad window id isso trx is read only from ad menu where ad menu id and action w try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad menu id result set rs pstmt execute query if rs next vo ad window id rs get int 1 string isso trx rs get string 2 env set context ctx window no isso trx isso trx null isso trx equals y string is read only rs get string 3 if is read only null is read only equals y vo is read write y else vo is read write n rs close pstmt close catch sql exception e c logger get log level severe menu e return null c logger get config ad window id vo ad window id get window string buffer sql new string buffer select name description help window type ad color id ad image id a is read write win height win width isso trx if env is base language vo ctx ad window sql append from ad window w ad window access a where w ad window id and w ad window id a ad window id and a ad role id and w is active y and a is active y else sql append from ad window vt w ad window access a where w ad window id and w ad window id a ad window id and a ad role id and a is active y append and ad language append env getad language vo ctx append int ad role id env get context as int vo ctx ad role id try create statement prepared statement pstmt db prepare statement sql to string null pstmt set int 1 vo ad window id pstmt set int 2 ad role id get data result set rs pstmt execute query if rs next vo name rs get string 1 vo description rs get string 2 if vo description null vo description vo help rs get string 3 if vo help null vo help vo window type rs get string 4 vo ad color id rs get int 5 vo ad image id rs get int 6 vo is read write rs get string 7 vo win height rs get int 8 vo win width rs get int 9 vo isso trx y equals rs get string 10 else vo null rs close pstmt close catch sql exception ex c logger get log level severe sql to string ex return null not found if vo null c logger get log level severe no window ad window id ad window id ad role id ad role id sql c logger get save error access table no view not found return null read write if vo is read write null c logger get save error access table no view found return null create tabs create tabs vo if vo tabs null vo tabs size 0 return null return vo windowno ad_window_id ad_menu_id mwindowvo mwindowvo windowno ad_window_id ad_menu_id clogger windowno ad_window_id ad_window_id ad_menu_id ad_menu_id mwindowvo mwindowvo windowno ad_window_id ad_window_id window_id ad_window_id ad_menu_id ad_window_id issotrx isreadonly ad_menu ad_menu_id preparedstatement preparestatement setint ad_menu_id resultset executequery ad_window_id getint issotrx getstring setcontext windowno issotrx issotrx issotrx isreadonly getstring isreadonly isreadonly isreadwrite isreadwrite sqlexception clogger clogger ad_window_id ad_window_id stringbuffer stringbuffer windowtype ad_color_id ad_image_id isreadwrite winheight winwidth issotrx isbaselanguage ad_window ad_window ad_window_access ad_window_id ad_window_id ad_window_id ad_role_id isactive isactive ad_window_vt ad_window_access ad_window_id ad_window_id ad_window_id ad_role_id isactive ad_language getad_language ad_role_id getcontextasint ad_role_id preparedstatement preparestatement tostring setint ad_window_id setint ad_role_id resultset executequery getstring getstring getstring windowtype getstring ad_color_id getint ad_image_id getint isreadwrite getstring winheight getint winwidth getint issotrx getstring sqlexception clogger tostring clogger ad_window_id ad_window_id ad_role_id ad_role_id clogger saveerror accesstablenoview isreadwrite clogger saveerror accesstablenoview createtabs create window tabs param m windowvo window value object return true if tabs were created private static boolean create tabs m windowvo m windowvo m windowvo tabs new array list m tabvo string sql m tabvo getsql m windowvo ctx int tab no 0 try create statement prepared statement pstmt db prepare statement sql null pstmt set int 1 m windowvo ad window id result set rs pstmt execute query boolean first tab true while rs next if m windowvo ad table id 0 m windowvo ad table id rs get int ad table id create tabvo m tabvo m tabvo m tabvo create m windowvo tab no rs m windowvo window type equals windowtype query isro m windowvo window type equals windowtype trx only current rows if m tabvo null first tab break don t continue if first tab is null if m tabvo null if m tabvo is read only n equals m windowvo is read write m tabvo is read only true m windowvo tabs add m tabvo tab no must be same as m window get tab x first tab false rs close pstmt close catch sql exception e c logger get log level severe create tabs e return false no tabs if tab no 0 m windowvo tabs size 0 c logger get log level severe no tabs ad window id m windowvo ad window id sql return false put base table of window in ctx for v doc action env set context m windowvo ctx m windowvo window no basetable id m windowvo ad table id return true mwindowvo createtabs mwindowvo mwindowvo mwindowvo arraylist mtabvo mtabvo mwindowvo tabno preparedstatement preparestatement setint mwindowvo ad_window_id resultset executequery firsttab mwindowvo ad_table_id mwindowvo ad_table_id getint ad_table_id mtabvo mtabvo mtabvo mwindowvo tabno mwindowvo windowtype windowtype_query mwindowvo windowtype windowtype_trx onlycurrentrows mtabvo firsttab mtabvo mtabvo isreadonly mwindowvo isreadwrite mtabvo isreadonly mwindowvo mtabvo tabno mwindow gettab firsttab sqlexception clogger createtabs tabno mwindowvo clogger ad_window_id mwindowvo ad_window_id vdocaction setcontext mwindowvo mwindowvo windowno basetable_id mwindowvo ad_table_id private constructor param ctx context param window no window no private m windowvo properties ctx int window no this ctx ctx this window no window no windowno mwindowvo windowno windowno windowno set context including contained elements param new ctx context public void set ctx properties new ctx ctx new ctx for int i 0 i tabs size i m tabvo tab m tabvo tabs get i tab set ctx new ctx newctx setctx newctx newctx mtabvo mtabvo setctx newctx clone param window no no return windowvo public m windowvo clone int window no m windowvo clone null try clone new m windowvo ctx window no clone ad window id ad window id clone name name clone description description clone help help clone window type window type clone ad image id ad image id clone ad color id ad color id clone is read write is read write clone win width win width clone win height win height clone isso trx isso trx env set context ctx window no isso trx clone isso trx clone ad table id ad table id env set context ctx window no basetable id clone ad table id clone tabs new array list m tabvo for int i 0 i tabs size i m tabvo tab tabs get i m tabvo clone tab tab clone clone ctx window no if clone tab null return null clone tabs add clone tab catch exception e clone null return clone windowno mwindowvo windowno mwindowvo mwindowvo windowno ad_window_id ad_window_id windowtype windowtype ad_image_id ad_image_id ad_color_id ad_color_id isreadwrite isreadwrite winwidth winwidth winheight winheight issotrx issotrx setcontext windowno issotrx issotrx ad_table_id ad_table_id setcontext windowno basetable_id ad_table_id arraylist mtabvo mtabvo mtabvo clonetab windowno clonetab clonetab create own instance param x return compiere menu barui public static componentui createui j component x return new compiere menuui compieremenubarui jcomponent compieremenuui install ui param c public void installui j component c super installui c c set opaque false use menu barui background jcomponent setopaque menubarui delete accounting param ad table id table param record id record param trx name transaction return number of rows or 1 for error public static int delete int ad table id int record id string trx name string buffer sb new string buffer sb append delete fact acct where ad table id append ad table id append and record id append record id int no db execute update sb to string trx name if no 1 s log log level severe failed ad table id ad table id record id record id else s log fine delete ad table id ad table id record id record id no return no ad_table_id record_id trxname ad_table_id record_id trxname stringbuffer stringbuffer fact_acct ad_table_id ad_table_id record_id record_id executeupdate tostring trxname s_log ad_table_id ad_table_id record_id record_id s_log ad_table_id ad_table_id record_id record_id standard constructor param ctx context param fact acct id id public m fact acct properties ctx int fact acct id string trx name super ctx fact acct id trx name fact_acct_id mfactacct fact_acct_id trxname fact_acct_id trxname load constructor param ctx context param rs result set public m fact acct properties ctx result set rs string trx name super ctx rs trx name mfactacct resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m fact acct sb append get id append acct append getaccount id append dr append get amt source dr append append get amt acct dr append cr append get amt source cr append append get amt acct cr append return sb to string tostring stringbuffer stringbuffer mfactacct get_id getaccount_id getamtsourcedr getamtacctdr getamtsourcecr getamtacctcr tostring derive m account from record return valid account combination public m account getm account m account acct m account get get ctx getad client id getad org id getc acctschema id getaccount id getc subacct id getm product id getc bpartner id getad orgtrx id getc locfrom id getc locto id getc salesregion id getc project id getc campaign id getc activity id getuser1 id getuser2 id getuserelement1 id getuserelement2 id if acct null acct get id 0 acct save return acct maccount maccount getmaccount maccount maccount getctx getad_client_id getad_org_id getc_acctschema_id getaccount_id getc_subacct_id getm_product_id getc_bpartner_id getad_orgtrx_id getc_locfrom_id getc_locto_id getc_salesregion_id getc_project_id getc_campaign_id getc_activity_id getuser1_id getuser2_id getuserelement1_id getuserelement2_id get_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals is encrypted p isencrypted y equals para i get parameter else if name equals change setting p changesetting y equals para i get parameter else if name equals max length p maxlength para i get parameter as int else if name equals test value p testvalue string para i get parameter else log log level severe unknown parameter name p ad column id getrecord id processinfoparameter getparameter getparametername getparameter isencrypted p_isencrypted getparameter changesetting p_changesetting getparameter maxlength p_maxlength getparameterasint testvalue p_testvalue getparameter p_ad_column_id getrecord_id process return info throws exception protected string do it throws exception log info ad column id p ad column id is encrypted p isencrypted change setting p changesetting max length p maxlength m column column new m column get ctx p ad column id null if column get id 0 column get id p ad column id throw new compiere user error not found ad column id p ad column id string column name column get column name int dt column getad reference id can it be enabled if column is key column is parent column is standard column column is virtual column column is identifier column is translated display type is lookup dt display type islob dt document no equals ignore case column get column name value equals ignore case column get column name name equals ignore case column get column name if column is encrypted column set is encrypted false column save return column name cannot be encrypted start add log 0 null null encryption class secure engine get class name boolean error false test value if p testvalue null p testvalue length 0 string enc string secure engine encrypt p testvalue add log 0 null null encrypted test value enc string string clear string secure engine decrypt enc string if p testvalue equals clear string add log 0 null null decrypted clear string same as test value else add log 0 null null decrypted clear string not the same as test value check algorithm error true int enc length enc string length add log 0 null null test length p testvalue length enc length if enc length column get field length add log 0 null null encrypted length enc length fits into field column get field length else add log 0 null null encrypted length enc length does not fit into field column get field length resize field error true length test if p maxlength 0 string test clear 1234567890abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz while test clear length p maxlength test clear test clear test clear test clear substring 0 p maxlength log config test test clear p maxlength string enc string secure engine encrypt test clear int enc length enc string length add log 0 null null test max length test clear length enc length if enc length column get field length add log 0 null null encrypted max length enc length fits into field column get field length else add log 0 null null encrypted max length enc length does not fit into field column get field length resize field error true if p isencrypted column is encrypted if error p changesetting add log 0 null null encryption not changed encryption column is encrypted else column set is encrypted p isencrypted if column save add log 0 null null encryption changed encryption column is encrypted else add log 0 null null save error return encryption column is encrypted doit ad_column_id p_ad_column_id isencrypted p_isencrypted changesetting p_changesetting maxlength p_maxlength m_column m_column getctx p_ad_column_id get_id get_id p_ad_column_id compiereusererror notfound ad_column_id p_ad_column_id columnname getcolumnname getad_reference_id iskey isparent isstandardcolumn isvirtualcolumn isidentifier istranslated displaytype islookup displaytype documentno equalsignorecase getcolumnname equalsignorecase getcolumnname equalsignorecase getcolumnname isencrypted setisencrypted columnname addlog secureengine getclassname p_testvalue p_testvalue encstring secureengine p_testvalue addlog encstring clearstring secureengine encstring p_testvalue clearstring addlog clearstring addlog clearstring enclength encstring addlog p_testvalue enclength enclength getfieldlength addlog enclength getfieldlength addlog enclength getfieldlength p_maxlength testclear testclear p_maxlength testclear testclear testclear testclear p_maxlength testclear p_maxlength encstring secureengine testclear enclength encstring addlog testclear enclength enclength getfieldlength addlog enclength getfieldlength addlog enclength getfieldlength p_isencrypted isencrypted p_changesetting addlog isencrypted setisencrypted p_isencrypted addlog isencrypted addlog isencrypted standard constructor public x m costdetail properties ctx int m costdetail id string trx name super ctx m costdetail id trx name if m costdetail id 0 set amt env zero setc acctschema id 0 set isso trx false setm attributesetinstance id 0 setm costdetail id 0 setm product id 0 set processed false set qty env zero x_m_costdetail m_costdetail_id trxname m_costdetail_id trxname m_costdetail_id setamt setc_acctschema_id setissotrx setm_attributesetinstance_id setm_costdetail_id setm_product_id setprocessed setqty load constructor public x m costdetail properties ctx result set rs string trx name super ctx rs trx name x_m_costdetail resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m costdetail append get id append return sb to string tostring stringbuffer stringbuffer x_m_costdetail get_id tostring set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set valuenocheck c orderline id null else set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_valuenocheck c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set project issue project issues material labor public void setc projectissue id int c projectissue id if c projectissue id 0 set value c projectissue id null else set value c projectissue id new integer c projectissue id setc_projectissue_id c_projectissue_id c_projectissue_id set_value c_projectissue_id set_value c_projectissue_id c_projectissue_id get project issue project issues material labor public int getc projectissue id integer ii integer get value c projectissue id if ii null return 0 return ii int value getc_projectissue_id get_value c_projectissue_id intvalue set delta amount difference amount public void set delta amt big decimal delta amt set value delta amt delta amt setdeltaamt bigdecimal deltaamt set_value deltaamt deltaamt get delta amount difference amount public big decimal get delta amt big decimal bd big decimal get value delta amt if bd null return env zero return bd bigdecimal getdeltaamt bigdecimal bigdecimal get_value deltaamt set delta quantity quantity difference public void set delta qty big decimal delta qty set value delta qty delta qty setdeltaqty bigdecimal deltaqty set_value deltaqty deltaqty get delta quantity quantity difference public big decimal get delta qty big decimal bd big decimal get value delta qty if bd null return env zero return bd bigdecimal getdeltaqty bigdecimal bigdecimal get_value deltaqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set cost detail cost detail information public void setm costdetail id int m costdetail id if m costdetail id 1 throw new illegal argument exception m costdetail id is mandatory set valuenocheck m costdetail id new integer m costdetail id setm_costdetail_id m_costdetail_id m_costdetail_id illegalargumentexception m_costdetail_id set_valuenocheck m_costdetail_id m_costdetail_id get cost detail cost detail information public int getm costdetail id integer ii integer get value m costdetail id if ii null return 0 return ii int value getm_costdetail_id get_value m_costdetail_id intvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 0 set valuenocheck m costelement id null else set valuenocheck m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id set_valuenocheck m_costelement_id set_valuenocheck m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set valuenocheck m inoutline id null else set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_valuenocheck m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 0 set value m movementline id null else set value m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id set_value m_movementline_id set_value m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 0 set value m productionline id null else set value m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id set_value m_productionline_id set_value m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue set price price public void set price big decimal price throw new illegal argument exception price is virtual column setprice bigdecimal illegalargumentexception get price price public big decimal get price big decimal bd big decimal get value price if bd null return env zero return bd bigdecimal getprice bigdecimal bigdecimal get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value constructor param ass accounting schemata param rs record parem trx name trx protected doc order m acct schema ass result set rs string trx name super ass m order class rs null trx name trxname doc_order macctschema resultset trxname morder trxname load specific document details return error message or null protected string load document details m order order m order getpo set date doc order get date ordered set is tax included order is tax included amounts set amount amttype gross order get grand total set amount amttype net order get total lines set amount amttype charge order get charge amt contained objects m taxes load taxes p lines load lines order log fine lines p lines length taxes m taxes length return null loaddocumentdetails morder morder setdatedoc getdateordered setistaxincluded istaxincluded setamount amttype_gross getgrandtotal setamount amttype_net gettotallines setamount amttype_charge getchargeamt m_taxes loadtaxes p_lines loadlines p_lines m_taxes load invoice line return doc line array private doc line load lines m order order array list doc line list new array list doc line m order line lines order get lines for int i 0 i lines length i m order line line lines i doc line doc line new doc line line this big decimal qty line get qty ordered doc line set qty qty order isso trx big decimal price actual line get price actual big decimal price cost null if get document type equals doctype porder po price cost line get price cost big decimal line net amt null if price cost null price cost signum 0 line net amt qty multiply price cost else line net amt line get line net amt doc line set amount line net amt dr big decimal price list line get price list int c tax id doc line getc tax id correct included tax if is tax included c tax id 0 m tax tax m tax get get ctx c tax id if tax is zero tax big decimal line net amt tax tax calculate tax line net amt true get std precision log fine line net amt line net amt tax line net amt tax line net amt line net amt subtract line net amt tax for int t 0 t m taxes length t if m taxes t getc tax id c tax id m taxes t add included tax line net amt tax break big decimal price list tax tax calculate tax price list true get std precision price list price list subtract price list tax correct included tax doc line set amount line net amt price list qty list add doc line return array doc line dl new doc line list size list to array dl return dl docline docline loadlines morder arraylist docline arraylist docline morderline getlines morderline docline docline docline bigdecimal getqtyordered docline setqty issotrx bigdecimal priceactual getpriceactual bigdecimal pricecost getdocumenttype doctype_porder pricecost getpricecost bigdecimal linenetamt pricecost pricecost linenetamt pricecost linenetamt getlinenetamt docline setamount linenetamt bigdecimal pricelist getpricelist c_tax_id docline getc_tax_id istaxincluded c_tax_id mtax mtax getctx c_tax_id iszerotax bigdecimal linenetamttax calculatetax linenetamt getstdprecision linenetamt linenetamt linenetamttax linenetamt linenetamt linenetamttax m_taxes m_taxes getc_tax_id c_tax_id m_taxes addincludedtax linenetamttax bigdecimal pricelisttax calculatetax pricelist getstdprecision pricelist pricelist pricelisttax docline setamount linenetamt pricelist docline docline docline toarray load requisitions return requisition lines of order private doc line load requisitions m order order m order getpo m order line o lines order get lines hash map integer big decimal qtys new hash map integer big decimal for int i 0 i o lines length i m order line line o lines i qtys put new integer line getc orderline id line get qty ordered array list doc line list new array list doc line string sql select from m requisitionline rl where exists select from c order o inner join c orderline ol on o c order id ol c order id where ol c orderline id rl c orderline id and o c order id order by rl c orderline id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 order getc order id result set rs pstmt execute query while rs next m requisition line line new m requisition line get ctx rs null doc line doc line new doc line line this quantity not more then order line issue split of requisition to multiple p os different price integer key new integer line getc orderline id big decimal max qty qtys get key big decimal qty line get qty max max qty if qty signum 0 continue doc line set qty qty false qtys put key max qty subtract qty big decimal price actual line get price actual big decimal line net amt line get line net amt if line get qty compare to qty 0 line net amt price actual multiply qty doc line set amount line net amt dr list add doc line rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return array doc line dls new doc line list size list to array dls return dls docline loadrequisitions morder morder morderline olines getlines hashmap bigdecimal hashmap bigdecimal olines morderline olines getc_orderline_id getqtyordered arraylist docline arraylist docline m_requisitionline c_order c_orderline c_order_id c_order_id c_orderline_id c_orderline_id c_order_id c_orderline_id preparedstatement preparestatement setint getc_order_id resultset executequery mrequisitionline mrequisitionline getctx docline docline docline orderline pos getc_orderline_id bigdecimal maxqty bigdecimal getqty maxqty docline setqty maxqty bigdecimal priceactual getpriceactual bigdecimal linenetamt getlinenetamt getqty compareto linenetamt priceactual docline setamount linenetamt docline docline docline toarray get currency precision return precision private int get std precision if m precision 1 m precision m currency get std precision get ctx getc currency id return m precision getstdprecision m_precision m_precision mcurrency getstdprecision getctx getc_currency_id m_precision load invoice taxes return doc tax array private doc tax load taxes array list doc tax list new array list doc tax string sql select it c tax id t name t rate it tax base amt it tax amt t is sales tax from c tax t c ordertax it where t c tax id it c tax id and it c order id try prepared statement pstmt db prepare statement sql get trx name pstmt set int 1 get id result set rs pstmt execute query while rs next int c tax id rs get int 1 string name rs get string 2 big decimal rate rs get big decimal 3 big decimal tax base amt rs get big decimal 4 big decimal amount rs get big decimal 5 boolean sales tax y equals rs get string 6 doc tax tax line new doc tax c tax id name rate tax base amt amount sales tax list add tax line rs close pstmt close catch sql exception e log log level severe sql e return array doc tax tl new doc tax list size list to array tl return tl doctax doctax loadtaxes arraylist doctax arraylist doctax c_tax_id taxbaseamt taxamt issalestax c_tax c_ordertax c_tax_id c_tax_id c_order_id preparedstatement preparestatement gettrxname setint get_id resultset executequery c_tax_id getint getstring bigdecimal getbigdecimal bigdecimal taxbaseamt getbigdecimal bigdecimal getbigdecimal salestax getstring doctax taxline doctax c_tax_id taxbaseamt salestax taxline sqlexception doctax doctax toarray get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value new big decimal 0 0 string buffer sb new string buffer total ret value ret value add get amount doc amttype gross sb append get amount doc amttype gross header charge ret value ret value subtract get amount doc amttype charge sb append append get amount doc amttype charge tax if m taxes null for int i 0 i m taxes length i ret value ret value subtract m taxes i get amount sb append append m taxes i get amount lines if p lines null for int i 0 i p lines length i ret value ret value subtract p lines i get amt source sb append append p lines i get amt source sb append if ret value signum 0 sum of cost vs price in lines may not add up get document type equals doctype porder po log fine to string balance ret value sb to string ignored ret value env zero else log fine to string balance ret value sb to string return ret value bigdecimal getbalance bigdecimal retvalue bigdecimal stringbuffer stringbuffer retvalue retvalue getamount amttype_gross getamount amttype_gross retvalue retvalue getamount amttype_charge getamount amttype_charge m_taxes m_taxes retvalue retvalue m_taxes getamount m_taxes getamount p_lines p_lines retvalue retvalue p_lines getamtsource p_lines getamtsource retvalue getdocumenttype doctype_porder tostring retvalue tostring retvalue tostring retvalue tostring retvalue create facts the accounting logic for soo poo pre reservation release expense dr offset cr commitment to be released by invoice matching expense cr offset dr pre param as accounting schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact purchase order if get document type equals doctype porder update productpo as update product info as getc acctschema id big decimal gross amt get amount doc amttype gross commitment if as is create commitment fact fact new fact this as fact post commitment big decimal total env zero for int i 0 i p lines length i doc line line p lines i big decimal cost line get amt source total total add cost account m account expense line get account product cost accttype p expense as fact line fl fact create line line expense getc currency id cost null offset m account offset get account accttype commitmentoffset as if offset null p error not found commitmentoffset acct log log level severe p error return null fact create line null offset getc currency id null total facts add fact reverse reservation if as is create reservation fact fact new fact this as fact post reservation big decimal total env zero if m requisitions null m requisitions load requisitions for int i 0 i m requisitions length i doc line line m requisitions i big decimal cost line get amt source total total add cost account m account expense line get account product cost accttype p expense as fact line fl fact create line line expense getc currency id null cost offset m account offset get account accttype commitmentoffset as if offset null p error not found commitmentoffset acct log log level severe p error return null fact create line null offset getc currency id total null facts add fact reservations so return facts arraylist createfacts macctschema arraylist arraylist getdocumenttype doctype_porder updateproductpo updateproductinfo getc_acctschema_id bigdecimal grossamt getamount amttype_gross iscreatecommitment post_commitment bigdecimal p_lines docline p_lines bigdecimal getamtsource maccount getaccount productcost accttype_p_expense factline createline getc_currency_id maccount getaccount accttype_commitmentoffset p_error notfound commitmentoffset_acct p_error createline getc_currency_id iscreatereservation post_reservation bigdecimal m_requisitions m_requisitions loadrequisitions m_requisitions docline m_requisitions bigdecimal getamtsource maccount getaccount productcost accttype_p_expense factline createline getc_currency_id maccount getaccount accttype_commitmentoffset p_error notfound commitmentoffset_acct p_error createline getc_currency_id update productpo price lastpo param as accounting schema private void update productpo m acct schema as m client info ci m client info get get ctx as getad client id if ci getc acctschema1 id as getc acctschema id return string buffer sql new string buffer update m product po po set price lastpo select currency convert ol price actual ol c currency id po c currency id o date ordered o c conversiontype id o ad client id o ad org id from c order o c orderline ol where o c order id ol c order id and po m product id ol m product id and po c bpartner id o c bpartner id and rownum 1 and o c order id append get id append append where exists select from c order o c orderline ol where o c order id ol c order id and po m product id ol m product id and po c bpartner id o c bpartner id and o c order id append get id append int no db execute update sql to string get trx name log fine updated no pricelastpo updateproductpo macctschema mclientinfo mclientinfo getctx getad_client_id getc_acctschema1_id getc_acctschema_id stringbuffer stringbuffer m_product_po pricelastpo currencyconvert priceactual c_currency_id c_currency_id dateordered c_conversiontype_id ad_client_id ad_org_id c_order c_orderline c_order_id c_order_id m_product_id m_product_id c_bpartner_id c_bpartner_id c_order_id get_id c_order c_orderline c_order_id c_order_id m_product_id m_product_id c_bpartner_id c_bpartner_id c_order_id get_id executeupdate tostring gettrxname get commitments param doc document param max qty qty invoiced matched param c invoiceline id invoice line return commitments order lines protected static doc line get commitments doc doc big decimal max qty int c invoiceline id int precision 1 array list doc line list new array list doc line string sql select from c orderline ol where exists select from c invoiceline il where il c orderline id ol c orderline id and il c invoiceline id or exists select from m matchpo po where po c orderline id ol c orderline id and po c invoiceline id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c invoiceline id pstmt set int 2 c invoiceline id result set rs pstmt execute query while rs next if max qty signum 0 continue m order line line new m order line doc get ctx rs null doc line doc line new doc line line doc currency if precision 1 doc setc currency id doc line getc currency id precision m currency get std precision doc get ctx doc line getc currency id qty big decimal qty line get qty ordered max max qty doc line set qty qty false big decimal price actual line get price actual big decimal price cost line get price cost big decimal line net amt null if price cost null price cost signum 0 line net amt qty multiply price cost else if qty equals max qty line net amt line get line net amt else line net amt qty multiply price actual max qty max qty subtract qty doc line set amount line net amt dr big decimal price list line get price list int c tax id doc line getc tax id correct included tax if c tax id 0 line get parent is tax included m tax tax m tax get doc get ctx c tax id if tax is zero tax big decimal line net amt tax tax calculate tax line net amt true precision s log fine line net amt line net amt tax line net amt tax line net amt line net amt subtract line net amt tax big decimal price list tax tax calculate tax price list true precision price list price list subtract price list tax correct included tax doc line set amount line net amt price list qty list add doc line rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return array doc line dl new doc line list size list to array dl return dl maxqty c_invoiceline_id docline getcommitments bigdecimal maxqty c_invoiceline_id arraylist docline arraylist docline c_orderline c_invoiceline c_orderline_id c_orderline_id c_invoiceline_id m_matchpo c_orderline_id c_orderline_id c_invoiceline_id preparedstatement preparestatement setint c_invoiceline_id setint c_invoiceline_id resultset executequery maxqty morderline morderline getctx docline docline docline setc_currency_id docline getc_currency_id mcurrency getstdprecision getctx docline getc_currency_id bigdecimal getqtyordered maxqty docline setqty bigdecimal priceactual getpriceactual bigdecimal pricecost getpricecost bigdecimal linenetamt pricecost pricecost linenetamt pricecost maxqty linenetamt getlinenetamt linenetamt priceactual maxqty maxqty docline setamount linenetamt bigdecimal pricelist getpricelist c_tax_id docline getc_tax_id c_tax_id getparent istaxincluded mtax mtax getctx c_tax_id iszerotax bigdecimal linenetamttax calculatetax linenetamt s_log linenetamt linenetamt linenetamttax linenetamt linenetamt linenetamttax bigdecimal pricelisttax calculatetax pricelist pricelist pricelist pricelisttax docline setamount linenetamt pricelist docline s_log docline docline toarray get commitment release called from match inv for accrual and allocation for cash based param as accounting schema param doc doc param qty qty invoiced matched param c invoiceline id line param multiplier 1 for accrual return fact protected static fact get commitment release m acct schema as doc doc big decimal qty int c invoiceline id big decimal multiplier fact fact new fact doc as fact post commitment doc line commitments doc order get commitments doc qty c invoiceline id big decimal total env zero int c currency id 1 for int i 0 i commitments length i doc line line commitments i if c currency id 1 c currency id line getc currency id else if c currency id line getc currency id doc p error different currencies of order lines s log log level severe doc p error return null big decimal cost line get amt source multiply multiplier total total add cost account m account expense line get account product cost accttype p expense as fact line fl fact create line line expense c currency id null cost offset m account offset doc get account accttype commitmentoffset as if offset null doc p error not found commitmentoffset acct s log log level severe doc p error return null fact create line null offset c currency id total null return fact matchinv c_invoiceline_id getcommitmentrelease macctschema bigdecimal c_invoiceline_id bigdecimal post_commitment docline doc_order getcommitments c_invoiceline_id bigdecimal c_currency_id docline c_currency_id c_currency_id getc_currency_id c_currency_id getc_currency_id p_error s_log p_error bigdecimal getamtsource maccount getaccount productcost accttype_p_expense factline createline c_currency_id maccount getaccount accttype_commitmentoffset p_error notfound commitmentoffset_acct s_log p_error createline c_currency_id update product info old costing price lastpo po price lastpo param c acctschema id accounting schema deprecated old costing private void update product info int c acctschema id log fine c order id get id todo last would need to compare document last updated date would need to maintain last price update date on po and costing update product costing requires existence of currency conversion if there are multiple lines of the same product last price uses first string buffer sql new string buffer update m product costing pc set price lastpo select currency convert ol price actual ol c currency id a c currency id o date ordered o c conversiontype id o ad client id o ad org id from c order o c orderline ol c acctschema a where o c order id ol c order id and pc m product id ol m product id and pc c acctschema id a c acctschema id and rownum 1 and pc c acctschema id append c acctschema id append and o c order id append get id append append where exists select from c order o c orderline ol c acctschema a where o c order id ol c order id and pc m product id ol m product id and pc c acctschema id a c acctschema id and pc c acctschema id append c acctschema id append and o c order id append get id append int no db execute update sql to string get trx name log fine m product costing updated no pricelastpo pricelastpo c_acctschema_id updateproductinfo c_acctschema_id c_order_id get_id lastpriceupdatedate _po _costing stringbuffer stringbuffer m_product_costing pricelastpo currencyconvert priceactual c_currency_id c_currency_id dateordered c_conversiontype_id ad_client_id ad_org_id c_order c_orderline c_acctschema c_order_id c_order_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_order_id get_id c_order c_orderline c_acctschema c_order_id c_order_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_order_id get_id executeupdate tostring gettrxname m_product_costing standard constructor public x m distributionlist properties ctx int m distributionlist id string trx name super ctx m distributionlist id trx name if m distributionlist id 0 setm distributionlist id 0 set name null x_m_distributionlist m_distributionlist_id trxname m_distributionlist_id trxname m_distributionlist_id setm_distributionlist_id setname load constructor public x m distributionlist properties ctx result set rs string trx name super ctx rs trx name x_m_distributionlist resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m distributionlist append get id append return sb to string tostring stringbuffer stringbuffer x_m_distributionlist get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set distribution list distribution lists allow to distribute products to a selected list of partners public void setm distributionlist id int m distributionlist id if m distributionlist id 1 throw new illegal argument exception m distributionlist id is mandatory set valuenocheck m distributionlist id new integer m distributionlist id setm_distributionlist_id m_distributionlist_id m_distributionlist_id illegalargumentexception m_distributionlist_id set_valuenocheck m_distributionlist_id m_distributionlist_id get distribution list distribution lists allow to distribute products to a selected list of partners public int getm distributionlist id integer ii integer get value m distributionlist id if ii null return 0 return ii int value getm_distributionlist_id get_value m_distributionlist_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set total ratio total of relative weight in a distribution public void set ratio total big decimal ratio total set value ratio total ratio total setratiototal bigdecimal ratiototal set_value ratiototal ratiototal get total ratio total of relative weight in a distribution public big decimal get ratio total big decimal bd big decimal get value ratio total if bd null return env zero return bd bigdecimal getratiototal bigdecimal bigdecimal get_value ratiototal get contents return contents public object get contents return contents getcontents get parameters for a node param ctx context param ad wf node id node return array of parameters public static mwf node para get parameters properties ctx int ad wf node id array list mwf node para list new array list mwf node para string sql select from ad wf node para where ad wf node id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad wf node id result set rs pstmt execute query while rs next list add new mwf node para ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get parameters e try if pstmt null pstmt close pstmt null catch exception e pstmt null mwf node para ret value new mwf node para list size list to array ret value return ret value ad_wf_node_id mwfnodepara getparameters ad_wf_node_id arraylist mwfnodepara arraylist mwfnodepara ad_wf_node_para ad_wf_node_id preparedstatement preparestatement setint ad_wf_node_id resultset executequery mwfnodepara s_log getparameters mwfnodepara retvalue mwfnodepara toarray retvalue retvalue standard constructor param ctx context param id id public mwf node para properties ctx int id string trx name super ctx id trx name mwfnodepara trxname trxname load constructor param ctx context param rs result set public mwf node para properties ctx result set rs string trx name super ctx rs trx name mwfnodepara resultset trxname trxname get process parameter return process parameter public m process para get process para if m processpara null m processpara new m process para get ctx getad process para id get trxname return m processpara mprocesspara getprocesspara m_processpara m_processpara mprocesspara getctx getad_process_para_id get_trxname m_processpara get attribute name if not set retrieve it return attribute name public string get attribute name string an super get attribute name if an null an length 0 getad process para id 0 an get process para get column name set attribute name an save return an getattributename getattributename getad_process_para_id getprocesspara getcolumnname setattributename get display type return display type public int get display type return get process para getad reference id getdisplaytype getprocesspara getad_reference_id is mandatory return true if mandatory public boolean is mandatory return get process para is mandatory ismandatory getprocesspara ismandatory set ad process para id param ad process para id id public void setad process para id int ad process para id super setad process para id ad process para id set attribute name null ad_process_para_id ad_process_para_id setad_process_para_id ad_process_para_id setad_process_para_id ad_process_para_id setattributename standatd constructor param ctx context param ad alertrule id id public m alert rule properties ctx int ad alertrule id string trx name super ctx ad alertrule id trx name ad_alertrule_id malertrule ad_alertrule_id trxname ad_alertrule_id trxname standard constructor param ctx context param rs result set public m alert rule properties ctx result set rs string trx name super ctx rs trx name malertrule resultset trxname trxname get sql return sql public string get sql string buffer sql new string buffer sql append select append get select clause append from append get from clause if get where clause null get where clause length 0 sql append where append get where clause if get other clause null get other clause length 0 sql append append get other clause return sql to string getsql stringbuffer stringbuffer getselectclause getfromclause getwhereclause getwhereclause getwhereclause getotherclause getotherclause getotherclause tostring before save param new record new return true protected boolean before save boolean new record if new record set is valid true if is valid set error msg null return true newrecord beforesave newrecord newrecord setisvalid isvalid seterrormsg string representation return info public string to string string buffer sb new string buffer m alert rule sb append get id append append get name append valid append is valid append append get sql sb append return sb to string tostring stringbuffer stringbuffer malertrule get_id getname isvalid getsql tostring standard constructor public x ad fieldgroup properties ctx int ad fieldgroup id string trx name super ctx ad fieldgroup id trx name if ad fieldgroup id 0 setad fieldgroup id 0 set entity type null u set name null x_ad_fieldgroup ad_fieldgroup_id trxname ad_fieldgroup_id trxname ad_fieldgroup_id setad_fieldgroup_id setentitytype setname load constructor public x ad fieldgroup properties ctx result set rs string trx name super ctx rs trx name x_ad_fieldgroup resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad fieldgroup append get id append return sb to string tostring stringbuffer stringbuffer x_ad_fieldgroup get_id tostring set field group logical grouping of fields public void setad fieldgroup id int ad fieldgroup id if ad fieldgroup id 1 throw new illegal argument exception ad fieldgroup id is mandatory set valuenocheck ad fieldgroup id new integer ad fieldgroup id setad_fieldgroup_id ad_fieldgroup_id ad_fieldgroup_id illegalargumentexception ad_fieldgroup_id set_valuenocheck ad_fieldgroup_id ad_fieldgroup_id get field group logical grouping of fields public int getad fieldgroup id integer ii integer get value ad fieldgroup id if ii null return 0 return ii int value getad_fieldgroup_id get_value ad_fieldgroup_id intvalue public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x m movementlineconfirm properties ctx int m movementlineconfirm id string trx name super ctx m movementlineconfirm id trx name if m movementlineconfirm id 0 set confirmed qty env zero set difference qty env zero setm movementconfirm id 0 setm movementlineconfirm id 0 setm movementline id 0 set processed false set scrapped qty env zero set target qty env zero x_m_movementlineconfirm m_movementlineconfirm_id trxname m_movementlineconfirm_id trxname m_movementlineconfirm_id setconfirmedqty setdifferenceqty setm_movementconfirm_id setm_movementlineconfirm_id setm_movementline_id setprocessed setscrappedqty settargetqty load constructor public x m movementlineconfirm properties ctx result set rs string trx name super ctx rs trx name x_m_movementlineconfirm resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m movementlineconfirm append get id append return sb to string tostring stringbuffer stringbuffer x_m_movementlineconfirm get_id tostring set confirmed quantity confirmation of a received quantity public void set confirmed qty big decimal confirmed qty if confirmed qty null throw new illegal argument exception confirmed qty is mandatory set value confirmed qty confirmed qty setconfirmedqty bigdecimal confirmedqty confirmedqty illegalargumentexception confirmedqty set_value confirmedqty confirmedqty get confirmed quantity confirmation of a received quantity public big decimal get confirmed qty big decimal bd big decimal get value confirmed qty if bd null return env zero return bd bigdecimal getconfirmedqty bigdecimal bigdecimal get_value confirmedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set difference difference quantity public void set difference qty big decimal difference qty if difference qty null throw new illegal argument exception difference qty is mandatory set value difference qty difference qty setdifferenceqty bigdecimal differenceqty differenceqty illegalargumentexception differenceqty set_value differenceqty differenceqty get difference difference quantity public big decimal get difference qty big decimal bd big decimal get value difference qty if bd null return env zero return bd bigdecimal getdifferenceqty bigdecimal bigdecimal get_value differenceqty set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set move confirm inventory move confirmation public void setm movementconfirm id int m movementconfirm id if m movementconfirm id 1 throw new illegal argument exception m movementconfirm id is mandatory set valuenocheck m movementconfirm id new integer m movementconfirm id setm_movementconfirm_id m_movementconfirm_id m_movementconfirm_id illegalargumentexception m_movementconfirm_id set_valuenocheck m_movementconfirm_id m_movementconfirm_id get move confirm inventory move confirmation public int getm movementconfirm id integer ii integer get value m movementconfirm id if ii null return 0 return ii int value getm_movementconfirm_id get_value m_movementconfirm_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm movementconfirm id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_movementconfirm_id set move line confirm inventory move line confirmation public void setm movementlineconfirm id int m movementlineconfirm id if m movementlineconfirm id 1 throw new illegal argument exception m movementlineconfirm id is mandatory set valuenocheck m movementlineconfirm id new integer m movementlineconfirm id setm_movementlineconfirm_id m_movementlineconfirm_id m_movementlineconfirm_id illegalargumentexception m_movementlineconfirm_id set_valuenocheck m_movementlineconfirm_id m_movementlineconfirm_id get move line confirm inventory move line confirmation public int getm movementlineconfirm id integer ii integer get value m movementlineconfirm id if ii null return 0 return ii int value getm_movementlineconfirm_id get_value m_movementlineconfirm_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 1 throw new illegal argument exception m movementline id is mandatory set value m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id illegalargumentexception m_movementline_id set_value m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set scrapped quantity the quantity scrapped due to qa issues public void set scrapped qty big decimal scrapped qty if scrapped qty null throw new illegal argument exception scrapped qty is mandatory set value scrapped qty scrapped qty setscrappedqty bigdecimal scrappedqty scrappedqty illegalargumentexception scrappedqty set_value scrappedqty scrappedqty get scrapped quantity the quantity scrapped due to qa issues public big decimal get scrapped qty big decimal bd big decimal get value scrapped qty if bd null return env zero return bd bigdecimal getscrappedqty bigdecimal bigdecimal get_value scrappedqty set target quantity target movement quantity public void set target qty big decimal target qty if target qty null throw new illegal argument exception target qty is mandatory set value target qty target qty settargetqty bigdecimal targetqty targetqty illegalargumentexception targetqty set_value targetqty targetqty get target quantity target movement quantity public big decimal get target qty big decimal bd big decimal get value target qty if bd null return env zero return bd bigdecimal gettargetqty bigdecimal bigdecimal get_value targetqty prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id para i get parameter as int else if name equals m product category id p m product category id para i get parameter as int else if name equals set future cost to p setfuturecostto string para i get parameter else if name equals m pricelist version id p m pricelist version id para i get parameter as int else if name equals set standard cost p setstandardcost string para i get parameter else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id getparameterasint m_product_category_id p_m_product_category_id getparameterasint setfuturecostto p_setfuturecostto getparameter m_pricelist_version_id p_m_pricelist_version_id getparameterasint setstandardcost p_setstandardcost getparameter p_record_id getrecord_id process return message throws exception protected string do it throws exception string buffer sql null int no 0 int no1 0 int no2 0 log info create the new costing information 1 set future cost to if p setfuturecostto equals s s standard cost log info set to standard cost sql new string buffer update m product costing set future cost price cost standard where ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to standard cost error sql to string else if p setfuturecostto equals dp dp difference po log info set to difference po sql new string buffer update m product costing set future cost price cost standard cost standardpo amt cost standardpo qty where cost standardpo qty 0 and cost standardpo amt 0 and ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to difference po error sql to string else if p setfuturecostto equals di di difference invoice log info set to difference inv sql new string buffer update m product costing set future cost price cost standard cost standard cum amt cost standard cum qty where cost standard cum qty 0 and cost standard cum amt 0 and ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to difference inv error sql to string else if p setfuturecostto equals p p last po price log info set to po price sql new string buffer update m product costing set future cost price price lastpo where price lastpo 0 and ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to po price error sql to string else if p setfuturecostto equals i l last inv price log info set to inv price sql new string buffer update m product costing set future cost price price last inv where price last inv 0 and ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to inv price error sql to string else if p setfuturecostto equals a a average cost log info set to average cost sql new string buffer update m product costing set future cost price cost average where cost average 0 and ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to average cost error sql to string else if p setfuturecostto equals ll p m pricelist version id 0 a average cost log info set to price list p m pricelist version id sql new string buffer update m product costing set future cost price select pp price limit from m productprice pp where pp m pricelist version id p m pricelist version id and pp m product id m product costing m product id set future cost price c currency convert amount select pp price limit from m productprice pp where pp m pricelist version id 11 and pp m product id m product costing m product id cur from select c currency id from m pricelist pl m pricelist version pv where pv m pricelist id pl m pricelist id and pv m pricelist version id 11 cur to select a c currency id from c acctschema a where a c acctschema id m product costing c acctschema id where ad client id p ad client id we have a price and exists select from m productprice pp where pp m pricelist version id p m pricelist version id and pp m product id m product costing m product id and the same currency and exists select from c acctschema a m pricelist pl m pricelist version pv where a c acctschema id m product costingupdate c acctschema id and pv m pricelist version id p m pricelist version id and pv m pricelist id pl m pricelist id and pl c currency id a c currency id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no db execute update sql to string if no 1 raise error set to average cost error sql to string else log info set future cost to p setfuturecostto log info updated no 2 set standard cost if p setstandardcost equals y a average cost log info set standard cost sql new string buffer update m product costing set cost standard future cost price where ad client id p ad client id and p m product category id 1 or exists select from m product p where p m product category id p m product category id and p m product id m product costing m product id no1 db execute update sql to string if no1 1 raise error set standard cost sql to string 3 update current cost price depending on costing method try prepared statement pstmt db prepare statement select a costing method from c acctschema a ad clientinfo ci where a c acctschema id ci c acctschema1 id and ci ad client id p ad client id result set rs pstmt execute query if rs next v costingmethod rs get string 1 rs close pstmt close catch sql exception e throw new exception select costing method e a verage s tandard log info update current cost v costingmethod log info set standard cost sql new string buffer update m product costing set current cost price decode v costingmethod a cost average cost standard where ad client id p ad client id no2 db execute update sql to string if no2 1 raise error set standard cost sql to string log info updated no2 return updated no no1 doit stringbuffer p_setfuturecostto stringbuffer m_product_costing futurecostprice coststandard ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto stringbuffer m_product_costing futurecostprice coststandard coststandardpoamt coststandardpoqty coststandardpoqty coststandardpoamt ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto stringbuffer m_product_costing futurecostprice coststandard coststandardcumamt coststandardcumqty coststandardcumqty coststandardcumamt ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto stringbuffer m_product_costing futurecostprice pricelastpo pricelastpo ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto stringbuffer m_product_costing futurecostprice pricelastinv pricelastinv ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto stringbuffer m_product_costing futurecostprice costaverage costaverage ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring p_setfuturecostto p_m_pricelist_version_id pricelist p_m_pricelist_version_id stringbuffer m_product_costing futurecostprice pricelimit m_productprice m_pricelist_version_id p_m_pricelist_version_id m_product_id m_product_costing m_product_id futurecostprice c_currency_convert pricelimit m_productprice m_pricelist_version_id m_product_id m_product_costing m_product_id c_currency_id m_pricelist m_pricelist_version m_pricelist_id m_pricelist_id m_pricelist_version_id c_currency_id c_acctschema c_acctschema_id m_product_costing c_acctschema_id ad_client_id p_ad_client_id m_productprice m_pricelist_version_id p_m_pricelist_version_id m_product_id m_product_costing m_product_id c_acctschema m_pricelist m_pricelist_version c_acctschema_id m_product_costingupdate c_acctschema_id m_pricelist_version_id p_m_pricelist_version_id m_pricelist_id m_pricelist_id c_currency_id c_currency_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring setfuturecostto p_setfuturecostto setstandardcost p_setstandardcost stringbuffer m_product_costing coststandard futurecostprice ad_client_id p_ad_client_id p_m_product_category_id m_product m_product_category_id p_m_product_category_id m_product_id m_product_costing m_product_id executeupdate tostring raiseerror tostring currentcostprice preparedstatement preparestatement costingmethod c_acctschema ad_clientinfo c_acctschema_id c_acctschema1_id ad_client_id p_ad_client_id resultset executequery v_costingmethod getstring sqlexception costingmethod v_costingmethod stringbuffer m_product_costing currentcostprice v_costingmethod costaverage coststandard ad_client_id p_ad_client_id executeupdate tostring raiseerror tostring private void raise error string string string sql throws exception db rollback false get trxname string msg string value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg raiseerror get_trxname valuenamepair clogger retrieveerror getname compiereusererror get content return content public object get contents return contents getcontents standard constructor public x c jobremuneration properties ctx int c jobremuneration id string trx name super ctx c jobremuneration id trx name if c jobremuneration id 0 setc jobremuneration id 0 setc job id 0 setc remuneration id 0 set valid from new timestamp system current time millis x_c_jobremuneration c_jobremuneration_id trxname c_jobremuneration_id trxname c_jobremuneration_id setc_jobremuneration_id setc_job_id setc_remuneration_id setvalidfrom currenttimemillis load constructor public x c jobremuneration properties ctx result set rs string trx name super ctx rs trx name x_c_jobremuneration resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c jobremuneration append get id append return sb to string tostring stringbuffer stringbuffer x_c_jobremuneration get_id tostring set position remuneration remuneration for the position public void setc jobremuneration id int c jobremuneration id if c jobremuneration id 1 throw new illegal argument exception c jobremuneration id is mandatory set valuenocheck c jobremuneration id new integer c jobremuneration id setc_jobremuneration_id c_jobremuneration_id c_jobremuneration_id illegalargumentexception c_jobremuneration_id set_valuenocheck c_jobremuneration_id c_jobremuneration_id get position remuneration remuneration for the position public int getc jobremuneration id integer ii integer get value c jobremuneration id if ii null return 0 return ii int value getc_jobremuneration_id get_value c_jobremuneration_id intvalue set position job position public void setc job id int c job id if c job id 1 throw new illegal argument exception c job id is mandatory set valuenocheck c job id new integer c job id setc_job_id c_job_id c_job_id illegalargumentexception c_job_id set_valuenocheck c_job_id c_job_id get position job position public int getc job id integer ii integer get value c job id if ii null return 0 return ii int value getc_job_id get_value c_job_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc job id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_job_id set remuneration wage or salary public void setc remuneration id int c remuneration id if c remuneration id 1 throw new illegal argument exception c remuneration id is mandatory set valuenocheck c remuneration id new integer c remuneration id setc_remuneration_id c_remuneration_id c_remuneration_id illegalargumentexception c_remuneration_id set_valuenocheck c_remuneration_id c_remuneration_id get remuneration wage or salary public int getc remuneration id integer ii integer get value c remuneration id if ii null return 0 return ii int value getc_remuneration_id get_value c_remuneration_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto get contents return context public object get contents return contents getcontents cosntructor param type database db public convert string type if database db oracle equals type m isoracle true else if database db sybase equals type m map convert map get sybase map else if database db postgresql equals type m map convert map get postgesql map else throw new unsupported operation exception unsupported database type db_ db_oracle m_isoracle db_sybase m_map convertmap getsybasemap db_postgresql m_map convertmap getpostgesqlmap unsupportedoperationexception set verbose param verbose public void set verbose boolean verbose m verbose verbose setverbose m_verbose is oracle db return true if connection is oracle db public boolean is oracle return m isoracle isoracle m_isoracle execute sql statement stops at first error if an error occured had error returns true you can get details via get conversion error or get exception param sql statements returns true if success throws illegal state exception if no connection public boolean execute string sql statements connection conn if conn null throw new illegal state exception require connection string sql convert sql statements m exception null if m conversionerror null sql null return false boolean ok true int i 0 string statement null try if m stmt null m stmt conn create statement for i 0 ok i sql length i statement sql i if statement length 0 if m verbose log finer skipping empty i else if m verbose log info executing i statement else log info executing i try m stmt clear warnings int no m stmt execute update statement sql warning warn m stmt get warnings if warn null if m verbose log info warn else log info executing i statement log info warn if m verbose log fine ok no catch sql exception ex ignore drop errors if statement starts with drop ok false m exception ex if m verbose log info executing i statement log info error executing i sql length ex for all statements catch sql exception e m exception e if m verbose log info executing i statement log info error executing i sql length e return false return ok haderror getconversionerror getexception sqlstatements illegalstateexception sqlstatements illegalstateexception sqlstatements m_exception m_conversionerror m_stmt m_stmt createstatement m_verbose m_verbose m_stmt clearwarnings m_stmt executeupdate sqlwarning m_stmt getwarnings m_verbose m_verbose sqlexception startswith m_exception m_verbose sqlexception m_exception m_verbose return last execution exception return execution exception public exception get exception return m exception getexception m_exception returns true if a conversion or execution error had occured get more details via get conversion error or get exception return true if error had occured public boolean has error return m exception null m conversionerror null getconversionerror getexception haserror m_exception m_conversionerror convert sql statement stops at first error statements are delimited by if an error occured had error returns true you can get details via get conversion error param sql statements return converted statement as a string public string convert all string sql statements string sql convert sql statements string buffer sb new string buffer sql statements length 10 for int i 0 i sql length i line separator sb append sql i append n n if m verbose log info statement i sql i return sb to string haderror getconversionerror sqlstatements convertall sqlstatements sqlstatements stringbuffer stringbuffer sqlstatements m_verbose tostring convert sql statement stops at first error if an error occured had error returns true you can get details via get conversion error param sql statements return array of converted statements public string convert string sql statements m conversionerror null if sql statements null sql statements length 0 m conversionerror sql statement is null or has zero length log info m conversionerror return null return convert it sql statements haderror getconversionerror sqlstatements sqlstatements m_conversionerror sqlstatements sqlstatements m_conversionerror sql_statement m_conversionerror convertit sqlstatements return last conversion error or null return lst conversion error public string get conversion error return m conversionerror getconversionerror m_conversionerror conversion routine stops at first error pre mask in strings break into single statement unmask statements for each statement convert statement remove comments process function trigger procedure process statement convert simple statement based on convert map convert complex statement decode sequence exception pre param sql statements return array of converted statements private string convert it string sql statements need to mask in sql strings final char mask u001f unit separator string buffer masked new string buffer sql statements length matcher m pattern compile pattern dotall matcher sql statements while m find string group m group sql string if group index of 1 in string group group replace mask if group index of 1 group character needs to be escaped group util replace group m append replacement masked group m append tail masked string temp result masked to string todo need to mask in comments statements ending with string sql temp result split s s s s s array list string result new array list string sql length process statements for int i 0 i sql length i string statement sql i if statement index of mask 1 statement statement replace mask result add all convert statement statement may return more than one target statement convert to array sql new string result size result to array sql return sql convertstatement convertsimplestatement convertmap convertcomplexstatement sqlstatements convertit sqlstatements stringbuffer stringbuffer sqlstatements sqlstatements indexof indexof appendreplacement appendtail tempresult tostring tempresult arraylist arraylist indexof addall convertstatement toarray convert single statements remove comments process function trigger procedure process statement param sql statement return converted statement private array list string convert statement string sql statement array list string result new array list string if m isoracle result add sql statement return result remove comments begin vpj cd e evolution 07 12 2005 postgresql string statement remove comments sql statement string statement remove comments sql statement to upper case begin vpj cd e evolution 07 12 2005 postgresql log info log info statement log info string cmp string statement to upper case boolean is create cmp string starts with create process if is create cmp string index of function 1 result add all convert function statement else if is create cmp string index of trigger 1 result add all convert trigger statement else if is create cmp string index of procedure 1 result add all convert procedure statement else if is create cmp string index of view 1 result add all convert view statement begin vpj cd e evolution 02 24 2005 postgresql else if cmp string index of alter table 1 result add convertddl statement else if cmp string index of rownum 1 result add convert row num convert alias conver simple statement statement else if cmp string index of delete 1 cmp string index of delete from 1 statement convert delete statement cmp string statement system out println cmp string cmp string result add conver simple statement convert alias cmp string else if cmp string index of delete from 1 result add conver simple statement convert alias statement else if cmp string index of update 1 result add conver simple statement convert update convert alias statement else result add conver simple statement convert alias statement end vpj cd e evolution 02 24 2005 postgresql log info for int i 0 i result size i log info result get i log info begin vpj cd e evolution 06 21 2005 postgresql result add convert alias statement end vpj cd e evolution 02 21 2005 postgresql return result sqlstatement arraylist convertstatement sqlstatement arraylist arraylist m_isoracle sqlstatement removecomments sqlstatement removecomments sqlstatement touppercase cmpstring touppercase iscreate cmpstring startswith iscreate cmpstring indexof addall convertfunction iscreate cmpstring indexof addall converttrigger iscreate cmpstring indexof addall convertprocedure iscreate cmpstring indexof addall convertview cmpstring indexof cmpstring indexof convertrownum convertalias conversimplestatement cmpstring indexof cmpstring indexof convertdelete cmpstring cmpstring cmpstring conversimplestatement convertalias cmpstring cmpstring indexof conversimplestatement convertalias cmpstring indexof conversimplestatement convertupdate convertalias conversimplestatement convertalias convertalias convert simple sql statement based on convert map param sql statement return converted statement private string conver simple statement string sql statement error checks if sql statement to upper case index of exception when 1 string error exception clause needs to be converted sql statement log info error m conversionerror error return sql statement standard statement string ret value sql statement iterator iter m map key set iterator while iter has next begin e evolution vpj cd 26 09 2005 search reserved word ie date into date and remplace for character temporal vector ret vars new vector pattern p pattern compile w matcher m p matcher ret value while m find ret vars add element new string ret value substring m start m end ret vars add element new string m replace all end e evolution vpj cd 26 09 2005 string regex string iter next string replacement string m map get regex try begin e evolution vpj cd 29 09 2005 pattern p pattern compile regex regex flags matcher m p matcher ret value ret value m replace all remplace reserved work p pattern compile regex regex flags m p matcher string ret vars get ret vars size 1 ret value m replace all replacement p pattern compile regex flags m p matcher ret value for int cont 0 cont ret vars size 1 cont ret value m replace first string ret vars get cont m p matcher ret value end e evolution vpj cd 29 09 2005 catch exception e string error error expression regex e log info error m conversionerror error convert decode sequence join return convert complex statement ret value convertmap sqlstatement conversimplestatement sqlstatement sqlstatement touppercase indexof sqlstatement m_conversionerror sqlstatement retvalue sqlstatement m_map keyset hasnext retvars retvalue retvars addelement retvalue retvars addelement replaceall m_map regex_flags retvalue retvalue replaceall regex_flags retvars retvars retvalue replaceall regex_flags retvalue retvars retvalue replacefirst retvars retvalue m_conversionerror convertcomplexstatement retvalue clean up statement remove all comments and while spaces database specific functionality can me tagged as follows pre 047 oracle gt 047 oracle specific statement 047 lt oracle 047 047 postgresql gt postgresql specicic statements lt postgresql 047 pre param statement return sql statement protected string remove comments string statement string clean statement trim remove oracle oracle matcher m pattern compile oracle oracle pattern dotall matcher clean clean m replace all remove postgresql m pattern compile postgresql matcher clean clean m replace all remove postgresql m pattern compile postgresql matcher clean clean m replace all remove m pattern compile pattern dotall matcher clean clean m replace all remove m pattern compile matcher clean up to eol clean m replace all m pattern compile n r matcher clean at bol clean m replace all convert cr lf tab to single space m pattern compile s matcher clean clean m replace all clean clean trim return clean removecomments replaceall replaceall replaceall replaceall replaceall replaceall replaceall convert function pre create or replace function ad message get p ad message in varchar p ad language in varchar return varchar as end ad message get create function ad message get varchar varchar returns varchar as declare p ad message alias for 1 p ad language alias for 2 end language plpgsql pre param sql statement return create and drop function statement private array list string convert function string sql statement array list string result new array list string convert statement to avoid handling contents of comments string stmt conver simple statement sql statement double quotes stmt pattern compile matcher stmt replace all remove or replace int or replace pos stmt to upper case index of or replace if or replace pos 1 stmt create stmt substring or replace pos 11 line separators string match parameter breturn w as is return clause statement end nice to have for readability bbegin b begin bthen b belse b belsif b matcher m pattern compile match pattern case insensitive matcher stmt string buffer sb new string buffer first group create or replace function ad message get p ad message in varchar p ad language in varchar create function ad message get varchar varchar m find m append replacement sb string name sb substring 6 trim string buffer signature new string buffer string group m group trim log info group group string buffer alias new string buffer parameters if group starts with group ends with default not supported if group to upper case index of default 1 string error default in parameter not supported log info error m conversionerror error return result signature append if group length 2 group group substring 1 group length 1 paraneters are delimited by string parameters group split for int i 0 i parameters length i if i 0 signature append name alias for 1 string p parameters i trim alias append p substring 0 p index of append alias for append i 1 append n datatape signature append p substring p last index of 1 signature append sb append signature log info alias alias to string log info signature signature to string no parameters else string error missing parameter log info error m conversionerror error return result sb append n need to create drop statement if or replace pos 1 string drop drop name signature to string log info drop result add drop log info 1 sb to string 1 second group return varchar as returns varchar as m find group m group m append replacement sb if group starts with return sb append returns append group substring group index of sb append ndeclare n append alias add aliases here log info 2 sb to string 2 remainder statements while m find string group2 m group if group2 index of 1 group character needs to be escaped group2 util replace group2 m append replacement sb group2 sb append n m append tail sb finish sb append language plpgsql log info sb to string result add sb to string return result ad_message_get p_ad_message p_ad_language ad_message_get ad_message_get p_ad_message p_ad_language sqlstatement arraylist convertfunction sqlstatement arraylist arraylist conversimplestatement sqlstatement replaceall orreplacepos touppercase indexof orreplacepos orreplacepos case_insensitive stringbuffer stringbuffer ad_message_get p_ad_message p_ad_language ad_message_get appendreplacement stringbuffer stringbuffer stringbuffer stringbuffer startswith endswith touppercase indexof m_conversionerror indexof lastindexof tostring tostring m_conversionerror orreplacepos tostring tostring appendreplacement startswith indexof tostring indexof appendreplacement appendtail tostring tostring convert procedure pre create or replace procedure ad message x p ad message in varchar p ad language in varchar end ad message x create function ad message x varchar varchar returns varchar as declare p ad message alias for 1 p ad language alias for 2 end language plpgsql pre param sql statement return create and drop function statement private array list string convert procedure string sql statement array list string result new array list string convert statement to avoid handling contents of comments string stmt conver simple statement sql statement double quotes stmt pattern compile matcher stmt replace all remove or replace int or replace pos stmt to upper case index of or replace if or replace pos 1 stmt create stmt substring or replace pos 11 line separators string match parameter breturn w as is return clause statement end nice to have for readability bbegin b begin bthen b belse b belsif b matcher m pattern compile match pattern case insensitive matcher stmt string buffer sb new string buffer first group create or replace function ad message get p ad message in varchar p ad language in varchar create function ad message get varchar varchar m find m append replacement sb string name sb substring 6 trim string buffer signature new string buffer string group m group trim log info group group string buffer alias new string buffer parameters if group starts with group ends with default not supported if group to upper case index of default 1 string error default in parameter not supported log info error m conversionerror error return result signature append if group length 2 group group substring 1 group length 1 paraneters are delimited by string parameters group split for int i 0 i parameters length i if i 0 signature append name alias for 1 string p parameters i trim alias append p substring 0 p index of append alias for append i 1 append n datatape signature append p substring p last index of 1 signature append sb append signature log info alias alias to string log info signature signature to string no parameters else string error missing parameter log info error m conversionerror error return result sb append n need to create drop statement if or replace pos 1 string drop drop name signature to string log info drop result add drop log info 1 sb to string 1 second group return varchar as returns varchar as m find group m group m append replacement sb if group starts with return sb append returns append group substring group index of sb append ndeclare n append alias add aliases here log info 2 sb to string 2 remainder statements while m find string group2 m group if group2 index of 1 group character needs to be escaped group2 util replace group2 m append replacement sb group2 sb append n m append tail sb finish sb append language plpgsql log info sb to string result add sb to string return result ad_message_x p_ad_message p_ad_language ad_message_x ad_message_x p_ad_message p_ad_language sqlstatement arraylist convertprocedure sqlstatement arraylist arraylist conversimplestatement sqlstatement replaceall orreplacepos touppercase indexof orreplacepos orreplacepos case_insensitive stringbuffer stringbuffer ad_message_get p_ad_message p_ad_language ad_message_get appendreplacement stringbuffer stringbuffer stringbuffer stringbuffer startswith endswith touppercase indexof m_conversionerror indexof lastindexof tostring tostring m_conversionerror orreplacepos tostring tostring appendreplacement startswith indexof tostring indexof appendreplacement appendtail tostring tostring convert trigger pre drop function emp trgf create function emp trg returns opaque as return new language plpgsql drop trigger emp trg on emp create trigger emp trg before insert or update on emp for each row execute procedure emp trgf pre param sql statement return create and drop trigger and associated function statement private array list string convert trigger string sql statement array list string result new array list string convert statement to avoid handling contents of comments string stmt conver simple statement sql statement trigger specific replacements stmt pattern compile binserting b matcher stmt replace all tg op insert stmt pattern compile bupdating b matcher stmt replace all tg op update stmt pattern compile bdeleting b matcher stmt replace all tg op delete stmt pattern compile new matcher stmt replace all new stmt pattern compile old matcher stmt replace all old double quotes stmt pattern compile matcher stmt replace all remove or replace int or replace pos stmt to upper case index of or replace trigger name int trigger pos stmt to upper case index of trigger 9 string trigger name stmt substring trigger pos trigger name trigger name substring 0 trigger name index of table name string table name stmt substring stmt to upper case index of on 4 table name table name substring 0 table name index of function drop if or replace pos 1 string drop drop function trigger name f log info drop result add drop function trigger int pos stmt index of declare if pos 1 pos stmt index of begin string function code stmt substring pos string buffer trigger code new string buffer create trigger trigger code append trigger name append n append stmt substring trigger pos trigger name length pos append nexecute procedure append trigger name append f add new to existing return delete trigger function code pattern compile breturn pattern case insensitive matcher function code replace all return new add final return and change name function code pattern compile bend trigger name pattern case insensitive matcher function code replace all nreturn new nend trigger name f line separators string match parameter statement end nice to have for readability bbegin b begin bthen b belse b belsif b matcher m pattern compile match pattern case insensitive matcher function code function header string buffer sb new string buffer create function sb append trigger name append f returns opaque as n remainder statements while m find string group m group if group index of 1 group character needs to be escaped group util replace group m append replacement sb group sb append n m append tail sb finish function sb append language plpgsql log info sb to string result add sb to string trigger drop if or replace pos 1 string drop drop trigger trigger name to lower case on table name log info drop result add drop trigger remove column references of on string trigger pattern compile sof on s matcher trigger code replace all on log info trigger result add trigger return result emp_trgf emp_trg emp_trg emp_trg emp_trgf sqlstatement arraylist converttrigger sqlstatement arraylist arraylist conversimplestatement sqlstatement replaceall tg_op replaceall tg_op replaceall tg_op replaceall replaceall replaceall orreplacepos touppercase indexof triggerpos touppercase indexof triggername triggerpos triggername triggername triggername indexof tablename touppercase indexof tablename tablename tablename indexof orreplacepos triggername indexof indexof functioncode stringbuffer triggercode stringbuffer triggercode triggername triggerpos triggername triggername functioncode case_insensitive functioncode replaceall functioncode triggername case_insensitive functioncode replaceall triggername case_insensitive functioncode stringbuffer stringbuffer triggername indexof appendreplacement appendtail tostring tostring orreplacepos triggername tolowercase tablename triggercode replaceall convert view handle create or replace param sql statement return converted statement s private array list string convert view string sql statement array list string result new array list string string stmt conver simple statement sql statement remove or replace int or replace pos stmt to upper case index of or replace if or replace pos 1 int index stmt index of view int space stmt index of index 6 string drop drop view stmt substring index 6 space result add drop string create create stmt substring index result add create else simple statement result add stmt return result sqlstatement arraylist convertview sqlstatement arraylist arraylist conversimplestatement sqlstatement orreplacepos touppercase indexof orreplacepos indexof indexof converts decode outer join and sequence pre decode a 1 one 2 two none case when a 1 then one when a 2 then two else none end ad error seq nextval nextval ad error seq raise application error 20100 table sequence not found raise exception table sequence not found pre param sql statement return converted statement private string convert complex statement string sql statement string ret value sql statement string buffer sb null convert all decode parts while ret value index of decode 1 ret value convert decode ret value sequence handling ad error seq nextval nextval ad error seq matcher m pattern compile w nextval curval pattern case insensitive matcher ret value sb new string buffer while m find string group m group system out print group int pos group index of string seq name group substring 0 pos string func name group substring pos 1 group func name seq name log info group if group index of 1 group character needs to be escaped group util replace group m append replacement sb group m append tail sb ret value sb to string raise raise application error 20100 table sequence not found raise exception table sequence not found m pattern compile raise application error s pattern case insensitive matcher ret value sb new string buffer while m find string group m group system out print group string result raise exception group substring group index of group last index of 1 log info result if result index of 1 group character needs to be escaped result util replace result m append replacement sb result m append tail sb ret value sb to string truncate handling begin vpj cd e evolution 16 07 2005 while ret value index of trunc 1 if ret value index of trunc trunc 1 db is postgresql ret value util replace ret value trunc trunc trunc while ret value index of trunc 1 ret value convert trunc ret value outer join handling int index ret value index of select if index 1 ret value index of index 1 ret value convert outer join ret value return ret value ad_error_seq ad_error_seq raise_application_error sqlstatement convertcomplexstatement sqlstatement retvalue sqlstatement stringbuffer retvalue indexof retvalue convertdecode retvalue ad_error_seq ad_error_seq case_insensitive retvalue stringbuffer indexof seqname funcname funcname seqname indexof appendreplacement appendtail retvalue tostring raise_application_error raise_application_error case_insensitive retvalue stringbuffer indexof lastindexof indexof appendreplacement appendtail retvalue tostring retvalue indexof retvalue indexof ispostgresql retvalue retvalue retvalue indexof retvalue converttrunc retvalue retvalue indexof retvalue indexof retvalue convertouterjoin retvalue retvalue converts decode pre decode a 1 one 2 two none case when a 1 then one when a 2 then two else none end pre param sql statement return converted statement private string convert decode string sql statement log info decode sql statement string statement sql statement string buffer sb new string buffer case int index statement index of decode string first part statement substring 0 index find the opening index statement index of index statement statement substring index 1 find the expression a find first ignoring index util find index of statement string expression statement substring 0 index trim log info expression expression pairs 1 one statement statement substring index 1 index util find index of statement while index 1 string first statement substring 0 index char cc statement char at index statement statement substring index 1 log info first first char cc boolean error false if cc index util find index of statement if index 1 error true else string second statement substring 0 index sb append when append expression append append first trim append then append second trim log info sb to string statement statement substring index 1 index util find index of statement else if cc sb append else append first trim append end log info sb to string index 1 else error true if error log log level severe sql sql statement n result sb to string n statement statement n first first n index index m conversionerror decode conversion error sb append statement sb insert 0 first part log info decode sb to string return sb to string sqlstatement convertdecode sqlstatement sqlstatement sqlstatement stringbuffer stringbuffer indexof firstpart indexof findindexof findindexof charat findindexof tostring findindexof tostring sqlstatement tostring m_conversionerror firstpart tostring tostring convert outer join converting joins can ve very complex when multiple tables keys are involved the main scenarios supported are two tables with multiple key columns and multiple tables with single key columns pre select a col1 b col2 from tablea a tableb b where a id b id select a col1 b col2 from tablea a left outer join tableb b on a id b id select a col1 b col2 from tablea a tableb b where a id b id select a col1 b col2 from tablea a right outer join tableb b on a id b id assumptions no outer joins in sub queries ignores sub queries or condition ignored not sure what to do should not happen limitations parameters for outer joins must be first as sequence of parameters changes pre param sql statement return converted statement private string convert outer join string sql statement boolean trace false int from index util find index of sql statement to upper case from int where index util find index of sql statement to upper case where begin vpj cd e evolution 03 14 2005 postgresql int end where index util find index of sql statement to upper case grpup by int end where index util find index of sql statement to upper case group by end vpj cd e evolution 03 14 2005 postgresql if end where index 1 end where index util find index of sql statement to upper case order by if end where index 1 end where index sql statement length if trace log info outer join sql statement log info from from index where where index end end where index length sql statement length string select part sql statement substring 0 from index string from part sql statement substring from index where index string where part sql statement substring where index end where index string rest sql statement substring end where index find remove all from where clase string new where part where part array list string joins new array list string int pos new where part index of while pos 1 find starting point int start new where part last index of and pos int start offset 5 if start 1 start new where part last index of or pos start offset 4 if start 1 start new where part last index of where pos start offset 6 if start 1 string error start point not found in clause where part log severe error m conversionerror error return sql statement find end point int end new where part index of and pos if end 1 end new where part index of or pos if end 1 end new where part length log info new where part start start start offset end end extract condition string condition new where part substring start start offset end joins add condition if trace log info condition new where clause new where part new where part substring 0 start new where part substring end log info new where part pos new where part index of correct beginning new where part new where part trim if new where part starts with and new where part where new where part substring 3 else if new where part starts with or new where part where new where part substring 2 if trace log info new where part correct from clause disassemble from string from parts from part trim substring 4 split hash map string string from alias new hash map string string tables to be processed hash map string string from lookup new hash map string string used tabled for int i 0 i from parts length i string entry from parts i trim string alias entry no alias string table entry int a pos entry last index of if a pos 1 alias entry substring a pos 1 table entry substring 0 entry index of may have as from alias put alias table from lookup put alias table if trace log info alias alias table table single column select t table name w name from ad table t ad window w where t ad window id w ad window id 275 rows select t table name w name from ad table t left outer join ad window w on t ad window id w ad window id select t table name w name from ad table t ad window w where t ad window id w ad window id 239 rows select t table name w name from ad table t right outer join ad window w on t ad window id w ad window id multiple columns select tn node id tn parent id tn seq no tb is active from ad treenode tn ad treebar tb where tn ad tree id tb ad tree id and tn node id tb node id and tn ad tree id 10 235 rows select tn node id tn parent id tn seq no tb is active from ad treenode tn left outer join ad treebar tb on tn node id tb node id and tn ad tree id tb ad tree id and tb ad user id 0 where tn ad tree id 10 select tn node id tn parent id tn seq no tb is active from ad treenode tn ad treebar tb where tn ad tree id tb ad tree id and tn node id tb node id and tn ad tree id 10 and tb ad user id 0 214 rows select tn node id tn parent id tn seq no tb is active from ad treenode tn left outer join ad treebar tb on tn node id tb node id and tn ad tree id tb ad tree id and tb ad user id 0 where tn ad tree id 10 string buffer new from new string buffer for int i 0 i joins size i join first new join string joins get i first set main table string from lookup get first get main alias from alias remove first get main alias remove from list first set join table string from lookup get first get join alias from alias remove first get join alias remove from list if trace log info first first if new from length 0 new from append from else new from append new from append first get main table append append first get main alias append first is left left right append outer join append first get join table append append first get join alias append on append first get condition keep it open check for other key comparisons for int j i 1 j joins size j join second new join string joins get j second set main table string from lookup get second get main alias second set join table string from lookup get second get join alias if first get main table equals second get main table first get join table equals second get join table second is condition of first if trace log info second key second new from append and append second get condition joins remove j remove from join list from alias remove first get join alias remove from table list for int k i 1 k joins size k join third new join string joins get k third set main table string from lookup get third get main alias third set join table string from lookup get third get join alias if third is condition of second if trace log info third key third new from append and append third get condition joins remove k remove from join list from alias remove third get join alias remove from table list else if trace log info third key skip third else if trace log info second key skip second new from append close on check dependency on first table for int j i 1 j joins size j join second new join string joins get j second set main table string from lookup get second get main alias second set join table string from lookup get second get join alias if first get main table equals second get main table if trace log info second dep second from ad field f left outer join ad column c on f ad column id c ad column id left outer join ad fieldgroup fg on f ad fieldgroup id fg ad fieldgroup id new from insert 6 from new from append add parantesis on previous relation new from append second is left left right append outer join append second get join table append append second get join alias append on append second get condition joins remove j remove from join list from alias remove second get join alias remove from table list additional join colums would come here new from append close on for int k i 1 k joins size k join third new join string joins get k third set main table string from lookup get third get main alias third set join table string from lookup get third get join alias if second get join table equals third get main table if trace log info third dep third from c bpartner p left outer join ad user c on p c bpartner id c c bpartner id left outer sqlstatement convertouterjoin sqlstatement fromindex findindexof sqlstatement touppercase whereindex findindexof sqlstatement touppercase endwhereindex findindexof sqlstatement touppercase endwhereindex findindexof sqlstatement touppercase endwhereindex endwhereindex findindexof sqlstatement touppercase endwhereindex endwhereindex sqlstatement outerjoin sqlstatement fromindex whereindex endwhereindex sqlstatement selectpart sqlstatement fromindex frompart sqlstatement fromindex whereindex wherepart sqlstatement whereindex endwhereindex sqlstatement endwhereindex newwherepart wherepart arraylist arraylist newwherepart indexof newwherepart lastindexof startoffset newwherepart lastindexof startoffset newwherepart lastindexof startoffset wherepart m_conversionerror sqlstatement newwherepart indexof newwherepart indexof newwherepart newwherepart startoffset newwherepart startoffset newwherepart newwherepart newwherepart newwherepart newwherepart indexof newwherepart newwherepart newwherepart startswith newwherepart newwherepart newwherepart startswith newwherepart newwherepart newwherepart fromparts frompart hashmap fromalias hashmap hashmap fromlookup hashmap fromparts fromparts apos lastindexof apos apos indexof fromalias fromlookup tablename ad_table ad_window ad_window_id ad_window_id tablename ad_table ad_window ad_window_id ad_window_id tablename ad_table ad_window ad_window_id ad_window_id tablename ad_table ad_window ad_window_id ad_window_id node_id parent_id seqno isactive ad_treenode ad_treebar ad_tree_id ad_tree_id node_id node_id ad_tree_id node_id parent_id seqno isactive ad_treenode ad_treebar node_id node_id ad_tree_id ad_tree_id ad_user_id ad_tree_id node_id parent_id seqno isactive ad_treenode ad_treebar ad_tree_id ad_tree_id node_id node_id ad_tree_id ad_user_id node_id parent_id seqno isactive ad_treenode ad_treebar node_id node_id ad_tree_id ad_tree_id ad_user_id ad_tree_id stringbuffer newfrom stringbuffer setmaintable fromlookup getmainalias fromalias getmainalias setjointable fromlookup getjoinalias fromalias getjoinalias newfrom newfrom newfrom newfrom getmaintable getmainalias isleft getjointable getjoinalias getcondition setmaintable fromlookup getmainalias setjointable fromlookup getjoinalias getmaintable getmaintable getjointable getjointable isconditionof newfrom getcondition fromalias getjoinalias setmaintable fromlookup getmainalias setjointable fromlookup getjoinalias isconditionof newfrom getcondition fromalias getjoinalias newfrom setmaintable fromlookup getmainalias setjointable fromlookup getjoinalias getmaintable getmaintable ad_field ad_column ad_column_id ad_column_id ad_fieldgroup ad_fieldgroup_id ad_fieldgroup_id newfrom _from newfrom newfrom isleft getjointable getjoinalias getcondition fromalias getjoinalias newfrom setmaintable fromlookup getmainalias setjointable fromlookup getjoinalias getjointable getmaintable c_bpartner ad_user c_bpartner_id c_bpartner_id convert row num pre select col1 from tablea where rownum 1 select col1 from tablea limit 1 assumptions limitations row num not used in select part pre param sql statement return converted statement private string convert row num string sql statement if db is postgresql log info row num sql statement string ret value null find into select from where int s end 0 int s start 1 string select sql statement string convert while true s end 0 s start select index of select if s start 1 break convert convert select substring 0 s start system out println convert convert int open 1 for int i s start i select length i char c select char at i if c open if c open if open 1 s end i 1 break string subselect select substring s start s end system out println subselect subselect system out println select select if subselect index of and rownum 1 1 subselect subselect substring 0 subselect length 1 limit 1 system out println subselect subselect convert convert util replace subselect and rownum 1 system out println convert convert else if subselect index of where rownum 1 and 1 subselect subselect substring 0 subselect length 1 limit 1 system out println subselect subselect convert convert util replace subselect where rownum 1 and where system out println convert convert else convert convert subselect select select substring s end ret value select system out println convert convert system out println select select if ret value null ret value sql statement if ret value index of and rownum 1 1 int rownum ret value index of and rownum 1 if ret value substring 0 rownum contains where ret value util replace ret value and rownum 1 limit 1 return convert ret value else ret value util replace ret value and rownum 1 return convert ret value limit 1 else if ret value index of and rownum 1 1 int rownum ret value index of and rownum 1 if ret value substring 0 rownum contains where ret value util replace ret value and rownum 1 limit 1 return convert ret value else ret value util replace ret value and rownum 1 return convert ret value limit 1 else if ret value index of and rownum 1 1 int rownum ret value index of and rownum 1 if ret value substring 0 rownum contains where ret value util replace sql statement and rownum 1 limit 1 return convert ret value else ret value util replace sql statement and rownum 1 return convert ret value limit 1 else if ret value index of and rownum 1 1 int rownum ret value index of and rownum 1 if ret value substring 0 rownum contains where ret value util replace ret value and rownum 1 limit 1 return convert ret value else ret value util replace ret value and rownum 1 return convert ret value limit 1 else if ret value index of rownum 1 1 int rownum ret value index of rownum 1 system out println ret value ret value if ret value substring 0 rownum contains where ret value util replace ret value rownum 1 limit 1 return convert ret value else ret value util replace ret value rownum 1 return convert ret value limit 1 log info row num ret value return convert ret value else return sql statement rownum rownum sqlstatement convertrownum sqlstatement ispostgresql rownum sqlstatement retvalue s_end s_start sqlstatement s_end s_start indexof s_start s_start s_start charat s_end s_start s_end indexof indexof s_end retvalue retvalue retvalue sqlstatement retvalue indexof retvalue indexof retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue indexof retvalue indexof retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue indexof retvalue indexof retvalue retvalue sqlstatement retvalue retvalue sqlstatement retvalue retvalue indexof retvalue indexof retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue indexof retvalue indexof retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue retvalue rownum retvalue retvalue sqlstatement convert trunc assumed that it is used for date only param sql statement return converted statement private string convert trunc string sql statement begin vpj cd e evolution 09 02 2005 postgresql if db is sybase return util replace sql statement trunc convert date pre trunc my date date trunc day my date trunc my date oracle format date trunc pg format my date oracle postgresql list not complete q quarter mm month dd day spacial handling of day dy starting dat of the week date trunc day 1 date part dow 1 pre begin vpj cd e evolution 07 12 2005 end vpj cd e evolution 07 12 2005 if db is postgresql int index sql statement index of trunc string before statement sql statement substring 0 index string after statement sql statement substring index after statement after statement substring after statement index of 1 index util find index of after statement string temp after statement substring 0 index trim after statement after statement substring index 1 string buffer ret value new string buffer date trunc lower case otherwise endless loop if temp index of 1 begin vpj cd e evolution 07 12 2005 postgresql globalqss fix bug reported 1577055 m period get error is translating trunc date by date part day date must be date trunc day date ret value new string buffer date part ret value append day append temp end vpj cd e evolution 07 12 2005 postgresql else with format int pos temp index of string variable temp substring 0 pos trim string format temp substring pos 1 trim if format equals q ret value append quarter append variable else if format equals y ret value append year append variable else if format equals mm ret value append month append variable else if format equals dd ret value append day append variable else if format equals dy format equals day ret value append day append variable append date part dow append variable append else log severe trunc format not supported format ret value append day append variable ret value append log info trunc ret value to string ret value insert 0 before statement ret value append after statement return ret value to string else return sql statement end vpj cd e evolution 09 02 2005 postgresql sqlstatement converttrunc sqlstatement issybase sqlstatement mydate date_trunc mydate mydate oracleformat date_trunc pgformat mydate date_trunc date_part ispostgresql sqlstatement indexof beforestatement sqlstatement afterstatement sqlstatement afterstatement afterstatement afterstatement indexof findindexof afterstatement afterstatement afterstatement afterstatement stringbuffer retvalue stringbuffer date_trunc indexof mperiod date_part date_trunc retvalue stringbuffer date_part retvalue indexof retvalue retvalue retvalue retvalue retvalue date_part retvalue retvalue retvalue tostring retvalue beforestatement retvalue afterstatement retvalue tostring sqlstatement begin vpj cd e evolution 02 24 2005 postgresql converts decode pre update c order i set update c order set pre param sql statement return converted statement private string convert update string sql statement if db is postgresql string sql update sql statement int index 0 int begintable 0 int begin 0 int end 0 string alias null end 0 begin util find index of sql update set if begin 1 if sql update to upper case index of update 0 index sql update to upper case index of update string first part statement substring 0 index begintable sql update index of 6 begin the opening begin alias begin sql update index of 7 statement statement substring begin end alias end sql update to upper case index of set 0 statement index of set 0 string table sql update substring begintable begin trim string select begin util find index of sql update set end sql update index of if end 1 select sql update substring end 2 else end sql update index of if end 1 select sql update substring end 4 else end sql update index of if end 1 select sql update substring end 3 else end sql update index of if end 1 select sql update substring end 3 int where begin 1 string rest string select sql update substring end 2 system out println select select int s end select index of int s end 0 int s start select index of string where null int open 1 for int i s start i select length i char c select char at i if c open if c open if open 1 s end i 1 break where select substring s end where where substring where index of where 7 string s select substring s start s end system out println s s system out println s end s end system out println rest rest string from s substring s to upper case index of from 6 system out println from from string tablejoin from substring 0 from to upper case index of system out println tablejoin tablejoin string tablealias from substring 0 from to upper case index of where system out println tablealias tablealias system out println select to upper case substring s end select substring select substring s end to upper case index of where string swhere select substring s end s end system out println system out println string end swhere string s where system out println string end select substring select substring s end to upper case index of where string s where s substring s to upper case index of where 7 s length 1 system out println where before join where system out println s where s where system out println where where system out println from from system out println table join tablejoin system out println table alias tablejoin string update sql update substring 0 begin update update set int f begin begin 6 int f beginjoin 0 system out println sql update sql update string fields sql update substring f begin end system out println fields fields int beginfrom select to upper case index of from string fieldsjoin select substring select to upper case index of select 8 beginfrom system out println fields fields system out println fields joint fieldsjoin int f fields length int fj fieldsjoin length string field null string fieldjoin null system out println update update while f 0 f util find index of fields fields index of system out println comman c if f 0 system out print fields fields field fields fieldjoin fieldsjoin if fieldjoin index of 0 fieldjoin tablejoin fieldjoin system out println f begin f begin end end field field update update field trim tablejoin field trim rest from tablealias where where select substring s end 8 update update field trim fieldjoin trim rest from tablealias where s where select substring s end 8 system out println last update update set alias all field before where if where null where and where else where string sqlkey and or from where join by group in into select not set update delete having is null exists int o 1 string tokenizer st new string tokenizer where string result string word while true make sure there is stuff to get word st next token system out println word word if sqlkey index of word 1 for int i 0 i word length i char c word char at i if c o if c o if o 1 word contains word contains result result table word system out println cadena word else result result word else result result word if st has more elements break update update result system out println update update else field fields substring 0 f system out println field field system out println fieldsjoin fieldsjoin fj util find index of fieldsjoin fj fieldsjoin index of fieldjoin fieldsjoin substring 0 fj system out println fields fields system out println fieldsjoin fieldsjoin if fieldjoin index of 0 fieldjoin equals sys date fieldjoin tablejoin fieldjoin system out println fj fj fieldjoin fieldjoin update update field tablejoin field trim update update field trim fieldjoin trim f beginjoin fj fieldsjoin fieldsjoin substring f beginjoin 1 system out println fieldsjoin fieldsjoin f beginjoin fj f begin f fields fields substring f begin 1 system out println update update sql update update system out println convert update sql update return sql update else return sql statement c_order c_order sqlstatement convertupdate sqlstatement ispostgresql sqlupdate sqlstatement findindexof sqlupdate sqlupdate touppercase indexof sqlupdate touppercase indexof firstpart sqlupdate indexof sqlupdate indexof sqlupdate touppercase indexof indexof sqlupdate findindexof sqlupdate sqlupdate indexof sqlupdate sqlupdate indexof sqlupdate sqlupdate indexof sqlupdate sqlupdate indexof sqlupdate where_begin sqlupdate s_end indexof s_end s_start indexof s_start charat s_end s_end indexof s_start s_end s_end s_end touppercase indexof touppercase indexof touppercase indexof touppercase s_end s_end touppercase indexof s_end s_end s_where s_end touppercase indexof s_where touppercase indexof s_where s_where sqlupdate f_begin f_beginjoin sqlupdate sqlupdate sqlupdate f_begin touppercase indexof touppercase indexof findindexof indexof indexof f_begin f_begin s_end s_where s_end stringtokenizer stringtokenizer nexttoken indexof charat hasmoreelements findindexof indexof indexof sysdate f_beginjoin f_beginjoin f_beginjoin f_begin f_begin sqlupdate sqlupdate sqlupdate sqlstatement converts decode pre delete c order i where delete from c order where pre param sql statement return converted statement private string convert delete string sql statement if db is postgresql int index sql statement to upper case index of delete if index 7 return delete from sql statement substring index 7 return sql statement c_order c_order sqlstatement convertdelete sqlstatement ispostgresql sqlstatement touppercase indexof sqlstatement sqlstatement begin vpj cd e evolution 08 02 2005 convert alias param sql statement return converted statementf private string convert alias string sql statement if db is postgresql string statement sql statement int index 0 int begintable 0 int begin 0 int end 0 string alias null if statement to upper case index of delete from 0 index statement to upper case index of delete from begintable statement index of 11 begin the opening begin alias begin statement index of 12 end alias end statement to upper case index of where 0 else if statement to upper case index of update 0 index statement to upper case index of update string first part statement substring 0 index begintable statement index of 6 begin the opening begin alias begin statement index of 7 statement statement substring begin end alias end statement to upper case index of set 0 statement index of set 0 else return statement string sql alias statement if end begin alias statement substring begin end trim string table statement substring begintable begin trim system out println table table statement statement substring 0 begin statement substring end if alias equals sql alias util replace statement alias table sql alias util replace sql alias alias table sql alias util replace sql alias alias table sql delete util replace sql delete delete delete from system out println convertion alias statement substring 0 begin statement substring end system out println statement convert statement system out println begin alias begin end alias end system out println alias statement substring begin end trim system out println sql alias sql alias return sql alias else return sql statement convertalias sqlstatement convertalias sqlstatement ispostgresql sqlstatement touppercase indexof touppercase indexof indexof indexof touppercase indexof touppercase indexof touppercase indexof firstpart indexof indexof touppercase indexof indexof sqlalias sqlalias sqlalias sqlalias sqlalias sqlalias sqldelete sqldelete sqlalias sqlalias sqlstatement alter table ad fieldgroup alter column is tab type char 1 alter table ad fieldgroup alter column set default n private string convertddl string sql statement if db is postgresql if sql statement to upper case index of alter table 0 string action null int begin col 1 if sql statement to upper case index of modify 0 action alter begin col sql statement to upper case index of modify action length else if sql statement to upper case index of add 0 action add begin col sql statement to upper case index of add action length system out println modify sql statement to upper case index of modify system out println add sql statement to upper case index of add system out println begincolumn sql statement begincolumn begin col if begin col 0 return sql statement int end col 0 int begin default 1 int begin type 1 string column null string type null string defaultvalue null string ddl null if begin col 1 column sql statement substring begin col end col begin col column index of column sql statement substring begin col end col system out println column column begincolumn begin col en column end col system out println type sql statement substring end col 1 type sql statement substring end col 1 system out println type 1 type type type substring 0 type index of system out println type type if action equals add ddl sql statement substring 0 begin col action length action column column type else if action equals alter ddl sql statement substring 0 begin col action length action column column type type if sql statement to upper case index of default 1 begin default sql statement to upper case index of default 9 defaultvalue sql statement substring begin default string rest defaultvalue substring defaultvalue index of defaultvalue defaultvalue substring 0 defaultvalue index of ddl sql statement substring 0 begin col action length alter column column set default defaultvalue if rest null rest index of not null 0 ddl sql statement substring 0 begin col alter column column set rest return ddl system out println ddl ddl return ddl return sql statement ad_fieldgroup istab ad_fieldgroup sqlstatement ispostgresql sqlstatement touppercase indexof begin_col sqlstatement touppercase indexof begin_col sqlstatement touppercase indexof sqlstatement touppercase indexof begin_col sqlstatement touppercase indexof sqlstatement touppercase indexof sqlstatement touppercase indexof sqlstatement begin_col begin_col sqlstatement end_col begin_default begin_type begin_col sqlstatement begin_col end_col begin_col indexof sqlstatement begin_col end_col begin_col end_col sqlstatement end_col sqlstatement end_col indexof sqlstatement begin_col sqlstatement begin_col sqlstatement touppercase indexof begin_default sqlstatement touppercase indexof sqlstatement begin_default indexof indexof sqlstatement begin_col indexof sqlstatement begin_col sqlstatement private string convert ignore string sql statement string vars new string 20 int cont 1 pattern p pattern compile w pattern case insensitive matcher m p matcher sql statement while m find vars cont sql statement substring m start m end vars 0 m replace all string ret var new string cont for int i 0 i cont i ret var i vars i p pattern compile m p matcher ret var 0 cont 1 for cont 1 cont ret var length cont ret var 0 m replace first ret var cont m p matcher ret var 0 return null convertignore sqlstatement case_insensitive sqlstatement sqlstatement replaceall retvar retvar retvar retvar retvar replacefirst retvar retvar standard constructor public x ad attribute value properties ctx int ad attribute value id string trx name super ctx ad attribute value id trx name if ad attribute value id 0 setad attribute id 0 setrecord id 0 x_ad_attribute_value ad_attribute_value_id trxname ad_attribute_value_id trxname ad_attribute_value_id setad_attribute_id setrecord_id load constructor public x ad attribute value properties ctx result set rs string trx name super ctx rs trx name x_ad_attribute_value resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad attribute value append get id append return sb to string tostring stringbuffer stringbuffer x_ad_attribute_value get_id tostring set system attribute public void setad attribute id int ad attribute id if ad attribute id 1 throw new illegal argument exception ad attribute id is mandatory set valuenocheck ad attribute id new integer ad attribute id setad_attribute_id ad_attribute_id ad_attribute_id illegalargumentexception ad_attribute_id set_valuenocheck ad_attribute_id ad_attribute_id get system attribute public int getad attribute id integer ii integer get value ad attribute id if ii null return 0 return ii int value getad_attribute_id get_value ad_attribute_id intvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set v date public void setv date timestamp v date set value v date v date v_date setv_date v_date set_value v_date v_date get v date public timestamp getv date return timestamp get value v date v_date getv_date get_value v_date set v number public void setv number string v number if v number null v number length 22 log warning length 22 truncated v number v number substring 0 21 set value v number v number v_number setv_number v_number v_number v_number v_number v_number set_value v_number v_number get v number public string getv number return string get value v number v_number getv_number get_value v_number set v string public void setv string string v string if v string null v string length 2000 log warning length 2000 truncated v string v string substring 0 1999 set value v string v string v_string setv_string v_string v_string v_string v_string v_string set_value v_string v_string get v string public string getv string return string get value v string v_string getv_string get_value v_string standard constructor public x c cashbook properties ctx int c cashbook id string trx name super ctx c cashbook id trx name if c cashbook id 0 setc cashbook id 0 setc currency id 0 sql select cb c currency id from c cashbook cb inner join c cash c on cb c cashbook id c c cashbook id where c c cash id c cash id set is default false set name null x_c_cashbook c_cashbook_id trxname c_cashbook_id trxname c_cashbook_id setc_cashbook_id setc_currency_id c_currency_id c_cashbook c_cash c_cashbook_id c_cashbook_id c_cash_id c_cash_id setisdefault setname load constructor public x c cashbook properties ctx result set rs string trx name super ctx rs trx name x_c_cashbook resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cashbook append get id append return sb to string tostring stringbuffer stringbuffer x_c_cashbook get_id tostring set cash book cash book for recording petty cash transactions public void setc cashbook id int c cashbook id if c cashbook id 1 throw new illegal argument exception c cashbook id is mandatory set valuenocheck c cashbook id new integer c cashbook id setc_cashbook_id c_cashbook_id c_cashbook_id illegalargumentexception c_cashbook_id set_valuenocheck c_cashbook_id c_cashbook_id get cash book cash book for recording petty cash transactions public int getc cashbook id integer ii integer get value c cashbook id if ii null return 0 return ii int value getc_cashbook_id get_value c_cashbook_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname init param config configuration throws servlet exception public void init filter config config throws servlet exception web env init web config get servlet context if log null log c logger getc logger store filter class log info config get filter name servletexception filterconfig servletexception webenv initweb getservletcontext clogger getclogger storefilter getfiltername destroy public void destroy public void do filter servlet request request servlet response response filter chain chain throws io exception servlet exception get uri string uri if request instanceof http servlet request http servlet request req http servlet request request uri req get requesturi ignore static content boolean check uri index of servlet 1 boolean pass true we need to check if check string enc request get character encoding try enc request get character encoding if enc null request set character encoding web env encoding if enc null log finer checked uri else log finer checked uri enc enc catch exception e log log level severe set character endocung enc web env encoding e else log finer not checked uri start if pass chain do filter request response else log warning rejected uri string msg error access rejected web doc doc web doc create msg body body b doc get body b add element new p uri align type center fini response set content type text html print writer out new print writer response get output stream doc output out out close dofilter servletrequest servletresponse filterchain ioexception servletexception httpservletrequest httpservletrequest httpservletrequest getrequesturi indexof getcharacterencoding getcharacterencoding setcharacterencoding webenv characterendocung webenv notchecked dofilter webdoc webdoc getbody addelement aligntype setcontenttype printwriter printwriter getoutputstream get contsnts return contents public object get contents return contents getcontents constructor public wf layout manager wflayoutmanager if the layout manager uses a per component string adds the component code comp code to the layout associating it with the string specified by code name code param name the string to be associated with the component param comp the component to be added see java awt layout manager add layout component string component public void add layout component string name component comp invalidate layout layoutmanager addlayoutcomponent addlayoutcomponent invalidatelayout removes the specified component from the layout param comp the component to be removed see java awt layout manager remove layout component component public void remove layout component component comp if comp null return invalidate layout layoutmanager removelayoutcomponent removelayoutcomponent invalidatelayout calculates the preferred size dimensions for the specified container given the components it contains param parent the container to be laid out return preferred size see minimum layout size public dimension preferred layout size container parent if m size null layout container parent return m size minimumlayoutsize preferredlayoutsize m_size layoutcontainer m_size calculates the minimum size dimensions for the specified container given the components it contains param parent the component to be laid out return preferred size see preferred layout size public dimension minimum layout size container parent return preferred layout size parent preferredlayoutsize minimumlayoutsize preferredlayoutsize lays out the specified container param parent the container to be laid out see java awt layout manager layout container container public void layout container container parent insets insets parent get insets int width insets left int height insets top we need to layout if need layout parent int x 5 int y 5 go through all components for int i 0 i parent get component count i component comp parent get component i if comp is visible comp instanceof wf node dimension ps comp get preferred size comp set location x y comp set bounds x y ps width ps height width x ps width height y ps height next pos if x 5 x 230 else x 5 y 100 x ps width 20 y ps height 20 else we have an layout go through all components for int i 0 i parent get component count i component comp parent get component i if comp is visible comp instanceof wf node dimension ps comp get preferred size point loc comp get location int max width comp getx ps width int max height comp gety ps height if width max width width max width if height max height height max height comp set bounds loc x loc y ps width ps height for all components have layout create lines wf content panel panel wf content panel parent panel create lines calculate size width insets right height insets bottom return size m size new dimension width height log finer size m size layoutmanager layoutcontainer layoutcontainer getinsets needlayout getcomponentcount getcomponent isvisible wfnode getpreferredsize setlocation setbounds getcomponentcount getcomponent isvisible wfnode getpreferredsize getlocation maxwidth maxheight maxwidth maxwidth maxheight maxheight setbounds wfcontentpanel wfcontentpanel createlines m_size m_size need layout param parent parent return true if we need to layout private boolean need layout container parent point p00 new point 0 0 go through all components for int i 0 i parent get component count i component comp parent get component i if comp instanceof wf node comp get location equals p00 log fine comp to string return true return false needlayout getcomponentcount getcomponent wfnode getlocation tostring invalidates the layout indicating that if the layout manager has cached information it should be discarded private void invalidate layout m size null invalidatelayout m_size standard constructor public x c pos properties ctx int c pos id string trx name super ctx c pos id trx name if c pos id 0 setc cashbook id 0 setc pos id 0 set is modify price false n setm pricelist id 0 setm warehouse id 0 set name null setsalesrep id 0 x_c_pos c_pos_id trxname c_pos_id trxname c_pos_id setc_cashbook_id setc_pos_id setismodifyprice setm_pricelist_id setm_warehouse_id setname setsalesrep_id load constructor public x c pos properties ctx result set rs string trx name super ctx rs trx name x_c_pos resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c pos append get id append return sb to string tostring stringbuffer stringbuffer x_c_pos get_id tostring public static final int c bpartnercashtrx id ad reference id 173 set template b partner business partner used for creating new business partners on the fly public void setc bpartnercashtrx id int c bpartnercashtrx id if c bpartnercashtrx id 0 set value c bpartnercashtrx id null else set value c bpartnercashtrx id new integer c bpartnercashtrx id c_bpartnercashtrx_id_ad_reference_id setc_bpartnercashtrx_id c_bpartnercashtrx_id c_bpartnercashtrx_id set_value c_bpartnercashtrx_id set_value c_bpartnercashtrx_id c_bpartnercashtrx_id get template b partner business partner used for creating new business partners on the fly public int getc bpartnercashtrx id integer ii integer get value c bpartnercashtrx id if ii null return 0 return ii int value getc_bpartnercashtrx_id get_value c_bpartnercashtrx_id intvalue set cash book cash book for recording petty cash transactions public void setc cashbook id int c cashbook id if c cashbook id 1 throw new illegal argument exception c cashbook id is mandatory set value c cashbook id new integer c cashbook id setc_cashbook_id c_cashbook_id c_cashbook_id illegalargumentexception c_cashbook_id set_value c_cashbook_id c_cashbook_id get cash book cash book for recording petty cash transactions public int getc cashbook id integer ii integer get value c cashbook id if ii null return 0 return ii int value getc_cashbook_id get_value c_cashbook_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set pos key layout pos function key layout public void setc poskeylayout id int c poskeylayout id if c poskeylayout id 0 set value c poskeylayout id null else set value c poskeylayout id new integer c poskeylayout id setc_poskeylayout_id c_poskeylayout_id c_poskeylayout_id set_value c_poskeylayout_id set_value c_poskeylayout_id c_poskeylayout_id get pos key layout pos function key layout public int getc poskeylayout id integer ii integer get value c poskeylayout id if ii null return 0 return ii int value getc_poskeylayout_id get_value c_poskeylayout_id intvalue set pos terminal point of sales terminal public void setc pos id int c pos id if c pos id 1 throw new illegal argument exception c pos id is mandatory set valuenocheck c pos id new integer c pos id setc_pos_id c_pos_id c_pos_id illegalargumentexception c_pos_id set_valuenocheck c_pos_id c_pos_id get pos terminal point of sales terminal public int getc pos id integer ii integer get value c pos id if ii null return 0 return ii int value getc_pos_id get_value c_pos_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set modify price allow modifying the price public void set is modify price boolean is modify price set value is modify price new boolean is modify price setismodifyprice ismodifyprice set_value ismodifyprice ismodifyprice get modify price allow modifying the price public boolean is modify price object oo get value is modify price if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismodifyprice get_value ismodifyprice booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set printer name name of the printer public void set printer name string printer name if printer name null printer name length 60 log warning length 60 truncated printer name printer name substring 0 59 set value printer name printer name setprintername printername printername printername printername printername set_value printername printername get printer name name of the printer public string get printer name return string get value printer name getprintername get_value printername public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue get contents return context public object get contents return contents getcontents m inout order public string order properties ctx int window no m tab m tab m field m field object value integer c order id integer value if c order id null c order id int value 0 return get details m order order new m order ctx c order id int value null if order get id 0 m tab set value date ordered order get date ordered m tab set value po reference order getpo reference m tab set value ad org id new integer order getad org id m tab set value ad orgtrx id new integer order getad orgtrx id m tab set value c campaign id new integer order getc activity id m tab set value c campaign id new integer order getc campaign id m tab set value c project id new integer order getc project id m tab set value user1 id new integer order getuser1 id m tab set value user2 id new integer order getuser2 id m tab set value m warehouse id new integer order getm warehouse id m tab set value delivery rule order get delivery rule m tab set value delivery via rule order get delivery via rule m tab set value m shipper id new integer order getm shipper id m tab set value freight cost rule order get freight cost rule m tab set value freight amt order get freight amt m tab set value c bpartner id new integer order getc bpartner id return m_inout windowno mtab mtab mfield mfield c_order_id c_order_id c_order_id intvalue morder morder c_order_id intvalue get_id mtab setvalue dateordered getdateordered mtab setvalue poreference getporeference mtab setvalue ad_org_id getad_org_id mtab setvalue ad_orgtrx_id getad_orgtrx_id mtab setvalue c_campaign_id getc_activity_id mtab setvalue c_campaign_id getc_campaign_id mtab setvalue c_project_id getc_project_id mtab setvalue user1_id getuser1_id mtab setvalue user2_id getuser2_id mtab setvalue m_warehouse_id getm_warehouse_id mtab setvalue deliveryrule getdeliveryrule mtab setvalue deliveryviarule getdeliveryviarule mtab setvalue m_shipper_id getm_shipper_id mtab setvalue freightcostrule getfreightcostrule mtab setvalue freightamt getfreightamt mtab setvalue c_bpartner_id getc_bpartner_id in out doc type sets movement type gets doc no public string doc type properties ctx int window no m tab m tab m field m field object value integer c doctype id integer value if c doctype id null c doctype id int value 0 return string sql select d doc base type d is doc no controlled s current next from c doctype d ad sequence s where c doctype id 1 and d docnosequence id s ad sequence id try env set context ctx window no c doctypetarget id c doctype id int value prepared statement pstmt db prepare statement sql null pstmt set int 1 c doctype id int value result set rs pstmt execute query if rs next set movement type string doc base type rs get string doc base type if doc base type equals mms material shipments m tab set value movement type c customer shipments else if doc base type equals mmr material receipts m tab set value movement type v vendor receipts document no if rs get string is doc no controlled equals y m tab set value document no rs get string current next rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return inout doctype movementtype docno doctype windowno mtab mtab mfield mfield c_doctype_id c_doctype_id c_doctype_id intvalue docbasetype isdocnocontrolled currentnext c_doctype ad_sequence c_doctype_id docnosequence_id ad_sequence_id setcontext windowno c_doctypetarget_id c_doctype_id intvalue preparedstatement preparestatement setint c_doctype_id intvalue resultset executequery docbasetype getstring docbasetype docbasetype mtab setvalue movementtype docbasetype mtab setvalue movementtype documentno getstring isdocnocontrolled mtab setvalue documentno getstring currentnext sqlexception getlocalizedmessage m inout defaults for b partner location contact public string bpartner properties ctx int window no m tab m tab m field m field object value integer c bpartner id integer value if c bpartner id null c bpartner id int value 0 return string sql select p ad language p c paymentterm id p m pricelist id p payment rule p po reference p so description p is discount printed p so creditlimit p so creditused as credit available l c bpartner location id c ad user id from c bpartner p c bpartner location l ad user c where p c bpartner id l c bpartner id and p c bpartner id c c bpartner id and p c bpartner id 1 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c bpartner id int value result set rs pstmt execute query big decimal bd if rs next location integer ii new integer rs get int c bpartner location id if rs was null m tab set value c bpartner location id null else m tab set value c bpartner location id ii contact ii new integer rs get int ad user id if rs was null m tab set value ad user id null else m tab set value ad user id ii credit available double credit available rs get double credit available if rs was null credit available 0 m tab fire data statuse event credit limit over display type get number format display type amount format credit available false rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return m_inout bpartner windowno mtab mtab mfield mfield c_bpartner_id c_bpartner_id c_bpartner_id intvalue ad_language c_paymentterm_id m_pricelist_id paymentrule poreference so_description isdiscountprinted so_creditlimit so_creditused creditavailable c_bpartner_location_id ad_user_id c_bpartner c_bpartner_location ad_user c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id preparedstatement preparestatement setint c_bpartner_id intvalue resultset executequery bigdecimal getint c_bpartner_location_id wasnull mtab setvalue c_bpartner_location_id mtab setvalue c_bpartner_location_id getint ad_user_id wasnull mtab setvalue ad_user_id mtab setvalue ad_user_id creditavailable creditavailable getdouble creditavailable wasnull creditavailable mtab firedatastatuseevent creditlimitover displaytype getnumberformat displaytype creditavailable sqlexception getlocalizedmessage m inoutline order line public string order line properties ctx int window no m tab m tab m field m field object value integer c orderline id integer value if c orderline id null c orderline id int value 0 return set callout active true get details m order line ol new m order line ctx c orderline id int value null if ol get id 0 m tab set value m product id new integer ol getm product id m tab set value m attributesetinstance id new integer ol getm attributesetinstance id m tab set value c uom id new integer ol getc uom id big decimal movement qty ol get qty ordered subtract ol get qty delivered m tab set value movement qty movement qty big decimal qty entered movement qty if ol get qty entered compare to ol get qty ordered 0 qty entered qty entered multiply ol get qty entered divide ol get qty ordered 12 big decimal round half up m tab set value qty entered qty entered set callout active false return m_inoutline orderline windowno mtab mtab mfield mfield c_orderline_id c_orderline_id c_orderline_id intvalue setcalloutactive morderline morderline c_orderline_id intvalue get_id mtab setvalue m_product_id getm_product_id mtab setvalue m_attributesetinstance_id getm_attributesetinstance_id mtab setvalue c_uom_id getc_uom_id bigdecimal movementqty getqtyordered getqtydelivered mtab setvalue movementqty movementqty bigdecimal qtyentered movementqty getqtyentered compareto getqtyordered qtyentered qtyentered getqtyentered getqtyordered bigdecimal round_half_up mtab setvalue qtyentered qtyentered setcalloutactive m inoutline default uom locator for product public string product properties ctx int window no m tab m tab m field m field object value if is callout active return integer m product id integer value if m product id null m product id int value 0 return set callout active true set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null int m warehouse id env get context as int ctx window no m warehouse id boolean isso trx y equals env get context ctx window no isso trx if isso trx set callout active false return set uom locator qty m product product m product get ctx m product id int value m tab set value c uom id new integer product getc uom id big decimal qty entered big decimal m tab get value qty entered m tab set value movement qty qty entered if product getm locator id 0 m locator loc m locator get ctx product getm locator id if m warehouse id loc getm warehouse id m tab set value m locator id new integer product getm locator id else log fine no locator for m product id m product id and m warehouse id m warehouse id else log fine no locator for m product id m product id set callout active false return m_inoutline windowno mtab mtab mfield mfield iscalloutactive m_product_id m_product_id m_product_id intvalue setcalloutactive getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id m_warehouse_id getcontextasint windowno m_warehouse_id issotrx getcontext windowno issotrx issotrx setcalloutactive mproduct mproduct m_product_id intvalue mtab setvalue c_uom_id getc_uom_id bigdecimal qtyentered bigdecimal mtab getvalue qtyentered mtab setvalue movementqty qtyentered getm_locator_id mlocator mlocator getm_locator_id m_warehouse_id getm_warehouse_id mtab setvalue m_locator_id getm_locator_id m_product_id m_product_id m_warehouse_id m_warehouse_id m_product_id m_product_id setcalloutactive in out line quantity called from c uom id qty entered movement qty enforces qty uom relationship param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string qty properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true int m product id env get context as int ctx window no m product id log log level warning qty init m product id m product id big decimal movement qty qty entered no product if m product id 0 qty entered big decimal m tab get value qty entered m tab set value movement qty qty entered uom changed convert from entered product else if m field get column name equals c uom id int c uom to id integer value int value qty entered big decimal m tab get value qty entered movement qty muom conversion convert product from ctx m product id c uom to id qty entered if movement qty null movement qty qty entered boolean conversion qty entered compare to movement qty 0 log fine uom c uom to id qty entered qty entered conversion movement qty movement qty env set context ctx window no uom conversion conversion y n m tab set value movement qty movement qty no uom defined else if env get context as int ctx window no c uom id 0 qty entered big decimal m tab get value qty entered m tab set value movement qty qty entered qty entered changed calculate movement qty else if m field get column name equals qty entered int c uom to id env get context as int ctx window no c uom id qty entered big decimal value movement qty muom conversion convert product from ctx m product id c uom to id qty entered if movement qty null movement qty qty entered boolean conversion qty entered compare to movement qty 0 log fine uom c uom to id qty entered qty entered conversion movement qty movement qty env set context ctx window no uom conversion conversion y n m tab set value movement qty movement qty movement qty changed calculate qty entered else if m field get column name equals movement qty int c uom to id env get context as int ctx window no c uom id movement qty big decimal value qty entered muom conversion convert product to ctx m product id c uom to id movement qty if qty entered null qty entered movement qty boolean conversion movement qty compare to qty entered 0 log fine uom c uom to id movement qty movement qty conversion qty entered qty entered env set context ctx window no uom conversion conversion y n m tab set value qty entered qty entered set callout active false return inout c_uom_id qtyentered movementqty windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive m_product_id getcontextasint windowno m_product_id m_product_id m_product_id bigdecimal movementqty qtyentered m_product_id qtyentered bigdecimal mtab getvalue qtyentered mtab setvalue movementqty qtyentered mfield getcolumnname c_uom_id c_uom_to_id intvalue qtyentered bigdecimal mtab getvalue qtyentered movementqty muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered movementqty movementqty qtyentered qtyentered compareto movementqty c_uom_to_id qtyentered qtyentered movementqty movementqty setcontext windowno uomconversion mtab setvalue movementqty movementqty getcontextasint windowno c_uom_id qtyentered bigdecimal mtab getvalue qtyentered mtab setvalue movementqty qtyentered qtyentered movementqty mfield getcolumnname qtyentered c_uom_to_id getcontextasint windowno c_uom_id qtyentered bigdecimal movementqty muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered movementqty movementqty qtyentered qtyentered compareto movementqty c_uom_to_id qtyentered qtyentered movementqty movementqty setcontext windowno uomconversion mtab setvalue movementqty movementqty movementqty qtyentered mfield getcolumnname movementqty c_uom_to_id getcontextasint windowno c_uom_id movementqty bigdecimal qtyentered muomconversion convertproductto m_product_id c_uom_to_id movementqty qtyentered qtyentered movementqty movementqty compareto qtyentered c_uom_to_id movementqty movementqty qtyentered qtyentered setcontext windowno uomconversion mtab setvalue qtyentered qtyentered setcalloutactive standard constructor public x ad printformat properties ctx int ad printformat id string trx name super ctx ad printformat id trx name if ad printformat id 0 setad printcolor id 0 setad printfont id 0 setad printformat id 0 0 setad printpaper id 0 setad table id 0 set footer margin 0 set header margin 0 set is default false set is form false set is standard header footer true y set is table based true y set name null x_ad_printformat ad_printformat_id trxname ad_printformat_id trxname ad_printformat_id setad_printcolor_id setad_printfont_id setad_printformat_id setad_printpaper_id setad_table_id setfootermargin setheadermargin setisdefault setisform setisstandardheaderfooter setistablebased setname load constructor public x ad printformat properties ctx result set rs string trx name super ctx rs trx name x_ad_printformat resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printformat append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printformat get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 1 throw new illegal argument exception ad printcolor id is mandatory set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id illegalargumentexception ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set print font maintain print font public void setad printfont id int ad printfont id if ad printfont id 1 throw new illegal argument exception ad printfont id is mandatory set value ad printfont id new integer ad printfont id setad_printfont_id ad_printfont_id ad_printfont_id illegalargumentexception ad_printfont_id set_value ad_printfont_id ad_printfont_id get print font maintain print font public int getad printfont id integer ii integer get value ad printfont id if ii null return 0 return ii int value getad_printfont_id get_value ad_printfont_id intvalue set print format data print format public void setad printformat id int ad printformat id if ad printformat id 1 throw new illegal argument exception ad printformat id is mandatory set valuenocheck ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id illegalargumentexception ad_printformat_id set_valuenocheck ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set print paper printer paper definition public void setad printpaper id int ad printpaper id if ad printpaper id 1 throw new illegal argument exception ad printpaper id is mandatory set value ad printpaper id new integer ad printpaper id setad_printpaper_id ad_printpaper_id ad_printpaper_id illegalargumentexception ad_printpaper_id set_value ad_printpaper_id ad_printpaper_id get print paper printer paper definition public int getad printpaper id integer ii integer get value ad printpaper id if ii null return 0 return ii int value getad_printpaper_id get_value ad_printpaper_id intvalue set print table format table format in reports public void setad printtableformat id int ad printtableformat id if ad printtableformat id 0 set value ad printtableformat id null else set value ad printtableformat id new integer ad printtableformat id setad_printtableformat_id ad_printtableformat_id ad_printtableformat_id set_value ad_printtableformat_id set_value ad_printtableformat_id ad_printtableformat_id get print table format table format in reports public int getad printtableformat id integer ii integer get value ad printtableformat id if ii null return 0 return ii int value getad_printtableformat_id get_value ad_printtableformat_id intvalue set report view view used to generate this report public void setad reportview id int ad reportview id if ad reportview id 0 set valuenocheck ad reportview id null else set valuenocheck ad reportview id new integer ad reportview id setad_reportview_id ad_reportview_id ad_reportview_id set_valuenocheck ad_reportview_id set_valuenocheck ad_reportview_id ad_reportview_id get report view view used to generate this report public int getad reportview id integer ii integer get value ad reportview id if ii null return 0 return ii int value getad_reportview_id get_value ad_reportview_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set create copy public void set create copy string create copy if create copy null create copy length 1 log warning length 1 truncated create copy create copy substring 0 0 set value create copy create copy setcreatecopy createcopy createcopy createcopy createcopy createcopy set_value createcopy createcopy get create copy public string get create copy return string get value create copy getcreatecopy get_value createcopy set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set footer margin margin of the footer in 1 72 of an inch public void set footer margin int footer margin set value footer margin new integer footer margin setfootermargin footermargin set_value footermargin footermargin get footer margin margin of the footer in 1 72 of an inch public int get footer margin integer ii integer get value footer margin if ii null return 0 return ii int value getfootermargin get_value footermargin intvalue set header margin margin of the header in 1 72 of an inch public void set header margin int header margin set value header margin new integer header margin setheadermargin headermargin set_value headermargin headermargin get header margin margin of the header in 1 72 of an inch public int get header margin integer ii integer get value header margin if ii null return 0 return ii int value getheadermargin get_value headermargin intvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set form if selected a form is printed if not selected a columnar list report public void set is form boolean is form set value is form new boolean is form setisform isform set_value isform isform get form if selected a form is printed if not selected a columnar list report public boolean is form object oo get value is form if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isform get_value isform booleanvalue set standard header footer the standard header and footer is used public void set is standard header footer boolean is standard header footer set value is standard header footer new boolean is standard header footer setisstandardheaderfooter isstandardheaderfooter set_value isstandardheaderfooter isstandardheaderfooter get standard header footer the standard header and footer is used public boolean is standard header footer object oo get value is standard header footer if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isstandardheaderfooter get_value isstandardheaderfooter booleanvalue set table based table based list reporting public void set is table based boolean is table based set valuenocheck is table based new boolean is table based setistablebased istablebased set_valuenocheck istablebased istablebased get table based table based list reporting public boolean is table based object oo get value is table based if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istablebased get_value istablebased booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set printer name name of the printer public void set printer name string printer name if printer name null printer name length 40 log warning length 40 truncated printer name printer name substring 0 39 set value printer name printer name setprintername printername printername printername printername printername set_value printername printername get printer name name of the printer public string get printer name return string get value printer name getprintername get_value printername default url encoded utf 8 post form basic constructor you need to set the attributes using the set methods public form default url encoded utf 8 post form use the set methods to set the values of the attributes param element set the value of lt form gt value lt form gt public form element element add element element addelement default url encoded utf 8 post form use the set methods to set the values of the attributes param action set the value of action public form string action set action action setaction default url encoded utf 8 post form use the set methods to set the values of the attributes param element set the value of lt form gt value lt form gt param action set the value of action public form string action element element add element element set action action addelement setaction default url encoded utf 8 form use the set methods to set the values of the attributes param action set the value of action param method set the value of method param element set the value of lt form gt value lt form gt public form string action string method element element add element element set action action set method method addelement setaction setmethod default url encoded utf 8 form use the set methods to set the values of the attributes param action set the value of action param method set the value of method public form string action string method set action action set method method setaction setmethod default utf 8 form use the set methods to set the values of the attributes param action set the value of action param method set the value of method param enctype set the value of enctype public form string action string method string enctype set action action set method method set enc type enctype setaction setmethod setenctype sets the action attribute param action the action attribute public form set action string action add attribute action action return this setaction addattribute sets the method attribute param method the method attribute public form set method string method add attribute method method return this setmethod addattribute sets the enctype attribute param enctype the enctype attribute public form set enc type string enctype add attribute enctype enctype return this setenctype addattribute sets the accept attribute param accept the accept attribute public form set accept string accept add attribute accept accept return this setaccept addattribute sets the name attribute param name the name attribute public form set name string name add attribute name name return this setname addattribute sets the target attribute param target the target attribute public form set target string target add attribute target target return this settarget addattribute sets the accept charset attribute only nn p ara m accept the accept charset attribute public form set accept charset string acceptcharset add attribute accept charset acceptcharset return this sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setacceptcharset addattribute setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public form add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public form add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public form add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public form add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public form remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onsubmit event occurs when a form is submitted it only applies to the form element param script script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param script script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param script script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param script script public void set on change string script add attribute onchange script setonchange addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute attachment entry param name name param data binary data param index optional index public m attachment entry string name byte data int index super set name name set data data if index 0 m index index else long now system current time millis if s seed 3600000l now older then 1 hour s seed now s random new random s seed m index s random next int mattachmententry setname setdata m_index currenttimemillis s_seed s_seed s_random s_seed m_index s_random nextint attachment entry param name name param data binary data public m attachment entry string name byte data this name data 0 mattachmententry return returns the data public byte get data return m data getdata m_data param data the data to set public void set data byte data m data data setdata m_data return returns the name public string get name return m name getname m_name param name the name to set public void set name string name if name null m name name if m name null m name setname m_name m_name m_name get attachment index return timestamp public int get index return m index getindex m_index to string return name public string to string return m name tostring m_name to string extended return name length public string to stringx string buffer sb new string buffer m name if m data null sb append float size m data length if size 1024 sb append m data length append b else size 1024 if size 1024 size 1024 sb append size append mb else sb append size append kb sb append sb append append get content type return sb to string tostringx stringbuffer stringbuffer m_name m_data m_data m_data getcontenttype tostring dump data public void dump string hdr get name system out println hdr if m data null system out println no data return raw data for int i 0 i m data length i char data char m data i system out print data system out println system out println hdr count nulls at end int ii m data length 1 int null count 0 while m data ii 0 null count system out println length m data length end nulls null count real length m data length null count dump w o nulls if null count 0 for int i 0 i m data length null count i system out print char m data i system out println system out println hdr getname m_data m_data m_data m_data nullcount m_data nullcount m_data endnulls nullcount reallength m_data nullcount nullcount m_data nullcount m_data get file with default name return file public file get file return get file get name getfile getfile getname get file with name param file name optional file name return file public file get file string file name if file name null file name length 0 file name get name return get file new file file name filename getfile filename filename filename filename getname getfile filename get file param file out file return file public file get file file file if m data null m data length 0 return null try file output stream fos new file output stream file fos write m data fos close catch io exception ioe log log level severe get file ioe return file getfile m_data m_data fileoutputstream fileoutputstream m_data ioexception getfile is attachment entry a pdf return true if pdf public boolean ispdf return m name ends with pdf m_name endswith isattachment entry a graphic return true if gif jpg png public boolean is graphic return m name ends with gif m name ends with jpg m name ends with png isgraphic m_name endswith m_name endswith m_name endswith get content mime type return content type public string get content type return mime type get mime type m name getcontenttype mimetype getmimetype m_name get data as input stream return input stream public input stream get input stream if m data null return null return new byte array input stream m data inputstream getinputstream m_data bytearrayinputstream m_data html editor param owner owner param html text text public html editor frame owner string title string html text boolean editable super owner title null msg get msg env get ctx editor title true init owner html text editable htmltext htmleditor htmltext getmsg getctx htmltext html editor param owner owner param html text text public html editor dialog owner string title string html text boolean editable super owner title null msg get msg env get ctx editor title true init owner html text editable htmltext htmleditor htmltext getmsg getctx htmltext init param owner owner param html text text private void init window owner string html text boolean editable try jb init catch exception e log log level severe html editor e set html text html text editor pane set editable editable a env show center window owner this htmltext htmltext jbinit htmleditor sethtmltext htmltext editorpane seteditable aenv showcenterwindow static init throws exception private void jb init throws exception tool bar b import set tool tip text msg get msg env get ctx import b import add action listener this b export set tool tip text msg get msg env get ctx export b export add action listener this b bold set tool tip text msg get msg env get ctx bold b italic set tool tip text msg get msg env get ctx italic b underline set tool tip text msg get msg env get ctx underline tool bar add b import null tool bar add b export null tool bar add separator tool bar add b bold null tool bar add b italic null tool bar add b underline null tool bar add separator editor editor pane set content type text html set menu content type must be set setj menu bar menu bar create menu bar general layout main panel set layout main layout get content pane add main panel border layout center main panel add tool bar border layout north main panel add editor scroll pane border layout center size 600x600 editor scroll pane set preferred size new dimension 600 600 editor scroll pane get viewport add editor pane null main panel add confirm panel border layout south confirm panel add action listener this jbinit toolbar bimport settooltiptext getmsg getctx bimport addactionlistener bexport settooltiptext getmsg getctx bexport addactionlistener bbold settooltiptext getmsg getctx bitalic settooltiptext getmsg getctx bunderline settooltiptext getmsg getctx toolbar bimport toolbar bexport toolbar addseparator toolbar bbold toolbar bitalic toolbar bunderline toolbar addseparator editorpane setcontenttype setjmenubar menubar createmenubar mainpanel setlayout mainlayout getcontentpane mainpanel borderlayout mainpanel toolbar borderlayout mainpanel editorscrollpane borderlayout editorscrollpane setpreferredsize editorscrollpane getviewport editorpane mainpanel confirmpanel borderlayout confirmpanel addactionlistener create menu bar private void create menu bar build lookup action action array editor pane get actions hashtable object action actions new hashtable object action for int i 0 i action array length i object name action array i get value action name system out println name actions put name action array i for int i 0 i extra actions length i object name extra actions i get value action name actions put name extra actions i add the font menu j menu menu build menu msg get msg env get ctx font font menu actions if menu null menu bar add menu add the alignment menu menu build menu msg get msg env get ctx align align menu actions if menu null menu bar add menu add the html menu menu build menu html html menu actions if menu null menu bar add menu add to button actions action target action action actions get font bold b bold add action listener target action target action action actions get font italic b italic add action listener target action target action action actions get font underline b underline add action listener target action createmenubar actionarray editorpane getactions actionarray actionarray getvalue actionarray extraactions extraactions getvalue extraactions jmenu buildmenu getmsg getctx fontmenu menubar buildmenu getmsg getctx alignmenu menubar buildmenu htmlmenu menubar targetaction bbold addactionlistener targetaction targetaction bitalic addactionlistener targetaction targetaction bunderline addactionlistener targetaction build menu param name name param menu actions menu structure param actions lookup return menu private j menu build menu string name htmleditor menuaction menu actions hashtable actions j menu menu new j menu name for int i 0 i menu actions length i htmleditor menuaction item menu actions i if item is sub menu recurse to handle a sub menu j menu sub menu build menu item get name item get sub menus actions if sub menu null menu add sub menu else if item is action direct action menu add item get action else find it string action name item get action name action target action action actions get action name create the menu item j menu item menu item menu add item get name if target action null menu item add action listener target action else action not known disable the menu item menu item set enabled false for all actions return null if nothing was added to the menu if menu get menu component count 0 menu null return menu menuactions jmenu buildmenu htmleditor_menuaction menuactions jmenu jmenu menuactions htmleditor_menuaction menuactions issubmenu jmenu submenu buildmenu getname getsubmenus submenu submenu isaction getaction actionname getactionname targetaction actionname jmenuitem menuitem getname targetaction menuitem addactionlistener targetaction menuitem setenabled getmenucomponentcount action listener param e event public void action performed action event e log fine action performed text get html text if e get source b import cmd import else if e get source b export cmd export else if e get action command equals confirm panel a ok m text editor pane get text dispose else if e get action command equals confirm panel a cancel dispose actionperformed actionevent actionperformed gethtmltext getsource bimport cmd_import getsource bexport cmd_export getactioncommand confirmpanel a_ok m_text editorpane gettext getactioncommand confirmpanel a_cancel import text from file private void cmd import j file chooser jc new j file chooser jc set dialog title msg get msg env get ctx import jc set dialog type j file chooser open dialog jc set file selection mode j file chooser files only if jc show open dialog this j file chooser approve option return string buffer sb new string buffer try input stream reader in new input stream reader new file input stream jc get selected file char cbuf new char 1024 int count while count in read cbuf 0 sb append cbuf 0 count in close catch exception e log log level severe html editor import e get message return set html text sb to string cmd_import jfilechooser jfilechooser setdialogtitle getmsg getctx setdialogtype jfilechooser open_dialog setfileselectionmode jfilechooser files_only showopendialog jfilechooser approve_option stringbuffer stringbuffer inputstreamreader inputstreamreader fileinputstream getselectedfile htmleditor getmessage sethtmltext tostring export text to file private void cmd export j file chooser jc new j file chooser jc set dialog title msg get msg env get ctx export jc set dialog type j file chooser save dialog jc set file selection mode j file chooser files only if jc show save dialog this j file chooser approve option return try editor kit kit editor pane get editor kit output stream writer writer new output stream writer new file output stream jc get selected file editor pane write writer writer flush writer close catch exception e log log level severe html editor export e get message cmd_export jfilechooser jfilechooser setdialogtitle getmsg getctx setdialogtype jfilechooser save_dialog setfileselectionmode jfilechooser files_only showsavedialog jfilechooser approve_option editorkit editorpane geteditorkit outputstreamwriter outputstreamwriter fileoutputstream getselectedfile editorpane htmleditor getmessage get html text return text public string get html text return m text gethtmltext m_text set html text param html text public void set html text string html text m text html text editor pane set text html text htmltext sethtmltext htmltext m_text htmltext editorpane settext htmltext test param args ignored public static void main string args compiere startup environment true j frame frame new j frame test frame set visible true string text html p this is a line br with b bold info html int i 0 while true html editor ed new html editor frame heading i text true text ed get html text startupenvironment jframe jframe setvisible htmleditor htmleditor gethtmltext public htmleditor menuaction string name htmleditor menuaction sub menus m name name m submenus sub menus htmleditor_menuaction htmleditor_menuaction submenus m_name m_submenus submenus public htmleditor menuaction string name string action name m name name m actionname action name htmleditor_menuaction actionname m_name m_actionname actionname public htmleditor menuaction string name action action m name name m action action htmleditor_menuaction m_name m_action public boolean is sub menu return m submenus null issubmenu m_submenus public boolean is action return m action null isaction m_action public string get name return m name getname m_name public htmleditor menuaction get sub menus return m submenus htmleditor_menuaction getsubmenus m_submenus public string get action name return m actionname getactionname m_actionname public action get action return m action getaction m_action standard constructor public x ad schedulerlog properties ctx int ad schedulerlog id string trx name super ctx ad schedulerlog id trx name if ad schedulerlog id 0 setad schedulerlog id 0 setad scheduler id 0 set is error false x_ad_schedulerlog ad_schedulerlog_id trxname ad_schedulerlog_id trxname ad_schedulerlog_id setad_schedulerlog_id setad_scheduler_id setiserror load constructor public x ad schedulerlog properties ctx result set rs string trx name super ctx rs trx name x_ad_schedulerlog resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad schedulerlog append get id append return sb to string tostring stringbuffer stringbuffer x_ad_schedulerlog get_id tostring set scheduler log result of the execution of the scheduler public void setad schedulerlog id int ad schedulerlog id if ad schedulerlog id 1 throw new illegal argument exception ad schedulerlog id is mandatory set valuenocheck ad schedulerlog id new integer ad schedulerlog id setad_schedulerlog_id ad_schedulerlog_id ad_schedulerlog_id illegalargumentexception ad_schedulerlog_id set_valuenocheck ad_schedulerlog_id ad_schedulerlog_id get scheduler log result of the execution of the scheduler public int getad schedulerlog id integer ii integer get value ad schedulerlog id if ii null return 0 return ii int value getad_schedulerlog_id get_value ad_schedulerlog_id intvalue set scheduler schedule processes public void setad scheduler id int ad scheduler id if ad scheduler id 1 throw new illegal argument exception ad scheduler id is mandatory set valuenocheck ad scheduler id new integer ad scheduler id setad_scheduler_id ad_scheduler_id ad_scheduler_id illegalargumentexception ad_scheduler_id set_valuenocheck ad_scheduler_id ad_scheduler_id get scheduler schedule processes public int getad scheduler id integer ii integer get value ad scheduler id if ii null return 0 return ii int value getad_scheduler_id get_value ad_scheduler_id intvalue set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set error an error occured in the execution public void set is error boolean is error set value is error new boolean is error setiserror iserror set_value iserror iserror get error an error occured in the execution public boolean is error object oo get value is error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iserror get_value iserror booleanvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg get contents return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter p_record_id getrecord_id process return message throws exception protected string do it throws exception string buffer sql1 null int no 0 log info check bom structure record id is m product id of product to be tested x m product xp new x m product env get ctx p record id get trxname if xp isbom log info not bom product no bom should not happen but no problem xp set is verified true xp save get trxname return ok table to put all bo ms duplicate will cause exception sql1 new string buffer delete from t selection2 where query id 0 no db execute update sql1 to string sql1 new string buffer insert into t selection2 query id t selection id values 0 p record id no db execute update sql1 to string table of root modes sql1 new string buffer delete from t selection no db execute update sql1 to string sql1 new string buffer insert into t selection t selection id values p record id no db execute update sql1 to string while true get count remaining on t selection int countno 0 try prepared statement pstmt db prepare statement select count from t selection result set rs pstmt execute query if rs next countno rs get int 1 rs close pstmt close catch sql exception e throw new exception count t selection e log fine count t selection countno if countno 0 break try if any command fails no 1 break and inform failure insert bom nodes into all table sql1 new string buffer insert into t selection2 query id t selection id select 0 p m product id from m product p where isbom y and exists select from m product bom b where p m product id b m productbom id and b m product id in select t selection id from t selection no db execute update sql1 to string if no 1 raise error inserting root error sql1 to string insert bom nodes into temporary table sql1 new string buffer delete from t selection2 where query id 1 no db execute update sql1 to string if no 1 raise error inserting root error sql1 to string sql1 new string buffer insert into t selection2 query id t selection id select 1 p m product id from m product p where isbom y and exists select from m product bom b where p m product id b m productbom id and b m product id in select t selection id from t selection no db execute update sql1 to string if no 1 raise error inserting root error sql1 to string copy into root table sql1 new string buffer delete from t selection no db execute update sql1 to string if no 1 raise error inserting root error sql1 to string sql1 new string buffer insert into t selection t selection id select t selection id from t selection2 where query id 1 no db execute update sql1 to string if no 1 raise error inserting root error sql1 to string catch exception e throw new exception root insert e finish process xp set is verified true xp save get trxname return ok doit stringbuffer m_product_id x_m_product x_m_product getctx p_record_id get_trxname setisverified get_trxname boms stringbuffer t_selection2 query_id executeupdate tostring stringbuffer t_selection2 query_id t_selection_id p_record_id executeupdate tostring stringbuffer t_selection executeupdate tostring stringbuffer t_selection t_selection_id p_record_id executeupdate tostring t_selection preparedstatement preparestatement t_selection resultset executequery getint sqlexception t_selection t_selection stringbuffer t_selection2 query_id t_selection_id m_product_id m_product m_product_bom m_product_id m_productbom_id m_product_id t_selection_id t_selection executeupdate tostring raiseerror insertingroot tostring stringbuffer t_selection2 query_id executeupdate tostring raiseerror insertingroot tostring stringbuffer t_selection2 query_id t_selection_id m_product_id m_product m_product_bom m_product_id m_productbom_id m_product_id t_selection_id t_selection executeupdate tostring raiseerror insertingroot tostring stringbuffer t_selection executeupdate tostring raiseerror insertingroot tostring stringbuffer t_selection t_selection_id t_selection_id t_selection2 query_id executeupdate tostring raiseerror insertingroot tostring setisverified get_trxname private void raise error string string string sql throws exception db rollback false get trxname string msg string value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg raiseerror get_trxname valuenamepair clogger retrieveerror getname compiereusererror persistency constructor param ctx context param ignored ignored public m column access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mcolumnaccess trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m column access properties ctx result set rs string trx name super ctx rs trx name mcolumnaccess resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m column access sb append ad role id append getad role id append ad table id append getad table id append ad column id append getad column id append exclude append is exclude sb append return sb to string tostring stringbuffer stringbuffer mcolumnaccess ad_role_id getad_role_id ad_table_id getad_table_id ad_column_id getad_column_id isexclude tostring extended string representation return extended info public string to stringx properties ctx string in msg get msg ctx include string ex msg get msg ctx exclude string buffer sb new string buffer sb append msg translate ctx ad table id append append get table name ctx append append msg translate ctx ad column id append append get column name ctx append append msg translate ctx is read only append append is read only append append is exclude ex in return sb to string tostringx getmsg getmsg stringbuffer stringbuffer ad_table_id gettablename ad_column_id getcolumnname isreadonly isreadonly isexclude tostring get table name param ctx context for translatioin return table name public string get table name properties ctx if m tablename null get column name ctx return m tablename gettablename m_tablename getcolumnname m_tablename get column name param ctx context for translatioin return column name public string get column name properties ctx if m columnname null string sql select t table name c column name t ad table id from ad table t inner join ad column c on t ad table id c ad table id where ad column id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad column id result set rs pstmt execute query if rs next m tablename rs get string 1 m columnname rs get string 2 if rs get int 3 getad table id log log level severe ad table id inconsistent access getad table id table rs get int 3 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null get clear text string real name msg translate ctx m tablename id if real name equals m tablename id m tablename real name m columnname msg translate ctx m columnname return m columnname getcolumnname m_columnname tablename columnname ad_table_id ad_table ad_column ad_table_id ad_table_id ad_column_id preparedstatement preparestatement get_trxname setint getad_column_id resultset executequery m_tablename getstring m_columnname getstring getint getad_table_id ad_table_id getad_table_id getint realname m_tablename _id realname m_tablename _id m_tablename realname m_columnname m_columnname m_columnname initialize logging param is client client public static void initialize boolean is client if s handlers null return log manager mgr log manager get log manager try load logging config from org compiere util properties string file name log client properties if is client file name log server properties input stream in c log mgt class get resource as stream file name buffered input stream bin new buffered input stream in mgr read configuration bin in close catch exception e e print stack trace create handler list s handlers new array list handler try logger root logger logger get logger system out println root logger get name root logger handler handlers root logger get handlers for int i 0 i handlers length i system out println handlers i if s handlers contains handlers i s handlers add handlers i enumeration en mgr get logger names while en has more elements logger lll logger get logger en next element to string system out println lll get name lll system out println level lll get level system out println parent lll get parent use parent handlers lll get use parent handlers system out println filter lll get filter handlers lll get handlers system out println handlers handlers length for int i 0 i handlers length i system out println handlers i if s handlers contains handlers i s handlers add handlers i system out println catch exception e if e instanceof class not found exception web start can t load log handler org compiere util c log console java lang class not found exception org compiere util c log console java lang class not found exception org compiere util c log console at java net url class loader 1 run unknown source at java security access controller do privileged native method at java net url class loader find class unknown source at java lang class loader load class unknown source at sun misc launcher app class loader load class unknown source at java lang class loader load class unknown source at java util logging log manager 7 run unknown source at java security access controller do privileged native method at java util logging log manager initialize global handlers unknown source at java util logging log manager access 900 unknown source at java util logging log manager root logger get handlers unknown source at org compiere util c log mgt initialize c log mgt java 67 at org compiere compiere startup compiere java 389 at org compiere compiere main compiere java 500 at sun reflect native method accessor impl invoke0 native method at sun reflect native method accessor impl invoke unknown source at sun reflect delegating method accessor impl invoke unknown source at java lang reflect method invoke unknown source at com sun javaws launcher execute application unknown source at com sun javaws launcher execute main class unknown source at com sun javaws launcher continue launch unknown source at com sun javaws launcher handle application desc unknown source at com sun javaws launcher handle launch file unknown source at com sun javaws launcher run unknown source at java lang thread run unknown source else system err println e to string system out println handlers s handlers size check loggers if c log error buffer get false null add handler c log error buffer get true if c log console get false null is client add handler c log console get true c log file fh c log file get false null is client if fh null is client fh c log file get true null is client add handler fh if fh null is client system out println fh set formatter c log formatter get set filter c log filter get set level s currentlevel set logger level level all null c log mgt log4j initialize is client system out println handlers s handlers size level s currentlevel isclient isclient s_handlers logmanager logmanager getlogmanager filename logclient isclient filename logserver inputstream clogmgt getresourceasstream filename bufferedinputstream bufferedinputstream readconfiguration printstacktrace s_handlers arraylist rootlogger getlogger rootlogger getname rootlogger rootlogger gethandlers s_handlers s_handlers getloggernames hasmoreelements getlogger nextelement tostring getname getlevel getparent useparenthandlers getuseparenthandlers getfilter gethandlers s_handlers s_handlers classnotfoundexception webstart clogconsole classnotfoundexception clogconsole classnotfoundexception clogconsole urlclassloader accesscontroller doprivileged urlclassloader findclass classloader loadclass appclassloader loadclass classloader loadclass logmanager accesscontroller doprivileged logmanager initializeglobalhandlers logmanager logmanager rootlogger gethandlers clogmgt clogmgt nativemethodaccessorimpl nativemethodaccessorimpl delegatingmethodaccessorimpl executeapplication executemainclass continuelaunch handleapplicationdesc handlelaunchfile tostring s_handlers clogerrorbuffer addhandler clogerrorbuffer clogconsole isclient addhandler clogconsole clogfile clogfile isclient isclient clogfile isclient addhandler isclient setformatter clogformatter setfilter clogfilter setlevel s_currentlevel setloggerlevel clogmgtlog4j isclient s_handlers s_currentlevel get handlers return handlers protected static handler get handlers handler handlers new handler s handlers size for int i 0 i s handlers size i handlers i handler s handlers get i return handlers gethandlers s_handlers s_handlers s_handlers add handler to root logger param handler new handler public static void add handler handler handler if handler null return logger root logger logger get logger root logger add handler handler s handlers add handler log log level config handler handler addhandler rootlogger getlogger rootlogger addhandler s_handlers set formatter for all handlers param formatter formatter protected static void set formatter java util logging formatter formatter for int i 0 i s handlers size i handler handler handler s handlers get i handler set formatter formatter log log level config formatter formatter setformatter s_handlers s_handlers setformatter set filter for all handlers param filter filter protected static void set filter filter filter for int i 0 i s handlers size i handler handler handler s handlers get i handler set filter filter log log level config filter filter setfilter s_handlers s_handlers setfilter set level for all loggers param level log level param logger name part optional partial class logger name public static void set logger level level level string logger name part if level null return log manager mgr log manager get log manager enumeration en mgr get logger names while en has more elements string name en next element to string if logger name part null name index of logger name part 1 logger lll logger get logger name lll set level level loggernamepart setloggerlevel loggernamepart logmanager logmanager getlogmanager getloggernames hasmoreelements nextelement tostring loggernamepart indexof loggernamepart getlogger setlevel set level for all handlers param level log level public static void set level level level if level null return for int i 0 i s handlers size i handler handler handler s handlers get i handler set level level jdbc if all setjdbc debug s currentlevel int value level all int value if level int value s currentlevel int value set logger level level null log config level to string s currentlevel level setlevel s_handlers s_handlers setlevel setjdbcdebug s_currentlevel intvalue intvalue intvalue s_currentlevel intvalue setloggerlevel tostring s_currentlevel set level param int level integer value of level public static void set level int int level set level string value of int level intlevel setlevel intlevel setlevel valueof intlevel set level param level string string representation of level public static void set level string level string if level string null return for int i 0 i levels length i if levels i get name equals level string set level levels i return log log level config ignored level string levelstring setlevel levelstring levelstring getname levelstring setlevel levelstring set jdbc debug param enable public static void setjdbc debug boolean enable if enable driver manager set log writer new print writer system err else driver manager set log writer null setjdbcdebug drivermanager setlogwriter printwriter drivermanager setlogwriter get logging level of handlers return logging level public static level get level return s currentlevel getlevel s_currentlevel get logging level of handlers return logging level public static int get level as int return s currentlevel int value getlevelasint s_currentlevel intvalue is logging level logged param level level return true if it is logged public static boolean is level level level if level null return false return level int value s currentlevel int value islevel intvalue s_currentlevel intvalue is logging level finest logged return true if it is logged public static boolean is level all return level all int value s currentlevel int value islevelall intvalue s_currentlevel intvalue is logging level finest logged return true if it is logged public static boolean is level finest return level finest int value s currentlevel int value islevelfinest intvalue s_currentlevel intvalue is logging level finer logged return true if it is logged public static boolean is level finer return level finer int value s currentlevel int value islevelfiner intvalue s_currentlevel intvalue is logging level fine logged return true if it is logged public static boolean is level fine return level fine int value s currentlevel int value islevelfine intvalue s_currentlevel intvalue is logging level info logged return true if it is logged public static boolean is level info return level info int value s currentlevel int value islevelinfo intvalue s_currentlevel intvalue enable disable logging of handlers param enable logging true if logging enabled public static void enable boolean enable logging if enable logging set level s currentlevel else level level s currentlevel set level level off s currentlevel level enablelogging enablelogging enablelogging setlevel s_currentlevel s_currentlevel setlevel s_currentlevel shutdown logging system public static void shutdown log manager mgr log manager get log manager mgr reset logmanager logmanager getlogmanager print properties param p properties to print param description description of properties param log it if true write to log level config else to system out public static void print properties properties p string description boolean log it if p null return if log it log info description size p size hash p hash code n get local host else system out println log print properties description size p size hash p hash code n get local host object pp p key set to array arrays sort pp for int i 0 i pp length i string key pp i to string string value p get property key if log it log config key value else system out println key value logit printproperties logit logit hashcode getlocalhost printproperties hashcode getlocalhost keyset toarray tostring getproperty logit get compiere system info return info as multiple line string public static string buffer get info string buffer sb if sb null sb new string buffer final string eq sb append get msg host append eq append get server info append nl sb append get msg database append eq append get database info append nl sb append get msg schema append eq append c connection get get db uid append nl sb append get msg ad user id append eq append env get context env get ctx ad user name append nl sb append get msg ad role id append eq append env get context env get ctx ad role name append nl sb append get msg ad client id append eq append env get context env get ctx ad client name append nl sb append get msg ad org id append eq append env get context env get ctx ad org name append nl sb append get msg date append eq append env get context env get ctx date append nl sb append get msg printer append eq append env get context env get ctx printer append nl manifest mf zip util get manifest c client jar if mf null mf zip util get manifest c tools jar if mf null attributes atts mf get main attributes if atts null iterator it atts key set iterator while it has next object key it next if key to string starts with impl key to string starts with spec sb append key append eq append atts get key append nl sb append a dempiere home append compiere get compiere home append nl sb append env get language env get ctx append nl m client client m client get env get ctx sb append client append nl sb append get msg is multi lingual document append eq append client is multi lingual document append nl sb append base language append env is base language env get ctx ad window append append env is base language env get ctx c uom append nl sb append pdf license append document is licensed append nl sb append compiere get java info append nl sb append compiere getos info return sb stringbuffer getinfo stringbuffer stringbuffer getmsg getserverinfo getmsg getdatabaseinfo getmsg cconnection getdbuid getmsg ad_user_id getcontext getctx ad_user_name getmsg ad_role_id getcontext getctx ad_role_name getmsg ad_client_id getcontext getctx ad_client_name getmsg ad_org_id getcontext getctx ad_org_name getmsg getcontext getctx getmsg getcontext getctx ziputil getmanifest cclient ziputil getmanifest ctools getmainattributes keyset hasnext tostring startswith tostring startswith adempierehome getcompierehome getlanguage getctx mclient mclient getctx getmsg ismultilingualdocument ismultilingualdocument baselanguage isbaselanguage getctx ad_window isbaselanguage getctx c_uom islicensed getjavainfo getosinfo create system info param sb optional string buffer param ctx environment return system info public static string buffer get info detail string buffer sb properties ctx if sb null sb new string buffer if ctx null ctx env get ctx envoronment c connection cc c connection get sb append nl append environment append compiere get check sum append nl append compiere get summary ascii append nl append get local host append nl append cc to string long append nl append cc get info append nl context sb append nl append context append nl string context env get entire context ctx arrays sort context for int i 0 i context length i sb append context i append nl system sb append nl append system append nl object pp system get properties key set to array arrays sort pp for int i 0 i pp length i string key pp i to string string value system get property key sb append key append append value append nl return sb stringbuffer getinfodetail stringbuffer stringbuffer getctx cconnection cconnection getchecksum getsummaryascii getlocalhost tostringlong getinfo getentirecontext getproperties keyset toarray tostring getproperty get translated message if db connection exists param msg ad message return translated msg if connected private static string get msg string msg if db is connected return msg translate env get ctx msg return msg ad_message getmsg isconnected getctx get server info return host port not active via c mhost port private static string get server info string buffer sb new string buffer c connection cc c connection get host sb append cc get apps host append append cc get apps port append server if cc is apps serverok false sb append c connection get get server version else sb append get msg not active sb append n boolean remote objects db is remote objects boolean remote process db is remote process string realcp c connection profile lan if cc isrm ioverhttp cc is apps serverok false realcp c connection profile wan else if remote objects remote process realcp c connection profile vpn else if remote process realcp c connection profile terminal sb append cc get connection profile text realcp sb append tunnel append cc isrm ioverhttp cc is apps serverok false append objects append remote objects append process append remote process return sb to string notactive cmhost getserverinfo stringbuffer stringbuffer cconnection cconnection getappshost getappsport isappsserverok cconnection getserverversion getmsg notactive remoteobjects isremoteobjects remoteprocess isremoteprocess cconnection profile_lan isrmioverhttp isappsserverok cconnection profile_wan remoteobjects remoteprocess cconnection profile_vpn remoteprocess cconnection profile_terminal getconnectionprofiletext isrmioverhttp isappsserverok remoteobjects remoteprocess tostring get database info return host port sid private static string get database info string buffer sb new string buffer sb append c connection get get db host append append c connection get get db port append append c connection get get db name connection manager if c connection get is via firewall sb append get msg via append append c connection get get fw host append append c connection get get fw port return sb to string getdatabaseinfo stringbuffer stringbuffer cconnection getdbhost cconnection getdbport cconnection getdbname cconnection isviafirewall getmsg cconnection getfwhost cconnection getfwport tostring get localhost return local host private static string get local host try inet address id inet address get local host return id to string catch exception e log log level severe get local host e return no local host info getlocalhost inetaddress inetaddress getlocalhost tostring getlocalhost c log mgt public c log mgt test log clogmgt clogmgt testlog test log private void test log final c logger log c logger getc logger test log log level severe severe log warning warning log info info log config config log fine fine log finer finer log entering my class my method parameter log exiting my class my method result log finest finest new thread public void run log info thread info start try integer parse int abc catch exception e log log level severe error message e log log level info info message 1 1 param log log level info info message n new object 1 param 2 param testlog clogger clogger getclogger myclass mymethod myclass mymethod parseint 1param 1param 2param new thread public void run log info thread info test param args ignored public static void main string args initialize true new c log mgt clogmgt get contents return contents public object get contents return contents getcontents amtinwords fr public amtinwords fr super amtinwords_fr amtinwords_fr convert less than one thousand param number number return string private string convert less than one thousand int number string so far if number 100 20 19 et moins so far num names number 100 number 100 else 9 et moins so far num names number 10 number 10 90 80 20 so far tens names number 10 so far number 10 reste les centaines y en a pas if number 0 return so far if number 1 on ne retourne un cent xxxx mais cent xxxx return cent so far else return num names number cent so far convertlessthanonethousand sofar sofar numnames sofar numnames sofar tensnames sofar sofar sofar numnames sofar convert param number number return string private string convert int number if number 0 return zero string prefix if number 0 number number prefix moins string so far int place 0 boolean plural possible true boolean plural form false do int n number 1000 par tranche de 1000 if n 0 string s convert less than one thousand n if s trim equals un place 1 on donne pas le un pour mille so far major names place so far else if place 0 if s trim ends with cent s trim starts with cent nnn200 nnn900 avec s plural form true else pas de s jamais plural possible false if place 0 plural possible if s trim starts with un avec s plural form true else jamis de s plural possible false so far s major names place so far place number 1000 while number 0 string result prefix so far trim return plural form result s result sofar pluralpossible pluralform convertlessthanonethousand sofar majornames sofar endswith startswith pluralform pluralpossible pluralpossible startswith pluralform pluralpossible sofar majornames sofar sofar pluralform get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 public string get amt in words string amount throws exception if amount null return amount string buffer sb new string buffer int pos amount last index of int pos2 amount last index of if pos2 pos pos pos2 string oldamt amount amount amount replace all int newpos amount last index of int pesos integer parse int amount substring 0 newpos sb append convert pesos for int i 0 i oldamt length i if pos i we are done string cents oldamt substring i 1 sb append append cents append 100 break return sb to string getamtinwords stringbuffer stringbuffer lastindexof lastindexof replaceall lastindexof parseint tostring default constructor public online help super set editable false set content type text html add hyperlink listener this onlinehelp seteditable setcontenttype addhyperlinklistener constructor param url url to load public online help string url this try if url null url length 0 set page url catch exception e system err println online help url url e onlinehelp setpage onlinehelp constructor param load online load online url public online help boolean load online this load online base url null loadonline onlinehelp loadonline loadonline base_url hyperlink listener param e event public void hyperlink update hyperlink event e system out println online help hyperlink update e get description e geturl if e get event type hyperlink event event type activated return this set cursor cursor get predefined cursor cursor wait cursor if e instanceof html frame hyperlink event html frame hyperlink event evt html frame hyperlink event e html document doc html document get document doc processhtml frame hyperlink event evt else if e geturl null remove of the reference scroll to reference e get description substring 1 else try set page e geturl catch throwable t system err println help hyperlink update t to string display error error e geturl t this set cursor cursor get default cursor hyperlinkupdate hyperlinkevent onlinehelp hyperlinkupdate getdescription geteventtype hyperlinkevent eventtype setcursor getpredefinedcursor wait_cursor htmlframehyperlinkevent htmlframehyperlinkevent htmlframehyperlinkevent htmldocument htmldocument getdocument processhtmlframehyperlinkevent scrolltoreference getdescription setpage hyperlinkupdate tostring displayerror setcursor getdefaultcursor set text param text text public void set text string text set background compiereplaf get info background super set text text set caret position 0 scroll to top settext setbackground getinfobackground settext setcaretposition load url async param url url public void set page final url url set background color white runnable pgm new runnable public void run load page url new thread pgm start setpage setbackground loadpage runnable pgm new runnable public void run load page url loadpage load page async param url url private void load page url url try super set page url catch exception e display error error url not found url e loadpage setpage displayerror display error message param header header param url url param exception exception protected void display error string header object url object exception string buffer msg new string buffer html body msg append h1 append header append h1 append h3 url append url append h3 append h3 error append exception append h3 append p a dempiere append a href append base url append online help a p append body html set text msg to string displayerror stringbuffer stringbuffer adempiere base_url settext tostring is online help available return true if available public static boolean is available return s links size 0 isavailable s_links worker constructor param url string url param links links worker string url string hash map string string links m urlstring url string m links links set priority thread min priority urlstring urlstring hashmap m_urlstring urlstring m_links setpriority min_priority worker read available online help pages public void run if m links null return url url null try url new url m urlstring catch exception e system err println online help worker run url e if url null return read reference page try url connection conn url open connection input stream is conn get input stream html editor kit kit new html editor kit html document doc html document kit create default document doc put property ignore charset directive new boolean true kit read new input stream reader is doc 0 get the links to the help pages html document iterator it doc get iterator html tag a object target null object href null while it null it is valid attribute set as it get attributes href help 100 index html target online title my test system out println as key keys if target null href null enumeration en as get attribute names while en has more elements object o en next element if target null o to string equals target target o javax swing text html html attribute else if href null o to string equals href href o if online equals as get attribute target format help ad window id index html string href string string as get attribute href if href string null try system err println href string string ad window id href string substring href string index of 1 href string last index of m links put ad window id href string catch exception e system err println online help worker run help e it next is close catch connect exception e system err println online help worker run url url e catch unknown host exception uhe system err println online help worker run uhe catch exception e system err println online help worker run e e e print stack trace catch throwable t system err println online help worker run t t t print stack trace system out println online help links m links size m_links m_urlstring onlinehelp urlconnection openconnection inputstream getinputstream htmleditorkit htmleditorkit htmldocument htmldocument createdefaultdocument putproperty ignorecharsetdirective inputstreamreader htmldocument getiterator isvalid attributeset getattributes getattributenames hasmoreelements nextelement tostring tostring getattribute ad_window_id hrefstring getattribute hrefstring hrefstring ad_window_id hrefstring hrefstring indexof hrefstring lastindexof m_links ad_window_id hrefstring onlinehelp connectexception onlinehelp unknownhostexception onlinehelp onlinehelp printstacktrace onlinehelp printstacktrace onlinehelp m_links diagnostics param doc html document param tag html tag private void dump tags html document doc html tag tag system out println doc doc get base tag tag html document iterator it doc get iterator tag while it null it is valid attribute set as it get attributes system out println as it next dumptags htmldocument getbase htmldocument getiterator isvalid attributeset getattributes construct new test instance param name the test name public m role test string name super name mroletest perform pre test initialization throws exception see test case set up protected void set up throws exception exception org compiere compiere startup environment true m role m role get default env get ctx false super set up testcase setup setup startupenvironment m_role mrole getdefault getctx setup perform post test clean up throws exception see test case tear down protected void tear down throws exception super tear down testcase teardown teardown teardown run the string add accesssql string string boolean boolean method test public void test add accesssql add test code here string sql m role add accesssql select r a r b r c from ad role r where exists select ad column c where c a c b order by 1 r m role sql fullyqualified m role sql ro system out println sql assert equals sql select r a r b r c from ad role r where exists select ad column c where c a c b and r ad client id 0 and r ad org id 0 order by 1 addaccesssql testaddaccesssql m_role addaccesssql ad_role ad_column mrole sql_fullyqualified mrole sql_ro assertequals ad_role ad_column ad_client_id ad_org_id launch the test param args string public static void main string args junit textui test runner run m role test class testrunner mroletest standard constructor public x m package properties ctx int m package id string trx name super ctx m package id trx name if m package id 0 set document no null setm inout id 0 setm package id 0 setm shipper id 0 x_m_package m_package_id trxname m_package_id trxname m_package_id setdocumentno setm_inout_id setm_package_id setm_shipper_id load constructor public x m package properties ctx result set rs string trx name super ctx rs trx name x_m_package resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m package append get id append return sb to string tostring stringbuffer stringbuffer x_m_package get_id tostring set date received date a product was received public void set date received timestamp date received set value date received date received setdatereceived datereceived set_value datereceived datereceived get date received date a product was received public timestamp get date received return timestamp get value date received getdatereceived get_value datereceived set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 1 throw new illegal argument exception m inout id is mandatory set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id illegalargumentexception m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set package shipment package public void setm package id int m package id if m package id 1 throw new illegal argument exception m package id is mandatory set valuenocheck m package id new integer m package id setm_package_id m_package_id m_package_id illegalargumentexception m_package_id set_valuenocheck m_package_id m_package_id get package shipment package public int getm package id integer ii integer get value m package id if ii null return 0 return ii int value getm_package_id get_value m_package_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 1 throw new illegal argument exception m shipper id is mandatory set value m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id illegalargumentexception m_shipper_id set_value m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue set info received information of the receipt of the package acknowledgement public void set received info string received info if received info null received info length 255 log warning length 255 truncated received info received info substring 0 254 set value received info received info setreceivedinfo receivedinfo receivedinfo receivedinfo receivedinfo receivedinfo set_value receivedinfo receivedinfo get info received information of the receipt of the package acknowledgement public string get received info return string get value received info getreceivedinfo get_value receivedinfo set ship date shipment date time public void set ship date timestamp ship date set value ship date ship date setshipdate shipdate set_value shipdate shipdate get ship date shipment date time public timestamp get ship date return timestamp get value ship date getshipdate get_value shipdate set tracking info public void set tracking info string tracking info if tracking info null tracking info length 255 log warning length 255 truncated tracking info tracking info substring 0 254 set value tracking info tracking info settrackinginfo trackinginfo trackinginfo trackinginfo trackinginfo trackinginfo set_value trackinginfo trackinginfo get tracking info public string get tracking info return string get value tracking info gettrackinginfo get_value trackinginfo standard constructor public x c greeting properties ctx int c greeting id string trx name super ctx c greeting id trx name if c greeting id 0 setc greeting id 0 set is default false set is first name only false set name null x_c_greeting c_greeting_id trxname c_greeting_id trxname c_greeting_id setc_greeting_id setisdefault setisfirstnameonly setname load constructor public x c greeting properties ctx result set rs string trx name super ctx rs trx name x_c_greeting resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c greeting append get id append return sb to string tostring stringbuffer stringbuffer x_c_greeting get_id tostring set greeting greeting to print on correspondence public void setc greeting id int c greeting id if c greeting id 1 throw new illegal argument exception c greeting id is mandatory set valuenocheck c greeting id new integer c greeting id setc_greeting_id c_greeting_id c_greeting_id illegalargumentexception c_greeting_id set_valuenocheck c_greeting_id c_greeting_id get greeting greeting to print on correspondence public int getc greeting id integer ii integer get value c greeting id if ii null return 0 return ii int value getc_greeting_id get_value c_greeting_id intvalue set greeting for letters e g dear 0 or dear mr 0 at runtime 0 is replaced by the name public void set greeting string greeting if greeting null greeting length 60 log warning length 60 truncated greeting greeting substring 0 59 set value greeting greeting setgreeting set_value get greeting for letters e g dear 0 or dear mr 0 at runtime 0 is replaced by the name public string get greeting return string get value greeting getgreeting get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set first name only print only the first name in greetings public void set is first name only boolean is first name only set value is first name only new boolean is first name only setisfirstnameonly isfirstnameonly set_value isfirstnameonly isfirstnameonly get first name only print only the first name in greetings public boolean is first name only object oo get value is first name only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfirstnameonly get_value isfirstnameonly booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname ide constructor public vp attribute this false false true 0 null vpattribute create product attribute set instance editor param mandatory mandatory param is read only read only param is updateable updateable param window no window no param lookup model product attribute public vp attribute boolean mandatory boolean is read only boolean is updateable int window no mp attribute lookup lookup super set name m attributesetinstance id m windowno window no m mpattribute lookup m c bpartner id env get context as int env get ctx window no c bpartner id look and feel install border this text field border this set layout new border layout size this set preferred size m text get preferred size int height m text get preferred size height text m text set editable false m text set focusable false m text set border null m text set horizontal alignment j text field leading background set mandatory mandatory this add m text border layout center button m button set icon env get image icon p attribute10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this m button set focusable true this add m button border layout east prefereed size this set preferred size this get preferred size causes r o to be the same length read write if is read only is updateable set read write false else set read write true popup m text add mouse listener new vpattribute mouseadapter this menu editor new c menu item msg get msg env get ctx p attribute env get image icon zoom16 gif menu editor add action listener this popup menu add menu editor isreadonly isupdateable windowno windowno vpattribute isreadonly isupdateable windowno mpattributelookup setname m_attributesetinstance_id m_windowno windowno m_mpattribute m_c_bpartner_id getcontextasint getctx windowno c_bpartner_id lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize m_text seteditable m_text setfocusable m_text setborder m_text sethorizontalalignment jtextfield setmandatory m_text borderlayout m_button seticon getimageicon pattribute10 m_button setmargin m_button setpreferredsize m_button addactionlistener m_button setfocusable m_button borderlayout setpreferredsize getpreferredsize readwrite isreadonly isupdateable setreadwrite setreadwrite m_text addmouselistener vpattribute_mouseadapter menueditor cmenuitem getmsg getctx pattribute getimageicon menueditor addactionlistener popupmenu menueditor dispose resources public void dispose m text null m button null m mpattribute dispose m mpattribute null m_text m_button m_mpattribute m_mpattribute set mandatory param mandatory mandatory public void set mandatory boolean mandatory m mandatory mandatory m button set mandatory mandatory set background false setmandatory m_mandatory m_button setmandatory setbackground get mandatory return mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set read write param rw read rwite public void set read write boolean rw m readwrite rw m button set read write rw set background false readwrite setreadwrite m_readwrite m_button setreadwrite setbackground is read write return read write public boolean is read write return m readwrite isreadwrite m_readwrite set foreground param color color public void set foreground color color m text set foreground color setforeground m_text setforeground set background param error error public void set background boolean error if error set background compiereplaf getfieldbackground error else if m readwrite set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf get info background setbackground setbackground getfieldbackground_error m_readwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getinfobackground set background param color color public void set background color color m text set background color setbackground m_text setbackground set lookup value param value value public void set value object value if value null no instance equals value m text set text m value value return the same if value equals m value return new value log fine value value m value value m text set text m mpattribute get display value loads value setvalue no_instance m_text settext m_value m_value m_value m_text settext m_mpattribute getdisplay get value return value public object get value return m value getvalue m_value get display value return info public string get display return m text get text getdisplay m_text gettext set field param m field m field public void set field m field m field to determine behavior m ad column id m field getad column id mfield mfield setfield mfield mfield m_ad_column_id mfield getad_column_id action listener interface param listener listener public void add action listener action listener listener addactionlistener actionlistener action listener start dialog param e event public void action performed action event e if m button is enabled return m button set enabled false integer old value integer get value int m attributesetinstance id old value null 0 old value int value int m product id env get context as int env get ctx m windowno m product id int m productbom id env get context as int env get ctx m windowno m productbom id log config m product id m product id m productbom id m attributesetinstance id m attributesetinstance id ad column id m ad column id m product m attributesetinstance id 8418 boolean product window m ad column id 8418 hardcoded exclude ability to enter asi boolean exclude true if m product id 0 m product product m product get env get ctx m product id int m attributeset id product getm attributeset id if m attributeset id 0 m attribute set mas m attribute set get env get ctx m attributeset id exclude mas exclude entry m ad column id env isso trx env get ctx m windowno boolean changed false if m productbom id 0 use bom component m product id m productbom id if product window m product id 0 exclude changed true m text set text null m attributesetinstance id 0 else vp attribute dialog vad new vp attribute dialog env get frame this m attributesetinstance id m product id m c bpartner id product window m ad column id m windowno if vad is changed m text set text vad getm attributesetinstancename m attributesetinstance id vad getm attributesetinstance id changed true selection get model m attribute set instance masi m attribute set instance get env get ctx m attributesetinstance id m product id if masi null log log level severe no model for m attributesetinstance id m attributesetinstance id m product id m product id else env set context env get ctx m windowno m attributeset id masi getm attributeset id get attribute set m attribute set as masi getm attribute set product has no attribute set if as null a dialog error m windowno this p attribute no attribute set product has no instance attributes else if as is instance attribute a dialog error m windowno this p attribute no instance attribute else int m warehouse id env get context as int env get ctx m windowno m warehouse id int m locator id env get context as int env get ctx m windowno m locator id string title p attribute instance pai new p attribute instance env get frame this title m warehouse id m locator id m product id m c bpartner id if pai getm attributesetinstance id 1 m text set text pai getm attributesetinstancename m attributesetinstance id pai getm attributesetinstance id changed true set value if changed log finest changed m attributesetinstance id m attributesetinstance id m value new object force re query display if m attributesetinstance id 0 set value null else set value new integer m attributesetinstance id try fire vetoable change m attributesetinstance id new object get value catch property veto exception pve log log level severe pve change m button set enabled true request focus actionperformed actionevent m_button isenabled m_button setenabled oldvalue getvalue m_attributesetinstance_id oldvalue oldvalue intvalue m_product_id getcontextasint getctx m_windowno m_product_id m_productbom_id getcontextasint getctx m_windowno m_productbom_id m_product_id m_product_id m_productbom_id m_attributesetinstance_id m_attributesetinstance_id ad_column_id m_ad_column_id m_product m_attributesetinstance_id productwindow m_ad_column_id m_product_id mproduct mproduct getctx m_product_id m_attributeset_id getm_attributeset_id m_attributeset_id mattributeset mattributeset getctx m_attributeset_id excludeentry m_ad_column_id issotrx getctx m_windowno m_productbom_id m_product_id m_productbom_id productwindow m_product_id m_text settext m_attributesetinstance_id vpattributedialog vpattributedialog getframe m_attributesetinstance_id m_product_id m_c_bpartner_id productwindow m_ad_column_id m_windowno ischanged m_text settext getm_attributesetinstancename m_attributesetinstance_id getm_attributesetinstance_id mattributesetinstance mattributesetinstance getctx m_attributesetinstance_id m_product_id m_attributesetinstance_id m_attributesetinstance_id m_product_id m_product_id setcontext getctx m_windowno m_attributeset_id getm_attributeset_id mattributeset getmattributeset adialog m_windowno pattributenoattributeset isinstanceattribute adialog m_windowno pattributenoinstanceattribute m_warehouse_id getcontextasint getctx m_windowno m_warehouse_id m_locator_id getcontextasint getctx m_windowno m_locator_id pattributeinstance pattributeinstance getframe m_warehouse_id m_locator_id m_product_id m_c_bpartner_id getm_attributesetinstance_id m_text settext getm_attributesetinstancename m_attributesetinstance_id getm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id m_value m_attributesetinstance_id setvalue setvalue m_attributesetinstance_id firevetoablechange m_attributesetinstance_id getvalue propertyvetoexception m_button setenabled requestfocus property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue constructor param adaptee adaptee vpattribute mouseadapter vp attribute adaptee this adaptee adaptee vpattribute_mouseadapter vpattribute mouse listener param e event public void mouse clicked mouse event e double click if e get click count 1 adaptee action performed new action event e get source e getid mouse popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent getclickcount actionperformed actionevent getsource swingutilities isrightmousebutton popupmenu getsource basic constructor use set methods public fieldset basic constructor use set methods param element an element to add public fieldset element element add element element addelement basic constructor use set methods param element an element to add public fieldset string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public fieldset add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public fieldset add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public fieldset add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public fieldset add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public fieldset remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get content return content public object get contents return contents getcontents constructor public bar graph super set layout m layout size m size new dimension 500 300 set preferred size m size set minimum size m size set maximum size m size 0 0 point font metrics fm get font metrics get font int font height fm get height int yaxis x font height 10 int xaxis y m size height font height 10 m point0 0 new point yaxis x xaxis y bargraph setlayout m_layout m_size setpreferredsize m_size setminimumsize m_size setmaximumsize m_size fontmetrics getfontmetrics getfont fontheight getheight yaxis_x fontheight xaxis_y m_size fontheight m_point0_0 yaxis_x xaxis_y constructor param goal goal public bar graph m goal goal this m goal goal m y axislabel goal get name m x axislabel goal getx axis text load data test add new bar graph column column 1 100 add new bar graph column column 2 200 add new bar graph column column 3 300 add new bar graph column column 4 400 add new bar graph column column 5 500 add new bar graph column column 6 400 add new bar graph column column 7 300 add new bar graph column column 8 200 add new bar graph column column 9 100 add new bar graph column column 10 200 add new bar graph column column 11 300 add new bar graph column column 12 400 add new bar graph column column 13 500 add new bar graph column column 14 100 bargraph mgoal m_goal m_y_axislabel getname m_x_axislabel getxaxistext loaddata bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn bargraphcolumn load performance data private void load data array list bar graph column list new array list bar graph column calculated m measure measure m goal get measure if measure null log warning no measure for m goal return if m measure measuretype calculated equals measure get measure type m measure calc mc m measure calc get env get ctx measure getpa measurecalc id string sql mc get sql bar chart m goal get restrictions false m goal get measure display null m role get default logged in role prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next big decimal data rs get big decimal 1 timestamp date rs get timestamp 2 bar graph column bgc new bar graph column mc data bgc set label date m goal get measure display list add bgc rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null else if m measure measuretype achievements equals measure get measure type if m measure measuredatatype statusqtyamount equals measure get measure data type m achievement achievements m achievement get measure for int i 0 i achievements length i m achievement achievement achievements i bar graph column bgc new bar graph column achievement list add bgc else m measure measuredatatype qtyamountintime string measure display m goal get measure display string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display trunc d trunc trunc date doc trunc string buffer sql new string buffer select sum manual actual append trunc append from pa achievement where pa measure id and is achieved y append group by append trunc append order by append trunc prepared statement pstmt null try pstmt db prepare statement sql to string null pstmt set int 1 measure getpa measure id result set rs pstmt execute query while rs next big decimal data rs get big decimal 1 timestamp date rs get timestamp 2 bar graph column bgc new bar graph column m goal data bgc set label date m goal get measure display list add bgc rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null achievement in time achievement request else if m measure measuretype request equals measure get measure type m request type rt m request type get env get ctx measure getr requesttype id string sql rt get sql bar chart m goal get restrictions false m goal get measure display measure get measure data type null m role get default logged in role prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next big decimal data rs get big decimal 1 int r status id rs get int 3 bar graph column bgc new bar graph column rt data r status id if r status id 0 timestamp date rs get timestamp 2 bgc set label date m goal get measure display else m status status m status get env get ctx r status id bgc set label status get name list add bgc rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null request project else if m measure measuretype project equals measure get measure type m project type pt m project type get env get ctx measure getc projecttype id string sql pt get sql bar chart m goal get restrictions false m goal get measure display measure get measure data type null m role get default logged in role prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next big decimal data rs get big decimal 1 timestamp date rs get timestamp 2 int id rs get int 3 bar graph column bgc new bar graph column pt data id bgc set label date m goal get measure display list add bgc rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null project add last 20 int start value 0 if list size 20 start value list size 20 for int i start value i list size i add list get i loaddata arraylist bargraphcolumn arraylist bargraphcolumn mmeasure m_goal getmeasure m_goal mmeasure measuretype_calculated getmeasuretype mmeasurecalc mmeasurecalc getctx getpa_measurecalc_id getsqlbarchart m_goal getrestrictions m_goal getmeasuredisplay mrole getdefault preparedstatement preparestatement resultset executequery bigdecimal getbigdecimal gettimestamp bargraphcolumn bargraphcolumn setlabel m_goal getmeasuredisplay mmeasure measuretype_achievements getmeasuretype mmeasure measuredatatype_statusqtyamount getmeasuredatatype machievement machievement machievement bargraphcolumn bargraphcolumn mmeasure measuredatatype_qtyamountintime measuredisplay m_goal getmeasuredisplay mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay datedoc stringbuffer stringbuffer manualactual pa_achievement pa_measure_id isachieved preparedstatement preparestatement tostring setint getpa_measure_id resultset executequery bigdecimal getbigdecimal gettimestamp bargraphcolumn bargraphcolumn m_goal setlabel m_goal getmeasuredisplay tostring mmeasure measuretype_request getmeasuretype mrequesttype mrequesttype getctx getr_requesttype_id getsqlbarchart m_goal getrestrictions m_goal getmeasuredisplay getmeasuredatatype mrole getdefault preparedstatement preparestatement resultset executequery bigdecimal getbigdecimal r_status_id getint bargraphcolumn bargraphcolumn r_status_id r_status_id gettimestamp setlabel m_goal getmeasuredisplay mstatus mstatus getctx r_status_id setlabel getname mmeasure measuretype_project getmeasuretype mprojecttype mprojecttype getctx getc_projecttype_id getsqlbarchart m_goal getrestrictions m_goal getmeasuredisplay getmeasuredatatype mrole getdefault preparedstatement preparestatement resultset executequery bigdecimal getbigdecimal gettimestamp getint bargraphcolumn bargraphcolumn setlabel m_goal getmeasuredisplay startvalue startvalue startvalue get point 0 0 return point public point getpoint0 0 return m point0 0 0_0 getpoint0_0 m_point0_0 return returns the x axislabel public string getx axislabel return m x axislabel x_axislabel getx_axislabel m_x_axislabel param axis label the x axislabel to set public void setx axislabel string axis label m x axislabel axis label axislabel x_axislabel setx_axislabel axislabel m_x_axislabel axislabel return returns the y axislabel public string gety axislabel return m y axislabel y_axislabel gety_axislabel m_y_axislabel param axis label the y axislabel to set public void sety axislabel string axis label m y axislabel axis label axislabel y_axislabel sety_axislabel axislabel m_y_axislabel axislabel return returns the y targetlabel public string gety targetlabel return m y targetlabel y_targetlabel gety_targetlabel m_y_targetlabel param target label the y targetlabel to set public void sety targetlabel string target label double target m y targetlabel target label m y target target targetlabel y_targetlabel sety_targetlabel targetlabel m_y_targetlabel targetlabel m_y_target add column param column column public void add bar graph column column super add column column column add action listener this bargraphcolumn addactionlistener paint component param g graphics protected void paint component graphics g graphics2d g2d graphics2d g rectangle bounds get bounds background g2d set color color white dimension size get preferred size g2d fill3d rect 0 0 size width size height true font font get font font metrics fm g2d get font metrics font int font height fm get height int yaxis x m point0 0 x font height 10 int xaxis y m point0 0 y size height font height 10 paint x axis g2d set color color black g2d draw line yaxis x xaxis y size width 5 xaxis y g2d set font font g2d draw string m x axislabel yaxis x xaxis y font height paint y axis g2d draw line yaxis x 5 yaxis x xaxis y affine transform transform affine transform get rotate instance math pi 3 2 font font derive font transform g2d set font font g2d draw string m y axislabel yaxis x font height 10 xaxis y columns super paint component g2d paintcomponent getbounds setcolor getpreferredsize fill3drect getfont fontmetrics getfontmetrics fontheight getheight yaxis_x m_point0_0 fontheight xaxis_y m_point0_0 fontheight setcolor drawline yaxis_x xaxis_y xaxis_y setfont drawstring m_x_axislabel yaxis_x xaxis_y fontheight drawline yaxis_x yaxis_x xaxis_y affinetransform affinetransform getrotateinstance derivefont setfont drawstring m_y_axislabel yaxis_x fontheight xaxis_y paintcomponent action listener param e event public void action performed action event e if e get source instanceof bar graph column set cursor cursor get predefined cursor cursor wait cursor bar graph column bgc bar graph column e get source log info bgc get name m query query null if bgc get achievement null single achievement m achievement a bgc get achievement query m query get equal query pa measure id a getpa measure id else if bgc get goal null multiple achievements m goal goal bgc get goal query m query get equal query pa measure id goal getpa measure id else if bgc get measure calc null document m measure calc mc bgc get measure calc query mc get query m goal get restrictions false bgc get measure display bgc get date m role get default logged in role else if bgc get project type null document m project type pt bgc get project type query pt get query m goal get restrictions false bgc get measure display bgc get date bgc getid m role get default logged in role else if bgc get request type null document m request type rt bgc get request type query rt get query m goal get restrictions false bgc get measure display bgc get date bgc getid m role get default logged in role if query null a env zoom query else log warning nothing to zoom to bgc set cursor cursor get predefined cursor cursor wait cursor actionperformed actionevent getsource bargraphcolumn setcursor getpredefinedcursor wait_cursor bargraphcolumn bargraphcolumn getsource getname mquery getachievement machievement getachievement mquery getequalquery pa_measure_id getpa_measure_id getgoal mgoal getgoal mquery getequalquery pa_measure_id getpa_measure_id getmeasurecalc mmeasurecalc getmeasurecalc getquery m_goal getrestrictions getmeasuredisplay getdate mrole getdefault getprojecttype mprojecttype getprojecttype getquery m_goal getrestrictions getmeasuredisplay getdate mrole getdefault getrequesttype mrequesttype getrequesttype getquery m_goal getrestrictions getmeasuredisplay getdate mrole getdefault aenv setcursor getpredefinedcursor wait_cursor standard constructor public x ad userquery properties ctx int ad userquery id string trx name super ctx ad userquery id trx name if ad userquery id 0 setad table id 0 setad userquery id 0 set name null x_ad_userquery ad_userquery_id trxname ad_userquery_id trxname ad_userquery_id setad_table_id setad_userquery_id setname load constructor public x ad userquery properties ctx result set rs string trx name super ctx rs trx name x_ad_userquery resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad userquery append get id append return sb to string tostring stringbuffer stringbuffer x_ad_userquery get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set user query saved user query public void setad userquery id int ad userquery id if ad userquery id 1 throw new illegal argument exception ad userquery id is mandatory set valuenocheck ad userquery id new integer ad userquery id setad_userquery_id ad_userquery_id ad_userquery_id illegalargumentexception ad_userquery_id set_valuenocheck ad_userquery_id ad_userquery_id get user query saved user query public int getad userquery id integer ii integer get value ad userquery id if ii null return 0 return ii int value getad_userquery_id get_value ad_userquery_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set validation code validation code public void set code string code if code null code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode set_value get validation code validation code public string get code return string get value code getcode get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname convert an amount to base currency param ctx context param curfrom id the c currency id from param conv date conversion date if null use current date param c conversiontype id conversion rate type if 0 use default param amt amount to be converted param ad client id client param ad org id organization return converted amount public static big decimal convert base properties ctx big decimal amt int curfrom id timestamp conv date int c conversiontype id int ad client id int ad org id return convert ctx amt curfrom id m client get ctx getc currency id conv date c conversiontype id ad client id ad org id curfrom_id c_currency_id convdate c_conversiontype_id ad_client_id ad_org_id bigdecimal convertbase bigdecimal curfrom_id convdate c_conversiontype_id ad_client_id ad_org_id curfrom_id mclient getc_currency_id convdate c_conversiontype_id ad_client_id ad_org_id convert an amount with today s default rate param ctx context param curfrom id the c currency id from param curto id the c currency id to param amt amount to be converted param ad client id client param ad org id organization return converted amount public static big decimal convert properties ctx big decimal amt int curfrom id int curto id int ad client id int ad org id return convert ctx amt curfrom id curto id null 0 ad client id ad org id curfrom_id c_currency_id curto_id c_currency_id ad_client_id ad_org_id bigdecimal bigdecimal curfrom_id curto_id ad_client_id ad_org_id curfrom_id curto_id ad_client_id ad_org_id convert an amount param ctx context param curfrom id the c currency id from param curto id the c currency id to param conv date conversion date if null use current date param c conversiontype id conversion rate type if 0 use default param amt amount to be converted param ad client id client param ad org id organization return converted amount or null if no rate public static big decimal convert properties ctx big decimal amt int curfrom id int curto id timestamp conv date int c conversiontype id int ad client id int ad org id if amt null throw new illegal argument exception m conversion rate get converted amt required parameter missing amt if curfrom id curto id amt equals env zero return amt get rate big decimal ret value get rate curfrom id curto id conv date c conversiontype id ad client id ad org id if ret value null return null get amount in currency precision ret value ret value multiply amt int std precision m currency get std precision ctx curto id if ret value scale std precision ret value ret value set scale std precision big decimal round half up return ret value curfrom_id c_currency_id curto_id c_currency_id convdate c_conversiontype_id ad_client_id ad_org_id bigdecimal bigdecimal curfrom_id curto_id convdate c_conversiontype_id ad_client_id ad_org_id illegalargumentexception mconversionrate getconvertedamt curfrom_id curto_id bigdecimal retvalue getrate curfrom_id curto_id convdate c_conversiontype_id ad_client_id ad_org_id retvalue retvalue retvalue stdprecision mcurrency getstdprecision curto_id retvalue stdprecision retvalue retvalue setscale stdprecision bigdecimal round_half_up retvalue get currency conversion rate param curfrom id the c currency id from param curto id the c currency id to param conv date the conversion date if null use current date param conversiontype id conversion rate type if 0 use default param ad client id client param ad org id organization return currency rate or null public static big decimal get rate int curfrom id int curto id timestamp conv date int conversiontype id int ad client id int ad org id if curfrom id curto id return env one conversion type int c conversiontype id conversiontype id if c conversiontype id 0 c conversiontype id m conversion type get default ad client id conversion date if conv date null conv date new timestamp system current time millis get rate string sql select multiply rate from c conversion rate where c currency id 1 and c currency id to 2 and c conversiontype id 3 and between valid from and valid to 4 trunc ora 00932 inconsistent datatypes expected number got timestamp and ad client id in 0 5 and ad org id in 0 6 order by ad client id desc ad org id desc valid from desc big decimal ret value null prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 curfrom id pstmt set int 2 curto id pstmt set int 3 c conversiontype id pstmt set timestamp 4 conv date pstmt set int 5 ad client id pstmt set int 6 ad org id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e s log log level severe get rate e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log info get rate not found cur from curfrom id cur to curto id conv date type conversiontype id conversiontype id c conversiontype id c conversiontype id client ad client id org ad org id return ret value curfrom_id c_currency_id curto_id c_currency_id convdate conversiontype_id ad_client_id ad_org_id bigdecimal getrate curfrom_id curto_id convdate conversiontype_id ad_client_id ad_org_id curfrom_id curto_id c_conversiontype_id conversiontype_id c_conversiontype_id c_conversiontype_id mconversiontype getdefault ad_client_id convdate convdate currenttimemillis multiplyrate c_conversion_rate c_currency_id c_currency_id_to c_conversiontype_id validfrom validto ad_client_id ad_org_id ad_client_id ad_org_id validfrom bigdecimal retvalue preparedstatement preparestatement setint curfrom_id setint curto_id setint c_conversiontype_id settimestamp convdate setint ad_client_id setint ad_org_id resultset executequery retvalue getbigdecimal s_log getrate retvalue s_log getrate curfrom curfrom_id curto curto_id convdate conversiontype_id conversiontype_id c_conversiontype_id c_conversiontype_id ad_client_id ad_org_id retvalue standard constructor param ctx context param c conversion rate id id public m conversion rate properties ctx int c conversion rate id string trx name super ctx c conversion rate id trx name if c conversion rate id 0 setc conversion rate id 0 setc currency id 0 setc currency id to null super set divide rate env zero super set multiply rate env zero set valid from new timestamp system current time millis c_conversion_rate_id mconversionrate c_conversion_rate_id trxname c_conversion_rate_id trxname c_conversion_rate_id setc_conversion_rate_id setc_currency_id setc_currency_id_to setdividerate setmultiplyrate setvalidfrom currenttimemillis load constructor param ctx context param rs result set public m conversion rate properties ctx result set rs string trx name super ctx rs trx name mconversionrate resultset trxname trxname new constructor param po parent param c conversiontype id conversion type param c currency id currency param c currency id to currency to param multiply rate multiply rate param valid from valid from public m conversion rate po po int c conversiontype id int c currency id int c currency id to big decimal multiply rate timestamp valid from this po get ctx 0 po get trxname set client org po setc conversiontype id c conversiontype id setc currency id c currency id setc currency id to c currency id to set multiply rate multiply rate set valid from valid from c_conversiontype_id c_currency_id c_currency_id_to multiplyrate validfrom mconversionrate c_conversiontype_id c_currency_id c_currency_id_to bigdecimal multiplyrate validfrom getctx get_trxname setclientorg setc_conversiontype_id c_conversiontype_id setc_currency_id c_currency_id setc_currency_id_to c_currency_id_to setmultiplyrate multiplyrate setvalidfrom validfrom set multiply rate sets also divide rate param multiply rate multiply rate public void set multiply rate big decimal multiply rate if multiply rate null multiply rate compare to env zero 0 multiply rate compare to env one 0 super set divide rate env one super set multiply rate env one else super set multiply rate multiply rate double dd 1 multiply rate double value super set divide rate new big decimal dd multiplyrate setmultiplyrate bigdecimal multiplyrate multiplyrate multiplyrate compareto multiplyrate compareto setdividerate setmultiplyrate setmultiplyrate multiplyrate multiplyrate doublevalue setdividerate bigdecimal set divide rate sets also multiply rate param divide rate divide rate public void set divide rate big decimal divide rate if divide rate null divide rate compare to env zero 0 divide rate compare to env one 0 super set divide rate env one super set multiply rate env one else super set divide rate divide rate double dd 1 divide rate double value super set multiply rate new big decimal dd dividerate setdividerate bigdecimal dividerate dividerate dividerate compareto dividerate compareto setdividerate setmultiplyrate setdividerate dividerate dividerate doublevalue setmultiplyrate bigdecimal string representation return info public string to string string buffer sb new string buffer m conversion rate sb append get id append currency append getc currency id append to append getc currency id to append multiply append get multiply rate append divide append get divide rate append valid from append get valid from sb append return sb to string tostring stringbuffer stringbuffer mconversionrate get_id getc_currency_id getc_currency_id_to getmultiplyrate getdividerate validfrom getvalidfrom tostring before save same currency date range check set to date to 2056 param new record new return true if ok to save protected boolean before save boolean new record from to is the same if getc currency id getc currency id to log save error error msg parse translation get ctx c currency id c currency id return false nothing to convert if get multiply rate compare to env zero 0 log save error error msg parse translation get ctx multiply rate 0 return false date range check timestamp from get valid from if get valid to null set valid to time util get day 2056 1 29 no exchange rates after my 100th birthday timestamp to get valid to if to before from simple date format df display type get date format display type date log save error error df format to df format from return false return true newrecord beforesave newrecord getc_currency_id getc_currency_id_to saveerror parsetranslation getctx c_currency_id c_currency_id getmultiplyrate compareto saveerror parsetranslation getctx multiplyrate getvalidfrom getvalidto setvalidto timeutil getday getvalidto simpledateformat displaytype getdateformat displaytype saveerror string representation return info public string to string return remote new datavo test test table name sql tostring remotenewdatavo tablename standard constructor public x ad error properties ctx int ad error id string trx name super ctx ad error id trx name if ad error id 0 setad error id 0 set name null x_ad_error ad_error_id trxname ad_error_id trxname ad_error_id setad_error_id setname load constructor public x ad error properties ctx result set rs string trx name super ctx rs trx name x_ad_error resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad error append get id append return sb to string tostring stringbuffer stringbuffer x_ad_error get_id tostring set error public void setad error id int ad error id if ad error id 1 throw new illegal argument exception ad error id is mandatory set valuenocheck ad error id new integer ad error id setad_error_id ad_error_id ad_error_id illegalargumentexception ad_error_id set_valuenocheck ad_error_id ad_error_id get error public int getad error id integer ii integer get value ad error id if ii null return 0 return ii int value getad_error_id get_value ad_error_id intvalue public static final int ad language ad reference id 106 set language language for this entity public void setad language string ad language if ad language null ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set validation code validation code public void set code string code if code null code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode set_value get validation code validation code public string get code return string get value code getcode get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname initialize panel param window no window param frame frame public void init int window no form frame frame m windowno window no m frame frame log info win no m windowno ad client id m ad client id ad org id m ad org id by m by env set context env get ctx m windowno isso trx n try ui only vendor v lookup createb partner m windowno only product v lookup create product m windowno jb init dyn init frame get content pane add main panel border layout center frame get content pane add status bar border layout south new thread public void run log info starting m matchpo consolidate env get ctx log info done start catch exception e log log level severe e windowno windowno formframe m_windowno windowno m_frame winno m_windowno ad_client_id m_ad_client_id ad_org_id m_ad_org_id m_by setcontext getctx m_windowno issotrx onlyvendor vlookup createbpartner m_windowno onlyproduct vlookup createproduct m_windowno jbinit dyninit getcontentpane mainpanel borderlayout getcontentpane statusbar borderlayout mmatchpo getctx public void run log info starting m matchpo consolidate env get ctx log info done mmatchpo getctx static init pre main panel north panel center panel x matched x panel x mathed to south panel pre throws exception private void jb init throws exception main panel set layout main layout north panel set layout north layout match from label set text msg translate env get ctx match from match to label set text msg translate env get ctx match to match mode label set text msg translate env get ctx match mode only vendor label set text msg translate env get ctx c bpartner id only product label set text msg translate env get ctx m product id date from label set text msg translate env get ctx date from date to label set text msg translate env get ctx date to b search set text msg translate env get ctx search south panel set layout south layout x matched label set text msg translate env get ctx to be matched x matched to label set text msg translate env get ctx matching difference label set text msg translate env get ctx difference b process set text msg translate env get ctx process center panel set layout center layout x matched scroll pane set border x matched border x matched scroll pane set preferred size new dimension 450 200 x matched to scroll pane set border x matched to border x matched to scroll pane set preferred size new dimension 450 200 same product set selected true same product set text msg translate env get ctx same product sameb partner set selected true sameb partner set text msg translate env get ctx sameb partner same qty set selected false same qty set text msg translate env get ctx same qty x panel set layout x layout main panel add north panel border layout north north panel add match from label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 12 5 5 0 0 north panel add match from new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 0 0 0 north panel add match to label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 12 5 5 5 0 0 north panel add match to new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 12 0 5 0 0 0 north panel add match mode label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 north panel add match mode new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 north panel add only vendor new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 north panel add only product new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 north panel add only vendor label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 north panel add only product label new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add date from label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 5 0 0 north panel add date to label new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 0 5 5 0 0 north panel add date from new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 north panel add date to new grid bag constraints 3 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 0 0 5 0 0 0 north panel add b search new grid bag constraints 4 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 12 5 12 0 0 main panel add south panel border layout south south panel add x matched label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 12 5 5 0 0 south panel add x matched new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 south panel add x matched to label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 10 5 5 0 0 south panel add b process new grid bag constraints 6 0 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 12 5 12 0 0 south panel add difference label new grid bag constraints 4 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 10 5 5 0 0 main panel add center panel border layout center center panel add x matched scroll pane border layout north x matched scroll pane get viewport add x matched table null center panel add x matched to scroll pane border layout south center panel add x panel border layout center x panel add sameb partner null x panel add same product null x panel add same qty null x matched to scroll pane get viewport add x matched to table null south panel add difference new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 south panel add x matched to new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 0 5 0 0 0 mainpanel northpanel centerpanel xmatched xpanel xmathedto southpanel jbinit mainpanel setlayout mainlayout northpanel setlayout northlayout matchfromlabel settext getctx matchfrom matchtolabel settext getctx matchto matchmodelabel settext getctx matchmode onlyvendorlabel settext getctx c_bpartner_id onlyproductlabel settext getctx m_product_id datefromlabel settext getctx datefrom datetolabel settext getctx dateto bsearch settext getctx southpanel setlayout southlayout xmatchedlabel settext getctx tobematched xmatchedtolabel settext getctx differencelabel settext getctx bprocess settext getctx centerpanel setlayout centerlayout xmatchedscrollpane setborder xmatchedborder xmatchedscrollpane setpreferredsize xmatchedtoscrollpane setborder xmatchedtoborder xmatchedtoscrollpane setpreferredsize sameproduct setselected sameproduct settext getctx sameproduct samebpartner setselected samebpartner settext getctx samebpartner sameqty setselected sameqty settext getctx sameqty xpanel setlayout xlayout mainpanel northpanel borderlayout northpanel matchfromlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel matchfrom gridbagconstraints gridbagconstraints gridbagconstraints northpanel matchtolabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel matchto gridbagconstraints gridbagconstraints gridbagconstraints northpanel matchmodelabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel matchmode gridbagconstraints gridbagconstraints gridbagconstraints northpanel onlyvendor gridbagconstraints gridbagconstraints gridbagconstraints northpanel onlyproduct gridbagconstraints gridbagconstraints gridbagconstraints northpanel onlyvendorlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel onlyproductlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel datefromlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel datetolabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel datefrom gridbagconstraints gridbagconstraints gridbagconstraints northpanel dateto gridbagconstraints gridbagconstraints gridbagconstraints northpanel bsearch gridbagconstraints gridbagconstraints gridbagconstraints mainpanel southpanel borderlayout southpanel xmatchedlabel gridbagconstraints gridbagconstraints gridbagconstraints southpanel xmatched gridbagconstraints gridbagconstraints gridbagconstraints southpanel xmatchedtolabel gridbagconstraints gridbagconstraints gridbagconstraints southpanel bprocess gridbagconstraints gridbagconstraints gridbagconstraints southpanel differencelabel gridbagconstraints gridbagconstraints gridbagconstraints mainpanel centerpanel borderlayout centerpanel xmatchedscrollpane borderlayout xmatchedscrollpane getviewport xmatchedtable centerpanel xmatchedtoscrollpane borderlayout centerpanel xpanel borderlayout xpanel samebpartner xpanel sameproduct xpanel sameqty xmatchedtoscrollpane getviewport xmatchedtotable southpanel gridbagconstraints gridbagconstraints gridbagconstraints southpanel xmatchedto gridbagconstraints gridbagconstraints gridbagconstraints dynamic init table layout visual listener private void dyn init column info layout new column info new column info id column class false false new column info msg translate env get ctx document no string class 1 new column info msg translate env get ctx date timestamp class new column info msg translate env get ctx c bpartner id key name pair class 3 new column info msg translate env get ctx line key name pair class new column info msg translate env get ctx m product id key name pair class 5 new column info msg translate env get ctx qty double class new column info msg translate env get ctx matched double class x matched table prepare table layout false x matched to table prepare table layout true visual compiere color set background this listener match from add action listener this match to add action listener this b search add action listener this x matched table get selection model add list selection listener this x matched to table get model add table model listener this b process add action listener this sameb partner add action listener this same product add action listener this same qty add action listener this init cmd matchfrom status bar set status line status bar set statusdb 0 dyninit columninfo columninfo columninfo idcolumn columninfo getctx documentno columninfo getctx columninfo getctx c_bpartner_id keynamepair columninfo getctx keynamepair columninfo getctx m_product_id keynamepair columninfo getctx columninfo getctx xmatchedtable preparetable xmatchedtotable preparetable compierecolor setbackground matchfrom addactionlistener matchto addactionlistener bsearch addactionlistener xmatchedtable getselectionmodel addlistselectionlistener xmatchedtotable getmodel addtablemodellistener bprocess addactionlistener samebpartner addactionlistener sameproduct addactionlistener sameqty addactionlistener cmd_matchfrom statusbar setstatusline statusbar setstatusdb dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e set cursor cursor get predefined cursor cursor wait cursor if e get source match from cmd matchfrom else if e get source match to cmd matchto else if e get source b search cmd search else if e get source b process cmd process else if e get source sameb partner e get source same product e get source same qty cmd searchto set cursor cursor get default cursor actionperformed actionevent setcursor getpredefinedcursor wait_cursor getsource matchfrom cmd_matchfrom getsource matchto cmd_matchto getsource bsearch cmd_search getsource bprocess cmd_process getsource samebpartner getsource sameproduct getsource sameqty cmd_searchto setcursor getdefaultcursor match from changed fill match to private void cmd matchfrom log fine v match cmd matchfrom string selection string match from get selected item vector string vector new vector string 2 if selection equals m matchoptions match invoice vector add m matchoptions match shipment else if selection equals m matchoptions match order vector add m matchoptions match shipment else shipment vector add m matchoptions match invoice vector add m matchoptions match order match to set model new default combo box model vector set title x matched border set title selection x matched scroll pane repaint reset table x matched table set row count 0 sync to cmd matchto cmd_matchfrom vmatch cmd_matchfrom matchfrom getselecteditem m_matchoptions match_invoice m_matchoptions match_shipment m_matchoptions match_order m_matchoptions match_shipment m_matchoptions match_invoice m_matchoptions match_order matchto setmodel defaultcomboboxmodel xmatchedborder settitle xmatchedscrollpane xmatchedtable setrowcount cmd_matchto match to changed set title private void cmd matchto log fine v match cmd matchto string selection string match to get selected item x matched to border set title selection x matched to scroll pane repaint reset table x matched to table set row count 0 cmd_matchto vmatch cmd_matchto matchto getselecteditem xmatchedtoborder settitle xmatchedtoscrollpane xmatchedtotable setrowcount search button pressed fill x matched private void cmd search create sql int display match from get selected index string match to string string match to get selected item int match to type match invoice if match to string equals m matchoptions match shipment match to type match shipment else if match to string equals m matchoptions match order match to type match order table init display match to type sets m sql add where clause product if only product get value null integer product integer only product get value m sql append and lin m product id append product b partner if only vendor get value null integer vendor integer only vendor get value m sql append and hdr c bpartner id append vendor date timestamp from timestamp date from get value timestamp to timestamp date to get value if from null to null m sql append and append m datecolumn append between append db to date from append and append db to date to else if from null m sql append and append m datecolumn append append db to date from else if to null m sql append and append m datecolumn append append db to date to load table table load x matched table x matched set value env zero status info status bar set status line match from get selected item to string x matched table get row count x matched table get row count 0 status bar set statusdb 0 xmatched cmd_search matchfrom getselectedindex matchtostring matchto getselecteditem matchtotype match_invoice matchtostring m_matchoptions match_shipment matchtotype match_shipment matchtostring m_matchoptions match_order matchtotype match_order tableinit matchtotype m_sql onlyproduct getvalue onlyproduct getvalue m_sql m_product_id bpartner onlyvendor getvalue onlyvendor getvalue m_sql c_bpartner_id datefrom getvalue dateto getvalue m_sql m_datecolumn to_date to_date m_sql m_datecolumn to_date m_sql m_datecolumn to_date tableload xmatchedtable xmatched setvalue statusbar setstatusline matchfrom getselecteditem tostring xmatchedtable getrowcount xmatchedtable getrowcount statusbar setstatusdb process button pressed process matching private void cmd process log config matched from int matched row x matched table get selected row if matched row 0 return key name pair b partner key name pair x matched table get value at matched row i bpartner key name pair line matched key name pair x matched table get value at matched row i line key name pair product key name pair x matched table get value at matched row i product int m product id product get key double total qty m xmatched double value matched to for int row 0 row x matched to table get row count row id column id id column x matched to table get value at row 0 if id null id is selected need to be the same product key name pair product compare key name pair x matched to table get value at row i product if product get key product compare get key continue key name pair line matched to key name pair x matched to table get value at row i line qty double qty 0 0 if match mode get selected index mode notmatched qty double x matched to table get value at row i qty double value doc qty double x matched to table get value at row i matched double value matched if qty total qty qty total qty total qty qty invoice or po boolean invoice true if match from get selected index match order match to get selected item equals m matchoptions match order invoice false get shipment id int m inoutline id 0 int line id 0 if match from get selected index match shipment m inoutline id line matched get key upper table line id line matched to get key else m inoutline id line matched to get key lower table line id line matched get key create it create match record invoice m inoutline id line id new big decimal qty requery cmd search cmd_process matchedrow xmatchedtable getselectedrow matchedrow keynamepair bpartner keynamepair xmatchedtable getvalueat matchedrow i_bpartner keynamepair linematched keynamepair xmatchedtable getvalueat matchedrow i_line keynamepair keynamepair xmatchedtable getvalueat matchedrow i_product m_product_id getkey totalqty m_xmatched doublevalue xmatchedtotable getrowcount idcolumn idcolumn xmatchedtotable getvalueat isselected keynamepair productcompare keynamepair xmatchedtotable getvalueat i_product getkey productcompare getkey keynamepair linematchedto keynamepair xmatchedtotable getvalueat i_line matchmode getselectedindex mode_notmatched xmatchedtotable getvalueat i_qty doublevalue xmatchedtotable getvalueat i_matched doublevalue totalqty totalqty totalqty matchfrom getselectedindex match_order matchto getselecteditem m_matchoptions match_order shipment_id m_inoutline_id line_id matchfrom getselectedindex match_shipment m_inoutline_id linematched getkey line_id linematchedto getkey m_inoutline_id linematchedto getkey line_id linematched getkey creatematchrecord m_inoutline_id line_id bigdecimal cmd_search list selection listener get info and fill x matched to param e event public void value changed list selection event e if e get value is adjusting return log config v match value changed set cursor cursor get predefined cursor cursor wait cursor cmd searchto set cursor cursor get default cursor xmatchedto valuechanged listselectionevent getvalueisadjusting vmatch valuechanged setcursor getpredefinedcursor wait_cursor cmd_searchto setcursor getdefaultcursor fill x matched to private void cmd searchto int row x matched table get selected row log config row row double qty 0 0 if row 0 x matched to table set row count 0 else create sql string display string string match to get selected item int display match invoice if display string equals m matchoptions match shipment display match shipment else if display string equals m matchoptions match order display match order int match to type match from get selected index table init display match to type sets m sql add where clause key name pair b partner key name pair x matched table get value at row i bpartner key name pair product key name pair x matched table get value at row i product log fine b partner b partner product product if sameb partner is selected m sql append and hdr c bpartner id append b partner get key if same product is selected m sql append and lin m product id append product get key calculate qty double doc qty double x matched table get value at row i qty double value double matched qty double x matched table get value at row i matched double value qty doc qty matched qty if same qty is selected m sql append and append m qtycolumn append append doc qty load table table load x matched to table display to be matched qty m xmatched new big decimal qty x matched set value m xmatched x matched to set value env zero difference set value m xmatched status info status bar set status line match from get selected item to string x matched table get row count match to get selected item to string x matched to table get row count x matched to table get row count 0 status bar set statusdb 0 xmatchedto cmd_searchto xmatchedtable getselectedrow xmatchedtotable setrowcount displaystring matchto getselecteditem match_invoice displaystring m_matchoptions match_shipment match_shipment displaystring m_matchoptions match_order match_order matchtotype matchfrom getselectedindex tableinit matchtotype m_sql keynamepair bpartner keynamepair xmatchedtable getvalueat i_bpartner keynamepair keynamepair xmatchedtable getvalueat i_product bpartner bpartner samebpartner isselected m_sql c_bpartner_id bpartner getkey sameproduct isselected m_sql m_product_id getkey docqty xmatchedtable getvalueat i_qty doublevalue matchedqty xmatchedtable getvalueat i_matched doublevalue docqty matchedqty sameqty isselected m_sql m_qtycolumn docqty tableload xmatchedtotable m_xmatched bigdecimal xmatched setvalue m_xmatched xmatchedto setvalue setvalue m_xmatched statusbar setstatusline matchfrom getselecteditem tostring xmatchedtable getrowcount matchto getselecteditem tostring xmatchedtotable getrowcount xmatchedtotable getrowcount statusbar setstatusdb table model listener calculate matchd qty param e event public void table changed table model event e if e get column 0 return log config row e get first row e get last row col e get column type e get type set cursor cursor get predefined cursor cursor wait cursor matched from int matched row x matched table get selected row key name pair product key name pair x matched table get value at matched row 5 matched to double qty 0 0 int no rows 0 for int row 0 row x matched to table get row count row id column id id column x matched to table get value at row 0 if id null id is selected key name pair product compare key name pair x matched to table get value at row 5 if product get key product compare get key id set selected false else if match mode get selected index mode notmatched qty double x matched to table get value at row i qty double value doc qty double x matched to table get value at row i matched double value matched no rows update qualtities m xmatchedto new big decimal qty x matched to set value m xmatchedto difference set value m xmatched subtract m xmatchedto b process set enabled no rows 0 set cursor cursor get default cursor status status bar set statusdb no rows tablechanged tablemodelevent getcolumn getfirstrow getlastrow getcolumn gettype setcursor getpredefinedcursor wait_cursor matchedrow xmatchedtable getselectedrow keynamepair keynamepair xmatchedtable getvalueat matchedrow norows xmatchedtotable getrowcount idcolumn idcolumn xmatchedtotable getvalueat isselected keynamepair productcompare keynamepair xmatchedtotable getvalueat getkey productcompare getkey setselected matchmode getselectedindex mode_notmatched xmatchedtotable getvalueat i_qty doublevalue xmatchedtotable getvalueat i_matched doublevalue norows m_xmatchedto bigdecimal xmatchedto setvalue m_xmatchedto setvalue m_xmatched m_xmatchedto bprocess setenabled norows setcursor getdefaultcursor statusbar setstatusdb norows initialise table access create sql date column br the driving table is hdr e g for hdr c bpartner id the line table is lin e g for lin m product id you use the date column qty column variable directly as it is table specific br the sql is dependent on match mode if matched all fully or partially matched records are listed if not matched all not fully matched records are listed param display invoice shipment order see match param match to type invoice shipment order see match private void table init int display int match to type boolean matched match mode get selected index mode matched log config display m matchoptions display match to m matchoptions match to type matched matched m sql new string buffer if display match invoice m datecolumn hdr date invoiced m qtycolumn lin qty invoiced m sql append select hdr c invoice id hdr document no hdr date invoiced bp name hdr c bpartner id lin line lin c invoiceline id p name lin m product id lin qty invoiced sum nvl mi qty 0 from c invoice hdr inner join c bpartner bp on hdr c bpartner id bp c bpartner id inner join c invoiceline lin on hdr c invoice id lin c invoice id inner join m product p on lin m product id p m product id inner join c doctype dt on hdr c doctype id dt c doctype id and dt doc base type in api apc full join m matchinv mi on lin c invoiceline id mi c invoiceline id where hdr doc status in co cl m groupby group by hdr c invoice id hdr document no hdr date invoiced bp name hdr c bpartner id lin line lin c invoiceline id p name lin m product id lin qty invoiced having matched 0 lin qty invoiced sum nvl mi qty 0 else if display match order m datecolumn hdr date ordered m qtycolumn lin qty ordered m sql append select hdr c order id hdr document no hdr date ordered bp name hdr c bpartner id lin line lin c orderline id p name lin m product id lin qty ordered sum coalesce mo qty 0 from c order hdr inner join c bpartner bp on hdr c bpartner id bp c bpartner id inner join c orderline lin on hdr c order id lin c order id inner join m product p on lin m product id p m product id inner join c doctype dt on hdr c doctype id dt c doctype id and dt doc base type poo full join m matchpo mo on lin c orderline id mo c orderline id where mo append match to type match shipment m inoutline id c invoiceline id append matched is not null is null and hdr doc status in co cl m groupby group by hdr c order id hdr document no hdr date ordered bp name hdr c bpartner id lin line lin c orderline id p name lin m product id lin qty ordered having matched 0 lin qty ordered sum coalesce mo qty 0 else shipment m datecolumn hdr movement date m qtycolumn lin movement qty m sql append select hdr m inout id hdr document no hdr movement date bp name hdr c bpartner id lin line lin m inoutline id p name lin m product id lin movement qty sum nvl m qty 0 from m inout hdr inner join c bpartner bp on hdr c bpartner id bp c bpartner id inner join m inoutline lin on hdr m inout id lin m inout id inner join m product p on lin m product id p m product id inner join c doctype dt on hdr c doctype id dt c doctype id and dt doc base type mmr full join append match to type match order m matchpo m matchinv append m on lin m inoutline id m m inoutline id where hdr doc status in co cl m groupby group by hdr m inout id hdr document no hdr movement date bp name hdr c bpartner id lin line lin m inoutline id p name lin m product id lin movement qty having matched 0 lin movement qty sum nvl m qty 0 log trace 7 v match table init m sql n m groupby datecolumn c_bpartner_id m_product_id datecolumn qtycolumn matchmode match_ matchtotype match_ tableinit matchtotype matchmode getselectedindex mode_matched m_matchoptions matchto m_matchoptions matchtotype m_sql stringbuffer match_invoice m_datecolumn dateinvoiced m_qtycolumn qtyinvoiced m_sql c_invoice_id documentno dateinvoiced c_bpartner_id c_invoiceline_id m_product_id qtyinvoiced c_invoice c_bpartner c_bpartner_id c_bpartner_id c_invoiceline c_invoice_id c_invoice_id m_product m_product_id m_product_id c_doctype c_doctype_id c_doctype_id docbasetype m_matchinv c_invoiceline_id c_invoiceline_id docstatus m_groupby c_invoice_id documentno dateinvoiced c_bpartner_id c_invoiceline_id m_product_id qtyinvoiced qtyinvoiced match_order m_datecolumn dateordered m_qtycolumn qtyordered m_sql c_order_id documentno dateordered c_bpartner_id c_orderline_id m_product_id qtyordered c_order c_bpartner c_bpartner_id c_bpartner_id c_orderline c_order_id c_order_id m_product m_product_id m_product_id c_doctype c_doctype_id c_doctype_id docbasetype m_matchpo c_orderline_id c_orderline_id matchtotype match_shipment m_inoutline_id c_invoiceline_id docstatus m_groupby c_order_id documentno dateordered c_bpartner_id c_orderline_id m_product_id qtyordered qtyordered m_datecolumn movementdate m_qtycolumn movementqty m_sql m_inout_id documentno movementdate c_bpartner_id m_inoutline_id m_product_id movementqty m_inout c_bpartner c_bpartner_id c_bpartner_id m_inoutline m_inout_id m_inout_id m_product m_product_id m_product_id c_doctype c_doctype_id c_doctype_id docbasetype matchtotype match_order m_matchpo m_matchinv m_inoutline_id m_inoutline_id docstatus m_groupby m_inout_id documentno movementdate c_bpartner_id m_inoutline_id m_product_id movementqty movementqty vmatch tableinit m_sql m_groupby fill the table using m sql param table table private void table load mini table table log finest m sql m groupby string sql m role get default add accesssql m sql to string hdr m role sql fullyqualified m role sql ro m groupby log finest sql try statement stmt db create statement result set rs stmt execute query sql table load table rs stmt close catch sql exception e log log level severe sql e m_sql tableload minitable m_sql m_groupby mrole getdefault addaccesssql m_sql tostring mrole sql_fullyqualified mrole sql_ro m_groupby createstatement resultset executequery loadtable sqlexception create matching record param invoice true if matching invoice false if matching po param m inoutline id shipment line param line id c invoiceline id or c orderline id param qty quantity return true if created private boolean create match record boolean invoice int m inoutline id int line id big decimal qty if qty compare to env zero 0 return true log fine is invoice invoice m inoutline id m inoutline id line id line id qty qty boolean success false m in out line s line new m in out line env get ctx m inoutline id null if invoice shipment invoice update invoice line m invoice line i line new m invoice line env get ctx line id null i line setm inoutline id m inoutline id if s line getc orderline id 0 i line setc orderline id s line getc orderline id i line save create shipment invoice link if i line getm product id 0 m match inv match new m match inv i line null qty match setm inoutline id m inoutline id if match save success true else log log level severe inv match not created match else success true create po invoice link corrects po if i line getc orderline id 0 i line getm product id 0 m matchpo matchpo m matchpo create i line s line null qty matchpo setc invoiceline id i line matchpo setm inoutline id m inoutline id if matchpo save log log level severe po inv match not created matchpo else shipment order update shipment line s line setc orderline id line id s line save update order line m order line o line new m order line env get ctx line id null if o line get id 0 other in m in out complete it o line set qty reserved o line get qty reserved subtract qty if o line save log severe qty reserved not updated c orderline id line id create po shipment link if s line getm product id 0 m matchpo match new m matchpo s line null qty if match save log log level severe po match not created match else success true correct ordered qty for stocked products see m order reserve stock m in out process it if s line get product null s line get product is stocked success m storage add env get ctx s line getm warehouse id s line getm locator id s line getm product id s line getm attributesetinstance id o line getm attributesetinstance id null null qty negate null else success true return success m_inoutline_id line_id c_invoiceline_id c_orderline_id creatematchrecord m_inoutline_id line_id bigdecimal compareto isinvoice m_inoutline_id m_inoutline_id line_id line_id minoutline sline minoutline getctx m_inoutline_id minvoiceline iline minvoiceline getctx line_id iline setm_inoutline_id m_inoutline_id sline getc_orderline_id iline setc_orderline_id sline getc_orderline_id iline iline getm_product_id mmatchinv mmatchinv iline setm_inoutline_id m_inoutline_id iline getc_orderline_id iline getm_product_id mmatchpo mmatchpo iline sline setc_invoiceline_id iline setm_inoutline_id m_inoutline_id sline setc_orderline_id line_id sline morderline oline morderline getctx line_id oline get_id minout completeit oline setqtyreserved oline getqtyreserved oline qtyreserved c_orderline_id line_id sline getm_product_id mmatchpo mmatchpo sline morder reservestock minout processit sline getproduct sline getproduct isstocked mstorage getctx sline getm_warehouse_id sline getm_locator_id sline getm_product_id sline getm_attributesetinstance_id oline getm_attributesetinstance_id detail protected contructor param frame parent frame param modal modal param window no window no param value query value param multi selection multiple selections param where clause whwre clause protected info cash line frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no cl c cashline id multi selection where clause log info info cash line set title msg get msg env get ctx info cash line try stat init p loadedok init info catch exception e return int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if value null value length 0 f name set value value execute query pack focus f name request focus windowno multiselection whereclause infocashline windowno multiselection whereclause windowno c_cashline_id multiselection whereclause infocashline settitle getmsg getctx infocashline statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring fname setvalue executequery fname requestfocus static setup add fields to parameter panel throws exception if lookups cannot be created private void stat init throws exception l name set label for f name f name set background compiereplaf get info background f name add action listener this forg id new v lookup ad org id false false true m lookup factory create env get ctx 3486 m windowno display type table dir false display type table dir m windowno lorg id set label for forg id forg id set background compiereplaf get info background 5249 c cash c cashbook id fcashbook id new v lookup c cashbook id false false true m lookup factory get env get ctx p windowno 0 5249 display type table dir lcashbook id set label for fcashbook id fcashbook id set background compiereplaf get info background 5354 c cashline c invoice id finvoice id new v lookup c invoice id false false true m lookup factory get env get ctx p windowno 0 5354 display type search linvoice id set label for finvoice id finvoice id set background compiereplaf get info background 5295 c cashline c bankaccount id fbankaccount id new v lookup c bankaccount id false false true m lookup factory get env get ctx p windowno 0 5295 display type table dir lbankaccount id set label for fbankaccount id fbankaccount id set background compiereplaf get info background 5296 c cashline c charge id 5291 c cashline c cash id l date from set label for f date from f date from set background compiereplaf get info background f date from set tool tip text msg translate env get ctx date from l date to set label for f date to f date to set background compiereplaf get info background f date to set tool tip text msg translate env get ctx date to l amt from set label for f amt from f amt from set background compiereplaf get info background f amt from set tool tip text msg translate env get ctx amt from l amt to set label for f amt to f amt to set background compiereplaf get info background f amt to set tool tip text msg translate env get ctx amt to parameter panel set layout new a layout first row parameter panel add lcashbook id new a layout constraint 0 0 parameter panel add fcashbook id null parameter panel add l name null parameter panel add f name null parameter panel add cb absolute new a layout constraint 0 5 2nd row parameter panel add linvoice id new a layout constraint 1 0 parameter panel add finvoice id null parameter panel add l date from null parameter panel add f date from null parameter panel add l date to null parameter panel add f date to null 3rd row parameter panel add lbankaccount id new a layout constraint 2 0 parameter panel add fbankaccount id null parameter panel add l amt from null parameter panel add f amt from null parameter panel add l amt to null parameter panel add f amt to null parameter panel add lorg id null parameter panel add forg id null parameterpanel statinit lname setlabelfor fname fname setbackground getinfobackground fname addactionlistener forg_id vlookup ad_org_id mlookupfactory getctx m_windowno displaytype tabledir displaytype tabledir m_windowno lorg_id setlabelfor forg_id forg_id setbackground getinfobackground c_cash c_cashbook_id fcashbook_id vlookup c_cashbook_id mlookupfactory getctx p_windowno displaytype tabledir lcashbook_id setlabelfor fcashbook_id fcashbook_id setbackground getinfobackground c_cashline c_invoice_id finvoice_id vlookup c_invoice_id mlookupfactory getctx p_windowno displaytype linvoice_id setlabelfor finvoice_id finvoice_id setbackground getinfobackground c_cashline c_bankaccount_id fbankaccount_id vlookup c_bankaccount_id mlookupfactory getctx p_windowno displaytype tabledir lbankaccount_id setlabelfor fbankaccount_id fbankaccount_id setbackground getinfobackground c_cashline c_charge_id c_cashline c_cash_id ldatefrom setlabelfor fdatefrom fdatefrom setbackground getinfobackground fdatefrom settooltiptext getctx datefrom ldateto setlabelfor fdateto fdateto setbackground getinfobackground fdateto settooltiptext getctx dateto lamtfrom setlabelfor famtfrom famtfrom setbackground getinfobackground famtfrom settooltiptext getctx amtfrom lamtto setlabelfor famtto famtto setbackground getinfobackground famtto settooltiptext getctx amtto parameterpanel setlayout alayout parameterpanel lcashbook_id alayoutconstraint parameterpanel fcashbook_id parameterpanel lname parameterpanel fname parameterpanel cbabsolute alayoutconstraint parameterpanel linvoice_id alayoutconstraint parameterpanel finvoice_id parameterpanel ldatefrom parameterpanel fdatefrom parameterpanel ldateto parameterpanel fdateto parameterpanel lbankaccount_id alayoutconstraint parameterpanel fbankaccount_id parameterpanel lamtfrom parameterpanel famtfrom parameterpanel lamtto parameterpanel famtto parameterpanel lorg_id parameterpanel forg_id general init return true if success private boolean init info prepare table string buffer where new string buffer cl is active y if p whereclause length 0 where append and append util replace p whereclause c cashline cl prepare table s cashlayout c cashline cl inner join c cash c on cl c cash id c c cash id where to string 2 3 cl line return true initinfo stringbuffer stringbuffer isactive p_whereclause p_whereclause c_cashline preparetable s_cashlayout c_cashline c_cash c_cash_id c_cash_id tostring construct sql where clause and define parameters set parameters needs to set parameters includes first and return sql where clause string getsql where string buffer sql new string buffer if f name get text length 0 sql append and upper c name like if fcashbook id get value null sql append and c c cashbook id if finvoice id get value null sql append and cl c invoice id if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value if from null to null sql append and trunc c statement date else if from null to null sql append and trunc c statement date else if from null to null sql append and trunc c statement date between and if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value if cb absolute is selected sql append and abs cl amount else sql append and cl amount if from null to null sql append else if from null to null sql append else if from null to null if from compare to to 0 sql append else sql append between and log fine sql to string return sql to string setparameters getsqlwhere stringbuffer stringbuffer fname gettext fcashbook_id getvalue c_cashbook_id finvoice_id getvalue c_invoice_id fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue statementdate statementdate statementdate famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue cbabsolute isselected compareto tostring tostring set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 if f name get text length 0 pstmt set string index getsql text f name if fcashbook id get value null integer cb integer fcashbook id get value pstmt set int index cb int value log fine cash book cb if finvoice id get value null integer i integer finvoice id get value pstmt set int index i int value log fine invoice i if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value log fine date from from to to if from null to null pstmt set timestamp index to else if from null to null pstmt set timestamp index from else if from null to null pstmt set timestamp index from pstmt set timestamp index to if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value if cb absolute is selected if from null from from abs if to null to to abs log fine amt from from to to absolute cb absolute is selected if from null to null pstmt set big decimal index to else if from null to null pstmt set big decimal index from else if from null to null if from compare to to 0 pstmt set big decimal index from else pstmt set big decimal index from pstmt set big decimal index to getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fname gettext setstring getsqltext fname fcashbook_id getvalue fcashbook_id getvalue setint intvalue cashbook finvoice_id getvalue finvoice_id getvalue setint intvalue fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue settimestamp settimestamp settimestamp settimestamp famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue cbabsolute isselected cbabsolute isselected setbigdecimal setbigdecimal compareto setbigdecimal setbigdecimal setbigdecimal get sql where parameter param f field return upper case text with at the end private string getsql text c text field f string s f get text to upper case if s ends with s log fine string s return s getsqltext ctextfield gettext touppercase endswith compiere cache expires after 2 hours param name name of the cache param initial capacity initial capacity public c cache string name int initial capacity this name initial capacity 120 initialcapacity ccache initialcapacity initialcapacity compiere cache param name table name of the cache param initial capacity initial capacity param expire minutes expire after minutes 0 no expire public c cache string name int initial capacity int expire minutes super initial capacity m name name set expire minutes expire minutes cache mgt get register this initialcapacity expireminutes ccache initialcapacity expireminutes initialcapacity m_name setexpireminutes expireminutes cachemgt get table name return name public string get name return m name getname m_name set expire minutes and start it param expire minutes minutes or 0 public void set expire minutes int expire minutes if expire minutes 0 m expire expire minutes long addms 60000l m expire m timeexp system current time millis addms else m expire 0 m timeexp 0 expireminutes setexpireminutes expireminutes expireminutes m_expire expireminutes m_expire m_timeexp currenttimemillis m_expire m_timeexp get expire minutes return expire minutes public int get expire minutes return m expire getexpireminutes m_expire cache was reset return true if reset public boolean is reset return m justreset isreset m_justreset resets the reset flag public void set used m justreset false setused m_justreset reset cache return number of items cleared see org compiere util cache interface reset public int reset int no super size clear return no cacheinterface expire cache if enabled private void expire if m expire 0 m timeexp system current time millis system out println expired get name reset m_expire m_timeexp currenttimemillis getname string representation return info public string to string return c cache m name exp get expire minutes super size tostring ccache m_name getexpireminutes clear cache and calculate new expiry time see java util map clear public void clear if m changesupport null try m changesupport fire vetoable change propertyname super size 0 catch exception e system out println c cache clear e return clear super clear if m expire 0 long addms 60000l m expire m timeexp system current time millis addms m justreset true m_changesupport m_changesupport firevetoablechange ccache m_expire m_expire m_timeexp currenttimemillis m_justreset see java util map contains key java lang object public boolean contains key object key expire return super contains key key containskey containskey containskey see java util map contains value java lang object public boolean contains value object value expire return super contains value value containsvalue containsvalue containsvalue see java util map entry set public set map entry k v entry set expire return super entry set entryset entryset entryset see java util map get java lang object public v get object key expire return super get key put value param key key param value value return previous value public v put k key v value expire m justreset false return super put key value m_justreset put all param m map public void put all map extends k extends v m expire m justreset false super put all m putall m_justreset putall see java util map is empty public boolean is empty expire return super is empty isempty isempty isempty see java util map key set public set k key set expire return super key set keyset keyset keyset see java util map size public int size expire return super size get size w o expire see java util map size public int size no expire return super size sizenoexpire see java util map values public collection v values expire return super values add vetoable change listener param listener listner public void add vetoable change listener vetoable change listener listener if m changesupport null m changesupport new vetoable change support this if listener null m changesupport add vetoable change listener listener addvetoablechangelistener vetoablechangelistener m_changesupport m_changesupport vetoablechangesupport m_changesupport addvetoablechangelistener remove vetoable change listener param listener listener public void remove vetoable change listener vetoable change listener listener if m changesupport null listener null m changesupport remove vetoable change listener listener removevetoablechangelistener vetoablechangelistener m_changesupport m_changesupport removevetoablechangelistener just an example the string in the callout field is code com compiere custom callout engine just an example code param ctx context param window no current window no param m tab model tab param m field model field param value the new value param old value the old value return error message or if ok public string just an example properties ctx int window no m tab m tab m field m field object value object old value log info just an example return justanexample calloutengine justanexample windowno mtab mfield oldvalue justanexample windowno mtab mtab mfield mfield oldvalue justanexample frie value convert to standardized name param value name return name public string frie name string value if value null value length 0 return string ret value value string sql select frie name from dual try prepared statement pstmt db prepare statement sql null pstmt set string 1 value result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value frie_name retvalue frie_name preparedstatement preparestatement setstring resultset executequery retvalue getstring sqlexception retvalue frie value convert name to value param value name return value of name public string frie value string value if value null value length 0 return string ret value value string sql select frie value frie name from dual try prepared statement pstmt db prepare statement sql null pstmt set string 1 value result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value frie_value retvalue frie_value frie_name preparedstatement preparestatement setstring resultset executequery retvalue getstring sqlexception retvalue frie status convert to status param value value return status public string frie status string value string ret value n default if value null value equals a auslaufartikel ret value y return ret value frie_status retvalue retvalue retvalue standard constructor public x ad user substitute properties ctx int ad user substitute id string trx name super ctx ad user substitute id trx name if ad user substitute id 0 setad user id 0 setad user substitute id 0 set name null setsubstitute id 0 x_ad_user_substitute ad_user_substitute_id trxname ad_user_substitute_id trxname ad_user_substitute_id setad_user_id setad_user_substitute_id setname setsubstitute_id load constructor public x ad user substitute properties ctx result set rs string trx name super ctx rs trx name x_ad_user_substitute resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad user substitute append get id append return sb to string tostring stringbuffer stringbuffer x_ad_user_substitute get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set user substitute substitute of the user public void setad user substitute id int ad user substitute id if ad user substitute id 1 throw new illegal argument exception ad user substitute id is mandatory set valuenocheck ad user substitute id new integer ad user substitute id setad_user_substitute_id ad_user_substitute_id ad_user_substitute_id illegalargumentexception ad_user_substitute_id set_valuenocheck ad_user_substitute_id ad_user_substitute_id get user substitute substitute of the user public int getad user substitute id integer ii integer get value ad user substitute id if ii null return 0 return ii int value getad_user_substitute_id get_value ad_user_substitute_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int substitute id ad reference id 110 set substitute entity which can be used in place of this entity public void setsubstitute id int substitute id if substitute id 1 throw new illegal argument exception substitute id is mandatory set value substitute id new integer substitute id substitute_id_ad_reference_id setsubstitute_id substitute_id substitute_id illegalargumentexception substitute_id set_value substitute_id substitute_id get substitute entity which can be used in place of this entity public int getsubstitute id integer ii integer get value substitute id if ii null return 0 return ii int value getsubstitute_id get_value substitute_id intvalue set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto standard constructor param ctx context param ad note id id public m note properties ctx int ad note id string trx name super ctx ad note id trx name if ad note id 0 set processed false set processing false ad_note_id mnote ad_note_id trxname ad_note_id trxname ad_note_id setprocessed setprocessing load constructor param ctx context param rs result set public m note properties ctx result set rs string trx name super ctx rs trx name mnote resultset trxname trxname new mandatory constructor param ctx context param ad message id message param ad user id targeted user public m note properties ctx int ad message id int ad user id string trx name this ctx 0 trx name setad message id ad message id setad user id ad user id ad_message_id ad_user_id mnote ad_message_id ad_user_id trxname trxname setad_message_id ad_message_id setad_user_id ad_user_id new mandatory constructor param ctx context param ad messagevalue message param ad user id targeted user public m note properties ctx string ad messagevalue int ad user id string trx name this ctx m message getad message id ctx ad messagevalue ad user id trx name ad_messagevalue ad_user_id mnote ad_messagevalue ad_user_id trxname mmessage getad_message_id ad_messagevalue ad_user_id trxname create note param ctx context param ad message id message param ad user id user param ad table id table param record id record param text msg text message param reference reference public m note properties ctx int ad message id int ad user id int ad table id int record id string reference string text msg string trx name this ctx ad message id ad user id trx name set record ad table id record id set reference reference set text msg text msg ad_message_id ad_user_id ad_table_id record_id textmsg mnote ad_message_id ad_user_id ad_table_id record_id textmsg trxname ad_message_id ad_user_id trxname setrecord ad_table_id record_id setreference settextmsg textmsg new constructor param ctx context param ad messagevalue message param ad user id targeted user param ad client id client param ad org id org public m note properties ctx string ad messagevalue int ad user id int ad client id int ad org id string trx name this ctx m message getad message id ctx ad messagevalue ad user id trx name set client org ad client id ad org id ad_messagevalue ad_user_id ad_client_id ad_org_id mnote ad_messagevalue ad_user_id ad_client_id ad_org_id trxname mmessage getad_message_id ad_messagevalue ad_user_id trxname setclientorg ad_client_id ad_org_id set record ss button and defaults to string param ad message ad message public void setad message id string ad message int ad message id db getsql value null select ad message id from ad message where value ad message if ad message id 1 super setad message id ad message id else super setad message id 240 error log log level severe setad message id id not found for ad message ad_message ad_message setad_message_id ad_message ad_message_id getsqlvalue ad_message_id ad_message ad_message ad_message_id setad_message_id ad_message_id setad_message_id setad_message_id ad_message set ad message id looks up no message found if 0 param ad message id id public void setad message id int ad message id if ad message id 0 super setad message id m message getad message id get ctx no message found else super setad message id ad message id ad_message_id ad_message_id setad_message_id ad_message_id ad_message_id setad_message_id mmessage getad_message_id getctx nomessagefound setad_message_id ad_message_id get message return message public string get message int ad message id getad message id m message msg m message get get ctx ad message id return msg get msg text getmessage ad_message_id getad_message_id mmessage mmessage getctx ad_message_id getmsgtext set record param ad table id table param record id record public void set record int ad table id int record id setad table id ad table id setrecord id record id ad_table_id record_id setrecord ad_table_id record_id setad_table_id ad_table_id setrecord_id record_id string representation return info public string to string string buffer sb new string buffer m note append get id append ad message id append getad message id append append get reference append processed append is processed append return sb to string tostring stringbuffer stringbuffer mnote get_id ad_message_id getad_message_id getreference isprocessed tostring default constructor public mini table super log config mini table set cell selection enabled false set row selection allowed false default editor this set cell editor new ro cell editor minitable minitable setcellselectionenabled setrowselectionallowed setcelleditor rocelleditor size columns uses mimimum column size public void auto size long start system current time millis final int slack 8 making sure it fits in a column final int maxsize 300 max size of a column table model model this get model int size model get column count for all columns for int col 0 col size col column minimum width table column tc this get column model get column col int width 0 if m minwidth size col width integer m minwidth get col int value log config column col column get header value header table cell renderer renderer tc get header renderer if renderer null renderer new default table cell renderer component comp renderer get table cell renderer component this tc get header value false false 0 0 log fine hdr preferred comp get preferred size width width comp get width width math max width comp get preferred size width slack cells int max row math min 30 get row count first 30 rows for int row 0 row max row row renderer get cell renderer row col comp renderer get table cell renderer component this get value at row col false false row col int row width comp get preferred size width slack width math max width row width width not greater width math min maxsize width tc set preferred width width log fine width width for all columns log finer cols size system current time millis start ms autosize currenttimemillis tablemodel getmodel getcolumncount tablecolumn getcolumnmodel getcolumn m_minwidth m_minwidth intvalue getheadervalue tablecellrenderer getheaderrenderer defaulttablecellrenderer gettablecellrenderercomponent getheadervalue getpreferredsize getwidth getpreferredsize maxrow getrowcount maxrow getcellrenderer gettablecellrenderercomponent getvalueat rowwidth getpreferredsize rowwidth setpreferredwidth currenttimemillis is cell editable param row row param column column return true if editable public boolean is cell editable int row int column if the first column is a boolean and it is false it is not editable if column 0 get value at row 0 instanceof boolean boolean get value at row 0 boolean value return false is the column rw if m readwritecolumn contains new integer column return true return false iscelleditable getvalueat getvalueat booleanvalue m_readwritecolumn set column to read only param column column param read only read only public void set column read only int column boolean read only column is read write if m readwritecolumn contains new integer column remove from list if read only int size m readwritecolumn size for int i 0 i size i if integer m readwritecolumn get i int value column m readwritecolumn remove i break read only current column is r o read write add to list else if read only m readwritecolumn add new integer column readonly readonly setcolumnreadonly readonly readwrite m_readwritecolumn readonly m_readwritecolumn m_readwritecolumn intvalue m_readwritecolumn readonly readwrite readonly m_readwritecolumn prepare table and return sql param layout array of column info param from sql from content param where sql where content param multi selection multiple selections return sql public string prepare table column info layout string from string where boolean multi selection string table name m layout layout m multiselection multi selection string buffer sql new string buffer select add columns sql for int i 0 i layout length i create sql if i 0 sql append sql append layout i get colsql adding id column if layout i is key pair col sql append append layout i get key pair colsql add to model add column layout i get col header if layout i is color column set color column i if layout i get col class id column class p keycolumnindex i set editors two steps for int i 0 i layout length i set column class i layout i get col class layout i is read only layout i get col header sql append from append from sql append where append where table selection set row selection allowed true org compiere apps form v match dyn init calls routine for initial init only if from length 0 return sql to string string finalsql m role get default add accesssql sql to string table name m role sql fullyqualified m role sql ro log finest finalsql return finalsql multiselection preparetable columninfo multiselection tablename m_layout m_multiselection multiselection stringbuffer stringbuffer getcolsql iskeypaircol getkeypaircolsql addcolumn getcolheader iscolorcolumn setcolorcolumn getcolclass idcolumn p_keycolumnindex setcolumnclass getcolclass isreadonly getcolheader setrowselectionallowed vmatch dyninit tostring mrole getdefault addaccesssql tostring tablename mrole sql_fullyqualified mrole sql_ro add table column after adding a column you need to set the column classes again default table model fires table structure changed which calls j table table changed create default columns from model param header header public void add column string header log config mini table add column header int index get column count if get model instanceof default table model default table model model default table model get model model add column util clean amp header else throw new illegal argument exception model must be instance of default table model defaulttablemodel tablestructurechanged jtable tablechanged createdefaultcolumnsfrommodel addcolumn minitable addcolumn getcolumncount getmodel defaulttablemodel defaulttablemodel defaulttablemodel getmodel addcolumn cleanamp illegalargumentexception defaulttablemodel set column editor renderer to class after all columns were added param index column index param c class of column determines renderere param read only read only flag public void set column class int index class c boolean read only set column class index c read only null readonly setcolumnclass readonly setcolumnclass readonly set column editor renderer to class after all columns were added lauout of id column depemds on multi selection param index column index param c class of column determines renderere editors supported id column boolean double quantity big decimal amount integer timestamp string default param read only read only flag param header optional header value public void set column class int index class c boolean read only string header log config mini table set column class index c get name r o read only table column tc get column model get column index if tc null return set r o set column read only index read only header if header null header length 0 tc set header value util clean amp header id column selection if c id column class tc set cell renderer new id column renderer m multiselection if m multiselection tc set cell editor new id column editor else tc set cell editor new ro cell editor m minwidth add new integer 10 tc set max width 20 tc set preferred width 20 tc set resizable false boolean else if c boolean class tc set cell renderer new check renderer if read only tc set cell editor new ro cell editor else c check box check new c check box check set margin new insets 0 0 0 0 check set horizontal alignment j label center tc set cell editor new default cell editor check m minwidth add new integer 30 date else if c timestamp class tc set cell renderer new v cell renderer display type date if read only tc set cell editor new ro cell editor else tc set cell editor new mini cell editor c m minwidth add new integer 30 amount else if c big decimal class tc set cell renderer new v cell renderer display type amount if read only tc set cell editor new ro cell editor m minwidth add new integer 70 else tc set cell editor new mini cell editor c m minwidth add new integer 80 number else if c double class tc set cell renderer new v cell renderer display type number if read only tc set cell editor new ro cell editor m minwidth add new integer 70 else tc set cell editor new mini cell editor c m minwidth add new integer 80 integer else if c integer class tc set cell renderer new v cell renderer display type integer if read only tc set cell editor new ro cell editor else tc set cell editor new mini cell editor c m minwidth add new integer 30 string else tc set cell renderer new v cell renderer display type string if read only tc set cell editor new ro cell editor else tc set cell editor new mini cell editor string class m minwidth add new integer 30 log fine renderer tc get cell renderer to string editor tc get cell editor to string idcolumn multiselection idcolumn bigdecimal readonly setcolumnclass readonly minitable setcolumnclass getname readonly tablecolumn getcolumnmodel getcolumn setcolumnreadonly readonly setheadervalue cleanamp idcolumn setcellrenderer idcolumnrenderer m_multiselection m_multiselection setcelleditor idcolumneditor setcelleditor rocelleditor m_minwidth setmaxwidth setpreferredwidth setresizable setcellrenderer checkrenderer readonly setcelleditor rocelleditor ccheckbox ccheckbox setmargin sethorizontalalignment jlabel setcelleditor defaultcelleditor m_minwidth setcellrenderer vcellrenderer displaytype readonly setcelleditor rocelleditor setcelleditor minicelleditor m_minwidth bigdecimal setcellrenderer vcellrenderer displaytype readonly setcelleditor rocelleditor m_minwidth setcelleditor minicelleditor m_minwidth setcellrenderer vcellrenderer displaytype readonly setcelleditor rocelleditor m_minwidth setcelleditor minicelleditor m_minwidth setcellrenderer vcellrenderer displaytype readonly setcelleditor rocelleditor setcelleditor minicelleditor m_minwidth setcellrenderer vcellrenderer displaytype readonly setcelleditor rocelleditor setcelleditor minicelleditor m_minwidth getcellrenderer tostring getcelleditor tostring clear table content param no number of rows public void set row count int no if get model instanceof default table model default table model model default table model get model model set row count no log config mini table set row count rows get row count cols get column count else throw new illegal argument exception model must be instance of default table model setrowcount getmodel defaulttablemodel defaulttablemodel defaulttablemodel getmodel setrowcount minitable setrowcount getrowcount getcolumncount illegalargumentexception defaulttablemodel load table from result set the result set is not closed param rs result set with the column layout defined in prepare table public void load table result set rs if m layout null throw new unsupported operation exception layout not defined clear table set row count 0 try while rs next int row get row count set row count row 1 int col offset 1 columns start with 1 for int col 0 col m layout length col object data null class c m layout col get col class int col index col col offset if c id column class data new id column rs get int col index else if c boolean class data new boolean rs get string col index equals y else if c timestamp class data rs get timestamp col index else if c big decimal class data rs get big decimal col index else if c double class data new double rs get double col index else if c integer class data new integer rs get int col index else if c key name pair class string display rs get string col index int key rs get int col index 1 data new key name pair key display col offset else string s rs get string col index if s null data s trim problems with nchar store set value at data row col log fine r row c col m layout col get col header data data to string data get class get name m table get cell renderer row col catch sql exception e log log level severe e auto size log config row rs get row count resultset resultset resultset preparetable loadtable resultset m_layout unsupportedoperationexception setrowcount getrowcount setrowcount coloffset m_layout m_layout getcolclass colindex coloffset idcolumn idcolumn getint colindex getstring colindex gettimestamp colindex bigdecimal getbigdecimal colindex getdouble colindex getint colindex keynamepair getstring colindex getint colindex keynamepair coloffset getstring colindex setvalueat m_layout getcolheader tostring getclass getname m_table getcellrenderer sqlexception autosize getrowcount load table from object array param pos array of p os public void load table po pos if m layout null throw new unsupported operation exception layout not defined clear table set row count 0 for int i 0 i pos length i po mypo pos i int row get row count set row count row 1 for int col 0 col m layout length col string column name m layout col get colsql object data mypo get value column name if data null class c m layout col get col class if c id column class data new id column integer data int value else if c double class data new double big decimal data double value store set value at data row col auto size log config row array get row count pos loadtable m_layout unsupportedoperationexception setrowcount getrowcount setrowcount m_layout columnname m_layout getcolsql get_value columnname m_layout getcolclass idcolumn idcolumn intvalue bigdecimal doublevalue setvalueat autosize getrowcount get the key of currently selected row based on layout defined in prepare table return id if key public integer get selected row key if m layout null throw new unsupported operation exception layout not defined int row get selected row if row 1 p keycolumnindex 1 object data get model get value at row p keycolumnindex if data instanceof id column data id column data getrecord id if data instanceof integer return integer data return null preparetable getselectedrowkey m_layout unsupportedoperationexception getselectedrow p_keycolumnindex getmodel getvalueat p_keycolumnindex idcolumn idcolumn getrecord_id get layout return array of column info public column info get layout info return m layout columninfo columninfo getlayoutinfo m_layout set single selection param multi selection multiple selections public void set multi selection boolean multi selection m multiselection multi selection multiselection setmultiselection multiselection m_multiselection multiselection single selection table return true if multiple rows can be selected public boolean is multi selection return m multiselection ismultiselection m_multiselection set the column to determine the color of the row based on model index param model index model index public void set color column int model index m colorcolumnindex model index modelindex setcolorcolumn modelindex m_colorcolumnindex modelindex set color column comparison criteria param data compare data public void set color compare object data compare m colordatacompare data compare colorcolumn datacompare setcolorcompare datacompare m_colordatacompare datacompare get color code for row pre if numerical value in compare column is negative 1 positive 1 otherwise 0 if timestamp pre param row row return color code public int get color code int row if m colorcolumnindex 1 return 0 object data get model get value at row m colorcolumnindex int cmp 0 we need to have a number if data null return 0 try if data instanceof timestamp if m colordatacompare null m colordatacompare instanceof timestamp m colordatacompare new timestamp system current time millis cmp timestamp m colordatacompare compare to timestamp data else if m colordatacompare null m colordatacompare instanceof big decimal m colordatacompare env zero if data instanceof big decimal data new big decimal data to string cmp big decimal m colordatacompare compare to big decimal data catch exception e return 0 if cmp 0 return 1 if cmp 0 return 1 return 0 colorcode getcolorcode m_colorcolumnindex getmodel getvalueat m_colorcolumnindex m_colordatacompare m_colordatacompare m_colordatacompare currenttimemillis m_colordatacompare compareto m_colordatacompare m_colordatacompare bigdecimal m_colordatacompare bigdecimal bigdecimal tostring bigdecimal m_colordatacompare compareto bigdecimal standard constructor param ctx context param c payselectionline id id public m pay selection line properties ctx int c payselectionline id string trx name super ctx c payselectionline id trx name if c payselectionline id 0 setc payselection id 0 set payment rule null s set line 0 sql select nvl max line 0 10 as default value from c payselectionline where c payselection id c payselection id setc invoice id 0 set isso trx false set open amt env zero set pay amt env zero set discount amt env zero set difference amt env zero set is manual false c_payselectionline_id mpayselectionline c_payselectionline_id trxname c_payselectionline_id trxname c_payselectionline_id setc_payselection_id setpaymentrule setline defaultvalue c_payselectionline c_payselection_id c_payselection_id setc_invoice_id setissotrx setopenamt setpayamt setdiscountamt setdifferenceamt setismanual load constructor param ctx context param rs result set public m pay selection line properties ctx result set rs string trx name super ctx rs trx name mpayselectionline resultset trxname trxname parent constructor param ps parent param line line param payment rule payment rule public m pay selection line m pay selection ps int line string payment rule this ps get ctx 0 ps get trxname set client org ps setc payselection id ps getc payselection id set line line set payment rule payment rule paymentrule mpayselectionline mpayselection paymentrule getctx get_trxname setclientorg setc_payselection_id getc_payselection_id setline setpaymentrule paymentrule set invoice info param c invoice id invoice param isso trx sales trx param pay amt payment param open amt open param discount amt discount public void set invoice int c invoice id boolean isso trx big decimal open amt big decimal pay amt big decimal discount amt setc invoice id c invoice id set isso trx isso trx set open amt open amt set pay amt pay amt set discount amt discount amt set difference amt open amt subtract pay amt subtract discount amt c_invoice_id issotrx payamt openamt discountamt setinvoice c_invoice_id issotrx bigdecimal openamt bigdecimal payamt bigdecimal discountamt setc_invoice_id c_invoice_id setissotrx issotrx setopenamt openamt setpayamt payamt setdiscountamt discountamt setdifferenceamt openamt payamt discountamt get invoice return invoice public m invoice get invoice if m invoice null m invoice new m invoice get ctx getc invoice id get trxname return m invoice minvoice getinvoice m_invoice m_invoice minvoice getctx getc_invoice_id get_trxname m_invoice before save param new record new return true protected boolean before save boolean new record set difference amt get open amt subtract get pay amt subtract get discount amt return true newrecord beforesave newrecord setdifferenceamt getopenamt getpayamt getdiscountamt after save param new record new param success success return success protected boolean after save boolean new record boolean success set header return success newrecord aftersave newrecord setheader after delete param success success return sucess protected boolean after delete boolean success set header return success afterdelete setheader recalculate header sum private void set header update header string sql update c payselection ps set total amt select coalesce sum psl pay amt 0 from c payselectionline psl where ps c payselection id psl c payselection id and psl is active y where c payselection id getc payselection id db execute update sql get trxname setheader c_payselection totalamt payamt c_payselectionline c_payselection_id c_payselection_id isactive c_payselection_id getc_payselection_id executeupdate get_trxname string representation return info public string to string string buffer sb new string buffer m pay selection line sb append get id append c invoice id append getc invoice id append pay amt append get pay amt append difference amt append get difference amt append return sb to string tostring stringbuffer stringbuffer mpayselectionline get_id c_invoice_id getc_invoice_id payamt getpayamt differenceamt getdifferenceamt tostring constructor param ass accounting schemata param rs record parem trx name trx public doc inout m acct schema ass result set rs string trx name super ass m in out class rs null trx name trxname doc_inout macctschema resultset trxname minout trxname load document details return error message or null protected string load document details setc currency id no currency m in out inout m in out getpo set date doc inout get movement date contained objects p lines load lines inout log fine lines p lines length return null loaddocumentdetails setc_currency_id no_currency minout minout setdatedoc getmovementdate p_lines loadlines p_lines load invoice line return doc line array private doc line load lines m in out inout array list doc line list new array list doc line m in out line lines inout get lines false for int i 0 i lines length i m in out line line lines i if line is description line getm product id 0 line get movement qty signum 0 log finer ignored line continue doc line doc line new doc line line this big decimal qty line get movement qty doc line set qty qty get document type equals doctype matshipment sets trx and storage qty log fine doc line to string list add doc line return array doc line dls new doc line list size list to array dls return dls docline docline loadlines minout arraylist docline arraylist docline minoutline getlines minoutline isdescription getm_product_id getmovementqty docline docline docline bigdecimal getmovementqty docline setqty getdocumenttype doctype_matshipment docline tostring docline docline docline toarray get balance return zero always balanced public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for mms mmr pre shipment cogs rev org dr inventory cr shipment of project issue cogs dr project cr receipt inventory dr not invoiced receipt cr pre param as accounting schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual setc currency id as getc currency id line pointers fact line dr null fact line cr null sales shipment if get document type equals doctype matshipment for int i 0 i p lines length i doc line line p lines i big decimal costs line get product costs as line getad org id true if costs null costs signum 0 zero costs ok m product product line get product if product is stocked p error no costs for line get product get name log log level severe p error return null else ignore service continue cogs dr dr fact create line line line get account product cost accttype p cogs as as getc currency id costs null if dr null p error fact line dr not created line log log level severe p error return null dr setm locator id line getm locator id dr set location from locator line getm locator id true from loc dr set location fromb partner getc bpartner location id false to loc dr setad org id line getorder org id revenue x org dr set qty line get qty negate inventory cr cr fact create line line line get account product cost accttype p asset as as getc currency id null costs if cr null p error fact line cr not created line log log level severe create fact p error return null cr setm locator id line getm locator id cr set location from locator line getm locator id true from loc cr set location fromb partner getc bpartner location id false to loc if line getm product id 0 m cost detail create shipment as line getad org id line getm product id line getm attributesetinstance id line get id 0 costs line get qty line get description true get trx name for all lines update product info as getc acctschema id only for so shipment purchasing receipt else if get document type equals doctype matreceipt for int i 0 i p lines length i doc line line p lines i big decimal costs line get product costs as line getad org id false non zero costs m product product line get product if costs null costs signum 0 p error resubmit no costs for product get name log log level severe p error return null inventory asset dr m account assets line get account product cost accttype p asset as if product is service assets line get account product cost accttype p expense as dr fact create line line assets as getc currency id costs null if dr null p error dr not created line log log level severe p error return null dr setm locator id line getm locator id dr set location fromb partner getc bpartner location id true from loc dr set location from locator line getm locator id false to loc not invoiced receipt cr cr fact create line line get account doc accttype notinvoicedreceipts as as getc currency id null costs if cr null p error cr not created line log log level severe p error return null cr setm locator id line getm locator id cr set location fromb partner getc bpartner location id true from loc cr set location from locator line getm locator id false to loc cr set qty line get qty negate receipt else p error document type unknown get document type log log level severe p error return null array list fact facts new array list fact facts add fact return facts revorg notinvoicedreceipt arraylist createfacts macctschema post_actual setc_currency_id getc_currency_id factline factline getdocumenttype doctype_matshipment p_lines docline p_lines bigdecimal getproductcosts getad_org_id mproduct getproduct isstocked p_error getproduct getname p_error createline getaccount productcost accttype_p_cogs getc_currency_id p_error factline p_error setm_locator_id getm_locator_id setlocationfromlocator getm_locator_id setlocationfrombpartner getc_bpartner_location_id setad_org_id getorder_org_id setqty getqty createline getaccount productcost accttype_p_asset getc_currency_id p_error factline createfact p_error setm_locator_id getm_locator_id setlocationfromlocator getm_locator_id setlocationfrombpartner getc_bpartner_location_id getm_product_id mcostdetail createshipment getad_org_id getm_product_id getm_attributesetinstance_id get_id getqty getdescription gettrxname updateproductinfo getc_acctschema_id getdocumenttype doctype_matreceipt p_lines docline p_lines bigdecimal getproductcosts getad_org_id mproduct getproduct p_error getname p_error maccount getaccount productcost accttype_p_asset isservice getaccount productcost accttype_p_expense createline getc_currency_id p_error p_error setm_locator_id getm_locator_id setlocationfrombpartner getc_bpartner_location_id setlocationfromlocator getm_locator_id notinvoicedreceipt createline getaccount accttype_notinvoicedreceipts getc_currency_id p_error p_error setm_locator_id getm_locator_id setlocationfrombpartner getc_bpartner_location_id setlocationfromlocator getm_locator_id setqty getqty p_error documenttype getdocumenttype p_error arraylist arraylist update sales order costing product info old purchase side handeled in invoice matching br decrease average cumulatives param c acctschema id accounting schema deprecated old costing private void update product info int c acctschema id log fine m inout id get id old model string buffer sql new string buffer update m product costing pc set cost average cum qty cost average cum amt select cost average cum qty sum il movement qty cost average cum amt sum il movement qty current cost price from m inoutline il where pc m product id il m product id and il m inout id append get id append append where exists select from m inoutline il where pc m product id il m product id and il m inout id append get id append int no db execute update sql to string get trx name log fine m product costing updated no c_acctschema_id updateproductinfo c_acctschema_id m_inout_id get_id stringbuffer stringbuffer m_product_costing costaveragecumqty costaveragecumamt costaveragecumqty movementqty costaveragecumamt movementqty currentcostprice m_inoutline m_product_id m_product_id m_inout_id get_id m_inoutline m_product_id m_product_id m_inout_id get_id executeupdate tostring gettrxname m_product_costing wf activity public wf activity super needs to call init wfactivity wf activity param menu a menu public wf activity a menu menu super log config try dyn init 0 jb init catch exception e log log level severe e m menu menu amenu wfactivity amenu dyninit jbinit m_menu dynamic init called before static init param window no window private void dyn init int window no load activities forward f forward v lookup create user window no windowno dyninit windowno loadactivities fforward vlookup createuser windowno static init called after dynamic init throws exception private void jb init throws exception center panel set layout center layout f node set read write false f description set read write false f description set preferred size new dimension 130 40 f help set read write false f help set preferred size new dimension 150 80 f history set read write false f history set preferred size new dimension 150 60 f text msg set preferred size new dimension 150 40 b previous add action listener this b next add action listener this b zoom add action listener this bok add action listener this this set layout new border layout this add center panel border layout center this add status bar border layout south answers set opaque false answers add f answer text answers add f answer list answers add f answer button f answer button add action listener this center panel add l node new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 10 5 5 0 0 center panel add f node new grid bag constraints 1 0 2 1 0 5 0 0 grid bag constraints northwest grid bag constraints horizontal new insets 5 0 5 5 0 0 center panel add b previous new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 5 5 10 0 0 center panel add l desctiption new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 10 5 5 0 0 center panel add f description new grid bag constraints 1 1 2 1 0 0 0 1 grid bag constraints northwest grid bag constraints horizontal new insets 5 0 5 5 0 0 center panel add b next new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 5 5 10 0 0 center panel add l help new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 10 5 5 0 0 center panel add f help new grid bag constraints 1 2 3 1 0 0 0 1 grid bag constraints northwest grid bag constraints horizontal new insets 5 0 5 10 0 0 center panel add l history new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 10 5 5 0 0 center panel add f history new grid bag constraints 1 3 3 1 0 5 0 5 grid bag constraints northwest grid bag constraints both new insets 5 0 5 10 0 0 center panel add l answer new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 10 5 5 0 0 center panel add answers new grid bag constraints 1 4 2 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 0 5 5 0 0 center panel add b zoom new grid bag constraints 3 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 0 10 10 0 0 center panel add l text msg new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 10 5 5 0 0 center panel add f text msg new grid bag constraints 1 5 3 1 0 5 0 0 grid bag constraints northwest grid bag constraints horizontal new insets 5 0 5 10 0 0 center panel add l forward new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 10 5 5 0 0 center panel add f forward new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 0 5 0 0 0 center panel add l optional new grid bag constraints 2 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 5 5 5 0 0 center panel add bok new grid bag constraints 3 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 5 10 0 0 jbinit centerpanel setlayout centerlayout fnode setreadwrite fdescription setreadwrite fdescription setpreferredsize fhelp setreadwrite fhelp setpreferredsize fhistory setreadwrite fhistory setpreferredsize ftextmsg setpreferredsize bprevious addactionlistener bnext addactionlistener bzoom addactionlistener addactionlistener setlayout borderlayout centerpanel borderlayout statusbar borderlayout setopaque fanswertext fanswerlist fanswerbutton fanswerbutton addactionlistener centerpanel lnode gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fnode gridbagconstraints gridbagconstraints gridbagconstraints centerpanel bprevious gridbagconstraints gridbagconstraints gridbagconstraints centerpanel ldesctiption gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fdescription gridbagconstraints gridbagconstraints gridbagconstraints centerpanel bnext gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lhelp gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fhelp gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lhistory gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fhistory gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lanswer gridbagconstraints gridbagconstraints gridbagconstraints centerpanel gridbagconstraints gridbagconstraints gridbagconstraints centerpanel bzoom gridbagconstraints gridbagconstraints gridbagconstraints centerpanel ltextmsg gridbagconstraints gridbagconstraints gridbagconstraints centerpanel ftextmsg gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lforward gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fforward gridbagconstraints gridbagconstraints gridbagconstraints centerpanel loptional gridbagconstraints gridbagconstraints gridbagconstraints centerpanel gridbagconstraints gridbagconstraints gridbagconstraints initialize panel for form panel param window no window param frame frame see org compiere apps form form panel init int form frame public void init int window no form frame frame m windowno window no m frame frame log info try dyn init window no jb init this set preferred size new dimension 400 400 frame get content pane add this border layout center display catch exception e log log level severe e formpanel windowno formpanel formframe windowno formframe m_windowno windowno m_frame dyninit windowno jbinit setpreferredsize getcontentpane borderlayout dispose see org compiere apps form form panel dispose public void dispose if m frame null m frame dispose m frame null formpanel m_frame m_frame m_frame load activities return int public int load activities long start system current time millis array list mwf activity list new array list mwf activity string sql select from ad wf activity a where a processed n and a wf state os and owner of activity a ad user id 1 invoker if no invoker all or exists select from ad wf responsible r where a ad wf responsible id r ad wf responsible id and coalesce r ad user id 0 0 and a ad user id or a ad user id is null 2 responsible user or exists select from ad wf responsible r where a ad wf responsible id r ad wf responsible id and r ad user id 3 responsible role or exists select from ad wf responsible r inner join ad user roles ur on r ad role id ur ad role id where a ad wf responsible id r ad wf responsible id and ur ad user id 4 order by a priority desc created int ad user id env getad user id env get ctx prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad user id pstmt set int 2 ad user id pstmt set int 3 ad user id pstmt set int 4 ad user id result set rs pstmt execute query while rs next list add new mwf activity env get ctx rs null if list size 200 hardcoded log warning more then 200 activities ignored break rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m activities new mwf activity list size list to array m activities log fine m activities length system current time millis start ms m index 0 return m activities length loadactivities currenttimemillis arraylist mwfactivity arraylist mwfactivity ad_wf_activity wfstate ad_user_id ad_wf_responsible ad_wf_responsible_id ad_wf_responsible_id ad_user_id ad_user_id ad_user_id ad_wf_responsible ad_wf_responsible_id ad_wf_responsible_id ad_user_id ad_wf_responsible ad_user_roles ad_role_id ad_role_id ad_wf_responsible_id ad_wf_responsible_id ad_user_id ad_user_id getad_user_id getctx preparedstatement preparestatement setint ad_user_id setint ad_user_id setint ad_user_id setint ad_user_id resultset executequery mwfactivity getctx m_activities mwfactivity toarray m_activities m_activities currenttimemillis m_index m_activities display fill editors public void display log fine index m index f text msg set text f answer text set visible false f answer list set visible false f answer button set icon env get image icon m window gif f answer button set visible false f text msg set read write m activities length 0 b zoom set enabled m activities length 0 bok set enabled m activities length 0 f forward set value null f forward set enabled m activities length 0 status bar set statusdb string value of m index m activities length m activity null if m activities length 0 if m index 1 m activities length log log level severe index m index greater then activity length m activities length m index 0 else m activity m activities m index nothing to show if m activity null f node set text f description set text f help set text f history set text status bar set statusdb 0 0 status bar set status line msg get msg env get ctx wf no activities b next set enabled false b previous set enabled false return display activity f node set text m activity get node name f description set text m activity get node description f help set text m activity get node help f history set text m activity get historyhtml user actions mwf node node m activity get node if mwf node action userchoice equals node get action if m column null m column node get column if m column null m column get id 0 int dt m column getad reference id if dt display type yes no value name pair values m ref list get list 319 false yesno f answer list set model new default combo box model values f answer list set visible true else if dt display type list value name pair values m ref list get list m column getad reference value id false f answer list set model new default combo box model values f answer list set visible true else other display types come here f answer text set text f answer text set visible true else if mwf node action userwindow equals node get action mwf node action userform equals node get action f answer button set text node get name f answer button set tool tip text node get description f answer button set visible true else if mwf node action userworkbench equals node get action log log level severe workflow action not implemented yet else log log level severe unknown node action node get action if m menu null m menu update info calls load activities updates menu tab end if m index 1 m activities length m index m activities length 1 b next set enabled false else b next set enabled true start if m index 0 m index 0 b previous set enabled false else b previous set enabled true status bar set statusdb m index 1 m activities length status bar set status line msg get msg env get ctx wf activities m_index ftextmsg settext fanswertext setvisible fanswerlist setvisible fanswerbutton seticon getimageicon mwindow fanswerbutton setvisible ftextmsg setreadwrite m_activities bzoom setenabled m_activities setenabled m_activities fforward setvalue fforward setenabled m_activities statusbar setstatusdb valueof m_index m_activities m_activity m_activities m_index m_activities m_index m_activities m_index m_activity m_activities m_index m_activity fnode settext fdescription settext fhelp settext fhistory settext statusbar setstatusdb statusbar setstatusline getmsg getctx wfnoactivities bnext setenabled bprevious setenabled fnode settext m_activity getnodename fdescription settext m_activity getnodedescription fhelp settext m_activity getnodehelp fhistory settext m_activity gethistoryhtml mwfnode m_activity getnode mwfnode action_userchoice getaction m_column m_column getcolumn m_column m_column get_id m_column getad_reference_id displaytype yesno valuenamepair mreflist getlist _yesno fanswerlist setmodel defaultcomboboxmodel fanswerlist setvisible displaytype valuenamepair mreflist getlist m_column getad_reference_value_id fanswerlist setmodel defaultcomboboxmodel fanswerlist setvisible fanswertext settext fanswertext setvisible mwfnode action_userwindow getaction mwfnode action_userform getaction fanswerbutton settext getname fanswerbutton settooltiptext getdescription fanswerbutton setvisible mwfnode action_userworkbench getaction getaction m_menu m_menu updateinfo loadactivities m_index m_activities m_index m_activities bnext setenabled bnext setenabled m_index m_index bprevious setenabled bprevious setenabled statusbar setstatusdb m_index m_activities statusbar setstatusline getmsg getctx wfactivities action listener param e event see java awt event action listener action performed action event public void action performed action event e this set cursor cursor get predefined cursor cursor wait cursor if e get source b next e get source b previous if e get source b next m index else m index display else if e get source b zoom cmd zoom else if e get source bok cmd ok else if e get source f answer button cmd button this set cursor cursor get default cursor actionlistener actionperformed actionevent actionperformed actionevent setcursor getpredefinedcursor wait_cursor getsource bnext getsource bprevious getsource bnext m_index m_index getsource bzoom cmd_zoom getsource cmd_ok getsource fanswerbutton cmd_button setcursor getdefaultcursor zoom private void cmd zoom log config activity m activity if m activity null return a env zoom m activity getad table id m activity getrecord id cmd_zoom m_activity m_activity aenv m_activity getad_table_id m_activity getrecord_id answer button private void cmd button log config activity m activity if m activity null return mwf node node m activity get node if mwf node action userwindow equals node get action int ad window id node getad window id explicit window string column name m activity getpo get tablename id int record id m activity getrecord id m query query m query get equal query column name record id boolean isso trx m activity isso trx log info zoom to ad window id ad window id query isso trx isso trx a window frame new a window if frame init window ad window id query return a env show center screen frame frame null else if mwf node action userform equals node get action int ad form id node getad form id form frame ff new form frame ff open form ad form id ff pack a env show center screen ff else if mwf node action userworkbench equals node get action else log log level severe no user action node get action cmd_button m_activity m_activity mwfnode m_activity getnode mwfnode action_userwindow getaction ad_window_id getad_window_id columnname m_activity get_tablename _id record_id m_activity getrecord_id mquery mquery getequalquery columnname record_id issotrx m_activity issotrx ad_window_id ad_window_id issotrx issotrx awindow awindow initwindow ad_window_id aenv showcenterscreen mwfnode action_userform getaction ad_form_id getad_form_id formframe formframe openform ad_form_id aenv showcenterscreen mwfnode action_userworkbench getaction getaction save private void cmd ok log config activity m activity if m activity null return int ad user id env getad user id env get ctx string text msg f text msg get text mwf node node m activity get node object forward f forward get value if forward null log config forward to forward int fw integer forward int value if fw ad user id fw 0 log log level severe forward user fw return if m activity forward to fw text msg a dialog error m windowno this cannot forward return user choice answer else if mwf node action userchoice equals node get action if m column null m column node get column do we have an answer int dt m column getad reference id string value f answer text get text if dt display type yes no dt display type list value name pair pp value name pair f answer list get selected item value pp get value if value null value length 0 a dialog error m windowno this fill mandatory msg get msg env get ctx answer return log config answer value text msg try m activity set user choice ad user id value dt text msg catch exception e log log level severe node get name e a dialog error m windowno this error e to string return user action else log config action node get action text msg try m activity set user confirmation ad user id text msg catch exception e log log level severe node get name e a dialog error m windowno this error e to string return next load activities display cmd_ok m_activity m_activity ad_user_id getad_user_id getctx textmsg ftextmsg gettext mwfnode m_activity getnode fforward getvalue intvalue ad_user_id m_activity forwardto textmsg adialog m_windowno cannotforward mwfnode action_userchoice getaction m_column m_column getcolumn m_column getad_reference_id fanswertext gettext displaytype yesno displaytype valuenamepair valuenamepair fanswerlist getselecteditem getvalue adialog m_windowno fillmandatory getmsg getctx textmsg m_activity setuserchoice ad_user_id textmsg getname adialog m_windowno tostring getaction textmsg m_activity setuserconfirmation ad_user_id textmsg getname adialog m_windowno tostring loadactivities prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception m recurring rec new m recurring get ctx getrecord id get trxname log info rec to string return rec execute run doit mrecurring mrecurring getctx getrecord_id get_trxname tostring executerun initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception expense servlet init servletexception servletconfig servletexception webenv initweb servletexception expenseservlet get servlet information return info public string get servlet info return a dempiere web expense servlet getservletinfo adempiere clean up resources public void destroy log fine process the http get request sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr forward to request jsp response send redirect expenses jsp servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr sendredirect process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to expense jsp entry return int w expense id web util get parameter as int request p expense id web util create forward page response web expense under construction expenses jsp 0 servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser sendredirect loginservlet forwardto w_expense_id webutil getparameterasint p_expense_id webutil createforwardpage prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c order id p c order id para i get parameter as int else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_order_id p_c_order_id getparameterasint perrform process return message throws exception if not successful protected string do it throws exception log info do it open c order id p c order id if p c order id 0 throw new illegal argument exception c order id 0 m order order new m order get ctx p c order id get trxname if m order docstatus closed equals order get doc status order set doc status m order docstatus completed return order save ok error else throw new illegal state exception order is not closed doit doit c_order_id p_c_order_id p_c_order_id illegalargumentexception c_order_id morder morder getctx p_c_order_id get_trxname morder docstatus_closed getdocstatus setdocstatus morder docstatus_completed illegalstateexception basic constructor you need to set the attributes using the set methods public address use the set methods to set the values of the attributes param value set the value of lt address gt value lt address gt public address string value add element value addelement use the set methods to set the values of the attributes param element set the value of lt address gt value lt address gt public address span element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public address add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public address add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public address add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public address add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public address remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param ass accounting schemata param rs record parem trx name trx protected doc payment m acct schema ass result set rs string trx name super ass m payment class rs null trx name trxname doc_payment macctschema resultset trxname mpayment trxname load specific document details return error message or null protected string load document details m payment pay m payment getpo set date doc pay get date trx m tendertype pay get tender type m prepayment pay is prepayment m c bankaccount id pay getc bankaccount id amount set amount doc amttype gross pay get pay amt return null loaddocumentdetails mpayment mpayment setdatedoc getdatetrx m_tendertype gettendertype m_prepayment isprepayment m_c_bankaccount_id getc_bankaccount_id setamount amttype_gross getpayamt get source currency balance always zero return zero always balanced public big decimal get balance big decimal ret value env zero log config to string balance ret value return ret value bigdecimal getbalance bigdecimal retvalue tostring retvalue retvalue create facts the accounting logic for arp app pre arp bank in transit dr unallocated cash cr or charge c prepayment app payment select dr or charge v prepayment bank in transit cr cash bank transfer pre param as accounting schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual cash transfer if x equals m tendertype array list fact facts new array list fact facts add fact return facts int ad org id getbank org id bank account org if get document type equals doctype arreceipt asset fact line fl fact create line null get account doc accttype bankintransit as getc currency id get amount null if fl null ad org id 0 fl setad org id ad org id m account acct null if getc charge id 0 acct m charge get account getc charge id as get amount else if m prepayment acct get account doc accttype c prepayment as else acct get account doc accttype unallocatedcash as fl fact create line null acct getc currency id null get amount if fl null ad org id 0 getc charge id 0 don t overwrite charge fl setad org id ad org id app else if get document type equals doctype appayment m account acct null if getc charge id 0 acct m charge get account getc charge id as get amount else if m prepayment acct get account doc accttype v prepayment as else acct get account doc accttype paymentselect as fact line fl fact create line null acct getc currency id get amount null if fl null ad org id 0 getc charge id 0 don t overwrite charge fl setad org id ad org id asset fl fact create line null get account doc accttype bankintransit as getc currency id null get amount if fl null ad org id 0 fl setad org id ad org id else p error document type unknown get document type log log level severe p error fact null array list fact facts new array list fact facts add fact return facts bankintransit unallocatedcash c_prepayment paymentselect v_prepayment bankintransit cashbanktransfer arraylist createfacts macctschema post_actual m_tendertype arraylist arraylist ad_org_id getbank_org_id getdocumenttype doctype_arreceipt factline createline getaccount accttype_bankintransit getc_currency_id getamount ad_org_id setad_org_id ad_org_id maccount getc_charge_id mcharge getaccount getc_charge_id getamount m_prepayment getaccount accttype_c_prepayment getaccount accttype_unallocatedcash createline getc_currency_id getamount ad_org_id getc_charge_id setad_org_id ad_org_id getdocumenttype doctype_appayment maccount getc_charge_id mcharge getaccount getc_charge_id getamount m_prepayment getaccount accttype_v_prepayment getaccount accttype_paymentselect factline createline getc_currency_id getamount ad_org_id getc_charge_id setad_org_id ad_org_id createline getaccount accttype_bankintransit getc_currency_id getamount ad_org_id setad_org_id ad_org_id p_error documenttype getdocumenttype p_error arraylist arraylist get ad org id from bank account return ad org id or 0 private int getbank org id if m c bankaccount id 0 return 0 m bank account ba m bank account get get ctx m c bankaccount id return ba getad org id ad_org_id ad_org_id getbank_org_id m_c_bankaccount_id mbankaccount mbankaccount getctx m_c_bankaccount_id getad_org_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name p pa sla measure id getrecord id processinfoparameter getparameter getparametername getparameter p_pa_sla_measure_id getrecord_id process return info throws exception protected string do it throws exception log info pa sla measure id p pa sla measure id msla measure measure new msla measure get ctx p pa sla measure id get trxname if measure get id 0 throw new compiere user error pa sla measure id p pa sla measure id msla goal goal new msla goal get ctx measure getpa sla goal id get trxname if goal get id 0 throw new compiere user error pa sla goal id measure getpa sla goal id msla criteria criteria msla criteria get get ctx goal getpa sla criteria id get trxname if criteria get id 0 throw new compiere user error pa sla criteria id goal getpa sla criteria id sla criteria pgm criteria new instance goal set measure actual pgm calculate measure goal goal set date last run new timestamp system current time millis goal save return measure actual goal get measure actual doit pa_sla_measure_id p_pa_sla_measure_id mslameasure mslameasure getctx p_pa_sla_measure_id get_trxname get_id compiereusererror pa_sla_measure_id p_pa_sla_measure_id mslagoal mslagoal getctx getpa_sla_goal_id get_trxname get_id compiereusererror pa_sla_goal_id getpa_sla_goal_id mslacriteria mslacriteria getctx getpa_sla_criteria_id get_trxname get_id compiereusererror pa_sla_criteria_id getpa_sla_criteria_id slacriteria newinstance setmeasureactual calculatemeasure setdatelastrun currenttimemillis measureactual getmeasureactual standatrd constructor param ctx ctx param ad preference id id public m preference properties ctx int ad preference id string trx name super ctx ad preference id trx name if ad preference id 0 setad preference id 0 set attribute null set value null ad_preference_id mpreference ad_preference_id trxname ad_preference_id trxname ad_preference_id setad_preference_id setattribute setvalue load contsructor param ctx context param rs result set public m preference properties ctx result set rs string trx name super ctx rs trx name mpreference resultset trxname trxname full constructor param ctx context param attribute attribute param value value param trx name trx public m preference properties ctx string attribute string value string trx name this ctx 0 trx name set attribute attribute set value value trxname mpreference trxname trxname setattribute setvalue before save param new record return true if can be saved protected boolean before save boolean new record string value get value if value null value if value equals 1 set value return true newrecord beforesave newrecord getvalue setvalue string representation return info public string to string string buffer sb new string buffer m preference sb append get id append append get attribute append append get value append return sb to string tostring stringbuffer stringbuffer mpreference get_id getattribute getvalue tostring get contents return context public object get contents return contents getcontents get contents return contents public object get contents return contents getcontents standard constructor public x ad treenodemm properties ctx int ad treenodemm id string trx name super ctx ad treenodemm id trx name if ad treenodemm id 0 setad tree id 0 setnode id 0 x_ad_treenodemm ad_treenodemm_id trxname ad_treenodemm_id trxname ad_treenodemm_id setad_tree_id setnode_id load constructor public x ad treenodemm properties ctx result set rs string trx name super ctx rs trx name x_ad_treenodemm resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad treenodemm append get id append return sb to string tostring stringbuffer stringbuffer x_ad_treenodemm get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set node id public void setnode id int node id if node id 0 throw new illegal argument exception node id is mandatory set valuenocheck node id new integer node id node_id setnode_id node_id node_id illegalargumentexception node_id set_valuenocheck node_id node_id get node id public int getnode id integer ii integer get value node id if ii null return 0 return ii int value node_id getnode_id get_value node_id intvalue set parent parent of entity public void setparent id int parent id if parent id 0 set value parent id null else set value parent id new integer parent id setparent_id parent_id parent_id set_value parent_id set_value parent_id parent_id get parent parent of entity public int getparent id integer ii integer get value parent id if ii null return 0 return ii int value getparent_id get_value parent_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue empty constructor need to open explicitly public zip util ziputil open zip file param file name zip file name public zip util string file name open file name filename ziputil filename filename open zip file param file zip file public zip util file file open file ziputil open the zip file for reading param file name zip file return true if opened public boolean open string file name if file name null return false try return open new file file name catch exception ex system err println zip util open ex return false filename filename filename filename ziputil open the zip file for reading param file zip file return true if opened public boolean open file file if file null return false m file file try if file get name ends with jar m zipfile new jar file file false jar file open read else m zipfile new zip file file zip file open read catch io exception ex system err println zip util open ex m zipfile null return false return true m_file getname endswith m_zipfile jarfile jarfile open_read m_zipfile zipfile zipfile open_read ioexception ziputil m_zipfile close zip file public void close try if m zipfile null m zipfile close catch io exception ex system err println zip util close ex m zipfile null m_zipfile m_zipfile ioexception ziputil m_zipfile is the zip file open return true if yes public boolean is open return m zipfile null isopen m_zipfile is it a jar return true if yes public boolean is jar return m zipfile null m zipfile instanceof jar file isjar m_zipfile m_zipfile jarfile get it as jar if it is a jar return jar or null if not a jar public jar file get jar if m zipfile null m zipfile instanceof jar file return jar file m zipfile return null jarfile getjar m_zipfile m_zipfile jarfile jarfile m_zipfile string representation return info public string to string if m zipfile null return m zipfile to string return zip util tostring m_zipfile m_zipfile tostring ziputil get content as sorted string array return content public string get content if is open return null enumeration extends zip entry e m zipfile entries array list zip entry list new array list zip entry while e has more elements list add e next element return sorted array string ret value new string list size for int i 0 i ret value length i ret value i zip entry list get i get name arrays sort ret value return ret value getcontent isopen zipentry m_zipfile arraylist zipentry arraylist zipentry hasmoreelements nextelement retvalue retvalue retvalue zipentry getname retvalue retvalue get zip entries as enumeration return entries public enumeration entries if is open return null return m zipfile entries zipentries isopen m_zipfile get zip entry param name entry name return zip entry or null if not found public zip entry get entry string name if is open return null return m zipfile get entry name zipentry zipentry getentry isopen m_zipfile getentry get file info param name name return time and size public string get entry info string name string buffer sb new string buffer name zip entry e get entry name if e null sb append else timestamp ts new timestamp e get time sb append append ts append append e get size return sb to string getentryinfo stringbuffer stringbuffer zipentry getentry gettime getsize tostring get manifest if a jar return manifest if exists or null public manifest get manifest try jar file jar get jar if jar null return jar get manifest catch io exception ex system err println zip util get manifest ex return null getmanifest jarfile getjar getmanifest ioexception ziputil getmanifest get zip entry param file name zip jar file param entry name entry return zip entry static public zip entry get entry string file name string entry name if file name null entry name null return null file file file new file file name if file exists string fn find in path file name if fn null return null file not found file new file fn zip util zu new zip util file if zu is open return null entry zip entry ret value zu get entry entry name if ret value null enumeration e zu entries while e has more elements zip entry entry zip entry e next element if entry get name index of entry name 1 ret value entry break zu close return ret value filename entryname zipentry zipentry getentry filename entryname filename entryname filename findinpath filename ziputil ziputil isopen zipentry retvalue getentry entryname retvalue hasmoreelements zipentry zipentry nextelement getname indexof entryname retvalue retvalue get jar file param file name zip jar file return jar static public jar file get jar string file name if file name null return null file file file new file file name if file exists string fn find in path file name if fn null return null file not found file new file fn zip util zu new zip util file return zu get jar filename jarfile getjar filename filename filename findinpath filename ziputil ziputil getjar get manifest param file name zip jar file return manifest or null static public manifest get manifest string file name if file name null return null jar file jar get jar file name if jar null return null try return jar get manifest catch io exception ex system err println zip util get manifest ex return null filename getmanifest filename filename jarfile getjar filename getmanifest ioexception ziputil getmanifest get manifest param file name jar file param jar entry jar entry return manifest static public jar entry get jar entry string file name string jar entry if file name null return null jar file jar get jar file name if jar null return null return jar get jar entry jar entry filename jarentry jarentry getjarentry filename jarentry filename jarfile getjar filename getjarentry jarentry dump manifest to param file name zip jar file static public void dump manifest string file name manifest mf get manifest file name if mf null system out println no jar file file name return system out println mf get entries filename dumpmanifest filename getmanifest filename filename getentries get zip entry time param file name zip file param entry name entry return time as string or null static public string get entry time string file name string entry name zip entry entry get entry file name entry name if entry null return null timestamp ts new timestamp entry get time return ts to string filename entryname getentrytime filename entryname zipentry getentry filename entryname gettime tostring get fill name of jarfile in path param jar file name return full name or null if not found static public string find in path string jar file string path system get property java class path string path entries path split system get property path separator for int i 0 i path entries length i system out println path entries i if path entries i index of jar file 1 return path entries i path system get property sun boot class path path entries path split system get property path separator for int i 0 i path entries length i system out println path entries i if path entries i index of jar file 1 return path entries i return null jarfile findinpath jarfile getproperty pathentries getproperty pathentries pathentries pathentries indexof jarfile pathentries getproperty pathentries getproperty pathentries pathentries pathentries indexof jarfile pathentries test param args ignored public static void main string args try get jar file jar file jar zip util get jar c client jar if jar null jar zip util get jar c tools jar if jar null return jar entry je jar get jar entry jar file manifest name if je null system out println time new date je get time manifest mf jar get manifest if mf null attributes atts mf get main attributes atts get value implementation vendor atts get value implementation version catch io exception ex system err println ex jarfile ziputil getjar cclient ziputil getjar ctools jarentry getjarentry jarfile manifest_name gettime getmanifest getmainattributes getvalue getvalue ioexception full constructor param ctx context param ad pinstance id instance param c bpartner id bpartner param c currency id currency param c invoice id invoice param c bp group id group param due date due date param isso trx so trx public m aging properties ctx int ad pinstance id int c bpartner id int c currency id int c invoice id int c invoicepayschedule id int c bp group id timestamp due date boolean isso trx string trx name super ctx 0 trx name setad pinstance id ad pinstance id setc bpartner id c bpartner id setc currency id c currency id setc invoice id c invoice id may be zero set valuenocheck c invoice id new integer c invoice id setc invoicepayschedule id c invoicepayschedule id may be zero set value c invoicepayschedule id new integer c invoicepayschedule id set is list invoices c invoice id 0 setc bp group id c bp group id if due date null set due date new timestamp system current time millis else set due date due date set isso trx isso trx set due amt env zero set due0 env zero setdue0 7 env zero setdue0 30 env zero setdue1 7 env zero setdue31 60 env zero setdue31 plus env zero setdue61 90 env zero setdue61 plus env zero setdue8 30 env zero setdue91 plus env zero set past due amt env zero setpastdue1 7 env zero setpastdue1 30 env zero setpastdue31 60 env zero setpastdue31 plus env zero setpastdue61 90 env zero setpastdue61 plus env zero setpastdue8 30 env zero setpastdue91 plus env zero set open amt env zero set invoiced amt env zero ad_pinstance_id c_bpartner_id c_currency_id c_invoice_id c_bp_group_id duedate issotrx maging ad_pinstance_id c_bpartner_id c_currency_id c_invoice_id c_invoicepayschedule_id c_bp_group_id duedate issotrx trxname trxname setad_pinstance_id ad_pinstance_id setc_bpartner_id c_bpartner_id setc_currency_id c_currency_id setc_invoice_id c_invoice_id set_valuenocheck c_invoice_id c_invoice_id setc_invoicepayschedule_id c_invoicepayschedule_id set_value c_invoicepayschedule_id c_invoicepayschedule_id setislistinvoices c_invoice_id setc_bp_group_id c_bp_group_id duedate setduedate currenttimemillis setduedate duedate setissotrx issotrx setdueamt setdue0 setdue0_7 setdue0_30 setdue1_7 setdue31_60 setdue31_plus setdue61_90 setdue61_plus setdue8_30 setdue91_plus setpastdueamt setpastdue1_7 setpastdue1_30 setpastdue31_60 setpastdue31_plus setpastdue61_90 setpastdue61_plus setpastdue8_30 setpastdue91_plus setopenamt setinvoicedamt load constructor param ctx context param rs result set public m aging properties ctx result set rs string trx name super ctx rs trx name maging resultset trxname trxname add amount to buckets param days due positive due negative not due param invoiced amt invoiced amount param open amt open amount public void add int days due big decimal invoiced amt big decimal open amt if invoiced amt null invoiced amt env zero if open amt null open amt env zero set invoiced amt get invoiced amt add invoiced amt set open amt get open amt add open amt big decimal amt open amt not due negative if days due 0 set due amt get due amt add amt if days due 0 set due0 get due0 add amt if days due 7 setdue0 7 getdue0 7 add amt if days due 30 setdue0 30 getdue0 30 add amt if days due 1 days due 7 setdue1 7 getdue1 7 add amt if days due 8 days due 30 setdue8 30 getdue8 30 add amt if days due 31 days due 60 setdue31 60 getdue31 60 add amt if days due 31 setdue31 plus getdue31 plus add amt if days due 61 days due 90 setdue61 90 getdue61 90 add amt if days due 61 setdue61 plus getdue61 plus add amt if days due 91 setdue91 plus getdue91 plus add amt else due positive 1 set past due amt get past due amt add amt if days due 7 setpastdue1 7 getpastdue1 7 add amt if days due 30 setpastdue1 30 getpastdue1 30 add amt if days due 8 days due 30 setpastdue8 30 getpastdue8 30 add amt if days due 31 days due 60 setpastdue31 60 getpastdue31 60 add amt if days due 31 setpastdue31 plus getpastdue31 plus add amt if days due 61 days due 90 setpastdue61 90 getpastdue61 90 add amt if days due 61 setpastdue61 plus getpastdue61 plus add amt if days due 91 setpastdue91 plus getpastdue91 plus add amt daysdue invoicedamt openamt daysdue bigdecimal invoicedamt bigdecimal openamt invoicedamt invoicedamt openamt openamt setinvoicedamt getinvoicedamt invoicedamt setopenamt getopenamt openamt bigdecimal openamt daysdue setdueamt getdueamt daysdue setdue0 getdue0 daysdue setdue0_7 getdue0_7 daysdue setdue0_30 getdue0_30 daysdue daysdue setdue1_7 getdue1_7 daysdue daysdue setdue8_30 getdue8_30 daysdue daysdue setdue31_60 getdue31_60 daysdue setdue31_plus getdue31_plus daysdue daysdue setdue61_90 getdue61_90 daysdue setdue61_plus getdue61_plus daysdue setdue91_plus getdue91_plus setpastdueamt getpastdueamt daysdue setpastdue1_7 getpastdue1_7 daysdue setpastdue1_30 getpastdue1_30 daysdue daysdue setpastdue8_30 getpastdue8_30 daysdue daysdue setpastdue31_60 getpastdue31_60 daysdue setpastdue31_plus getpastdue31_plus daysdue daysdue setpastdue61_90 getpastdue61_90 daysdue setpastdue61_plus getpastdue61_plus daysdue setpastdue91_plus getpastdue91_plus string representation return info public string to string string buffer sb new string buffer m aging sb append ad pinstance id append getad pinstance id append c bpartner id append getc bpartner id append c currency id append getc currency id append c invoice id append getc invoice id sb append return sb to string tostring stringbuffer stringbuffer maging ad_pinstance_id getad_pinstance_id c_bpartner_id getc_bpartner_id c_currency_id getc_currency_id c_invoice_id getc_invoice_id tostring convert color limited use as it assumes that color is hex string w o this method will take a string of hex values and append a to the beginning if it isn t already there param color the string to convert return the converted string public static string convert color string color if color null return black hex 000000 w o if color length 6 return color if color starts with return color return color convertcolor startswith this method will take a string matching one of the colors defined in this class and return the string value of that color param color the color to get retrieve return the string value of the color if found null otherwise public static string get color string color object col object try col object class for name org apache ecs html color get field color get null catch exception e return null return string col object getcolor colobject colobject forname htmlcolor getfield colobject constructor param document pointer to document param acct schema account schema to create accounts param default posting type the default posting type actual for this posting public fact doc document m acct schema acct schema string default posting type m doc document m acctschema acct schema m postingtype default posting type log config to string acctschema defaultpostingtype macctschema acctschema defaultpostingtype m_doc m_acctschema acctschema m_postingtype defaultpostingtype tostring dispose public void dispose m lines clear m lines null m_lines m_lines create and convert fact line used to create a dr and or cr entry param doc line the document line or null param account if null line is not created param c currency id the currency param debit amt debit amount can be null param credit amt credit amount can be null return fact line public fact line create line doc line doc line m account account int c currency id big decimal debit amt big decimal credit amt log fine create line account dr debit amt cr credit amt data check if account null log info no account for doc line amt debit amt credit amt to string return null fact line line new fact line m doc get ctx m doc get table id m doc get id doc line null 0 doc line get id m trxname set info account line set document info m doc doc line line set posting type m postingtype line set account m acctschema account amounts one needs to not zero if line set amt source c currency id debit amt credit amt if doc line null doc line get qty null doc line get qty signum 0 log fine both amounts qty 0 null doc line to string return null log fine both amounts 0 null qty doc line get qty doc line to string convert line convert optionally overwrite acct amount if doc line null doc line get amt acct dr null doc line get amt acct cr null line set amt acct doc line get amt acct dr doc line get amt acct cr log fine line to string add line return line docline c_currency_id debitamt creditamt factline createline docline docline maccount c_currency_id bigdecimal debitamt bigdecimal creditamt createline debitamt creditamt docline debitamt creditamt tostring factline factline m_doc getctx m_doc get_table_id m_doc get_id docline docline get_id m_trxname setdocumentinfo m_doc docline setpostingtype m_postingtype setaccount m_acctschema setamtsource c_currency_id debitamt creditamt docline docline getqty docline getqty docline tostring docline getqty docline tostring docline docline getamtacctdr docline getamtacctcr setamtacct docline getamtacctdr docline getamtacctcr tostring add fact line param line fact line void add fact line line m lines add line factline m_lines create and convert fact line used to create either a dr or cr entry param doc line document line or null param account dr account to be used if amt is dr balance param account cr account to be used if amt is cr balance param c currency id currency param amt if negative cr else dr return fact line public fact line create line doc line doc line m account account dr m account account cr int c currency id big decimal amt if amt signum 0 return create line doc line account cr c currency id null amt abs else return create line doc line account dr c currency id amt null docline accountdr accountcr c_currency_id factline factline createline docline docline maccount accountdr maccount accountcr c_currency_id bigdecimal createline docline accountcr c_currency_id createline docline accountdr c_currency_id create and convert fact line used to create either a dr or cr entry param doc line document line or null param account account to be used param c currency id currency param amt if negative cr else dr return fact line public fact line create line doc line doc line m account account int c currency id big decimal amt if amt signum 0 return create line doc line account c currency id null amt abs else return create line doc line account c currency id amt null docline c_currency_id factline factline createline docline docline maccount c_currency_id bigdecimal createline docline c_currency_id createline docline c_currency_id is posting type param posting type see post return true if document is posting type public boolean is posting type string posting type return m postingtype equals posting type postingtype post_ ispostingtype postingtype m_postingtype postingtype is converted return true if converted public boolean is converted return m converted isconverted m_converted get acct schema return acct schema public m acct schema get acct schema return m acctschema acctschema acctschema macctschema getacctschema m_acctschema are the lines source balanced return true if source lines balanced public boolean is source balanced no lines balanded if m lines size 0 return true big decimal balance get source balance boolean ret value balance signum 0 if ret value log finer to string else log warning no diff balance to string return ret value issourcebalanced m_lines bigdecimal getsourcebalance retvalue retvalue tostring tostring retvalue return source balance return source balance protected big decimal get source balance big decimal result env zero for int i 0 i m lines size i fact line line fact line m lines get i result result add line get source balance log fine get source balance result to string return result bigdecimal getsourcebalance bigdecimal m_lines factline factline m_lines getsourcebalance getsourcebalance tostring create source line for suspense balancing only if suspense balancing is enabled and not a multi currency document double check as otherwise the rule should not have fired if not balanced create balancing entry in currency of the document return fact line public fact line balance source if m acctschema is suspense balancing m doc is multi currency return null big decimal diff get source balance log finer diff diff new line fact line line new fact line m doc get ctx m doc get table id m doc get id 0 m trxname line set document info m doc null line set posting type m postingtype amount if diff signum 0 negative balance dr line set amt source m doc getc currency id diff abs env zero else positive balance cr line set amt source m doc getc currency id env zero diff account line set account m acctschema m acctschema getsuspensebalancing acct convert line convert log fine line to string m lines add line return line factline factline balancesource m_acctschema issuspensebalancing m_doc ismulticurrency bigdecimal getsourcebalance factline factline m_doc getctx m_doc get_table_id m_doc get_id m_trxname setdocumentinfo m_doc setpostingtype m_postingtype setamtsource m_doc getc_currency_id setamtsource m_doc getc_currency_id setaccount m_acctschema m_acctschema getsuspensebalancing_acct tostring m_lines are all segments balanced return true if segments are balanced public boolean is segment balanced if m lines size 0 return true m acct schema element elements m acctschema get acct schema elements check all balancing segments for int i 0 i elements length i m acct schema element ase elements i if ase is balanced is segment balanced ase get element type return false return true issegmentbalanced m_lines macctschemaelement m_acctschema getacctschemaelements macctschemaelement isbalanced issegmentbalanced getelementtype is source segment balanced param segment type see acct schema element segment implemented only for org other sensible candidates are project user1 2 return true if segments are balanced public boolean is segment balanced string segment type if segment type equals m acct schema element elementtype organization hash map integer big decimal map new hash map integer big decimal add up values by key for int i 0 i m lines size i fact line line fact line m lines get i integer key new integer line getad org id big decimal bal line get source balance big decimal old bal big decimal map get key if old bal null bal bal add old bal map put key bal system out println add key key bal bal line check if all keys are zero iterator values map values iterator while values has next big decimal bal big decimal values next if bal signum 0 map clear log warning segment type no to string balance bal return false map clear log finer segment type to string return true log finer segment type not checked to string return true segmenttype acctschemaelement segment_ issegmentbalanced segmenttype segmenttype macctschemaelement elementtype_organization hashmap bigdecimal hashmap bigdecimal m_lines factline factline m_lines getad_org_id bigdecimal getsourcebalance bigdecimal oldbal bigdecimal oldbal oldbal hasnext bigdecimal bigdecimal segmenttype tostring segmenttype tostring segmenttype tostring balance all segments for all balancing segments for all segment values if balance 0 create due to due from line overwriting the segment value public void balance segments m acct schema element elements m acctschema get acct schema elements check all balancing segments for int i 0 i elements length i m acct schema element ase elements i if ase is balanced balance segment ase get element type dueto duefrom balancesegments macctschemaelement m_acctschema getacctschemaelements macctschemaelement isbalanced balancesegment getelementtype balance source segment param element type segment element type private void balance segment string element type no lines balanced if m lines size 0 return log fine element type to string org if element type equals m acct schema element elementtype organization hash map integer balance map new hash map integer balance add up values by key for int i 0 i m lines size i fact line line fact line m lines get i integer key new integer line getad org id big decimal balance line get source balance balance old balance balance map get key if old balance null old balance new balance line get amt source dr line get amt source cr map put key old balance else old balance add line get amt source dr line get amt source cr log info key key balance balance line create entry for non zero element iterator keys map key set iterator while keys has next integer key integer keys next balance difference balance map get key log info element type key difference if difference is zero balance create balancing entry fact line line new fact line m doc get ctx m doc get table id m doc get id 0 m trxname line set document info m doc null line set posting type m postingtype amount account if difference get balance signum 0 if difference is reversal line set amt source m doc getc currency id env zero difference get post balance line set account m acctschema m acctschema getdueto acct element type else line set amt source m doc getc currency id difference get post balance env zero line set account m acctschema m acctschema getduefrom acct element type else if difference is reversal line set amt source m doc getc currency id difference get post balance env zero line set account m acctschema m acctschema getduefrom acct element type else line set amt source m doc getc currency id env zero difference get post balance line set account m acctschema m acctschema getdueto acct element type line convert line setad org id key int value m lines add line log fine element type line map clear elementtype balancesegment elementtype m_lines elementtype tostring elementtype macctschemaelement elementtype_organization hashmap hashmap m_lines factline factline m_lines getad_org_id bigdecimal getsourcebalance oldbalance oldbalance oldbalance getamtsourcedr getamtsourcecr oldbalance oldbalance getamtsourcedr getamtsourcecr keyset hasnext elementtype iszerobalance factline factline m_doc getctx m_doc get_table_id m_doc get_id m_trxname setdocumentinfo m_doc setpostingtype m_postingtype getbalance isreversal setamtsource m_doc getc_currency_id getpostbalance setaccount m_acctschema m_acctschema getdueto_acct elementtype setamtsource m_doc getc_currency_id getpostbalance setaccount m_acctschema m_acctschema getduefrom_acct elementtype isreversal setamtsource m_doc getc_currency_id getpostbalance setaccount m_acctschema m_acctschema getduefrom_acct elementtype setamtsource m_doc getc_currency_id getpostbalance setaccount m_acctschema m_acctschema getdueto_acct elementtype setad_org_id intvalue m_lines elementtype are the lines accounting balanced return true if accounting lines are balanced public boolean is acct balanced no lines balanced if m lines size 0 return true big decimal balance get acct balance boolean ret value balance signum 0 if ret value log finer to string else log warning no diff balance to string return ret value isacctbalanced m_lines bigdecimal getacctbalance retvalue retvalue tostring tostring retvalue return accounting balance return true if accounting lines are balanced protected big decimal get acct balance big decimal result env zero for int i 0 i m lines size i fact line line fact line m lines get i result result add line get acct balance log fine result to string return result bigdecimal getacctbalance bigdecimal m_lines factline factline m_lines getacctbalance tostring balance accounting currency if the accounting currency is not balanced if currency balancing is enabled create a new line using the currency balancing account with zero source balance or adjust the line with the largest balance sheet account or if no balance sheet account exist the line with the largest amount return fact line public fact line balance accounting big decimal diff get acct balance dr cr log fine balance diff curr bal m acctschema is currency balancing to string fact line line null create currency entry if m acctschema is currency balancing line new fact line m doc get ctx m doc get table id m doc get id 0 m trxname line set document info m doc null line set posting type m postingtype line set account m acctschema m acctschema getcurrencybalancing acct amount line set amt source m doc getc currency id env zero env zero line convert if diff signum 0 line set amt acct diff abs env zero else line set amt acct env zero diff abs log fine line to string m lines add line else adjust biggest balance sheet line amount big decimal b samount env zero fact line b sline null big decimal p lamount env zero fact line p lline null find line for int i 0 i m lines size i fact line l fact line m lines get i big decimal amt l get acct balance abs if l is balance sheet amt compare to b samount 0 b samount amt b sline l else if l is balance sheet amt compare to p lamount 0 p lamount amt p lline l if b sline null line b sline else line p lline if line null log severe no line found else log fine adjusting amt diff line line line currency correct diff log fine line to string correct biggest amount return line factline factline balanceaccounting bigdecimal getacctbalance currbal m_acctschema iscurrencybalancing tostring factline m_acctschema iscurrencybalancing factline m_doc getctx m_doc get_table_id m_doc get_id m_trxname setdocumentinfo m_doc setpostingtype m_postingtype setaccount m_acctschema m_acctschema getcurrencybalancing_acct setamtsource m_doc getc_currency_id setamtacct setamtacct tostring m_lines bigdecimal bsamount factline bsline bigdecimal plamount factline plline m_lines factline factline m_lines bigdecimal getacctbalance isbalancesheet compareto bsamount bsamount bsline isbalancesheet compareto plamount plamount plline bsline bsline plline currencycorrect tostring check accounts of fact lines return true if success public boolean check accounts no lines nothing to distribute if m lines size 0 return true for all fact lines for int i 0 i m lines size i fact line line fact line m lines get i m account account line get account if account null log warning no account for line return false m element value ev account get account if ev null log warning no element value for account line return false if ev is summary log warning cannot post to summary account ev line return false if ev is active log warning cannot post to inactive account ev line return false for all lines return true checkaccounts m_lines m_lines factline factline m_lines maccount getaccount melementvalue getaccount issummary isactive gl distribution of fact lines return true if success public boolean distribute no lines nothing to distribute if m lines size 0 return true array list fact line new lines new array list fact line for all fact lines for int i 0 i m lines size i fact line d line fact line m lines get i m distribution distributions m distribution get d line get account m postingtype m doc getc doctype id no distribution for this line if distributions null distributions length 0 continue just the first if distributions length 1 log warning more then one distributiion for d line get account m distribution distribution distributions 0 add reversal fact line reversal d line reverse distribution get name log info reversal reversal new lines add reversal saved in post commit prepare distribution distribute d line get account d line get source balance d line getc currency id m distribution line lines distribution get lines false for int j 0 j lines length j m distribution line dl lines j if dl is active dl get amt signum 0 continue fact line fact line new fact line m doc get ctx m doc get table id m doc get id 0 m trxname set info account fact line set document info m doc d line get doc line fact line set account m acctschema dl get account fact line set posting type m postingtype if dl is overwrite org set org explicitly fact line setad org id dl getorg id if dl get amt signum 0 fact line set amt source d line getc currency id null dl get amt abs else fact line set amt source d line getc currency id dl get amt null convert fact line convert string description distribution get name dl get line if dl get description null description dl get description fact line add description description log info fact line to string new lines add fact line for all lines add lines for int i 0 i new lines size i m lines add new lines get i return true m_lines arraylist factline newlines arraylist factline m_lines factline dline factline m_lines mdistribution mdistribution dline getaccount m_postingtype m_doc getc_doctype_id dline getaccount mdistribution factline dline getname newlines postcommit dline getaccount dline getsourcebalance dline getc_currency_id mdistributionline getlines mdistributionline isactive getamt factline factline factline m_doc getctx m_doc get_table_id m_doc get_id m_trxname factline setdocumentinfo m_doc dline getdocline factline setaccount m_acctschema getaccount factline setpostingtype m_postingtype isoverwriteorg factline setad_org_id getorg_id getamt factline setamtsource dline getc_currency_id getamt factline setamtsource dline getc_currency_id getamt factline getname getline getdescription getdescription factline adddescription factline tostring newlines factline newlines m_lines newlines string representation return string public string to string string buffer sb new string buffer fact sb append m doc to string sb append append m acctschema to string sb append post type append m postingtype sb append return sb to string tostring stringbuffer stringbuffer m_doc tostring m_acctschema tostring posttype m_postingtype tostring get lines return fact line array public fact line get lines fact line temp new fact line m lines size m lines to array temp return temp factline factline getlines factline factline m_lines m_lines toarray save fact param trx name transaction return true if all lines were saved public boolean save string trx name save lines for int i 0 i m lines size i fact line fl fact line m lines get i log fine save fl if fl save trx name abort on first error return false return true trxname trxname m_lines factline factline m_lines trxname get transaction return trx public string get trxname return m trxname get_trxname m_trxname set transaction name param trx name private void set trxname string trx name m trxname trx name trxname set_trxname trxname m_trxname trxname new balance param dr dr param cr cr public balance big decimal dr big decimal cr dr dr cr cr bigdecimal bigdecimal add param dr dr param cr cr public void add big decimal dr big decimal cr dr dr add dr cr cr add cr bigdecimal bigdecimal get balance return balance public big decimal get balance return dr subtract cr bigdecimal getbalance get post balance return absolute balance negative if reversal public big decimal get post balance big decimal bd get balance abs if is reversal return bd negate return bd bigdecimal getpostbalance bigdecimal getbalance isreversal zero balance return true if 0 public boolean is zero balance return get balance signum 0 iszerobalance getbalance reversal return true if both dr cr are negative or zero public boolean is reversal return dr signum 0 cr signum 0 isreversal string representation return info public string to string string buffer sb new string buffer balance sb append dr append dr append cr append cr append append get balance append return sb to string tostring stringbuffer stringbuffer getbalance tostring initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame env set context env get ctx m windowno isso trx y try fill picks jb init dyn init frame get content pane add tabbed pane border layout center frame get content pane add status bar border layout south catch exception ex log log level severe init ex windowno windowno formframe m_windowno windowno m_frame setcontext getctx m_windowno issotrx fillpicks jbinit dyninit getcontentpane tabbedpane borderlayout getcontentpane statusbar borderlayout static init pre sel panel tabbed f org fb partner scroll pane mini table gen panel info pre throws exception void jb init throws exception compiere color set background this sel panel set layout sel panel layout l warehouse set label for f warehouse lb partner set label for fb partner lb partner set text b partner sel north panel set layout north panel layout north panel layout set alignment flow layout left tabbed pane add sel panel msg get msg env get ctx select sel panel add sel north panel border layout north sel north panel add l warehouse null sel north panel add f warehouse null sel north panel add lb partner null sel north panel add fb partner null sel panel set name sel panel sel panel add confirm panel sel border layout south sel panel add scroll pane border layout center scroll pane get viewport add mini table null confirm panel sel add action listener this tabbed pane add gen panel msg get msg env get ctx generate gen panel set layout gen layout gen panel add info border layout center gen panel set enabled false info set background compiereplaf getfieldbackground inactive info set editable false gen panel add confirm panel gen border layout south confirm panel gen add action listener this selpanel forg fbpartner scrollpane minitable genpanel jbinit compierecolor setbackground selpanel setlayout selpanellayout lwarehouse setlabelfor fwarehouse lbpartner setlabelfor fbpartner lbpartner settext bpartner selnorthpanel setlayout northpanellayout northpanellayout setalignment flowlayout tabbedpane selpanel getmsg getctx selpanel selnorthpanel borderlayout selnorthpanel lwarehouse selnorthpanel fwarehouse selnorthpanel lbpartner selnorthpanel fbpartner selpanel setname selpanel selpanel confirmpanelsel borderlayout selpanel scrollpane borderlayout scrollpane getviewport minitable confirmpanelsel addactionlistener tabbedpane genpanel getmsg getctx genpanel setlayout genlayout genpanel borderlayout genpanel setenabled setbackground getfieldbackground_inactive seteditable genpanel confirmpanelgen borderlayout confirmpanelgen addactionlistener fill picks column id from c order throws exception if lookups cannot be initialized private void fill picks throws exception c orderline m warehouse id m lookup orgl m lookup factory get env get ctx m windowno 0 2223 display type table dir f warehouse new v lookup m warehouse id true false true orgl l warehouse set text msg translate env get ctx m warehouse id f warehouse add vetoable change listener this m m warehouse id f warehouse get value c order c bpartner id m lookup bpl m lookup factory get env get ctx m windowno 0 2762 display type search fb partner new v lookup c bpartner id false false true bpl lb partner set text msg translate env get ctx c bpartner id fb partner add vetoable change listener this column_id c_order fillpicks c_orderline m_warehouse_id mlookup mlookupfactory getctx m_windowno displaytype tabledir fwarehouse vlookup m_warehouse_id lwarehouse settext getctx m_warehouse_id fwarehouse addvetoablechangelistener m_m_warehouse_id fwarehouse getvalue c_order c_bpartner_id mlookup mlookupfactory getctx m_windowno displaytype fbpartner vlookup c_bpartner_id lbpartner settext getctx c_bpartner_id fbpartner addvetoablechangelistener dynamic init create grid controller panel ad column id from c order private void dyn init create columns mini table add column c order id mini table add column ad org id mini table add column c doctype id mini table add column document no mini table add column c bpartner id mini table add column date ordered mini table add column total lines mini table set multi selection true mini table set row selection allowed true set details mini table set column class 0 id column class false mini table set column class 1 string class true msg translate env get ctx ad org id mini table set column class 2 string class true msg translate env get ctx c doctype id mini table set column class 3 string class true msg translate env get ctx document no mini table set column class 4 string class true msg translate env get ctx c bpartner id mini table set column class 5 timestamp class true msg translate env get ctx date ordered mini table set column class 6 big decimal class true msg translate env get ctx total lines mini table auto size mini table get model add table model listener this info status bar set status line msg get msg env get ctx in out generate sel status bar set statusdb tabbed pane listener tabbed pane add change listener this gridcontroller ad_column_id c_order dyninit minitable addcolumn c_order_id minitable addcolumn ad_org_id minitable addcolumn c_doctype_id minitable addcolumn documentno minitable addcolumn c_bpartner_id minitable addcolumn dateordered minitable addcolumn totallines minitable setmultiselection minitable setrowselectionallowed minitable setcolumnclass idcolumn minitable setcolumnclass getctx ad_org_id minitable setcolumnclass getctx c_doctype_id minitable setcolumnclass getctx documentno minitable setcolumnclass getctx c_bpartner_id minitable setcolumnclass getctx dateordered minitable setcolumnclass bigdecimal getctx totallines minitable autosize minitable getmodel addtablemodellistener statusbar setstatusline getmsg getctx inoutgeneratesel statusbar setstatusdb tabbedpane addchangelistener query info private void execute query log info int ad client id env getad client id env get ctx create sql string buffer sql new string buffer select c order id o name dt name document no bp name date ordered total lines from m inout candidate v ic ad org o c bpartner bp c doctype dt where ic ad org id o ad org id and ic c bpartner id bp c bpartner id and ic c doctype id dt c doctype id and ic ad client id if m m warehouse id null sql append and ic m warehouse id append m m warehouse id if m c bpartner id null sql append and ic c bpartner id append m c bpartner id sql append order by o name bp name date ordered log fine sql to string reset table int row 0 mini table set row count row execute try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 ad client id result set rs pstmt execute query while rs next extend table mini table set row count row 1 set values mini table set value at new id column rs get int 1 row 0 c order id mini table set value at rs get string 2 row 1 org mini table set value at rs get string 3 row 2 doc type mini table set value at rs get string 4 row 3 doc no mini table set value at rs get string 5 row 4 b partner mini table set value at rs get timestamp 6 row 5 date ordered mini table set value at rs get big decimal 7 row 6 total lines prepare next row rs close pstmt close catch sql exception e log log level severe sql to string e mini table auto size status bar set statusdb string value of mini table get row count executequery ad_client_id getad_client_id getctx stringbuffer stringbuffer c_order_id documentno dateordered totallines m_inout_candidate_v ad_org c_bpartner c_doctype ad_org_id ad_org_id c_bpartner_id c_bpartner_id c_doctype_id c_doctype_id ad_client_id m_m_warehouse_id m_warehouse_id m_m_warehouse_id m_c_bpartner_id c_bpartner_id m_c_bpartner_id dateordered tostring minitable setrowcount preparedstatement preparestatement tostring setint ad_client_id resultset executequery minitable setrowcount minitable setvalueat idcolumn getint c_order_id minitable setvalueat getstring minitable setvalueat getstring doctype minitable setvalueat getstring minitable setvalueat getstring bpartner minitable setvalueat gettimestamp dateordered minitable setvalueat getbigdecimal totallines sqlexception tostring minitable autosize statusbar setstatusdb valueof minitable getrowcount dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e log info cmd e get action command if e get action command equals confirm panel a cancel dispose return m whereclause save selection if m whereclause length 0 m selectionactive on selection tab m m warehouse id null generate shipments else dispose actionperformed actionevent getactioncommand getactioncommand confirmpanel a_cancel m_whereclause saveselection m_whereclause m_selectionactive m_m_warehouse_id generateshipments vetoable change listener requery param e event public void vetoable change property change event e log info e get property name e get new value if e get property name equals m warehouse id m m warehouse id e get new value if e get property name equals c bpartner id m c bpartner id e get new value fb partner set value m c bpartner id display value execute query vetoablechange propertychangeevent getpropertyname getnewvalue getpropertyname m_warehouse_id m_m_warehouse_id getnewvalue getpropertyname c_bpartner_id m_c_bpartner_id getnewvalue fbpartner setvalue m_c_bpartner_id executequery change listener tab changed param e event public void state changed change event e int index tabbed pane get selected index m selectionactive index 0 statechanged changeevent tabbedpane getselectedindex m_selectionactive table model listener param e event public void table changed table model event e int rows selected 0 int rows mini table get row count for int i 0 i rows i id column id id column mini table get value at i 0 id in column 0 if id null id is selected rows selected status bar set statusdb rows selected tablechanged tablemodelevent rowsselected minitable getrowcount idcolumn idcolumn minitable getvalueat isselected rowsselected statusbar setstatusdb rowsselected save selection return selecion query or return where clause like c order id in private string save selection log info id selection may be pending mini table editing stopped new change event this array of integers array list integer results new array list integer get selected entries int rows mini table get row count for int i 0 i rows i id column id id column mini table get value at i 0 id in column 0 log fine row i id if id null id is selected results add id getrecord id if results size 0 return log config selected results size query string string key column c order id string buffer sb new string buffer key column if results size 1 sb append in else sb append add elements for int i 0 i results size i if i 0 sb append if key column ends with id sb append results get i to string else sb append append results get i to string if results size 1 sb append log config sb to string return sb to string c_order_id saveselection minitable editingstopped changeevent arraylist arraylist minitable getrowcount idcolumn idcolumn minitable getvalueat isselected getrecord_id keycolumn c_order_id stringbuffer stringbuffer keycolumn keycolumn endswith _id tostring tostring tostring tostring generate shipments private void generate shipments log info m warehouse id m m warehouse id string trx name trx create trx name iog trx trx trx get trx name true trx needs to be committed too string trx name null trx trx null reset selection string sql update c order set is selected n where is selected y and ad client id env getad client id env get ctx int no db execute update sql trx name log config reset no set selection sql update c order set is selected y where m whereclause no db execute update sql trx name log fine sql if no 0 string msg no shipments not translated log config msg info set text msg return log info set selection no m selectionactive false prevents from being called twice status bar set status line msg get msg env get ctx in out generate gen status bar set statusdb string value of no prepare process int ad process id 199 m inoutcreate org compiere process in out generate mp instance instance new mp instance env get ctx ad process id 0 if instance save info set text msg get msg env get ctx process no instance return process info pi new process info v in out gen ad process id pi setad pinstance id instance getad pinstance id add parameter selection y mp instance para ip new mp instance para instance 10 ip set parameter selection y if ip save string msg no parameter added not translated info set text msg log log level severe msg return add parameter m warehouse id x ip new mp instance para instance 20 ip set parameter m warehouse id integer parse int m m warehouse id to string if ip save string msg no parameter added not translated info set text msg log log level severe msg return execute process process ctl worker new process ctl this pi trx worker start complete tasks in unlockui generateshipments complete generateshipments m_warehouse_id m_m_warehouse_id trxname createtrxname trxname trxname c_order isselected isselected ad_client_id getad_client_id getctx executeupdate trxname c_order isselected m_whereclause executeupdate trxname settext m_selectionactive statusbar setstatusline getmsg getctx inoutgenerategen statusbar setstatusdb valueof ad_process_id m_inoutcreate inoutgenerate mpinstance mpinstance getctx ad_process_id settext getmsg getctx processnoinstance processinfo processinfo vinoutgen ad_process_id setad_pinstance_id getad_pinstance_id mpinstancepara mpinstancepara setparameter settext m_warehouse_id mpinstancepara setparameter m_warehouse_id parseint m_m_warehouse_id tostring settext processctl processctl generateshipments_complete complete generating shipments called from unlock ui param pi process info private void generateshipments complete process info pi switch tabs tabbed pane set selected index 1 process info util set log fromdb pi string buffer i text new string buffer i text append b append pi get summary append b br append msg get msg env get ctx in out generate info shipments are generated depending on the delivery rule selection in the order append br append pi get log info true info set text i text to string reset selection string sql update c order set is selected n where m whereclause int no db execute update sql null log config reset no get results int ids pi geti ds if ids null ids length 0 return log config print items ids length confirm panel gen getok button set enabled false ok to print shipments if a dialog ask m windowno this print shipments info append n n msg get msg env get ctx print shipments set cursor cursor get predefined cursor cursor wait cursor int ret value a dialog dialog a cancel see also process dialog print shipments invoices do loop through all items for int i 0 i ids length i int m inout id ids i report ctl start document print report engine shipment m inout id true a dialog dialog d new a dialog dialog m frame env get header env get ctx m windowno msg get msg env get ctx printoutok j option pane question message ret value d get return code while ret value a dialog dialog a cancel set cursor cursor get default cursor ok to print shipments confirm panel gen getok button set enabled true generateshipments_complete processinfo tabbedpane setselectedindex processinfoutil setlogfromdb stringbuffer itext stringbuffer itext getsummary getmsg getctx inoutgenerateinfo getloginfo settext itext tostring c_order isselected m_whereclause executeupdate getids printitems confirmpanelgen getokbutton setenabled adialog m_windowno printshipments getmsg getctx printshipments setcursor getpredefinedcursor wait_cursor retvalue adialogdialog a_cancel processdialog printshipments m_inout_id reportctl startdocumentprint reportengine m_inout_id adialogdialog adialogdialog m_frame getheader getctx m_windowno getmsg getctx joptionpane question_message retvalue getreturncode retvalue adialogdialog a_cancel setcursor getdefaultcursor confirmpanelgen getokbutton setenabled lock user interface called from the worker before processing param pi process info public void lockui process info pi this set cursor cursor get predefined cursor cursor wait cursor this set enabled false processinfo setcursor getpredefinedcursor wait_cursor setenabled unlock user interface called from the worker when processing is done param pi result of execute a sync call public void unlockui process info pi this set enabled true this set cursor cursor get default cursor generateshipments complete pi async processinfo setenabled setcursor getdefaultcursor generateshipments_complete is the ui locked internal method return true if ui is locked public boolean isui locked return this is enabled isuilocked isenabled method to be executed async called from the worker param pi process info public void executea sync process info pi processinfo executeasync processinfo set b partner parameter param bpartnerid el region info public void set bpartnerid string bpartnerid el m bpartnerid el bpartnerid el bpartnerid_el setbpartnerid bpartnerid_el m_bpartnerid_el bpartnerid_el start tag return skip body public int do start tag parameter int c bpartner id 0 try string info string expression util eval not null request order bpartnerid m bpartnerid el string class this page context if info null info length 0 c bpartner id integer parse int info catch exception e log severe b partner e jsp writer out page context get out select select get ref orders c bpartner id select output out return skip body skip_body dostarttag c_bpartner_id expressionutil evalnotnull requestorder m_bpartnerid_el pagecontext c_bpartner_id parseint bpartner jspwriter pagecontext getout getreforders c_bpartner_id skip_body create select list param c bpartner id b partner return select list private select get ref orders int c bpartner id select select new select request servlet p ref order id get orders c bpartner id select setid id request servlet p ref order id return select c_bpartner_id getreforders c_bpartner_id requestservlet p_ref_order_id getorders c_bpartner_id id_ requestservlet p_ref_order_id get the request type options param c bpartner id b partner return array of options private option get orders int c bpartner id properties ctx jsp env get ctx http servlet request page context get request array list option list new array list option optional element option o new option 0 add element o set selected true list add o string sql select c order id document no date ordered grand total from c order where c bpartner id order by created by desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c bpartner id result set rs pstmt execute query while rs next o new option rs get string 1 string display rs get string 2 rs get timestamp 3 rs get big decimal 4 o add element util maskhtml display list add o rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null return to array and return option options new option list size list to array options log fine options length return options c_bpartner_id getorders c_bpartner_id jspenv getctx httpservletrequest pagecontext getrequest arraylist arraylist addelement setselected c_order_id documentno dateordered grandtotal c_order c_bpartner_id createdby preparedstatement preparestatement setint c_bpartner_id resultset executequery getstring getstring _ gettimestamp _ getbigdecimal addelement toarray standard constructor public x k source properties ctx int k source id string trx name super ctx k source id trx name if k source id 0 setk source id 0 set name null x_k_source k_source_id trxname k_source_id trxname k_source_id setk_source_id setname load constructor public x k source properties ctx result set rs string trx name super ctx rs trx name x_k_source resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k source append get id append return sb to string tostring stringbuffer stringbuffer x_k_source get_id tostring set description url url for the description public void set descriptionurl string descriptionurl if descriptionurl null descriptionurl length 120 log warning length 120 truncated descriptionurl descriptionurl substring 0 119 set value descriptionurl descriptionurl setdescriptionurl set_value get description url url for the description public string get descriptionurl return string get value descriptionurl getdescriptionurl get_value set knowledge source source of a knowledge entry public void setk source id int k source id if k source id 1 throw new illegal argument exception k source id is mandatory set valuenocheck k source id new integer k source id setk_source_id k_source_id k_source_id illegalargumentexception k_source_id set_valuenocheck k_source_id k_source_id get knowledge source source of a knowledge entry public int getk source id integer ii integer get value k source id if ii null return 0 return ii int value getk_source_id get_value k_source_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname basic constructor use the set methods to set the values of the attributes public br use the set methods to set the values of the attributes param clear type the clear attribute public br string clear type set clear clear type clear_type clear_type setclear clear_type use the set methods to set the values of the attributes param clear type the clear attribute param title the title attribute public br string clear type string title set clear clear type set title title clear_type clear_type setclear clear_type settitle sets the clear attribute param clear type the clear attribute public br set clear string clear type add attribute clear clear type return this clear_type setclear clear_type addattribute clear_type sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public br add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public br add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public br add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public br add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public br remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry get org from cache param ctx context param ad org id id return m org public static m org get properties ctx int ad org id integer key new integer ad org id m org ret value m org s cache get key if ret value null return ret value ret value new m org ctx ad org id null if ret value get id 0 s cache put key ret value return ret value ad_org_id morg morg ad_org_id ad_org_id morg retvalue morg s_cache retvalue retvalue retvalue morg ad_org_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param ad org id id public m org properties ctx int ad org id string trx name super ctx ad org id trx name if ad org id 0 set value null set name null set is summary false ad_org_id morg ad_org_id trxname ad_org_id trxname ad_org_id setvalue setname setissummary load constructor param ctx context param rs result set public m org properties ctx result set rs string trx name super ctx rs trx name morg resultset trxname trxname parent constructor param client client public m org m client client string name this client get ctx 0 client get trxname setad client id client getad client id set value name set name name morg mclient getctx get_trxname setad_client_id getad_client_id setvalue setname get org info return org info public m org info get info if m info null m info m org info get get ctx getad org id return m info morginfo getinfo m_info m_info morginfo getctx getad_org_id m_info after save param new record new record param success save success protected boolean after save boolean new record boolean success if success return success if new record info m info new m org info this m info save access m role org access create for org this m role get default get ctx true reload tree node insert tree mtree base treetype organization value name change if new record is valuechanged value is valuechanged name m account update value description get ctx ad org id getad org id get trxname if y equals env get context get ctx element ot m account update value description get ctx ad orgtrx id getad org id get trxname return true newrecord aftersave newrecord newrecord m_info morginfo m_info mroleorgaccess createfororg mrole getdefault getctx treenode insert_tree mtree_base treetype_organization newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx ad_org_id getad_org_id get_trxname getcontext getctx element_ot maccount updatevaluedescription getctx ad_orgtrx_id getad_org_id get_trxname after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype organization return success afterdelete delete_tree mtree_base treetype_organization get linked b partner return c bpartner id public int getlinkedc bpartner id if m linkedbpartner null int c bpartner id db getsql value null select c bpartner id from c bpartner where ad orgbp id getad org id if c bpartner id 0 not found 1 c bpartner id 0 m linkedbpartner new integer c bpartner id return m linkedbpartner int value bpartner c_bpartner_id getlinkedc_bpartner_id m_linkedbpartner c_bpartner_id getsqlvalue c_bpartner_id c_bpartner ad_orgbp_id getad_org_id c_bpartner_id c_bpartner_id m_linkedbpartner c_bpartner_id m_linkedbpartner intvalue standard constructor param ctx context param ad reference id id param trx name trx public m ref table properties ctx int ad reference id string trx name super ctx ad reference id trx name if ad reference id 0 setad table id 0 setad display 0 setad key 0 set entity type entitytype usermaintained u set is value displayed false ad_reference_id trxname mreftable ad_reference_id trxname ad_reference_id trxname ad_reference_id setad_table_id setad_display setad_key setentitytype entitytype_usermaintained setisvaluedisplayed load cosntructor param ctx context param rs result set param trx name trx public m ref table properties ctx result set rs string trx name super ctx rs trx name trxname mreftable resultset trxname trxname basic constructor public element container elementcontainer basic constructor public element container element element add element element elementcontainer addelement adds an element to the element param element adds an element to the element public element container add element element element ec add element element return this elementcontainer addelement addelement adds an element to the element param element adds an element to the element public element container add element string element ec add element new string element element return this elementcontainer addelement addelement stringelement implements the output method in element public void output output stream out element element null enumeration data ec elements while data has more elements element element data next element element output out outputstream hasmoreelements nextelement implements the output method in element public void output print writer out element element null enumeration data ec elements while data has more elements element element data next element element output out printwriter hasmoreelements nextelement returns an enumeration of the elements in this container public enumeration elements return ec elements standard constructor param ctx context param ad impformat id id public m imp format properties ctx int ad impformat id string trx name super ctx ad impformat id trx name ad_impformat_id mimpformat ad_impformat_id trxname ad_impformat_id trxname load constructor param ctx context param rs result set public m imp format properties ctx result set rs string trx name super ctx rs trx name mimpformat resultset trxname trxname get all rows return array of rows public m imp format row get rows array list m imp format row list new array list m imp format row string sql select from ad impformat row where ad impformat id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad impformat id result set rs pstmt execute query while rs next list add new m imp format row get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get rows e try if pstmt null pstmt close pstmt null catch exception e pstmt null m imp format row ret value new m imp format row list size list to array ret value return ret value mimpformatrow getrows arraylist mimpformatrow arraylist mimpformatrow ad_impformat_row ad_impformat_id seqno preparedstatement preparestatement get_trxname setint getad_impformat_id resultset executequery mimpformatrow getctx get_trxname getrows mimpformatrow retvalue mimpformatrow toarray retvalue retvalue constructor public ro cell editor super new j text field rocelleditor jtextfield indicate ro param an event return false public boolean is cell editable event object an event return false anevent iscelleditable eventobject anevent get contents return context public object get contents return contents getcontents standard constructor param ctx context param c commissionamt id id public m commission amt properties ctx int c commissionamt id string trx name super ctx c commissionamt id trx name if c commissionamt id 0 setc commissionrun id 0 setc commissionline id 0 set actual qty env zero set commission amt env zero set converted amt env zero c_commissionamt_id mcommissionamt c_commissionamt_id trxname c_commissionamt_id trxname c_commissionamt_id setc_commissionrun_id setc_commissionline_id setactualqty setcommissionamt setconvertedamt parent constructor param run parent param c commissionline id line public m commission amt m commission run run int c commissionline id this run get ctx 0 run get trxname set client org run setc commissionrun id run getc commissionrun id setc commissionline id c commissionline id c_commissionline_id mcommissionamt mcommissionrun c_commissionline_id getctx get_trxname setclientorg setc_commissionrun_id getc_commissionrun_id setc_commissionline_id c_commissionline_id load constructor param ctx context param rs result set public m commission amt properties ctx result set rs string trx name super ctx rs trx name mcommissionamt resultset trxname trxname get details return array of details public m commission detail get details string sql select from c commissiondetail where c commissionamt id array list m commission detail list new array list m commission detail prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc commissionamt id result set rs pstmt execute query while rs next list add new m commission detail get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert m commission detail ret value new m commission detail list size list to array ret value return ret value mcommissiondetail getdetails c_commissiondetail c_commissionamt_id arraylist mcommissiondetail arraylist mcommissiondetail preparedstatement preparestatement get_trxname setint getc_commissionamt_id resultset executequery mcommissiondetail getctx get_trxname mcommissiondetail retvalue mcommissiondetail toarray retvalue retvalue calculate commission public void calculate commission m commission detail details get details big decimal converted amt env zero big decimal actual qty env zero for int i 0 i details length i m commission detail detail details i big decimal amt detail get converted amt if amt null amt env zero converted amt converted amt add amt actual qty actual qty add detail get actual qty set converted amt converted amt set actual qty actual qty m commission line cl new m commission line get ctx getc commissionline id get trxname qty big decimal qty get actual qty subtract cl get qty subtract if cl is positive only qty signum 0 qty env zero qty qty multiply cl get qty multiplier amt big decimal amt get converted amt subtract cl get amt subtract if cl is positive only amt signum 0 amt env zero amt amt multiply cl get amt multiplier set commission amt amt add qty calculatecommission mcommissiondetail getdetails bigdecimal convertedamt bigdecimal actualqty mcommissiondetail bigdecimal getconvertedamt convertedamt convertedamt actualqty actualqty getactualqty setconvertedamt convertedamt setactualqty actualqty mcommissionline mcommissionline getctx getc_commissionline_id get_trxname bigdecimal getactualqty getqtysubtract ispositiveonly getqtymultiplier bigdecimal getconvertedamt getamtsubtract ispositiveonly getamtmultiplier setcommissionamt after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record update run header return success newrecord aftersave newrecord newrecord updaterunheader after delete param success success return success protected boolean after delete boolean success if success update run header return success afterdelete updaterunheader update amt header private void update run header m commission run run new m commission run get ctx getc commissionrun id get trxname run update from amt run save updaterunheader mcommissionrun mcommissionrun getctx getc_commissionrun_id get_trxname updatefromamt standard status bar public status bar this false statusbar status bar with additional info param with info with info public status bar boolean with info super try jb init catch exception e this set name status bar if with info info line set visible false withinfo statusbar withinfo jbinit setname statusbar withinfo infoline setvisible static init throws exception private void jb init throws exception status line set border border factory create etched border status line set text status line status line set opaque false statusdb set foreground color blue statusdb set border border factory create etched border statusdb set text statusdb set opaque false statusdb add mouse listener new statusbar mouseadapter this this set layout main layout info line set font compiereplaf getfont label info line set border border factory create raised bevel border info line set horizontal alignment swing constants center info line set horizontal text position swing constants center info line set text info main layout set hgap 2 main layout set vgap 2 this add status line border layout center this add statusdb border layout east this add info line border layout north jbinit statusline setborder borderfactory createetchedborder statusline settext statusline statusline setopaque setforeground setborder borderfactory createetchedborder settext setopaque addmouselistener statusbar_mouseadapter setlayout mainlayout infoline setfont getfont_label infoline setborder borderfactory createraisedbevelborder infoline sethorizontalalignment swingconstants infoline sethorizontaltextposition swingconstants infoline settext mainlayout sethgap mainlayout setvgap statusline borderlayout borderlayout infoline borderlayout set standard status line non error param text text public void set status line string text if text null set status line false else set status line text false setstatusline setstatusline setstatusline set status line param text text param error error public void set status line string text boolean error mt error error mt text text if mt error status line set foreground compiereplaf gettextcolor issue else status line set foreground compiereplaf gettextcolor ok status line set text mt text thread yield setstatusline mt_error mt_text mt_error statusline setforeground gettextcolor_issue statusline setforeground gettextcolor_ok statusline settext mt_text get status line text return status line text public string get status line return status line get text trim statusline getstatusline statusline gettext set tool tip of status line param tip tip public void set status tool tip string tip status line set tool tip text tip tooltip statusline setstatustooltip statusline settooltiptext set status db info param text text param dse data status event public void set statusdb string text data status event dse log config status bar set statusdb text created created by if text null text length 0 statusdb set text statusdb set visible false else string buffer sb new string buffer sb append text append statusdb set text sb to string if statusdb is visible statusdb set visible true save m text text m dse dse setstatusdb datastatusevent statusbar setstatusdb createdby settext setvisible stringbuffer stringbuffer settext tostring isvisible setvisible m_text m_dse set status db info param text text public void set statusdb string text set statusdb text null setstatusdb setstatusdb set status db info param no no public void set statusdb int no set statusdb string value of no null setstatusdb setstatusdb valueof set info line param text text public void set info string text if info line is visible info line set visible true info line set text text setinfo infoline isvisible infoline setvisible infoline settext add component to east of status bar param component component public void add status component j component component this add component border layout east statusbar addstatuscomponent jcomponent borderlayout show who param e event void mouse clicked mouse event e if m dse null m dse created by null m role get default is show preference return string title msg get msg env get ctx who m text record info info new record info env get frame this title m dse a env show center screen info mouseclicked mouseevent m_dse m_dse createdby mrole getdefault isshowpreference getmsg getctx m_text recordinfo recordinfo getframe m_dse aenv showcenterscreen constructor param adaptee adaptee statusbar mouseadapter status bar adaptee this adaptee adaptee statusbar_mouseadapter statusbar click param e event public void mouse clicked mouse event e adaptee mouse clicked e mouseclicked mouseevent mouseclicked display table public display table string table name string column name displaytable displaytable tablename columnname display table public string get query labels return null get query names displaytable getquerylabels getquerynames get query names public string get query fields return null get query fields getquerynames getqueryfields getqueryfields get query fields public string get result labels return null get result labels getqueryfields getresultlabels getresultlabels get content return content public object get contents return contents getcontents standard constructor param ctx context param c phase id id param trx name trx public m project type phase properties ctx int c phase id string trx name super ctx c phase id trx name if c phase id 0 setc phase id 0 pk setc projecttype id 0 parent set name null set seq no 0 set standard qty env zero c_phase_id trxname mprojecttypephase c_phase_id trxname c_phase_id trxname c_phase_id setc_phase_id setc_projecttype_id setname setseqno setstandardqty load constructor param ctx context param rs result set param trx name public m project type phase properties ctx result set rs string trx name super ctx rs trx name trxname mprojecttypephase resultset trxname trxname get project type phases return array of phases public m project type task get tasks array list m project type task list new array list m project type task string sql select from c task where c phase id order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc phase id result set rs pstmt execute query while rs next list add new m project type task get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m project type task ret value new m project type task list size list to array ret value return ret value mprojecttypetask gettasks arraylist mprojecttypetask arraylist mprojecttypetask c_task c_phase_id seqno preparedstatement preparestatement get_trxname setint getc_phase_id resultset executequery mprojecttypetask getctx get_trxname sqlexception sqlexception mprojecttypetask retvalue mprojecttypetask toarray retvalue retvalue standard constructor public x ad wf nextcondition properties ctx int ad wf nextcondition id string trx name super ctx ad wf nextcondition id trx name if ad wf nextcondition id 0 setad column id 0 setad wf nextcondition id 0 setad wf nodenext id 0 set and or null o set entity type null u set operation null set seq no 0 sql select coalesce max seq no 0 10 as default value from ad wf nextcondition where ad wf nodenext id ad wf nodenext id set value null x_ad_wf_nextcondition ad_wf_nextcondition_id trxname ad_wf_nextcondition_id trxname ad_wf_nextcondition_id setad_column_id setad_wf_nextcondition_id setad_wf_nodenext_id setandor setentitytype setoperation setseqno seqno defaultvalue ad_wf_nextcondition ad_wf_nodenext_id ad_wf_nodenext_id setvalue load constructor public x ad wf nextcondition properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_nextcondition resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf nextcondition append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_nextcondition get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set transition condition workflow node transition condition public void setad wf nextcondition id int ad wf nextcondition id if ad wf nextcondition id 1 throw new illegal argument exception ad wf nextcondition id is mandatory set valuenocheck ad wf nextcondition id new integer ad wf nextcondition id setad_wf_nextcondition_id ad_wf_nextcondition_id ad_wf_nextcondition_id illegalargumentexception ad_wf_nextcondition_id set_valuenocheck ad_wf_nextcondition_id ad_wf_nextcondition_id get transition condition workflow node transition condition public int getad wf nextcondition id integer ii integer get value ad wf nextcondition id if ii null return 0 return ii int value getad_wf_nextcondition_id get_value ad_wf_nextcondition_id intvalue set node transition workflow node transition public void setad wf nodenext id int ad wf nodenext id if ad wf nodenext id 1 throw new illegal argument exception ad wf nodenext id is mandatory set valuenocheck ad wf nodenext id new integer ad wf nodenext id setad_wf_nodenext_id ad_wf_nodenext_id ad_wf_nodenext_id illegalargumentexception ad_wf_nodenext_id set_valuenocheck ad_wf_nodenext_id ad_wf_nodenext_id get node transition workflow node transition public int getad wf nodenext id integer ii integer get value ad wf nodenext id if ii null return 0 return ii int value getad_wf_nodenext_id get_value ad_wf_nodenext_id intvalue public static final string andor or o set and or logical operation and or or public void set and or string and or if and or null throw new illegal argument exception and or is mandatory if and or equals a and or equals o else throw new illegal argument exception and or invalid value and or reference id 204 a o if and or length 1 log warning length 1 truncated and or and or substring 0 0 set value and or and or andor_or setandor andor andor illegalargumentexception andor andor andor illegalargumentexception andor andor reference_id andor andor andor set_value andor andor get and or logical operation and or or public string get and or return string get value and or getandor get_value andor public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype public static final string operation like set operation compare operation public void set operation string operation if operation null throw new illegal argument exception operation is mandatory if operation equals operation equals operation equals operation equals operation equals operation equals operation equals ab operation equals sq operation equals else throw new illegal argument exception operation invalid value operation reference id 205 ab sq if operation length 2 log warning length 2 truncated operation operation substring 0 1 set value operation operation operation_like setoperation illegalargumentexception illegalargumentexception reference_id set_value get operation compare operation public string get operation return string get value operation getoperation get_value set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue set value to value to public void set value2 string value2 if value2 null value2 length 40 log warning length 40 truncated value2 value2 substring 0 39 set value value2 value2 setvalue2 set_value get value to value to public string get value2 return string get value value2 getvalue2 get_value basic constructor public var basic constructor param element adds an element to the element public var element element add element element addelement basic constructor param element adds an element to the element public var string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public var add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public var add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public var add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public var add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public var remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param ctx context param test id public m test properties ctx int test id string trx name super ctx test id trx name test_id mtest test_id trxname test_id trxname load constructor param ctx context param rs result set public m test properties ctx result set rs string trx name super ctx rs trx name mtest resultset trxname trxname test object constructor param ctx context param test string test string public m test properties ctx string test string int test no super ctx 0 null test string test string test no set name test string set description test string test string test string set help get description get description sett date new timestamp system current time millis sett datetime new timestamp system current time millis sett integer test no sett amount new big decimal test no sett number env one divide new big decimal test no big decimal round half up setc currency id 100 usd setc location id 109 monroe setc uom id 100 each setc bpartner id c bpartner id setc payment id c payment id setm locator id m locator id setm product id m product id teststring mtest teststring testno teststring teststring _ testno setname teststring setdescription teststring teststring teststring sethelp getdescription getdescription sett_date currenttimemillis sett_datetime currenttimemillis sett_integer testno sett_amount bigdecimal testno sett_number bigdecimal testno bigdecimal round_half_up setc_currency_id setc_location_id setc_uom_id setc_bpartner_id c_bpartner_id setc_payment_id c_payment_id setm_locator_id m_locator_id setm_product_id m_product_id before delete return true if it can be deleted protected boolean before delete log info return true beforedelete after delete param success return success protected boolean after delete boolean success log info success success return success afterdelete before save param new record return true protected boolean before save boolean new record log info new new record return true newrecord beforesave newrecord newrecord after save param new record param success protected boolean after save boolean new record boolean success log info new new record seccess success return success newrecord aftersave newrecord newrecord test param args public static void main string args compiere startup true properties ctx env get ctx test clob m test t1 new m test ctx 0 null t1 set name test1 system out println t1 get character data t1 save t1 set character data long text jj t1 save int test id t1 gettest id m test t2 new m test env get ctx test id null system out println t2 get character data t2 delete true volume test for int i 1 i 20000 i new m test ctx test i save getctx mtest mtest setname getcharacterdata setcharacterdata test_id gettest_id mtest mtest getctx test_id getcharacterdata mtest standard constructor public x c payselectionline properties ctx int c payselectionline id string trx name super ctx c payselectionline id trx name if c payselectionline id 0 setc invoice id 0 setc payselectionline id 0 setc payselection id 0 set difference amt env zero set discount amt env zero set is manual false set isso trx false set line 0 sql select nvl max line 0 10 as default value from c payselectionline where c payselection id c payselection id set open amt env zero set pay amt env zero set payment rule null s set processed false n x_c_payselectionline c_payselectionline_id trxname c_payselectionline_id trxname c_payselectionline_id setc_invoice_id setc_payselectionline_id setc_payselection_id setdifferenceamt setdiscountamt setismanual setissotrx setline defaultvalue c_payselectionline c_payselection_id c_payselection_id setopenamt setpayamt setpaymentrule setprocessed load constructor public x c payselectionline properties ctx result set rs string trx name super ctx rs trx name x_c_payselectionline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c payselectionline append get id append return sb to string tostring stringbuffer stringbuffer x_c_payselectionline get_id tostring set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set pay selection check payment selection check public void setc payselectioncheck id int c payselectioncheck id if c payselectioncheck id 0 set value c payselectioncheck id null else set value c payselectioncheck id new integer c payselectioncheck id setc_payselectioncheck_id c_payselectioncheck_id c_payselectioncheck_id set_value c_payselectioncheck_id set_value c_payselectioncheck_id c_payselectioncheck_id get pay selection check payment selection check public int getc payselectioncheck id integer ii integer get value c payselectioncheck id if ii null return 0 return ii int value getc_payselectioncheck_id get_value c_payselectioncheck_id intvalue set payment selection line payment selection line public void setc payselectionline id int c payselectionline id if c payselectionline id 1 throw new illegal argument exception c payselectionline id is mandatory set valuenocheck c payselectionline id new integer c payselectionline id setc_payselectionline_id c_payselectionline_id c_payselectionline_id illegalargumentexception c_payselectionline_id set_valuenocheck c_payselectionline_id c_payselectionline_id get payment selection line payment selection line public int getc payselectionline id integer ii integer get value c payselectionline id if ii null return 0 return ii int value getc_payselectionline_id get_value c_payselectionline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc payselectionline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_payselectionline_id set payment selection payment selection public void setc payselection id int c payselection id if c payselection id 1 throw new illegal argument exception c payselection id is mandatory set valuenocheck c payselection id new integer c payselection id setc_payselection_id c_payselection_id c_payselection_id illegalargumentexception c_payselection_id set_valuenocheck c_payselection_id c_payselection_id get payment selection payment selection public int getc payselection id integer ii integer get value c payselection id if ii null return 0 return ii int value getc_payselection_id get_value c_payselection_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set difference difference amount public void set difference amt big decimal difference amt if difference amt null throw new illegal argument exception difference amt is mandatory set valuenocheck difference amt difference amt setdifferenceamt bigdecimal differenceamt differenceamt illegalargumentexception differenceamt set_valuenocheck differenceamt differenceamt get difference difference amount public big decimal get difference amt big decimal bd big decimal get value difference amt if bd null return env zero return bd bigdecimal getdifferenceamt bigdecimal bigdecimal get_value differenceamt set discount amount calculated amount of discount public void set discount amt big decimal discount amt if discount amt null throw new illegal argument exception discount amt is mandatory set valuenocheck discount amt discount amt setdiscountamt bigdecimal discountamt discountamt illegalargumentexception discountamt set_valuenocheck discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set open amount open item amount public void set open amt big decimal open amt if open amt null throw new illegal argument exception open amt is mandatory set valuenocheck open amt open amt setopenamt bigdecimal openamt openamt illegalargumentexception openamt set_valuenocheck openamt openamt get open amount open item amount public big decimal get open amt big decimal bd big decimal get value open amt if bd null return env zero return bd bigdecimal getopenamt bigdecimal bigdecimal get_value openamt set payment amount amount being paid public void set pay amt big decimal pay amt if pay amt null throw new illegal argument exception pay amt is mandatory set value pay amt pay amt setpayamt bigdecimal payamt payamt illegalargumentexception payamt set_value payamt payamt get payment amount amount being paid public big decimal get pay amt big decimal bd big decimal get value pay amt if bd null return env zero return bd bigdecimal getpayamt bigdecimal bigdecimal get_value payamt public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue public c dialog throws headless exception this frame null false cdialog headlessexception public c dialog frame owner throws headless exception this owner false cdialog headlessexception public c dialog frame owner boolean modal throws headless exception this owner null modal cdialog headlessexception public c dialog frame owner string title throws headless exception this owner title false cdialog headlessexception public c dialog frame owner string title boolean modal throws headless exception super owner title modal cdialog headlessexception public c dialog frame owner string title boolean modal graphics configuration gc super owner title modal gc cdialog graphicsconfiguration public c dialog dialog owner throws headless exception this owner false cdialog headlessexception public c dialog dialog owner boolean modal throws headless exception this owner null modal cdialog headlessexception public c dialog dialog owner string title throws headless exception this owner title false cdialog headlessexception public c dialog dialog owner string title boolean modal throws headless exception super owner title modal cdialog headlessexception super owner title modal public c dialog dialog owner string title boolean modal graphics configuration gc throws headless exception super owner title modal gc cdialog graphicsconfiguration headlessexception initialize install alt pause protected void dialog init super dialog init compiere color set background this set default close operation j dialog dispose on close set title get title remove mn container c get content pane if c instanceof j panel j panel panel j panel c panel get action map put action dispose s dialogaction panel get input map j panel when in focused window put s disposekeystroke action dispose dialoginit dialoginit compierecolor setbackground setdefaultcloseoperation jdialog dispose_on_close settitle gettitle getcontentpane jpanel jpanel jpanel getactionmap action_dispose s_dialogaction getinputmap jpanel when_in_focused_window s_disposekeystroke action_dispose see java awt event action listener action performed java awt event action event param e public void action performed action event e actionlistener actionperformed actionevent actionperformed actionevent see java awt event mouse listener mouse clicked java awt event mouse event param e public void mouse clicked mouse event e mouselistener mouseclicked mouseevent mouseclicked mouseevent see java awt event mouse listener mouse entered java awt event mouse event param e public void mouse entered mouse event e mouselistener mouseentered mouseevent mouseentered mouseevent see java awt event mouse listener mouse exited java awt event mouse event param e public void mouse exited mouse event e mouselistener mouseexited mouseevent mouseexited mouseevent see java awt event mouse listener mouse pressed java awt event mouse event param e public void mouse pressed mouse event e mouselistener mousepressed mouseevent mousepressed mouseevent see java awt event mouse listener mouse released java awt event mouse event param e public void mouse released mouse event e mouselistener mousereleased mouseevent mousereleased mouseevent set title param title title public void set title string title if title null int pos title index of if pos 1 title length pos we have a nemonic int mnemonic title to upper case char at pos 1 if mnemonic title title substring 0 pos title substring pos 1 super set title title settitle indexof touppercase charat settitle dialog action string action name super action name put value abstract action action command key action name dialogaction actionname actionname putvalue abstractaction action_command_key actionname action listener param e event public void action performed action event e if action dispose equals e get action command object source e get source while source null if source instanceof window window source dispose return if source instanceof container source container source get parent else source null else system out println action e actionperformed actionevent action_dispose getactioncommand getsource getparent create ui param c return new instance of compiere combo boxui public static componentui createui j component c return new compiere combo boxui compierecomboboxui jcomponent compierecomboboxui static int s no 0 install ui set combo box opaque bug in metal arrow button gets mouse events so add the j combo box mouse listeners to the arrow button see org compiere swing c combo box add mouse listener mouse listener param c componrnt public void installui j component c mouse listener ml c get mouse listeners super installui c c set opaque false for int i 0 i ml length i system out println adding c get class get name arrow button add mouse listener ml i s_no combobox arrowbutton jcombobox mouselisteners arrowbutton ccombobox addmouselistener mouselistener jcomponent mouselistener getmouselisteners setopaque getclass getname arrowbutton addmouselistener create opaque button return opaque button protected j button create arrow button j button button super create arrow button button set content area filled false button set opaque false return button jbutton createarrowbutton jbutton createarrowbutton setcontentareafilled setopaque create arrow button public j button get arrow button return arrow button createarrowbutton jbutton getarrowbutton arrowbutton set icon of arrow button param default icon public void set icon icon default icon metal combo box button arrow button set combo icon default icon defaulticon seticon defaulticon metalcomboboxbutton arrowbutton setcomboicon defaulticon create popup return compiere combo popup protected combo popup create popup compiere combo popup new popup new compiere combo popup combo box new popup get accessible context set accessible parent combo box return new popup compierecombopopup combopopup createpopup compierecombopopup newpopup compierecombopopup combobox newpopup getaccessiblecontext setaccessibleparent combobox newpopup standard constructor public x ad reportview properties ctx int ad reportview id string trx name super ctx ad reportview id trx name if ad reportview id 0 setad reportview id 0 setad table id 0 set entity type null u set name null x_ad_reportview ad_reportview_id trxname ad_reportview_id trxname ad_reportview_id setad_reportview_id setad_table_id setentitytype setname load constructor public x ad reportview properties ctx result set rs string trx name super ctx rs trx name x_ad_reportview resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad reportview append get id append return sb to string tostring stringbuffer stringbuffer x_ad_reportview get_id tostring set report view view used to generate this report public void setad reportview id int ad reportview id if ad reportview id 1 throw new illegal argument exception ad reportview id is mandatory set valuenocheck ad reportview id new integer ad reportview id setad_reportview_id ad_reportview_id ad_reportview_id illegalargumentexception ad_reportview_id set_valuenocheck ad_reportview_id ad_reportview_id get report view view used to generate this report public int getad reportview id integer ii integer get value ad reportview id if ii null return 0 return ii int value getad_reportview_id get_value ad_reportview_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sql order by fully qualified order by clause public void set order by clause string order by clause if order by clause null order by clause length 2000 log warning length 2000 truncated order by clause order by clause substring 0 1999 set value order by clause order by clause setorderbyclause orderbyclause orderbyclause orderbyclause orderbyclause orderbyclause set_value orderbyclause orderbyclause get sql order by fully qualified order by clause public string get order by clause return string get value order by clause getorderbyclause get_value orderbyclause set sql where fully qualified sql where clause public void set where clause string where clause if where clause null where clause length 2000 log warning length 2000 truncated where clause where clause substring 0 1999 set value where clause where clause setwhereclause whereclause whereclause whereclause whereclause whereclause set_value whereclause whereclause get sql where fully qualified sql where clause public string get where clause return string get value where clause getwhereclause get_value whereclause standard constructor public x i conversion rate properties ctx int i conversion rate id string trx name super ctx i conversion rate id trx name if i conversion rate id 0 seti conversion rate id 0 x_i_conversion_rate i_conversion_rate_id trxname i_conversion_rate_id trxname i_conversion_rate_id seti_conversion_rate_id load constructor public x i conversion rate properties ctx result set rs string trx name super ctx rs trx name x_i_conversion_rate resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i conversion rate append get id append return sb to string tostring stringbuffer stringbuffer x_i_conversion_rate get_id tostring set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set conversion rate rate used for converting currencies public void setc conversion rate id int c conversion rate id if c conversion rate id 0 set value c conversion rate id null else set value c conversion rate id new integer c conversion rate id setc_conversion_rate_id c_conversion_rate_id c_conversion_rate_id set_value c_conversion_rate_id set_value c_conversion_rate_id c_conversion_rate_id get conversion rate rate used for converting currencies public int getc conversion rate id integer ii integer get value c conversion rate id if ii null return 0 return ii int value getc_conversion_rate_id get_value c_conversion_rate_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c currency id to ad reference id 112 set currency to target currency public void setc currency id to int c currency id to set value c currency id to new integer c currency id to c_currency_id_to_ad_reference_id setc_currency_id_to c_currency_id_to set_value c_currency_id_to c_currency_id_to get currency to target currency public int getc currency id to integer ii integer get value c currency id to if ii null return 0 return ii int value getc_currency_id_to get_value c_currency_id_to intvalue set currency type key key value for the currency conversion rate type public void set conversion type value string conversion type value if conversion type value null conversion type value length 40 log warning length 40 truncated conversion type value conversion type value substring 0 39 set value conversion type value conversion type value setconversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue set_value conversiontypevalue conversiontypevalue get currency type key key value for the currency conversion rate type public string get conversion type value return string get value conversion type value getconversiontypevalue get_value conversiontypevalue set create reciprocal rate create reciprocal rate from current information public void set create reciprocal rate boolean create reciprocal rate set value create reciprocal rate new boolean create reciprocal rate setcreatereciprocalrate createreciprocalrate set_value createreciprocalrate createreciprocalrate get create reciprocal rate create reciprocal rate from current information public boolean is create reciprocal rate object oo get value create reciprocal rate if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatereciprocalrate get_value createreciprocalrate booleanvalue set divide rate to convert source number to target number the source is divided public void set divide rate big decimal divide rate set value divide rate divide rate setdividerate bigdecimal dividerate set_value dividerate dividerate get divide rate to convert source number to target number the source is divided public big decimal get divide rate big decimal bd big decimal get value divide rate if bd null return env zero return bd bigdecimal getdividerate bigdecimal bigdecimal get_value dividerate set iso currency code three letter iso 4217 code of the currency public void setiso code string iso code if iso code null iso code length 3 log warning length 3 truncated iso code iso code substring 0 2 set value iso code iso code setiso_code iso_code iso_code iso_code iso_code iso_code set_value iso_code iso_code get iso currency code three letter iso 4217 code of the currency public string getiso code return string get value iso code getiso_code get_value iso_code set iso currency to code three letter iso 4217 code of the to currency public void setiso code to string iso code to if iso code to null iso code to length 3 log warning length 3 truncated iso code to iso code to substring 0 2 set value iso code to iso code to setiso_code_to iso_code_to iso_code_to iso_code_to iso_code_to iso_code_to set_value iso_code_to iso_code_to get iso currency to code three letter iso 4217 code of the to currency public string getiso code to return string get value iso code to getiso_code_to get_value iso_code_to set import conversion rate import currency conversion rate public void seti conversion rate id int i conversion rate id if i conversion rate id 1 throw new illegal argument exception i conversion rate id is mandatory set valuenocheck i conversion rate id new integer i conversion rate id seti_conversion_rate_id i_conversion_rate_id i_conversion_rate_id illegalargumentexception i_conversion_rate_id set_valuenocheck i_conversion_rate_id i_conversion_rate_id get import conversion rate import currency conversion rate public int geti conversion rate id integer ii integer get value i conversion rate id if ii null return 0 return ii int value geti_conversion_rate_id get_value i_conversion_rate_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geti conversion rate id intvalue keynamepair getkeynamepair keynamepair get_id valueof geti_conversion_rate_id set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set multiply rate rate to multiple the source by to calculate the target public void set multiply rate big decimal multiply rate set value multiply rate multiply rate setmultiplyrate bigdecimal multiplyrate set_value multiplyrate multiplyrate get multiply rate rate to multiple the source by to calculate the target public big decimal get multiply rate big decimal bd big decimal get value multiply rate if bd null return env zero return bd bigdecimal getmultiplyrate bigdecimal bigdecimal get_value multiplyrate set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto constructor param table name table name param column name column name param where clause where param display type display type param value value public po lob string table name string column name string where clause int display type object value m tablename table name m columnname column name m whereclause where clause m displaytype display type m value value tablename columnname whereclause displaytype po_lob tablename columnname whereclause displaytype m_tablename tablename m_columnname columnname m_whereclause whereclause m_displaytype displaytype m_value save lob param where clause clause param trx name trx name return true if saved public boolean save string where clause string trx name m whereclause where clause return save trx name whereclause trxname whereclause trxname m_whereclause whereclause trxname save lob see also org compiere session server bean updatelob param trx name trx name return true if saved public boolean save string trx name if m value null m value instanceof string m value instanceof byte m value instanceof string m value to string length 0 m value instanceof byte byte m value length 0 string buffer sql new string buffer update append m tablename append set append m columnname append null where append m whereclause int no db execute update sql to string trx name log fine save trx name no no data set to null m value if no 0 log warning trx name not updated sql return true string buffer sql new string buffer update append m tablename append set append m columnname append where append m whereclause boolean success true if db is remote objects log fine trx name remote m value server server c connection get get server try if server null see server bean success server updatelob sql to string m displaytype m value if c log mgt is level finest log fine server success if success return true log log level severe apps server not found catch remote exception ex log log level severe apps server error ex log fine trx name local m value connection trx trx null if trx name null trx trx get trx name false connection con null create connection if trx null con trx get connection if con null con db create connection false connection transaction read committed if con null log log level severe could not get connection return false prepared statement pstmt null success true try pstmt con prepare statement sql to string if m displaytype display type text long pstmt set string 1 string m value else pstmt set bytes 1 byte m value int no pstmt execute update if no 1 log fine trx name not updated no sql success false pstmt close pstmt null catch exception e log log level fine trx name sql e success false close statement try if pstmt null pstmt close pstmt null catch exception e pstmt null success commit local trx if success if trx null trx null con null else try con commit con close con null catch exception e log log level severe trx name commit e success false error roll back if success log severe trx name rollback if trx null trx rollback trx null con null else try con rollback con close con null catch exception ee log log level severe trx name rollback ee clean connection try if con null con close con null catch exception e con null return success serverbean trxname trxname m_value m_value m_value m_value m_value tostring m_value m_value stringbuffer stringbuffer m_tablename m_columnname m_whereclause executeupdate tostring trxname trxname m_value trxname stringbuffer stringbuffer m_tablename m_columnname m_whereclause isremoteobjects trxname m_value cconnection getserver serverbean tostring m_displaytype m_value clogmgt islevelfinest appsserver remoteexception appsserver trxname m_value trxname trxname getconnection createconnection transaction_read_committed preparedstatement preparestatement tostring m_displaytype displaytype textlong setstring m_value setbytes m_value executeupdate trxname trxname trxname trxname trxname string representation return info public string to string string buffer sb new string buffer po lob sb append m tablename append append m columnname append display type append m displaytype append return sb to string tostring stringbuffer stringbuffer po_lob m_tablename m_columnname displaytype m_displaytype tostring get material allocations for line param ctx context param m inoutline id line param trx name trx return allocations public static m in out linema get properties ctx int m inoutline id string trx name array list m in out linema list new array list m in out linema string sql select from m inoutlinema where m inoutline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inoutline id result set rs pstmt execute query while rs next list add new m in out linema ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m in out linema ret value new m in out linema list size list to array ret value return ret value m_inoutline_id trxname minoutlinema m_inoutline_id trxname arraylist minoutlinema arraylist minoutlinema m_inoutlinema m_inoutline_id preparedstatement preparestatement trxname setint m_inoutline_id resultset executequery minoutlinema trxname s_log minoutlinema retvalue minoutlinema toarray retvalue retvalue delete all material allocation for in out param m inout id shipment return number of rows deleted or 1 for error public static int delete in outma int m inout id string trx name string sql delete from m inoutlinema ma where exists select from m inoutline l where l m inoutline id ma m inoutline id and m inout id m inout id return db execute update sql trx name inout m_inout_id deleteinoutma m_inout_id trxname m_inoutlinema m_inoutline m_inoutline_id m_inoutline_id m_inout_id m_inout_id executeupdate trxname standard constructor param ctx context param m inoutlinema id ignored param trx name trx public m in out linema properties ctx int m inoutlinema id string trx name super ctx m inoutlinema id trx name if m inoutlinema id 0 throw new illegal argument exception multi key m_inoutlinema_id trxname minoutlinema m_inoutlinema_id trxname m_inoutlinema_id trxname m_inoutlinema_id illegalargumentexception load cosntructor param ctx context param rs result set param trx name trx public m in out linema properties ctx result set rs string trx name super ctx rs trx name trxname minoutlinema resultset trxname trxname parent constructor param parent parent param m attributesetinstance id asi param movement qty qty public m in out linema m in out line parent int m attributesetinstance id big decimal movement qty this parent get ctx 0 parent get trxname set client org parent setm inoutline id parent getm inoutline id setm attributesetinstance id m attributesetinstance id set movement qty movement qty m_attributesetinstance_id movementqty minoutlinema minoutline m_attributesetinstance_id bigdecimal movementqty getctx get_trxname setclientorg setm_inoutline_id getm_inoutline_id setm_attributesetinstance_id m_attributesetinstance_id setmovementqty movementqty string representation return info public string to string string buffer sb new string buffer m in out linema sb append m inoutline id append getm inoutline id append m attributesetinstance id append getm attributesetinstance id append qty append get movement qty append return sb to string tostring stringbuffer stringbuffer minoutlinema m_inoutline_id getm_inoutline_id m_attributesetinstance_id getm_attributesetinstance_id getmovementqty tostring order test param no thread number param number orders number of orders to create public order test int no int number orders int avg lines super m no no m numberorders number orders m maxlines avg lines 2 ordertest numberorders ordertest numberorders avglines m_no m_numberorders numberorders m_maxlines avglines run public void run long time system current time millis int count 0 mb partner bp new mb partner env get ctx 117 null bp setso credit status mb partner socreditstatus nocreditcheck bp save for int i 0 i m numberorders i trx trx trx get trx create trx name test m no i true trx start m order order new m order env get ctx 0 trx get trx name order set description m no i order setc doctypetarget id 135 pos order setc bpartner id 117 c w order setsalesrep id 101 garden admin order set delivery rule m order deliveryrule force if order save log warning m no i not saved 1 m errors continue random r new random int lines number r next int m maxlines 1 for int j 0 j lines number j m order line line new m order line order line setm product id 123 oak tree line set qty new big decimal 5 if line save log warning m no i line not saved m errors process order set doc action doc action action complete if order process it doc action action complete log warning m no i not processed m errors trx rollback trx close continue if order save log warning m no i not saved 2 m errors else count trx commit trx close log info order to string time system current time millis time log warning m no errors m errors count count float count 100 m numberorders time ms ea float time count ms currenttimemillis mbpartner mbpartner getctx setsocreditstatus mbpartner socreditstatus_nocreditcheck m_numberorders createtrxname m_no _ morder morder getctx gettrxname setdescription m_no _ setc_doctypetarget_id setc_bpartner_id setsalesrep_id gardenadmin setdeliveryrule morder deliveryrule_force m_no _ m_errors linesnumber nextint m_maxlines linesnumber morderline morderline setm_product_id setqty bigdecimal m_no _ m_errors setdocaction docaction action_complete processit docaction action_complete m_no _ m_errors m_no _ m_errors tostring currenttimemillis m_no m_errors m_numberorders test param args ignored public static void main string args compiere startup true c log mgt set logger level level info null c log mgt set level level info ini set property ini p uid super user ini set property ini p pwd system ini set property ini p role garden world admin ini set property ini p client garden world ini set property ini p org hq ini set property ini p warehouse hq warehouse ini set property ini p language english login login new login env get ctx if login batch login null system exit 1 c log mgt set logger level level warning null c log mgt set level level warning int no tests 2 int no orders 200 int no lines 20 long time system current time millis thread tests new thread no tests for int i 0 i tests length i tests i new thread new order test i no orders no lines tests i start wait for int i 0 i tests length i try tests i join catch interrupted exception e time system current time millis time system out println time ms time clogmgt setloggerlevel clogmgt setlevel setproperty p_uid superuser setproperty p_pwd setproperty p_role gardenworld setproperty p_client gardenworld setproperty p_org setproperty p_warehouse setproperty p_language getctx batchlogin clogmgt setloggerlevel clogmgt setlevel no_tests no_orders no_lines currenttimemillis no_tests ordertest no_orders no_lines interruptedexception currenttimemillis get price list param ad client id client param m pricelist id price list param search string query search string param product category query product category string param all records all if no query return price list public static price list get properties ctx int ad client id int m pricelist id string search string string product category boolean all records search parameter string search search string if search null search length 0 search equals search null if search null if search ends with search if search starts with search search search search to upper case int m product category id 0 try if product category null product category length 0 m product category id integer parse int product category catch exception e if m product category id 0 m product category id 0 search price list cache string key string value of ad client id m pricelist id price list ret value null if search null m product category id 0 all records ret value price list s cache get key create new if ret value null ret value new price list ctx ad client id m pricelist id search m product category id all records if search null m product category id 0 all records s cache put key ret value return ret value ad_client_id m_pricelist_id searchstring productcategory allrecords pricelist ad_client_id m_pricelist_id searchstring productcategory allrecords searchstring endswith startswith touppercase m_product_category_id productcategory productcategory m_product_category_id parseint productcategory m_product_category_id m_product_category_id valueof ad_client_id _ m_pricelist_id pricelist retvalue m_product_category_id allrecords retvalue pricelist s_cache retvalue retvalue pricelist ad_client_id m_pricelist_id m_product_category_id allrecords m_product_category_id allrecords s_cache retvalue retvalue price list constructor param ctx context param ad client id client param m pricelist id optional price list param search string query search string param m product category id query product category param all records all if no query private price list properties ctx int ad client id int m pricelist id string search string int m product category id boolean all records log finer ad client id ad client id m pricelist id m pricelist id search search string m product category id m product category id all all records m ctx ctx get price list if getm pricelist id ad client id m pricelist id 0 if getm pricelist id ad client id 0 0 return get price list version getm pricelist version id m pricelist id new timestamp system current time millis load products search string m product category id all records pricelist ad_client_id m_pricelist_id searchstring m_product_category_id allrecords pricelist ad_client_id m_pricelist_id searchstring m_product_category_id allrecords ad_client_id ad_client_id m_pricelist_id m_pricelist_id searchstring m_product_category_id m_product_category_id allrecords m_ctx getm_pricelist_id ad_client_id m_pricelist_id getm_pricelist_id ad_client_id getm_pricelist_version_id m_pricelist_id currenttimemillis loadproducts searchstring m_product_category_id allrecords find price list param ad client id client param m pricelist id optional price list return m pricelist id private int getm pricelist id int ad client id int m pricelist id string sql select m pricelist id pl name pl description pl is tax included 1 4 c iso code c cur symbol cc ad language 5 7 from m pricelist pl inner join c currency c on pl c currency id c c currency id begin globalqss 29 09 2005 problem with postgres port left outer join c country cc on c c currency id cc c currency id and rownum 1 left outer join c country cc on c c currency id cc c currency id end globalqss 29 09 2005 where pl is active y and pl ad client id 1 if m pricelist id 0 sql and pl m pricelist id 2 else sql order by pl is default desc m pricelist id 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id if m pricelist id 0 pstmt set int 2 m pricelist id result set rs pstmt execute query if rs next m pricelist id rs get int 1 m name rs get string 2 m description rs get string 3 m taxincluded y equals rs get string 4 m currency rs get string 5 m cursymbol rs get string 6 m ad language rs get string 7 rs close pstmt close pstmt null catch exception e log log level severe getm pricelist id e finally try if pstmt null pstmt close catch exception e pstmt null return m pricelist id ad_client_id m_pricelist_id m_pricelist_id getm_pricelist_id ad_client_id m_pricelist_id m_pricelist_id istaxincluded iso_code cursymbol ad_language m_pricelist c_currency c_currency_id c_currency_id c_country c_currency_id c_currency_id c_country c_currency_id c_currency_id isactive ad_client_id m_pricelist_id m_pricelist_id isdefault m_pricelist_id preparedstatement preparestatement setint ad_client_id m_pricelist_id setint m_pricelist_id resultset executequery m_pricelist_id getint m_name getstring m_description getstring m_taxincluded getstring m_currency getstring m_cursymbol getstring m_ad_language getstring getm_pricelist_id m_pricelist_id get pl version param m pricelist id price list param day valid day return m pricelist version id private int getm pricelist version id int m pricelist id timestamp day string sql select plv m pricelist version id plv name plv description plv valid from 1 4 from m pricelist version plv where plv m pricelist id 1 and plv valid from 2 order by plv valid from desc prepared statement pstmt null m pricelist version id 0 try pstmt db prepare statement sql null pstmt set int 1 m pricelist id pstmt set timestamp 2 day result set rs pstmt execute query if rs next m pricelist version id rs get int 1 m name rs get string 2 m description rs get string 3 m validfrom rs get timestamp 4 rs close pstmt close pstmt null catch exception e log log level severe getm pricelist version id e finally try if pstmt null pstmt close catch exception e pstmt null return m pricelist version id m_pricelist_id m_pricelist_version_id getm_pricelist_version_id m_pricelist_id m_pricelist_version_id validfrom m_pricelist_version m_pricelist_id validfrom validfrom preparedstatement m_pricelist_version_id preparestatement setint m_pricelist_id settimestamp resultset executequery m_pricelist_version_id getint m_name getstring m_description getstring m_validfrom gettimestamp getm_pricelist_version_id m_pricelist_version_id load from product price param search string query search string param m product category id query product category param all records all only true if called from basket servlet private void load products string search string int m product category id boolean all records set search string log finer load products m pricelist version id m pricelist version id search search string m product category id m product category id m searchinfo if search string null m searchinfo search string if m product category id 0 if m searchinfo length 0 m searchinfo m searchinfo m product category get m ctx m product category id get name m prices clear m notallprices false string sql select p m product id p value p name p description 1 4 p help p document note p imageurl p descriptionurl 5 8 pp price std uom name uom uom symbol 9 11 from m productprice pp inner join m product p on pp m product id p m product id and p is active y and p is sold y inner join c uom uom on p c uom id uom c uom id where pp m pricelist version id 1 and pp price std 0 and p is self service y if search string null sql and upper p value p name p description like 2 if m product category id 0 sql and p m product category id 3 if all records search string null m product category id 0 sql and p is web store featured y m notallprices true sql order by p m product category id p value log fine load products sql prepared statement pstmt null try pstmt db prepare statement sql null int index 1 pstmt set int index m pricelist version id if search string null pstmt set string index search string if m product category id 0 pstmt set int index m product category id result set rs pstmt execute query int no 0 while rs next m prices add new price list product rs get int 1 rs get string 2 rs get string 3 rs get string 4 rs get string 5 rs get string 6 rs get string 7 rs get string 8 rs get big decimal 9 rs get string 10 rs get string 11 if not all records limit list if all records no max lines m notallprices true break rs close pstmt close pstmt null catch exception e log log level severe load e finally try if pstmt null pstmt close catch exception e pstmt null log fine load m prices size search m searchinfo searchstring m_product_category_id allrecords basketservlet loadproducts searchstring m_product_category_id allrecords loadproducts m_pricelist_version_id m_pricelist_version_id searchstring m_product_category_id m_product_category_id m_searchinfo searchstring m_searchinfo searchstring m_product_category_id m_searchinfo m_searchinfo m_searchinfo mproductcategory m_ctx m_product_category_id getname m_prices m_notallprices m_product_id documentnote pricestd uomsymbol m_productprice m_product m_product_id m_product_id isactive issold c_uom c_uom_id c_uom_id m_pricelist_version_id pricestd isselfservice searchstring m_product_category_id m_product_category_id allrecords searchstring m_product_category_id iswebstorefeatured m_notallprices m_product_category_id loadproducts preparedstatement preparestatement setint m_pricelist_version_id searchstring setstring searchstring m_product_category_id setint m_product_category_id resultset executequery m_prices pricelistproduct getint getstring getstring getstring getstring getstring getstring getstring getbigdecimal getstring getstring allrecords max_lines m_notallprices m_prices m_searchinfo string representation return info public string to string string buffer sb new string buffer price list sb append m prices size append return sb to string tostring stringbuffer stringbuffer pricelist m_prices tostring get count return size public int get price count return m prices size getpricecount m_prices no prices return true if no prices public boolean is no lines return get price count 0 isnolines getpricecount not all prices displayed return true if no prices public boolean is not all prices return m notallprices isnotallprices m_notallprices get prices return price array list public array list get prices return m prices arraylist getprices m_prices get price list for product implementation assumes a relatively small price list 200 param m product id product return price list info or null public price list product get price list product int m product id for int i 0 i m prices size i price list product plp price list product m prices get i if plp get id m product id return plp return null m_product_id pricelistproduct getpricelistproduct m_product_id m_prices pricelistproduct pricelistproduct m_prices getid m_product_id get search info return search info public string get search info return m searchinfo getsearchinfo m_searchinfo get name return price list name public string get name return m name getname m_name return m name public string get description return m description m_name getdescription m_description return m description public string get currency return m currency m_description getcurrency m_currency return m currency public string get cur symbol return m cursymbol m_currency getcursymbol m_cursymbol return m cursymbol public string getad language return m ad language m_cursymbol getad_language m_ad_language return m ad language public boolean is tax included return m taxincluded m_ad_language istaxincluded m_taxincluded return m taxincluded public int getpricelist id return m pricelist id m_taxincluded getpricelist_id m_pricelist_id return m pricelist id public int getpricelist version id return m pricelist version id m_pricelist_id getpricelist_version_id m_pricelist_version_id standard constructor public x c bankaccountdoc properties ctx int c bankaccountdoc id string trx name super ctx c bankaccountdoc id trx name if c bankaccountdoc id 0 setc bankaccountdoc id 0 setc bankaccount id 0 set current next 0 set name null set payment rule null x_c_bankaccountdoc c_bankaccountdoc_id trxname c_bankaccountdoc_id trxname c_bankaccountdoc_id setc_bankaccountdoc_id setc_bankaccount_id setcurrentnext setname setpaymentrule load constructor public x c bankaccountdoc properties ctx result set rs string trx name super ctx rs trx name x_c_bankaccountdoc resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankaccountdoc append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankaccountdoc get_id tostring set bank account document checks transfers etc public void setc bankaccountdoc id int c bankaccountdoc id if c bankaccountdoc id 1 throw new illegal argument exception c bankaccountdoc id is mandatory set valuenocheck c bankaccountdoc id new integer c bankaccountdoc id setc_bankaccountdoc_id c_bankaccountdoc_id c_bankaccountdoc_id illegalargumentexception c_bankaccountdoc_id set_valuenocheck c_bankaccountdoc_id c_bankaccountdoc_id get bank account document checks transfers etc public int getc bankaccountdoc id integer ii integer get value c bankaccountdoc id if ii null return 0 return ii int value getc_bankaccountdoc_id get_value c_bankaccountdoc_id intvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set valuenocheck c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_valuenocheck c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue public static final int check printformat id ad reference id 268 set check print format print format for printing checks public void setcheck printformat id int check printformat id if check printformat id 0 set value check printformat id null else set value check printformat id new integer check printformat id check_printformat_id_ad_reference_id setcheck_printformat_id check_printformat_id check_printformat_id set_value check_printformat_id set_value check_printformat_id check_printformat_id get check print format print format for printing checks public int getcheck printformat id integer ii integer get value check printformat id if ii null return 0 return ii int value getcheck_printformat_id get_value check_printformat_id intvalue set current next the next number to be used public void set current next int current next set value current next new integer current next setcurrentnext currentnext set_value currentnext currentnext get current next the next number to be used public int get current next integer ii integer get value current next if ii null return 0 return ii int value getcurrentnext get_value currentnext intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule standard constructor public x c acctschema properties ctx int c acctschema id string trx name super ctx c acctschema id trx name if c acctschema id 0 set auto period control false setc acctschema id 0 setc currency id 0 set commitment type null n set costing level null c set costing method null s setgaap null set has alias false set has combination false set is accrual true y set is adjustcogs false set is discount corrects tax false set is explicit cost adjustment false n set is post services false n set is trade discount posted false setm costtype id 0 set name null set separator null x_c_acctschema c_acctschema_id trxname c_acctschema_id trxname c_acctschema_id setautoperiodcontrol setc_acctschema_id setc_currency_id setcommitmenttype setcostinglevel setcostingmethod sethasalias sethascombination setisaccrual setisadjustcogs setisdiscountcorrectstax setisexplicitcostadjustment setispostservices setistradediscountposted setm_costtype_id setname setseparator load constructor public x c acctschema properties ctx result set rs string trx name super ctx rs trx name x_c_acctschema resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctschema append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctschema get_id tostring public static final int ad orgonly id ad reference id 322 set only organization create posting entries only for this organization public void setad orgonly id int ad orgonly id if ad orgonly id 0 set value ad orgonly id null else set value ad orgonly id new integer ad orgonly id ad_orgonly_id_ad_reference_id setad_orgonly_id ad_orgonly_id ad_orgonly_id set_value ad_orgonly_id set_value ad_orgonly_id ad_orgonly_id get only organization create posting entries only for this organization public int getad orgonly id integer ii integer get value ad orgonly id if ii null return 0 return ii int value getad_orgonly_id get_value ad_orgonly_id intvalue set automatic period control if selected the periods are automatically opened and closed public void set auto period control boolean auto period control set value auto period control new boolean auto period control setautoperiodcontrol autoperiodcontrol set_value autoperiodcontrol autoperiodcontrol get automatic period control if selected the periods are automatically opened and closed public boolean is auto period control object oo get value auto period control if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isautoperiodcontrol get_value autoperiodcontrol booleanvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set period period of the calendar public void setc period id int c period id if c period id 0 set valuenocheck c period id null else set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id set_valuenocheck c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue public static final string commitmenttype none n set commitment type create commitment and or reservations for budget control public void set commitment type string commitment type if commitment type null throw new illegal argument exception commitment type is mandatory if commitment type equals b commitment type equals c commitment type equals n else throw new illegal argument exception commitment type invalid value commitment type reference id 359 b c n if commitment type length 1 log warning length 1 truncated commitment type commitment type substring 0 0 set value commitment type commitment type commitmenttype_none setcommitmenttype commitmenttype commitmenttype illegalargumentexception commitmenttype commitmenttype commitmenttype commitmenttype illegalargumentexception commitmenttype commitmenttype reference_id commitmenttype commitmenttype commitmenttype set_value commitmenttype commitmenttype get commitment type create commitment and or reservations for budget control public string get commitment type return string get value commitment type getcommitmenttype get_value commitmenttype public static final string costinglevel organization o set costing level the lowest level to accumulate costing information public void set costing level string costing level if costing level null throw new illegal argument exception costing level is mandatory if costing level equals b costing level equals c costing level equals o else throw new illegal argument exception costing level invalid value costing level reference id 355 b c o if costing level length 1 log warning length 1 truncated costing level costing level substring 0 0 set value costing level costing level costinglevel_organization setcostinglevel costinglevel costinglevel illegalargumentexception costinglevel costinglevel costinglevel costinglevel illegalargumentexception costinglevel costinglevel reference_id costinglevel costinglevel costinglevel set_value costinglevel costinglevel get costing level the lowest level to accumulate costing information public string get costing level return string get value costing level getcostinglevel get_value costinglevel public static final string costingmethod x set costing method indicates how costs will be calculated public void set costing method string costing method if costing method null throw new illegal argument exception costing method is mandatory if costing method equals a costing method equals f costing method equals i costing method equals l costing method equals s costing method equals u costing method equals i costing method equals p costing method equals x else throw new illegal argument exception costing method invalid value costing method reference id 122 a f i l s u i p x if costing method length 1 log warning length 1 truncated costing method costing method substring 0 0 set value costing method costing method costingmethod__ setcostingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod costingmethod illegalargumentexception costingmethod costingmethod reference_id costingmethod costingmethod costingmethod set_value costingmethod costingmethod get costing method indicates how costs will be calculated public string get costing method return string get value costing method getcostingmethod get_value costingmethod set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string gaap customaccountingrules xx set gaap generally accepted accounting principles public void setgaap string gaap if gaap null throw new illegal argument exception gaap is mandatory if gaap equals de gaap equals fr gaap equals un gaap equals us gaap equals xx else throw new illegal argument exception gaap invalid value gaap reference id 123 de fr un us xx if gaap length 2 log warning length 2 truncated gaap gaap substring 0 1 set value gaap gaap gaap_customaccountingrules illegalargumentexception illegalargumentexception reference_id set_value get gaap generally accepted accounting principles public string getgaap return string get value gaap get_value set use account alias ability to select partial account combinations by an alias public void set has alias boolean has alias set value has alias new boolean has alias sethasalias hasalias set_value hasalias hasalias get use account alias ability to select partial account combinations by an alias public boolean is has alias object oo get value has alias if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishasalias get_value hasalias booleanvalue set use account combination control combination of account elements are checked public void set has combination boolean has combination set value has combination new boolean has combination sethascombination hascombination set_value hascombination hascombination get use account combination control combination of account elements are checked public boolean is has combination object oo get value has combination if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishascombination get_value hascombination booleanvalue set accrual indicates if accrual or cash based accounting will be used public void set is accrual boolean is accrual set value is accrual new boolean is accrual setisaccrual isaccrual set_value isaccrual isaccrual get accrual indicates if accrual or cash based accounting will be used public boolean is accrual object oo get value is accrual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isaccrual get_value isaccrual booleanvalue set adjust cogs adjust cost of good sold public void set is adjustcogs boolean is adjustcogs set value is adjustcogs new boolean is adjustcogs setisadjustcogs isadjustcogs set_value isadjustcogs isadjustcogs get adjust cogs adjust cost of good sold public boolean is adjustcogs object oo get value is adjustcogs if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isadjustcogs get_value isadjustcogs booleanvalue set correct tax for discounts charges correct the tax for payment discount and charges public void set is discount corrects tax boolean is discount corrects tax set value is discount corrects tax new boolean is discount corrects tax setisdiscountcorrectstax isdiscountcorrectstax set_value isdiscountcorrectstax isdiscountcorrectstax get correct tax for discounts charges correct the tax for payment discount and charges public boolean is discount corrects tax object oo get value is discount corrects tax if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountcorrectstax get_value isdiscountcorrectstax booleanvalue set explicit cost adjustment post the cost adjustment explicitly public void set is explicit cost adjustment boolean is explicit cost adjustment set value is explicit cost adjustment new boolean is explicit cost adjustment setisexplicitcostadjustment isexplicitcostadjustment set_value isexplicitcostadjustment isexplicitcostadjustment get explicit cost adjustment post the cost adjustment explicitly public boolean is explicit cost adjustment object oo get value is explicit cost adjustment if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isexplicitcostadjustment get_value isexplicitcostadjustment booleanvalue set post services separately differentiate between services and product receivable payables public void set is post services boolean is post services set value is post services new boolean is post services setispostservices ispostservices set_value ispostservices ispostservices get post services separately differentiate between services and product receivable payables public boolean is post services object oo get value is post services if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispostservices get_value ispostservices booleanvalue set post trade discount generate postings for trade discounts public void set is trade discount posted boolean is trade discount posted set value is trade discount posted new boolean is trade discount posted setistradediscountposted istradediscountposted set_value istradediscountposted istradediscountposted get post trade discount generate postings for trade discounts public boolean is trade discount posted object oo get value is trade discount posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istradediscountposted get_value istradediscountposted booleanvalue set cost type type of cost e g current plan future public void setm costtype id int m costtype id if m costtype id 1 throw new illegal argument exception m costtype id is mandatory set value m costtype id new integer m costtype id setm_costtype_id m_costtype_id m_costtype_id illegalargumentexception m_costtype_id set_value m_costtype_id m_costtype_id get cost type type of cost e g current plan future public int getm costtype id integer ii integer get value m costtype id if ii null return 0 return ii int value getm_costtype_id get_value m_costtype_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set future days number of days to be able to post to a future date based on system date public void setperiod openfuture int period openfuture set value period openfuture new integer period openfuture setperiod_openfuture period_openfuture set_value period_openfuture period_openfuture get future days number of days to be able to post to a future date based on system date public int getperiod openfuture integer ii integer get value period openfuture if ii null return 0 return ii int value getperiod_openfuture get_value period_openfuture intvalue set history days number of days to be able to post in the past based on system date public void setperiod openhistory int period openhistory set value period openhistory new integer period openhistory setperiod_openhistory period_openhistory set_value period_openhistory period_openhistory get history days number of days to be able to post in the past based on system date public int getperiod openhistory integer ii integer get value period openhistory if ii null return 0 return ii int value getperiod_openhistory get_value period_openhistory intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set element separator element separator public void set separator string separator if separator null throw new illegal argument exception separator is mandatory if separator length 1 log warning length 1 truncated separator separator substring 0 0 set value separator separator setseparator illegalargumentexception set_value get element separator element separator public string get separator return string get value separator getseparator get_value standard constructor public x c conversiontype properties ctx int c conversiontype id string trx name super ctx c conversiontype id trx name if c conversiontype id 0 setc conversiontype id 0 set is default false set name null set value null x_c_conversiontype c_conversiontype_id trxname c_conversiontype_id trxname c_conversiontype_id setc_conversiontype_id setisdefault setname setvalue load constructor public x c conversiontype properties ctx result set rs string trx name super ctx rs trx name x_c_conversiontype resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c conversiontype append get id append return sb to string tostring stringbuffer stringbuffer x_c_conversiontype get_id tostring set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 1 throw new illegal argument exception c conversiontype id is mandatory set valuenocheck c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id illegalargumentexception c_conversiontype_id set_valuenocheck c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value get msla criteria from cache param ctx context param pa sla criteria id id return msla criteria public static msla criteria get properties ctx int pa sla criteria id string trx name integer key new integer pa sla criteria id msla criteria ret value msla criteria s cache get key if ret value null return ret value ret value new msla criteria ctx pa sla criteria id trx name if ret value get id 0 s cache put key ret value return ret value mslacriteria pa_sla_criteria_id mslacriteria mslacriteria pa_sla_criteria_id trxname pa_sla_criteria_id mslacriteria retvalue mslacriteria s_cache retvalue retvalue retvalue mslacriteria pa_sla_criteria_id trxname retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param pa sla criteria id id public msla criteria properties ctx int pa sla criteria id string trx name super ctx pa sla criteria id trx name pa_sla_criteria_id mslacriteria pa_sla_criteria_id trxname pa_sla_criteria_id trxname load constructor param ctx context param rs result set public msla criteria properties ctx result set rs string trx name super ctx rs trx name mslacriteria resultset trxname trxname get goals of criteria return array of goals public msla goal get goals string sql select from pa sla goal where pa sla criteria id array list msla goal list new array list msla goal prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa sla criteria id result set rs pstmt execute query while rs next list add new msla goal get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null msla goal ret value new msla goal list size list to array ret value return ret value mslagoal getgoals pa_sla_goal pa_sla_criteria_id arraylist mslagoal arraylist mslagoal preparedstatement preparestatement get_trxname setint getpa_sla_criteria_id resultset executequery mslagoal getctx get_trxname mslagoal retvalue mslagoal toarray retvalue retvalue create new instance of sla criteria return instanciated class throws exception public sla criteria new instance throws exception if get classname null get classname length 0 throw new compiere system error no sla criteria classname try class clazz class for name get classname sla criteria ret value sla criteria clazz new instance return ret value catch exception e throw new compiere system error could not intsnciate sla criteria e slacriteria newinstance getclassname getclassname compieresystemerror forname getclassname slacriteria retvalue slacriteria newinstance retvalue compieresystemerror c frame throws headless exception public c frame throws headless exception super cframe headlessexception cframe headlessexception c frame param gc public c frame graphics configuration gc super gc cframe cframe graphicsconfiguration c frame param title throws headless exception public c frame string title throws headless exception super cleanup title cframe headlessexception cframe headlessexception c frame param title param gc public c frame string title graphics configuration gc super cleanup title gc cframe cframe graphicsconfiguration frame init install alt pause protected void frame init super frame init compiere color set background this set default close operation j frame dispose on close container c get content pane if c instanceof j panel j panel panel j panel c panel get action map put c dialog action dispose c dialog s dialogaction panel get input map j panel when in focused window put c dialog s disposekeystroke c dialog action dispose frameinit frameinit compierecolor setbackground setdefaultcloseoperation jframe dispose_on_close getcontentpane jpanel jpanel jpanel getactionmap cdialog action_dispose cdialog s_dialogaction getinputmap jpanel when_in_focused_window cdialog s_disposekeystroke cdialog action_dispose cleanedup title param title title return title w o mn private static string cleanup string title if title null int pos title index of if pos 1 title length pos we have a nemonic int mnemonic title to upper case char at pos 1 if mnemonic title title substring 0 pos title substring pos 1 return title indexof touppercase charat set title param title title public void set title string title super set title cleanup title settitle settitle return returns the ad window id public int getad window id return p ad window id ad_window_id getad_window_id p_ad_window_id param window id the ad window id to set public void setad window id int window id p ad window id window id window_id ad_window_id setad_window_id window_id p_ad_window_id window_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter perform process return message variables are parsed throws exception if not successful protected string do it throws exception log info do it c commissionrun id getrecord id load data m commission run com run new m commission run get ctx getrecord id get trxname if com run get id 0 throw new illegal argument exception commissionap invoice no commission run if env zero compare to com run get grand total 0 throw new illegal argument exception grand total 0 m commission com new m commission get ctx com run getc commission id get trxname if com get id 0 throw new illegal argument exception commissionap invoice no commission if com getc charge id 0 throw new illegal argument exception commissionap invoice no charge on commission mb partner bp new mb partner get ctx com getc bpartner id get trxname if bp get id 0 throw new illegal argument exception commissionap invoice no b partner create invoice m invoice invoice new m invoice get ctx 0 null invoice set client org com getad client id com getad org id invoice setc doctypetarget id m doc type docbasetype apinvoice api invoice setb partner bp invoice set document no com run get document no may cause unique constraint invoice setsalesrep id getad user id caller if com getc currency id invoice getc currency id throw new illegal argument exception commissionap invoice currency of po price list not commission currency if invoice save throw new illegal state exception commissionap invoice cannot save invoice create invoice line m invoice line i line new m invoice line invoice i line setc charge id com getc charge id i line set qty 1 i line set price com run get grand total i line set tax if i line save throw new illegal state exception commissionap invoice cannot save invoice line return c invoice id invoice get document no doit doit c_commissionrun_id getrecord_id mcommissionrun comrun mcommissionrun getctx getrecord_id get_trxname comrun get_id illegalargumentexception commissionapinvoice compareto comrun getgrandtotal illegalargumentexception grandtotal mcommission mcommission getctx comrun getc_commission_id get_trxname get_id illegalargumentexception commissionapinvoice getc_charge_id illegalargumentexception commissionapinvoice mbpartner mbpartner getctx getc_bpartner_id get_trxname get_id illegalargumentexception commissionapinvoice bpartner minvoice minvoice getctx setclientorg getad_client_id getad_org_id setc_doctypetarget_id mdoctype docbasetype_apinvoice setbpartner setdocumentno comrun getdocumentno setsalesrep_id getad_user_id getc_currency_id getc_currency_id illegalargumentexception commissionapinvoice illegalstateexception commissionapinvoice minvoiceline iline minvoiceline iline setc_charge_id getc_charge_id iline setqty iline setprice comrun getgrandtotal iline settax iline illegalstateexception commissionapinvoice c_invoice_id getdocumentno persistency constructor param ctx context param ignored ignored public m rfq response line properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mrfqresponseline trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m rfq response line properties ctx result set rs string trx name super ctx rs trx name mrfqresponseline resultset trxname trxname parent constructor also creates qtys if rfq qty is saved if there are qtys param response response param line line public m rfq response line m rfq response response m rfq line line super response get ctx 0 response get trxname set client org response setc rfqresponse id response getc rfqresponse id setc rfqline id line getc rfqline id set is selected winner false set is self service false m rfq line qty qtys line get qtys for int i 0 i qtys length i if qtys i is active qtys i is rfq qty if get id 0 save this line save m rfq response line qty qty new m rfq response line qty this qtys i qty save mrfqresponseline mrfqresponse mrfqline getctx get_trxname setclientorg setc_rfqresponse_id getc_rfqresponse_id setc_rfqline_id getc_rfqline_id setisselectedwinner setisselfservice mrfqlineqty getqtys isactive isrfqqty get_id mrfqresponselineqty mrfqresponselineqty get quantities return array of quantities public m rfq response line qty get qtys return get qtys false mrfqresponselineqty getqtys getqtys get quantities param requery requery return array of quantities public m rfq response line qty get qtys boolean requery if m qtys null requery return m qtys array list m rfq response line qty list new array list m rfq response line qty string sql select from c rfqresponselineqty where c rfqresponseline id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfqresponseline id result set rs pstmt execute query while rs next list add new m rfq response line qty get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m qtys new m rfq response line qty list size list to array m qtys return m qtys mrfqresponselineqty getqtys m_qtys m_qtys arraylist mrfqresponselineqty arraylist mrfqresponselineqty c_rfqresponselineqty c_rfqresponseline_id isactive preparedstatement preparestatement get_trxname setint getc_rfqresponseline_id resultset executequery mrfqresponselineqty getctx get_trxname m_qtys mrfqresponselineqty toarray m_qtys m_qtys get rfq line return rfq line public m rfq line get rfq line if m rfqline null m rfqline m rfq line get get ctx getc rfqline id get trxname return m rfqline mrfqline getrfqline m_rfqline m_rfqline mrfqline getctx getc_rfqline_id get_trxname m_rfqline string representation return info public string to string string buffer sb new string buffer m rfq response line sb append get id append winner append is selected winner append return sb to string tostring stringbuffer stringbuffer mrfqresponseline get_id isselectedwinner tostring before save param new record new return true protected boolean before save boolean new record calculate complete date also used to verify if get date work start null get delivery days 0 set date work complete time util add days get date work start get delivery days calculate delivery days else if get date work start null get delivery days 0 get date work complete null set delivery days time util get days between get date work start get date work complete calculate start date else if get date work start null get delivery days 0 get date work complete null set date work start time util add days get date work complete get delivery days 1 if is active set is selected winner false return true newrecord beforesave newrecord getdateworkstart getdeliverydays setdateworkcomplete timeutil adddays getdateworkstart getdeliverydays getdateworkstart getdeliverydays getdateworkcomplete setdeliverydays timeutil getdaysbetween getdateworkstart getdateworkcomplete getdateworkstart getdeliverydays getdateworkcomplete setdateworkstart timeutil adddays getdateworkcomplete getdeliverydays isactive setisselectedwinner after save param new record new param success success return success protected boolean after save boolean new record boolean success if is active get qtys false for int i 0 i m qtys length i m rfq response line qty qty m qtys i if qty is active qty set is active false qty save return success newrecord aftersave newrecord isactive getqtys m_qtys mrfqresponselineqty m_qtys isactive setisactive price list product param m product id product param value value param name name param description descriprion param help help param document note document note param imageurl image param descriptionurl description param price price param uom name uom param uom symbol uom public price list product int m product id string value string name string description string help string document note string imageurl string descriptionurl big decimal price string uom name string uom symbol m product id m product id m value value m name name m description description help document note imageurl descriptionurl m help help m documentnote document note m imageurl imageurl m descriptionurl descriptionurl price std uom name uom symbol m price price m uomname uom name m uomsymbol uom symbol m_product_id documentnote uomname uomsymbol pricelistproduct m_product_id documentnote bigdecimal uomname uomsymbol m_product_id m_product_id m_value m_name m_description documentnote m_help m_documentnote documentnote m_imageurl m_descriptionurl pricestd uomname uomsymbol m_price m_uomname uomname m_uomsymbol uomsymbol string representation return info public string to string string buffer sb new string buffer price list product sb append m product id append append m name append append m price append return sb to string tostring stringbuffer stringbuffer pricelistproduct m_product_id m_name m_price tostring get product io return m product id public int get id return m product id m_product_id getid m_product_id return m product id public string get value return m value m_product_id getvalue m_value get name return name public string get name return m name getname m_name return m name public string get description return m description m_name getdescription m_description return m description public string get help return m help m_description gethelp m_help public string get document note return m documentnote getdocumentnote m_documentnote return m documentnote public string get imageurl return m imageurl m_documentnote getimageurl m_imageurl return m imageurl public string get descriptionurl return m descriptionurl m_imageurl getdescriptionurl m_descriptionurl public big decimal get price return m price bigdecimal getprice m_price return m price public string get uom name return m uomname m_price getuomname m_uomname return m uomname public string get uom symbol return m uomsymbol m_uomname getuomsymbol m_uomsymbol get contents return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m warehouse id p m warehouse id para i get parameter as int else log log level severe unknown parameter name p c invoice id getrecord id processinfoparameter getparameter getparametername getparameter m_warehouse_id p_m_warehouse_id getparameterasint p_c_invoice_id getrecord_id create shipment return info throws exception protected string do it throws exception log info c invoice id p c invoice id m warehouse id p m warehouse id if p c invoice id 0 throw new illegal argument exception not found c invoice id if p m warehouse id 0 throw new illegal argument exception not found m warehouse id m invoice invoice new m invoice get ctx p c invoice id null if invoice get id 0 throw new illegal argument exception not found c invoice id if m invoice docstatus completed equals invoice get doc status throw new illegal argument exception invoice create doc not completed m in out ship new m in out invoice 0 null p m warehouse id if ship save throw new illegal argument exception save error receipt m invoice line invoice lines invoice get lines false for int i 0 i invoice lines length i m invoice line invoice line invoice lines i m in out line s line new m in out line ship s line set invoice line invoice line 0 locator invoice isso trx invoice line get qty invoiced env zero s line set qty entered invoice line get qty entered s line set movement qty invoice line get qty invoiced if invoice is credit memo s line set qty entered s line get qty entered negate s line set movement qty s line get movement qty negate if s line save throw new illegal argument exception save error m inoutline id invoice line setm inoutline id s line getm inoutline id if invoice line save throw new illegal argument exception save error c invoiceline id return ship get document no doit c_invoice_id p_c_invoice_id m_warehouse_id p_m_warehouse_id p_c_invoice_id illegalargumentexception notfound c_invoice_id p_m_warehouse_id illegalargumentexception notfound m_warehouse_id minvoice minvoice getctx p_c_invoice_id get_id illegalargumentexception notfound c_invoice_id minvoice docstatus_completed getdocstatus illegalargumentexception invoicecreatedocnotcompleted minout minout p_m_warehouse_id illegalargumentexception saveerror minvoiceline invoicelines getlines invoicelines minvoiceline invoiceline invoicelines minoutline sline minoutline sline setinvoiceline invoiceline issotrx invoiceline getqtyinvoiced sline setqtyentered invoiceline getqtyentered sline setmovementqty invoiceline getqtyinvoiced iscreditmemo sline setqtyentered sline getqtyentered sline setmovementqty sline getmovementqty sline illegalargumentexception saveerror m_inoutline_id invoiceline setm_inoutline_id sline getm_inoutline_id invoiceline illegalargumentexception saveerror c_invoiceline_id getdocumentno prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p c rfqresponse id getrecord id processinfoparameter getparameter getparametername getparameter p_c_rfqresponse_id getrecord_id perform process return message throws exception if not successful protected string do it throws exception m rfq response response new m rfq response get ctx p c rfqresponse id get trxname log info do it response string error response get rfq check quote total amt only if error null error length 0 throw new exception error send it if response send rfq return ok return error doit mrfqresponse mrfqresponse getctx p_c_rfqresponse_id get_trxname doit getrfq checkquotetotalamtonly sendrfq get contents return contents public object get contents return contents getcontents get costs of invoice line param il invoice line return array of landed cost lines public static m landed cost get landed costs m invoice line il array list m landed cost list new array list m landed cost string sql select from c landedcost where c invoiceline id prepared statement pstmt null try pstmt db prepare statement sql il get trxname pstmt set int 1 il getc invoiceline id result set rs pstmt execute query while rs next list add new m landed cost il get ctx rs il get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m landed cost ret value new m landed cost list size list to array ret value return ret value mlandedcost getlandedcosts minvoiceline arraylist mlandedcost arraylist mlandedcost c_landedcost c_invoiceline_id preparedstatement preparestatement get_trxname setint getc_invoiceline_id resultset executequery mlandedcost getctx get_trxname mlandedcost retvalue mlandedcost toarray retvalue retvalue standard constructor param ctx context param c landedcost id id param trx name trx public m landed cost properties ctx int c landedcost id string trx name super ctx c landedcost id trx name if c landedcost id 0 setc invoiceline id 0 setm costelement id 0 set landed cost distribution landedcostdistribution quantity q c_landedcost_id trxname mlandedcost c_landedcost_id trxname c_landedcost_id trxname c_landedcost_id setc_invoiceline_id setm_costelement_id setlandedcostdistribution landedcostdistribution_quantity load constructor param ctx context param rs result set param trx name trx public m landed cost properties ctx result set rs string trx name super ctx rs trx name trxname mlandedcost resultset trxname trxname before save param new record new return true if ok protected boolean before save boolean new record one reference if getm product id 0 getm inout id 0 getm inoutline id 0 log save error error msg parse translation get ctx not found m product id m inout id m inoutline id return false no product if line entered if getm inoutline id 0 getm product id 0 setm product id 0 return true newrecord beforesave newrecord getm_product_id getm_inout_id getm_inoutline_id saveerror parsetranslation getctx notfound m_product_id m_inout_id m_inoutline_id getm_inoutline_id getm_product_id setm_product_id allocate costs done at invoice line level return error message or public string allocate costs m invoice line il new m invoice line get ctx getc invoiceline id get trxname return il allocate landed costs allocatecosts minvoiceline minvoiceline getctx getc_invoiceline_id get_trxname allocatelandedcosts string representation return info public string to string string buffer sb new string buffer m landed cost sb append get id append cost distribution append get landed cost distribution append m costelement id append getm costelement id if getm inout id 0 sb append m inout id append getm inout id if getm inoutline id 0 sb append m inoutline id append getm inoutline id if getm product id 0 sb append m product id append getm product id sb append return sb to string tostring stringbuffer stringbuffer mlandedcost get_id costdistribution getlandedcostdistribution m_costelement_id getm_costelement_id getm_inout_id m_inout_id getm_inout_id getm_inoutline_id m_inoutline_id getm_inoutline_id getm_product_id m_product_id getm_product_id tostring standard constructor public x c recurring run properties ctx int c recurring run id string trx name super ctx c recurring run id trx name if c recurring run id 0 setc recurring id 0 setc recurring run id 0 x_c_recurring_run c_recurring_run_id trxname c_recurring_run_id trxname c_recurring_run_id setc_recurring_id setc_recurring_run_id load constructor public x c recurring run properties ctx result set rs string trx name super ctx rs trx name x_c_recurring_run resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c recurring run append get id append return sb to string tostring stringbuffer stringbuffer x_c_recurring_run get_id tostring set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set valuenocheck c payment id null else set valuenocheck c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_valuenocheck c_payment_id set_valuenocheck c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set valuenocheck c project id null else set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id set_valuenocheck c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set recurring recurring document public void setc recurring id int c recurring id if c recurring id 1 throw new illegal argument exception c recurring id is mandatory set valuenocheck c recurring id new integer c recurring id setc_recurring_id c_recurring_id c_recurring_id illegalargumentexception c_recurring_id set_valuenocheck c_recurring_id c_recurring_id get recurring recurring document public int getc recurring id integer ii integer get value c recurring id if ii null return 0 return ii int value getc_recurring_id get_value c_recurring_id intvalue set recurring run recurring document run public void setc recurring run id int c recurring run id if c recurring run id 1 throw new illegal argument exception c recurring run id is mandatory set valuenocheck c recurring run id new integer c recurring run id setc_recurring_run_id c_recurring_run_id c_recurring_run_id illegalargumentexception c_recurring_run_id set_valuenocheck c_recurring_run_id c_recurring_run_id get recurring run recurring document run public int getc recurring run id integer ii integer get value c recurring run id if ii null return 0 return ii int value getc_recurring_run_id get_value c_recurring_run_id intvalue set document date date of the document public void set date doc timestamp date doc set value date doc date doc setdatedoc datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set journal batch general ledger journal batch public void setgl journalbatch id int gl journalbatch id if gl journalbatch id 0 set valuenocheck gl journalbatch id null else set valuenocheck gl journalbatch id new integer gl journalbatch id setgl_journalbatch_id gl_journalbatch_id gl_journalbatch_id set_valuenocheck gl_journalbatch_id set_valuenocheck gl_journalbatch_id gl_journalbatch_id get journal batch general ledger journal batch public int getgl journalbatch id integer ii integer get value gl journalbatch id if ii null return 0 return ii int value getgl_journalbatch_id get_value gl_journalbatch_id intvalue get and create window model value object ejb interface method view type both param ctx environment properties param window no number of this window param ad window id the internal number of the window if not 0 ad menu id is ignored param ad menu id ine internal menu number used when ad window id is 0 return initialized window model public m windowvo get windowvo properties ctx int window no int ad window id int ad menu id log info get windowvo m no window ad window id log fine ctx m windowvo vo m windowvo create ctx window no ad window id ad menu id m windowcount return vo windowno ad_window_id ad_menu_id ad_menu_id ad_window_id mwindowvo getwindowvo windowno ad_window_id ad_menu_id getwindowvo m_no ad_window_id mwindowvo mwindowvo windowno ad_window_id ad_menu_id m_windowcount post immediate ejb interface method view type both param ctx client context param ad client id client id of document param ad table id table id of document param record id record id of this document param force force posting return null if success or error message public string post immediate properties ctx int ad client id int ad table id int record id boolean force string trx name log info m no table ad table id record record id m postcount m acct schema ass m acct schema get client acct schema ctx ad client id return doc post immediate ass ad table id record id force trx name ad_client_id ad_table_id record_id postimmediate ad_client_id ad_table_id record_id trxname m_no ad_table_id record_id m_postcount macctschema macctschema getclientacctschema ad_client_id postimmediate ad_table_id record_id trxname get prepared statement result set ejb interface method view type both param info result info return row set throws not serializable exception public row set pstmt getrowset c statementvo info throws not serializable exception log finer m no m stmt rowsetcount c prepared statement pstmt new c prepared statement info return pstmt remote getrowset resultset rowset notserializableexception rowset pstmt_getrowset cstatementvo notserializableexception m_no m_stmt_rowsetcount cpreparedstatement cpreparedstatement remote_getrowset get statement result set ejb interface method view type both param info result info return row set public row set stmt getrowset c statementvo info log finer m no m stmt rowsetcount c statement stmt new c statement info return stmt remote getrowset resultset rowset rowset stmt_getrowset cstatementvo m_no m_stmt_rowsetcount cstatement cstatement remote_getrowset execute update ejb interface method view type both param info result info return row count public int stmt executeupdate c statementvo info log finer m no m stmt updatecount if info get parameter count 0 c statement stmt new c statement info return stmt remote executeupdate c prepared statement pstmt new c prepared statement info return pstmt remote executeupdate stmt_executeupdate cstatementvo m_no m_stmt_updatecount getparametercount cstatement cstatement remote_executeupdate cpreparedstatement cpreparedstatement remote_executeupdate get next number for key column 0 is error ejb interface method view type both param ad client id client param table name table name param trx name optional transaction name return next no public int get nextid int ad client id string table name string trx name int ret value m sequence get nextid ad client id table name trx name log finer m no table name ret value m nextseqcount return ret value ad_client_id tablename trxname getnextid ad_client_id tablename trxname retvalue msequence getnextid ad_client_id tablename trxname m_no tablename retvalue m_nextseqcount retvalue get document no from table ejb interface method view type both param ad client id client param table name table name param trx name optional transaction name return document no or null public string get document no int ad client id string table name string trx name m nextseqcount string dn m sequence get document no ad client id table name trx name if dn null try again dn m sequence get document no ad client id table name trx name return dn ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname m_nextseqcount msequence getdocumentno ad_client_id tablename trxname msequence getdocumentno ad_client_id tablename trxname get document no based on document type ejb interface method view type both param c doctype id document type param trx name optional transaction name return document no or null public string get document no int c doctype id string trx name m nextseqcount string dn m sequence get document no c doctype id trx name if dn null try again dn m sequence get document no c doctype id trx name return dn c_doctype_id trxname getdocumentno c_doctype_id trxname m_nextseqcount msequence getdocumentno c_doctype_id trxname msequence getdocumentno c_doctype_id trxname process remote ejb interface method view type both param ctx context param pi process info return resulting process info public process info process properties ctx process info pi string class name pi get class name log info class name pi m processcount get class class clazz null try clazz class for name class name catch class not found exception ex log log level warning class name ex pi set summary class not found true return pi get process svr process process null try process svr process clazz new instance catch exception ex log log level warning instance for class name ex pi set summary instance error true return pi start process trx trx trx get trx create trx name server prc true try boolean ok process start process ctx pi trx pi process get process info trx commit trx close catch exception ex1 trx rollback trx close pi set summary process error true return pi return pi processinfo processinfo classname getclassname classname m_processcount forname classname classnotfoundexception classname setsummary classnotfound svrprocess svrprocess newinstance classname setsummary instanceerror createtrxname serverprc startprocess getprocessinfo setsummary processerror run workflow and wait on server ejb interface method view type both param ctx context param pi process info return process info public process info workflow properties ctx process info pi int ad workflow id log info m no ad workflow id m workflowcount m workflow wf m workflow get ctx ad workflow id mwf process wf process wf start wait pi may return null log fine pi to string return pi processinfo processinfo ad_workflow_id m_no ad_workflow_id m_workflowcount mworkflow mworkflow ad_workflow_id mwfprocess wfprocess startwait tostring online payment from server ejb interface method view type both called from m payment process online param ctx context param c payment id payment param c paymentprocessor id processor return true if approved public boolean payment online properties ctx int c payment id int c paymentprocessor id string trx name m payment payment new m payment ctx c payment id trx name m payment processor mpp new m payment processor ctx c paymentprocessor id null log info m no payment mpp m paymentcount boolean approved false try payment processor pp payment processor create mpp payment if pp null payment set error message no payment processor else approved pp processcc if approved payment set error message null else payment set error message from payment get credit card name payment getr respmsg catch exception e log log level severe e payment set error message payment processor error payment save return approved mpayment processonline c_payment_id c_paymentprocessor_id paymentonline c_payment_id c_paymentprocessor_id trxname mpayment mpayment c_payment_id trxname mpaymentprocessor mpaymentprocessor c_paymentprocessor_id m_no m_paymentcount paymentprocessor paymentprocessor seterrormessage seterrormessage seterrormessage getcreditcardname getr_respmsg seterrormessage create e mail from server request user ejb interface method view type both param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail public e mail createe mail properties ctx int ad client id string to string subject string message m client client m client get ctx ad client id return client createe mail to subject message email ad_client_id email email createemail ad_client_id mclient mclient ad_client_id createemail create e mail from server request user ejb interface method view type both param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail public e mail createe mail properties ctx int ad client id int ad user id string to string subject string message m client client m client get ctx ad client id m user from new m user ctx ad user id null return client createe mail from to subject message email ad_client_id email email createemail ad_client_id ad_user_id mclient mclient ad_client_id muser muser ad_user_id createemail create e mail from server request user ejb interface method view type both param ad task id task return execution trace public string execute task int ad task id m task task new m task env get ctx ad task id null server context return task execute email ad_task_id executetask ad_task_id mtask mtask getctx ad_task_id cash reset ejb interface method view type both param table name table name param record id record or 0 for all return number of records reset public int cache reset string table name int record id log config table name record id m cacheresetcount return cache mgt get reset table name record id tablename record_id cachereset tablename record_id tablename record_id m_cacheresetcount cachemgt tablename record_id lob update ejb interface method view type both param sql table name param display type display type i e blob clob param value the data return true if updated public boolean updatelob string sql int display type object value if sql null value null log fine no sql or data return false log fine sql m updatelobcount boolean success true connection con db create connection false connection transaction read committed prepared statement pstmt null try pstmt con prepare statement sql if display type display type text long pstmt set string 1 string value else pstmt set bytes 1 byte value int no pstmt execute update pstmt close pstmt null catch exception e log log level fine sql e success false close statement try if pstmt null pstmt close pstmt null catch exception e pstmt null success commit local trx if success try con commit con close con null catch exception e log log level severe commit e success false error roll back if success log severe rollback try con rollback con close con null catch exception ee log log level severe rollback ee clean connection try if con null con close con null catch exception e con null return success displaytype displaytype m_updatelobcount createconnection transaction_read_committed preparedstatement preparestatement displaytype displaytype textlong setstring setbytes executeupdate describes the instance and its content for debugging purpose ejb interface method view type both return debugging information about the instance and its content public string get status string buffer sb new string buffer server bean sb append m no append window append m windowcount append post append m postcount append process append m processcount append next seq append m nextseqcount append workflow append m workflowcount append payment append m paymentcount append row set append m stmt rowsetcount append update append m stmt updatecount append cache reset append m cacheresetcount append update lob append m updatelobcount append return sb to string getstatus stringbuffer stringbuffer serverbean m_no m_windowcount m_postcount m_processcount nextseq m_nextseqcount m_workflowcount m_paymentcount rowset m_stmt_rowsetcount m_stmt_updatecount cachereset m_cacheresetcount updatelob m_updatelobcount tostring string representation return info public string to string return get status tostring getstatus create the session bean throws ejb exception create exception ejb create method view type both public void ejb create throws ejb exception create exception m no s no try compiere startup false catch exception ex log log level severe ejb create ex throw new create exception log info get status ejbexception createexception ejbcreate ejbexception createexception m_no s_no ejbcreate createexception getstatus method set session context param a context session context throws ejb exception see javax ejb session bean set session context session context public void set session context session context a context throws ejb exception m context a context setsessioncontext acontext sessioncontext ejbexception sessionbean setsessioncontext sessioncontext setsessioncontext sessioncontext acontext ejbexception m_context acontext method ejb activate throws ejb exception see javax ejb session bean ejb activate public void ejb activate throws ejb exception if log null log c logger getc logger get class log info ejb activate get status ejbactivate ejbexception sessionbean ejbactivate ejbactivate ejbexception clogger getclogger getclass ejbactivate getstatus method ejb passivate throws ejb exception see javax ejb session bean ejb passivate public void ejb passivate throws ejb exception log info ejb passivate get status ejbpassivate ejbexception sessionbean ejbpassivate ejbpassivate ejbexception ejbpassivate getstatus method ejb remove throws ejb exception see javax ejb session bean ejb remove public void ejb remove throws ejb exception log info ejb remove get status ejbremove ejbexception sessionbean ejbremove ejbremove ejbexception ejbremove getstatus dump serial versionuid of class param clazz class protected static void dumpsvuid class clazz string s clazz get name nstatic final long serial versionuid java io object stream class lookup clazz get serial versionuid l n system out println s serialversionuid getname serialversionuid objectstreamclass getserialversionuid print uid of used classes r2 5 1h org compiere process process info static final long serial versionuid 1993220053515488725l org compiere util c statementvo static final long serial versionuid 3393389471515956399l org compiere model m query static final long serial versionuid 1511402030597166113l org compiere model po info static final long serial versionuid 5976719579744948419l org compiere model po info column static final long serial versionuid 3983585608504631958l org compiere model m windowvo static final long serial versionuid 3802628212531678981l org compiere model m tabvo static final long serial versionuid 9160212869277319305l org compiere model m fieldvo static final long serial versionuid 4385061125114436797l org compiere model m lookup info static final long serial versionuid 7958664359250070233l param args ignored public static void main string args dumpsvuid process info class dumpsvuid c statementvo class dumpsvuid m query class dumpsvuid po info class dumpsvuid po info column class dumpsvuid m windowvo class dumpsvuid m tabvo class dumpsvuid m fieldvo class dumpsvuid m lookup info class processinfo serialversionuid cstatementvo serialversionuid mquery serialversionuid poinfo serialversionuid poinfocolumn serialversionuid mwindowvo serialversionuid mtabvo serialversionuid mfieldvo serialversionuid mlookupinfo serialversionuid processinfo cstatementvo mquery poinfo poinfocolumn mwindowvo mtabvo mfieldvo mlookupinfo methods to set the attibutes public hr basic constructor param width sets the width attribute public hr string width set width width setwidth basic constructor param width sets the width attribute public hr int width set width width setwidth basic constructor param width sets the width attribute param align sets the align attribute public hr string width string align set width width set align align setwidth setalign basic constructor param width sets the width attribute param align sets the align attribute public hr int width string align set width width set align align setwidth setalign basic constructor param width sets the width attribute param align sets the align attribute param size sets the size attribute public hr string width string align string size set width width set align align set size size setwidth setalign setsize basic constructor param width sets the width attribute param align sets the align attribute param size sets the size attribute public hr string width string align int size set width width set align align set size size setwidth setalign setsize basic constructor param width sets the width attribute param align sets the align attribute param size sets the size attribute public hr int width string align int size set width width set align align set size size setwidth setalign setsize sets the width attribute param width the width attribute public hr set width string width add attribute width width return this setwidth addattribute sets the width attribute param width the width attribute public hr set width int width add attribute width integer to string width return this setwidth addattribute tostring sets the align attribute param align the align attribute public hr set align string align add attribute align align return this setalign addattribute sets the size attribute param hspace the size attribute public hr set size string size add attribute size size return this setsize addattribute sets the size attribute param hspace the size attribute public hr set size int size add attribute size integer to string size return this setsize addattribute tostring sets the noshade param shade true or false public hr set no shade boolean shade if shade true add attribute noshade noshade else remove attribute noshade return this setnoshade addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public hr add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public hr add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public hr add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public hr add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public hr remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get color param ctx context param pa colorschema id id param target target value param actual actual value return color public static color get color properties ctx int pa colorschema id big decimal target big decimal actual int percent 0 if actual null actual signum 0 target null target signum 0 big decimal pp actual multiply env onehundred divide target 0 big decimal round half up percent pp int value return get color ctx pa colorschema id percent pa_colorschema_id getcolor pa_colorschema_id bigdecimal bigdecimal bigdecimal bigdecimal round_half_up intvalue getcolor pa_colorschema_id get color param ctx context param pa colorschema id id param percent percent return color public static color get color properties ctx int pa colorschema id int percent m color schema cs get ctx pa colorschema id return cs get color percent pa_colorschema_id getcolor pa_colorschema_id mcolorschema pa_colorschema_id getcolor get m color schema from cache param ctx context param pa colorschema id id return m color schema public static m color schema get properties ctx int pa colorschema id if pa colorschema id 0 m color schema ret value new m color schema ctx 0 null ret value set default return ret value integer key new integer pa colorschema id m color schema ret value m color schema s cache get key if ret value null return ret value ret value new m color schema ctx pa colorschema id null if ret value get id 0 s cache put key ret value return ret value mcolorschema pa_colorschema_id mcolorschema mcolorschema pa_colorschema_id pa_colorschema_id mcolorschema retvalue mcolorschema retvalue setdefault retvalue pa_colorschema_id mcolorschema retvalue mcolorschema s_cache retvalue retvalue retvalue mcolorschema pa_colorschema_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param pa colorschema id id param trx name trx public m color schema properties ctx int pa colorschema id string trx name super ctx pa colorschema id trx name if pa colorschema id 0 set name null set mark1 percent 50 setad printcolor1 id 102 red set mark2 percent 100 setad printcolor2 id 113 yellow pa_colorschema_id trxname mcolorschema pa_colorschema_id trxname pa_colorschema_id trxname pa_colorschema_id setname setmark1percent setad_printcolor1_id setmark2percent setad_printcolor2_id load constructor param ctx context param rs result set param trx name trx public m color schema properties ctx result set rs string trx name super ctx rs trx name trxname mcolorschema resultset trxname trxname set default red 50 yellow 100 green public void set default set name default set mark1 percent 50 setad printcolor1 id 102 red set mark2 percent 100 setad printcolor2 id 113 yellow set mark3 percent 9999 setad printcolor3 id 103 green setdefault setname setmark1percent setad_printcolor1_id setmark2percent setad_printcolor2_id setmark3percent setad_printcolor3_id before save param new record new return true protected boolean before save boolean new record if get mark1 percent get mark2 percent set mark1 percent get mark2 percent if get mark2 percent get mark3 percent get mark3 percent 0 set mark2 percent get mark3 percent if get mark3 percent get mark4 percent get mark4 percent 0 set mark4 percent get mark4 percent return true newrecord beforesave newrecord getmark1percent getmark2percent setmark1percent getmark2percent getmark2percent getmark3percent getmark3percent setmark2percent getmark3percent getmark3percent getmark4percent getmark4percent setmark4percent getmark4percent get color param percent percent return color public color get color int percent int ad printcolor id 0 if percent get mark1 percent get mark2 percent 0 ad printcolor id getad printcolor1 id else if percent get mark2 percent get mark3 percent 0 ad printcolor id getad printcolor2 id else if percent get mark3 percent get mark4 percent 0 ad printcolor id getad printcolor3 id else ad printcolor id getad printcolor4 id if ad printcolor id 0 if getad printcolor3 id 0 ad printcolor id getad printcolor3 id else if getad printcolor2 id 0 ad printcolor id getad printcolor2 id else if getad printcolor1 id 0 ad printcolor id getad printcolor1 id if ad printcolor id 0 return color black m print color pc m print color get get ctx ad printcolor id if pc null return pc get color return color black getcolor ad_printcolor_id getmark1percent getmark2percent ad_printcolor_id getad_printcolor1_id getmark2percent getmark3percent ad_printcolor_id getad_printcolor2_id getmark3percent getmark4percent ad_printcolor_id getad_printcolor3_id ad_printcolor_id getad_printcolor4_id ad_printcolor_id getad_printcolor3_id ad_printcolor_id getad_printcolor3_id getad_printcolor2_id ad_printcolor_id getad_printcolor2_id getad_printcolor1_id ad_printcolor_id getad_printcolor1_id ad_printcolor_id mprintcolor mprintcolor getctx ad_printcolor_id getcolor string representation return info public string to string string buffer sb new string buffer m color schema sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mcolorschema get_id getname tostring prepare e g get parameters public void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals is test m test boolean value of y equals para i get parameter else log log level severe prepare unknown parameter name m system m system get get ctx processinfoparameter getparameter getparametername getparameter istest m_test valueof getparameter m_system msystem getctx perrform process return message throws exception if not successful public string do it throws exception if m system null m system is valid return system not setup for replication log info do it record id getrecord id test m test connect remote setup remote merge data send updates save info log info do it replicated m replicated m replicationstart m replicationrun set is replicated m replicated double sec system current time millis m start sec 1000 m replicationrun set description sec s m replicationrun save if m replicated m replication set date last run m replicationstart m replication save exit return m replicated replicated replication error doit m_system m_system isvalid systemnotsetupforreplication doit record_id getrecord_id m_test connectremote setupremote mergedata sendupdates doit m_replicated m_replicationstart m_replicationrun setisreplicated m_replicated currenttimemillis m_start m_replicationrun setdescription m_replicationrun m_replicated m_replication setdatelastrun m_replicationstart m_replication m_replicated connect to remote server throws java lang exception private void connect remote throws exception replication info m replication new m replication get ctx getrecord id get trxname string apps host m replication get host address int apps port m replication get host port boolean rm ioverhttp m replication isrm ioverhttp log info apps host apps port http tunnel rm ioverhttp initial context ic c connection get initial context c connection get initial environment apps host apps port rm ioverhttp if ic null throw new exception no initial context try server home server home server home ic lookup server home jndi name log fine server home server home if server home null throw new exception no server m serverremote server home create log fine server m serverremote log fine remote status m serverremote get status catch exception ex log log level severe connect remote ex throw new exception ex connectremote m_replication mreplication getctx getrecord_id get_trxname appshost m_replication gethostaddress appsport m_replication gethostport rmioverhttp m_replication isrmioverhttp appshost appsport rmioverhttp initialcontext cconnection getinitialcontext cconnection getinitialenvironment appshost appsport rmioverhttp noinitialcontext serverhome serverhome serverhome serverhome jndi_name serverhome serverhome serverhome noserver m_serverremote serverhome m_serverremote m_serverremote getstatus connectremote setup remote ad system ad table ad sequence for remote management throws exception private void setup remote throws exception log info setup remote string sql select rt ad table id rt replication type t table name from ad replicationtable rt inner join ad table t on rt ad table id t ad table id where rt is active y and t is active y and ad replicationstrategy id 1 order by t load seq row set rowset get row set sql new object new integer m replication getad replicationstrategy id if rowset null throw new exception setup remote no row set data data info remote setupvo data new remote setupvo data test m test data replication table rowset row set data id range start m replication getid range start data id range end m replication getid range end data ad client id m replication getremote client id data ad org id m replication getremote org id data prefix m replication get prefix data suffix m replication get suffix process info process info pi new process info data to string 0 pi set class name remote pi set serializable object data object result do it start init new object m system if result null boolean true equals result throw new exception setup remote init error result send it pi m serverremote process new properties pi process info log logs pi get logs timestamp date run null if logs null logs length 0 date run logs 0 getp date user remote timestamp log info setup remote pi remote timestamp date run if date run null m replicationstart date run m replicationrun new m replication run get ctx m replication getad replication id m replicationstart get trxname m replicationrun save ad_system ad_table ad_sequence setupremote setupremote ad_table_id replicationtype tablename ad_replicationtable ad_table ad_table_id ad_table_id isactive isactive ad_replicationstrategy_id loadseq rowset getrowset m_replication getad_replicationstrategy_id setupremote rowset remotesetupvo remotesetupvo m_test replicationtable rowset idrangestart m_replication getidrangestart idrangeend m_replication getidrangeend ad_client_id m_replication getremote_client_id ad_org_id m_replication getremote_org_id m_replication getprefix m_replication getsuffix processinfo processinfo tostring setclassname setserializableobject doit m_system setupremote m_serverremote processinfolog getlogs daterun daterun getp_date setupremote daterun daterun m_replicationstart daterun m_replicationrun mreplicationrun getctx m_replication getad_replication_id m_replicationstart get_trxname m_replicationrun receive new data from remote throws exception private void merge data throws exception log info merge data string sql select rt ad table id rt replication type t table name rt ad replicationtable id from ad replicationtable rt inner join ad table t on rt ad table id t ad table id where rt is active y and t is active y and ad replicationstrategy id 1 and rt replication type m merge order by t load seq row set rowset get row set sql new object new integer m replication getad replicationstrategy id try while rowset next merge data table rowset get int 1 rowset get string 3 rowset get int 4 rowset close rowset null catch sql exception ex log log level severe merge data ex m replicated false mergedata mergedata ad_table_id replicationtype tablename ad_replicationtable_id ad_replicationtable ad_table ad_table_id ad_table_id isactive isactive ad_replicationstrategy_id replicationtype loadseq rowset getrowset m_replication getad_replicationstrategy_id mergedatatable getint getstring getint sqlexception mergedata m_replicated receive new data from remote and send local updates param ad table id table id param table name table name param ad replicationtable id id return true if success throws java lang exception private boolean merge data table int ad table id string table name int ad replicationtable id throws exception remote merge datavo data new remote merge datavo data test m test data table name table name create sql string buffer sql new string buffer select from append table name append where ad client id append m replication getremote client id if m replication getremote org id 0 sql append and ad org id in 0 append m replication getremote org id append if m replication get date last run null sql append and updated append db to date m replication get date last run false sql append order by data key columns get key columns ad table id if data key columns null data key columns length 0 log log level severe merge data table no key columns for table name m replicated false return false for int i 0 i data key columns length i if i 0 sql append sql append data key columns i data sql sql to string new central data data central data get row set data sql null if data central data null log fine merge data table central data is null table name m replicated false return false process info process info pi new process info merge data 0 pi set class name remote pi set serializable object data send it pi m serverremote process new properties pi process info log logs pi get logs string msg if logs null logs length 0 msg logs 0 getp msg remote message log info merge data table pi m replication log r log new m replication log get ctx m replicationrun getad replication run id ad replicationtable id msg get trxname if pi is error log severe merge data table error pi m replicated false r log set is replicated false else import data fom remote row set sourcers row set pi get serializable object row set targetrs get row set data sql null object result do it start sync new object merge data table name data key columns sourcers targetrs m test boolean true boolean replicated is replicated result if replicated log fine merge data table table name result else m replicated false log severe merge data table table name result r log set is replicated replicated if result null r log setp msg result to string sourcers close sourcers null targetrs close targetrs null r log save return pi is error ad_table_id tablename ad_replicationtable_id mergedatatable ad_table_id tablename ad_replicationtable_id remotemergedatavo remotemergedatavo m_test tablename tablename stringbuffer stringbuffer tablename ad_client_id m_replication getremote_client_id m_replication getremote_org_id ad_org_id m_replication getremote_org_id m_replication getdatelastrun to_date m_replication getdatelastrun keycolumns getkeycolumns ad_table_id keycolumns keycolumns mergedatatable keycolumns tablename m_replicated keycolumns keycolumns tostring centraldata getrowset centraldata mergedatatable centraldata tablename m_replicated processinfo processinfo mergedata setclassname setserializableobject m_serverremote processinfolog getlogs getp_msg mergedatatable mreplicationlog rlog mreplicationlog getctx m_replicationrun getad_replication_run_id ad_replicationtable_id get_trxname iserror mergedatatable m_replicated rlog setisreplicated rowset rowset getserializableobject rowset getrowset doit tablename keycolumns m_test isreplicated mergedatatable tablename m_replicated mergedatatable tablename rlog setisreplicated rlog setp_msg tostring rlog iserror get key columns pk or fk of table param ad table id id return key columns public string get key columns int ad table id array list string list new array list string prepared statement pstmt null try get keys string sql select column name from ad column where ad table id and is key y pstmt db prepare statement sql get trxname pstmt set int 1 ad table id result set rs pstmt execute query while rs next list add rs get string 1 rs close no keys search for parents if list size 0 sql select column name from ad column where ad table id and is parent y pstmt db prepare statement sql get trxname pstmt set int 1 ad table id rs pstmt execute query while rs next list add rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe get key columns e try if pstmt null pstmt close catch exception e convert to array string ret value new string list size list to array ret value return ret value ad_table_id getkeycolumns ad_table_id arraylist arraylist preparedstatement columnname ad_column ad_table_id iskey preparestatement get_trxname setint ad_table_id resultset executequery getstring columnname ad_column ad_table_id isparent preparestatement get_trxname setint ad_table_id executequery getstring getkeycolumns retvalue toarray retvalue retvalue send updates to remote i e r o on remote throws exception private void send updates throws exception log info send updates string sql select rt ad table id rt replication type t table name rt ad replicationtable id from ad replicationtable rt inner join ad table t on rt ad table id t ad table id where rt is active y and t is active y and ad replicationstrategy id 1 and rt replication type r reference order by t load seq row set rowset get row set sql new object new integer m replication getad replicationstrategy id try while rowset next send updates table rowset get int 1 rowset get string 3 rowset get int 4 rowset close catch sql exception ex log log level severe send updates ex m replicated false sendupdates sendupdates ad_table_id replicationtype tablename ad_replicationtable_id ad_replicationtable ad_table ad_table_id ad_table_id isactive isactive ad_replicationstrategy_id replicationtype loadseq rowset getrowset m_replication getad_replicationstrategy_id sendupdatestable getint getstring getint sqlexception sendupdates m_replicated send u pdates to remote param ad table id table id param table name table param ad replicationtable id id return true if success throws exception private boolean send updates table int ad table id string table name int ad replicationtable id throws exception remote updatevo data new remote updatevo data test m test data table name table name create sql string buffer sql new string buffer select from append table name append where ad client id append m replication getremote client id if m replication getremote org id 0 sql append and ad org id in 0 append m replication getremote org id append if m replication get date last run null sql append and updated append db to date m replication get date last run false sql append order by data key columns get key columns ad table id if data key columns null data key columns length 0 log log level severe send updates table no key columns for table name m replicated false return false for int i 0 i data key columns length i if i 0 sql append sql append data key columns i data sql sql to string new data data central data get row set data sql null if data central data null log fine send updates table null table name m replicated false return false int rows 0 try if data central data last rows data central data get row data central data before first rewind catch sql exception ex log fine row check ex m replicated false return false if rows 0 log fine no rows table name return true else log fine table name rows process info process info pi new process info send updates 0 pi set class name remote pi set serializable object data send it pi m serverremote process new properties pi log info send updates table pi process info log logs pi get logs string msg if logs null logs length 0 msg logs 0 getp msg remote message m replication log r log new m replication log get ctx m replicationrun getad replication run id ad replicationtable id msg get trxname if pi is error m replicated false r log set is replicated pi is error r log save return pi is error updates ad_table_id tablename ad_replicationtable_id sendupdatestable ad_table_id tablename ad_replicationtable_id remoteupdatevo remoteupdatevo m_test tablename tablename stringbuffer stringbuffer tablename ad_client_id m_replication getremote_client_id m_replication getremote_org_id ad_org_id m_replication getremote_org_id m_replication getdatelastrun to_date m_replication getdatelastrun keycolumns getkeycolumns ad_table_id keycolumns keycolumns sendupdatestable keycolumns tablename m_replicated keycolumns keycolumns tostring centraldata getrowset centraldata sendupdatestable tablename m_replicated centraldata centraldata getrow centraldata beforefirst sqlexception rowcheck m_replicated tablename tablename processinfo processinfo sendupdates setclassname setserializableobject m_serverremote sendupdatestable processinfolog getlogs getp_msg mreplicationlog rlog mreplicationlog getctx m_replicationrun getad_replication_run_id ad_replicationtable_id get_trxname iserror m_replicated rlog setisreplicated iserror rlog iserror clean up resources connections private void exit log info exit object result do it start exit null process info pi new process info exit 0 pi set class name remote pi set serializable object m replicationstart send it try m serverremote process new properties pi catch exception ex doit processinfo processinfo setclassname setserializableobject m_replicationstart m_serverremote get row set of local connection param sql sql param args optional argument array supported integer timestamp big decimal rest is concerted to string return row set public static row set get row set string sql object args shared connection connection conn db get connectionro prepared statement pstmt null row set row set null try pstmt conn prepare statement sql result set type scroll insensitive result set concur read only set parameters if args null for int i 0 i args length i if args i null s log log level severe null argument i else if args i instanceof integer pstmt set int i 1 integer args i int value else if args i instanceof timestamp pstmt set timestamp i 1 timestamp args i else if args i instanceof big decimal pstmt set big decimal i 1 big decimal args i else pstmt set string i 1 args i to string result set rs pstmt execute query row set c cached row set get row set rs pstmt close pstmt null catch exception ex s log log level severe sql ex throw new runtime exception ex close cursor try if pstmt null pstmt close pstmt null catch exception e s log log level severe close pstmt e return row set rowset bigdecimal rowset getrowset getconnectionro preparedstatement rowset rowset preparestatement resultset type_scroll_insensitive resultset concur_read_only s_log setint intvalue settimestamp bigdecimal setbigdecimal bigdecimal setstring tostring resultset executequery rowset ccachedrowset getrowset s_log runtimeexception s_log rowset is data successful replicated param result sync return value return true if replicated public static boolean is replicated object result boolean replicated result null boolean false equals result if replicated replicated result to string ends with errors 0 return replicated isreplicated tostring endswith create printer job public c printer super get printer names set default set value ini get property ini p printer this add action listener this printerjob cprinter getprinternames setvalue getproperty p_printer addactionlistener action listener param e event public void action performed action event e actionperformed actionevent get print service return print service public print service get print service string current service string get selected item for int i 0 i s services length i if s services i get name equals current service return s services i return print service lookup lookup default print service printservice printservice getprintservice currentservice getselecteditem s_services s_services getname currentservice s_services printservicelookup lookupdefaultprintservice get print services names return printer name array public static string get printer names string ret value new string s services length for int i 0 i s services length i ret value i s services i get name return ret value getprinternames retvalue s_services s_services retvalue s_services getname retvalue return default printer job return printer job public static printer job get printer job return get printer job ini get property ini p printer printerjob printerjob printerjob getprinterjob getprinterjob getproperty p_printer return printer job with selected printer name param printer name if null get default printer ini return printer job public static printer job get printer job string printer name printer job pj printer job get printer job print service ps null find printer service if printer name null printer name length 0 printer name ini get property ini p printer if printer name null printer name length 0 system out println c printer get printer job searching printer name for int i 0 i s services length i string service name s services i get name if printer name equals service name ps s services i system out println c printer get printer job found printer name break system out println c printer get printer job not service name find printer service try if ps null pj set print service ps catch exception e system err println c printer get printer job e to string string service name pj get print service get name if printer name null printer name equals service name system err println c printer get printer job not found printer name used service name return pj printerjob printername printerjob printerjob getprinterjob printername printerjob printerjob getprinterjob printservice printername printername printername getproperty p_printer printername printername cprinter getprinterjob printername s_services servicename s_services getname printername servicename s_services cprinter getprinterjob printername cprinter getprinterjob servicename setprintservice cprinter getprinterjob tostring servicename getprintservice getname printername printername servicename cprinter getprinterjob printername servicename standard constructor public x ad registration properties ctx int ad registration id string trx name super ctx ad registration id trx name if ad registration id 0 setad registration id 0 0 setad system id 0 0 set is allow publish true y set is allow statistics true y set is in production false set is registered false n x_ad_registration ad_registration_id trxname ad_registration_id trxname ad_registration_id setad_registration_id setad_system_id setisallowpublish setisallowstatistics setisinproduction setisregistered load constructor public x ad registration properties ctx result set rs string trx name super ctx rs trx name x_ad_registration resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad registration append get id append return sb to string tostring stringbuffer stringbuffer x_ad_registration get_id tostring set system registration system registration public void setad registration id int ad registration id if ad registration id 1 throw new illegal argument exception ad registration id is mandatory set valuenocheck ad registration id new integer ad registration id setad_registration_id ad_registration_id ad_registration_id illegalargumentexception ad_registration_id set_valuenocheck ad_registration_id ad_registration_id get system registration system registration public int getad registration id integer ii integer get value ad registration id if ii null return 0 return ii int value getad_registration_id get_value ad_registration_id intvalue set system system definition public void setad system id int ad system id if ad system id 1 throw new illegal argument exception ad system id is mandatory set valuenocheck ad system id new integer ad system id setad_system_id ad_system_id ad_system_id illegalargumentexception ad_system_id set_valuenocheck ad_system_id ad_system_id get system system definition public int getad system id integer ii integer get value ad system id if ii null return 0 return ii int value getad_system_id get_value ad_system_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set industry info information of the industry e g professional service distribution of furnitures public void set industry info string industry info if industry info null industry info length 255 log warning length 255 truncated industry info industry info substring 0 254 set value industry info industry info setindustryinfo industryinfo industryinfo industryinfo industryinfo industryinfo set_value industryinfo industryinfo get industry info information of the industry e g professional service distribution of furnitures public string get industry info return string get value industry info getindustryinfo get_value industryinfo set allowed to be published you allow to publish the information not just statistical summary info public void set is allow publish boolean is allow publish set value is allow publish new boolean is allow publish setisallowpublish isallowpublish set_value isallowpublish isallowpublish get allowed to be published you allow to publish the information not just statistical summary info public boolean is allow publish object oo get value is allow publish if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallowpublish get_value isallowpublish booleanvalue set maintain statistics maintain general statistics public void set is allow statistics boolean is allow statistics set value is allow statistics new boolean is allow statistics setisallowstatistics isallowstatistics set_value isallowstatistics isallowstatistics get maintain statistics maintain general statistics public boolean is allow statistics object oo get value is allow statistics if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallowstatistics get_value isallowstatistics booleanvalue set in production the system is in production public void set is in production boolean is in production set value is in production new boolean is in production setisinproduction isinproduction set_value isinproduction isinproduction get in production the system is in production public boolean is in production object oo get value is in production if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinproduction get_value isinproduction booleanvalue set registered the application is registered public void set is registered boolean is registered set valuenocheck is registered new boolean is registered setisregistered isregistered set_valuenocheck isregistered isregistered get registered the application is registered public boolean is registered object oo get value is registered if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isregistered get_value isregistered booleanvalue set employees number of employees public void set number employees int number employees set value number employees new integer number employees setnumberemployees numberemployees set_value numberemployees numberemployees get employees number of employees public int get number employees integer ii integer get value number employees if ii null return 0 return ii int value getnumberemployees get_value numberemployees intvalue set platform info information about server and client platform public void set platform info string platform info if platform info null platform info length 255 log warning length 255 truncated platform info platform info substring 0 254 set value platform info platform info setplatforminfo platforminfo platforminfo platforminfo platforminfo platforminfo set_value platforminfo platforminfo get platform info information about server and client platform public string get platform info return string get value platform info getplatforminfo get_value platforminfo set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set record id direct internal record id public void setrecord id int record id if record id 0 set valuenocheck record id null else set valuenocheck record id new integer record id setrecord_id record_id record_id set_valuenocheck record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set valuenocheck remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_valuenocheck remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set valuenocheck remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_valuenocheck remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set sales volume in 1 000 total volume of sales in thousands of currency public void set sales volume int sales volume set value sales volume new integer sales volume setsalesvolume salesvolume set_value salesvolume salesvolume get sales volume in 1 000 total volume of sales in thousands of currency public int get sales volume integer ii integer get value sales volume if ii null return 0 return ii int value getsalesvolume get_value salesvolume intvalue set start implementation production the day you started the implementation if implementing or production went life with compiere public void set start production date timestamp start production date set value start production date start production date setstartproductiondate startproductiondate set_value startproductiondate startproductiondate get start implementation production the day you started the implementation if implementing or production went life with compiere public timestamp get start production date return timestamp get value start production date getstartproductiondate get_value startproductiondate standard constructor public x r requestprocessor route properties ctx int r requestprocessor route id string trx name super ctx r requestprocessor route id trx name if r requestprocessor route id 0 setad user id 0 setr requestprocessor id 0 setr requestprocessor route id 0 set seq no 0 x_r_requestprocessor_route r_requestprocessor_route_id trxname r_requestprocessor_route_id trxname r_requestprocessor_route_id setad_user_id setr_requestprocessor_id setr_requestprocessor_route_id setseqno load constructor public x r requestprocessor route properties ctx result set rs string trx name super ctx rs trx name x_r_requestprocessor_route resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestprocessor route append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestprocessor_route get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set keyword case insensitive keyword public void set keyword string keyword if keyword null keyword length 60 log warning length 60 truncated keyword keyword substring 0 59 set value keyword keyword setkeyword set_value get keyword case insensitive keyword public string get keyword return string get value keyword getkeyword get_value set request processor processor for requests public void setr requestprocessor id int r requestprocessor id if r requestprocessor id 1 throw new illegal argument exception r requestprocessor id is mandatory set valuenocheck r requestprocessor id new integer r requestprocessor id setr_requestprocessor_id r_requestprocessor_id r_requestprocessor_id illegalargumentexception r_requestprocessor_id set_valuenocheck r_requestprocessor_id r_requestprocessor_id get request processor processor for requests public int getr requestprocessor id integer ii integer get value r requestprocessor id if ii null return 0 return ii int value getr_requestprocessor_id get_value r_requestprocessor_id intvalue set request routing automatic routing of requests public void setr requestprocessor route id int r requestprocessor route id if r requestprocessor route id 1 throw new illegal argument exception r requestprocessor route id is mandatory set valuenocheck r requestprocessor route id new integer r requestprocessor route id setr_requestprocessor_route_id r_requestprocessor_route_id r_requestprocessor_route_id illegalargumentexception r_requestprocessor_route_id set_valuenocheck r_requestprocessor_route_id r_requestprocessor_route_id get request routing automatic routing of requests public int getr requestprocessor route id integer ii integer get value r requestprocessor route id if ii null return 0 return ii int value getr_requestprocessor_route_id get_value r_requestprocessor_route_id intvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 0 set value r requesttype id null else set value r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id set_value r_requesttype_id set_value r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno public pi set the version of this document param version the version of this document public pi set version string version add attribute version version return this setversion addattribute set the version of this document param version the version of this document public pi set version float version set version float to string version return this setversion setversion tostring set the version of this document param version the version of this document public pi set version double version set version double to string version return this setversion setversion tostring sets the target of this document it is used to identigy the application to which the instruction is directed param target the target application public pi set target string target set element type target return this settarget setelementtype add an additional instruction which works like an xml attribute to the pi param name name of instruction e g standalone param value value of instruction e g no public pi add instruction string name string value add attribute name value return this addinstruction addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public pi add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public pi add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public pi add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public pi add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public pi remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry get contents return contents public object get contents return contents getcontents standard constructor public x m product properties ctx int m product id string trx name super ctx m product id trx name if m product id 0 setc taxcategory id 0 setc uom id 0 set isbom false n set is drop ship false set is exclude auto delivery false n set is invoice print details false set is pick list print details false set is purchased true y set is self service true y set is sold true y set is stocked true y set is summary false set is verified false n set is web store featured false setm attributesetinstance id 0 setm product category id 0 setm product id 0 set name null set product type null i set value null x_m_product m_product_id trxname m_product_id trxname m_product_id setc_taxcategory_id setc_uom_id setisbom setisdropship setisexcludeautodelivery setisinvoiceprintdetails setispicklistprintdetails setispurchased setisselfservice setissold setisstocked setissummary setisverified setiswebstorefeatured setm_attributesetinstance_id setm_product_category_id setm_product_id setname setproducttype setvalue load constructor public x m product properties ctx result set rs string trx name super ctx rs trx name x_m_product resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product append get id append return sb to string tostring stringbuffer stringbuffer x_m_product get_id tostring set revenue recognition method for recording revenue public void setc revenuerecognition id int c revenuerecognition id if c revenuerecognition id 0 set value c revenuerecognition id null else set value c revenuerecognition id new integer c revenuerecognition id setc_revenuerecognition_id c_revenuerecognition_id c_revenuerecognition_id set_value c_revenuerecognition_id set_value c_revenuerecognition_id c_revenuerecognition_id get revenue recognition method for recording revenue public int getc revenuerecognition id integer ii integer get value c revenuerecognition id if ii null return 0 return ii int value getc_revenuerecognition_id get_value c_revenuerecognition_id intvalue set subscription type type of subscription public void setc subscriptiontype id int c subscriptiontype id if c subscriptiontype id 0 set value c subscriptiontype id null else set value c subscriptiontype id new integer c subscriptiontype id setc_subscriptiontype_id c_subscriptiontype_id c_subscriptiontype_id set_value c_subscriptiontype_id set_value c_subscriptiontype_id c_subscriptiontype_id get subscription type type of subscription public int getc subscriptiontype id integer ii integer get value c subscriptiontype id if ii null return 0 return ii int value getc_subscriptiontype_id get_value c_subscriptiontype_id intvalue set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set classification classification for grouping public void set classification string classification if classification null classification length 1 log warning length 1 truncated classification classification substring 0 0 set value classification classification setclassification set_value get classification classification for grouping public string get classification return string get value classification getclassification get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set description url url for the description public void set descriptionurl string descriptionurl if descriptionurl null descriptionurl length 120 log warning length 120 truncated descriptionurl descriptionurl substring 0 119 set value descriptionurl descriptionurl setdescriptionurl set_value get description url url for the description public string get descriptionurl return string get value descriptionurl getdescriptionurl get_value set discontinued this product is no longer available public void set discontinued boolean discontinued set value discontinued new boolean discontinued setdiscontinued set_value get discontinued this product is no longer available public boolean is discontinued object oo get value discontinued if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscontinued get_value booleanvalue set discontinued by discontinued by public void set discontinued by timestamp discontinued by set value discontinued by discontinued by setdiscontinuedby discontinuedby set_value discontinuedby discontinuedby get discontinued by discontinued by public timestamp get discontinued by return timestamp get value discontinued by getdiscontinuedby get_value discontinuedby set document note additional information for a document public void set document note string document note if document note null document note length 2000 log warning length 2000 truncated document note document note substring 0 1999 set value document note document note setdocumentnote documentnote documentnote documentnote documentnote documentnote set_value documentnote documentnote get document note additional information for a document public string get document note return string get value document note getdocumentnote get_value documentnote set guarantee days number of days the product is guaranteed or available public void set guarantee days int guarantee days set value guarantee days new integer guarantee days setguaranteedays guaranteedays set_value guaranteedays guaranteedays get guarantee days number of days the product is guaranteed or available public int get guarantee days integer ii integer get value guarantee days if ii null return 0 return ii int value getguaranteedays get_value guaranteedays intvalue set min guarantee days minumum number of guarantee days public void set guarantee days min int guarantee days min set value guarantee days min new integer guarantee days min setguaranteedaysmin guaranteedaysmin set_value guaranteedaysmin guaranteedaysmin get min guarantee days minumum number of guarantee days public int get guarantee days min integer ii integer get value guarantee days min if ii null return 0 return ii int value getguaranteedaysmin get_value guaranteedaysmin intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set bill of materials bill of materials public void set isbom boolean isbom set value isbom new boolean isbom setisbom set_value get bill of materials bill of materials public boolean isbom object oo get value isbom if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false get_value booleanvalue set drop shipment drop shipments are sent from the vendor directly to the customer public void set is drop ship boolean is drop ship set value is drop ship new boolean is drop ship setisdropship isdropship set_value isdropship isdropship get drop shipment drop shipments are sent from the vendor directly to the customer public boolean is drop ship object oo get value is drop ship if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdropship get_value isdropship booleanvalue set exclude auto delivery exclude from automatic delivery public void set is exclude auto delivery boolean is exclude auto delivery set value is exclude auto delivery new boolean is exclude auto delivery setisexcludeautodelivery isexcludeautodelivery set_value isexcludeautodelivery isexcludeautodelivery get exclude auto delivery exclude from automatic delivery public boolean is exclude auto delivery object oo get value is exclude auto delivery if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isexcludeautodelivery get_value isexcludeautodelivery booleanvalue set print detail records on invoice print detail bom elements on the invoice public void set is invoice print details boolean is invoice print details set value is invoice print details new boolean is invoice print details setisinvoiceprintdetails isinvoiceprintdetails set_value isinvoiceprintdetails isinvoiceprintdetails get print detail records on invoice print detail bom elements on the invoice public boolean is invoice print details object oo get value is invoice print details if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiceprintdetails get_value isinvoiceprintdetails booleanvalue set print detail records on pick list print detail bom elements on the pick list public void set is pick list print details boolean is pick list print details set value is pick list print details new boolean is pick list print details setispicklistprintdetails ispicklistprintdetails set_value ispicklistprintdetails ispicklistprintdetails get print detail records on pick list print detail bom elements on the pick list public boolean is pick list print details object oo get value is pick list print details if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispicklistprintdetails get_value ispicklistprintdetails booleanvalue set purchased organization purchases this product public void set is purchased boolean is purchased set value is purchased new boolean is purchased setispurchased ispurchased set_value ispurchased ispurchased get purchased organization purchases this product public boolean is purchased object oo get value is purchased if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispurchased get_value ispurchased booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set sold organization sells this product public void set is sold boolean is sold set value is sold new boolean is sold setissold issold set_value issold issold get sold organization sells this product public boolean is sold object oo get value is sold if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issold get_value issold booleanvalue set stocked organization stocks this product public void set is stocked boolean is stocked set value is stocked new boolean is stocked setisstocked isstocked set_value isstocked isstocked get stocked organization stocks this product public boolean is stocked object oo get value is stocked if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isstocked get_value isstocked booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set verified the bom configuration has been verified public void set is verified boolean is verified set valuenocheck is verified new boolean is verified setisverified isverified set_valuenocheck isverified isverified get verified the bom configuration has been verified public boolean is verified object oo get value is verified if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isverified get_value isverified booleanvalue set featured in web store if selected the product is displayed in the inital or any empy search public void set is web store featured boolean is web store featured set value is web store featured new boolean is web store featured setiswebstorefeatured iswebstorefeatured set_value iswebstorefeatured iswebstorefeatured get featured in web store if selected the product is displayed in the inital or any empy search public boolean is web store featured object oo get value is web store featured if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iswebstorefeatured get_value iswebstorefeatured booleanvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set attribute set product attribute set public void setm attributeset id int m attributeset id if m attributeset id 0 set value m attributeset id null else set value m attributeset id new integer m attributeset id setm_attributeset_id m_attributeset_id m_attributeset_id set_value m_attributeset_id set_value m_attributeset_id m_attributeset_id get attribute set product attribute set public int getm attributeset id integer ii integer get value m attributeset id if ii null return 0 return ii int value getm_attributeset_id get_value m_attributeset_id intvalue set freight category category of the freight public void setm freightcategory id int m freightcategory id if m freightcategory id 0 set value m freightcategory id null else set value m freightcategory id new integer m freightcategory id setm_freightcategory_id m_freightcategory_id m_freightcategory_id set_value m_freightcategory_id set_value m_freightcategory_id m_freightcategory_id get freight category category of the freight public int getm freightcategory id integer ii integer get value m freightcategory id if ii null return 0 return ii int value getm_freightcategory_id get_value m_freightcategory_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set value m locator id null else set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_value m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue public static final int m product category id ad reference id 163 set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set value m product category id new integer m product category id m_product_category_id_ad_reference_id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final string producttype service s set product type type of product public void set product type string product type if product type null throw new illegal argument exception product type is mandatory if product type equals e product type equals i product type equals o product type equals r product type equals s else throw new illegal argument exception product type invalid value product type reference id 270 e i o r s if product type length 1 log warning length 1 truncated product type product type substring 0 0 set value product type product type producttype_service setproducttype producttype producttype illegalargumentexception producttype producttype producttype producttype producttype producttype illegalargumentexception producttype producttype reference_id producttype producttype producttype set_value producttype producttype get product type type of product public string get product type return string get value product type getproducttype get_value producttype set mail template text templates for mailings public void setr mailtext id int r mailtext id if r mailtext id 0 set value r mailtext id null else set value r mailtext id new integer r mailtext id setr_mailtext_id r_mailtext_id r_mailtext_id set_value r_mailtext_id set_value r_mailtext_id r_mailtext_id get mail template text templates for mailings public int getr mailtext id integer ii integer get value r mailtext id if ii null return 0 return ii int value getr_mailtext_id get_value r_mailtext_id intvalue set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set value sku sku set_value get sku stock keeping unit public string getsku return string get value sku get_value set expense type expense report type public void sets expensetype id int s expensetype id if s expensetype id 0 set valuenocheck s expensetype id null else set valuenocheck s expensetype id new integer s expensetype id sets_expensetype_id s_expensetype_id s_expensetype_id set_valuenocheck s_expensetype_id set_valuenocheck s_expensetype_id s_expensetype_id get expense type expense report type public int gets expensetype id integer ii integer get value s expensetype id if ii null return 0 return ii int value gets_expensetype_id get_value s_expensetype_id intvalue set resource resource public void sets resource id int s resource id if s resource id 0 set valuenocheck s resource id null else set valuenocheck s resource id new integer s resource id sets_resource_id s_resource_id s_resource_id set_valuenocheck s_resource_id set_valuenocheck s_resource_id s_resource_id get resource resource public int gets resource id integer ii integer get value s resource id if ii null return 0 return ii int value gets_resource_id get_value s_resource_id intvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set shelf depth shelf depth required public void set shelf depth int shelf depth set value shelf depth new integer shelf depth setshelfdepth shelfdepth set_value shelfdepth shelfdepth get shelf depth shelf depth required public int get shelf depth integer ii integer get value shelf depth if ii null return 0 return ii int value getshelfdepth get_value shelfdepth intvalue set shelf height shelf height required public void set shelf height int shelf height set value shelf height new integer shelf height setshelfheight shelfheight set_value shelfheight shelfheight get shelf height shelf height required public int get shelf height integer ii integer get value shelf height if ii null return 0 return ii int value getshelfheight get_value shelfheight intvalue set shelf width shelf width required public void set shelf width int shelf width set value shelf width new integer shelf width setshelfwidth shelfwidth set_value shelfwidth shelfwidth get shelf width shelf width required public int get shelf width integer ii integer get value shelf width if ii null return 0 return ii int value getshelfwidth get_value shelfwidth intvalue set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set units per pallet units per pallet public void set units per pallet int units per pallet set value units per pallet new integer units per pallet setunitsperpallet unitsperpallet set_value unitsperpallet unitsperpallet get units per pallet units per pallet public int get units per pallet integer ii integer get value units per pallet if ii null return 0 return ii int value getunitsperpallet get_value unitsperpallet intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set version no version number public void set version no string version no if version no null version no length 20 log warning length 20 truncated version no version no substring 0 19 set value version no version no setversionno versionno versionno versionno versionno versionno set_value versionno versionno get version no version number public string get version no return string get value version no getversionno get_value versionno set volume volume of a product public void set volume big decimal volume set value volume volume setvolume bigdecimal set_value get volume volume of a product public big decimal get volume big decimal bd big decimal get value volume if bd null return env zero return bd bigdecimal getvolume bigdecimal bigdecimal get_value set weight weight of a product public void set weight big decimal weight set value weight weight setweight bigdecimal set_value get weight weight of a product public big decimal get weight big decimal bd big decimal get value weight if bd null return env zero return bd bigdecimal getweight bigdecimal bigdecimal get_value create wf node param node model public wf node mwf node node super set opaque true m node node set name m node get name m icon new wf icon node get action m name m node get name true set border s border tool tip string description node get description true if description null description length 0 set tool tip text description else set tool tip text node get name true location set bounds node getx position node gety position s size width s size height log config node getad wf node id node get name get location set selected false set visited false wfnode mwfnode setopaque m_node setname m_node getname m_icon wficon getaction m_name m_node getname setborder s_border getdescription settooltiptext settooltiptext getname setbounds getxposition getyposition s_size s_size getad_wf_node_id getname getlocation setselected setvisited set selected selected blue foreground lowered border un selected black foreground raised border param selected selected public void set selected boolean selected fire property change property selected m selected selected m selected selected if m selected set border s borderselected set foreground color blue else set border s border set foreground color black unselected setselected firepropertychange property_selected m_selected m_selected m_selected setborder s_borderselected setforeground setborder s_border setforeground set visited visited green background not visited param visited visited public void set visited boolean visited m visited visited if m visited set background color green else set background color light gray notvisited setvisited m_visited m_visited setbackground setbackground lightgray get selected return selected public boolean is selected return m selected isselected m_selected get client id return client id public int getad client id return m node getad client id getad_client_id m_node getad_client_id is the node editable return yes if the client is the same public boolean is editable return getad client id env getad client id env get ctx iseditable getad_client_id getad_client_id getctx get node id return node id public int getad wf node id return m node getad wf node id getad_wf_node_id m_node getad_wf_node_id get node model return node model public mwf node get model return m node mwfnode getmodel m_node set location also for node param x x param y y public void set location int x int y super set location x y m node set position x y setlocation setlocation m_node setposition string representation return info public string to string string buffer sb new string buffer wf node sb append getad wf node id append append m name append append get bounds append return sb to string tostring stringbuffer stringbuffer wfnode getad_wf_node_id m_name getbounds tostring get font italics if not editable return font public font get font font base new font null if is editable return base return bold italic font return new font base get name font italic font bold base get size getfont iseditable getname getsize get preferred size return size public dimension get preferred size return s size getpreferredsize s_size paint component param g graphics protected void paint component graphics g graphics2d g2d graphics2d g rectangle bounds get bounds m icon paint icon this g2d 0 0 paint text color color get foreground g2d set paint color font font get font attributed string a string new attributed string m name a string add attribute text attribute font font a string add attribute text attribute foreground color attributed character iterator iter a string get iterator line break measurer measurer new line break measurer iter g2d get font render context float width s size width m icon get icon width 2 text layout layout measurer next layout width float x pos m icon get icon width float y pos layout get ascent 2 layout draw g2d x pos y pos width s size width 4 2 pt while measurer get position iter get end index layout measurer next layout width y pos layout get ascent layout get descent layout get leading layout draw g2d 2 y pos paintcomponent getbounds m_icon painticon getforeground setpaint getfont attributedstring astring attributedstring m_name astring addattribute textattribute astring addattribute textattribute attributedcharacteriterator astring getiterator linebreakmeasurer linebreakmeasurer getfontrendercontext s_size m_icon geticonwidth textlayout nextlayout xpos m_icon geticonwidth ypos getascent xpos ypos s_size getposition getendindex nextlayout ypos getascent getdescent getleading ypos prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c project id m c project id big decimal para i get parameter int value else if name equals m inout id m m inout id big decimal para i get parameter int value else if name equals s timeexpense id m s timeexpense id big decimal para i get parameter int value else if name equals m locator id m m locator id big decimal para i get parameter int value else if name equals c projectline id m c projectline id big decimal para i get parameter int value else if name equals m product id m m product id big decimal para i get parameter int value else if name equals m attributesetinstance id m m attributesetinstance id big decimal para i get parameter int value else if name equals movement qty m movementqty big decimal para i get parameter else if name equals movement date m movementdate timestamp para i get parameter else if name equals description m description string para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_project_id m_c_project_id bigdecimal getparameter intvalue m_inout_id m_m_inout_id bigdecimal getparameter intvalue s_timeexpense_id m_s_timeexpense_id bigdecimal getparameter intvalue m_locator_id m_m_locator_id bigdecimal getparameter intvalue c_projectline_id m_c_projectline_id bigdecimal getparameter intvalue m_product_id m_m_product_id bigdecimal getparameter intvalue m_attributesetinstance_id m_m_attributesetinstance_id bigdecimal getparameter intvalue movementqty m_movementqty bigdecimal getparameter movementdate m_movementdate getparameter m_description getparameter perrform process return message clear text throws exception if not successful protected string do it throws exception check parameter m project new m project get ctx m c project id get trxname if m project projectcategory workorderjob equals m project get project category m project projectcategory assetproject equals m project get project category throw new illegal argument exception project not work order or asset m project get project category log info m project to string if m m inout id 0 return issue receipt if m s timeexpense id 0 return issue expense if m m locator id 0 throw new illegal argument exception locator missing if m c projectline id 0 return issue project line return issue inventory doit m_project mproject getctx m_c_project_id get_trxname mproject projectcategory_workorderjob m_project getprojectcategory mproject projectcategory_assetproject m_project getprojectcategory illegalargumentexception m_project getprojectcategory m_project tostring m_m_inout_id issuereceipt m_s_timeexpense_id issueexpense m_m_locator_id illegalargumentexception m_c_projectline_id issueprojectline issueinventory issue receipt return message clear text private string issue receipt m in out in out new m in out get ctx m m inout id null if in out isso trx in out is processed m in out docstatus completed equals in out get doc status m in out docstatus closed equals in out get doc status throw new illegal argument exception receipt not valid in out log info in out to string set project of receipt if in out getc project id 0 in out setc project id m project getc project id in out save else if in out getc project id m project getc project id throw new illegal argument exception receipt for other project in out getc project id m in out line in out lines in out get lines false int counter 0 for int i 0 i in out lines length i need to have a product if in out lines i getm product id 0 continue need to have quantity if in out lines i get movement qty null in out lines i get movement qty signum 0 continue not issued yet if project issue has receipt in out lines i getm inoutline id continue create issue m project issue pi new m project issue m project pi set mandatory in out lines i getm locator id in out lines i getm product id in out lines i get movement qty if m movementdate null default today pi set movement date m movementdate if m description null m description length 0 pi set description m description else if in out lines i get description null pi set description in out lines i get description else if in out get description null pi set description in out get description pi setm inoutline id in out lines i getm inoutline id pi process find create project line m project line pl null m project line pls m project get lines for int ii 0 ii pls length ii the order we generated is the same as the order of the receipt if pls ii getc orderpo id in out getc order id pls ii getm product id in out lines i getm product id pls ii getc projectissue id 0 not issued pl pls ii break if pl null pl new m project line m project pl setm project issue pi set issue pl save add log pi get line pi get movement date pi get movement qty null counter all in out lines return created counter issuereceipt minout inout minout getctx m_m_inout_id inout issotrx inout isprocessed minout docstatus_completed inout getdocstatus minout docstatus_closed inout getdocstatus illegalargumentexception inout inout tostring inout getc_project_id inout setc_project_id m_project getc_project_id inout inout getc_project_id m_project getc_project_id illegalargumentexception inout getc_project_id minoutline inoutlines inout getlines inoutlines inoutlines getm_product_id inoutlines getmovementqty inoutlines getmovementqty projectissuehasreceipt inoutlines getm_inoutline_id mprojectissue mprojectissue m_project setmandatory inoutlines getm_locator_id inoutlines getm_product_id inoutlines getmovementqty m_movementdate setmovementdate m_movementdate m_description m_description setdescription m_description inoutlines getdescription setdescription inoutlines getdescription inout getdescription setdescription inout getdescription setm_inoutline_id inoutlines getm_inoutline_id mprojectline mprojectline m_project getlines getc_orderpo_id inout getc_order_id getm_product_id inoutlines getm_product_id getc_projectissue_id mprojectline m_project setmprojectissue setissue addlog getline getmovementdate getmovementqty inoutlines issue expense report return message clear text private string issue expense get expense report m time expense expense new m time expense get ctx m s timeexpense id get trxname if expense is processed throw new illegal argument exception time expense not processed expense for all expense lines m time expense line expense lines expense get lines false int counter 0 for int i 0 i expense lines length i need to have a product if expense lines i getm product id 0 continue need to have quantity if expense lines i get qty null expense lines i get qty signum 0 continue need to the same project if expense lines i getc project id m project getc project id continue not issued yet if project issue has expense expense lines i gets timeexpenseline id continue find location int m locator id 0 m product product new m product get ctx expense lines i getm product id if product is stocked m locator id m storage getm locator id expense getm warehouse id expense lines i getm product id 0 no asi expense lines i get qty null if m locator id 0 service expense get default and fallback m locator id expense getm locator id create issue m project issue pi new m project issue m project pi set mandatory m locator id expense lines i getm product id expense lines i get qty if m movementdate null default today pi set movement date m movementdate if m description null m description length 0 pi set description m description else if expense lines i get description null pi set description expense lines i get description pi sets timeexpenseline id expense lines i gets timeexpenseline id pi process find create project line m project line pl new m project line m project pl setm project issue pi set issue pl save add log pi get line pi get movement date pi get movement qty null counter all expense lines return created counter issueexpense mtimeexpense mtimeexpense getctx m_s_timeexpense_id get_trxname isprocessed illegalargumentexception mtimeexpenseline expenselines getlines expenselines expenselines getm_product_id expenselines getqty expenselines getqty expenselines getc_project_id m_project getc_project_id projectissuehasexpense expenselines gets_timeexpenseline_id m_locator_id mproduct mproduct getctx expenselines getm_product_id isstocked m_locator_id mstorage getm_locator_id getm_warehouse_id expenselines getm_product_id expenselines getqty m_locator_id m_locator_id getm_locator_id mprojectissue mprojectissue m_project setmandatory m_locator_id expenselines getm_product_id expenselines getqty m_movementdate setmovementdate m_movementdate m_description m_description setdescription m_description expenselines getdescription setdescription expenselines getdescription sets_timeexpenseline_id expenselines gets_timeexpenseline_id mprojectline mprojectline m_project setmprojectissue setissue addlog getline getmovementdate getmovementqty allexpenselines issue project line return message clear text private string issue project line m project line pl new m project line get ctx m c projectline id get trxname if pl getm product id 0 throw new illegal argument exception projet line has no product if pl getc projectissue id 0 throw new illegal argument exception projet line already been issued if m m locator id 0 throw new illegal argument exception no locator set to qty 1 if pl get planned qty null pl get planned qty signum 0 pl set planned qty env one m project issue pi new m project issue m project pi set mandatory m m locator id pl getm product id pl get planned qty if m movementdate null default today pi set movement date m movementdate if m description null m description length 0 pi set description m description else if pl get description null pi set description pl get description pi process update line pl setm project issue pi pl save add log pi get line pi get movement date pi get movement qty null return created 1 issueprojectline mprojectline mprojectline getctx m_c_projectline_id get_trxname getm_product_id illegalargumentexception getc_projectissue_id illegalargumentexception m_m_locator_id illegalargumentexception getplannedqty getplannedqty setplannedqty mprojectissue mprojectissue m_project setmandatory m_m_locator_id getm_product_id getplannedqty m_movementdate setmovementdate m_movementdate m_description m_description setdescription m_description getdescription setdescription getdescription setmprojectissue addlog getline getmovementdate getmovementqty issue from inventory return message clear text private string issue inventory if m m locator id 0 throw new illegal argument exception no locator if m m product id 0 throw new illegal argument exception no product set to qty 1 if m movementqty null m movementqty signum 0 m movementqty env one m project issue pi new m project issue m project pi set mandatory m m locator id m m product id m movementqty if m movementdate null default today pi set movement date m movementdate if m description null m description length 0 pi set description m description pi process create project line m project line pl new m project line m project pl setm project issue pi pl save add log pi get line pi get movement date pi get movement qty null return created 1 issueinventory m_m_locator_id illegalargumentexception m_m_product_id illegalargumentexception m_movementqty m_movementqty m_movementqty mprojectissue mprojectissue m_project setmandatory m_m_locator_id m_m_product_id m_movementqty m_movementdate setmovementdate m_movementdate m_description m_description setdescription m_description mprojectline mprojectline m_project setmprojectissue addlog getline getmovementdate getmovementqty check if project issue already has expense param s timeexpenseline id line return true if exists private boolean project issue has expense int s timeexpenseline id if m projectissues null m projectissues m project get issues for int i 0 i m projectissues length i if m projectissues i gets timeexpenseline id s timeexpenseline id return true return false s_timeexpenseline_id projectissuehasexpense s_timeexpenseline_id m_projectissues m_projectissues m_project getissues m_projectissues m_projectissues gets_timeexpenseline_id s_timeexpenseline_id check if project isssye already has receipt param m inoutline id line return true if exists private boolean project issue has receipt int m inoutline id if m projectissues null m projectissues m project get issues for int i 0 i m projectissues length i if m projectissues i getm inoutline id m inoutline id return true return false m_inoutline_id projectissuehasreceipt m_inoutline_id m_projectissues m_projectissues m_project getissues m_projectissues m_projectissues getm_inoutline_id m_inoutline_id basic constructor use the set methods to set the attibutes public head this method creates a lt head gt tag and sets it value param value the value that goes between lt start tag gt lt end tag gt public head string value add element value start_tag end_tag addelement this method creates a lt head gt tag and sets it value param value the value that goes between lt start tag gt lt end tag gt public head element value add element value start_tag end_tag addelement sets the profile attribue param profile the url to one or more meta data profiles seperated by whitespace public head set profile string profile add attribute profile profile return this setprofile addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public head add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public head add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public head add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public head add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public head remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m pricelist id p m pricelist id para i get parameter as int else if name equals invoice document no p invoicedocumentno string para i get parameter else log log level severe unknown parameter name p m inout id getrecord id processinfoparameter getparameter getparametername getparameter m_pricelist_id p_m_pricelist_id getparameterasint invoicedocumentno p_invoicedocumentno getparameter p_m_inout_id getrecord_id create invoice return document no throws exception protected string do it throws exception log info m inout id p m inout id m pricelist id p m pricelist id invoice document no p invoicedocumentno if p m inout id 0 throw new illegal argument exception no shipment m in out ship new m in out get ctx p m inout id null if ship get id 0 throw new illegal argument exception shipment not found if m in out docstatus completed equals ship get doc status throw new illegal argument exception shipment not completed m invoice invoice new m invoice ship null if p m pricelist id 0 invoice setm pricelist id p m pricelist id if p invoicedocumentno null p invoicedocumentno length 0 invoice set document no p invoicedocumentno if invoice save throw new illegal argument exception cannot save invoice m in out line ship lines ship get lines false for int i 0 i ship lines length i m in out line s line ship lines i m invoice line line new m invoice line invoice line set ship line s line line set qty entered s line get qty entered line set qty invoiced s line get movement qty if line save throw new illegal argument exception cannot save invoice line return invoice get document no doit m_inout_id p_m_inout_id m_pricelist_id p_m_pricelist_id invoicedocumentno p_invoicedocumentno p_m_inout_id illegalargumentexception minout minout getctx p_m_inout_id get_id illegalargumentexception minout docstatus_completed getdocstatus illegalargumentexception minvoice minvoice p_m_pricelist_id setm_pricelist_id p_m_pricelist_id p_invoicedocumentno p_invoicedocumentno setdocumentno p_invoicedocumentno illegalargumentexception minoutline shiplines getlines shiplines minoutline sline shiplines minvoiceline minvoiceline setshipline sline setqtyentered sline getqtyentered setqtyinvoiced sline getmovementqty illegalargumentexception getdocumentno prepare e g get parameters protected void prepare string buffer sb new string buffer record id append getrecord id parameter process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c period id p c period id para i get parameter as int else if name equals pa hierarchy id p pa hierarchy id para i get parameter as int else if name equals org id p org id big decimal para i get parameter int value else if name equals c bpartner id p c bpartner id big decimal para i get parameter int value else if name equals m product id p m product id big decimal para i get parameter int value else if name equals c project id p c project id big decimal para i get parameter int value else if name equals c activity id p c activity id big decimal para i get parameter int value else if name equals c salesregion id p c salesregion id big decimal para i get parameter int value else if name equals c campaign id p c campaign id big decimal para i get parameter int value else if name equals update balances p updatebalances y equals para i get parameter else if name equals details source first p detailssourcefirst y equals para i get parameter else log log level severe unknown parameter name optional org if p org id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype organization p org id optional b partner if p c bpartner id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype bpartner p c bpartner id optional product if p m product id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype product p m product id optional project if p c project id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype project p c project id optional activity if p c activity id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype activity p c activity id optional campaign if p c campaign id 0 m parameterwhere append and c campaign id append p c campaign id m parameterwhere append and append m report tree get where clause get ctx m acct schema element elementtype campaign p c campaign id optional sales region if p c salesregion id 0 m parameterwhere append and append m report tree get where clause get ctx p pa hierarchy id m acct schema element elementtype salesregion p c salesregion id load report definition m report new m report get ctx getrecord id null sb append append m report set periods sb append c period id append p c period id append append m parameterwhere log info sb to string m report list stringbuffer stringbuffer record_id getrecord_id processinfoparameter getparameter getparametername getparameter c_period_id p_c_period_id getparameterasint pa_hierarchy_id p_pa_hierarchy_id getparameterasint org_id p_org_id bigdecimal getparameter intvalue c_bpartner_id p_c_bpartner_id bigdecimal getparameter intvalue m_product_id p_m_product_id bigdecimal getparameter intvalue c_project_id p_c_project_id bigdecimal getparameter intvalue c_activity_id p_c_activity_id bigdecimal getparameter intvalue c_salesregion_id p_c_salesregion_id bigdecimal getparameter intvalue c_campaign_id p_c_campaign_id bigdecimal getparameter intvalue updatebalances p_updatebalances getparameter detailssourcefirst p_detailssourcefirst getparameter p_org_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_organization p_org_id bpartner p_c_bpartner_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_bpartner p_c_bpartner_id p_m_product_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_product p_m_product_id p_c_project_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_project p_c_project_id p_c_activity_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_activity p_c_activity_id p_c_campaign_id m_parameterwhere c_campaign_id p_c_campaign_id m_parameterwhere mreporttree getwhereclause getctx macctschemaelement elementtype_campaign p_c_campaign_id p_c_salesregion_id m_parameterwhere mreporttree getwhereclause getctx p_pa_hierarchy_id macctschemaelement elementtype_salesregion p_c_salesregion_id m_report mreport getctx getrecord_id m_report setperiods c_period_id p_c_period_id m_parameterwhere tostring m_report set periods private void set periods log info c calendar id m report getc calendar id timestamp today time util get day system current time millis array list fin report period list new array list fin report period string sql select p c period id p name p start date p end date min p1 start date from c period p inner join c year y on p c year id y c year id c period p1 where y c calendar id globalqss cruiz bug 1577712 financial period bug and p is active y and p period type s and p1 c year id y c year id and p1 period type s group by p c period id p name p start date p end date order by p start date prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m report getc calendar id result set rs pstmt execute query while rs next fin report period frp new fin report period rs get int 1 rs get string 2 rs get timestamp 3 rs get timestamp 4 rs get timestamp 5 list add frp if p c period id 0 frp in period today p c period id frp getc period id rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null convert to array m periods new fin report period list size list to array m periods today after latest period if p c period id 0 m reportperiod m periods length 1 p c period id m periods m reportperiod getc period id setperiods c_calendar_id m_report getc_calendar_id timeutil getday currenttimemillis arraylist finreportperiod arraylist finreportperiod c_period_id startdate enddate startdate c_period c_year c_year_id c_year_id c_period c_calendar_id isactive periodtype c_year_id c_year_id periodtype c_period_id startdate enddate startdate preparedstatement preparestatement setint m_report getc_calendar_id resultset executequery finreportperiod finreportperiod getint getstring gettimestamp gettimestamp gettimestamp p_c_period_id inperiod p_c_period_id getc_period_id m_periods finreportperiod toarray m_periods p_c_period_id m_reportperiod m_periods p_c_period_id m_periods m_reportperiod getc_period_id perform process return message to be translated throws exception protected string do it throws exception log info ad pinstance id getad pinstance id create temporary and empty report lines from pa reportline ad pinstance id pa reportline id 0 0 int pa reportlineset id m report get line set getpa reportlineset id string buffer sql new string buffer insert into t report ad pinstance id pa reportline id record id fact acct id seq no level no name description select append getad pinstance id append pa reportline id 0 0 seq no 0 name description from pa reportline where is active y and pa reportlineset id append pa reportlineset id int no db execute update sql to string get trxname log fine report lines no update acct schema balances if p updatebalances fin balance update balance m report getc acctschema id false get data segment values m columns m report get column set get columns if m columns length 0 throw new compiere user error no pa reportcolumn id m lines m report get line set get liness if m lines length 0 throw new compiere user error no pa reportline id for all lines for int line 0 line m lines length line line segment value i e not calculation if m lines line is line type segment value insert line line for all lines insert line detail do calculations delete unprinted lines create report if ini is client get process info set transient object get print format else get process info set serializable object get print format log fine system current time millis m start ms return doit ad_pinstance_id getad_pinstance_id pa_reportline ad_pinstance_id pa_reportline_id pa_reportlineset_id m_report getlineset getpa_reportlineset_id stringbuffer stringbuffer t_report ad_pinstance_id pa_reportline_id record_id fact_acct_id seqno levelno getad_pinstance_id pa_reportline_id seqno pa_reportline isactive pa_reportlineset_id pa_reportlineset_id executeupdate tostring get_trxname acctschema p_updatebalances finbalance updatebalance m_report getc_acctschema_id m_columns m_report getcolumnset getcolumns m_columns compiereusererror pa_reportcolumn_id m_lines m_report getlineset getliness m_lines compiereusererror pa_reportline_id m_lines m_lines islinetypesegmentvalue insertline insertlinedetail docalculations deleteunprintedlines isclient getprocessinfo settransientobject getprintformat getprocessinfo setserializableobject getprintformat currenttimemillis m_start for all columns in a line with relative period access param line line private void insert line int line log info m lines line no source lines headings if m lines line null m lines line get sources length 0 log warning no source lines m lines line return string buffer update new string buffer for all columns for int col 0 col m columns length col ignore calculation columns if m columns col is column type calculation continue string buffer info new string buffer info append line append line append col append col select sum string buffer select new string buffer select if m lines line get amount type null line amount type overwrites column string sql m lines line get select clause true select append sql info append line amt type append m lines line get amount type else if m columns col get amount type null string sql m columns col get select clause true select append sql info append column amt type append m columns col get amount type else log warning no amount type in line m lines line or column m columns col continue get period date info select append from fact acct balance where date acct big decimal relative offset null current if m columns col is column type relative period relative offset m columns col get relative period fin report period frp get period relative offset if m lines line get amount type null line amount type overwrites column info append line date acct if m lines line is period string sql frp get period where info append period select append sql else if m lines line is year string sql frp get year where info append year select append sql else if m lines line is total string sql frp get total where info append total select append sql else log log level severe no valid line amount type select append 0 valid sql else if m columns col get amount type null info append column date acct if m columns col is period string sql frp get period where info append period select append sql else if m columns col is year string sql frp get year where info append year select append sql else if m columns col is total string sql frp get total where info append total select append sql else log log level severe no valid column amount type select append 0 valid sql line where string s m lines line get where clause p pa hierarchy id sources posting type if s null s length 0 select append and append s report where s m report get where clause if s null s length 0 select append and append s posting type if m lines line is posting type only if not defined on line string posting type m columns col get posting type if posting type null posting type length 0 select append and posting type append posting type append if m columns col is column type segment value string element type m columns col get element type if m report column elementtype organization equals element type select append and ad org id append m columns col getorg id else if m report column elementtype bpartner equals element type select append and c bpartner id append m columns col getc bpartner id else if m report column elementtype product equals element type select append and m product id append m columns col getm product id else if m report column elementtype project equals element type select append and c project id append m columns col getc project id else if m report column elementtype activity equals element type select append and c activity id append m columns col getc activity id else if m report column elementtype campaign equals element type select append and c campaign id append m columns col getc campaign id else if m report column elementtype locationfrom equals element type select append and c locfrom id append m columns col getc location id else if m report column elementtype locationto equals element type select append and c locto id append m columns col getc location id else if m report column elementtype orgtrx equals element type select append and ad orgtrx id append m columns col getorg id else if m report column elementtype salesregion equals element type select append and c salesregion id append m columns col getc salesregion id else if m report column elementtype account equals element type select append and account id append m columns col getc elementvalue id else if m report column elementtype userlist1 equals element type select append and user1 id append m columns col getc elementvalue id else if m report column elementtype userlist2 equals element type select append and user2 id append m columns col getc elementvalue id else if m report column elementtype userelement1 equals element type select append and userelement1 id append m columns col getc elementvalue id else if m report column elementtype userelement2 equals element type select append and userelement2 id append m columns col getc elementvalue id parameter where select append m parameterwhere log finest line line col line select update set portion if update length 0 update append update append col append col append append select append log finest info to string update line values if update length 0 update insert 0 update t report set update append where ad pinstance id append getad pinstance id append and pa reportline id append m lines line getpa reportline id append and abs level no 2 0 line 1 acct int no db execute update update to string get trxname if no 1 log log level severe no for update log finest update to string insertline m_lines m_lines m_lines getsources m_lines stringbuffer stringbuffer m_columns m_columns iscolumntypecalculation stringbuffer stringbuffer stringbuffer stringbuffer m_lines getamounttype m_lines getselectclause lineamttype m_lines getamounttype m_columns getamounttype m_columns getselectclause columnamttype m_columns getamounttype m_lines m_columns fact_acct_balance dateacct bigdecimal relativeoffset m_columns iscolumntyperelativeperiod relativeoffset m_columns getrelativeperiod finreportperiod getperiod relativeoffset m_lines getamounttype linedateacct m_lines isperiod getperiodwhere m_lines isyear getyearwhere m_lines istotal gettotalwhere amounttype m_columns getamounttype columndateacct m_columns isperiod getperiodwhere m_columns isyear getyearwhere m_columns istotal gettotalwhere amounttype m_lines getwhereclause p_pa_hierarchy_id m_report getwhereclause postingtype m_lines ispostingtype postingtype m_columns getpostingtype postingtype postingtype postingtype postingtype m_columns iscolumntypesegmentvalue elementtype m_columns getelementtype mreportcolumn elementtype_organization elementtype ad_org_id m_columns getorg_id mreportcolumn elementtype_bpartner elementtype c_bpartner_id m_columns getc_bpartner_id mreportcolumn elementtype_product elementtype m_product_id m_columns getm_product_id mreportcolumn elementtype_project elementtype c_project_id m_columns getc_project_id mreportcolumn elementtype_activity elementtype c_activity_id m_columns getc_activity_id mreportcolumn elementtype_campaign elementtype c_campaign_id m_columns getc_campaign_id mreportcolumn elementtype_locationfrom elementtype c_locfrom_id m_columns getc_location_id mreportcolumn elementtype_locationto elementtype c_locto_id m_columns getc_location_id mreportcolumn elementtype_orgtrx elementtype ad_orgtrx_id m_columns getorg_id mreportcolumn elementtype_salesregion elementtype c_salesregion_id m_columns getc_salesregion_id mreportcolumn elementtype_account elementtype account_id m_columns getc_elementvalue_id mreportcolumn elementtype_userlist1 elementtype user1_id m_columns getc_elementvalue_id mreportcolumn elementtype_userlist2 elementtype user2_id m_columns getc_elementvalue_id mreportcolumn elementtype_userelement1 elementtype userelement1_id m_columns getc_elementvalue_id mreportcolumn elementtype_userelement2 elementtype userelement2_id m_columns getc_elementvalue_id m_parameterwhere col_ tostring t_report ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id levelno executeupdate tostring get_trxname tostring line column calculation private void do calculations for all lines for int line 0 line m lines length line if m lines line is line type calculation continue int oper 1 m lines line getoper 1 id int oper 2 m lines line getoper 2 id log fine line line oper 1 m lines line get calculation type oper 2 adding if m lines line is calculation type add m lines line is calculation type range reverse range if oper 1 oper 2 int temp oper 1 oper 1 oper 2 oper 2 temp string buffer sb new string buffer update t report set for int col 0 col m columns length col if col 0 sb append sb append col append col sb append select for int col 0 col m columns length col if col 0 sb append sb append coalesce sum col append col append 0 sb append from t report where ad pinstance id append getad pinstance id append and pa reportline id in if m lines line is calculation type add sb append oper 1 append append oper 2 else sb append get linei ds oper 1 oper 2 list of columns to add up sb append and abs level no 1 0 line 1 acct where ad pinstance id append getad pinstance id append and pa reportline id append m lines line getpa reportline id append and abs level no 1 not trx int no db execute update sb to string get trxname if no 1 log log level severe no for m lines line sb to string else log fine line line m lines line log finest sb to string else no add subtract percent step 1 get first value or 0 in there string buffer sb new string buffer update t report set for int col 0 col m columns length col if col 0 sb append sb append col append col sb append select for int col 0 col m columns length col if col 0 sb append sb append coalesce r2 col append col append 0 sb append from t report r2 where r2 ad pinstance id append getad pinstance id append and r2 pa reportline id append oper 1 append and r2 record id 0 and r2 fact acct id 0 where ad pinstance id append getad pinstance id append and pa reportline id append m lines line getpa reportline id append and abs level no 1 0 line 1 acct int no db execute update sb to string get trxname if no 1 log severe x no for m lines line sb to string continue step 2 do calculation with second value sb new string buffer update t report r1 set for int col 0 col m columns length col if col 0 sb append sb append col append col sb append select for int col 0 col m columns length col if col 0 sb append sb append coalesce r1 col append col append 0 fix bug 1563664 errors in values shown in financial reports carlos ruiz globalqss if m lines line is calculation type subtract sb append solution for subtraction replace the null with 0 instead of 0 000000001 sb append coalesce r2 col append col append 0 else solution for division don t replace the null convert 0 to null avoid ora 01476 sb append sb append decode r2 col append col append 0 null r2 col append col append end fix bug 1563664 if m lines line is calculation type percent sb append 100 sb append from t report r2 where r2 ad pinstance id append getad pinstance id append and r2 pa reportline id append oper 2 append and r2 record id 0 and r2 fact acct id 0 where ad pinstance id append getad pinstance id append and pa reportline id append m lines line getpa reportline id append and abs level no 1 0 line 1 acct no db execute update sb to string get trxname if no 1 log severe x no for m lines line sb to string else log fine x line line m lines line log finest sb to string for all lines for all columns for int col 0 col m columns length col only calculations if m columns col is column type calculation continue string buffer sb new string buffer update t report set column to set sb append col append col append first operand int ii 1 get column index m columns col getoper 1 id if ii 1 0 log log level severe column index for operator 1 not found m columns col continue second operand int ii 2 get column index m columns col getoper 2 id if ii 2 0 log log level severe column index for operator 2 not found m columns col continue log fine column col ii 1 m columns col get calculation type ii 2 reverse range if ii 1 ii 2 m columns col is calculation type range log fine swap operands from ii 1 op ii 2 int temp ii 1 ii 1 ii 2 ii 2 temp if m columns col is calculation type add sb append coalesce col append ii 1 append 0 append append coalesce col append ii 2 append 0 else if m columns col is calculation type subtract sb append coalesce col append ii 1 append 0 append append coalesce col append ii 2 append 0 if m columns col is calculation type percent sb append case when coalesce col append ii 2 append 0 0 then null else append coalesce col append ii 1 append 0 append append col append ii 2 append 100 end zero divide range else if m columns col is calculation type range sb append coalesce col append ii 1 append 0 for int ii ii 1 1 ii ii 2 ii sb append coalesce col append ii append 0 sb append where ad pinstance id append getad pinstance id append and abs level no 2 0 line 1 acct int no db execute update sb to string get trxname if no 1 log severe no for m columns col sb to string else log fine col col m columns col log finest sb to string for all columns docalculations m_lines m_lines islinetypecalculation oper_1 m_lines getoper_1_id oper_2 m_lines getoper_2_id oper_1 m_lines getcalculationtype oper_2 m_lines iscalculationtypeadd m_lines iscalculationtyperange oper_1 oper_2 oper_1 oper_1 oper_2 oper_2 stringbuffer stringbuffer t_report m_columns col_ m_columns col_ t_report ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines iscalculationtypeadd oper_1 oper_2 getlineids oper_1 oper_2 levelno ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id levelno executeupdate tostring get_trxname m_lines tostring m_lines tostring stringbuffer stringbuffer t_report m_columns col_ m_columns col_ t_report ad_pinstance_id getad_pinstance_id pa_reportline_id oper_1 record_id fact_acct_id ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id levelno executeupdate tostring get_trxname m_lines tostring stringbuffer t_report m_columns col_ m_columns col_ m_lines iscalculationtypesubtract col_ col_ col_ m_lines iscalculationtypepercent t_report ad_pinstance_id getad_pinstance_id pa_reportline_id oper_2 record_id fact_acct_id ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id levelno executeupdate tostring get_trxname m_lines tostring m_lines tostring m_columns m_columns iscolumntypecalculation stringbuffer stringbuffer t_report col_ ii_1 getcolumnindex m_columns getoper_1_id ii_1 m_columns ii_2 getcolumnindex m_columns getoper_2_id ii_2 m_columns ii_1 m_columns getcalculationtype ii_2 ii_1 ii_2 m_columns iscalculationtyperange ii_1 ii_2 ii_1 ii_1 ii_2 ii_2 m_columns iscalculationtypeadd col_ ii_1 col_ ii_2 m_columns iscalculationtypesubtract col_ ii_1 col_ ii_2 m_columns iscalculationtypepercent col_ ii_2 col_ ii_1 col_ ii_2 m_columns iscalculationtyperange col_ ii_1 ii_1 ii_2 col_ ad_pinstance_id getad_pinstance_id levelno executeupdate tostring get_trxname m_columns tostring m_columns tostring get list of pa reportline id from to param fromid from id param toid to id return comma separated list private string get linei ds int fromid int toid log finest from fromid to toid string buffer sb new string buffer sb append fromid boolean add to list false for int line 0 line m lines length line int pa reportline id m lines line getpa reportline id log finest add add to list id pa reportline id m lines line if add to list sb append append pa reportline id if pa reportline id toid done break else if pa reportline id fromid from already added add to list true return sb to string pa_reportline_id getlineids stringbuffer stringbuffer addtolist m_lines pa_reportline_id m_lines getpa_reportline_id addtolist pa_reportline_id m_lines addtolist pa_reportline_id pa_reportline_id pa_reportline_id addtolist tostring get column index param pa reportcolumn id pa reportcolumn id return zero based index or if not found private int get column index int pa reportcolumn id for int i 0 i m columns length i if m columns i getpa reportcolumn id pa reportcolumn id return i return 1 pa_reportcolumn_id pa_reportcolumn_id getcolumnindex pa_reportcolumn_id m_columns m_columns getpa_reportcolumn_id pa_reportcolumn_id get financial reporting period based on reportong period and offset param relative offset offset return reporting period private fin report period get period big decimal relative offset if relative offset null return get period 0 return get period relative offset int value relativeoffset finreportperiod getperiod bigdecimal relativeoffset relativeoffset getperiod getperiod relativeoffset intvalue get financial reporting period based on reporting period and offset param relative offset offset return reporting period private fin report period get period int relative offset find current reporting period c period id if m reportperiod 0 for int i 0 i m periods length i if p c period id m periods i getc period id m reportperiod i break if m reportperiod 0 m reportperiod m periods length throw new unsupported operation exception period index not found report period m reportperiod c period id p c period id bounds check int index m reportperiod relative offset if index 0 log log level severe relative offset relative offset not valid for selected period m reportperiod index 0 else if index m periods length log log level severe relative offset relative offset not valid for selected period m reportperiod index m periods length 1 get period return m periods index relativeoffset finreportperiod getperiod relativeoffset c_period_id m_reportperiod m_periods p_c_period_id m_periods getc_period_id m_reportperiod m_reportperiod m_reportperiod m_periods unsupportedoperationexception reportperiod m_reportperiod c_period_id p_c_period_id m_reportperiod relativeoffset relativeoffset m_reportperiod m_periods relativeoffset m_reportperiod m_periods m_periods insert detail lines if enabled private void insert line detail if m report is list sources return log info for all source lines for int line 0 line m lines length line line segment value i e not calculation if m lines line is line type segment value insert line source line set seq no string buffer sql new string buffer update t report r1 set seq no select seq no from t report r2 where r1 ad pinstance id r2 ad pinstance id and r1 pa reportline id r2 pa reportline id and r2 record id 0 and r2 fact acct id 0 where seq no is null int no db execute update sql to string get trxname log fine seq no no if m report is list trx return set name description string sql select select e name fa description from fact acct fa inner join ad table t on fa ad table id t ad table id inner join ad element e on t table name id e column name where r fact acct id fa fact acct id translated version sql new string buffer update t report r set name description append sql select append where fact acct id 0 and ad pinstance id append getad pinstance id no db execute update sql to string get trxname if c log mgt is level finest log fine trx name no sql to string insertlinedetail m_report islistsources m_lines m_lines islinetypesegmentvalue insertlinesource seqno stringbuffer stringbuffer t_report seqno seqno t_report ad_pinstance_id ad_pinstance_id pa_reportline_id pa_reportline_id record_id fact_acct_id seqno executeupdate tostring get_trxname seqno m_report islisttrx sql_select fact_acct ad_table ad_table_id ad_table_id ad_element tablename _id columnname fact_acct_id fact_acct_id stringbuffer t_report sql_select fact_acct_id ad_pinstance_id getad_pinstance_id executeupdate tostring get_trxname clogmgt islevelfinest tostring insert detail line per source for all columns in a line with relative period access ad pinstance id pa reportline id variable 0 level 1 param line line private void insert line source int line log info line line m lines line no source lines if m lines line null m lines line get sources length 0 return string variable m lines line get source column name if variable null return log fine variable variable insert string buffer insert new string buffer insert into t report ad pinstance id pa reportline id record id fact acct id level no for int col 0 col m columns length col insert append col append col select insert append select append getad pinstance id append append m lines line getpa reportline id append append variable append 0 if p detailssourcefirst insert append 1 else insert append 1 for all columns create select statement for int col 0 col m columns length col insert append no calculation if m columns col is column type calculation insert append null continue select sum string buffer select new string buffer select if m lines line get amount type null line amount type overwrites column select append m lines line get select clause true else if m columns col get amount type null select append m columns col get select clause true else insert append null continue get period info select append from fact acct balance fb where date acct fin report period frp get period m columns col get relative period if m lines line get amount type null line amount type overwrites column if m lines line is period select append frp get period where else if m lines line is year select append frp get year where else select append frp get total where else if m columns col get amount type null if m columns col is period select append frp get period where else if m columns col is year select append frp get year where else select append frp get total where link select append and fb append variable append x append variable posting type if m lines line is posting type only if not defined on line string posting type m columns col get posting type if posting type null posting type length 0 select append and fb posting type append posting type append report where string s m report get where clause if s null s length 0 select append and append s limited segment values if m columns col is column type segment value string element type m columns col get element type if m report column elementtype organization equals element type select append and ad org id append m columns col getorg id else if m report column elementtype bpartner equals element type select append and c bpartner id append m columns col getc bpartner id else if m report column elementtype product equals element type select append and m product id append m columns col getm product id else if m report column elementtype project equals element type select append and c project id append m columns col getc project id else if m report column elementtype activity equals element type select append and c activity id append m columns col getc activity id else if m report column elementtype campaign equals element type select append and c campaign id append m columns col getc campaign id else if m report column elementtype locationfrom equals element type select append and c locfrom id append m columns col getc location id else if m report column elementtype locationto equals element type select append and c locto id append m columns col getc location id else if m report column elementtype orgtrx equals element type select append and ad orgtrx id append m columns col getorg id else if m report column elementtype salesregion equals element type select append and c salesregion id append m columns col getc salesregion id else if m report column elementtype account equals element type select append and account id append m columns col getc elementvalue id else if m report column elementtype userlist1 equals element type select append and user1 id append m columns col getc elementvalue id else if m report column elementtype userlist2 equals element type select append and user2 id append m columns col getc elementvalue id else if m report column elementtype userelement1 equals element type select append and userelement1 id append m columns col getc elementvalue id else if m report column elementtype userelement2 equals element type select append and userelement2 id append m columns col getc elementvalue id parameter where select append m parameterwhere system out println c col l line select insert append append select append insert append from fact acct balance x where append m lines line get where clause p pa hierarchy id sources posting type string s m report get where clause if s null s length 0 insert append and append s insert append m parameterwhere append group by append variable int no db execute update insert to string get trxname if c log mgt is level finest log fine source no insert if no 0 return set name description string buffer sql new string buffer update t report set name description append m lines line get source value query append record id where record id 0 and ad pinstance id append getad pinstance id append and pa reportline id append m lines line getpa reportline id append and fact acct id 0 no db execute update sql to string get trxname if c log mgt is level finest log fine name no sql to string if m report is list trx insert line trx line variable ad_pinstance_id pa_reportline_id insertlinesource m_lines m_lines m_lines getsources m_lines getsourcecolumnname stringbuffer stringbuffer t_report ad_pinstance_id pa_reportline_id record_id fact_acct_id levelno m_columns col_ getad_pinstance_id m_lines getpa_reportline_id p_detailssourcefirst m_columns m_columns iscolumntypecalculation stringbuffer stringbuffer m_lines getamounttype m_lines getselectclause m_columns getamounttype m_columns getselectclause fact_acct_balance dateacct finreportperiod getperiod m_columns getrelativeperiod m_lines getamounttype m_lines isperiod getperiodwhere m_lines isyear getyearwhere gettotalwhere m_columns getamounttype m_columns isperiod getperiodwhere m_columns isyear getyearwhere gettotalwhere postingtype m_lines ispostingtype postingtype m_columns getpostingtype postingtype postingtype postingtype postingtype m_report getwhereclause m_columns iscolumntypesegmentvalue elementtype m_columns getelementtype mreportcolumn elementtype_organization elementtype ad_org_id m_columns getorg_id mreportcolumn elementtype_bpartner elementtype c_bpartner_id m_columns getc_bpartner_id mreportcolumn elementtype_product elementtype m_product_id m_columns getm_product_id mreportcolumn elementtype_project elementtype c_project_id m_columns getc_project_id mreportcolumn elementtype_activity elementtype c_activity_id m_columns getc_activity_id mreportcolumn elementtype_campaign elementtype c_campaign_id m_columns getc_campaign_id mreportcolumn elementtype_locationfrom elementtype c_locfrom_id m_columns getc_location_id mreportcolumn elementtype_locationto elementtype c_locto_id m_columns getc_location_id mreportcolumn elementtype_orgtrx elementtype ad_orgtrx_id m_columns getorg_id mreportcolumn elementtype_salesregion elementtype c_salesregion_id m_columns getc_salesregion_id mreportcolumn elementtype_account elementtype account_id m_columns getc_elementvalue_id mreportcolumn elementtype_userlist1 elementtype user1_id m_columns getc_elementvalue_id mreportcolumn elementtype_userlist2 elementtype user2_id m_columns getc_elementvalue_id mreportcolumn elementtype_userelement1 elementtype userelement1_id m_columns getc_elementvalue_id mreportcolumn elementtype_userelement2 elementtype userelement2_id m_columns getc_elementvalue_id m_parameterwhere fact_acct_balance m_lines getwhereclause p_pa_hierarchy_id m_report getwhereclause m_parameterwhere executeupdate tostring get_trxname clogmgt islevelfinest stringbuffer stringbuffer t_report m_lines getsourcevaluequery record_id record_id ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id fact_acct_id executeupdate tostring get_trxname clogmgt islevelfinest tostring m_report islisttrx insertlinetrx create trx line per source detail ad pinstance id pa reportline id variable fact acct id level 2 param line line param variable variable e g account id private void insert line trx int line string variable log info line line variable variable insert string buffer insert new string buffer insert into t report ad pinstance id pa reportline id record id fact acct id level no for int col 0 col m columns length col insert append col append col select insert append select append getad pinstance id append append m lines line getpa reportline id append append variable append fact acct id if p detailssourcefirst insert append 2 else insert append 2 for all columns create select statement for int col 0 col m columns length col insert append only relative period not calculation or segment value if m columns col is column type relative period m columns col get relative period as int 0 insert append null continue amount type qty if m lines line get amount type null line amount type overwrites column insert append m lines line get select clause false else if m columns col get amount type null insert append m columns col get select clause false else insert append null continue insert append from fact acct where append m lines line get where clause p pa hierarchy id sources posting type report where string s m report get where clause if s null s length 0 insert append and append s period restriction fin report period frp get period 0 insert append and date acct append frp get period where posting type if m lines line is posting type only if not defined on line string posting type m columns col get posting type if posting type null posting type length 0 insert append and posting type append posting type append int no db execute update insert to string get trxname log finest trx no insert if no 0 return ad_pinstance_id pa_reportline_id fact_acct_id account_id insertlinetrx stringbuffer stringbuffer t_report ad_pinstance_id pa_reportline_id record_id fact_acct_id levelno m_columns col_ getad_pinstance_id m_lines getpa_reportline_id fact_acct_id p_detailssourcefirst m_columns m_columns iscolumntyperelativeperiod m_columns getrelativeperiodasint m_lines getamounttype m_lines getselectclause m_columns getamounttype m_columns getselectclause fact_acct m_lines getwhereclause p_pa_hierarchy_id m_report getwhereclause finreportperiod getperiod dateacct getperiodwhere postingtype m_lines ispostingtype postingtype m_columns getpostingtype postingtype postingtype postingtype postingtype executeupdate tostring get_trxname delete unprinted lines private void delete unprinted lines for int line 0 line m lines length line not printed delete in t if m lines line is printed string sql delete from t report where ad pinstance id getad pinstance id and pa reportline id m lines line getpa reportline id int no db execute update sql get trxname if no 0 log fine m lines line get name no for all lines deleteunprintedlines m_lines m_lines isprinted t_report ad_pinstance_id getad_pinstance_id pa_reportline_id m_lines getpa_reportline_id executeupdate get_trxname m_lines getname get create print format return print format private m print format get print format int ad printformat id m report getad printformat id log info ad printformat id ad printformat id m print format pf null boolean create new ad printformat id 0 create new if create new int ad table id 544 t report pf m print format create from table env get ctx ad table id ad printformat id pf getad printformat id m report setad printformat id ad printformat id m report save else pf m print format get get ctx ad printformat id false use cache print format sync if m report get name equals pf get name pf set name m report get name if m report get description null if pf get description null pf set description null else if m report get description equals pf get description pf set description m report get description pf save log fine pf pf get item count print format item sync int count pf get item count for int i 0 i count i m print format item pfi pf get item i string column name pfi get column name if column name null log log level severe no column name for i pfi if pfi is printed pfi set is printed false if pfi is order by pfi set is order by false if pfi get sort no 0 pfi set sort no 0 else if column name starts with col int index integer parse int column name substring 4 if index m columns length pfi set is printed m columns index is printed string s m columns index get name if pfi get name equals s pfi set name s pfi set print name s int seq 30 index if pfi get seq no seq pfi set seq no seq else not printed if pfi is printed pfi set is printed false not sorted if pfi is order by pfi set is order by false if pfi get sort no 0 pfi set sort no 0 else if column name equals seq no if pfi is printed pfi set is printed false if pfi is order by pfi set is order by true if pfi get sort no 10 pfi set sort no 10 else if column name equals level no if pfi is printed pfi set is printed false if pfi is order by pfi set is order by true if pfi get sort no 20 pfi set sort no 20 else if column name equals name if pfi get seq no 10 pfi set seq no 10 if pfi is printed pfi set is printed true if pfi is order by pfi set is order by true if pfi get sort no 30 pfi set sort no 30 else if column name equals description if pfi get seq no 20 pfi set seq no 20 if pfi is printed pfi set is printed true if pfi is order by pfi set is order by false if pfi get sort no 0 pfi set sort no 0 else not printed no sort if pfi is printed pfi set is printed false if pfi is order by pfi set is order by false if pfi get sort no 0 pfi set sort no 0 pfi save log fine pfi to string set translated to original pf set translation first one is unsorted just re load if create new pf m print format get get ctx ad printformat id false use cache return pf printformat mprintformat getprintformat ad_printformat_id m_report getad_printformat_id ad_printformat_id ad_printformat_id mprintformat createnew ad_printformat_id createnew ad_table_id t_report mprintformat createfromtable getctx ad_table_id ad_printformat_id getad_printformat_id m_report setad_printformat_id ad_printformat_id m_report mprintformat getctx ad_printformat_id m_report getname getname setname m_report getname m_report getdescription getdescription setdescription m_report getdescription getdescription setdescription m_report getdescription getitemcount getitemcount mprintformatitem getitem columnname getcolumnname columnname columnname isprinted setisprinted isorderby setisorderby getsortno setsortno columnname startswith parseint columnname m_columns setisprinted m_columns isprinted m_columns getname getname setname setprintname getseqno setseqno isprinted setisprinted isorderby setisorderby getsortno setsortno columnname seqno isprinted setisprinted isorderby setisorderby getsortno setsortno columnname levelno isprinted setisprinted isorderby setisorderby getsortno setsortno columnname getseqno setseqno isprinted setisprinted isorderby setisorderby getsortno setsortno columnname getseqno setseqno isprinted setisprinted isorderby setisorderby getsortno setsortno isprinted setisprinted isorderby setisorderby getsortno setsortno tostring settranslation createnew mprintformat getctx ad_printformat_id get m resolution from cache param ctx context param r resolution id id return m resolution public static m resolution get properties ctx int r resolution id integer key new integer r resolution id m resolution ret value m resolution s cache get key if ret value null return ret value ret value new m resolution ctx r resolution id null if ret value get id 0 s cache put key ret value return ret value mresolution r_resolution_id mresolution mresolution r_resolution_id r_resolution_id mresolution retvalue mresolution s_cache retvalue retvalue retvalue mresolution r_resolution_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param r resolution id id param trx name public m resolution properties ctx int r resolution id string trx name super ctx r resolution id trx name r_resolution_id trxname mresolution r_resolution_id trxname r_resolution_id trxname load constructor param ctx context param rs result set param trx name trx public m resolution properties ctx result set rs string trx name super ctx rs trx name trxname mresolution resultset trxname trxname get contents return contents public object get contents return contents getcontents basic constructor you need to set the attributes using the set methods public div use the set methods to set the values of the attributes param value set the value of lt div gt value lt div gt public div string value add element value addelement use the set methods to set the values of the attributes param element set the value of lt div gt value lt div gt public div span element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public div add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public div add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public div add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public div add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public div remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param ctx context param c bp bankaccount id bp bank account public mbp bank account properties ctx int c bp bankaccount id string trx name super ctx c bp bankaccount id trx name if c bp bankaccount id 0 setc bpartner id 0 set isach false c_bp_bankaccount_id mbpbankaccount c_bp_bankaccount_id trxname c_bp_bankaccount_id trxname c_bp_bankaccount_id setc_bpartner_id setisach constructor param ctx context param rs result set public mbp bank account properties ctx result set rs string trx name super ctx rs trx name mbpbankaccount resultset trxname trxname constructor param ctx context param bp bp param bpc bp contact param location location public mbp bank account properties ctx mb partner bp m user bpc m location location super ctx 0 bp get trxname set isach false setc bpartner id bp getc bpartner id seta name bpc get name seta email bpc gete mail seta street location get address1 seta city location get city seta zip location get postal seta state location get region name true seta country location get country name mbpbankaccount mbpartner muser mlocation get_trxname setisach setc_bpartner_id getc_bpartner_id seta_name getname seta_email getemail seta_street getaddress1 seta_city getcity seta_zip getpostal seta_state getregionname seta_country getcountryname string representation return info public string to string string buffer sb new string buffer mbp bankaccount append get id append name append geta name append return sb to string tostring stringbuffer stringbuffer mbp_bankaccount get_id geta_name tostring basic constructor public style basic constructor param type the type attribute public style string type set type type settype basic constructor param type the type attribute param element adds an element to the element public style string type element element set type type add element element settype addelement basic constructor param type the type attribute param element adds an element to the element public style string type string element set type type add element element settype addelement sets the type attribute param type the type attribute public style set type string type add attribute type type return this settype addattribute sets the media attribute param media the media attribute public style set media string media add attribute media media return this setmedia addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public style add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public style add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public style add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public style add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public style remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry standard constructor param ctx context param c periodcontrol id 0 public m period control properties ctx int c periodcontrol id string trx name super ctx c periodcontrol id trx name if c periodcontrol id 0 setc period id 0 set doc base type null set period action periodaction noaction set period status periodstatus neveropened c_periodcontrol_id mperiodcontrol c_periodcontrol_id trxname c_periodcontrol_id trxname c_periodcontrol_id setc_period_id setdocbasetype setperiodaction periodaction_noaction setperiodstatus periodstatus_neveropened load constructor param ctx context param rs result set public m period control properties ctx result set rs string trx name super ctx rs trx name mperiodcontrol resultset trxname trxname parent constructor param period parent param doc base type doc base type public m period control m period period string doc base type this period get ctx period getad client id period getc period id doc base type period get trxname docbasetype mperiodcontrol mperiod docbasetype getctx getad_client_id getc_period_id docbasetype get_trxname new constructor param ctx context param c period id period param doc base type doc base type public m period control properties ctx int ad client id int c period id string doc base type string trx name this ctx 0 trx name set client org ad client id 0 setc period id c period id set doc base type doc base type c_period_id docbasetype mperiodcontrol ad_client_id c_period_id docbasetype trxname trxname setclientorg ad_client_id setc_period_id c_period_id setdocbasetype docbasetype is period open return true if open public boolean is open return periodstatus open equals get period status isopen periodstatus_open getperiodstatus string representation return info public string to string string buffer sb new string buffer m period control sb append get id append append get doc base type append status append get period status append return sb to string tostring stringbuffer stringbuffer mperiodcontrol get_id getdocbasetype getperiodstatus tostring standard constructor public x m inoutconfirm properties ctx int m inoutconfirm id string trx name super ctx m inoutconfirm id trx name if m inoutconfirm id 0 set confirm type null set doc action null co set doc status null dr set document no null set is approved false set is cancelled false set is in dispute false n setm inoutconfirm id 0 setm inout id 0 set processed false x_m_inoutconfirm m_inoutconfirm_id trxname m_inoutconfirm_id trxname m_inoutconfirm_id setconfirmtype setdocaction setdocstatus setdocumentno setisapproved setiscancelled setisindispute setm_inoutconfirm_id setm_inout_id setprocessed load constructor public x m inoutconfirm properties ctx result set rs string trx name super ctx rs trx name x_m_inoutconfirm resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inoutconfirm append get id append return sb to string tostring stringbuffer stringbuffer x_m_inoutconfirm get_id tostring set approval amount document approval amount public void set approval amt big decimal approval amt set value approval amt approval amt setapprovalamt bigdecimal approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue public static final string confirmtype vendorconfirmation xv set confirmation type type of confirmation public void set confirm type string confirm type if confirm type null throw new illegal argument exception confirm type is mandatory if confirm type equals ds confirm type equals pc confirm type equals sc confirm type equals xc confirm type equals xv else throw new illegal argument exception confirm type invalid value confirm type reference id 320 ds pc sc xc xv if confirm type length 2 log warning length 2 truncated confirm type confirm type substring 0 1 set value confirm type confirm type confirmtype_vendorconfirmation setconfirmtype confirmtype confirmtype illegalargumentexception confirmtype confirmtype confirmtype confirmtype confirmtype confirmtype illegalargumentexception confirmtype confirmtype reference_id confirmtype confirmtype confirmtype set_value confirmtype confirmtype get confirmation type type of confirmation public string get confirm type return string get value confirm type getconfirmtype get_value confirmtype set confirmation no confirmation number public void set confirmation no string confirmation no if confirmation no null confirmation no length 20 log warning length 20 truncated confirmation no confirmation no substring 0 19 set value confirmation no confirmation no setconfirmationno confirmationno confirmationno confirmationno confirmationno confirmationno set_value confirmationno confirmationno get confirmation no confirmation number public string get confirmation no return string get value confirmation no getconfirmationno get_value confirmationno set create package public void set create package string create package if create package null create package length 1 log warning length 1 truncated create package create package substring 0 0 set value create package create package setcreatepackage createpackage createpackage createpackage createpackage createpackage set_value createpackage createpackage get create package public string get create package return string get value create package getcreatepackage get_value createpackage set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set cancelled the transaction was cancelled public void set is cancelled boolean is cancelled set value is cancelled new boolean is cancelled setiscancelled iscancelled set_value iscancelled iscancelled get cancelled the transaction was cancelled public boolean is cancelled object oo get value is cancelled if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscancelled get_value iscancelled booleanvalue set in dispute document is in dispute public void set is in dispute boolean is in dispute set value is in dispute new boolean is in dispute setisindispute isindispute set_value isindispute isindispute get in dispute document is in dispute public boolean is in dispute object oo get value is in dispute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isindispute get_value isindispute booleanvalue set ship receipt confirmation material shipment or receipt confirmation public void setm inoutconfirm id int m inoutconfirm id if m inoutconfirm id 1 throw new illegal argument exception m inoutconfirm id is mandatory set valuenocheck m inoutconfirm id new integer m inoutconfirm id setm_inoutconfirm_id m_inoutconfirm_id m_inoutconfirm_id illegalargumentexception m_inoutconfirm_id set_valuenocheck m_inoutconfirm_id m_inoutconfirm_id get ship receipt confirmation material shipment or receipt confirmation public int getm inoutconfirm id integer ii integer get value m inoutconfirm id if ii null return 0 return ii int value getm_inoutconfirm_id get_value m_inoutconfirm_id intvalue set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 1 throw new illegal argument exception m inout id is mandatory set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id illegalargumentexception m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 0 set value m inventory id null else set value m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id set_value m_inventory_id set_value m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue get contents return contents public object get contents return contents getcontents create ui param c component return componentui public static componentui createui j component c return s radiobuttonui jcomponent s_radiobuttonui install defaults param b button public void install defaults abstract button b super install defaults b b set opaque false installdefaults abstractbutton installdefaults setopaque standard constructor param ctx context param m discountschemaline id id public m discount schema line properties ctx int m discountschemaline id string trx name super ctx m discountschemaline id trx name m_discountschemaline_id mdiscountschemaline m_discountschemaline_id trxname m_discountschemaline_id trxname load constructor param ctx context param rs result set public m discount schema line properties ctx result set rs string trx name super ctx rs trx name mdiscountschemaline resultset trxname trxname compiere monitor filter public compiere monitor filter super m authorization new long system current time millis compieremonitorfilter compieremonitorfilter m_authorization currenttimemillis init param config configuration throws servlet exception public void init filter config config throws servlet exception log info servletexception filterconfig servletexception filter param request request param response response param chain chain throws io exception throws servlet exception public void do filter servlet request request servlet response response filter chain chain throws io exception servlet exception boolean error false string error page error html boolean pass false try if request instanceof http servlet request response instanceof http servlet response request get request dispatcher error page forward request response return http servlet request req http servlet request request http servlet response resp http servlet response response previously checked http session session req get session true long compare long session get attribute authorization if compare null compare compare to m authorization 0 pass true else if check authorization req get header authorization session set attribute authorization m authorization pass true if pass chain do filter request response else resp set status http servlet response sc unauthorized resp set header www authenticate basic realm compiere server return catch exception e log log level severe filter e request get request dispatcher error page forward request response ioexception servletexception dofilter servletrequest servletresponse filterchain ioexception servletexception errorpage httpservletrequest httpservletresponse getrequestdispatcher errorpage httpservletrequest httpservletrequest httpservletresponse httpservletresponse httpsession getsession getattribute compareto m_authorization checkauthorization getheader setattribute m_authorization dofilter setstatus httpservletresponse sc_unauthorized setheader getrequestdispatcher errorpage check authorization param authorization authorization return true if authenticated private boolean check authorization string authorization if authorization null return false try string user info authorization substring 6 trim base64 decoder decoder new base64 decoder string name password new string decoder decode buffer user info log fine check authorization name password name password int index name password index of string name name password substring 0 index string password name password substring index 1 m user user m user get env get ctx name password if user null log warning user not found name password return false if user is administrator log warning not a sys admin name return false log info name name return true catch exception e log log level severe check e return false checkauthorization userinfo base64decoder base64decoder namepassword decodebuffer userinfo checkauthorization namepassword namepassword indexof namepassword namepassword muser muser getctx isadministrator destroy public void destroy log info standard constructor param ctx context param w mailmsg id id param trx name trx public m mail msg properties ctx int w mailmsg id string trx name super ctx w mailmsg id trx name if w mailmsg id 0 setw store id 0 set mail msg type null set name null set subject null set message null w_mailmsg_id trxname mmailmsg w_mailmsg_id trxname w_mailmsg_id trxname w_mailmsg_id setw_store_id setmailmsgtype setname setsubject setmessage load constructor param ctx context param rs result set param trx name trx public m mail msg properties ctx result set rs string trx name super ctx rs trx name trxname mmailmsg resultset trxname trxname full constructor param parent store param mail msg type msg type param name name param subject subject param message message public m mail msg m store parent string mail msg type string name string subject string message string message2 string message3 this parent get ctx 0 parent get trxname set client org parent setw store id parent getw store id set mail msg type mail msg type set name name set subject subject set message message set message2 message2 set message3 message3 mailmsgtype mmailmsg mstore mailmsgtype getctx get_trxname setclientorg setw_store_id getw_store_id setmailmsgtype mailmsgtype setname setsubject setmessage setmessage2 setmessage3 get m bank from cache param ctx context param c bank id id return m bank public static m bank get properties ctx int c bank id integer key new integer c bank id m bank ret value m bank s cache get key if ret value null return ret value ret value new m bank ctx c bank id null if ret value get id 0 s cache put key ret value return ret value mbank c_bank_id mbank mbank c_bank_id c_bank_id mbank retvalue mbank s_cache retvalue retvalue retvalue mbank c_bank_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c bank id bank param trx name trx public m bank properties ctx int c bank id string trx name super ctx c bank id trx name c_bank_id trxname mbank c_bank_id trxname c_bank_id trxname load constructor param ctx context param rs result set param trx name trx public m bank properties ctx result set rs string trx name super ctx rs trx name trxname mbank resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m bank sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mbank get_id getname tostring standard constructor public x i product properties ctx int i product id string trx name super ctx i product id trx name if i product id 0 seti isimported false seti product id 0 x_i_product i_product_id trxname i_product_id trxname i_product_id seti_isimported seti_product_id load constructor public x i product properties ctx result set rs string trx name super ctx rs trx name x_i_product resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i product append get id append return sb to string tostring stringbuffer stringbuffer x_i_product get_id tostring set business partner key the key of the business partner public void setbpartner value string bpartner value if bpartner value null bpartner value length 40 log warning length 40 truncated bpartner value bpartner value substring 0 39 set value bpartner value bpartner value setbpartner_value bpartner_value bpartner_value bpartner_value bpartner_value bpartner_value set_value bpartner_value bpartner_value get business partner key the key of the business partner public string getbpartner value return string get value bpartner value getbpartner_value get_value bpartner_value set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set classification classification for grouping public void set classification string classification if classification null classification length 1 log warning length 1 truncated classification classification substring 0 0 set value classification classification setclassification set_value get classification classification for grouping public string get classification return string get value classification getclassification get_value set cost per order fixed cost per order public void set cost per order big decimal cost per order set value cost per order cost per order setcostperorder bigdecimal costperorder set_value costperorder costperorder get cost per order fixed cost per order public big decimal get cost per order big decimal bd big decimal get value cost per order if bd null return env zero return bd bigdecimal getcostperorder bigdecimal bigdecimal get_value costperorder set promised delivery time promised days between order and delivery public void setdeliverytime promised int deliverytime promised set value deliverytime promised new integer deliverytime promised setdeliverytime_promised deliverytime_promised set_value deliverytime_promised deliverytime_promised get promised delivery time promised days between order and delivery public int getdeliverytime promised integer ii integer get value deliverytime promised if ii null return 0 return ii int value getdeliverytime_promised get_value deliverytime_promised intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set description url url for the description public void set descriptionurl string descriptionurl if descriptionurl null descriptionurl length 120 log warning length 120 truncated descriptionurl descriptionurl substring 0 119 set value descriptionurl descriptionurl setdescriptionurl set_value get description url url for the description public string get descriptionurl return string get value descriptionurl getdescriptionurl get_value set discontinued this product is no longer available public void set discontinued boolean discontinued set value discontinued new boolean discontinued setdiscontinued set_value get discontinued this product is no longer available public boolean is discontinued object oo get value discontinued if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscontinued get_value booleanvalue set discontinued by discontinued by public void set discontinued by timestamp discontinued by set value discontinued by discontinued by setdiscontinuedby discontinuedby set_value discontinuedby discontinuedby get discontinued by discontinued by public timestamp get discontinued by return timestamp get value discontinued by getdiscontinuedby get_value discontinuedby set document note additional information for a document public void set document note string document note if document note null document note length 2000 log warning length 2000 truncated document note document note substring 0 1999 set value document note document note setdocumentnote documentnote documentnote documentnote documentnote documentnote set_value documentnote documentnote get document note additional information for a document public string get document note return string get value document note getdocumentnote get_value documentnote set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set iso currency code three letter iso 4217 code of the currency public void setiso code string iso code if iso code null iso code length 3 log warning length 3 truncated iso code iso code substring 0 2 set value iso code iso code setiso_code iso_code iso_code iso_code iso_code iso_code set_value iso_code iso_code get iso currency code three letter iso 4217 code of the currency public string getiso code return string get value iso code getiso_code get_value iso_code set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set import product import item or service public void seti product id int i product id if i product id 1 throw new illegal argument exception i product id is mandatory set valuenocheck i product id new integer i product id seti_product_id i_product_id i_product_id illegalargumentexception i_product_id set_valuenocheck i_product_id i_product_id get import product import item or service public int geti product id integer ii integer get value i product id if ii null return 0 return ii int value geti_product_id get_value i_product_id intvalue set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set manufacturer manufacturer of the product public void set manufacturer string manufacturer if manufacturer null manufacturer length 30 log warning length 30 truncated manufacturer manufacturer substring 0 29 set value manufacturer manufacturer setmanufacturer set_value get manufacturer manufacturer of the product public string get manufacturer return string get value manufacturer getmanufacturer get_value set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set minimum order qty minimum order quantity in uom public void setorder min int order min set value order min new integer order min setorder_min order_min set_value order_min order_min get minimum order qty minimum order quantity in uom public int getorder min integer ii integer get value order min if ii null return 0 return ii int value getorder_min get_value order_min intvalue set order pack qty package order size in uom e g order set of 5 units public void setorder pack int order pack set value order pack new integer order pack setorder_pack order_pack set_value order_pack order_pack get order pack qty package order size in uom e g order set of 5 units public int getorder pack integer ii integer get value order pack if ii null return 0 return ii int value getorder_pack get_value order_pack intvalue set price effective effective date of price public void set price effective timestamp price effective set value price effective price effective setpriceeffective priceeffective set_value priceeffective priceeffective get price effective effective date of price public timestamp get price effective return timestamp get value price effective getpriceeffective get_value priceeffective set limit price lowest price for a product public void set price limit big decimal price limit set value price limit price limit setpricelimit bigdecimal pricelimit set_value pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set list price list price public void set price list big decimal price list set value price list price list setpricelist bigdecimal pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set po price price based on a purchase order public void set pricepo big decimal pricepo set value pricepo pricepo setpricepo bigdecimal set_value get po price price based on a purchase order public big decimal get pricepo big decimal bd big decimal get value pricepo if bd null return env zero return bd bigdecimal getpricepo bigdecimal bigdecimal get_value set standard price standard price public void set price std big decimal price std set value price std price std setpricestd bigdecimal pricestd set_value pricestd pricestd get standard price standard price public big decimal get price std big decimal bd big decimal get value price std if bd null return env zero return bd bigdecimal getpricestd bigdecimal bigdecimal get_value pricestd set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set product category key public void setproductcategory value string productcategory value if productcategory value null productcategory value length 40 log warning length 40 truncated productcategory value productcategory value substring 0 39 set value productcategory value productcategory value setproductcategory_value productcategory_value productcategory_value productcategory_value productcategory_value productcategory_value set_value productcategory_value productcategory_value get product category key public string getproductcategory value return string get value productcategory value getproductcategory_value get_value productcategory_value public static final string producttype service s set product type type of product public void set product type string product type if product type null throw new illegal argument exception product type is mandatory if product type null product type equals e product type equals i product type equals o product type equals r product type equals s else throw new illegal argument exception product type invalid value product type reference id 270 e i o r s if product type null product type length 1 log warning length 1 truncated product type product type substring 0 0 set value product type product type producttype_service setproducttype producttype producttype illegalargumentexception producttype producttype producttype producttype producttype producttype producttype illegalargumentexception producttype producttype reference_id producttype producttype producttype producttype set_value producttype producttype get product type type of product public string get product type return string get value product type getproducttype get_value producttype set royalty amount included amount for copyright etc public void set royalty amt big decimal royalty amt set value royalty amt royalty amt setroyaltyamt bigdecimal royaltyamt set_value royaltyamt royaltyamt get royalty amount included amount for copyright etc public big decimal get royalty amt big decimal bd big decimal get value royalty amt if bd null return env zero return bd bigdecimal getroyaltyamt bigdecimal bigdecimal get_value royaltyamt set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set value sku sku set_value get sku stock keeping unit public string getsku return string get value sku get_value set shelf depth shelf depth required public void set shelf depth int shelf depth set value shelf depth new integer shelf depth setshelfdepth shelfdepth set_value shelfdepth shelfdepth get shelf depth shelf depth required public int get shelf depth integer ii integer get value shelf depth if ii null return 0 return ii int value getshelfdepth get_value shelfdepth intvalue set shelf height shelf height required public void set shelf height int shelf height set value shelf height new integer shelf height setshelfheight shelfheight set_value shelfheight shelfheight get shelf height shelf height required public int get shelf height integer ii integer get value shelf height if ii null return 0 return ii int value getshelfheight get_value shelfheight intvalue set shelf width shelf width required public void set shelf width int shelf width set value shelf width new integer shelf width setshelfwidth shelfwidth set_value shelfwidth shelfwidth get shelf width shelf width required public int get shelf width integer ii integer get value shelf width if ii null return 0 return ii int value getshelfwidth get_value shelfwidth intvalue set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set units per pallet units per pallet public void set units per pallet int units per pallet set value units per pallet new integer units per pallet setunitsperpallet unitsperpallet set_value unitsperpallet unitsperpallet get units per pallet units per pallet public int get units per pallet integer ii integer get value units per pallet if ii null return 0 return ii int value getunitsperpallet get_value unitsperpallet intvalue set search key search key for the record in the format required must be unique public void set value string value if value null value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue set partner category product category of the business partner public void set vendor category string vendor category if vendor category null vendor category length 30 log warning length 30 truncated vendor category vendor category substring 0 29 set value vendor category vendor category setvendorcategory vendorcategory vendorcategory vendorcategory vendorcategory vendorcategory set_value vendorcategory vendorcategory get partner category product category of the business partner public string get vendor category return string get value vendor category getvendorcategory get_value vendorcategory set partner product key product key of the business partner public void set vendor product no string vendor product no if vendor product no null vendor product no length 30 log warning length 30 truncated vendor product no vendor product no substring 0 29 set value vendor product no vendor product no setvendorproductno vendorproductno vendorproductno vendorproductno vendorproductno vendorproductno set_value vendorproductno vendorproductno get partner product key product key of the business partner public string get vendor product no return string get value vendor product no getvendorproductno get_value vendorproductno set volume volume of a product public void set volume int volume set value volume new integer volume setvolume set_value get volume volume of a product public int get volume integer ii integer get value volume if ii null return 0 return ii int value getvolume get_value intvalue set weight weight of a product public void set weight int weight set value weight new integer weight setweight set_value get weight weight of a product public int get weight integer ii integer get value weight if ii null return 0 return ii int value getweight get_value intvalue set uom code uom edi x12 code public void setx12de355 string x12de355 if x12de355 null x12de355 length 2 log warning length 2 truncated x12de355 x12de355 substring 0 1 set value x12de355 x12de355 set_value get uom code uom edi x12 code public string getx12de355 return string get value x12de355 get_value standard constructor public x ad alert properties ctx int ad alert id string trx name super ctx ad alert id trx name if ad alert id 0 setad alertprocessor id 0 setad alert id 0 set alert message null set alert subject null set enforce client security true y set enforce role security true y set is valid true y set name null x_ad_alert ad_alert_id trxname ad_alert_id trxname ad_alert_id setad_alertprocessor_id setad_alert_id setalertmessage setalertsubject setenforceclientsecurity setenforcerolesecurity setisvalid setname load constructor public x ad alert properties ctx result set rs string trx name super ctx rs trx name x_ad_alert resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad alert append get id append return sb to string tostring stringbuffer stringbuffer x_ad_alert get_id tostring set alert processor alert processor server parameter public void setad alertprocessor id int ad alertprocessor id if ad alertprocessor id 1 throw new illegal argument exception ad alertprocessor id is mandatory set value ad alertprocessor id new integer ad alertprocessor id setad_alertprocessor_id ad_alertprocessor_id ad_alertprocessor_id illegalargumentexception ad_alertprocessor_id set_value ad_alertprocessor_id ad_alertprocessor_id get alert processor alert processor server parameter public int getad alertprocessor id integer ii integer get value ad alertprocessor id if ii null return 0 return ii int value getad_alertprocessor_id get_value ad_alertprocessor_id intvalue set alert compiere alert public void setad alert id int ad alert id if ad alert id 1 throw new illegal argument exception ad alert id is mandatory set valuenocheck ad alert id new integer ad alert id setad_alert_id ad_alert_id ad_alert_id illegalargumentexception ad_alert_id set_valuenocheck ad_alert_id ad_alert_id get alert compiere alert public int getad alert id integer ii integer get value ad alert id if ii null return 0 return ii int value getad_alert_id get_value ad_alert_id intvalue set alert message message of the alert public void set alert message string alert message if alert message null throw new illegal argument exception alert message is mandatory if alert message length 2000 log warning length 2000 truncated alert message alert message substring 0 1999 set value alert message alert message setalertmessage alertmessage alertmessage illegalargumentexception alertmessage alertmessage alertmessage alertmessage set_value alertmessage alertmessage get alert message message of the alert public string get alert message return string get value alert message getalertmessage get_value alertmessage set alert subject subject of the alert public void set alert subject string alert subject if alert subject null throw new illegal argument exception alert subject is mandatory if alert subject length 60 log warning length 60 truncated alert subject alert subject substring 0 59 set value alert subject alert subject setalertsubject alertsubject alertsubject illegalargumentexception alertsubject alertsubject alertsubject alertsubject set_value alertsubject alertsubject get alert subject subject of the alert public string get alert subject return string get value alert subject getalertsubject get_value alertsubject set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set enforce client security send alerts to recipient only if the client security rules of the role allows public void set enforce client security boolean enforce client security set value enforce client security new boolean enforce client security setenforceclientsecurity enforceclientsecurity set_value enforceclientsecurity enforceclientsecurity get enforce client security send alerts to recipient only if the client security rules of the role allows public boolean is enforce client security object oo get value enforce client security if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isenforceclientsecurity get_value enforceclientsecurity booleanvalue set enforce role security send alerts to recipient only if the data security rules of the role allows public void set enforce role security boolean enforce role security set value enforce role security new boolean enforce role security setenforcerolesecurity enforcerolesecurity set_value enforcerolesecurity enforcerolesecurity get enforce role security send alerts to recipient only if the data security rules of the role allows public boolean is enforce role security object oo get value enforce role security if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isenforcerolesecurity get_value enforcerolesecurity booleanvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard costructor param ctx context param ad wf nodenext id id public mwf node next properties ctx int ad wf nodenext id string trx name super ctx ad wf nodenext id trx name if ad wf nodenext id 0 setad wf next id 0 setad wf node id 0 set entity type entitytype usermaintained u set is std user workflow false set seq no 10 10 ad_wf_nodenext_id mwfnodenext ad_wf_nodenext_id trxname ad_wf_nodenext_id trxname ad_wf_nodenext_id setad_wf_next_id setad_wf_node_id setentitytype entitytype_usermaintained setisstduserworkflow setseqno default constructor param ctx context param rs result set to load info from public mwf node next properties ctx result set rs string trx name super ctx rs trx name mwfnodenext resultset trxname trxname parent constructor param parent patent param ad wf next id next public mwf node next mwf node parent int ad wf next id this parent get ctx 0 parent get trxname set client org parent setad wf node id parent getad wf node id setad wf next id ad wf next id ad_wf_next_id mwfnodenext mwfnode ad_wf_next_id getctx get_trxname setclientorg setad_wf_node_id getad_wf_node_id setad_wf_next_id ad_wf_next_id set client org param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id string representation return info public string to string string buffer sb new string buffer mwf node next sb append get seq no append node append getad wf node id append next append getad wf next id if m conditions null sb append append m conditions length if get description null get description length 0 sb append append get description sb append return sb to string tostring stringbuffer stringbuffer mwfnodenext getseqno getad_wf_node_id getad_wf_next_id m_conditions m_conditions getdescription getdescription getdescription tostring get conditions param requery true if requery return array of conditions public mwf next condition get conditions boolean requery if requery m conditions null return m conditions array list mwf next condition list new array list mwf next condition string sql select from ad wf nextcondition where ad wf nodenext id and is active y order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad wf nodenext id result set rs pstmt execute query while rs next list add new mwf next condition get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m conditions new mwf next condition list size list to array m conditions return m conditions mwfnextcondition getconditions m_conditions m_conditions arraylist mwfnextcondition arraylist mwfnextcondition ad_wf_nextcondition ad_wf_nodenext_id isactive seqno preparedstatement preparestatement get_trxname setint getad_wf_nodenext_id resultset executequery mwfnextcondition getctx get_trxname m_conditions mwfnextcondition toarray m_conditions m_conditions unconditional return true if no conditions public boolean is unconditional return is std user workflow get conditions false length 0 isunconditional isstduserworkflow getconditions is this a valid transition for return true if valid public boolean is valid for mwf activity activity if is std user workflow po po activity getpo if po instanceof doc action doc action da doc action po string doc status da get doc status string doc action da get doc action if doc action action complete equals doc action doc action status completed equals doc status doc action status waitingconfirmation equals doc status doc action status waitingpayment equals doc status doc action status voided equals doc status doc action status closed equals doc status doc action status reversed equals doc status doc action action complete equals doc action doc action action reactivate equals doc action doc action action none equals doc action doc action action post equals doc action doc action action unlock equals doc action doc action action invalidate equals doc action log fine is valid for no std userwf status doc status action doc action return false no conditions if get conditions false length 0 log fine is valid for 0 to string return true boolean ok true for int i 0 i m conditions length i first condition always and if i 0 m conditions i is or m conditions i set and or mwf next condition andor and we have an or condition if m conditions i is or i 0 with existing true condition if ok log fine is valid for i true to string return true ok true reset ok m conditions i evaluate activity for all conditions log fine is valid for ok to string return ok isvalidfor mwfactivity isstduserworkflow docaction docaction docaction docstatus getdocstatus docaction getdocaction docaction action_complete docaction docaction status_completed docstatus docaction status_waitingconfirmation docstatus docaction status_waitingpayment docstatus docaction status_voided docstatus docaction status_closed docstatus docaction status_reversed docstatus docaction action_complete docaction docaction action_reactivate docaction docaction action_none docaction docaction action_post docaction docaction action_unlock docaction docaction action_invalidate docaction isvalidfor stduserwf docstatus docaction getconditions isvalidfor tostring m_conditions m_conditions isor m_conditions setandor mwfnextcondition andor_and m_conditions isor isvalidfor tostring m_conditions isvalidfor tostring split element is and return returns the from split and public boolean is from split and if m fromsplitand null return m fromsplitand boolean value return false isfromsplitand m_fromsplitand m_fromsplitand booleanvalue split element is and set by mwf node load nodes param from split and the from split and public void set from split and boolean from split and m fromsplitand new boolean from split and mwfnode loadnodes fromsplitand setfromsplitand fromsplitand m_fromsplitand fromsplitand join element is and return returns the to join and public boolean is to join and if m tojoinand null getad wf next id 0 mwf node next mwf node get get ctx getad wf next id set to join and mwf node joinelement and equals next get join element if m tojoinand null return m tojoinand boolean value return false istojoinand m_tojoinand getad_wf_next_id mwfnode mwfnode getctx getad_wf_next_id settojoinand mwfnode joinelement_and getjoinelement m_tojoinand m_tojoinand booleanvalue join element is and param to join and the to join and to set private void set to join and boolean to join and m tojoinand new boolean to join and tojoinand settojoinand tojoinand m_tojoinand tojoinand standard constructor public x c acctschema gl properties ctx int c acctschema gl id string trx name super ctx c acctschema gl id trx name if c acctschema gl id 0 setc acctschema id 0 setcommitmentoffset acct 0 setincomesummary acct 0 setintercompanyduefrom acct 0 setintercompanydueto acct 0 setppvoffset acct 0 setretainedearning acct 0 set use currency balancing false set use suspense balancing false set use suspense error false x_c_acctschema_gl c_acctschema_gl_id trxname c_acctschema_gl_id trxname c_acctschema_gl_id setc_acctschema_id setcommitmentoffset_acct setincomesummary_acct setintercompanyduefrom_acct setintercompanydueto_acct setppvoffset_acct setretainedearning_acct setusecurrencybalancing setusesuspensebalancing setusesuspenseerror load constructor public x c acctschema gl properties ctx result set rs string trx name super ctx rs trx name x_c_acctschema_gl resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctschema gl append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctschema_gl get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc acctschema id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_acctschema_id set commitment offset budgetary commitment offset account public void setcommitmentoffset acct int commitmentoffset acct set value commitmentoffset acct new integer commitmentoffset acct setcommitmentoffset_acct commitmentoffset_acct set_value commitmentoffset_acct commitmentoffset_acct get commitment offset budgetary commitment offset account public int getcommitmentoffset acct integer ii integer get value commitmentoffset acct if ii null return 0 return ii int value getcommitmentoffset_acct get_value commitmentoffset_acct intvalue set currency balancing acct account used when a currency is out of balance public void setcurrencybalancing acct int currencybalancing acct set value currencybalancing acct new integer currencybalancing acct setcurrencybalancing_acct currencybalancing_acct set_value currencybalancing_acct currencybalancing_acct get currency balancing acct account used when a currency is out of balance public int getcurrencybalancing acct integer ii integer get value currencybalancing acct if ii null return 0 return ii int value getcurrencybalancing_acct get_value currencybalancing_acct intvalue set income summary acct income summary account public void setincomesummary acct int incomesummary acct set value incomesummary acct new integer incomesummary acct setincomesummary_acct incomesummary_acct set_value incomesummary_acct incomesummary_acct get income summary acct income summary account public int getincomesummary acct integer ii integer get value incomesummary acct if ii null return 0 return ii int value getincomesummary_acct get_value incomesummary_acct intvalue set intercompany due from acct intercompany due from receivables account public void setintercompanyduefrom acct int intercompanyduefrom acct set value intercompanyduefrom acct new integer intercompanyduefrom acct setintercompanyduefrom_acct intercompanyduefrom_acct set_value intercompanyduefrom_acct intercompanyduefrom_acct get intercompany due from acct intercompany due from receivables account public int getintercompanyduefrom acct integer ii integer get value intercompanyduefrom acct if ii null return 0 return ii int value getintercompanyduefrom_acct get_value intercompanyduefrom_acct intvalue set intercompany due to acct intercompany due to payable account public void setintercompanydueto acct int intercompanydueto acct set value intercompanydueto acct new integer intercompanydueto acct setintercompanydueto_acct intercompanydueto_acct set_value intercompanydueto_acct intercompanydueto_acct get intercompany due to acct intercompany due to payable account public int getintercompanydueto acct integer ii integer get value intercompanydueto acct if ii null return 0 return ii int value getintercompanydueto_acct get_value intercompanydueto_acct intvalue set ppv offset purchase price variance offset account public void setppvoffset acct int ppvoffset acct set value ppvoffset acct new integer ppvoffset acct setppvoffset_acct ppvoffset_acct set_value ppvoffset_acct ppvoffset_acct get ppv offset purchase price variance offset account public int getppvoffset acct integer ii integer get value ppvoffset acct if ii null return 0 return ii int value getppvoffset_acct get_value ppvoffset_acct intvalue set retained earning acct public void setretainedearning acct int retainedearning acct set value retainedearning acct new integer retainedearning acct setretainedearning_acct retainedearning_acct set_value retainedearning_acct retainedearning_acct get retained earning acct public int getretainedearning acct integer ii integer get value retainedearning acct if ii null return 0 return ii int value getretainedearning_acct get_value retainedearning_acct intvalue set suspense balancing acct public void setsuspensebalancing acct int suspensebalancing acct set value suspensebalancing acct new integer suspensebalancing acct setsuspensebalancing_acct suspensebalancing_acct set_value suspensebalancing_acct suspensebalancing_acct get suspense balancing acct public int getsuspensebalancing acct integer ii integer get value suspensebalancing acct if ii null return 0 return ii int value getsuspensebalancing_acct get_value suspensebalancing_acct intvalue set suspense error acct public void setsuspenseerror acct int suspenseerror acct set value suspenseerror acct new integer suspenseerror acct setsuspenseerror_acct suspenseerror_acct set_value suspenseerror_acct suspenseerror_acct get suspense error acct public int getsuspenseerror acct integer ii integer get value suspenseerror acct if ii null return 0 return ii int value getsuspenseerror_acct get_value suspenseerror_acct intvalue set use currency balancing public void set use currency balancing boolean use currency balancing set value use currency balancing new boolean use currency balancing setusecurrencybalancing usecurrencybalancing set_value usecurrencybalancing usecurrencybalancing get use currency balancing public boolean is use currency balancing object oo get value use currency balancing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isusecurrencybalancing get_value usecurrencybalancing booleanvalue set use suspense balancing public void set use suspense balancing boolean use suspense balancing set value use suspense balancing new boolean use suspense balancing setusesuspensebalancing usesuspensebalancing set_value usesuspensebalancing usesuspensebalancing get use suspense balancing public boolean is use suspense balancing object oo get value use suspense balancing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isusesuspensebalancing get_value usesuspensebalancing booleanvalue set use suspense error public void set use suspense error boolean use suspense error set value use suspense error new boolean use suspense error setusesuspenseerror usesuspenseerror set_value usesuspenseerror usesuspenseerror get use suspense error public boolean is use suspense error object oo get value use suspense error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isusesuspenseerror get_value usesuspenseerror booleanvalue standard constructor public x m substitute properties ctx int m substitute id string trx name super ctx m substitute id trx name if m substitute id 0 setm product id 0 set name null setsubstitute id 0 x_m_substitute m_substitute_id trxname m_substitute_id trxname m_substitute_id setm_product_id setname setsubstitute_id load constructor public x m substitute properties ctx result set rs string trx name super ctx rs trx name x_m_substitute resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m substitute append get id append return sb to string tostring stringbuffer stringbuffer x_m_substitute get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int substitute id ad reference id 162 set substitute entity which can be used in place of this entity public void setsubstitute id int substitute id if substitute id 1 throw new illegal argument exception substitute id is mandatory set valuenocheck substitute id new integer substitute id substitute_id_ad_reference_id setsubstitute_id substitute_id substitute_id illegalargumentexception substitute_id set_valuenocheck substitute_id substitute_id get substitute entity which can be used in place of this entity public int getsubstitute id integer ii integer get value substitute id if ii null return 0 return ii int value getsubstitute_id get_value substitute_id intvalue get m calendar from cache param ctx context param c calendar id id return m calendar public static m calendar get properties ctx int c calendar id integer key new integer c calendar id m calendar ret value m calendar s cache get key if ret value null return ret value ret value new m calendar ctx c calendar id null if ret value get id 0 s cache put key ret value return ret value mcalendar c_calendar_id mcalendar mcalendar c_calendar_id c_calendar_id mcalendar retvalue mcalendar s_cache retvalue retvalue retvalue mcalendar c_calendar_id retvalue get_id s_cache retvalue retvalue get default calendar for client param ctx context param ad client id id return m calendar public static m calendar get default properties ctx int ad client id m client info info m client info get ctx ad client id return get ctx info getc calendar id ad_client_id mcalendar mcalendar getdefault ad_client_id mclientinfo mclientinfo ad_client_id getc_calendar_id get default calendar for client param ctx context return m calendar public static m calendar get default properties ctx return get default ctx env getad client id ctx mcalendar mcalendar getdefault getdefault getad_client_id standard constructor param ctx context param c calendar id id public m calendar properties ctx int c calendar id string trx name super ctx c calendar id trx name c_calendar_id mcalendar c_calendar_id trxname c_calendar_id trxname load constructor param ctx context param rs result set public m calendar properties ctx result set rs string trx name super ctx rs trx name mcalendar resultset trxname trxname parent constructor param client parent public m calendar m client client super client get ctx 0 client get trxname set client org client set name client get name msg translate client get ctx c calendar id mcalendar mclient getctx get_trxname setclientorg setname getname getctx c_calendar_id create current calendar year param locale locale return the year public m year create year locale locale if get id 0 return null m year year new m year this if year save year create std periods locale return year myear createyear get_id myear myear createstdperiods initialize global variables param config servlet config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception counter init servletexception servletconfig servletexception webenv initweb servletexception get servlet information return info public string get servlet info return a dempiere web counter getservletinfo adempiere clean up resources public void destroy log info process the http get request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception m requests add request new thread this start servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception m_requests process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception doget async process public void run long time system current time millis get request http servlet request request null if m requests size 0 request http servlet request m requests remove 0 if request null log log level severe nothing in queue return properties ctx jsp env get ctx request string ref request get header referer if ref null ref length 0 ref request get requesturl to string log info referer request get header referer url request get requesturl currenttimemillis httpservletrequest m_requests httpservletrequest m_requests jspenv getctx getheader getrequesturl tostring getheader getrequesturl constructor param ass accounting schemata param rs record parem trx name trx protected doc matchpo m acct schema ass result set rs string trx name super ass m matchpo class rs doctype matmatchpo trx name trxname doc_matchpo macctschema resultset trxname mmatchpo doctype_matmatchpo trxname load specific document details return error message or null protected string load document details setc currency id doc no currency m matchpo matchpo m matchpo getpo set date doc matchpo get date trx m m attributesetinstance id matchpo getm attributesetinstance id set qty matchpo get qty m c orderline id matchpo getc orderline id m oline new m order line get ctx m c orderline id get trx name m m inoutline id matchpo getm inoutline id m c invoiceline id matchpo getc invoiceline id m pc new product cost env get ctx getm product id m m attributesetinstance id get trx name m pc set qty get qty return null loaddocumentdetails setc_currency_id no_currency mmatchpo mmatchpo setdatedoc getdatetrx m_m_attributesetinstance_id getm_attributesetinstance_id setqty getqty m_c_orderline_id getc_orderline_id m_oline morderline getctx m_c_orderline_id gettrxname m_m_inoutline_id getm_inoutline_id m_c_invoiceline_id getc_invoiceline_id m_pc productcost getctx getm_product_id m_m_attributesetinstance_id gettrxname m_pc setqty getqty get source currency balance subtracts line and tax amounts from total no rounding return zero always balanced public big decimal get balance return env zero bigdecimal getbalance create facts the accounting logic for mxp pre product ppv difference ppv offset difference pre param as accounting schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact if getm product id 0 nothing to do if no product get qty signum 0 m m inoutline id 0 no posting if not matched to shipment log fine no product qty m product id getm product id qty get qty return facts create fact header fact fact new fact this as fact post actual setc currency id as getc currency id purchase order line big decimal po cost m oline get price cost if po cost null po cost signum 0 po cost m oline get price actual po cost po cost multiply get qty delivered so far different currency if m oline getc currency id as getc currency id m order order m oline get parent big decimal rate m conversion rate get rate order getc currency id as getc currency id order get date acct order getc conversiontype id m oline getad client id m oline getad org id if rate null p error purchase order not convertible as get name return null po cost po cost multiply rate if po cost scale as get costing precision po cost po cost set scale as get costing precision big decimal round half up create po cost detail record firs m cost detail create order as m oline getad org id getm product id m m attributesetinstance id m c orderline id 0 no cost element po cost get qty delivered m oline get description get trx name current costs string costing method as get costing method m product product m product get get ctx getm product id m product category acct pca m product category acct get get ctx product getm product category id as getc acctschema id get trx name if pca get costing method null costing method pca get costing method big decimal costs m pc get product costs as getad org id costing method m c orderline id false non zero costs no costs yet no ppv if costs null costs signum 0 p error resubmit no costs for product get name log log level severe p error return null difference big decimal difference po cost subtract costs nothing to post if difference signum 0 log log level fine no cost difference for m product id getm product id facts add fact return facts product ppv fact line cr fact create line null m pc get account product cost accttype p ppv as as getc currency id difference if cr null cr set qty get qty cr setc bpartner id m oline getc bpartner id cr setc activity id m oline getc activity id cr setc campaign id m oline getc campaign id cr setc project id m oline getc project id cr setc uom id m oline getc uom id cr setuser1 id m oline getuser1 id cr setuser2 id m oline getuser2 id ppv offset fact line dr fact create line null get account doc accttype ppvoffset as as getc currency id difference negate if dr null dr set qty get qty negate dr setc bpartner id m oline getc bpartner id dr setc activity id m oline getc activity id dr setc campaign id m oline getc campaign id dr setc project id m oline getc project id dr setc uom id m oline getc uom id dr setuser1 id m oline getuser1 id dr setuser2 id m oline getuser2 id facts add fact return facts ppv_offset arraylist createfacts macctschema arraylist arraylist getm_product_id getqty m_m_inoutline_id m_product_id getm_product_id getqty post_actual setc_currency_id getc_currency_id bigdecimal pocost m_oline getpricecost pocost pocost pocost m_oline getpriceactual pocost pocost getqty m_oline getc_currency_id getc_currency_id morder m_oline getparent bigdecimal mconversionrate getrate getc_currency_id getc_currency_id getdateacct getc_conversiontype_id m_oline getad_client_id m_oline getad_org_id p_error getname pocost pocost pocost getcostingprecision pocost pocost setscale getcostingprecision bigdecimal round_half_up mcostdetail createorder m_oline getad_org_id getm_product_id m_m_attributesetinstance_id m_c_orderline_id pocost getqty m_oline getdescription gettrxname costingmethod getcostingmethod mproduct mproduct getctx getm_product_id mproductcategoryacct mproductcategoryacct getctx getm_product_category_id getc_acctschema_id gettrxname getcostingmethod costingmethod getcostingmethod bigdecimal m_pc getproductcosts getad_org_id costingmethod m_c_orderline_id p_error getname p_error bigdecimal pocost m_product_id getm_product_id factline createline m_pc getaccount productcost accttype_p_ppv getc_currency_id setqty getqty setc_bpartner_id m_oline getc_bpartner_id setc_activity_id m_oline getc_activity_id setc_campaign_id m_oline getc_campaign_id setc_project_id m_oline getc_project_id setc_uom_id m_oline getc_uom_id setuser1_id m_oline getuser1_id setuser2_id m_oline getuser2_id factline createline getaccount accttype_ppvoffset getc_currency_id setqty getqty setc_bpartner_id m_oline getc_bpartner_id setc_activity_id m_oline getc_activity_id setc_campaign_id m_oline getc_campaign_id setc_project_id m_oline getc_project_id setc_uom_id m_oline getc_uom_id setuser1_id m_oline getuser1_id setuser2_id m_oline getuser2_id update product info old costing cost standardpo qty cost standardpo amt param c acctschema id accounting schema deprecated old costing private void update product info int c acctschema id log fine m matchpo id get id update product costing requires existence of currency conversion string buffer sql new string buffer update m product costing pc set cost standardpo qty cost standardpo amt select cost standardpo qty m qty cost standardpo amt currency convert ol price actual ol c currency id a c currency id ol date ordered null ol ad client id ol ad org id m qty from m matchpo m c orderline ol c acctschema a where m c orderline id ol c orderline id and pc m product id ol m product id and pc c acctschema id a c acctschema id and m m matchpo id append get id append append where pc c acctschema id append c acctschema id append and pc m product id append getm product id int no db execute update sql to string get trx name log fine m product costing updated no coststandardpoqty coststandardpoamt c_acctschema_id updateproductinfo c_acctschema_id m_matchpo_id get_id stringbuffer stringbuffer m_product_costing coststandardpoqty coststandardpoamt coststandardpoqty coststandardpoamt currencyconvert priceactual c_currency_id c_currency_id dateordered ad_client_id ad_org_id m_matchpo c_orderline c_acctschema c_orderline_id c_orderline_id m_product_id m_product_id c_acctschema_id c_acctschema_id m_matchpo_id get_id c_acctschema_id c_acctschema_id m_product_id getm_product_id executeupdate tostring gettrxname m_product_costing get contsnts return contents public object get contents return contents getcontents get request status cached param ctx context param r status id id return request status or null public static m status get properties ctx int r status id if r status id 0 return null integer key new integer r status id m status ret value m status s cache get key if ret value null ret value new m status ctx r status id null s cache put key ret value return ret value r_status_id mstatus r_status_id r_status_id r_status_id mstatus retvalue mstatus s_cache retvalue retvalue mstatus r_status_id s_cache retvalue retvalue get default request status param ctx context param r requesttype id request type return request type public static m status get default properties ctx int r requesttype id integer key new integer r requesttype id m status ret value m status s cachedefault get key if ret value null return ret value get new string sql select from r status s where exists select from r requesttype rt where rt r statuscategory id s r statuscategory id and rt r requesttype id and is default y order by seq no prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 r requesttype id result set rs pstmt execute query if rs next ret value new m status ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if ret value null s cachedefault put key ret value return ret value r_requesttype_id mstatus getdefault r_requesttype_id r_requesttype_id mstatus retvalue mstatus s_cachedefault retvalue retvalue r_status r_requesttype r_statuscategory_id r_statuscategory_id r_requesttype_id isdefault seqno preparedstatement preparestatement setint r_requesttype_id resultset executequery retvalue mstatus sqlexception s_log sqlexception retvalue s_cachedefault retvalue retvalue get closed status param ctx context return request type public static m status get closed properties ctx int ad client id env getad client id ctx string sql select from r status where ad client id and is active y and is closed y order by value array list m status list new array list m status prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query if rs next list add new m status ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m status ret value new m status list size list to array ret value return ret value mstatus getclosed ad_client_id getad_client_id r_status ad_client_id isactive isclosed arraylist mstatus arraylist mstatus preparedstatement preparestatement setint ad_client_id resultset executequery mstatus sqlexception s_log sqlexception mstatus retvalue mstatus toarray retvalue retvalue default constructor param ctx context param r status id is param trx name trx public m status properties ctx int r status id string trx name super ctx r status id trx name if r status id 0 set value null set name null set is closed false n set is default false set is final close false n set is open false set is web can update true r_status_id trxname mstatus r_status_id trxname r_status_id trxname r_status_id setvalue setname setisclosed setisdefault setisfinalclose setisopen setiswebcanupdate load constructor param ctx context param rs result set param trx name trx public m status properties ctx result set rs string trx name super ctx rs trx name trxname mstatus resultset trxname trxname before save param new record new return true protected boolean before save boolean new record if is open is closed set is closed false if is final close is closed set is final close false if is web can update getupdate status id 0 setupdate status id 0 if get timeout days 0 getnext status id 0 setnext status id 0 return true newrecord beforesave newrecord isopen isclosed setisclosed isfinalclose isclosed setisfinalclose iswebcanupdate getupdate_status_id setupdate_status_id gettimeoutdays getnext_status_id setnext_status_id string representation return info public string to string string buffer sb new string buffer m status sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mstatus get_id getname tostring standard constructor param ctx context param ad alertrecipient id id public m alert recipient properties ctx int ad alertrecipient id string trx name super ctx ad alertrecipient id trx name ad_alertrecipient_id malertrecipient ad_alertrecipient_id trxname ad_alertrecipient_id trxname load constructor param ctx context param rs result set public m alert recipient properties ctx result set rs string trx name super ctx rs trx name malertrecipient resultset trxname trxname get user return ad user id or 1 if none public int getad user id integer ii integer get value ad user id if ii null return 1 return ii int value ad_user_id getad_user_id get_value ad_user_id intvalue get role return ad role id or 1 if none public int getad role id integer ii integer get value ad role id if ii null return 1 return ii int value ad_role_id getad_role_id get_value ad_role_id intvalue string representation return info public string to string string buffer sb new string buffer m alert recipient sb append get id append ad user id append getad user id append ad role id append getad role id append return sb to string tostring stringbuffer stringbuffer malertrecipient get_id ad_user_id getad_user_id ad_role_id getad_role_id tostring get document workflow manager return mgr public static doc workflow manager get if s mgr null s mgr new doc workflow manager return s mgr docworkflowmanager s_mgr s_mgr docworkflowmanager s_mgr doc workflow manager private doc workflow manager super if s mgr null s mgr this docworkflowmanager s_mgr s_mgr process document value workflow param document document param ad table id table return true if wf started public boolean process po document int ad table id m nocalled m workflow wfs m workflow get doc value document get ctx document getad client id ad table id document get trxname bug 1568766 trx should be kept all along the road if wfs null wfs length 0 return false boolean started false for int i 0 i wfs length i m workflow wf wfs i we have a document workflow string logic wf get doc value logic if logic null logic length 0 log severe workflow has no logic wf get name continue re check document must be same client as workflow if wf getad client id document getad client id continue check logic boolean sql logic starts with sql if sql test start wf document log fine sql logic evaluated to false logic continue if sql evaluator evaluate logic document logic log fine logic evaluated to false logic continue start workflow log fine logic int ad process id 305 hardcoded process info pi new process info wf get name ad process id ad table id document get id pi setad user id env getad user id document get ctx pi setad client id document getad client id if wf start pi null log config wf get name m nostarted started true return started ad_table_id ad_table_id m_nocalled mworkflow mworkflow getdocvalue getctx getad_client_id ad_table_id get_trxname mworkflow getdocvaluelogic getname getad_client_id getad_client_id startswith teststart evaluatelogic ad_process_id processinfo processinfo getname ad_process_id ad_table_id get_id setad_user_id getad_user_id getctx setad_client_id getad_client_id getname m_nostarted test start condition param wf workflow param document document return true if wf should be started private boolean test start m workflow wf po document boolean ret value false string logic wf get doc value logic logic logic substring 4 sql string table name document get tablename string key columns document get keycolumns if key columns length 1 log severe tables with more then one key column not supported table name key columns length return false string key column key columns 0 string buffer sql new string buffer select append key column append from append table name append where ad client id and 1 append key column append and 2 append logic duplicate open workflow test append and not exists select from ad wf process wfp append where wfp ad table id and wfp record id 3 append table name append append key column append and wfp ad workflow id 4 append and substr wfp wf state 1 1 o prepared statement pstmt null try pstmt db prepare statement sql to string document get trxname pstmt set int 1 wf getad client id pstmt set int 2 document get id pstmt set int 3 document get table id pstmt set int 4 wf getad workflow id result set rs pstmt execute query if rs next ret value true rs close pstmt close pstmt null catch exception e log log level severe logic logic sql sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value teststart mworkflow retvalue getdocvaluelogic tablename get_tablename keycolumns get_keycolumns keycolumns tablename keycolumns keycolumn keycolumns stringbuffer stringbuffer keycolumn tablename ad_client_id keycolumn ad_wf_process ad_table_id record_id tablename keycolumn ad_workflow_id wfstate preparedstatement preparestatement tostring get_trxname setint getad_client_id setint get_id setint get_table_id setint getad_workflow_id resultset executequery retvalue tostring retvalue string representation return info public string to string string buffer sb new string buffer doc workflow manager sb append called append m nocalled append stated append m nostarted append return sb to string tostring stringbuffer stringbuffer docworkflowmanager m_nocalled m_nostarted tostring standard constructor public x ad printpaper properties ctx int ad printpaper id string trx name super ctx ad printpaper id trx name if ad printpaper id 0 setad printpaper id 0 set code null iso a4 set is default false set is landscape true y set margin bottom 0 36 set margin left 0 36 set margin right 0 36 set margin top 0 36 set name null x_ad_printpaper ad_printpaper_id trxname ad_printpaper_id trxname ad_printpaper_id setad_printpaper_id setcode setisdefault setislandscape setmarginbottom setmarginleft setmarginright setmargintop setname load constructor public x ad printpaper properties ctx result set rs string trx name super ctx rs trx name x_ad_printpaper resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printpaper append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printpaper get_id tostring set print paper printer paper definition public void setad printpaper id int ad printpaper id if ad printpaper id 1 throw new illegal argument exception ad printpaper id is mandatory set valuenocheck ad printpaper id new integer ad printpaper id setad_printpaper_id ad_printpaper_id ad_printpaper_id illegalargumentexception ad_printpaper_id set_valuenocheck ad_printpaper_id ad_printpaper_id get print paper printer paper definition public int getad printpaper id integer ii integer get value ad printpaper id if ii null return 0 return ii int value getad_printpaper_id get_value ad_printpaper_id intvalue set validation code validation code public void set code string code if code null throw new illegal argument exception code is mandatory if code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode illegalargumentexception set_value get validation code validation code public string get code return string get value code getcode get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string dimensionunits mm m set dimension units units of dimension public void set dimension units string dimension units if dimension units null throw new illegal argument exception dimension units is mandatory if dimension units null dimension units equals i dimension units equals m else throw new illegal argument exception dimension units invalid value dimension units reference id 375 i m if dimension units null dimension units length 1 log warning length 1 truncated dimension units dimension units substring 0 0 set value dimension units dimension units dimensionunits_mm setdimensionunits dimensionunits dimensionunits illegalargumentexception dimensionunits dimensionunits dimensionunits dimensionunits illegalargumentexception dimensionunits dimensionunits reference_id dimensionunits dimensionunits dimensionunits dimensionunits set_value dimensionunits dimensionunits get dimension units units of dimension public string get dimension units return string get value dimension units getdimensionunits get_value dimensionunits set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set landscape landscape orientation public void set is landscape boolean is landscape set value is landscape new boolean is landscape setislandscape islandscape set_value islandscape islandscape get landscape landscape orientation public boolean is landscape object oo get value is landscape if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islandscape get_value islandscape booleanvalue set bottom margin bottom space in 1 72 inch public void set margin bottom int margin bottom set value margin bottom new integer margin bottom setmarginbottom marginbottom set_value marginbottom marginbottom get bottom margin bottom space in 1 72 inch public int get margin bottom integer ii integer get value margin bottom if ii null return 0 return ii int value getmarginbottom get_value marginbottom intvalue set left margin left space in 1 72 inch public void set margin left int margin left set value margin left new integer margin left setmarginleft marginleft set_value marginleft marginleft get left margin left space in 1 72 inch public int get margin left integer ii integer get value margin left if ii null return 0 return ii int value getmarginleft get_value marginleft intvalue set right margin right space in 1 72 inch public void set margin right int margin right set value margin right new integer margin right setmarginright marginright set_value marginright marginright get right margin right space in 1 72 inch public int get margin right integer ii integer get value margin right if ii null return 0 return ii int value getmarginright get_value marginright intvalue set top margin top space in 1 72 inch public void set margin top int margin top set value margin top new integer margin top setmargintop margintop set_value margintop margintop get top margin top space in 1 72 inch public int get margin top integer ii integer get value margin top if ii null return 0 return ii int value getmargintop get_value margintop intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set size x x horizontal dimension size public void set sizex big decimal sizex set value sizex sizex setsizex bigdecimal set_value get size x x horizontal dimension size public big decimal get sizex big decimal bd big decimal get value sizex if bd null return env zero return bd bigdecimal getsizex bigdecimal bigdecimal get_value set size y y vertical dimension size public void set sizey big decimal sizey set value sizey sizey setsizey bigdecimal set_value get size y y vertical dimension size public big decimal get sizey big decimal bd big decimal get value sizey if bd null return env zero return bd bigdecimal getsizey bigdecimal bigdecimal get_value standard constructor public x m transactionallocation properties ctx int m transactionallocation id string trx name super ctx m transactionallocation id trx name if m transactionallocation id 0 set allocation strategy type null set is allocated false n set is manual false n setm attributesetinstance id 0 setm product id 0 setm transaction id 0 set qty env zero x_m_transactionallocation m_transactionallocation_id trxname m_transactionallocation_id trxname m_transactionallocation_id setallocationstrategytype setisallocated setismanual setm_attributesetinstance_id setm_product_id setm_transaction_id setqty load constructor public x m transactionallocation properties ctx result set rs string trx name super ctx rs trx name x_m_transactionallocation resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m transactionallocation append get id append return sb to string tostring stringbuffer stringbuffer x_m_transactionallocation get_id tostring public static final string allocationstrategytype lifo l set allocation strategy allocation strategy public void set allocation strategy type string allocation strategy type if allocation strategy type null throw new illegal argument exception allocation strategy type is mandatory if allocation strategy type equals f allocation strategy type equals l else throw new illegal argument exception allocation strategy type invalid value allocation strategy type reference id 294 f l if allocation strategy type length 1 log warning length 1 truncated allocation strategy type allocation strategy type substring 0 0 set value allocation strategy type allocation strategy type allocationstrategytype_lifo setallocationstrategytype allocationstrategytype allocationstrategytype illegalargumentexception allocationstrategytype allocationstrategytype allocationstrategytype illegalargumentexception allocationstrategytype allocationstrategytype reference_id allocationstrategytype allocationstrategytype allocationstrategytype set_value allocationstrategytype allocationstrategytype get allocation strategy allocation strategy public string get allocation strategy type return string get value allocation strategy type getallocationstrategytype get_value allocationstrategytype set allocated indicates if the payment has been allocated public void set is allocated boolean is allocated set value is allocated new boolean is allocated setisallocated isallocated set_value isallocated isallocated get allocated indicates if the payment has been allocated public boolean is allocated object oo get value is allocated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallocated get_value isallocated booleanvalue set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set value m inoutline id null else set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_value m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 0 set value m inventoryline id null else set value m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id set_value m_inventoryline_id set_value m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 0 set value m productionline id null else set value m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id set_value m_productionline_id set_value m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue set inventory transaction public void setm transaction id int m transaction id if m transaction id 1 throw new illegal argument exception m transaction id is mandatory set valuenocheck m transaction id new integer m transaction id setm_transaction_id m_transaction_id m_transaction_id illegalargumentexception m_transaction_id set_valuenocheck m_transaction_id m_transaction_id get inventory transaction public int getm transaction id integer ii integer get value m transaction id if ii null return 0 return ii int value getm_transaction_id get_value m_transaction_id intvalue public static final int out m inoutline id ad reference id 295 set out shipment line outgoing shipment receipt public void setout m inoutline id int out m inoutline id if out m inoutline id 0 set value out m inoutline id null else set value out m inoutline id new integer out m inoutline id out_m_inoutline_id_ad_reference_id setout_m_inoutline_id out_m_inoutline_id out_m_inoutline_id set_value out_m_inoutline_id set_value out_m_inoutline_id out_m_inoutline_id get out shipment line outgoing shipment receipt public int getout m inoutline id integer ii integer get value out m inoutline id if ii null return 0 return ii int value getout_m_inoutline_id get_value out_m_inoutline_id intvalue public static final int out m inventoryline id ad reference id 296 set out inventory line outgoing inventory line public void setout m inventoryline id int out m inventoryline id if out m inventoryline id 0 set value out m inventoryline id null else set value out m inventoryline id new integer out m inventoryline id out_m_inventoryline_id_ad_reference_id setout_m_inventoryline_id out_m_inventoryline_id out_m_inventoryline_id set_value out_m_inventoryline_id set_value out_m_inventoryline_id out_m_inventoryline_id get out inventory line outgoing inventory line public int getout m inventoryline id integer ii integer get value out m inventoryline id if ii null return 0 return ii int value getout_m_inventoryline_id get_value out_m_inventoryline_id intvalue public static final int out m productionline id ad reference id 297 set out production line outgoing production line public void setout m productionline id int out m productionline id if out m productionline id 0 set value out m productionline id null else set value out m productionline id new integer out m productionline id out_m_productionline_id_ad_reference_id setout_m_productionline_id out_m_productionline_id out_m_productionline_id set_value out_m_productionline_id set_value out_m_productionline_id out_m_productionline_id get out production line outgoing production line public int getout m productionline id integer ii integer get value out m productionline id if ii null return 0 return ii int value getout_m_productionline_id get_value out_m_productionline_id intvalue public static final int out m transaction id ad reference id 298 set out transaction outgoing transaction public void setout m transaction id int out m transaction id if out m transaction id 0 set value out m transaction id null else set value out m transaction id new integer out m transaction id out_m_transaction_id_ad_reference_id setout_m_transaction_id out_m_transaction_id out_m_transaction_id set_value out_m_transaction_id set_value out_m_transaction_id out_m_transaction_id get out transaction outgoing transaction public int getout m transaction id integer ii integer get value out m transaction id if ii null return 0 return ii int value getout_m_transaction_id get_value out_m_transaction_id intvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value basic constructor use the set methods to set the values of the attributes public option basic constructor use the set methods to set the values of the attributes param value sets the attribute value public option string value set value value setvalue basic constructor use the set methods to set the values of the attributes param label sets the attribute label param value sets the attribute value public option string label string value set label label set value value setlabel setvalue basic constructor use the set methods to set the values of the attributes param label sets the attribute label param value sets the attribute value public option string label int value set label label set value value setlabel setvalue basic constructor use the set methods to set the values of the attributes param label sets the attribute label param value sets the attribute value public option string label double value set label label set value value setlabel setvalue sets the label attribute param label the label attribute public option set label string label add attribute label label return this setlabel addattribute sets the value attribute param value the value attribute public option set value string value add attribute value value return this setvalue addattribute sets the value attribute param value the value attribute public option set value int value add attribute value integer to string value return this setvalue addattribute tostring sets the value attribute param value the value attribute public option set value double value add attribute value double to string value return this setvalue addattribute tostring sets the selected value param selected true or false public option set selected boolean selected if selected true add attribute selected selected else remove attribute selected return this setselected addattribute removeattribute sets the disabled value param disabled true or false public option set disabled boolean disabled if disabled true add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public option add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public option add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public option add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public option add element string element add element to registry element return this addelement addelementtoregistry creates a group of options param element a group of options public option add element string element option option new option element length for int x 0 x element length x option x new option add element element x return option addelement addelement removes an element from the element param hashcode the name of the element to be removed public option remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param script script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param script script public void set on blur string script add attribute onblur script setonblur addattribute the onsubmit event occurs when a form is submitted it only applies to the form element param script script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param script script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param script script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param script script public void set on change string script add attribute onchange script setonchange addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute http www w3 org tr xhtml1 dtd xhtml1 strict dtd initialize global variables public void init servlet config config throws servlet exception super init config servletconfig servletexception process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception response set content type content type print writer out response get writer out println xml version 1 0 out println doc type out println html xmlns http www w3 org 1999 xhtml xml lang en lang en out println head title w error title head out println body out println p the servlet has received a get this is the reply p out println body html doget httpservletrequest httpservletresponse servletexception ioexception setcontenttype content_type printwriter getwriter doc_type werror process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception response set content type content type print writer out response get writer out println xml version 1 0 out println doc type out println html xmlns http www w3 org 1999 xhtml xml lang en lang en out println head title w error title head out println body out println p the servlet has received a post this is the reply p out println body html dopost httpservletrequest httpservletresponse servletexception ioexception setcontenttype content_type printwriter getwriter doc_type werror out println body html clean up resources public void destroy please upgrade prego lanciare il programma di update public object get contents return contents pleaseupgrade getcontents initialize panel param window no window param frame parent frame public void init int window no form frame frame log info m windowno window no m frame frame try top selection panel create selection panel true true true m frame get content pane add selection panel border layout north center create main panel c scroll pane scroll new c scroll pane this m frame get content pane add scroll border layout center confirm panel add action listener this south m frame get content pane add confirm panel border layout south catch exception e log log level severe e size it windowno windowno formframe m_windowno windowno m_frame createselectionpanel m_frame getcontentpane selectionpanel borderlayout createmainpanel cscrollpane cscrollpane m_frame getcontentpane borderlayout confirmpanel addactionlistener m_frame getcontentpane confirmpanel borderlayout sizeit size window private void size it frame m frame pack dimension size m frame get preferred size size width window width m frame set size size sizeit m_frame m_frame getpreferredsize window_width m_frame setsize dispose public void dispose if m frame null m frame dispose m frame null remove all if selection panel null selection panel remove all selection panel null if m selectionlist null m selectionlist clear m selectionlist null if m productlist null m productlist clear m productlist null if m qtylist null m qtylist clear m qtylist null if m buttongroups null m buttongroups clear m buttongroups null m_frame m_frame m_frame removeall selectionpanel selectionpanel removeall selectionpanel m_selectionlist m_selectionlist m_selectionlist m_productlist m_productlist m_productlist m_qtylist m_qtylist m_qtylist m_buttongroups m_buttongroups m_buttongroups create selection panel param order param invoice param project private void create selection panel boolean order boolean invoice boolean project int row 0 selection panel set border new titled border msg translate env get ctx selection product field new c combo box get products c label label new c label msg translate env get ctx m product id label set label for product field selection panel add label new a layout constraint row 0 selection panel add product field product field add action listener this qty label new c label product qty get title label set label for product qty selection panel add label selection panel add product qty product qty set value env one product qty add action listener this if order order field new c combo box get orders label new c label msg translate env get ctx c order id label set label for order field selection panel add label new a layout constraint row 0 selection panel add order field order field add action listener this if invoice invoice field new c combo box get invoices label new c label msg translate env get ctx c invoice id label set label for invoice field selection panel add label new a layout constraint row 0 selection panel add invoice field invoice field add action listener this if project project field new c combo box get projects label new c label msg translate env get ctx c project id label set label for project field selection panel add label new a layout constraint row 0 selection panel add project field project field add action listener this enabled in action performed confirm panel getok button set enabled false size dimension size selection panel get preferred size size width window width selection panel set preferred size size createselectionpanel selectionpanel setborder titledborder getctx productfield ccombobox getproducts clabel clabel getctx m_product_id setlabelfor productfield selectionpanel alayoutconstraint selectionpanel productfield productfield addactionlistener clabel productqty gettitle setlabelfor productqty selectionpanel selectionpanel productqty productqty setvalue productqty addactionlistener orderfield ccombobox getorders clabel getctx c_order_id setlabelfor orderfield selectionpanel alayoutconstraint selectionpanel orderfield orderfield addactionlistener invoicefield ccombobox getinvoices clabel getctx c_invoice_id setlabelfor invoicefield selectionpanel alayoutconstraint selectionpanel invoicefield invoicefield addactionlistener projectfield ccombobox getprojects clabel getctx c_project_id setlabelfor projectfield selectionpanel alayoutconstraint selectionpanel projectfield projectfield addactionlistener actionperformed confirmpanel getokbutton setenabled selectionpanel getpreferredsize window_width selectionpanel setpreferredsize get array of bom products return products private key name pair get products string sql select m product id name from m product where isbom y and is verified y and is active y order by name return db get key name pairs m role get default add accesssql sql m product m role sql notqualified m role sql ro true keynamepair getproducts m_product_id m_product isverified isactive getkeynamepairs mrole getdefault addaccesssql m_product mrole sql_notqualified mrole sql_ro get array of open orders return orders private key name pair get orders string sql select c order id document no grand total from c order where processed n and doc status dr order by document no return db get key name pairs m role get default add accesssql sql c order m role sql notqualified m role sql ro true keynamepair getorders c_order_id documentno _ grandtotal c_order docstatus documentno getkeynamepairs mrole getdefault addaccesssql c_order mrole sql_notqualified mrole sql_ro get array of open non service projects return orders private key name pair get projects string sql select c project id name from c project where processed n and is summary n and is active y and project category s order by name return db get key name pairs m role get default add accesssql sql c project m role sql notqualified m role sql ro true keynamepair getprojects c_project_id c_project issummary isactive projectcategory getkeynamepairs mrole getdefault addaccesssql c_project mrole sql_notqualified mrole sql_ro get array of open invoices return invoices private key name pair get invoices string sql select c invoice id document no grand total from c invoice where processed n and doc status dr order by document no return db get key name pairs m role get default add accesssql sql c invoice m role sql notqualified m role sql ro true keynamepair getinvoices c_invoice_id documentno _ grandtotal c_invoice docstatus documentno getkeynamepairs mrole getdefault addaccesssql c_invoice mrole sql_notqualified mrole sql_ro create main panel called when changing product private void create main panel log config m product this remove all this set preferred size null this invalidate this set border null m selectionlist clear m productlist clear m qtylist clear m buttongroups clear this set layout new a layout string title msg get msg env get ctx select product if m product null m product get id 0 title m product get name if m product get description null m product get description length 0 this set tool tip text m product get description m bomline 0 addbom lines m product m qty this set border new titled border title createmainpanel m_product removeall setpreferredsize setborder m_selectionlist m_productlist m_qtylist m_buttongroups setlayout alayout getmsg getctx selectproduct m_product m_product get_id m_product getname m_product getdescription m_product getdescription settooltiptext m_product getdescription m_bomline addbomlines m_product m_qty setborder titledborder add bom lines to this called recursively param product product param qty quantity private void addbom lines m product product big decimal qty m productbom bom lines m productbom getbom lines product for int i 0 i bom lines length i addbom line bom lines i qty log fine bom lines length addbomlines mproduct bigdecimal mproductbom bomlines mproductbom getbomlines bomlines addbomline bomlines bomlines add bom line to this calls addbom lines if added product is a bom param line bom line param qty quantity private void addbom line m productbom line big decimal qty log fine line to string string bom type line getbom type if bom type null bom type m productbom bomtype standardpart big decimal line qty line getbom qty multiply qty m product product line get product if product null return if product isbom product is verified addbom lines product line qty recursive else add display line getm product id product getm product id bom type product get name line qty addbomlines addbomline mproductbom bigdecimal tostring bomtype getbomtype bomtype bomtype mproductbom bomtype_standardpart bigdecimal lineqty getbomqty mproduct getproduct isverified addbomlines lineqty adddisplay getm_product_id getm_product_id bomtype getname lineqty add line to display param parentm product id parent product param m product id product param bom type bom type param name name param line qty qty private void add display int parentm product id int m product id string bom type string name big decimal line qty log fine m product id m product id type bom type name name qty line qty boolean selected true if m productbom bomtype standardpart equals bom type string title j check box cb new j check box title cb set selected true cb set enabled false cb add action listener this will not change m selectionlist add cb this add cb new a layout constraint m bomline 0 else if m productbom bomtype optionalpart equals bom type string title msg get msg env get ctx optional j check box cb new j check box title cb set selected false selected false cb add action listener this m selectionlist add cb this add cb new a layout constraint m bomline 0 else alternative string title msg get msg env get ctx alternative bom type j radio button b new j radio button title string group name string value of parentm product id bom type button group group button group m buttongroups get group name if group null log fine button group group name group new button group m buttongroups put group name group group add b b set selected true select first one else group add b b set selected false selected false b add action listener this m selectionlist add b this add b new a layout constraint m bomline 0 add to list display m productlist add new integer m product id v number qty new v number qty true false true display type quantity name qty set value line qty qty set read write selected m qtylist add qty c label label new c label name label set label for qty this add label this add qty parentm_product_id m_product_id bomtype lineqty adddisplay parentm_product_id m_product_id bomtype bigdecimal lineqty m_product_id m_product_id bomtype lineqty mproductbom bomtype_standardpart bomtype jcheckbox jcheckbox setselected setenabled addactionlistener m_selectionlist alayoutconstraint m_bomline mproductbom bomtype_optionalpart bomtype getmsg getctx jcheckbox jcheckbox setselected addactionlistener m_selectionlist alayoutconstraint m_bomline getmsg getctx bomtype jradiobutton jradiobutton groupname valueof parentm_product_id _ bomtype buttongroup buttongroup m_buttongroups groupname buttongroup groupname buttongroup m_buttongroups groupname setselected setselected addactionlistener m_selectionlist alayoutconstraint m_bomline m_productlist m_product_id vnumber vnumber displaytype setvalue lineqty setreadwrite m_qtylist clabel clabel setlabelfor get preferred size return size public dimension get preferred size dimension size super get preferred size if size width window width size width window width 30 return size getpreferredsize getpreferredsize window_width window_width action listener param e event public void action performed action event e log config e get action command object source e get source toggle qty enabled if source instanceof j check box source instanceof j radio button cmd selection source need to de select the others in group if source instanceof j radio button find button group iterator it m buttongroups values iterator while it has next button group group button group it next enumeration en group get elements while en has more elements we found the group if source en next element enumeration info group get elements while info has more elements object info obj info next element if source info obj cmd selection info obj j check box or j radio button product qty else if source product field source product qty m qty big decimal product qty get value key name pair pp key name pair product field get selected item m product m product get env get ctx pp get key create main panel size it order else if source order field key name pair pp key name pair order field get selected item boolean valid pp null pp get key 0 if invoice field null invoice field set read write valid if project field null project field set read write valid invoice else if source invoice field key name pair pp key name pair invoice field get selected item boolean valid pp null pp get key 0 if order field null order field set read write valid if project field null project field set read write valid project else if source project field key name pair pp key name pair project field get selected item boolean valid pp null pp get key 0 if order field null order field set read write valid if invoice field null invoice field set read write valid ok else if e get action command equals confirm panel a ok if cmd save dispose else if e get action command equals confirm panel a cancel dispose enable ok boolean ok m product null if ok key name pair pp null if order field null pp key name pair order field get selected item if pp null pp get key 0 invoice field null pp key name pair invoice field get selected item if pp null pp get key 0 project field null pp key name pair project field get selected item ok pp null pp get key 0 confirm panel getok button set enabled ok actionperformed actionevent getactioncommand getsource jcheckbox jradiobutton cmd_selection jradiobutton m_buttongroups hasnext buttongroup buttongroup getelements hasmoreelements nextelement getelements hasmoreelements infoobj nextelement infoobj cmd_selection infoobj jcheckbox jradiobutton productfield productqty m_qty bigdecimal productqty getvalue keynamepair keynamepair productfield getselecteditem m_product mproduct getctx getkey createmainpanel sizeit orderfield keynamepair keynamepair orderfield getselecteditem getkey invoicefield invoicefield setreadwrite projectfield projectfield setreadwrite invoicefield keynamepair keynamepair invoicefield getselecteditem getkey orderfield orderfield setreadwrite projectfield projectfield setreadwrite projectfield keynamepair keynamepair projectfield getselecteditem getkey orderfield orderfield setreadwrite invoicefield invoicefield setreadwrite getactioncommand confirmpanel a_ok cmd_save getactioncommand confirmpanel a_cancel m_product keynamepair orderfield keynamepair orderfield getselecteditem getkey invoicefield keynamepair invoicefield getselecteditem getkey projectfield keynamepair projectfield getselecteditem getkey confirmpanel getokbutton setenabled enable disable qty based on selection param source j check box or j radio button private void cmd selection object source for int i 0 i m selectionlist size i if source m selectionlist get i boolean selected is selection selected source v number qty v number m qtylist get i qty set read write selected return log log level severe vbom drop cmd selection not found source jcheckbox jradiobutton cmd_selection m_selectionlist m_selectionlist isselectionselected vnumber vnumber m_qtylist setreadwrite vbomdrop cmd_selection is selection selected param source check box or radio button return true if selected private boolean is selection selected object source boolean ret value false if source instanceof j check box ret value j check box source is selected else if source instanceof j radio button ret value j radio button source is selected else log log level severe vbom drop is selection selected not valid source return ret value checkbox radiobutton isselectionselected retvalue jcheckbox retvalue jcheckbox isselected jradiobutton retvalue jradiobutton isselected vbomdrop isselectionselected retvalue save selection private boolean cmd save key name pair pp key name pair order field get selected item if pp null pp get key 0 return cmd saveorder pp get key pp key name pair invoice field get selected item if pp null pp get key 0 return cmd saveinvoice pp get key pp key name pair project field get selected item if pp null pp get key 0 return cmd saveproject pp get key log log level severe cmd save nothing selected return false cmd_save keynamepair keynamepair orderfield getselecteditem getkey cmd_saveorder getkey keynamepair invoicefield getselecteditem getkey cmd_saveinvoice getkey keynamepair projectfield getselecteditem getkey cmd_saveproject getkey cmd_save save to order param c order id id return true if saved private boolean cmd saveorder int c order id log config vbom drop cmd saveorder c order id c order id m order order new m order env get ctx c order id null if order get id 0 log log level severe vbom drop cmd saveorder not found c order id c order id return false int line count 0 for all bom lines for int i 0 i m selectionlist size i if is selection selected m selectionlist get i big decimal qty big decimal v number m qtylist get i get value int m product id integer m productlist get i int value create line m order line ol new m order line order ol setm product id m product id true ol set qty qty ol set price ol set tax if ol save line count else log log level severe vbom drop cmd saveorder line not saved line selected for all bom lines log config vbom drop cmd saveorder line count return true c_order_id cmd_saveorder c_order_id vbomdrop cmd_saveorder c_order_id c_order_id morder morder getctx c_order_id get_id vbomdrop cmd_saveorder c_order_id c_order_id linecount m_selectionlist isselectionselected m_selectionlist bigdecimal bigdecimal vnumber m_qtylist getvalue m_product_id m_productlist intvalue morderline morderline setm_product_id m_product_id setqty setprice settax linecount vbomdrop cmd_saveorder vbomdrop cmd_saveorder linecount save to invoice param c invoice id id return true if saved private boolean cmd saveinvoice int c invoice id log config c invoice id c invoice id m invoice invoice new m invoice env get ctx c invoice id null if invoice get id 0 log log level severe not found c invoice id c invoice id return false int line count 0 for all bom lines for int i 0 i m selectionlist size i if is selection selected m selectionlist get i big decimal qty big decimal v number m qtylist get i get value int m product id integer m productlist get i int value create line m invoice line il new m invoice line invoice il setm product id m product id true il set qty qty il set price il set tax if il save line count else log log level severe vbom drop cmd saveinvoice line not saved line selected for all bom lines log config vbom drop cmd saveinvoice line count return true c_invoice_id cmd_saveinvoice c_invoice_id c_invoice_id c_invoice_id minvoice minvoice getctx c_invoice_id get_id c_invoice_id c_invoice_id linecount m_selectionlist isselectionselected m_selectionlist bigdecimal bigdecimal vnumber m_qtylist getvalue m_product_id m_productlist intvalue minvoiceline minvoiceline setm_product_id m_product_id setqty setprice settax linecount vbomdrop cmd_saveinvoice vbomdrop cmd_saveinvoice linecount save to project param c project id id return true if saved private boolean cmd saveproject int c project id log config vbom drop cmd saveproject c project id c project id m project project new m project env get ctx c project id null if project get id 0 log log level severe vbom drop cmd saveproject not found c project id c project id return false int line count 0 for all bom lines for int i 0 i m selectionlist size i if is selection selected m selectionlist get i big decimal qty big decimal v number m qtylist get i get value int m product id integer m productlist get i int value create line m project line pl new m project line project pl setm product id m product id pl set planned qty qty pl set planned price if pl save line count else log log level severe vbom drop cmd saveproject line not saved line selected for all bom lines log config vbom drop cmd saveproject line count return true c_project_id cmd_saveproject c_project_id vbomdrop cmd_saveproject c_project_id c_project_id mproject mproject getctx c_project_id get_id vbomdrop cmd_saveproject c_project_id c_project_id linecount m_selectionlist isselectionselected m_selectionlist bigdecimal bigdecimal vnumber m_qtylist getvalue m_product_id m_productlist intvalue mprojectline mprojectline setm_product_id m_product_id setplannedqty setplannedprice linecount vbomdrop cmd_saveproject vbomdrop cmd_saveproject linecount standard constructor public x ad ref list properties ctx int ad ref list id string trx name super ctx ad ref list id trx name if ad ref list id 0 setad ref list id 0 setad reference id 0 set entity type null u set name null set value null x_ad_ref_list ad_ref_list_id trxname ad_ref_list_id trxname ad_ref_list_id setad_ref_list_id setad_reference_id setentitytype setname setvalue load constructor public x ad ref list properties ctx result set rs string trx name super ctx rs trx name x_ad_ref_list resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad ref list append get id append return sb to string tostring stringbuffer stringbuffer x_ad_ref_list get_id tostring set reference list reference list based on table public void setad ref list id int ad ref list id if ad ref list id 1 throw new illegal argument exception ad ref list id is mandatory set valuenocheck ad ref list id new integer ad ref list id setad_ref_list_id ad_ref_list_id ad_ref_list_id illegalargumentexception ad_ref_list_id set_valuenocheck ad_ref_list_id ad_ref_list_id get reference list reference list based on table public int getad ref list id integer ii integer get value ad ref list id if ii null return 0 return ii int value getad_ref_list_id get_value ad_ref_list_id intvalue set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set valuenocheck ad reference id new integer ad reference id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_valuenocheck ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 60 log warning length 60 truncated value value substring 0 59 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value get content return content public object get contents return contents getcontents standard constructor public x pa goal properties ctx int pa goal id string trx name super ctx pa goal id trx name if pa goal id 0 set goal performance env zero set is summary false set measure actual env zero set measure scope null set measure target env zero set name null setpa colorschema id 0 setpa goal id 0 set relative weight env zero 1 set seq no 0 x_pa_goal pa_goal_id trxname pa_goal_id trxname pa_goal_id setgoalperformance setissummary setmeasureactual setmeasurescope setmeasuretarget setname setpa_colorschema_id setpa_goal_id setrelativeweight setseqno load constructor public x pa goal properties ctx result set rs string trx name super ctx rs trx name x_pa_goal resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa goal append get id append return sb to string tostring stringbuffer stringbuffer x_pa_goal get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 set value ad role id null else set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_value ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set date from starting date for a range public void set date from timestamp date from set value date from date from setdatefrom datefrom set_value datefrom datefrom get date from starting date for a range public timestamp get date from return timestamp get value date from getdatefrom get_value datefrom set date last run date the process was last run public void set date last run timestamp date last run set valuenocheck date last run date last run setdatelastrun datelastrun set_valuenocheck datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date to end date of a date range public void set date to timestamp date to set value date to date to setdateto dateto set_value dateto dateto get date to end date of a date range public timestamp get date to return timestamp get value date to getdateto get_value dateto set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set performance goal target achievement from 0 1 public void set goal performance big decimal goal performance if goal performance null throw new illegal argument exception goal performance is mandatory set valuenocheck goal performance goal performance setgoalperformance bigdecimal goalperformance goalperformance illegalargumentexception goalperformance set_valuenocheck goalperformance goalperformance get performance goal target achievement from 0 1 public big decimal get goal performance big decimal bd big decimal get value goal performance if bd null return env zero return bd bigdecimal getgoalperformance bigdecimal bigdecimal get_value goalperformance set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set measure actual actual value that has been measured public void set measure actual big decimal measure actual if measure actual null throw new illegal argument exception measure actual is mandatory set valuenocheck measure actual measure actual setmeasureactual bigdecimal measureactual measureactual illegalargumentexception measureactual set_valuenocheck measureactual measureactual get measure actual actual value that has been measured public big decimal get measure actual big decimal bd big decimal get value measure actual if bd null return env zero return bd bigdecimal getmeasureactual bigdecimal bigdecimal get_value measureactual public static final string measuredisplay day 8 set measure display measure scope initially displayed public void set measure display string measure display if measure display null throw new illegal argument exception measure display is mandatory if measure display null measure display equals 0 measure display equals 1 measure display equals 3 measure display equals 5 measure display equals 7 measure display equals 8 else throw new illegal argument exception measure display invalid value measure display reference id 367 0 1 3 5 7 8 if measure display null measure display length 1 log warning length 1 truncated measure display measure display substring 0 0 set value measure display measure display measuredisplay_day setmeasuredisplay measuredisplay measuredisplay illegalargumentexception measuredisplay measuredisplay measuredisplay measuredisplay measuredisplay measuredisplay measuredisplay measuredisplay illegalargumentexception measuredisplay measuredisplay reference_id measuredisplay measuredisplay measuredisplay measuredisplay set_value measuredisplay measuredisplay get measure display measure scope initially displayed public string get measure display return string get value measure display getmeasuredisplay get_value measuredisplay public static final string measurescope day 8 set measure scope performance measure scope public void set measure scope string measure scope if measure scope null throw new illegal argument exception measure scope is mandatory if measure scope equals 0 measure scope equals 1 measure scope equals 3 measure scope equals 5 measure scope equals 7 measure scope equals 8 else throw new illegal argument exception measure scope invalid value measure scope reference id 367 0 1 3 5 7 8 if measure scope length 1 log warning length 1 truncated measure scope measure scope substring 0 0 set value measure scope measure scope measurescope_day setmeasurescope measurescope measurescope illegalargumentexception measurescope measurescope measurescope measurescope measurescope measurescope measurescope illegalargumentexception measurescope measurescope reference_id measurescope measurescope measurescope set_value measurescope measurescope get measure scope performance measure scope public string get measure scope return string get value measure scope getmeasurescope get_value measurescope set measure target target value for measure public void set measure target big decimal measure target if measure target null throw new illegal argument exception measure target is mandatory set value measure target measure target setmeasuretarget bigdecimal measuretarget measuretarget illegalargumentexception measuretarget set_value measuretarget measuretarget get measure target target value for measure public big decimal get measure target big decimal bd big decimal get value measure target if bd null return env zero return bd bigdecimal getmeasuretarget bigdecimal bigdecimal get_value measuretarget set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set color schema performance color schema public void setpa colorschema id int pa colorschema id if pa colorschema id 1 throw new illegal argument exception pa colorschema id is mandatory set value pa colorschema id new integer pa colorschema id setpa_colorschema_id pa_colorschema_id pa_colorschema_id illegalargumentexception pa_colorschema_id set_value pa_colorschema_id pa_colorschema_id get color schema performance color schema public int getpa colorschema id integer ii integer get value pa colorschema id if ii null return 0 return ii int value getpa_colorschema_id get_value pa_colorschema_id intvalue public static final int pa goalparent id ad reference id 230 set parent goal parent goal public void setpa goalparent id int pa goalparent id if pa goalparent id 0 set value pa goalparent id null else set value pa goalparent id new integer pa goalparent id pa_goalparent_id_ad_reference_id setpa_goalparent_id pa_goalparent_id pa_goalparent_id set_value pa_goalparent_id set_value pa_goalparent_id pa_goalparent_id get parent goal parent goal public int getpa goalparent id integer ii integer get value pa goalparent id if ii null return 0 return ii int value getpa_goalparent_id get_value pa_goalparent_id intvalue set goal performance goal public void setpa goal id int pa goal id if pa goal id 1 throw new illegal argument exception pa goal id is mandatory set valuenocheck pa goal id new integer pa goal id setpa_goal_id pa_goal_id pa_goal_id illegalargumentexception pa_goal_id set_valuenocheck pa_goal_id pa_goal_id get goal performance goal public int getpa goal id integer ii integer get value pa goal id if ii null return 0 return ii int value getpa_goal_id get_value pa_goal_id intvalue set measure concrete performance measurement public void setpa measure id int pa measure id if pa measure id 0 set value pa measure id null else set value pa measure id new integer pa measure id setpa_measure_id pa_measure_id pa_measure_id set_value pa_measure_id set_value pa_measure_id pa_measure_id get measure concrete performance measurement public int getpa measure id integer ii integer get value pa measure id if ii null return 0 return ii int value getpa_measure_id get_value pa_measure_id intvalue set relative weight relative weight of this step 0 ignored public void set relative weight big decimal relative weight if relative weight null throw new illegal argument exception relative weight is mandatory set value relative weight relative weight setrelativeweight bigdecimal relativeweight relativeweight illegalargumentexception relativeweight set_value relativeweight relativeweight get relative weight relative weight of this step 0 ignored public big decimal get relative weight big decimal bd big decimal get value relative weight if bd null return env zero return bd bigdecimal getrelativeweight bigdecimal bigdecimal get_value relativeweight set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m pricelist version id p m pricelist version id para i get parameter as int else if name equals date value p datevalue timestamp para i get parameter else if name equals m warehouse id p m warehouse id para i get parameter as int else if name equals c currency id p c currency id para i get parameter as int else log log level severe unknown parameter name p record id getrecord id p pinstance id getad pinstance id processinfoparameter getparameter getparametername getparameter m_pricelist_version_id p_m_pricelist_version_id getparameterasint datevalue p_datevalue getparameter m_warehouse_id p_m_warehouse_id getparameterasint c_currency_id p_c_currency_id getparameterasint p_record_id getrecord_id p_pinstance_id getad_pinstance_id process return message throws exception protected string do it throws exception string sqlupd string sqlins int cntu 0 int cnti 0 log info inventory valuation temporary table clear v resultstr clear table delete t inventoryvalue where m warehouse id p m warehouse id commit insert products sqlins insert into t inventoryvalue ad client id ad org id ad pinstance id m warehouse id m product id select ad client id ad org id p pinstance id p m warehouse id m product id from m product where is stocked y cnti db execute update sqlins if cnti 0 return created 0 if cnti 0 raise error insert stocked products error sqlins update constants en oracle set date value trunc 0 9993 equivale a sumar 23 59 a la fecha p datevalue set hours 23 p datevalue set minutes 59 p datevalue set seconds 0 sqlupd update t inventoryvalue set date value m pricelist version id c currency id where m warehouse id prepared statement pstmt db prepare statement sqlupd result set type scroll insensitive result set concur updatable get trxname pstmt set timestamp 1 p datevalue pstmt set int 2 p m pricelist version id pstmt set int 3 p c currency id pstmt set int 4 p m warehouse id cntu pstmt execute update if cntu 0 raise error update constants error sqlupd get current qty on hand sqlupd update t inventoryvalue set qty on hand select sum qty on hand from m storage s m locator l where t inventoryvalue m product id s m product id and l m locator id s m locator id and l m warehouse id t inventoryvalue m warehouse id where t inventoryvalue m warehouse id p m warehouse id cntu db execute update sqlupd if cntu 0 raise error get qty on hand error sqlupd adjust for valuation date sqlupd update t inventoryvalue set qty on hand select t inventoryvalue qty on hand nvl sum t movement qty 0 from m transaction t m locator l where t m product id t inventoryvalue m product id and t m attributesetinstance id t inventoryvalue m attributesetinstance id and t movement date t inventoryvalue date value and t m locator id l m locator id and l m warehouse id t inventoryvalue m warehouse id where t inventoryvalue m warehouse id p m warehouse id cntu db execute update sqlupd if cntu 0 raise error adjust qty on hand error sqlupd delete records w o on hand qty sqlupd delete t inventoryvalue where qty on hand 0 or qty on hand is null cntu db execute update sqlupd if cntu 0 raise error delete zero qty on hand error sqlupd update prices sqlupd update t inventoryvalue set pricepo select currency convert po price list po c currency id t inventoryvalue c currency id t inventoryvalue date value null t inventoryvalue ad client id t inventoryvalue ad org id from m product po po where po m product id t inventoryvalue m product id and po is current vendor y and rownum 1 price list select currency convert pp price list pl c currency id t inventoryvalue c currency id t inventoryvalue date value null t inventoryvalue ad client id t inventoryvalue ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id t inventoryvalue m product id and pp m pricelist version id t inventoryvalue m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id price std select currency convert pp price std pl c currency id t inventoryvalue c currency id t inventoryvalue date value null t inventoryvalue ad client id t inventoryvalue ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id t inventoryvalue m product id and pp m pricelist version id t inventoryvalue m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id price limit select currency convert pp price limit pl c currency id t inventoryvalue c currency id t inventoryvalue date value null t inventoryvalue ad client id t inventoryvalue ad org id from m pricelist pl m pricelist version plv m productprice pp where pp m product id t inventoryvalue m product id and pp m pricelist version id t inventoryvalue m pricelist version id and pp m pricelist version id plv m pricelist version id and plv m pricelist id pl m pricelist id cost standard select currency convert pc current cost price acs c currency id t inventoryvalue c currency id t inventoryvalue date value null t inventoryvalue ad client id t inventoryvalue ad org id from ad clientinfo ci c acctschema acs m product costing pc where t inventoryvalue ad client id ci ad client id and ci c acctschema1 id acs c acctschema id and acs c acctschema id pc c acctschema id and t inventoryvalue m product id pc m product id where t inventoryvalue m warehouse id p m warehouse id cntu db execute update sqlupd if cntu 0 raise error get prices error sqlupd update values sqlupd update t inventoryvalue set pricepo amt qty on hand pricepo price list amt qty on hand price list price std amt qty on hand price std price limit amt qty on hand price limit cost standard amt qty on hand cost standard where m warehouse id p m warehouse id cntu db execute update sqlupd if cntu 0 raise error update value error sqlupd db commit true get trxname return created cntu doit v_resultstr cleartable t_inventoryvalue m_warehouse_id p_m_warehouse_id t_inventoryvalue ad_client_id ad_org_id ad_pinstance_id m_warehouse_id m_product_id ad_client_id ad_org_id p_pinstance_id p_m_warehouse_id m_product_id m_product isstocked executeupdate raiseerror insertstockedproducts datevalue p_datevalue sethours p_datevalue setminutes p_datevalue setseconds t_inventoryvalue datevalue m_pricelist_version_id c_currency_id m_warehouse_id preparedstatement preparestatement resultset type_scroll_insensitive resultset concur_updatable get_trxname settimestamp p_datevalue setint p_m_pricelist_version_id setint p_c_currency_id setint p_m_warehouse_id executeupdate raiseerror updateconstants qtyonhand t_inventoryvalue qtyonhand qtyonhand m_storage m_locator t_inventoryvalue m_product_id m_product_id m_locator_id m_locator_id m_warehouse_id t_inventoryvalue m_warehouse_id t_inventoryvalue m_warehouse_id p_m_warehouse_id executeupdate raiseerror getqtyonhand t_inventoryvalue qtyonhand t_inventoryvalue qtyonhand movementqty m_transaction m_locator m_product_id t_inventoryvalue m_product_id m_attributesetinstance_id t_inventoryvalue m_attributesetinstance_id movementdate t_inventoryvalue datevalue m_locator_id m_locator_id m_warehouse_id t_inventoryvalue m_warehouse_id t_inventoryvalue m_warehouse_id p_m_warehouse_id executeupdate raiseerror adjustqtyonhand onhand t_inventoryvalue qtyonhand qtyonhand executeupdate raiseerror deletezeroqtyonhand t_inventoryvalue currencyconvert pricelist c_currency_id t_inventoryvalue c_currency_id t_inventoryvalue datevalue t_inventoryvalue ad_client_id t_inventoryvalue ad_org_id m_product_po m_product_id t_inventoryvalue m_product_id iscurrentvendor pricelist currencyconvert pricelist c_currency_id t_inventoryvalue c_currency_id t_inventoryvalue datevalue t_inventoryvalue ad_client_id t_inventoryvalue ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id t_inventoryvalue m_product_id m_pricelist_version_id t_inventoryvalue m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id pricestd currencyconvert pricestd c_currency_id t_inventoryvalue c_currency_id t_inventoryvalue datevalue t_inventoryvalue ad_client_id t_inventoryvalue ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id t_inventoryvalue m_product_id m_pricelist_version_id t_inventoryvalue m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id pricelimit currencyconvert pricelimit c_currency_id t_inventoryvalue c_currency_id t_inventoryvalue datevalue t_inventoryvalue ad_client_id t_inventoryvalue ad_org_id m_pricelist m_pricelist_version m_productprice m_product_id t_inventoryvalue m_product_id m_pricelist_version_id t_inventoryvalue m_pricelist_version_id m_pricelist_version_id m_pricelist_version_id m_pricelist_id m_pricelist_id coststandard currencyconvert currentcostprice c_currency_id t_inventoryvalue c_currency_id t_inventoryvalue datevalue t_inventoryvalue ad_client_id t_inventoryvalue ad_org_id ad_clientinfo c_acctschema m_product_costing t_inventoryvalue ad_client_id ad_client_id c_acctschema1_id c_acctschema_id c_acctschema_id c_acctschema_id t_inventoryvalue m_product_id m_product_id t_inventoryvalue m_warehouse_id p_m_warehouse_id executeupdate raiseerror getprices t_inventoryvalue pricepoamt qtyonhand pricelistamt qtyonhand pricelist pricestdamt qtyonhand pricestd pricelimitamt qtyonhand pricelimit coststandardamt qtyonhand coststandard m_warehouse_id p_m_warehouse_id executeupdate raiseerror updatevalue get_trxname private void raise error string string string sql throws exception db rollback false get trxname string msg string value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg raiseerror get_trxname valuenamepair clogger retrieveerror getname compiereusererror constructor derive paper from page foramt param pf page format public c paper page format pf super m landscape pf get orientation page format portrait try to find media size float x float pf get width float y float pf get height media size name msn media size find media x 72 y 72 media size inch media size ms null if msn null msn media size find media y 72 x 72 media size inch flip it if msn null ms media size get media size for name msn set media size ms m landscape set size directly set size pf get width pf get height set imageable area pf get imageablex pf get imageabley pf get imageable width pf get imageable height pageforamt pageformat cpaper pageformat m_landscape getorientation pageformat mediasize getwidth getheight mediasizename mediasize findmedia mediasize mediasize mediasize findmedia mediasize mediasize getmediasizeforname setmediasize m_landscape setsize getwidth getheight setimageablearea getimageablex getimageabley getimageablewidth getimageableheight constructor get media size from default language param landscape true if landscape false if portrait public c paper boolean landscape this language get login language landscape cpaper getloginlanguage constructor get media size from language param language language to derive media size param landscape true if landscape false if portrait private c paper language language boolean landscape this language get media size landscape cpaper getmediasize detail constructor 1 2 inch on all sides param media size media size param landscape true if landscape false if portrait private c paper media size media size boolean landscape this media size landscape 36 36 36 36 mediasize cpaper mediasize mediasize mediasize detail constructor param media size media size param left x in 1 72 inch param top y in 1 72 inch param right right x in 1 72 param bottom bottom y in 1 72 param landscape true if landscape false if portrait public c paper media size media size boolean landscape double left double top double right double bottom super set media size media size landscape set imageable area left top get width left right get height top bottom mediasize cpaper mediasize mediasize setmediasize mediasize setimageablearea getwidth getheight set media size param media size media size param landscape true if landscape false if portrait public void set media size media size media size boolean landscape if media size null throw new illegal argument exception media size is null m mediasize media size m landscape landscape get sise in inch 72 double width m mediasize getx media size inch 72 double height m mediasize gety media size inch 72 set size set size width height log fine media size get media size name m mediasize landscape m landscape mediasize setmediasize mediasize mediasize mediasize illegalargumentexception mediasize m_mediasize mediasize m_landscape m_mediasize mediasize m_mediasize mediasize setsize mediasize getmediasizename m_mediasize m_landscape get media size return media size public media size name get media size name return m mediasize get media size name mediasizename getmediasizename m_mediasize getmediasizename get media size return media size public media size get media size return m mediasize mediasize getmediasize m_mediasize get printable media area return printable area public media printable area get media printable area media printable area area new media printable area float get imageablex 72 float get imageabley 72 float get imageable width 72 float get imageable height 72 media printable area inch log fine c paper get media printable area area to string media printable area inch return area mediaprintablearea getmediaprintablearea mediaprintablearea mediaprintablearea getimageablex getimageabley getimageablewidth getimageableheight mediaprintablearea cpaper getmediaprintablearea tostring mediaprintablearea get printable media area param area printable area public void set media printable area media printable area area int inch media printable area inch log fine area to string inch set imageable area area getx inch 72 area gety inch 72 area get width inch 72 area get height inch 72 setmediaprintablearea mediaprintablearea mediaprintablearea tostring setimageablearea getwidth getheight is landscape return true if landscape public boolean is landscape return m landscape islandscape m_landscape show dialog and set paper param job printer job return true if changed public boolean page setup dialog printer job job print request attribute set prats get print request attribute set page dialog page format pf job page dialog prats set print request attribute set prats return true pagesetupdialog printerjob printrequestattributeset getprintrequestattributeset pageformat pagedialog setprintrequestattributeset return print request attributes return print request attribute set public print request attribute set get print request attribute set print request attribute set pratts new hash print request attribute set media printable area 25 4 25 4 165 1 228 6 mm class javax print attribute standard media printable area pratts add get media printable area orientation requested landscape class javax print attribute standard orientation requested if is landscape pratts add orientation requested landscape else pratts add orientation requested portrait media na legal pratts add get media size name return pratts printrequestattributeset printrequestattributeset getprintrequestattributeset printrequestattributeset hashprintrequestattributeset mediaprintablearea getmediaprintablearea orientationrequested islandscape orientationrequested orientationrequested getmediasizename set print request attributes param prats print request attribute set public void set print request attribute set print request attribute set prats boolean landscape m landscape media size ms m mediasize media printable area area get media printable area attribute atts prats to array for int i 0 i atts length i if atts i instanceof orientation requested orientation requested or orientation requested atts i if or equals orientation requested portrait landscape false else landscape true else if atts i instanceof media size name media size name msn media size name atts i ms media size get media size for name msn else if atts i instanceof media printable area area media printable area atts i else unhandeled system out println atts i get name atts i atts i get category set media size ms landscape set media printable area area printrequestattributeset setprintrequestattributeset printrequestattributeset m_landscape mediasize m_mediasize mediaprintablearea getmediaprintablearea toarray orientationrequested orientationrequested orientationrequested orientationrequested mediasizename mediasizename mediasizename mediasize getmediasizeforname mediaprintablearea mediaprintablearea getname getcategory setmediasize setmediaprintablearea get the page format for the papaer return page format public page format get page format page format pf new page format pf set paper this int orient page format portrait if m landscape orient page format landscape pf set orientation orient return pf pageformat getpageformat pageformat pageformat setpaper pageformat m_landscape pageformat setorientation get string representation return info public string to string string buffer sb new string buffer c paper sb append get width 72 append x append get height 72 append append m landscape landscape portrait append x append get imageablex append y append get imageabley append w append get imageable width append h append get imageable height append return sb to string tostring stringbuffer stringbuffer cpaper getwidth getheight m_landscape getimageablex getimageabley getimageablewidth getimageableheight tostring get nice string representation param ctx context return info public string to string properties ctx string buffer sb new string buffer print media size sb append m mediasize get media size name print dimension string name m mediasize get media size name to string if name starts with iso sb append append m mediasize to string media size inch append append get media printable area to string media printable area inch if name starts with na sb append append m mediasize to string media size mm mm append append get media printable area to string media printable area mm mm print orientation sb append append msg get msg ctx m landscape landscape portrait return sb to string tostring stringbuffer stringbuffer m_mediasize getmediasizename m_mediasize getmediasizename tostring startswith m_mediasize tostring mediasize getmediaprintablearea tostring mediaprintablearea startswith m_mediasize tostring mediasize getmediaprintablearea tostring mediaprintablearea getmsg m_landscape tostring equals param obj compare return true if equal public boolean equals object obj if obj instanceof c paper c paper cp c paper obj if cp is landscape m landscape return false media size is more descriptive if get imageablex cp get imageablex get imageabley cp get imageabley get imageable width cp get imageable width get imageable height cp get imageable height return true return false cpaper cpaper cpaper islandscape m_landscape getimageablex getimageablex getimageabley getimageabley getimageablewidth getimageablewidth getimageableheight getimageableheight get width in 1 72 inch param orientation corrected correct for orientation return width public double get width boolean orientation corrected if orientation corrected m landscape return super get height return super get width orientationcorrected getwidth orientationcorrected orientationcorrected m_landscape getheight getwidth get height in 1 72 inch param orientation corrected correct for orientation return height public double get height boolean orientation corrected if orientation corrected m landscape return super get width return super get height orientationcorrected getheight orientationcorrected orientationcorrected m_landscape getwidth getheight get image y in 1 72 inch param orientation corrected correct for orientation return imagable y public double get imageabley boolean orientation corrected if orientation corrected m landscape return super get imageablex return super get imageabley orientationcorrected getimageabley orientationcorrected orientationcorrected m_landscape getimageablex getimageabley get image x in 1 72 inch param orientation corrected correct for orientation return imagable x public double get imageablex boolean orientation corrected if orientation corrected m landscape return super get imageabley return super get imageablex orientationcorrected getimageablex orientationcorrected orientationcorrected m_landscape getimageabley getimageablex get image height in 1 72 inch param orientation corrected correct for orientation return imagable height public double get imageable height boolean orientation corrected if orientation corrected m landscape return super get imageable width return super get imageable height orientationcorrected getimageableheight orientationcorrected orientationcorrected m_landscape getimageablewidth getimageableheight get image width in 1 72 inch param orientation corrected correct for orientation return imagable width public double get imageable width boolean orientation corrected if orientation corrected m landscape return super get imageable height return super get imageable width orientationcorrected getimageablewidth orientationcorrected orientationcorrected m_landscape getimageableheight getimageablewidth get margin param orientation corrected correct for orientation return margin public insets get margin boolean orientation corrected return new insets int get imageabley orientation corrected top int get imageablex orientation corrected left int get height orientation corrected get imageabley orientation corrected get imageable height orientation corrected bottom int get width orientation corrected get imageablex orientation corrected get imageable width orientation corrected right orientationcorrected getmargin orientationcorrected getimageabley orientationcorrected getimageablex orientationcorrected getheight orientationcorrected getimageabley orientationcorrected getimageableheight orientationcorrected getwidth orientationcorrected getimageablex orientationcorrected getimageablewidth orientationcorrected standard constructor public x r mailtext properties ctx int r mailtext id string trx name super ctx r mailtext id trx name if r mailtext id 0 set is html false set mail text null set name null setr mailtext id 0 x_r_mailtext r_mailtext_id trxname r_mailtext_id trxname r_mailtext_id setishtml setmailtext setname setr_mailtext_id load constructor public x r mailtext properties ctx result set rs string trx name super ctx rs trx name x_r_mailtext resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r mailtext append get id append return sb to string tostring stringbuffer stringbuffer x_r_mailtext get_id tostring set html text has html tags public void set is html boolean is html set value is html new boolean is html setishtml ishtml set_value ishtml ishtml get html text has html tags public boolean is html object oo get value is html if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ishtml get_value ishtml booleanvalue set subject mail header subject public void set mail header string mail header if mail header null mail header length 2000 log warning length 2000 truncated mail header mail header substring 0 1999 set value mail header mail header setmailheader mailheader mailheader mailheader mailheader mailheader set_value mailheader mailheader get subject mail header subject public string get mail header return string get value mail header getmailheader get_value mailheader set mail text text used for mail message public void set mail text string mail text if mail text null throw new illegal argument exception mail text is mandatory if mail text length 2000 log warning length 2000 truncated mail text mail text substring 0 1999 set value mail text mail text setmailtext mailtext mailtext illegalargumentexception mailtext mailtext mailtext mailtext set_value mailtext mailtext get mail text text used for mail message public string get mail text return string get value mail text getmailtext get_value mailtext set mail text 2 optional second text part used for mail message public void set mail text2 string mail text2 if mail text2 null mail text2 length 2000 log warning length 2000 truncated mail text2 mail text2 substring 0 1999 set value mail text2 mail text2 setmailtext2 mailtext2 mailtext2 mailtext2 mailtext2 mailtext2 set_value mailtext2 mailtext2 get mail text 2 optional second text part used for mail message public string get mail text2 return string get value mail text2 getmailtext2 get_value mailtext2 set mail text 3 optional third text part used for mail message public void set mail text3 string mail text3 if mail text3 null mail text3 length 2000 log warning length 2000 truncated mail text3 mail text3 substring 0 1999 set value mail text3 mail text3 setmailtext3 mailtext3 mailtext3 mailtext3 mailtext3 mailtext3 set_value mailtext3 mailtext3 get mail text 3 optional third text part used for mail message public string get mail text3 return string get value mail text3 getmailtext3 get_value mailtext3 set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set mail template text templates for mailings public void setr mailtext id int r mailtext id if r mailtext id 1 throw new illegal argument exception r mailtext id is mandatory set valuenocheck r mailtext id new integer r mailtext id setr_mailtext_id r_mailtext_id r_mailtext_id illegalargumentexception r_mailtext_id set_valuenocheck r_mailtext_id r_mailtext_id get mail template text templates for mailings public int getr mailtext id integer ii integer get value r mailtext id if ii null return 0 return ii int value getr_mailtext_id get_value r_mailtext_id intvalue creates an initially unselected toggle button without setting the text or image public c toggle button this null null false ctogglebutton creates an initially unselected toggle button with the specified image but no text param icon the image that the button should display public c toggle button icon icon this null icon false ctogglebutton creates a toggle button with the specified image and selection state but no text param icon the image that the button should display param selected if true the button is initially selected otherwise the button is initially unselected public c toggle button icon icon boolean selected this null icon selected ctogglebutton creates an unselected toggle button with the specified text param text the string displayed on the toggle button public c toggle button string text this text null false ctogglebutton creates a toggle button with the specified text and selection state param text the string displayed on the toggle button param selected if true the button is initially selected otherwise the button is initially unselected public c toggle button string text boolean selected this text null selected ctogglebutton creates a toggle button where properties are taken from the action supplied param a public c toggle button action a this null null false set action a ctogglebutton setaction creates a toggle button that has the specified text and image and that is initially unselected param text the string displayed on the button param icon the image that the button should display public c toggle button string text icon icon this text icon false ctogglebutton creates a toggle button with the specified text image and selection state param text the text of the toggle button param icon the image that the button should display param selected if true the button is initially selected otherwise the button is initially unselected public c toggle button string text icon icon boolean selected super text icon selected set content area filled false set opaque false set font compiereplaf getfont label set foreground compiereplaf gettextcolor label ctogglebutton setcontentareafilled setopaque setfont getfont_label setforeground gettextcolor_label set background differentiates between system user call if user call sets opaque context area filled to true param bg public void set background color bg if bg equals get background return super set background bg ignore calls from javax swing look and feel install colors look and feel java 61 if trace get caller class 1 starts with javax set opaque true set content area filled true contextareafilled setbackground getbackground setbackground lookandfeel installcolors lookandfeel getcallerclass startswith setopaque setcontentareafilled set background nop param error public void set background boolean error setbackground set standard background public void set background color set background color null setbackgroundcolor setbackgroundcolor set background param bg compiere color for background if null set standard background public void set background color compiere color bg if bg null bg compiere color get default background set opaque true put client property compiereplaf background bg super set background bg get flat color compierecolor setbackgroundcolor compierecolor compierecolor getdefaultbackground setopaque putclientproperty setbackground getflatcolor get background return color for background public compiere color get background color try return compiere color get client property compiereplaf background catch exception e system err println c button client property e get message return null compierecolor getbackgroundcolor compierecolor getclientproperty cbutton clientproperty getmessage set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is enabled rw super set enabled rw setreadwrite isenabled setenabled is it possible to edit return true if editable public boolean is read write return super is enabled isreadwrite isenabled set editor to value param value value of the editor public void set value object value if value null set text else set text value to string setvalue settext settext tostring return editor value return current value public object get value return get text getvalue gettext return display value return displayed string value public string get display return get text getdisplay gettext constructor public v tree cell renderer super vtreecellrenderer get tree cell renderer component sets icon name description for leaves param tree tree param value value param selected selected param expanded expanded param leaf leaf param row row param has focus focus return renderer public component get tree cell renderer component j tree tree object value boolean selected boolean expanded boolean leaf int row boolean has focus v tree cell renderer c v tree cell renderer super get tree cell renderer component tree value selected expanded leaf row has focus if leaf return c we have a leaf m tree node nd m tree node value icon icon nd get icon if icon null c set icon icon c set text nd get name c set tool tip text nd get description if selected c set foreground nd get color return c hasfocus gettreecellrenderercomponent jtree hasfocus vtreecellrenderer vtreecellrenderer gettreecellrenderercomponent hasfocus mtreenode mtreenode geticon seticon settext getname settooltiptext getdescription setforeground getcolor standard constructor public x m forecastline properties ctx int m forecastline id string trx name super ctx m forecastline id trx name if m forecastline id 0 setc period id 0 setm forecastline id 0 setm forecast id 0 setm product id 0 set qty env zero set qty calculated env zero x_m_forecastline m_forecastline_id trxname m_forecastline_id trxname m_forecastline_id setc_period_id setm_forecastline_id setm_forecast_id setm_product_id setqty setqtycalculated load constructor public x m forecastline properties ctx result set rs string trx name super ctx rs trx name x_m_forecastline resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m forecastline append get id append return sb to string tostring stringbuffer stringbuffer x_m_forecastline get_id tostring set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc period id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_period_id set forecast line forecast line public void setm forecastline id int m forecastline id if m forecastline id 1 throw new illegal argument exception m forecastline id is mandatory set valuenocheck m forecastline id new integer m forecastline id setm_forecastline_id m_forecastline_id m_forecastline_id illegalargumentexception m_forecastline_id set_valuenocheck m_forecastline_id m_forecastline_id get forecast line forecast line public int getm forecastline id integer ii integer get value m forecastline id if ii null return 0 return ii int value getm_forecastline_id get_value m_forecastline_id intvalue set forecast material forecast public void setm forecast id int m forecast id if m forecast id 1 throw new illegal argument exception m forecast id is mandatory set valuenocheck m forecast id new integer m forecast id setm_forecast_id m_forecast_id m_forecast_id illegalargumentexception m_forecast_id set_valuenocheck m_forecast_id m_forecast_id get forecast material forecast public int getm forecast id integer ii integer get value m forecast id if ii null return 0 return ii int value getm_forecast_id get_value m_forecast_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set calculated quantity calculated quantity public void set qty calculated big decimal qty calculated if qty calculated null throw new illegal argument exception qty calculated is mandatory set value qty calculated qty calculated setqtycalculated bigdecimal qtycalculated qtycalculated illegalargumentexception qtycalculated set_value qtycalculated qtycalculated get calculated quantity calculated quantity public big decimal get qty calculated big decimal bd big decimal get value qty calculated if bd null return env zero return bd bigdecimal getqtycalculated bigdecimal bigdecimal get_value qtycalculated standard constructor param ctx context param m shipper id id public m shipper properties ctx int m shipper id string trx name super ctx m shipper id trx name m_shipper_id mshipper m_shipper_id trxname m_shipper_id trxname load constructor param ctx context param rs result set public m shipper properties ctx result set rs string trx name super ctx rs trx name mshipper resultset trxname trxname standard constructor param ctx context param c projecttask id id public m project task properties ctx int c projecttask id string trx name super ctx c projecttask id trx name if c projecttask id 0 setc projecttask id 0 pk setc projectphase id 0 parent setc task id 0 fk set seq no 0 set name null set qty env zero c_projecttask_id mprojecttask c_projecttask_id trxname c_projecttask_id trxname c_projecttask_id setc_projecttask_id setc_projectphase_id setc_task_id setseqno setname setqty load constructor param ctx context param rs result set public m project task properties ctx result set rs string trx name super ctx rs trx name mprojecttask resultset trxname trxname parent constructor param phase parent public m project task m project phase phase this phase get ctx 0 phase get trxname set client org phase setc projectphase id phase getc projectphase id mprojecttask mprojectphase getctx get_trxname setclientorg setc_projectphase_id getc_projectphase_id copy constructor param phase parent param task type copy public m project task m project phase phase m project type task task this phase setc task id task getc task id fk set seq no task get seq no set name task get name set description task get description set help task get help if task getm product id 0 setm product id task getm product id set qty task get standard qty mprojecttask mprojectphase mprojecttypetask setc_task_id getc_task_id setseqno getseqno setname getname setdescription getdescription sethelp gethelp getm_product_id setm_product_id getm_product_id setqty getstandardqty prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals r request id p r request id para i get parameter as int else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter r_request_id p_r_request_id getparameterasint process it return message throws exception protected string do it throws exception m request request new m request get ctx p r request id get trxname log info request to string if request get id 0 throw new compiere user error not found r request id p r request id request setr status id set default status request set processed false if request save request is processed return ok return error doit mrequest mrequest getctx p_r_request_id get_trxname tostring get_id compiereusererror notfound r_request_id p_r_request_id setr_status_id setprocessed isprocessed create and report issue param record log record return reported issue or null public static m issue create log record record s log config record get message m system system m system get env get ctx if db is connected system is auto error report return null m issue issue new m issue record string error issue report issue save if error null return null return issue missue logrecord s_log getmessage msystem msystem getctx isconnected isautoerrorreport missue missue create from decoded hash map string param ctx context param hex input hex string return issue suppress warnings unchecked public static m issue create properties ctx string hex input hash map hm in null try encode in report byte byte array secure convert hex string hex input byte array input stream b in new byte array input stream byte array object input stream o in new object input stream b in hm in hash map o in read object catch exception e s log log level severe e return null m issue issue new m issue ctx hash map string string hm in return issue hexinput suppresswarnings missue hexinput hashmap hmin bytearray converthexstring hexinput bytearrayinputstream bin bytearrayinputstream bytearray objectinputstream oin objectinputstream bin hmin hashmap oin readobject s_log missue missue hashmap hmin standard constructor param ctx context param ad issue id issue param trx name transaction public m issue properties ctx int ad issue id string trx name super ctx ad issue id trx name if ad issue id 0 set processed false n set system status systemstatus evaluation try init ctx catch exception e e get stack trace ad_issue_id trxname missue ad_issue_id trxname ad_issue_id trxname ad_issue_id setprocessed setsystemstatus systemstatus_evaluation getstacktrace load constructor param ctx context param rs result set param trx name trx public m issue properties ctx result set rs string trx name super ctx rs trx name trxname missue resultset trxname trxname log record constructor param record public m issue log record record this env get ctx 0 null string summary record get message set source class name record get source class name set source method name record get source method name set logger name record get logger name throwable t record get thrown if t null if summary null summary length 0 summary t to string summary if summary null summary length 0 summary t to string string buffer error new string buffer stack trace element tes t get stack trace int count 0 for int i 0 i tes length i stack trace element element tes i string s element to string if s index of adempiere 1 error append s append n if count 0 string source element get class name element get method name set source class name source set line no element get line number count if count 5 error length 2000 break set error trace error to string stack char array writer c writer new char array writer print writer p writer new print writer c writer t print stack trace p writer set stack trace c writer to string if summary null summary length 0 summary set issue summary summary setrecord id 1 missue logrecord getctx getmessage setsourceclassname getsourceclassname setsourcemethodname getsourcemethodname setloggername getloggername getthrown tostring tostring stringbuffer stringbuffer stacktraceelement getstacktrace stacktraceelement tostring indexof getclassname getmethodname setsourceclassname setlineno getlinenumber seterrortrace tostring chararraywriter cwriter chararraywriter printwriter pwriter printwriter cwriter printstacktrace pwriter setstacktrace cwriter tostring setissuesummary setrecord_id hash map constructor param ctx context param hm in hash map public m issue properties ctx hash map string string hm in super ctx 0 null load hm in setrecord id 0 hashmap hmin missue hashmap hmin hmin setrecord_id initialize private void init properties ctx throws exception m system system m system get ctx set name system get name set user name system get user name setdb address system getdb address set system status system get system status set release no system get release no db set version compiere date version code set database info db get database info set operating system info compiere getos info set java info compiere get java info set release tag compiere get implementation version setlocal host inet address get local host to string if system is allow statistics set statistics info system get statistics info true set profile info system get profile info true msystem msystem setname getname setusername getusername setdbaddress getdbaddress setsystemstatus getsystemstatus setreleaseno getreleaseno setversion date_version setdatabaseinfo getdatabaseinfo setoperatingsysteminfo getosinfo setjavainfo getjavainfo setreleasetag getimplementationversion setlocal_host inetaddress getlocalhost tostring isallowstatistics setstatisticsinfo getstatisticsinfo setprofileinfo getprofileinfo set issue summary truncate it to 2000 char param issue summary summary public void set issue summary string issue summary if issue summary null return issue summary issue summary replace java lang issue summary issue summary replace java sql if issue summary length infolength issue summary issue summary substring 0 infolength 1 super set issue summary issue summary issuesummary setissuesummary issuesummary issuesummary issuesummary issuesummary issuesummary issuesummary issuesummary issuesummary issuesummary setissuesummary issuesummary set stack trace truncate it to 2000 char param stack trace trace public void set stack trace string stack trace if stack trace null return stack trace stack trace replace java lang stack trace stack trace replace java sql if stack trace length infolength stack trace stack trace substring 0 infolength 1 super set stack trace stack trace stacktrace setstacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace setstacktrace stacktrace set error trace truncate it to 2000 char param error trace trace public void set error trace string error trace if error trace null return error trace error trace replace java lang error trace error trace replace java sql if error trace length infolength error trace error trace substring 0 infolength 1 super set error trace error trace errortrace seterrortrace errortrace errortrace errortrace errortrace errortrace errortrace errortrace errortrace errortrace seterrortrace errortrace add comments param comments public void add comments string comments if comments null comments length 0 return string old get comments if old null old length 0 set comments comments else if old equals comments old index of comments 1 something new set comments comments old addcomments getcomments setcomments indexof setcomments set comments truncate it to 2000 char param comments public void set comments string comments if comments null return if comments length infolength comments comments substring 0 infolength 1 super set comments comments setcomments setcomments set response text truncate it to 2000 char param response text public void set response text string response text if response text null return if response text length infolength response text response text substring 0 infolength 1 super set response text response text responsetext responsetext setresponsetext responsetext responsetext responsetext responsetext responsetext setresponsetext responsetext process request return answer public string process m issue project get this sets also asset m issue system get this m issue user get this setr issueknown id 0 setr request id 0 return create answer missueproject missuesystem missueuser setr_issueknown_id setr_request_id createanswer create answer to send to user return answer public string create answer string buffer sb new string buffer if geta asset id 0 sb append sign up for support at http www compiere org to receive answers else if getr issueknown id 0 sb append known issue n if getr request id 0 sb append request append get request get document no append n return sb to string createanswer stringbuffer stringbuffer geta_asset_id getr_issueknown_id getr_request_id getrequest getdocumentno tostring get request return request or null public x r request get request if getr request id 0 return null return new x r request get ctx getr request id null x_r_request getrequest getr_request_id x_r_request getctx getr_request_id get request document no return request document no public string get request document no if getr request id 0 return x r request r get request return r get document no getrequestdocumentno getr_request_id x_r_request getrequest getdocumentno get system status return system status public string get system status string s super get system status if s null s length 0 s systemstatus evaluation return s getsystemstatus getsystemstatus systemstatus_evaluation report update issue return error message public string report string buffer parameter new string buffer if getrecord id 0 don t report return id 0 if getrecord id 1 new parameter append issue hash map ht out get hashmap try deserializing in create byte array output stream b out new byte array output stream object output o out new object output stream b out o out write object ht out o out flush string hex string secure convert to hex string b out to byte array parameter append hex string catch exception e log severe e get localized message return new e get localized message else existing try parameter append recordid append getrecord id parameter append dbaddress append url encoder encode getdb address utf 8 parameter append comments append url encoder encode get comments utf 8 catch exception e log severe e get localized message return update e get localized message input stream reader in null string target http dev1 wstore issue report servlet try send get request string buffer url string new string buffer target append parameter url url new url url string to string url connection uc url open connection in new input stream reader uc get input stream catch exception e string msg cannot connect to http target if e instanceof file not found exception e instanceof connect exception msg n server temporarily down please try again later else msg n check connection e get localized message log log level fine msg return msg return read response in stringbuffer stringbuffer getrecord_id getrecord_id hashmap htout get_hashmap bytearrayoutputstream bout bytearrayoutputstream objectoutput oout objectoutputstream bout oout writeobject htout oout hexstring converttohexstring bout tobytearray hexstring getlocalizedmessage getlocalizedmessage getrecord_id urlencoder getdbaddress urlencoder getcomments getlocalizedmessage getlocalizedmessage inputstreamreader issuereportservlet stringbuffer urlstring stringbuffer urlstring tostring urlconnection openconnection inputstreamreader getinputstream filenotfoundexception connectexception nserver ncheck getlocalizedmessage readresponse read response param in input stream return error message private string read response input stream reader in string buffer sb new string buffer int record id 0 string response text null string request document no null try get answer int c while c in read 1 sb append char c in close log fine sb to string string clear url decoder decode sb to string utf 8 log fine clear interpret data string tokenizer st new string tokenizer clear delimiter while st has more elements string pair st next token try int index pair index of if pair starts with recordid string info pair substring index 1 record id integer parse int info else if pair starts with response response text pair substring index 1 else if pair starts with documentno request document no pair substring index 1 catch exception e log warning pair e get message catch exception ex log log level fine ex return reading ex get localized message if record id 0 setrecord id record id if response text null set response text response text if request document no null set request document no request document no return null readresponse inputstreamreader stringbuffer stringbuffer record_id responsetext requestdocumentno tostring urldecoder tostring stringtokenizer stringtokenizer hasmoreelements nexttoken indexof startswith record_id parseint startswith responsetext startswith requestdocumentno getmessage getlocalizedmessage record_id setrecord_id record_id responsetext setresponsetext responsetext requestdocumentno setrequestdocumentno requestdocumentno string representation return info public string to string string buffer sb new string buffer m issue sb append get id append append get issue summary append record append getrecord id append return sb to string tostring stringbuffer stringbuffer missue get_id getissuesummary getrecord_id tostring get caller array param caller optional thowable exception param max nest level maximum call nesting level 0 is all return array of class method file line public static string get caller classes throwable caller int max nest level int nest level max nest level if nest level 1 nest level 99 array list string list new array list string throwable t caller if t null t new throwable stack trace element elements t get stack trace for int i 0 i elements length list size max nest level i string class name elements i get class name system out println list size class name if class name starts with org compiere util trace class name starts with java lang throwable list add class name string ret value new string list size list to array ret value return ret value maxnestlevel getcallerclasses maxnestlevel nestlevel maxnestlevel nestlevel nestlevel arraylist arraylist stacktraceelement getstacktrace maxnestlevel classname getclassname classname classname startswith classname startswith classname retvalue toarray retvalue retvalue get caller with nest level param nest level nesting level 0 calling method 1 previous return class name and line info of nesting level or if not exist public static string get caller class int nest level string array get caller classes null nest level if array length nest level return return array nest level nestlevel getcallerclass nestlevel getcallerclasses nestlevel nestlevel nestlevel is the caller called from the class mentioned param class name calling class return the caller was called from class name public static boolean is called from string class name if class name null class name length 0 return false return get caller class 1 index of class name 1 classname classname iscalledfrom classname classname classname getcallerclass indexof classname print stack tace info raw compiere only first9only public static void print stack print stack true true compiereonly printstack printstack print stack tace info raw public static void print stack boolean compiere only boolean first9only throwable t new throwable t print stack trace int counter 0 stack trace element elements t get stack trace for int i 1 i elements length i if elements i get class name index of util trace 1 continue if compiere only compiere only elements i get class name starts with org compiere logger global fine i elements i if first9only counter 8 break printstack compiereonly printstacktrace stacktraceelement getstacktrace getclassname indexof compiereonly compiereonly getclassname startswith initialize global variables param config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w window init servletexception servletconfig servletexception webenv initweb servletexception wwindow get servlet information return info public string get servlet info return w login web window getservletinfo wlogin clean up resources public void destroy log fine destroy process the http get request initial call br http localhost adempiere w window ad window id 123 br create window with request parameters ad window id ad menu id clean up old existing window param request param response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception get session attributes http session sess request get session web session ctx wsc web session ctx get request if wsc null web util create timeout page request response this null return parameter ad window id int ad window id web util get parameter as int request ad window id get parameter menu id int ad menu id web util get parameter as int request ad menu id log info ad window id ad window id ad menu id ad menu id clean up old window w window status ws w window status get request if ws null int window no ws m window get window no log fine disposing window no window no id ws m window getad window id ws m window dispose env clear win context wsc ctx window no new window data m windowvo m windowvo m windowvo create wsc ctx s windowno ad window id ad menu id if m windowvo null string msg msg translate wsc ctx ad window id msg get msg wsc ctx not found id ad window id ad menu id web util create error page request response this msg sess set attribute w window status name null return create new window ws new w window status m windowvo sess set attribute w window status name ws query ws cur tab query ws m window is transaction ws cur tab navigate 0 build page web doc doc null if ws cur tab is single row doc getsr form request get requesturi wsc ws else doc getmr form request get requesturi wsc ws fini log fine fini log trace log l6 database doc to string web util create response request response this null doc true log fine closed wwindow ad_window_id ad_window_id ad_menu_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception httpsession getsession websessionctx websessionctx webutil createtimeoutpage ad_window_id ad_window_id webutil getparameterasint ad_window_id menu_id ad_menu_id webutil getparameterasint ad_menu_id ad_window_id ad_window_id ad_menu_id ad_menu_id wwindowstatus wwindowstatus windowno mwindow getwindowno windowno windowno mwindow getad_window_id mwindow clearwincontext windowno mwindowvo mwindowvo mwindowvo s_windowno ad_window_id ad_menu_id mwindowvo ad_window_id getmsg notfound ad_window_id ad_menu_id webutil createerrorpage setattribute wwindowstatus wwindowstatus mwindowvo setattribute wwindowstatus curtab mwindow istransaction curtab webdoc curtab issinglerow getsr_form getrequesturi getmr_form getrequesturi l6_database tostring webutil createresponse process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception web env dump request get session info web session ctx wsc web session ctx get request w window status ws w window status get request if wsc null ws null if wsc null web util create timeout page request response this no context else do get request response return get parameter command string p cmd web util get parameter request p command string column web util get parameter request p changedcolumn log info cmd p cmd changed column column changed column if column null column length 0 update fields request wsc ws else exit commands if p cmd equals exit m session c session m session get wsc ctx false if c session null c session logout web util create login page request response this ws ctx exit return execute command request p cmd wsc ws build page web doc doc null create simgle multi row if ws cur tab is single row doc getsr form request get requesturi wsc ws else doc getmr form request get requesturi wsc ws log fine fini log trace log l6 database doc to string web util create response request response this null doc true log fine closed servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception webenv websessionctx websessionctx wwindowstatus wwindowstatus webutil createtimeoutpage doget p_cmd webutil getparameter p_command webutil getparameter p_changedcolumn p_cmd changedcolumn updatefields p_cmd msession csession msession csession csession webutil createloginpage executecommand p_cmd webdoc curtab issinglerow getsr_form getrequesturi getmr_form getrequesturi l6_database tostring webutil createresponse execute command param request request param p cmd command param wsc session context param ws window status private void execute command http servlet request request string p cmd web session ctx wsc w window status ws get parameter command and tab changes string p tab web util get parameter request p tab string p row web util get parameter request p mr rowno mr row command log config p cmd tab p tab row p row multi row selection i e display single row if p row null p row length 0 try int new row no integer parse int p row ws cur tab navigate new row no ws cur tab set single row true catch exception e log log level severe parse row no p row e tab change else if p tab null p tab length 0 int new tab no 0 try new tab no integer parse int p tab catch exception e log log level severe parse tab no p tab e move to detail if new tab no ws cur tab get tab no ws cur tab ws m window get tab new tab no ws cur tab query false ws cur tab navigate 0 move back else if new tab no ws cur tab get tab no ws cur tab ws m window get tab new tab no ws cur tab data refresh multi row toggle else if p cmd equals multi boolean single ws cur tab is single row ws cur tab set single row single if single ws cur tab navigate 0 position commands else if p cmd equals first ws cur tab navigate 0 else if p cmd equals next ws cur tab navigate relative 1 multi row is positioned at last displayed row else if p cmd equals previous int rows ws cur tab is single row 1 2 max lines ws cur tab navigate relative rows else if p cmd equals last ws cur tab navigate relative 999999 find else if p cmd equals find todo find refresh else if p cmd equals refresh ws cur tab data refresh all attachment else if p cmd equals attachment todo attachment history else if p cmd equals history if ws m window is transaction ws cur tab get window no 0 ws cur tab query ws cur tab is only current rows ws cur tab navigate 0 report else if p cmd equals report todo report print else if p cmd equals print todo print new else if p cmd equals new if ws cur tab data new false ws cur tab data ignore delete else if p cmd equals delete ws cur tab data delete save check for changed values else if p cmd equals save execute save request wsc ws p_cmd executecommand httpservletrequest p_cmd websessionctx wwindowstatus p_tab webutil getparameter p_tab p_row webutil getparameter p_mr_rowno p_cmd p_tab p_row p_row p_row newrowno parseint p_row curtab newrowno curtab setsinglerow rowno p_row p_tab p_tab newtabno newtabno parseint p_tab tabno p_tab newtabno curtab gettabno curtab mwindow gettab newtabno curtab curtab newtabno curtab gettabno curtab mwindow gettab newtabno curtab datarefresh p_cmd curtab issinglerow curtab setsinglerow curtab p_cmd curtab p_cmd curtab navigaterelative p_cmd curtab issinglerow max_lines curtab navigaterelative p_cmd curtab navigaterelative p_cmd p_cmd curtab datarefreshall p_cmd p_cmd mwindow istransaction curtab getwindowno curtab curtab isonlycurrentrows curtab p_cmd p_cmd p_cmd curtab datanew curtab dataignore p_cmd curtab datadelete p_cmd executesave execute save param request request param ws private void execute save http servlet request request web session ctx wsc w window status ws log info boolean error update fields request wsc ws check mandatory log fine mandatory check int size ws cur tab get field count for int i 0 i size i m field field ws cur tab get field i if field is mandatory true context check object value field get value if value null value to string length 0 field set inserting true set editable otherwise deadlock field set error true field set error value value null null value to string if error error true log info mandatory error field get column name else field set error false if error return save it of errors ignore changes if ws cur tab data save true ws cur tab data ignore log fine done executesave httpservletrequest websessionctx wwindowstatus updatefields curtab getfieldcount mfield curtab getfield ismandatory getvalue tostring setinserting seterror seterrorvalue tostring getcolumnname seterror curtab datasave curtab dataignore update field values from parameter param request request param wsc session context param ws window status return true if error private boolean update fields http servlet request request web session ctx wsc w window status ws boolean error false try string enc request get character encoding if enc null request set character encoding web env encoding catch exception e log log level severe set character endocung web env encoding e loop through parameters enumeration en request get parameter names while en has more elements string key string en next element ignore hidden commands if key equals p command key equals p changedcolumn key equals p mr rowno key equals p tab continue m field m field ws cur tab get field key log fine execute save key key m field we found a writable field if m field null m field is editable true string value web util get parameter request key object db value m field get value boolean field error false string column name m field get column name log finest column name db value null null db value to string value null null value to string same both null if db value null value null continue new value null else if db value null value null ws cur tab set value m field null from null to new value else if db value null value null field error set field value wsc ws m field value same else if db value equals value continue else field error set field value wsc ws m field value if error field error log info error m field get column name error true for all parameteres re do changed column to overwrite string column name web util get parameter request p changedcolumn if column name null column name length 0 m field m field ws cur tab get field column name if m field null string value web util get parameter request column name object new value get field value wsc m field value if error equals new value de selected check boxes are null if new value null m field get display type display type yes no new value n log fine changed column column name new value ws cur tab set value m field new value return error updatefields httpservletrequest websessionctx wwindowstatus getcharacterencoding setcharacterencoding webenv characterendocung webenv getparameternames hasmoreelements nextelement p_command p_changedcolumn p_mr_rowno p_tab mfield mfield curtab getfield executesave mfield mfield mfield iseditable webutil getparameter dbvalue mfield getvalue fielderror columnname mfield getcolumnname columnname dbvalue dbvalue tostring tostring dbvalue dbvalue curtab setvalue mfield dbvalue fielderror setfieldvalue mfield dbvalue fielderror setfieldvalue mfield fielderror mfield getcolumnname columnname webutil getparameter p_changedcolumn columnname columnname mfield mfield curtab getfield columnname mfield webutil getparameter columnname newvalue getfieldvalue mfield newvalue newvalue mfield getdisplaytype displaytype yesno newvalue changedcolumn columnname newvalue curtab setvalue mfield newvalue set field value param wsc web session param ws window status param m field field param value as string return true if correct private boolean set field value web session ctx wsc w window status ws m field m field string value object new value get field value wsc m field value if error equals new value m field set error value value return false object db value m field get value if new value null db value null new value null new value equals db value ws cur tab set value m field new value return true mfield setfieldvalue websessionctx wwindowstatus mfield mfield newvalue getfieldvalue mfield newvalue mfield seterrorvalue dbvalue mfield getvalue newvalue dbvalue newvalue newvalue dbvalue curtab setvalue mfield newvalue get field value convert value to datatype of m field param wsc session context param m field field param value string value return converted field value private object get field value web session ctx wsc m field m field string value if value null value length 0 return null int dt m field get display type string column name m field get column name big decimal if display type is numeric dt big decimal bd null try number nn null if dt display type amount nn wsc amount format parse value else if dt display type quantity nn wsc quantity format parse value else display type cost price nn wsc number format parse value if nn instanceof big decimal bd big decimal nn else bd new big decimal nn to string catch exception e log warning big decimal column name value error return error log fine big decimal column name value bd return bd id else if display type isid dt integer ii null try ii new integer value catch exception e log log level warning id column name value e ii null 1 indicates null if ii int value 1 ii null log fine id column name value ii return ii date time else if display type is date dt timestamp ts null try java util date d null if dt display type date d wsc date format parse value else d wsc date time format parse value ts new timestamp d get time catch exception e log warning date column name value error return error log fine date column name value ts return ts checkbox else if dt display type yes no boolean ret value boolean false if value equals true ret value boolean true log fine yes no column name value ret value return ret value treat as string log fine column name value return value mfield mfield getfieldvalue websessionctx mfield mfield mfield getdisplaytype columnname mfield getcolumnname bigdecimal displaytype isnumeric bigdecimal displaytype amountformat displaytype quantityformat displaytype costprice numberformat bigdecimal bigdecimal bigdecimal tostring bigdecimal columnname bigdecimal columnname displaytype columnname intvalue columnname displaytype isdate displaytype dateformat datetimeformat gettime columnname columnname displaytype yesno retvalue retvalue yesno columnname retvalue retvalue columnname return single row form details param action action param wsc web session context param ws window status return form private web doc getsr form string action web session ctx wsc w window status ws log fine tab ws cur tab get tab no for all fields table table new table set align align type center table set border 1 set border color 00ff00 debug field lines string buffer script src new string buffer tr line new tr if ws cur tab is displayed int no fields ws cur tab get field count for int i 0 i no fields i m field field ws cur tab get field i string column name field get column name get data and convert to string single row object o data ws cur tab get value field display field if field is displayed true if field is same line line new tr boolean has dependents ws cur tab has dependants column name add field wsc line field o data has dependents table add element line additional values string disp logic field get display logic if disp logic null disp logic length 0 disp logic disp logic replace replace with script src append document append form name append append column name append display logic append disp logic append n for all fields displayed if script src length 0 table add element new script script src to string status line int row no ws cur tab get current row string statusdb string value of row no 1 ws cur tab get row count return create layout action table wsc ws statusdb singlerow webdoc getsr_form websessionctx wwindowstatus curtab gettabno setalign aligntype setborder setbordercolor stringbuffer scriptsrc stringbuffer curtab isdisplayed nofields curtab getfieldcount nofields mfield curtab getfield columnname getcolumnname singlerow odata curtab getvalue isdisplayed issameline hasdependents curtab hasdependants columnname addfield odata hasdependents addelement displogic getdisplaylogic displogic displogic displogic displogic scriptsrc form_name columnname displaylogic displogic scriptsrc addelement scriptsrc tostring rowno curtab getcurrentrow valueof rowno curtab getrowcount createlayout return multi row form details param action action param wsc session context param ws window status return form private web doc getmr form string action web session ctx wsc w window status ws log fine tab ws cur tab get tab no int init row no ws cur tab get current row table header table table new table set align align type center table set class multi row table set border 1 table set cell spacing 1 tr line new tr first column line add element new th add element tab not displayed if ws cur tab is displayed return create layout action table wsc ws int no fields ws cur tab get field count for all header columns for int col no 0 col no no fields col no m field field ws cur tab get field col no if field is displayed false th th new th th add element field get header name th set abbr field get description description line add element th for all columns table add element new thead add element line table lines int last row init row no max lines last row math min last row ws cur tab get row count for int line no init row no line no last row line no row ws cur tab navigate line no line new tr selector button selector new button selector add element gt displays selector set on click document form name p mr rowno value line no submit line add element new td add element selector for all columns for int col no 0 col no no fields col no td td new td m field field ws cur tab get field col no if field is displayed false continue get data turn to string object data ws cur tab get value field get column name string info null if data null info else int dt field get display type switch dt case display type date info wsc date format format data td set align right break case display type date time info wsc date time format format data td set align right break case display type amount info wsc amount format format data td set align right break case display type number case display type cost price info wsc number format format data td set align right break case display type quantity info wsc quantity format format data td set align right break case display type integer info wsc integer format format data td set align right break case display type yes no info msg get msg ws ctx data to string break todo output formatting 2 default if display type is lookup dt info field get lookup get display data else info data to string empty info if info null info length 0 info nbsp space td add element info line add element td for all columns table add element line for all table lines status line string statusdb string value of init row no 1 string value of last row ws cur tab get row count return create layout action table wsc ws statusdb multirow webdoc getmr_form websessionctx wwindowstatus curtab gettabno initrowno curtab getcurrentrow setalign aligntype setclass multirow setborder setcellspacing addelement addelement curtab isdisplayed createlayout nofields curtab getfieldcount colno colno nofields colno mfield curtab getfield colno isdisplayed addelement getheader setabbr getdescription addelement addelement addelement lastrow initrowno max_lines lastrow lastrow curtab getrowcount lineno initrowno lineno lastrow lineno curtab lineno addelement setonclick form_name p_mr_rowno lineno addelement addelement colno colno nofields colno mfield curtab getfield colno isdisplayed curtab getvalue getcolumnname getdisplaytype displaytype dateformat setalign displaytype datetime datetimeformat setalign displaytype amountformat setalign displaytype displaytype costprice numberformat setalign displaytype quantityformat setalign displaytype integerformat setalign displaytype yesno getmsg tostring displaytype islookup getlookup getdisplay tostring addelement addelement addelement valueof initrowno valueof lastrow curtab getrowcount createlayout create window layout param action form action param content table content table param wsc web session context param ws window status param status info status line info param statusdb status db info return form private static web doc create layout string action table content table web session ctx wsc w window status ws string status info string statusdb form my form null my form new form action my form set target web env target window my form setid w window ws m window getad window id string ad language env getad language ws ctx window my form set name form name my form add element new input hidden p command button commands my form add element new input hidden p mr rowno row no my form add element new input hidden p changedcolumn set title of main window string title ws m window get name wsc login info my form add element new script top document title title buttons td toolbar new td null align type left align type middle true toolbar toolbar add element create image ad language ignore reset true false toolbar add element nbsp toolbar add element create image ad language help start popup w help ad window id ws m window getad window id true false toolbar add element create image ad language new toolbar add element create image ad language delete if confirm delete text submit true false toolbar add element create image ad language save toolbar add element nbsp toolbar add element create image ad language find toolbar add element create image ad language refresh toolbar add element create image ad language attachment start popup w attachment ws cur tab can have attachment ws cur tab has attachment toolbar add element create image ad language multi null true ws cur tab is single row toolbar add element nbsp toolbar add element create image ad language history null ws m window is transaction ws cur tab get tab no 0 ws cur tab is only current rows toolbar add element nbsp boolean is first ws cur tab get current row 1 toolbar add element create image ad language first null is first false toolbar add element create image ad language previous null is first false boolean is last ws cur tab get current row 1 ws cur tab get row count toolbar add element create image ad language next null is last false toolbar add element create image ad language last null is last false toolbar add element nbsp toolbar add element create image ad language report toolbar add element create image ad language print toolbar add element nbsp toolbar add element create image ad language exit tabs td tabbar new td window center align type left align type middle false tabbar add element new input input type hidden p tab for int i 0 i ws m window get tab count i m tab tab ws m window get tab i if tab is sort tab continue big big new big tab get name if ws cur tab get tab no i big setid tab selected css else big setid tab css big set on click alert tab get name big set on click document form name p tab value i submit status description if tab get description length 0 big set on mouse over status tab get description return true tabbar add element big top table table top table new table 0 0 5 100 null top table setid w window top table top table add element new tr toolbar top table add element new tr tabbar my form add element top table fields my form add element content table status line table status table new table 0 0 0 100 null top table setid w window status line tr status line new tr status line add element new td set width 85 set align align type left add element status info status line add element new td set width 10 set align align type right add element new small statusdb status line add element new td set width 5 set align align type right add element create image ad language save status table add element status line set class window center my form add element status table fini todo dynamic display my form add element new script dyn display createw cmd initial display set cmd window web doc doc create page ws main table doc get table add element new tr add element new td null align type center align type middle true my form set col span 2 return doc contenttable statusinfo webdoc createlayout contenttable websessionctx wwindowstatus statusinfo myform myform myform settarget webenv target_window myform wwindow mwindow getad_window_id ad_language getad_language myform setname form_name myform addelement p_command myform addelement p_mr_rowno rowno myform addelement p_changedcolumn mwindow getname logininfo myform addelement aligntype aligntype addelement createimage ad_language addelement addelement createimage ad_language startpopup whelp ad_window_id mwindow getad_window_id addelement createimage ad_language addelement createimage ad_language deletetext addelement createimage ad_language addelement addelement createimage ad_language addelement createimage ad_language addelement createimage ad_language startpopup wattachment curtab canhaveattachment curtab hasattachment addelement createimage ad_language curtab issinglerow addelement addelement createimage ad_language mwindow istransaction curtab gettabno curtab isonlycurrentrows addelement isfirst curtab getcurrentrow addelement createimage ad_language isfirst addelement createimage ad_language isfirst islast curtab getcurrentrow curtab getrowcount addelement createimage ad_language islast addelement createimage ad_language islast addelement addelement createimage ad_language addelement createimage ad_language addelement addelement createimage ad_language windowcenter aligntype aligntype addelement type_hidden p_tab mwindow gettabcount mtab mwindow gettab issorttab getname curtab gettabno tabselected setonclick getname setonclick form_name p_tab getdescription setonmouseover getdescription addelement toptable toptable wwindow toptable toptable addelement toptable addelement myform addelement toptable myform addelement contenttable statustable toptable wwindow statusline statusline statusline addelement setwidth setalign aligntype addelement statusinfo statusline addelement setwidth setalign aligntype addelement statusline addelement setwidth setalign aligntype addelement createimage ad_language statustable addelement statusline setclass windowcenter myform addelement statustable myform addelement dyndisplay createwcmd webdoc createpage gettable addelement addelement aligntype aligntype myform setcolspan create page set header param ws status return w doc page private static web doc create page w window status ws web doc doc web doc create window ws m window get name set variables doc get body add element new script delete text msg get msg ws ctx delete record return doc wdoc webdoc createpage wwindowstatus webdoc webdoc createwindow mwindow getname getbody addelement deletetext getmsg deleterecord create image with name id of button name and set p command on click param ad language param name name of the image used also for name24 gif param js command java script command null results in submit an empty string disables on click param enabled enable the immage button if not uses the d image param pressed if true use the x image return image private static img create image string ad language string name string js command boolean enabled boolean pressed string buffer img name new string buffer name if enabled img name append d else if pressed img name append x img name append 24 gif img img new img web env get image directory img name to string name if enabled img set alt msg get msg ad language name translate tool tip if pressed enabled img setid img button css else img setid img button pressed css if js command null js command submit if js command length 0 enabled img set on click document form name p command value name js command return img button_name p_command onclick ad_language js_command onclick createimage ad_language js_command stringbuffer imgname stringbuffer imgname imgname imgname webenv getimagedirectory imgname tostring setalt getmsg ad_language tooltip imgbutton imgbuttonpressed js_command js_command js_command setonclick form_name p_command js_command create enabled image with name id of button name and sumbit command param ad language param name name of the image used also for name24 gif return image private static img create image string ad language string name return create image ad language name null true false button_name ad_language createimage ad_language createimage ad_language add field to line param wsc session context param line format element param field field param o data original data param has dependents has callout function s private void add field web session ctx wsc tr line m field field object o data boolean has dependents string column name field get column name any error boolean error field is error value if error o data field get error value int dt field get display type boolean has callout field get callout length 0 html label element id id columnname html input elements name column name id id columnname web field w field new web field wsc column name field get header field get description dt field get field length field get display length field is long field read only context check mandatory no context check field is editable true field is mandatory false error has dependents has callout line add element w field get label add element w field get field field get lookup o data odata hasdependents addfield websessionctx mfield odata hasdependents columnname getcolumnname iserrorvalue odata geterrorvalue getdisplaytype hascallout getcallout id_columnname columnname id_columnname webfield wfield webfield columnname getheader getdescription getfieldlength getdisplaylength islongfield readonly iseditable ismandatory hasdependents hascallout addelement wfield getlabel addelement wfield getfield getlookup odata standard constructor public x m productionline properties ctx int m productionline id string trx name super ctx m productionline id trx name if m productionline id 0 set line 0 sql select nvl max line 0 10 as default value from m productionline where m productionplan id m productionplan id setm attributesetinstance id 0 setm locator id 0 m locator id setm product id 0 setm productionline id 0 setm productionplan id 0 set movement qty env zero set processed false x_m_productionline m_productionline_id trxname m_productionline_id trxname m_productionline_id setline defaultvalue m_productionline m_productionplan_id m_productionplan_id setm_attributesetinstance_id setm_locator_id m_locator_id setm_product_id setm_productionline_id setm_productionplan_id setmovementqty setprocessed load constructor public x m productionline properties ctx result set rs string trx name super ctx rs trx name x_m_productionline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productionline append get id append return sb to string tostring stringbuffer stringbuffer x_m_productionline get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set production line document line representing a production public void setm productionline id int m productionline id if m productionline id 1 throw new illegal argument exception m productionline id is mandatory set valuenocheck m productionline id new integer m productionline id setm_productionline_id m_productionline_id m_productionline_id illegalargumentexception m_productionline_id set_valuenocheck m_productionline_id m_productionline_id get production line document line representing a production public int getm productionline id integer ii integer get value m productionline id if ii null return 0 return ii int value getm_productionline_id get_value m_productionline_id intvalue set production plan plan for how a product is produced public void setm productionplan id int m productionplan id if m productionplan id 1 throw new illegal argument exception m productionplan id is mandatory set valuenocheck m productionplan id new integer m productionplan id setm_productionplan_id m_productionplan_id m_productionplan_id illegalargumentexception m_productionplan_id set_valuenocheck m_productionplan_id m_productionplan_id get production plan plan for how a product is produced public int getm productionplan id integer ii integer get value m productionplan id if ii null return 0 return ii int value getm_productionplan_id get_value m_productionplan_id intvalue set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue public constructor use static get methods param ctx context param ad printformat id ad printformat id public m print format properties ctx int ad printformat id string trx name super ctx ad printformat id trx name language deutsch locale de de ad language en us date pattern dd mm yyyy decimal point false m language language get login language if ad printformat id 0 set standard header footer true set is table based true set is form false set is default false m items get items ad_printformat_id ad_printformat_id mprintformat ad_printformat_id trxname ad_printformat_id trxname de_de ad_language en_us datepattern decimalpoint m_language getloginlanguage ad_printformat_id setstandardheaderfooter setistablebased setisform setisdefault m_items getitems load constructor param ctx context param rs result set public m print format properties ctx result set rs string trx name super ctx rs trx name m language language get login language m items get items mprintformat resultset trxname trxname m_language getloginlanguage m_items getitems get language return language public language get language return m language getlanguage m_language set language param language language public void set language language language if language null m language language log fine set language language m translationviewlanguage null setlanguage m_language setlanguage m_translationviewlanguage get ad column id of order columns return array of ad column ids in sort order public int getorderad column ids hash map integer integer map new hash map integer integer sort no ad column id for int i 0 i m items length i sort order and column must be 0 if m items i get sort no 0 m items i getad column id 0 map put new integer m items i get sort no new integer m items i getad column id get sort no and sort them integer keys new integer map key set size map key set to array keys arrays sort keys create ad column id array int ret value new int keys length for int i 0 i keys length i integer value integer map get keys i ret value i value int value return ret value ad_column_id ad_column_ids getorderad_column_ids hashmap hashmap sortno ad_column_id m_items m_items getsortno m_items getad_column_id m_items getsortno m_items getad_column_id sortno keyset keyset toarray ad_column_id retvalue retvalue intvalue retvalue get ad column ids of columns in report return array of ad column id public int getad column ids array list integer list new array list integer for int i 0 i m items length i if m items i getad column id 0 m items i is printed list add new integer m items i getad column id convert int ret value new int list size for int i 0 i list size i ret value i integer list get i int value return ret value ad_column_ids ad_column_id getad_column_ids arraylist arraylist m_items m_items getad_column_id m_items isprinted m_items getad_column_id retvalue retvalue intvalue retvalue set items param items items private void set items m print format item items if items null m items items setitems mprintformatitem m_items get active items return items private m print format item get items array list m print format item list new array list m print format item string sql select from ad printformatitem pfi where pfi ad printformat id and pfi is active y display restrictions passwords etc and not exists select from ad field f where pfi ad column id f ad column id and f is encrypted y or f obscure type is not null order by seq no m role role m role get default get ctx false try prepared statement pstmt db prepare statement sql null pstmt set int 1 get id result set rs pstmt execute query while rs next m print format item pfi new m print format item p ctx rs get trxname if role is column access getad table id pfi getad column id true list add pfi rs close pstmt close catch sql exception e log log level severe sql e m print format item ret value new m print format item list size list to array ret value return ret value mprintformatitem getitems arraylist mprintformatitem arraylist mprintformatitem ad_printformatitem ad_printformat_id isactive ad_field ad_column_id ad_column_id isencrypted obscuretype seqno mrole mrole getdefault getctx preparedstatement preparestatement setint get_id resultset executequery mprintformatitem mprintformatitem p_ctx get_trxname iscolumnaccess getad_table_id getad_column_id sqlexception mprintformatitem retvalue mprintformatitem toarray retvalue retvalue get item count return number of items or 1 if items not defined public int get item count if m items null return 1 return m items length getitemcount m_items m_items get print format item param index index return print format item public m print format item get item int index if index 0 index m items length throw new array index out of bounds exception index index length m items length return m items index mprintformatitem getitem m_items arrayindexoutofboundsexception m_items m_items set the translation of the format items to the original public void set translation string buffer sb new string buffer update ad printformatitem trl t set print name print name suffix select print name print name suffix from ad printformatitem i where i ad printformatitem id t ad printformatitem id where ad printformatitem id in select ad printformatitem id from ad printformatitem where ad printformat id append get id append int no db execute update sb to string get trxname log fine set translation no settranslation stringbuffer stringbuffer ad_printformatitem_trl printname printnamesuffix printname printnamesuffix ad_printformatitem ad_printformatitem_id ad_printformatitem_id ad_printformatitem_id ad_printformatitem_id ad_printformatitem ad_printformat_id get_id executeupdate tostring get_trxname settranslation set standard header param standard header footer true if std header public void set standard header footer boolean standard header footer super set is standard header footer standard header footer if standard header footer set footer margin 0 set header margin 0 standardheaderfooter setstandardheaderfooter standardheaderfooter setisstandardheaderfooter standardheaderfooter standardheaderfooter setfootermargin setheadermargin set table based reset form param table based true if table based public void set is table based boolean table based super set is table based table based if table based super set is form false tablebased setistablebased tablebased setistablebased tablebased tablebased setisform set translation view language param language language checked for base language public void set translation language language language if language null language is base language log info ignored language m translationviewlanguage null else log info language language getad language m translationviewlanguage language getad language m language language settranslationlanguage isbaselanguage m_translationviewlanguage getad_language m_translationviewlanguage getad_language m_language get translation view use return true if a translation view is used public boolean is translation view return m translationviewlanguage null istranslationview m_translationviewlanguage update the query to access the translation view can be called multiple times adds only if not set already param query query to be updated public void set translation view query m query query set table name and add add restriction if a view and language set if m translationviewlanguage null query null query get table name to upper case ends with v query set table name query get table name t query add restriction ad language m query equal m translationviewlanguage settranslationviewquery mquery m_translationviewlanguage gettablename touppercase endswith _v settablename gettablename addrestriction ad_language mquery m_translationviewlanguage get optional table format param ad printtableformat id table format public void setad printtableformat id int ad printtableformat id super setad printtableformat id ad printtableformat id m tformat m print table format get get ctx ad printtableformat id getad printfont id tableformat ad_printtableformat_id setad_printtableformat_id ad_printtableformat_id setad_printtableformat_id ad_printtableformat_id m_tformat mprinttableformat getctx ad_printtableformat_id getad_printfont_id get table format return table format public m print table format get table format if m tformat null m tformat m print table format get get ctx getad printtableformat id getad printfont id return m tformat mprinttableformat gettableformat m_tformat m_tformat mprinttableformat getctx getad_printtableformat_id getad_printfont_id m_tformat sting representation return info public string to string string buffer sb new string buffer m print format id append get id append name append get name append language append get language append items append get item count append return sb to string tostring stringbuffer stringbuffer mprintformat get_id getname getlanguage getitemcount tostring load special data images to be extended by sub classes param rs result set param index zero based index return value value throws sql exception protected object load special result set rs int index throws sql exception create copy log config m print format load special p info get column name index return null sqlexception loadspecial resultset sqlexception createcopy mprintformat loadspecial p_info getcolumnname save special data to be extended by sub classes param value value param index index return sql code for insert values clause protected string save new special object value int index create copy string col name p info get column name index string col class p info get column class index to string string col value value null null value get class to string log log level severe po save new special unknown class for column col name col class value col value if value null return null return value to string savenewspecial createcopy colname p_info getcolumnname colclass p_info getcolumnclass tostring colvalue getclass tostring savenewspecial colname colclass colvalue tostring create m print format for table param ctx context param ad table id table return print format static public m print format create from table properties ctx int ad table id return create from table ctx ad table id 0 mprintformat ad_table_id mprintformat createfromtable ad_table_id createfromtable ad_table_id create m print format for table param ctx context param ad table id table param ad printformat id 0 or existing print format return print format static public m print format create from table properties ctx int ad table id int ad printformat id int ad client id env getad client id ctx s log info ad table id ad table id ad client id ad client id m print format pf new m print format ctx ad printformat id null pf setad table id ad table id get info string sql select table name 1 select count from ad printformat x where x ad table id t ad table id and x ad client id c ad client id as count coalesce cpc ad printcolor id pc ad printcolor id as ad printcolor id 3 coalesce cpf ad printfont id pf ad printfont id as ad printfont id coalesce cpp ad printpaper id pp ad printpaper id as ad printpaper id from ad table t ad client c left outer join ad printcolor cpc on cpc ad client id c ad client id and cpc is default y left outer join ad printfont cpf on cpf ad client id c ad client id and cpf is default y left outer join ad printpaper cpp on cpp ad client id c ad client id and cpp is default y ad printcolor pc ad printfont pf ad printpaper pp where t ad table id and c ad client id 1 2 and pc is default y and pf is default y and pp is default y boolean error true try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id pstmt set int 2 ad client id result set rs pstmt execute query if rs next name string table name rs get string 1 string column name table name id string s column name if column name equals t report id s msg translate ctx column name if column name equals s not found s msg translate ctx table name int count rs get int 2 if count 0 s count 1 pf set name s pf setad printcolor id rs get int 3 pf setad printfont id rs get int 4 pf setad printpaper id rs get int 5 error false else s log log level severe no info found ad table id rs close pstmt close catch sql exception e s log log level severe sql e if error return null save complete if pf save return null pf dump pf set items create items ctx pf return pf mprintformat ad_table_id ad_printformat_id printformat mprintformat createfromtable ad_table_id ad_printformat_id ad_client_id getad_client_id s_log ad_table_id ad_table_id ad_client_id ad_client_id mprintformat mprintformat ad_printformat_id setad_table_id ad_table_id tablename ad_printformat ad_table_id ad_table_id ad_client_id ad_client_id ad_printcolor_id ad_printcolor_id ad_printcolor_id ad_printfont_id ad_printfont_id ad_printfont_id ad_printpaper_id ad_printpaper_id ad_printpaper_id ad_table ad_client ad_printcolor ad_client_id ad_client_id isdefault ad_printfont ad_client_id ad_client_id isdefault ad_printpaper ad_client_id ad_client_id isdefault ad_printcolor ad_printfont ad_printpaper ad_table_id ad_client_id isdefault isdefault isdefault preparedstatement preparestatement setint ad_table_id setint ad_client_id resultset executequery tablename getstring columnname tablename _id columnname columnname t_report_id columnname columnname tablename getint _ setname setad_printcolor_id getint setad_printfont_id getint setad_printpaper_id getint s_log ad_table_id sqlexception s_log setitems createitems create m print format for report view param ctx context param ad reportview id report view param report name optional report name return print format static public m print format create from report view properties ctx int ad reportview id string report name int ad client id env getad client id ctx s log info ad reportview id ad reportview id ad client id ad client id report name m print format pf new m print format ctx 0 null pf setad reportview id ad reportview id get info string sql select t table name select count from ad printformat x where x ad reportview id rv ad reportview id and x ad client id c ad client id as count coalesce cpc ad printcolor id pc ad printcolor id as ad printcolor id coalesce cpf ad printfont id pf ad printfont id as ad printfont id coalesce cpp ad printpaper id pp ad printpaper id as ad printpaper id t ad table id from ad reportview rv inner join ad table t on rv ad table id t ad table id ad client c left outer join ad printcolor cpc on cpc ad client id c ad client id and cpc is default y left outer join ad printfont cpf on cpf ad client id c ad client id and cpf is default y left outer join ad printpaper cpp on cpp ad client id c ad client id and cpp is default y ad printcolor pc ad printfont pf ad printpaper pp where rv ad reportview id and c ad client id and pc is default y and pf is default y and pp is default y boolean error true try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad reportview id pstmt set int 2 ad client id result set rs pstmt execute query if rs next name string name report name if name null name length 0 name rs get string 1 table name int count rs get int 2 if count 0 name count pf set name name pf setad printcolor id rs get int 3 pf setad printfont id rs get int 4 pf setad printpaper id rs get int 5 pf setad table id rs get int 6 error false else s log log level severe not found ad reportview id ad reportview id rs close pstmt close catch sql exception e s log log level severe sql e if error return null save complete if pf save return null pf dump pf set items create items ctx pf return pf mprintformat reportview ad_reportview_id reportview reportname mprintformat createfromreportview ad_reportview_id reportname ad_client_id getad_client_id s_log ad_reportview_id ad_reportview_id ad_client_id ad_client_id reportname mprintformat mprintformat setad_reportview_id ad_reportview_id tablename ad_printformat ad_reportview_id ad_reportview_id ad_client_id ad_client_id ad_printcolor_id ad_printcolor_id ad_printcolor_id ad_printfont_id ad_printfont_id ad_printfont_id ad_printpaper_id ad_printpaper_id ad_printpaper_id ad_table_id ad_reportview ad_table ad_table_id ad_table_id ad_client ad_printcolor ad_client_id ad_client_id isdefault ad_printfont ad_client_id ad_client_id isdefault ad_printpaper ad_client_id ad_client_id isdefault ad_printcolor ad_printfont ad_printpaper ad_reportview_id ad_client_id isdefault isdefault isdefault preparedstatement preparestatement setint ad_reportview_id setint ad_client_id resultset executequery reportname getstring tablename getint _ setname setad_printcolor_id getint setad_printfont_id getint setad_printpaper_id getint setad_table_id getint s_log ad_reportview_id ad_reportview_id sqlexception s_log setitems createitems create items using the display order of fields in some tab param ctx context param format print format return items static private m print format item create items properties ctx m print format format s log fine from window tab array list m print format item list new array list m print format item get column list from tab string sql select ad column id name is displayed seq no from ad field where ad tab id select ad tab id from ad tab where ad table id and rownum 1 and is encrypted n and obscure type is null order by coalesce is displayed n desc sort no seq no name try prepared statement pstmt db prepare statement sql format get trxname pstmt set int 1 format getad table id result set rs pstmt execute query int seq no 1 while rs next m print format item pfi m print format item create from column format rs get int 1 seq no if pfi null list add pfi s log finest tab pfi rs close pstmt close catch sql exception e s log log level severe tab sql e no tab found for table if list size 0 s log fine from table sql select ad column id from ad column where ad table id order by is identifier desc seq no name try prepared statement pstmt db prepare statement sql format get trxname pstmt set int 1 format getad table id result set rs pstmt execute query int seq no 1 while rs next m print format item pfi m print format item create from column format rs get int 1 seq no if pfi null list add pfi s log finest table pfi rs close pstmt close catch sql exception e s log log level severe table sql e m print format item ret value new m print format item list size list to array ret value s log info format ret value length return ret value mprintformatitem createitems mprintformat s_log arraylist mprintformatitem arraylist mprintformatitem ad_column_id isdisplayed seqno ad_field ad_tab_id ad_tab_id ad_tab ad_table_id isencrypted obscuretype isdisplayed sortno seqno preparedstatement preparestatement get_trxname setint getad_table_id resultset executequery seqno mprintformatitem mprintformatitem createfromcolumn getint seqno s_log sqlexception s_log s_log ad_column_id ad_column ad_table_id isidentifier seqno preparedstatement preparestatement get_trxname setint getad_table_id resultset executequery seqno mprintformatitem mprintformatitem createfromcolumn getint seqno s_log sqlexception s_log mprintformatitem retvalue mprintformatitem toarray retvalue s_log retvalue retvalue copy items param from format from print format param to format to print format client id return items static private m print format item copy items m print format from format m print format to format s log info from from format array list m print format item list new array list m print format item m print format item items from format get items for int i 0 i items length i m print format item pfi items i copy to client to format getad client id to format get id if pfi null list add pfi m print format item ret value new m print format item list size list to array ret value return ret value fromformat toformat mprintformatitem copyitems mprintformat fromformat mprintformat toformat s_log fromformat arraylist mprintformatitem arraylist mprintformatitem mprintformatitem fromformat getitems mprintformatitem copytoclient toformat getad_client_id toformat get_id mprintformatitem retvalue mprintformatitem toarray retvalue retvalue copy existing definition to client param ctx context param from ad printformat id format param to ad printformat id format return print format public static m print format copy properties ctx int from ad printformat id int to ad printformat id return copy ctx from ad printformat id to ad printformat id 1 from_ad_printformat_id to_ad_printformat_id mprintformat from_ad_printformat_id to_ad_printformat_id from_ad_printformat_id to_ad_printformat_id copy existing definition to client param ctx context param ad printformat id format param to client id to client return print format public static m print format copy to client properties ctx int ad printformat id int to client id return copy ctx ad printformat id 0 to client id ad_printformat_id to_client_id mprintformat copytoclient ad_printformat_id to_client_id ad_printformat_id to_client_id copy existing definition to client param ctx context param from ad printformat id format param to ad printformat id to format or 0 for new param to client id to client ignored if to ad printformat id 0 return print format private static m print format copy properties ctx int from ad printformat id int to ad printformat id int to client id s log info from ad printformat id from ad printformat id to ad printformat id to ad printformat id to client id to client id if from ad printformat id 0 throw new illegal argument exception from ad printformat id is 0 m print format from new m print format ctx from ad printformat id null m print format to new m print format ctx to ad printformat id null could be 0 m print format copy values from to new if to ad printformat id 0 if to client id 0 to client id env getad client id ctx to set client org to client id 0 set name remove template add copy to set name util replace to get name template string value of to client id to set name to get name msg get msg ctx copy to hash code unique name to save copy items to set items copy items from to return to from_ad_printformat_id to_ad_printformat_id to_client_id to_ad_printformat_id mprintformat from_ad_printformat_id to_ad_printformat_id to_client_id s_log ad_printformat_id from_ad_printformat_id ad_printformat_id to_ad_printformat_id client_id to_client_id from_ad_printformat_id illegalargumentexception from_ad_printformat_id mprintformat mprintformat from_ad_printformat_id mprintformat mprintformat to_ad_printformat_id mprintformat copyvalues to_ad_printformat_id to_client_id to_client_id getad_client_id setclientorg to_client_id setname getname valueof to_client_id setname getname getmsg hashcode setitems copyitems get format param ctx context param ad printformat id id param read from disk refresh from disk return format static public m print format get properties ctx int ad printformat id boolean read from disk integer key new integer ad printformat id m print format pf null if read from disk pf m print format s formats get key if pf null pf new m print format ctx ad printformat id null s formats put key pf return pf ad_printformat_id readfromdisk mprintformat ad_printformat_id readfromdisk ad_printformat_id mprintformat readfromdisk mprintformat s_formats mprintformat ad_printformat_id s_formats get default printformat for report view or table param ctx context param ad reportview id id or 0 param ad table id id or 0 return first print format found or null static public m print format get properties ctx int ad reportview id int ad table id m print format ret value null prepared statement pstmt null string sql select from ad printformat where if ad reportview id 0 sql ad reportview id else sql ad table id sql order by is default desc try pstmt db prepare statement sql null pstmt set int 1 ad reportview id 0 ad reportview id ad table id result set rs pstmt execute query if rs next ret value new m print format ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value ad_reportview_id ad_table_id mprintformat ad_reportview_id ad_table_id mprintformat retvalue preparedstatement ad_printformat ad_reportview_id ad_reportview_id ad_table_id isdefault preparestatement setint ad_reportview_id ad_reportview_id ad_table_id resultset executequery retvalue mprintformat s_log retvalue delete format from cache param ad printformat id id static public void delete from cache int ad printformat id integer key new integer ad printformat id s formats put key null ad_printformat_id deletefromcache ad_printformat_id ad_printformat_id s_formats test param args arga static public void main string args org compiere compiere startup true m print format create from table env get ctx 496 order m print format create from table env get ctx 497 m print format create from table env get ctx 516 invoice m print format create from table env get ctx 495 m print format create from table env get ctx 500 shipment m print format create from table env get ctx 501 m print format create from table env get ctx 498 check m print format create from table env get ctx 499 m print format create from table env get ctx 498 remittance mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx mprintformat createfromtable getctx basic constructor use set value if needed public dd setvalue sets the value after the lt dd gt tag param value the value after the lt dd gt tag public dd string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dd add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dd add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dd add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dd add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public dd remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute basic constructor use set value if needed public dt setvalue sets the value after the lt dt gt tag param value the value after the lt dt gt tag public dt string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dt add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public dt add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dt add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public dt add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public dt remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute initialize global variables public void init servlet config config throws servlet exception super init config web env init web config servletconfig servletexception webenv initweb process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception request dispatcher dispatcher request get request dispatcher test dispatcher forward request response doget httpservletrequest httpservletresponse servletexception ioexception requestdispatcher getrequestdispatcher process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create get request test2 web util create response request response this null doc true dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse get active payment allocation of payment param parent payment return array of allocations public static m payment allocate get m payment parent array list m payment allocate list new array list m payment allocate string sql select from c paymentallocate where c payment id and is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 parent getc payment id result set rs pstmt execute query while rs next list add new m payment allocate parent get ctx rs parent get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m payment allocate ret value new m payment allocate list size list to array ret value return ret value mpaymentallocate mpayment arraylist mpaymentallocate arraylist mpaymentallocate c_paymentallocate c_payment_id isactive preparedstatement preparestatement setint getc_payment_id resultset executequery mpaymentallocate getctx get_trxname mpaymentallocate retvalue mpaymentallocate toarray retvalue retvalue standard constructor param ctx context param c paymentallocate id id param trx name trx public m payment allocate properties ctx int c paymentallocate id string trx name super ctx c paymentallocate id trx name if c paymentallocate id 0 setc payment id 0 parent setc invoice id 0 set amount env zero set discount amt env zero set over under amt env zero set write off amt env zero set invoice amt env zero c_paymentallocate_id trxname mpaymentallocate c_paymentallocate_id trxname c_paymentallocate_id trxname c_paymentallocate_id setc_payment_id setc_invoice_id setamount setdiscountamt setoverunderamt setwriteoffamt setinvoiceamt load cosntructor param ctx context param rs result set param trx name trx public m payment allocate properties ctx result set rs string trx name super ctx rs trx name trxname mpaymentallocate resultset trxname trxname set c invoice id param c invoice id id public void setc invoice id int c invoice id super setc invoice id c invoice id m invoice null c_invoice_id c_invoice_id setc_invoice_id c_invoice_id setc_invoice_id c_invoice_id m_invoice get invoice return invoice public m invoice get invoice if m invoice null getc invoice id 0 m invoice new m invoice get ctx getc invoice id get trxname return m invoice minvoice getinvoice m_invoice getc_invoice_id m_invoice minvoice getctx getc_invoice_id get_trxname m_invoice get b partner of invoice return bp public int getc bpartner id if m invoice null get invoice return m invoice getc bpartner id bpartner getc_bpartner_id m_invoice getinvoice m_invoice getc_bpartner_id before save param new record new return true protected boolean before save boolean new record m payment payment new m payment get ctx getc payment id get trxname if new record is valuechanged c invoice id payment getc charge id 0 payment getc invoice id 0 payment getc order id 0 log save error payment is allocated return false check b partner if new record is valuechanged c bpartner id payment getc bpartner id 0 get invoice if m invoice null m invoice getc bpartner id payment getc bpartner id log save error error msg parse translation get ctx c bpartner id c payment id c invoice id return false big decimal check get amount add get discount amt add get write off amt add get over under amt if check compare to get invoice amt 0 log save error error msg parse translation get ctx invoice amt get invoice amt totals check return false org if new record is valuechanged c invoice id get invoice if m invoice null setad org id m invoice getad org id return true newrecord beforesave newrecord mpayment mpayment getctx getc_payment_id get_trxname newrecord is_valuechanged c_invoice_id getc_charge_id getc_invoice_id getc_order_id saveerror paymentisallocated bpartner newrecord is_valuechanged c_bpartner_id getc_bpartner_id getinvoice m_invoice m_invoice getc_bpartner_id getc_bpartner_id saveerror parsetranslation getctx c_bpartner_id c_payment_id c_invoice_id bigdecimal getamount getdiscountamt getwriteoffamt getoverunderamt compareto getinvoiceamt saveerror parsetranslation getctx invoiceamt getinvoiceamt newrecord is_valuechanged c_invoice_id getinvoice m_invoice setad_org_id m_invoice getad_org_id get accounting schema gl info param ctx context param c acctschema id id return defaults public static m acct schemagl get properties ctx int c acctschema id m acct schemagl ret value null string sql select from c acctschema gl where c acctschema id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c acctschema id result set rs pstmt execute query if rs next ret value new m acct schemagl ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value c_acctschema_id macctschemagl c_acctschema_id macctschemagl retvalue c_acctschema_gl c_acctschema_id preparedstatement preparestatement setint c_acctschema_id resultset executequery retvalue macctschemagl s_log retvalue load constructor param ctx context param c acctschema id acct schema public m acct schemagl properties ctx int c acctschema id string trx name super ctx c acctschema id trx name if c acctschema id 0 set use currency balancing false set use suspense balancing false set use suspense error false c_acctschema_id acctschema macctschemagl c_acctschema_id trxname c_acctschema_id trxname c_acctschema_id setusecurrencybalancing setusesuspensebalancing setusesuspenseerror load constructor param ctx context param rs result set public m acct schemagl properties ctx result set rs string trx name super ctx rs trx name macctschemagl resultset trxname trxname get acct info list return list public array list key name pair get acct info array list key name pair list new array list key name pair for int i 0 i get columncount i string column name get columnname i if column name ends with acct int id integer get value i list add new key name pair id column name return list arraylist keynamepair getacctinfo arraylist keynamepair arraylist keynamepair get_columncount columnname get_columnname columnname endswith get_value keynamepair columnname set value don t use param column name column name param value value public boolean set value string column name integer value return super set value column name value columnname setvalue columnname set_value columnname before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id constructor param join clause public join string join clause if join clause null throw new illegal argument exception join clause cannot be null evaluate join clause joinclause joinclause joinclause illegalargumentexception joinclause evaluate the clause e g tb ad user id f ad column id c ad column id param join clause private void evaluate string join clause m joinclause join clause int index equal join clause index of m left index equal join clause index of converts to left if true get table alias of it if m left f ad column id c ad column id f c m mainalias join clause substring 0 util find index of join clause trim f int end join clause index of index equal if end 1 no alias end join clause index of index equal m joinalias join clause substring index equal 1 end trim c else f ad column id c ad column id c f int end join clause index of index equal if end 1 no alias end join clause length m mainalias join clause substring index equal 1 end trim c m joinalias join clause substring 0 util find index of join clause trim f m condition util replace join clause trim ad_user_id ad_column_id ad_column_id joinclause joinclause m_joinclause joinclause indexequal joinclause indexof m_left indexequal joinclause indexof m_left ad_column_id ad_column_id m_mainalias joinclause findindexof joinclause joinclause indexof indexequal joinclause indexof indexequal m_joinalias joinclause indexequal ad_column_id ad_column_id joinclause indexof indexequal joinclause m_mainalias joinclause indexequal m_joinalias joinclause findindexof joinclause m_condition joinclause get origial join clause e g f ad column id c ad column id return join cluase public string get join clause return m joinclause ad_column_id ad_column_id getjoinclause m_joinclause get main table alias return main table alias public string get main alias return m mainalias getmainalias m_mainalias get join table alias return join table alias public string get join alias return m joinalias getjoinalias m_joinalias is left aouter join return true if left outer join public boolean is left return m left isleft m_left get join condition e g f ad column id c ad column id return join condition public string get condition return m condition ad_column_id ad_column_id getcondition m_condition set main table name if table name equals alias the alias is set to param main table public void set main table string main table if main table null main table length 0 return m maintable main table if m mainalias equals main table m mainalias maintable setmaintable maintable maintable maintable m_maintable maintable m_mainalias maintable m_mainalias get main table name return main table name public string get main table return m maintable getmaintable m_maintable set main table name if table name equals alias the alias is set to param join table public void set join table string join table if join table null join table length 0 return m jointable join table if m joinalias equals join table m joinalias jointable setjointable jointable jointable jointable m_jointable jointable m_joinalias jointable m_joinalias get join table name return join table name public string get join table return m jointable getjointable m_jointable this join is a condition of the first join e g tb ad user id or tb ad user id 123 param first return true if condition public boolean is condition of join first if m maintable null did not find table from alias first get join table equals m jointable same join table first get main alias equals m jointable same main table return true return false ad_user_id ad_user_id isconditionof m_maintable getjointable m_jointable getmainalias m_jointable string representation return info public string to string string buffer sb new string buffer join sb append m joinclause append main append m maintable append append m mainalias append join append m jointable append append m joinalias append left append m left append condition append m condition append return sb to string tostring stringbuffer stringbuffer m_joinclause m_maintable m_mainalias m_jointable m_joinalias m_left m_condition tostring get bom lines for product param product product return array of bo ms public static m productbom getbom lines m product product return getbom lines product get ctx product getm product id product get trxname boms mproductbom getbomlines mproduct getbomlines getctx getm_product_id get_trxname get bom lines for product param m product id product return array of bo ms public static m productbom getbom lines properties ctx int m product id string trx name string sql select from m product bom where m product id order by line array list m productbom list new array list m productbom prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new m productbom ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe getbom lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log fine getbom lines list size m product id m product id m productbom ret value new m productbom list size list to array ret value return ret value m_product_id boms mproductbom getbomlines m_product_id trxname m_product_bom m_product_id arraylist mproductbom arraylist mproductbom preparedstatement preparestatement trxname setint m_product_id resultset executequery mproductbom trxname s_log getbomlines s_log getbomlines m_product_id m_product_id mproductbom retvalue mproductbom toarray retvalue retvalue standard constructor param ctx context param m product bom id id public m productbom properties ctx int m product bom id string trx name super ctx m product bom id trx name if m product bom id 0 setm product id 0 parent set line 0 sql select nvl max line 0 10 as default value from m product bom where m product id m product id setm productbom id 0 setbom qty env zero 1 m_product_bom_id mproductbom m_product_bom_id trxname m_product_bom_id trxname m_product_bom_id setm_product_id setline defaultvalue m_product_bom m_product_id m_product_id setm_productbom_id setbomqty load construvtor param ctx context param rs result set public m productbom properties ctx result set rs string trx name super ctx rs trx name mproductbom resultset trxname trxname get bom product return product public m product get product if m product null getm productbom id 0 m product m product get get ctx getm productbom id return m product mproduct getproduct m_product getm_productbom_id m_product mproduct getctx getm_productbom_id m_product set included product param m productbom id product id public void setm productbom id int m productbom id super setm productbom id m productbom id m product null m_productbom_id setm_productbom_id m_productbom_id setm_productbom_id m_productbom_id m_product string representation return info public string to string string buffer sb new string buffer m productbom sb append get id append line append get line append type append getbom type append qty append getbom qty if m product null sb append m product id append getm productbom id else sb append append m product sb append return sb to string tostring stringbuffer stringbuffer mproductbom get_id getline getbomtype getbomqty m_product m_product_id getm_productbom_id m_product tostring after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record is valuechanged m productbom id m product product new m product get ctx getm product id get trxname if get trxname null product load get trxname if product is verified product set is verified false product save get trxname return success newrecord aftersave newrecord newrecord is_valuechanged m_productbom_id mproduct mproduct getctx getm_product_id get_trxname get_trxname get_trxname isverified setisverified get_trxname get ship lines of order line param ctx context param c orderline id line param where optional addition where clause return array of receipt lines public static m in out line get of order line properties ctx int c orderline id string where string trx name array list m in out line list new array list m in out line string sql select from m inoutline where c orderline id if where null where length 0 sql and where prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c orderline id result set rs pstmt execute query while rs next list add new m in out line ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m in out line ret value new m in out line list size list to array ret value return ret value c_orderline_id minoutline getoforderline c_orderline_id trxname arraylist minoutline arraylist minoutline m_inoutline c_orderline_id preparedstatement preparestatement trxname setint c_orderline_id resultset executequery minoutline trxname s_log minoutline retvalue minoutline toarray retvalue retvalue get ship lines of order line param ctx context param c orderline id line return array of receipt lines2 public static m in out line get properties ctx int c orderline id string trx name array list m in out line list new array list m in out line string sql select from m inoutline where c orderline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c orderline id result set rs pstmt execute query while rs next list add new m in out line ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m in out line ret value new m in out line list size list to array ret value return ret value c_orderline_id minoutline c_orderline_id trxname arraylist minoutline arraylist minoutline m_inoutline c_orderline_id preparedstatement preparestatement trxname setint c_orderline_id resultset executequery minoutline trxname s_log minoutline retvalue minoutline toarray retvalue retvalue standard constructor param ctx context param m inoutline id id param trx name trx name public m in out line properties ctx int m inoutline id string trx name super ctx m inoutline id trx name if m inoutline id 0 set line 0 setm locator id 0 setc uom id 0 setm product id 0 setm attributesetinstance id 0 set movement qty env zero set confirmed qty env zero set picked qty env zero set scrapped qty env zero set target qty env zero set is invoiced false set is description false m_inoutline_id trxname minoutline m_inoutline_id trxname m_inoutline_id trxname m_inoutline_id setline setm_locator_id setc_uom_id setm_product_id setm_attributesetinstance_id setmovementqty setconfirmedqty setpickedqty setscrappedqty settargetqty setisinvoiced setisdescription load constructor param ctx context param rs result set record public m in out line properties ctx result set rs string trx name super ctx rs trx name minoutline resultset trxname trxname parent constructor param inout parent public m in out line m in out inout this inout get ctx 0 inout get trxname set client org inout setm inout id inout getm inout id setm warehouse id inout getm warehouse id m parent inout minoutline minout getctx get_trxname setclientorg setm_inout_id getm_inout_id setm_warehouse_id getm_warehouse_id m_parent get parent return parent public m in out get parent if m parent null m parent new m in out get ctx getm inout id get trxname return m parent minout getparent m_parent m_parent minout getctx getm_inout_id get_trxname m_parent set order line does not set quantity param o line order line param m locator id locator param qty used only to find suitable locator public void set order line m order line o line int m locator id big decimal qty setc orderline id o line getc orderline id set line o line get line setc uom id o line getc uom id m product product o line get product if product null set valuenocheck m product id null set valuenocheck m attributesetinstance id null set valuenocheck m locator id null else setm product id o line getm product id setm attributesetinstance id o line getm attributesetinstance id if product is item if m locator id 0 setm locator id qty requires warehouse product asi else setm locator id m locator id else set valuenocheck m locator id null setc charge id o line getc charge id set description o line get description set is description o line is description oline m_locator_id setorderline morderline oline m_locator_id bigdecimal setc_orderline_id oline getc_orderline_id setline oline getline setc_uom_id oline getc_uom_id mproduct oline getproduct set_valuenocheck m_product_id set_valuenocheck m_attributesetinstance_id set_valuenocheck m_locator_id setm_product_id oline getm_product_id setm_attributesetinstance_id oline getm_attributesetinstance_id isitem m_locator_id setm_locator_id setm_locator_id m_locator_id set_valuenocheck m_locator_id setc_charge_id oline getc_charge_id setdescription oline getdescription setisdescription oline isdescription set invoice line does not set quantity param i line invoice line param m locator id locator param qty qty only fo find suitable locator public void set invoice line m invoice line i line int m locator id big decimal qty setc orderline id i line getc orderline id set line i line get line setc uom id i line getc uom id int m product id i line getm product id if m product id 0 set valuenocheck m product id null set valuenocheck m locator id null set valuenocheck m attributesetinstance id null else setm product id m product id setm attributesetinstance id i line getm attributesetinstance id if m locator id 0 setm locator id qty requires warehouse product asi else setm locator id m locator id setc charge id i line getc charge id set description i line get description set is description i line is description iline m_locator_id setinvoiceline minvoiceline iline m_locator_id bigdecimal setc_orderline_id iline getc_orderline_id setline iline getline setc_uom_id iline getc_uom_id m_product_id iline getm_product_id m_product_id set_valuenocheck m_product_id set_valuenocheck m_locator_id set_valuenocheck m_attributesetinstance_id setm_product_id m_product_id setm_attributesetinstance_id iline getm_attributesetinstance_id m_locator_id setm_locator_id setm_locator_id m_locator_id setc_charge_id iline getc_charge_id setdescription iline getdescription setisdescription iline isdescription get warehouse return returns the m warehouse id public int getm warehouse id if m m warehouse id 0 m m warehouse id get parent getm warehouse id return m m warehouse id m_warehouse_id getm_warehouse_id m_m_warehouse_id m_m_warehouse_id getparent getm_warehouse_id m_m_warehouse_id set warehouse param warehouse id the m warehouse id to set public void setm warehouse id int warehouse id m m warehouse id warehouse id warehouse_id m_warehouse_id setm_warehouse_id warehouse_id m_m_warehouse_id warehouse_id set default locator param qty quantity assumes warehouse is set public void setm locator id big decimal qty locator esatblished if getm locator id 0 return no product if getm product id 0 set valuenocheck m locator id null return get existing location int m locator id m storage getm locator id getm warehouse id getm product id getm attributesetinstance id qty get trxname get default location if m locator id 0 m warehouse wh m warehouse get get ctx getm warehouse id m locator id wh get default locator getm locator id setm locator id m locator id setm_locator_id bigdecimal getm_locator_id getm_product_id set_valuenocheck m_locator_id m_locator_id mstorage getm_locator_id getm_warehouse_id getm_product_id getm_attributesetinstance_id get_trxname m_locator_id mwarehouse mwarehouse getctx getm_warehouse_id m_locator_id getdefaultlocator getm_locator_id setm_locator_id m_locator_id set movement movement qty param qty entered movement qty public void set qty big decimal qty set qty entered qty set movement qty qty setqty bigdecimal setqtyentered setmovementqty get product return product or null public m product get product if m product null getm product id 0 m product m product get get ctx getm product id return m product mproduct getproduct m_product getm_product_id m_product mproduct getctx getm_product_id m_product set product param product product public void set product m product product m product product if m product null setm product id m product getm product id setc uom id m product getc uom id else setm product id 0 setc uom id 0 setm attributesetinstance id 0 setproduct mproduct m_product m_product setm_product_id m_product getm_product_id setc_uom_id m_product getc_uom_id setm_product_id setc_uom_id setm_attributesetinstance_id set m product id param m product id product public void setm product id int m product id boolean setuom if setuom set product m product get get ctx m product id else super setm product id m product id setm attributesetinstance id 0 m_product_id m_product_id setm_product_id m_product_id setproduct mproduct getctx m_product_id setm_product_id m_product_id setm_attributesetinstance_id set product and uom param m product id product param c uom id uom public void setm product id int m product id int c uom id if m product id 0 super setm product id m product id super setc uom id c uom id setm attributesetinstance id 0 m product null m_product_id c_uom_id setm_product_id m_product_id c_uom_id m_product_id setm_product_id m_product_id setc_uom_id c_uom_id setm_attributesetinstance_id m_product add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription before save param new record new return save protected boolean before save boolean new record log fine get line no if get line 0 string sql select coalesce max line 0 10 from m inoutline where m inout id int ii db getsql value get trxname sql getm inout id set line ii uom if getc uom id 0 setc uom id env get context as int get ctx c uom id if getc uom id 0 int c uom id muom getdefault uom id get ctx if c uom id 0 setc uom id c uom id order line if getc orderline id 0 if get parent isso trx log save error fill mandatory msg translate get ctx c order id return false if getc charge id 0 getm product id 0 qty on instance asi if getm attributesetinstance id 0 m product product get product int m attributeset id product getm attributeset id boolean is instance m attributeset id 0 if is instance m attribute set mas m attribute set get get ctx m attributeset id is instance mas is instance attribute max if is instance m storage storage m storage get get ctx getm locator id getm product id getm attributesetinstance id get trxname if storage null big decimal qty storage get qty on hand if get movement qty compare to qty 0 log warning qty stock qty movement get movement qty log save error qty insufficient qty return false return true newrecord beforesave newrecord getline m_inoutline m_inout_id getsqlvalue get_trxname getm_inout_id setline getc_uom_id setc_uom_id getcontextasint getctx c_uom_id getc_uom_id c_uom_id getdefault_uom_id getctx c_uom_id setc_uom_id c_uom_id getc_orderline_id getparent issotrx saveerror fillmandatory getctx c_order_id getc_charge_id getm_product_id getm_attributesetinstance_id mproduct getproduct m_attributeset_id getm_attributeset_id isinstance m_attributeset_id isinstance mattributeset mattributeset getctx m_attributeset_id isinstance isinstanceattribute isinstance mstorage mstorage getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname bigdecimal getqtyonhand getmovementqty compareto getmovementqty saveerror qtyinsufficient before delete return true if drafted protected boolean before delete if get parent get doc status equals m in out docstatus drafted return true log save error error msg get msg get ctx cannot delete return false beforedelete getparent getdocstatus minout docstatus_drafted saveerror getmsg getctx cannotdelete string representation return info public string to string string buffer sb new string buffer m in out line append get id append m product id append getm product id append qty entered append get qty entered append movement qty append get movement qty append m attributesetinstance id append getm attributesetinstance id append return sb to string tostring stringbuffer stringbuffer minoutline get_id m_product_id getm_product_id qtyentered getqtyentered movementqty getmovementqty m_attributesetinstance_id getm_attributesetinstance_id tostring get base value for cost distribution param cost distribution cost distribution return base number public big decimal get base string cost distribution if m landed cost landedcostdistribution costs equals cost distribution todo costs log severe not implemented yet cost return env zero else if m landed cost landedcostdistribution line equals cost distribution return env one else if m landed cost landedcostdistribution quantity equals cost distribution return get movement qty else if m landed cost landedcostdistribution volume equals cost distribution m product product get product if product null log severe no product return env zero return get movement qty multiply product get volume else if m landed cost landedcostdistribution weight equals cost distribution m product product get product if product null log severe no product return env zero return get movement qty multiply product get weight log severe invalid criteria cost distribution return env zero costdistribution bigdecimal getbase costdistribution mlandedcost landedcostdistribution_costs costdistribution mlandedcost landedcostdistribution_line costdistribution mlandedcost landedcostdistribution_quantity costdistribution getmovementqty mlandedcost landedcostdistribution_volume costdistribution mproduct getproduct getmovementqty getvolume mlandedcost landedcostdistribution_weight costdistribution mproduct getproduct getmovementqty getweight costdistribution standard constructor public x ad clientinfo properties ctx int ad clientinfo id string trx name super ctx ad clientinfo id trx name if ad clientinfo id 0 set is discount line amt false x_ad_clientinfo ad_clientinfo_id trxname ad_clientinfo_id trxname ad_clientinfo_id setisdiscountlineamt load constructor public x ad clientinfo properties ctx result set rs string trx name super ctx rs trx name x_ad_clientinfo resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad clientinfo append get id append return sb to string tostring stringbuffer stringbuffer x_ad_clientinfo get_id tostring public static final int ad tree activity id ad reference id 184 set activity tree tree to determine activity hierarchy public void setad tree activity id int ad tree activity id if ad tree activity id 0 set valuenocheck ad tree activity id null else set valuenocheck ad tree activity id new integer ad tree activity id ad_tree_activity_id_ad_reference_id setad_tree_activity_id ad_tree_activity_id ad_tree_activity_id set_valuenocheck ad_tree_activity_id set_valuenocheck ad_tree_activity_id ad_tree_activity_id get activity tree tree to determine activity hierarchy public int getad tree activity id integer ii integer get value ad tree activity id if ii null return 0 return ii int value getad_tree_activity_id get_value ad_tree_activity_id intvalue public static final int ad tree bpartner id ad reference id 184 set b partner tree tree to determine business partner hierarchy public void setad tree bpartner id int ad tree bpartner id if ad tree bpartner id 0 set valuenocheck ad tree bpartner id null else set valuenocheck ad tree bpartner id new integer ad tree bpartner id ad_tree_bpartner_id_ad_reference_id bpartner setad_tree_bpartner_id ad_tree_bpartner_id ad_tree_bpartner_id set_valuenocheck ad_tree_bpartner_id set_valuenocheck ad_tree_bpartner_id ad_tree_bpartner_id get b partner tree tree to determine business partner hierarchy public int getad tree bpartner id integer ii integer get value ad tree bpartner id if ii null return 0 return ii int value bpartner getad_tree_bpartner_id get_value ad_tree_bpartner_id intvalue public static final int ad tree campaign id ad reference id 184 set campaign tree tree to determine marketing campaign hierarchy public void setad tree campaign id int ad tree campaign id if ad tree campaign id 0 set valuenocheck ad tree campaign id null else set valuenocheck ad tree campaign id new integer ad tree campaign id ad_tree_campaign_id_ad_reference_id setad_tree_campaign_id ad_tree_campaign_id ad_tree_campaign_id set_valuenocheck ad_tree_campaign_id set_valuenocheck ad_tree_campaign_id ad_tree_campaign_id get campaign tree tree to determine marketing campaign hierarchy public int getad tree campaign id integer ii integer get value ad tree campaign id if ii null return 0 return ii int value getad_tree_campaign_id get_value ad_tree_campaign_id intvalue public static final int ad tree menu id ad reference id 184 set menu tree tree of the menu public void setad tree menu id int ad tree menu id if ad tree menu id 0 set valuenocheck ad tree menu id null else set valuenocheck ad tree menu id new integer ad tree menu id ad_tree_menu_id_ad_reference_id setad_tree_menu_id ad_tree_menu_id ad_tree_menu_id set_valuenocheck ad_tree_menu_id set_valuenocheck ad_tree_menu_id ad_tree_menu_id get menu tree tree of the menu public int getad tree menu id integer ii integer get value ad tree menu id if ii null return 0 return ii int value getad_tree_menu_id get_value ad_tree_menu_id intvalue public static final int ad tree org id ad reference id 184 set organization tree tree to determine organizational hierarchy public void setad tree org id int ad tree org id if ad tree org id 0 set valuenocheck ad tree org id null else set valuenocheck ad tree org id new integer ad tree org id ad_tree_org_id_ad_reference_id setad_tree_org_id ad_tree_org_id ad_tree_org_id set_valuenocheck ad_tree_org_id set_valuenocheck ad_tree_org_id ad_tree_org_id get organization tree tree to determine organizational hierarchy public int getad tree org id integer ii integer get value ad tree org id if ii null return 0 return ii int value getad_tree_org_id get_value ad_tree_org_id intvalue public static final int ad tree product id ad reference id 184 set product tree tree to determine product hierarchy public void setad tree product id int ad tree product id if ad tree product id 0 set valuenocheck ad tree product id null else set valuenocheck ad tree product id new integer ad tree product id ad_tree_product_id_ad_reference_id setad_tree_product_id ad_tree_product_id ad_tree_product_id set_valuenocheck ad_tree_product_id set_valuenocheck ad_tree_product_id ad_tree_product_id get product tree tree to determine product hierarchy public int getad tree product id integer ii integer get value ad tree product id if ii null return 0 return ii int value getad_tree_product_id get_value ad_tree_product_id intvalue public static final int ad tree project id ad reference id 184 set project tree tree to determine project hierarchy public void setad tree project id int ad tree project id if ad tree project id 0 set valuenocheck ad tree project id null else set valuenocheck ad tree project id new integer ad tree project id ad_tree_project_id_ad_reference_id setad_tree_project_id ad_tree_project_id ad_tree_project_id set_valuenocheck ad_tree_project_id set_valuenocheck ad_tree_project_id ad_tree_project_id get project tree tree to determine project hierarchy public int getad tree project id integer ii integer get value ad tree project id if ii null return 0 return ii int value getad_tree_project_id get_value ad_tree_project_id intvalue public static final int ad tree salesregion id ad reference id 184 set sales region tree tree to determine sales regional hierarchy public void setad tree salesregion id int ad tree salesregion id if ad tree salesregion id 0 set valuenocheck ad tree salesregion id null else set valuenocheck ad tree salesregion id new integer ad tree salesregion id ad_tree_salesregion_id_ad_reference_id setad_tree_salesregion_id ad_tree_salesregion_id ad_tree_salesregion_id set_valuenocheck ad_tree_salesregion_id set_valuenocheck ad_tree_salesregion_id ad_tree_salesregion_id get sales region tree tree to determine sales regional hierarchy public int getad tree salesregion id integer ii integer get value ad tree salesregion id if ii null return 0 return ii int value getad_tree_salesregion_id get_value ad_tree_salesregion_id intvalue public static final int c acctschema1 id ad reference id 136 set primary accounting schema primary rules for accounting public void setc acctschema1 id int c acctschema1 id if c acctschema1 id 0 set valuenocheck c acctschema1 id null else set valuenocheck c acctschema1 id new integer c acctschema1 id c_acctschema1_id_ad_reference_id setc_acctschema1_id c_acctschema1_id c_acctschema1_id set_valuenocheck c_acctschema1_id set_valuenocheck c_acctschema1_id c_acctschema1_id get primary accounting schema primary rules for accounting public int getc acctschema1 id integer ii integer get value c acctschema1 id if ii null return 0 return ii int value getc_acctschema1_id get_value c_acctschema1_id intvalue public static final int c bpartnercashtrx id ad reference id 138 set template b partner business partner used for creating new business partners on the fly public void setc bpartnercashtrx id int c bpartnercashtrx id if c bpartnercashtrx id 0 set value c bpartnercashtrx id null else set value c bpartnercashtrx id new integer c bpartnercashtrx id c_bpartnercashtrx_id_ad_reference_id setc_bpartnercashtrx_id c_bpartnercashtrx_id c_bpartnercashtrx_id set_value c_bpartnercashtrx_id set_value c_bpartnercashtrx_id c_bpartnercashtrx_id get template b partner business partner used for creating new business partners on the fly public int getc bpartnercashtrx id integer ii integer get value c bpartnercashtrx id if ii null return 0 return ii int value getc_bpartnercashtrx_id get_value c_bpartnercashtrx_id intvalue set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 0 set value c calendar id null else set value c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id set_value c_calendar_id set_value c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue public static final int c uom length id ad reference id 114 set uom for length standard unit of measure for length public void setc uom length id int c uom length id if c uom length id 0 set value c uom length id null else set value c uom length id new integer c uom length id c_uom_length_id_ad_reference_id setc_uom_length_id c_uom_length_id c_uom_length_id set_value c_uom_length_id set_value c_uom_length_id c_uom_length_id get uom for length standard unit of measure for length public int getc uom length id integer ii integer get value c uom length id if ii null return 0 return ii int value getc_uom_length_id get_value c_uom_length_id intvalue public static final int c uom time id ad reference id 114 set uom for time standard unit of measure for time public void setc uom time id int c uom time id if c uom time id 0 set value c uom time id null else set value c uom time id new integer c uom time id c_uom_time_id_ad_reference_id setc_uom_time_id c_uom_time_id c_uom_time_id set_value c_uom_time_id set_value c_uom_time_id c_uom_time_id get uom for time standard unit of measure for time public int getc uom time id integer ii integer get value c uom time id if ii null return 0 return ii int value getc_uom_time_id get_value c_uom_time_id intvalue public static final int c uom volume id ad reference id 114 set uom for volume standard unit of measure for volume public void setc uom volume id int c uom volume id if c uom volume id 0 set value c uom volume id null else set value c uom volume id new integer c uom volume id c_uom_volume_id_ad_reference_id setc_uom_volume_id c_uom_volume_id c_uom_volume_id set_value c_uom_volume_id set_value c_uom_volume_id c_uom_volume_id get uom for volume standard unit of measure for volume public int getc uom volume id integer ii integer get value c uom volume id if ii null return 0 return ii int value getc_uom_volume_id get_value c_uom_volume_id intvalue public static final int c uom weight id ad reference id 114 set uom for weight standard unit of measure for weight public void setc uom weight id int c uom weight id if c uom weight id 0 set value c uom weight id null else set value c uom weight id new integer c uom weight id c_uom_weight_id_ad_reference_id setc_uom_weight_id c_uom_weight_id c_uom_weight_id set_value c_uom_weight_id set_value c_uom_weight_id c_uom_weight_id get uom for weight standard unit of measure for weight public int getc uom weight id integer ii integer get value c uom weight id if ii null return 0 return ii int value getc_uom_weight_id get_value c_uom_weight_id intvalue set discount calculated from line amounts payment discount calculation does not include taxes and charges public void set is discount line amt boolean is discount line amt set value is discount line amt new boolean is discount line amt setisdiscountlineamt isdiscountlineamt set_value isdiscountlineamt isdiscountlineamt get discount calculated from line amounts payment discount calculation does not include taxes and charges public boolean is discount line amt object oo get value is discount line amt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountlineamt get_value isdiscountlineamt booleanvalue set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue public static final int m productfreight id ad reference id 162 set product for freight public void setm productfreight id int m productfreight id if m productfreight id 0 set value m productfreight id null else set value m productfreight id new integer m productfreight id m_productfreight_id_ad_reference_id setm_productfreight_id m_productfreight_id m_productfreight_id set_value m_productfreight_id set_value m_productfreight_id m_productfreight_id get product for freight public int getm productfreight id integer ii integer get value m productfreight id if ii null return 0 return ii int value getm_productfreight_id get_value m_productfreight_id intvalue get report tree cached param ctx context param pa hierarchy id optional hierarchy param element type account schema element type return tree public static m report tree get properties ctx int pa hierarchy id string element type string key pa hierarchy id element type m report tree tree m report tree s trees get key if tree null tree new m report tree ctx pa hierarchy id element type s trees put key tree return tree pa_hierarchy_id elementtype mreporttree pa_hierarchy_id elementtype pa_hierarchy_id elementtype mreporttree mreporttree s_trees mreporttree pa_hierarchy_id elementtype s_trees get where clause param ctx context param pa hierarchy id optional hierarchy param element type account schema element type param id leaf element id return where clause public static string get where clause properties ctx int pa hierarchy id string element type int id m report tree tree get ctx pa hierarchy id element type return tree get where clause id pa_hierarchy_id elementtype getwhereclause pa_hierarchy_id elementtype mreporttree pa_hierarchy_id elementtype getwhereclause get child i ds param ctx context param pa hierarchy id optional hierarchie param element type account schema element type return array of i ds public static integer get childi ds properties ctx int pa hierarchy id string element type int id m report tree tree get ctx pa hierarchy id element type return tree get childi ds id ids pa_hierarchy_id elementtype ids getchildids pa_hierarchy_id elementtype mreporttree pa_hierarchy_id elementtype getchildids report tree param ctx context param pa hierarchy id optional hierarchy param element type account schema element type public m report tree properties ctx int pa hierarchy id string element type m elementtype element type m treetype m elementtype if m acct schema element elementtype account equals m elementtype m acct schema element elementtype userlist1 equals m elementtype m acct schema element elementtype userlist2 equals m elementtype m treetype m tree treetype elementvalue m pa hierarchy id pa hierarchy id m ctx ctx int ad tree id getad tree id not found if ad tree id 0 throw new illegal argument exception no ad tree id for tree type m treetype pa hierarchy id pa hierarchy id boolean client tree true m tree new m tree ctx ad tree id false client tree null pa_hierarchy_id elementtype mreporttree pa_hierarchy_id elementtype m_elementtype elementtype m_treetype m_elementtype macctschemaelement elementtype_account m_elementtype macctschemaelement elementtype_userlist1 m_elementtype macctschemaelement elementtype_userlist2 m_elementtype m_treetype mtree treetype_elementvalue m_pa_hierarchy_id pa_hierarchy_id m_ctx ad_tree_id getad_tree_id ad_tree_id illegalargumentexception ad_tree_id treetype m_treetype pa_hierarchy_id pa_hierarchy_id clienttree m_tree mtree ad_tree_id clienttree get ad tree id return tree protected int getad tree id if m pa hierarchy id 0 return getdefaultad tree id m hierarchy hierarchy m hierarchy get m ctx m pa hierarchy id int ad tree id hierarchy getad tree id m treetype if ad tree id 0 return getdefaultad tree id return ad tree id ad_tree_id getad_tree_id m_pa_hierarchy_id getdefaultad_tree_id mhierarchy mhierarchy m_ctx m_pa_hierarchy_id ad_tree_id getad_tree_id m_treetype ad_tree_id getdefaultad_tree_id ad_tree_id get default ad tree id see m tree getdefaultad tree id return tree protected int getdefaultad tree id int ad tree id 0 int ad client id env getad client id m ctx string sql select ad tree id name from ad tree where ad client id and tree type and is active y and is all nodes y order by is default desc ad tree id assumes first is primary tree try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set string 2 m treetype result set rs pstmt execute query if rs next ad tree id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return ad tree id ad_tree_id mtree getdefaultad_tree_id getdefaultad_tree_id ad_tree_id ad_client_id getad_client_id m_ctx ad_tree_id ad_tree ad_client_id treetype isactive isallnodes isdefault ad_tree_id preparedstatement preparestatement setint ad_client_id setstring m_treetype resultset executequery ad_tree_id getint sqlexception ad_tree_id get account schema element type return element type public string get element type return m elementtype getelementtype m_elementtype get tree type return tree type public string get tree type return m treetype gettreetype m_treetype get tree return tree public m tree get tree return m tree mtree gettree m_tree get where clause param id start node return column name 1 or column name in 1 2 3 public string get where clause int id log fine m elementtype id id string column name m acct schema element get column name m elementtype m tree node node m tree get root find node id log finest root node string buffer result null if node null node is summary string buffer sb new string buffer enumeration en node preorder enumeration while en has more elements m tree node nn m tree node en next element if nn is summary if sb length 0 sb append sb append nn getnode id log finest nn else log finest skipped parent nn result new string buffer column name append in append sb append else not found or not summary result new string buffer column name append append id log finest result to string return result to string columnname columnname getwhereclause m_elementtype columnname macctschemaelement getcolumnname m_elementtype mtreenode m_tree getroot findnode stringbuffer issummary stringbuffer stringbuffer preorderenumeration hasmoreelements mtreenode mtreenode nextelement issummary getnode_id stringbuffer columnname stringbuffer columnname tostring tostring get child i ds param id start node return array if i ds public integer get childi ds int id log fine m elementtype id id array list integer list new array list integer m tree node node m tree get root find node id log finest root node if node null node is summary enumeration en node preorder enumeration while en has more elements m tree node nn m tree node en next element if nn is summary list add new integer nn getnode id log finest nn else log finest skipped parent nn else not found or not summary list add new integer id integer ret value new integer list size list to array ret value return ret value ids ids getchildids m_elementtype arraylist arraylist mtreenode m_tree getroot findnode issummary preorderenumeration hasmoreelements mtreenode mtreenode nextelement issummary getnode_id retvalue toarray retvalue retvalue string representation return info public string to string string buffer sb new string buffer m report tree element type sb append m elementtype append tree type append m treetype append append m tree append return sb to string tostring stringbuffer stringbuffer mreporttree elementtype m_elementtype treetype m_treetype m_tree tostring get contsnts return contents public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name log fine prepare para i if para i get parameter null else if name equals c doctype id p c doctype id big decimal para i get parameter int value else if name equals date promised p datepromised timestamp para i get parameter else if name equals is test p istest y equals para i get parameter else log log level severe prepare unknown parameter name p m distributionrun id getrecord id processinfoparameter getparameter getparametername getparameter c_doctype_id p_c_doctype_id bigdecimal getparameter intvalue datepromised p_datepromised getparameter istest p_istest getparameter p_m_distributionrun_id getrecord_id perform process return message text with variables throws exception if not successful protected string do it throws exception log info m distributionrun id p m distributionrun id c doctype id p c doctype id date promised p datepromised test p istest distribution run if p m distributionrun id 0 throw new illegal argument exception no distribution run id m run new m distribution run get ctx p m distributionrun id get trxname if m run get id 0 throw new exception distribution run not found m distributionrun id p m distributionrun id m runlines m run get lines false if m runlines null m runlines length 0 throw new exception no active non zero distribution run lines found document type if p c doctype id 0 throw new illegal argument exception no document type id m doctype new m doc type get ctx p c doctype id get trxname if m doctype get id 0 throw new exception documentation type not found c doctype id p c doctype id m dateordered new timestamp system current time millis if p datepromised null p datepromised m dateordered create temp lines if insert details 0 throw new exception no lines order by distribution run line m details m distribution run detail get get ctx p m distributionrun id false first run add round add allocations do allocation int loops 0 while is allocation eq total adjust allocation add allocations if loops 10 throw new exception loop detected more than 10 allocation attempts order by business partner m details m distribution run detail get get ctx p m distributionrun id true create orders create orders return created m counter doit m_distributionrun_id p_m_distributionrun_id c_doctype_id p_c_doctype_id datepromised p_datepromised p_istest p_m_distributionrun_id illegalargumentexception m_run mdistributionrun getctx p_m_distributionrun_id get_trxname m_run get_id m_distributionrun_id p_m_distributionrun_id m_runlines m_run getlines m_runlines m_runlines p_c_doctype_id illegalargumentexception m_doctype mdoctype getctx p_c_doctype_id get_trxname m_doctype get_id c_doctype_id p_c_doctype_id m_dateordered currenttimemillis p_datepromised p_datepromised m_dateordered insertdetails m_details mdistributionrundetail getctx p_m_distributionrun_id addallocations isallocationeqtotal adjustallocation addallocations m_details mdistributionrundetail getctx p_m_distributionrun_id createorders m_counter insert details return number of rows inserted private int insert details handle null string sql update m distributionrunline set min qty 0 where min qty is null int no db execute update sql get trxname sql update m distributionlistline set min qty 0 where min qty is null no db execute update sql get trxname total ratio sql update m distributionlist l set ratio total select sum ratio from m distributionlistline ll where l m distributionlist id ll m distributionlist id where exists select from m distributionrunline rl where l m distributionlist id rl m distributionlist id and rl m distributionrun id p m distributionrun id no db execute update sql get trxname delete old sql delete from t distributionrundetail where m distributionrun id p m distributionrun id no db execute update sql get trxname log fine insert details deleted no insert new sql insert into t distributionrundetail m distributionrun id m distributionrunline id m distributionlist id m distributionlistline id ad client id ad org id is active created created by updated updated by c bpartner id c bpartner location id m product id ratio min qty qty select rl m distributionrun id rl m distributionrunline id ll m distributionlist id ll m distributionlistline id rl ad client id rl ad org id rl is active rl created rl created by rl updated rl updated by ll c bpartner id ll c bpartner location id rl m product id ll ratio case when rl min qty ll min qty then rl min qty else ll min qty end ll ratio l ratio total rl total qty from m distributionrunline rl inner join m distributionlist l on rl m distributionlist id l m distributionlist id inner join m distributionlistline ll on rl m distributionlist id ll m distributionlist id where rl m distributionrun id p m distributionrun id and l ratio total 0 and rl is active y and ll is active y no db execute update sql get trxname log fine inserted no return no insertdetails m_distributionrunline minqty minqty executeupdate get_trxname m_distributionlistline minqty minqty executeupdate get_trxname m_distributionlist ratiototal m_distributionlistline m_distributionlist_id m_distributionlist_id m_distributionrunline m_distributionlist_id m_distributionlist_id m_distributionrun_id p_m_distributionrun_id executeupdate get_trxname t_distributionrundetail m_distributionrun_id p_m_distributionrun_id executeupdate get_trxname insertdetails t_distributionrundetail m_distributionrun_id m_distributionrunline_id m_distributionlist_id m_distributionlistline_id ad_client_id ad_org_id isactive createdby updatedby c_bpartner_id c_bpartner_location_id m_product_id minqty m_distributionrun_id m_distributionrunline_id m_distributionlist_id m_distributionlistline_id ad_client_id ad_org_id isactive createdby updatedby c_bpartner_id c_bpartner_location_id m_product_id minqty minqty minqty minqty ratiototal totalqty m_distributionrunline m_distributionlist m_distributionlist_id m_distributionlist_id m_distributionlistline m_distributionlist_id m_distributionlist_id m_distributionrun_id p_m_distributionrun_id ratiototal isactive isactive executeupdate get_trxname add up allocations private void add allocations reset for int j 0 j m runlines length j m distribution run line run line m runlines j run line reset calculations add up for int i 0 i m details length i m distribution run detail detail m details i for int j 0 j m runlines length j m distribution run line run line m runlines j if run line getm distributionrunline id detail getm distributionrunline id round detail round run line get standard precision add run line add actual min detail get min qty run line add actual qty detail get qty run line add actual allocation detail get actual allocation run line set max allocation detail get actual allocation false log fine run line run line get line bp id detail getc bpartner id min detail get min qty qty detail get qty allocation detail get actual allocation continue for all detail lines info for int j 0 j m runlines length j m distribution run line run line m runlines j log fine run run line get info addallocations m_runlines mdistributionrunline runline m_runlines runline resetcalculations m_details mdistributionrundetail m_details m_runlines mdistributionrunline runline m_runlines runline getm_distributionrunline_id getm_distributionrunline_id runline getstandardprecision runline addactualmin getminqty runline addactualqty getqty runline addactualallocation getactualallocation runline setmaxallocation getactualallocation runline runline getline bp_id getc_bpartner_id getminqty getqty getactualallocation m_runlines mdistributionrunline runline m_runlines runline getinfo is allocation equals total return true if allocation eq total throws exception private boolean is allocation eq total throws exception boolean allocation eq total true check total min qty delta for int j 0 j m runlines length j m distribution run line run line m runlines j if run line is actual min gt total throw new exception line run line get line sum of min qty run line get actual min is greater than total qty run line get total qty if allocation eq total run line is actual allocation eq total allocation eq total false for all run lines log info allocation eq total return allocation eq total isallocationeqtotal allocationeqtotal m_runlines mdistributionrunline runline m_runlines runline isactualmingttotal runline getline runline getactualmin runline gettotalqty allocationeqtotal runline isactualallocationeqtotal allocationeqtotal allocationeqtotal allocationeqtotal adjust allocation private void adjust allocation throws exception for int j 0 j m runlines length j adjust allocation j adjustallocation m_runlines adjustallocation adjust run line allocation param index run line index private void adjust allocation int index throws exception m distribution run line run line m runlines index big decimal difference run line get actual allocation diff if difference compare to env zero 0 return adjust when difference is 1 1 or last difference is the same boolean adjust biggest difference abs compare to env one 0 difference abs compare to run line get last difference abs 0 log fine line run line get line diff difference adjust adjust biggest adjust biggest amount if adjust biggest for int i 0 i m details length i m distribution run detail detail m details i if run line getm distributionrunline id detail getm distributionrunline id log fine biggest detail allocation detail get actual allocation max allocation run line get max allocation can adjust detail is can adjust if detail get actual allocation compare to run line get max allocation 0 detail is can adjust detail adjust qty difference detail save return for all detail lines throw new exception cannot adjust difference difference you need to change total qty or min qty else distibute new total ratio big decimal ratio total env zero for int i 0 i m details length i m distribution run detail detail m details i if run line getm distributionrunline id detail getm distributionrunline id if detail is can adjust ratio total ratio total add detail get ratio if ratio total compare to env zero 0 throw new exception cannot distribute difference difference you need to change total qty or min qty distribute for int i 0 i m details length i m distribution run detail detail m details i if run line getm distributionrunline id detail getm distributionrunline id if detail is can adjust big decimal diff ratio detail get ratio multiply difference divide ratio total big decimal round half up precision from total detail adjust qty diff ratio detail save run line set last difference difference adjustallocation mdistributionrunline runline m_runlines bigdecimal runline getactualallocationdiff compareto adjustbiggest compareto compareto runline getlastdifference runline getline adjustbiggest adjustbiggest m_details mdistributionrundetail m_details runline getm_distributionrunline_id getm_distributionrunline_id detailallocation getactualallocation maxallocation runline getmaxallocation canadjust iscanadjust getactualallocation compareto runline getmaxallocation iscanadjust adjustqty bigdecimal ratiototal m_details mdistributionrundetail m_details runline getm_distributionrunline_id getm_distributionrunline_id iscanadjust ratiototal ratiototal getratio ratiototal compareto m_details mdistributionrundetail m_details runline getm_distributionrunline_id getm_distributionrunline_id iscanadjust bigdecimal diffratio getratio ratiototal bigdecimal round_half_up adjustqty diffratio runline setlastdifference create orders private boolean create orders get counter org bp int runad org id m run getad org id if runad org id 0 runad org id env getad org id get ctx m org run org m org get get ctx runad org id int runc bpartner id run org getlinkedc bpartner id boolean counter m run is create single order no single order runc bpartner id 0 org linked to bp m doctype isso trx po mb partner runb partner counter new mb partner get ctx runc bpartner id get trxname null if counter runb partner null runb partner get id runc bpartner id counter false if counter log info runbp runb partner m doctype log info single m run is create single order m doctype so m doctype isso trx log fine counter counter c bpartner id runc bpartner id runb partner mb partner bp null m order single order null m product product null consolidated order if m run is create single order bp new mb partner get ctx m run getc bpartner id get trxname if bp get id 0 throw new illegal argument exception business partner not found c bpartner id m run getc bpartner id if p istest single order new m order get ctx 0 get trxname single order setc doctypetarget id m doctype getc doctype id single order setc doctype id m doctype getc doctype id single order set isso trx m doctype isso trx single order setb partner bp if m run getc bpartner location id 0 single order setc bpartner location id m run getc bpartner location id single order set date ordered m dateordered single order set date promised p datepromised if single order save log log level severe order not saved return false m counter int lastc bpartner id 0 int lastc bpartner location id 0 m order order null for all lines for int i 0 i m details length i m distribution run detail detail m details i create order header if m run is create single order order single order new business partner else if lastc bpartner id detail getc bpartner id lastc bpartner location id detail getc bpartner location id finish order order null lastc bpartner id detail getc bpartner id lastc bpartner location id detail getc bpartner location id new order if order null bp new mb partner get ctx detail getc bpartner id get trxname if p istest order new m order get ctx 0 get trxname order setc doctypetarget id m doctype getc doctype id order setc doctype id m doctype getc doctype id order set isso trx m doctype isso trx counter doc if counter bp getad orgbp id int 0 log fine counter from bporg bp getad orgbp id int bp to bp runb partner order setad org id bp getad orgbp id int m org info oi m org info get get ctx bp getad orgbp id int if oi getm warehouse id 0 order setm warehouse id oi getm warehouse id order setb partner runb partner else normal log fine from org runad org id to bp bp order setad org id runad org id order setb partner bp if detail getc bpartner location id 0 order setc bpartner location id detail getc bpartner location id order set date ordered m dateordered order set date promised p datepromised if order save log log level severe order not saved return false line if product null product getm product id detail getm product id product m product get get ctx detail getm product id if p istest add log 0 null detail get actual allocation bp get name product get name continue create order line m order line line new m order line order if counter bp getad orgbp id int 0 don t overwrite counter doc else normal optionally overwrite line setc bpartner id detail getc bpartner id if detail getc bpartner location id 0 line setc bpartner location id detail getc bpartner location id line set product product line set qty detail get actual allocation line set price if line save log log level severe order line not saved return false add log 0 null detail get actual allocation order get document no bp get name product get name finish order order null return true createorders runad_org_id m_run getad_org_id runad_org_id runad_org_id getad_org_id getctx morg runorg morg getctx runad_org_id runc_bpartner_id runorg getlinkedc_bpartner_id m_run iscreatesingleorder runc_bpartner_id m_doctype issotrx mbpartner runbpartner mbpartner getctx runc_bpartner_id get_trxname runbpartner runbpartner get_id runc_bpartner_id runbpartner m_doctype m_run iscreatesingleorder m_doctype m_doctype issotrx c_bpartner_id runc_bpartner_id runbpartner mbpartner morder singleorder mproduct m_run iscreatesingleorder mbpartner getctx m_run getc_bpartner_id get_trxname get_id illegalargumentexception c_bpartner_id m_run getc_bpartner_id p_istest singleorder morder getctx get_trxname singleorder setc_doctypetarget_id m_doctype getc_doctype_id singleorder setc_doctype_id m_doctype getc_doctype_id singleorder setissotrx m_doctype issotrx singleorder setbpartner m_run getc_bpartner_location_id singleorder setc_bpartner_location_id m_run getc_bpartner_location_id singleorder setdateordered m_dateordered singleorder setdatepromised p_datepromised singleorder m_counter lastc_bpartner_id lastc_bpartner_location_id morder m_details mdistributionrundetail m_details m_run iscreatesingleorder singleorder lastc_bpartner_id getc_bpartner_id lastc_bpartner_location_id getc_bpartner_location_id lastc_bpartner_id getc_bpartner_id lastc_bpartner_location_id getc_bpartner_location_id mbpartner getctx getc_bpartner_id get_trxname p_istest morder getctx get_trxname setc_doctypetarget_id m_doctype getc_doctype_id setc_doctype_id m_doctype getc_doctype_id setissotrx m_doctype issotrx getad_orgbp_id_int from_bporg getad_orgbp_id_int to_bp runbpartner setad_org_id getad_orgbp_id_int morginfo morginfo getctx getad_orgbp_id_int getm_warehouse_id setm_warehouse_id getm_warehouse_id setbpartner runbpartner from_org runad_org_id to_bp setad_org_id runad_org_id setbpartner getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id setdateordered m_dateordered setdatepromised p_datepromised getm_product_id getm_product_id mproduct getctx getm_product_id p_istest addlog getactualallocation getname getname morderline morderline getad_orgbp_id_int setc_bpartner_id getc_bpartner_id getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id setproduct setqty getactualallocation setprice orderline addlog getactualallocation getdocumentno getname getname compiere scoll pane public c scroll pane this null vertical scrollbar as needed horizontal scrollbar as needed scollpane cscrollpane vertical_scrollbar_as_needed horizontal_scrollbar_as_needed compiere scoll pane param vsb policy vertical policy param hsb policy horizontal policy public c scroll pane int vsb policy int hsb policy this null vsb policy hsb policy scollpane vsbpolicy hsbpolicy cscrollpane vsbpolicy hsbpolicy vsbpolicy hsbpolicy compiere scoll pane param view view public c scroll pane component view this view vertical scrollbar as needed horizontal scrollbar as needed scollpane cscrollpane vertical_scrollbar_as_needed horizontal_scrollbar_as_needed compiere scoll pane param view view param vsb policy vertical policy param hsb policy horizontal policy public c scroll pane component view int vsb policy int hsb policy super view vsb policy hsb policy set background color null set opaque false get viewport set opaque false scollpane vsbpolicy hsbpolicy cscrollpane vsbpolicy hsbpolicy vsbpolicy hsbpolicy setbackgroundcolor setopaque getviewport setopaque set background param bg compiere color for background if null set standard background public void set background color compiere color bg if bg null bg compiere panelui get default background put client property compiereplaf background bg super set background bg get flat color get viewport put client property compiereplaf background bg get viewport set background bg get flat color get viewport set opaque true compierecolor setbackgroundcolor compierecolor compierepanelui getdefaultbackground putclientproperty setbackground getflatcolor getviewport putclientproperty getviewport setbackground getflatcolor getviewport setopaque standard constructor public x m lot properties ctx int m lot id string trx name super ctx m lot id trx name if m lot id 0 setm lot id 0 setm product id 0 set name null x_m_lot m_lot_id trxname m_lot_id trxname m_lot_id setm_lot_id setm_product_id setname load constructor public x m lot properties ctx result set rs string trx name super ctx rs trx name x_m_lot resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m lot append get id append return sb to string tostring stringbuffer stringbuffer x_m_lot get_id tostring set date from starting date for a range public void set date from timestamp date from set value date from date from setdatefrom datefrom set_value datefrom datefrom get date from starting date for a range public timestamp get date from return timestamp get value date from getdatefrom get_value datefrom set date to end date of a date range public void set date to timestamp date to set value date to date to setdateto dateto set_value dateto dateto get date to end date of a date range public timestamp get date to return timestamp get value date to getdateto get_value dateto set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set lot control product lot control public void setm lotctl id int m lotctl id if m lotctl id 0 set valuenocheck m lotctl id null else set valuenocheck m lotctl id new integer m lotctl id setm_lotctl_id m_lotctl_id m_lotctl_id set_valuenocheck m_lotctl_id set_valuenocheck m_lotctl_id m_lotctl_id get lot control product lot control public int getm lotctl id integer ii integer get value m lotctl id if ii null return 0 return ii int value getm_lotctl_id get_value m_lotctl_id intvalue set lot product lot definition public void setm lot id int m lot id if m lot id 1 throw new illegal argument exception m lot id is mandatory set valuenocheck m lot id new integer m lot id setm_lot_id m_lot_id m_lot_id illegalargumentexception m_lot_id set_valuenocheck m_lot_id m_lot_id get lot product lot definition public int getm lot id integer ii integer get value m lot id if ii null return 0 return ii int value getm_lot_id get_value m_lot_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm product id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_product_id set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id big decimal para i get parameter int value else if name equals ad org id p ad org id big decimal para i get parameter int value else if name equals m locator id p m locator id big decimal para i get parameter int value else if name equals movement date p movementdate timestamp para i get parameter else if name equals delete old imported p deleteoldimported y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id bigdecimal getparameter intvalue ad_org_id p_ad_org_id bigdecimal getparameter intvalue m_locator_id p_m_locator_id bigdecimal getparameter intvalue movementdate p_movementdate getparameter deleteoldimported p_deleteoldimported getparameter perrform process return message throws exception protected string do it throws java lang exception log info m locator id p m locator id movement date p movementdate string buffer sql null int no 0 string client check and ad client id p ad client id prepare delete old imported if p deleteoldimported sql new string buffer delete i inventory where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org location is active created updated sql new string buffer update i inventory set ad client id coalesce ad client id append p ad client id append ad org id coalesce ad org id append p ad org id append if p movementdate null sql append movement date coalesce movement date append db to date p movementdate append sql append is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null m warehouse id null reset i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no sql new string buffer update i inventory o set i isimported e i errormsg i errormsg err invalid org where ad org id is null or ad org id 0 or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid org no location sql new string buffer update i inventory i set m locator id select m locator id from m locator l where i locator value l value and i ad client id l ad client id and rownum 1 where m locator id is null and locator value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set locator from value no sql new string buffer update i inventory i set m locator id select m locator id from m locator l where i x l x and i y l y and i z l z and i ad client id l ad client id and rownum 1 where m locator id is null and x is not null and y is not null and z is not null and i isimported y append client check no db execute update sql to string get trxname log fine set locator from x y z no if p m locator id 0 sql new string buffer update i inventory set m locator id append p m locator id append where m locator id is null and i isimported y append client check no db execute update sql to string get trxname log fine set locator from parameter no sql new string buffer update i inventory set i isimported e i errormsg i errormsg err no location where m locator id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no location no set m warehouse id sql new string buffer update i inventory i set m warehouse id select m warehouse id from m locator l where i m locator id l m locator id where m locator id is not null and i isimported y append client check no db execute update sql to string get trxname log fine set warehouse from locator no sql new string buffer update i inventory set i isimported e i errormsg i errormsg err no warehouse where m warehouse id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no warehouse no product sql new string buffer update i inventory i set m product id select m product id from m product p where i value p value and i ad client id p ad client id and rownum 1 where m product id is null and value is not null and i isimported y append client check no db execute update sql to string get trxname log fine set product from value no sql new string buffer update i inventory i set m product id select m product id from m product p where i upc p upc and i ad client id p ad client id and rownum 1 where m product id is null and upc is not null and i isimported y append client check no db execute update sql to string get trxname log fine set product from upc no sql new string buffer update i inventory set i isimported e i errormsg i errormsg err no product where m product id is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no product no no qty count sql new string buffer update i inventory set i isimported e i errormsg i errormsg err no qty count where qty count is null and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning no qty count no commit m inventory inventory null int no insert 0 int no insert line 0 go through inventory records sql new string buffer select from i inventory where i isimported n append client check append order by m warehouse id trunc movement date i inventory id try prepared statement pstmt db prepare statement sql to string get trxname result set rs pstmt execute query int x m warehouse id 1 timestamp x movementdate null while rs next x i inventory imp new x i inventory get ctx rs get trxname timestamp movement date time util get day imp get movement date if inventory null imp getm warehouse id x m warehouse id movement date equals x movementdate inventory new m inventory get ctx 0 get trxname inventory set client org imp getad client id imp getad org id inventory set description i imp getm warehouse id movement date inventory setm warehouse id imp getm warehouse id inventory set movement date movement date if inventory save log log level severe inventory not saved break x m warehouse id imp getm warehouse id x movementdate movement date no insert line int m attributesetinstance id 0 if imp get lot null imp get ser no null m product product m product get get ctx imp getm product id if product is instance attribute m attribute set mas product get attribute set m attribute set instance masi new m attribute set instance get ctx 0 mas getm attributeset id get trxname if mas is lot imp get lot null masi set lot imp get lot imp getm product id if mas is ser no imp get ser no null masi set ser no imp get ser no masi set description masi save m attributesetinstance id masi getm attributesetinstance id m inventory line line new m inventory line inventory imp getm locator id imp getm product id m attributesetinstance id imp get qty book imp get qty count if line save imp seti isimported true imp setm inventory id line getm inventory id imp setm inventoryline id line getm inventoryline id imp set processed true if imp save no insert line rs close pstmt close catch exception e log log level severe sql to string e set error to indicator to not imported sql new string buffer update i inventory set i isimported n updated sys date where i isimported y append client check no db execute update sql to string get trxname add log 0 null new big decimal no errors add log 0 null new big decimal no insert m inventory id inserted add log 0 null new big decimal no insert line m inventoryline id inserted return doit m_locator_id p_m_locator_id movementdate p_movementdate stringbuffer clientcheck ad_client_id p_ad_client_id p_deleteoldimported stringbuffer i_inventory i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_inventory ad_client_id ad_client_id p_ad_client_id ad_org_id ad_org_id p_ad_org_id p_movementdate movementdate movementdate to_date p_movementdate isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg m_warehouse_id i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_inventory i_isimported i_errormsg i_errormsg ad_org_id ad_org_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory m_locator_id m_locator_id m_locator locatorvalue ad_client_id ad_client_id m_locator_id locatorvalue i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory m_locator_id m_locator_id m_locator ad_client_id ad_client_id m_locator_id i_isimported clientcheck executeupdate tostring get_trxname p_m_locator_id stringbuffer i_inventory m_locator_id p_m_locator_id m_locator_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory i_isimported i_errormsg i_errormsg m_locator_id i_isimported clientcheck executeupdate tostring get_trxname m_warehouse_id stringbuffer i_inventory m_warehouse_id m_warehouse_id m_locator m_locator_id m_locator_id m_locator_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory i_isimported i_errormsg i_errormsg m_warehouse_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory m_product_id m_product_id m_product ad_client_id ad_client_id m_product_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory m_product_id m_product_id m_product ad_client_id ad_client_id m_product_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_inventory i_isimported i_errormsg i_errormsg m_product_id i_isimported clientcheck executeupdate tostring get_trxname qtycount stringbuffer i_inventory i_isimported i_errormsg i_errormsg qtycount i_isimported clientcheck executeupdate tostring get_trxname qtycount minventory noinsert noinsertline stringbuffer i_inventory i_isimported clientcheck m_warehouse_id movementdate i_inventory_id preparedstatement preparestatement tostring get_trxname resultset executequery x_m_warehouse_id x_movementdate x_i_inventory x_i_inventory getctx get_trxname movementdate timeutil getday getmovementdate getm_warehouse_id x_m_warehouse_id movementdate x_movementdate minventory getctx get_trxname setclientorg getad_client_id getad_org_id setdescription getm_warehouse_id movementdate setm_warehouse_id getm_warehouse_id setmovementdate movementdate x_m_warehouse_id getm_warehouse_id x_movementdate movementdate noinsert m_attributesetinstance_id getlot getserno mproduct mproduct getctx getm_product_id isinstanceattribute mattributeset getattributeset mattributesetinstance mattributesetinstance getctx getm_attributeset_id get_trxname islot getlot setlot getlot getm_product_id isserno getserno setserno getserno setdescription m_attributesetinstance_id getm_attributesetinstance_id minventoryline minventoryline getm_locator_id getm_product_id m_attributesetinstance_id getqtybook getqtycount seti_isimported setm_inventory_id getm_inventory_id setm_inventoryline_id getm_inventoryline_id setprocessed noinsertline tostring stringbuffer i_inventory i_isimported sysdate i_isimported clientcheck executeupdate tostring get_trxname addlog bigdecimal addlog bigdecimal noinsert m_inventory_id addlog bigdecimal noinsertline m_inventoryline_id standard constructor public x c bankstatementloader properties ctx int c bankstatementloader id string trx name super ctx c bankstatementloader id trx name if c bankstatementloader id 0 setc bankaccount id 0 setc bankstatementloader id 0 set name null x_c_bankstatementloader c_bankstatementloader_id trxname c_bankstatementloader_id trxname c_bankstatementloader_id setc_bankaccount_id setc_bankstatementloader_id setname load constructor public x c bankstatementloader properties ctx result set rs string trx name super ctx rs trx name x_c_bankstatementloader resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankstatementloader append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankstatementloader get_id tostring set account no account number public void set account no string account no if account no null account no length 20 log warning length 20 truncated account no account no substring 0 19 set value account no account no setaccountno accountno accountno accountno accountno accountno set_value accountno accountno get account no account number public string get account no return string get value account no getaccountno get_value accountno set branch id bank branch id public void set branchid string branchid if branchid null branchid length 20 log warning length 20 truncated branchid branchid substring 0 19 set value branchid branchid setbranchid set_value get branch id bank branch id public string get branchid return string get value branchid getbranchid get_value set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set valuenocheck c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_valuenocheck c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set bank statement loader definition of bank statement loader swift ofx public void setc bankstatementloader id int c bankstatementloader id if c bankstatementloader id 1 throw new illegal argument exception c bankstatementloader id is mandatory set valuenocheck c bankstatementloader id new integer c bankstatementloader id setc_bankstatementloader_id c_bankstatementloader_id c_bankstatementloader_id illegalargumentexception c_bankstatementloader_id set_valuenocheck c_bankstatementloader_id c_bankstatementloader_id get bank statement loader definition of bank statement loader swift ofx public int getc bankstatementloader id integer ii integer get value c bankstatementloader id if ii null return 0 return ii int value getc_bankstatementloader_id get_value c_bankstatementloader_id intvalue set date format date format used in the imput format public void set date format string date format if date format null date format length 20 log warning length 20 truncated date format date format substring 0 19 set value date format date format setdateformat dateformat dateformat dateformat dateformat dateformat set_value dateformat dateformat get date format date format used in the imput format public string get date format return string get value date format getdateformat get_value dateformat set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set file name name of the local file or url public void set file name string file name if file name null file name length 120 log warning length 120 truncated file name file name substring 0 119 set value file name file name setfilename filename filename filename filename filename set_value filename filename get file name name of the local file or url public string get file name return string get value file name getfilename get_value filename set financial institution id the id of the financial institution bank public void set financial institutionid string financial institutionid if financial institutionid null financial institutionid length 20 log warning length 20 truncated financial institutionid financial institutionid substring 0 19 set value financial institutionid financial institutionid setfinancialinstitutionid financialinstitutionid financialinstitutionid financialinstitutionid financialinstitutionid financialinstitutionid set_value financialinstitutionid financialinstitutionid get financial institution id the id of the financial institution bank public string get financial institutionid return string get value financial institutionid getfinancialinstitutionid get_value financialinstitutionid set host address host address url or dns public void set host address string host address if host address null host address length 60 log warning length 60 truncated host address host address substring 0 59 set value host address host address sethostaddress hostaddress hostaddress hostaddress hostaddress hostaddress set_value hostaddress hostaddress get host address host address url or dns public string get host address return string get value host address gethostaddress get_value hostaddress set host port host communication port public void set host port int host port set value host port new integer host port sethostport hostport set_value hostport hostport get host port host communication port public int get host port integer ii integer get value host port if ii null return 0 return ii int value gethostport get_value hostport intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set pin personal identification number public void setpin string pin if pin null pin length 20 log warning length 20 truncated pin pin substring 0 19 set value pin pin set_value get pin personal identification number public string getpin return string get value pin get_value set password password of any length case sensitive public void set password string password if password null password length 60 log warning length 60 truncated password password substring 0 59 set value password password setpassword set_value get password password of any length case sensitive public string get password return string get value password getpassword get_value set proxy address address of your proxy server public void set proxy address string proxy address if proxy address null proxy address length 60 log warning length 60 truncated proxy address proxy address substring 0 59 set value proxy address proxy address setproxyaddress proxyaddress proxyaddress proxyaddress proxyaddress proxyaddress set_value proxyaddress proxyaddress get proxy address address of your proxy server public string get proxy address return string get value proxy address getproxyaddress get_value proxyaddress set proxy logon logon of your proxy server public void set proxy logon string proxy logon if proxy logon null proxy logon length 60 log warning length 60 truncated proxy logon proxy logon substring 0 59 set value proxy logon proxy logon setproxylogon proxylogon proxylogon proxylogon proxylogon proxylogon set_value proxylogon proxylogon get proxy logon logon of your proxy server public string get proxy logon return string get value proxy logon getproxylogon get_value proxylogon set proxy password password of your proxy server public void set proxy password string proxy password if proxy password null proxy password length 60 log warning length 60 truncated proxy password proxy password substring 0 59 set value proxy password proxy password setproxypassword proxypassword proxypassword proxypassword proxypassword proxypassword set_value proxypassword proxypassword get proxy password password of your proxy server public string get proxy password return string get value proxy password getproxypassword get_value proxypassword set proxy port port of your proxy server public void set proxy port int proxy port set value proxy port new integer proxy port setproxyport proxyport set_value proxyport proxyport get proxy port port of your proxy server public int get proxy port integer ii integer get value proxy port if ii null return 0 return ii int value getproxyport get_value proxyport intvalue set statement loader class class name of the bank statement loader public void set stmt loader class string stmt loader class if stmt loader class null stmt loader class length 60 log warning length 60 truncated stmt loader class stmt loader class substring 0 59 set value stmt loader class stmt loader class setstmtloaderclass stmtloaderclass stmtloaderclass stmtloaderclass stmtloaderclass stmtloaderclass set_value stmtloaderclass stmtloaderclass get statement loader class class name of the bank statement loader public string get stmt loader class return string get value stmt loader class getstmtloaderclass get_value stmtloaderclass set user id user id or account number public void set userid string userid if userid null userid length 60 log warning length 60 truncated userid userid substring 0 59 set value userid userid setuserid set_value get user id user id or account number public string get userid return string get value userid getuserid get_value get content return content public object get contents return contents getcontents standard constructor public x c invoicetax properties ctx int c invoicetax id string trx name super ctx c invoicetax id trx name if c invoicetax id 0 setc invoice id 0 setc tax id 0 set is tax included false set processed false set tax amt env zero set tax base amt env zero x_c_invoicetax c_invoicetax_id trxname c_invoicetax_id trxname c_invoicetax_id setc_invoice_id setc_tax_id setistaxincluded setprocessed settaxamt settaxbaseamt load constructor public x c invoicetax properties ctx result set rs string trx name super ctx rs trx name x_c_invoicetax resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoicetax append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoicetax get_id tostring set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt if tax amt null throw new illegal argument exception tax amt is mandatory set valuenocheck tax amt tax amt settaxamt bigdecimal taxamt taxamt illegalargumentexception taxamt set_valuenocheck taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt set tax base amount base for calculating the tax amount public void set tax base amt big decimal tax base amt if tax base amt null throw new illegal argument exception tax base amt is mandatory set valuenocheck tax base amt tax base amt settaxbaseamt bigdecimal taxbaseamt taxbaseamt illegalargumentexception taxbaseamt set_valuenocheck taxbaseamt taxbaseamt get tax base amount base for calculating the tax amount public big decimal get tax base amt big decimal bd big decimal get value tax base amt if bd null return env zero return bd bigdecimal gettaxbaseamt bigdecimal bigdecimal get_value taxbaseamt constructor public id column editor m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center m check add action listener this idcolumneditor m_check setmargin m_check sethorizontalalignment jlabel m_check addactionlistener return selection status as id column return value public object get cell editor value log fine id column editor get cell editor value m check is selected if m value null m value set selected m check is selected return m value idcolumn getcelleditorvalue idcolumneditor getcelleditorvalue m_check isselected m_value m_value setselected m_check isselected m_value get visual component param table param value param is selected param row param column return component public component get table cell editor component j table table object value boolean is selected int row int column log fine id column editor get table cell editor component value m table table set value if value null value instanceof id column m value id column value else m value null throw new illegal argument exception ic column editor get table cell editor component value value set editor value m check set selected m value is selected return m check isselected gettablecelleditorcomponent jtable isselected idcolumneditor gettablecelleditorcomponent m_table idcolumn m_value idcolumn m_value illegalargumentexception iccolumneditor gettablecelleditorcomponent m_check setselected m_value isselected m_check can we edit it param an event return true cobstant public boolean is cell editable event object an event return true anevent iscelleditable eventobject anevent can the cell be selected param an event return true constant public boolean should select cell event object an event return true anevent shouldselectcell eventobject anevent action listener param e public void action performed action event e if m table null m table editing stopped new change event this actionperformed actionevent m_table m_table editingstopped changeevent constructor param ctx context param m attributevalue id id public m attribute value properties ctx int m attributevalue id string trx name super ctx m attributevalue id trx name if m attributevalue id 0 setm attributevalue id 0 setm attribute id 0 set name null set value null m_attributevalue_id mattributevalue m_attributevalue_id trxname m_attributevalue_id trxname m_attributevalue_id setm_attributevalue_id setm_attribute_id setname setvalue load constructor param ctx context param rs result set public m attribute value properties ctx result set rs string trx name super ctx rs trx name mattributevalue resultset trxname trxname string representation return info public string to string return get name tostring getname get contents return context public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name p ad column id getrecord id processinfoparameter getparameter getparametername getparameter p_ad_column_id getrecord_id process return message throws exception protected string do it throws exception log info c column id p ad column id if p ad column id 0 throw new compiere user error no ad column id m column column new m column get ctx p ad column id get trxname if column get id 0 throw new compiere user error not found ad column id p ad column id m table table m table get get ctx column getad table id if table get id 0 throw new compiere user error not found ad table id column getad table id find column in database database meta data md db get connectionro get meta data string catalog db get database get catalog string schema db get database get schema string table name table get table name if db is oracle table name table name to upper case begin vpj cd e evolution 08 01 2005 postgresql if db is postgresql table name table name to lower case end vpj cd e evolution 08 01 2005 postgresql int no columns 0 string sql null result set rs md get columns catalog schema table name null while rs next no columns string column name rs get string column name if column name equals ignore case column get column name continue update existing column boolean not null database meta data column no nulls rs get int nullable sql column getsql modify table column is mandatory not null break rs close rs null no table if no columns 0 sql table getsql create no existing column else if sql null sql column getsql add table int no 0 if sql index of db sqlstatement separator 1 no db execute update sql false get trxname add log 0 null new big decimal no sql else string statements sql split db sqlstatement separator for int i 0 i statements length i int count db execute update statements i false get trxname add log 0 null new big decimal count statements i no count if no 1 string msg error value name pair pp c logger retrieve error if pp null msg pp get name msg sql throw new compiere user error msg return sql doit c_column_id p_ad_column_id p_ad_column_id compiereusererror ad_column_id m_column m_column getctx p_ad_column_id get_trxname get_id compiereusererror notfound ad_column_id p_ad_column_id m_table m_table getctx getad_table_id get_id compiereusererror notfound ad_table_id getad_table_id databasemetadata getconnectionro getmetadata getdatabase getcatalog getdatabase getschema tablename gettablename isoracle tablename tablename touppercase ispostgresql tablename tablename tolowercase nocolumns resultset getcolumns tablename nocolumns columnname getstring column_name columnname equalsignorecase getcolumnname notnull databasemetadata columnnonulls getint getsqlmodify ismandatory notnull nocolumns getsqlcreate getsqladd indexof sqlstatement_separator executeupdate get_trxname addlog bigdecimal sqlstatement_separator executeupdate get_trxname addlog bigdecimal valuenamepair clogger retrieveerror getname compiereusererror standard constructor public x m inoutlinema properties ctx int m inoutlinema id string trx name super ctx m inoutlinema id trx name if m inoutlinema id 0 setm attributesetinstance id 0 setm inoutline id 0 set movement qty env zero x_m_inoutlinema m_inoutlinema_id trxname m_inoutlinema_id trxname m_inoutlinema_id setm_attributesetinstance_id setm_inoutline_id setmovementqty load constructor public x m inoutlinema properties ctx result set rs string trx name super ctx rs trx name x_m_inoutlinema resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inoutlinema append get id append return sb to string tostring stringbuffer stringbuffer x_m_inoutlinema get_id tostring set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm inoutline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_inoutline_id set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty config oracle public config oracle configuration data data super data configoracle configoracle configurationdata init public void init p data set database port string value of db oracle default port p_data setdatabaseport valueof db_oracle default_port discover databases to be overwritten by database configs param selected selected database return array of databases public string discover databases string selected if p discovered null return p discovered array list string list new array list string default value to lowercase or null string def selected if def null def trim length 0 def null if def null list add def to lower case search for oracle info string path system get property java library path string entries path split file path separator for int e 0 e entries length e string entry entries e to lower case if entry index of ora 1 entry ends with bin string buffer sb gettns file entries e substring 0 entries e length 4 string tnsnames gettns names sb if tnsnames null for int i 0 i tnsnames length i string tns tnsnames i is lower case if tns equals def list add tns break for all path entries p discovered new string list size list to array p discovered return p discovered discoverdatabases p_discovered p_discovered arraylist arraylist tolowercase getproperty pathseparator tolowercase indexof endswith stringbuffer gettns_file gettns_names p_discovered toarray p_discovered p_discovered get file tnmsnames ora in string buffer param ora home oracle home return tnsnames ora or null private string buffer gettns file string ora home string tnsnames ora home file separator network file separator admin file separator tnsnames ora file tnsfile new file tnsnames if tnsfile exists return null log fine tnsnames string buffer sb new string buffer try file reader fr new file reader tnsfile int c while c fr read 1 sb append char c catch io exception ex log severe error reading tnsnames ex print stack trace return null if sb length 0 return null return sb stringbuffer orahome oracle_home stringbuffer gettns_file orahome orahome stringbuffer stringbuffer filereader filereader ioexception printstacktrace get tns names entries assumes standard tnsmanes ora formatting of net mgr param tnsnames content of tnsnames ora return tns names or null private string gettns names string buffer tnsnames if tnsnames null return null array list string list new array list string pattern pattern pattern compile pattern multiline string lines pattern split tnsnames for int i 0 i lines length i string line lines i trim log finest i line if false get tns name if line length 0 character is letter line char at 0 no line index of 1 line index of extproc 1 line index of http 1 string entry line substring 0 line index of trim to lower case log fine entry list add entry else search service names if line length 0 line to upper case index of service name 1 string entry line substring line index of 1 trim to lower case int index entry index of if index 0 entry entry substring 0 index trim log fine entry list add entry convert to array if list size 0 return null string ret value new string list size list to array ret value return ret value netmgr gettns_names stringbuffer arraylist arraylist isletter charat indexof indexof extproc_ indexof _http indexof tolowercase touppercase indexof service_name indexof tolowercase indexof retvalue toarray retvalue retvalue test return error message or null if ok public string test database server string server p data get database server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 string error not correct db server server inet address database server null try if pass database server inet address get by name server catch exception e error e get message pass false signalok get panel ok database server error database server pass true error log info ok database server database server set property configuration data compiere db server database server get host name set property configuration data compiere db type p data get database type database port int database port p data get database port pass p data test port database server database port true error db server port database port signalok get panel ok database server error database port pass true error if pass return error log info ok database port database port set property configuration data compiere db port string value of database port jdbc database info string database name p data get database name service name string system password p data get database system password pass system password null system password length 0 error no database system password entered signalok get panel ok database system errorjdbc pass true error if pass return error url derived jdbc oracle thin prod1 1521 prod1 string url jdbc oracle thin database server get host name database port database name pass testjdbc url system system password error error connecting url as system system password signalok get panel ok database system errorjdbc pass true error if pass return error log info ok connection url set property configuration data compiere db url url log info ok database system user database name set property configuration data compiere db name database name set property configuration data compiere db system system password database user info string database user p data get database user uid string database password p data get database password pwd pass database password null database password length 0 error invalid database user password signalok get panel ok database user errorjdbc pass true error if pass return error ignore result as it might not be imported pass testjdbc url database user database password error database imported cannot connect to user database user database password signalok get panel ok database user errorjdbc pass false error if pass log info ok database user database user if m con null set property configuration data compiere webstores get web stores m con else log warning error set property configuration data compiere db user database user set property configuration data compiere db password database password tns name info via sqlplus if not tomcat if p data get apps server type equals configuration data appstype tomcat string sqlplus sqlplus system system password database name utils oracle test sql log config sqlplus pass testsql sqlplus error error connecting via sqlplus signalok get panel ok databasesql errortns pass true error if pass log info ok database sql connection oci test if system get property testoci n equals y url jdbc oracle oci8 database name pass testjdbc url system system password if pass log info ok connection url else log warning cannot connect via net8 url log info oci test skipped m con null return null p_data getdatabaseserver tolowercase indexof inetaddress databaseserver databaseserver inetaddress getbyname getmessage getpanel okdatabaseserver errordatabaseserver databaseserver setproperty configurationdata compiere_db_server databaseserver gethostname setproperty configurationdata compiere_db_type p_data getdatabasetype databaseport p_data getdatabaseport p_data testport databaseserver databaseport databaseport getpanel okdatabaseserver errordatabaseport databaseport setproperty configurationdata compiere_db_port valueof databaseport databasename p_data getdatabasename systempassword p_data getdatabasesystempassword systempassword systempassword getpanel okdatabasesystem databaseserver gethostname databaseport databasename systempassword systempassword getpanel okdatabasesystem setproperty configurationdata compiere_db_url databasename setproperty configurationdata compiere_db_name databasename setproperty configurationdata compiere_db_system systempassword databaseuser p_data getdatabaseuser databasepassword p_data getdatabasepassword databasepassword databasepassword getpanel okdatabaseuser databaseuser databasepassword databaseuser databasepassword getpanel okdatabaseuser databaseuser m_con setproperty configurationdata compiere_webstores getwebstores m_con setproperty configurationdata compiere_db_user databaseuser setproperty configurationdata compiere_db_password databasepassword p_data getappsservertype configurationdata appstype_tomcat systempassword databasename getpanel okdatabasesql getproperty databasename systempassword m_con test jdbc connection to server param url connection string param uid user id param pwd password return true if ok private boolean testjdbc string url string uid string pwd log fine url url uid uid try if s oracledriver null s oracledriver new oracle driver driver manager register driver s oracledriver m con driver manager get connection url uid pwd catch unsatisfied link error ule log warning check oracle home jdbc readme txt for oci driver setup log warning ule to string catch exception e log severe e to string return false return true s_oracledriver s_oracledriver oracledriver drivermanager registerdriver s_oracledriver m_con drivermanager getconnection unsatisfiedlinkerror oracle_home tostring tostring test tns connection param sqlplus sqlplus command line return true if ok private boolean testsql string sqlplus string buffer sb out new string buffer string buffer sb err new string buffer int result 1 try process p runtime get runtime exec sqlplus input stream in p get input stream int c while c in read 1 sb out append char c system out print char c in close in p get error stream while c in read 1 sb err append char c in close get result try thread yield result p exit value catch exception e timing issue on solaris thread sleep 200 2 sec result p exit value catch exception ex log severe ex to string log finer sb out to string if sb err length 0 log warning sb err to string return result 0 stringbuffer sbout stringbuffer stringbuffer sberr stringbuffer getruntime inputstream getinputstream sbout geterrorstream sberr exitvalue exitvalue tostring sbout tostring sberr sberr tostring get contsnts return contents public object get contents return contents getcontents config sybase param data public config sybase configuration data data super data configsybase configsybase configurationdata init public void init p data set database port string value of db sybase default port p_data setdatabaseport valueof db_sybase default_port discover databases to be overwritten by database configs param selected selected database return array of databases public string discover databases string selected if p discovered null return p discovered p discovered new string return p discovered discoverdatabases p_discovered p_discovered p_discovered p_discovered test return error message or null if ok public string test database server string server p data get database server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 string error not correct db server server inet address database server null try if pass database server inet address get by name server catch exception e error e get message pass false signalok get panel ok database server error database server pass true error log info ok database server database server set property configuration data compiere db server database server get host name set property configuration data compiere db type p data get database type database port int database port p data get database port pass p data test port database server database port true error db server port database port signalok get panel ok database server error database port pass true error if pass return error log info ok database port database port set property configuration data compiere db port string value of database port jdbc database info string database name p data get database name service name string system password p data get database system password url derived jdbc sybase tds prod1 5000 prod1 string url system p db get connectionurl database server get host name database port p db get system database database name p db get system user pass testjdbc url system p db get system user system password error error connecting url system p db get system user system password signalok get panel ok database system errorjdbc pass true error if pass return error log info ok system connection url system set property configuration data compiere db system system password database user info string database user p data get database user uid string database password p data get database password pwd pass database password null database password length 0 error no database user password entered signalok get panel ok database user errorjdbc pass true error if pass return error string url p db get connectionurl database server get host name database port database name database user ignore result as it might not be imported pass testjdbc url database user database password error database imported cannot connect to user database user database password signalok get panel ok database user errorjdbc pass false error if pass log info ok database user database user else log warning error set property configuration data compiere db url url set property configuration data compiere db name database name set property configuration data compiere db user database user set property configuration data compiere db password database password tns name info string sqlplus sqlplus system system password database name utils oracle test sql log config sqlplus pass testsql sqlplus error error connecting via sqlplus signalok get panel ok databasesql errortns pass true error if pass log info ok database sql connection oci test url jdbc oracle oci8 database name pass testjdbc url system system password if pass log info ok connection url else log warning cannot connect via net8 url set property configuration data compiere db tns database name return null p_data getdatabaseserver tolowercase indexof inetaddress databaseserver databaseserver inetaddress getbyname getmessage getpanel okdatabaseserver errordatabaseserver databaseserver setproperty configurationdata compiere_db_server databaseserver gethostname setproperty configurationdata compiere_db_type p_data getdatabasetype databaseport p_data getdatabaseport p_data testport databaseserver databaseport databaseport getpanel okdatabaseserver errordatabaseport databaseport setproperty configurationdata compiere_db_port valueof databaseport databasename p_data getdatabasename systempassword p_data getdatabasesystempassword urlsystem p_db getconnectionurl databaseserver gethostname databaseport p_db getsystemdatabase databasename p_db getsystemuser urlsystem p_db getsystemuser systempassword urlsystem p_db getsystemuser systempassword getpanel okdatabasesystem urlsystem setproperty configurationdata compiere_db_system systempassword databaseuser p_data getdatabaseuser databasepassword p_data getdatabasepassword databasepassword databasepassword getpanel okdatabaseuser p_db getconnectionurl databaseserver gethostname databaseport databasename databaseuser databaseuser databasepassword databaseuser databasepassword getpanel okdatabaseuser databaseuser setproperty configurationdata compiere_db_url setproperty configurationdata compiere_db_name databasename setproperty configurationdata compiere_db_user databaseuser setproperty configurationdata compiere_db_password databasepassword systempassword databasename getpanel okdatabasesql databasename systempassword setproperty configurationdata compiere_db_tns databasename test jdbc connection to server param url connection string param uid user id param pwd password return true if ok private boolean testjdbc string url string uid string pwd try connection conn p db get driver connection url uid pwd catch exception e log severe e to string return false return true p_db getdriverconnection tostring get contsnts return contents public object get contents return contents getcontents get version return version public static string get version return compiere sqlj 1 0 getversion get environment info return properties public static string get properties string buffer sb new string buffer enumeration en system get properties keys while en has more elements if sb length 0 sb append string key string en next element string value system get property key sb append key append append value return sb to string getproperties stringbuffer stringbuffer getproperties hasmoreelements nextelement getproperty tostring get environment info return property info public static string get property string key throws sql exception if key null key length 0 return null return system get property key not found getproperty sqlexception getproperty notfound get server type return server type public static string get server type if s type null string vendor system get property java vendor if vendor starts with oracle s type type oracle else if vendor starts with sybase s type type sybase else s type return s type getservertype s_type getproperty startswith s_type type_oracle startswith s_type type_sybase s_type s_type is this oracle return true if oracle static boolean is oracle if s type null get server type if s type null return type oracle equals s type return false isoracle s_type getservertype s_type type_oracle s_type is this sybase return true if sybase static boolean is sybase if s type null get server type if s type null return type sybase equals s type return false issybase s_type getservertype s_type type_sybase s_type begin vpj cd e evolution 02 22 2005 postgresql is this postgresql return true if sybase static boolean is postgresql if s type null get server type if s type null return type postgresql equals s type return false ispostgresql s_type getservertype s_type type_postgresql s_type get connection url return connection url static string get connectionurl if s url null return s url if is oracle s url jdbc default connection else if is sybase s url jdbc default connection begin vpj cd e evolution 02 22 2005 postgresql else if is postgresql return jdbc default connection return jdbc default connection end vpj cd e evolution 02 22 2005 postgresql getconnectionurl s_url s_url isoracle s_url issybase s_url ispostgresql get server side connection return connection throws sql exception private static connection get connection throws sql exception if s uid null s pwd null return driver manager get connection get connectionurl s uid s pwd return driver manager get connection get connectionurl sqlexception getconnection sqlexception s_uid s_pwd drivermanager getconnection getconnectionurl s_uid s_pwd drivermanager getconnection getconnectionurl prepare statement forward read only param sql sql return prepared statement throws sql exception static prepared statement prepare statement string sql throws sql exception return prepare statement sql result set type forward only result set concur read only readonly sqlexception preparedstatement preparestatement sqlexception preparestatement resultset type_forward_only resultset concur_read_only prepare statement param sql sql return prepared statement throws sql exception static prepared statement prepare statement string sql int result set type int result set currency throws sql exception if s conn null s conn get connection try return s conn prepare statement sql result set type result set currency catch exception e connection not good anymore get new connection s conn get connection return s conn prepare statement sql sqlexception preparedstatement preparestatement resultsettype resultsetcurrency sqlexception s_conn s_conn getconnection s_conn preparestatement resultsettype resultsetcurrency s_conn getconnection s_conn preparestatement get sql int value with param param sql sql command param param1 parameter return value or 1 if not found throws sql exception static int getsql value string sql int param1 throws sql exception int ret value 1 prepared statement pstmt prepare statement sql pstmt set int 1 param1 result set rs pstmt execute query if rs next ret value rs get int 1 rs close pstmt close return ret value sqlexception getsqlvalue sqlexception retvalue preparedstatement preparestatement setint resultset executequery retvalue getint retvalue truncate date param p datetime date return day public static timestamp trunc timestamp p datetime timestamp time p datetime if time null time new timestamp system current time millis gregorian calendar cal new gregorian calendar cal set time time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 java util date temp cal get time return new timestamp temp get time p_datetime p_datetime p_datetime currenttimemillis gregoriancalendar gregoriancalendar settime hour_of_day gettime gettime truncate date param p datetime date param xx date part supported dd default dy mm q return day first public static timestamp first of timestamp p datetime string xx timestamp time p datetime if time null time new timestamp system current time millis gregorian calendar cal new gregorian calendar cal set time time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 if mm equals xx month cal set calendar day of month 1 else if dy equals xx week cal set calendar day of week calendar sunday else if q equals xx quarter cal set calendar day of month 1 int mm cal get calendar month january 0 if mm calendar april cal set calendar month calendar january else if mm calendar july cal set calendar month calendar april else if mm calendar october cal set calendar month calendar july else cal set calendar month calendar october java util date temp cal get time return new timestamp temp get time p_datetime firstof p_datetime p_datetime currenttimemillis gregoriancalendar gregoriancalendar settime hour_of_day day_of_month day_of_week day_of_month gettime gettime calculate the number of days between start and end param start start date param end end date return number of days 0 same static public int get days between timestamp start timestamp end boolean negative false if end before start negative true timestamp temp start start end end temp gregorian calendar cal new gregorian calendar cal set time start cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 gregorian calendar cal end new gregorian calendar cal end set time end cal end set calendar hour of day 0 cal end set calendar minute 0 cal end set calendar second 0 cal end set calendar millisecond 0 system out println start start end end day start cal get calendar day of year day end cal end get calendar day of year in same year if cal get calendar year cal end get calendar year if negative return cal end get calendar day of year cal get calendar day of year 1 return cal end get calendar day of year cal get calendar day of year not very efficient but correct int counter 0 while cal end after cal cal add calendar day of year 1 counter if negative return counter 1 return counter getdaysbetween gregoriancalendar gregoriancalendar settime hour_of_day gregoriancalendar calend gregoriancalendar calend settime calend hour_of_day calend calend calend daystart day_of_year dayend calend day_of_year calend calend day_of_year day_of_year calend day_of_year day_of_year calend day_of_year return day offset truncates param day day param offset day offset return day offset at 00 00 static public timestamp add days timestamp day int offset if day null day new timestamp system current time millis gregorian calendar cal new gregorian calendar cal set time day cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 if offset 0 cal add calendar day of year offset may have a problem with negative before 1 1 java util date temp cal get time return new timestamp temp get time adddays currenttimemillis gregoriancalendar gregoriancalendar settime hour_of_day day_of_year gettime gettime next business day only sa su mo param day day return next business dat if day is off static public timestamp next business day timestamp day if day null day new timestamp system current time millis gregorian calendar cal new gregorian calendar cal set time day cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 int dow cal get calendar day of week if dow calendar saturday cal add calendar day of year 2 else if dow calendar sunday cal add calendar day of year 1 java util date temp cal get time return new timestamp temp get time nextbusinessday currenttimemillis gregoriancalendar gregoriancalendar settime hour_of_day day_of_week day_of_year day_of_year gettime gettime character at position param source source param pos index position 1 first return substring or null public static string char at string source int pos index if source null return null try return source substring pos index 1 pos index 2 catch exception e return null posindex charat posindex posindex posindex mext id param ad sequence id sequence param system system return id or 1 public static int nextid int ad sequence id string system throws sql exception boolean is system system null y equals system int ret value 1 string buffer sql new string buffer select current next if is system sql append sys sql append increment no from ad sequence where ad sequence id prepared statement pstmt prepare statement sql to string result set type forward only result set concur updatable result set rs pstmt execute query if rs next ret value rs get int 1 int increment no rs get int 2 rs update int 2 ret value increment no pstmt get connection commit rs close pstmt close return ret value ad_sequence_id ad_sequence_id sqlexception issystem retvalue stringbuffer stringbuffer currentnext issystem incrementno ad_sequence ad_sequence_id preparedstatement preparestatement tostring resultset type_forward_only resultset concur_updatable resultset executequery retvalue getint incrementno getint updateint retvalue incrementno getconnection retvalue convert amount to base currency default conversion type previously c base convert now currency base param p c currencyfrom id from currency param p conversiondate conversion date param p ad client id client param p ad org id org return rate or null throws sql exception public static big decimal base big decimal p amount int p c currencyfrom id timestamp p conversiondate int p ad client id int p ad org id throws sql exception return null if p amount null p c currencyfrom id 0 return null return amount if p amount signum 0 return p amount base currency string sql select ac c currency id from ad clientinfo ci inner join c acctschema ac on ci c acctschema1 id ac c acctschema id where ci ad client id int c currencyto id compiere getsql value sql p ad client id return amount if p c currencyfrom id c currencyto id return p amount return convert p amount p c currencyfrom id c currencyto id p conversiondate 0 p ad client id p ad org id c_base_convert currencybase p_c_currencyfrom_id p_conversiondate p_ad_client_id p_ad_org_id sqlexception bigdecimal bigdecimal p_amount p_c_currencyfrom_id p_conversiondate p_ad_client_id p_ad_org_id sqlexception p_amount p_c_currencyfrom_id p_amount p_amount c_currency_id ad_clientinfo c_acctschema c_acctschema1_id c_acctschema_id ad_client_id c_currencyto_id getsqlvalue p_ad_client_id p_c_currencyfrom_id c_currencyto_id p_amount p_amount p_c_currencyfrom_id c_currencyto_id p_conversiondate p_ad_client_id p_ad_org_id convert amount to currency previously currency convert now currency convert param p c currencyfrom id from currency param p c currencyto id to currency param p conversiondate conversion date param p c conversiontype id conversion type param p ad client id client param p ad org id org return rate or null throws sql exception public static big decimal convert big decimal p amount int p c currencyfrom id int p c currencyto id timestamp p conversiondate int p c conversiontype id int p ad client id int p ad org id throws sql exception return null if p amount null p c currencyfrom id 0 p c currencyto id 0 return null return amount if p amount signum 0 p c currencyfrom id p c currencyto id return p amount get rate big decimal rate rate p c currencyfrom id p c currencyto id p conversiondate p c conversiontype id p ad client id p ad org id if rate null return null round return round p amount multiply rate p c currencyto id null currencyconvert currencyconvert p_c_currencyfrom_id p_c_currencyto_id p_conversiondate p_c_conversiontype_id p_ad_client_id p_ad_org_id sqlexception bigdecimal bigdecimal p_amount p_c_currencyfrom_id p_c_currencyto_id p_conversiondate p_c_conversiontype_id p_ad_client_id p_ad_org_id sqlexception p_amount p_c_currencyfrom_id p_c_currencyto_id p_amount p_c_currencyfrom_id p_c_currencyto_id p_amount bigdecimal p_c_currencyfrom_id p_c_currencyto_id p_conversiondate p_c_conversiontype_id p_ad_client_id p_ad_org_id p_amount p_c_currencyto_id get conversion rate previously c currency rate now currency rate param p c currencyfrom id from currency param p c currencyto id to currency param p conversiondate conversion date param p c conversiontype id conversion type param p ad client id client param p ad org id org return rate or null throws sql exception public static big decimal rate int p c currencyfrom id int p c currencyto id timestamp p conversiondate int p c conversiontype id int p ad client id int p ad org id throws sql exception no conversion if p c currencyfrom id p c currencyto id return compiere one get defaults timestamp conversion date p conversiondate if conversion date null conversion date new timestamp system current time millis conversion date compiere trunc conversion date int c conversiontype id p c conversiontype id if c conversiontype id 0 string sql select c conversiontype id from c conversiontype where is default y and ad client id in 0 order by ad client id desc c conversiontype id compiere getsql value sql p ad client id get euro currency info string sql select is euro isemu member emu entry date emu rate from c currency where c currency id fixed from euro to emu if cf iseuro y and ct isemumember y and v convdate ct emuentrydate then return ct emurate end if fixed from emu to euro if ct iseuro y and cf isemumember y and v convdate cf emuentrydate then return 1 cf emurate end if fixed from emu to emu if cf isemumember y and cf isemumember y and v convdate cf emuentrydate and v convdate ct emuentrydate then return ct emurate cf emurate end if flexible rates if emu member involved replace from to currency if cf isemumember y and v convdate cf emuentrydate or ct isemumember y and v convdate ct emuentrydate then select max c currency id into v currencyeuro from c currency where is euro y conversion rate not found if v currencyeuro is null then dbms output put line euro not found return null end if if cf isemumember y and v convdate cf emuentrydate then v currencyfrom v currencyeuro else v currencyto v currencyeuro end if end if get rate big decimal rate null string sql select multiply rate from c conversion rate where c currency id and c currency id to from to and c conversiontype id and trunc valid from and trunc valid to and ad client id in 0 and ad org id in 0 order by ad client id desc ad org id desc valid from desc prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c currencyfrom id pstmt set int 2 p c currencyto id pstmt set int 3 c conversiontype id pstmt set timestamp 4 conversion date pstmt set timestamp 5 conversion date pstmt set int 6 p ad client id pstmt set int 7 p ad org id result set rs pstmt execute query if rs next rate rs get big decimal 1 rs close pstmt close not found if rate null return null currency from was emu if cf isemumember y and v convdate cf emuentrydate then return v rate cf emurate end if currency to was emu if ct isemumember y and v convdate ct emuentrydate then return v rate ct emurate end if return rate c_currency_rate currencyrate p_c_currencyfrom_id p_c_currencyto_id p_conversiondate p_c_conversiontype_id p_ad_client_id p_ad_org_id sqlexception bigdecimal p_c_currencyfrom_id p_c_currencyto_id p_conversiondate p_c_conversiontype_id p_ad_client_id p_ad_org_id sqlexception p_c_currencyfrom_id p_c_currencyto_id conversiondate p_conversiondate conversiondate conversiondate currenttimemillis conversiondate conversiondate c_conversiontype_id p_c_conversiontype_id c_conversiontype_id c_conversiontype_id c_conversiontype isdefault ad_client_id ad_client_id c_conversiontype_id getsqlvalue p_ad_client_id iseuro isemumember emuentrydate emurate c_currency c_currency_id cf_iseuro ct_isemumember v_convdate ct_emuentrydate ct_emurate ct_iseuro cf_isemumember v_convdate cf_emuentrydate cf_emurate cf_isemumember cf_isemumember v_convdate cf_emuentrydate v_convdate ct_emuentrydate ct_emurate cf_emurate cf_isemumember v_convdate cf_emuentrydate ct_isemumember v_convdate ct_emuentrydate c_currency_id v_currencyeuro c_currency iseuro v_currencyeuro dbms_output put_line cf_isemumember v_convdate cf_emuentrydate v_currencyfrom v_currencyeuro v_currencyto v_currencyeuro bigdecimal multiplyrate c_conversion_rate c_currency_id c_currency_id_to c_conversiontype_id validfrom validto ad_client_id ad_org_id ad_client_id ad_org_id validfrom preparedstatement preparestatement setint p_c_currencyfrom_id setint p_c_currencyto_id setint c_conversiontype_id settimestamp conversiondate settimestamp conversiondate setint p_ad_client_id setint p_ad_org_id resultset executequery getbigdecimal cf_isemumember v_convdate cf_emuentrydate v_rate cf_emurate ct_isemumember v_convdate ct_emuentrydate v_rate ct_emurate round amount to currency precision select iso code currency round 111 111111 c currency id n std currency round 111 111111 c currency id y cost from c currency where c currency id in 100 113 param p amount amount param p c currency id currency param p costing y if costing precision return rounded amount throws sql exception public static big decimal round big decimal p amount int p c currency id string p costing throws sql exception if p amount null return null if p amount signum 0 p c currency id 0 return p amount boolean costing p costing null y equals p costing big decimal result p amount string sql select std precision costing precision from c currency where c currency id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c currency id result set rs pstmt execute query if rs next int index costing 2 1 int prec rs get int index if result scale prec result result set scale prec big decimal round half up rs close pstmt close return result iso_code currencyround c_currency_id currencyround c_currency_id c_currency c_currency_id p_amount p_c_currency_id p_costing sqlexception bigdecimal bigdecimal p_amount p_c_currency_id p_costing sqlexception p_amount p_amount p_c_currency_id p_amount p_costing p_costing bigdecimal p_amount stdprecision costingprecision c_currency c_currency_id preparedstatement preparestatement setint p_c_currency_id resultset executequery getint setscale bigdecimal round_half_up constructor param pos panel pos panel public sub sales rep pos panel pos panel super pos panel pospanel subsalesrep pospanel pospanel pospanel initialize public void init title titled border border new titled border msg translate env get ctx c pos id set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets2 f label new c label p pos get name c label leading gbc gridx 0 gbc gridy 0 gbc weightx 0 5 gbc anchor grid bag constraints west gbc fill grid bag constraints both add f label gbc f button new c button msg get msg env get ctx logout f button set action command log out f button set focusable false f button add action listener this gbc gridx 1 gbc gridy 0 gbc weightx 0 gbc anchor grid bag constraints east gbc fill grid bag constraints none add f button gbc titledborder titledborder getctx c_pos_id setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_label clabel p_pos getname clabel gridbagconstraints gridbagconstraints f_label f_button cbutton getmsg getctx f_button setactioncommand logout f_button setfocusable f_button addactionlistener gridbagconstraints gridbagconstraints f_button get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 1 gbc gridy 0 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub sales rep action performed action logout p pospanel dispose actionperformed actionevent getactioncommand possubsalesrep actionperformed p_pospanel standard constructor public x r issueknown properties ctx int r issueknown id string trx name super ctx r issueknown id trx name if r issueknown id 0 set issue summary null setr issueknown id 0 set release no null x_r_issueknown r_issueknown_id trxname r_issueknown_id trxname r_issueknown_id setissuesummary setr_issueknown_id setreleaseno load constructor public x r issueknown properties ctx result set rs string trx name super ctx rs trx name x_r_issueknown resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issueknown append get id append return sb to string tostring stringbuffer stringbuffer x_r_issueknown get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set issue status current status of the issue public void set issue status string issue status if issue status null issue status length 2000 log warning length 2000 truncated issue status issue status substring 0 1999 set value issue status issue status setissuestatus issuestatus issuestatus issuestatus issuestatus issuestatus set_value issuestatus issuestatus get issue status current status of the issue public string get issue status return string get value issue status getissuestatus get_value issuestatus set issue summary issue summary public void set issue summary string issue summary if issue summary null throw new illegal argument exception issue summary is mandatory if issue summary length 255 log warning length 255 truncated issue summary issue summary substring 0 254 set value issue summary issue summary setissuesummary issuesummary issuesummary illegalargumentexception issuesummary issuesummary issuesummary issuesummary set_value issuesummary issuesummary get issue summary issue summary public string get issue summary return string get value issue summary getissuesummary get_value issuesummary set line line no public void set line no int line no set value line no new integer line no setlineno lineno set_value lineno lineno get line line no public int get line no integer ii integer get value line no if ii null return 0 return ii int value getlineno get_value lineno intvalue set logger logger name public void set logger name string logger name if logger name null logger name length 60 log warning length 60 truncated logger name logger name substring 0 59 set value logger name logger name setloggername loggername loggername loggername loggername loggername set_value loggername loggername get logger logger name public string get logger name return string get value logger name getloggername get_value loggername set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set known issue known issue public void setr issueknown id int r issueknown id if r issueknown id 1 throw new illegal argument exception r issueknown id is mandatory set valuenocheck r issueknown id new integer r issueknown id setr_issueknown_id r_issueknown_id r_issueknown_id illegalargumentexception r_issueknown_id set_valuenocheck r_issueknown_id r_issueknown_id get known issue known issue public int getr issueknown id integer ii integer get value r issueknown id if ii null return 0 return ii int value getr_issueknown_id get_value r_issueknown_id intvalue set issue recommendation recommendations how to fix an issue public void setr issuerecommendation id int r issuerecommendation id if r issuerecommendation id 0 set value r issuerecommendation id null else set value r issuerecommendation id new integer r issuerecommendation id setr_issuerecommendation_id r_issuerecommendation_id r_issuerecommendation_id set_value r_issuerecommendation_id set_value r_issuerecommendation_id r_issuerecommendation_id get issue recommendation recommendations how to fix an issue public int getr issuerecommendation id integer ii integer get value r issuerecommendation id if ii null return 0 return ii int value getr_issuerecommendation_id get_value r_issuerecommendation_id intvalue set issue status status of an issue public void setr issuestatus id int r issuestatus id if r issuestatus id 0 set value r issuestatus id null else set value r issuestatus id new integer r issuestatus id setr_issuestatus_id r_issuestatus_id r_issuestatus_id set_value r_issuestatus_id set_value r_issuestatus_id r_issuestatus_id get issue status status of an issue public int getr issuestatus id integer ii integer get value r issuestatus id if ii null return 0 return ii int value getr_issuestatus_id get_value r_issuestatus_id intvalue set request request from a business partner or prospect public void setr request id int r request id if r request id 0 set value r request id null else set value r request id new integer r request id setr_request_id r_request_id r_request_id set_value r_request_id set_value r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue set release no internal release number public void set release no string release no if release no null throw new illegal argument exception release no is mandatory if release no length 4 log warning length 4 truncated release no release no substring 0 3 set value release no release no setreleaseno releaseno releaseno illegalargumentexception releaseno releaseno releaseno releaseno set_value releaseno releaseno get release no internal release number public string get release no return string get value release no getreleaseno get_value releaseno return string get value release no public key name pair get key name pair return new key name pair get id get release no get_value releaseno keynamepair getkeynamepair keynamepair get_id getreleaseno set source class source class name public void set source class name string source class name if source class name null source class name length 60 log warning length 60 truncated source class name source class name substring 0 59 set value source class name source class name setsourceclassname sourceclassname sourceclassname sourceclassname sourceclassname sourceclassname set_value sourceclassname sourceclassname get source class source class name public string get source class name return string get value source class name getsourceclassname get_value sourceclassname set source method source method name public void set source method name string source method name if source method name null source method name length 60 log warning length 60 truncated source method name source method name substring 0 59 set value source method name source method name setsourcemethodname sourcemethodname sourcemethodname sourcemethodname sourcemethodname sourcemethodname set_value sourcemethodname sourcemethodname get source method source method name public string get source method name return string get value source method name getsourcemethodname get_value sourcemethodname standard constructor public x c dunningrun properties ctx int c dunningrun id string trx name super ctx c dunningrun id trx name if c dunningrun id 0 setc dunninglevel id 0 setc dunningrun id 0 set dunning date new timestamp system current time millis date set processed false x_c_dunningrun c_dunningrun_id trxname c_dunningrun_id trxname c_dunningrun_id setc_dunninglevel_id setc_dunningrun_id setdunningdate currenttimemillis setprocessed load constructor public x c dunningrun properties ctx result set rs string trx name super ctx rs trx name x_c_dunningrun resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c dunningrun append get id append return sb to string tostring stringbuffer stringbuffer x_c_dunningrun get_id tostring set dunning level public void setc dunninglevel id int c dunninglevel id if c dunninglevel id 1 throw new illegal argument exception c dunninglevel id is mandatory set valuenocheck c dunninglevel id new integer c dunninglevel id setc_dunninglevel_id c_dunninglevel_id c_dunninglevel_id illegalargumentexception c_dunninglevel_id set_valuenocheck c_dunninglevel_id c_dunninglevel_id get dunning level public int getc dunninglevel id integer ii integer get value c dunninglevel id if ii null return 0 return ii int value getc_dunninglevel_id get_value c_dunninglevel_id intvalue set dunning run dunning run public void setc dunningrun id int c dunningrun id if c dunningrun id 1 throw new illegal argument exception c dunningrun id is mandatory set valuenocheck c dunningrun id new integer c dunningrun id setc_dunningrun_id c_dunningrun_id c_dunningrun_id illegalargumentexception c_dunningrun_id set_valuenocheck c_dunningrun_id c_dunningrun_id get dunning run dunning run public int getc dunningrun id integer ii integer get value c dunningrun id if ii null return 0 return ii int value getc_dunningrun_id get_value c_dunningrun_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set dunning date date of dunning public void set dunning date timestamp dunning date if dunning date null throw new illegal argument exception dunning date is mandatory set value dunning date dunning date setdunningdate dunningdate dunningdate illegalargumentexception dunningdate set_value dunningdate dunningdate get dunning date date of dunning public timestamp get dunning date return timestamp get value dunning date getdunningdate get_value dunningdate return timestamp get value dunning date public key name pair get key name pair return new key name pair get id string value of get dunning date get_value dunningdate keynamepair getkeynamepair keynamepair get_id valueof getdunningdate set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set send public void set send it string send it if send it null send it length 1 log warning length 1 truncated send it send it substring 0 0 set value send it send it setsendit sendit sendit sendit sendit sendit set_value sendit sendit get send public string get send it return string get value send it getsendit get_value sendit constructor param pos panel pos panel public sub function keys pos panel pos panel super pos panel pospanel subfunctionkeys pospanel pospanel pospanel initialize public void init title titled border border new titled border msg translate env get ctx c poskeylayout id set border border int c poskeylayout id p pos getc poskeylayout id if c poskeylayout id 0 return mpos key layout f keys mpos key layout get env get ctx c poskeylayout id if f keys get id 0 return int columns 3 min columns int rows 3 min rows m keys f keys get keys false int no keys m keys length int rows math max no keys 1 columns 1 rows int cols no keys 1 columns 1 log fine pos sub function keys init no keys no keys rows rows cols cols content c panel content new c panel new grid layout math max rows 3 math max cols 3 for int i 0 i m keys length i mpos key key m keys i string buffer buttonhtml new string buffer html p if key getad printcolor id 0 m print color color m print color get env get ctx key getad printcolor id buttonhtml append font color append color getrrggbb append append key get name append font else buttonhtml append key get name buttonhtml append p html log fine i buttonhtml c button button new c button buttonhtml to string button set margin insets1 button set focusable false button set action command string value of key getc poskey id button add action listener this content add button for int i m keys length i rows columns i c button button new c button button set focusable false content add button content set preferred size new dimension cols 70 rows 50 add content titledborder titledborder getctx c_poskeylayout_id setborder c_poskeylayout_id p_pos getc_poskeylayout_id c_poskeylayout_id mposkeylayout fkeys mposkeylayout getctx c_poskeylayout_id fkeys get_id m_keys fkeys getkeys nokeys m_keys nokeys nokeys possubfunctionkeys nokeys nokeys cpanel cpanel gridlayout m_keys mposkey m_keys stringbuffer stringbuffer getad_printcolor_id mprintcolor mprintcolor getctx getad_printcolor_id getname getname cbutton cbutton tostring setmargin setfocusable setactioncommand valueof getc_poskey_id addactionlistener m_keys cbutton cbutton setfocusable setpreferredsize get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 1 gbc gridy 2 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 m keys null return log info pos sub function keys action performed action try int c poskey id integer parse int action for int i 0 i m keys length i mpos key key m keys i if key getc poskey id c poskey id p pospanel f product setm product id key getm product id p pospanel f product set price p pospanel f curline set qty key get qty p pospanel f curline save line return catch exception ex actionperformed actionevent getactioncommand m_keys possubfunctionkeys actionperformed c_poskey_id parseint m_keys mposkey m_keys getc_poskey_id c_poskey_id p_pospanel f_product setm_product_id getm_product_id p_pospanel f_product setprice p_pospanel f_curline setqty getqty p_pospanel f_curline saveline standard constructor public x ad menu properties ctx int ad menu id string trx name super ctx ad menu id trx name if ad menu id 0 setad menu id 0 set entity type null u set is read only false n set isso trx false set is summary false set name null x_ad_menu ad_menu_id trxname ad_menu_id trxname ad_menu_id setad_menu_id setentitytype setisreadonly setissotrx setissummary setname load constructor public x ad menu properties ctx result set rs string trx name super ctx rs trx name x_ad_menu resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad menu append get id append return sb to string tostring stringbuffer stringbuffer x_ad_menu get_id tostring set special form special form public void setad form id int ad form id if ad form id 0 set value ad form id null else set value ad form id new integer ad form id setad_form_id ad_form_id ad_form_id set_value ad_form_id set_value ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue set menu identifies a menu public void setad menu id int ad menu id if ad menu id 1 throw new illegal argument exception ad menu id is mandatory set valuenocheck ad menu id new integer ad menu id setad_menu_id ad_menu_id ad_menu_id illegalargumentexception ad_menu_id set_valuenocheck ad_menu_id ad_menu_id get menu identifies a menu public int getad menu id integer ii integer get value ad menu id if ii null return 0 return ii int value getad_menu_id get_value ad_menu_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set os task operation system task public void setad task id int ad task id if ad task id 0 set value ad task id null else set value ad task id new integer ad task id setad_task_id ad_task_id ad_task_id set_value ad_task_id set_value ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set workbench collection of windows reports public void setad workbench id int ad workbench id if ad workbench id 0 set value ad workbench id null else set value ad workbench id new integer ad workbench id setad_workbench_id ad_workbench_id ad_workbench_id set_value ad_workbench_id set_value ad_workbench_id ad_workbench_id get workbench collection of windows reports public int getad workbench id integer ii integer get value ad workbench id if ii null return 0 return ii int value getad_workbench_id get_value ad_workbench_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 0 set value ad workflow id null else set value ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id set_value ad_workflow_id set_value ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue public static final string action form x set action indicates the action to be performed public void set action string action if action null throw new illegal argument exception action is mandatory if action null action equals b action equals f action equals p action equals r action equals t action equals w action equals x else throw new illegal argument exception action invalid value action reference id 104 b f p r t w x if action null action length 1 log warning length 1 truncated action action substring 0 0 set value action action action_form setaction illegalargumentexception illegalargumentexception reference_id set_value get action indicates the action to be performed public string get action return string get value action getaction get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x b bidcomment properties ctx int b bidcomment id string trx name super ctx b bidcomment id trx name if b bidcomment id 0 setad user id 0 setb bidcomment id 0 setb topic id 0 set text msg null x_b_bidcomment b_bidcomment_id trxname b_bidcomment_id trxname b_bidcomment_id setad_user_id setb_bidcomment_id setb_topic_id settextmsg load constructor public x b bidcomment properties ctx result set rs string trx name super ctx rs trx name x_b_bidcomment resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b bidcomment append get id append return sb to string tostring stringbuffer stringbuffer x_b_bidcomment get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set bid comment make a comment to a bid topic public void setb bidcomment id int b bidcomment id if b bidcomment id 1 throw new illegal argument exception b bidcomment id is mandatory set valuenocheck b bidcomment id new integer b bidcomment id setb_bidcomment_id b_bidcomment_id b_bidcomment_id illegalargumentexception b_bidcomment_id set_valuenocheck b_bidcomment_id b_bidcomment_id get bid comment make a comment to a bid topic public int getb bidcomment id integer ii integer get value b bidcomment id if ii null return 0 return ii int value getb_bidcomment_id get_value b_bidcomment_id intvalue set topic auction topic public void setb topic id int b topic id if b topic id 1 throw new illegal argument exception b topic id is mandatory set value b topic id new integer b topic id setb_topic_id b_topic_id b_topic_id illegalargumentexception b_topic_id set_value b_topic_id b_topic_id get topic auction topic public int getb topic id integer ii integer get value b topic id if ii null return 0 return ii int value getb_topic_id get_value b_topic_id intvalue set text message text message public void set text msg string text msg if text msg null throw new illegal argument exception text msg is mandatory if text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg illegalargumentexception textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg get background compiere color param owner owner param color optional initial color return compiere color public static compiere color show dialog frame owner compiere color color compiere color editor cce new compiere color editor owner color if cce is saved return cce get color return color compierecolor compierecolor compierecolor showdialog compierecolor compierecoloreditor compierecoloreditor issaved getcolor get background compiere color param owner owner param color optional initial color return compiere color public static compiere color show dialog dialog owner compiere color color compiere color editor cce new compiere color editor owner color if cce is saved return cce get color return color compierecolor compierecolor compierecolor showdialog compierecolor compierecoloreditor compierecoloreditor issaved getcolor create compiere color dialog with color param owner owner param color start color public compiere color editor frame owner compiere color color super owner true init color compierecolor compierecoloreditor compierecolor create compiere color dialog with color param owner owner param color start color public compiere color editor dialog owner compiere color color super owner true init color compierecolor compierecoloreditor compierecolor init dialog param color start color private void init compiere color color try jb init catch exception e e print stack trace bok add action listener this b cancel add action listener this type field add action listener this flat field add action listener this gradient upper add action listener this gradient lower add action listener this url field add action listener this alpha field add action listener this taint color add action listener this line color add action listener this back color add action listener this width field add action listener this distance field add action listener this gradient start field add action listener this gradient distance field add action listener this if color null set color m cc else set color new compiere color color compiereplaf show center screen this compierecolor jbinit printstacktrace addactionlistener bcancel addactionlistener typefield addactionlistener flatfield addactionlistener gradientupper addactionlistener gradientlower addactionlistener urlfield addactionlistener alphafield addactionlistener taintcolor addactionlistener linecolor addactionlistener backcolor addactionlistener widthfield addactionlistener distancefield addactionlistener gradientstartfield addactionlistener gradientdistancefield addactionlistener setcolor m_cc setcolor compierecolor showcenterscreen static layout pre north panel labels fields center panel south panel pre throws exception private void jb init throws exception this set title res get string compiere color editor south panel set layout south layout south layout set alignment flow layout right north panel set layout north layout type label set text res get string compiere type gradient upper set text res get string gradient upper color gradient lower set text res get string gradient lower color gradient start label set text res get string gradient start gradient distance label set text res get string gradient distance url label set text res get string textureurl alpha label set text res get string texture alpha taint color set text res get string texture taint color line color set text res get string line color back color set text res get string line back color width label set text res get string line width distance label set text res get string line distance flat field set text res get string flat color center panel set border border factory create raised bevel border center panel set preferred size new dimension 400 200 center panel set opaque true north panel set preferred size new dimension 400 150 south panel add b cancel null this get content pane add north panel border layout north south panel add bok null this get content pane add south panel border layout south this get content pane add center panel border layout center north panel add type label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add type field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 north panel add gradient lower new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add url field new grid bag constraints 1 5 2 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add alpha label new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add alpha field new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add taint color new grid bag constraints 1 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add back color new grid bag constraints 1 8 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add width label new grid bag constraints 0 9 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add width field new grid bag constraints 1 9 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 north panel add distance label new grid bag constraints 0 10 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add distance field new grid bag constraints 1 10 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 north panel add flat field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add gradient start field new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 north panel add gradient distance field new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 north panel add url label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add gradient start label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add gradient distance label new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 north panel add gradient upper new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add line color new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints east grid bag constraints horizontal new insets 5 5 5 5 0 0 northpanel centerpanel southpanel jbinit settitle getstring compierecoloreditor southpanel setlayout southlayout southlayout setalignment flowlayout northpanel setlayout northlayout typelabel settext getstring compieretype gradientupper settext getstring gradientuppercolor gradientlower settext getstring gradientlowercolor gradientstartlabel settext getstring gradientstart gradientdistancelabel settext getstring gradientdistance urllabel settext getstring alphalabel settext getstring texturealpha taintcolor settext getstring texturetaintcolor linecolor settext getstring linecolor backcolor settext getstring linebackcolor widthlabel settext getstring linewidth distancelabel settext getstring linedistance flatfield settext getstring flatcolor centerpanel setborder borderfactory createraisedbevelborder centerpanel setpreferredsize centerpanel setopaque northpanel setpreferredsize southpanel bcancel getcontentpane northpanel borderlayout southpanel getcontentpane southpanel borderlayout getcontentpane centerpanel borderlayout northpanel typelabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel typefield gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientlower gridbagconstraints gridbagconstraints gridbagconstraints northpanel urlfield gridbagconstraints gridbagconstraints gridbagconstraints northpanel alphalabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel alphafield gridbagconstraints gridbagconstraints gridbagconstraints northpanel taintcolor gridbagconstraints gridbagconstraints gridbagconstraints northpanel backcolor gridbagconstraints gridbagconstraints gridbagconstraints northpanel widthlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel widthfield gridbagconstraints gridbagconstraints gridbagconstraints northpanel distancelabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel distancefield gridbagconstraints gridbagconstraints gridbagconstraints northpanel flatfield gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientstartfield gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientdistancefield gridbagconstraints gridbagconstraints gridbagconstraints northpanel urllabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientstartlabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientdistancelabel gridbagconstraints gridbagconstraints gridbagconstraints northpanel gradientupper gridbagconstraints gridbagconstraints gridbagconstraints northpanel linecolor gridbagconstraints gridbagconstraints gridbagconstraints action listener param e event public void action performed action event e if m setting return if e get source bok m saved true dispose return else if e get source b cancel dispose return field changes try type if e get source type field cmd type flat else if e get source flat field m cc set flat color j color chooser show dialog this flat field get text m cc get flat color gradient else if e get source gradient upper m cc set gradient upper color j color chooser show dialog this gradient upper get text m cc get gradient upper color else if e get source gradient lower m cc set gradient lower color j color chooser show dialog this gradient lower get text m cc get gradient lower color else if e get source gradient start field m cc set gradient start point key name pair gradient start field get selected item get key else if e get source gradient distance field m cc set gradient repeat distance gradient distance field get text texture else if e get source url field m cc set textureurl url field get text else if e get source alpha field m cc set texture composite alpha alpha field get text else if e get source taint color m cc set texture taint color j color chooser show dialog this taint color get text m cc get texture taint color lines else if e get source line color m cc set line color j color chooser show dialog this line color get text m cc get line color else if e get source back color m cc set line back color j color chooser show dialog this back color get text m cc get line back color else if e get source width field m cc set line width width field get text else if e get source distance field m cc set line distance distance field get text catch exception ee set color m cc actionperformed actionevent m_setting getsource m_saved getsource bcancel getsource typefield cmd_type getsource flatfield m_cc setflatcolor jcolorchooser showdialog flatfield gettext m_cc getflatcolor getsource gradientupper m_cc setgradientuppercolor jcolorchooser showdialog gradientupper gettext m_cc getgradientuppercolor getsource gradientlower m_cc setgradientlowercolor jcolorchooser showdialog gradientlower gettext m_cc getgradientlowercolor getsource gradientstartfield m_cc setgradientstartpoint keynamepair gradientstartfield getselecteditem getkey getsource gradientdistancefield m_cc setgradientrepeatdistance gradientdistancefield gettext getsource urlfield m_cc settextureurl urlfield gettext getsource alphafield m_cc settexturecompositealpha alphafield gettext getsource taintcolor m_cc settexturetaintcolor jcolorchooser showdialog taintcolor gettext m_cc gettexturetaintcolor getsource linecolor m_cc setlinecolor jcolorchooser showdialog linecolor gettext m_cc getlinecolor getsource backcolor m_cc setlinebackcolor jcolorchooser showdialog backcolor gettext m_cc getlinebackcolor getsource widthfield m_cc setlinewidth widthfield gettext getsource distancefield m_cc setlinedistance distancefield gettext setcolor m_cc set type with default values private void cmd type value name pair vp value name pair type field get selected item if vp get value equals compiere color type flat m cc new compiere color compiere color type flat else if vp get value equals compiere color type gradient m cc new compiere color compiere color type gradient else if vp get value equals compiere color type texture m cc new compiere color compiere color type texture else if vp get value equals compiere color type lines m cc new compiere color compiere color type lines set color m cc cmd_type valuenamepair valuenamepair typefield getselecteditem getvalue compierecolor type_flat m_cc compierecolor compierecolor type_flat getvalue compierecolor type_gradient m_cc compierecolor compierecolor type_gradient getvalue compierecolor type_texture m_cc compierecolor compierecolor type_texture getvalue compierecolor type_lines m_cc compierecolor compierecolor type_lines setcolor m_cc set color and update ui param color color public void set color compiere color color if color null m cc null return system out println compiere color editor set color color m cc color if m cc null m cc compiere panelui get default background update display update fields center panel set background color m cc center panel repaint setcolor compierecolor m_cc compierecoloreditor setcolor m_cc m_cc m_cc compierepanelui getdefaultbackground updatefields centerpanel setbackgroundcolor m_cc centerpanel update field from compiere color private void update fields m setting true type for int i 0 i compiere color types length i if m cc get type equals compiere color type values i type field set selected item compiere color types i break if m cc is flat flat field set visible true gradient upper set visible false gradient lower set visible false gradient start label set visible false gradient distance label set visible false gradient start field set visible false gradient distance field set visible false url label set visible false url field set visible false alpha label set visible false alpha field set visible false taint color set visible false line color set visible false back color set visible false width label set visible false width field set visible false distance label set visible false distance field set visible false flat field set background m cc get flat color else if m cc is gradient flat field set visible false gradient upper set visible true gradient lower set visible true gradient start label set visible true gradient distance label set visible true gradient start field set visible true gradient distance field set visible true url label set visible false url field set visible false alpha label set visible false alpha field set visible false taint color set visible false line color set visible false back color set visible false width label set visible false width field set visible false distance label set visible false distance field set visible false gradient upper set background m cc get gradient upper color gradient lower set background m cc get gradient lower color gradient distance field set text string value of m cc get gradient repeat distance for int i 0 i compiere color gradient sp length i if m cc get gradient start point compiere color gradient sp values i gradient start field set selected item compiere color gradient sp i break else if m cc is texture flat field set visible false gradient upper set visible false gradient lower set visible false gradient start label set visible false gradient distance label set visible false gradient start field set visible false gradient distance field set visible false url label set visible true url field set visible true alpha label set visible true alpha field set visible true taint color set visible true line color set visible false back color set visible false width label set visible false width field set visible false distance label set visible false distance field set visible false url field set text m cc get textureurl to string alpha field set text string value of m cc get texture composite alpha taint color set background m cc get texture taint color else if m cc is line flat field set visible false gradient upper set visible false gradient lower set visible false gradient start label set visible false gradient distance label set visible false gradient start field set visible false gradient distance field set visible false url label set visible false url field set visible false alpha label set visible false alpha field set visible false taint color set visible false line color set visible true back color set visible true width label set visible true width field set visible true distance label set visible true distance field set visible true line color set background m cc get line color back color set background m cc get line back color width field set text string value of m cc get line width distance field set text string value of m cc get line distance m setting false updatefield compierecolor updatefields m_setting compierecolor m_cc gettype compierecolor type_values typefield setselecteditem compierecolor m_cc isflat flatfield setvisible gradientupper setvisible gradientlower setvisible gradientstartlabel setvisible gradientdistancelabel setvisible gradientstartfield setvisible gradientdistancefield setvisible urllabel setvisible urlfield setvisible alphalabel setvisible alphafield setvisible taintcolor setvisible linecolor setvisible backcolor setvisible widthlabel setvisible widthfield setvisible distancelabel setvisible distancefield setvisible flatfield setbackground m_cc getflatcolor m_cc isgradient flatfield setvisible gradientupper setvisible gradientlower setvisible gradientstartlabel setvisible gradientdistancelabel setvisible gradientstartfield setvisible gradientdistancefield setvisible urllabel setvisible urlfield setvisible alphalabel setvisible alphafield setvisible taintcolor setvisible linecolor setvisible backcolor setvisible widthlabel setvisible widthfield setvisible distancelabel setvisible distancefield setvisible gradientupper setbackground m_cc getgradientuppercolor gradientlower setbackground m_cc getgradientlowercolor gradientdistancefield settext valueof m_cc getgradientrepeatdistance compierecolor gradient_sp m_cc getgradientstartpoint compierecolor gradient_sp_values gradientstartfield setselecteditem compierecolor gradient_sp m_cc istexture flatfield setvisible gradientupper setvisible gradientlower setvisible gradientstartlabel setvisible gradientdistancelabel setvisible gradientstartfield setvisible gradientdistancefield setvisible urllabel setvisible urlfield setvisible alphalabel setvisible alphafield setvisible taintcolor setvisible linecolor setvisible backcolor setvisible widthlabel setvisible widthfield setvisible distancelabel setvisible distancefield setvisible urlfield settext m_cc gettextureurl tostring alphafield settext valueof m_cc gettexturecompositealpha taintcolor setbackground m_cc gettexturetaintcolor m_cc isline flatfield setvisible gradientupper setvisible gradientlower setvisible gradientstartlabel setvisible gradientdistancelabel setvisible gradientstartfield setvisible gradientdistancefield setvisible urllabel setvisible urlfield setvisible alphalabel setvisible alphafield setvisible taintcolor setvisible linecolor setvisible backcolor setvisible widthlabel setvisible widthfield setvisible distancelabel setvisible distancefield setvisible linecolor setbackground m_cc getlinecolor backcolor setbackground m_cc getlinebackcolor widthfield settext valueof m_cc getlinewidth distancefield settext valueof m_cc getlinedistance m_setting get color return color when saved else null public compiere color get color return m cc compierecolor getcolor m_cc was the selection saved return true if saved public boolean is saved return m saved issaved m_saved set or change the object that is to be edited primitive types such as int must be wrapped as the corresponding object type such as java lang integer param value the new target object to be edited note that this object should not be modified by the property editor rather the property editor should create a new object to hold any modified value public void set value object value if value null value instanceof compiere color set color new compiere color compiere color value else throw new illegal argument exception compiere color editor set value requires compiere color propertyeditor propertyeditor setvalue compierecolor setcolor compierecolor compierecolor illegalargumentexception compierecoloreditor setvalue compierecolor gets the property value return the value of the property primitive types such as int will be wrapped as the corresponding object type such as java lang integer public object get value return get color getvalue getcolor determines whether this property editor is paintable return true if the class will honor the paint value method public boolean is paintable return false paintvalue ispaintable paint a representation of the value into a given area of screen real estate note that the property editor is responsible for doing its own clipping so that it fits into the given rectangle p if the property editor doesn t honor paint requests see is paintable this method should be a silent noop p the given graphics object will have the default font color etc of the parent container the property editor may change graphics attributes such as font and color and doesn t need to restore the old values param gfx graphics object to paint into param box rectangle within graphics object into which we should paint public void paint value graphics gfx rectangle box todo implement this java beans property editor method throw new java lang unsupported operation exception method paint value not yet implemented propertyeditor propertyeditor ispaintable propertyeditor paintvalue propertyeditor unsupportedoperationexception paintvalue this method is intended for use when generating java code to set the value of the property it should return a fragment of java code that can be used to initialize a variable with the current property value p example results are 2 new color 127 127 34 color orange etc return a fragment of java code representing an initializer for the current value public string get java initialization string return new compiere color getjavainitializationstring compierecolor gets the property value as text return the property value as a human editable string p returns null if the value can t be expressed as an editable string p if a non null value is returned then the property editor should be prepared to parse that string back in set as text public string get as text return m cc to string propertyeditor setastext getastext m_cc tostring set the property value by parsing a given string may raise java lang illegal argument exception if either the string is badly formatted or if this kind of property can t be expressed as text param text the string to be parsed throws illegal argument exception public void set as text string text throws java lang illegal argument exception throw new java lang illegal argument exception compiere color editor set as text not supported illegalargumentexception illegalargumentexception setastext illegalargumentexception illegalargumentexception compierecoloreditor setastext if the property value must be one of a set of known tagged values then this method should return an array of the tags this can be used to represent for example enum values if a property editor supports tags then it should support the use of set as text with a tag value as a way of setting the value and the use of get as text to identify the current value return the tag values for this property may be null if this property cannot be represented as a tagged value public string get tags return null propertyeditor setastext getastext gettags a property editor may choose to make available a full custom component that edits its property value it is the responsibility of the property editor to hook itself up to its editor component itself and to report property value changes by firing a property change event p the higher level code that calls get custom editor may either embed the component in some larger property sheet or it may put it in its own individual dialog or return a java awt component that will allow a human to directly edit the current property value may be null if this is not supported public component get custom editor return this propertyeditor propertyeditor propertychange getcustomeditor getcustomeditor determines whether this property editor supports a custom editor return true if the property editor can provide a custom editor public boolean supports custom editor return true propertyeditor supportscustomeditor register a listener for the property change event when a property editor changes its value it should fire a property change event on all registered property change listeners specifying the null value for the property name and itself as the source param listener an object to be invoked when a property change event is fired public void add property change listener property change listener listener super add property change listener listener propertychange propertyeditor propertychange propertychangelisteners propertychange addpropertychangelistener propertychangelistener addpropertychangelistener remove a listener for the property change event param listener the property change listener to be removed public void remove property change listener property change listener listener super remove property change listener listener propertychange propertychange removepropertychangelistener propertychangelistener removepropertychangelistener standard constructor public x gl fundrestriction properties ctx int gl fundrestriction id string trx name super ctx gl fundrestriction id trx name if gl fundrestriction id 0 setc elementvalue id 0 setgl fundrestriction id 0 setgl fund id 0 set name null x_gl_fundrestriction gl_fundrestriction_id trxname gl_fundrestriction_id trxname gl_fundrestriction_id setc_elementvalue_id setgl_fundrestriction_id setgl_fund_id setname load constructor public x gl fundrestriction properties ctx result set rs string trx name super ctx rs trx name x_gl_fundrestriction resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl fundrestriction append get id append return sb to string tostring stringbuffer stringbuffer x_gl_fundrestriction get_id tostring set account element account element public void setc elementvalue id int c elementvalue id if c elementvalue id 1 throw new illegal argument exception c elementvalue id is mandatory set value c elementvalue id new integer c elementvalue id setc_elementvalue_id c_elementvalue_id c_elementvalue_id illegalargumentexception c_elementvalue_id set_value c_elementvalue_id c_elementvalue_id get account element account element public int getc elementvalue id integer ii integer get value c elementvalue id if ii null return 0 return ii int value getc_elementvalue_id get_value c_elementvalue_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set fund restriction restriction of funds public void setgl fundrestriction id int gl fundrestriction id if gl fundrestriction id 1 throw new illegal argument exception gl fundrestriction id is mandatory set valuenocheck gl fundrestriction id new integer gl fundrestriction id setgl_fundrestriction_id gl_fundrestriction_id gl_fundrestriction_id illegalargumentexception gl_fundrestriction_id set_valuenocheck gl_fundrestriction_id gl_fundrestriction_id get fund restriction restriction of funds public int getgl fundrestriction id integer ii integer get value gl fundrestriction id if ii null return 0 return ii int value getgl_fundrestriction_id get_value gl_fundrestriction_id intvalue set gl fund general ledger funds control public void setgl fund id int gl fund id if gl fund id 1 throw new illegal argument exception gl fund id is mandatory set valuenocheck gl fund id new integer gl fund id setgl_fund_id gl_fund_id gl_fund_id illegalargumentexception gl_fund_id set_valuenocheck gl_fund_id gl_fund_id get gl fund general ledger funds control public int getgl fund id integer ii integer get value gl fund id if ii null return 0 return ii int value getgl_fund_id get_value gl_fund_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get tree node param tree tree param node id node return node or null public static mtree nodebp get mtree base tree int node id mtree nodebp ret value null string sql select from ad treenodebp where ad tree id and node id prepared statement pstmt null try pstmt db prepare statement sql tree get trxname pstmt set int 1 tree getad tree id pstmt set int 2 node id result set rs pstmt execute query if rs next ret value new mtree nodebp tree get ctx rs tree get trxname rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value node_id mtree_nodebp mtree_base node_id mtree_nodebp retvalue ad_treenodebp ad_tree_id node_id preparedstatement preparestatement get_trxname setint getad_tree_id setint node_id resultset executequery retvalue mtree_nodebp getctx get_trxname s_log retvalue load constructor param ctx context param rs result set public mtree nodebp properties ctx result set rs string trx name super ctx rs trx name mtree_nodebp resultset trxname trxname full constructor param tree tree param node id node public mtree nodebp mtree base tree int node id super tree get ctx 0 tree get trxname set client org tree setad tree id tree getad tree id setnode id node id add to root setparent id 0 set seq no 0 node_id mtree_nodebp mtree_base node_id getctx get_trxname setclientorg setad_tree_id getad_tree_id setnode_id node_id setparent_id setseqno standard constructor public x m inventorylinema properties ctx int m inventorylinema id string trx name super ctx m inventorylinema id trx name if m inventorylinema id 0 setm attributesetinstance id 0 setm inventoryline id 0 set movement qty env zero x_m_inventorylinema m_inventorylinema_id trxname m_inventorylinema_id trxname m_inventorylinema_id setm_attributesetinstance_id setm_inventoryline_id setmovementqty load constructor public x m inventorylinema properties ctx result set rs string trx name super ctx rs trx name x_m_inventorylinema resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inventorylinema append get id append return sb to string tostring stringbuffer stringbuffer x_m_inventorylinema get_id tostring set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set phys inventory line unique line in an inventory document public void setm inventoryline id int m inventoryline id if m inventoryline id 1 throw new illegal argument exception m inventoryline id is mandatory set valuenocheck m inventoryline id new integer m inventoryline id setm_inventoryline_id m_inventoryline_id m_inventoryline_id illegalargumentexception m_inventoryline_id set_valuenocheck m_inventoryline_id m_inventoryline_id get phys inventory line unique line in an inventory document public int getm inventoryline id integer ii integer get value m inventoryline id if ii null return 0 return ii int value getm_inventoryline_id get_value m_inventoryline_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm inventoryline id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_inventoryline_id set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty prepare e g get parameters protected void prepare perform process see also m sequenve validate return message to be translated throws exception protected string do it throws java lang exception log info check table sequences env get ctx this check tableid env get ctx this check client sequences env get ctx this return sequence check msequenve doit checktablesequences getctx checktableid getctx checkclientsequences getctx validate sequences param ctx context public static void validate properties ctx try check table sequences ctx null check tableid ctx null check client sequences ctx null catch exception e s log log level severe validate e checktablesequences checktableid checkclientsequences s_log check existence of table sequences param ctx comtext param sp server process or null private static void check table sequences properties ctx svr process sp string trx name null if sp null trx name sp get trxname string sql select table name from ad table t where is active y and is view n and not exists select from ad sequence s where upper s name upper t table name and s is tableid y prepared statement pstmt null try pstmt db prepare statement sql trx name result set rs pstmt execute query while rs next string table name rs get string 1 if m sequence create table sequence ctx table name trx name if sp null sp add log 0 null null table name else s log fine table name else rs close throw new exception error creating table sequence for table name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null sync table name case sql update ad sequence s set name select table name from ad table t where t is view n and upper s name upper t table name where s is tableid y and exists select from ad table t where t is active y and t is view n and upper s name upper t table name and s name t table name int no db execute update sql trx name if no 0 if sp null sp add log 0 null null sync name no else s log fine sync no if no 0 return find duplicates sql select table name s name from ad table t ad sequence s where t is active y and t is view n and upper s name upper t table name and s name t table name try pstmt db prepare statement sql null result set rs pstmt execute query while rs next string table name rs get string 1 string seq name rs get string 2 sp add log 0 null null error table name table name sequence seq name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null checktablesequences svrprocess trxname trxname get_trxname tablename ad_table isactive isview ad_sequence tablename istableid preparedstatement preparestatement trxname resultset executequery tablename getstring msequence createtablesequence tablename trxname addlog tablename s_log tablename tablename s_log ad_sequence tablename ad_table isview tablename istableid ad_table isactive isview tablename tablename executeupdate trxname addlog syncname s_log tablename ad_table ad_sequence isactive isview tablename tablename preparestatement resultset executequery tablename getstring seqname getstring addlog tablename tablename seqname s_log check table sequence id values param ctx comtext param sp server process or null private static void check tableid properties ctx svr process sp int id range end db getsql value null select id range end from ad system if id range end 0 id range end db getsql value null select min id range start 1 from ad replication s log info id range end id range end string sql select from ad sequence where is tableid y order by name int counter 0 prepared statement pstmt null string trx name null if sp null trx name sp get trxname try pstmt db prepare statement sql trx name result set rs pstmt execute query while rs next m sequence seq new m sequence ctx rs trx name int old seq get current next int old sys seq get current next sys if seq validate tableid value if seq get current next old string msg seq get name id old seq get current next if sp null sp add log 0 null null msg else s log fine msg if seq get current next sys old sys string msg seq get name sys old sys seq get current next sys if sp null sp add log 0 null null msg else s log fine msg if seq save counter else s log severe not updated seq else if c log mgt is level 6 log fine check tableid skipped table name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log fine counter checktableid svrprocess idrangeend getsqlvalue idrangeend ad_system idrangeend idrangeend getsqlvalue idrangestart ad_replication s_log idrangeend idrangeend ad_sequence istableid preparedstatement trxname trxname get_trxname preparestatement trxname resultset executequery msequence msequence trxname getcurrentnext oldsys getcurrentnextsys validatetableidvalue getcurrentnext getname getcurrentnext addlog s_log getcurrentnextsys oldsys getname oldsys getcurrentnextsys addlog s_log s_log clogmgt islevel checktableid tablename s_log s_log check initialize document no value sequences for all clients param ctx comtext param sp server process or null private static void check client sequences properties ctx svr process sp string trx name null if sp null trx name sp get trxname sequence for document no value m client clients m client get all ctx for int i 0 i clients length i m client client clients i if client is active continue m sequence check client sequences ctx client getad client id trx name for all clients documentno checkclientsequences svrprocess trxname trxname get_trxname documentno mclient mclient getall mclient isactive msequence checkclientsequences getad_client_id trxname get request type cached param ctx context param r requesttype id id return request type public static m request type get properties ctx int r requesttype id integer key new integer r requesttype id m request type ret value m request type s cache get key if ret value null ret value new m request type ctx r requesttype id null s cache put key ret value return ret value r_requesttype_id mrequesttype r_requesttype_id r_requesttype_id mrequesttype retvalue mrequesttype s_cache retvalue retvalue mrequesttype r_requesttype_id s_cache retvalue retvalue get default request type param ctx context return request type public static m request type get default properties ctx m request type ret value null int ad client id env getad client id ctx string sql select from r requesttype where ad client id in 0 11 order by is default desc ad client id desc prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next ret value new m request type ctx rs null if ret value is default ret value null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return ret value mrequesttype getdefault mrequesttype retvalue ad_client_id getad_client_id r_requesttype ad_client_id isdefault ad_client_id preparedstatement preparestatement resultset executequery retvalue mrequesttype retvalue isdefault retvalue sqlexception s_log sqlexception retvalue standard constructor param ctx context param r requesttype id id public m request type properties ctx int r requesttype id string trx name super ctx r requesttype id trx name if r requesttype id 0 setr requesttype id 0 set name null set due date tolerance 7 set is default false set ise mail when due false set ise mail when overdue false set is self service true y set auto due date days 0 set confidential type confidentialtype customerconfidential set is auto change request false set is confidential info false r_requesttype_id mrequesttype r_requesttype_id trxname r_requesttype_id trxname r_requesttype_id setr_requesttype_id setname setduedatetolerance setisdefault setisemailwhendue setisemailwhenoverdue setisselfservice setautoduedatedays setconfidentialtype confidentialtype_customerconfidential setisautochangerequest setisconfidentialinfo load constructor param ctx context param rs result set public m request type properties ctx result set rs string trx name super ctx rs trx name mrequesttype resultset trxname trxname update statistics private synchronized void update statistics if system current time millis m nextstats return string sql select select count from r request r inner join r status s on r r status id s r status id and s is open y where r r requesttype id x r requesttype id as open no select count from r request r where r r requesttype id x r requesttype id as total no select count from r request r where r r requesttype id x r requesttype id and created sys date 30 as new30 no select count from r request r inner join r status s on r r status id s r status id and s is closed y where r r requesttype id x r requesttype id and r updated sys date 30 as closed30 no from r requesttype x where r requesttype id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getr requesttype id result set rs pstmt execute query if rs next m openno rs get int 1 m totalno rs get int 2 m new30no rs get int 3 m closed30no rs get int 4 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m nextstats system current time millis 3600000 every hour updatestatistics currenttimemillis m_nextstats r_request r_status r_status_id r_status_id isopen r_requesttype_id r_requesttype_id openno r_request r_requesttype_id r_requesttype_id totalno r_request r_requesttype_id r_requesttype_id sysdate new30no r_request r_status r_status_id r_status_id isclosed r_requesttype_id r_requesttype_id sysdate closed30no r_requesttype r_requesttype_id preparedstatement preparestatement setint getr_requesttype_id resultset executequery m_openno getint m_totalno getint m_new30no getint m_closed30no getint m_nextstats currenttimemillis get total no of requests of type return no public int get total no update statistics return m totalno gettotalno updatestatistics m_totalno get open no of requests of type return no public int get open no update statistics return m openno getopenno updatestatistics m_openno get closed in last 30 days of type return no public int get closed30 no update statistics return m closed30no getclosed30no updatestatistics m_closed30no get new in the last 30 days of type return no public int get new30 no update statistics return m new30no getnew30no updatestatistics m_new30no get requests of type param self service self service param c bpartner id id or 0 for public return array of requests public m request get requests boolean self service int c bpartner id string sql select from r request where r requesttype id if self service sql and is self service y if c bpartner id 0 sql and confidential type a else sql and confidential type a or c bpartner id c bpartner id sql order by document no desc array list m request list new array list m request prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getr requesttype id result set rs pstmt execute query while rs next list add new m request get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m request ret value new m request list size list to array ret value return ret value selfservice c_bpartner_id mrequest getrequests selfservice c_bpartner_id r_request r_requesttype_id selfservice isselfservice c_bpartner_id confidentialtype confidentialtype c_bpartner_id c_bpartner_id documentno arraylist mrequest arraylist mrequest preparedstatement preparestatement setint getr_requesttype_id resultset executequery mrequest getctx mrequest retvalue mrequest toarray retvalue retvalue get public requests of type return array of requests public m request get requests return get requests true 0 mrequest getrequests getrequests get default r status id for type return status or 0 public int getdefaultr status id if getr statuscategory id 0 m status category sc m status category get default get ctx if sc null sc m status category create default get ctx if sc null sc getr statuscategory id 0 setr statuscategory id sc getr statuscategory id if getr statuscategory id 0 m status category sc m status category get get ctx getr statuscategory id return sc getdefaultr status id return 0 r_status_id getdefaultr_status_id getr_statuscategory_id mstatuscategory mstatuscategory getdefault getctx mstatuscategory createdefault getctx getr_statuscategory_id setr_statuscategory_id getr_statuscategory_id getr_statuscategory_id mstatuscategory mstatuscategory getctx getr_statuscategory_id getdefaultr_status_id before save param new record new return true protected boolean before save boolean new record if getr statuscategory id 0 m status category sc m status category get default get ctx if sc null sc getr statuscategory id 0 setr statuscategory id sc getr statuscategory id return true newrecord beforesave newrecord getr_statuscategory_id mstatuscategory mstatuscategory getdefault getctx getr_statuscategory_id setr_statuscategory_id getr_statuscategory_id string representation return info public string to string string buffer sb new string buffer m request type sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer mrequesttype get_id getname tostring get sql to return single value for the performance indicator param restrictions array of goal restrictions param measure scope scope of this value oaram measure data type data type param report date optional report date return sql for performance indicator public string get sqlpi m goal restriction restrictions string measure scope string measure data type timestamp report date m role role string date column created string org column ad org id string bp column c bpartner id string p column m product id planned amt planned qty count string buffer sb new string buffer select count from r request where r requesttype id getr requesttype id and processed y date restriction if m measure measuredatatype qtyamountintime equals measure data type m goal measuredisplay total equals measure scope if report date null report date new timestamp system current time millis string date string db to date report date string trunc d if m goal measuredisplay year equals measure scope trunc y else if m goal measuredisplay quarter equals measure scope trunc q else if m goal measuredisplay month equals measure scope trunc mm else if m goal measuredisplay week equals measure scope trunc w else if m goal measuredisplay day equals measure display sb append and trunc append date column append append trunc append trunc append db to date report date append append trunc append date string sql m measure calc add restrictions sb to string false restrictions role r request org column bp column p column log fine sql return sql measurescope measuredatatype reportdate getsqlpi mgoalrestriction measurescope measuredatatype reportdate mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn m_product_id plannedamt plannedqty stringbuffer stringbuffer r_request r_requesttype_id getr_requesttype_id mmeasure measuredatatype_qtyamountintime measuredatatype mgoal measuredisplay_total measurescope reportdate reportdate currenttimemillis datestring to_date reportdate mgoal measuredisplay_year measurescope mgoal measuredisplay_quarter measurescope mgoal measuredisplay_month measurescope mgoal measuredisplay_week measurescope mgoal measuredisplay_day measuredisplay datecolumn to_date reportdate mmeasurecalc addrestrictions tostring r_request orgcolumn bpcolumn pcolumn get sql to value for the bar chart param restrictions array of goal restrictions param measure display scope of this value param measure data type data type param start date optional report start date return sql for bar chart public string get sql bar chart m goal restriction restrictions string measure display string measure data type timestamp start date m role role string date column created string org column ad org id string bp column c bpartner id string p column m product id string buffer sb new string buffer select count string group by null string order by null if m measure measuredatatype qtyamountintime equals measure data type m goal measuredisplay total equals measure display string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display order by trunc date column trunc group by order by 0 sb append group by append from r request else order by s seq no group by coalesce s name to nchar s r status id s seq no sb append group by append from r request left outer join r status s on r request r status id s r status id where sb append where r request r requesttype id append getr requesttype id append and r request processed y date restriction if start date null m goal measuredisplay total equals measure display string date string db to date start date sb append and append date column append append date string date string sql m measure calc add restrictions sb to string false restrictions role r request org column bp column p column if group by null sql group by group by order by order by log fine sql return sql measuredisplay measuredatatype startdate getsqlbarchart mgoalrestriction measuredisplay measuredatatype startdate mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn m_product_id stringbuffer stringbuffer groupby orderby mmeasure measuredatatype_qtyamountintime measuredatatype mgoal measuredisplay_total measuredisplay mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay orderby datecolumn groupby orderby groupby r_request orderby seqno groupby to_nchar r_status_id seqno groupby r_request r_status r_request r_status_id r_status_id r_request r_requesttype_id getr_requesttype_id r_request startdate mgoal measuredisplay_total measuredisplay datestring to_date startdate datecolumn datestring mmeasurecalc addrestrictions tostring r_request orgcolumn bpcolumn pcolumn groupby groupby orderby get zoom query return query public m query get query m goal restriction restrictions string measure display timestamp date int r status id m role role string date column created string org column ad org id string bp column c bpartner id string p column m product id m query query new m query r request query add restriction r requesttype id getr requesttype id string where null if r status id 0 where r status id r status id else string trunc d if m goal measuredisplay year equals measure display trunc y else if m goal measuredisplay quarter equals measure display trunc q else if m goal measuredisplay month equals measure display trunc mm else if m goal measuredisplay week equals measure display trunc w else if m goal measuredisplay day equals measure display trunc d where trunc date column trunc trunc db to date date trunc string where restriction m measure calc add restrictions where and processed y true restrictions role r request org column bp column p column query add restriction where restriction query set record count 1 return query mquery getquery mgoalrestriction measuredisplay r_status_id mrole datecolumn orgcolumn ad_org_id bpcolumn c_bpartner_id pcolumn m_product_id mquery mquery r_request addrestriction r_requesttype_id getr_requesttype_id r_status_id r_status_id r_status_id mgoal measuredisplay_year measuredisplay mgoal measuredisplay_quarter measuredisplay mgoal measuredisplay_month measuredisplay mgoal measuredisplay_week measuredisplay mgoal measuredisplay_day measuredisplay datecolumn to_date whererestriction mmeasurecalc addrestrictions r_request orgcolumn bpcolumn pcolumn addrestriction whererestriction setrecordcount default constructor param ctx param s expensetype id public m expense type properties ctx int s expensetype id string trx name super ctx s expensetype id trx name s_expensetype_id mexpensetype s_expensetype_id trxname s_expensetype_id trxname m expense type param ctx param rs public m expense type properties ctx result set rs string trx name super ctx rs trx name mexpensetype mexpensetype resultset trxname trxname get product return product public m product get product if m product null m product products m product get get ctx s expensetype id gets expensetype id get trxname if products length 0 m product products 0 return m product mproduct getproduct m_product mproduct mproduct getctx s_expensetype_id gets_expensetype_id get_trxname m_product m_product before save see org compiere model po before save boolean param new record return true protected boolean before save boolean new record if new record if get value null get value length 0 set value get name m product new m product this return m product save get trxname return true beforesave beforesave newrecord beforesave newrecord newrecord getvalue getvalue setvalue getname m_product mproduct m_product get_trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if success return success m product prod get product if prod set expense type this prod save get trxname return success newrecord aftersave newrecord mproduct getproduct setexpensetype get_trxname create posting document param ass accounting schema param ad table id table id of documents param record id record id to load param trx name transaction name return document or null public static doc get m acct schema ass int ad table id int record id string trx name string table name null for int i 0 i documents tableid length i if documents tableid i ad table id table name documents table name i break if table name null s log severe not found ad table id ad table id return null doc doc null string buffer sql new string buffer select from append table name append where append table name append id and processed y prepared statement pstmt null try pstmt db prepare statement sql to string trx name pstmt set int 1 record id result set rs pstmt execute query if rs next doc get ass ad table id rs trx name else s log severe not found table name id record id rs close pstmt close pstmt null catch exception e s log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null return doc ad_table_id record_id trxname macctschema ad_table_id record_id trxname tablename documentstableid documentstableid ad_table_id tablename documentstablename tablename s_log ad_table_id ad_table_id stringbuffer stringbuffer tablename tablename _id preparedstatement preparestatement tostring trxname setint record_id resultset executequery ad_table_id trxname s_log tablename _id record_id s_log tostring create posting document param ass accounting schema param ad table id table id of documents param rs result set param trx name transaction name return document public static doc get m acct schema ass int ad table id result set rs string trx name doc doc null switch ad table id case m invoice table id doc new doc invoice ass rs trx name break case m allocation hdr table id doc new doc allocation ass rs trx name break case m cash table id doc new doc cash ass rs trx name break case m bank statement table id doc new doc bank ass rs trx name break case m order table id doc new doc order ass rs trx name break case m payment table id doc new doc payment ass rs trx name break case m in out table id doc new doc inout ass rs trx name break case m inventory table id doc new doc inventory ass rs trx name break case m movement table id doc new doc movement ass rs trx name break case x m production table id doc new doc production ass rs trx name break case m journal table id doc new doc gljournal ass rs trx name break case m match inv table id doc new doc matchinv ass rs trx name break case m matchpo table id doc new doc matchpo ass rs trx name break case m project issue table id doc new doc projectissue ass rs trx name break case m requisition table id doc new doc requisition ass rs trx name break if doc null s log log level severe unknown ad table id ad table id return doc ad_table_id resultset trxname macctschema ad_table_id resultset trxname ad_table_id minvoice table_id doc_invoice trxname mallocationhdr table_id doc_allocation trxname mcash table_id doc_cash trxname mbankstatement table_id doc_bank trxname morder table_id doc_order trxname mpayment table_id doc_payment trxname minout table_id doc_inout trxname minventory table_id doc_inventory trxname mmovement table_id doc_movement trxname x_m_production table_id doc_production trxname mjournal table_id doc_gljournal trxname mmatchinv table_id doc_matchinv trxname mmatchpo table_id doc_matchpo trxname mprojectissue table_id doc_projectissue trxname mrequisition table_id doc_requisition trxname s_log ad_table_id ad_table_id post document param ass accounting schemata param ad table id transaction table param record id record id of this document param force force posting return null if the document was posted or error message public static string post immediate m acct schema ass int ad table id int record id boolean force string trx name doc doc get ass ad table id record id trx name if doc null return doc post force true repost return no doc ad_table_id record_id postimmediate macctschema ad_table_id record_id trxname ad_table_id record_id trxname nodoc constructor param ass accounting schemata param clazz document class param rs result set param default document type default document type or null param trx name trx doc m acct schema ass class clazz result set rs string default document type string trx name p status status error m ass ass m ctx new properties m ass 0 get ctx m ctx set property ad client id string value of m ass 0 getad client id string class name clazz get name class name class name substring class name last index of 1 try constructor constructor clazz get constructor new class properties class result set class string class p po po constructor new instance new object m ctx rs trx name catch exception e string msg class name e get localized message log severe msg throw new illegal argument exception msg document type set document type default document type m trxname trx name if m trxname null m trxname post get document type p po get id p po set trxname m trxname amounts m amounts 0 env zero m amounts 1 env zero m amounts 2 env zero m amounts 3 env zero defaultdocumenttype trxname macctschema resultset defaultdocumenttype trxname p_status status_error m_ass m_ctx m_ass getctx m_ctx setproperty ad_client_id valueof m_ass getad_client_id classname getname classname classname classname lastindexof getconstructor resultset p_po newinstance m_ctx trxname classname getlocalizedmessage illegalargumentexception setdocumenttype defaultdocumenttype m_trxname trxname m_trxname m_trxname getdocumenttype p_po get_id p_po set_trxname m_trxname m_amounts m_amounts m_amounts m_amounts get context return context protected properties get ctx return m ctx getctx m_ctx get table name return table name public string get tablename return p po get tablename get_tablename p_po get_tablename get table id return table id public int get table id return p po get table id get_table_id p_po get_table_id get record id return record id public int get id return p po get id record_id get_id p_po get_id get persistent object return po protected po getpo return p po p_po post document pre try to lock document processed y and processing n and posted n if not ok return false postlogic for all accounting schema create fact lines post commit commits fact lines and document sets processing n if error create note pre param force if true ignore that locked param repost if true ignore that already posted return null if posted error otherwise public final string post boolean force boolean repost if p po getad client id m ass 0 getad client id string error ad client id conflict document p po getad client id acct schema m ass 0 getad client id log severe error return error lock record string buffer sql new string buffer update sql append get tablename append set processing y where append get tablename append id append get id append and processed y and is active y if force sql append and processing n or processing is null if repost sql append and posted n if db execute update sql to string get trx name 1 log info locked get tablename id get id else log log level severe resubmit cannot lock get tablename id get id force force re post repost return cannot lock resubmit p error load document details if p error null return p error delete existing accounting if repost if is posted is period open already posted don t delete if period closed log log level severe to string period closed for already posed document return period closed delete it sql new string buffer delete fact acct where ad table id sql append get table id append and record id append p po get id int no db execute update sql to string get trx name if no 0 log info deleted no else if is posted log log level severe to string document already posted return already posted p status status notposted create fact per acct schema m fact m fact new array list fact for all accounting schema boolean ok true try for int i 0 ok i m ass length i if acct schema has only org skip boolean skip false if m ass i getad orgonly id 0 if m ass i get only orgs null m ass i set only orgs m report tree get childi ds get ctx 0 m acct schema element elementtype organization m ass i getad orgonly id header level org skip m ass i is skip org getad org id line level org for int line 0 skip line p lines length line skip m ass i is skip org p lines line getad org id if skip break if skip continue post log info i p po p status post logic i if p status equals status posted ok false catch exception e log log level severe e p status status error p error e to string ok false commit fact p status post commit p status create note if p status equals status posted insert note string ad messagevalue posting error p status int ad user id p po get updated by m note note new m note get ctx ad messagevalue ad user id getad client id getad org id null note set record p po get table id p po get id reference note set reference to string document text string buffer text new string buffer msg get msg env get ctx ad messagevalue if p error null text append append p error append string cn get class get name text append append cn substring cn last index of append append get document type append document no append get document no append date acct append get date acct to string substring 0 10 append amount append get amount append sta append p status append period open append is period open append balanced append is balanced note set text msg text to string note save dispose facts for int i 0 i m fact size i fact fact m fact get i if fact null fact dispose p lines null if p status equals status posted return null return p error postcommit p_po getad_client_id m_ass getad_client_id ad_client_id p_po getad_client_id acctschema m_ass getad_client_id stringbuffer stringbuffer get_tablename get_tablename _id get_id isactive executeupdate tostring gettrxname get_tablename _id get_id get_tablename _id get_id repost p_error loaddocumentdetails p_error p_error isposted isperiodopen tostring periodclosed stringbuffer fact_acct ad_table_id get_table_id record_id p_po get_id executeupdate tostring gettrxname isposted tostring alreadyposted p_status status_notposted acctschema m_fact m_fact arraylist m_ass m_ass getad_orgonly_id m_ass getonlyorgs m_ass setonlyorgs mreporttree getchildids getctx macctschemaelement elementtype_organization m_ass getad_orgonly_id m_ass isskiporg getad_org_id p_lines m_ass isskiporg p_lines getad_org_id p_po p_status postlogic p_status status_posted p_status status_error p_error tostring commitfact p_status postcommit p_status p_status status_posted ad_messagevalue postingerror p_status ad_user_id p_po getupdatedby mnote mnote getctx ad_messagevalue ad_user_id getad_client_id getad_org_id setrecord p_po get_table_id p_po get_id setreference tostring stringbuffer stringbuffer getmsg getctx ad_messagevalue p_error p_error getclass getname lastindexof getdocumenttype documentno getdocumentno dateacct getdateacct tostring getamount p_status periodopen isperiodopen isbalanced settextmsg tostring m_fact m_fact p_lines p_status status_posted p_error posting logic for accounting schema index param index accounting schema index return posting status error code private final string post logic int index log info index p po reject unbalanced if m ass index is suspense balancing is balanced return status notbalanced reject unconvertible if is convertible m ass index return status notconvertible reject period closed if is period open return status periodclosed create facts array list fact facts create facts m ass index if facts null return status error for int f 0 f facts size f fact fact facts get f if fact null return status error m fact add fact p status status postprepared check accounts if fact check accounts return status invalidaccount distribute if fact distribute return status error balance source if fact is source balanced fact balance source if fact is source balanced return status notbalanced balance segments if fact is segment balanced fact balance segments if fact is segment balanced return status notbalanced balance accounting if fact is acct balanced fact balance accounting if fact is acct balanced return status notbalanced for all facts return status posted postlogic p_po rejectunbalanced m_ass issuspensebalancing isbalanced status_notbalanced rejectunconvertible isconvertible m_ass status_notconvertible rejectperiodclosed isperiodopen status_periodclosed createfacts arraylist createfacts m_ass status_error status_error m_fact p_status status_postprepared checkaccounts status_invalidaccount status_error balancesource issourcebalanced balancesource issourcebalanced status_notbalanced balancesegments issegmentbalanced balancesegments issegmentbalanced status_notbalanced balanceaccounting isacctbalanced balanceaccounting isacctbalanced status_notbalanced status_posted post commit save facts document param status status return posting status private final string post commit string status log info sta status dt get document type id p po get id p status status trx trx trx get get trx name true try transaction start commit facts if status equals status posted for int i 0 i m fact size i fact fact m fact get i if fact null else if fact save get trx name else log log level severe fact not saved rolling back trx rollback trx close unlock return status error commit doc if save get trx name contains unlock document status update log log level severe doc not saved rolling back trx rollback trx close unlock return status error success trx commit trx close trx null transaction end catch exception e log log level severe rolling back e status status error try if trx null trx rollback catch exception e2 try if trx null trx close trx null catch exception e3 unlock p status status return status postcommit getdocumenttype p_po get_id p_status gettrxname status_posted m_fact m_fact gettrxname status_error gettrxname status_error status_error p_status get trx name and create transaction return trx name protected string get trx name return m trxname gettrxname m_trxname unlock document private void unlock string buffer sql new string buffer update sql append get tablename append set processing n where append get tablename append id append p po get id db execute update sql to string null no trx stringbuffer stringbuffer get_tablename get_tablename _id p_po get_id executeupdate tostring load document type and gl info set p documenttype and p gl category id protected string get document type if m documenttype null set document type null return m documenttype p_documenttype p_gl_category_id getdocumenttype m_documenttype setdocumenttype m_documenttype load document type and gl info set p documenttype and p gl category id param document type protected void set document type string document type if document type null m documenttype document type no document type defined if m documenttype null getc doctype id 0 string sql select doc base type gl category id from c doctype where c doctype id try prepared statement pstmt db prepare statement sql null pstmt set int 1 getc doctype id result set rsdt pstmt execute query if rsdt next m documenttype rsdt get string 1 m gl category id rsdt get int 2 rsdt close pstmt close catch sql exception e log log level severe sql e if m documenttype null log log level severe no doc base type setup for c doctype id getc doctype id document no get document no we have a document type but no gl info search for doc type if m gl category id 0 string sql select gl category id from c doctype where ad client id and doc base type try prepared statement pstmt db prepare statement sql null pstmt set int 1 getad client id pstmt set string 2 m documenttype result set rsdt pstmt execute query if rsdt next m gl category id rsdt get int 1 rsdt close pstmt close catch sql exception e log log level severe sql e still no gl category get default gl category if m gl category id 0 string sql select gl category id from gl category where ad client id order by is default desc try prepared statement pstmt db prepare statement sql null pstmt set int 1 getad client id result set rsdt pstmt execute query if rsdt next m gl category id rsdt get int 1 rsdt close pstmt close catch sql exception e log log level severe sql e if m gl category id 0 log log level severe no default gl category to string if m documenttype null throw new illegal state exception document type not found p_documenttype p_gl_category_id documenttype setdocumenttype documenttype documenttype m_documenttype documenttype m_documenttype getc_doctype_id docbasetype gl_category_id c_doctype c_doctype_id preparedstatement preparestatement setint getc_doctype_id resultset executequery m_documenttype getstring m_gl_category_id getint sqlexception m_documenttype docbasetype c_doctype_id getc_doctype_id documentno getdocumentno doctype m_gl_category_id gl_category_id c_doctype ad_client_id docbasetype preparedstatement preparestatement setint getad_client_id setstring m_documenttype resultset executequery m_gl_category_id getint sqlexception gl_category m_gl_category_id gl_category_id gl_category ad_client_id isdefault preparedstatement preparestatement setint getad_client_id resultset executequery m_gl_category_id getint sqlexception m_gl_category_id gl_category tostring m_documenttype illegalstateexception is the source document balanced return true if source baanced public boolean is balanced multi currency documents are source balanced by definition if is multi currency return true boolean ret value get balance signum 0 if ret value log fine yes to string else log warning no to string return ret value isbalanced ismulticurrency retvalue getbalance retvalue tostring tostring retvalue is document convertible to currency and conversion type param acct schema accounting schema return true if vonvertable to accounting currency public boolean is convertible m acct schema acct schema no currency in document if getc currency id no currency log fine none to string return true get all currencies hash set integer set new hash set integer set add new integer getc currency id for int i 0 p lines null i p lines length i int c currency id p lines i getc currency id if c currency id no currency set add new integer c currency id just one and the same if set size 1 acct schema getc currency id getc currency id log fine same cur getc currency id to string return true boolean convertible true iterator it set iterator while it has next convertible int c currency id integer it next int value if c currency id acct schema getc currency id big decimal amt m conversion rate get rate c currency id acct schema getc currency id get date acct getc conversiontype id getad client id getad org id if amt null convertible false log warning not from c currency id c currency id to acct schema getc currency id to string else log fine from c currency id c currency id log fine convertible convertible acct schema c currency id acct schema getc currency id to string return convertible acctschema isconvertible macctschema acctschema getc_currency_id no_currency tostring hashset hashset getc_currency_id p_lines p_lines c_currency_id p_lines getc_currency_id c_currency_id no_currency c_currency_id acctschema getc_currency_id getc_currency_id getc_currency_id tostring hasnext c_currency_id intvalue c_currency_id acctschema getc_currency_id bigdecimal mconversionrate getrate c_currency_id acctschema getc_currency_id getdateacct getc_conversiontype_id getad_client_id getad_org_id c_currency_id c_currency_id acctschema getc_currency_id tostring c_currency_id c_currency_id acctschema c_currency_id acctschema getc_currency_id tostring calculate period from date acct m c period id is set to 1 of not open to 0 if not found public void set period if m period null return period defined in gl journal e g adjustment period int index p po get columnindex c period id if index 1 integer ii integer p po get value index if ii null m period m period get get ctx ii int value m trxname if m period null m period m period get get ctx get date acct is period open if m period null m period is open get document type m c period id m period getc period id else m c period id 1 log fine ad client id get date acct get document type m c period id dateacct m_c_period_id setperiod m_period p_po get_columnindex c_period_id p_po get_value m_period mperiod getctx intvalue m_trxname m_period m_period mperiod getctx getdateacct m_period m_period isopen getdocumenttype m_c_period_id m_period getc_period_id m_c_period_id ad_client_id getdateacct getdocumenttype m_c_period_id get c period id return period public int getc period id if m period null set period return m c period id c_period_id getc_period_id m_period setperiod m_c_period_id is period open return true if period is open public boolean is period open set period boolean open m c period id 0 if open log fine yes to string else log warning no to string return open isperiodopen setperiod m_c_period_id tostring tostring get the amount loaded in load document details param amt type see amttype return amount public big decimal get amount int amt type if amt type 0 amt type m amounts length return null return m amounts amt type loaddocumentdetails amttype amttype_ bigdecimal getamount amttype amttype amttype m_amounts m_amounts amttype set the amount param amt type see amttype param amt amount protected void set amount int amt type big decimal amt if amt type 0 amt type m amounts length return if amt null m amounts amt type env zero else m amounts amt type amt amttype amttype_ setamount amttype bigdecimal amttype amttype m_amounts m_amounts amttype m_amounts amttype get amount with index 0 return amount primary document amount public big decimal get amount return m amounts 0 bigdecimal getamount m_amounts set quantity param qty quantity protected void set qty big decimal qty m qty qty setqty bigdecimal m_qty get quantity return quantity public big decimal get qty if m qty null int index p po get columnindex qty if index 1 m qty big decimal p po get value index else m qty env zero return m qty bigdecimal getqty m_qty p_po get_columnindex m_qty bigdecimal p_po get_value m_qty m_qty get the valid combination id for accounting schema param acct type see accttype param as accounting schema return c validcombination id public int getvalidcombination id int acct type m acct schema as int para 1 0 first parameter second is always acct schema string sql null account type invoice if acct type accttype charge see get charge account in doc line int cmp get amount amttype charge compare to env zero if cmp 0 return 0 else if cmp 0 sql select ch expense acct from c charge acct where c charge id and c acctschema id else sql select ch revenue acct from c charge acct where c charge id and c acctschema id para 1 getc charge id else if acct type accttype v liability sql select v liability acct from c bp vendor acct where c bpartner id and c acctschema id para 1 getc bpartner id else if acct type accttype v liability services sql select v liability services acct from c bp vendor acct where c bpartner id and c acctschema id para 1 getc bpartner id else if acct type accttype c receivable sql select c receivable acct from c bp customer acct where c bpartner id and c acctschema id para 1 getc bpartner id else if acct type accttype c receivable services sql select c receivable services acct from c bp customer acct where c bpartner id and c acctschema id para 1 getc bpartner id else if acct type accttype v prepayment sql select v prepayment acct from c bp vendor acct where c bpartner id and c acctschema id para 1 getc bpartner id else if acct type accttype c prepayment sql select c prepayment acct from c bp customer acct where c bpartner id and c acctschema id para 1 getc bpartner id account type payment else if acct type accttype unallocatedcash sql select b unallocatedcash acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id else if acct type accttype bankintransit sql select b intransit acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id else if acct type accttype paymentselect sql select b paymentselect acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id account type allocation else if acct type accttype discountexp sql select a paydiscount exp acct from c bp group acct a c bpartner bp where a c bp group id bp c bp group id and bp c bpartner id and a c acctschema id para 1 getc bpartner id else if acct type accttype discountrev sql select paydiscount rev acct from c bp group acct a c bpartner bp where a c bp group id bp c bp group id and bp c bpartner id and a c acctschema id para 1 getc bpartner id else if acct type accttype writeoff sql select writeoff acct from c bp group acct a c bpartner bp where a c bp group id bp c bp group id and bp c bpartner id and a c acctschema id para 1 getc bpartner id account type bank statement else if acct type accttype bankasset sql select b asset acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id else if acct type accttype interestrev sql select b interestrev acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id else if acct type accttype interestexp sql select b interestexp acct from c bankaccount acct where c bankaccount id and c acctschema id para 1 getc bankaccount id account type cash else if acct type accttype cashasset sql select cb asset acct from c cashbook acct where c cashbook id and c acctschema id para 1 getc cashbook id else if acct type accttype cashtransfer sql select cb cashtransfer acct from c cashbook acct where c cashbook id and c acctschema id para 1 getc cashbook id else if acct type accttype cashexpense sql select cb expense acct from c cashbook acct where c cashbook id and c acctschema id para 1 getc cashbook id else if acct type accttype cashreceipt sql select cb receipt acct from c cashbook acct where c cashbook id and c acctschema id para 1 getc cashbook id else if acct type accttype cashdifference sql select cb differences acct from c cashbook acct where c cashbook id and c acctschema id para 1 getc cashbook id inventory accounts else if acct type accttype invdifferences sql select w differences acct from m warehouse acct where m warehouse id and c acctschema id select w inventory acct w revaluation acct w invactualadjust acct from m warehouse acct where m warehouse id and c acctschema id para 1 getm warehouse id else if acct type accttype notinvoicedreceipts sql select notinvoicedreceipts acct from c bp group acct a c bpartner bp where a c bp group id bp c bp group id and bp c bpartner id and a c acctschema id para 1 getc bpartner id project accounts else if acct type accttype projectasset sql select pj asset acct from c project acct where c project id and c acctschema id para 1 getc project id else if acct type accttype projectwip sql select pj wip acct from c project acct where c project id and c acctschema id para 1 getc project id gl accounts else if acct type accttype ppvoffset sql select ppvoffset acct from c acctschema gl where c acctschema id para 1 1 else if acct type accttype commitmentoffset sql select commitmentoffset acct from c acctschema gl where c acctschema id para 1 1 else log severe not found acct type acct type return 0 do we have sql parameter if sql null para 1 0 log severe no parameter for acct type acct type sql sql return 0 get acct int account id 0 try prepared statement pstmt db prepare statement sql null if para 1 1 gl accounts pstmt set int 1 as getc acctschema id else pstmt set int 1 para 1 pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next account id rs get int 1 rs close pstmt close catch sql exception e log log level severe acct type acct type sql sql e return 0 no account if account id 0 log severe no account type acct type record p po get id return 0 return account id accttype accttype_ c_validcombination_id getvalidcombination_id accttype macctschema para_1 acctschema accttype accttype_charge getchargeaccount docline getamount amttype_charge compareto ch_expense_acct c_charge_acct c_charge_id c_acctschema_id ch_revenue_acct c_charge_acct c_charge_id c_acctschema_id para_1 getc_charge_id accttype accttype_v_liability v_liability_acct c_bp_vendor_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_v_liability_services v_liability_services_acct c_bp_vendor_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_c_receivable c_receivable_acct c_bp_customer_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_c_receivable_services c_receivable_services_acct c_bp_customer_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_v_prepayment v_prepayment_acct c_bp_vendor_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_c_prepayment c_prepayment_acct c_bp_customer_acct c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_unallocatedcash b_unallocatedcash_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_bankintransit b_intransit_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_paymentselect b_paymentselect_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_discountexp paydiscount_exp_acct c_bp_group_acct c_bpartner c_bp_group_id c_bp_group_id c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_discountrev paydiscount_rev_acct c_bp_group_acct c_bpartner c_bp_group_id c_bp_group_id c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_writeoff writeoff_acct c_bp_group_acct c_bpartner c_bp_group_id c_bp_group_id c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_bankasset b_asset_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_interestrev b_interestrev_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_interestexp b_interestexp_acct c_bankaccount_acct c_bankaccount_id c_acctschema_id para_1 getc_bankaccount_id accttype accttype_cashasset cb_asset_acct c_cashbook_acct c_cashbook_id c_acctschema_id para_1 getc_cashbook_id accttype accttype_cashtransfer cb_cashtransfer_acct c_cashbook_acct c_cashbook_id c_acctschema_id para_1 getc_cashbook_id accttype accttype_cashexpense cb_expense_acct c_cashbook_acct c_cashbook_id c_acctschema_id para_1 getc_cashbook_id accttype accttype_cashreceipt cb_receipt_acct c_cashbook_acct c_cashbook_id c_acctschema_id para_1 getc_cashbook_id accttype accttype_cashdifference cb_differences_acct c_cashbook_acct c_cashbook_id c_acctschema_id para_1 getc_cashbook_id accttype accttype_invdifferences w_differences_acct m_warehouse_acct m_warehouse_id c_acctschema_id w_inventory_acct w_revaluation_acct w_invactualadjust_acct m_warehouse_acct m_warehouse_id c_acctschema_id para_1 getm_warehouse_id accttype accttype_notinvoicedreceipts notinvoicedreceipts_acct c_bp_group_acct c_bpartner c_bp_group_id c_bp_group_id c_bpartner_id c_acctschema_id para_1 getc_bpartner_id accttype accttype_projectasset pj_asset_acct c_project_acct c_project_id c_acctschema_id para_1 getc_project_id accttype accttype_projectwip pj_wip_acct c_project_acct c_project_id c_acctschema_id para_1 getc_project_id accttype accttype_ppvoffset ppvoffset_acct c_acctschema_gl c_acctschema_id para_1 accttype accttype_commitmentoffset commitmentoffset_acct c_acctschema_gl c_acctschema_id para_1 accttype accttype para_1 accttype accttype account_id preparedstatement preparestatement para_1 setint getc_acctschema_id setint para_1 setint getc_acctschema_id resultset executequery account_id getint sqlexception accttype accttype account_id accttype p_po get_id account_id get the account for accounting schema param acct type see accttype param as accounting schema return account public final m account get account int acct type m acct schema as int c validcombination id getvalidcombination id acct type as if c validcombination id 0 return null return account m account acct m account get as get ctx c validcombination id return acct accttype accttype_ maccount getaccount accttype macctschema c_validcombination_id getvalidcombination_id accttype c_validcombination_id maccount maccount getctx c_validcombination_id save to disk set posted flag param trx name transaction name return true if saved private final boolean save string trx name log fine to string p status string buffer sql new string buffer update sql append get tablename append set posted append p status append processing n append where append get tablename append id append p po get id int no db execute update sql to string trx name return no 1 trxname trxname tostring p_status stringbuffer stringbuffer get_tablename p_status get_tablename _id p_po get_id executeupdate tostring trxname get doc line with id param record id record id return doc line public doc line get doc line int record id if p lines null p lines length 0 record id 0 return null for int i 0 i p lines length i if p lines i get id record id return p lines i return null docline record_id docline docline getdocline record_id p_lines p_lines record_id p_lines p_lines get_id record_id p_lines string representation return string public string to string return p po to string tostring p_po tostring get ad client id return client public int getad client id return p po getad client id ad_client_id getad_client_id p_po getad_client_id get ad org id return org public int getad org id return p po getad org id ad_org_id getad_org_id p_po getad_org_id get document no return document no public string get document no if m documentno null return m documentno int index p po get columnindex document no if index 1 index p po get columnindex name if index 1 throw new unsupported operation exception no document no m documentno string p po get value index return m documentno getdocumentno m_documentno m_documentno p_po get_columnindex documentno p_po get_columnindex unsupportedoperationexception documentno m_documentno p_po get_value m_documentno get description return description public string get description if m description null int index p po get columnindex description if index 1 m description string p po get value index else m description return m description getdescription m_description p_po get_columnindex m_description p_po get_value m_description m_description get c currency id return currency public int getc currency id if m c currency id 1 int index p po get columnindex c currency id if index 1 integer ii integer p po get value index if ii null m c currency id ii int value if m c currency id 1 m c currency id no currency return m c currency id c_currency_id getc_currency_id m_c_currency_id p_po get_columnindex c_currency_id p_po get_value m_c_currency_id intvalue m_c_currency_id m_c_currency_id no_currency m_c_currency_id set c currency id param c currency id id public void setc currency id int c currency id m c currency id c currency id c_currency_id c_currency_id setc_currency_id c_currency_id m_c_currency_id c_currency_id is multi currency return mc public boolean is multi currency return m multicurrency ismulticurrency m_multicurrency set multi currency param mc multi currency protected void set is multi currency boolean mc m multicurrency mc setismulticurrency m_multicurrency is tax included return tax incl public boolean is tax included return m taxincluded istaxincluded m_taxincluded set tax includedy param ti tax included protected void set is tax included boolean ti m taxincluded ti setistaxincluded m_taxincluded get c conversiontype id return conversion type public int getc conversiontype id int index p po get columnindex c conversiontype id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_conversiontype_id conversiontype getc_conversiontype_id p_po get_columnindex c_conversiontype_id p_po get_value intvalue get gl category id return categoory public int getgl category id return m gl category id gl_category_id getgl_category_id m_gl_category_id get gl category id return categoory public int getgl budget id int index p po get columnindex gl budget id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 gl_category_id getgl_budget_id p_po get_columnindex gl_budget_id p_po get_value intvalue get accounting date return currency public timestamp get date acct if m dateacct null return m dateacct int index p po get columnindex date acct if index 1 m dateacct timestamp p po get value index if m dateacct null return m dateacct throw new illegal state exception no date acct getdateacct m_dateacct m_dateacct p_po get_columnindex dateacct m_dateacct p_po get_value m_dateacct m_dateacct illegalstateexception dateacct set date acct param da accounting date protected void set date acct timestamp da m dateacct da setdateacct m_dateacct get document date return currency public timestamp get date doc if m datedoc null return m datedoc int index p po get columnindex date doc if index 1 index p po get columnindex movement date if index 1 m datedoc timestamp p po get value index if m datedoc null return m datedoc throw new illegal state exception no date doc getdatedoc m_datedoc m_datedoc p_po get_columnindex datedoc p_po get_columnindex movementdate m_datedoc p_po get_value m_datedoc m_datedoc illegalstateexception datedoc set date doc param dd document date protected void set date doc timestamp dd m datedoc dd setdatedoc m_datedoc is document posted return true if posted public boolean is posted int index p po get columnindex posted if index 1 object posted p po get value index if posted instanceof boolean return boolean posted boolean value if posted instanceof string return y equals posted throw new illegal state exception no posted isposted p_po get_columnindex p_po get_value booleanvalue illegalstateexception is sales trx return true if posted public boolean isso trx int index p po get columnindex isso trx if index 1 index p po get columnindex is receipt if index 1 object posted p po get value index if posted instanceof boolean return boolean posted boolean value if posted instanceof string return y equals posted return false issotrx p_po get_columnindex issotrx p_po get_columnindex isreceipt p_po get_value booleanvalue get c doctype id return doc type public int getc doctype id int index p po get columnindex c doctype id if index 1 integer ii integer p po get value index bug 1564500 void of an invoice that was never prepared completed if ii null ii int value 0 index p po get columnindex c doctypetarget id ii integer p po get value index if ii null return ii int value return 0 c_doctype_id doctype getc_doctype_id p_po get_columnindex c_doctype_id p_po get_value intvalue p_po get_columnindex c_doctypetarget_id p_po get_value intvalue get header level c charge id return charge public int getc charge id int index p po get columnindex c charge id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_charge_id getc_charge_id p_po get_columnindex c_charge_id p_po get_value intvalue get salesrep id return sales rep public int getsalesrep id int index p po get columnindex salesrep id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 salesrep_id salesrep getsalesrep_id p_po get_columnindex salesrep_id p_po get_value intvalue get c bankaccount id return bank account public int getc bankaccount id if m c bankaccount id 1 int index p po get columnindex c bankaccount id if index 1 integer ii integer p po get value index if ii null m c bankaccount id ii int value if m c bankaccount id 1 m c bankaccount id 0 return m c bankaccount id c_bankaccount_id bankaccount getc_bankaccount_id m_c_bankaccount_id p_po get_columnindex c_bankaccount_id p_po get_value m_c_bankaccount_id intvalue m_c_bankaccount_id m_c_bankaccount_id m_c_bankaccount_id set c bankaccount id param c bankaccount id bank acct protected void setc bankaccount id int c bankaccount id m c bankaccount id c bankaccount id c_bankaccount_id c_bankaccount_id setc_bankaccount_id c_bankaccount_id m_c_bankaccount_id c_bankaccount_id get c cashbook id return cash book public int getc cashbook id if m c cashbook id 1 int index p po get columnindex c cashbook id if index 1 integer ii integer p po get value index if ii null m c cashbook id ii int value if m c cashbook id 1 m c cashbook id 0 return m c cashbook id c_cashbook_id cashbook getc_cashbook_id m_c_cashbook_id p_po get_columnindex c_cashbook_id p_po get_value m_c_cashbook_id intvalue m_c_cashbook_id m_c_cashbook_id m_c_cashbook_id set c cashbook id param c cashbook id cash book protected void setc cashbook id int c cashbook id m c cashbook id c cashbook id c_cashbook_id c_cashbook_id setc_cashbook_id c_cashbook_id m_c_cashbook_id c_cashbook_id get m warehouse id return warehouse public int getm warehouse id int index p po get columnindex m warehouse id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_warehouse_id getm_warehouse_id p_po get_columnindex m_warehouse_id p_po get_value intvalue get c bpartner id return b partner public int getc bpartner id if m c bpartner id 1 int index p po get columnindex c bpartner id if index 1 integer ii integer p po get value index if ii null m c bpartner id ii int value if m c bpartner id 1 m c bpartner id 0 return m c bpartner id c_bpartner_id bpartner getc_bpartner_id m_c_bpartner_id p_po get_columnindex c_bpartner_id p_po get_value m_c_bpartner_id intvalue m_c_bpartner_id m_c_bpartner_id m_c_bpartner_id set c bpartner id param c bpartner id bp protected void setc bpartner id int c bpartner id m c bpartner id c bpartner id c_bpartner_id c_bpartner_id setc_bpartner_id c_bpartner_id m_c_bpartner_id c_bpartner_id get c bpartner location id return b partner location public int getc bpartner location id int index p po get columnindex c bpartner location id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_bpartner_location_id bpartner getc_bpartner_location_id p_po get_columnindex c_bpartner_location_id p_po get_value intvalue get c project id return project public int getc project id int index p po get columnindex c project id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_project_id getc_project_id p_po get_columnindex c_project_id p_po get_value intvalue get c salesregion id return sales region public int getc salesregion id int index p po get columnindex c salesregion id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_salesregion_id getc_salesregion_id p_po get_columnindex c_salesregion_id p_po get_value intvalue get c salesregion id return sales region public int getbp c salesregion id if m bp c salesregion id 1 int index p po get columnindex c salesregion id if index 1 integer ii integer p po get value index if ii null m bp c salesregion id ii int value if m bp c salesregion id 1 m bp c salesregion id 0 return m bp c salesregion id c_salesregion_id getbp_c_salesregion_id m_bp_c_salesregion_id p_po get_columnindex c_salesregion_id p_po get_value m_bp_c_salesregion_id intvalue m_bp_c_salesregion_id m_bp_c_salesregion_id m_bp_c_salesregion_id set c salesregion id param c salesregion id id protected void setbp c salesregion id int c salesregion id m bp c salesregion id c salesregion id c_salesregion_id c_salesregion_id setbp_c_salesregion_id c_salesregion_id m_bp_c_salesregion_id c_salesregion_id get c activity id return activity public int getc activity id int index p po get columnindex c activity id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_activity_id getc_activity_id p_po get_columnindex c_activity_id p_po get_value intvalue get c campaign id return campaign public int getc campaign id int index p po get columnindex c campaign id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 c_campaign_id getc_campaign_id p_po get_columnindex c_campaign_id p_po get_value intvalue get m product id return product public int getm product id int index p po get columnindex m product id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 m_product_id getm_product_id p_po get_columnindex m_product_id p_po get_value intvalue get ad orgtrx id return trx org public int getad orgtrx id int index p po get columnindex ad orgtrx id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 ad_orgtrx_id getad_orgtrx_id p_po get_columnindex ad_orgtrx_id p_po get_value intvalue get c locfrom id return loc from public int getc locfrom id return m c locfrom id c_locfrom_id getc_locfrom_id m_c_locfrom_id set c locfrom id param c locfrom id loc from protected void setc locfrom id int c locfrom id m c locfrom id c locfrom id c_locfrom_id c_locfrom_id setc_locfrom_id c_locfrom_id m_c_locfrom_id c_locfrom_id get c locto id return loc to public int getc locto id return m c locto id c_locto_id getc_locto_id m_c_locto_id set c locto id param c locto id loc to protected void setc locto id int c locto id m c locto id c locto id c_locto_id c_locto_id setc_locto_id c_locto_id m_c_locto_id c_locto_id get user1 id return campaign public int getuser1 id int index p po get columnindex user1 id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 user1_id getuser1_id p_po get_columnindex user1_id p_po get_value intvalue get user2 id return campaign public int getuser2 id int index p po get columnindex user2 id if index 1 integer ii integer p po get value index if ii null return ii int value return 0 user2_id getuser2_id p_po get_columnindex user2_id p_po get_value intvalue load document details return error message or null get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total header is bigger than lines create facts the accounting logic param as accounting schema return facts prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name p pa sla goal id getrecord id processinfoparameter getparameter getparametername getparameter p_pa_sla_goal_id getrecord_id process return info throws exception protected string do it throws exception log info pa sla goal id p pa sla goal id msla goal goal new msla goal get ctx p pa sla goal id get trxname if goal get id 0 throw new compiere user error pa sla goal id p pa sla goal id msla criteria criteria msla criteria get get ctx goal getpa sla criteria id get trxname if criteria get id 0 throw new compiere user error pa sla criteria id goal getpa sla criteria id sla criteria pgm criteria new instance int no pgm create measures goal goal set measure actual pgm calculate measure goal goal set date last run new timestamp system current time millis goal save return created no measure actual goal get measure actual doit pa_sla_goal_id p_pa_sla_goal_id mslagoal mslagoal getctx p_pa_sla_goal_id get_trxname get_id compiereusererror pa_sla_goal_id p_pa_sla_goal_id mslacriteria mslacriteria getctx getpa_sla_criteria_id get_trxname get_id compiereusererror pa_sla_criteria_id getpa_sla_criteria_id slacriteria newinstance createmeasures setmeasureactual calculatemeasure setdatelastrun currenttimemillis measureactual getmeasureactual get active param ctx context return active processors public static m acct processor get active properties ctx array list m acct processor list new array list m acct processor string sql select from c acctprocessor where is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m acct processor ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get active e try if pstmt null pstmt close pstmt null catch exception e pstmt null m acct processor ret value new m acct processor list size list to array ret value return ret value macctprocessor getactive arraylist macctprocessor arraylist macctprocessor c_acctprocessor isactive preparedstatement preparestatement resultset executequery macctprocessor s_log getactive macctprocessor retvalue macctprocessor toarray retvalue retvalue standard construvtor param ctx context param c acctprocessor id id public m acct processor properties ctx int c acctprocessor id string trx name super ctx c acctprocessor id trx name if c acctprocessor id 0 set name null setsupervisor id 0 set frequency type frequencytype hour set frequency 1 set keep log days 7 7 c_acctprocessor_id macctprocessor c_acctprocessor_id trxname c_acctprocessor_id trxname c_acctprocessor_id setname setsupervisor_id setfrequencytype frequencytype_hour setfrequency setkeeplogdays load constructor param ctx context param rs result set public m acct processor properties ctx result set rs string trx name super ctx rs trx name macctprocessor resultset trxname trxname parent constructor param client parent param supervisor id admin public m acct processor m client client int supervisor id this client get ctx 0 client get trxname set client org client set name client get name msg translate get ctx c acctprocessor id setsupervisor id supervisor id supervisor_id macctprocessor mclient supervisor_id getctx get_trxname setclientorg setname getname getctx c_acctprocessor_id setsupervisor_id supervisor_id get server id return id public string get serverid return acct processor get id getserverid acctprocessor get_id get date next run param requery requery return date next run public timestamp get date next run boolean requery if requery load get trxname return get date next run getdatenextrun get_trxname getdatenextrun get logs return logs public compiere processor log get logs array list m acct processor log list new array list m acct processor log string sql select from c acctprocessorlog where c acctprocessor id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc acctprocessor id result set rs pstmt execute query while rs next list add new m acct processor log get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m acct processor log ret value new m acct processor log list size list to array ret value return ret value compiereprocessorlog getlogs arraylist macctprocessorlog arraylist macctprocessorlog c_acctprocessorlog c_acctprocessor_id preparedstatement preparestatement get_trxname setint getc_acctprocessor_id resultset executequery macctprocessorlog getctx get_trxname macctprocessorlog retvalue macctprocessorlog toarray retvalue retvalue delete old request log return number of records public int delete log if get keep log days 1 return 0 string sql delete c acctprocessorlog where c acctprocessor id getc acctprocessor id and created get keep log days sys date int no db execute update sql get trxname return 0 deletelog getkeeplogdays c_acctprocessorlog c_acctprocessor_id getc_acctprocessor_id getkeeplogdays sysdate executeupdate get_trxname should we filter the value of lt gt value lt gt public static boolean get default filter state return filter state getdefaultfilterstate filter_state should we filter the value of the element attributes public static boolean get default filter attribute state return filter attribute state getdefaultfilterattributestate filter_attribute_state what is the equality character for an attribute public static char get default attribute equality sign return attribute equality sign getdefaultattributeequalitysign attribute_equality_sign what the start modifier should be public static char get default begin start modifier return begin start modifier getdefaultbeginstartmodifier begin_start_modifier what the start modifier should be public static char get default end start modifier return end start modifier getdefaultendstartmodifier end_start_modifier what the end modifier should be public static char get default begin end modifier return begin end modifier getdefaultbeginendmodifier begin_end_modifier what the end modifier should be public static char get default end end modifier return end end modifier getdefaultendendmodifier end_end_modifier what character should we use for quoting attributes public static char get default attribute quote char return attribute quote char getdefaultattributequotechar attribute_quote_char should we wrap quotes around an attribute public static boolean get default attribute quote return attribute quote getdefaultattributequote attribute_quote does this element need a closing tag public static boolean get default end element return end element getdefaultendelement end_element what codeset are we going to use the default is 8859 1 public static string get default codeset return codeset 8859_1 getdefaultcodeset position of tag relative to start and end public static int get default position return position getdefaultposition default value to set case type public static int get default case type return case type getdefaultcasetype case_type public static char get default start tag return start tag getdefaultstarttag start_tag public static char get default end tag return end tag getdefaultendtag end_tag should we print html in a more readable format public static boolean get default pretty print return pretty print getdefaultprettyprint pretty_print get content return content public object get contents return contents getcontents creates a button with no set text or icon public c button this null null cbutton creates a button with an icon param icon the icon image to display on the button public c button icon icon this null icon cbutton creates a button with text param text the text of the button public c button string text this text null cbutton creates a button where properties are taken from the code action code supplied param a the code action code used to specify the new button since 1 3 public c button action a super a set content area filled false set opaque false cbutton setcontentareafilled setopaque creates a button with initial text and an icon param text the text of the button param icon the icon image to display on the button public c button string text icon icon super text icon set content area filled false set opaque false set font compiereplaf getfont label set foreground compiereplaf gettextcolor label cbutton setcontentareafilled setopaque setfont getfont_label setforeground gettextcolor_label set background differentiates between system user call if user call sets opaque context area filled to true param bg background color public void set background color bg if bg equals get background return super set background bg ignore calls from javax swing look and feel install colors look and feel java 61 if trace get caller class 1 starts with javax set opaque true set content area filled true this repaint contextareafilled setbackground getbackground setbackground lookandfeel installcolors lookandfeel getcallerclass startswith setopaque setcontentareafilled set background nop param error error public void set background boolean error setbackground set standard background public void set background color set background color null setbackgroundcolor setbackgroundcolor set background param bg compiere color for background if null set standard background public void set background color compiere color bg if bg null bg compiere color get default background set opaque true put client property compiereplaf background bg super set background bg get flat color this repaint compierecolor setbackgroundcolor compierecolor compierecolor getdefaultbackground setopaque putclientproperty setbackground getflatcolor get background return color for background public compiere color get background color try return compiere color get client property compiereplaf background catch exception e system err println c button client property e get message return null compierecolor getbackgroundcolor compierecolor getclientproperty cbutton clientproperty getmessage set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if is enabled rw set enabled rw m readwrite rw setreadwrite isenabled setenabled m_readwrite is it possible to edit return true if editable public boolean is read write return m readwrite isreadwrite m_readwrite set editor to value param value value of the editor public void set value object value if value null set text else set text value to string setvalue settext settext tostring return editor value return current value public object get value return get text getvalue gettext return display value return displayed string value public string get display return get text getdisplay gettext set text mnemonic param text text public void set text string text if text null super set text text return int pos text index of if pos 1 we have a nemonic creates alt int mnemonic text to upper case char at pos 1 if mnemonic set mnemonic mnemonic text text substring 0 pos text substring pos 1 super set text text if get name null set name text settext settext indexof _ touppercase charat setmnemonic settext getname setname set tool tip text mnemonic param text text public void set tool tip text string text if text null super set text text return int pos text index of if pos 1 we have a nemonic creates alt int mnemonic text to upper case char at pos 1 if mnemonic set mnemonic mnemonic text text substring 0 pos text substring pos 1 super set tool tip text text if get name null set name text settooltiptext settext indexof _ touppercase charat setmnemonic settooltiptext getname setname set action command param action command command public void set action command string action command super set action command action command if get name null action command null action command length 0 set name action command actioncommand setactioncommand actioncommand setactioncommand actioncommand getname actioncommand actioncommand setname actioncommand prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c project id m c project id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_project_id m_c_project_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception int to c project id getrecord id log info do it from c project id m c project id to to c project id if to c project id 0 throw new illegal argument exception target c project id 0 if m c project id 0 throw new illegal argument exception source c project id 0 m project from new m project get ctx m c project id get trxname m project to new m project get ctx to c project id get trxname int no to copy details from from return copied no doit to_c_project_id getrecord_id doit c_project_id m_c_project_id to_c_project_id to_c_project_id illegalargumentexception c_project_id m_c_project_id illegalargumentexception c_project_id mproject mproject getctx m_c_project_id get_trxname mproject mproject getctx to_c_project_id get_trxname copydetailsfrom find b partners param ctx context param value business partner value param name business partner name param contact contact user name param e mail contact user e mail return array if of info public static mb partner info find properties ctx string value string name string contact string e mail string phone string city string buffer sql new string buffer select from rv bpartner where is active y string buffer sb new string buffer value get find parameter value if value null sb append upper value like name get find parameter name if name null if sb length 0 sb append or sb append upper name like contact get find parameter contact if contact null if sb length 0 sb append or sb append upper contact like e mail get find parameter e mail if e mail null if sb length 0 sb append or sb append upper e mail like phone get find parameter phone if phone null if sb length 0 sb append or sb append upper phone like city get find parameter city if city null if sb length 0 sb append or sb append upper city like if sb length 0 sql append and append sb append sql append order by value string finalsql m role get default add accesssql sql to string rv bpartner m role sql notqualified m role sql ro array list mb partner info list new array list mb partner info prepared statement pstmt null try pstmt db prepare statement finalsql null int index 1 if value null pstmt set string index value if name null pstmt set string index name if contact null pstmt set string index contact if e mail null pstmt set string index e mail if phone null pstmt set string index phone if city null pstmt set string index city result set rs pstmt execute query while rs next list add new mb partner info ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe find finalsql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return mb partner info ret value new mb partner info list size list to array ret value return ret value bpartners email email mbpartnerinfo email stringbuffer stringbuffer rv_bpartner isactive stringbuffer stringbuffer getfindparameter getfindparameter getfindparameter email getfindparameter email email email getfindparameter getfindparameter mrole getdefault addaccesssql tostring rv_bpartner mrole sql_notqualified mrole sql_ro arraylist mbpartnerinfo arraylist mbpartnerinfo preparedstatement preparestatement setstring setstring setstring email setstring email setstring setstring resultset executequery mbpartnerinfo s_log mbpartnerinfo retvalue mbpartnerinfo toarray retvalue retvalue load constructor param ctx context param rs result set public mb partner info properties ctx result set rs string trx name super ctx rs trx name mbpartnerinfo resultset trxname trxname constructor param ad table id table param invoker component to display popup optional param query query public a report int ad table id j component invoker m query query log config ad table id ad table id query if m role get default is can report ad table id a dialog error 0 invoker access cannot report query get table name return m query query see what is there get print formats ad table id invoker ad_table_id areport ad_table_id jcomponent mquery ad_table_id ad_table_id mrole getdefault iscanreport ad_table_id adialog accesscannotreport gettablename m_query getprintformats ad_table_id get the print formats for the table fill the list and the popup menu param ad table id table param invoker component to display popup optional private void get print formats int ad table id j component invoker int ad client id env getad client id env get ctx string sql m role get default add accesssql select ad printformat id name ad client id from ad printformat where ad table id and is table based y order by ad client id desc is default desc name own first ad printformat m role sql notqualified m role sql ro key name pair pp null try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 if rs get int 3 ad client id m list add pp m popup add pp to string add action listener this rs close pstmt close catch sql exception e log log level severe sql e no format exists create it if m list size 0 if pp null create new format ad table id calls launch else copy format pp get key ad client id one format exists or no invoker show it else if m list size 1 invoker null launch report key name pair m list get 0 multiple formats exist show selection else if invoker is showing m popup show invoker 0 invoker get height below button ad_table_id getprintformats ad_table_id jcomponent ad_client_id getad_client_id getctx mrole getdefault addaccesssql ad_printformat_id ad_client_id ad_printformat ad_table_id istablebased ad_client_id isdefault ad_printformat mrole sql_notqualified mrole sql_ro keynamepair preparedstatement preparestatement setint ad_table_id resultset executequery keynamepair getint getstring getint ad_client_id m_list m_popup tostring addactionlistener sqlexception m_list createnewformat ad_table_id copyformat getkey ad_client_id m_list launchreport keynamepair m_list isshowing m_popup getheight create and launch new format for table param ad table id table private void create new format int ad table id m print format pf m print format create from table env get ctx ad table id launch report pf ad_table_id createnewformat ad_table_id mprintformat mprintformat createfromtable getctx ad_table_id launchreport copy existing format param ad printformat id print format param to client id to client private void copy format int ad printformat id int to client id m print format pf m print format copy to client env get ctx ad printformat id to client id launch report pf ad_printformat_id to_client_id copyformat ad_printformat_id to_client_id mprintformat mprintformat copytoclient getctx ad_printformat_id to_client_id launchreport launch report param pp key ad printformat id private void launch report key name pair pp m print format pf m print format get env get ctx pp get key false launch report pf ad_printformat_id launchreport keynamepair mprintformat mprintformat getctx getkey launchreport launch report param pf print format private void launch report m print format pf int record id 0 if m query get restriction count 1 m query get code 0 instanceof integer record id integer m query get code 0 int value print info info new print info pf get name pf getad table id record id info set description m query get info report engine re new report engine env get ctx pf m query info new viewer re if m popup is visible m popup set visible false launchreport mprintformat record_id m_query getrestrictioncount m_query getcode record_id m_query getcode intvalue printinfo printinfo getname getad_table_id record_id setdescription m_query getinfo reportengine reportengine getctx m_query m_popup isvisible m_popup setvisible action listener param e event public void action performed action event e m popup set cursor cursor get predefined cursor cursor wait cursor string cmd e get action command for int i 0 i m list size i key name pair pp key name pair m list get i if cmd equals pp get name launch report pp return actionperformed actionevent m_popup setcursor getpredefinedcursor wait_cursor getactioncommand m_list keynamepair keynamepair m_list getname launchreport get ad table id for table name param table name table name return ad table id or 0 static public int getad table id string table name int ad table id 0 string sql select ad table id from ad table where table name try prepared statement pstmt db prepare statement sql null pstmt set string 1 table name result set rs pstmt execute query if rs next ad table id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return ad table id ad_table_id tablename ad_table_id getad_table_id tablename ad_table_id ad_table_id ad_table tablename preparedstatement preparestatement setstring tablename resultset executequery ad_table_id getint sqlexception ad_table_id default constructor param ctx context param s timeexpense id id public m time expense properties ctx int s timeexpense id string trx name super ctx s timeexpense id trx name if s timeexpense id 0 setc bpartner id 0 set date report new timestamp system current time millis set document no null set is approved false setm pricelist id 0 setm warehouse id 0 super set processed false set processing false s_timeexpense_id mtimeexpense s_timeexpense_id trxname s_timeexpense_id trxname s_timeexpense_id setc_bpartner_id setdatereport currenttimemillis setdocumentno setisapproved setm_pricelist_id setm_warehouse_id setprocessed setprocessing load constructor public m time expense properties ctx result set rs string trx name super ctx rs trx name mtimeexpense resultset trxname trxname get lines param requery true requeries return array of lines public m time expense line get lines boolean requery if m lines null requery return m lines int c currency id getc currency id array list m time expense line list new array list m time expense line string sql select from s timeexpenseline where s timeexpense id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 gets timeexpense id result set rs pstmt execute query while rs next m time expense line te new m time expense line get ctx rs get trxname te setc currency report id c currency id list add te rs close pstmt close pstmt null catch sql exception ex log log level severe get lines ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m lines new m time expense line list size list to array m lines return m lines mtimeexpenseline getlines m_lines m_lines c_currency_id getc_currency_id arraylist mtimeexpenseline arraylist mtimeexpenseline s_timeexpenseline s_timeexpense_id preparedstatement preparestatement get_trxname setint gets_timeexpense_id resultset executequery mtimeexpenseline mtimeexpenseline getctx get_trxname setc_currency_report_id c_currency_id sqlexception getlines sqlexception m_lines mtimeexpenseline toarray m_lines m_lines add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get default locator from warehouse return locator public int getm locator id if m m locator id 0 return m m locator id string sql select m locator id from m locator where m warehouse id and is active y order by is default desc created prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm warehouse id result set rs pstmt execute query if rs next m m locator id rs get int 1 rs close pstmt close pstmt null catch sql exception ex log log level severe getm locator id ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return m m locator id getm_locator_id m_m_locator_id m_m_locator_id m_locator_id m_locator m_warehouse_id isactive isdefault preparedstatement preparestatement setint getm_warehouse_id resultset executequery m_m_locator_id getint sqlexception getm_locator_id sqlexception m_m_locator_id set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update s timeexpenseline set processed processed y n where s timeexpense id gets timeexpense id int no line db execute update sql get trxname m lines null log fine processed lines no line setprocessed setprocessed get_id s_timeexpenseline s_timeexpense_id gets_timeexpense_id noline executeupdate get_trxname m_lines noline get document info return document info public string get document info return msg get element get ctx s timeexpense id get document no getdocumentinfo getelement getctx s_timeexpense_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open ap reimbursement invoice if m period is open get ctx get date report m doc type docbasetype apinvoice m processmsg period closed return doc action status invalid m time expense line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid add up amounts big decimal amt env zero for int i 0 i lines length i m time expense line line lines i amt amt add line get approval amt set approval amt amt invoiced but no bp for int i 0 i lines length i m time expense line line lines i if line is invoiced line getc bpartner id 0 m processmsg line line get line invoiced but no business partner return doc action status invalid m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getdatereport mdoctype docbasetype_apinvoice m_processmsg periodclosed docaction status_invalid mtimeexpenseline getlines m_processmsg nolines docaction status_invalid bigdecimal mtimeexpenseline getapprovalamt setapprovalamt mtimeexpenseline isinvoiced getc_bpartner_id m_processmsg getline docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info complete it to string user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit completeit tostring modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document same as close return true if success public boolean void it log info void it to string return close it voidit voidit tostring closeit close document cancel not delivered qunatities return true if success public boolean close it log info close it to string close not delivered qty set doc action docaction none return true closeit closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual none return false public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return true if success public boolean re activate it log info re activate it to string set processed false return false reactivateit reactivateit tostring setprocessed get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id if m ad user id 0 return m ad user id if getc bpartner id 0 m user users m user get ofb partner get ctx getc bpartner id if users length 0 m ad user id users 0 getad user id return m ad user id return get created by ad_user_id getdoc_user_id m_ad_user_id m_ad_user_id getc_bpartner_id muser muser getofbpartner getctx getc_bpartner_id m_ad_user_id getad_user_id m_ad_user_id getcreatedby get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id get trxname return pl getc currency id c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id get_trxname getc_currency_id standard constructor public x pa ratio properties ctx int pa ratio id string trx name super ctx pa ratio id trx name if pa ratio id 0 setc acctschema id 0 set name null setpa ratio id 0 x_pa_ratio pa_ratio_id trxname pa_ratio_id trxname pa_ratio_id setc_acctschema_id setname setpa_ratio_id load constructor public x pa ratio properties ctx result set rs string trx name super ctx rs trx name x_pa_ratio resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa ratio append get id append return sb to string tostring stringbuffer stringbuffer x_pa_ratio get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set ratio performace ratio public void setpa ratio id int pa ratio id if pa ratio id 1 throw new illegal argument exception pa ratio id is mandatory set valuenocheck pa ratio id new integer pa ratio id setpa_ratio_id pa_ratio_id pa_ratio_id illegalargumentexception pa_ratio_id set_valuenocheck pa_ratio_id pa_ratio_id get ratio performace ratio public int getpa ratio id integer ii integer get value pa ratio id if ii null return 0 return ii int value getpa_ratio_id get_value pa_ratio_id intvalue standard constructor public x ad wf block properties ctx int ad wf block id string trx name super ctx ad wf block id trx name if ad wf block id 0 setad wf block id 0 setad workflow id 0 set name null x_ad_wf_block ad_wf_block_id trxname ad_wf_block_id trxname ad_wf_block_id setad_wf_block_id setad_workflow_id setname load constructor public x ad wf block properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_block resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf block append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_block get_id tostring set workflow block workflow transaction execution block public void setad wf block id int ad wf block id if ad wf block id 1 throw new illegal argument exception ad wf block id is mandatory set valuenocheck ad wf block id new integer ad wf block id setad_wf_block_id ad_wf_block_id ad_wf_block_id illegalargumentexception ad_wf_block_id set_valuenocheck ad_wf_block_id ad_wf_block_id get workflow block workflow transaction execution block public int getad wf block id integer ii integer get value ad wf block id if ii null return 0 return ii int value getad_wf_block_id get_value ad_wf_block_id intvalue set workflow workflow or combination of tasks public void setad workflow id int ad workflow id if ad workflow id 1 throw new illegal argument exception ad workflow id is mandatory set valuenocheck ad workflow id new integer ad workflow id setad_workflow_id ad_workflow_id ad_workflow_id illegalargumentexception ad_workflow_id set_valuenocheck ad_workflow_id ad_workflow_id get workflow workflow or combination of tasks public int getad workflow id integer ii integer get value ad workflow id if ii null return 0 return ii int value getad_workflow_id get_value ad_workflow_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname alert processor param model model public alert processor m alert processor model super model 180 3 monute delay m model model m client m client get model get ctx model getad client id alertprocessor malertprocessor m_model m_client mclient getctx getad_client_id work protected void do work m summary new string buffer m errors new string buffer int count 0 int count error 0 m alert alerts m model get alerts false for int i 0 i alerts length i if process alert alerts i count error count string summary total count if count error 0 summary not processed count error summary m summary insert 0 summary int no m model delete log m summary append logs deleted append no m alert processor log p log new m alert processor log m model m summary to string p log set reference string value of p runcount time util format elapsed new timestamp p startwork p log set text msg m errors to string p log save dowork m_summary stringbuffer m_errors stringbuffer counterror malert m_model getalerts processalert counterror counterror counterror m_summary m_model deletelog m_summary malertprocessorlog plog malertprocessorlog m_model m_summary tostring plog setreference valueof p_runcount timeutil formatelapsed p_startwork plog settextmsg m_errors tostring plog process alert param alert alert return true if processed private boolean process alert m alert alert if alert is valid return false log info alert string buffer message new string buffer alert get alert message append env nl boolean valid true boolean processed false m alert rule rules alert get rules false for int i 0 i rules length i if i 0 message append env nl append append env nl string trx name null assume r o m alert rule rule rules i if rule is valid continue log fine rule pre string sql rule get pre processing if sql null sql length 0 int no db execute update sql false trx name if no 1 value name pair error c logger retrieve error rule set error msg pre error get name m errors append pre error get name rule set is valid false rule save valid false break pre the processing sql rule get sql if alert is enforce role security alert is enforce client security int ad role id alert getfirstad role id if ad role id 1 ad role id alert getfirstuserad role id if ad role id 1 m role role m role get get ctx ad role id sql role add accesssql sql null true false try string text list sql select sql trx name if text null text length 0 message append text processed true catch exception e rule set error msg select e get localized message m errors append select e get localized message rule set is valid false rule save valid false break post sql rule get post processing if sql null sql length 0 int no db execute update sql false trx name if no 1 value name pair error c logger retrieve error rule set error msg post error get name m errors append post error get name rule set is valid false rule save valid false break post trx if trx name null trx trx trx get trx name false if trx null trx commit trx close for all rules update header if error if valid alert set is valid false alert save return false nothing to report if processed m summary append alert get name append no result return true send message int count mail 0 m alert recipient recipients alert get recipients false for int i 0 i recipients length i m alert recipient recipient recipients i if recipient getad user id 0 system 0 if m client sende mail recipient getad user id alert get alert subject message to string null count mail if recipient getad role id 0 system administrator 0 m user roles urs m user roles get of role get ctx recipient getad role id for int j 0 j urs length j m user roles ur urs j if m client sende mail ur getad user id alert get alert subject message to string null count mail m summary append alert get name append e mails append count mail append return valid processalert malert isvalid stringbuffer stringbuffer getalertmessage malertrule getrules trxname malertrule isvalid getpreprocessing executeupdate trxname valuenamepair clogger retrieveerror seterrormsg getname m_errors getname setisvalid getsql isenforcerolesecurity isenforceclientsecurity ad_role_id getfirstad_role_id ad_role_id ad_role_id getfirstuserad_role_id ad_role_id mrole mrole getctx ad_role_id addaccesssql listsqlselect trxname seterrormsg getlocalizedmessage m_errors getlocalizedmessage setisvalid getpostprocessing executeupdate trxname valuenamepair clogger retrieveerror seterrormsg getname m_errors getname setisvalid trxname trxname setisvalid m_summary getname countmail malertrecipient getrecipients malertrecipient getad_user_id m_client sendemail getad_user_id getalertsubject tostring countmail getad_role_id systemadministrator muserroles muserroles getofrole getctx getad_role_id muserroles m_client sendemail getad_user_id getalertsubject tostring countmail m_summary getname emails countmail list sql select param sql sql select return list of rows values throws exception private string list sql select string sql string trx name throws exception string buffer result new string buffer prepared statement pstmt null exception error null try pstmt db prepare statement sql trx name result set rs pstmt execute query result set meta data meta rs get meta data while rs next result append append env nl for int col 1 col meta get column count col result append meta get column label col append result append rs get string col result append env nl for all columns if result length 0 log fine no rows selected rs close pstmt close pstmt null catch exception e log log level severe sql e error e try if pstmt null pstmt close pstmt null catch exception e pstmt null error occured if error null throw new exception sql env nl error get localized message return result to string listsqlselect trxname stringbuffer stringbuffer preparedstatement preparestatement trxname resultset executequery resultsetmetadata getmetadata getcolumncount getcolumnlabel getstring getlocalizedmessage tostring get server info return info public string get server info return p runcount last m summary to string getserverinfo p_runcount m_summary tostring test param args ignored public static void main string args compiere startup true m alert processor model new m alert processor env get ctx 100 null alert processor ap new alert processor model ap start malertprocessor malertprocessor getctx alertprocessor alertprocessor standard constructor public x c revenuerecognition run properties ctx int c revenuerecognition run id string trx name super ctx c revenuerecognition run id trx name if c revenuerecognition run id 0 setc revenuerecognition plan id 0 setc revenuerecognition run id 0 setgl journal id 0 set recognized amt env zero x_c_revenuerecognition_run c_revenuerecognition_run_id trxname c_revenuerecognition_run_id trxname c_revenuerecognition_run_id setc_revenuerecognition_plan_id setc_revenuerecognition_run_id setgl_journal_id setrecognizedamt load constructor public x c revenuerecognition run properties ctx result set rs string trx name super ctx rs trx name x_c_revenuerecognition_run resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c revenuerecognition run append get id append return sb to string tostring stringbuffer stringbuffer x_c_revenuerecognition_run get_id tostring set revenue recognition plan plan for recognizing or recording revenue public void setc revenuerecognition plan id int c revenuerecognition plan id if c revenuerecognition plan id 1 throw new illegal argument exception c revenuerecognition plan id is mandatory set valuenocheck c revenuerecognition plan id new integer c revenuerecognition plan id setc_revenuerecognition_plan_id c_revenuerecognition_plan_id c_revenuerecognition_plan_id illegalargumentexception c_revenuerecognition_plan_id set_valuenocheck c_revenuerecognition_plan_id c_revenuerecognition_plan_id get revenue recognition plan plan for recognizing or recording revenue public int getc revenuerecognition plan id integer ii integer get value c revenuerecognition plan id if ii null return 0 return ii int value getc_revenuerecognition_plan_id get_value c_revenuerecognition_plan_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc revenuerecognition plan id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_revenuerecognition_plan_id set revenue recognition run revenue recognition run or process public void setc revenuerecognition run id int c revenuerecognition run id if c revenuerecognition run id 1 throw new illegal argument exception c revenuerecognition run id is mandatory set valuenocheck c revenuerecognition run id new integer c revenuerecognition run id setc_revenuerecognition_run_id c_revenuerecognition_run_id c_revenuerecognition_run_id illegalargumentexception c_revenuerecognition_run_id set_valuenocheck c_revenuerecognition_run_id c_revenuerecognition_run_id get revenue recognition run revenue recognition run or process public int getc revenuerecognition run id integer ii integer get value c revenuerecognition run id if ii null return 0 return ii int value getc_revenuerecognition_run_id get_value c_revenuerecognition_run_id intvalue set journal general ledger journal public void setgl journal id int gl journal id if gl journal id 1 throw new illegal argument exception gl journal id is mandatory set valuenocheck gl journal id new integer gl journal id setgl_journal_id gl_journal_id gl_journal_id illegalargumentexception gl_journal_id set_valuenocheck gl_journal_id gl_journal_id get journal general ledger journal public int getgl journal id integer ii integer get value gl journal id if ii null return 0 return ii int value getgl_journal_id get_value gl_journal_id intvalue set recognized amount public void set recognized amt big decimal recognized amt if recognized amt null throw new illegal argument exception recognized amt is mandatory set valuenocheck recognized amt recognized amt setrecognizedamt bigdecimal recognizedamt recognizedamt illegalargumentexception recognizedamt set_valuenocheck recognizedamt recognizedamt get recognized amount public big decimal get recognized amt big decimal bd big decimal get value recognized amt if bd null return env zero return bd bigdecimal getrecognizedamt bigdecimal bigdecimal get_value recognizedamt constructor param display type display type param format format param tc text component param title title public m doc date int display type simple date format format j text component tc string title super m displaytype display type m tc tc m tc add caret listener this m format format if m format null m format new simple date format m format set lenient false mark delimiters as in pattern char pattern m format to pattern to char array for int i 0 i pattern length i do we have a delimiter if mdy index of pattern i 1 pattern i delimiter m mask new string pattern m title title if m title null m title displaytype mdocdate displaytype simpledateformat jtextcomponent m_displaytype displaytype m_tc m_tc addcaretlistener m_format m_format m_format simpledateformat m_format setlenient m_format topattern tochararray indexof m_mask m_title m_title m_title insert string param offset offset param string string param attr attributes throws bad location exception public void insert string int offset string string attribute set attr throws bad location exception log finest offset offset string string attr attr old text get text old length get text length manual entry db text data binder update text sends stuff at once length 8 if string null string length 1 ignore if too long if offset m mask length return is it an empty field int length get text length if offset 0 length 0 date today new date system current time millis string date str m format format today super insert string 0 string date str substring 1 attr m tc set caret position 1 return is it a digit try integer parse int string catch exception pe start date dialog return try to get date in field if invalid get today s try char cc get text to char array cc offset string char at 0 m format parse new string cc catch parse exception pe start date dialog return positioned before the delimiter jump over delimiter if offset m mask length 1 m mask char at offset 1 delimiter m tc set caret position offset 2 positioned at the delimiter if m mask char at offset delimiter offset m tc set caret position offset 1 super remove offset 1 replace current position set new character super insert string offset string attr new value set cursor if offset 0 string null string length 1 m tc set caret position 0 badlocationexception insertstring attributeset badlocationexception oldtext gettext oldlength gettext dbtextdatabinder updatetext m_mask gettext currenttimemillis datestr m_format insertstring datestr m_tc setcaretposition parseint startdatedialog gettext tochararray charat m_format parseexception startdatedialog m_mask m_mask charat m_tc setcaretposition m_mask charat m_tc setcaretposition insertstring m_tc setcaretposition delete string param offset offset param length length throws bad location exception public void remove int offset int length throws bad location exception log finest offset offset length length begin of string if offset 0 length 0 empty the field if length m mask length length 0 super remove offset length return one position behind delimiter if offset 1 0 offset 1 m mask length m mask char at offset 1 delimiter if offset 2 0 m tc set caret position offset 2 else return else m tc set caret position offset 1 badlocationexception badlocationexception m_mask m_mask m_mask charat m_tc setcaretposition m_tc setcaretposition caret listener param e event public void caret update caret event e log finest dot e get dot last m lastdot mark e get mark selection if e get dot e get mark m lastdot e get dot return is the current position a fixed character if e get dot 1 m mask length m mask char at e get dot delimiter m lastdot e get dot return direction int new dot 1 if m lastdot e get dot new dot e get dot 1 else or same new dot e get dot 1 if e get dot 0 first new dot 1 else if e get dot m mask length 1 last new dot e get dot 1 log fine on fixed char m mask char at e get dot new dot new dot last m lastdot m lastdot e get dot if new dot 0 new dot get text length m tc set caret position new dot caretupdate caretevent getdot m_lastdot getmark getdot getmark m_lastdot getdot getdot m_mask m_mask charat getdot m_lastdot getdot newdot m_lastdot getdot newdot getdot newdot getdot getdot newdot getdot m_mask newdot getdot onfixedchar m_mask charat getdot newdot newdot m_lastdot m_lastdot getdot newdot newdot gettext m_tc setcaretposition newdot get full text return text private string get text string str try str get content get string 0 get content length 1 cr at end catch exception e str return str gettext getcontent getstring getcontent call calendar dialog private void start date dialog log config date dialog string result get text timestamp ts null try ts new timestamp m format parse result get time catch exception pe ts new timestamp system current time millis ts v date start calendar m tc ts m format m displaytype m title result m format format ts move to field try super remove 0 get text length super insert string 0 result null catch bad location exception ble log log level severe ble startdatedialog gettext m_format gettime currenttimemillis vdate startcalendar m_tc m_format m_displaytype m_title m_format gettext insertstring badlocationexception standard constructor public x ad reportview col properties ctx int ad reportview col id string trx name super ctx ad reportview col id trx name if ad reportview col id 0 setad reportview col id 0 setad reportview id 0 set function column null set is group function false x_ad_reportview_col ad_reportview_col_id trxname ad_reportview_col_id trxname ad_reportview_col_id setad_reportview_col_id setad_reportview_id setfunctioncolumn setisgroupfunction load constructor public x ad reportview col properties ctx result set rs string trx name super ctx rs trx name x_ad_reportview_col resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad reportview col append get id append return sb to string tostring stringbuffer stringbuffer x_ad_reportview_col get_id tostring set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set report view column public void setad reportview col id int ad reportview col id if ad reportview col id 1 throw new illegal argument exception ad reportview col id is mandatory set valuenocheck ad reportview col id new integer ad reportview col id setad_reportview_col_id ad_reportview_col_id ad_reportview_col_id illegalargumentexception ad_reportview_col_id set_valuenocheck ad_reportview_col_id ad_reportview_col_id get report view column public int getad reportview col id integer ii integer get value ad reportview col id if ii null return 0 return ii int value getad_reportview_col_id get_value ad_reportview_col_id intvalue set report view view used to generate this report public void setad reportview id int ad reportview id if ad reportview id 1 throw new illegal argument exception ad reportview id is mandatory set valuenocheck ad reportview id new integer ad reportview id setad_reportview_id ad_reportview_id ad_reportview_id illegalargumentexception ad_reportview_id set_valuenocheck ad_reportview_id ad_reportview_id get report view view used to generate this report public int getad reportview id integer ii integer get value ad reportview id if ii null return 0 return ii int value getad_reportview_id get_value ad_reportview_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad reportview id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_reportview_id set function column overwrite column with function public void set function column string function column if function column null throw new illegal argument exception function column is mandatory if function column length 60 log warning length 60 truncated function column function column substring 0 59 set value function column function column setfunctioncolumn functioncolumn functioncolumn illegalargumentexception functioncolumn functioncolumn functioncolumn functioncolumn set_value functioncolumn functioncolumn get function column overwrite column with function public string get function column return string get value function column getfunctioncolumn get_value functioncolumn set sql group function this function will generate a group by clause public void set is group function boolean is group function set value is group function new boolean is group function setisgroupfunction isgroupfunction set_value isgroupfunction isgroupfunction get sql group function this function will generate a group by clause public boolean is group function object oo get value is group function if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isgroupfunction get_value isgroupfunction booleanvalue constructor param window no owning window param m tab owning tab param button button with access information public v payment int window no m tab m tab v button button super env get window window no msg get msg env get ctx payment true m windowno window no m issotrx y equals env get context env get ctx window no isso trx m mtab m tab try b date field new v date date acct false false true display type date date acct jb init m initok dyn init button null pointer if order invoice not saved yet catch exception ex log log level severe v payment ex m initok false a env position center window env get window window no this windowno mtab vpayment windowno mtab mtab vbutton getwindow windowno getmsg getctx m_windowno windowno m_issotrx getcontext getctx windowno issotrx m_mtab mtab bdatefield vdate dateacct displaytype dateacct jbinit m_initok dyninit vpayment m_initok aenv positioncenterwindow getwindow windowno static init throws exception private void jb init throws exception center panel set border border factory create raised bevel border get content pane add main panel main panel set layout main layout main panel add center panel border layout center north panel set layout north layout payment label set text msg translate env get ctx payment rule main panel add north panel border layout north north panel add payment label null north panel add payment combo null center panel set layout center layout k panel set layout k layout k number field set preferred size new dimension 120 21 k exp field set preferred size new dimension 40 21 k approval field set preferred size new dimension 120 21 k type label set text msg translate env get ctx credit card type k numner label set text msg translate env get ctx credit card number k exp label set text msg get msg env get ctx expires k approval label set text msg translate env get ctx voice auth code k online set text msg get msg env get ctx online k online add action listener this k status set text center panel add k panel k panel center layout add layout component k panel k panel k panel add k type label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 k panel add k type combo new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 k panel add k numner label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 k panel add k number field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints vertical new insets 2 5 2 5 0 0 k panel add k exp label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 k panel add k exp field new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 k panel add k approval label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 0 0 0 k panel add k approval field new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 k panel add k status new grid bag constraints 0 4 2 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 k panel add k online new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 t panel set layout t panel layout t account label set text msg translate env get ctx c bp bankaccount id t routing field set columns 8 t number field set columns 10 t routing text set text msg translate env get ctx routing no t number text set text msg translate env get ctx account no t online set text msg get msg env get ctx online t status set text center panel add t panel t panel center layout add layout component t panel t panel t panel add t account label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 0 0 0 t panel add t account combo new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 t panel add t routing field new grid bag constraints 1 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 t panel add t number field new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 t panel add t status new grid bag constraints 0 3 2 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 t panel add t routing text new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 0 0 0 t panel add t number text new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 0 0 0 t panel add t online new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints northeast grid bag constraints none new insets 5 5 5 5 0 0 s panel set layout s panel layout s bank account label set text msg translate env get ctx c bankaccount id s amount label set text msg get msg env get ctx amount s amount field set text s routing label set text msg translate env get ctx routing no s number label set text msg translate env get ctx account no s check label set text msg translate env get ctx check no s check field set columns 8 s currency label set text msg translate env get ctx c currency id s number field set preferred size new dimension 100 21 s routing field set preferred size new dimension 70 21 s status set text s online set text msg get msg env get ctx online center panel add s panel s panel center layout add layout component s panel s panel s panel add s currency label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 s panel add s currency combo new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 s panel add s routing field new grid bag constraints 1 4 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 5 2 0 0 0 s panel add s number field new grid bag constraints 1 5 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 5 2 0 0 0 s panel add s check field new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 0 0 0 s panel add s routing label new grid bag constraints 0 3 1 2 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 0 2 0 0 0 s panel add s number label new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 s panel add s check label new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 s panel add s bank account combo new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 2 5 0 0 s panel add s bank account label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 0 2 0 0 0 s panel add s status new grid bag constraints 0 7 3 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 s panel add s online new grid bag constraints 3 6 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 s panel add s amount field new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 5 5 0 0 s panel add s amount label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 5 0 0 0 p panel set layout p panel layout p term label set text msg translate env get ctx c paymentterm id center panel add p panel p panel center layout add layout component p panel p panel p panel add p term label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 5 2 0 0 0 p panel add p term combo new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 b cash book label set text msg translate env get ctx c cashbook id b currency label set text msg translate env get ctx c currency id b panel set layout b panel layout b amount label set text msg get msg env get ctx amount b amount field set text b date label set text msg translate env get ctx date acct center layout add layout component b panel b panel center panel add b panel b panel b panel add b currency label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 b panel add b currency combo new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 b panel add b date field new grid bag constraints 1 2 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 2 5 0 0 b panel add b date label new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 0 2 0 0 0 b panel add b cash book label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 2 0 2 0 0 0 b panel add b cash book combo new grid bag constraints 1 0 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 2 5 2 5 0 0 b panel add b amount label new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 0 2 0 0 0 b panel add b amount field new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 2 5 0 0 main panel add confirm panel border layout south confirm panel add action listener this jbinit centerpanel setborder borderfactory createraisedbevelborder getcontentpane mainpanel mainpanel setlayout mainlayout mainpanel centerpanel borderlayout northpanel setlayout northlayout paymentlabel settext getctx paymentrule mainpanel northpanel borderlayout northpanel paymentlabel northpanel paymentcombo centerpanel setlayout centerlayout kpanel setlayout klayout knumberfield setpreferredsize kexpfield setpreferredsize kapprovalfield setpreferredsize ktypelabel settext getctx creditcardtype knumnerlabel settext getctx creditcardnumber kexplabel settext getmsg getctx kapprovallabel settext getctx voiceauthcode konline settext getmsg getctx konline addactionlistener kstatus settext centerpanel kpanel kpanel centerlayout addlayoutcomponent kpanel kpanel kpanel ktypelabel gridbagconstraints gridbagconstraints gridbagconstraints kpanel ktypecombo gridbagconstraints gridbagconstraints gridbagconstraints kpanel knumnerlabel gridbagconstraints gridbagconstraints gridbagconstraints kpanel knumberfield gridbagconstraints gridbagconstraints gridbagconstraints kpanel kexplabel gridbagconstraints gridbagconstraints gridbagconstraints kpanel kexpfield gridbagconstraints gridbagconstraints gridbagconstraints kpanel kapprovallabel gridbagconstraints gridbagconstraints gridbagconstraints kpanel kapprovalfield gridbagconstraints gridbagconstraints gridbagconstraints kpanel kstatus gridbagconstraints gridbagconstraints gridbagconstraints kpanel konline gridbagconstraints gridbagconstraints gridbagconstraints tpanel setlayout tpanellayout taccountlabel settext getctx c_bp_bankaccount_id troutingfield setcolumns tnumberfield setcolumns troutingtext settext getctx routingno tnumbertext settext getctx accountno tonline settext getmsg getctx tstatus settext centerpanel tpanel tpanel centerlayout addlayoutcomponent tpanel tpanel tpanel taccountlabel gridbagconstraints gridbagconstraints gridbagconstraints tpanel taccountcombo gridbagconstraints gridbagconstraints gridbagconstraints tpanel troutingfield gridbagconstraints gridbagconstraints gridbagconstraints tpanel tnumberfield gridbagconstraints gridbagconstraints gridbagconstraints tpanel tstatus gridbagconstraints gridbagconstraints gridbagconstraints tpanel troutingtext gridbagconstraints gridbagconstraints gridbagconstraints tpanel tnumbertext gridbagconstraints gridbagconstraints gridbagconstraints tpanel tonline gridbagconstraints gridbagconstraints gridbagconstraints spanel setlayout spanellayout sbankaccountlabel settext getctx c_bankaccount_id samountlabel settext getmsg getctx samountfield settext sroutinglabel settext getctx routingno snumberlabel settext getctx accountno schecklabel settext getctx checkno scheckfield setcolumns scurrencylabel settext getctx c_currency_id snumberfield setpreferredsize sroutingfield setpreferredsize sstatus settext sonline settext getmsg getctx centerpanel spanel spanel centerlayout addlayoutcomponent spanel spanel spanel scurrencylabel gridbagconstraints gridbagconstraints gridbagconstraints spanel scurrencycombo gridbagconstraints gridbagconstraints gridbagconstraints spanel sroutingfield gridbagconstraints gridbagconstraints gridbagconstraints spanel snumberfield gridbagconstraints gridbagconstraints gridbagconstraints spanel scheckfield gridbagconstraints gridbagconstraints gridbagconstraints spanel sroutinglabel gridbagconstraints gridbagconstraints gridbagconstraints spanel snumberlabel gridbagconstraints gridbagconstraints gridbagconstraints spanel schecklabel gridbagconstraints gridbagconstraints gridbagconstraints spanel sbankaccountcombo gridbagconstraints gridbagconstraints gridbagconstraints spanel sbankaccountlabel gridbagconstraints gridbagconstraints gridbagconstraints spanel sstatus gridbagconstraints gridbagconstraints gridbagconstraints spanel sonline gridbagconstraints gridbagconstraints gridbagconstraints spanel samountfield gridbagconstraints gridbagconstraints gridbagconstraints spanel samountlabel gridbagconstraints gridbagconstraints gridbagconstraints ppanel setlayout ppanellayout ptermlabel settext getctx c_paymentterm_id centerpanel ppanel ppanel centerlayout addlayoutcomponent ppanel ppanel ppanel ptermlabel gridbagconstraints gridbagconstraints gridbagconstraints ppanel ptermcombo gridbagconstraints gridbagconstraints gridbagconstraints bcashbooklabel settext getctx c_cashbook_id bcurrencylabel settext getctx c_currency_id bpanel setlayout bpanellayout bamountlabel settext getmsg getctx bamountfield settext bdatelabel settext getctx dateacct centerlayout addlayoutcomponent bpanel bpanel centerpanel bpanel bpanel bpanel bcurrencylabel gridbagconstraints gridbagconstraints gridbagconstraints bpanel bcurrencycombo gridbagconstraints gridbagconstraints gridbagconstraints bpanel bdatefield gridbagconstraints gridbagconstraints gridbagconstraints bpanel bdatelabel gridbagconstraints gridbagconstraints gridbagconstraints bpanel bcashbooklabel gridbagconstraints gridbagconstraints gridbagconstraints bpanel bcashbookcombo gridbagconstraints gridbagconstraints gridbagconstraints bpanel bamountlabel gridbagconstraints gridbagconstraints gridbagconstraints bpanel bamountfield gridbagconstraints gridbagconstraints gridbagconstraints mainpanel confirmpanel borderlayout confirmpanel addactionlistener dynamic init b cash currency k credit card type number exp approval l direct debit bpartner bank p payment term payment term s check currency check no routing currencies are shown if member of emu param button button return true if init ok throws exception private boolean dyn init v button button throws exception m docstatus string m mtab get value doc status log config m docstatus if m mtab get value c bpartner id null a dialog error 0 this save error row not found return false is the trx posted string posted string m mtab get value posted if posted null posted equals y return false doc status m docstatus string m mtab get value doc status if m docstatus null m docstatus is the trx closed reversed voided cloased if m docstatus equals re m docstatus equals vo m docstatus equals cl return false document is not complete allow to change the payment rule only if m docstatus equals co m docstatus equals wp m onlyrule false else m onlyrule true po only rule if m onlyrule only order has warehouse m issotrx m mtab get value m warehouse id null m onlyrule true center panel set visible m onlyrule amount m amount big decimal m mtab get value grand total if m onlyrule m amount compare to env zero 0 a dialog error m windowno this payment zero return false b amount field set text m format format m amount s amount field set text m format format m amount get data from grid m ad client id integer m mtab get value ad client id int value m ad org id integer m mtab get value ad org id int value m c bpartner id integer m mtab get value c bpartner id int value m paymentrule string m mtab get value payment rule m c currency id integer m mtab get value c currency id int value m dateacct timestamp m mtab get value date acct if m mtab get value c paymentterm id null m c paymentterm id integer m mtab get value c paymentterm id int value existing payment if m mtab get value c payment id null m c payment id integer m mtab get value c payment id int value if m c payment id 0 m mpayment new m payment env get ctx m c payment id null m mpaymentoriginal new m payment env get ctx m c payment id null full copy credit card m cctype m mpayment get credit card type k number field set text m mpayment get credit card number k exp field set text m mpayment get credit card exp null k approval field set text m mpayment get voice auth code k status set text m mpayment getr pnref if approved paid don t let it change k type combo set read write m mpayment is approved k number field set read write m mpayment is approved k exp field set read write m mpayment is approved k approval field set read write m mpayment is approved k online set read write m mpayment is approved check m c bankaccount id m mpayment getc bankaccount id s routing field set text m mpayment get routing no s number field set text m mpayment get account no s check field set text m mpayment get check no s status set text m mpayment getr pnref transfer t routing field set text m mpayment get routing no t number field set text m mpayment get account no t status set text m mpayment getr pnref if m mpayment null m mpayment new m payment env get ctx 0 null m mpayment setad org id m ad org id m mpayment set amount m c currency id m amount existing cahbook entry m cashline null m c cashline id 0 if m mtab get value c cashline id null m c cashline id integer m mtab get value c cashline id int value if m c cashline id 0 m cashline null else m cashline new m cash line env get ctx m c cashline id null m dateacct m cashline get statement date accounting date b date field set value m dateacct if s currencies null load currencies is the currency an emu currency integer c currency id new integer m c currency id if s currencies contains key c currency id enumeration en s currencies keys while en has more elements object key en next element b currency combo add item s currencies get key s currency combo add item s currencies get key s currency combo add action listener this s currency combo set selected item s currencies get c currency id b currency combo add action listener this b currency combo set selected item s currencies get c currency id else no emu currency b currency label set visible false cash b currency combo set visible false s currency label set visible false check s currency combo set visible false payment combo if m paymentrule null m paymentrule value name pair vp null hash map values button get values object a values key set to array for int i 0 i a length i string payment rule string a i value name pair pp new value name pair payment rule string values get a i payment combo add item pp if payment rule to string equals m paymentrule to select vp pp set payment rule payment combo add action listener this if vp null payment combo set selected item vp load payment terms string sql m role get default add accesssql select c paymentterm id name from c paymentterm where is active y order by name c paymentterm m role sql notqualified m role sql ro key name pair kp null try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next int key rs get int 1 string name rs get string 2 key name pair pp new key name pair key name p term combo add item pp if key m c paymentterm id kp pp rs close pstmt close catch sql exception ept log log level severe sql ept set selection if kp null p term combo set selected item kp load accounts sql select a c bp bankaccount id nvl b name a account no as acct from c bp bankaccount a c bank b where c bpartner id and a is active y kp null try prepared statement pstmt db prepare statement sql null pstmt set int 1 m c bpartner id result set rs pstmt execute query while rs next int key rs get int 1 string name rs get string 2 key name pair pp new key name pair key name t account combo add item pp kp pp rs close pstmt close catch sql exception eac log log level severe sql eac set selection if kp null t account combo set selected item kp load credit cards value name pair ccs m mpayment get credit cards vp null for int i 0 i ccs length i k type combo add item ccs i if ccs i get value equals m cctype vp ccs i set selection if vp null k type combo set selected item vp load bank accounts sql m role get default add accesssql select c bankaccount id name account no is default from c bankaccount ba inner join c bank b on ba c bank id b c bank id where b is active y ba m role sql fullyqualified m role sql ro kp null try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next int key rs get int 1 string name rs get string 2 key name pair pp new key name pair key name s bank account combo add item pp if key m c bankaccount id kp pp if kp null rs get string 3 equals y default kp pp rs close pstmt close catch sql exception ept log log level severe sql ept set selection if kp null s bank account combo set selected item kp load cash books sql m role get default add accesssql select c cashbook id name ad org id from c cashbook where is active y c cashbook m role sql notqualified m role sql ro kp null try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next int key rs get int 1 string name rs get string 2 key name pair pp new key name pair key name b cash book combo add item pp if key m c cashbook id kp pp if kp null key m ad org id default org kp pp rs close pstmt close catch sql exception epc log log level severe sql epc set selection if kp null b cash book combo set selected item kp if m c cashbook id 0 m c cashbook id kp get key set to default to avoid cashbook changed message return true creditcard directdebit bpartner_bank paymentterm paymentterm checkno dyninit vbutton m_docstatus m_mtab getvalue docstatus m_docstatus m_mtab getvalue c_bpartner_id adialog saveerrorrownotfound m_mtab getvalue docstatus m_docstatus m_mtab getvalue docstatus m_docstatus m_docstatus m_docstatus m_docstatus m_docstatus m_docstatus m_docstatus m_onlyrule m_onlyrule m_onlyrule m_issotrx m_mtab getvalue m_warehouse_id m_onlyrule centerpanel setvisible m_onlyrule m_amount bigdecimal m_mtab getvalue grandtotal m_onlyrule m_amount compareto adialog m_windowno paymentzero bamountfield settext m_format m_amount samountfield settext m_format m_amount m_ad_client_id m_mtab getvalue ad_client_id intvalue m_ad_org_id m_mtab getvalue ad_org_id intvalue m_c_bpartner_id m_mtab getvalue c_bpartner_id intvalue m_paymentrule m_mtab getvalue paymentrule m_c_currency_id m_mtab getvalue c_currency_id intvalue m_dateacct m_mtab getvalue dateacct m_mtab getvalue c_paymentterm_id m_c_paymentterm_id m_mtab getvalue c_paymentterm_id intvalue m_mtab getvalue c_payment_id m_c_payment_id m_mtab getvalue c_payment_id intvalue m_c_payment_id m_mpayment mpayment getctx m_c_payment_id m_mpaymentoriginal mpayment getctx m_c_payment_id creditcard m_cctype m_mpayment getcreditcardtype knumberfield settext m_mpayment getcreditcardnumber kexpfield settext m_mpayment getcreditcardexp kapprovalfield settext m_mpayment getvoiceauthcode kstatus settext m_mpayment getr_pnref ktypecombo setreadwrite m_mpayment isapproved knumberfield setreadwrite m_mpayment isapproved kexpfield setreadwrite m_mpayment isapproved kapprovalfield setreadwrite m_mpayment isapproved konline setreadwrite m_mpayment isapproved m_c_bankaccount_id m_mpayment getc_bankaccount_id sroutingfield settext m_mpayment getroutingno snumberfield settext m_mpayment getaccountno scheckfield settext m_mpayment getcheckno sstatus settext m_mpayment getr_pnref troutingfield settext m_mpayment getroutingno tnumberfield settext m_mpayment getaccountno tstatus settext m_mpayment getr_pnref m_mpayment m_mpayment mpayment getctx m_mpayment setad_org_id m_ad_org_id m_mpayment setamount m_c_currency_id m_amount m_cashline m_c_cashline_id m_mtab getvalue c_cashline_id m_c_cashline_id m_mtab getvalue c_cashline_id intvalue m_c_cashline_id m_cashline m_cashline mcashline getctx m_c_cashline_id m_dateacct m_cashline getstatementdate bdatefield setvalue m_dateacct s_currencies loadcurrencies c_currency_id m_c_currency_id s_currencies containskey c_currency_id s_currencies hasmoreelements nextelement bcurrencycombo additem s_currencies scurrencycombo additem s_currencies scurrencycombo addactionlistener scurrencycombo setselecteditem s_currencies c_currency_id bcurrencycombo addactionlistener bcurrencycombo setselecteditem s_currencies c_currency_id bcurrencylabel setvisible bcurrencycombo setvisible scurrencylabel setvisible scurrencycombo setvisible m_paymentrule m_paymentrule valuenamepair hashmap getvalues keyset toarray paymentrule valuenamepair valuenamepair paymentrule paymentcombo additem paymentrule tostring m_paymentrule paymentrule paymentcombo addactionlistener paymentcombo setselecteditem mrole getdefault addaccesssql c_paymentterm_id c_paymentterm isactive c_paymentterm mrole sql_notqualified mrole sql_ro keynamepair preparedstatement preparestatement resultset executequery getint getstring keynamepair keynamepair ptermcombo additem m_c_paymentterm_id sqlexception ptermcombo setselecteditem c_bp_bankaccount_id accountno c_bp_bankaccount c_bank c_bpartner_id isactive preparedstatement preparestatement setint m_c_bpartner_id resultset executequery getint getstring keynamepair keynamepair taccountcombo additem sqlexception taccountcombo setselecteditem valuenamepair m_mpayment getcreditcards ktypecombo additem getvalue m_cctype ktypecombo setselecteditem mrole getdefault addaccesssql c_bankaccount_id accountno isdefault c_bankaccount c_bank c_bank_id c_bank_id isactive mrole sql_fullyqualified mrole sql_ro preparedstatement preparestatement resultset executequery getint getstring keynamepair keynamepair sbankaccountcombo additem m_c_bankaccount_id getstring sqlexception sbankaccountcombo setselecteditem mrole getdefault addaccesssql c_cashbook_id ad_org_id c_cashbook isactive c_cashbook mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery getint getstring keynamepair keynamepair bcashbookcombo additem m_c_cashbook_id m_ad_org_id sqlexception bcashbookcombo setselecteditem m_c_cashbook_id m_c_cashbook_id getkey init ok to be able to make changes return true if init ok public boolean is initok return m initok isinitok m_initok fill s currencies with emu currencies private void load currencies s currencies new hashtable integer key name pair 12 currenly only 10 1 string sql select c currency id iso code from c currency where isemu member y and emu entry date sys date or is euro y order by 2 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next int id rs get int 1 string name rs get string 2 s currencies put new integer id new key name pair id name rs close pstmt close catch sql exception e log log level severe sql e s_currencies loadcurrencies s_currencies keynamepair c_currency_id iso_code c_currency isemumember emuentrydate sysdate iseuro preparedstatement preparestatement resultset executequery getint getstring s_currencies keynamepair sqlexception action listener param e event public void action performed action event e log fine v payment action performed e get action command finish if e get action command equals confirm panel a ok if check mandatory save changes cannot recover dispose else if e get action command equals confirm panel a cancel dispose payment method change else if e get source payment combo get selection value name pair pp value name pair payment combo get selected item if pp null string s pp get value to lower case panel center layout show center panel s switch to panel check currency change else if e get source s currency combo key name pair pp key name pair s currency combo get selected item big decimal amt m conversion rate convert env get ctx m amount m c currency id pp get key m ad client id m ad org id s amount field set text m format format amt cash currency change else if e get source b currency combo key name pair pp key name pair b currency combo get selected item big decimal amt m conversion rate convert env get ctx m amount m c currency id pp get key m ad client id m ad org id b amount field set text m format format amt online else if e get source k online e get source s online e get source t online process online actionperformed actionevent vpayment actionperformed getactioncommand getactioncommand confirmpanel a_ok checkmandatory savechanges getactioncommand confirmpanel a_cancel getsource paymentcombo valuenamepair valuenamepair paymentcombo getselecteditem getvalue tolowercase centerlayout centerpanel getsource scurrencycombo keynamepair keynamepair scurrencycombo getselecteditem bigdecimal mconversionrate getctx m_amount m_c_currency_id getkey m_ad_client_id m_ad_org_id samountfield settext m_format getsource bcurrencycombo keynamepair keynamepair bcurrencycombo getselecteditem bigdecimal mconversionrate getctx m_amount m_c_currency_id getkey m_ad_client_id m_ad_org_id bamountfield settext m_format getsource konline getsource sonline getsource tonline processonline save changes return true if eindow can exit private boolean save changes value name pair vp value name pair payment combo get selected item string new payment rule vp get value log info new rule new payment rule only payment rule if m onlyrule if new payment rule equals m paymentrule m mtab set value payment rule new payment rule return true new values timestamp new date acct m dateacct int newc paymentterm id m c paymentterm id int newc cashline id m c cashline id int newc cashbook id m c cashbook id string newcc type m cctype int newc bankaccount id 0 b cash currency if new payment rule equals x c order paymentrule cash key name pair kp key name pair b cash book combo get selected item if kp null newc cashbook id kp get key new date acct timestamp b date field get value k credit card type number exp approval else if new payment rule equals x c order paymentrule creditcard vp value name pair k type combo get selected item if vp null newcc type vp get value t transfer bpartner bank else if new payment rule equals m order paymentrule directdeposit new payment rule equals m order paymentrule directdebit t account combo get selected item p payment term payment term else if new payment rule equals x c order paymentrule oncredit key name pair kp key name pair p term combo get selected item if kp null newc paymentterm id kp get key s check currency check no routing else if new payment rule equals x c order paymentrule check s currency combo get selected item key name pair kp key name pair s bank account combo get selected item if kp null newc bankaccount id kp get key else return false find bank account if not qualified yet if ktsd index of new payment rule 1 newc bankaccount id 0 string tender m payment tendertype creditcard if new payment rule equals m order paymentrule directdeposit tender m payment tendertype directdeposit else if new payment rule equals m order paymentrule directdebit tender m payment tendertype directdebit else if new payment rule equals m order paymentrule check tender m payment tendertype check changed payment rule if new payment rule equals m paymentrule log fine changed payment rule m paymentrule new payment rule we had a cash book entry if m paymentrule equals x c order paymentrule cash log fine old cash m cashline if m cashline null m cash line cl m cashline create reversal if cl save log config cash cancelled else a dialog error m windowno this payment error cash not cancelled newc cashline id 0 reset we had a change in payment type e g check to cc else if ktsd index of m paymentrule 1 ktsd index of new payment rule 1 m mpaymentoriginal null log fine old payment 1 m mpaymentoriginal m mpaymentoriginal set doc action doc action action reverse correct boolean ok m mpaymentoriginal process it doc action action reverse correct m mpaymentoriginal save if ok log info payment canecelled m mpaymentoriginal else a dialog error m windowno this payment error payment not cancelled m mpaymentoriginal get document no m mpayment reset new we had a payment and something else e g check to cash else if ktsd index of m paymentrule 1 ktsd index of new payment rule 1 log fine old payment 2 m mpaymentoriginal if m mpaymentoriginal null m mpaymentoriginal set doc action doc action action reverse correct boolean ok m mpaymentoriginal process it doc action action reverse correct m mpaymentoriginal save if ok cancel payment log fine payment cancelled m mpayment get document no m mtab get table model data save true m mpayment reset new m mpayment set amount m c currency id m amount else a dialog error m windowno this payment error payment not cancelled m mpayment get document no get order and optionally invoice int c order id env get context as int env get ctx m windowno c order id int c invoice id env get context as int env get ctx m windowno c invoice id if c invoice id 0 m docstatus equals co c invoice id get invoiceid c order id amount sign negative if arc credit memo or api ap invoice boolean negate amt false m invoice invoice null if c invoice id 0 invoice new m invoice env get ctx c invoice id null negate amt invoice is credit memo m order order null if invoice null c order id 0 order new m order env get ctx c order id null big decimal pay amount m amount if negate amt pay amount m amount negate info log config c order id c order id c invoice id c invoice id negate amt negate amt cash book if new payment rule equals x c order paymentrule cash log fine cash string description string m mtab get value document no if c invoice id 0 order null log config no invoice a dialog error m windowno this payment error cash not created else changed amount if m cashline null pay amount compare to m cashline get amount 0 log config changed cash book amount m cashline set amount pay amount if m cashline save log config cash amt changed different date cash book if m cashline null newc cashbook id m c cashbook id time util is same day m cashline get statement date new date acct log config changed cash book date m c cashbook id newc cashbook id m cash line reverse m cashline create reversal if reverse save a dialog error m windowno this payment error cash not cancelled m cashline null create new if m cashline null log config new cash book int c currency id 0 if invoice null c currency id invoice getc currency id if c currency id 0 order null c currency id order getc currency id m cash cash null if newc cashbook id 0 cash m cash get env get ctx newc cashbook id new date acct null else default cash m cash get env get ctx m ad org id new date acct c currency id null if cash null cash get id 0 a dialog error m windowno this payment error cash not created else m cash line cl new m cash line cash if invoice null cl set invoice invoice if order null cl set order order null m needsave true if cl save log config cash created else a dialog error m windowno this payment error cash not created have invoice payments if ktsd index of new payment rule 1 log fine payment new payment rule set amount m mpayment set amount m c currency id pay amount if new payment rule equals m order paymentrule creditcard m mpayment set credit card m payment trxtype sales newcc type k number field get text k exp field get text m mpayment set payment processor else if new payment rule equals m order paymentrule directdeposit new payment rule equals m order paymentrule directdebit m mpayment set bankach newc bankaccount id m issotrx new payment rule t routing field get text t number field get text else if new payment rule equals m order paymentrule check m mpayment set bank check newc bankaccount id m issotrx s routing field get text s number field get text s check field get text m mpayment setc bpartner id m c bpartner id m mpayment setc invoice id c invoice id if order null m mpayment setc order id c order id m needsave true m mpayment set date trx m dateacct m mpayment set date acct m dateacct m mpayment save save post if m payment docstatus drafted equals m mpayment get doc status boolean ok m mpayment process it doc action action complete m mpayment save if ok a dialog info m windowno this payment created m mpayment get document no else a dialog error m windowno this payment error payment not created else log fine not draft m mpayment save values to m tab log config saving changes if new payment rule equals m paymentrule m mtab set value payment rule new payment rule if new date acct equals m dateacct m mtab set value date acct new date acct if newc paymentterm id m c paymentterm id m mtab set value c paymentterm id new integer newc paymentterm id set payment if m mpayment getc payment id m c payment id if m mpayment getc payment id 0 m mtab set value c payment id null else m mtab set value c payment id new integer m mpayment getc payment id set cash if newc cashline id m c cashline id if newc cashline id 0 m mtab set value c cashline id null else savechanges valuenamepair valuenamepair paymentcombo getselecteditem newpaymentrule getvalue newpaymentrule m_onlyrule newpaymentrule m_paymentrule m_mtab setvalue paymentrule newpaymentrule newdateacct m_dateacct newc_paymentterm_id m_c_paymentterm_id newc_cashline_id m_c_cashline_id newc_cashbook_id m_c_cashbook_id newcctype m_cctype newc_bankaccount_id newpaymentrule x_c_order paymentrule_cash keynamepair keynamepair bcashbookcombo getselecteditem newc_cashbook_id getkey newdateacct bdatefield getvalue creditcard newpaymentrule x_c_order paymentrule_creditcard valuenamepair ktypecombo getselecteditem newcctype getvalue bpartner_bank newpaymentrule morder paymentrule_directdeposit newpaymentrule morder paymentrule_directdebit taccountcombo getselecteditem paymentterm paymentterm newpaymentrule x_c_order paymentrule_oncredit keynamepair keynamepair ptermcombo getselecteditem newc_paymentterm_id getkey checkno newpaymentrule x_c_order paymentrule_check scurrencycombo getselecteditem keynamepair keynamepair sbankaccountcombo getselecteditem newc_bankaccount_id getkey indexof newpaymentrule newc_bankaccount_id mpayment tendertype_creditcard newpaymentrule morder paymentrule_directdeposit mpayment tendertype_directdeposit newpaymentrule morder paymentrule_directdebit mpayment tendertype_directdebit newpaymentrule morder paymentrule_check mpayment tendertype_check paymentrule newpaymentrule m_paymentrule paymentrule m_paymentrule newpaymentrule cashbook m_paymentrule x_c_order paymentrule_cash m_cashline m_cashline mcashline m_cashline createreversal cashcancelled adialog m_windowno paymenterror cashnotcancelled newc_cashline_id indexof m_paymentrule indexof newpaymentrule m_mpaymentoriginal m_mpaymentoriginal m_mpaymentoriginal setdocaction docaction action_reverse_correct m_mpaymentoriginal processit docaction action_reverse_correct m_mpaymentoriginal m_mpaymentoriginal adialog m_windowno paymenterror paymentnotcancelled m_mpaymentoriginal getdocumentno m_mpayment resetnew indexof m_paymentrule indexof newpaymentrule m_mpaymentoriginal m_mpaymentoriginal m_mpaymentoriginal setdocaction docaction action_reverse_correct m_mpaymentoriginal processit docaction action_reverse_correct m_mpaymentoriginal paymentcancelled m_mpayment getdocumentno m_mtab gettablemodel datasave m_mpayment resetnew m_mpayment setamount m_c_currency_id m_amount adialog m_windowno paymenterror paymentnotcancelled m_mpayment getdocumentno c_order_id getcontextasint getctx m_windowno c_order_id c_invoice_id getcontextasint getctx m_windowno c_invoice_id c_invoice_id m_docstatus c_invoice_id getinvoiceid c_order_id negateamt minvoice c_invoice_id minvoice getctx c_invoice_id negateamt iscreditmemo morder c_order_id morder getctx c_order_id bigdecimal payamount m_amount negateamt payamount m_amount c_order_id c_order_id c_invoice_id c_invoice_id negateamt negateamt cashbook newpaymentrule x_c_order paymentrule_cash m_mtab getvalue documentno c_invoice_id adialog m_windowno paymenterror cashnotcreated m_cashline payamount compareto m_cashline getamount cashbook m_cashline setamount payamount m_cashline cashamt cashbook m_cashline newc_cashbook_id m_c_cashbook_id timeutil issameday m_cashline getstatementdate newdateacct cashbook m_c_cashbook_id newc_cashbook_id mcashline m_cashline createreversal adialog m_windowno paymenterror cashnotcancelled m_cashline m_cashline cashbook c_currency_id c_currency_id getc_currency_id c_currency_id c_currency_id getc_currency_id mcash newc_cashbook_id mcash getctx newc_cashbook_id newdateacct mcash getctx m_ad_org_id newdateacct c_currency_id get_id adialog m_windowno paymenterror cashnotcreated mcashline mcashline setinvoice setorder m_needsave cashcreated adialog m_windowno paymenterror cashnotcreated indexof newpaymentrule newpaymentrule m_mpayment setamount m_c_currency_id payamount newpaymentrule morder paymentrule_creditcard m_mpayment setcreditcard mpayment trxtype_sales newcctype knumberfield gettext kexpfield gettext m_mpayment setpaymentprocessor newpaymentrule morder paymentrule_directdeposit newpaymentrule morder paymentrule_directdebit m_mpayment setbankach newc_bankaccount_id m_issotrx newpaymentrule troutingfield gettext tnumberfield gettext newpaymentrule morder paymentrule_check m_mpayment setbankcheck newc_bankaccount_id m_issotrx sroutingfield gettext snumberfield gettext scheckfield gettext m_mpayment setc_bpartner_id m_c_bpartner_id m_mpayment setc_invoice_id c_invoice_id m_mpayment setc_order_id c_order_id m_needsave m_mpayment setdatetrx m_dateacct m_mpayment setdateacct m_dateacct m_mpayment mpayment docstatus_drafted m_mpayment getdocstatus m_mpayment processit docaction action_complete m_mpayment adialog m_windowno paymentcreated m_mpayment getdocumentno adialog m_windowno paymenterror paymentnotcreated notdraft m_mpayment mtab newpaymentrule m_paymentrule m_mtab setvalue paymentrule newpaymentrule newdateacct m_dateacct m_mtab setvalue dateacct newdateacct newc_paymentterm_id m_c_paymentterm_id m_mtab setvalue c_paymentterm_id newc_paymentterm_id m_mpayment getc_payment_id m_c_payment_id m_mpayment getc_payment_id m_mtab setvalue c_payment_id m_mtab setvalue c_payment_id m_mpayment getc_payment_id newc_cashline_id m_c_cashline_id newc_cashline_id m_mtab setvalue c_cashline_id check mandatory return true if all mandatory items are ok private boolean check mandatory log config v payment check mandatory value name pair vp value name pair payment combo get selected item string payment rule vp get value only payment rule if m onlyrule return true timestamp date acct m dateacct int c paymentterm id m c paymentterm id int c cashbook id m c cashbook id string cc type m cctype int c bankaccount id 0 mandatory data check boolean dataok true b cash currency if payment rule equals m order paymentrule cash key name pair kp key name pair b cash book combo get selected item if kp null c cashbook id kp get key date acct timestamp b date field get value k credit card type number exp approval else if payment rule equals m order paymentrule creditcard vp value name pair k type combo get selected item if vp null cc type vp get value string error m payment validate validate credit card number k number field get text cc type if error length 0 k number field set background compiereplaf getfieldbackground error if error index of 1 a dialog error m windowno this error dataok false else warning if a dialog ask m windowno this error dataok false error m payment validate validate credit card exp k exp field get text if error length 0 k exp field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false t transfer bpartner bank else if payment rule equals m order paymentrule directdeposit payment rule equals m order paymentrule directdebit t account combo get selected item string error m payment validate validate routing no t routing field get text if error length 0 t routing field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false error m payment validate validate account no t number field get text if error length 0 t number field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false p payment term payment term else if payment rule equals m order paymentrule oncredit key name pair kp key name pair p term combo get selected item if kp null c paymentterm id kp get key s check currency check no routing else if payment rule equals m order paymentrule check s currency combo get selected item key name pair kp key name pair s bank account combo get selected item if kp null c bankaccount id kp get key string error m payment validate validate routing no s routing field get text if error length 0 s routing field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false error m payment validate validate account no s number field get text if error length 0 s number field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false error m payment validate validate check no s check field get text if error length 0 s check field set background compiereplaf getfieldbackground error a dialog error m windowno this error dataok false else log log level severe unknown payment rule payment rule return false find bank account if not qualified yet if ktsd index of payment rule 1 c bankaccount id 0 string tender m payment tendertype creditcard if payment rule equals m order paymentrule directdeposit tender m payment tendertype directdeposit else if payment rule equals m order paymentrule directdebit tender m payment tendertype directdebit else if payment rule equals m order paymentrule check tender m payment tendertype check ach check must have a bank account if c bankaccount id 0 ts index of payment rule 1 a dialog error m windowno this payment no processor dataok false log config ok dataok return dataok checkmandatory vpayment checkmandatory valuenamepair valuenamepair paymentcombo getselecteditem paymentrule getvalue m_onlyrule dateacct m_dateacct c_paymentterm_id m_c_paymentterm_id c_cashbook_id m_c_cashbook_id cctype m_cctype c_bankaccount_id paymentrule morder paymentrule_cash keynamepair keynamepair bcashbookcombo getselecteditem c_cashbook_id getkey dateacct bdatefield getvalue creditcard paymentrule morder paymentrule_creditcard valuenamepair ktypecombo getselecteditem cctype getvalue mpaymentvalidate validatecreditcardnumber knumberfield gettext cctype knumberfield setbackground getfieldbackground_error indexof adialog m_windowno adialog m_windowno mpaymentvalidate validatecreditcardexp kexpfield gettext kexpfield setbackground getfieldbackground_error adialog m_windowno bpartner_bank paymentrule morder paymentrule_directdeposit paymentrule morder paymentrule_directdebit taccountcombo getselecteditem mpaymentvalidate validateroutingno troutingfield gettext troutingfield setbackground getfieldbackground_error adialog m_windowno mpaymentvalidate validateaccountno tnumberfield gettext tnumberfield setbackground getfieldbackground_error adialog m_windowno paymentterm paymentterm paymentrule morder paymentrule_oncredit keynamepair keynamepair ptermcombo getselecteditem c_paymentterm_id getkey checkno paymentrule morder paymentrule_check scurrencycombo getselecteditem keynamepair keynamepair sbankaccountcombo getselecteditem c_bankaccount_id getkey mpaymentvalidate validateroutingno sroutingfield gettext sroutingfield setbackground getfieldbackground_error adialog m_windowno mpaymentvalidate validateaccountno snumberfield gettext snumberfield setbackground getfieldbackground_error adialog m_windowno mpaymentvalidate validatecheckno scheckfield gettext scheckfield setbackground getfieldbackground_error adialog m_windowno paymentrule paymentrule indexof paymentrule c_bankaccount_id mpayment tendertype_creditcard paymentrule morder paymentrule_directdeposit mpayment tendertype_directdeposit paymentrule morder paymentrule_directdebit mpayment tendertype_directdebit paymentrule morder paymentrule_check mpayment tendertype_check c_bankaccount_id indexof paymentrule adialog m_windowno paymentnoprocessor get invoice id for order param c order id order return c invoice id or 0 if not found private static int get invoiceid int c order id int ret value 0 string sql select c invoice id from c invoice where c order id order by c invoice id desc last invoice try prepared statement pstmt db prepare statement sql null pstmt set int 1 c order id result set rs pstmt execute query if rs next ret value rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e return ret value c_order_id c_invoice_id getinvoiceid c_order_id retvalue c_invoice_id c_invoice c_order_id c_invoice_id preparedstatement preparestatement setint c_order_id resultset executequery retvalue getint sqlexception retvalue process online sales only if approved exit private void process online log config if check mandatory return boolean approved false string info value name pair vp value name pair payment combo get selected item string payment rule vp get value credit card if payment rule equals x c order paymentrule creditcard vp value name pair k type combo get selected item string cc type vp get value m mpayment set credit card m payment trxtype sales cc type k number field get text k exp field get text m mpayment set amount m c currency id m amount m mpayment set payment processor m mpayment setc bpartner id m c bpartner id int c invoice id env get context as int env get ctx m windowno c invoice id if c invoice id 0 m docstatus equals co int c order id env get context as int env get ctx m windowno c order id c invoice id get invoiceid c order id m mpayment setc invoice id c invoice id m mpayment set date trx m dateacct set amount m mpayment set amount m c currency id m amount approved m mpayment process online info m mpayment getr respmsg m mpayment getr authcode id m mpayment getr pnref boolean saved m mpayment save if approved boolean ok m mpayment process it doc action action complete m mpayment save if ok a dialog info m windowno this payment processed info n m mpayment get document no else a dialog error m windowno this payment error payment not created save changes dispose else a dialog error m windowno this payment not processed info else a dialog error m windowno this payment no processor processonline checkmandatory valuenamepair valuenamepair paymentcombo getselecteditem paymentrule getvalue creditcard paymentrule x_c_order paymentrule_creditcard valuenamepair ktypecombo getselecteditem cctype getvalue m_mpayment setcreditcard mpayment trxtype_sales cctype knumberfield gettext kexpfield gettext m_mpayment setamount m_c_currency_id m_amount m_mpayment setpaymentprocessor m_mpayment setc_bpartner_id m_c_bpartner_id c_invoice_id getcontextasint getctx m_windowno c_invoice_id c_invoice_id m_docstatus c_order_id getcontextasint getctx m_windowno c_order_id c_invoice_id getinvoiceid c_order_id m_mpayment setc_invoice_id c_invoice_id m_mpayment setdatetrx m_dateacct m_mpayment setamount m_c_currency_id m_amount m_mpayment processonline m_mpayment getr_respmsg m_mpayment getr_authcode m_mpayment getr_pnref m_mpayment m_mpayment processit docaction action_complete m_mpayment adialog m_windowno paymentprocessed m_mpayment getdocumentno adialog m_windowno paymenterror paymentnotcreated savechanges adialog m_windowno paymentnotprocessed adialog m_windowno paymentnoprocessor need save record payment with waiting order return true if payment with waiting order public boolean need save return m needsave needsave m_needsave standard constructor param ctx context param m changerequest id ix param trx name trx public m change request properties ctx int m changerequest id string trx name super ctx m changerequest id trx name if m changerequest id 0 set name null set is approved false set processed false m_changerequest_id trxname mchangerequest m_changerequest_id trxname m_changerequest_id trxname m_changerequest_id setname setisapproved setprocessed crm request constructor param request request param group request group public m change request m request request m group group this request get ctx 0 request get trxname set client org request set name msg get element get ctx r request id request get document no set help request get summary setm bom id group getm bom id setm changenotice id group getm changenotice id mchangerequest mrequest mgroup getctx get_trxname setclientorg setname getelement getctx r_request_id getdocumentno sethelp getsummary setm_bom_id getm_bom_id setm_changenotice_id getm_changenotice_id load constructor param ctx context param rs result set param trx name trx public m change request properties ctx result set rs string trx name super ctx rs trx name trxname mchangerequest resultset trxname trxname get crm requests of change requests return requests public m request get requests string sql select from r request where m changerequest id return null mrequest getrequests r_request m_changerequest_id before save param new record new return true false protected boolean before save boolean new record have at least one if getm bom id 0 getm changenotice id 0 log save error error msg parse translation get ctx not found m bom id m changenotice id return false derive change notice from bom if defined if new record getm bom id 0 getm changenotice id 0 mbom bom new mbom get ctx getm bom id get trxname if bom getm changenotice id 0 setm bom id bom getm changenotice id return true newrecord beforesave newrecord getm_bom_id getm_changenotice_id saveerror parsetranslation getctx notfound m_bom_id m_changenotice_id changenotice newrecord getm_bom_id getm_changenotice_id getctx getm_bom_id get_trxname getm_changenotice_id setm_bom_id getm_changenotice_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad tab id p ad tabfrom id para i get parameter as int else log log level severe unknown parameter name p ad tabto id getrecord id processinfoparameter getparameter getparametername getparameter ad_tab_id p_ad_tabfrom_id getparameterasint p_ad_tabto_id getrecord_id process return message throws exception protected string do it throws exception log info to ad tab id p ad tabto id from p ad tabfrom id m tab from new m tab get ctx p ad tabfrom id get trxname if from get id 0 throw new compiere user error not found from ad tab id m tab to new m tab get ctx p ad tabto id get trxname if to get id 0 throw new compiere user error not found to ad tab id if from getad table id to getad table id throw new compiere user error error ad table id int count 0 m field old fields from get fields false get trxname for int i 0 i old fields length i m field old field old fields i m field new field new m field to old field if new field save count else throw new compiere user error error ad field id return copied count doit ad_tab_id p_ad_tabto_id p_ad_tabfrom_id m_tab m_tab getctx p_ad_tabfrom_id get_trxname get_id compiereusererror notfound ad_tab_id m_tab m_tab getctx p_ad_tabto_id get_trxname get_id compiereusererror notfound ad_tab_id getad_table_id getad_table_id compiereusererror ad_table_id m_field oldfields getfields get_trxname oldfields m_field oldfield oldfields m_field newfield m_field oldfield newfield compiereusererror ad_field_id constructor key value pair param key key 1 is considered as null param name string representation public key name pair int key string name super name m key key keyvalue keynamepair m_key get key return key public int get key return m key getkey m_key get id key as string return string value of key or null if 1 public string getid if m key 1 return null return string value of m key m_key valueof m_key equals param obj object return true if equal public boolean equals object obj if obj instanceof key name pair key name pair pp key name pair obj if pp get key m key pp get name null pp get name equals get name return true return false return false keynamepair keynamepair keynamepair getkey m_key getname getname getname return hashcode of key return hascode public int hash code return m key hashcode m_key standard constructor public x c validcombination properties ctx int c validcombination id string trx name super ctx c validcombination id trx name if c validcombination id 0 setaccount id 0 setc acctschema id 0 setc validcombination id 0 set is fully qualified false x_c_validcombination c_validcombination_id trxname c_validcombination_id trxname c_validcombination_id setaccount_id setc_acctschema_id setc_validcombination_id setisfullyqualified load constructor public x c validcombination properties ctx result set rs string trx name super ctx rs trx name x_c_validcombination resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c validcombination append get id append return sb to string tostring stringbuffer stringbuffer x_c_validcombination get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set valuenocheck ad orgtrx id null else set valuenocheck ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_valuenocheck ad_orgtrx_id set_valuenocheck ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue public static final int account id ad reference id 362 set account account used public void setaccount id int account id if account id 1 throw new illegal argument exception account id is mandatory set valuenocheck account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id illegalargumentexception account_id set_valuenocheck account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set alias defines an alternate method of indicating an account combination public void set alias string alias if alias null alias length 40 log warning length 40 truncated alias alias substring 0 39 set value alias alias setalias set_value get alias defines an alternate method of indicating an account combination public string get alias return string get value alias getalias get_value set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue public static final int c activity id ad reference id 142 set activity business activity public void setc activity id int c activity id if c activity id 0 set valuenocheck c activity id null else set valuenocheck c activity id new integer c activity id c_activity_id_ad_reference_id setc_activity_id c_activity_id c_activity_id set_valuenocheck c_activity_id set_valuenocheck c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue public static final int c bpartner id ad reference id 138 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set valuenocheck c bpartner id null else set valuenocheck c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id set_valuenocheck c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue public static final int c campaign id ad reference id 143 set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set valuenocheck c campaign id null else set valuenocheck c campaign id new integer c campaign id c_campaign_id_ad_reference_id setc_campaign_id c_campaign_id c_campaign_id set_valuenocheck c_campaign_id set_valuenocheck c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set valuenocheck c locfrom id null else set valuenocheck c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_valuenocheck c_locfrom_id set_valuenocheck c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set valuenocheck c locto id null else set valuenocheck c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_valuenocheck c_locto_id set_valuenocheck c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue public static final int c project id ad reference id 141 set project financial project public void setc project id int c project id if c project id 0 set valuenocheck c project id null else set valuenocheck c project id new integer c project id c_project_id_ad_reference_id setc_project_id c_project_id c_project_id set_valuenocheck c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue public static final int c salesregion id ad reference id 144 set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set valuenocheck c salesregion id null else set valuenocheck c salesregion id new integer c salesregion id c_salesregion_id_ad_reference_id setc_salesregion_id c_salesregion_id c_salesregion_id set_valuenocheck c_salesregion_id set_valuenocheck c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set sub account sub account for element value public void setc subacct id int c subacct id if c subacct id 0 set valuenocheck c subacct id null else set valuenocheck c subacct id new integer c subacct id setc_subacct_id c_subacct_id c_subacct_id set_valuenocheck c_subacct_id set_valuenocheck c_subacct_id c_subacct_id get sub account sub account for element value public int getc subacct id integer ii integer get value c subacct id if ii null return 0 return ii int value getc_subacct_id get_value c_subacct_id intvalue set combination valid account combination public void setc validcombination id int c validcombination id if c validcombination id 1 throw new illegal argument exception c validcombination id is mandatory set valuenocheck c validcombination id new integer c validcombination id setc_validcombination_id c_validcombination_id c_validcombination_id illegalargumentexception c_validcombination_id set_valuenocheck c_validcombination_id c_validcombination_id get combination valid account combination public int getc validcombination id integer ii integer get value c validcombination id if ii null return 0 return ii int value getc_validcombination_id get_value c_validcombination_id intvalue set combination unique combination of account elements public void set combination string combination if combination null combination length 60 log warning length 60 truncated combination combination substring 0 59 set valuenocheck combination combination setcombination set_valuenocheck get combination unique combination of account elements public string get combination return string get value combination getcombination get_value return string get value combination public key name pair get key name pair return new key name pair get id get combination get_value keynamepair getkeynamepair keynamepair get_id getcombination set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set valuenocheck description description setdescription set_valuenocheck get description optional short description of the record public string get description return string get value description getdescription get_value set fully qualified this account is fully qualified public void set is fully qualified boolean is fully qualified set valuenocheck is fully qualified new boolean is fully qualified setisfullyqualified isfullyqualified set_valuenocheck isfullyqualified isfullyqualified get fully qualified this account is fully qualified public boolean is fully qualified object oo get value is fully qualified if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfullyqualified get_value isfullyqualified booleanvalue public static final int m product id ad reference id 162 set product product service item public void setm product id int m product id if m product id 0 set valuenocheck m product id null else set valuenocheck m product id new integer m product id m_product_id_ad_reference_id setm_product_id m_product_id m_product_id set_valuenocheck m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set valuenocheck user1 id null else set valuenocheck user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_valuenocheck user1_id set_valuenocheck user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set valuenocheck user2 id null else set valuenocheck user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_valuenocheck user2_id set_valuenocheck user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue set user element 1 user defined accounting element public void setuserelement1 id int userelement1 id if userelement1 id 0 set value userelement1 id null else set value userelement1 id new integer userelement1 id setuserelement1_id userelement1_id userelement1_id set_value userelement1_id set_value userelement1_id userelement1_id get user element 1 user defined accounting element public int getuserelement1 id integer ii integer get value userelement1 id if ii null return 0 return ii int value getuserelement1_id get_value userelement1_id intvalue set user element 2 user defined accounting element public void setuserelement2 id int userelement2 id if userelement2 id 0 set value userelement2 id null else set value userelement2 id new integer userelement2 id setuserelement2_id userelement2_id userelement2_id set_value userelement2_id set_value userelement2_id userelement2_id get user element 2 user defined accounting element public int getuserelement2 id integer ii integer get value userelement2 id if ii null return 0 return ii int value getuserelement2_id get_value userelement2_id intvalue standard constructor param ctx context param c revenuerecognition id id public m revenue recognition properties ctx int c revenuerecognition id string trx name super ctx c revenuerecognition id trx name c_revenuerecognition_id mrevenuerecognition c_revenuerecognition_id trxname c_revenuerecognition_id trxname load constructor param ctx context param rs result set public m revenue recognition properties ctx result set rs string trx name super ctx rs trx name mrevenuerecognition resultset trxname trxname constructor extends label param rm param rc public result table cell renderer r model rm r column rc m rm rm m rc rc int dt m rc get display type numbers if display type is numeric dt super set horizontal alignment j label trailing m nformat display type get number format dt dates else if display type is date m rc get display type super set horizontal alignment j label trailing m dformat display type get date format dt else if dt display type yes no m check new j check box m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center resulttablecellrenderer rmodel rcolumn m_rm m_rc m_rc getdisplaytype displaytype isnumeric sethorizontalalignment jlabel m_nformat displaytype getnumberformat displaytype isdate m_rc getdisplaytype sethorizontalalignment jlabel m_dformat displaytype getdateformat displaytype yesno m_check jcheckbox m_check setmargin m_check sethorizontalalignment jlabel return renderer component param table param value param is selected param has focus param row param col return renderer component public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int col get component component c m check if c null default j label c super get table cell renderer component table value is selected has focus row col background if m rm is cell editable row col c set background compiereplaf getfieldbackground normal else c set background compiereplaf getfieldbackground inactive if m rm is group row row c set font c get font derive font font bold value set value value return c isselected hasfocus gettablecellrenderercomponent jtable isselected hasfocus m_check jlabel gettablecellrenderercomponent isselected hasfocus m_rm iscelleditable setbackground getfieldbackground_normal setbackground getfieldbackground_inactive m_rm isgrouprow setfont getfont derivefont setvalue set value param value protected void set value object value boolean if m check null boolean sel false if value null boolean value boolean value sel true m check set selected sel return j label if value null set text else if m nformat null try set text m nformat format value catch exception e set text value to string else if m dformat null try set text m dformat format value catch exception e set text value to string else set text value to string setvalue m_check booleanvalue m_check setselected jlabel settext m_nformat settext m_nformat settext tostring m_dformat settext m_dformat settext tostring settext tostring get contents return contents public object get contents return contents getcontents static final private string content type text html initialize global variables public void init throws servlet exception get servlet context log status info init content_type servletexception getservletcontext statusinfo process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception response set content type content type print writer out response get writer out println html out println head title status info title head out println body initial context context null try context new initial context catch exception ex out println p b ex b p try status home status home status home context lookup status home jndi name status status status home create out println p status get status p status remove catch exception ex out println p b ex b p try server home server home server home context lookup server home jndi name server server server home create out println p server get status p server remove catch exception ex out println p b ex b p try out println h2 h2 naming enumeration ne context list while ne has more out println br ne next element out println h2 java h2 ne context list java while ne has more out println br ne next element out println h2 ejb h2 ne context list ejb while ne has more out println br ne next element out println h2 ds h2 data source ds data source context lookup java oracleds out println br data source ds get class get name login timeout ds get login timeout connection con ds get connection adempiere adempiere out println br connection get servlet context log connection closed con is closed database meta data dbmd con get meta data get servlet context log db dbmd get database product name get servlet context log db v dbmd get database product version get servlet context log driver dbmd get driver name get servlet context log driver v dbmd get driver version get servlet context log jdbc dbmd getjdbc major version get servlet context log jdbc mv dbmd getjdbc minor version get servlet context log user dbmd get user name get servlet context log ansi 92 dbmd supportsansi92 fullsql get servlet context log connection alter table add dbmd supports alter table with add column get servlet context log connection alter table drop dbmd supports alter table with drop column get servlet context log connection ddl dml dbmd supports data definition and data manipulation transactions get servlet context log connection catalogs in dml dbmd supports catalogs in data manipulation get servlet context log connection schema in dml dbmd supports schemas in data manipulation catch exception e out println p b e b p out println body html doget httpservletrequest httpservletresponse servletexception ioexception setcontenttype content_type printwriter getwriter initialcontext initialcontext statushome statushome statushome statushome jndi_name statushome getstatus serverhome serverhome serverhome serverhome jndi_name serverhome getstatus namingenumeration hasmore nextelement hasmore nextelement hasmore nextelement datasource datasource datasource getclass getname logintimeout getlogintimeout getconnection getservletcontext isclosed databasemetadata getmetadata getservletcontext getdatabaseproductname getservletcontext getdatabaseproductversion getservletcontext getdrivername getservletcontext getdriverversion getservletcontext getjdbcmajorversion getservletcontext getjdbcminorversion getservletcontext getusername getservletcontext supportsansi92fullsql getservletcontext supportsaltertablewithaddcolumn getservletcontext supportsaltertablewithdropcolumn getservletcontext supportsdatadefinitionanddatamanipulationtransactions getservletcontext catalogsin supportscatalogsindatamanipulation getservletcontext supportsschemasindatamanipulation process the http put request public void do put http servlet request request http servlet response response throws servlet exception io exception do get request response doput httpservletrequest httpservletresponse servletexception ioexception doget clean up resources public void destroy get servlet context log status info destroy getservletcontext statusinfo process cc return true if processed throws illegal argument exception public boolean processcc throws illegal argument exception return m ok illegalargumentexception illegalargumentexception m_ok is processed ok return true if ok public boolean is processedok return m ok isprocessedok m_ok test param args ifnored public static void main string args c log mgt initialize true c log mgt set level level all pp paypal pp new pp paypal pp processcc pp is processedok clogmgt clogmgt setlevel pp_paypal pp_paypal isprocessedok create new run param ctx context param ad replication id id param date run date public m replication run properties ctx int ad replication id timestamp date run string trx name super ctx 0 trx name setad replication id ad replication id set name date run to string super set is replicated false ad_replication_id daterun mreplicationrun ad_replication_id daterun trxname trxname setad_replication_id ad_replication_id setname daterun tostring setisreplicated set replication flag param is replicated replicated public void set is replicated boolean is replicated super set is replicated is replicated isreplicated setisreplicated isreplicated setisreplicated isreplicated basic constructor public samp basic constructor param element adds an element to the element public samp element element add element element addelement basic constructor param element adds an element to the element public samp string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public samp add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public samp add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public samp add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public samp add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public samp remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param multi selection determines layout button for single check for multi public id column renderer boolean multi selection super m multiselection multi selection multi check if m multiselection m check new j check box m check set margin new insets 0 0 0 0 m check set horizontal alignment j label center else single button m button new j button m button set margin new insets 0 0 0 0 m button set size new dimension 5 5 multiselection idcolumnrenderer multiselection m_multiselection multiselection m_multiselection m_check jcheckbox m_check setmargin m_check sethorizontalalignment jlabel m_button jbutton m_button setmargin m_button setsize set value for multi selection param value protected void set value object value if m multiselection boolean sel false if value null else if value instanceof id column sel id column value is selected else if value instanceof boolean sel boolean value boolean value else sel value to string equals y m check set selected sel setvalue m_multiselection idcolumn idcolumn isselected booleanvalue tostring m_check setselected return rendering component param table param value param is selected param has focus param row param column return component check box or button public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int column set value value if m multiselection return m check else return m button isselected hasfocus checkbox gettablecellrenderercomponent jtable isselected hasfocus setvalue m_multiselection m_check m_button currency constructor param ctx context param c currency id id public m currency properties ctx int c currency id string trx name super ctx c currency id trx name if c currency id 0 set isemu member false set is euro false set std precision 2 set costing precision 4 c_currency_id mcurrency c_currency_id trxname c_currency_id trxname c_currency_id setisemumember setiseuro setstdprecision setcostingprecision currency constructor param ctx context param iso code iso param description name param cur symbol symbol param std precision prec param costing precision prec public m currency properties ctx string iso code string description string cur symbol int std precision int costing precision string trx name super ctx 0 trx name setiso code iso code set description description set cur symbol cur symbol set std precision std precision set costing precision costing precision set isemu member false set is euro false iso_code cursymbol stdprecision costingprecision mcurrency iso_code cursymbol stdprecision costingprecision trxname trxname setiso_code iso_code setdescription setcursymbol cursymbol setstdprecision stdprecision setcostingprecision costingprecision setisemumember setiseuro get currency param ctx context param c currency id currency return iso code public static m currency get properties ctx int c currency id try cache integer key new integer c currency id m currency ret value m currency s currencies get key if ret value null return ret value create it ret value new m currency ctx c currency id null save in system if ret value getad client id 0 s currencies put key ret value return ret value c_currency_id mcurrency c_currency_id c_currency_id mcurrency retvalue mcurrency s_currencies retvalue retvalue retvalue mcurrency c_currency_id retvalue getad_client_id s_currencies retvalue retvalue get currency iso code param ctx context param c currency id currency return iso code public static string getiso code properties ctx int c currency id string context key c currency c currency id string ret value ctx get property context key if ret value null return ret value create it m currency c get ctx c currency id ret value c getiso code ctx set property context key ret value return ret value c_currency_id getiso_code c_currency_id contextkey c_currency_ c_currency_id retvalue getproperty contextkey retvalue retvalue mcurrency c_currency_id retvalue getiso_code setproperty contextkey retvalue retvalue get standard precision param ctx context param c currency id currency return standard precision public static int get std precision properties ctx int c currency id m currency c get ctx c currency id return c get std precision c_currency_id getstdprecision c_currency_id mcurrency c_currency_id getstdprecision string representation return info public string to string return m currency getc currency id getiso code get cur symbol get description precision get std precision get costing precision tostring mcurrency getc_currency_id getiso_code getcursymbol getdescription getstdprecision getcostingprecision get active param ctx context return active processors public static m workflow processor get active properties ctx array list m workflow processor list new array list m workflow processor string sql select from ad workflowprocessor where is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m workflow processor ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m workflow processor ret value new m workflow processor list size list to array ret value return ret value mworkflowprocessor getactive arraylist mworkflowprocessor arraylist mworkflowprocessor ad_workflowprocessor isactive preparedstatement preparestatement resultset executequery mworkflowprocessor s_log mworkflowprocessor retvalue mworkflowprocessor toarray retvalue retvalue standard constructor param ctx context param ad workflowprocessor id id public m workflow processor properties ctx int ad workflowprocessor id string trx name super ctx ad workflowprocessor id trx name ad_workflowprocessor_id mworkflowprocessor ad_workflowprocessor_id trxname ad_workflowprocessor_id trxname load constructor param ctx context param rs result set public m workflow processor properties ctx result set rs string trx name super ctx rs trx name mworkflowprocessor resultset trxname trxname get server id return id public string get serverid return workflow processor get id getserverid workflowprocessor get_id get date next run param requery requery return date next run public timestamp get date next run boolean requery if requery load get trxname return get date next run getdatenextrun get_trxname getdatenextrun get logs return logs public compiere processor log get logs array list m workflow processor log list new array list m workflow processor log string sql select from ad workflowprocessorlog where ad workflowprocessor id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad workflowprocessor id result set rs pstmt execute query while rs next list add new m workflow processor log get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m workflow processor log ret value new m workflow processor log list size list to array ret value return ret value compiereprocessorlog getlogs arraylist mworkflowprocessorlog arraylist mworkflowprocessorlog ad_workflowprocessorlog ad_workflowprocessor_id preparedstatement preparestatement get_trxname setint getad_workflowprocessor_id resultset executequery mworkflowprocessorlog getctx get_trxname mworkflowprocessorlog retvalue mworkflowprocessorlog toarray retvalue retvalue delete old request log return number of records public int delete log if get keep log days 1 return 0 string sql delete ad workflowprocessorlog where ad workflowprocessor id getad workflowprocessor id and created get keep log days sys date int no db execute update sql get trxname return 0 deletelog getkeeplogdays ad_workflowprocessorlog ad_workflowprocessor_id getad_workflowprocessor_id getkeeplogdays sysdate executeupdate get_trxname constructor the class is instanciated when logging in and client is selected known public my validator super myvalidator initialize validation param engine validation engine param client client public void initialize model validation engine engine m client client log info client to string m ad client id client getad client id we want to be informed when c order is created changed engine add model change c order this we want to validate order before preparing engine add doc validate c order this modelvalidationengine mclient tostring m_ad_client_id getad_client_id c_order addmodelchange c_order adddocvalidate c_order model change of a monitored table called after po before save po before delete when you called add model change for the table param po persistent object param type type return error message or null exception exception if the recipient wishes the change to be not accept public string model change po po int type throws exception if po get tablename equals c order type type change m order order m order po log info po to string return null beforesave beforedelete addmodelchange type_ modelchange get_tablename c_order type_change morder morder tostring validate document called as first step of doc action prepare it when you called add doc validate for the table note that totals etc may not be correct param po persistent object param timing see timing constants return error message or null public string doc validate po po int timing ignore all after complete events if timing timing after complete return null if po get tablename equals c order m order order m order po log info po to string return null docaction prepareit adddocvalidate timing_ docvalidate timing_after_complete get_tablename c_order morder morder tostring user login called when preferences are set param ad org id org param ad role id role param ad user id user return error message or null public string login int ad org id int ad role id int ad user id log info ad user id ad user id return null ad_org_id ad_role_id ad_user_id ad_org_id ad_role_id ad_user_id ad_user_id ad_user_id get client to be monitored return ad client id client public int getad client id return m ad client id ad_client_id getad_client_id m_ad_client_id create ui own instance param c return compiere tool barui public static componentui createui j component c return new compiere tool barui compieretoolbarui jcomponent compieretoolbarui install ui not opaque param c public void installui j component c super installui c c set opaque false jcomponent setopaque default constructor use set methods with this name param element type the name of this element public xml string element type set element type element type element_type element_type setelementtype element_type construct a new xml element with this name br and specify if it needs the element tag closed param element type the name of this element param close should it have a closing tag public xml string element type boolean close set element type element type set need closing tag close element_type element_type setelementtype element_type setneedclosingtag construct a new xml element with this name and specify a filter for it param element type the name of this element param filter a new filter for this element override the default public xml string element type filter filter set element type element type set filter filter element_type element_type setelementtype element_type setfilter construct a new xml element with this name and specify a filter for it param element type the name of this element param close should it have a closing tag param filter should this element be filtered public xml string element type boolean close boolean filter set element type element type set need closing tag close set filter state filter element_type element_type setelementtype element_type setneedclosingtag setfilterstate construct a new xml element with this name and specify a filter for it param element type the name of this element param close should it have a closing tag param filter a new filter for this element override the default public xml string element type boolean close filter filter set element type element type set need closing tag close set filter filter element_type element_type setelementtype element_type setneedclosingtag setfilter add a new attribute to this xml tag param attribute the attribute name param attribute value the value of the attribute set this to br code ecs no attribute value code if this attribute br doesn t take a value public xml addxml attribute string attribute string attribute value add attribute attribute attribute value return this attribute_value ecs_no_attribute_value addxmlattribute attribute_value addattribute attribute_value add an element to the valuie of lt gt value lt gt param element the value of lt gt value lt gt public xml add element string element add element to registry element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public xml add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public xml add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add an element to the valuie of lt gt value lt gt param element the value of lt gt value lt gt public xml add element element element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public xml remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry public boolean get need line break boolean linebreak true java util enumeration en elements if this tag has one child and it s a string then don t do any linebreaks to preserve whitespace while en has more elements object obj en next element if obj instanceof string element linebreak false break return linebreak getneedlinebreak hasmoreelements nextelement stringelement public boolean get begin end modifier defined boolean answer false if this get need closing tag answer true return answer getbeginendmodifierdefined getneedclosingtag public char get begin end modifier return getbeginendmodifier standard constructor public x w counter properties ctx int w counter id string trx name super ctx w counter id trx name if w counter id 0 set pageurl null set processed false setremote addr null setremote host null setw counter id 0 x_w_counter w_counter_id trxname w_counter_id trxname w_counter_id setpageurl setprocessed setremote_addr setremote_host setw_counter_id load constructor public x w counter properties ctx result set rs string trx name super ctx rs trx name x_w_counter resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w counter append get id append return sb to string tostring stringbuffer stringbuffer x_w_counter get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set accept language language accepted based on browser information public void set accept language string accept language if accept language null accept language length 60 log warning length 60 truncated accept language accept language substring 0 59 set value accept language accept language setacceptlanguage acceptlanguage acceptlanguage acceptlanguage acceptlanguage acceptlanguage set_value acceptlanguage acceptlanguage get accept language language accepted based on browser information public string get accept language return string get value accept language getacceptlanguage get_value acceptlanguage set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set page url public void set pageurl string pageurl if pageurl null throw new illegal argument exception pageurl is mandatory if pageurl length 120 log warning length 120 truncated pageurl pageurl substring 0 119 set value pageurl pageurl setpageurl illegalargumentexception set_value get page url public string get pageurl return string get value pageurl getpageurl get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set referrer referring web address public void set referrer string referrer if referrer null referrer length 120 log warning length 120 truncated referrer referrer substring 0 119 set value referrer referrer setreferrer set_value get referrer referring web address public string get referrer return string get value referrer getreferrer get_value set remote addr remote address public void setremote addr string remote addr if remote addr null throw new illegal argument exception remote addr is mandatory if remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set value remote addr remote addr setremote_addr remote_addr remote_addr illegalargumentexception remote_addr remote_addr remote_addr remote_addr set_value remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr return string get value remote addr public key name pair get key name pair return new key name pair get id getremote addr get_value remote_addr keynamepair getkeynamepair keynamepair get_id getremote_addr set remote host remote host info public void setremote host string remote host if remote host null throw new illegal argument exception remote host is mandatory if remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set value remote host remote host setremote_host remote_host remote_host illegalargumentexception remote_host remote_host remote_host remote_host set_value remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set user agent browser used public void set user agent string user agent if user agent null user agent length 255 log warning length 255 truncated user agent user agent substring 0 254 set value user agent user agent setuseragent useragent useragent useragent useragent useragent set_value useragent useragent get user agent browser used public string get user agent return string get value user agent getuseragent get_value useragent set counter count web counter count management public void setw countercount id int w countercount id if w countercount id 0 set valuenocheck w countercount id null else set valuenocheck w countercount id new integer w countercount id setw_countercount_id w_countercount_id w_countercount_id set_valuenocheck w_countercount_id set_valuenocheck w_countercount_id w_countercount_id get counter count web counter count management public int getw countercount id integer ii integer get value w countercount id if ii null return 0 return ii int value getw_countercount_id get_value w_countercount_id intvalue set web counter individual count hit public void setw counter id int w counter id if w counter id 1 throw new illegal argument exception w counter id is mandatory set valuenocheck w counter id new integer w counter id setw_counter_id w_counter_id w_counter_id illegalargumentexception w_counter_id set_valuenocheck w_counter_id w_counter_id get web counter individual count hit public int getw counter id integer ii integer get value w counter id if ii null return 0 return ii int value getw_counter_id get_value w_counter_id intvalue get set default client server connection return connection descriptor public static c connection get return get null cconnection get set default client server connection param apps host optional apps host for new connections return connection descriptor public static c connection get string apps host if s cc null string attributes ini get property ini p connection if attributes null attributes length 0 c connection dialog ccd new c connection dialog new c connection apps host s cc ccd get connection set also in a login and ctrl ini set property ini p connection s cc to string long ini save properties ini is client else s cc new c connection null s cc set attributes attributes log fine s cc to string return s cc apps_host cconnection apps_host s_cc getproperty p_connection cconnectiondialog cconnectiondialog cconnection apps_host s_cc getconnection alogin setproperty p_connection s_cc tostringlong saveproperties isclient s_cc cconnection s_cc setattributes s_cc tostring s_cc get specific connection param type database type e g database db oracle param db host db host param db port db port param db name db name return connection public static c connection get string type string db host int db port string db name return get type db host db port db name null null db_oracle db_host db_port db_name cconnection db_host db_port db_name db_host db_port db_name get specific client connection param type database type e g database db oracle param db host db host param db port db port param db name db name param db uid db user id param db pwd db user password return connection public static c connection get string type string db host int db port string db name string db uid string db pwd c connection cc new c connection db host cc set apps host db host set apps db cc set type type cc set db host db host cc set db port db port cc set db name db name if db uid null cc set db uid db uid if db pwd null cc set db pwd db pwd return cc db_oracle db_host db_port db_name db_uid db_pwd cconnection db_host db_port db_name db_uid db_pwd cconnection cconnection db_host setappshost db_host settype setdbhost db_host setdbport db_port setdbname db_name db_uid setdbuid db_uid db_pwd setdbpwd db_pwd compiere connection param host optional application db host private c connection string host if host null m apps host host m db host host cconnection m_apps_host m_db_host get name return connection name public string get name return m name getname m_name set name param name connection name public void set name string name m name name setname m_name set name protected void set name m name to string setname m_name tostring get application host return apps host public string get apps host return m apps host getappshost m_apps_host set application host param apps host apps host public void set apps host string apps host m apps host apps host m name to string m okapps false apps_host setappshost apps_host m_apps_host apps_host m_name tostring m_okapps get apps port return port public int get apps port return m apps port getappsport m_apps_port set apps port param apps port apps port public void set apps port int apps port m apps port apps port m okapps false apps_port setappsport apps_port m_apps_port apps_port m_okapps set apps port param apps portstring appd port as string public void set apps port string apps portstring try if apps portstring null apps portstring length 0 else set apps port integer parse int apps portstring catch exception e log severe e to string apps_portstring setappsport apps_portstring apps_portstring apps_portstring setappsport parseint apps_portstring tostring is application server ok param try contact again try to contact again return true if apps server exists public boolean is apps serverok boolean try contact again if try contact again return m okapps get context if m icontext null get initial context false if m okapps return false contact it try status home status home status home m icontext lookup status home jndi name status status status home create m version status get date version status remove m okapps true catch exception ce m okapps false catch throwable t m okapps false return m okapps trycontactagain isappsserverok trycontactagain trycontactagain m_okapps m_icontext getinitialcontext m_okapps statushome statushome statushome m_icontext statushome jndi_name statushome m_version getdateversion m_okapps m_okapps m_okapps m_okapps test application server return exception or null public exception test apps server if query apps server info test database false return get apps server exception applicationserver testappsserver queryappsserverinfo testdatabase getappsserverexception get server return server public server get server if m server null try initial context ic get initial context true if ic null server home server home server home ic lookup server home jndi name if server home null m server server home create catch exception ex log log level severe ex m icontext null return m server getserver m_server initialcontext getinitialcontext serverhome serverhome serverhome serverhome jndi_name serverhome m_server serverhome m_icontext m_server get apps server version return db host name public string get server version return m version getserverversion m_version get database host name return db host name public string get db host return m db host getdbhost m_db_host set database host name param db host db host public void set db host string db host m db host db host m name to string m okdb false db_host setdbhost db_host m_db_host db_host m_name tostring m_okdb get database name service name return db name public string get db name return m db name getdbname m_db_name set database name service name param db name db name public void set db name string db name m db name db name m name to string m okdb false db_name setdbname db_name m_db_name db_name m_name tostring m_okdb get db port return port public int get db port return m db port getdbport m_db_port set db port param db port db port public void set db port int db port m db port db port m okdb false db_port setdbport db_port m_db_port db_port m_okdb set db port param db portstring db port as string public void set db port string db portstring try if db portstring null db portstring length 0 else set db port integer parse int db portstring catch exception e log severe e to string db_portstring setdbport db_portstring db_portstring db_portstring setdbport parseint db_portstring tostring get database password return db password public string get db pwd return m db pwd getdbpwd m_db_pwd set db password param db pwd db user password public void set db pwd string db pwd m db pwd db pwd m okdb false db_pwd setdbpwd db_pwd m_db_pwd db_pwd m_okdb get database user return db user public string get db uid return m db uid getdbuid m_db_uid set database user param db uid db user id public void set db uid string db uid m db uid db uid m name to string m okdb false db_uid setdbuid db_uid m_db_uid db_uid m_name tostring m_okdb rmi over http return true if rmi over http wan connection profile public boolean isrm ioverhttp return ini is client get connection profile equals profile wan isrmioverhttp isclient getconnectionprofile profile_wan set connection profile param connection profile connection profile public void set connection profile value name pair connection profile if connection profile null set connection profile connection profile get value connectionprofile setconnectionprofile valuenamepair connectionprofile connectionprofile setconnectionprofile connectionprofile getvalue set connection profile param connection profile connection profile public void set connection profile string connection profile if connection profile null m connectionprofile null m connectionprofile equals connection profile same return if profile lan equals connection profile profile terminal equals connection profile profile vpn equals connection profile profile wan equals connection profile if m connectionprofile null log config m connectionprofile connection profile m connectionprofile connection profile ini set property ini p connection to string long else m connectionprofile connection profile else log warning invalid connection profile connectionprofile setconnectionprofile connectionprofile connectionprofile m_connectionprofile m_connectionprofile connectionprofile profile_lan connectionprofile profile_terminal connectionprofile profile_vpn connectionprofile profile_wan connectionprofile m_connectionprofile m_connectionprofile connectionprofile m_connectionprofile connectionprofile setproperty p_connection tostringlong m_connectionprofile connectionprofile connectionprofile get connection profile return connection profile public string get connection profile if m connectionprofile null return m connectionprofile return profile lan getconnectionprofile m_connectionprofile m_connectionprofile profile_lan get connection profile text return connection profile text public string get connection profile text string connection profile for int i 0 i connection profiles length i if connection profiles i get value equals connection profile return connection profiles i get name return connection profiles 0 get name getconnectionprofiletext connectionprofile connectionprofiles connectionprofiles getvalue connectionprofile connectionprofiles getname connectionprofiles getname get connection profile text return connection profile text public string get connection profile text return get connection profile text get connection profile getconnectionprofiletext getconnectionprofiletext getconnectionprofile get connection profile return connection profile public value name pair get connection profile pair for int i 0 i connection profiles length i if connection profiles i get value equals get connection profile return connection profiles i return connection profiles 0 valuenamepair getconnectionprofilepair connectionprofiles connectionprofiles getvalue getconnectionprofile connectionprofiles connectionprofiles should objects be created on server return true if client and vpn wan public boolean is server objects return ini is client get connection profile equals profile vpn get connection profile equals profile wan isserverobjects isclient getconnectionprofile profile_vpn getconnectionprofile profile_wan should objects be created on server return true if client and terminal vpn wan public boolean is server process return ini is client get connection profile equals profile terminal get connection profile equals profile vpn get connection profile equals profile wan isserverprocess isclient getconnectionprofile profile_terminal getconnectionprofile profile_vpn getconnectionprofile profile_wan is this a terminal server return true if client and terminal public boolean is terminal server return ini is client get connection profile equals profile terminal isterminalserver isclient getconnectionprofile profile_terminal is db via firewall return true if via firewall public boolean is via firewall return m firewall isviafirewall m_firewall method set via firewall param via firewall boolean public void set via firewall boolean via firewall m firewall via firewall m okdb false setviafirewall viafirewall setviafirewall viafirewall m_firewall viafirewall m_okdb method set via firewall param via firewall string string public void set via firewall string via firewall string try set via firewall boolean value of via firewall string boolean value catch exception e log severe e to string setviafirewall viafirewallstring setviafirewall viafirewallstring setviafirewall valueof viafirewallstring booleanvalue tostring method get fw host return string public string get fw host return m fw host getfwhost getfwhost m_fw_host method set fw host param fw host string public void set fw host string fw host m fw host fw host m okdb false setfwhost fw_host setfwhost fw_host m_fw_host fw_host m_okdb get firewall port return firewall port public int get fw port return m fw port getfwport m_fw_port set firewall port param fw port firewall port public void set fw port int fw port m fw port fw port m okdb false fw_port setfwport fw_port m_fw_port fw_port m_okdb set firewall port param fw portstring firewall port as string public void set fw port string fw portstring try if fw portstring null fw portstring length 0 else set fw port integer parse int fw portstring catch exception e log severe e to string fw_portstring setfwport fw_portstring fw_portstring fw_portstring setfwport parseint fw_portstring tostring is it a bequeath connection return true if bequeath connection public boolean is bequeath return m bequeath isbequeath m_bequeath set bequeath param bequeath bequeath connection public void set bequeath boolean bequeath m bequeath bequeath m okdb false setbequeath m_bequeath m_okdb set bequeath param bequeath string bequeath connection as string true false public void set bequeath string bequeath string try set bequeath boolean value of bequeath string boolean value catch exception e log severe e to string bequeathstring setbequeath bequeathstring setbequeath valueof bequeathstring booleanvalue tostring get database type return database type public string get type return m type gettype m_type set database type and default settings checked against installed databases param type database type e g database db oracle public void set type string type for int i 0 i database db names length i if database db names i equals type m type type m okdb false break oracle if is oracle if get db port db oracle default port set db port db oracle default port set fw port db oracle default cm port else set bequeath false set via firewall false db2 if isdb2 if get db port db db2 default port set db port db db2 default port else if is sybase if get db port db sybase default port set db port db sybase default port begin vpj cd e evolution 09 ene 2006 postgresql if is postgresql if get db port db postgresql default port set db port db postgresql default port end vpj cd e evolution 09 ene 2006 db_oracle settype db_names db_names m_type m_okdb isoracle getdbport db_oracle default_port setdbport db_oracle default_port setfwport db_oracle default_cm_port setbequeath setviafirewall getdbport db_db2 default_port setdbport db_db2 default_port issybase getdbport db_sybase default_port setdbport db_sybase default_port ispostgresql getdbport db_postgresql default_port setdbport db_postgresql default_port supports blob return true if blob is supported public boolean supportsblob return m db supportsblob m_db is oracle db return true if oracle public boolean is oracle return database db oracle equals m type isoracle db_oracle m_type is sybase db return true if sybase public boolean is sybase return database db sybase equals m type issybase db_sybase m_type is ibm db 2 return true if db 2 public boolean isdb2 return database db db2 equals m type db_db2 m_type is apache derby return true if derby public boolean is derby return database db derby equals m type isderby db_derby m_type is microsoft sql server return true if derby public boolean ismssql server return database db mssqlserver equals m type ismssqlserver db_mssqlserver m_type begin e evolution vpj cd 30 nov 2005 is postgresql db return true if postgresql public boolean is postgresql return database db postgresql equals m type ispostgresql db_postgresql m_type is database connection ok return true if database connection is ok public boolean is databaseok return m okdb isdatabaseok m_okdb create db connection return data source null public boolean set data source system out println c connection set data source m ds client ini is client if m ds null ini is client if get database null no db selected m ds get database get data source this system out println c connection set data source m ds return m ds null setdatasource cconnection setdatasource m_ds isclient m_ds isclient getdatabase m_ds getdatabase getdatasource cconnection setdatasource m_ds m_ds set data source param ds data source return data source null public boolean set data source data source ds if ds null m ds null get database close m ds ds return m ds null setdatasource datasource m_ds getdatabase m_ds m_ds get server connection return data source public data source get data source return m ds datasource datasource getdatasource m_ds has server connection return true if data source exists public boolean is data source return m ds null datasource isdatasource m_ds test database connection example database postgresql 7 1 3 driver postgresql native driver postgresql 7 2 jdbc2 example database oracle oracle8i enterprise edition release 8 1 7 0 0 production with the partitioning option j server release 8 1 7 0 0 production driver oracle jdbc driver 9 0 1 1 0 return exception or null public exception test database boolean retest at this point application server connection is tested if isrm ioverhttp return null if retest m ds null m okdb return null if m ds null get database close m ds null set data source the actual test connection conn get connection true connection transaction read committed if conn null try database meta data dbmd conn get meta data m info 0 database dbmd get database product name dbmd get database product version m info 0 m info 0 replace n m info 1 driver dbmd get driver name dbmd get driver version if is data source m info 1 via data source m info 1 m info 1 replace n log config m info 0 m info 1 conn close catch exception e log severe e to string return e return m dbexception from opening jserver testdatabase isrmioverhttp m_ds m_okdb m_ds getdatabase m_ds setdatasource getconnection transaction_read_committed databasemetadata getmetadata m_info getdatabaseproductname getdatabaseproductversion m_info m_info m_info getdrivername getdriverversion isdatasource m_info datasource m_info m_info m_info m_info tostring m_dbexception short string representation return apps host db host db name uid public string to string string buffer sb new string buffer m apps host sb append append m db host append append m db name append append m db uid append return sb to string appshost dbhost dbname tostring stringbuffer stringbuffer m_apps_host m_db_host m_db_name m_db_uid tostring detail info return info public string to string detail string buffer sb new string buffer m apps host sb append append m db host append append m db name append append m db uid append connection conn get connection true connection transaction read committed if conn null try database meta data dbmd conn get meta data sb append n database dbmd get database product name dbmd get database product version sb append n driver dbmd get driver name dbmd get driver version if is data source sb append via ds conn close catch exception e conn null return sb to string tostringdetail stringbuffer stringbuffer m_apps_host m_db_host m_db_name m_db_uid getconnection transaction_read_committed databasemetadata getmetadata ndatabase getdatabaseproductname getdatabaseproductversion ndriver getdrivername getdriverversion isdatasource tostring get db version info return info public string getdb info if m dbinfo null return m dbinfo string buffer sb new string buffer connection conn get connection true connection transaction read committed if conn null try database meta data dbmd conn get meta data sb append dbmd get database product version append append dbmd get driver version if is data source sb append ds conn close m dbinfo sb to string catch exception e log log level severe e sb append e get localized message conn null return sb to string getdbinfo m_dbinfo m_dbinfo stringbuffer stringbuffer getconnection transaction_read_committed databasemetadata getmetadata getdatabaseproductversion getdriverversion isdatasource m_dbinfo tostring getlocalizedmessage tostring string representation used also for instanciation return string representation see set attributes string set attributes public string to string long string buffer sb new string buffer c connection sb append name append m name append apps host append m apps host append apps port append m apps port append profile append get connection profile append type append m type append d bhost append m db host append d bport append m db port append d bname append m db name append bq append m bequeath append fw append m firewall append f whost append m fw host append f wport append m fw port append uid append m db uid append pwd append m db pwd the format is read by set attributes sb append return sb to string setattributes setattributes tostringlong stringbuffer stringbuffer cconnection m_name appshost m_apps_host appsport m_apps_port getconnectionprofile m_type dbhost m_db_host dbport m_db_port dbname m_db_name m_bequeath m_firewall fwhost m_fw_host fwport m_fw_port m_db_uid m_db_pwd setattributes tostring set attributes from string pares to string long param attributes attributes private void set attributes string attributes try set name attributes substring attributes index of name 5 attributes index of apps host set apps host attributes substring attributes index of apps host 9 attributes index of apps port int index attributes index of apps port set apps port attributes substring index 9 attributes index of index index attributes index of profile if index 0 new attribute may not exist set connection profile attributes substring index 8 attributes index of index set type attributes substring attributes index of type 5 attributes index of d bhost set db host attributes substring attributes index of d bhost 7 attributes index of d bport set db port attributes substring attributes index of d bport 7 attributes index of d bname set db name attributes substring attributes index of d bname 7 attributes index of bq set bequeath attributes substring attributes index of bq 3 attributes index of fw set via firewall attributes substring attributes index of fw 3 attributes index of f whost set fw host attributes substring attributes index of f whost 7 attributes index of f wport set fw port attributes substring attributes index of f wport 7 attributes index of uid set db uid attributes substring attributes index of uid 4 attributes index of pwd set db pwd attributes substring attributes index of pwd 4 attributes index of catch exception e log severe attributes e to string tostringlong setattributes setname indexof indexof appshost setappshost indexof appshost indexof appsport indexof appsport setappsport indexof indexof setconnectionprofile indexof settype indexof indexof dbhost setdbhost indexof dbhost indexof dbport setdbport indexof dbport indexof dbname setdbname indexof dbname indexof setbequeath indexof indexof setviafirewall indexof indexof fwhost setfwhost indexof fwhost indexof fwport setfwport indexof fwport indexof setdbuid indexof indexof setdbpwd indexof indexof tostring equals param o object return true if o equals this public boolean equals object o if o instanceof c connection c connection cc c connection o if cc get apps host equals m apps host cc get apps port m apps port cc get db host equals m db host cc get db port m db port cc get connection profile equals get connection profile cc get db name equals m db name cc get type equals m type cc get db uid equals m db uid cc get db pwd equals m db pwd return true return false cconnection cconnection cconnection getappshost m_apps_host getappsport m_apps_port getdbhost m_db_host getdbport m_db_port getconnectionprofile getconnectionprofile getdbname m_db_name gettype m_type getdbuid m_db_uid getdbpwd m_db_pwd get info database driver status info return info public string get info string buffer sb new string buffer m info 0 sb append append m info 1 append n append get database to string append n apps serverok append is apps serverok false append databaseok append is databaseok return sb to string getinfo stringbuffer stringbuffer m_info m_info getdatabase tostring nappsserverok isappsserverok isdatabaseok tostring hashcode return hashcode of name public int hash code return m name hash code hashcode m_name hashcode get database return database public compiere database get database different driver if m db null m db get name equals m type m db null if m db null try for int i 0 i database db names length i if database db names i equals m type m db compiere database database db classes i new instance break catch exception e log severe e to string return m db compieredatabase getdatabase m_db m_db getname m_type m_db m_db db_names db_names m_type m_db compieredatabase db_classes newinstance tostring m_db get connection string return connection string public string get connectionurl get database updates m db if m db null return m db get connectionurl this else return getconnectionurl getdatabase m_db m_db m_db getconnectionurl get server connection do close param auto commit true if autocommit connection param trx level connection transaction level return connection public connection get server connection boolean auto commit int trx level connection conn null server connection if m ds null try conn m ds get connection conn set auto commit auto commit conn set transaction isolation trx level m okdb true catch sql exception ex m dbexception ex log log level severe ex server return conn autocommit trxlevel getserverconnection autocommit trxlevel m_ds m_ds getconnection setautocommit autocommit settransactionisolation trxlevel m_okdb sqlexception m_dbexception create connection no not close sets m dbexception param auto commit true if autocommit connection param transaction isolation connection transaction level return connection public connection get connection boolean auto commit int transaction isolation connection conn null m dbexception null m okdb false get database updates m db if m db null m dbexception new illegal state exception no database connector return null try if ini is client server trx level connection transaction read committed po lob save exception ee null try conn m db get cached connection this auto commit transaction isolation catch exception e ee e if conn null thread yield log config retrying ee conn m db get cached connection this auto commit transaction isolation system err println c connection get connection cache get connectionurl auto commit auto commit trx level trx level else if is data source client conn m ds get connection system err println c connection get connection data source get connectionurl auto commit auto commit trx level trx level else conn m db get driver connection this system err println c connection get connection driver get connectionurl auto commit auto commit trx level trx level verify connection if conn null if conn get transaction isolation transaction isolation conn set transaction isolation transaction isolation if conn get auto commit auto commit conn set auto commit auto commit m okdb true catch unsatisfied link error ule string msg ule get localized message did you set the ld library path get connectionurl m dbexception new exception msg log severe msg catch sql exception ex m dbexception ex if conn null log log level severe get connectionurl 1 auto commit auto commit trx iso get transaction isolation info transaction isolation get db uid get db pwd ex get message else try log severe get connectionurl 2 auto commit conn get auto commit auto commit trx iso get transaction isolation info conn get transaction isolation get transaction isolation info transaction isolation get db uid get db pwd ex get message catch exception ee log severe get connectionurl 3 auto commit auto commit trx iso get transaction isolation info transaction isolation get db uid get db pwd ex get message catch exception ex m dbexception ex log log level severe get connectionurl ex system err println c connection get connection conn return conn m_dbexception autocommit transactionisolation getconnection autocommit transactionisolation m_dbexception m_okdb getdatabase m_db m_db m_dbexception illegalstateexception isclient trxlevel transaction_read_committed po_lob m_db getcachedconnection autocommit transactionisolation m_db getcachedconnection autocommit transactionisolation cconnection getconnection getconnectionurl autocommit autocommit trxlevel trxlevel isdatasource m_ds getconnection cconnection getconnection datasource getconnectionurl autocommit autocommit trxlevel trxlevel m_db getdriverconnection cconnection getconnection getconnectionurl autocommit autocommit trxlevel trxlevel gettransactionisolation transactionisolation settransactionisolation transactionisolation getautocommit autocommit setautocommit autocommit m_okdb unsatisfiedlinkerror getlocalizedmessage ld_library_path getconnectionurl m_dbexception sqlexception m_dbexception getconnectionurl autocommit autocommit trxiso gettransactionisolationinfo transactionisolation getdbuid getdbpwd getmessage getconnectionurl autocommit getautocommit autocommit trxiso gettransactionisolationinfo gettransactionisolation gettransactionisolationinfo transactionisolation getdbuid getdbpwd getmessage getconnectionurl autocommit autocommit trxiso gettransactionisolationinfo transactionisolation getdbuid getdbpwd getmessage m_dbexception getconnectionurl cconnection getconnection get database exception of last connection attempt return exception or null public exception get database exception return m dbexception getdatabaseexception m_dbexception get application server initial context param use cache if true use existing cache return initial context or null public initial context get initial context boolean use cache if use cache m icontext null return m icontext set environment if m env null use cache m env get initial environment get apps host get apps port isrm ioverhttp string connect string m env get context provider url env set context env get ctx context provider url connect get context m icontext null try m icontext new initial context m env catch exception ex m okapps false m appsexception ex if connect null connect string m env get context provider url log severe connect n ex to string n m env if c log mgt is level finest ex print stack trace return m icontext usecache initialcontext getinitialcontext usecache usecache m_icontext m_icontext m_env usecache m_env getinitialenvironment getappshost getappsport isrmioverhttp m_env provider_url setcontext getctx provider_url m_icontext m_icontext initialcontext m_env m_okapps m_appsexception m_env provider_url tostring m_env clogmgt islevelfinest printstacktrace m_icontext get initial environment param apps host host param apps port port param rm ioverhttp true if tunnel through http return environment public static hashtable get initial environment string apps host int apps port boolean rm ioverhttp set environment hashtable string string env new hashtable string string string connect apps host if rm ioverhttp env put context initial context factory org jboss naming http naming context factory if apps host index of 1 connect http apps host apps port invoker jndi factory env put context provider url connect else env put context initial context factory org jnp interfaces naming context factory if apps host index of 1 connect jnp apps host apps port env put context provider url connect env put context url pkg prefixes org jboss naming client http default timeout 0 env put org jnp interfaces timed socket factory jnp timeout 5000 timeout in ms env put org jnp interfaces timed socket factory jnp so timeout 5000 jnp default timeout 5 sec env put org jnp interfaces naming context jnp discovery timeout 5000 return env appshost appsport rmioverhttp getinitialenvironment appshost appsport rmioverhttp appshost rmioverhttp initial_context_factory httpnamingcontextfactory appshost indexof appshost appsport jndifactory provider_url initial_context_factory namingcontextfactory appshost indexof appshost appsport provider_url url_pkg_prefixes timedsocketfactory jnp_timeout timedsocketfactory jnp_so_timeout namingcontext jnp_discovery_timeout get initial context param env environment return initial context public static initial context get initial context hashtable env initial context i context null try i context new initial context env catch exception ex log warning url env get context provider url n ex to string n env i context null if c log mgt is level finest ex print stack trace return i context initialcontext getinitialcontext initialcontext icontext icontext initialcontext provider_url tostring icontext clogmgt islevelfinest printstacktrace icontext query application server status update ok apps return true ik ok private boolean query apps server info log finer get apps host long start system current time millis m okapps false m appsexception null get initial context false if m icontext null return m okapps false prevent error trace c log mgt log4j enable false try status home status home status home m icontext lookup status home jndi name status status status home create update info from server status status remove m okapps true catch communication exception ce not a real error m appsexception ce string connect string m env get context provider url log warning connect n ce to string n m env catch exception e m appsexception e string connect string m env get context provider url log warning connect n e to string n m env c log mgt log4j enable true log fine success m okapps system current time millis start ms return m okapps okapps queryappsserverinfo getappshost currenttimemillis m_okapps m_appsexception getinitialcontext m_icontext m_okapps clogmgtlog4j statushome statushome statushome m_icontext statushome jndi_name statushome updateinfofromserver m_okapps communicationexception m_appsexception m_env provider_url tostring m_env m_appsexception m_env provider_url tostring m_env clogmgtlog4j m_okapps currenttimemillis m_okapps get last exception of apps server connection attempt return exception or null public exception get apps server exception return m appsexception getappsserverexception m_appsexception update connection info from apps server param svr apps server status throws exception private void update info from server status svr throws exception if svr null throw new illegal argument exception apps server was null set type svr get db type set db host svr get db host set db port svr get db port set db name svr get db name set db uid svr get db uid set db pwd svr get db pwd set bequeath false set fw host svr get fw host set fw port svr get fw port if get fw host length 0 set via firewall false m version svr get date version log config server get db host db get db name updateinfofromserver illegalargumentexception appsserver settype getdbtype setdbhost getdbhost setdbport getdbport setdbname getdbname setdbuid getdbuid setdbpwd getdbpwd setbequeath setfwhost getfwhost setfwport getfwport getfwhost setviafirewall m_version getdateversion getdbhost getdbname convert statement param orig statement original statement oracle notation return converted statement throws exception public string convert statement string orig statement throws exception make sure we have a good database if m db null m db get name equals m type get database if m db null return m db convert statement orig statement throw new exception c connection convert statement no converstion database origstatement convertstatement origstatement m_db m_db getname m_type getdatabase m_db m_db convertstatement origstatement cconnection convertstatement get status info return info public string get status string buffer sb new string buffer m apps host sb append append m db host append append m db name append append m db uid append if m db null sb append m db get status return sb to string getstatus stringbuffer stringbuffer m_apps_host m_db_host m_db_name m_db_uid m_db m_db getstatus tostring get transaction isolation info param transaction isolation trx iso return clear test public static string get transaction isolation info int transaction isolation if transaction isolation connection transaction none return none if transaction isolation connection transaction read committed return read committed if transaction isolation connection transaction read uncommitted return read uncommitted if transaction isolation connection transaction repeatable read return repeatable read if transaction isolation connection transaction read committed return serializable return transaction isolation transactionisolation gettransactionisolationinfo transactionisolation transactionisolation transaction_none transactionisolation transaction_read_committed read_committed transactionisolation transaction_read_uncommitted read_uncommitted transactionisolation transaction_repeatable_read repeatable_read transactionisolation transaction_read_committed transactionisolation testing param args ignored public static void main string args boolean server true if args length 0 system out println c connection server client else server server equals args 0 system out println c connection server server client if server compiere startup false else compiere startup true system out println connection c connection name localhost dev dev1 compiere apps host localhost apps port 1099 type oracle d bhost dev d bport 1521 d bname dev1 bq false fw false f whost f wport 1630 uid compiere pwd compiere system out println ini get property ini p connection c connection cc c connection get system out println cc to string long connection con cc get connection false connection transaction read committed new c connection dialog cc cconnection cconnection cconnection appshost appsport dbhost dbport dbname fwhost fwport getproperty p_connection cconnection cconnection tostringlong getconnection transaction_read_committed cconnectiondialog standard constructor public x b topiccategory properties ctx int b topiccategory id string trx name super ctx b topiccategory id trx name if b topiccategory id 0 setb topiccategory id 0 setb topictype id 0 set name null x_b_topiccategory b_topiccategory_id trxname b_topiccategory_id trxname b_topiccategory_id setb_topiccategory_id setb_topictype_id setname load constructor public x b topiccategory properties ctx result set rs string trx name super ctx rs trx name x_b_topiccategory resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b topiccategory append get id append return sb to string tostring stringbuffer stringbuffer x_b_topiccategory get_id tostring set topic category auction topic category public void setb topiccategory id int b topiccategory id if b topiccategory id 1 throw new illegal argument exception b topiccategory id is mandatory set valuenocheck b topiccategory id new integer b topiccategory id setb_topiccategory_id b_topiccategory_id b_topiccategory_id illegalargumentexception b_topiccategory_id set_valuenocheck b_topiccategory_id b_topiccategory_id get topic category auction topic category public int getb topiccategory id integer ii integer get value b topiccategory id if ii null return 0 return ii int value getb_topiccategory_id get_value b_topiccategory_id intvalue set topic type auction topic type public void setb topictype id int b topictype id if b topictype id 1 throw new illegal argument exception b topictype id is mandatory set valuenocheck b topictype id new integer b topictype id setb_topictype_id b_topictype_id b_topictype_id illegalargumentexception b_topictype_id set_valuenocheck b_topictype_id b_topictype_id get topic type auction topic type public int getb topictype id integer ii integer get value b topictype id if ii null return 0 return ii int value getb_topictype_id get_value b_topictype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name m ad tree id getrecord id from window processinfoparameter getparameter getparametername getparameter m_ad_tree_id getrecord_id perrform process return message clear text throws exception if not successful protected string do it throws exception log info do it ad tree id m ad tree id if m ad tree id 0 throw new illegal argument exception tree id 0 m tree tree new m tree get ctx m ad tree id get trxname if tree null tree getad tree id 0 throw new illegal argument exception no tree tree if m tree treetype bom equals tree get tree type return bom trees not implemented return verify tree tree doit doit ad_tree_id m_ad_tree_id m_ad_tree_id illegalargumentexception tree_id mtree mtree getctx m_ad_tree_id get_trxname getad_tree_id illegalargumentexception mtree treetype_bom gettreetype verifytree verify tree param tree tree private string verify tree mtree base tree string node table name tree get node table name string source table name tree get source table name true string source table key source table name id int ad client id tree getad client id int c element id 0 if m tree treetype elementvalue equals tree get tree type string sql select c element id from c element where ad tree id tree getad tree id c element id db getsql value null sql if c element id 0 throw new illegal state exception no account element found delete unused string buffer sql new string buffer sql append delete append node table name append where ad tree id append tree getad tree id append and node id not in select append source table key append from append source table name append where ad client id append ad client id if c element id 0 sql append and c element id append c element id sql append log finer sql to string int deletes db execute update sql to string get trxname add log 0 null new big decimal deletes tree get name deleted if tree is all nodes return tree get name ok insert new int inserts 0 sql new string buffer sql append select append source table key append from append source table name append where ad client id append ad client id if c element id 0 sql append and c element id append c element id sql append and append source table key append not in select node id from append node table name append where ad tree id append tree getad tree id append log finer sql to string boolean ok true prepared statement pstmt null try pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next int node id rs get int 1 po node null if node table name equals ad treenode node new mtree node tree node id else if node table name equals ad treenodebp node new mtree nodebp tree node id else if node table name equals ad treenodepr node new mtree nodepr tree node id else if node table name equals ad treenodemm node new mtree nodemm tree node id if node null log log level severe verify tree no model for node table name else if node save inserts else log log level severe verify tree could not add to tree node id node id rs close pstmt close pstmt null catch exception e log log level severe verify tree e ok false try if pstmt null pstmt close pstmt null catch exception e pstmt null add log 0 null new big decimal inserts tree get name inserted return tree get name ok ok error verifytree mtree_base nodetablename getnodetablename sourcetablename getsourcetablename sourcetablekey sourcetablename _id ad_client_id getad_client_id c_element_id mtree treetype_elementvalue gettreetype c_element_id c_element ad_tree_id getad_tree_id c_element_id getsqlvalue c_element_id illegalstateexception stringbuffer stringbuffer nodetablename ad_tree_id getad_tree_id node_id sourcetablekey sourcetablename ad_client_id ad_client_id c_element_id c_element_id c_element_id tostring executeupdate tostring get_trxname addlog bigdecimal getname isallnodes getname stringbuffer sourcetablekey sourcetablename ad_client_id ad_client_id c_element_id c_element_id c_element_id sourcetablekey node_id nodetablename ad_tree_id getad_tree_id tostring preparedstatement preparestatement tostring get_trxname resultset executequery node_id getint nodetablename ad_treenode mtree_node node_id nodetablename ad_treenodebp mtree_nodebp node_id nodetablename ad_treenodepr mtree_nodepr node_id nodetablename ad_treenodemm mtree_nodemm node_id verifytree nodetablename verifytree node_id node_id verifytree addlog bigdecimal getname getname get contsnts return contents public object get contents return contents getcontents standard constructor public x ad pinstance log properties ctx int ad pinstance log id string trx name super ctx ad pinstance log id trx name if ad pinstance log id 0 setad pinstance id 0 setlog id 0 x_ad_pinstance_log ad_pinstance_log_id trxname ad_pinstance_log_id trxname ad_pinstance_log_id setad_pinstance_id setlog_id load constructor public x ad pinstance log properties ctx result set rs string trx name super ctx rs trx name x_ad_pinstance_log resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad pinstance log append get id append return sb to string tostring stringbuffer stringbuffer x_ad_pinstance_log get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set log public void setlog id int log id if log id 1 throw new illegal argument exception log id is mandatory set valuenocheck log id new integer log id setlog_id log_id log_id illegalargumentexception log_id set_valuenocheck log_id log_id get log public int getlog id integer ii integer get value log id if ii null return 0 return ii int value getlog_id get_value log_id intvalue set process date process parameter public void setp date timestamp p date set valuenocheck p date p date setp_date p_date set_valuenocheck p_date p_date get process date process parameter public timestamp getp date return timestamp get value p date getp_date get_value p_date set process id public void setp id int p id if p id 0 set valuenocheck p id null else set valuenocheck p id new integer p id setp_id p_id p_id set_valuenocheck p_id set_valuenocheck p_id p_id get process id public int getp id integer ii integer get value p id if ii null return 0 return ii int value getp_id get_value p_id intvalue set process message public void setp msg string p msg if p msg null p msg length 2000 log warning length 2000 truncated p msg p msg substring 0 1999 set valuenocheck p msg p msg setp_msg p_msg p_msg p_msg p_msg p_msg set_valuenocheck p_msg p_msg get process message public string getp msg return string get value p msg getp_msg get_value p_msg set process number process parameter public void setp number big decimal p number set valuenocheck p number p number setp_number bigdecimal p_number set_valuenocheck p_number p_number get process number process parameter public big decimal getp number big decimal bd big decimal get value p number if bd null return env zero return bd bigdecimal getp_number bigdecimal bigdecimal get_value p_number public testejb c connection cc c connection get null cc set apps host dev1 initial context ic cc get initial context false try system out println ic get environment system out println naming enumeration ne ic list while ne has more system out println ne next catch exception e system err println e print stack trace system exit 1 try status home status home status home ic lookup status status status status home create catch communication exception ce not a real error system err println ce ce print stack trace catch exception e system err println e e print stack trace cconnection cconnection setappshost initialcontext getinitialcontext getenvironment namingenumeration hasmore printstacktrace statushome statushome statushome statushome communicationexception printstacktrace printstacktrace main param args public static void main string args new testejb constructor param c period id period param name name param start date period start date param end date period end date param year start date year start date public fin report period int c period id string name timestamp start date timestamp end date timestamp year start date m c period id c period id m name name m startdate start date m enddate end date m yearstartdate year start date c_period_id startdate enddate yearstartdate finreportperiod c_period_id startdate enddate yearstartdate m_c_period_id c_period_id m_name m_startdate startdate m_enddate enddate m_yearstartdate yearstartdate get period info return between start and end public string get period where string buffer sql new string buffer between sql append db to date m startdate append and append db to date m enddate return sql to string getperiodwhere stringbuffer stringbuffer to_date m_startdate to_date m_enddate tostring get year info return between start and end public string get year where string buffer sql new string buffer between sql append db to date m yearstartdate append and append db to date m enddate return sql to string getyearwhere stringbuffer stringbuffer to_date m_yearstartdate to_date m_enddate tostring get total info return end public string get total where string buffer sql new string buffer sql append db to date m enddate return sql to string gettotalwhere stringbuffer stringbuffer to_date m_enddate tostring is date in period param date date return true if in period public boolean in period timestamp date if date null return false if date before m startdate return false if date after m enddate return false return true inperiod m_startdate m_enddate public int getc period id return m c period id getc_period_id m_c_period_id return m c period id public timestamp get end date return m enddate m_c_period_id getenddate m_enddate return m enddate public string get name return m name m_enddate getname m_name return m name public timestamp get start date return m startdate m_name getstartdate m_startdate return m startdate public timestamp get year start date return m yearstartdate m_startdate getyearstartdate m_yearstartdate test connection param jdbcurl jdbc url param uid user param pwd password public test connection string jdbcurl string uid string pwd system out println test connection for jdbcurl m jdbcurl jdbcurl m uid uid m pwd pwd init if m conn null long time test time test time test time test system out println system out println total average m jdbcurl time 4 ms testconnection m_jdbcurl m_uid m_pwd m_conn m_jdbcurl initialize open connection private void init long start system current time millis driver driver null try driver driver manager get driver m jdbcurl catch sql exception ex system err println init get driver ex if driver null try driver manager register driver new oracle jdbc oracle driver catch sql exception ex system err println init register driver ex long end system current time millis system out println 1 driver end start ms start system current time millis try m conn driver manager get connection m jdbcurl m uid m pwd catch sql exception ex system err println init get connection ex end system current time millis system out println 2 get connection end start ms start system current time millis try if m conn null m conn close catch sql exception ex system err println init close connection ex end system current time millis system out println 3 close connection end start ms currenttimemillis drivermanager getdriver m_jdbcurl sqlexception drivermanager registerdriver oracledriver sqlexception currenttimemillis currenttimemillis m_conn drivermanager getconnection m_jdbcurl m_uid m_pwd sqlexception currenttimemillis currenttimemillis m_conn m_conn sqlexception currenttimemillis test result set return time in ms private long test system out println long total start system current time millis long start system current time millis try m conn driver manager get connection m jdbcurl m uid m pwd catch sql exception ex system err println test get connection ex return 1 long end system current time millis system out println a get connection end start ms try start system current time millis statement stmt m conn create statement end system current time millis system out println b create statement end start ms start system current time millis result set rs stmt execute query m sql end system current time millis system out println c execute query end start ms int no 0 start system current time millis while rs next int i rs get int ad client id string s rs get string name i s length no end system current time millis system out println d read result set end start ms per 10 rows end start no 10 ms start system current time millis rs close end system current time millis system out println e close result set end start ms start system current time millis stmt close end system current time millis system out println f close statement end start ms catch sql exception e system err println test e start system current time millis try if m conn null m conn close catch sql exception ex system err println test close connection ex end system current time millis system out println g close connection end start ms long total end system current time millis system out println total test total end total start ms return total end total start resultset totalstart currenttimemillis currenttimemillis m_conn drivermanager getconnection m_jdbcurl m_uid m_pwd sqlexception currenttimemillis currenttimemillis m_conn createstatement currenttimemillis currenttimemillis resultset executequery m_sql currenttimemillis currenttimemillis getint ad_client_id getstring currenttimemillis resultset currenttimemillis currenttimemillis resultset currenttimemillis currenttimemillis sqlexception currenttimemillis m_conn m_conn sqlexception currenttimemillis totalend currenttimemillis totalend totalstart totalend totalstart test connection java cp db port jar oracle jar org compiere db test connection param args arguments optional jdbcurl uid pwd example jdbc oracle thin dev 1521 dev compiere compiere public static void main string args string url jdbc oracle thin 24 151 26 64 1521 lap11 string uid adempiere string pwd adempiere if args length 0 system out println test connection jdbc url uid pwd system out println example jdbc oracle thin dev 1521 dev adempiere adempiere system out println example jdbc oracle oci8 dev adempiere adempiere else if args length 0 url args 0 else if args length 1 url args 1 else if args length 2 url args 2 system out println test connection test new test connection url uid pwd dbport testconnection testconnection jdbcurl testconnection testconnection create timeout message param request request param response response param servlet servlet param message optional message throws servlet exception throws io exception public static void create timeout page http servlet request request http servlet response response http servlet servlet string message throws servlet exception io exception log info message web session ctx wsc web session ctx get request string window title timeout if wsc null window title msg get msg wsc ctx timeout web doc doc web doc create window title body body body doc get body optional message if message null message length 0 body add element new p message align type center login button body add element get login button wsc null null wsc ctx body add element new hr body add element new small servlet get class get name fini create response request response servlet null doc false servletexception ioexception createtimeoutpage httpservletrequest httpservletresponse httpservlet servletexception ioexception websessionctx websessionctx windowtitle windowtitle getmsg webdoc webdoc windowtitle getbody addelement aligntype addelement getloginbutton addelement addelement getclass getname createresponse create error message param request request param response response param servlet servlet param message message throws servlet exception throws io exception public static void create error page http servlet request request http servlet response response http servlet servlet string message throws servlet exception io exception log info message web session ctx wsc web session ctx get request string window title error if wsc null window title msg get msg wsc ctx error if message null window title message web doc doc web doc create window title body body b doc get body b add element new p servlet get servlet name align type center b add element new br fini create response request response servlet null doc true servletexception ioexception createerrorpage httpservletrequest httpservletresponse httpservlet servletexception ioexception websessionctx websessionctx windowtitle windowtitle getmsg windowtitle webdoc webdoc windowtitle getbody addelement getservletname aligntype addelement createresponse create exit page log off p end session go to start page e g adempiere index html param request request param response response param servlet servlet param ctx context param ad message messahe throws servlet exception throws io exception public static void create login page http servlet request request http servlet response response http servlet servlet properties ctx string ad message throws servlet exception io exception request get session invalidate string url web env get base directory index html web doc doc null if ctx null ad message null ad message equals doc web doc create msg get msg ctx ad message else if ad message null doc web doc create ad message else doc web doc create false script script new script window top location replace url doc get body add element script create response request response servlet null doc false ad_message servletexception ioexception createloginpage httpservletrequest httpservletresponse httpservlet ad_message servletexception ioexception getsession webenv getbasedirectory webdoc ad_message ad_message webdoc getmsg ad_message ad_message webdoc ad_message webdoc getbody addelement createresponse create login button replace window param ctx context return button public static button get login button properties ctx string text login if ctx null text msg get msg ctx login button button new button button set type button set name login add element text string buffer cmd new string buffer window top location replace cmd append web env get base directory index html cmd append button set on click cmd to string return button getloginbutton getmsg settype setname addelement stringbuffer stringbuffer webenv getbasedirectory setonclick tostring get cookie properties param request request return properties public static properties get cookie proprties http servlet request request get properties cookie cookies request get cookies if cookies null for int i 0 i cookies length i if cookies i get name equals web env cookie info return properties decode cookies i get value return new properties getcookieproprties httpservletrequest getcookies getname webenv cookie_info propertiesdecode getvalue get string parameter param request request param parameter parameter return string or null public static string get parameter http servlet request request string parameter if request null parameter null return null string enc request get character encoding try if enc null request set character encoding web env encoding enc request get character encoding catch exception e log log level severe set character encoding web env encoding e enc request get character encoding string data request get parameter parameter if data null data length 0 return data convert if enc null web env encoding equals enc try string data enc new string data get bytes enc web env encoding log log level finer convert data enc data enc web env encoding data data enc catch exception e log log level severe convert data enc web env encoding convert 000 to character jstl input string in str data string buffer out str new string buffer int i in str index of while i 1 out str append in str substring 0 i up to in str in str substring i 2 in str length from int j in str index of next if j 0 no second tag in str in str break string token in str substring 0 j try int int token integer parse int token out str append char int token replace context catch exception e log log level severe token token e out str append append token append in str in str substring j 1 in str length from i in str index of out str append in str add remainder string ret value out str to string string buffer debug new string buffer char cc data to char array for int j 0 j cc length j debug append cc j int iii int cc j debug append append iii append log finest parameter data ret value debug log finest parameter data ret value return ret value getparameter httpservletrequest getcharacterencoding setcharacterencoding webenv getcharacterencoding characterencoding webenv getcharacterencoding getparameter webenv dataenc getbytes webenv dataenc webenv dataenc webenv instr stringbuffer outstr stringbuffer instr indexof outstr instr instr instr instr instr indexof instr instr instr inttoken parseint outstr inttoken outstr instr instr instr instr indexof outstr instr retvalue outstr tostring stringbuffer stringbuffer tochararray retvalue retvalue retvalue get integer parameter 0 if not defined param request request param parameter parameter return int result or 0 public static int get parameter as int http servlet request request string parameter if request null parameter null return 0 string data get parameter request parameter if data null data length 0 return 0 try return integer parse int data catch exception e log warning parameter data e return 0 getparameterasint httpservletrequest getparameter parseint get numeric parameter 0 if not defined param request request param parameter parameter return big decimal result or 0 public static big decimal get parameter asbd http servlet request request string parameter if request null parameter null return env zero string data get parameter request parameter if data null data length 0 return env zero try return new big decimal data catch exception e try decimal format format display type get number format display type number object oo format parse object data if oo instanceof big decimal return big decimal oo else if oo instanceof number return new big decimal number oo double value return new big decimal oo to string catch exception e log fine parameter data e return env zero bigdecimal getparameterasbd httpservletrequest getparameter bigdecimal decimalformat displaytype getnumberformat displaytype parseobject bigdecimal bigdecimal bigdecimal doublevalue bigdecimal tostring get date parameter null if not defined date portion only param request request param parameter parameter return timestamp result or null public static timestamp get parameter as date http servlet request request string parameter return get parameter as date request parameter null getparameterasdate httpservletrequest getparameterasdate get date parameter null if not defined date portion only param request request param parameter parameter param language optional language return timestamp result or null public static timestamp get parameter as date http servlet request request string parameter language language if request null parameter null return null string data get parameter request parameter if data null data length 0 return null language date format if language null try date format format display type get date format display type date language java util date date format parse data if date null return new timestamp date get time catch exception e default simple date format try simple date format format display type get date format display type date java util date date format parse data if date null return new timestamp date get time catch exception e jdbc format try return timestamp value of data catch exception e log warning parameter cannot parse data return null getparameterasdate httpservletrequest getparameter dateformat displaytype getdateformat displaytype gettime simpledateformat displaytype getdateformat displaytype gettime valueof get boolean parameter param request request param parameter parameter return true if found public static boolean get parameter as boolean http servlet request request string parameter return get parameter as boolean request parameter null getparameterasboolean httpservletrequest getparameterasboolean get boolean parameter param request request param parameter parameter param expected optional expected value return true if found and if optional value matches public static boolean get parameter as boolean http servlet request request string parameter string expected if request null parameter null return false string data get parameter request parameter if data null data length 0 return false ignore actual value if expected null return true return expected equals ignore case data getparameterasboolean httpservletrequest getparameter equalsignorecase create standard response header with optional cookie and print document d j2sdk1 4 0 docs guide intl encoding doc html param request request param response response param servlet servlet param cookie properties cookie properties param doc doc param debug debug throws io exception public static void create response http servlet request request http servlet response response http servlet servlet properties cookie properties web doc doc boolean debug throws io exception response set header cache control no cache response set content type text html charset utf 8 update cookie overwrite if cookie properties null cookie cookie new cookie web env cookie info properties encode cookie properties cookie set comment a dempiere cookie set secure false cookie set path if cookie properties size 0 cookie set max age 0 delete cookie else cookie set max age 2592000 30 days in seconds 60 60 24 30 response add cookie cookie add diagnostics if debug web env debug doc output system out web env add footer request response servlet doc get body doc output system out string content doc to string response set content length content length causes problems at the end of the output print document print writer out response get writer with character encoding support doc output out out flush if out check error log log level severe error writing binary output is faster but does not do character set conversion output stream out response get output stream byte data doc to string get bytes response set content length data length out write doc to string get bytes out close cookieproperties ioexception createresponse httpservletrequest httpservletresponse httpservlet cookieproperties webdoc ioexception setheader setcontenttype cookieproperties webenv cookie_info propertiesencode cookieproperties setcomment adempiere setsecure setpath cookieproperties setmaxage setmaxage addcookie webenv webenv addfooter getbody tostring setcontentlength printwriter getwriter checkerror outputstream getoutputstream tostring getbytes setcontentlength tostring getbytes create java script to clear target frame param target frame target frame return clear frame script public static script get clear frame string target frame string buffer cmd new string buffer cmd append clear frame n append var d parent append target frame append document n append d open n append d write link href append web env get stylesheeturl append rel stylesheet n append d close n append clear frame return new script cmd to string targetframe getclearframe targetframe stringbuffer stringbuffer targetframe webenv getstylesheeturl tostring return a link and script with new location param url forward url param delay sec delay in seconds default 3 return html public static html code get forward string url int delay sec if delay sec 0 delay sec 3 html code ret value new html code link a a new a url a add element url ret value add element a java script document location script script new script set timeout window top location replace url delay sec 1000 ret value add element script return ret value delaysec htmlcode getforward delaysec delaysec delaysec htmlcode retvalue htmlcode addelement retvalue addelement settimeout delaysec retvalue addelement retvalue create forward page param response response param title page title param forwardurl url param delay sec delay in seconds default 3 throws servlet exception throws io exception public static void create forward page http servlet response response string title string forwardurl int delay sec throws servlet exception io exception response set content type text html charset utf 8 web doc doc web doc create title body b doc get body b add element get forward forwardurl delay sec print writer out response get writer doc output out out flush if out check error log log level severe error writing out close log fine forwardurl title delaysec servletexception ioexception createforwardpage httpservletresponse delaysec servletexception ioexception setcontenttype webdoc webdoc getbody addelement getforward delaysec printwriter getwriter checkerror does test exist param test string return true if string with data public static boolean exists string test if test null return false return test length 0 does parameter exist param request request param parameter string return true if string with data public static boolean exists http servlet request request string parameter if request null parameter null return false try string enc request get character encoding if enc null request set character encoding web env encoding catch exception e log log level severe set character encoding web env encoding e return exists request get parameter parameter httpservletrequest getcharacterencoding setcharacterencoding webenv characterencoding webenv getparameter is e mail address valid param email mail address return true if valid public static boolean is email valid string email if email null email length 0 return false try internet address ia new internet address email true return true catch address exception ex log warning email ex get localized message return false email isemailvalid internetaddress internetaddress addressexception getlocalizedmessage decode properties into string url encoded param pp properties return encoded string public static string properties encode properties pp byte array output stream bos new byte array output stream try pp store bos a dempiere header catch io exception e log log level severe store e string result new string bos to byte array system out println string result try result url encoder encode result web env encoding catch unsupported encoding exception e log log level severe encode web env encoding e string enc system get property file encoding windows default is cp1252 try result url encoder encode result enc log info encode enc catch exception ex log log level severe encode ex system out println string encoded result return result propertiesencode bytearrayoutputstream bytearrayoutputstream adempiere ioexception tobytearray urlencoder webenv unsupportedencodingexception webenv getproperty urlencoder decode data string url encoded into properties param data data return properties public static properties properties decode string data string result null system out println string data try result url decoder decode data web env encoding catch unsupported encoding exception e log log level severe decode web env encoding e string enc system get property file encoding windows default is cp1252 try result url encoder encode data enc log log level severe decode enc catch exception ex log log level severe decode ex system out println string decoded result byte array input stream bis new byte array input stream result get bytes properties pp new properties try pp load bis catch io exception e log log level severe load e return pp propertiesdecode urldecoder webenv unsupportedencodingexception webenv getproperty urlencoder bytearrayinputstream bytearrayinputstream getbytes ioexception convert array of name pair to http option array p if the array list does not contain name pairs the string value is used see org compiere util name pair param list array list containing name pair values param default id sets the default if the key id value is found if the value is null or empty the first value is selected return option array public static option convert to option name pair list string default id int size list length option ret value new option size for int i 0 i size i boolean selected false select first entry if i 0 default id null default id length 0 selected true create option string name util maskhtml list i get name ret value i new option list i getid add element name select if id key is same as default id if default id null default id equals list i getid selected true ret value i set selected selected return ret value namepair arraylist namepairs namepair arraylist namepair default_id converttooption namepair default_id retvalue default_id default_id getname retvalue addelement default_id default_id retvalue setselected retvalue create label field table row param line null for new line table row param formname form name param parameter parameter name param label text label param input type html input type param value data value param size display display size param size data size param long field field spanning two columns param mandatory mark as mandatory param on change on change call param script script return tr table row static public tr create field tr line string formname string parameter string label text string input type object value int size display int size boolean long field boolean mandatory string on change string buffer script if line null line new tr string label info label text if mandatory label info nbsp font color red font string f name document formname parameter script append f name append required true label llabel new label set for parameter add element label info llabel setid id parameter label label set title description line add element new td add element llabel set align align type right input iinput new input input type parameter value null value to string iinput set size size display set maxlength size iinput setid id parameter if on change null on change length 0 iinput set on change on change iinput set title label text td field new td add element iinput set align align type left if long field field set col span 3 line add element field return line labeltext inputtype sizedisplay longfield onchange onchange createfield labeltext inputtype sizedisplay longfield onchange stringbuffer labelinfo labeltext labelinfo fname fname setfor addelement labelinfo id_ _label settitle addelement addelement setalign aligntype inputtype tostring setsize sizedisplay setmaxlength id_ onchange onchange setonchange onchange settitle labeltext addelement setalign aligntype longfield setcolspan addelement get close pop up buton return button public static input create close popup button input close new input input type button close popup close close set title close pop up help close set on click close popup return false return close popup createclosepopupbutton type_button closepopup settitle popup setonclick closepopup stream attachment entry param response response param attachment attachment param attachment index logical index return error message or null public static string stream attachment http servlet response response m attachment attachment int attachment index if attachment null return no attachment int real index 1 m attachment entry entries attachment get entries for int i 0 i entries length i m attachment entry entry entries i if entry get index attachment index real index i break if real index 0 log fine no attachment entry for index attachment index attachment return attachment entry not found m attachment entry entry entries real index if entry get data null log fine empty attachment entry for index attachment index attachment return attachment entry empty stream attachment entry try int buffer size 2048 2k buffer int file length entry get data length response set content type entry get content type response set buffer size buffer size response set content length file length log fine entry to string long time system current time millis timer start servlet output stream out response get output stream out write entry get data out flush out close time system current time millis time double speed file length 1024 double time 1000 log info length file length time ms speed kb sec entry get content type catch io exception ex log log level severe ex to string return streaming error ex return null attachmentindex streamattachment httpservletresponse mattachment attachmentindex realindex mattachmententry getentries mattachmententry getindex attachmentindex realindex realindex attachmentindex mattachmententry realindex getdata attachmentindex buffersize filelength getdata setcontenttype getcontenttype setbuffersize buffersize setcontentlength filelength tostring currenttimemillis servletoutputstream getoutputstream getdata currenttimemillis filelength filelength getcontenttype ioexception tostring stream file param response response param file file to stream return error message or null public static string stream file http servlet response response file file if file null return no file if file exists return file not found file get absolute path mime type mime type mime type get file get absolute path stream file try int buffer size 2048 2k buffer int file length int file length response set content type mime type get mime type response set buffer size buffer size response set content length file length log fine file to string long time system current time millis timer start get data file input stream in new file input stream file servlet output stream out response get output stream int c 0 while c in read 1 out write c out flush out close in close time system current time millis time double speed file length 1024 double time 1000 log info length file length time ms speed kb sec mime type catch io exception ex log log level severe ex to string return streaming error ex return null streamfile httpservletresponse getabsolutepath mimetype mimetype mimetype getabsolutepath buffersize filelength setcontenttype mimetype getmimetype setbuffersize buffersize setcontentlength filelength tostring currenttimemillis fileinputstream fileinputstream servletoutputstream getoutputstream currenttimemillis filelength filelength mimetype ioexception tostring standard constructor public x ad replication properties ctx int ad replication id string trx name super ctx ad replication id trx name if ad replication id 0 setad replicationstrategy id 0 setad replication id 0 set host address null set host port 0 80 set isrm ioverhttp true y set name null setremote client id 0 setremote org id 0 x_ad_replication ad_replication_id trxname ad_replication_id trxname ad_replication_id setad_replicationstrategy_id setad_replication_id sethostaddress sethostport setisrmioverhttp setname setremote_client_id setremote_org_id load constructor public x ad replication properties ctx result set rs string trx name super ctx rs trx name x_ad_replication resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad replication append get id append return sb to string tostring stringbuffer stringbuffer x_ad_replication get_id tostring set replication strategy data replication strategy public void setad replicationstrategy id int ad replicationstrategy id if ad replicationstrategy id 1 throw new illegal argument exception ad replicationstrategy id is mandatory set value ad replicationstrategy id new integer ad replicationstrategy id setad_replicationstrategy_id ad_replicationstrategy_id ad_replicationstrategy_id illegalargumentexception ad_replicationstrategy_id set_value ad_replicationstrategy_id ad_replicationstrategy_id get replication strategy data replication strategy public int getad replicationstrategy id integer ii integer get value ad replicationstrategy id if ii null return 0 return ii int value getad_replicationstrategy_id get_value ad_replicationstrategy_id intvalue set replication data replication target public void setad replication id int ad replication id if ad replication id 1 throw new illegal argument exception ad replication id is mandatory set valuenocheck ad replication id new integer ad replication id setad_replication_id ad_replication_id ad_replication_id illegalargumentexception ad_replication_id set_valuenocheck ad_replication_id ad_replication_id get replication data replication target public int getad replication id integer ii integer get value ad replication id if ii null return 0 return ii int value getad_replication_id get_value ad_replication_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set valuenocheck date last run date last run setdatelastrun datelastrun set_valuenocheck datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set host address host address url or dns public void set host address string host address if host address null throw new illegal argument exception host address is mandatory if host address length 60 log warning length 60 truncated host address host address substring 0 59 set value host address host address sethostaddress hostaddress hostaddress illegalargumentexception hostaddress hostaddress hostaddress hostaddress set_value hostaddress hostaddress get host address host address url or dns public string get host address return string get value host address gethostaddress get_value hostaddress set host port host communication port public void set host port int host port set value host port new integer host port sethostport hostport set_value hostport hostport get host port host communication port public int get host port integer ii integer get value host port if ii null return 0 return ii int value gethostport get_value hostport intvalue set id range end end if the id range used public void setid range end big decimal id range end set value id range end id range end setidrangeend bigdecimal idrangeend set_value idrangeend idrangeend get id range end end if the id range used public big decimal getid range end big decimal bd big decimal get value id range end if bd null return env zero return bd bigdecimal getidrangeend bigdecimal bigdecimal get_value idrangeend set id range start start of the id range used public void setid range start big decimal id range start set value id range start id range start setidrangestart bigdecimal idrangestart set_value idrangestart idrangestart get id range start start of the id range used public big decimal getid range start big decimal bd big decimal get value id range start if bd null return env zero return bd bigdecimal getidrangestart bigdecimal bigdecimal get_value idrangestart set tunnel via http connect to server via http tunnel public void set isrm ioverhttp boolean isrm ioverhttp set value isrm ioverhttp new boolean isrm ioverhttp setisrmioverhttp isrmioverhttp set_value isrmioverhttp isrmioverhttp get tunnel via http connect to server via http tunnel public boolean isrm ioverhttp object oo get value isrm ioverhttp if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrmioverhttp get_value isrmioverhttp booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set prefix prefix before the sequence number public void set prefix string prefix if prefix null prefix length 10 log warning length 10 truncated prefix prefix substring 0 9 set value prefix prefix setprefix set_value get prefix prefix before the sequence number public string get prefix return string get value prefix getprefix get_value set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int remote client id ad reference id 129 set remote client remote client to be used to replicate synchronize data with public void setremote client id int remote client id if remote client id 1 throw new illegal argument exception remote client id is mandatory set valuenocheck remote client id new integer remote client id remote_client_id_ad_reference_id setremote_client_id remote_client_id remote_client_id illegalargumentexception remote_client_id set_valuenocheck remote_client_id remote_client_id get remote client remote client to be used to replicate synchronize data with public int getremote client id integer ii integer get value remote client id if ii null return 0 return ii int value getremote_client_id get_value remote_client_id intvalue public static final int remote org id ad reference id 276 set remote organization remote organization to be used to replicate synchronize data with public void setremote org id int remote org id if remote org id 1 throw new illegal argument exception remote org id is mandatory set valuenocheck remote org id new integer remote org id remote_org_id_ad_reference_id setremote_org_id remote_org_id remote_org_id illegalargumentexception remote_org_id set_valuenocheck remote_org_id remote_org_id get remote organization remote organization to be used to replicate synchronize data with public int getremote org id integer ii integer get value remote org id if ii null return 0 return ii int value getremote_org_id get_value remote_org_id intvalue set suffix suffix after the number public void set suffix string suffix if suffix null suffix length 10 log warning length 10 truncated suffix suffix substring 0 9 set value suffix suffix setsuffix set_value get suffix suffix after the number public string get suffix return string get value suffix getsuffix get_value get m image from cache param ctx context param ad image id id return m image public static m image get properties ctx int ad image id integer key new integer ad image id m image ret value m image s cache get key if ret value null return ret value ret value new m image ctx ad image id null if ret value get id 0 s cache put key ret value return ret value mimage ad_image_id mimage mimage ad_image_id ad_image_id mimage retvalue mimage s_cache retvalue retvalue retvalue mimage ad_image_id retvalue get_id s_cache retvalue retvalue constructor param ctx context param ad image id image public m image properties ctx int ad image id string trx name super ctx ad image id trx name if ad image id 1 set name ad_image_id mimage ad_image_id trxname ad_image_id trxname ad_image_id setname load constructor param ctx param rs public m image properties ctx result set rs string trx name super ctx rs trx name mimage resultset trxname trxname get image return image or null public image get image url url geturl if url null return null toolkit tk toolkit get default toolkit return tk get image url getimage getdefaulttoolkit getimage get icon return icon or null public icon get icon url url geturl if url null return null return new image icon url geticon imageicon get url return url or null private url geturl string str get imageurl if str null str length 0 return null url url null try try url directly if str index of 1 url new url str else try resource url get class get resource str if url null log warning not found str catch exception e log warning not found str e get message return url getimageurl indexof getclass getresource getmessage string representation return string public string to string return m image id get id name get name tostring mimage get_id getname standard constructor public x c job properties ctx int c job id string trx name super ctx c job id trx name if c job id 0 setc jobcategory id 0 setc job id 0 set is employee true y set name null x_c_job c_job_id trxname c_job_id trxname c_job_id setc_jobcategory_id setc_job_id setisemployee setname load constructor public x c job properties ctx result set rs string trx name super ctx rs trx name x_c_job resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c job append get id append return sb to string tostring stringbuffer stringbuffer x_c_job get_id tostring set position category job position category public void setc jobcategory id int c jobcategory id if c jobcategory id 1 throw new illegal argument exception c jobcategory id is mandatory set value c jobcategory id new integer c jobcategory id setc_jobcategory_id c_jobcategory_id c_jobcategory_id illegalargumentexception c_jobcategory_id set_value c_jobcategory_id c_jobcategory_id get position category job position category public int getc jobcategory id integer ii integer get value c jobcategory id if ii null return 0 return ii int value getc_jobcategory_id get_value c_jobcategory_id intvalue set position job position public void setc job id int c job id if c job id 1 throw new illegal argument exception c job id is mandatory set valuenocheck c job id new integer c job id setc_job_id c_job_id c_job_id illegalargumentexception c_job_id set_valuenocheck c_job_id c_job_id get position job position public int getc job id integer ii integer get value c job id if ii null return 0 return ii int value getc_job_id get_value c_job_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set employee indicates if this business partner is an employee public void set is employee boolean is employee set value is employee new boolean is employee setisemployee isemployee set_value isemployee isemployee get employee indicates if this business partner is an employee public boolean is employee object oo get value is employee if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isemployee get_value isemployee booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get default conversion rate for client org param ad client id client return c conversiontype id or 0 if not found public static int get default int ad client id try cache integer key new integer ad client id integer ii integer s cache get key if ii null return ii int value get from db int c conversiontype id 0 string sql select c conversiontype id from c conversiontype where is active y and ad client id in 0 1 order by is default desc ad client id desc c conversiontype id db getsql value null sql ad client id return s cache put key new integer c conversiontype id return c conversiontype id ad_client_id c_conversiontype_id getdefault ad_client_id ad_client_id s_cache intvalue c_conversiontype_id c_conversiontype_id c_conversiontype isactive ad_client_id isdefault ad_client_id c_conversiontype_id getsqlvalue ad_client_id s_cache c_conversiontype_id c_conversiontype_id standard constructor param ctx context param c conversiontype id id public m conversion type properties ctx int c conversiontype id string trx name super ctx c conversiontype id trx name c_conversiontype_id mconversiontype c_conversiontype_id trxname c_conversiontype_id trxname load constructor param ctx context param rs result set public m conversion type properties ctx result set rs string trx name super ctx rs trx name mconversiontype resultset trxname trxname standard constructor param ctx context param ad accesslog id id public m access log properties ctx int ad accesslog id string trx name super ctx ad accesslog id trx name ad_accesslog_id maccesslog ad_accesslog_id trxname ad_accesslog_id trxname load constructor param ctx context param rs result set public m access log properties ctx result set rs string trx name super ctx rs trx name maccesslog resultset trxname trxname new constructor param ctx context public m access log properties ctx string remote host string remote addr string text msg string trx name this ctx 0 trx name setremote addr remote addr setremote host remote host set text msg text msg maccesslog remote_host remote_addr textmsg trxname trxname setremote_addr remote_addr setremote_host remote_host settextmsg textmsg discontinue public m access log properties ctx string remote host string remote addr string text msg this ctx remote host remote addr text msg null maccesslog remote_host remote_addr textmsg remote_host remote_addr textmsg new constructor param ctx context public m access log properties ctx int ad table id int ad column id int record id string trx name this ctx 0 trx name setad table id ad table id setad column id ad column id setrecord id record id maccesslog ad_table_id ad_column_id record_id trxname trxname setad_table_id ad_table_id setad_column_id ad_column_id setrecord_id record_id public class aqua theme extends default metal theme public string get name return aqua aquatheme defaultmetaltheme getname private final colorui resource primary3 new colorui resource 159 235 235 protected colorui resource get primary1 return primary1 coloruiresource coloruiresource coloruiresource getprimary1 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 coloruiresource getprimary1 coloruiresource getprimary2 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 protected colorui resource get primary3 return primary3 coloruiresource getprimary1 coloruiresource getprimary2 coloruiresource getprimary3 standard constructor param ctx context param ad workflowprocessorlog id id public m workflow processor log properties ctx int ad workflowprocessorlog id string trx name super ctx ad workflowprocessorlog id trx name if ad workflowprocessorlog id 0 set is error false ad_workflowprocessorlog_id mworkflowprocessorlog ad_workflowprocessorlog_id trxname ad_workflowprocessorlog_id trxname ad_workflowprocessorlog_id setiserror load constructor param ctx context param rs result set public m workflow processor log properties ctx result set rs string trx name super ctx rs trx name mworkflowprocessorlog resultset trxname trxname parent constructor param parent parent param summary summary public m workflow processor log m workflow processor parent string summary this parent get ctx 0 parent get trxname set client org parent setad workflowprocessor id parent getad workflowprocessor id set summary summary mworkflowprocessorlog mworkflowprocessor getctx get_trxname setclientorg setad_workflowprocessor_id getad_workflowprocessor_id setsummary persistency constructor param ctx context param ignored ignored public m attribute instance properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mattributeinstance trxname trxname illegalargumentexception load cosntructor param ctx context param rs result set public m attribute instance properties ctx result set rs string trx name super ctx rs trx name mattributeinstance resultset trxname trxname string value constructior param ctx context param m attribute id attribute param m attributesetinstance id instance param value string value public m attribute instance properties ctx int m attribute id int m attributesetinstance id string value string trx name super ctx 0 trx name setm attribute id m attribute id setm attributesetinstance id m attributesetinstance id set value value m_attribute_id m_attributesetinstance_id mattributeinstance m_attribute_id m_attributesetinstance_id trxname trxname setm_attribute_id m_attribute_id setm_attributesetinstance_id m_attributesetinstance_id setvalue number value constructior param ctx context param m attribute id attribute param m attributesetinstance id instance param bd value number value public m attribute instance properties ctx int m attribute id int m attributesetinstance id big decimal bd value string trx name super ctx 0 trx name setm attribute id m attribute id setm attributesetinstance id m attributesetinstance id set value number bd value m_attribute_id m_attributesetinstance_id bdvalue mattributeinstance m_attribute_id m_attributesetinstance_id bigdecimal bdvalue trxname trxname setm_attribute_id m_attribute_id setm_attributesetinstance_id m_attributesetinstance_id setvaluenumber bdvalue selection value constructior param ctx context param m attribute id attribute param m attributesetinstance id instance param m attributevalue id selection param value string representation for fast display public m attribute instance properties ctx int m attribute id int m attributesetinstance id int m attributevalue id string value string trx name super ctx 0 trx name setm attribute id m attribute id setm attributesetinstance id m attributesetinstance id setm attributevalue id m attributevalue id set value value m_attribute_id m_attributesetinstance_id m_attributevalue_id mattributeinstance m_attribute_id m_attributesetinstance_id m_attributevalue_id trxname trxname setm_attribute_id m_attribute_id setm_attributesetinstance_id m_attributesetinstance_id setm_attributevalue_id m_attributevalue_id setvalue set value number param value number number public void set value number big decimal value number super set value number value number if value number null set value null return if value number signum 0 set value 0 return display number w o decimal 0 char chars value number to string to char array string buffer display new string buffer boolean add false for int i chars length 1 i 0 i char c chars i if add display insert 0 c else if c 0 continue else if c decimal point add true else display insert 0 c add true set value display to string valuenumber valuenumber setvaluenumber bigdecimal valuenumber setvaluenumber valuenumber valuenumber setvalue valuenumber setvalue valuenumber tostring tochararray stringbuffer stringbuffer setvalue tostring string representation return info public string to string return get value tostring getvalue return first remit location of b partner c bpartner remitlocation bpartner remit location param p c bpartner id business partner return remit to location public static int remit location int p c bpartner id throws sql exception int c location id 0 string sql select is remit to c location id from c bpartner location where c bpartner id order by is remit to desc prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c bpartner id result set rs pstmt execute query if rs next c location id rs get int 2 rs close pstmt close return c location id bpartner c_bpartner_remitlocation bpartnerremitlocation p_c_bpartner_id remitlocation p_c_bpartner_id sqlexception c_location_id isremitto c_location_id c_bpartner_location c_bpartner_id isremitto preparedstatement preparestatement setint p_c_bpartner_id resultset executequery c_location_id getint c_location_id amtinwords th 0 23 23 100 1 23 23 100 11 45 45 100 121 45 45 100 1231 56 56 100 12341 78 78 100 123451 89 89 100 12234571 90 90 100 123234571 90 90 100 1987234571 90 90 100 11123234571 90 90 100 123123234571 90 90 100 2123123234571 90 90 100 23 123 123 234 571 90 90 100 100 000 000 000 000 90 90 100 0 00 00 100 public amtinwords th super amtinwords_th amtinwords_th convert less than one thousand param number return amt private string convert less than one million int number string so far esta dentro de los 1os diecinueve iscap if number 100 20 so far num names number 100 number 100 else so far num names number 10 if number 1 so far equals u0e2b u0e19 u0e36 u0e48 u0e07 so far u0e40 u0e2d u0e47 u0e14 number 10 so far tens names number 10 so far number 10 so far hundred names number 10 so far number 10 so far thousand names number 10 so far number 10 so far ten thousand names number 10 so far number 10 so far hundred thousand names number 10 so far number 10 if number 0 return so far return num names number u0e23 u0e49 u0e2d u0e22 u0e25 u0e49 u0e32 u0e19 so far convertlessthanonemillion sofar sofar numnames sofar numnames sofar sofar sofar tensnames sofar sofar hundrednames sofar sofar thousandnames sofar sofar tenthousandnames sofar sofar hundredthousandnames sofar sofar numnames sofar convert param number return amt private string convert double number special case if number 0 return u0e28 u0e39 u0e19 u0e22 u0e4c string prefix string subfix u0e1a u0e32 u0e17 if number 0 number number prefix u0e25 u0e1a string so far int place 0 do double d number 1000000 int n int d if n 0 string s convert less than one million n place place 0 1 0 so far s major names place so far place number 1000000d while number 0 return prefix so far subfix trim sofar convertlessthanonemillion sofar majornames sofar sofar get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 public string get amt in words string amount throws exception if amount null return amount string buffer sb new string buffer double pos double amount last index of double pos2 double amount last index of if pos2 pos pos pos2 string oldamt amount amount amount replace all int newpos amount last index of double pesos double parse double amount substring 0 newpos sb append convert pesos for int i 0 i oldamt length i if pos i we are done string cents oldamt substring i 1 sb append append cents append 100 break return sb to string getamtinwords stringbuffer stringbuffer lastindexof lastindexof replaceall lastindexof parsedouble tostring test print param amt amount private void print string amt try system out println amt get amt in words amt catch exception e e print stack trace getamtinwords printstacktrace test param args ignored public static void main string args amtinwords th aiw new amtinwords th aiw print 23 error aiw print 0 23 aiw print 1 23 aiw print 11 45 aiw print 121 45 aiw print 1231 56 aiw print 12341 78 aiw print 123451 89 aiw print 12234571 90 aiw print 123234571 90 aiw print 1987234571 90 aiw print 11123234571 90 aiw print 123123234571 90 aiw print 2123123234571 90 aiw print 23 123 123 234 571 90 aiw print 100 000 000 000 000 90 aiw print 0 00 amtinwords_th amtinwords_th basic constructor public element attributes elementattributes set the character used to quote attributes param quote char character used to quote attributes public element set attribute quote char char quote char attribute quote char quote char return this quote_char setattributequotechar quote_char attribute_quote_char quote_char get the character used to quote attributes public char get attribute quote char return attribute quote char getattributequotechar attribute_quote_char set the equality sign for an attribute param equality sign the equality sign used for attributes public element set attribute equality sign char equality sign attribute equality sign equality sign return this equality_sign setattributeequalitysign equality_sign attribute_equality_sign equality_sign get the equality sign for an attribute public char get attribute equality sign return attribute equality sign getattributeequalitysign attribute_equality_sign do we surround attributes with qoutes public boolean get attribute quote return attribute quote getattributequote attribute_quote set wether or not we surround the attributes with quotes public element set attribute quote boolean attribute quote this attribute quote attribute quote return this setattributequote attribute_quote attribute_quote attribute_quote set the element id for cascading style sheets public element setid string id add attribute id id return this addattribute set the element class for cascading style sheets public element set class string element class add attribute class element class return this setclass element_class addattribute element_class sets the lang attribute param lang the lang attribute public element set lang string lang add attribute lang lang return this setlang addattribute sets the style attribute param style the style attribute public element set style string style add attribute style style return this setstyle addattribute sets the dir attribute param dir the dir attribute public element set dir string dir add attribute dir dir return this setdir addattribute sets the title attribute param title the title attribute public element set title string title add attribute title title return this settitle addattribute find out if we want to filter the elements attributes or not protected boolean get attribute filter state return filter attribute state getattributefilterstate filter_attribute_state tell the element if we want to filter its attriubtes param filter attribute state do we want to filter the attributes of this element public element set attribute filter state boolean filter attribute state this filter attribute state filter attribute state return this filter_attribute_state setattributefilterstate filter_attribute_state filter_attribute_state filter_attribute_state set up a new filter for all element attributes param filter the filter we want to use for element attributes by br default it is the same as is used for the value of the tag it is assumed br that if you create a new filter you must want to use it public element set attribute filter filter attribute filter filter attribute state true if your setting up a filter you must want to filter this attribute filter attribute filter return this setattributefilter attribute_filter filter_attribute_state attribute_filter attribute_filter get the filter for all element attributes param filter the filter we want to use for element attributes by br default it is the same as is used for the value of the tag it is assumed br that if you create a new filter you must want to use it public filter get attribute filter return this attribute filter getattributefilter attribute_filter add an attribute to the element public element add attribute string attribute name object attribute value get element hash entry put attribute name attribute value return this addattribute attribute_name attribute_value getelementhashentry attribute_name attribute_value add an attribute to the element public element add attribute string attribute name int attribute value get element hash entry put attribute name new integer attribute value return this addattribute attribute_name attribute_value getelementhashentry attribute_name attribute_value add an attribute to the element public element add attribute string attribute name string attribute value if attribute name null attribute value null get element hash entry put attribute name attribute value return this addattribute attribute_name attribute_value attribute_name attribute_value getelementhashentry attribute_name attribute_value add an attribute to the element public element add attribute string attribute name integer attribute value get element hash entry put attribute name attribute value return this addattribute attribute_name attribute_value getelementhashentry attribute_name attribute_value remove an attribute from the element public element remove attribute string attribute name try get element hash entry remove attribute name catch exception e return this removeattribute attribute_name getelementhashentry attribute_name does the element have a particular attribute public boolean has attribute string attribute return get element hash entry contains key attribute hasattribute getelementhashentry containskey return a list of the attributes associated with this element public enumeration attributes return get element hash entry keys getelementhashentry return the specified attribute param attribute the name of the attribute to fetch public string get attribute string attribute return string get element hash entry get attribute getattribute getelementhashentry this method overrides create start tag in generic element it provides a way to print out the attributes of an element protected string create start tag string buffer out new string buffer out append get start tag char if get begin start modifier defined out append get begin start modifier out append get element type enumeration en get element hash entry keys string value null avoid creating a new string object on each pass through the loop while en has more elements string attr string en next element if get attribute filter state value get attribute filter process get element hash entry get attr to string else value string get element hash entry get attr out append out append alter case attr if value equals ignore case no attribute value get attribute quote out append get attribute equality sign out append get attribute quote char out append value out append get attribute quote char else if get attribute quote out append get attribute equality sign out append value if get begin end modifier defined out append get begin end modifier out append get end tag char return out to string createstarttag createstarttag stringbuffer stringbuffer getstarttagchar getbeginstartmodifierdefined getbeginstartmodifier getelementtype getelementhashentry hasmoreelements nextelement getattributefilterstate getattributefilter getelementhashentry tostring getelementhashentry altercase equalsignorecase no_attribute_value getattributequote getattributeequalitysign getattributequotechar getattributequotechar getattributequote getattributeequalitysign getbeginendmodifierdefined getbeginendmodifier getendtagchar tostring load system record param ctx context return system public static m system get properties ctx if s system null return s system string sql select from ad system order by ad system id 0 first prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next s system new m system ctx rs null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if ini is client s system set info s system save return s system msystem s_system s_system ad_system ad_system_id preparedstatement preparestatement resultset executequery s_system msystem sqlexception s_log sqlexception isclient s_system setinfo s_system s_system default constructor param ctx context param ignored id public m system properties ctx int ignored string mtrx name super ctx 0 mtrx name string trx name null load trx name load id 0 if s system null s system this msystem mtrxname mtrxname trxname trxname s_system s_system load constructor param ctx context param rs result set public m system properties ctx result set rs string trx name super ctx rs trx name if s system null s system this msystem resultset trxname trxname s_system s_system constructor public m system this new properties 0 null msystem is ldap authentification defined return true if ldap defined public boolean isldap string host getldap host if host null host length 0 return false string domain getldap domain return domain null domain length 0 getldaphost getldapdomain ldap authentification assumes that ldap is defined param user name user name param password password return true if ldap authenticated public boolean isldap string user name string password return ldap validate getldap host getldap domain user name password username username getldaphost getldapdomain username get db address return address public string getdb address string s super getdb address if s null s length 0 s c connection get get connectionurl return s getdbaddress getdbaddress cconnection getconnectionurl get statistics info param recalc recalculate return statistics public string get statistics info boolean recalc string s super get statistics info if s null recalc string sql select c select count from ad client u select count from ad user b select count from c bpartner p select count from m product i select count from c invoice m select count from m transaction from ad system prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next s rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return s getstatisticsinfo getstatisticsinfo ad_client ad_user c_bpartner m_product c_invoice m_transaction ad_system preparedstatement preparestatement resultset executequery getstring get profile info param recalc recalculate return profile public string get profile info boolean recalc string s super get profile info if s null recalc string sql select value from ad client where is active y order by ad client id desc prepared statement pstmt null string buffer sb new string buffer try pstmt db prepare statement sql null result set rs pstmt execute query while rs next sb append rs get string 1 append rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s sb to string return s getprofileinfo getprofileinfo ad_client isactive ad_client_id preparedstatement stringbuffer stringbuffer preparestatement resultset executequery getstring tostring before save param new record new return true false protected boolean before save boolean new record mandatory values if get value is auto error report null set is auto error report true boolean user change ini is client is valuechanged name is valuechanged name is valuechanged user name is valuechanged password is valuechanged ldap host is valuechanged ldap domain is valuechanged custom prefix if user change if get name equals get name length 2 log save error error define a unique system name e g company name return false if get user name equals get user name length 2 log save error error use the same e mail address as in the a dempiere web store return false if get password equals get password length 2 log save error error use the same password as in the a dempiere web store return false set info return true newrecord beforesave newrecord get_value isautoerrorreport setisautoerrorreport userchange isclient is_valuechanged is_valuechanged is_valuechanged username is_valuechanged is_valuechanged ldaphost is_valuechanged ldapdomain is_valuechanged customprefix userchange getname getname saveerror getusername getusername saveerror email adempiere getpassword getpassword saveerror adempiere setinfo save record id 0 return true if saved public boolean save if before save false return false return save update beforesave saveupdate string representation return info public string to string return m system get name user get user name release no get release no tostring msystem getname getusername releaseno getreleaseno check valididity return true if valid public boolean is valid if get name null get name length 2 log log level warning name not valid get name return false if get password null get password length 2 log log level warning password not valid get password return false if get info null get info length 2 log log level warning need to run migration once return false return true isvalid getname getname getname getpassword getpassword getpassword getinfo getinfo is there a pdf license return true if there is a pdf license public boolean ispdf license string key get summary return key null key length 25 ispdflicense getsummary set derive info if more then a day old return true if set public boolean set info log severe set info if time util get day get updated before time util get day null return false try setdb info set internal users if is allow statistics set statistics info get statistics info true set profile info get profile info true catch exception e set support units 9999 set info e get localized message log log level severe e return true setinfo setinfo timeutil getday getupdated timeutil getday setdbinfo setinternalusers isallowstatistics setstatisticsinfo getstatisticsinfo setprofileinfo getprofileinfo setsupportunits setinfo getlocalizedmessage set internal user count private void set internal users string sql select count distinct u ad user id as iu from ad user u inner join ad user roles ur on u ad user id ur ad user id where u ad client id 11 no demo and u ad user id not in 0 100 no system super user prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query if rs next int internal users rs get int 1 set support units internal users rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null setinternalusers ad_user_id ad_user ad_user_roles ad_user_id ad_user_id ad_client_id ad_user_id superuser preparedstatement preparestatement resultset executequery internalusers getint setsupportunits internalusers set db info private void setdb info if db is remote objects string db address c connection get get connectionurl setdb address db address to lower case if ini is client int no processors runtime get runtime available processors set no processors no processors string db name null prepared statement pstmt null string sql null try string db type c connection get get database get name sql getdb infosql db type pstmt db prepare statement sql null result set rs pstmt execute query if rs next db address rs get string 1 db name rs get string 2 setdb instance db name to lower case rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null setdbinfo isremoteobjects dbaddress cconnection getconnectionurl setdbaddress dbaddress tolowercase isclient noprocessors getruntime availableprocessors setnoprocessors noprocessors dbname preparedstatement dbtype cconnection getdatabase getname getdbinfosql dbtype preparestatement resultset executequery dbaddress getstring dbname getstring setdbinstance dbname tolowercase get db info sql param db type database type return sql public static string getdb infosql string db type if database db oracle equals db type return select sys context userenv host sys context userenv ip address as db address sys context userenv current user sys context userenv db name sys context userenv db domain as db name from dual return select null null from ad system where ad system id 1 dbtype getdbinfosql dbtype db_oracle dbtype sys_context sys_context ip_address dbaddress sys_context current_user sys_context db_name sys_context db_domain dbname ad_system ad_system_id print info public void info if c log mgt is level fine return os operating systemmx bean os management factory get operating systemmx bean log fine os get name os get version os get arch processors os get available processors runtime runtimemx bean rt management factory get runtimemx bean log fine rt get name rt get vm version up time util format elapsed rt get uptime memory if c log mgt is level finer list memory poolmx bean list management factory get memory poolmx beans iterator it list iterator while it has next memory poolmx bean pool memory poolmx bean it next log finer pool get name pool get type new c memory usage pool get usage else memorymx bean memory management factory get memorymx bean log fine vm new c memory usage memory get non heap memory usage log fine heap new c memory usage memory get heap memory usage thread threadmx bean th management factory get threadmx bean log fine threads th get thread count peak th get peak thread count demons th get daemon thread count total th get total started thread count clogmgt islevelfine operatingsystemmxbean managementfactory getoperatingsystemmxbean getname getversion getarch getavailableprocessors runtimemxbean managementfactory getruntimemxbean getname getvmversion timeutil formatelapsed getuptime clogmgt islevelfiner memorypoolmxbean managementfactory getmemorypoolmxbeans hasnext memorypoolmxbean memorypoolmxbean getname gettype cmemoryusage getusage memorymxbean managementfactory getmemorymxbean cmemoryusage getnonheapmemoryusage cmemoryusage getheapmemoryusage threadmxbean managementfactory getthreadmxbean getthreadcount getpeakthreadcount getdaemonthreadcount gettotalstartedthreadcount test param args public static void main string args new m system msystem default constructor not started public state engine this state notstarted log c logger getc logger get class stateengine state_notstarted clogger getclogger getclass initialized constructor param start state start state public state engine string start state if start state null m state start state startstate stateengine startstate startstate m_state startstate are exception thrown return trie if exceptions thrown public boolean is throw exception return m throwexception isthrowexception m_throwexception set if exceptions are thrown param throw exception boolean public void set throw exception boolean throw exception m throwexception throw exception throwexception setthrowexception throwexception m_throwexception throwexception get state return state public string get state return m state getstate m_state get clear text state info return state info public string get state info string state get state is overwritten to update int ad reference id 305 m ref list get list ad reference id false if state running equals state return running else if state notstarted equals state return not started else if state suspended equals state return suspended else if state completed equals state return completed else if state aborted equals state return aborted else if state terminated equals state return terminated return state getstateinfo getstate ad_reference_id mreflist getlist ad_reference_id state_running state_notstarted state_suspended state_completed state_aborted state_terminated state is open return true if open running not started suspended public boolean is open return state running equals m state state notstarted equals m state state suspended equals m state isopen state_running m_state state_notstarted m_state state_suspended m_state state is not running return true if not running not started suspended public boolean is not running return state notstarted equals m state state suspended equals m state isnotrunning state_notstarted m_state state_suspended m_state state is closed return true if closed completed aborted terminated public boolean is closed return state completed equals m state state aborted equals m state state terminated equals m state isclosed state_completed m_state state_aborted m_state state_terminated m_state state is not started return true if not started public boolean is not started return state notstarted equals m state isnotstarted state_notstarted m_state state is running return true if running public boolean is running return state running equals m state isrunning state_running m_state state is suspended return true if suspended public boolean is suspended return state suspended equals m state issuspended state_suspended m_state state is completed return true if completed public boolean is completed return state completed equals m state iscompleted state_completed m_state state is aborted environment setup issue return true if aborted public boolean is aborted return state aborted equals m state isaborted state_aborted m_state state is terminated execution issue return true if terminated public boolean is terminated return state terminated equals m state isterminated state_terminated m_state start not started running return true if set to running public boolean start if log null log c logger getc logger get class if is not started m state state running log info starting return true string msg start failed not not started get state if m throwexception throw new illegal state exception msg log warning msg return false clogger getclogger getclass isnotstarted m_state state_running getstate m_throwexception illegalstateexception resume suspended running return true if set to sunning public boolean resume raises cannot resume not running not suspended if log null log c logger getc logger get class if is suspended m state state running log info resuming return true string msg resume failed not suspended get state if m throwexception throw new illegal state exception msg log warning msg return false cannotresume notrunning notsuspended clogger getclogger getclass issuspended m_state state_running getstate m_throwexception illegalstateexception suspend running suspended return true if suspended public boolean suspend raises cannot suspend not running already suspended if log null log c logger getc logger get class if is running m state state suspended log info suspending return true string msg suspend failed not running get state if m throwexception throw new illegal state exception msg log warning msg return false cannotsuspend notrunning alreadysuspended clogger getclogger getclass isrunning m_state state_suspended getstate m_throwexception illegalstateexception complete running completed return true if set to completed public boolean complete if log null log c logger getc logger get class if is running m state state completed log info completing return true string msg complete failed not running get state if m throwexception throw new illegal state exception msg log warning msg return false clogger getclogger getclass isrunning m_state state_completed getstate m_throwexception illegalstateexception abort open aborted return true if set to aborted public boolean abort raises cannot stop not running if log null log c logger getc logger get class if is open m state state aborted log info aborting return true string msg abort failed not open get state if m throwexception throw new illegal state exception msg log warning msg return false cannotstop notrunning clogger getclogger getclass isopen m_state state_aborted getstate m_throwexception illegalstateexception terminate open terminated return true if set to terminated public boolean terminate raises cannot stop not running if log null log c logger getc logger get class if is open m state state terminated log info terminating return true string msg terminate failed not open get state if m throwexception throw new illegal state exception msg log warning msg return false cannotstop notrunning clogger getclogger getclass isopen m_state state_terminated getstate m_throwexception illegalstateexception get new state options based on current state return array of new states public string get new state options if is not started return new string state running state aborted state terminated if is running return new string state suspended state completed state aborted state terminated if is suspended return new string state running state aborted state terminated return new string getnewstateoptions isnotstarted state_running state_aborted state_terminated isrunning state_suspended state_completed state_aborted state_terminated issuspended state_running state_aborted state_terminated is the new state valid based on current state param new state new state return true valid new state public boolean is valid new state string new state string options get new state options for int i 0 i options length i if options i equals new state return true return false newstate isvalidnewstate newstate getnewstateoptions newstate set state to new state param new state new state return true if set to new state public boolean set state string new state raises invalid state transition not allowed if state running equals new state if is not started return start else return resume else if state suspended equals new state return suspend else if state completed equals new state return complete else if state aborted equals new state return abort else if state terminated equals new state return terminate return false newstate setstate newstate invalidstate transitionnotallowed state_running newstate isnotstarted state_suspended newstate state_completed newstate state_aborted newstate state_terminated newstate get action options based on current state return array of actions public string get action options if is not started return new string action start action abort action terminate if is running return new string action suspend action complete action abort action terminate if is suspended return new string action resume action abort action terminate return new string getactionoptions isnotstarted action_start action_abort action_terminate isrunning action_suspend action_complete action_abort action_terminate issuspended action_resume action_abort action_terminate is the action valid based on current state param action action return true if valid public boolean is valid action string action string options get action options for int i 0 i options length i if options i equals action return true return false isvalidaction getactionoptions process param action action return true if set to new state public boolean process string action raises invalid state transition not allowed if action start equals action return start else if action complete equals action return complete else if action suspend equals action return suspend else if action resume equals action return resume else if action abort equals action return abort else if action terminate equals action return terminate return false invalidstate transitionnotallowed action_start action_complete action_suspend action_resume action_abort action_terminate get new state if action performed param action action return potential new state public string get new state if action string action if is valid action action if action start equals action return state running else if action complete equals action return state completed else if action suspend equals action return state suspended else if action resume equals action return state running else if action abort equals action return state aborted else if action terminate equals action return state terminated unchanged return get state getnewstateifaction isvalidaction action_start state_running action_complete state_completed action_suspend state_suspended action_resume state_running action_abort state_aborted action_terminate state_terminated getstate string representation return info public string to string return get state info tostring getstateinfo basic constructor public frame basic constructor param element adds an element to the element public frame element element add element element addelement basic constructor param element adds an element to the element public frame string element add element element addelement basic constructor param element adds an element to the element param name the name attribute public frame element element string name add element element set name name addelement setname basic constructor param element adds an element to the element param name the name attribute public frame string element string name add element element set name name addelement setname basic constructor param element adds an element to the element param name the nama attribute param src the src attribute public frame element element string name string src add element element set name name set src src addelement setname setsrc basic constructor param element adds an element to the element param name the name attribute param src the src attribute public frame string element string name string src add element element set name name set src src addelement setname setsrc sets the longdesc attribute param longdesc the longdesc attribute public frame set long desc string longdesc add attribute longdesc longdesc return this setlongdesc addattribute sets the name attribute param name the name attribute public frame set name string name add attribute name name return this setname addattribute sets the src attribute param src the src attribute public frame set src string src add attribute src src return this setsrc addattribute sets the frameborder attribute param frameborder the frameborder attribute public frame set frame border boolean frameborder if frameborder add attribute frameborder integer to string 1 else add attribute frameborder integer to string 0 return this setframeborder addattribute tostring addattribute tostring sets the marginwidth attribute param marginwidth the marginwidth attribute public frame set margin width int marginwidth set margin width integer to string marginwidth return this setmarginwidth setmarginwidth tostring sets the marginwidth attribute param marginwidth the marginwidth attribute public frame set margin width string marginwidth add attribute marginwidth marginwidth return this setmarginwidth addattribute sets the marginheight attribute param marginheight the marginheight attribute public frame set margin height int marginheight set margin height integer to string marginheight return this setmarginheight setmarginheight tostring sets the marginheight attribute param marginheight the marginheight attribute public frame set margin height string marginheight add attribute marginheight marginheight return this setmarginheight addattribute sets the scrolling attribute param scrolling the scrolling attribute public frame set scrolling string scrolling add attribute scrolling scrolling return this setscrolling addattribute sets the noresize value param noresize true or false public frame set no resize boolean noresize if noresize true add attribute noresize noresize else remove attribute noresize return this setnoresize addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public frame add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public frame add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public frame add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public frame add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public frame remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry standard constructor public x ad issue properties ctx int ad issue id string trx name super ctx ad issue id trx name if ad issue id 0 setad issue id 0 set issue summary null set name null set processed false n set release no null set system status null e set user name null set version null x_ad_issue ad_issue_id trxname ad_issue_id trxname ad_issue_id setad_issue_id setissuesummary setname setprocessed setreleaseno setsystemstatus setusername setversion load constructor public x ad issue properties ctx result set rs string trx name super ctx rs trx name x_ad_issue resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad issue append get id append return sb to string tostring stringbuffer stringbuffer x_ad_issue get_id tostring set special form special form public void setad form id int ad form id if ad form id 0 set value ad form id null else set value ad form id new integer ad form id setad_form_id ad_form_id ad_form_id set_value ad_form_id set_value ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue set system issue automatically created or manually entered system issue public void setad issue id int ad issue id if ad issue id 1 throw new illegal argument exception ad issue id is mandatory set valuenocheck ad issue id new integer ad issue id setad_issue_id ad_issue_id ad_issue_id illegalargumentexception ad_issue_id set_valuenocheck ad_issue_id ad_issue_id get system issue automatically created or manually entered system issue public int getad issue id integer ii integer get value ad issue id if ii null return 0 return ii int value getad_issue_id get_value ad_issue_id intvalue set process process or report public void setad process id int ad process id if ad process id 0 set value ad process id null else set value ad process id new integer ad process id setad_process_id ad_process_id ad_process_id set_value ad_process_id set_value ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set valuenocheck a asset id null else set valuenocheck a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_valuenocheck a_asset_id set_valuenocheck a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set comments comments or additional information public void set comments string comments if comments null comments length 2000 log warning length 2000 truncated comments comments substring 0 1999 set value comments comments setcomments set_value get comments comments or additional information public string get comments return string get value comments getcomments get_value set db address jdbc url of the database server public void setdb address string db address if db address null db address length 255 log warning length 255 truncated db address db address substring 0 254 set valuenocheck db address db address setdbaddress dbaddress dbaddress dbaddress dbaddress dbaddress set_valuenocheck dbaddress dbaddress get db address jdbc url of the database server public string getdb address return string get value db address getdbaddress get_value dbaddress set database database information public void set database info string database info if database info null database info length 255 log warning length 255 truncated database info database info substring 0 254 set valuenocheck database info database info setdatabaseinfo databaseinfo databaseinfo databaseinfo databaseinfo databaseinfo set_valuenocheck databaseinfo databaseinfo get database database information public string get database info return string get value database info getdatabaseinfo get_value databaseinfo set error trace system error trace public void set error trace string error trace if error trace null error trace length 2000 log warning length 2000 truncated error trace error trace substring 0 1999 set value error trace error trace seterrortrace errortrace errortrace errortrace errortrace errortrace set_value errortrace errortrace get error trace system error trace public string get error trace return string get value error trace geterrortrace get_value errortrace public static final string isreproducible yes y set reproducible problem can re reproduced in gardenworld public void set is reproducible string is reproducible if is reproducible null throw new illegal argument exception is reproducible is mandatory if is reproducible null is reproducible equals n is reproducible equals y else throw new illegal argument exception is reproducible invalid value is reproducible reference id 319 n y if is reproducible null is reproducible length 1 log warning length 1 truncated is reproducible is reproducible substring 0 0 set value is reproducible is reproducible isreproducible_yes setisreproducible isreproducible isreproducible illegalargumentexception isreproducible isreproducible isreproducible isreproducible illegalargumentexception isreproducible isreproducible reference_id isreproducible isreproducible isreproducible isreproducible set_value isreproducible isreproducible get reproducible problem can re reproduced in gardenworld public string get is reproducible return string get value is reproducible getisreproducible get_value isreproducible public static final string isvanillasystem yes y set vanilla system the system was not compiled from source i e standard distribution public void set is vanilla system string is vanilla system if is vanilla system null throw new illegal argument exception is vanilla system is mandatory if is vanilla system null is vanilla system equals n is vanilla system equals y else throw new illegal argument exception is vanilla system invalid value is vanilla system reference id 319 n y if is vanilla system null is vanilla system length 1 log warning length 1 truncated is vanilla system is vanilla system substring 0 0 set value is vanilla system is vanilla system isvanillasystem_yes setisvanillasystem isvanillasystem isvanillasystem illegalargumentexception isvanillasystem isvanillasystem isvanillasystem isvanillasystem illegalargumentexception isvanillasystem isvanillasystem reference_id isvanillasystem isvanillasystem isvanillasystem isvanillasystem set_value isvanillasystem isvanillasystem get vanilla system the system was not compiled from source i e standard distribution public string get is vanilla system return string get value is vanilla system getisvanillasystem get_value isvanillasystem public static final string issuesource form x set source issue source public void set issue source string issue source if issue source null throw new illegal argument exception issue source is mandatory if issue source null issue source equals b issue source equals f issue source equals p issue source equals r issue source equals t issue source equals w issue source equals x else throw new illegal argument exception issue source invalid value issue source reference id 104 b f p r t w x if issue source null issue source length 1 log warning length 1 truncated issue source issue source substring 0 0 set value issue source issue source issuesource_form setissuesource issuesource issuesource illegalargumentexception issuesource issuesource issuesource issuesource issuesource issuesource issuesource issuesource issuesource illegalargumentexception issuesource issuesource reference_id issuesource issuesource issuesource issuesource set_value issuesource issuesource get source issue source public string get issue source return string get value issue source getissuesource get_value issuesource set issue summary issue summary public void set issue summary string issue summary if issue summary null throw new illegal argument exception issue summary is mandatory if issue summary length 2000 log warning length 2000 truncated issue summary issue summary substring 0 1999 set value issue summary issue summary setissuesummary issuesummary issuesummary illegalargumentexception issuesummary issuesummary issuesummary issuesummary set_value issuesummary issuesummary get issue summary issue summary public string get issue summary return string get value issue summary getissuesummary get_value issuesummary return string get value issue summary public key name pair get key name pair return new key name pair get id get issue summary get_value issuesummary keynamepair getkeynamepair keynamepair get_id getissuesummary set java info java version info public void set java info string java info if java info null java info length 255 log warning length 255 truncated java info java info substring 0 254 set valuenocheck java info java info setjavainfo javainfo javainfo javainfo javainfo javainfo set_valuenocheck javainfo javainfo get java info java version info public string get java info return string get value java info getjavainfo get_value javainfo set line line no public void set line no int line no set value line no new integer line no setlineno lineno set_value lineno lineno get line line no public int get line no integer ii integer get value line no if ii null return 0 return ii int value getlineno get_value lineno intvalue set local host local host info public void setlocal host string local host if local host null local host length 120 log warning length 120 truncated local host local host substring 0 119 set valuenocheck local host local host setlocal_host local_host local_host local_host local_host local_host set_valuenocheck local_host local_host get local host local host info public string getlocal host return string get value local host getlocal_host get_value local_host set logger logger name public void set logger name string logger name if logger name null logger name length 60 log warning length 60 truncated logger name logger name substring 0 59 set value logger name logger name setloggername loggername loggername loggername loggername loggername set_value loggername loggername get logger logger name public string get logger name return string get value logger name getloggername get_value loggername set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set valuenocheck name name setname illegalargumentexception set_valuenocheck get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set operating system operating system info public void set operating system info string operating system info if operating system info null operating system info length 255 log warning length 255 truncated operating system info operating system info substring 0 254 set valuenocheck operating system info operating system info setoperatingsysteminfo operatingsysteminfo operatingsysteminfo operatingsysteminfo operatingsysteminfo operatingsysteminfo set_valuenocheck operatingsysteminfo operatingsysteminfo get operating system operating system info public string get operating system info return string get value operating system info getoperatingsysteminfo get_value operatingsysteminfo set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set profile information to help profiling the system for solving support issues public void set profile info string profile info if profile info null profile info length 255 log warning length 255 truncated profile info profile info substring 0 254 set valuenocheck profile info profile info setprofileinfo profileinfo profileinfo profileinfo profileinfo profileinfo set_valuenocheck profileinfo profileinfo get profile information to help profiling the system for solving support issues public string get profile info return string get value profile info getprofileinfo get_value profileinfo set known issue known issue public void setr issueknown id int r issueknown id if r issueknown id 0 set value r issueknown id null else set value r issueknown id new integer r issueknown id setr_issueknown_id r_issueknown_id r_issueknown_id set_value r_issueknown_id set_value r_issueknown_id r_issueknown_id get known issue known issue public int getr issueknown id integer ii integer get value r issueknown id if ii null return 0 return ii int value getr_issueknown_id get_value r_issueknown_id intvalue set issue project implementation projects public void setr issueproject id int r issueproject id if r issueproject id 0 set value r issueproject id null else set value r issueproject id new integer r issueproject id setr_issueproject_id r_issueproject_id r_issueproject_id set_value r_issueproject_id set_value r_issueproject_id r_issueproject_id get issue project implementation projects public int getr issueproject id integer ii integer get value r issueproject id if ii null return 0 return ii int value getr_issueproject_id get_value r_issueproject_id intvalue set issue system system creating the issue public void setr issuesystem id int r issuesystem id if r issuesystem id 0 set value r issuesystem id null else set value r issuesystem id new integer r issuesystem id setr_issuesystem_id r_issuesystem_id r_issuesystem_id set_value r_issuesystem_id set_value r_issuesystem_id r_issuesystem_id get issue system system creating the issue public int getr issuesystem id integer ii integer get value r issuesystem id if ii null return 0 return ii int value getr_issuesystem_id get_value r_issuesystem_id intvalue set issue user user who reported issues public void setr issueuser id int r issueuser id if r issueuser id 0 set value r issueuser id null else set value r issueuser id new integer r issueuser id issueuser setr_issueuser_id r_issueuser_id r_issueuser_id set_value r_issueuser_id set_value r_issueuser_id r_issueuser_id get issue user user who reported issues public int getr issueuser id integer ii integer get value r issueuser id if ii null return 0 return ii int value issueuser getr_issueuser_id get_value r_issueuser_id intvalue set request request from a business partner or prospect public void setr request id int r request id if r request id 0 set valuenocheck r request id null else set valuenocheck r request id new integer r request id setr_request_id r_request_id r_request_id set_valuenocheck r_request_id set_valuenocheck r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue set record id direct internal record id public void setrecord id int record id if record id 0 set valuenocheck record id null else set valuenocheck record id new integer record id setrecord_id record_id record_id set_valuenocheck record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set release no internal release number public void set release no string release no if release no null throw new illegal argument exception release no is mandatory if release no length 4 log warning length 4 truncated release no release no substring 0 3 set valuenocheck release no release no setreleaseno releaseno releaseno illegalargumentexception releaseno releaseno releaseno releaseno set_valuenocheck releaseno releaseno get release no internal release number public string get release no return string get value release no getreleaseno get_value releaseno set release tag release tag public void set release tag string release tag if release tag null release tag length 60 log warning length 60 truncated release tag release tag substring 0 59 set value release tag release tag setreleasetag releasetag releasetag releasetag releasetag releasetag set_value releasetag releasetag get release tag release tag public string get release tag return string get value release tag getreleasetag get_value releasetag set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set valuenocheck remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_valuenocheck remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 120 log warning length 120 truncated remote host remote host substring 0 119 set valuenocheck remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_valuenocheck remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set request document no compiere request document no public void set request document no string request document no if request document no null request document no length 30 log warning length 30 truncated request document no request document no substring 0 29 set valuenocheck request document no request document no setrequestdocumentno requestdocumentno requestdocumentno requestdocumentno requestdocumentno requestdocumentno set_valuenocheck requestdocumentno requestdocumentno get request document no compiere request document no public string get request document no return string get value request document no getrequestdocumentno get_value requestdocumentno set response text request response text public void set response text string response text if response text null response text length 2000 log warning length 2000 truncated response text response text substring 0 1999 set valuenocheck response text response text setresponsetext responsetext responsetext responsetext responsetext responsetext set_valuenocheck responsetext responsetext get response text request response text public string get response text return string get value response text getresponsetext get_value responsetext set source class source class name public void set source class name string source class name if source class name null source class name length 60 log warning length 60 truncated source class name source class name substring 0 59 set value source class name source class name setsourceclassname sourceclassname sourceclassname sourceclassname sourceclassname sourceclassname set_value sourceclassname sourceclassname get source class source class name public string get source class name return string get value source class name getsourceclassname get_value sourceclassname set source method source method name public void set source method name string source method name if source method name null source method name length 60 log warning length 60 truncated source method name source method name substring 0 59 set value source method name source method name setsourcemethodname sourcemethodname sourcemethodname sourcemethodname sourcemethodname sourcemethodname set_value sourcemethodname sourcemethodname get source method source method name public string get source method name return string get value source method name getsourcemethodname get_value sourcemethodname set stack trace system log trace public void set stack trace string stack trace if stack trace null stack trace length 2000 log warning length 2000 truncated stack trace stack trace substring 0 1999 set value stack trace stack trace setstacktrace stacktrace stacktrace stacktrace stacktrace stacktrace set_value stacktrace stacktrace get stack trace system log trace public string get stack trace return string get value stack trace getstacktrace get_value stacktrace set statistics information to help profiling the system for solving support issues public void set statistics info string statistics info if statistics info null statistics info length 255 log warning length 255 truncated statistics info statistics info substring 0 254 set valuenocheck statistics info statistics info setstatisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo set_valuenocheck statisticsinfo statisticsinfo get statistics information to help profiling the system for solving support issues public string get statistics info return string get value statistics info getstatisticsinfo get_value statisticsinfo set support e mail e mail address to send support information and updates to public void set supporte mail string supporte mail if supporte mail null supporte mail length 60 log warning length 60 truncated supporte mail supporte mail substring 0 59 set value supporte mail supporte mail email email setsupportemail supportemail supportemail supportemail supportemail supportemail set_value supportemail supportemail get support e mail e mail address to send support information and updates to public string get supporte mail return string get value supporte mail email email getsupportemail get_value supportemail public static final string systemstatus production p set system status status of the system support priority depends on system status public void set system status string system status if system status null throw new illegal argument exception system status is mandatory if system status equals e system status equals i system status equals p else throw new illegal argument exception system status invalid value system status reference id 374 e i p if system status length 1 log warning length 1 truncated system status system status substring 0 0 set value system status system status systemstatus_production setsystemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus reference_id systemstatus systemstatus systemstatus set_value systemstatus systemstatus get system status status of the system support priority depends on system status public string get system status return string get value system status getsystemstatus get_value systemstatus set registered e mail email of the responsible for the system public void set user name string user name if user name null throw new illegal argument exception user name is mandatory if user name length 60 log warning length 60 truncated user name user name substring 0 59 set valuenocheck user name user name email setusername username username illegalargumentexception username username username username set_valuenocheck username username get registered e mail email of the responsible for the system public string get user name return string get value user name email getusername get_value username set version version of the table definition public void set version string version if version null throw new illegal argument exception version is mandatory if version length 40 log warning length 40 truncated version version substring 0 39 set valuenocheck version version setversion illegalargumentexception set_valuenocheck get version version of the table definition public string get version return string get value version getversion get_value basic constructor you need to set the attributes using the set methods public title this method creates a lt title gt tag and sets the element value param value what goes between lt start tag gt lt end tag gt public title string title add element title start_tag end_tag addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public title add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public title add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public title add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public title add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public title remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry public static c field create numeric number format format return null cfield createnumeric numberformat return null public static c field create numeric return create numeric new decimal format cfield createnumeric createnumeric decimalformat return create numeric new decimal format public static c field create date date format format return null createnumeric decimalformat cfield createdate dateformat return null public static c field create date return create date new simple date format cfield createdate createdate simpledateformat return create date new simple date format public static c field create text pattern p return null createdate simpledateformat cfield createtext return null public static c field create text int length return null cfield createtext public c field this null null cfield construct compiere field with external popup editor param editor the validating editor param c field popup the popup dialog param title title for popup public c field c field editor editor class c field popup string title super new object 1 2 if editor null set editor editor set editable true m title title check popup if c field popup null class interfaces c field popup get interfaces boolean found false for int i 0 i interfaces length i if interfaces i equals c field popup class found true break if found throw new illegal argument exception popup class must be c field popup super add action listener this cfieldpopup cfield cfieldeditor cfieldpopup seteditor seteditable m_title cfieldpopup cfieldpopup getinterfaces cfieldpopup illegalargumentexception cfieldpopup addactionlistener set icon of arrow button to icon param default icon icon to be displayed public void set icon icon default icon m icon default icon defaulticon seticon defaulticon m_icon defaulticon get icon of arrow button to icon return default icon icon to be displayed public icon get icon return m icon defaulticon geticon m_icon set ui and re set icon for arrow button param ui public void setui textui ui super setui ui display popup called from compiere combo popup and allows to implement alternative actions than showing the popup return if true the popup should be displayed public boolean display popup if m popupclass null return false try get owner create popup instance window win swing utilities get window ancestor this c field popup popup null if win instanceof dialog constructor constructor m popupclass get constructor new class dialog class string class boolean class popup c field popup constructor new instance new object dialog win m title new boolean true else if win instanceof frame constructor constructor m popupclass get constructor new class frame class string class boolean class popup c field popup constructor new instance new object frame win m title new boolean true if popup null return false start popup popup set value m editor get item popup set format m editor get format popup show m editor set item popup get value popup null catch exception e notify user e return false compierecombopopup displaypopup m_popupclass swingutilities getwindowancestor cfieldpopup m_popupclass getconstructor cfieldpopup newinstance m_title m_popupclass getconstructor cfieldpopup newinstance m_title setvalue m_editor getitem setformat m_editor getformat m_editor setitem getvalue notifyuser notify user of a ptoblem with starting popup param e exception public void notify user exception e j option pane show message dialog this e to string field error j option pane error message notifyuser joptionpane showmessagedialog tostring joptionpane error_message set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is enabled rw super set enabled rw set background false setreadwrite isenabled setenabled setbackground is it possible to edit return true if editable public boolean is read write return super is enabled isreadwrite isenabled set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error color bg null if error bg compiereplaf getfieldbackground error else if is read write bg compiereplaf getfieldbackground inactive else if m mandatory bg compiereplaf getfieldbackground mandatory else bg compiereplaf getfieldbackground normal if bg equals m editor get background return m editor set background bg setbackground getfieldbackground_error isreadwrite getfieldbackground_inactive m_mandatory getfieldbackground_mandatory getfieldbackground_normal m_editor getbackground m_editor setbackground set editor to value param value value of the editor public void set value object value m oldvalue value super set selected item value setvalue m_oldvalue setselecteditem return editor value return current value public object get value return null super get selected item getvalue getselecteditem return display value return displayed string value public string get display if super get selected item null return return super get selected item to string getdisplay getselecteditem getselecteditem tostring action listener param e action event public void action performed action event e do er have a change object new value get value if new value null new value equals m oldvalue new value null m oldvalue null return super fire property change data changed m oldvalue new value m oldvalue new value actionevent actionperformed actionevent newvalue getvalue newvalue newvalue m_oldvalue newvalue m_oldvalue firepropertychange datachanged m_oldvalue newvalue m_oldvalue newvalue standard constructor param ctx context param c invoicebatch id id param trx name trx public m invoice batch properties ctx int c invoicebatch id string trx name super ctx c invoicebatch id trx name if c invoicebatch id 0 set document no null setc currency id 0 c currency id set control amt env zero 0 set date doc new timestamp system current time millis date set document amt env zero set isso trx false n set processed false setsalesrep id 0 c_invoicebatch_id trxname minvoicebatch c_invoicebatch_id trxname c_invoicebatch_id trxname c_invoicebatch_id setdocumentno setc_currency_id c_currency_id setcontrolamt setdatedoc currenttimemillis setdocumentamt setissotrx setprocessed setsalesrep_id load constructor param ctx context param rs result set param trx name trx public m invoice batch properties ctx result set rs string trx name super ctx rs trx name trxname minvoicebatch resultset trxname trxname get lines param reload reload data return array of lines public m invoice batch line get lines boolean reload if m lines null reload return m lines string sql select from c invoicebatchline where c invoicebatch id order by line array list m invoice batch line list new array list m invoice batch line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc invoicebatch id result set rs pstmt execute query while rs next list add new m invoice batch line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m invoice batch line list size list to array m lines return m lines minvoicebatchline getlines m_lines m_lines c_invoicebatchline c_invoicebatch_id arraylist minvoicebatchline arraylist minvoicebatchline preparedstatement preparestatement get_trxname setint getc_invoicebatch_id resultset executequery minvoicebatchline getctx get_trxname m_lines minvoicebatchline toarray m_lines m_lines set processed param processed processed public void set processed boolean processed super set processed processed if get id 0 return string set set processed processed y n where c invoicebatch id getc invoicebatch id int no line db execute update update c invoicebatchline set get trxname m lines null log fine processed lines no line setprocessed setprocessed get_id c_invoicebatch_id getc_invoicebatch_id noline executeupdate c_invoicebatchline get_trxname m_lines noline detail protected contructor param frame parent frame param modal modal param window no window no param value query value param multi selection multiple selections param where clause where clause protected info order frame frame boolean modal int window no string value boolean multi selection string where clause super frame modal window no o c order id multi selection where clause log info info order set title msg get msg env get ctx info order try stat init p loadedok init info catch exception e return int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no if value null value length 0 f document no set value value execute query pack focus f document no request focus windowno multiselection whereclause infoorder windowno multiselection whereclause windowno c_order_id multiselection whereclause infoorder settitle getmsg getctx infoorder statinit p_loadedok initinfo p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring fdocumentno setvalue executequery fdocumentno requestfocus static setup add fields to parameter panel throws exception if lookups cannot be initialized private void stat init throws exception l document no set label for f document no f document no set background compiereplaf get info background f document no add action listener this l description set label for f description f description set background compiereplaf get info background f description add action listener this lpo reference set label for lpo reference fpo reference set background compiereplaf get info background fpo reference add action listener this f isso trx set selected n equals env get context env get ctx p windowno isso trx f isso trx add action listener this forg id new v lookup ad org id false false true m lookup factory create env get ctx 3486 m windowno display type table dir false display type table dir m windowno lorg id set label for forg id forg id set background compiereplaf get info background fbpartner id new v lookup c bpartner id false false true m lookup factory get env get ctx p windowno 0 3499 display type search lbpartner id set label for fbpartner id fbpartner id set background compiereplaf get info background l date from set label for f date from f date from set background compiereplaf get info background f date from set tool tip text msg translate env get ctx date from l date to set label for f date to f date to set background compiereplaf get info background f date to set tool tip text msg translate env get ctx date to l amt from set label for f amt from f amt from set background compiereplaf get info background f amt from set tool tip text msg translate env get ctx amt from l amt to set label for f amt to f amt to set background compiereplaf get info background f amt to set tool tip text msg translate env get ctx amt to parameter panel set layout new a layout first row parameter panel add l document no new a layout constraint 0 0 parameter panel add f document no null parameter panel add lbpartner id null parameter panel add fbpartner id null parameter panel add f isso trx new a layout constraint 0 5 2nd row parameter panel add l description new a layout constraint 1 0 parameter panel add f description null parameter panel add l date from null parameter panel add f date from null parameter panel add l date to null parameter panel add f date to null 3rd row parameter panel add lpo reference new a layout constraint 2 0 parameter panel add fpo reference null parameter panel add l amt from null parameter panel add f amt from null parameter panel add l amt to null parameter panel add f amt to null parameter panel add lorg id null parameter panel add forg id null parameterpanel statinit ldocumentno setlabelfor fdocumentno fdocumentno setbackground getinfobackground fdocumentno addactionlistener ldescription setlabelfor fdescription fdescription setbackground getinfobackground fdescription addactionlistener lporeference setlabelfor lporeference fporeference setbackground getinfobackground fporeference addactionlistener fissotrx setselected getcontext getctx p_windowno issotrx fissotrx addactionlistener forg_id vlookup ad_org_id mlookupfactory getctx m_windowno displaytype tabledir displaytype tabledir m_windowno lorg_id setlabelfor forg_id forg_id setbackground getinfobackground fbpartner_id vlookup c_bpartner_id mlookupfactory getctx p_windowno displaytype lbpartner_id setlabelfor fbpartner_id fbpartner_id setbackground getinfobackground ldatefrom setlabelfor fdatefrom fdatefrom setbackground getinfobackground fdatefrom settooltiptext getctx datefrom ldateto setlabelfor fdateto fdateto setbackground getinfobackground fdateto settooltiptext getctx dateto lamtfrom setlabelfor famtfrom famtfrom setbackground getinfobackground famtfrom settooltiptext getctx amtfrom lamtto setlabelfor famtto famtto setbackground getinfobackground famtto settooltiptext getctx amtto parameterpanel setlayout alayout parameterpanel ldocumentno alayoutconstraint parameterpanel fdocumentno parameterpanel lbpartner_id parameterpanel fbpartner_id parameterpanel fissotrx alayoutconstraint parameterpanel ldescription alayoutconstraint parameterpanel fdescription parameterpanel ldatefrom parameterpanel fdatefrom parameterpanel ldateto parameterpanel fdateto parameterpanel lporeference alayoutconstraint parameterpanel fporeference parameterpanel lamtfrom parameterpanel famtfrom parameterpanel lamtto parameterpanel famtto parameterpanel lorg_id parameterpanel forg_id general init return true if success private boolean init info set defaults string bp env get context env get ctx p windowno c bpartner id if bp null bp length 0 fbpartner id set value new integer bp prepare table string buffer where new string buffer o is active y if p whereclause length 0 where append and append util replace p whereclause c order o prepare table s invoicelayout c order o where to string 2 3 4 return true initinfo getcontext getctx p_windowno c_bpartner_id fbpartner_id setvalue stringbuffer stringbuffer isactive p_whereclause p_whereclause c_order preparetable s_invoicelayout c_order tostring construct sql where clause and define parameters set parameters needs to set parameters includes first and return sql string getsql where string buffer sql new string buffer if f document no get text length 0 sql append and upper o document no like if f description get text length 0 sql append and upper o description like if fpo reference get text length 0 sql append and upper o po reference like if fbpartner id get value null sql append and o c bpartner id if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value if from null to null sql append and trunc o date ordered else if from null to null sql append and trunc o date ordered else if from null to null sql append and trunc o date ordered between and if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value if from null to null sql append and o grand total else if from null to null sql append and o grand total else if from null to null sql append and o grand total between and sql append and o isso trx log finer sql to string return sql to string setparameters getsqlwhere stringbuffer stringbuffer fdocumentno gettext documentno fdescription gettext fporeference gettext poreference fbpartner_id getvalue c_bpartner_id fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue dateordered dateordered dateordered famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue grandtotal grandtotal grandtotal issotrx tostring tostring set parameters for query as defined in getsql where param pstmt statement param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 if f document no get text length 0 pstmt set string index getsql text f document no if f description get text length 0 pstmt set string index getsql text f description if fpo reference get text length 0 pstmt set string index getsql text fpo reference if fbpartner id get value null integer bp integer fbpartner id get value pstmt set int index bp int value log fine b partner bp if f date from get value null f date to get value null timestamp from timestamp f date from get value timestamp to timestamp f date to get value log fine date from from to to if from null to null pstmt set timestamp index to else if from null to null pstmt set timestamp index from else if from null to null pstmt set timestamp index from pstmt set timestamp index to if f amt from get value null f amt to get value null big decimal from big decimal f amt from get value big decimal to big decimal f amt to get value log fine amt from from to to if from null to null pstmt set big decimal index to else if from null to null pstmt set big decimal index from else if from null to null pstmt set big decimal index from pstmt set big decimal index to pstmt set string index f isso trx is selected y n getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fdocumentno gettext setstring getsqltext fdocumentno fdescription gettext setstring getsqltext fdescription fporeference gettext setstring getsqltext fporeference fbpartner_id getvalue fbpartner_id getvalue setint intvalue bpartner fdatefrom getvalue fdateto getvalue fdatefrom getvalue fdateto getvalue settimestamp settimestamp settimestamp settimestamp famtfrom getvalue famtto getvalue bigdecimal bigdecimal famtfrom getvalue bigdecimal bigdecimal famtto getvalue setbigdecimal setbigdecimal setbigdecimal setbigdecimal setstring fissotrx isselected get sql where parameter param f field return sql private string getsql text c text field f string s f get text to upper case if s ends with s log fine string s return s getsqltext ctextfield gettext touppercase endswith zoom void zoom log info integer c order id get selected row key if c order id null return m query query new m query c order query add restriction c order id m query equal c order id query set record count 1 int ad windowno getad window id c order f isso trx is selected zoom ad windowno query c_order_id getselectedrowkey c_order_id mquery mquery c_order addrestriction c_order_id mquery c_order_id setrecordcount ad_windowno getad_window_id c_order fissotrx isselected ad_windowno has zoom return true boolean has zoom return true haszoom po info factory param ctx context param ad table id ad table id return po info public static po info getpo info properties ctx int ad table id integer key new integer ad table id po info ret value po info s cache get key if ret value null ret value new po info ctx ad table id false if ret value get column count 0 may be run before language verification ret value new po info ctx ad table id true else s cache put key ret value return ret value poinfo ad_table_id ad_table_id poinfo poinfo getpoinfo ad_table_id ad_table_id poinfo retvalue poinfo s_cache retvalue retvalue poinfo ad_table_id retvalue getcolumncount retvalue poinfo ad_table_id s_cache retvalue retvalue create persistent info param ctx context param ad table id ad table id param base language only get in base language private po info properties ctx int ad table id boolean base language only m ctx ctx m ad table id ad table id boolean base language base language only true env is base language m ctx ad table load info base language ad_table_id ad_ table_id baselanguageonly poinfo ad_table_id baselanguageonly m_ctx m_ad_table_id ad_table_id baselanguage baselanguageonly isbaselanguage m_ctx ad_table loadinfo baselanguage load table column info param base language in english private void load info boolean base language array list po info column list new array list po info column 15 string buffer sql new string buffer sql append select t table name c column name c ad reference id 1 3 c is mandatory c is updateable c default value 4 6 e name e description c ad column id 7 9 c is key c is parent 10 11 c ad reference value id vr code 12 13 c field length c value min c value max c is translated 14 17 t access level c columnsql c is encrypted 18 20 sql append from ad table t inner join ad column c on t ad table id c ad table id left outer join ad val rule vr on c ad val rule id vr ad val rule id inner join ad element if base language sql append trl sql append e on c ad element id e ad element id where t ad table id and c is active y if base language sql append and e ad language append env getad language m ctx append try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m ad table id result set rs pstmt execute query while rs next if m tablename null m tablename rs get string 1 string column name rs get string 2 int ad reference id rs get int 3 boolean is mandatory y equals rs get string 4 boolean is updateable y equals rs get string 5 string default logic rs get string 6 string name rs get string 7 string description rs get string 8 int ad column id rs get int 9 boolean is key y equals rs get string 10 if is key m haskeycolumn true boolean is parent y equals rs get string 11 int ad reference value id rs get int 12 string validation code rs get string 13 int field length rs get int 14 string value min rs get string 15 string value max rs get string 16 boolean is translated y equals rs get string 17 m accesslevel rs get string 18 string columnsql rs get string 19 boolean is encrypted y equals rs get string 20 po info column col new po info column ad column id column name columnsql ad reference id is mandatory is updateable default logic name description is key is parent ad reference value id validation code field length value min value max is translated is encrypted list add col rs close pstmt close catch sql exception e c logger get log level severe sql to string e convert to array m columns new po info column list size list to array m columns baselanguage loadinfo baselanguage arraylist poinfocolumn arraylist poinfocolumn stringbuffer stringbuffer tablename columnname ad_reference_id ismandatory isupdateable defaultvalue ad_column_id iskey isparent ad_reference_value_id fieldlength valuemin valuemax istranslated accesslevel isencrypted ad_table ad_column ad_table_id ad_table_id ad_val_rule ad_val_rule_id ad_val_rule_id ad_element baselanguage _trl ad_element_id ad_element_id ad_table_id isactive baselanguage ad_language getad_language m_ctx preparedstatement preparestatement tostring setint m_ad_table_id resultset executequery m_tablename m_tablename getstring columnname getstring ad_reference_id getint ismandatory getstring isupdateable getstring defaultlogic getstring getstring getstring ad_column_id getint iskey getstring iskey m_haskeycolumn isparent getstring ad_reference_value_id getint validationcode getstring fieldlength getint valuemin getstring valuemax getstring istranslated getstring m_accesslevel getstring getstring isencrypted getstring poinfocolumn poinfocolumn ad_column_id columnname ad_reference_id ismandatory isupdateable defaultlogic iskey isparent ad_reference_value_id validationcode fieldlength valuemin valuemax istranslated isencrypted sqlexception clogger tostring m_columns poinfocolumn toarray m_columns string representation return string representation public string to string return po info get table name ad table id getad table id tostring poinfo gettablename ad_table_id getad_table_id string representation for index param index column index return string representation public string to string int index if index 0 index m columns length return po info get table name invalid column index index return po info get table name m columns index to string tostring m_columns poinfo gettablename invalidcolumnindex poinfo gettablename m_columns tostring get table name return table name public string get table name return m tablename gettablename m_tablename get ad table id return ad table id public int getad table id return m ad table id ad_table_id ad_table_id getad_table_id m_ad_table_id table has a key column return true if has a key column public boolean has key column return m haskeycolumn haskeycolumn m_haskeycolumn get table access level return m table access public string get access level return m accesslevel m_table getaccesslevel m_accesslevel get column count return column count public int get column count return m columns length columncount getcolumncount m_columns get column index param column name column name return index of column with column name or 1 if not found public int get column index string column name for int i 0 i m columns length i if column name equals m columns i column name return i return 1 columnname columnname getcolumnindex columnname m_columns columnname m_columns columnname get column index param ad column id column return index of column with column name or 1 if not found public int get column index int ad column id for int i 0 i m columns length i if ad column id m columns i ad column id return i return 1 ad_column_id columnname getcolumnindex ad_column_id m_columns ad_column_id m_columns ad_column_id get column param index index return column protected po info column get column int index if index 0 index m columns length return null return m columns index poinfocolumn getcolumn m_columns m_columns get column name param index index return column name column name public string get column name int index if index 0 index m columns length return null return m columns index column name columnname getcolumnname m_columns m_columns columnname get column sql or column name param index index return columnsql column sql or name public string get columnsql int index if index 0 index m columns length return null if m columns index columnsql null m columns index columnsql length 0 return m columns index columnsql as m columns index column name return m columns index column name getcolumnsql m_columns m_columns m_columns m_columns m_columns columnname m_columns columnname is column virtal param index index return true if column is virtual public boolean is virtual column int index if index 0 index m columns length return true return m columns index columnsql null m columns index columnsql length 0 isvirtualcolumn m_columns m_columns m_columns get column label param index index return column label public string get column label int index if index 0 index m columns length return null return m columns index column label getcolumnlabel m_columns m_columns columnlabel get column description param index index returncolumn description public string get column description int index if index 0 index m columns length return null return m columns index column description getcolumndescription m_columns m_columns columndescription get column class param index index return class public class get column class int index if index 0 index m columns length return null return m columns index column class getcolumnclass m_columns m_columns columnclass get column display type param index index return display type public int get column display type int index if index 0 index m columns length return display type string return m columns index display type displaytype getcolumndisplaytype m_columns displaytype m_columns displaytype get column default logic param index index return default logic public string get default logic int index if index 0 index m columns length return null return m columns index default logic getdefaultlogic m_columns m_columns defaultlogic is column mandatory param index index return true if column mandatory public boolean is column mandatory int index if index 0 index m columns length return false return m columns index is mandatory iscolumnmandatory m_columns m_columns ismandatory is column updateable param index index return true if column updateable public boolean is column updateable int index if index 0 index m columns length return false return m columns index is updateable iscolumnupdateable m_columns m_columns isupdateable set column updateable param index index param updateable column updateable public void set column updateable int index boolean updateable if index 0 index m columns length return m columns index is updateable updateable setcolumnupdateable m_columns m_columns isupdateable set all columns updateable param updateable updateable public void set updateable boolean updateable for int i 0 i m columns length i m columns i is updateable updateable setupdateable m_columns m_columns isupdateable is lookup column param index index return true if it is a lookup column public boolean is column lookup int index if index 0 index m columns length return false return display type is lookup m columns index display type iscolumnlookup m_columns displaytype islookup m_columns displaytype get lookup param index index return lookup public lookup get column lookup int index if is column lookup index return null int window no 0 list table table dir lookup lookup null try lookup m lookup factory get m ctx window no m columns index ad column id m columns index display type env get language m ctx m columns index column name m columns index ad reference value id m columns index is parent m columns index validation code catch exception e lookup null cannot create lookup return lookup todo other lookup types getcolumnlookup iscolumnlookup windowno tabledir mlookupfactory m_ctx windowno m_columns ad_column_id m_columns displaytype getlanguage m_ctx m_columns columnname m_columns ad_reference_value_id m_columns isparent m_columns validationcode is column key param index index return true if column is the key public boolean is key int index if index 0 index m columns length return false return m columns index is key iskey m_columns m_columns iskey is column parent param index index return true if column is a parent public boolean is column parent int index if index 0 index m columns length return false return m columns index is parent iscolumnparent m_columns m_columns isparent is column translated param index index return true if column is translated public boolean is column translated int index if index 0 index m columns length return false return m columns index is translated iscolumntranslated m_columns m_columns istranslated is table translated return true if table is translated public boolean is translated for int i 0 i m columns length i if m columns i is translated return true return false istranslated m_columns m_columns istranslated is column data encrypted param index index return true if column is encrypted public boolean is encrypted int index if index 0 index m columns length return false return m columns index is encrypted isencrypted m_columns m_columns isencrypted get column field length param index index return field length public int get field length int index if index 0 index m columns length return 0 return m columns index field length fieldlength getfieldlength m_columns m_columns fieldlength validate content param index index param value new value return null if all valid otherwise error message public string validate int index object value if index 0 index m columns length return range error mandatory i e not null if m columns index is mandatory value null return is mandatory if value null return null length ignored if m columns index value min null big decimal value bd null try if m columns index valuemin bd null value bd new big decimal value to string catch exception ex both are numeric if m columns index valuemin bd null value bd null error 1 0 1 ok 1 1 0 1 10 1 int comp m columns index valuemin bd compare to value bd if comp 0 return min value m columns index valuemin bd m columns index value min compared with numeric value value bd value results in comp else string int comp m columns index value min compare to value to string if comp 0 return min value m columns index value min compared with string value value results in comp if m columns index value max null big decimal value bd null try if m columns index valuemax bd null value bd new big decimal value to string catch exception ex both are numeric if m columns index valuemax bd null value bd null error 12 20 1 ok 12 12 0 12 10 1 int comp m columns index valuemax bd compare to value bd if comp 0 return max value m columns index valuemax bd m columns index value max compared with numeric value value bd value results in comp else string int comp m columns index value max compare to value to string if comp 0 return max value m columns index value max compared with string value value results in comp return null m_columns rangeerror m_columns ismandatory ismandatory m_columns valuemin bigdecimal value_bd m_columns valuemin_bd value_bd bigdecimal tostring m_columns valuemin_bd value_bd m_columns valuemin_bd compareto value_bd minvalue m_columns valuemin_bd m_columns valuemin value_bd m_columns valuemin compareto tostring minvalue m_columns valuemin m_columns valuemax bigdecimal value_bd m_columns valuemax_bd value_bd bigdecimal tostring m_columns valuemax_bd value_bd m_columns valuemax_bd compareto value_bd maxvalue m_columns valuemax_bd m_columns valuemax value_bd m_columns valuemax compareto tostring maxvalue m_columns valuemax standard constructor public x c bpartner location properties ctx int c bpartner location id string trx name super ctx c bpartner location id trx name if c bpartner location id 0 setc bpartner id 0 setc bpartner location id 0 setc location id 0 set is bill to true y set is pay from true y set is remit to true y set is ship to true y set name null x_c_bpartner_location c_bpartner_location_id trxname c_bpartner_location_id trxname c_bpartner_location_id setc_bpartner_id setc_bpartner_location_id setc_location_id setisbillto setispayfrom setisremitto setisshipto setname load constructor public x c bpartner location properties ctx result set rs string trx name super ctx rs trx name x_c_bpartner_location resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bpartner location append get id append return sb to string tostring stringbuffer stringbuffer x_c_bpartner_location get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set valuenocheck c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_valuenocheck c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set address location or address public void setc location id int c location id if c location id 1 throw new illegal argument exception c location id is mandatory set value c location id new integer c location id setc_location_id c_location_id c_location_id illegalargumentexception c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set fax facsimile number public void set fax string fax if fax null fax length 40 log warning length 40 truncated fax fax substring 0 39 set value fax fax setfax set_value get fax facsimile number public string get fax return string get value fax getfax get_value set isdn isdn or modem line public void setisdn string isdn if isdn null isdn length 40 log warning length 40 truncated isdn isdn substring 0 39 set value isdn isdn set_value get isdn isdn or modem line public string getisdn return string get value isdn get_value set invoice address business partner invoice bill address public void set is bill to boolean is bill to set value is bill to new boolean is bill to setisbillto isbillto set_value isbillto isbillto get invoice address business partner invoice bill address public boolean is bill to object oo get value is bill to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbillto get_value isbillto booleanvalue set pay from address business partner pays from that address and we ll send dunning letters there public void set is pay from boolean is pay from set value is pay from new boolean is pay from setispayfrom ispayfrom set_value ispayfrom ispayfrom get pay from address business partner pays from that address and we ll send dunning letters there public boolean is pay from object oo get value is pay from if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispayfrom get_value ispayfrom booleanvalue set remit to address business partner payment address public void set is remit to boolean is remit to set value is remit to new boolean is remit to setisremitto isremitto set_value isremitto isremitto get remit to address business partner payment address public boolean is remit to object oo get value is remit to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isremitto get_value isremitto booleanvalue set ship address business partner shipment address public void set is ship to boolean is ship to set value is ship to new boolean is ship to setisshipto isshipto set_value isshipto isshipto get ship address business partner shipment address public boolean is ship to object oo get value is ship to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isshipto get_value isshipto booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set value phone phone setphone set_value get phone identifies a telephone number public string get phone return string get value phone getphone get_value set 2nd phone identifies an alternate telephone number public void set phone2 string phone2 if phone2 null phone2 length 40 log warning length 40 truncated phone2 phone2 substring 0 39 set value phone2 phone2 setphone2 set_value get 2nd phone identifies an alternate telephone number public string get phone2 return string get value phone2 getphone2 get_value standard constructor public x a asset delivery properties ctx int a asset delivery id string trx name super ctx a asset delivery id trx name if a asset delivery id 0 seta asset delivery id 0 seta asset id 0 set movement date new timestamp system current time millis x_a_asset_delivery a_asset_delivery_id trxname a_asset_delivery_id trxname a_asset_delivery_id seta_asset_delivery_id seta_asset_id setmovementdate currenttimemillis load constructor public x a asset delivery properties ctx result set rs string trx name super ctx rs trx name x_a_asset_delivery resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a asset delivery append get id append return sb to string tostring stringbuffer stringbuffer x_a_asset_delivery get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set valuenocheck ad user id null else set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_valuenocheck ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set asset delivery delivery of asset public void seta asset delivery id int a asset delivery id if a asset delivery id 1 throw new illegal argument exception a asset delivery id is mandatory set valuenocheck a asset delivery id new integer a asset delivery id seta_asset_delivery_id a_asset_delivery_id a_asset_delivery_id illegalargumentexception a_asset_delivery_id set_valuenocheck a_asset_delivery_id a_asset_delivery_id get asset delivery delivery of asset public int geta asset delivery id integer ii integer get value a asset delivery id if ii null return 0 return ii int value geta_asset_delivery_id get_value a_asset_delivery_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 1 throw new illegal argument exception a asset id is mandatory set valuenocheck a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id illegalargumentexception a_asset_id set_valuenocheck a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set delivery confirmation e mail delivery confirmation public void set delivery confirmation string delivery confirmation if delivery confirmation null delivery confirmation length 120 log warning length 120 truncated delivery confirmation delivery confirmation substring 0 119 set value delivery confirmation delivery confirmation email setdeliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation set_value deliveryconfirmation deliveryconfirmation get delivery confirmation e mail delivery confirmation public string get delivery confirmation return string get value delivery confirmation email getdeliveryconfirmation get_value deliveryconfirmation set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set valuenocheck e mail e mail email setemail email email email email email set_valuenocheck email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set lot no lot number alphanumeric public void set lot string lot if lot null lot length 40 log warning length 40 truncated lot lot substring 0 39 set valuenocheck lot lot setlot set_valuenocheck get lot no lot number alphanumeric public string get lot return string get value lot getlot get_value set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set valuenocheck m inoutline id null else set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_valuenocheck m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set product download product downloads public void setm productdownload id int m productdownload id if m productdownload id 0 set value m productdownload id null else set value m productdownload id new integer m productdownload id setm_productdownload_id m_productdownload_id m_productdownload_id set_value m_productdownload_id set_value m_productdownload_id m_productdownload_id get product download product downloads public int getm productdownload id integer ii integer get value m productdownload id if ii null return 0 return ii int value getm_productdownload_id get_value m_productdownload_id intvalue set message id e mail message id public void set messageid string messageid if messageid null messageid length 120 log warning length 120 truncated messageid messageid substring 0 119 set valuenocheck messageid messageid email setmessageid set_valuenocheck get message id e mail message id public string get messageid return string get value messageid email getmessageid get_value set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set valuenocheck movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_valuenocheck movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate return timestamp get value movement date public key name pair get key name pair return new key name pair get id string value of get movement date get_value movementdate keynamepair getkeynamepair keynamepair get_id valueof getmovementdate set referrer referring web address public void set referrer string referrer if referrer null referrer length 255 log warning length 255 truncated referrer referrer substring 0 254 set valuenocheck referrer referrer setreferrer set_valuenocheck get referrer referring web address public string get referrer return string get value referrer getreferrer get_value set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set valuenocheck remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_valuenocheck remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 60 log warning length 60 truncated remote host remote host substring 0 59 set valuenocheck remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_valuenocheck remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set serial no product serial number public void set ser no string ser no if ser no null ser no length 40 log warning length 40 truncated ser no ser no substring 0 39 set valuenocheck ser no ser no setserno serno serno serno serno serno set_valuenocheck serno serno get serial no product serial number public string get ser no return string get value ser no getserno get_value serno set url full url address e g http www compiere org public void seturl string url if url null url length 120 log warning length 120 truncated url url substring 0 119 set valuenocheck url url set_valuenocheck get url full url address e g http www compiere org public string geturl return string get value url get_value set version no version number public void set version no string version no if version no null version no length 20 log warning length 20 truncated version no version no substring 0 19 set valuenocheck version no version no setversionno versionno versionno versionno versionno versionno set_valuenocheck versionno versionno get version no version number public string get version no return string get value version no getversionno get_value versionno create a data source from an input stream param is stream param type mime type e g text html public byte array data source input stream is string type m type type try byte array output stream os new byte array output stream int ch while ch is read 1 xxx must be made more efficient by doing buffered reads rather than one byte reads os write ch m data os to byte array catch io exception ioex system err println byte array data source ioex datasource bytearraydatasource inputstream m_type bytearrayoutputstream bytearrayoutputstream m_data tobytearray ioexception bytearraydatasource create a data source from a byte array param data data param type type e g text html public byte array data source byte data string type m data data m type type datasource bytearraydatasource m_data m_type create a data source from a string param ascii data data assumption that the string contains only ascii characters otherwise just pass a charset into this constructor and use it in get bytes param type mime type e g text html public byte array data source string ascii data string type try web env encoding m data ascii data get bytes utf 8 iso 8859 1 catch unsupported encoding exception uex system err println byte array data source uex m type type datasource asciidata getbytes bytearraydatasource asciidata webenv m_data asciidata getbytes unsupportedencodingexception bytearraydatasource m_type return an input stream for the data return inputstream throws io exception public input stream get input stream throws io exception if m data null throw new io exception no data a new stream must be returned each time return new byte array input stream m data inputstream ioexception inputstream getinputstream ioexception m_data ioexception bytearrayinputstream m_data throws exception return null throws io exception public output stream get output stream throws io exception throw new io exception cannot do this ioexception outputstream getoutputstream ioexception ioexception get content type return mime type e g text html public string get content type return m type getcontenttype m_type set name param name name return this public byte array data source set name string name m name name return this bytearraydatasource setname m_name return name or class name content type return dummy public string get name if m name null return m name return byte array data stream m type getname m_name m_name bytearraydatastream m_type id column constructor param record id public id column int record id this new integer record id record_id idcolumn record_id record_id id column constructor param record id public id column integer record id super setrecord id record id set selected false record_id idcolumn record_id setrecord_id record_id setselected set selection param selected public void set selected boolean selected m selected selected setselected m_selected is selected return true if selected public boolean is selected return m selected isselected m_selected set record id param record id public void setrecord id integer record id m record id record id record_id record_id setrecord_id record_id m_record_id record_id get record id return id public integer getrecord id return m record id getrecord_id m_record_id to string return string representation public string to string return id column id m record id selected m selected tostring idcolumn m_record_id m_selected get attachment param ctx context param ad table id table param record id record return attachment or null public static m attachment get properties ctx int ad table id int record id m attachment ret value null prepared statement pstmt null string sql select from ad attachment where ad table id and record id try pstmt db prepare statement sql null pstmt set int 1 ad table id pstmt set int 2 record id result set rs pstmt execute query if rs next ret value new m attachment ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe m attachment e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value ad_table_id record_id mattachment ad_table_id record_id mattachment retvalue preparedstatement ad_attachment ad_table_id record_id preparestatement setint ad_table_id setint record_id resultset executequery retvalue mattachment s_log mattachment retvalue standard constructor param ctx context param ad attachment id id public m attachment properties ctx int ad attachment id string trx name super ctx ad attachment id trx name ad_attachment_id mattachment ad_attachment_id trxname ad_attachment_id trxname new constructor param ctx context param ad table id table param record id record public m attachment properties ctx int ad table id int record id string trx name this ctx 0 trx name setad table id ad table id setrecord id record id ad_table_id record_id mattachment ad_table_id record_id trxname trxname setad_table_id ad_table_id setrecord_id record_id load constructor param ctx context param rs result set public m attachment properties ctx result set rs string trx name super ctx rs trx name mattachment resultset trxname trxname add to text msg param added text public void add text msg string added string old text msg get text msg if old text msg null set text msg added else if added null set text msg old text msg added addtextmsg oldtextmsg gettextmsg oldtextmsg settextmsg settextmsg oldtextmsg get text msg return trimmed message public string get text msg string msg super get text msg if msg null return null return msg trim gettextmsg gettextmsg string representation return info public string to string string buffer sb new string buffer m attachment sb append getad attachment id append title append get title append entries append get entry count for int i 0 i get entry count i if i 0 sb append else sb append sb append get entry name i sb append return sb to string tostring stringbuffer stringbuffer mattachment getad_attachment_id gettitle getentrycount getentrycount getentryname tostring add new data entry param file file return true if added public boolean add entry file file if file null log warning add entry no file return false if file exists file is directory log warning add entry not added file exists file exists directory file is directory return false log fine add entry file string name file get name byte data null try file input stream fis new file input stream file byte array output stream os new byte array output stream byte buffer new byte 1024 8 8kb int length 1 while length fis read buffer 1 os write buffer 0 length fis close data os to byte array os close catch io exception ioe log log level severe add entry file ioe return add entry name data addentry addentry isdirectory addentry isdirectory addentry getname fileinputstream fileinputstream bytearrayoutputstream bytearrayoutputstream tobytearray ioexception addentry addentry add new data entry param name name param data data return true if added public boolean add entry string name byte data if name null data null return false return add entry new m attachment entry name data random index addentry addentry mattachmententry add entry param item attachment entry return true if added public boolean add entry m attachment entry item if item null return false if m items null loadlob data boolean ret value m items add item log fine add entry item to stringx add text msg otherwise not saved return ret value addentry mattachmententry m_items loadlobdata retvalue m_items addentry tostringx addtextmsg retvalue get attachment entry param index index of the item return entry or null public m attachment entry get entry int index if m items null loadlob data if index 0 index m items size return null return m attachment entry m items get index mattachmententry getentry m_items loadlobdata m_items mattachmententry m_items get attachment entries as array return array or null public m attachment entry get entries if m items null loadlob data m attachment entry ret value new m attachment entry m items size m items to array ret value return ret value mattachmententry getentries m_items loadlobdata mattachmententry retvalue mattachmententry m_items m_items toarray retvalue retvalue delete entry param index index return true if deleted public boolean delete entry int index if index 0 index m items size m items remove index log config index index new size m items size return true log warning not deleted index index size m items size return false deleteentry m_items m_items newsize m_items m_items get entry count return number of entries public int get entry count if m items null loadlob data return m items size getentrycount m_items loadlobdata m_items get entry name param index index return name or null public string get entry name int index m attachment entry item get entry index if item null return item get name return null getentryname mattachmententry getentry getname dump entry names public void dump entry names if m items null loadlob data if m items null m items size 0 system out println no entries return system out println entries m items size for int i 0 i m items size i system out println get entry name i dumpentrynames m_items loadlobdata m_items m_items m_items m_items getentryname get entry data param index index return data or null public byte get entry data int index m attachment entry item get entry index if item null return item get data return null getentrydata mattachmententry getentry getdata get entry file with name param index index param file name optional file name return file public file get entry file int index string file name m attachment entry item get entry index if item null return item get file file name return null filename getentryfile filename mattachmententry getentry getfile filename get entry file with name param index index param file file return file public file get entry file int index file file m attachment entry item get entry index if item null return item get file file return null getentryfile mattachmententry getentry getfile save entry data in zip file format return true if saved private boolean savelob data if m items null m items size 0 set binary data null return true byte array output stream out new byte array output stream zip output stream zip new zip output stream out zip set method zip output stream deflated zip set level deflater best compression zip set comment adempiere try for int i 0 i m items size i m attachment entry item get entry i zip entry entry new zip entry item get name entry set time system current time millis entry set method zip entry deflated zip put next entry entry byte data item get data zip write data 0 data length zip close entry log fine entry get name entry get compressed size entry get size entry get compressed size 100 entry get size zip finish zip close byte zip data out to byte array log fine length zip data length set binary data zip data return true catch exception e log log level severe savelob data e set binary data null return false savelobdata m_items m_items setbinarydata bytearrayoutputstream bytearrayoutputstream zipoutputstream zipoutputstream setmethod zipoutputstream setlevel best_compression setcomment m_items mattachmententry getentry zipentry zipentry getname settime currenttimemillis setmethod zipentry putnextentry getdata closeentry getname getcompressedsize getsize getcompressedsize getsize zipdata tobytearray zipdata setbinarydata zipdata savelobdata setbinarydata load data into local m data return true if success private boolean loadlob data reset m items new array list m attachment entry byte data get binary data if data null return true log fine zip size data length if data length 0 return true old format single file if zip equals get title m items add new m attachment entry get title data 1 return true try byte array input stream in new byte array input stream data zip input stream zip new zip input stream in zip entry entry zip get next entry while entry null string name entry get name byte array output stream out new byte array output stream byte buffer new byte 2048 int length zip read buffer while length 1 out write buffer 0 length length zip read buffer byte data entry out to byte array log fine name size data entry length zip entry get compressed size entry get size entry get compressed size 100 entry get size m items add new m attachment entry name data entry m items size 1 entry zip get next entry catch exception e log log level severe loadlob data e m items null return false return true m_data loadlobdata m_items arraylist mattachmententry getbinarydata zipsize gettitle m_items mattachmententry gettitle bytearrayinputstream bytearrayinputstream zipinputstream zipinputstream zipentry getnextentry getname bytearrayoutputstream bytearrayoutputstream dataentry tobytearray dataentry getcompressedsize getsize getcompressedsize getsize m_items mattachmententry dataentry m_items getnextentry loadlobdata m_items before save param new record new return true if can be saved protected boolean before save boolean new record if get title null get title equals zip set title zip return savelob data save in binary data newrecord beforesave newrecord gettitle gettitle settitle savelobdata binarydata test param args ignored public static void main string args system set property javax activation debug true system out println mime type get mime type data xls system out println mime type get mime type data cvs system out println mime type get mime type data txt system out println mime type get mime type data log system out println mime type get mime type data html system out println mime type get mime type data htm system out println mime type get mime type data png system out println mime type get mime type data gif system out println mime type get mime type data jpg system out println mime type get mime type data xml system out println mime type get mime type data rtf system exit 0 org compiere compiere startup environment true m attachment att new m attachment env get ctx 100 0 null att add entry new file c adempiere dev properties att add entry new file c adempiere index html att save system out println att att dump entry names int ad attachment id att getad attachment id system out println att new m attachment env get ctx ad attachment id null system out println att att dump entry names system out println m attachment entry entries att get entries for int i 0 i entries length i m attachment entry entry entries i entry dump system out println att delete true setproperty mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype mimetype getmimetype startupenvironment mattachment mattachment getctx addentry addentry dumpentrynames ad_attachment_id getad_attachment_id mattachment getctx ad_attachment_id dumpentrynames mattachmententry getentries mattachmententry file utility param file input file or directory param filter filter param action action public file util string file string filter string action string p1 string p2 this new file file filter action p1 p2 fileutil file utility param file input file or directory param filter filter param action action public file util file file string filter string action string p1 string p2 if action null action length 0 system err println file util no action else if valid action action system err println file util action not valid action actions else if file null system err println file util no input file else if file exists system err println file util input file does not exist file else system out println file util file filter filter action action m filterstring filter process file file p1 p2 system out println file util process count m count actions m actions fileutil fileutil validaction fileutil fileutil fileutil fileutil m_filterstring processfile fileutil m_count m_actions is action valid param action action return true if supported private boolean valid action string action for int i 0 i actions length i if actions i equals action m actionindex i return true return false validaction m_actionindex process file param file file private void process file file file string p1 string p2 if file null return else if file exists return else if file is directory file dir files file list files m filter for int i 0 i dir files length i process file dir files i p1 p2 else system out println process file file get absolute path m count process file action file p1 p2 processfile isdirectory dirfiles listfiles m_filter dirfiles processfile dirfiles processfile getabsolutepath m_count processfileaction file action param file file to be processed void process file action file file string p1 string p2 try if m actionindex 0 list else if m actionindex 1 replace replace string file p1 p2 else if m actionindex 2 latex latex file catch exception ex processfileaction m_actionindex m_actionindex replacestring m_actionindex replace string in file param file file param from old string param to new string throws io exception private void replace string file file string from string to throws io exception string file name file get absolute path buffered reader in new buffered reader new file reader file file tmp file new file file name tmp buffered writer out new buffered writer new file writer tmp file false boolean found false string line null int line no 0 while line in read line null line no if line index of from 1 found true system out println line no line line util replace line from to m actions out write line out new line while reading file in close out close if found file old file new file file name old if file rename to old file if tmp file rename to new file file name if old file delete system out println file updated file name else system err println old file not deleted file name else system err println new file not renamed file name else system err println old file not renamed file name else if tmp file delete system err println temp file not deleted tmp file get absolute path ioexception replacestring ioexception filename getabsolutepath bufferedreader bufferedreader filereader tmpfile filename bufferedwriter bufferedwriter filewriter tmpfile lineno readline lineno indexof lineno m_actions newline oldfile filename renameto oldfile tmpfile renameto filename oldfile filename filename filename filename tmpfile tmpfile getabsolutepath strip latex specifics textsl colorbox yellow textbf important for more information on the installation of the compiere server and the compiere client please refer to href http www compiere org support index html compiere support for more details and the latest update param file file throws io exception private void latex file file throws io exception string file name file get absolute path buffered reader in new buffered reader new file reader file file out file new file file name txt buffered writer out new buffered writer new file writer out file false string line null int line no 0 while line in read line null line no boolean ignore false char in line line to char array string buffer sb new string buffer for int i 0 i in line length i char c in line i if c ignore true else if c ignore false else if c else if ignore sb append c out write sb to string out new line while reading file in close out close system out println file file name lines line no ioexception ioexception filename getabsolutepath bufferedreader bufferedreader filereader outfile filename bufferedwriter bufferedwriter filewriter outfile lineno readline lineno inline tochararray stringbuffer stringbuffer inline inline tostring newline filename lineno accept directories and files matching filter param dir the directory in which the file was found param name the name of the file return accept directories and files matching filter public boolean accept file dir string name system out println dir dir name name file file new file dir name if file is directory return true if m filterstring null m filterstring length 0 return true if name null return false ignore files with and this file if name index of 1 name equals file util java return false return name index of m filterstring 1 isdirectory m_filterstring m_filterstring indexof fileutil indexof m_filterstring start param args file name filter action public static void main string args string directory c compiere compiere all2 string filter sql string action replace if args length 1 directory args 0 if args length 2 filter args 1 if filter null filter new file util directory filter action erp cpm erp crm filename fileutil async process do it all code get instance id get parameters execute lock start process unlock code creates a process ctl instance which calls lockui and unlockui if parent is a a sync process br called from process ctl start process process dialog action performed a panel cmd print a panel action button v pay select cmd generate param parent a sync process container param window no window no param pi process info process info param trx transaction return worker started process ctl instance or null for workflow public static process ctl process a sync process parent int window no process info pi trx trx log fine window no window no pi mp instance instance new mp instance env get ctx pi getad process id pi getrecord id if instance save pi set summary msg get msg env get ctx process no instance pi set error true return null pi setad pinstance id instance getad pinstance id get parameters dialog process parameter para new process parameter env get frame container parent window no pi if para init dialog para set visible true if para isok pi set summary msg get msg env get ctx process cancelled pi set error true return null execute process ctl worker new process ctl parent pi trx worker start must be start return worker processctl asyncprocess processctl startprocess processdialog actionperformed apanel cmd_print apanel actionbutton vpayselect cmd_generate asyncprocess windowno processinfo processctl processctl asyncprocess windowno processinfo windowno windowno mpinstance mpinstance getctx getad_process_id getrecord_id setsummary getmsg getctx processnoinstance seterror setad_pinstance_id getad_pinstance_id processparameter processparameter getframe windowno initdialog setvisible setsummary getmsg getctx processcancelled seterror processctl processctl constructor param parent container a sync process param pi process info param trx transaction created in process v invoice gen generate invoices public process ctl a sync process parent process info pi trx trx m parent parent m pi pi m trx trx handeled correctly asyncprocess vinvoicegen generateinvoices processctl asyncprocess processinfo m_parent m_pi m_trx execute process instance and lock ui calls lockui and unlockui if parent is a a sync process pre get process information call class submit sql procedure run sql procedure pre public void run log fine ad pinstance id m pi getad pinstance id record id m pi getrecord id lock lock try system out println sleeping sleep 20000 system out println sleeping catch exception e get process information name procedure name class name is report is direct print string procedure name int ad reportview id 0 int ad workflow id 0 boolean is report false boolean is direct print false string sql select p name p procedure name p class name p ad process id 1 4 p is report p is direct print p ad reportview id p ad workflow id 5 8 case when coalesce p statistic count 0 0 then 0 else p statistic seconds p statistic count end case p is server process from ad process p inner join ad pinstance i on p ad process id i ad process id where p is active y and i ad pinstance id if env is base language env get ctx ad process sql select t name p procedure name p class name p ad process id 1 4 p is report p is direct print p ad reportview id p ad workflow id 5 8 case when coalesce p statistic count 0 0 then 0 else p statistic seconds p statistic count end case p is server process from ad process p inner join ad pinstance i on p ad process id i ad process id inner join ad process trl t on p ad process id t ad process id and t ad language env getad language env get ctx where p is active y and i ad pinstance id try prepared statement pstmt db prepare statement sql result set type forward only result set concur read only null pstmt set int 1 m pi getad pinstance id result set rs pstmt execute query if rs next m pi set title rs get string 1 if m waiting null m waiting set title m pi get title procedure name rs get string 2 m pi set class name rs get string 3 m pi setad process id rs get int 4 report if y equals rs get string 5 is report true if y equals rs get string 6 ini is property bool ini p printpreview is direct print true ad reportview id rs get int 7 ad workflow id rs get int 8 int estimate rs get int 9 if estimate 0 m pi set est seconds estimate 1 admin overhead if m waiting null m waiting set timer estimate m pi get est seconds m isserverprocess y equals rs get string 10 else log log level severe no ad pinstance id m pi getad pinstance id rs close pstmt close catch sql exception e m pi set summary msg get msg env get ctx process no procedure e get localized message true unlock log log level severe run e return no pl sql procedure if procedure name null procedure name workflow if ad workflow id 0 start workflow ad workflow id unlock return start optional class if m pi get class name null run class if start process unlock return no optional sql procedure done if is report procedure name length 0 unlock return no optional report done if is report ad reportview id 0 unlock return if not a report we need a prodedure name if is report procedure name length 0 m pi set summary msg get msg env get ctx process no procedure true unlock return report submission if is report optional pre report process if procedure name length 0 if startdb process procedure name unlock return pre report start report boolean ok report ctl start m pi is direct print m pi set summary report ok unlock process submission else if startdb process procedure name unlock return success get result process info util set summary fromdb m pi unlock process submission log fine log l3 util process ctl run done asyncprocess ad_pinstance_id m_pi getad_pinstance_id record_id m_pi getrecord_id classname isreport isdirectprint procedurename ad_reportview_id ad_workflow_id isreport isdirectprint procedurename classname ad_process_id isreport isdirectprint ad_reportview_id ad_workflow_id statistic_count statistic_seconds statistic_count isserverprocess ad_process ad_pinstance ad_process_id ad_process_id isactive ad_pinstance_id isbaselanguage getctx ad_process procedurename classname ad_process_id isreport isdirectprint ad_reportview_id ad_workflow_id statistic_count statistic_seconds statistic_count isserverprocess ad_process ad_pinstance ad_process_id ad_process_id ad_process_trl ad_process_id ad_process_id ad_language getad_language getctx isactive ad_pinstance_id preparedstatement preparestatement resultset type_forward_only resultset concur_read_only setint m_pi getad_pinstance_id resultset executequery m_pi settitle getstring m_waiting m_waiting settitle m_pi gettitle procedurename getstring m_pi setclassname getstring m_pi setad_process_id getint getstring isreport getstring ispropertybool p_printpreview isdirectprint ad_reportview_id getint ad_workflow_id getint getint m_pi setestseconds m_waiting m_waiting settimerestimate m_pi getestseconds m_isserverprocess getstring ad_pinstance_id m_pi getad_pinstance_id sqlexception m_pi setsummary getmsg getctx processnoprocedure getlocalizedmessage procedurename procedurename ad_workflow_id startworkflow ad_workflow_id m_pi getclassname startprocess isreport procedurename isreport ad_reportview_id isreport procedurename m_pi setsummary getmsg getctx processnoprocedure isreport procedurename startdbprocess procedurename reportctl m_pi isdirectprint m_pi setsummary startdbprocess procedurename getresult processinfoutil setsummaryfromdb m_pi l3_util processctl lock ui show waiting private void lock log info j frame frame env get frame container m parent if frame instanceof a window a window frame set busy timer m pi get est seconds else m waiting new waiting frame msg get msg env get ctx processing false m pi get est seconds swing utilities invoke later new runnable public void run log finer lock m parent lockui m pi if m waiting null m waiting to front m waiting set visible true jframe getframe m_parent awindow awindow setbusytimer m_pi getestseconds m_waiting getmsg getctx m_pi getestseconds swingutilities invokelater m_parent m_pi m_waiting m_waiting tofront m_waiting setvisible public void run log finer lock m parent lockui m pi m_parent m_pi unlock ui dispose waiting called from run private void unlock log info swing utilities invoke later new runnable public void run string summary m pi get summary log finer unlock summary if summary null summary index of 1 m pi set summary msg parse translation env get ctx summary m parent unlockui m pi remove waiting processing indicator if m waiting null m waiting dispose m waiting null swingutilities invokelater m_pi getsummary indexof m_pi setsummary parsetranslation getctx m_parent m_pi m_waiting m_waiting m_waiting public void run string summary m pi get summary log finer unlock summary if summary null summary index of 1 m pi set summary msg parse translation env get ctx summary m parent unlockui m pi m_pi getsummary indexof m_pi setsummary parsetranslation getctx m_parent m_pi start workflow param ad workflow id workflow return true if started private boolean start workflow int ad workflow id log fine ad workflow id m pi boolean started false if db is remote process server server c connection get get server try if server null see server bean m pi server workflow env get ctx m pi ad workflow id log finest server m pi started true catch remote exception ex log log level severe apps server error ex started false run locally if started m isserverprocess m workflow wf m workflow get env get ctx ad workflow id mwf process wf process wf start wait m pi may return null started wf process null return started ad_workflow_id startworkflow ad_workflow_id ad_workflow_id m_pi isremoteprocess cconnection getserver serverbean m_pi getctx m_pi ad_workflow_id m_pi remoteexception appsserver m_isserverprocess mworkflow mworkflow getctx ad_workflow_id mwfprocess wfprocess startwait m_pi wfprocess start java process class instanciate the class implementing the interface process call the class can be a server client class when in package org compiere process or org compiere model or a client only class e g in org compiere report return true if success private boolean start process log fine m pi to string boolean started false if db is remote process server server c connection get get server try if server null see server bean m pi server process env get ctx m pi log finest server m pi started true catch undeclared throwable exception ex throwable cause ex get cause if cause null if cause instanceof invalid class exception log log level severe version server client cause to string m pi ex else log log level severe apps server error 1b cause to string m pi ex else log log level severe apps server error 1 m pi ex started false catch remote exception ex throwable cause ex get cause if cause null cause ex log log level severe apps server error m pi cause started false run locally if started m isserverprocess process call my object null try class my class class for name m pi get class name my object process call my class new instance if my object null m pi set summary no instance for m pi get class name true else my object start process env get ctx m pi m trx if m trx null m trx commit m trx close catch exception e if m trx null m trx rollback m trx close m pi set summary error starting class m pi get class name true log log level severe m pi get class name e return m pi is error processcall startprocess m_pi tostring isremoteprocess cconnection getserver serverbean m_pi getctx m_pi m_pi undeclaredthrowableexception getcause invalidclassexception tostring m_pi appsserver tostring m_pi appsserver m_pi remoteexception getcause appsserver m_pi m_isserverprocess processcall myobject myclass forname m_pi getclassname myobject processcall myclass newinstance myobject m_pi setsummary m_pi getclassname myobject startprocess getctx m_pi m_trx m_trx m_trx m_trx m_trx m_trx m_trx m_pi setsummary m_pi getclassname m_pi getclassname m_pi iserror start database process param procedure name pl sql procedure name return true if success private boolean startdb process string procedure name execute on this thread connection log fine procedure name m pi getad pinstance id string sql call procedure name try callable statement cstmt db prepare call sql ro cstmt set int 1 m pi getad pinstance id cstmt execute update cstmt close catch exception e log log level severe sql e m pi set summary msg get msg env get ctx process run error e get localized message m pi set error true return false log fine log l4 data process ctl start process done return true procedurename startdbprocess procedurename procedurename m_pi getad_pinstance_id procedurename callablestatement preparecall setint m_pi getad_pinstance_id executeupdate m_pi setsummary getmsg getctx processrunerror getlocalizedmessage m_pi seterror l4_data processctl startprocess standard constructor param ctx context param m lotctl id id public m lot ctl properties ctx int m lotctl id string trx name super ctx m lotctl id trx name if m lotctl id 0 setm lotctl id 0 set start no 1 set current next 1 set increment no 1 set name null m_lotctl_id mlotctl m_lotctl_id trxname m_lotctl_id trxname m_lotctl_id setm_lotctl_id setstartno setcurrentnext setincrementno setname load constructor param ctx context param rs result set public m lot ctl properties ctx result set rs string trx name super ctx rs trx name mlotctl resultset trxname trxname create new lot increments current next and commits param m product id product return saved lot public m lot create lot int m product id string buffer name new string buffer if get prefix null name append get prefix int no get current next name append no if get suffix null name append get suffix no get increment no set current next no save m lot ret value new m lot this m product id name to string ret value save return ret value m_product_id mlot createlot m_product_id stringbuffer stringbuffer getprefix getprefix getcurrentnext getsuffix getsuffix getincrementno setcurrentnext mlot retvalue mlot m_product_id tostring retvalue retvalue standard constructor public x c projecttask properties ctx int c projecttask id string trx name super ctx c projecttask id trx name if c projecttask id 0 setc projectphase id 0 setc projecttask id 0 set name null set seq no 0 sql select nvl max seq no 0 10 as default value from c projecttask where c projectphase id c projectphase id x_c_projecttask c_projecttask_id trxname c_projecttask_id trxname c_projecttask_id setc_projectphase_id setc_projecttask_id setname setseqno seqno defaultvalue c_projecttask c_projectphase_id c_projectphase_id load constructor public x c projecttask properties ctx result set rs string trx name super ctx rs trx name x_c_projecttask resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c projecttask append get id append return sb to string tostring stringbuffer stringbuffer x_c_projecttask get_id tostring set project phase phase of a project public void setc projectphase id int c projectphase id if c projectphase id 1 throw new illegal argument exception c projectphase id is mandatory set valuenocheck c projectphase id new integer c projectphase id setc_projectphase_id c_projectphase_id c_projectphase_id illegalargumentexception c_projectphase_id set_valuenocheck c_projectphase_id c_projectphase_id get project phase phase of a project public int getc projectphase id integer ii integer get value c projectphase id if ii null return 0 return ii int value getc_projectphase_id get_value c_projectphase_id intvalue set project task actual project task in a phase public void setc projecttask id int c projecttask id if c projecttask id 1 throw new illegal argument exception c projecttask id is mandatory set valuenocheck c projecttask id new integer c projecttask id setc_projecttask_id c_projecttask_id c_projecttask_id illegalargumentexception c_projecttask_id set_valuenocheck c_projecttask_id c_projecttask_id get project task actual project task in a phase public int getc projecttask id integer ii integer get value c projecttask id if ii null return 0 return ii int value getc_projecttask_id get_value c_projecttask_id intvalue set standard task standard project type task public void setc task id int c task id if c task id 0 set valuenocheck c task id null else set valuenocheck c task id new integer c task id setc_task_id c_task_id c_task_id set_valuenocheck c_task_id set_valuenocheck c_task_id c_task_id get standard task standard project type task public int getc task id integer ii integer get value c task id if ii null return 0 return ii int value getc_task_id get_value c_task_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno standard constructor public x b seller properties ctx int b seller id string trx name super ctx b seller id trx name if b seller id 0 setad user id 0 set is internal false set name null set valid to new timestamp system current time millis x_b_seller b_seller_id trxname b_seller_id trxname b_seller_id setad_user_id setisinternal setname setvalidto currenttimemillis load constructor public x b seller properties ctx result set rs string trx name super ctx rs trx name x_b_seller resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b seller append get id append return sb to string tostring stringbuffer stringbuffer x_b_seller get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set internal internal organization public void set is internal boolean is internal set value is internal new boolean is internal setisinternal isinternal set_value isinternal isinternal get internal internal organization public boolean is internal object oo get value is internal if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinternal get_value isinternal booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set valid to valid to including this date last day public void set valid to timestamp valid to if valid to null throw new illegal argument exception valid to is mandatory set value valid to valid to setvalidto validto validto illegalargumentexception validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto standard constructor public x c allocationhdr properties ctx int c allocationhdr id string trx name super ctx c allocationhdr id trx name if c allocationhdr id 0 set approval amt env zero setc allocationhdr id 0 setc currency id 0 set date acct new timestamp system current time millis set date trx new timestamp system current time millis set doc action null co set doc status null dr set document no null set is approved false set is manual false set posted false set processed false x_c_allocationhdr c_allocationhdr_id trxname c_allocationhdr_id trxname c_allocationhdr_id setapprovalamt setc_allocationhdr_id setc_currency_id setdateacct currenttimemillis setdatetrx currenttimemillis setdocaction setdocstatus setdocumentno setisapproved setismanual setposted setprocessed load constructor public x c allocationhdr properties ctx result set rs string trx name super ctx rs trx name x_c_allocationhdr resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c allocationhdr append get id append return sb to string tostring stringbuffer stringbuffer x_c_allocationhdr get_id tostring set approval amount document approval amount public void set approval amt big decimal approval amt if approval amt null throw new illegal argument exception approval amt is mandatory set value approval amt approval amt setapprovalamt bigdecimal approvalamt approvalamt illegalargumentexception approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt set allocation payment allocation public void setc allocationhdr id int c allocationhdr id if c allocationhdr id 1 throw new illegal argument exception c allocationhdr id is mandatory set valuenocheck c allocationhdr id new integer c allocationhdr id setc_allocationhdr_id c_allocationhdr_id c_allocationhdr_id illegalargumentexception c_allocationhdr_id set_valuenocheck c_allocationhdr_id c_allocationhdr_id get allocation payment allocation public int getc allocationhdr id integer ii integer get value c allocationhdr id if ii null return 0 return ii int value getc_allocationhdr_id get_value c_allocationhdr_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set value date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_value datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set manual this is a manual process public void set is manual boolean is manual set value is manual new boolean is manual setismanual ismanual set_value ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x ad wf eventaudit properties ctx int ad wf eventaudit id string trx name super ctx ad wf eventaudit id trx name if ad wf eventaudit id 0 setad table id 0 setad wf eventaudit id 0 setad wf node id 0 setad wf process id 0 setad wf responsible id 0 set elapsed timems env zero set event type null setrecord id 0 setwf state null x_ad_wf_eventaudit ad_wf_eventaudit_id trxname ad_wf_eventaudit_id trxname ad_wf_eventaudit_id setad_table_id setad_wf_eventaudit_id setad_wf_node_id setad_wf_process_id setad_wf_responsible_id setelapsedtimems seteventtype setrecord_id setwfstate load constructor public x ad wf eventaudit properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_eventaudit resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf eventaudit append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_eventaudit get_id tostring set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue public static final int ad user id ad reference id 110 set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id ad_user_id_ad_reference_id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set workflow event audit workflow process activity event audit information public void setad wf eventaudit id int ad wf eventaudit id if ad wf eventaudit id 1 throw new illegal argument exception ad wf eventaudit id is mandatory set valuenocheck ad wf eventaudit id new integer ad wf eventaudit id setad_wf_eventaudit_id ad_wf_eventaudit_id ad_wf_eventaudit_id illegalargumentexception ad_wf_eventaudit_id set_valuenocheck ad_wf_eventaudit_id ad_wf_eventaudit_id get workflow event audit workflow process activity event audit information public int getad wf eventaudit id integer ii integer get value ad wf eventaudit id if ii null return 0 return ii int value getad_wf_eventaudit_id get_value ad_wf_eventaudit_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf eventaudit id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_eventaudit_id set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 1 throw new illegal argument exception ad wf node id is mandatory set value ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception ad_wf_node_id set_value ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue set workflow process actual workflow process instance public void setad wf process id int ad wf process id if ad wf process id 1 throw new illegal argument exception ad wf process id is mandatory set value ad wf process id new integer ad wf process id setad_wf_process_id ad_wf_process_id ad_wf_process_id illegalargumentexception ad_wf_process_id set_value ad_wf_process_id ad_wf_process_id get workflow process actual workflow process instance public int getad wf process id integer ii integer get value ad wf process id if ii null return 0 return ii int value getad_wf_process_id get_value ad_wf_process_id intvalue set workflow responsible responsible for workflow execution public void setad wf responsible id int ad wf responsible id if ad wf responsible id 1 throw new illegal argument exception ad wf responsible id is mandatory set value ad wf responsible id new integer ad wf responsible id setad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id illegalargumentexception ad_wf_responsible_id set_value ad_wf_responsible_id ad_wf_responsible_id get workflow responsible responsible for workflow execution public int getad wf responsible id integer ii integer get value ad wf responsible id if ii null return 0 return ii int value getad_wf_responsible_id get_value ad_wf_responsible_id intvalue set attribute name name of the attribute public void set attribute name string attribute name if attribute name null attribute name length 60 log warning length 60 truncated attribute name attribute name substring 0 59 set value attribute name attribute name setattributename attributename attributename attributename attributename attributename set_value attributename attributename get attribute name name of the attribute public string get attribute name return string get value attribute name getattributename get_value attributename set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set elapsed time ms elapsed time in mili seconds public void set elapsed timems big decimal elapsed timems if elapsed timems null throw new illegal argument exception elapsed timems is mandatory set value elapsed timems elapsed timems setelapsedtimems bigdecimal elapsedtimems elapsedtimems illegalargumentexception elapsedtimems set_value elapsedtimems elapsedtimems get elapsed time ms elapsed time in mili seconds public big decimal get elapsed timems big decimal bd big decimal get value elapsed timems if bd null return env zero return bd bigdecimal getelapsedtimems bigdecimal bigdecimal get_value elapsedtimems public static final string eventtype statechanged sc set event type type of event public void set event type string event type if event type null throw new illegal argument exception event type is mandatory if event type equals pc event type equals px event type equals sc else throw new illegal argument exception event type invalid value event type reference id 306 pc px sc if event type length 2 log warning length 2 truncated event type event type substring 0 1 set value event type event type eventtype_statechanged seteventtype eventtype eventtype illegalargumentexception eventtype eventtype eventtype eventtype illegalargumentexception eventtype eventtype reference_id eventtype eventtype eventtype set_value eventtype eventtype get event type type of event public string get event type return string get value event type geteventtype get_value eventtype set new value new field value public void set new value string new value if new value null new value length 2000 log warning length 2000 truncated new value new value substring 0 1999 set value new value new value setnewvalue newvalue newvalue newvalue newvalue newvalue set_value newvalue newvalue get new value new field value public string get new value return string get value new value getnewvalue get_value newvalue set old value the old file data public void set old value string old value if old value null old value length 2000 log warning length 2000 truncated old value old value substring 0 1999 set value old value old value setoldvalue oldvalue oldvalue oldvalue oldvalue oldvalue set_value oldvalue oldvalue get old value the old file data public string get old value return string get value old value getoldvalue get_value oldvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set value record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg public static final string wfstate suspended os set workflow state state of the execution of the workflow public void setwf state string wf state if wf state null throw new illegal argument exception wf state is mandatory if wf state equals ca wf state equals cc wf state equals ct wf state equals on wf state equals or wf state equals os else throw new illegal argument exception wf state invalid value wf state reference id 305 ca cc ct on or os if wf state length 2 log warning length 2 truncated wf state wf state substring 0 1 set value wf state wf state wfstate_suspended setwfstate wfstate wfstate illegalargumentexception wfstate wfstate wfstate wfstate wfstate wfstate wfstate illegalargumentexception wfstate wfstate reference_id wfstate wfstate wfstate set_value wfstate wfstate get workflow state state of the execution of the workflow public string getwf state return string get value wf state getwfstate get_value wfstate standard constructor public x c poskey properties ctx int c poskey id string trx name super ctx c poskey id trx name if c poskey id 0 setc poskeylayout id 0 setc poskey id 0 setm product id 0 set name null set qty env zero set seq no 0 x_c_poskey c_poskey_id trxname c_poskey_id trxname c_poskey_id setc_poskeylayout_id setc_poskey_id setm_product_id setname setqty setseqno load constructor public x c poskey properties ctx result set rs string trx name super ctx rs trx name x_c_poskey resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c poskey append get id append return sb to string tostring stringbuffer stringbuffer x_c_poskey get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set pos key layout pos function key layout public void setc poskeylayout id int c poskeylayout id if c poskeylayout id 1 throw new illegal argument exception c poskeylayout id is mandatory set valuenocheck c poskeylayout id new integer c poskeylayout id setc_poskeylayout_id c_poskeylayout_id c_poskeylayout_id illegalargumentexception c_poskeylayout_id set_valuenocheck c_poskeylayout_id c_poskeylayout_id get pos key layout pos function key layout public int getc poskeylayout id integer ii integer get value c poskeylayout id if ii null return 0 return ii int value getc_poskeylayout_id get_value c_poskeylayout_id intvalue set pos key pos function key public void setc poskey id int c poskey id if c poskey id 1 throw new illegal argument exception c poskey id is mandatory set valuenocheck c poskey id new integer c poskey id setc_poskey_id c_poskey_id c_poskey_id illegalargumentexception c_poskey_id set_valuenocheck c_poskey_id c_poskey_id get pos key pos function key public int getc poskey id integer ii integer get value c poskey id if ii null return 0 return ii int value getc_poskey_id get_value c_poskey_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue static create ui param c component return compiere toggle button ui public static componentui createui j component c return s togglebuttonui togglebutton jcomponent s_togglebuttonui install defaults param b public void install defaults abstract button b super install defaults b b set opaque false installdefaults abstractbutton installdefaults setopaque update this method is invoked by code j component code when the specified component is being painted by default this method will fill the specified component with its background color if its code opaque code property is code true code and then immediately call code paint code param g the code graphics code context in which to paint param c the component being painted see paint see javax swing j component paint component public void update graphics g j component c if c is opaque flat background compiere color get default background paint g c compiere utils fill rectange graphics2d g c compiere look and feel round paint g c jcomponent jcomponent paintcomponent jcomponent isopaque compierecolor getdefaultbackground compiereutils fillrectange compierelookandfeel paint 3d box param g graphics param c component public void paint graphics g j component c super paint g c abstract button b abstract button c button model model b get model boolean in model is pressed model is selected compiere utils paint3 deffect graphics2d g c compiere look and feel round in jcomponent abstractbutton abstractbutton buttonmodel getmodel ispressed isselected compiereutils paint3deffect compierelookandfeel don t get selected color use default otherwise the pressed button is gray param g param b protected void paint button pressed graphics g abstract button b if b is content area filled dimension size b get size g set color get select color g fill rect 0 0 size width size height paintbuttonpressed abstractbutton iscontentareafilled getsize setcolor getselectcolor fillrect prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m warehouse id p m warehouse id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals replenishment create p replenishmentcreate string para i get parameter else if name equals c doctype id p c doctype id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter m_warehouse_id p_m_warehouse_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint replenishmentcreate p_replenishmentcreate getparameter c_doctype_id p_c_doctype_id getparameterasint perrform process return message throws exception if not successful protected string do it throws exception log info m warehouse id p m warehouse id c bpartner id p c bpartner id replenishment create p replenishmentcreate c doctype id p c doctype id if p replenishmentcreate null p c doctype id 0 throw new compiere user error fill mandatory c doctype id m warehouse wh m warehouse get get ctx p m warehouse id if wh get id 0 throw new compiere system error fill mandatory m warehouse id prepare table fill table wh if p replenishmentcreate null return ok m doc type dt m doc type get get ctx p c doctype id if dt get doc base type equals p replenishmentcreate throw new compiere system error c doctype id dt get name p replenishmentcreate if p replenishmentcreate equals poo createpo else if p replenishmentcreate equals por create requisition else if p replenishmentcreate equals mmm create movements return m info doit m_warehouse_id p_m_warehouse_id c_bpartner_id p_c_bpartner_id replenishmentcreate p_replenishmentcreate c_doctype_id p_c_doctype_id p_replenishmentcreate p_c_doctype_id compiereusererror fillmandatory c_doctype_id mwarehouse mwarehouse getctx p_m_warehouse_id get_id compieresystemerror fillmandatory m_warehouse_id preparetable filltable p_replenishmentcreate mdoctype mdoctype getctx p_c_doctype_id getdocbasetype p_replenishmentcreate compieresystemerror c_doctype_id getname p_replenishmentcreate p_replenishmentcreate p_replenishmentcreate createrequisition p_replenishmentcreate createmovements m_info prepare check replenishment table private void prepare table level max must be level max string sql update m replenish set level max level min where level max level min int no db execute update sql get trxname if no 0 log fine corrected max level no minimum order should be 1 sql update m product po set order min 1 where order min is null or order min 1 no db execute update sql get trxname if no 0 log fine corrected order min no pack should be 1 sql update m product po set order pack 1 where order pack is null or order pack 1 no db execute update sql get trxname if no 0 log fine corrected order pack no set current vendor where only one vendor sql update m product po p set is current vendor y where is current vendor y and exists select from m product po pp where p m product id pp m product id group by pp m product id having count 1 no db execute update sql get trxname if no 0 log fine corrected current vendor y no more then one current vendor sql update m product po p set is current vendor n where is current vendor y and exists select from m product po pp where p m product id pp m product id and pp is current vendor y group by pp m product id having count 1 no db execute update sql get trxname if no 0 log fine corrected current vendor n no just to be sure sql delete t replenish where ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine delete existing temp no preparetable level_max level_max m_replenish level_max level_min level_max level_min executeupdate get_trxname max_level m_product_po order_min order_min order_min executeupdate get_trxname m_product_po order_pack order_pack order_pack executeupdate get_trxname m_product_po iscurrentvendor iscurrentvendor m_product_po m_product_id m_product_id m_product_id executeupdate get_trxname currentvendor m_product_po iscurrentvendor iscurrentvendor m_product_po m_product_id m_product_id iscurrentvendor m_product_id executeupdate get_trxname currentvendor t_replenish ad_pinstance_id getad_pinstance_id executeupdate get_trxname fill table param wh warehouse private void fill table m warehouse wh throws exception string sql insert into t replenish ad pinstance id m warehouse id m product id ad client id ad org id replenish type level min level max c bpartner id order min order pack qty to order replenishment create select getad pinstance id r m warehouse id r m product id r ad client id r ad org id r replenish type r level min r level max po c bpartner id po order min po order pack 0 if p replenishmentcreate null sql null else sql p replenishmentcreate sql from m replenish r inner join m product po po on r m product id po m product id where po is current vendor y only current vendor and r replenish type 0 and po is active y and r is active y and r m warehouse id p m warehouse id if p c bpartner id 0 sql and po c bpartner id p c bpartner id int no db execute update sql get trxname log finest sql log fine insert 1 no if p c bpartner id 0 sql insert into t replenish ad pinstance id m warehouse id m product id ad client id ad org id replenish type level min level max c bpartner id order min order pack qty to order replenishment create select getad pinstance id r m warehouse id r m product id r ad client id r ad org id r replenish type r level min r level max null 1 1 0 if p replenishmentcreate null sql null else sql p replenishmentcreate sql from m replenish r where r replenish type 0 and r is active y and r m warehouse id p m warehouse id and not exists select from t replenish t where r m product id t m product id and ad pinstance id getad pinstance id no db execute update sql get trxname log fine insert bp no sql update t replenish t set qty on hand select sum qty on hand from m storage s m locator l where t m product id s m product id and l m locator id s m locator id and l m warehouse id t m warehouse id qty reserved select sum qty reserved from m storage s m locator l where t m product id s m product id and l m locator id s m locator id and l m warehouse id t m warehouse id qty ordered select sum qty ordered from m storage s m locator l where t m product id s m product id and l m locator id s m locator id and l m warehouse id t m warehouse id if p c doctype id 0 sql c doctype id p c doctype id sql where ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine update no delete inactive products and replenishments sql delete t replenish r where exists select from m product p where p m product id r m product id and p is active n or exists select from m replenish rr where rr m product id r m product id and rr is active n and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine delete inactive no ensure data consistency sql update t replenish set qty on hand 0 where qty on hand is null no db execute update sql get trxname sql update t replenish set qty reserved 0 where qty reserved is null no db execute update sql get trxname sql update t replenish set qty ordered 0 where qty ordered is null no db execute update sql get trxname set minimum maximum maintain level x m replenish replenishtype reorderbelowminimumlevel sql update t replenish set qty to order level min qty on hand qty reserved qty ordered where replenish type 1 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine update type 1 no x m replenish replenishtype maintainmaximumlevel sql update t replenish set qty to order level max qty on hand qty reserved qty ordered where replenish type 2 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine update type 2 no delete rows where nothing to order sql delete t replenish where qty to order 1 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine delete no qty to order no minimum order quantity sql update t replenish set qty to order order min where qty to order order min and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine set min order qty no even dividable by pack sql update t replenish set qty to order qty to order mod qty to order order pack order pack where mod qty to order order pack 0 and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine set order pack qty no source from other warehouse if wh getm warehousesource id 0 sql update t replenish set m warehousesource id wh getm warehousesource id where ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine set source warehouse no check source warehouse sql update t replenish set m warehousesource id null where m warehouse id m warehousesource id and ad pinstance id getad pinstance id no db execute update sql get trxname if no 0 log fine set same source warehouse no custom replenishment string class name wh get replenishment class if class name null class name length 0 return get replenishment class replenish interface custom null try class clazz class for name class name custom replenish interface clazz new instance catch exception e throw new compiere user error no custom replenishment class class name e to string x t replenish replenishs get replenish replenish type 9 for int i 0 i replenishs length i x t replenish replenish replenishs i if replenish get replenish type equals x t replenish replenishtype custom big decimal qto null try qto custom get qty to order wh replenish catch exception e log log level severe custom to string e if qto null qto env zero replenish set qty to order qto replenish save filltable mwarehouse t_replenish ad_pinstance_id m_warehouse_id m_product_id ad_client_id ad_org_id replenishtype level_min level_max c_bpartner_id order_min order_pack qtytoorder replenishmentcreate getad_pinstance_id m_warehouse_id m_product_id ad_client_id ad_org_id replenishtype level_min level_max c_bpartner_id order_min order_pack p_replenishmentcreate p_replenishmentcreate m_replenish m_product_po m_product_id m_product_id iscurrentvendor replenishtype isactive isactive m_warehouse_id p_m_warehouse_id p_c_bpartner_id c_bpartner_id p_c_bpartner_id executeupdate get_trxname p_c_bpartner_id t_replenish ad_pinstance_id m_warehouse_id m_product_id ad_client_id ad_org_id replenishtype level_min level_max c_bpartner_id order_min order_pack qtytoorder replenishmentcreate getad_pinstance_id m_warehouse_id m_product_id ad_client_id ad_org_id replenishtype level_min level_max p_replenishmentcreate p_replenishmentcreate m_replenish replenishtype isactive m_warehouse_id p_m_warehouse_id t_replenish m_product_id m_product_id ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_replenish qtyonhand qtyonhand m_storage m_locator m_product_id m_product_id m_locator_id m_locator_id m_warehouse_id m_warehouse_id qtyreserved qtyreserved m_storage m_locator m_product_id m_product_id m_locator_id m_locator_id m_warehouse_id m_warehouse_id qtyordered qtyordered m_storage m_locator m_product_id m_product_id m_locator_id m_locator_id m_warehouse_id m_warehouse_id p_c_doctype_id c_doctype_id p_c_doctype_id ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_replenish m_product m_product_id m_product_id isactive m_replenish m_product_id m_product_id isactive ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_replenish qtyonhand qtyonhand executeupdate get_trxname t_replenish qtyreserved qtyreserved executeupdate get_trxname t_replenish qtyordered qtyordered executeupdate get_trxname x_m_replenish replenishtype_reorderbelowminimumlevel t_replenish qtytoorder level_min qtyonhand qtyreserved qtyordered replenishtype ad_pinstance_id getad_pinstance_id executeupdate get_trxname x_m_replenish replenishtype_maintainmaximumlevel t_replenish qtytoorder level_max qtyonhand qtyreserved qtyordered replenishtype ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_replenish qtytoorder ad_pinstance_id getad_pinstance_id executeupdate get_trxname qtytoorder t_replenish qtytoorder order_min qtytoorder order_min ad_pinstance_id getad_pinstance_id executeupdate get_trxname minorderqty t_replenish qtytoorder qtytoorder qtytoorder order_pack order_pack qtytoorder order_pack ad_pinstance_id getad_pinstance_id executeupdate get_trxname orderpackqty getm_warehousesource_id t_replenish m_warehousesource_id getm_warehousesource_id ad_pinstance_id getad_pinstance_id executeupdate get_trxname t_replenish m_warehousesource_id m_warehouse_id m_warehousesource_id ad_pinstance_id getad_pinstance_id executeupdate get_trxname classname getreplenishmentclass classname classname replenishinterface forname classname replenishinterface newinstance compiereusererror classname tostring x_t_replenish getreplenish replenishtype x_t_replenish getreplenishtype x_t_replenish replenishtype_custom bigdecimal getqtytoorder tostring setqtytoorder create po s private void createpo int no orders 0 string info m order order null m warehouse wh null x t replenish replenishs get replenish m warehousesource id is null for int i 0 i replenishs length i x t replenish replenish replenishs i if wh null wh getm warehouse id replenish getm warehouse id wh m warehouse get get ctx replenish getm warehouse id if order null order getc bpartner id replenish getc bpartner id order getm warehouse id replenish getm warehouse id order new m order get ctx 0 get trxname order set isso trx false order setc doctypetarget id p c doctype id mb partner bp new mb partner get ctx replenish getc bpartner id get trxname order setb partner bp order setsalesrep id getad user id order set description msg get msg get ctx replenishment set org wh order setad org id wh getad org id order setm warehouse id wh getm warehouse id if order save return log fine order to string no orders info order get document no m order line line new m order line order line setm product id replenish getm product id line set qty replenish get qty to order line set price line save m info no orders info log info m info noorders morder mwarehouse x_t_replenish getreplenish m_warehousesource_id x_t_replenish getm_warehouse_id getm_warehouse_id mwarehouse getctx getm_warehouse_id getc_bpartner_id getc_bpartner_id getm_warehouse_id getm_warehouse_id morder getctx get_trxname setissotrx setc_doctypetarget_id p_c_doctype_id mbpartner mbpartner getctx getc_bpartner_id get_trxname setbpartner setsalesrep_id getad_user_id setdescription getmsg getctx setad_org_id getad_org_id setm_warehouse_id getm_warehouse_id tostring noorders getdocumentno morderline morderline setm_product_id getm_product_id setqty getqtytoorder setprice m_info noorders m_info create requisition private void create requisition int no reqs 0 string info m requisition requisition null m warehouse wh null x t replenish replenishs get replenish m warehousesource id is null for int i 0 i replenishs length i x t replenish replenish replenishs i if wh null wh getm warehouse id replenish getm warehouse id wh m warehouse get get ctx replenish getm warehouse id if requisition null requisition getm warehouse id replenish getm warehouse id requisition new m requisition get ctx 0 get trxname requisition setad user id getad user id requisition setc doctype id p c doctype id requisition set description msg get msg get ctx replenishment set org wh requisition setad org id wh getad org id requisition setm warehouse id wh getm warehouse id if requisition save return log fine requisition to string no reqs info requisition get document no m requisition line line new m requisition line requisition line setm product id replenish getm product id line setc bpartner id replenish getc bpartner id line set qty replenish get qty to order line set price line save m info no reqs info log info m info createrequisition noreqs mrequisition mwarehouse x_t_replenish getreplenish m_warehousesource_id x_t_replenish getm_warehouse_id getm_warehouse_id mwarehouse getctx getm_warehouse_id getm_warehouse_id getm_warehouse_id mrequisition getctx get_trxname setad_user_id getad_user_id setc_doctype_id p_c_doctype_id setdescription getmsg getctx setad_org_id getad_org_id setm_warehouse_id getm_warehouse_id tostring noreqs getdocumentno mrequisitionline mrequisitionline setm_product_id getm_product_id setc_bpartner_id getc_bpartner_id setqty getqtytoorder setprice m_info noreqs m_info create inventory movements private void create movements int no moves 0 string info m client client null m movement move null int m warehouse id 0 int m warehousesource id 0 m warehouse wh source null m warehouse wh null x t replenish replenishs get replenish m warehousesource id is not null for int i 0 i replenishs length i x t replenish replenish replenishs i if wh source null wh source getm warehousesource id replenish getm warehousesource id wh source m warehouse get get ctx replenish getm warehousesource id if wh null wh getm warehouse id replenish getm warehouse id wh m warehouse get get ctx replenish getm warehouse id if client null client getad client id wh source getad client id client m client get get ctx wh source getad client id if move null m warehousesource id replenish getm warehousesource id m warehouse id replenish getm warehouse id m warehousesource id replenish getm warehousesource id m warehouse id replenish getm warehouse id move new m movement get ctx 0 get trxname move setc doctype id p c doctype id move set description msg get msg get ctx replenishment wh source get name wh get name set org move setad org id wh source getad org id if move save return log fine move to string no moves info move get document no to int m locatorto id wh get default locator getm locator id from look up storage m product product m product get get ctx replenish getm product id m product category pc m product category get get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy m storage storages m storage get warehouse get ctx wh source getm warehouse id replenish getm product id 0 0 true null m client mmpolicy fifo equals mm policy get trxname big decimal target replenish get qty to order for int j 0 j storages length j m storage storage storages j if storage get qty on hand signum 0 continue big decimal move qty target if storage get qty on hand compare to move qty 0 move qty storage get qty on hand m movement line line new m movement line move line setm product id replenish getm product id line set movement qty move qty if replenish get qty to order compare to move qty 0 line set description total replenish get qty to order line setm locator id storage getm locator id from line setm attributesetinstance id storage getm attributesetinstance id line setm locatorto id m locatorto id to line setm attributesetinstanceto id storage getm attributesetinstance id line save target target subtract move qty if target signum 0 break if replenishs length 0 m info no source warehouse log warning m info else m info no moves info log info m info createmovements nomoves mclient mmovement m_warehouse_id m_warehousesource_id mwarehouse whsource mwarehouse x_t_replenish getreplenish m_warehousesource_id x_t_replenish whsource whsource getm_warehousesource_id getm_warehousesource_id whsource mwarehouse getctx getm_warehousesource_id getm_warehouse_id getm_warehouse_id mwarehouse getctx getm_warehouse_id getad_client_id whsource getad_client_id mclient getctx whsource getad_client_id m_warehousesource_id getm_warehousesource_id m_warehouse_id getm_warehouse_id m_warehousesource_id getm_warehousesource_id m_warehouse_id getm_warehouse_id mmovement getctx get_trxname setc_doctype_id p_c_doctype_id setdescription getmsg getctx whsource getname getname setad_org_id whsource getad_org_id tostring nomoves getdocumentno m_locatorto_id getdefaultlocator getm_locator_id mproduct mproduct getctx getm_product_id mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy mstorage mstorage getwarehouse getctx whsource getm_warehouse_id getm_product_id mclient mmpolicy_fifo mmpolicy get_trxname bigdecimal getqtytoorder mstorage getqtyonhand bigdecimal moveqty getqtyonhand compareto moveqty moveqty getqtyonhand mmovementline mmovementline setm_product_id getm_product_id setmovementqty moveqty getqtytoorder compareto moveqty setdescription getqtytoorder setm_locator_id getm_locator_id setm_attributesetinstance_id getm_attributesetinstance_id setm_locatorto_id m_locatorto_id setm_attributesetinstanceto_id getm_attributesetinstance_id moveqty m_info m_info m_info nomoves m_info get replenish records return replenish private x t replenish get replenish string where string sql select from t replenish where ad pinstance id and c bpartner id 0 if where null where length 0 sql and where sql order by m warehouse id m warehousesource id c bpartner id array list x t replenish list new array list x t replenish prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad pinstance id result set rs pstmt execute query while rs next list add new x t replenish get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null x t replenish ret value new x t replenish list size list to array ret value return ret value x_t_replenish getreplenish t_replenish ad_pinstance_id c_bpartner_id m_warehouse_id m_warehousesource_id c_bpartner_id arraylist x_t_replenish arraylist x_t_replenish preparedstatement preparestatement get_trxname setint getad_pinstance_id resultset executequery x_t_replenish getctx get_trxname x_t_replenish retvalue x_t_replenish toarray retvalue retvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id para i get parameter as int else log log level severe unknown parameter name p record id getrecord id processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id getparameterasint p_record_id getrecord_id process return message throws exception protected string do it throws exception string buffer sql new string buffer int cnt 0 log info set print format try sql append update ad printformat pf set ad printpaper id p record id where exists select from ad printpaper pp where pf ad printpaper id pp ad printpaper id and is landscape select is landscape from ad printpaper where ad printpaper id p record id if p ad client id 1 sql append and ad client id p ad client id cnt db execute update sql to string log info updated cnt columns log fine committing db commit true null catch exception e log log level severe set print format e return copied cnt doit stringbuffer stringbuffer ad_printformat ad_printpaper_id p_record_id ad_printpaper ad_printpaper_id ad_printpaper_id islandscape islandscape ad_printpaper ad_printpaper_id p_record_id p_ad_client_id ad_client_id p_ad_client_id executeupdate tostring get contsnts return contents public object get contents return contents getcontents standard constructor public x m inventory properties ctx int m inventory id string trx name super ctx m inventory id trx name if m inventory id 0 setc doctype id 0 set doc action null co set doc status null dr set document no null set is approved false setm inventory id 0 setm warehouse id 0 set movement date new timestamp system current time millis date set posted false set processed false x_m_inventory m_inventory_id trxname m_inventory_id trxname m_inventory_id setc_doctype_id setdocaction setdocstatus setdocumentno setisapproved setm_inventory_id setm_warehouse_id setmovementdate currenttimemillis setposted setprocessed load constructor public x m inventory properties ctx result set rs string trx name super ctx rs trx name x_m_inventory resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m inventory append get id append return sb to string tostring stringbuffer stringbuffer x_m_inventory get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set approval amount document approval amount public void set approval amt big decimal approval amt set value approval amt approval amt setapprovalamt bigdecimal approvalamt set_value approvalamt approvalamt get approval amount document approval amount public big decimal get approval amt big decimal bd big decimal get value approval amt if bd null return env zero return bd bigdecimal getapprovalamt bigdecimal bigdecimal get_value approvalamt set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set generate list generate list public void set generate list string generate list if generate list null generate list length 1 log warning length 1 truncated generate list generate list substring 0 0 set value generate list generate list setgeneratelist generatelist generatelist generatelist generatelist generatelist set_value generatelist generatelist get generate list generate list public string get generate list return string get value generate list getgeneratelist get_value generatelist set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set phys inventory parameters for a physical inventory public void setm inventory id int m inventory id if m inventory id 1 throw new illegal argument exception m inventory id is mandatory set valuenocheck m inventory id new integer m inventory id setm_inventory_id m_inventory_id m_inventory_id illegalargumentexception m_inventory_id set_valuenocheck m_inventory_id m_inventory_id get phys inventory parameters for a physical inventory public int getm inventory id integer ii integer get value m inventory id if ii null return 0 return ii int value getm_inventory_id get_value m_inventory_id intvalue set perpetual inventory rules for generating physical inventory public void setm perpetualinv id int m perpetualinv id if m perpetualinv id 0 set valuenocheck m perpetualinv id null else set valuenocheck m perpetualinv id new integer m perpetualinv id setm_perpetualinv_id m_perpetualinv_id m_perpetualinv_id set_valuenocheck m_perpetualinv_id set_valuenocheck m_perpetualinv_id m_perpetualinv_id get perpetual inventory rules for generating physical inventory public int getm perpetualinv id integer ii integer get value m perpetualinv id if ii null return 0 return ii int value getm_perpetualinv_id get_value m_perpetualinv_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set movement date date a product was moved in or out of inventory public void set movement date timestamp movement date if movement date null throw new illegal argument exception movement date is mandatory set value movement date movement date setmovementdate movementdate movementdate illegalargumentexception movementdate set_value movementdate movementdate get movement date date a product was moved in or out of inventory public timestamp get movement date return timestamp get value movement date getmovementdate get_value movementdate set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set update quantities public void set update qty string update qty if update qty null update qty length 1 log warning length 1 truncated update qty update qty substring 0 0 set value update qty update qty setupdateqty updateqty updateqty updateqty updateqty updateqty set_value updateqty updateqty get update quantities public string get update qty return string get value update qty getupdateqty get_value updateqty public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue basic constructor public iframe basic constructor param element adds an element to the element public iframe element element add element element addelement basic constructor param element adds an element to the element public iframe string element add element element addelement basic constructor param element adds an element to the element param name the name attribute public iframe element element string name add element element set name name addelement setname basic constructor param element adds an element to the element param name the name attribute public iframe string element string name add element element set name name addelement setname basic constructor param element adds an element to the element param name the name attribute param src the src attribute public iframe element element string name string src add element element set name name set src src addelement setname setsrc basic constructor param element adds an element to the element param name the name attribute param src the src attribute public iframe string element string name string src add element element set name name set src src addelement setname setsrc sets the longdesc attribute param longdesc the longdesc attribute public iframe set long desc string longdesc add attribute longdesc longdesc return this setlongdesc addattribute sets the name attribute param name the name attribute public iframe set name string name add attribute name name return this setname addattribute sets the src attribute param src the src attribute public iframe set src string src add attribute src src return this setsrc addattribute sets the frameborder attribute param frameborder the frameborder attribute public iframe set frame border boolean frameborder if frameborder add attribute frameborder integer to string 1 else add attribute frameborder integer to string 0 return this setframeborder addattribute tostring addattribute tostring sets the marginwidth attribute param marginwidth the marginwidth attribute public iframe set margin width int marginwidth set margin width integer to string marginwidth return this setmarginwidth setmarginwidth tostring sets the marginwidth attribute param marginwidth the marginwidth attribute public iframe set margin width string marginwidth add attribute marginwidth marginwidth return this setmarginwidth addattribute sets the height attribute param height the height attribute public iframe set height string height add attribute height height return this setheight addattribute sets the height attribute param height the height attribute public iframe set height int height add attribute height integer to string height return this setheight addattribute tostring sets the width attribute param width the width attribute public iframe set width string width add attribute width width return this setwidth addattribute sets the width attribute param width the width attribute public iframe set width int width add attribute width integer to string width return this setwidth addattribute tostring sets the marginheight attribute param marginheight the marginheight attribute public iframe set margin height int marginheight set margin height integer to string marginheight return this setmarginheight setmarginheight tostring sets the marginheight attribute param marginheight the marginheight attribute public iframe set margin height string marginheight add attribute marginheight marginheight return this setmarginheight addattribute sets the scrolling attribute param scrolling the scrolling attribute public iframe set scrolling string scrolling add attribute scrolling scrolling return this setscrolling addattribute sets the align attribute param align sets the align attribute you can use the align type variables for convience public iframe set align string align add attribute align align return this aligntype setalign addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public iframe add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public iframe add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public iframe add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public iframe add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public iframe remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry get logger param class name class name return logger public static synchronized c logger getc logger string class name c log mgt initialize log manager manager log manager get log manager if class name null class name logger result manager get logger class name if result null result instanceof c logger return c logger result c logger new logger new c logger class name null new logger set level c log mgt get level manager add logger new logger return new logger classname clogger getclogger classname clogmgt logmanager logmanager getlogmanager classname classname getlogger classname clogger clogger clogger newlogger clogger classname newlogger setlevel clogmgt getlevel addlogger newlogger newlogger get logger param clazz class name return logger public static c logger getc logger class clazz if clazz null return get return getc logger clazz get name clogger getclogger getclogger getname get default compiere logger need to be used in serialized objects return logger public static c logger get if s logger null s logger getc logger org compiere default return s logger clogger s_logger s_logger getclogger s_logger standard constructor param name logger name param resource bundle name optional resource bundle ignored private c logger string name string resource bundle name super name resource bundle name set level level all resourcebundlename clogger resourcebundlename resourcebundlename setlevel set and issue error and save as value name pair param ad message message key param message clear text message return true to avoid removal of method public boolean save error string ad message string message return save error ad message message true valuenamepair ad_message saveerror ad_message saveerror ad_message set and issue error and save as value name pair param ad message message key param ex exception return true to avoid removal of method public boolean save error string ad message exception ex s lastexception ex return save error ad message ex get localized message true valuenamepair ad_message saveerror ad_message s_lastexception saveerror ad_message getlocalizedmessage set error and save as value name pair param ad message message key param message clear text message param issue error print error message default true return true public boolean save error string ad message string message boolean issue error s lasterror new value name pair ad message message print it if issue error severe ad message message return true valuenamepair ad_message issueerror saveerror ad_message issueerror s_lasterror valuenamepair ad_message issueerror ad_message get error from stack return ad message as value and message as string public static value name pair retrieve error value name pair vp s lasterror s lasterror null return vp ad_message valuenamepair retrieveerror valuenamepair s_lasterror s_lasterror get error from stack return last exception public static exception retrieve exception exception ex s lastexception s lastexception null return ex retrieveexception s_lastexception s_lastexception save warning as value name pair param ad message message key param message clear text message return true public boolean save warning string ad message string message s lastwarning new value name pair ad message message return true valuenamepair ad_message savewarning ad_message s_lastwarning valuenamepair ad_message get warning from stack return ad message as value and message as string public static value name pair retrieve warning value name pair vp s lastwarning s lastwarning null return vp ad_message valuenamepair retrievewarning valuenamepair s_lastwarning s_lastwarning save info as value name pair param ad message message key param message clear text message return true public boolean save info string ad message string message s lastinfo new value name pair ad message message return true valuenamepair ad_message saveinfo ad_message s_lastinfo valuenamepair ad_message get info from stack return ad message as value and message as string public static value name pair retrieve info value name pair vp s lastinfo s lastinfo null return vp ad_message valuenamepair retrieveinfo valuenamepair s_lastinfo s_lastinfo string representation return info public string to string string buffer sb new string buffer c logger sb append get name append level append get level append return sb to string tostring stringbuffer stringbuffer clogger getname getlevel tostring initialize global variables param config servlet configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception payment servlet init servletexception servletconfig servletexception webenv initweb servletexception paymentservlet get servlet information return info public string get servlet info return a dempiere payment servlet getservletinfo adempiere clean up resources public void destroy log info process the initial http get request reads the parameter amt and optional c invoice id param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message w env dump session w env dump request non existing user or existing web payment web user wu web user session get attribute web user name m payment p m payment session get attribute attr payment if wu null log info no user string url index jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response remove any open order session remove attribute web order name payment amount string amt param web util get parameter request amt if amt param null amt param length 0 log info no payment amount amt param do post request response return char chars amt param to char array string buffer sb new string buffer boolean decimal false for int i chars length 1 i 0 i char c chars i if c c if decimal sb insert 0 decimal true else if character is digit c sb insert 0 c big decimal amt null try if sb length 0 amt new big decimal sb to string amt amt abs make it positive catch exception ex log warning parsing amount amt param sb ex to string need to be positive amount if amt null amt compare to env zero 0 log info no valid payment amount amt param amt do post request response return string invoice param web util get parameter request c invoice id int c invoice id 0 try if invoice param null c invoice id integer parse int invoice param catch number format exception ex log warning parsing c invoice id invoice param ex to string log info amt amt c invoice id c invoice id create new payment for amt optional invoice see order servlet create payment p new m payment ctx 0 null p setad org id p set is self service true p set amount 0 amt for cc selection ges default from acct currency p set is online true sales cc trx p setc doctype id true p set trx type m payment trxtype sales p set tender type m payment tendertype creditcard payment info p setc invoice id c invoice id bp info p setbp bankaccount wu get bank account p save session set attribute attr payment p string url payment info jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response c_invoice_id servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession removeattribute websessionctx hdr_message wenv wenv webuser webuser getattribute webuser mpayment mpayment getattribute attr_payment requestdispatcher getservletcontext getrequestdispatcher removeattribute weborder amtparam webutil getparameter amtparam amtparam amtparam dopost amtparam tochararray stringbuffer stringbuffer isdigit bigdecimal bigdecimal tostring amtparam tostring compareto amtparam dopost invoiceparam webutil getparameter c_invoice_id c_invoice_id invoiceparam c_invoice_id parseint invoiceparam numberformatexception c_invoice_id invoiceparam tostring c_invoice_id c_invoice_id orderservlet createpayment mpayment setad_org_id setisselfservice setamount setisonline setc_doctype_id settrxtype mpayment trxtype_sales settendertype mpayment tendertype_creditcard setc_invoice_id c_invoice_id setbp_bankaccount getbankaccount setattribute attr_payment paymentinfo requestdispatcher getservletcontext getrequestdispatcher process the http post request the actual payment processing param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true w env dump session w env dump request web user payment web user wu web user session get attribute web user name m payment p m payment session get attribute attr payment web order wo web order session get attribute web order name string url null if wu null p null url index jsp else if process payment request ctx p wu wo url confirm jsp else url payment info jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession wenv wenv webuser webuser getattribute webuser mpayment mpayment getattribute attr_payment weborder weborder getattribute weborder processpayment paymentinfo requestdispatcher getservletcontext getrequestdispatcher process payment param request request param ctx context param payment payment param wu web user param wo web order optional return true if processed private boolean process payment http servlet request request properties ctx m payment payment web user wu web order wo boolean ok process parameter request ctx payment wu if ok if negative amount make it positive if payment get pay amt compare to env zero 0 payment set pay amt payment get pay amt abs ok payment process online if ok process web order and set invoice id if wo null if wo is completed wo process payment if wo is completed log warning order not processed wo else log warning no order payment process it doc action action complete payment save send thankse mail request ctx payment wu wo else log fine payment get error message string err msg payment get error message payment save payment set error message err msg request get session set attribute web session ctx hdr message err msg send declinee mail request payment wu wo return ok processpayment httpservletrequest mpayment webuser weborder processparameter getpayamt compareto setpayamt getpayamt processonline iscompleted iscompleted processit docaction action_complete sendthanksemail geterrormessage errmsg geterrormessage seterrormessage errmsg getsession setattribute websessionctx hdr_message errmsg senddeclineemail process parameter and check them param request request param ctx context param p payment param wu web user return true if processed private boolean process parameter http servlet request request properties ctx m payment p web user wu string buffer sb new string buffer p set tender type m payment tendertype creditcard p set trx type m payment trxtype sales p seta email wu get email cc number string cc type web util get parameter request credit card p set credit card type cc type string cc number web util get parameter request credit card number p set credit card number cc number string ad message m payment validate validate credit card number cc number cc type if ad message length 0 sb append msg get msg ctx ad message append optional verification code string ccvv web util get parameter request credit cardvv p set credit cardvv ccvv if ccvv null ccvv length 0 ad message m payment validate validate credit cardvv ccvv cc type if ad message length 0 sb append msg get msg ctx ad message append exp int mm web util get parameter as int request credit card expmm p set credit card expmm mm int yy web util get parameter as int request credit card expyy p set credit card expyy yy ad message m payment validate validate credit card exp mm yy if ad message length 0 sb append msg get msg ctx ad message append account info string a name web util get parameter request a name if a name null a name length 0 sb append name else p seta name a name string a street web util get parameter request a street p seta street a street string a city web util get parameter request a city if a city null a city length 0 sb append city else p seta city a city string a state web util get parameter request a state p seta state a state string a zip web util get parameter request a zip if a zip null a zip length 0 sb append zip else p seta zip a zip string a country web util get parameter request a country p seta country a country error message boolean ok sb length 0 p set error message sb to string always set save bp bank account if ok string sp save payment string save payment web util get parameter request sp if sp equals save payment p savetobp bankaccount wu get bank account return ok processparameter httpservletrequest mpayment webuser stringbuffer stringbuffer settendertype mpayment tendertype_creditcard settrxtype mpayment trxtype_sales seta_email getemail cctype webutil getparameter creditcard setcreditcardtype cctype ccnumber webutil getparameter creditcardnumber setcreditcardnumber ccnumber ad_message mpaymentvalidate validatecreditcardnumber ccnumber cctype ad_message getmsg ad_message webutil getparameter creditcardvv setcreditcardvv ad_message mpaymentvalidate validatecreditcardvv cctype ad_message getmsg ad_message webutil getparameterasint creditcardexpmm setcreditcardexpmm webutil getparameterasint creditcardexpyy setcreditcardexpyy ad_message mpaymentvalidate validatecreditcardexp ad_message getmsg ad_message aname webutil getparameter a_name aname aname seta_name aname astreet webutil getparameter a_street seta_street astreet acity webutil getparameter a_city acity acity seta_city acity astate webutil getparameter a_state seta_state astate azip webutil getparameter a_zip azip azip seta_zip azip acountry webutil getparameter a_country seta_country acountry seterrormessage tostring savepayment savepayment webutil getparameter savepayment savetobp_bankaccount getbankaccount send payment e mail param request request param p payment param wu web user param wo optional web order private void send thankse mail http servlet request request properties ctx m payment p web user wu web order wo string buffer message new string buffer append p get pay amt append append msg get element ctx r pnref append append p getr pnref append if wo null message append n append msg get element ctx c order id append append wo get document no jsp env sende mail request wu m mail msg mailmsgtype paymentacknowledgement new object p get document no p get pay amt wu get name message to string sales rep e mail if wo null wo getsalesrep id 0 m client client m client get ctx client sende mail wo getsalesrep id cc payment p get document no p get pay amt order wo get document no n user wu get name wu get email null email sendthanksemail httpservletrequest mpayment webuser weborder stringbuffer stringbuffer getpayamt getelement r_pnref getr_pnref getelement c_order_id getdocumentno jspenv sendemail mmailmsg mailmsgtype_paymentacknowledgement getdocumentno getpayamt getname tostring salesrep email getsalesrep_id mclient mclient sendemail getsalesrep_id getdocumentno getpayamt getdocumentno nuser getname getemail send payment e mail param request request param p payment param wu web user private void send declinee mail http servlet request request m payment p web user wu web order wo string buffer message new string buffer p get error message append append p get currencyiso append append p get pay amt append reference append p getr pnref append if wo null message append nfor order append wo get document no jsp env sende mail request wu m mail msg mailmsgtype paymenterror new object p get document no p get currencyiso p get pay amt wu get name message to string email senddeclineemail httpservletrequest mpayment webuser weborder stringbuffer stringbuffer geterrormessage getcurrencyiso getpayamt getr_pnref getdocumentno jspenv sendemail mmailmsg mailmsgtype_paymenterror getdocumentno getcurrencyiso getpayamt getname tostring public c menu item super c menu item cmenuitem cmenuitem c menu item public c menu item icon icon super icon c menu item cmenuitem cmenuitem cmenuitem c menu item public c menu item string text super text c menu item cmenuitem cmenuitem cmenuitem c menu item public c menu item action a super a c menu item cmenuitem cmenuitem cmenuitem c menu item public c menu item string text icon icon super text icon c menu item cmenuitem cmenuitem cmenuitem c menu item public c menu item string text int mnemonic super text mnemonic c menu item cmenuitem cmenuitem cmenuitem set text param text text public void set text string text if text null super set text text return int pos text index of if pos 1 text length pos we have a nemonic creates alt int mnemonic text to upper case char at pos 1 if mnemonic set mnemonic mnemonic text text substring 0 pos text substring pos 1 super set text text if get name null set name text settext settext indexof _ touppercase charat setmnemonic settext getname setname product locator asi modified set attribute set instance param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string product properties ctx int window no m tab m tab m field m field object value if is callout active return integer inventory line integer m tab get value m inventoryline id if inventory line null inventory line int value 0 return new line get book value int m product id 0 integer product integer m tab get value m product id if product null m product id product int value if m product id 0 return int m locator id 0 integer locator integer m tab get value m locator id if locator null m locator id locator int value if m locator id 0 return set callout active true set attribute int m attributesetinstance id 0 integer asi integer m tab get value m attributesetinstance id if asi null m attributesetinstance id asi int value product selection if env get context as int ctx env window info env tab info m product id m product id m attributesetinstance id env get context as int ctx env window info env tab info m attributesetinstance id if m attributesetinstance id 0 m tab set value m attributesetinstance id new integer m attributesetinstance id else m tab set value m attributesetinstance id null set qty book from first storage location big decimal bd null string sql select qty on hand from m storage where m product id 1 and m locator id 2 and m attributesetinstance id if m attributesetinstance id 0 sql select sum qty on hand from m storage where m product id 1 and m locator id 2 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m product id pstmt set int 2 m locator id if m attributesetinstance id 0 pstmt set int 3 m attributesetinstance id result set rs pstmt execute query if rs next bd rs get big decimal 1 if bd null m tab set value qty book bd rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message log info m product id m product id m locator id m locator id m attributesetinstance id m attributesetinstance id qty book bd set callout active false return windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive inventoryline mtab getvalue m_inventoryline_id inventoryline inventoryline intvalue m_product_id mtab getvalue m_product_id m_product_id intvalue m_product_id m_locator_id mtab getvalue m_locator_id m_locator_id intvalue m_locator_id setcalloutactive m_attributesetinstance_id mtab getvalue m_attributesetinstance_id m_attributesetinstance_id intvalue getcontextasint window_info tab_info m_product_id m_product_id m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id m_attributesetinstance_id mtab setvalue m_attributesetinstance_id m_attributesetinstance_id mtab setvalue m_attributesetinstance_id qtybook bigdecimal qtyonhand m_storage m_product_id m_locator_id m_attributesetinstance_id m_attributesetinstance_id qtyonhand m_storage m_product_id m_locator_id preparedstatement preparestatement setint m_product_id setint m_locator_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery getbigdecimal mtab setvalue qtybook sqlexception setcalloutactive getlocalizedmessage m_product_id m_product_id m_locator_id m_locator_id m_attributesetinstance_id m_attributesetinstance_id qtybook setcalloutactive constructor loads attachment if id 0 param frame frame param window no window no param ad attachment id attachment param ad table id table param record id record key public attachment frame frame int window no int ad attachment id int ad table id int record id string trx name super frame msg get msg env get ctx attachment true needs to be modal otherwise a panel does not recongize change log config attachment id ad attachment id table ad table id record record id m windowno window no try jb init catch exception ex log log level severe attachment ex create model if ad attachment id 0 m attachment new m attachment env get ctx ad table id record id trx name else m attachment new m attachment env get ctx ad attachment id trx name load attachments try a env show center window frame this catch exception e text request focus windowno ad_attachment_id ad_table_id record_id windowno ad_attachment_id ad_table_id record_id trxname getmsg getctx apanel ad_attachment_id ad_table_id record_id m_windowno windowno jbinit ad_attachment_id m_attachment mattachment getctx ad_table_id record_id trxname m_attachment mattachment getctx ad_attachment_id trxname loadattachments aenv showcenterwindow requestfocus static setup pre north panel tool bar title center pane split graph panel left gif scroll gif panel pdf viewer text right confirm panel pre throws exception void jb init throws exception main panel set layout main layout main layout set hgap 5 main layout set vgap 5 this get content pane add main panel north panel set layout north layout north panel add tool bar border layout center tool bar add b load tool bar add b delete tool bar add b save tool bar add b open tool bar add cb content main panel add north panel border layout north b open set enabled false b open set icon env get image icon editor24 gif b open set margin new insets 0 2 0 2 b open set tool tip text msg get msg env get ctx open b open add action listener this b save set enabled false b save set icon env get image icon export24 gif b save set margin new insets 0 2 0 2 b save set tool tip text msg get msg env get ctx attachment save b save add action listener this b load set icon env get image icon import24 gif b load set margin new insets 0 2 0 2 b load set tool tip text msg get msg env get ctx load b load add action listener this b delete set icon env get image icon delete24 gif b delete set margin new insets 0 2 0 2 b delete set tool tip text msg get msg env get ctx delete b delete add action listener this dimension size cb content get preferred size size width 200 cb content set preferred size size cb content set tool tip text text cb content add action listener this cb content set light weight popup enabled false acrobat panel is heavy text set background compiereplaf get info background text set preferred size new dimension 200 200 main panel add confirm panel border layout south confirm panel add action listener this b delete all confirm panel create delete button true confirm panel add button b delete all b delete all add action listener this info set text info set read write false graph panel add info border layout center main panel add center pane border layout center center pane add graph panel j split pane left center pane add text j split pane right center pane set resize weight 75 more to graph northpanel toolbar centerpane graphpanel gifscroll gifpanel pdfviewer confirmpanel jbinit mainpanel setlayout mainlayout mainlayout sethgap mainlayout setvgap getcontentpane mainpanel northpanel setlayout northlayout northpanel toolbar borderlayout toolbar bload toolbar bdelete toolbar bsave toolbar bopen toolbar cbcontent mainpanel northpanel borderlayout bopen setenabled bopen seticon getimageicon bopen setmargin bopen settooltiptext getmsg getctx bopen addactionlistener bsave setenabled bsave seticon getimageicon bsave setmargin bsave settooltiptext getmsg getctx attachmentsave bsave addactionlistener bload seticon getimageicon bload setmargin bload settooltiptext getmsg getctx bload addactionlistener bdelete seticon getimageicon bdelete setmargin bdelete settooltiptext getmsg getctx bdelete addactionlistener cbcontent getpreferredsize cbcontent setpreferredsize cbcontent settooltiptext cbcontent addactionlistener cbcontent setlightweightpopupenabled setbackground getinfobackground setpreferredsize mainpanel confirmpanel borderlayout confirmpanel addactionlistener bdeleteall confirmpanel createdeletebutton confirmpanel addbutton bdeleteall bdeleteall addactionlistener settext setreadwrite graphpanel borderlayout mainpanel centerpane borderlayout centerpane graphpanel jsplitpane centerpane jsplitpane centerpane setresizeweight dispose public void dispose pdf viewer null super dispose pdfviewer load attachments private void load attachments log config set text description string s text m attachment get text msg if s text null text set text else text set text s text set combo int size m attachment get entry count for int i 0 i size i cb content add item m attachment get entry name i if size 0 cb content set selected index 0 else display data 0 loadattachments stext m_attachment gettextmsg stext settext settext stext m_attachment getentrycount cbcontent additem m_attachment getentryname cbcontent setselectedindex displaydata display gif or jpg in gif panel param index index private void display data int index m attachment entry entry m attachment get entry index log config index index entry reset ui gif panel set image null graph panel remove all b delete set enabled false b open set enabled false b save set enabled false dimension size null no attachment if entry null entry get data null info set text else b open set enabled true b save set enabled true b delete set enabled true log config entry to stringx info set text entry to stringx if entry ispdf pdf viewer null try pdf viewer loadpdf entry get input stream pdf viewer set scale 50 size pdf viewer get preferred size size width math min size width 400 size height math min size height 400 graph panel add pdf viewer border layout center catch exception e log log level severe pdf e else if entry is graphic can we display it image image toolkit get default toolkit create image entry get data if image null gif panel set image image size gif panel get preferred size if size width 1 size height 1 log log level severe invalid image else size width 40 size height 40 graph panel add gif scroll border layout center else log log level severe could not create image if graph panel get component count 0 graph panel add info border layout center log config size size graph panel set preferred size size center pane set divider location size width 30 size width 100 size height 100 center pane set preferred size size pack gifpanel displaydata mattachmententry m_attachment getentry gifpanel setimage graphpanel removeall bdelete setenabled bopen setenabled bsave setenabled getdata settext bopen setenabled bsave setenabled bdelete setenabled tostringx settext tostringx pdfviewer pdfviewer getinputstream pdfviewer setscale pdfviewer getpreferredsize graphpanel pdfviewer borderlayout isgraphic getdefaulttoolkit createimage getdata gifpanel setimage gifpanel getpreferredsize graphpanel gifscroll borderlayout graphpanel getcomponentcount graphpanel borderlayout graphpanel setpreferredsize centerpane setdividerlocation centerpane setpreferredsize get file name with index param index index return file name or null private string get file name int index string file name null if cb content get item count index file name string cb content get item at index return file name getfilename filename cbcontent getitemcount filename cbcontent getitemat filename action listener param e event public void action performed action event e log config attachment action performed e get action command save and close if e get action command equals confirm panel a ok string new text text get text if new text null new text string old text m attachment get text msg if old text null old text if m change m change new text equals old text if new text length 0 m attachment get entry count 0 if m change m attachment set text msg text get text m attachment save else m attachment delete true dispose cancel else if e get action command equals confirm panel a cancel dispose delete attachment else if e get source b delete all delete attachment dispose delete individual entry and return else if e get source b delete delete attachment entry show data else if e get source cb content display data cb content get selected index load attachment else if e get source b load load file open attachment else if e get source b save save attachment to file open attachment else if e get source b open if open attachment save attachment to file actionperformed actionevent actionperformed getactioncommand getactioncommand confirmpanel a_ok newtext gettext newtext newtext oldtext m_attachment gettextmsg oldtext oldtext m_change m_change newtext oldtext newtext m_attachment getentrycount m_change m_attachment settextmsg gettext m_attachment m_attachment getactioncommand confirmpanel a_cancel getsource bdeleteall deleteattachment getsource bdelete deleteattachmententry getsource cbcontent displaydata cbcontent getselectedindex getsource bload loadfile getsource bsave saveattachmenttofile getsource bopen openattachment saveattachmenttofile load file for attachment private void load file log info j file chooser chooser new j file chooser chooser set dialog type j file chooser open dialog chooser set dialog title msg get msg env get ctx attachment new int return val chooser show open dialog this if return val j file chooser approve option return string file name chooser get selected file get name log config file name file file chooser get selected file if m attachment add entry file cb content add item file name cb content set selected index cb content get item count 1 m change true loadfile jfilechooser jfilechooser setdialogtype jfilechooser open_dialog setdialogtitle getmsg getctx attachmentnew returnval showopendialog returnval jfilechooser approve_option filename getselectedfile getname filename getselectedfile m_attachment addentry cbcontent additem filename cbcontent setselectedindex cbcontent getitemcount m_change delete entire attachment private void delete attachment log info if a dialog ask m windowno this attachment delete m attachment delete true deleteattachment adialog m_windowno attachmentdelete m_attachment delete attachment entry private void delete attachment entry log info int index cb content get selected index string file name get file name index if file name null return if a dialog ask m windowno this attachment delete entry file name if m attachment delete entry index cb content remove item at index m change true deleteattachmententry cbcontent getselectedindex filename getfilename filename adialog m_windowno attachmentdeleteentry filename m_attachment deleteentry cbcontent removeitemat m_change save attachment to file private void save attachment to file int index cb content get selected index log info index index if m attachment get entry count index return string file name get file name index string ext file name substring file name last index of log config ext ext j file chooser chooser new j file chooser chooser set dialog type j file chooser save dialog chooser set dialog title msg get msg env get ctx attachment save file f new file file name chooser set selected file f show dialog int return val chooser show save dialog this if return val j file chooser approve option return file save file chooser get selected file if save file null return log config save to save file get absolute path m attachment get entry file index save file saveattachmenttofile cbcontent getselectedindex m_attachment getentrycount filename getfilename filename filename lastindexof jfilechooser jfilechooser setdialogtype jfilechooser save_dialog setdialogtitle getmsg getctx attachmentsave filename setselectedfile returnval showsavedialog returnval jfilechooser approve_option savefile getselectedfile savefile savefile getabsolutepath m_attachment getentryfile savefile open the temporary file with the application associated with the extension in the file name return true if file was opened with third party application private boolean open attachment int index cb content get selected index byte data m attachment get entry data index if data null return false try string file name system get property java io tmpdir m attachment get entry name index file temp file new file file name m attachment get entry file index temp file if env is windows runtime get runtime exec rundll32 url dll file protocol handler url process p runtime get runtime exec rundll32 shell32 dll shellexec rundll temp file p wait for return true else if env is mac string cmd array new string open temp file get absolute path process p runtime get runtime exec cmd array p wait for return true else other os catch exception e log log level severe e return false openattachment cbcontent getselectedindex m_attachment getentrydata filename getproperty m_attachment getentryname tempfile filename m_attachment getentryfile tempfile iswindows getruntime fileprotocolhandler getruntime shellexec_rundll tempfile waitfor ismac cmdarray tempfile getabsolutepath getruntime cmdarray waitfor graphic image public g image super gimage set image param image image public void set image image image m image image if m image null return media tracker mt new media tracker this mt add image m image 0 try mt wait forid 0 catch exception e dimension dim new dimension m image get width this m image get height this this set preferred size dim setimage m_image m_image mediatracker mediatracker addimage m_image waitforid m_image getwidth m_image getheight setpreferredsize paint param g graphics public void paint graphics g insets in get insets if m image null g draw image m image in left in top this getinsets m_image drawimage m_image update param g graphics public void update graphics g paint g test pdf viewer param args ignored public static void main string args get contsnts return contents public object get contents return contents getcontents e mail processor param client client public e mail processor m client client this client getsmtp host client get request user client get request userpw email emailprocessor mclient getsmtphost getrequestuser getrequestuserpw e mail processor public e mail processor string host string user string password m host host m user user m pass password email emailprocessor m_host m_user m_pass process messages in in box return number of mails processed public int process messages int processed 0 try get session get store processed process in box catch exception e log log level severe process in box e cleanup try if m store is connected m store close catch exception e m store null return processed inbox processmessages getsession getstore processinbox processinbox m_store isconnected m_store m_store get session return session private session get session throws exception if m session null return m session session properties props system get properties props put mail store protocol smtp props put mail transport protocol smtp props put mail host m host props put mail smtp auth true e mail authenticator auth new e mail authenticator m user m pass m session session get default instance props auth m session set debug c log mgt is level finest log fine get session m session return m session getsession m_session m_session getproperties m_host emailauthenticator emailauthenticator m_user m_pass m_session getdefaultinstance m_session setdebug clogmgt islevelfinest getsession m_session m_session get store return store private store get store throws exception if m store null return m store if get session null throw new illegal state exception no session get imap store m store m session get store imap connect m store connect log fine get store m store return m store getstore m_store m_store getsession illegalstateexception m_store m_session getstore m_store getstore m_store m_store process in box return number of processed throws exception private int process in box throws exception folder folder folder folder m store get default folder if folder null throw new illegal state exception no default folder open inbox folder inbox folder get folder inbox if inbox exists throw new illegal state exception no inbox inbox open folder read write log fine process in box inbox get name messages total inbox get message count new inbox get new message count open request folder request folder folder get folder c request if request folder exists request folder create folder holds messages throw new illegal state exception cannot create request folder request folder open folder read write open workflow folder workflow folder folder get folder c workflow if workflow folder exists workflow folder create folder holds messages throw new illegal state exception cannot create workflow folder workflow folder open folder read write open error folder error folder folder get folder compiere error if error folder exists error folder create folder holds messages throw new illegal state exception cannot create error folder error folder open folder read write messages message messages inbox get messages fetch profile fp new fetch profile fp add fetch profile item envelope fp add fetch profile item flags fp add x mailer inbox fetch messages fp int no processed 0 int no error 0 for int i 0 i messages length i for int i messages length 1 i 0 i newest first message msg messages i int result process message msg if result request msg set flag flags flag seen true msg set flag flags flag answered true copy to processed request folder append messages new message msg else if result workflow msg set flag flags flag seen true msg set flag flags flag answered true copy to processed workflow folder append messages new message msg else if result delivery msg set flag flags flag seen true msg set flag flags flag answered true else error error folder append messages new message msg no error delete in in box msg set flag flags flag deleted true message deleted inbox expunge no processed log info process in box total no processed errors no error fini error folder close false request folder close false workflow folder close false inbox close true return no processed inbox processinbox m_store getdefaultfolder illegalstateexception getfolder illegalstateexception read_write processinbox getname getmessagecount getnewmessagecount requestfolder getfolder crequest requestfolder requestfolder holds_messages illegalstateexception requestfolder read_write workflowfolder getfolder cworkflow workflowfolder workflowfolder holds_messages illegalstateexception workflowfolder read_write errorfolder getfolder compiereerror errorfolder errorfolder holds_messages illegalstateexception errorfolder read_write getmessages fetchprofile fetchprofile fetchprofile fetchprofile noprocessed noerror processmessage setflag setflag requestfolder appendmessages setflag setflag workflowfolder appendmessages setflag setflag errorfolder appendmessages noerror inbox setflag noprocessed processinbox noprocessed noerror errorfolder requestfolder workflowfolder noprocessed process message param msg message return type of message private int process message message msg throws exception dump envelope msg dump body msg print out print out get subject msg print out print out get message msg print out string delivery get delivery report msg print out delivery print out if delivery null return delivery unknown return error processmessage dumpenvelope dumpbody printout printout getsubject printout printout getmessage printout getdeliveryreport printout printout get subject param msg message return subject or private string get subject message msg try string str msg get subject if str null return str trim catch messaging exception e log log level severe get subject e return getsubject getsubject messagingexception getsubject get message param msg message return message or private string get message part msg string buffer sb new string buffer try text if msg is mime type text plain sb append msg get content other text e g html xml else if msg is mime type text sb append msg get content nested else if msg is mime type message rfc822 sb append msg get content multi part alternative else if msg is mime type multipart alternative string plain text null string other stuff null multipart mp multipart msg get content int count mp get count for int i 0 i count i part part mp get body part i object content part get content if content null content to string trim length 0 continue if part is mime type text plain plain text content to string else other stuff content to string if plain text null sb append plain text else if other stuff null sb append other stuff multi part else if msg is mime type multipart multipart mp multipart msg get content int count mp get count for int i 0 i count i string str get message mp get body part i if str length 0 if sb length 0 sb append n n sb append str else if we actually want to see the data and it s not a mime type we know fetch it and check its java type object o msg get content if o instanceof string sb append o catch exception e log log level severe get message e return sb to string trim getmessage stringbuffer stringbuffer ismimetype getcontent ismimetype getcontent ismimetype getcontent ismimetype plaintext otherstuff getcontent getcount getbodypart getcontent tostring ismimetype plaintext tostring otherstuff tostring plaintext plaintext otherstuff otherstuff ismimetype getcontent getcount getmessage getbodypart getcontent getmessage tostring get delivery report param msg message return delivery info or null private string get delivery report part msg try if msg is mime type multipart report string delivery message null string other stuff null multipart mp multipart msg get content int count mp get count for int i 0 i count i part part mp get body part i object content part get content if content null continue if part is mime type message delivery message get delivered report detail part else other stuff content to string trim if delivery message null return delivery message return other stuff else if msg is mime type message return get delivered report detail msg catch exception e log log level severe get delivery report e nothing return null getdeliveryreport ismimetype deliverymessage otherstuff getcontent getcount getbodypart getcontent ismimetype deliverymessage getdeliveredreportdetail otherstuff tostring deliverymessage deliverymessage otherstuff ismimetype getdeliveredreportdetail getdeliveryreport get delivered report detail param part mime type message return info or null private string get delivered report detail part part throws exception object content part get content if content null return null string delivery message null if content instanceof input stream string buffer sb new string buffer input stream is input stream content int c while c is read 1 sb append char c delivery message sb to string trim else delivery message content to string trim if delivery message null return null final recipient rfc822 jjanke compiere org int index delivery message index of final recipient if index 1 string final recipient delivery message substring index int at index final recipient index of if at index 1 index final recipient last index of at index if index 1 final recipient final recipient substring index 1 at index final recipient index of if at index 1 index final recipient index of at index if index 1 final recipient final recipient substring 0 index index final recipient index of n if index 1 final recipient final recipient substring 0 index return final recipient trim return delivery message getdeliveredreportdetail getcontent deliverymessage inputstream stringbuffer stringbuffer inputstream inputstream deliverymessage tostring deliverymessage tostring deliverymessage deliverymessage indexof finalrecipient deliverymessage atindex finalrecipient indexof atindex finalrecipient lastindexof atindex finalrecipient finalrecipient atindex finalrecipient indexof atindex finalrecipient indexof atindex finalrecipient finalrecipient finalrecipient indexof finalrecipient finalrecipient finalrecipient deliverymessage print envelope param m message throws exception private void dump envelope message m throws exception print out address a from if a m get from null for int j 0 j a length j print out from a j to string to if a m get recipients message recipient type to null for int j 0 j a length j print out to a j to string subject print out subject m get subject date java util date d m get sent date print out send date d null d to string unknown flags flags flags m get flags string buffer sb new string buffer flags flag sf flags get system flags get the system flags boolean first true for int i 0 i sf length i string s flags flag f sf i if f flags flag answered s answered else if f flags flag deleted s deleted else if f flags flag draft s draft else if f flags flag flagged s flagged else if f flags flag recent s recent else if f flags flag seen s seen else continue skip it if first first false else sb append sb append s string uf flags get user flags get the user flag strings for int i 0 i uf length i if first first false else sb append sb append uf i print out flags sb to string x mailer string hdrs m get header x mailer if hdrs null string buffer sb1 new string buffer x mailer for int i 0 i hdrs length i sb1 append hdrs i append print out sb1 to string else print out x mailer not available message id hdrs m get header message id if hdrs null string buffer sb1 new string buffer message id for int i 0 i hdrs length i sb1 append hdrs i append print out sb1 to string else print out message id not available all print out all heade rs enumeration en m get all headers while en has more elements header hdr header en next element print out hdr get name hdr get value print out dumpenvelope printout getfrom printout tostring getrecipients recipienttype printout tostring printout getsubject getsentdate printout senddate tostring getflags stringbuffer stringbuffer getsystemflags getuserflags printout tostring getheader stringbuffer stringbuffer printout tostring printout getheader stringbuffer stringbuffer printout tostring printout printout headers getallheaders hasmoreelements nextelement printout getname getvalue printout print body param p throws exception private void dump body part p throws exception http www iana org assignments media types print out print out content type p get content type enumeration en p get all headers while en has more elements header hdr header en next element print out hdr get name hdr get value print out using is mime type to determine the content type avoids fetching the actual content data until we need it if p is mime type text plain print out plain text system out println string p get content else if p get content type to upper case starts with text print out other text system out println string p get content else if p is mime type multipart print out multipart multipart mp multipart p get content int count mp get count for int i 0 i count i dump body mp get body part i else if p is mime type message rfc822 print out nested dump body part p get content else if we actually want to see the data and it s not a mime type we know fetch it and check its java type object o p get content if o instanceof string print out this is a string system out println string o else if o instanceof input stream print out this is just an input stream input stream is input stream o int c while c is read 1 system out write c else print out this is an unknown type print out o to string print out dumpbody printout printout getcontenttype getallheaders hasmoreelements nextelement printout getname getvalue printout ismimetype ismimetype printout getcontent getcontenttype touppercase startswith printout getcontent ismimetype printout getcontent getcount dumpbody getbodypart ismimetype printout dumpbody getcontent getcontent printout inputstream printout inputstream inputstream printout printout tostring printout print param s string private static void print out string s system out print indent str substring 0 level 2 system out println s printout indentstr main test public static void main string arg compiere startup environment true e mail processor m new e mail processor admin test testcompiere m process messages system out println e mail server send main red1 adempiere org red1 yahoo com test1 test1 message system out println e mail server send main administrator adempiere org red1 yahoo com test2 test2 message system out println e mail server send main red1 adempiere org red1 yahoo com test3 test3 message startupenvironment emailprocessor emailprocessor processmessages emailserver emailserver emailserver creates an empty code tabbed pane code with a default tab placement of code j tabbed pane top code and default tab layout policy of code j tabbed pane wrap tab layout code public c tabbed pane super init tabbedpane jtabbedpane jtabbedpane wrap_tab_layout ctabbedpane creates an empty code tabbed pane code with the specified tab placement of either code j tabbed pane top code code j tabbed pane bottom code code j tabbed pane left code or code j tabbed pane right code and a default tab layout policy of code j tabbed pane wrap tab layout code param tab placement the placement for the tabs relative to the content public c tabbed pane int tab placement super tab placement init tabbedpane jtabbedpane jtabbedpane jtabbedpane jtabbedpane jtabbedpane wrap_tab_layout tabplacement ctabbedpane tabplacement tabplacement creates an empty code tabbed pane code with the specified tab placement and tab layout policy tab placement may be either code j tabbed pane top code code j tabbed pane bottom code code j tabbed pane left code or code j tabbed pane right code tab layout policy may be either code j tabbed pane wrap tab layout code or code j tabbed pane scroll tab layout code param tab placement the placement for the tabs relative to the content param tab layout policy the policy for laying out tabs when all tabs will not fit on one run exception illegal argument exception if tab placement or tab layout policy are not one of the above supported values public c tabbed pane int tab placement int tab layout policy super tab placement tab layout policy init tabbedpane jtabbedpane jtabbedpane jtabbedpane jtabbedpane jtabbedpane wrap_tab_layout jtabbedpane scroll_tab_layout tabplacement tablayoutpolicy illegalargumentexception ctabbedpane tabplacement tablayoutpolicy tabplacement tablayoutpolicy creates an empty code tabbed pane code with a defaults and color param bg color public c tabbed pane compiere color bg super init set background color bg tabbedpane ctabbedpane compierecolor setbackgroundcolor common init private void init set opaque false set font compiereplaf getfont label set foreground compiereplaf gettextcolor label setopaque setfont getfont_label setforeground gettextcolor_label set background ignored by ui param bg ignored public void set background color bg if bg equals get background return super set background bg ignore calls from javax swing look and feel install colors look and feel java 61 if trace get caller class 1 starts with javax set background color new compiere color bg setbackground getbackground setbackground lookandfeel installcolors lookandfeel getcallerclass startswith setbackgroundcolor compierecolor set standard background public void set background color set background color null setbackgroundcolor setbackgroundcolor set background param bg compiere color for background if null set standard background public void set background color compiere color bg if bg null bg compiere panelui get default background set opaque true put client property compiereplaf background bg super set background bg get flat color repaint compierecolor setbackgroundcolor compierecolor compierepanelui getdefaultbackground setopaque putclientproperty setbackground getflatcolor get background return color for background public compiere color get background color try return compiere color get client property compiereplaf background catch exception e system err println client property e get message return null compierecolor getbackgroundcolor compierecolor getclientproperty clientproperty getmessage insert tab if the component is a j panel the backround is set to the default compiere color and opaque if nothing was defined redquired as otherwise a gray background would be pained p inserts a code component code at code index code represented by a code title code and or code icon code either of which may be code null code if code icon code is non code null code and it implements code image icon code a corresponding disabled icon will automatically be created and set on the tabbedpane uses java util vector internally see code insert element at code for details of insertion conventions param text the title with mnemonic to be displayed in this tab param icon the icon to be displayed in this tab param component the component to be displayed when this tab is clicked param tip the tooltip to be displayed for this tab param index the position to insert this new tab public void insert tab string text icon icon component component string tip int index string title text if title starts with html int pos title index of if pos 1 title title substring 0 pos title substring pos 1 enforce tool tip if tip null tip length 0 tip title super insert tab title icon component tip index set component background if component instanceof j panel j panel p j panel component if p get client property compiereplaf background null compiere color set background p p set opaque true set first if index 0 get action map put action select s action if set mnemonic at index text only one set direct if index 9 set mnemonic at index 1 index else if index 9 set mnemonic at index 0 else additional alt 1 0 if index 9 get input map when in focused window put key stroke get key stroke key event vk 1 index event alt mask action select else if index 9 get input map when in focused window put key stroke get key stroke key event vk 0 event alt mask action select jpanel compierecolor imageicon insertelementat inserttab startswith indexof inserttab jpanel jpanel jpanel getclientproperty compierecolor setbackground setopaque getactionmap action_select s_action setmnemonicat setmnemonicat setmnemonicat getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_1 alt_mask action_select getinputmap when_in_focused_window keystroke getkeystroke keyevent vk_0 alt_mask action_select set title at param index index param text title with opt mnemonic public void set title at int index string text string title text if title starts with html int pos title index of if pos 1 we have a nemonic creates alt title title substring 0 pos title substring pos 1 super set title at index title set mnemonic at index text settitleat startswith indexof _ settitleat setmnemonicat set mnemonic for index based on text param index for index param text text public boolean set mnemonic at int index string text logistics remove old while m mnemonic size index 1 m mnemonic add char 0 char key code m mnemonic get index if key code 0 get input map when in focused window remove key stroke get key stroke key code event alt mask m mnemonic set index char 0 if text starts with html int pos text index of if pos 1 text length pos we have a nemonic creates alt key code text to upper case char at pos 1 if key code set mnemonic at index key code m mnemonic set index key code return true key code text to upper case char at 0 if m mnemonic contains key code key code 0 beginning new word int pos text index of while pos 1 text length pos char c text to upper case char at pos 1 if character is letter or digit c m mnemonic contains c key code c break pos text index of pos 1 any character if key code 0 for int i 1 i text length i char c text to upper case char at i if character is letter or digit c m mnemonic contains c key code c break first character fallback if mnemonic 0 mnemonic text to upper case char at 0 if key code 0 set mnemonic at index key code m mnemonic set index key code return false setmnemonicat m_mnemonic m_mnemonic keycode m_mnemonic keycode getinputmap when_in_focused_window keystroke getkeystroke keycode alt_mask m_mnemonic startswith indexof _ keycode touppercase charat keycode setmnemonicat keycode m_mnemonic keycode keycode touppercase charat m_mnemonic keycode keycode indexof touppercase charat isletterordigit m_mnemonic keycode indexof keycode touppercase charat isletterordigit m_mnemonic keycode touppercase charat keycode setmnemonicat keycode m_mnemonic keycode string representation return string representation public string to string string buffer sb new string buffer c tabbed pane sb append super to string compiere color bg get background color if bg null sb append bg to string sb append return sb to string tostring stringbuffer stringbuffer ctabbedpane tostring compierecolor getbackgroundcolor tostring tostring constructor public ct action string action name super action name ctaction actionname actionname public void action performed action event e string key get name if key equals action select e get source instanceof c tabbed pane return c tabbed pane pane c tabbed pane e get source string command e get action command if command null command length 1 return int index command char at 0 1 if index 1 index pane get tab count pane set selected index index else system out println action e actionperformed actionevent getname action_select getsource ctabbedpane ctabbedpane ctabbedpane getsource getactioncommand charat gettabcount setselectedindex constructor param parent frame parent param title title param m warehouse id warehouse key name pair param m locator id locator param m product id product key name pair param c bpartner id bp public p attribute instance j frame parent string title int m warehouse id int m locator id int m product id int c bpartner id super parent msg get msg env get ctx p attribute instance title true init m warehouse id m locator id m product id c bpartner id a env show center window parent this m_warehouse_id m_locator_id m_product_id c_bpartner_id pattributeinstance jframe m_warehouse_id m_locator_id m_product_id c_bpartner_id getmsg getctx pattributeinstance m_warehouse_id m_locator_id m_product_id c_bpartner_id aenv showcenterwindow constructor param parent dialog parent param m warehouse id warehouse key name pair param m locator id locator param m product id product key name pair param c bpartner id bp public p attribute instance j dialog parent string title int m warehouse id int m locator id int m product id int c bpartner id super parent msg get msg env get ctx p attribute instance title true init m warehouse id m locator id m product id c bpartner id a env show center window parent this m_warehouse_id m_locator_id m_product_id c_bpartner_id pattributeinstance jdialog m_warehouse_id m_locator_id m_product_id c_bpartner_id getmsg getctx pattributeinstance m_warehouse_id m_locator_id m_product_id c_bpartner_id aenv showcenterwindow initialization param m warehouse id wh param m locator id loc param m product id product param c bpartner id partner private void init int m warehouse id int m locator id int m product id int c bpartner id log info m warehouse id m warehouse id m locator id m locator id m product id m product id m m warehouse id m warehouse id m m locator id m locator id m m product id m product id try jb init dyn init c bpartner id catch exception e log log level severe e m_warehouse_id m_locator_id m_product_id c_bpartner_id m_warehouse_id m_locator_id m_product_id c_bpartner_id m_warehouse_id m_warehouse_id m_locator_id m_locator_id m_product_id m_product_id m_m_warehouse_id m_warehouse_id m_m_locator_id m_locator_id m_m_product_id m_product_id jbinit dyninit c_bpartner_id static init throws exception private void jb init throws exception main panel set layout main layout this get content pane add main panel border layout center north north panel set layout north layout north panel add show all border layout east show all add action listener this main panel add north panel border layout north center main panel add center scroll pane border layout center center scroll pane get viewport add m table null south main panel add confirm panel border layout south confirm panel add action listener this jbinit mainpanel setlayout mainlayout getcontentpane mainpanel borderlayout northpanel setlayout northlayout northpanel showall borderlayout showall addactionlistener mainpanel northpanel borderlayout mainpanel centerscrollpane borderlayout centerscrollpane getviewport m_table mainpanel confirmpanel borderlayout confirmpanel addactionlistener dynamic init private void dyn init int c bpartner id log config c bpartner id c bpartner id if c bpartner id 0 int shelf life min pct 0 int shelf life min days 0 string sql select bp shelf life min pct bpp shelf life min pct bpp shelf life min days from c bpartner bp left outer join c bpartner product bpp on bp c bpartner id bpp c bpartner id and bpp m product id where bp c bpartner id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m m product id pstmt set int 2 c bpartner id result set rs pstmt execute query if rs next shelf life min pct rs get int 1 bp int pct rs get int 2 bp p if pct 0 overwrite shelf life min days pct shelf life min days rs get int 3 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if shelf life min pct 0 m sqlminlife and coalesce trunc trunc asi guarantee date trunc sys date p guarantee days 100 0 shelf life min pct log config p attribute instance dyn init shelf life min pct shelf life min pct if shelf life min days 0 m sqlminlife and coalesce trunc asi guarantee date trunc sys date 0 shelf life min days log config p attribute instance dyn init shelf life min days shelf life min days b partner 0 m sql m table prepare table s layout s sqlfrom s sqlwhere false s order by asi guarantee date s qty on hand oldest smallest first m table set row selection allowed true m table set multi selection false m table add mouse listener this m table get selection model add list selection listener this refresh dyninit c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id shelflifeminpct shelflifemindays shelflifeminpct shelflifeminpct shelflifemindays c_bpartner c_bpartner_product c_bpartner_id c_bpartner_id m_product_id c_bpartner_id preparedstatement preparestatement setint m_m_product_id setint c_bpartner_id resultset executequery shelflifeminpct getint getint bp_p shelflifemindays shelflifemindays getint shelflifeminpct m_sqlminlife guaranteedate sysdate guaranteedays shelflifeminpct pattributeinstance dyninit shelflifeminpct shelflifeminpct shelflifemindays m_sqlminlife guaranteedate sysdate shelflifemindays pattributeinstance dyninit shelflifemindays shelflifemindays bpartner m_sql m_table preparetable s_layout s_sqlfrom s_sqlwhere guaranteedate qtyonhand m_table setrowselectionallowed m_table setmultiselection m_table addmouselistener m_table getselectionmodel addlistselectionlistener refresh query private void refresh string sql m sql int pos m sql last index of order by if show all is selected sql m sql substring 0 pos m sqlnonzero if m sqlminlife length 0 sql m sqlminlife sql m sql substring pos log finest sql prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m m warehouse id pstmt set int 2 m m product id result set rs pstmt execute query m table load table rs rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null enable buttons m_sql m_sql lastindexof showall isselected m_sql m_sqlnonzero m_sqlminlife m_sqlminlife m_sql preparedstatement preparestatement setint m_m_warehouse_id setint m_m_product_id resultset executequery m_table loadtable enablebuttons action listener param e event public void action performed action event e if e get action command equals confirm panel a ok dispose else if e get action command equals confirm panel a cancel dispose m m attributesetinstance id 1 m m attributesetinstancename null else if e get source show all refresh actionperformed actionevent getactioncommand confirmpanel a_ok getactioncommand confirmpanel a_cancel m_m_attributesetinstance_id m_m_attributesetinstancename getsource showall table selection changed param e event public void value changed list selection event e if e get value is adjusting return enable buttons valuechanged listselectionevent getvalueisadjusting enablebuttons enable set buttons and set id private void enable buttons m m attributesetinstance id 1 m m attributesetinstancename null int row m table get selected row boolean enabled row 1 if enabled integer id m table get selected row key if id null m m attributesetinstance id id int value m m attributesetinstancename string m table get value at row 1 confirm panel getok button set enabled enabled log fine m attributesetinstance id m m attributesetinstance id m m attributesetinstancename enablebuttons m_m_attributesetinstance_id m_m_attributesetinstancename m_table getselectedrow m_table getselectedrowkey m_m_attributesetinstance_id intvalue m_m_attributesetinstancename m_table getvalueat confirmpanel getokbutton setenabled m_attributesetinstance_id m_m_attributesetinstance_id m_m_attributesetinstancename mouse clicked param e event public void mouse clicked mouse event e double click with selected row exit if e get click count 1 m table get selected row 1 enable buttons dispose mouseclicked mouseevent getclickcount m_table getselectedrow enablebuttons get attribute set instance return m attributesetinstance id or 1 public int getm attributesetinstance id return m m attributesetinstance id m_attributesetinstance_id getm_attributesetinstance_id m_m_attributesetinstance_id get instance name return instance name public string getm attributesetinstancename return m m attributesetinstancename getm_attributesetinstancename m_m_attributesetinstancename get context from session param request request return properties public static properties get ctx http servlet request request web session ctx wsc web session ctx get request http session session request get session true add set current user web user wu web user get request if wu null int ad user id wu getad user id env set context wsc ctx ad user id ad user id security finish session set max inactive interval 1800 30 min hardcoded string info string wsc ctx get web session ctx hdr info if info null session set attribute web session ctx hdr info info return wsc ctx getctx httpservletrequest websessionctx websessionctx httpsession getsession webuser webuser ad_user_id getad_user_id setcontext ad_user_id ad_user_id setmaxinactiveinterval websessionctx hdr_info setattribute websessionctx hdr_info get web user from cookie param request request with cookie return web user or null public static string get cookie web user http servlet request request cookie cookies request get cookies if cookies null return null for int i 0 i cookies length i if cookie name equals cookies i get name return cookies i get value return null getcookiewebuser httpservletrequest getcookies cookie_name getname getvalue add cookie with web user param request request for context path param response response to add cookie param web user email address public static void add cookie web user http servlet request request http servlet response response string web user cookie cookie new cookie cookie name web user cookie set comment a dempiere web user cookie set path request get context path cookie set max age 2592000 30 days in seconds 60 60 24 30 response add cookie cookie webuser addcookiewebuser httpservletrequest httpservletresponse webuser cookie_name webuser setcomment adempiere setpath getcontextpath setmaxage addcookie remove cookie with web user by setting user to param request request for context path param response response to add cookie public static void delete cookie web user http servlet request request http servlet response response cookie cookie new cookie cookie name cookie set comment a dempiere web user cookie set path request get context path cookie set max age 1 second response add cookie cookie _ deletecookiewebuser httpservletrequest httpservletresponse cookie_name setcomment adempiere setpath getcontextpath setmaxage addcookie get remote from info param request request return remore info public static string get from http servlet request request string host request get remote host if host equals request get remote addr host request get remote addr return host getfrom httpservletrequest getremotehost getremoteaddr getremoteaddr send e mail param request request param to web user param msg type see m mail msg mailmsgtype return mail e mail sent ok or error message public static string sende mail http servlet request request web user to string msg type object parameter web session ctx wsc web session ctx get request m store w store wsc wstore m mail msg mail msg w store get mail msg msg type string buffer subject new string buffer mail msg get subject if parameter length 0 parameter 0 null subject append parameter 0 string buffer message new string buffer string hdr w store gete mail footer if hdr null hdr length 0 message append hdr append n message append mail msg get message if parameter length 1 parameter 1 null message append parameter 1 if mail msg get message2 null message append n append mail msg get message2 if parameter length 2 parameter 2 null message append parameter 2 if mail msg get message3 null message append n append mail msg get message3 if parameter length 3 parameter 3 null message append parameter 3 message append m request separator append http append request get server name append request get context path append append w store get name append n append request from append get from request append n string ftr w store gete mail footer if ftr null ftr length 0 message append ftr create mail e mail email w store createe mail to get email subject to string message to string cc order if msg type m mail msg mailmsgtype orderacknowledgement string ordere mail w store get web ordere mail string storee mail w store getw storee mail if ordere mail null ordere mail length 0 ordere mail equals storee mail already bcc email add bcc ordere mail send string ret value email send log m user mail um new m user mail mail msg to getad user id email um save return ret value email msgtype mmailmsg mailmsgtype_ email sent_ok sendemail httpservletrequest webuser msgtype websessionctx websessionctx mstore wstore mmailmsg mailmsg wstore getmailmsg msgtype stringbuffer stringbuffer mailmsg getsubject stringbuffer stringbuffer wstore getemailfooter mailmsg getmessage mailmsg getmessage2 mailmsg getmessage2 mailmsg getmessage3 mailmsg getmessage3 mrequest getservername getcontextpath wstore getname getfrom wstore getemailfooter email wstore createemail getemail tostring tostring msgtype mmailmsg mailmsgtype_orderacknowledgement orderemail wstore getweborderemail storeemail wstore getwstoreemail orderemail orderemail orderemail storeemail addbcc orderemail retvalue musermail musermail mailmsg getad_user_id retvalue standard constructor param ctx context param c rfq topicsubscriber id id public m rfq topic subscriber properties ctx int c rfq topicsubscriber id string trx name super ctx c rfq topicsubscriber id trx name c_rfq_topicsubscriber_id mrfqtopicsubscriber c_rfq_topicsubscriber_id trxname c_rfq_topicsubscriber_id trxname load constructor param ctx context param rs result set public m rfq topic subscriber properties ctx result set rs string trx name super ctx rs trx name mrfqtopicsubscriber resultset trxname trxname get restriction records param requery requery return arry of onlys public m rfq topic subscriber only get restrictions boolean requery if m restrictions null requery return m restrictions array list m rfq topic subscriber only list new array list m rfq topic subscriber only string sql select from c rfq topicsubscriberonly where c rfq topicsubscriber id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc rfq topicsubscriber id result set rs pstmt execute query while rs next list add new m rfq topic subscriber only get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m restrictions new m rfq topic subscriber only list size list to array m restrictions return m restrictions mrfqtopicsubscriberonly getrestrictions m_restrictions m_restrictions arraylist mrfqtopicsubscriberonly arraylist mrfqtopicsubscriberonly c_rfq_topicsubscriberonly c_rfq_topicsubscriber_id preparedstatement preparestatement get_trxname setint getc_rfq_topicsubscriber_id resultset executequery mrfqtopicsubscriberonly getctx get_trxname m_restrictions mrfqtopicsubscriberonly toarray m_restrictions m_restrictions is the product included param m product id product return true if no restrictions or included in positive only list public boolean is included int m product id no restrictions if get restrictions false length 0 return true for int i 0 i m restrictions length i m rfq topic subscriber only restriction m restrictions i if restriction is active continue product if restriction getm product id m product id return true product category if m product category is category restriction getm product category id m product id return true must be on positive list return false m_product_id isincluded m_product_id getrestrictions m_restrictions mrfqtopicsubscriberonly m_restrictions isactive getm_product_id m_product_id mproductcategory iscategory getm_product_category_id m_product_id constructor param parent parent frame param button location lower left corner of the button public v only current days frame parent point button location how long back in history super parent msg get msg env get ctx v only current days true true try jb init catch exception e log log level severe v only current days e this pack button location x int get preferred size get width 2 this set location button location this set visible true buttonlocation vonlycurrentdays buttonlocation getmsg getctx vonlycurrentdays jbinit vonlycurrentdays buttonlocation getpreferredsize getwidth setlocation buttonlocation setvisible static initializer throws exception private void jb init throws exception this set default close operation window constants dispose on close b show all set text msg get msg env get ctx all b show all add action listener this b show all set margin s margin b show year set text msg get msg env get ctx year b show year add action listener this b show year set margin s margin b show month set text msg get msg env get ctx month b show month add action listener this b show month set margin s margin b show week set text msg get msg env get ctx week b show week add action listener this b show week set margin s margin b show day set text msg get msg env get ctx day b show day add action listener this b show day set margin s margin b show day set default capable true main panel add b show day null main panel add b show week null main panel add b show month null main panel add b show year null main panel add b show all null main panel set tool tip text msg get msg env get ctx v only current days false this get content pane add main panel border layout center this get root pane set default button b show day jbinit setdefaultcloseoperation windowconstants dispose_on_close bshowall settext getmsg getctx bshowall addactionlistener bshowall setmargin s_margin bshowyear settext getmsg getctx bshowyear addactionlistener bshowyear setmargin s_margin bshowmonth settext getmsg getctx bshowmonth addactionlistener bshowmonth setmargin s_margin bshowweek settext getmsg getctx bshowweek addactionlistener bshowweek setmargin s_margin bshowday settext getmsg getctx bshowday addactionlistener bshowday setmargin s_margin bshowday setdefaultcapable mainpanel bshowday mainpanel bshowweek mainpanel bshowmonth mainpanel bshowyear mainpanel bshowall mainpanel settooltiptext getmsg getctx vonlycurrentdays getcontentpane mainpanel borderlayout getrootpane setdefaultbutton bshowday action listener param e evant public void action performed action event e if e get source b show day m days 1 else if e get source b show week m days 7 else if e get source b show month m days 31 else if e get source b show year m days 356 else m days 0 all dispose actionperformed actionevent getsource bshowday m_days getsource bshowweek m_days getsource bshowmonth m_days getsource bshowyear m_days m_days get selected number of days return days or 1 for all public int get current days return m days getcurrentdays m_days bank account changed update beginning balance return public string bank account properties ctx int window no m tab m tab m field m field object value if value null return int c bankaccount id integer value int value m bank account ba m bank account get ctx c bankaccount id m tab set value beginning balance ba get current balance return bankaccount windowno mtab mtab mfield mfield c_bankaccount_id intvalue mbankaccount mbankaccount c_bankaccount_id mtab setvalue beginningbalance getcurrentbalance bank stmt amount calculate charge amt stmt amt trx amt interest amt or id charge is entered interest amt stmt amt trx amt charge amt public string amount properties ctx int window no m tab m tab m field m field object value if is callout active return set callout active true get stmt trx big decimal stmt big decimal m tab get value stmt amt if stmt null stmt env zero big decimal trx big decimal m tab get value trx amt if trx null trx env zero big decimal bd stmt subtract trx charge calculate interest if m field get column name equals charge amt big decimal charge big decimal value if charge null charge env zero bd bd subtract charge log trace log l5 ddata interest bd stmt stmt trx trx charge charge m tab set value interest amt bd calculate charge else big decimal interest big decimal m tab get value interest amt if interest null interest env zero bd bd subtract interest log trace log l5 ddata charge bd stmt stmt trx trx interest interest m tab set value charge amt bd set callout active false return bankstmt chargeamt stmtamt trxamt interestamt interestamt stmtamt trxamt chargeamt windowno mtab mtab mfield mfield iscalloutactive setcalloutactive bigdecimal bigdecimal mtab getvalue stmtamt bigdecimal bigdecimal mtab getvalue trxamt bigdecimal mfield getcolumnname chargeamt bigdecimal bigdecimal l5_ddata mtab setvalue interestamt bigdecimal bigdecimal mtab getvalue interestamt l5_ddata mtab setvalue chargeamt setcalloutactive bank stmt payment update transaction amount when payment is selected public string payment properties ctx int window no m tab m tab m field m field object value integer c payment id integer value if c payment id null c payment id int value 0 return big decimal stmt big decimal m tab get value stmt amt if stmt null stmt env zero string sql select pay amt from c payment v where c payment id 1 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c payment id int value result set rs pstmt execute query if rs next big decimal bd rs get big decimal 1 m tab set value trx amt bd if stmt compare to env zero 0 m tab set value stmt amt bd rs close pstmt close catch sql exception e log log level severe bankstmt payment e return e get localized message recalculate amounts amount ctx window no m tab m field value return bankstmt windowno mtab mtab mfield mfield c_payment_id c_payment_id c_payment_id intvalue bigdecimal bigdecimal mtab getvalue stmtamt payamt c_payment_v c_payment_id preparedstatement preparestatement setint c_payment_id intvalue resultset executequery bigdecimal getbigdecimal mtab setvalue trxamt compareto mtab setvalue stmtamt sqlexception bankstmt_payment getlocalizedmessage windowno mtab mfield prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i log fine prepare para i string name para i get parameter name if para i get parameter null else if name equals c bp group id p c bp group id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c allocationhdr id p c allocationhdr id para i get parameter as int else if name equals date acct p dateacct from timestamp para i get parameter p dateacct to timestamp para i getparameter to else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bp_group_id p_c_bp_group_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint c_allocationhdr_id p_c_allocationhdr_id getparameterasint dateacct p_dateacct_from getparameter p_dateacct_to getparameter_to process return message throws exception protected string do it throws exception log info c bp group id p c bp group id c bpartner id p c bpartner id date acct p dateacct from p dateacct to c allocationhdr id p c allocationhdr id m trx trx get trx create trx name alloc reset true int count 0 if p c allocationhdr id 0 m allocation hdr hdr new m allocation hdr get ctx p c allocationhdr id m trx get trx name if delete hdr count m trx close return deleted count selection string buffer sql new string buffer select from c allocationhdr ah where exists select from c allocationline al where ah c allocationhdr id al c allocationhdr id if p c bpartner id 0 sql append and al c bpartner id else if p c bp group id 0 sql append and exists select from c bpartner bp where bp c bpartner id al c bpartner id and bp c bp group id else sql append and ad client id if p dateacct from null sql append and trim ah date acct if p dateacct to null sql append and trim ah date acct do not delete cash trx sql append and al c cashline id is null open period sql append and exists select from c period p inner join c periodcontrol pc on p c period id pc c period id and pc doc base type cma where ah date acct between p start date and p end date prepared statement pstmt null try pstmt db prepare statement sql to string m trx get trx name int index 1 if p c bpartner id 0 pstmt set int index p c bpartner id else if p c bp group id 0 pstmt set int index p c bp group id else pstmt set int index env getad client id get ctx if p dateacct from null pstmt set timestamp index p dateacct from if p dateacct to null pstmt set timestamp index p dateacct to result set rs pstmt execute query while rs next m allocation hdr hdr new m allocation hdr get ctx rs m trx get trx name if delete hdr count rs close pstmt close pstmt null catch exception e log log level severe sql to string e m trx rollback try if pstmt null pstmt close pstmt null catch exception e pstmt null m trx close return deleted count doit c_bp_group_id p_c_bp_group_id c_bpartner_id p_c_bpartner_id dateacct p_dateacct_from p_dateacct_to c_allocationhdr_id p_c_allocationhdr_id m_trx createtrxname allocreset p_c_allocationhdr_id mallocationhdr mallocationhdr getctx p_c_allocationhdr_id m_trx gettrxname m_trx stringbuffer stringbuffer c_allocationhdr c_allocationline c_allocationhdr_id c_allocationhdr_id p_c_bpartner_id c_bpartner_id p_c_bp_group_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id ad_client_id p_dateacct_from dateacct p_dateacct_to dateacct c_cashline_id c_period c_periodcontrol c_period_id c_period_id docbasetype dateacct startdate enddate preparedstatement preparestatement tostring m_trx gettrxname p_c_bpartner_id setint p_c_bpartner_id p_c_bp_group_id setint p_c_bp_group_id setint getad_client_id getctx p_dateacct_from settimestamp p_dateacct_from p_dateacct_to settimestamp p_dateacct_to resultset executequery mallocationhdr mallocationhdr getctx m_trx gettrxname tostring m_trx m_trx private boolean delete m allocation hdr hdr m trx start boolean success false if hdr delete true m trx get trx name log fine hdr to string success true if success m trx commit else m trx rollback return success mallocationhdr m_trx m_trx gettrxname tostring m_trx m_trx set b partner may not be required private void setb partner update c allocationline al set c bpartner id select c bpartner id from c payment p where al c payment id p c payment id where c bpartner id is null and c payment id is not null update c allocationline al set c bpartner id select c bpartner id from c invoice i where al c invoice id i c invoice id where c bpartner id is null and c invoice id is not null update c allocationline al set c bpartner id select c bpartner id from c order o where al c order id o c order id where c bpartner id is null and c order id is not null commit bpartner setbpartner c_allocationline c_bpartner_id c_bpartner_id c_payment c_payment_id c_payment_id c_bpartner_id c_payment_id c_allocationline c_bpartner_id c_bpartner_id c_invoice c_invoice_id c_invoice_id c_bpartner_id c_invoice_id c_allocationline c_bpartner_id c_bpartner_id c_order c_order_id c_order_id c_bpartner_id c_order_id get foreground for back param background back return while or black public static color get foreground color background if background null is dark background return color white return color black getforeground isdark get column background param index index public static color get background int index while s colors size index int rr index 1 47 int gg 100 while rr 255 rr 255 gg 50 while gg 255 gg 255 s colors add new color 255 rr gg rr return s colors get index getbackground s_colors s_colors s_colors is the color dark param color color return true if dark public static boolean is dark color color float r color get red 255 0f float g color get green 255 0f float b color get blue 255 0f double white distance color distance r g b 1 0 1 0 1 0 double black distance color distance r g b 0 0 0 0 0 0 boolean dark black distance white distance if r g b 1 0 dark false log info r r g g b b black black distance dark dark light white white distance alpha color get alpha trans color get transparency return dark isdark getred getgreen getblue whitedistance colordistance blackdistance colordistance blackdistance whitedistance blackdistance whitedistance getalpha gettransparency is color more white or black param r red param g green param b blue return true if dark public static boolean is dark double r double g double b double white distance color distance r g b 1 0 1 0 1 0 double black distance color distance r g b 0 0 0 0 0 0 boolean dark black distance white distance log finest r r g g b b white white distance black black distance return dark isdark whitedistance colordistance blackdistance colordistance blackdistance whitedistance whitedistance blackdistance simple color distance 3d point distance param r1 first red param g1 first green param b1 first blue param r2 second red param g2 second green param b2 second blue return 3d distance for relative comparison public static double color distance double r1 double g1 double b1 double r2 double g2 double b2 double a r2 r1 0 1 double b g2 g1 0 1 double c b2 b1 0 1 return math sqrt a a b b c c colordistance get darker color param color color param factor factor 0 1 awt 0 7 the smaller the darker return darker color public static color darker color color double factor return new color math max int color get red factor 0 math max int color get green factor 0 math max int color get blue factor 0 getred getgreen getblue get set system param issue issue return system static public m issue system get m issue issue if issue getdb address null return null m issue system system null prepared statement pstmt null string sql select from r issuesystem where db address try pstmt db prepare statement sql null pstmt set string 1 issue getdb address result set rs pstmt execute query if rs next system new m issue system issue get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null new if system null system new m issue system issue get ctx 0 null system setdb address issue getdb address system seta asset id issue geta asset id system set system status issue get system status system set statistics info issue get statistics info system set profile info issue get profile info if issue geta asset id 0 system geta asset id issue geta asset id system seta asset id issue geta asset id if system save return null set issue setr issuesystem id system getr issuesystem id if system geta asset id 0 issue seta asset id system geta asset id return system missuesystem missue getdbaddress missuesystem preparedstatement r_issuesystem dbaddress preparestatement setstring getdbaddress resultset executequery missuesystem getctx missuesystem getctx setdbaddress getdbaddress seta_asset_id geta_asset_id setsystemstatus getsystemstatus setstatisticsinfo getstatisticsinfo setprofileinfo getprofileinfo geta_asset_id geta_asset_id geta_asset_id seta_asset_id geta_asset_id setr_issuesystem_id getr_issuesystem_id geta_asset_id seta_asset_id geta_asset_id standard constructor param ctx context param r issuesystem id id param trx name trx public m issue system properties ctx int r issuesystem id string trx name super ctx r issuesystem id trx name r_issuesystem_id trxname missuesystem r_issuesystem_id trxname r_issuesystem_id trxname load constructor param ctx context param rs result set param trx name trx public m issue system properties ctx result set rs string trx name super ctx rs trx name trxname missuesystem resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m issue system sb append get id append append getdb address append a asset id append geta asset id append return sb to string tostring stringbuffer stringbuffer missuesystem get_id getdbaddress a_asset_id geta_asset_id tostring constructor for ofx1 toxml param is input stream throws io exception public ofx1 toxml input stream is throws io exception buffered reader br new buffered reader new input stream reader is init br ofx1toxml inputstream ioexception ofx1toxml inputstream ioexception bufferedreader bufferedreader inputstreamreader constructor for ofx1 toxml param br buffered reader throws io exception public ofx1 toxml buffered reader br throws io exception init br ofx1toxml bufferedreader ioexception ofx1toxml bufferedreader ioexception method init param br buffered reader throws io exception public void init buffered reader br throws io exception m writer new buffered writer new piped writer m reader string line br read line write xml version 1 0 n write ofx while line index of 0 if line length 0 write line replace all line br read line write n while line null m ofx line n line br read line br close new thread this start bufferedreader ioexception bufferedreader ioexception m_writer bufferedwriter pipedwriter m_reader readline indexof replaceall readline m_ofx readline method run see java lang runnable run public void run boolean add close tag int tag2 start int tag start int tag end string tag string line try while m ofx add close tag false tag start m ofx index of if tag start 1 break tag end m ofx index of if tag end tag start 1 throw new io exception parse error invalid tag tag m ofx substring tag start 1 tag end if tag index of 1 throw new io exception parse error invalid tag if tag starts with add close tag m ofx index of tag 1 tag2 start m ofx index of tag end if m ofx index of n tag end tag2 start tag2 start m ofx index of n tag end if tag2 start 1 tag2 start m ofx length line m ofx substring 0 tag2 start m ofx m ofx substring tag2 start if add close tag line tag write line write m ofx m writer close catch io exception e log log level severe ofx1 to2 convertor io exception e addclosetag tag2start tagstart tagend m_ofx addclosetag tagstart m_ofx indexof tagstart tagend m_ofx indexof tagend tagstart ioexception m_ofx tagstart tagend indexof ioexception startswith addclosetag m_ofx indexof tag2start m_ofx indexof tagend m_ofx indexof tagend tag2start tag2start m_ofx indexof tagend tag2start tag2start m_ofx m_ofx tag2start m_ofx m_ofx tag2start addclosetag m_ofx m_writer ioexception ofx1to2convertor method write param str string throws io exception private void write string str throws io exception m writer write str 0 str length ioexception ioexception m_writer method read return int throws io exception public int read throws io exception return m reader read ioexception ioexception m_reader method read param cbuf char param off int param len int return int throws io exception public int read char cbuf int off int len throws io exception return m reader read cbuf off len ioexception ioexception m_reader basic constructor public strike basic constructor param element adds an element to the element public strike element element add element element addelement basic constructor param element adds an element to the element public strike string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public strike add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public strike add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public strike add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public strike add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public strike remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute lookup column value object param column name column name param is translated translated param ad reference id display type param ad reference value id table list reference id public lookup display column string column name boolean is translated int ad reference id int ad reference value id column name column name is translated is translated display type ad reference id ad reference id ad reference value id columnname istranslated ad_reference_id ad_reference_value_id lookupdisplaycolumn columnname istranslated ad_reference_id ad_reference_value_id columnname columnname istranslated istranslated displaytype ad_reference_id ad_reference_id ad_reference_value_id string representation return info public string to string string buffer sb new string buffer lookup display column sb append column name append column name if is translated sb append is translated sb append display type append display type if ad reference id 0 sb append ad reference id append ad reference id sb append return sb to string tostring stringbuffer stringbuffer lookupdisplaycolumn columnname columnname istranslated istranslated displaytype displaytype ad_reference_id ad_reference_id ad_reference_id tostring get currency account for currency param as accounting schema default param c currency id currency return currency account or null public static m currency acct get m acct schema default as int c currency id m currency acct ret value null string sql select from c currency acct where c acctschema id and c currency id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 as getc acctschema id pstmt set int 2 c currency id result set rs pstmt execute query if rs next ret value new m currency acct as get ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe get e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value c_currency_id mcurrencyacct macctschemadefault c_currency_id mcurrencyacct retvalue c_currency_acct c_acctschema_id c_currency_id preparedstatement preparestatement setint getc_acctschema_id setint c_currency_id resultset executequery retvalue mcurrencyacct getctx s_log retvalue load constructor param ctx context param rs result set public m currency acct properties ctx result set rs string trx name super ctx rs trx name mcurrencyacct resultset trxname trxname public v schedule time panel set opaque false set size vscheduletimepanel setopaque setsize set time slots and calculate width param time slots time slots public void set time slots m assignment slot time slots log fine v schedule time panel set time slots m timeslots time slots m lines new string m timeslots length font metrics fm null graphics g get graphics if g null g env get graphics this if g null fm g get font metrics m font the correct way else log log level severe no graphics fm get toolkit get font metrics m font m width 0 for int i 0 i m lines length i m lines i m timeslots i get info time from int width 0 if fm null width fm string width m lines i if width m width m width width set size repaint timeslots settimeslots massignmentslot timeslots vscheduletimepanel settimeslots m_timeslots timeslots m_lines m_timeslots fontmetrics getgraphics getgraphics getfontmetrics m_font gettoolkit getfontmetrics m_font m_width m_lines m_lines m_timeslots getinfotimefrom stringwidth m_lines m_width m_width setsize calculate set size private void set size width int width m width 10 slack if width 10 width 120 default size height int height line height int lines m lines length if lines 2 height 10 default else height lines height heading dimension size new dimension width height set preferred size size set minimum size size set maximum size size setsize m_width line_height m_lines setpreferredsize setminimumsize setmaximumsize get the height of the header return height of the header public int get header height return heading getheaderheight get the height of a slot return height of a slot public int get slot height int height get preferred size height int part height heading m lines length return part getslotheight getpreferredsize m_lines get the height of a slot return height of a slot public int get slot count return m lines length getslotcount m_lines get y start position of slot param slot slot index return y start position public int get sloty start int slot int part get slot height int y heading slot part return y getslotystart getslotheight get y end position of slot param slot slot index return y end position public int get sloty end int slot int part get slot height int y heading slot 1 part return y getslotyend getslotheight return the time slot index for the time based on start time and not including end time param time time day is ignored param end time if true the end time is included return slot index public int get time slot index timestamp time boolean end time just one slot if m timeslots length 1 return 0 search for it for int i 0 i m timeslots length i if m timeslots i in slot time end time return i log log level severe v schedule time panel get slot index did not find slot for time end end time return 0 endtime gettimeslotindex endtime m_timeslots m_timeslots m_timeslots inslot endtime vscheduletimepanel getslotindex endtime get time slot param index time index return assignment slot public m assignment slot get time slot int index if index 0 index m timeslots length return null return m timeslots index massignmentslot gettimeslot m_timeslots m_timeslots get time slot index param y pos y position return assignment slot index public int get time slot index int y pos int index y pos get header height index get slot height if index 0 return 0 if index m timeslots length return m timeslots length 1 return index ypos gettimeslotindex ypos ypos getheaderheight getslotheight m_timeslots m_timeslots paint it param g the code graphics code object public void paint graphics g log fine v schedule time panel paint g get clip graphics2d g2d graphics2d g g2d set font m font dimension size get preferred size int w size width int h size height paint background g2d set paint color white g2d fill3d rect 1 1 w 2 h 2 true header background rectangle where new rectangle 0 0 w get header height compiere utils paint3 deffect g2d where false true heading text layout layout null layout new text layout heading m font g2d get font render context float hh layout get ascent layout get descent layout draw g2d w layout get advance 2 center heading hh 2 layout get ascent center horizontal lines text g2d set stroke get stroke true for int i 0 i m lines length i int yy get sloty start i if m lines i null m lines i length 0 layout new text layout m lines i m font g2d get font render context g2d set paint color blue layout draw g2d w layout get advance 3 right aligned with 2 pt space yy layout get ascent layout get leading top aligned with leading space g2d set paint color gray g2d draw line 2 yy w 2 yy top horiz line paint borders g2d set paint color black g2d set stroke get stroke false g2d draw line 1 1 1 h 1 left g2d draw line w 1 1 w 1 h 1 right g2d draw line 1 1 w 1 1 top g2d draw line 1 get header height w 1 get header height header g2d draw line 1 h 1 w 1 h 1 bottom line vscheduletimepanel getclip setfont m_font getpreferredsize setpaint fill3drect getheaderheight compiereutils paint3deffect textlayout textlayout m_font getfontrendercontext getascent getdescent getadvance getascent setstroke getstroke m_lines getslotystart m_lines m_lines textlayout m_lines m_font getfontrendercontext setpaint getadvance getascent getleading setpaint drawline setpaint setstroke getstroke drawline drawline drawline drawline getheaderheight getheaderheight drawline get stroke param slot line if true return dashed line return stroke public static stroke get stroke boolean slot line if slot line return new basic stroke 1 0f basic stroke cap butt basic stroke join miter 1 0f new float 2 0f 0 5f 0 0f return new basic stroke 1 0f slotline getstroke slotline slotline basicstroke basicstroke cap_butt basicstroke join_miter basicstroke public constructor public payment processor paymentprocessor factory param mpp payment processor model param mp payment model return initialized payment processor or null public static payment processor create m payment processor mpp m payment mp s log info create for mpp string class name mpp get pay processor class if class name null class name length 0 s log log level severe no payment processor class name in mpp return null payment processor my processor null try class pp class class for name class name if pp class null my processor payment processor pp class new instance catch error e1 no class def found s log log level severe class name error e1 get message return null catch exception e2 s log log level severe class name e2 return null if my processor null s log log level severe no class return null initialize my processor p mpp mpp my processor p mp mp return my processor paymentprocessor paymentprocessor mpaymentprocessor mpayment s_log classname getpayprocessorclass classname classname s_log paymentprocessor paymentprocessor myprocessor ppclass forname classname ppclass myprocessor paymentprocessor ppclass newinstance noclassdeffound s_log classname getmessage s_log classname myprocessor s_log myprocessor p_mpp myprocessor p_mp myprocessor process credit card no date check return true if processed successfully throws illegal argument exception creditcard illegalargumentexception payment is procesed successfully return true if ok set timeout param new timeout timeout public void set timeout int new timeout m timeout new timeout newtimeout settimeout newtimeout m_timeout newtimeout m timeout new timeout public int get timeout return m timeout m_timeout newtimeout gettimeout m_timeout check for delimiter fields and add length of not encoded param name name param value value param max length maximum length return name 5 value or name value protected string create pair string name big decimal value int max length if value null return create pair name 0 max length else if value scale 2 value value set scale 2 big decimal round half up return create pair name string value of value max length maxlength createpair bigdecimal maxlength createpair maxlength setscale bigdecimal round_half_up createpair valueof maxlength check for delimiter fields and add length of not encoded param name name param value value param max length maximum length return name 5 value or name value protected string create pair string name int value int max length if value 0 return else return create pair name string value of value max length maxlength createpair maxlength createpair valueof maxlength check for delimiter fields and add length of not encoded param name name param value value param max length maximum length return name 5 value or name value protected string create pair string name string value int max length nothing to say if name null name length 0 value null value length 0 return if value length max length value value substring 0 max length string buffer ret value new string buffer name if m encoded try value url encoder encode value encoding catch unsupported encoding exception e log log level severe value e to string else if value index of amp 1 value index of eq 1 ret value append append value length append ret value append eq ret value append value return ret value to string maxlength createpair maxlength maxlength maxlength stringbuffer retvalue stringbuffer m_encoded urlencoder unsupportedencodingexception tostring indexof indexof retvalue retvalue retvalue retvalue tostring create pair public void set encoded boolean do encode m encoded do encode set encode createpair setencoded doencode m_encoded doencode setencode m encoded do encode set encode public boolean is encoded return m encoded set encode m_encoded doencode setencode isencoded m_encoded setencode get connect post properties param url string post url string param parameter parameter return result as properties protected properties get connect post properties string url string string parameter long start system current time millis string result connect post url string parameter if result null return null properties prop new properties try string info url decoder decode result encoding string tokenizer st new string tokenizer info amp while st has more tokens string token st next token int index token index of if index 1 prop put token else string key token substring 0 index string value token substring index 1 prop put key value catch exception e log log level severe result e long ms system current time millis start log fine ms ms prop to string return prop urlstring getconnectpostproperties urlstring currenttimemillis connectpost urlstring urldecoder stringtokenizer stringtokenizer hasmoretokens nexttoken indexof currenttimemillis tostring connect via post param url string url destination assuming https param parameter parameter return response or null if failure protected string connect post string url string string parameter string response null try open secure connection url url new url url string httpsurl connection connection httpsurl connection url open connection url connection connection url open connection connection set do output true connection set use caches false connection set request property content type application x www form urlencoded log fine connection geturl to string post the parameter data output stream out new data output stream connection get output stream out write parameter get bytes out flush out close process and read the gateway response buffered reader in new buffered reader new input stream reader connection get input stream response in read line in close no more data log finest response catch exception e log log level severe url string e return response urlstring connectpost urlstring urlstring httpsurlconnection httpsurlconnection openconnection urlconnection openconnection setdooutput setusecaches setrequestproperty tostring dataoutputstream dataoutputstream getoutputstream getbytes bufferedreader bufferedreader inputstreamreader getinputstream readline urlstring standard constructor public x c bp withholding properties ctx int c bp withholding id string trx name super ctx c bp withholding id trx name if c bp withholding id 0 setc bpartner id 0 setc withholding id 0 set is mandatory withholding false set is temporary exempt false x_c_bp_withholding c_bp_withholding_id trxname c_bp_withholding_id trxname c_bp_withholding_id setc_bpartner_id setc_withholding_id setismandatorywithholding setistemporaryexempt load constructor public x c bp withholding properties ctx result set rs string trx name super ctx rs trx name x_c_bp_withholding resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp withholding append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_withholding get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set withholding withholding type defined public void setc withholding id int c withholding id if c withholding id 1 throw new illegal argument exception c withholding id is mandatory set valuenocheck c withholding id new integer c withholding id setc_withholding_id c_withholding_id c_withholding_id illegalargumentexception c_withholding_id set_valuenocheck c_withholding_id c_withholding_id get withholding withholding type defined public int getc withholding id integer ii integer get value c withholding id if ii null return 0 return ii int value getc_withholding_id get_value c_withholding_id intvalue set exempt reason reason for not withholding public void set exempt reason string exempt reason if exempt reason null exempt reason length 20 log warning length 20 truncated exempt reason exempt reason substring 0 19 set value exempt reason exempt reason setexemptreason exemptreason exemptreason exemptreason exemptreason exemptreason set_value exemptreason exemptreason get exempt reason reason for not withholding public string get exempt reason return string get value exempt reason getexemptreason get_value exemptreason set mandatory withholding monies must be withheld public void set is mandatory withholding boolean is mandatory withholding set value is mandatory withholding new boolean is mandatory withholding setismandatorywithholding ismandatorywithholding set_value ismandatorywithholding ismandatorywithholding get mandatory withholding monies must be withheld public boolean is mandatory withholding object oo get value is mandatory withholding if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatorywithholding get_value ismandatorywithholding booleanvalue set temporary exempt temporarily do not withhold taxes public void set is temporary exempt boolean is temporary exempt set value is temporary exempt new boolean is temporary exempt setistemporaryexempt istemporaryexempt set_value istemporaryexempt istemporaryexempt get temporary exempt temporarily do not withhold taxes public boolean is temporary exempt object oo get value is temporary exempt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istemporaryexempt get_value istemporaryexempt booleanvalue constructor param ctx context param ad process para id id public m process para properties ctx int ad process para id string trx name super ctx ad process para id trx name if ad process para id 0 setad process id 0 parent set name null set column name null set field length 0 set seq no 0 setad reference id 0 set is centrally maintained true set is range false set is mandatory false set entity type entitytype usermaintained ad_process_para_id mprocesspara ad_process_para_id trxname ad_process_para_id trxname ad_process_para_id setad_process_id setname setcolumnname setfieldlength setseqno setad_reference_id setiscentrallymaintained setisrange setismandatory setentitytype entitytype_usermaintained load constructor param ctx context param rs result set public m process para properties ctx result set rs string trx name super ctx rs trx name mprocesspara resultset trxname trxname is this field a lookup return true if lookup field public boolean is lookup boolean ret value false int display type getad reference id if display type is lookup display type ret value true else if display type display type location display type display type locator display type display type account display type display type p attribute ret value true return ret value islookup retvalue displaytype getad_reference_id displaytype islookup displaytype retvalue displaytype displaytype displaytype displaytype displaytype displaytype displaytype displaytype pattribute retvalue retvalue set lookup for columns with lookup public void load lookup if is lookup return log fine get column name int display type getad reference id if display type is lookup display type m lookup info lookup info m lookup factory get lookup info get ctx 0 getad process para id getad reference id env get language get ctx get column name getad reference value id false if lookup info null log log level severe get column name no lookup info return prevent loading of created by updated by if display type display type table get column name equals created by get column name equals updated by lookup info is creaded updated by true m lookup ml new m lookup lookup info tab no m lookup ml else if display type display type location not cached m location lookup ml new m location lookup get ctx window no m lookup ml else if display type display type locator m locator lookup ml new m locator lookup get ctx window no m lookup ml else if display type display type account not cached m account lookup ma new m account lookup get ctx window no m lookup ma else if display type display type p attribute not cached mp attribute lookup pa new mp attribute lookup get ctx window no m lookup pa if m lookup null m lookup load complete loadlookup islookup getcolumnname displaytype getad_reference_id displaytype islookup displaytype mlookupinfo lookupinfo mlookupfactory getlookupinfo getctx getad_process_para_id getad_reference_id getlanguage getctx getcolumnname getad_reference_value_id lookupinfo getcolumnname lookupinfo createdby updatedby displaytype displaytype getcolumnname createdby getcolumnname updatedby lookupinfo iscreadedupdatedby mlookup mlookup lookupinfo tab_no m_lookup displaytype displaytype mlocationlookup mlocationlookup getctx window_no m_lookup displaytype displaytype mlocatorlookup mlocatorlookup getctx window_no m_lookup displaytype displaytype maccountlookup maccountlookup getctx window_no m_lookup displaytype displaytype pattribute mpattributelookup mpattributelookup getctx window_no m_lookup m_lookup m_lookup loadcomplete get lookup for parameter return lookup or null public lookup get lookup if m lookup null is lookup load lookup return m lookup getlookup m_lookup islookup loadlookup m_lookup string representation return info public string to string string buffer sb new string buffer m process para append get id append return sb to string tostring stringbuffer stringbuffer mprocesspara get_id tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c invoice id m c invoice id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_invoice_id m_c_invoice_id bigdecimal getparameter intvalue perform process return message throws exception if not successful protected string do it throws exception int to c invoice id getrecord id log info from c invoice id m c invoice id to to c invoice id if to c invoice id 0 throw new illegal argument exception target c invoice id 0 if m c invoice id 0 throw new illegal argument exception source c invoice id 0 m invoice from new m invoice get ctx m c invoice id null m invoice to new m invoice get ctx to c invoice id null int no to copy lines from from false false return copied no doit to_c_invoice_id getrecord_id c_invoice_id m_c_invoice_id to_c_invoice_id to_c_invoice_id illegalargumentexception c_invoice_id m_c_invoice_id illegalargumentexception c_invoice_id minvoice minvoice getctx m_c_invoice_id minvoice minvoice getctx to_c_invoice_id copylinesfrom doc action template private doc action template super null docactiontemplate docactiontemplate doc action template init po param ctx ctx return null protected po info initpo properties ctx return null docactiontemplate poinfo initpo protected int get accesslevel return 0 get_accesslevel get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx 0 return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctypetarget id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid m line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid add up amounts m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctypetarget_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid mline getlines m_processmsg nolines docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document same as close return true if success public boolean void it log info void it to string return close it voidit voidit tostring closeit close document cancel not delivered qunatities return true if success public boolean close it log info close it to string close not delivered qty set doc action docaction none return true closeit closeit tostring setdocaction docaction_none reverse correction return true if success public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual none return true if success public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return true if success public boolean re activate it log info re activate it to string set processed false if reverse correct it return true return false reactivateit reactivateit tostring setprocessed reversecorrectit get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx total lines append append get total lines append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx totallines gettotallines getlines getdescription getdescription getdescription tostring get document no return document no public string get document no return getdocumentno get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return getsalesrep id return 0 ad_user_id getdoc_user_id getsalesrep_id get document approval amount return amount public big decimal get approval amt return null get total lines bigdecimal getapprovalamt gettotallines get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id general calls public void set doc status string new status setdocstatus newstatus public string get doc status return null getdocstatus return null public string get doc action return null getdocaction return null public boolean save return false standard constructor public x k synonym properties ctx int k synonym id string trx name super ctx k synonym id trx name if k synonym id 0 setad language null setk synonym id 0 set name null set synonym name null x_k_synonym k_synonym_id trxname k_synonym_id trxname k_synonym_id setad_language setk_synonym_id setname setsynonymname load constructor public x k synonym properties ctx result set rs string trx name super ctx rs trx name x_k_synonym resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k synonym append get id append return sb to string tostring stringbuffer stringbuffer x_k_synonym get_id tostring public static final int ad language ad reference id 106 set language language for this entity public void setad language string ad language if ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set value ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language set_value ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set knowledge synonym knowlege keyword synonym public void setk synonym id int k synonym id if k synonym id 1 throw new illegal argument exception k synonym id is mandatory set valuenocheck k synonym id new integer k synonym id setk_synonym_id k_synonym_id k_synonym_id illegalargumentexception k_synonym_id set_valuenocheck k_synonym_id k_synonym_id get knowledge synonym knowlege keyword synonym public int getk synonym id integer ii integer get value k synonym id if ii null return 0 return ii int value getk_synonym_id get_value k_synonym_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set synonym name the synonym for the name public void set synonym name string synonym name if synonym name null throw new illegal argument exception synonym name is mandatory if synonym name length 60 log warning length 60 truncated synonym name synonym name substring 0 59 set value synonym name synonym name setsynonymname synonymname synonymname illegalargumentexception synonymname synonymname synonymname synonymname set_value synonymname synonymname get synonym name the synonym for the name public string get synonym name return string get value synonym name getsynonymname get_value synonymname standard constructor public x m costqueue properties ctx int m costqueue id string trx name super ctx m costqueue id trx name if m costqueue id 0 setc acctschema id 0 set current cost price env zero set current qty env zero setm attributesetinstance id 0 setm costelement id 0 setm costqueue id 0 setm costtype id 0 setm product id 0 x_m_costqueue m_costqueue_id trxname m_costqueue_id trxname m_costqueue_id setc_acctschema_id setcurrentcostprice setcurrentqty setm_attributesetinstance_id setm_costelement_id setm_costqueue_id setm_costtype_id setm_product_id load constructor public x m costqueue properties ctx result set rs string trx name super ctx rs trx name x_m_costqueue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m costqueue append get id append return sb to string tostring stringbuffer stringbuffer x_m_costqueue get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set current cost price the currently used cost price public void set current cost price big decimal current cost price if current cost price null throw new illegal argument exception current cost price is mandatory set value current cost price current cost price setcurrentcostprice bigdecimal currentcostprice currentcostprice illegalargumentexception currentcostprice set_value currentcostprice currentcostprice get current cost price the currently used cost price public big decimal get current cost price big decimal bd big decimal get value current cost price if bd null return env zero return bd bigdecimal getcurrentcostprice bigdecimal bigdecimal get_value currentcostprice set current quantity current quantity public void set current qty big decimal current qty if current qty null throw new illegal argument exception current qty is mandatory set value current qty current qty setcurrentqty bigdecimal currentqty currentqty illegalargumentexception currentqty set_value currentqty currentqty get current quantity current quantity public big decimal get current qty big decimal bd big decimal get value current qty if bd null return env zero return bd bigdecimal getcurrentqty bigdecimal bigdecimal get_value currentqty set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set cost element product cost element public void setm costelement id int m costelement id if m costelement id 1 throw new illegal argument exception m costelement id is mandatory set valuenocheck m costelement id new integer m costelement id setm_costelement_id m_costelement_id m_costelement_id illegalargumentexception m_costelement_id set_valuenocheck m_costelement_id m_costelement_id get cost element product cost element public int getm costelement id integer ii integer get value m costelement id if ii null return 0 return ii int value getm_costelement_id get_value m_costelement_id intvalue set cost queue fi fo li fo cost queue public void setm costqueue id int m costqueue id if m costqueue id 1 throw new illegal argument exception m costqueue id is mandatory set valuenocheck m costqueue id new integer m costqueue id fifo lifo setm_costqueue_id m_costqueue_id m_costqueue_id illegalargumentexception m_costqueue_id set_valuenocheck m_costqueue_id m_costqueue_id get cost queue fi fo li fo cost queue public int getm costqueue id integer ii integer get value m costqueue id if ii null return 0 return ii int value fifo lifo getm_costqueue_id get_value m_costqueue_id intvalue set cost type type of cost e g current plan future public void setm costtype id int m costtype id if m costtype id 1 throw new illegal argument exception m costtype id is mandatory set valuenocheck m costtype id new integer m costtype id setm_costtype_id m_costtype_id m_costtype_id illegalargumentexception m_costtype_id set_valuenocheck m_costtype_id m_costtype_id get cost type type of cost e g current plan future public int getm costtype id integer ii integer get value m costtype id if ii null return 0 return ii int value getm_costtype_id get_value m_costtype_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue basic constructor you need to set the attributes using the set methods public p use the set methods to set the values of the attributes param align set the value of align public p string align set align align setalign use the set methods to set the values of the attributes param align set the value of align param value set the text after the lt p gt tag public p string value string align add element value set align align addelement setalign use the set methods to set the values of the attributes param value set the text after the lt p gt tag public p element value add element value addelement use the set methods to set the values of the attributes param align set the value of align param value set the text after the lt p gt tag public p element value string align add element value set align align addelement setalign sets the align attribute param align the align attribute public p set align string align add attribute align align return this setalign addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public p add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public p add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public p add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public p add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public p remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute public clear element string string super string this set filter new null filter clearelement setfilter nullfilter configvm mac public configvm mac configuration data data super data configvmmac configvmmac configurationdata init public void init java home e g d j2sdk1 4 1 jre string java home system get property java home log fine java home if java home ends with jre java home java home substring 0 java home length 4 p data set java home java home javahome getproperty javahome javahome endswith javahome javahome javahome p_data setjavahome javahome test return error message or null of ok public string test java home file java home new file p data get java home boolean pass java home exists string error not found java home signalok get panel ok java home error java home pass true error if pass return error different vm structure file tools new file p data get java home file separator lib file separator tools jar pass tools exists error not found java sdk tools signalok get panel ok java home error java home pass true error if pass return error if c log mgt is level finest c log mgt print properties system get properties system true log info ok java home java home get absolute path set property configuration data java home java home get absolute path system set property configuration data java home java home get absolute path java version final string version 1 5 0 final string version2 1 5 0 pass false string jh java home get absolute path if jh index of version 1 file name has version assuming ok pass true if pass jh index of version2 1 pass true string thisjh system get property java home if thisjh index of jh 1 we are running the version currently string thisjv system get property java version pass thisjv index of version 1 if pass thisjv index of version2 1 pass true if pass log info ok version thisjv error wrong java version should be version2 signalok get panel ok java home error java home pass true error if pass return error set property configuration data java type p data get java type return null javahome p_data getjavahome javahome getpanel okjavahome errorjavahome p_data getjavahome getpanel okjavahome errorjavahome clogmgt islevelfinest clogmgt printproperties getproperties javahome javahome getabsolutepath setproperty configurationdata java_home javahome getabsolutepath setproperty configurationdata java_home javahome getabsolutepath javahome getabsolutepath indexof indexof getproperty indexof getproperty indexof indexof getpanel okjavahome errorjavahome setproperty configurationdata java_type p_data getjavatype standard constructor public x c bp bankaccount properties ctx int c bp bankaccount id string trx name super ctx c bp bankaccount id trx name if c bp bankaccount id 0 seta name null setc bp bankaccount id 0 setc bpartner id 0 set isach false x_c_bp_bankaccount c_bp_bankaccount_id trxname c_bp_bankaccount_id trxname c_bp_bankaccount_id seta_name setc_bp_bankaccount_id setc_bpartner_id setisach load constructor public x c bp bankaccount properties ctx result set rs string trx name super ctx rs trx name x_c_bp_bankaccount resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp bankaccount append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_bankaccount get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set account city city or the credit card or account holder public void seta city string a city if a city null a city length 60 log warning length 60 truncated a city a city substring 0 59 set value a city a city seta_city a_city a_city a_city a_city a_city set_value a_city a_city get account city city or the credit card or account holder public string geta city return string get value a city geta_city get_value a_city set account country country public void seta country string a country if a country null a country length 40 log warning length 40 truncated a country a country substring 0 39 set value a country a country seta_country a_country a_country a_country a_country a_country set_value a_country a_country get account country country public string geta country return string get value a country geta_country get_value a_country set account e mail email address public void seta email string a email if a email null a email length 60 log warning length 60 truncated a email a email substring 0 59 set value a email a email email seta_email a_email a_email a_email a_email a_email set_value a_email a_email get account e mail email address public string geta email return string get value a email email geta_email get_value a_email set driver license payment identification driver license public void seta ident dl string a ident dl if a ident dl null a ident dl length 20 log warning length 20 truncated a ident dl a ident dl substring 0 19 set value a ident dl a ident dl seta_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl a_ident_dl set_value a_ident_dl a_ident_dl get driver license payment identification driver license public string geta ident dl return string get value a ident dl geta_ident_dl get_value a_ident_dl set social security no payment identification social security no public void seta ident ssn string a ident ssn if a ident ssn null a ident ssn length 20 log warning length 20 truncated a ident ssn a ident ssn substring 0 19 set value a ident ssn a ident ssn seta_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn a_ident_ssn set_value a_ident_ssn a_ident_ssn get social security no payment identification social security no public string geta ident ssn return string get value a ident ssn geta_ident_ssn get_value a_ident_ssn set account name name on credit card or account holder public void seta name string a name if a name null throw new illegal argument exception a name is mandatory if a name length 60 log warning length 60 truncated a name a name substring 0 59 set value a name a name seta_name a_name a_name illegalargumentexception a_name a_name a_name a_name set_value a_name a_name get account name name on credit card or account holder public string geta name return string get value a name geta_name get_value a_name set account state state of the credit card or account holder public void seta state string a state if a state null a state length 40 log warning length 40 truncated a state a state substring 0 39 set value a state a state seta_state a_state a_state a_state a_state a_state set_value a_state a_state get account state state of the credit card or account holder public string geta state return string get value a state geta_state get_value a_state set account street street address of the credit card or account holder public void seta street string a street if a street null a street length 60 log warning length 60 truncated a street a street substring 0 59 set value a street a street seta_street a_street a_street a_street a_street a_street set_value a_street a_street get account street street address of the credit card or account holder public string geta street return string get value a street geta_street get_value a_street set account zip postal zip code of the credit card or account holder public void seta zip string a zip if a zip null a zip length 20 log warning length 20 truncated a zip a zip substring 0 19 set value a zip a zip seta_zip a_zip a_zip a_zip a_zip a_zip set_value a_zip a_zip get account zip postal zip code of the credit card or account holder public string geta zip return string get value a zip geta_zip get_value a_zip set account no account number public void set account no string account no if account no null account no length 20 log warning length 20 truncated account no account no substring 0 19 set value account no account no setaccountno accountno accountno accountno accountno accountno set_value accountno accountno get account no account number public string get account no return string get value account no getaccountno get_value accountno public static final string bankaccounttype savings s set bank account type bank account type public void set bank account type string bank account type if bank account type null throw new illegal argument exception bank account type is mandatory if bank account type null bank account type equals c bank account type equals s else throw new illegal argument exception bank account type invalid value bank account type reference id 216 c s if bank account type null bank account type length 1 log warning length 1 truncated bank account type bank account type substring 0 0 set value bank account type bank account type bankaccounttype_savings setbankaccounttype bankaccounttype bankaccounttype illegalargumentexception bankaccounttype bankaccounttype bankaccounttype bankaccounttype illegalargumentexception bankaccounttype bankaccounttype reference_id bankaccounttype bankaccounttype bankaccounttype bankaccounttype set_value bankaccounttype bankaccounttype get bank account type bank account type public string get bank account type return string get value bank account type getbankaccounttype get_value bankaccounttype set partner bank account bank account of the business partner public void setc bp bankaccount id int c bp bankaccount id if c bp bankaccount id 1 throw new illegal argument exception c bp bankaccount id is mandatory set valuenocheck c bp bankaccount id new integer c bp bankaccount id setc_bp_bankaccount_id c_bp_bankaccount_id c_bp_bankaccount_id illegalargumentexception c_bp_bankaccount_id set_valuenocheck c_bp_bankaccount_id c_bp_bankaccount_id get partner bank account bank account of the business partner public int getc bp bankaccount id integer ii integer get value c bp bankaccount id if ii null return 0 return ii int value getc_bp_bankaccount_id get_value c_bp_bankaccount_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set bank bank public void setc bank id int c bank id if c bank id 0 set value c bank id null else set value c bank id new integer c bank id setc_bank_id c_bank_id c_bank_id set_value c_bank_id set_value c_bank_id c_bank_id get bank bank public int getc bank id integer ii integer get value c bank id if ii null return 0 return ii int value getc_bank_id get_value c_bank_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc bank id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_bank_id set exp month expiry month public void set credit card expmm int credit card expmm set value credit card expmm new integer credit card expmm setcreditcardexpmm creditcardexpmm set_value creditcardexpmm creditcardexpmm get exp month expiry month public int get credit card expmm integer ii integer get value credit card expmm if ii null return 0 return ii int value getcreditcardexpmm get_value creditcardexpmm intvalue set exp year expiry year public void set credit card expyy int credit card expyy set value credit card expyy new integer credit card expyy setcreditcardexpyy creditcardexpyy set_value creditcardexpyy creditcardexpyy get exp year expiry year public int get credit card expyy integer ii integer get value credit card expyy if ii null return 0 return ii int value getcreditcardexpyy get_value creditcardexpyy intvalue set number credit card number public void set credit card number string credit card number if credit card number null credit card number length 20 log warning length 20 truncated credit card number credit card number substring 0 19 set value credit card number credit card number setcreditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber creditcardnumber set_value creditcardnumber creditcardnumber get number credit card number public string get credit card number return string get value credit card number getcreditcardnumber get_value creditcardnumber public static final string creditcardtype visa v set credit card credit card visa mc am ex public void set credit card type string credit card type if credit card type null throw new illegal argument exception credit card type is mandatory if credit card type null credit card type equals a credit card type equals c credit card type equals d credit card type equals m credit card type equals n credit card type equals p credit card type equals v else throw new illegal argument exception credit card type invalid value credit card type reference id 149 a c d m n p v if credit card type null credit card type length 1 log warning length 1 truncated credit card type credit card type substring 0 0 set value credit card type credit card type creditcardtype_visa amex setcreditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype creditcardtype illegalargumentexception creditcardtype creditcardtype reference_id creditcardtype creditcardtype creditcardtype creditcardtype set_value creditcardtype creditcardtype get credit card credit card visa mc am ex public string get credit card type return string get value credit card type amex getcreditcardtype get_value creditcardtype set verification code credit card verification code on credit card public void set credit cardvv string credit cardvv if credit cardvv null credit cardvv length 4 log warning length 4 truncated credit cardvv credit cardvv substring 0 3 set value credit cardvv credit cardvv setcreditcardvv creditcardvv creditcardvv creditcardvv creditcardvv creditcardvv set_value creditcardvv creditcardvv get verification code credit card verification code on credit card public string get credit cardvv return string get value credit cardvv getcreditcardvv get_value creditcardvv set ach automatic clearing house public void set isach boolean isach set value isach new boolean isach setisach set_value get ach automatic clearing house public boolean isach object oo get value isach if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false get_value booleanvalue public static final string r avsaddr match y set address verified this address has been verified public void setr avsaddr string r avsaddr if r avsaddr null throw new illegal argument exception r avsaddr is mandatory if r avsaddr null r avsaddr equals n r avsaddr equals x r avsaddr equals y else throw new illegal argument exception r avsaddr invalid value r avsaddr reference id 213 n x y if r avsaddr null r avsaddr length 1 log warning length 1 truncated r avsaddr r avsaddr substring 0 0 set valuenocheck r avsaddr r avsaddr r_avsaddr_match setr_avsaddr r_avsaddr r_avsaddr illegalargumentexception r_avsaddr r_avsaddr r_avsaddr r_avsaddr r_avsaddr illegalargumentexception r_avsaddr r_avsaddr reference_id r_avsaddr r_avsaddr r_avsaddr r_avsaddr set_valuenocheck r_avsaddr r_avsaddr get address verified this address has been verified public string getr avsaddr return string get value r avsaddr getr_avsaddr get_value r_avsaddr public static final string r avszip match y set zip verified the zip code has been verified public void setr avszip string r avszip if r avszip null throw new illegal argument exception r avszip is mandatory if r avszip null r avszip equals n r avszip equals x r avszip equals y else throw new illegal argument exception r avszip invalid value r avszip reference id 213 n x y if r avszip null r avszip length 1 log warning length 1 truncated r avszip r avszip substring 0 0 set valuenocheck r avszip r avszip r_avszip_match setr_avszip r_avszip r_avszip illegalargumentexception r_avszip r_avszip r_avszip r_avszip r_avszip illegalargumentexception r_avszip r_avszip reference_id r_avszip r_avszip r_avszip r_avszip set_valuenocheck r_avszip r_avszip get zip verified the zip code has been verified public string getr avszip return string get value r avszip getr_avszip get_value r_avszip set routing no bank routing number public void set routing no string routing no if routing no null routing no length 20 log warning length 20 truncated routing no routing no substring 0 19 set value routing no routing no setroutingno routingno routingno routingno routingno routingno set_value routingno routingno get routing no bank routing number public string get routing no return string get value routing no getroutingno get_value routingno get contents return context public object get contents return contents getcontents constructor param cn common name param ou org unit param o organization param l locale param s state param c country public key store dialog j frame owner string cn string ou string o string l string s string c throws headless exception super owner true set title key store dialog jb init set values cn ou o l s c a env show center window owner this keystoredialog jframe headlessexception settitle jbinit setvalues aenv showcenterwindow static layout private void jb init c panel panel new c panel new a layout panel add lcn new a layout constraint 0 0 panel add fcn null panel add lou new a layout constraint 1 0 panel add fou null panel add lo new a layout constraint 2 0 panel add fo null panel add ll new a layout constraint 3 0 panel add fl null panel add ls new a layout constraint 4 0 panel add fs null panel add lc new a layout constraint 5 0 panel add fc null panel set preferred size new dimension 400 150 get content pane set layout new border layout get content pane add panel border layout center c panel confirm panel new c panel new flow layout flow layout right confirm panel add b cancel confirm panel add bok get content pane add confirm panel border layout south b cancel add action listener this bok add action listener this jbinit cpanel cpanel alayout alayoutconstraint alayoutconstraint alayoutconstraint alayoutconstraint alayoutconstraint alayoutconstraint setpreferredsize getcontentpane setlayout borderlayout getcontentpane borderlayout cpanel confirmpanel cpanel flowlayout flowlayout confirmpanel bcancel confirmpanel getcontentpane confirmpanel borderlayout bcancel addactionlistener addactionlistener action listener param e evt public void action performed action event e if e get source bok m ok true dispose actionperformed actionevent getsource m_ok ok pressed return true if ok public boolean isok return m ok m_ok set values param cn common name param ou org unit param o organization param l locale param s state param c country public void set values string cn string ou string o string l string s string c fcn set text cn fou set text ou fo set text o fl set text l fs set text s fc set text c setvalues settext settext settext settext settext settext set values public string getcn return fcn get text setvalues gettext return fcn get text public string getou return fou get text gettext gettext return fou get text public string geto return fo get text gettext gettext return fo get text public string getl return fl get text gettext gettext return fl get text public string gets return fs get text gettext gettext return fs get text public string getc return fc get text gettext gettext start tag return skip body throws jsp exception public int do start tag throws jsp exception properties ctx jsp env get ctx http servlet request page context get request int ad client id env getad client id ctx string name m product category id option options get categories ad client id select sel new select name options sel setid id name log fine ad client id ad client id options length assemble html code html new html code html add element sel jsp writer out page context get out html output out return skip body skip_body jspexception dostarttag jspexception jspenv getctx httpservletrequest pagecontext getrequest ad_client_id getad_client_id m_product_category_id getcategories ad_client_id id_ ad_client_id ad_client_id htmlcode htmlcode addelement jspwriter pagecontext getout skip_body end tag nop return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page get product category options param ad client id client return array of category options private option get categories int ad client id option options option s categories get new integer ad client id if options null return options string sql select m product category id name from m product category where ad client id ad client id and is active y and is self service y order by name key name pair pairs db get key name pairs sql true options new option pairs length for int i 0 i pairs length i if i 0 options i new option 1 options i add element else options i new option pairs i getid options i add element util maskhtml pairs i get name s categories put new integer ad client id options return options ad_client_id getcategories ad_client_id s_categories ad_client_id m_product_category_id m_product_category ad_client_id ad_client_id isactive isselfservice keynamepair getkeynamepairs addelement addelement getname s_categories ad_client_id standard constructor public x m movementline properties ctx int m movementline id string trx name super ctx m movementline id trx name if m movementline id 0 set line 0 sql select nvl max line 0 10 as default value from m movementline where m movement id m movement id setm attributesetinstance id 0 setm locatorto id 0 m locatorto id setm locator id 0 m locator id setm movementline id 0 setm movement id 0 setm product id 0 set movement qty env zero 1 set processed false set target qty env zero 0 x_m_movementline m_movementline_id trxname m_movementline_id trxname m_movementline_id setline defaultvalue m_movementline m_movement_id m_movement_id setm_attributesetinstance_id setm_locatorto_id m_locatorto_id setm_locator_id m_locator_id setm_movementline_id setm_movement_id setm_product_id setmovementqty setprocessed settargetqty load constructor public x m movementline properties ctx result set rs string trx name super ctx rs trx name x_m_movementline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m movementline append get id append return sb to string tostring stringbuffer stringbuffer x_m_movementline get_id tostring set confirmed quantity confirmation of a received quantity public void set confirmed qty big decimal confirmed qty set value confirmed qty confirmed qty setconfirmedqty bigdecimal confirmedqty set_value confirmedqty confirmedqty get confirmed quantity confirmation of a received quantity public big decimal get confirmed qty big decimal bd big decimal get value confirmed qty if bd null return env zero return bd bigdecimal getconfirmedqty bigdecimal bigdecimal get_value confirmedqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set attribute set instance to target product attribute set instance public void setm attributesetinstanceto id int m attributesetinstanceto id if m attributesetinstanceto id 0 set valuenocheck m attributesetinstanceto id null else set valuenocheck m attributesetinstanceto id new integer m attributesetinstanceto id setm_attributesetinstanceto_id m_attributesetinstanceto_id m_attributesetinstanceto_id set_valuenocheck m_attributesetinstanceto_id set_valuenocheck m_attributesetinstanceto_id m_attributesetinstanceto_id get attribute set instance to target product attribute set instance public int getm attributesetinstanceto id integer ii integer get value m attributesetinstanceto id if ii null return 0 return ii int value getm_attributesetinstanceto_id get_value m_attributesetinstanceto_id intvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue public static final int m locatorto id ad reference id 191 set locator to location inventory is moved to public void setm locatorto id int m locatorto id if m locatorto id 1 throw new illegal argument exception m locatorto id is mandatory set value m locatorto id new integer m locatorto id m_locatorto_id_ad_reference_id setm_locatorto_id m_locatorto_id m_locatorto_id illegalargumentexception m_locatorto_id set_value m_locatorto_id m_locatorto_id get locator to location inventory is moved to public int getm locatorto id integer ii integer get value m locatorto id if ii null return 0 return ii int value getm_locatorto_id get_value m_locatorto_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set move line inventory move document line public void setm movementline id int m movementline id if m movementline id 1 throw new illegal argument exception m movementline id is mandatory set valuenocheck m movementline id new integer m movementline id setm_movementline_id m_movementline_id m_movementline_id illegalargumentexception m_movementline_id set_valuenocheck m_movementline_id m_movementline_id get move line inventory move document line public int getm movementline id integer ii integer get value m movementline id if ii null return 0 return ii int value getm_movementline_id get_value m_movementline_id intvalue set inventory move movement of inventory public void setm movement id int m movement id if m movement id 1 throw new illegal argument exception m movement id is mandatory set valuenocheck m movement id new integer m movement id setm_movement_id m_movement_id m_movement_id illegalargumentexception m_movement_id set_valuenocheck m_movement_id m_movement_id get inventory move movement of inventory public int getm movement id integer ii integer get value m movement id if ii null return 0 return ii int value getm_movement_id get_value m_movement_id intvalue public static final int m product id ad reference id 171 set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set value m product id new integer m product id m_product_id_ad_reference_id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set movement quantity quantity of a product moved public void set movement qty big decimal movement qty if movement qty null throw new illegal argument exception movement qty is mandatory set value movement qty movement qty setmovementqty bigdecimal movementqty movementqty illegalargumentexception movementqty set_value movementqty movementqty get movement quantity quantity of a product moved public big decimal get movement qty big decimal bd big decimal get value movement qty if bd null return env zero return bd bigdecimal getmovementqty bigdecimal bigdecimal get_value movementqty set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set scrapped quantity the quantity scrapped due to qa issues public void set scrapped qty big decimal scrapped qty set value scrapped qty scrapped qty setscrappedqty bigdecimal scrappedqty set_value scrappedqty scrappedqty get scrapped quantity the quantity scrapped due to qa issues public big decimal get scrapped qty big decimal bd big decimal get value scrapped qty if bd null return env zero return bd bigdecimal getscrappedqty bigdecimal bigdecimal get_value scrappedqty set target quantity target movement quantity public void set target qty big decimal target qty if target qty null throw new illegal argument exception target qty is mandatory set value target qty target qty settargetqty bigdecimal targetqty targetqty illegalargumentexception targetqty set_value targetqty targetqty get target quantity target movement quantity public big decimal get target qty big decimal bd big decimal get value target qty if bd null return env zero return bd bigdecimal gettargetqty bigdecimal bigdecimal get_value targetqty constructor param ass accounting schemata param rs record parem trx name trx protected doc invoice m acct schema ass result set rs string trx name super ass m invoice class rs null trx name trxname doc_invoice macctschema resultset trxname minvoice trxname load specific document details return error message or null protected string load document details m invoice invoice m invoice getpo set date doc invoice get date invoiced set is tax included invoice is tax included amounts set amount doc amttype gross invoice get grand total set amount doc amttype net invoice get total lines set amount doc amttype charge invoice get charge amt contained objects m taxes load taxes p lines load lines invoice log fine lines p lines length taxes m taxes length return null loaddocumentdetails minvoice minvoice setdatedoc getdateinvoiced setistaxincluded istaxincluded setamount amttype_gross getgrandtotal setamount amttype_net gettotallines setamount amttype_charge getchargeamt m_taxes loadtaxes p_lines loadlines p_lines m_taxes load invoice taxes return doc tax array private doc tax load taxes array list doc tax list new array list doc tax string sql select it c tax id t name t rate it tax base amt it tax amt t is sales tax from c tax t c invoicetax it where t c tax id it c tax id and it c invoice id try prepared statement pstmt db prepare statement sql get trx name pstmt set int 1 get id result set rs pstmt execute query while rs next int c tax id rs get int 1 string name rs get string 2 big decimal rate rs get big decimal 3 big decimal tax base amt rs get big decimal 4 big decimal amount rs get big decimal 5 boolean sales tax y equals rs get string 6 doc tax tax line new doc tax c tax id name rate tax base amt amount sales tax log fine tax line to string list add tax line rs close pstmt close catch sql exception e log log level severe sql e return null return array doc tax tl new doc tax list size list to array tl return tl doctax doctax loadtaxes arraylist doctax arraylist doctax c_tax_id taxbaseamt taxamt issalestax c_tax c_invoicetax c_tax_id c_tax_id c_invoice_id preparedstatement preparestatement gettrxname setint get_id resultset executequery c_tax_id getint getstring bigdecimal getbigdecimal bigdecimal taxbaseamt getbigdecimal bigdecimal getbigdecimal salestax getstring doctax taxline doctax c_tax_id taxbaseamt salestax taxline tostring taxline sqlexception doctax doctax toarray load invoice line return doc line array private doc line load lines m invoice invoice array list doc line list new array list doc line m invoice line lines invoice get lines false for int i 0 i lines length i m invoice line line lines i if line is description continue doc line doc line new doc line line this qty big decimal qty line get qty invoiced boolean cm get document type equals doctype arcredit get document type equals doctype apcredit doc line set qty cm qty negate qty invoice isso trx big decimal line net amt line get line net amt big decimal price list line get price list int c tax id doc line getc tax id correct included tax if is tax included c tax id 0 m tax tax m tax get get ctx c tax id if tax is zero tax big decimal line net amt tax tax calculate tax line net amt true get std percision log fine line net amt line net amt tax line net amt tax line net amt line net amt subtract line net amt tax for int t 0 t m taxes length t if m taxes t getc tax id c tax id m taxes t add included tax line net amt tax break big decimal price list tax tax calculate tax price list true get std percision price list price list subtract price list tax correct included tax doc line set amount line net amt price list qty qty for discount calc if doc line is item m alllinesservice false else m alllinesitem false log fine doc line to string list add doc line convert to array doc line dls new doc line list size list to array dls included tax make sure that no difference if is tax included for int i 0 i m taxes length i if m taxes i is included tax difference big decimal diff m taxes i get included tax difference for int j 0 j dls length j if dls j getc tax id m taxes i getc tax id dls j set line net amt difference diff break for all lines tax difference for all taxes included tax difference return array return dls docline docline loadlines minvoice arraylist docline arraylist docline minvoiceline getlines minvoiceline isdescription docline docline docline bigdecimal getqtyinvoiced getdocumenttype doctype_arcredit getdocumenttype doctype_apcredit docline setqty issotrx bigdecimal linenetamt getlinenetamt bigdecimal pricelist getpricelist c_tax_id docline getc_tax_id istaxincluded c_tax_id mtax mtax getctx c_tax_id iszerotax bigdecimal linenetamttax calculatetax linenetamt getstdpercision linenetamt linenetamt linenetamttax linenetamt linenetamt linenetamttax m_taxes m_taxes getc_tax_id c_tax_id m_taxes addincludedtax linenetamttax bigdecimal pricelisttax calculatetax pricelist getstdpercision pricelist pricelist pricelisttax docline setamount linenetamt pricelist docline isitem m_alllinesservice m_alllinesitem docline tostring docline docline docline toarray istaxincluded m_taxes m_taxes isincludedtaxdifference bigdecimal m_taxes getincludedtaxdifference getc_tax_id m_taxes getc_tax_id setlinenetamtdifference get currency percision return precision private int get std percision if m precision 1 m precision m currency get std precision get ctx getc currency id return m precision getstdpercision m_precision m_precision mcurrency getstdprecision getctx getc_currency_id m_precision get source currency balance subtracts line and tax amounts from total no rounding return positive amount if total invoice is bigger than lines public big decimal get balance big decimal ret value env zero string buffer sb new string buffer total ret value ret value add get amount doc amttype gross sb append get amount doc amttype gross header charge ret value ret value subtract get amount doc amttype charge sb append append get amount doc amttype charge tax for int i 0 i m taxes length i ret value ret value subtract m taxes i get amount sb append append m taxes i get amount lines for int i 0 i p lines length i ret value ret value subtract p lines i get amt source sb append append p lines i get amt source sb append log fine to string balance ret value sb to string return ret value bigdecimal getbalance bigdecimal retvalue stringbuffer stringbuffer retvalue retvalue getamount amttype_gross getamount amttype_gross retvalue retvalue getamount amttype_charge getamount amttype_charge m_taxes retvalue retvalue m_taxes getamount m_taxes getamount p_lines retvalue retvalue p_lines getamtsource p_lines getamtsource tostring retvalue tostring retvalue create facts the accounting logic for ari arc arf api apc pre ari arf receivables dr charge cr tax due cr revenue cr arc receivables cr charge dr tax due dr revenue rr api payables cr charge dr tax credit dr expense dr apc payables dr charge cr tax credit cr expense cr pre param as accounting schema return fact public array list fact create facts m acct schema as array list fact facts new array list fact create fact header fact fact new fact this as fact post actual cash based accounting if as is accrual return facts ari arf if get document type equals doctype arinvoice get document type equals doctype arproforma big decimal gross amt get amount doc amttype gross big decimal service amt env zero header charge cr big decimal amt get amount doc amttype charge if amt null amt signum 0 fact create line null get account doc accttype charge as getc currency id null amt tax due cr for int i 0 i m taxes length i amt m taxes i get amount if amt null amt signum 0 fact line tl fact create line null m taxes i get account doc tax accttype taxdue as getc currency id null amt if tl null tl setc tax id m taxes i getc tax id revenue cr for int i 0 i p lines length i amt p lines i get amt source big decimal d amt null if as is trade discount posted big decimal discount p lines i get discount if discount null discount signum 0 amt amt add discount d amt discount fact create line p lines i p lines i get account product cost accttype p revenue as getc currency id d amt amt if p lines i is item gross amt gross amt subtract amt service amt service amt add amt set locations fact line f lines fact get lines for int i 0 i f lines length i if f lines i null f lines i set location from org f lines i getad org id true from loc f lines i set location fromb partner getc bpartner location id false to loc receivables dr int receivables id getvalidcombination id doc accttype c receivable as int receivablesservices id getvalidcombination id doc accttype c receivable services as if m alllinesitem as is post services receivables id receivablesservices id gross amt get amount doc amttype gross service amt env zero else if m alllinesservice service amt get amount doc amttype gross gross amt env zero if gross amt signum 0 fact create line null m account get get ctx receivables id getc currency id gross amt null if service amt signum 0 fact create line null m account get get ctx receivablesservices id getc currency id service amt null arc else if get document type equals doctype arcredit big decimal gross amt get amount doc amttype gross big decimal service amt env zero header charge dr big decimal amt get amount doc amttype charge if amt null amt signum 0 fact create line null get account doc accttype charge as getc currency id amt null tax due dr for int i 0 i m taxes length i amt m taxes i get amount if amt null amt signum 0 fact line tl fact create line null m taxes i get account doc tax accttype taxdue as getc currency id amt null if tl null tl setc tax id m taxes i getc tax id revenue cr for int i 0 i p lines length i amt p lines i get amt source big decimal d amt null if as is trade discount posted big decimal discount p lines i get discount if discount null discount signum 0 amt amt add discount d amt discount fact create line p lines i p lines i get account product cost accttype p revenue as getc currency id amt d amt if p lines i is item gross amt gross amt subtract amt service amt service amt add amt set locations fact line f lines fact get lines for int i 0 i f lines length i if f lines i null f lines i set location from org f lines i getad org id true from loc f lines i set location fromb partner getc bpartner location id false to loc receivables cr int receivables id getvalidcombination id doc accttype c receivable as int receivablesservices id getvalidcombination id doc accttype c receivable services as if m alllinesitem as is post services receivables id receivablesservices id gross amt get amount doc amttype gross service amt env zero else if m alllinesservice service amt get amount doc amttype gross gross amt env zero if gross amt signum 0 fact create line null m account get get ctx receivables id getc currency id null gross amt if service amt signum 0 fact create line null m account get get ctx receivablesservices id getc currency id null service amt api else if get document type equals doctype apinvoice big decimal gross amt get amount doc amttype gross big decimal service amt env zero charge dr fact create line null get account doc accttype charge as getc currency id get amount doc amttype charge null tax credit dr for int i 0 i m taxes length i fact line tl fact create line null m taxes i get account m taxes i getap tax type as getc currency id m taxes i get amount null if tl null tl setc tax id m taxes i getc tax id expense dr for int i 0 i p lines length i doc line line p lines i boolean landed cost landed cost as fact line true if landed cost as is explicit cost adjustment fact create line line line get account product cost accttype p expense as getc currency id line get amt source null fact line fl fact create line line line get account product cost accttype p expense as getc currency id null line get amt source string desc line get description if desc null desc 100 else desc 100 fl set description desc if landed cost m account expense line get account product cost accttype p expense as if line is item expense line get account product cost accttype p inventoryclearing as big decimal amt line get amt source big decimal d amt null if as is trade discount posted line is item big decimal discount line get discount if discount null discount signum 0 amt amt add discount d amt discount fact create line line expense getc currency id amt d amt if line is item gross amt gross amt subtract amt service amt service amt add amt if line getm product id 0 line get product is service otherwise inv matching m cost detail create invoice as line getad org id line getm product id line getm attributesetinstance id line get id 0 no cost element line get amt source line get qty line get description get trx name set locations fact line f lines fact get lines for int i 0 i f lines length i if f lines i null f lines i set location fromb partner getc bpartner location id true from loc f lines i set location from org f lines i getad org id false to loc liability cr int payables id getvalidcombination id doc accttype v liability as int payablesservices id getvalidcombination id doc accttype v liability services as if m alllinesitem as is post services payables id payablesservices id gross amt get amount doc amttype gross service amt env zero else if m alllinesservice service amt get amount doc amttype gross gross amt env zero if gross amt signum 0 fact create line null m account get get ctx payables id getc currency id null gross amt if service amt signum 0 fact create line null m account get get ctx payablesservices id getc currency id null service amt update productpo as only api update product info as getc acctschema id only api apc else if get document type equals doctype apcredit big decimal gross amt get amount doc amttype gross big decimal service amt env zero charge cr fact create line null get account doc accttype charge as getc currency id null get amount doc amttype charge tax credit cr for i taxdue taxdue taxcredit taxcredit arraylist createfacts macctschema arraylist arraylist post_actual isaccrual getdocumenttype doctype_arinvoice getdocumenttype doctype_arproforma bigdecimal grossamt getamount amttype_gross bigdecimal serviceamt bigdecimal getamount amttype_charge createline getaccount accttype_charge getc_currency_id taxdue m_taxes m_taxes getamount factline createline m_taxes getaccount doctax accttype_taxdue getc_currency_id setc_tax_id m_taxes getc_tax_id p_lines p_lines getamtsource bigdecimal damt istradediscountposted bigdecimal p_lines getdiscount damt createline p_lines p_lines getaccount productcost accttype_p_revenue getc_currency_id damt p_lines isitem grossamt grossamt serviceamt serviceamt factline flines getlines flines flines flines setlocationfromorg flines getad_org_id flines setlocationfrombpartner getc_bpartner_location_id receivables_id getvalidcombination_id accttype_c_receivable receivablesservices_id getvalidcombination_id accttype_c_receivable_services m_alllinesitem ispostservices receivables_id receivablesservices_id grossamt getamount amttype_gross serviceamt m_alllinesservice serviceamt getamount amttype_gross grossamt grossamt createline maccount getctx receivables_id getc_currency_id grossamt serviceamt createline maccount getctx receivablesservices_id getc_currency_id serviceamt getdocumenttype doctype_arcredit bigdecimal grossamt getamount amttype_gross bigdecimal serviceamt bigdecimal getamount amttype_charge createline getaccount accttype_charge getc_currency_id taxdue m_taxes m_taxes getamount factline createline m_taxes getaccount doctax accttype_taxdue getc_currency_id setc_tax_id m_taxes getc_tax_id p_lines p_lines getamtsource bigdecimal damt istradediscountposted bigdecimal p_lines getdiscount damt createline p_lines p_lines getaccount productcost accttype_p_revenue getc_currency_id damt p_lines isitem grossamt grossamt serviceamt serviceamt factline flines getlines flines flines flines setlocationfromorg flines getad_org_id flines setlocationfrombpartner getc_bpartner_location_id receivables_id getvalidcombination_id accttype_c_receivable receivablesservices_id getvalidcombination_id accttype_c_receivable_services m_alllinesitem ispostservices receivables_id receivablesservices_id grossamt getamount amttype_gross serviceamt m_alllinesservice serviceamt getamount amttype_gross grossamt grossamt createline maccount getctx receivables_id getc_currency_id grossamt serviceamt createline maccount getctx receivablesservices_id getc_currency_id serviceamt getdocumenttype doctype_apinvoice bigdecimal grossamt getamount amttype_gross bigdecimal serviceamt createline getaccount accttype_charge getc_currency_id getamount amttype_charge taxcredit m_taxes factline createline m_taxes getaccount m_taxes getaptaxtype getc_currency_id m_taxes getamount setc_tax_id m_taxes getc_tax_id p_lines docline p_lines landedcost landedcost landedcost isexplicitcostadjustment createline getaccount productcost accttype_p_expense getc_currency_id getamtsource factline createline getaccount productcost accttype_p_expense getc_currency_id getamtsource getdescription setdescription landedcost maccount getaccount productcost accttype_p_expense isitem getaccount productcost accttype_p_inventoryclearing bigdecimal getamtsource bigdecimal damt istradediscountposted isitem bigdecimal getdiscount damt createline getc_currency_id damt isitem grossamt grossamt serviceamt serviceamt getm_product_id getproduct isservice mcostdetail createinvoice getad_org_id getm_product_id getm_attributesetinstance_id get_id getamtsource getqty getdescription gettrxname factline flines getlines flines flines flines setlocationfrombpartner getc_bpartner_location_id flines setlocationfromorg flines getad_org_id payables_id getvalidcombination_id accttype_v_liability payablesservices_id getvalidcombination_id accttype_v_liability_services m_alllinesitem ispostservices payables_id payablesservices_id grossamt getamount amttype_gross serviceamt m_alllinesservice serviceamt getamount amttype_gross grossamt grossamt createline maccount getctx payables_id getc_currency_id grossamt serviceamt createline maccount getctx payablesservices_id getc_currency_id serviceamt updateproductpo updateproductinfo getc_acctschema_id getdocumenttype doctype_apcredit bigdecimal grossamt getamount amttype_gross bigdecimal serviceamt createline getaccount accttype_charge getc_currency_id getamount amttype_charge taxcredit create fact cash based i e only revenue expense param as accounting schema param fact fact to add lines to param multiplier source amount multiplier return accounted amount public big decimal create fact cash m acct schema as fact fact big decimal multiplier boolean credit memo get document type equals doctype arcredit get document type equals doctype apcredit boolean payables get document type equals doctype apinvoice get document type equals doctype apcredit big decimal acct amt env zero fact line fl null revenue cost for int i 0 i p lines length i doc line line p lines i boolean landed cost false if payables landed cost landed cost as fact line false if landed cost as is explicit cost adjustment fact create line line line get account product cost accttype p expense as getc currency id null line get amt source fl fact create line line line get account product cost accttype p expense as getc currency id line get amt source null string desc line get description if desc null desc 100 else desc 100 fl set description desc if landed cost m account acct line get account payables product cost accttype p expense product cost accttype p revenue as if payables if fixed asset if line is item acct line get account product cost accttype p inventoryclearing as big decimal amt line get amt source multiply multiplier big decimal amt2 null if credit memo amt2 amt amt null if payables vendor dr fl fact create line line acct getc currency id amt amt2 else customer cr fl fact create line line acct getc currency id amt2 amt if fl null acct amt acct amt add fl get acct balance tax for int i 0 i m taxes length i big decimal amt m taxes i get amount big decimal amt2 null if credit memo amt2 amt amt null fact line tl null if payables tl fact create line null m taxes i get account m taxes i getap tax type as getc currency id amt amt2 else tl fact create line null m taxes i get account doc tax accttype taxdue as getc currency id amt2 amt if tl null tl setc tax id m taxes i getc tax id set locations fact line f lines fact get lines for int i 0 i f lines length i if f lines i null if payables f lines i set location fromb partner getc bpartner location id true from loc f lines i set location from org f lines i getad org id false to loc else f lines i set location from org f lines i getad org id true from loc f lines i set location fromb partner getc bpartner location id false to loc return acct amt bigdecimal createfactcash macctschema bigdecimal creditmemo getdocumenttype doctype_arcredit getdocumenttype doctype_apcredit getdocumenttype doctype_apinvoice getdocumenttype doctype_apcredit bigdecimal acctamt factline p_lines docline p_lines landedcost landedcost landedcost landedcost isexplicitcostadjustment createline getaccount productcost accttype_p_expense getc_currency_id getamtsource createline getaccount productcost accttype_p_expense getc_currency_id getamtsource getdescription setdescription landedcost maccount getaccount productcost accttype_p_expense productcost accttype_p_revenue isitem getaccount productcost accttype_p_inventoryclearing bigdecimal getamtsource bigdecimal creditmemo createline getc_currency_id createline getc_currency_id acctamt acctamt getacctbalance m_taxes bigdecimal m_taxes getamount bigdecimal creditmemo factline createline m_taxes getaccount m_taxes getaptaxtype getc_currency_id createline m_taxes getaccount doctax accttype_taxdue getc_currency_id setc_tax_id m_taxes getc_tax_id factline flines getlines flines flines flines setlocationfrombpartner getc_bpartner_location_id flines setlocationfromorg flines getad_org_id flines setlocationfromorg flines getad_org_id flines setlocationfrombpartner getc_bpartner_location_id acctamt create landed cost accounting cost lines param as accounting schema param fact fact param line document line param dr dr entry normal api return true if landed costs were created private boolean landed cost m acct schema as fact fact doc line line boolean dr int c invoiceline id line get id m landed cost allocation lcas m landed cost allocation get of invoice line get ctx c invoiceline id get trx name if lcas length 0 return false delete old string sql delete m costdetail where c invoiceline id c invoiceline id int no db execute update sql get trx name if no 0 log config cost detail deleted no calculate total base double total base 0 for int i 0 i lcas length i total base lcas i get base double value create new m invoice line il new m invoice line get ctx c invoiceline id get trx name for int i 0 i lcas length i m landed cost allocation lca lcas i if lca get base signum 0 continue double percent total base lca get base double value string desc il get description if desc null desc percent else desc percent if line get description null desc line get description accounting product cost pc new product cost env get ctx lca getm product id lca getm attributesetinstance id get trx name big decimal dr amt null big decimal cr amt null if dr dr amt lca get amt else cr amt lca get amt fact line fl fact create line line pc get account product cost accttype p costadjustment as getc currency id dr amt cr amt fl set description desc cost detail convert to acct currency big decimal allocation amt lca get amt if getc currency id as getc currency id allocation amt m conversion rate convert get ctx allocation amt getc currency id as getc currency id get date acct getc conversiontype id getad client id getad org id if allocation amt scale as get costing precision allocation amt allocation amt set scale as get costing precision big decimal round half up if dr allocation amt allocation amt negate m cost detail cd new m cost detail as lca getad org id lca getm product id lca getm attributesetinstance id lca getm costelement id allocation amt env zero qty desc get trx name cd setc invoiceline id c invoiceline id boolean ok cd save if ok cd is processed m client client m client get as get ctx as getad client id if client is cost immediate cd process log config created lcas length return true landedcost macctschema docline c_invoiceline_id get_id mlandedcostallocation mlandedcostallocation getofinvoiceline getctx c_invoiceline_id gettrxname m_costdetail c_invoiceline_id c_invoiceline_id executeupdate gettrxname costdetail totalbase totalbase getbase doublevalue minvoiceline minvoiceline getctx c_invoiceline_id gettrxname mlandedcostallocation getbase totalbase getbase doublevalue getdescription getdescription getdescription productcost productcost getctx getm_product_id getm_attributesetinstance_id gettrxname bigdecimal dramt bigdecimal cramt dramt getamt cramt getamt factline createline getaccount productcost accttype_p_costadjustment getc_currency_id dramt cramt setdescription acctcurrency bigdecimal allocationamt getamt getc_currency_id getc_currency_id allocationamt mconversionrate getctx allocationamt getc_currency_id getc_currency_id getdateacct getc_conversiontype_id getad_client_id getad_org_id allocationamt getcostingprecision allocationamt allocationamt setscale getcostingprecision bigdecimal round_half_up allocationamt allocationamt mcostdetail mcostdetail getad_org_id getm_product_id getm_attributesetinstance_id getm_costelement_id allocationamt gettrxname setc_invoiceline_id c_invoiceline_id isprocessed mclient mclient getctx getad_client_id iscostimmediate update productpo price last inv param as accounting schema private void update productpo m acct schema as m client info ci m client info get get ctx as getad client id if ci getc acctschema1 id as getc acctschema id return string buffer sql new string buffer update m product po po set price last inv select select currency convert il price actual i c currency id po c currency id i date invoiced i c conversiontype id i ad client id i ad org id from c invoice i c invoiceline il where i c invoice id il c invoice id and po m product id il m product id and po c bpartner id i c bpartner id and rownum 1 and i c invoice id append get id append update append where exists select from c invoice i c invoiceline il where i c invoice id il c invoice id and po m product id il m product id and po c bpartner id i c bpartner id and i c invoice id append get id append int no db execute update sql to string get trx name log fine updated no pricelastinv updateproductpo macctschema mclientinfo mclientinfo getctx getad_client_id getc_acctschema1_id getc_acctschema_id stringbuffer stringbuffer m_product_po pricelastinv currencyconvert priceactual c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id c_invoice c_invoiceline c_invoice_id c_invoice_id m_product_id m_product_id c_bpartner_id c_bpartner_id c_invoice_id get_id c_invoice c_invoiceline c_invoice_id c_invoice_id m_product_id m_product_id c_bpartner_id c_bpartner_id c_invoice_id get_id executeupdate tostring gettrxname update product info old costing price last inv po price last inv param c acctschema id accounting schema deprecated old costing private void update product info int c acctschema id log fine c invoice id get id todo last would need to compare document last updated date would need to maintain last price update date on po and costing update product costing requires existence of currency conversion if there are multiple lines of the same product last price uses first total inv amt is sometimes null error begin globalqss 2005 10 19 postgresql doesn t support limit on update or delete statements string buffer sql new string buffer update m product costing pc set price last inv total inv amt total inv qty select select currency convert il price actual i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id currency convert il line net amt i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id il qty invoiced from c invoice i c invoiceline il c acctschema a where i c invoice id il c invoice id and pc m product id il m product id and pc c acctschema id a c acctschema id and rownum 1 and pc c acctschema id append c acctschema id append and i c invoice id append get id append update append where exists select from c invoice i c invoiceline il c acctschema a where i c invoice id il c invoice id and pc m product id il m product id and pc c acctschema id a c acctschema id and pc c acctschema id append c acctschema id append and i c invoice id append get id append the next command is equivalent and works in postgresql and oracle string buffer sql new string buffer update m product costing pc set price last inv total inv amt total inv qty select select currency convert il price actual i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id currency convert il line net amt i c currency id a c currency id i date invoiced i c conversiontype id i ad client id i ad org id il qty invoiced from c invoice i c invoiceline il c acctschema a where i c invoice id il c invoice id and il c invoiceline id select min c invoiceline id from c invoiceline where c invoice id append get id append and pc m product id il m product id and pc c acctschema id a c acctschema id and pc c acctschema id append c acctschema id append and i c invoice id append get id append update append where exists select from c invoice i c invoiceline il c acctschema a where i c invoice id il c invoice id and pc m product id il m product id and pc c acctschema id a c acctschema id and pc c acctschema id append c acctschema id append and i c invoice id append get id append end globalqss 2005 10 19 int no db execute update sql to string get trx name log fine m product costing updated no pricelastinv pricelastinv c_acctschema_id updateproductinfo c_acctschema_id c_invoice_id get_id lastpriceupdatedate _po _costing totalinvamt stringbuffer stringbuffer m_product_costing pricelastinv totalinvamt totalinvqty currencyconvert priceactual c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id currencyconvert linenetamt c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id qtyinvoiced c_invoice c_invoiceline c_acctschema c_invoice_id c_invoice_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_invoice_id get_id c_invoice c_invoiceline c_acctschema c_invoice_id c_invoice_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_invoice_id get_id stringbuffer stringbuffer m_product_costing pricelastinv totalinvamt totalinvqty currencyconvert priceactual c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id currencyconvert linenetamt c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id qtyinvoiced c_invoice c_invoiceline c_acctschema c_invoice_id c_invoice_id c_invoiceline_id c_invoiceline_id c_invoiceline c_invoice_id get_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_invoice_id get_id c_invoice c_invoiceline c_acctschema c_invoice_id c_invoice_id m_product_id m_product_id c_acctschema_id c_acctschema_id c_acctschema_id c_acctschema_id c_invoice_id get_id executeupdate tostring gettrxname m_product_costing basic constructor public xhtml frame set document xhtmlframesetdocument basic constructor sets the codeset for the page output public xhtml frame set document string codeset set codeset codeset xhtmlframesetdocument setcodeset get the html element for this document container public html get html return html gethtml set the html element for this xhtml frame set document container public xhtml frame set document set html html set html this html set html return this xhtmlframesetdocument xhtmlframesetdocument sethtml set_html set_html get the head element for this xhtml frame set document container public head get head return head xhtmlframesetdocument gethead set the head element for this xhtml frame set document container public xhtml frame set document set head head set head this head set head return this xhtmlframesetdocument xhtmlframesetdocument sethead set_head set_head append to the head element for this xhtml frame set document container param value adds to the value between the head tags public xhtml frame set document append head element value head add element value return this xhtmlframesetdocument xhtmlframesetdocument appendhead addelement append to the head element for this xhtml frame set document container param value adds to the value between the head tags public xhtml frame set document append head string value head add element value return this xhtmlframesetdocument xhtmlframesetdocument appendhead addelement get the frameset element for this xhtml frame set document container public frameset get frame set return frameset xhtmlframesetdocument getframeset set the frameset element for this xhtml frame set document container public xhtml frame set document set head frameset set frameset this frameset set frameset return this xhtmlframesetdocument xhtmlframesetdocument sethead set_frameset set_frameset append to the head element for this frame set document container param value adds to the value between the head tags public xhtml frame set document append frame set element value frameset add element value return this framesetdocument xhtmlframesetdocument appendframeset addelement append to the head element for this xhtml frame set document container param value adds to the value between the head tags public xhtml frame set document append frame set string value frameset add element value return this xhtmlframesetdocument xhtmlframesetdocument appendframeset addelement get the body element for this xhtml frame set document container public body get body return body xhtmlframesetdocument getbody set the body element for this xhtml frame set document container public xhtml frame set document set body body set body this body set body return this xhtmlframesetdocument xhtmlframesetdocument setbody set_body set_body append to the body element for this xhtml frame set document container param value adds to the value between the body tags public xhtml frame set document append body element value body add element value return this xhtmlframesetdocument xhtmlframesetdocument appendbody addelement append to the body element for this xhtml frame set document container param value adds to the value between the body tags public xhtml frame set document append body string value body add element value return this xhtmlframesetdocument xhtmlframesetdocument appendbody addelement get the title element for this xhtml frame set document container public title get title return title xhtmlframesetdocument gettitle set the title element for this xhtml frame set document container public xhtml frame set document set title title set title this title set title return this xhtmlframesetdocument xhtmlframesetdocument settitle set_title set_title append to the title element for this xhtml frame set document container param value adds to the value between the title tags public xhtml frame set document append title element value title add element value return this xhtmlframesetdocument xhtmlframesetdocument appendtitle addelement append to the title element for this xhtml frame set document container param value adds to the value between the title tags public xhtml frame set document append title string value title add element value return this xhtmlframesetdocument xhtmlframesetdocument appendtitle addelement sets the codeset for this xhtml frame set document public void set codeset string codeset this codeset codeset xhtmlframesetdocument setcodeset gets the codeset for this xhtml frame set document return the codeset public string get codeset return this codeset xhtmlframesetdocument getcodeset write the container to the output stream public void output output stream out xhtml frame set document is just a convient wrapper for html call html output html output out outputstream outputstream xhtmlframesetdocument write the container to the printe writer public void output print writer out xhtml frame set document is just a convient wrapper for html call html output html output out printewriter printwriter xhtmlframesetdocument override the to string method so that it prints something meaningful public final string to string if get codeset null return html to string get codeset else return html to string tostring tostring getcodeset tostring getcodeset tostring override the to string method so that it prints something meaningful public final string to string string codeset return html to string codeset tostring tostring tostring allows the xhtml frame set document to be cloned doesn t return an instanceof xhtml frame set document returns instance of html public object clone return html clone xhtmlframesetdocument xhtmlframesetdocument standard constructor public x ad accesslog properties ctx int ad accesslog id string trx name super ctx ad accesslog id trx name if ad accesslog id 0 setad accesslog id 0 x_ad_accesslog ad_accesslog_id trxname ad_accesslog_id trxname ad_accesslog_id setad_accesslog_id load constructor public x ad accesslog properties ctx result set rs string trx name super ctx rs trx name x_ad_accesslog resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad accesslog append get id append return sb to string tostring stringbuffer stringbuffer x_ad_accesslog get_id tostring set access log log of access to the system public void setad accesslog id int ad accesslog id if ad accesslog id 1 throw new illegal argument exception ad accesslog id is mandatory set valuenocheck ad accesslog id new integer ad accesslog id setad_accesslog_id ad_accesslog_id ad_accesslog_id illegalargumentexception ad_accesslog_id set_valuenocheck ad_accesslog_id ad_accesslog_id get access log log of access to the system public int getad accesslog id integer ii integer get value ad accesslog id if ii null return 0 return ii int value getad_accesslog_id get_value ad_accesslog_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad accesslog id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_accesslog_id set column column in the table public void setad column id int ad column id if ad column id 0 set value ad column id null else set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id set_value ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set record id direct internal record id public void setrecord id int record id if record id 0 set value record id null else set value record id new integer record id setrecord_id record_id record_id set_value record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set remote addr remote address public void setremote addr string remote addr if remote addr null remote addr length 60 log warning length 60 truncated remote addr remote addr substring 0 59 set value remote addr remote addr setremote_addr remote_addr remote_addr remote_addr remote_addr remote_addr set_value remote_addr remote_addr get remote addr remote address public string getremote addr return string get value remote addr getremote_addr get_value remote_addr set remote host remote host info public void setremote host string remote host if remote host null remote host length 60 log warning length 60 truncated remote host remote host substring 0 59 set value remote host remote host setremote_host remote_host remote_host remote_host remote_host remote_host set_value remote_host remote_host get remote host remote host info public string getremote host return string get value remote host getremote_host get_value remote_host set reply reply or answer public void set reply string reply if reply null reply length 2000 log warning length 2000 truncated reply reply substring 0 1999 set value reply reply setreply set_value get reply reply or answer public string get reply return string get value reply getreply get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg standard constructor public x b buyerfunds properties ctx int b buyerfunds id string trx name super ctx b buyerfunds id trx name if b buyerfunds id 0 setad user id 0 setb buyerfunds id 0 set committed amt env zero set non committed amt env zero x_b_buyerfunds b_buyerfunds_id trxname b_buyerfunds_id trxname b_buyerfunds_id setad_user_id setb_buyerfunds_id setcommittedamt setnoncommittedamt load constructor public x b buyerfunds properties ctx result set rs string trx name super ctx rs trx name x_b_buyerfunds resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b buyerfunds append get id append return sb to string tostring stringbuffer stringbuffer x_b_buyerfunds get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id set buyer funds buyer funds for bids on topics public void setb buyerfunds id int b buyerfunds id if b buyerfunds id 1 throw new illegal argument exception b buyerfunds id is mandatory set valuenocheck b buyerfunds id new integer b buyerfunds id setb_buyerfunds_id b_buyerfunds_id b_buyerfunds_id illegalargumentexception b_buyerfunds_id set_valuenocheck b_buyerfunds_id b_buyerfunds_id get buyer funds buyer funds for bids on topics public int getb buyerfunds id integer ii integer get value b buyerfunds id if ii null return 0 return ii int value getb_buyerfunds_id get_value b_buyerfunds_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set valuenocheck c payment id null else set valuenocheck c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_valuenocheck c_payment_id set_valuenocheck c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set committed amount the legal commitment amount public void set committed amt big decimal committed amt if committed amt null throw new illegal argument exception committed amt is mandatory set value committed amt committed amt setcommittedamt bigdecimal committedamt committedamt illegalargumentexception committedamt set_value committedamt committedamt get committed amount the legal commitment amount public big decimal get committed amt big decimal bd big decimal get value committed amt if bd null return env zero return bd bigdecimal getcommittedamt bigdecimal bigdecimal get_value committedamt set not committed aount amount not committed yet public void set non committed amt big decimal non committed amt if non committed amt null throw new illegal argument exception non committed amt is mandatory set value non committed amt non committed amt setnoncommittedamt bigdecimal noncommittedamt noncommittedamt illegalargumentexception noncommittedamt set_value noncommittedamt noncommittedamt get not committed aount amount not committed yet public big decimal get non committed amt big decimal bd big decimal get value non committed amt if bd null return env zero return bd bigdecimal getnoncommittedamt bigdecimal bigdecimal get_value noncommittedamt get m table from cache param ctx context param ad table id id return m table public static m table get properties ctx int ad table id integer key new integer ad table id m table ret value m table s cache get key if ret value null return ret value ret value new m table ctx ad table id null if ret value get id 0 s cache put key ret value return ret value m_table ad_table_id m_table m_table ad_table_id ad_table_id m_table retvalue m_table s_cache retvalue retvalue retvalue m_table ad_table_id retvalue get_id s_cache retvalue retvalue get m table from cache param ctx context param table name case insensitive table name return table public static m table get properties ctx string table name if table name null return null iterator it s cache values iterator while it has next m table ret value m table it next if table name equals ignore case ret value get table name return ret value m table ret value null string sql select from ad table where upper table name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 table name to upper case result set rs pstmt execute query if rs next ret value new m table ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null integer key new integer ret value getad table id s cache put key ret value return ret value m_table tablename m_table tablename tablename s_cache hasnext m_table retvalue m_table tablename equalsignorecase retvalue gettablename retvalue m_table retvalue ad_table tablename preparedstatement preparestatement setstring tablename touppercase resultset executequery retvalue m_table s_log retvalue retvalue getad_table_id s_cache retvalue retvalue get table name param ctx context param ad table id table return tavle name public static string get table name properties ctx int ad table id return m table get ctx ad table id get table name ad_table_id gettablename ad_table_id m_table ad_table_id gettablename get persistency class for table param table name table name return class or null public static class get class string table name not supported if table name null table name ends with trl return null import tables name conflict if table name starts with i class clazz getp oclass org compiere model x table name if clazz null return clazz s log warning no class for table table name return null special naming for int i 0 i s special length i if s special i equals table name class clazz getp oclass s special i if clazz null return clazz break strip table name prefix e g ad customizations are 3 4 string class name table name int index class name index of if index 0 if index 3 ad a class name class name substring index 1 else string prefix class name substring 0 index if prefix equals fact keep custom prefix class name class name substring index 1 remove underlines class name util replace class name search packages for int i 0 i s packages length i string buffer name new string buffer s packages i append m append class name class clazz getp oclass name to string if clazz null return clazz default extension class clazz getp oclass compiere model x table name if clazz null return clazz default clazz getp oclass org compiere model x table name if clazz null return clazz return null tablename getclass tablename tablename tablename endswith _trl tablename startswith i_ getpoclass x_ tablename s_log tablename s_special s_special tablename getpoclass s_special ad_ classname tablename classname indexof _ ad_ a_ classname classname classname classname classname classname classname _ s_packages stringbuffer stringbuffer s_packages classname getpoclass tostring getpoclass x_ tablename getpoclass x_ tablename get po class param class name fully qualified class name return class or null private static class getp oclass string class name try class clazz class for name class name make sure that it is a po class class super clazz clazz get superclass while super clazz null if super clazz po class s log fine use class name return clazz super clazz super clazz get superclass catch exception e s log finest not found class name return null classname getpoclass classname forname classname superclazz getsuperclass superclazz superclazz s_log classname superclazz superclazz getsuperclass s_log classname standard constructor param ctx context param ad table id id public m table properties ctx int ad table id string trx name super ctx ad table id trx name if ad table id 0 set name null set table name null set access level accesslevel systemonly 4 set entity type entitytype usermaintained u set is change log false set is deleteable false set is high volume false set is security enabled false set is view false n set replication type replicationtype local ad_table_id m_table ad_table_id trxname ad_table_id trxname ad_table_id setname settablename setaccesslevel accesslevel_systemonly setentitytype entitytype_usermaintained setischangelog setisdeleteable setishighvolume setissecurityenabled setisview setreplicationtype replicationtype_local load constructor param ctx context param rs result set public m table properties ctx result set rs string trx name super ctx rs trx name m_table resultset trxname trxname get columns param requery requery return array of columns public m column get columns boolean requery if m columns null requery return m columns string sql select from ad column where ad table id order by ad column id array list m column list new array list m column prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getad table id result set rs pstmt execute query while rs next list add new m column get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m columns new m column list size list to array m columns return m columns m_column getcolumns m_columns m_columns ad_column ad_table_id ad_column_id arraylist m_column arraylist m_column preparedstatement preparestatement get_trxname setint getad_table_id resultset executequery m_column getctx get_trxname m_columns m_column toarray m_columns m_columns get column param column name case insensitive return column if found public m column get column string column name if column name null column name length 0 return null get columns false for int i 0 i m columns length i if column name equals ignore case m columns i get column name return m columns i return null columnname m_column getcolumn columnname columnname columnname getcolumns m_columns columnname equalsignorecase m_columns getcolumnname m_columns get po class instance param record id record param trx name return po for record or null public po getpo int record id string trx name string table name get table name class clazz get class table name if clazz null log log level warning id class not found for table name return null boolean error logged false try constructor constructor null try constructor clazz get declared constructor new class properties class int class string class catch exception e string msg e get message if msg null msg e to string log warning no transaction constructor for clazz msg po po po constructor new instance new object get ctx new integer record id trx name if po null po get id record id return null return po catch exception e if e get cause null throwable t e get cause log log level severe id table table name class clazz t error logged true if t instanceof exception log save error error exception e get cause else log save error error table table name class clazz else log log level severe id table table name class clazz e error logged true log save error error table table name class clazz if error logged log log level severe id not found table table name record id record id return null record_id trxname record_id trxname tablename gettablename getclass tablename tablename errorlogged getdeclaredconstructor getmessage tostring newinstance getctx record_id trxname get_id record_id getcause getcause tablename errorlogged saveerror getcause saveerror tablename tablename errorlogged saveerror tablename errorlogged tablename record_id record_id get po class instance param rs result set return po for record or null public po getpo result set rs string trx name string table name get table name class clazz get class table name if clazz null log log level severe rs class not found for table name return null boolean error logged false try constructor constructor clazz get declared constructor new class properties class result set class string class po po po constructor new instance new object get ctx rs trx name return po catch exception e log log level severe rs table table name class clazz e error logged true log save error error table table name class clazz if error logged log log level severe rs not found table table name return null resultset trxname tablename gettablename getclass tablename tablename errorlogged getdeclaredconstructor resultset newinstance getctx trxname tablename errorlogged saveerror tablename errorlogged tablename get po class instance param where clause where clause param trx name transaction return po for record or null public po getpo string where clause string trx name if where clause null where clause length 0 return null po po null string sql select from get table name where where clause prepared statement pstmt null try pstmt db prepare statement sql trx name result set rs pstmt execute query if rs next po getpo rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e log save error error e try if pstmt null pstmt close pstmt null catch exception e pstmt null return po whereclause trxname whereclause trxname whereclause whereclause gettablename whereclause preparedstatement preparestatement trxname resultset executequery trxname saveerror before save param new record new return true protected boolean before save boolean new record if is view is deleteable set is deleteable false return true newrecord beforesave newrecord isview isdeleteable setisdeleteable after save param new record new param success success return success protected boolean after save boolean new record boolean success sync table id if new record m sequence create table sequence get ctx get table name get trxname else m sequence seq m sequence get get ctx get table name if seq null seq get id 0 m sequence create table sequence get ctx get table name get trxname else if seq get name equals get table name seq set name get table name seq save return success newrecord aftersave newrecord newrecord msequence createtablesequence getctx gettablename get_trxname msequence msequence getctx gettablename get_id msequence createtablesequence getctx gettablename get_trxname getname gettablename setname gettablename get sql create return create table ddl public string getsql create string buffer sb new string buffer create table append get table name append boolean haspk false boolean has parents false string buffer constraints new string buffer get columns true for int i 0 i m columns length i if i 0 sb append m column column m columns i sb append column getsqlddl if column is key haspk true if column is parent has parents true string constraint column get constraint get table name if constraint null constraint length 0 constraints append append constraint multi column pk if haspk has parents string buffer cols new string buffer for int i 0 i m columns length i m column column m columns i if column is parent continue if cols length 0 cols append cols append column get column name sb append constraint append get table name append key primary key append cols append sb append constraints append return sb to string getsqlcreate stringbuffer stringbuffer gettablename hasparents stringbuffer stringbuffer getcolumns m_columns m_column m_columns iskey isparent hasparents getconstraint gettablename hasparents stringbuffer stringbuffer m_columns m_column m_columns isparent getcolumnname gettablename _key tostring standard constructor public x w clickcount properties ctx int w clickcount id string trx name super ctx w clickcount id trx name if w clickcount id 0 set name null set targeturl null setw clickcount id 0 x_w_clickcount w_clickcount_id trxname w_clickcount_id trxname w_clickcount_id setname settargeturl setw_clickcount_id load constructor public x w clickcount properties ctx result set rs string trx name super ctx rs trx name x_w_clickcount resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w clickcount append get id append return sb to string tostring stringbuffer stringbuffer x_w_clickcount get_id tostring public static final int c bpartner id ad reference id 232 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set counter count value public void set counter int counter throw new illegal argument exception counter is virtual column setcounter illegalargumentexception get counter count value public int get counter integer ii integer get value counter if ii null return 0 return ii int value getcounter get_value intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set target url url for the target public void set targeturl string targeturl if targeturl null throw new illegal argument exception targeturl is mandatory if targeturl length 120 log warning length 120 truncated targeturl targeturl substring 0 119 set value targeturl targeturl settargeturl illegalargumentexception set_value get target url url for the target public string get targeturl return string get value targeturl gettargeturl get_value set click count web click management public void setw clickcount id int w clickcount id if w clickcount id 1 throw new illegal argument exception w clickcount id is mandatory set valuenocheck w clickcount id new integer w clickcount id setw_clickcount_id w_clickcount_id w_clickcount_id illegalargumentexception w_clickcount_id set_valuenocheck w_clickcount_id w_clickcount_id get click count web click management public int getw clickcount id integer ii integer get value w clickcount id if ii null return 0 return ii int value getw_clickcount_id get_value w_clickcount_id intvalue get inventory from cache param ctx context param m inventory id id return m inventory public static m inventory get properties ctx int m inventory id integer key new integer m inventory id m inventory ret value m inventory s cache get key if ret value null return ret value ret value new m inventory ctx m inventory id null if ret value get id 0 s cache put key ret value return ret value m_inventory_id minventory minventory m_inventory_id m_inventory_id minventory retvalue minventory s_cache retvalue retvalue retvalue minventory m_inventory_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param m inventory id id public m inventory properties ctx int m inventory id string trx name super ctx m inventory id trx name if m inventory id 0 set name null setm warehouse id 0 fk set movement date new timestamp system current time millis set doc action docaction complete co set doc status docstatus drafted dr set is approved false set movement date new timestamp system current time millis date set posted false set processed false m_inventory_id minventory m_inventory_id trxname m_inventory_id trxname m_inventory_id setname setm_warehouse_id setmovementdate currenttimemillis setdocaction docaction_complete setdocstatus docstatus_drafted setisapproved setmovementdate currenttimemillis setposted setprocessed load constructor param ctx context param rs result set public m inventory properties ctx result set rs string trx name super ctx rs trx name minventory resultset trxname trxname warehouse constructor param wh warehouse public m inventory m warehouse wh this wh get ctx 0 wh get trxname set client org wh setm warehouse id wh getm warehouse id minventory mwarehouse getctx get_trxname setclientorg setm_warehouse_id getm_warehouse_id get lines param requery requery return array of lines public m inventory line get lines boolean requery if m lines null requery return m lines array list m inventory line list new array list m inventory line string sql select from m inventoryline where m inventory id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm inventory id result set rs pstmt execute query while rs next list add new m inventory line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m inventory line list size list to array m lines return m lines minventoryline getlines m_lines m_lines arraylist minventoryline arraylist minventoryline m_inventoryline m_inventory_id preparedstatement preparestatement get_trxname setint getm_inventory_id resultset executequery minventoryline getctx get_trxname m_lines minventoryline toarray m_lines m_lines add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription overwrite client org from import param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id string representation return info public string to string string buffer sb new string buffer m inventory sb append get id append append get document no append m warehouse id append getm warehouse id append return sb to string tostring stringbuffer stringbuffer minventory get_id getdocumentno m_warehouse_id getm_warehouse_id tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save param new record new return true protected boolean before save boolean new record if getc doctype id 0 m doc type types m doc type get of doc base type get ctx m doc type docbasetype materialphysicalinventory if types length 0 get first setc doctype id types 0 getc doctype id else log save error error msg parse translation get ctx not found c doctype id return false return true newrecord beforesave newrecord getc_doctype_id mdoctype mdoctype getofdocbasetype getctx mdoctype docbasetype_materialphysicalinventory setc_doctype_id getc_doctype_id saveerror parsetranslation getctx notfound c_doctype_id set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update m inventoryline set processed processed y n where m inventory id getm inventory id int no line db execute update sql get trxname m lines null log fine processed processed lines no line setprocessed setprocessed get_id m_inventoryline m_inventory_id getm_inventory_id noline executeupdate get_trxname m_lines noline process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get movement date m doc type docbasetype materialphysicalinventory m processmsg period closed return doc action status invalid m inventory line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid todo add up amounts set approval amt m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getmovementdate mdoctype docbasetype_materialphysicalinventory m_processmsg periodclosed docaction status_invalid minventoryline getlines m_processmsg nolines docaction status_invalid setapprovalamt m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string m inventory line lines get lines false for int i 0 i lines length i m inventory line line lines i if line is active continue m transaction trx null if line getm attributesetinstance id 0 big decimal qty diff line get qty internal use negate if qty diff signum 0 qty diff line get qty count subtract line get qty book if qty diff signum 0 storage m storage storage m storage get get ctx line getm locator id line getm product id 0 get trxname if storage null storage m storage get create get ctx line getm locator id line getm product id 0 get trxname big decimal qty new storage get qty on hand add qty diff log fine diff qty diff on hand storage get qty on hand qty new storage set qty on hand qty new storage set date last inventory get movement date if storage save get trxname m processmsg storage not updated 1 return doc action status invalid log fine storage to string transaction trx new m transaction get ctx m transaction movementtype inventoryin line getm locator id line getm product id 0 qty diff get movement date get trxname trx setm inventoryline id line getm inventoryline id if trx save m processmsg transaction not inserted 1 return doc action status invalid else negative qty m inventory linema mas m inventory linema get get ctx line getm inventoryline id get trxname for int j 0 j mas length j m inventory linema ma mas j storage m storage storage m storage get get ctx line getm locator id line getm product id ma getm attributesetinstance id get trxname if storage null storage m storage get create get ctx line getm locator id line getm product id ma getm attributesetinstance id get trxname big decimal max diff qty diff if max diff signum 0 ma get movement qty compare to max diff negate 0 max diff ma get movement qty negate big decimal qty new ma get movement qty add max diff storage diff log fine ma qty ma get movement qty diff qty diff max diff on hand storage get qty on hand qty new ma getm attributesetinstance id storage set qty on hand qty new storage set date last inventory get movement date if storage save get trxname m processmsg storage not updated ma return doc action status invalid log fine storage to string transaction trx new m transaction get ctx m transaction movementtype inventoryin line getm locator id line getm product id ma getm attributesetinstance id max diff get movement date get trxname trx setm inventoryline id line getm inventoryline id if trx save m processmsg transaction not inserted ma return doc action status invalid qty diff qty diff subtract max diff if qty diff signum 0 break negative qty fallback if trx null storage m storage storage m storage get get ctx line getm locator id line getm product id line getm attributesetinstance id get trxname if storage null storage m storage get create get ctx line getm locator id line getm product id line getm attributesetinstance id get trxname big decimal qty diff line get qty internal use negate if env zero compare to qty diff 0 qty diff line get qty count subtract line get qty book big decimal qty new storage get qty on hand add qty diff log fine count line get qty count book line get qty book difference qty diff on hand storage get qty on hand qty new storage set qty on hand qty new storage set date last inventory get movement date if storage save get trxname m processmsg storage not updated 2 return doc action status invalid log fine storage to string transaction trx new m transaction get ctx m transaction movementtype inventoryin line getm locator id line getm product id line getm attributesetinstance id qty diff get movement date get trxname trx setm inventoryline id line getm inventoryline id if trx save m processmsg transaction not inserted 2 return doc action status invalid fallback for all lines user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring minventoryline getlines minventoryline isactive mtransaction getm_attributesetinstance_id bigdecimal qtydiff getqtyinternaluse qtydiff qtydiff getqtycount getqtybook qtydiff mstorage mstorage getctx getm_locator_id getm_product_id get_trxname mstorage getcreate getctx getm_locator_id getm_product_id get_trxname bigdecimal qtynew getqtyonhand qtydiff qtydiff onhand getqtyonhand qtynew setqtyonhand qtynew setdatelastinventory getmovementdate get_trxname m_processmsg docaction status_invalid tostring mtransaction getctx mtransaction movementtype_inventoryin getm_locator_id getm_product_id qtydiff getmovementdate get_trxname setm_inventoryline_id getm_inventoryline_id m_processmsg docaction status_invalid minventorylinema minventorylinema getctx getm_inventoryline_id get_trxname minventorylinema mstorage mstorage getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname mstorage getcreate getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname bigdecimal maxdiff qtydiff maxdiff getmovementqty compareto maxdiff maxdiff getmovementqty bigdecimal qtynew getmovementqty maxdiff getmovementqty qtydiff maxdiff onhand getqtyonhand qtynew getm_attributesetinstance_id setqtyonhand qtynew setdatelastinventory getmovementdate get_trxname m_processmsg docaction status_invalid tostring mtransaction getctx mtransaction movementtype_inventoryin getm_locator_id getm_product_id getm_attributesetinstance_id maxdiff getmovementdate get_trxname setm_inventoryline_id getm_inventoryline_id m_processmsg docaction status_invalid qtydiff qtydiff maxdiff qtydiff mstorage mstorage getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname mstorage getcreate getctx getm_locator_id getm_product_id getm_attributesetinstance_id get_trxname bigdecimal qtydiff getqtyinternaluse compareto qtydiff qtydiff getqtycount getqtybook bigdecimal qtynew getqtyonhand qtydiff getqtycount getqtybook qtydiff onhand getqtyonhand qtynew setqtyonhand qtynew setdatelastinventory getmovementdate get_trxname m_processmsg docaction status_invalid tostring mtransaction getctx mtransaction movementtype_inventoryin getm_locator_id getm_product_id getm_attributesetinstance_id qtydiff getmovementdate get_trxname setm_inventoryline_id getm_inventoryline_id m_processmsg docaction status_invalid modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed check material policy not used sets line asi private void check material policy int no m inventory linema delete inventoryma getm inventory id get trxname if no 0 log config delete old no m inventory line lines get lines false incoming trx m client client m client get get ctx check lines for int i 0 i lines length i m inventory line line lines i boolean need save false attribute set instance if line getm attributesetinstance id 0 m product product m product get get ctx line getm product id big decimal qty diff line get qty internal use negate if env zero compare to qty diff 0 qty diff line get qty count subtract line get qty book log fine count line get qty count book line get qty book difference qty diff if qty diff signum 0 in m attribute set instance asi new m attribute set instance get ctx 0 get trxname asi set client org getad client id 0 asi setm attributeset id product getm attributeset id if asi save line setm attributesetinstance id asi getm attributesetinstance id need save true else outgoing trx m product category pc m product category get get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy m storage storages m storage get all withasi get ctx line getm product id line getm locator id m client mmpolicy fifo equals mm policy get trxname big decimal qty to deliver qty diff negate for int ii 0 ii storages length ii m storage storage storages ii if ii 0 if storage get qty on hand compare to qty to deliver 0 line setm attributesetinstance id storage getm attributesetinstance id need save true log config direct line qty to deliver env zero else log config split line m inventory linema ma new m inventory linema line storage getm attributesetinstance id storage get qty on hand negate if ma save qty to deliver qty to deliver subtract storage get qty on hand log fine ii ma qty to deliver qty to deliver else create addl material allocation m inventory linema ma new m inventory linema line storage getm attributesetinstance id qty to deliver negate if storage get qty on hand compare to qty to deliver 0 qty to deliver env zero else ma set movement qty storage get qty on hand negate qty to deliver qty to deliver subtract storage get qty on hand if ma save log fine ii ma qty to deliver qty to deliver if qty to deliver signum 0 break for all storages no attribute set instance found for remainder if qty to deliver signum 0 m inventory linema ma new m inventory linema line 0 qty to deliver negate if ma save log fine ma outgoing trx attribute set instance if need save line save log severe not saved line for all lines checkmaterialpolicy minventorylinema deleteinventoryma getm_inventory_id get_trxname minventoryline getlines mclient mclient getctx minventoryline needsave getm_attributesetinstance_id mproduct mproduct getctx getm_product_id bigdecimal qtydiff getqtyinternaluse compareto qtydiff qtydiff getqtycount getqtybook getqtycount getqtybook qtydiff qtydiff mattributesetinstance mattributesetinstance getctx get_trxname setclientorg getad_client_id setm_attributeset_id getm_attributeset_id setm_attributesetinstance_id getm_attributesetinstance_id needsave mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy mstorage mstorage getallwithasi getctx getm_product_id getm_locator_id mclient mmpolicy_fifo mmpolicy get_trxname bigdecimal qtytodeliver qtydiff mstorage getqtyonhand compareto qtytodeliver setm_attributesetinstance_id getm_attributesetinstance_id needsave qtytodeliver minventorylinema minventorylinema getm_attributesetinstance_id getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver minventorylinema minventorylinema getm_attributesetinstance_id qtytodeliver getqtyonhand compareto qtytodeliver qtytodeliver setmovementqty getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver qtytodeliver attributesetinstance qtytodeliver minventorylinema minventorylinema qtytodeliver attributesetinstance needsave void document return false public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status return false not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status set lines to 0 m inventory line lines get lines false for int i 0 i lines length i m inventory line line lines i big decimal old count line get qty count big decimal old internal line get qty internal use if old count compare to line get qty book 0 old internal signum 0 line set qty internal use env zero line set qty count line get qty book line add description void old count old internal line save get trxname else return reverse correct it set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus minventoryline getlines minventoryline bigdecimal oldcount getqtycount bigdecimal oldinternal getqtyinternaluse oldcount compareto getqtybook oldinternal setqtyinternaluse setqtycount getqtybook adddescription oldcount oldinternal get_trxname reversecorrectit setprocessed setdocaction docaction_none close document return true if success public boolean close it log info to string set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info to string m doc type dt m doc type get get ctx getc doctype id if m period is open get ctx get movement date dt get doc base type m processmsg period closed return false deep copy m inventory reversal new m inventory get ctx 0 get trxname copy values this reversal getad client id getad org id reversal set doc status docstatus drafted reversal set doc action docaction complete reversal set is approved false reversal set posted false reversal set processed false reversal add description get document no if reversal save m processmsg could not create inventory reversal return false reverse line qty m inventory line o lines get lines true for int i 0 i o lines length i m inventory line o line o lines i m inventory line r line new m inventory line get ctx 0 get trxname copy values o line r line o line getad client id o line getad org id r line setm inventory id reversal getm inventory id r line set parent reversal r line set qty book o line get qty count switch r line set qty count o line get qty book r line set qty internal use o line get qty internal use negate if r line save m processmsg could not create inventory reversal line return false if reversal process it doc action action complete m processmsg reversal error reversal get process msg return false reversal close it reversal set doc status docstatus reversed reversal set doc action docaction none reversal save m processmsg reversal get document no update reversed this add description reversal get document no set processed true set doc status docstatus reversed may come from void set doc action docaction none return true reversecorrectit tostring mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getmovementdate getdocbasetype m_processmsg periodclosed minventory minventory getctx get_trxname copyvalues getad_client_id getad_org_id setdocstatus docstatus_drafted setdocaction docaction_complete setisapproved setposted setprocessed adddescription getdocumentno m_processmsg minventoryline olines getlines olines minventoryline oline olines minventoryline rline minventoryline getctx get_trxname copyvalues oline rline oline getad_client_id oline getad_org_id rline setm_inventory_id getm_inventory_id rline setparent rline setqtybook oline getqtycount rline setqtycount oline getqtybook rline setqtyinternaluse oline getqtyinternaluse rline m_processmsg processit docaction action_complete m_processmsg getprocessmsg closeit setdocstatus docstatus_reversed setdocaction docaction_none m_processmsg getdocumentno adddescription getdocumentno setprocessed setdocstatus docstatus_reversed setdocaction docaction_none reverse accrual return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return false public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get updated by ad_user_id getdoc_user_id getupdatedby get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id connection test constructor param server name server name or ip public connect test string server name system out println connect test server name system out println hashtable string string env new hashtable string string env put initial context initial context factory org jnp interfaces naming context factory env put initial context url pkg prefixes org jboss naming org jnp interfaces env put initial context provider url server name env put initial context security protocol ssl env put initial context security authentication none none simple strong env put initial context security principal env put initial context security credentials get context system out println creating context system out println env initial context context null try context new initial context env catch exception e system err println error could not create context e return testjnp server name context testejb server name context servername connecttest servername connecttest servername initialcontext initial_context_factory namingcontextfactory initialcontext url_pkg_prefixes initialcontext provider_url servername initialcontext security_protocol initialcontext security_authentication initialcontext security_principal initialcontext security_credentials initialcontext initialcontext servername servername test jnp param server name server name param context context private void testjnp string server name initial context context connect to m bean system out println system out println connecting to m bean try string connector name jmx server name rmi rmi adaptor server rmi adaptor context lookup connector name system out println have server system out println default domain server get default domain system out println m bean count server getm bean count object name service name new object name compiere service compiere ctrl system out println service name is registered server is registered service name system out println compiere summary server get attribute service name compiere summary object params string signature catch exception e system err println error could not contact m bean e return list context system out println system out println examining context try system out println namespace context get name in namespace system out println environment context get environment system out println context naming enumeration ne context list while ne has more system out println ne next element system out println context ejb ne context list ejb while ne has more system out println ne next element system out println context ejb compiere ne context list ejb compiere while ne has more system out println ne next element catch exception e system err println error could not examine context e return servername servername initialcontext mbean mbean connectorname servername rmiadaptor rmiadaptor connectorname getdefaultdomain mbeancount getmbeancount objectname servicename objectname compierectrl servicename isregistered servicename compieresummary getattribute servicename compieresummary mbean getnameinnamespace getenvironment namingenumeration hasmore nextelement hasmore nextelement hasmore nextelement test ejb param server name server name param context context private void testejb string server name initial context context system out println system out println connecting to ejb server try system out println name status home jndi name status home sta home status home context lookup status home jndi name system out println home created status sta sta home create system out println bean created system out println server version sta get main version sta get date version sta remove system out println bean removed catch exception e system err println error could not connect e return system out println system out println success servername servername initialcontext statushome jndi_name statushome stahome statushome statushome jndi_name stahome serverversion getmainversion getdateversion start method param args server name public static void main string args string server name null if args length 0 server name args 0 if server name null server name length 0 try server name inet address get local host get host name catch unknown host exception ex ex print stack trace start connect test ct new connect test server name servername servername servername servername servername servername inetaddress getlocalhost gethostname unknownhostexception printstacktrace connecttest connecttest servername standard constructor public x ad sequence audit properties ctx int ad sequence audit id string trx name super ctx ad sequence audit id trx name if ad sequence audit id 0 setad sequence id 0 setad table id 0 set document no null setrecord id 0 x_ad_sequence_audit ad_sequence_audit_id trxname ad_sequence_audit_id trxname ad_sequence_audit_id setad_sequence_id setad_table_id setdocumentno setrecord_id load constructor public x ad sequence audit properties ctx result set rs string trx name super ctx rs trx name x_ad_sequence_audit resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad sequence audit append get id append return sb to string tostring stringbuffer stringbuffer x_ad_sequence_audit get_id tostring set sequence document sequence public void setad sequence id int ad sequence id if ad sequence id 1 throw new illegal argument exception ad sequence id is mandatory set valuenocheck ad sequence id new integer ad sequence id setad_sequence_id ad_sequence_id ad_sequence_id illegalargumentexception ad_sequence_id set_valuenocheck ad_sequence_id ad_sequence_id get sequence document sequence public int getad sequence id integer ii integer get value ad sequence id if ii null return 0 return ii int value getad_sequence_id get_value ad_sequence_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue get active request processors param ctx context return array of request public static m request processor get active properties ctx array list m request processor list new array list m request processor string sql select from r requestprocessor where is active y prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list add new m request processor ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m request processor ret value new m request processor list size list to array ret value return ret value mrequestprocessor getactive arraylist mrequestprocessor arraylist mrequestprocessor r_requestprocessor isactive preparedstatement preparestatement resultset executequery mrequestprocessor s_log mrequestprocessor retvalue mrequestprocessor toarray retvalue retvalue standard constructor param ctx context param r requestprocessor id id public m request processor properties ctx int r requestprocessor id string trx name super ctx r requestprocessor id trx name if r requestprocessor id 0 set name null set frequency type frequencytype day set frequency 0 set keep log days 7 set overdue alert days 0 set overdue assign days 0 set remind days 0 setsupervisor id 0 r_requestprocessor_id mrequestprocessor r_requestprocessor_id trxname r_requestprocessor_id trxname r_requestprocessor_id setname setfrequencytype frequencytype_day setfrequency setkeeplogdays setoverduealertdays setoverdueassigndays setreminddays setsupervisor_id load constructor param ctx context param rs result set public m request processor properties ctx result set rs string trx name super ctx rs trx name mrequestprocessor resultset trxname trxname parent constructor param parent parent param supervisor id supervisor public m request processor m client parent int supervisor id this parent get ctx 0 parent get trxname set client org parent set name parent get name msg translate get ctx r requestprocessor id setsupervisor id supervisor id supervisor_id mrequestprocessor mclient supervisor_id getctx get_trxname setclientorg setname getname getctx r_requestprocessor_id setsupervisor_id supervisor_id get routes param reload reload data return array of routes public m request processor route get routes boolean reload if m routes null reload return m routes string sql select from r requestprocessor route where r requestprocessor id order by seq no array list m request processor route list new array list m request processor route prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getr requestprocessor id result set rs pstmt execute query while rs next list add new m request processor route get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m routes new m request processor route list size list to array m routes return m routes mrequestprocessorroute getroutes m_routes m_routes r_requestprocessor_route r_requestprocessor_id seqno arraylist mrequestprocessorroute arraylist mrequestprocessorroute preparedstatement preparestatement get_trxname setint getr_requestprocessor_id resultset executequery mrequestprocessorroute getctx get_trxname m_routes mrequestprocessorroute toarray m_routes m_routes get logs return array of logs public compiere processor log get logs array list m request processor log list new array list m request processor log string sql select from r requestprocessorlog where r requestprocessor id order by created desc prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getr requestprocessor id result set rs pstmt execute query while rs next list add new m request processor log get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m request processor log ret value new m request processor log list size list to array ret value return ret value compiereprocessorlog getlogs arraylist mrequestprocessorlog arraylist mrequestprocessorlog r_requestprocessorlog r_requestprocessor_id preparedstatement preparestatement get_trxname setint getr_requestprocessor_id resultset executequery mrequestprocessorlog getctx get_trxname mrequestprocessorlog retvalue mrequestprocessorlog toarray retvalue retvalue delete old request log return number of records public int delete log if get keep log days 1 return 0 string sql delete r requestprocessorlog where r requestprocessor id getr requestprocessor id and created get keep log days sys date int no db execute update sql get trxname return 0 deletelog getkeeplogdays r_requestprocessorlog r_requestprocessor_id getr_requestprocessor_id getkeeplogdays sysdate executeupdate get_trxname get the date next run param requery requery database return date next run public timestamp get date next run boolean requery if requery load get trxname return get date next run getdatenextrun get_trxname getdatenextrun get unique id return unique id public string get serverid return request processor get id getserverid requestprocessor get_id standard constructor public x ad form access properties ctx int ad form access id string trx name super ctx ad form access id trx name if ad form access id 0 setad form id 0 setad role id 0 set is read write false x_ad_form_access ad_form_access_id trxname ad_form_access_id trxname ad_form_access_id setad_form_id setad_role_id setisreadwrite load constructor public x ad form access properties ctx result set rs string trx name super ctx rs trx name x_ad_form_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad form access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_form_access get_id tostring set special form special form public void setad form id int ad form id if ad form id 1 throw new illegal argument exception ad form id is mandatory set valuenocheck ad form id new integer ad form id setad_form_id ad_form_id ad_form_id illegalargumentexception ad_form_id set_valuenocheck ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set read write field is read write public void set is read write boolean is read write set value is read write new boolean is read write setisreadwrite isreadwrite set_value isreadwrite isreadwrite get read write field is read write public boolean is read write object oo get value is read write if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadwrite get_value isreadwrite booleanvalue standard constructor public x c taxdeclarationline properties ctx int c taxdeclarationline id string trx name super ctx c taxdeclarationline id trx name if c taxdeclarationline id 0 setc bpartner id 0 setc currency id 0 setc taxdeclarationline id 0 setc taxdeclaration id 0 setc tax id 0 set date acct new timestamp system current time millis set is manual true y set line 0 set tax amt env zero set tax base amt env zero x_c_taxdeclarationline c_taxdeclarationline_id trxname c_taxdeclarationline_id trxname c_taxdeclarationline_id setc_bpartner_id setc_currency_id setc_taxdeclarationline_id setc_taxdeclaration_id setc_tax_id setdateacct currenttimemillis setismanual setline settaxamt settaxbaseamt load constructor public x c taxdeclarationline properties ctx result set rs string trx name super ctx rs trx name x_c_taxdeclarationline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c taxdeclarationline append get id append return sb to string tostring stringbuffer stringbuffer x_c_taxdeclarationline get_id tostring set allocation line allocation line public void setc allocationline id int c allocationline id if c allocationline id 0 set valuenocheck c allocationline id null else set valuenocheck c allocationline id new integer c allocationline id setc_allocationline_id c_allocationline_id c_allocationline_id set_valuenocheck c_allocationline_id set_valuenocheck c_allocationline_id c_allocationline_id get allocation line allocation line public int getc allocationline id integer ii integer get value c allocationline id if ii null return 0 return ii int value getc_allocationline_id get_value c_allocationline_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set tax declaration line tax declaration document information public void setc taxdeclarationline id int c taxdeclarationline id if c taxdeclarationline id 1 throw new illegal argument exception c taxdeclarationline id is mandatory set valuenocheck c taxdeclarationline id new integer c taxdeclarationline id setc_taxdeclarationline_id c_taxdeclarationline_id c_taxdeclarationline_id illegalargumentexception c_taxdeclarationline_id set_valuenocheck c_taxdeclarationline_id c_taxdeclarationline_id get tax declaration line tax declaration document information public int getc taxdeclarationline id integer ii integer get value c taxdeclarationline id if ii null return 0 return ii int value getc_taxdeclarationline_id get_value c_taxdeclarationline_id intvalue set tax declaration define the declaration to the tax authorities public void setc taxdeclaration id int c taxdeclaration id if c taxdeclaration id 1 throw new illegal argument exception c taxdeclaration id is mandatory set valuenocheck c taxdeclaration id new integer c taxdeclaration id setc_taxdeclaration_id c_taxdeclaration_id c_taxdeclaration_id illegalargumentexception c_taxdeclaration_id set_valuenocheck c_taxdeclaration_id c_taxdeclaration_id get tax declaration define the declaration to the tax authorities public int getc taxdeclaration id integer ii integer get value c taxdeclaration id if ii null return 0 return ii int value getc_taxdeclaration_id get_value c_taxdeclaration_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set valuenocheck date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_valuenocheck dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set manual this is a manual process public void set is manual boolean is manual set valuenocheck is manual new boolean is manual setismanual ismanual set_valuenocheck ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt if tax amt null throw new illegal argument exception tax amt is mandatory set valuenocheck tax amt tax amt settaxamt bigdecimal taxamt taxamt illegalargumentexception taxamt set_valuenocheck taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt set tax base amount base for calculating the tax amount public void set tax base amt big decimal tax base amt if tax base amt null throw new illegal argument exception tax base amt is mandatory set valuenocheck tax base amt tax base amt settaxbaseamt bigdecimal taxbaseamt taxbaseamt illegalargumentexception taxbaseamt set_valuenocheck taxbaseamt taxbaseamt get tax base amount base for calculating the tax amount public big decimal get tax base amt big decimal bd big decimal get value tax base amt if bd null return env zero return bd bigdecimal gettaxbaseamt bigdecimal bigdecimal get_value taxbaseamt get filter return singleton public static c log filter get if s filter null s filter new c log filter return s filter clogfilter s_filter s_filter clogfilter s_filter constructor public c log filter clogfilter loggable don t log core java classes param record log record return true public boolean is loggable log record record if record get level level severe record get level level warning return true string logger name record get logger name if logger name null if logger name to lower case index of focus 1 return true if logger name starts with sun logger name starts with java awt logger name starts with javax return false string class name record get source class name if class name null if class name starts with sun class name starts with java awt class name starts with javax return false return true isloggable logrecord getlevel getlevel loggername getloggername loggername loggername tolowercase indexof loggername startswith loggername startswith loggername startswith classname getsourceclassname classname classname startswith classname startswith classname startswith standard constructor public x r standardresponse properties ctx int r standardresponse id string trx name super ctx r standardresponse id trx name if r standardresponse id 0 set name null setr standardresponse id 0 set response text null x_r_standardresponse r_standardresponse_id trxname r_standardresponse_id trxname r_standardresponse_id setname setr_standardresponse_id setresponsetext load constructor public x r standardresponse properties ctx result set rs string trx name super ctx rs trx name x_r_standardresponse resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r standardresponse append get id append return sb to string tostring stringbuffer stringbuffer x_r_standardresponse get_id tostring set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set standard response request standard response public void setr standardresponse id int r standardresponse id if r standardresponse id 1 throw new illegal argument exception r standardresponse id is mandatory set valuenocheck r standardresponse id new integer r standardresponse id setr_standardresponse_id r_standardresponse_id r_standardresponse_id illegalargumentexception r_standardresponse_id set_valuenocheck r_standardresponse_id r_standardresponse_id get standard response request standard response public int getr standardresponse id integer ii integer get value r standardresponse id if ii null return 0 return ii int value getr_standardresponse_id get_value r_standardresponse_id intvalue set response text request response text public void set response text string response text if response text null throw new illegal argument exception response text is mandatory if response text length 2000 log warning length 2000 truncated response text response text substring 0 1999 set value response text response text setresponsetext responsetext responsetext illegalargumentexception responsetext responsetext responsetext responsetext set_value responsetext responsetext get response text request response text public string get response text return string get value response text getresponsetext get_value responsetext get m product from cache param ctx context param m product id id return m product public static m product get properties ctx int m product id integer key new integer m product id m product ret value m product s cache get key if ret value null return ret value ret value new m product ctx m product id null if ret value get id 0 s cache put key ret value return ret value mproduct m_product_id mproduct mproduct m_product_id m_product_id mproduct retvalue mproduct s_cache retvalue retvalue retvalue mproduct m_product_id retvalue get_id s_cache retvalue retvalue get m product from cache param ctx context param where clause sql where clause param trx name trx return m product public static m product get properties ctx string where clause string trx name string sql select from m product if where clause null where clause length 0 sql where ad client id and where clause array list m product list new array list m product int ad client id env getad client id ctx prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad client id result set rs pstmt execute query while rs next list add new m product ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m product ret value new m product list size list to array ret value return ret value mproduct whereclause trxname mproduct mproduct whereclause trxname m_product whereclause whereclause ad_client_id whereclause arraylist mproduct arraylist mproduct ad_client_id getad_client_id preparedstatement preparestatement trxname setint ad_client_id resultset executequery mproduct trxname s_log mproduct retvalue mproduct toarray retvalue retvalue is product stocked param m product id id return true if found and stocked false otherwise public static boolean is product stocked properties ctx int m product id boolean ret value false m product product get ctx m product id return product is stocked m_product_id isproductstocked m_product_id retvalue mproduct m_product_id isstocked standard constructor param ctx context param m product id id public m product properties ctx int m product id string trx name super ctx m product id trx name if m product id 0 set value null set name null setm product category id 0 setc taxcategory id 0 setc uom id 0 set product type producttype item i set isbom false n set is invoice print details false set is pick list print details false set is purchased true y set is sold true y set is stocked true y set is summary false set is verified false n set is web store featured false set is self service true set is exclude auto delivery false set processing false n m_product_id mproduct m_product_id trxname m_product_id trxname m_product_id setvalue setname setm_product_category_id setc_taxcategory_id setc_uom_id setproducttype producttype_item setisbom setisinvoiceprintdetails setispicklistprintdetails setispurchased setissold setisstocked setissummary setisverified setiswebstorefeatured setisselfservice setisexcludeautodelivery setprocessing load constructor param ctx context param rs result set public m product properties ctx result set rs string trx name super ctx rs trx name mproduct resultset trxname trxname parent constructor param et parent public m product m expense type et this et get ctx 0 et get trxname set product type m product producttype expensetype set expense type et mproduct mexpensetype getctx get_trxname setproducttype mproduct producttype_expensetype setexpensetype parent constructor param resource parent public m product m resource resource m resource type resource type this resource get ctx 0 resource get trxname set product type m product producttype resource set resource resource set resource resource type mproduct mresource mresourcetype resourcetype getctx get_trxname setproducttype mproduct producttype_resource setresource setresource resourcetype import constructor param impp import public m product x i product impp this impp get ctx 0 impp get trxname set client org impp set updated by impp get updated by set value impp get value set name impp get name set description impp get description set document note impp get document note set help impp get help setupc impp getupc setsku impp getsku setc uom id impp getc uom id setm product category id impp getm product category id set product type impp get product type set imageurl impp get imageurl set descriptionurl impp get descriptionurl mproduct x_i_product getctx get_trxname setclientorg setupdatedby getupdatedby setvalue getvalue setname getname setdescription getdescription setdocumentnote getdocumentnote sethelp gethelp setc_uom_id getc_uom_id setm_product_category_id getm_product_category_id setproducttype getproducttype setimageurl getimageurl setdescriptionurl getdescriptionurl set expense type param parent expense type return true if changed public boolean set expense type m expense type parent boolean changed false if producttype expensetype equals get product type set product type producttype expensetype changed true if parent gets expensetype id gets expensetype id sets expensetype id parent gets expensetype id changed true if parent is active is active set is active parent is active changed true if parent get value equals get value set value parent get value changed true if parent get name equals get name set name parent get name changed true if parent get description null get description null parent get description null parent get description equals get description set description parent get description changed true if parent getc uom id getc uom id setc uom id parent getc uom id changed true if parent getm product category id getm product category id setm product category id parent getm product category id changed true if parent getc taxcategory id getc taxcategory id setc taxcategory id parent getc taxcategory id changed true return changed setexpensetype mexpensetype producttype_expensetype getproducttype setproducttype producttype_expensetype gets_expensetype_id gets_expensetype_id sets_expensetype_id gets_expensetype_id isactive isactive setisactive isactive getvalue getvalue setvalue getvalue getname getname setname getname getdescription getdescription getdescription getdescription getdescription setdescription getdescription getc_uom_id getc_uom_id setc_uom_id getc_uom_id getm_product_category_id getm_product_category_id setm_product_category_id getm_product_category_id getc_taxcategory_id getc_taxcategory_id setc_taxcategory_id getc_taxcategory_id set resource param parent resource return true if changed public boolean set resource m resource parent boolean changed false if producttype resource equals get product type set product type producttype resource changed true if parent gets resource id gets resource id sets resource id parent gets resource id changed true if parent is active is active set is active parent is active changed true if parent get value equals get value set value parent get value changed true if parent get name equals get name set name parent get name changed true if parent get description null get description null parent get description null parent get description equals get description set description parent get description changed true return changed setresource mresource producttype_resource getproducttype setproducttype producttype_resource gets_resource_id gets_resource_id sets_resource_id gets_resource_id isactive isactive setisactive isactive getvalue getvalue setvalue getvalue getname getname setname getname getdescription getdescription getdescription getdescription getdescription setdescription getdescription set resource type param parent resource type return true if changed public boolean set resource m resource type parent boolean changed false if producttype resource equals get product type set product type producttype resource changed true if parent getc uom id getc uom id setc uom id parent getc uom id changed true if parent getm product category id getm product category id setm product category id parent getm product category id changed true if parent getc taxcategory id getc taxcategory id setc taxcategory id parent getc taxcategory id changed true return changed setresource mresourcetype producttype_resource getproducttype setproducttype producttype_resource getc_uom_id getc_uom_id setc_uom_id getc_uom_id getm_product_category_id getm_product_category_id setm_product_category_id getm_product_category_id getc_taxcategory_id getc_taxcategory_id setc_taxcategory_id getc_taxcategory_id get uom standard precision return uom standard precision public int get standard precision if m precision null muom uom muom get get ctx getc uom id m precision new integer uom get std precision return m precision int value getstandardprecision m_precision getctx getc_uom_id m_precision getstdprecision m_precision intvalue create asset group for this product return asset group id public int geta asset group id m product category pc m product category get get ctx getm product category id return pc geta asset group id geta_asset_group_id mproductcategory mproductcategory getctx getm_product_category_id geta_asset_group_id create asset for this product return true if asset is created public boolean is create asset m product category pc m product category get get ctx getm product category id return pc geta asset group id 0 iscreateasset mproductcategory mproductcategory getctx getm_product_category_id geta_asset_group_id get attribute set return set or null public m attribute set get attribute set if getm attributeset id 0 return m attribute set get get ctx getm attributeset id return null mattributeset getattributeset getm_attributeset_id mattributeset getctx getm_attributeset_id has the product instance attribute return true if instance attributes public boolean is instance attribute if getm attributeset id 0 return false m attribute set mas m attribute set get get ctx getm attributeset id return mas is instance attribute isinstanceattribute getm_attributeset_id mattributeset mattributeset getctx getm_attributeset_id isinstanceattribute create one asset per uom return individual asset public boolean is one asset peruom m product category pc m product category get get ctx getm product category id if pc geta asset group id 0 return false m asset group ag m asset group get get ctx pc geta asset group id return ag is one asset peruom isoneassetperuom mproductcategory mproductcategory getctx getm_product_category_id geta_asset_group_id massetgroup massetgroup getctx geta_asset_group_id isoneassetperuom product is item return true if item public boolean is item return producttype item equals get product type isitem producttype_item getproducttype product is an item and stocked return true if stocked and item public boolean is stocked return super is stocked is item isstocked isstocked isitem is service return true if service resource online public boolean is service producttype service producttype resource producttype online return is item isservice producttype_service producttype_resource producttype_online isitem get uom symbol return uom sumbol public string getuom symbol return muom get get ctx getc uom id getuom symbol getuomsymbol getctx getc_uom_id getuomsymbol get active product downloads return array of downloads public m product download get product downloads boolean requery if m downloads null requery return m downloads array list m product download list new array list m product download string sql select from m productdownload where m product id and is active y order by name prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm product id result set rs pstmt execute query while rs next list add new m product download get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m downloads new m product download list size list to array m downloads return m downloads mproductdownload getproductdownloads m_downloads m_downloads arraylist mproductdownload arraylist mproductdownload m_productdownload m_product_id isactive preparedstatement preparestatement get_trxname setint getm_product_id resultset executequery mproductdownload getctx get_trxname m_downloads mproductdownload toarray m_downloads m_downloads does the product have downloads return true if downloads exists public boolean has downloads get product downloads false return m downloads null m downloads length 0 hasdownloads getproductdownloads m_downloads m_downloads string representation return info public string to string string buffer sb new string buffer m product sb append get id append append get value append return sb to string tostring stringbuffer stringbuffer mproduct get_id getvalue tostring before save param new record new return true protected boolean before save boolean new record check storage if new record is valuechanged is active is active now not active is valuechanged is stocked is stocked now not stocked is valuechanged product type from item producttype item equals get valueold product type m storage storages m storage get of product get ctx get id get trxname big decimal on hand env zero big decimal ordered env zero big decimal reserved env zero for int i 0 i storages length i on hand on hand add storages i get qty on hand ordered on hand add storages i get qty ordered reserved on hand add storages i get qty reserved string err msg if on hand signum 0 err msg qty on hand on hand if ordered signum 0 err msg qty ordered ordered if reserved signum 0 err msg qty reserved reserved if err msg length 0 log save error error msg parse translation get ctx err msg return false reset stocked if not item if is stocked producttype item equals get product type set is stocked false return true newrecord beforesave newrecord newrecord is_valuechanged isactive isactive is_valuechanged isstocked isstocked is_valuechanged producttype producttype_item get_valueold producttype mstorage mstorage getofproduct getctx get_id get_trxname bigdecimal onhand bigdecimal bigdecimal onhand onhand getqtyonhand onhand getqtyordered onhand getqtyreserved errmsg onhand errmsg qtyonhand onhand errmsg qtyordered errmsg qtyreserved errmsg saveerror parsetranslation getctx errmsg isstocked producttype_item getproducttype setisstocked after save param new record new param success success return success protected boolean after save boolean new record boolean success if success return success value name change in account if new record is valuechanged value is valuechanged name m account update value description get ctx m product id getm product id get trxname name description change in asset m asset set value name description if new record is valuechanged name is valuechanged description string sql update a asset a set name description select substr bp name p name 1 60 p description from m product p c bpartner bp where p m product id a m product id and bp c bpartner id a c bpartner id where is active y and guarantee date sys date and m product id getm product id int no db execute update sql get trxname log fine asset description updated no new acct tree costing if new record success insert accounting m product acct m product category acct p m product category id getm product category id insert tree mtree base treetype product m acct schema mass m acct schema get client acct schema get ctx getad client id get trxname for int i 0 i mass length i m product costing pc new m product costing this mass i getc acctschema id pc save return success newrecord aftersave newrecord newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx m_product_id getm_product_id get_trxname masset setvaluenamedescription newrecord is_valuechanged is_valuechanged a_asset m_product c_bpartner m_product_id m_product_id c_bpartner_id c_bpartner_id isactive guaranteedate sysdate m_product_id getm_product_id executeupdate get_trxname newrecord insert_accounting m_product_acct m_product_category_acct m_product_category_id getm_product_category_id insert_tree mtree_base treetype_product macctschema macctschema getclientacctschema getctx getad_client_id get_trxname mproductcosting mproductcosting getc_acctschema_id before delete return true if it can be deleted protected boolean before delete check storage if is stocked producttype item equals get product type m storage storages m storage get of product get ctx get id get trxname big decimal on hand env zero big decimal ordered env zero big decimal reserved env zero for int i 0 i storages length i on hand on hand add storages i get qty on hand ordered on hand add storages i get qty ordered reserved on hand add storages i get qty reserved string err msg if on hand signum 0 err msg qty on hand on hand if ordered signum 0 err msg qty ordered ordered if reserved signum 0 err msg qty reserved reserved if err msg length 0 log save error error msg parse translation get ctx err msg return false delete costing m product costing costings m product costing get of product get ctx get id get trxname for int i 0 i costings length i costings i delete true get trxname return delete accounting m product acct beforedelete isstocked producttype_item getproducttype mstorage mstorage getofproduct getctx get_id get_trxname bigdecimal onhand bigdecimal bigdecimal onhand onhand getqtyonhand onhand getqtyordered onhand getqtyreserved errmsg onhand errmsg qtyonhand onhand errmsg qtyordered errmsg qtyreserved errmsg saveerror parsetranslation getctx errmsg mproductcosting mproductcosting getofproduct getctx get_id get_trxname get_trxname delete_accounting m_product_acct after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype product return success afterdelete delete_tree mtree_base treetype_product create process info log param p id process id param p date process date param p number process number param p msg process messagre public process info log int p id timestamp p date big decimal p number string p msg this s log id p id p date p number p msg p_id p_date p_number p_msg processinfolog p_id p_date bigdecimal p_number p_msg s_log_id p_id p_date p_number p_msg create process info log param log id log id param p id process id param p date process date param p number process number param p msg process messagre public process info log int log id int p id timestamp p date big decimal p number string p msg setlog id log id setp id p id setp date p date setp number p number setp msg p msg log_id p_id p_date p_number p_msg processinfolog log_id p_id p_date bigdecimal p_number p_msg setlog_id log_id setp_id p_id setp_date p_date setp_number p_number setp_msg p_msg method getlog id return int public int getlog id return m log id getlog_id getlog_id m_log_id return m log id public void setlog id int log id m log id log id m_log_id setlog_id log_id m_log_id log_id method getp id return int public int getp id return m p id getp_id getp_id m_p_id method setp id param p id int public void setp id int p id m p id p id setp_id p_id setp_id p_id m_p_id p_id method getp date return timestamp public timestamp getp date return m p date getp_date getp_date m_p_date method setp date param p date timestamp public void setp date timestamp p date m p date p date setp_date p_date setp_date p_date m_p_date p_date method getp number return big decimal public big decimal getp number return m p number getp_number bigdecimal bigdecimal getp_number m_p_number method setp number param p number big decimal public void setp number big decimal p number m p number p number setp_number p_number bigdecimal setp_number bigdecimal p_number m_p_number p_number method getp msg return string public string getp msg return m p msg getp_msg getp_msg m_p_msg method setp msg param p msg string public void setp msg string p msg m p msg p msg setp_msg p_msg setp_msg p_msg m_p_msg p_msg constructor public reportlineset copy super reportlineset_copy prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals pa reportlineset id m pa reportlineset id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter pa_reportlineset_id m_pa_reportlineset_id bigdecimal getparameter intvalue perrform process return message throws exception protected string do it throws exception int to id super getrecord id log info from pa reportlineset id m pa reportlineset id to to id if to id 1 throw new exception msg saveerrorrownotfound m report line set to new m report line set get ctx to id get trxname m report line set rl set new m report line set get ctx m pa reportlineset id get trxname m report line rls rl set get liness for int i 0 i rls length i m report line rl m report line copy get ctx to getad client id to getad org id to id rls i get trxname rl save m report source rss rls i get sources if rss null for int ii 0 ii rss length ii m report source rs m report source copy get ctx to getad client id to getad org id rl get id rss ii get trxname rs save oper 1 2 were set to null return copied rls length doit to_id getrecord_id pa_reportlineset_id m_pa_reportlineset_id to_id to_id msg_saveerrorrownotfound mreportlineset mreportlineset getctx to_id get_trxname mreportlineset rlset mreportlineset getctx m_pa_reportlineset_id get_trxname mreportline rlset getliness mreportline mreportline getctx getad_client_id getad_org_id to_id get_trxname mreportsource getsources mreportsource mreportsource getctx getad_client_id getad_org_id get_id get_trxname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals gl journalbatch id m gl journalbatch id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter gl_journalbatch_id m_gl_journalbatch_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception int to gl journalbatch id getrecord id log info do it from gl journalbatch id m gl journalbatch id to to gl journalbatch id if to gl journalbatch id 0 throw new illegal argument exception target gl journalbatch id 0 if m gl journalbatch id 0 throw new illegal argument exception source gl journalbatch id 0 m journal batch from new m journal batch get ctx m gl journalbatch id get trxname m journal batch to new m journal batch get ctx to gl journalbatch id get trxname int no to copy details from from return copied no doit to_gl_journalbatch_id getrecord_id doit gl_journalbatch_id m_gl_journalbatch_id to_gl_journalbatch_id to_gl_journalbatch_id illegalargumentexception gl_journalbatch_id m_gl_journalbatch_id illegalargumentexception gl_journalbatch_id mjournalbatch mjournalbatch getctx m_gl_journalbatch_id get_trxname mjournalbatch mjournalbatch getctx to_gl_journalbatch_id get_trxname copydetailsfrom create process with cmd param cmd o s command public task string cmd m cmd cmd m_cmd public void run log fine out reader try int c while c m outstream read 1 is interrupted system out print char c m out append char c m outstream close catch io exception ioe log log level severe out reader ioe log fine out reader done outreader m_outstream isinterrupted m_out m_outstream ioexception outreader outreader public void run log fine err reader try int c while c m errstream read 1 is interrupted system err print char c m err append char c m errstream close catch io exception ioe log log level severe err reader ioe log fine err reader done errreader m_errstream isinterrupted m_err m_errstream ioexception errreader errreader execute it public void run log info m cmd try m child runtime get runtime exec m cmd m outstream m child get input stream m errstream m child get error stream m instream m child get output stream if check interrupted return m outreader start m errreader start try if check interrupted return m errreader join if check interrupted return m outreader join if check interrupted return m child wait for catch interrupted exception ie log log level info ie ie exit value try if m child null log fine run exit value m child exit value catch exception e log config done catch io exception ioe log log level severe ioe ioe m_cmd m_child getruntime m_cmd m_outstream m_child getinputstream m_errstream m_child geterrorstream m_instream m_child getoutputstream checkinterrupted m_outreader m_errreader checkinterrupted m_errreader checkinterrupted m_outreader checkinterrupted m_child waitfor interruptedexception exitvalue m_child exitvalue m_child exitvalue ioexception check if interrupted return true if interrupted private boolean check interrupted if is interrupted log config interrupted interrupt child processes if m child null m child destroy m child null if m outreader null m outreader is alive m outreader interrupt m outreader null if m errreader null m errreader is alive m errreader interrupt m errreader null close streams if m instream null try m instream close catch exception e m instream null if m outstream null try m outstream close catch exception e m outstream null if m errstream null try m errstream close catch exception e m errstream null return true return false checkinterrupted isinterrupted m_child m_child m_child m_outreader m_outreader isalive m_outreader m_outreader m_errreader m_errreader isalive m_errreader m_errreader m_instream m_instream m_instream m_outstream m_outstream m_outstream m_errstream m_errstream m_errstream get out info return string buffer public string buffer get out return m out stringbuffer stringbuffer getout m_out get err info return string buffer public string buffer get err return m err stringbuffer stringbuffer geterr m_err get the process input stream i e we output to it return output stream public output stream get in stream return m instream outputstream outputstream getinstream m_instream configuration public config configuration data data super p data data configurationdata p_data initialize abstract void init test return error message or null of ok discover databases to be overwritten by database configs param selected selected database return array of databases public string discover databases string selected return new string discoverdatabases get panel return panel protected configuration panel get panel return p data p panel configurationpanel getpanel p_data p_panel set configuration property param key key param value value protected void set property string key string value p data p properties set property key value setproperty p_data p_properties setproperty ui signal ok param cb ckeck box param res string resource string key param pass true if test passed param critical true if critial param error msg error message void signalok c check box cb string res string boolean pass boolean critical string error msg p data p panel signalok cb res string pass critical error msg resstring errormsg ccheckbox resstring errormsg p_data p_panel resstring errormsg get web store context names separared by param con connection return string of web store names e g wstore protected string get web stores connection con string sql select web context from w store where is active y statement stmt null string buffer result new string buffer try stmt con create statement result set rs stmt execute query sql while rs next if result length 0 result append result append rs get string 1 rs close stmt close stmt null catch exception e log severe e to string try if stmt null stmt close stmt null catch exception e stmt null return result to string getwebstores webcontext w_store isactive stringbuffer stringbuffer createstatement resultset executequery getstring tostring tostring standard constructor public x s expensetype properties ctx int s expensetype id string trx name super ctx s expensetype id trx name if s expensetype id 0 setc taxcategory id 0 setc uom id 0 set is invoiced false setm product category id 0 set name null sets expensetype id 0 set value null x_s_expensetype s_expensetype_id trxname s_expensetype_id trxname s_expensetype_id setc_taxcategory_id setc_uom_id setisinvoiced setm_product_category_id setname sets_expensetype_id setvalue load constructor public x s expensetype properties ctx result set rs string trx name super ctx rs trx name x_s_expensetype resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s expensetype append get id append return sb to string tostring stringbuffer stringbuffer x_s_expensetype get_id tostring set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set invoiced is this invoiced public void set is invoiced boolean is invoiced set value is invoiced new boolean is invoiced setisinvoiced isinvoiced set_value isinvoiced isinvoiced get invoiced is this invoiced public boolean is invoiced object oo get value is invoiced if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinvoiced get_value isinvoiced booleanvalue set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set expense type expense report type public void sets expensetype id int s expensetype id if s expensetype id 1 throw new illegal argument exception s expensetype id is mandatory set valuenocheck s expensetype id new integer s expensetype id sets_expensetype_id s_expensetype_id s_expensetype_id illegalargumentexception s_expensetype_id set_valuenocheck s_expensetype_id s_expensetype_id get expense type expense report type public int gets expensetype id integer ii integer get value s expensetype id if ii null return 0 return ii int value gets_expensetype_id get_value s_expensetype_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value get sales region from cache param ctx context param c salesregion id id return m sales region public static m sales region get properties ctx int c salesregion id integer key new integer c salesregion id m sales region ret value m sales region s cache get key if ret value null return ret value ret value new m sales region ctx c salesregion id null if ret value get id 0 s cache put key ret value return ret value salesregion c_salesregion_id msalesregion msalesregion c_salesregion_id c_salesregion_id msalesregion retvalue msalesregion s_cache retvalue retvalue retvalue msalesregion c_salesregion_id retvalue get_id s_cache retvalue retvalue default constructor param ctx context param c salesregion id id public m sales region properties ctx int c salesregion id string trx name super ctx c salesregion id trx name c_salesregion_id msalesregion c_salesregion_id trxname c_salesregion_id trxname load constructor param ctx context param rs result set public m sales region properties ctx result set rs string trx name super ctx rs trx name msalesregion resultset trxname trxname before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id after save insert create tree param new record insert param success save success protected boolean after save boolean new record boolean success if success return success if new record insert tree mtree base treetype salesregion value name change if new record is valuechanged value is valuechanged name m account update value description get ctx c salesregion id getc salesregion id get trxname return true newrecord aftersave newrecord newrecord insert_tree mtree_base treetype_salesregion newrecord is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_salesregion_id getc_salesregion_id get_trxname after delete param success return deleted protected boolean after delete boolean success if success delete tree mtree base treetype salesregion return success afterdelete delete_tree mtree_base treetype_salesregion initialize panel param window no window param frame frame public void init int window no form frame frame log info m windowno window no m frame frame try jb init dyn init frame get content pane add command panel border layout south frame get content pane add main panel border layout center catch exception e log log level severe e windowno windowno formframe m_windowno windowno m_frame jbinit dyninit getcontentpane commandpanel borderlayout getcontentpane mainpanel borderlayout static init throws exception private void jb init throws exception compiere color set background this main panel set layout main layout parameter panel set layout parameter layout label bank account set text msg translate env get ctx c bankaccount id field bank account add action listener this labelb partner set text msg translate env get ctx c bpartner id fieldb partner add action listener this b refresh add action listener this label pay date set text msg translate env get ctx pay date label payment rule set text msg translate env get ctx payment rule label bank balance set text msg translate env get ctx current balance label balance set text 0 only due set text msg get msg env get ctx only due data status set text b generate add action listener this b cancel add action listener this main panel add parameter panel border layout north parameter panel add label bank account new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add field bank account new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 parameter panel add label bank balance new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add label currency new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 0 5 5 0 0 parameter panel add label balance new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add labelb partner new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add fieldb partner new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 parameter panel add b refresh new grid bag constraints 4 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add label pay date new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add field pay date new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 parameter panel add label payment rule new grid bag constraints 2 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add field payment rule new grid bag constraints 3 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add only due new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 main panel add data status border layout south main panel add data pane border layout center data pane get viewport add mini table null command panel set layout command layout command layout set alignment flow layout right command layout set hgap 10 command panel add b cancel null command panel add b generate null jbinit compierecolor setbackground mainpanel setlayout mainlayout parameterpanel setlayout parameterlayout labelbankaccount settext getctx c_bankaccount_id fieldbankaccount addactionlistener labelbpartner settext getctx c_bpartner_id fieldbpartner addactionlistener brefresh addactionlistener labelpaydate settext getctx paydate labelpaymentrule settext getctx paymentrule labelbankbalance settext getctx currentbalance labelbalance settext onlydue settext getmsg getctx onlydue datastatus settext bgenerate addactionlistener bcancel addactionlistener mainpanel parameterpanel borderlayout parameterpanel labelbankaccount gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldbankaccount gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelbankbalance gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelcurrency gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelbalance gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelbpartner gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldbpartner gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel brefresh gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelpaydate gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldpaydate gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelpaymentrule gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldpaymentrule gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel onlydue gridbagconstraints gridbagconstraints gridbagconstraints mainpanel datastatus borderlayout mainpanel datapane borderlayout datapane getviewport minitable commandpanel setlayout commandlayout commandlayout setalignment flowlayout commandlayout sethgap commandpanel bcancel commandpanel bgenerate dynamic init load bank info load b partner init table private void dyn init properties ctx env get ctx bank account info string sql m role get default add accesssql select ba c bankaccount id 1 b name ba account no as name 2 ba c currency id c iso code 3 4 ba current balance 5 from c bank b c bankaccount ba c currency c where b c bank id ba c bank id and ba c currency id c c currency id and exists select from c bankaccountdoc d where d c bankaccount id ba c bankaccount id order by 2 b m role sql fullyqualified m role sql rw try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next boolean transfers false bank info bi new bank info rs get int 1 rs get int 3 rs get string 2 rs get string 4 rs get big decimal 5 transfers field bank account add item bi rs close pstmt close catch sql exception e log log level severe sql e if field bank account get item count 0 a dialog error m windowno this v pay select no bank else field bank account set selected index 0 optional business partner with unpaid ap invoices key name pair pp new key name pair 0 fieldb partner add item pp sql m role get default add accesssql select bp c bpartner id bp name from c bpartner bp bp m role sql fullyqualified m role sql ro and exists select from c invoice i where bp c bpartner id i c bpartner id and i isso trx n and i is paid y order by 2 try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 fieldb partner add item pp rs close pstmt close catch sql exception e log log level severe sql e fieldb partner set selected index 0 prepare mini table select i c invoice id i date invoiced p net days as date due bp name i document no c iso code i grand total payment term discount i grand total i c paymentterm id i date invoiced sys date as discount sys date payment term due days i c paymentterm id i date invoiced as discount date i grand total payment term discount i grand total i c paymentterm id i date invoiced sys date as due amount currency convert i grand total payment term discount i grand total i c paymentterm id i date invoiced sys date null i c currency id xx100 sys date as pay amt from c invoice i c bpartner bp c currency c c paymentterm p where i isso trx n and i c bpartner id bp c bpartner id and i c currency id c c currency id and i c paymentterm id p c paymentterm id and i doc status in co cl order by 2 3 m sql mini table prepare table new column info 0 4 new column info i c invoice id id column class false false null new column info msg translate ctx date due i date invoiced p net days as date due timestamp class true true null new column info msg translate ctx c bpartner id bp name key name pair class true false i c bpartner id new column info msg translate ctx document no i document no string class new column info msg translate ctx c currency id c iso code key name pair class true false i c currency id 5 9 new column info msg translate ctx grand total i grand total big decimal class new column info msg translate ctx discount amt payment term discount i grand total i c currency id i c paymentterm id i date invoiced big decimal class new column info msg get msg ctx discount date sys date payment term due days i c paymentterm id i date invoiced sys date timestamp class new column info msg get msg ctx amount due currency convert invoice open i c invoice id i c invoicepayschedule id i c currency id i c conversiontype id i ad client id i ad org id big decimal class new column info msg get msg ctx amount pay currency convert invoice open i c invoice id i c invoicepayschedule id payment term discount i grand total i c currency id i c paymentterm id i date invoiced i c currency id i c conversiontype id i ad client id i ad org id big decimal class from c invoice v i inner join c bpartner bp on i c bpartner id bp c bpartner id inner join c currency c on i c currency id c c currency id inner join c paymentterm p on i c paymentterm id p c paymentterm id where i isso trx n and is paid n different payment selection and not exists select from c payselectionline psl where i c invoice id psl c invoice id and psl c payselectioncheck id is not null and i doc status in co cl and i ad client id additional where order in load table info true i mini table get model add table model listener this field pay date set mandatory true field pay date set value new timestamp system current time millis m ad client id env getad client id env get ctx bpartner dyninit getctx mrole getdefault addaccesssql c_bankaccount_id accountno c_currency_id iso_code currentbalance c_bank c_bankaccount c_currency c_bank_id c_bank_id c_currency_id c_currency_id c_bankaccountdoc c_bankaccount_id c_bankaccount_id mrole sql_fullyqualified mrole sql_rw preparedstatement preparestatement resultset executequery bankinfo bankinfo getint getint getstring getstring getbigdecimal fieldbankaccount additem sqlexception fieldbankaccount getitemcount adialog m_windowno vpayselectnobank fieldbankaccount setselectedindex businesspartner keynamepair keynamepair fieldbpartner additem mrole getdefault addaccesssql c_bpartner_id c_bpartner mrole sql_fullyqualified mrole sql_ro c_invoice c_bpartner_id c_bpartner_id issotrx ispaid preparedstatement preparestatement resultset executequery keynamepair getint getstring fieldbpartner additem sqlexception fieldbpartner setselectedindex minitable c_invoice_id dateinvoiced netdays datedue documentno iso_code grandtotal paymenttermdiscount grandtotal c_paymentterm_id dateinvoiced sysdate sysdate paymenttermduedays c_paymentterm_id dateinvoiced discountdate grandtotal paymenttermdiscount grandtotal c_paymentterm_id dateinvoiced sysdate dueamount currencyconvert grandtotal paymenttermdiscount grandtotal c_paymentterm_id dateinvoiced sysdate c_currency_id sysdate payamt c_invoice c_bpartner c_currency c_paymentterm issotrx c_bpartner_id c_bpartner_id c_currency_id c_currency_id c_paymentterm_id c_paymentterm_id docstatus m_sql minitable preparetable columninfo columninfo c_invoice_id idcolumn columninfo datedue dateinvoiced netdays datedue columninfo c_bpartner_id keynamepair c_bpartner_id columninfo documentno documentno columninfo c_currency_id iso_code keynamepair c_currency_id columninfo grandtotal grandtotal bigdecimal columninfo discountamt paymenttermdiscount grandtotal c_currency_id c_paymentterm_id dateinvoiced bigdecimal columninfo getmsg discountdate sysdate paymenttermduedays c_paymentterm_id dateinvoiced sysdate columninfo getmsg amountdue currencyconvert invoiceopen c_invoice_id c_invoicepayschedule_id c_currency_id c_conversiontype_id ad_client_id ad_org_id bigdecimal columninfo getmsg amountpay currencyconvert invoiceopen c_invoice_id c_invoicepayschedule_id paymenttermdiscount grandtotal c_currency_id c_paymentterm_id dateinvoiced c_currency_id c_conversiontype_id ad_client_id ad_org_id bigdecimal c_invoice_v c_bpartner c_bpartner_id c_bpartner_id c_currency c_currency_id c_currency_id c_paymentterm c_paymentterm_id c_paymentterm_id issotrx ispaid c_payselectionline c_invoice_id c_invoice_id c_payselectioncheck_id docstatus ad_client_id loadtableinfo minitable getmodel addtablemodellistener fieldpaydate setmandatory fieldpaydate setvalue currenttimemillis m_ad_client_id getad_client_id getctx load bank info load info from bank account and valid documents payment rule private void load bank info bank info bi bank info field bank account get selected item if bi null return label currency set text bi currency label balance set text m format format bi balance m bankbalance bi balance payment rule field payment rule remove all items int ad reference id 195 m lookup info getad reference id all payment rule language language env get language env get ctx m lookup info info m lookup factory getlookup list language ad reference id string sql info query substring 0 info query index of order by and info key column in select payment rule from c bankaccountdoc where c bankaccount id info query substring info query index of order by try prepared statement pstmt db prepare statement sql null pstmt set int 1 bi c bankaccount id result set rs pstmt execute query value name pair vp null while rs next vp new value name pair rs get string 2 rs get string 3 returns also not active field payment rule add item vp rs close pstmt close catch sql exception e log log level severe sql e field payment rule set selected index 0 paymentrule loadbankinfo bankinfo bankinfo fieldbankaccount getselecteditem labelcurrency settext labelbalance settext m_format m_bankbalance paymentrule fieldpaymentrule removeallitems ad_reference_id mlookupinfo getad_reference_id all_payment getlanguage getctx mlookupinfo mlookupfactory getlookup_list ad_reference_id indexof keycolumn paymentrule c_bankaccountdoc c_bankaccount_id indexof preparedstatement preparestatement setint c_bankaccount_id resultset executequery valuenamepair valuenamepair getstring getstring fieldpaymentrule additem sqlexception fieldpaymentrule setselectedindex query and create table info private void load table info log config not yet initialized if m sql null return string sql m sql parameters timestamp pay date timestamp field pay date get value mini table set color compare pay date log config pay date pay date bank info bi bank info field bank account get selected item if only due is selected sql and i date invoiced p net days key name pair pp key name pair fieldb partner get selected item int c bpartner id pp get key if c bpartner id 0 sql and i c bpartner id sql order by 2 3 log finest sql c currecny id bi c currency id c bpartner id c bpartner id get open invoices try int index 1 prepared statement pstmt db prepare statement sql null pstmt set timestamp index pay date discount amt pstmt set int index bi c currency id due amt pstmt set timestamp index pay date pstmt set timestamp index pay date pay amt pstmt set int index bi c currency id pstmt set timestamp index pay date pstmt set int index m ad client id if only due is selected pstmt set timestamp index pay date if c bpartner id 0 pstmt set int index c bpartner id result set rs pstmt execute query mini table load table rs rs close pstmt close catch sql exception e log log level severe sql e calculate selection tableinfo loadtableinfo m_sql m_sql paydate fieldpaydate getvalue minitable setcolorcompare paydate paydate paydate bankinfo bankinfo fieldbankaccount getselecteditem onlydue isselected dateinvoiced netdays keynamepair keynamepair fieldbpartner getselecteditem c_bpartner_id getkey c_bpartner_id c_bpartner_id c_currecny_id c_currency_id c_bpartner_id c_bpartner_id preparedstatement preparestatement settimestamp paydate discountamt setint c_currency_id dueamt settimestamp paydate settimestamp paydate payamt setint c_currency_id settimestamp paydate setint m_ad_client_id onlydue isselected settimestamp paydate c_bpartner_id setint c_bpartner_id resultset executequery minitable loadtable sqlexception calculateselection dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e update bank info if e get source field bank account load bank info generate pay selection else if e get source b generate generate pay select dispose else if e get source b cancel dispose update open invoices else if e get source fieldb partner e get source b refresh load table info actionlistener actionperformed actionevent getsource fieldbankaccount loadbankinfo payselection getsource bgenerate generatepayselect getsource bcancel getsource fieldbpartner getsource brefresh loadtableinfo table model listener param e event public void table changed table model event e if e get column 0 calculate selection tablechanged tablemodelevent getcolumn calculateselection calculate selected rows add up selected rows public void calculate selection m noselected 0 big decimal invoice amt new big decimal 0 0 int rows mini table get row count for int i 0 i rows i id column id id column mini table get model get value at i 0 if id is selected big decimal amt big decimal mini table get model get value at i 9 invoice amt invoice amt add amt m noselected information big decimal remaining m bankbalance subtract invoice amt string buffer info new string buffer info append m noselected append append msg get msg env get ctx selected append info append m format format invoice amt append info append msg get msg env get ctx remaining append append m format format remaining data status set text info to string b generate set enabled m noselected 0 calculateselection m_noselected bigdecimal invoiceamt bigdecimal minitable getrowcount idcolumn idcolumn minitable getmodel getvalueat isselected bigdecimal bigdecimal minitable getmodel getvalueat invoiceamt invoiceamt m_noselected bigdecimal m_bankbalance invoiceamt stringbuffer stringbuffer m_noselected getmsg getctx m_format invoiceamt getmsg getctx m_format datastatus settext tostring bgenerate setenabled m_noselected generate pay selection private void generate pay select log info string trx name trx create trx name pay select trx trx trx get trx name true trx needs to be committed too string trx name null trx trx null mini table stop editor true if mini table get row count 0 return mini table set row selection interval 0 0 calculate selection if m noselected 0 return string payment rule value name pair field payment rule get selected item get value create header m ps new m pay selection env get ctx 0 trx name m ps set name msg get msg env get ctx v pay select field pay date get timestamp m ps set pay date field pay date get timestamp bank info bi bank info field bank account get selected item m ps setc bankaccount id bi c bankaccount id m ps set is approved true if m ps save a dialog error m windowno this save error msg translate env get ctx c payselection id m ps null return log config m ps to string create lines int rows mini table get row count int line 0 for int i 0 i rows i id column id id column mini table get model get value at i 0 if id is selected line 10 m pay selection line psl new m pay selection line m ps line payment rule int c invoice id id getrecord id int value big decimal open amt big decimal mini table get model get value at i 8 big decimal pay amt big decimal mini table get model get value at i 9 boolean isso trx false psl set invoice c invoice id isso trx open amt pay amt open amt subtract pay amt if psl save trx name a dialog error m windowno this save error msg translate env get ctx c payselectionline id return log fine c invoice id c invoice id pay amt pay amt for all rows in table ask to post it if a dialog ask m windowno this v pay select generate m ps get name return prepare process pay selection create check process info pi new process info m frame get title 155 m pay selection table id m ps getc payselection id pi setad user id env getad user id env get ctx pi setad client id env getad client id env get ctx execute process process ctl process this m windowno pi trx process ctl worker new process ctl this pi trx worker start complete tasks in unlockui payselection generatepayselect trxname createtrxname payselect trxname trxname minitable stopeditor minitable getrowcount minitable setrowselectioninterval calculateselection m_noselected paymentrule valuenamepair fieldpaymentrule getselecteditem getvalue m_ps mpayselection getctx trxname m_ps setname getmsg getctx vpayselect fieldpaydate gettimestamp m_ps setpaydate fieldpaydate gettimestamp bankinfo bankinfo fieldbankaccount getselecteditem m_ps setc_bankaccount_id c_bankaccount_id m_ps setisapproved m_ps adialog m_windowno saveerror getctx c_payselection_id m_ps m_ps tostring minitable getrowcount idcolumn idcolumn minitable getmodel getvalueat isselected mpayselectionline mpayselectionline m_ps paymentrule c_invoice_id getrecord_id intvalue bigdecimal openamt bigdecimal minitable getmodel getvalueat bigdecimal payamt bigdecimal minitable getmodel getvalueat issotrx setinvoice c_invoice_id issotrx openamt payamt openamt payamt trxname adialog m_windowno saveerror getctx c_payselectionline_id c_invoice_id c_invoice_id payamt payamt adialog m_windowno vpayselectgenerate m_ps getname payselectioncreatecheck processinfo processinfo m_frame gettitle mpayselection table_id m_ps getc_payselection_id setad_user_id getad_user_id getctx setad_client_id getad_client_id getctx processctl m_windowno processctl processctl lock user interface called from the worker before processing param pi process info public void lockui process info pi this set enabled false m islocked true processinfo setenabled m_islocked unlock user interface called from the worker when processing is done param pi process info public void unlockui process info pi this set enabled true m islocked false ask to print it window is disposed if a dialog ask 0 this v pay select print pi get summary return start pay print int ad form id 106 payment print export form frame ff new form frame ff open form ad form id set parameter if m ps null v pay print pp v pay print ff get form panel pp set pay selection m ps getc payselection id ff pack this set visible false a env show center screen ff this dispose processinfo setenabled m_islocked adialog vpayselectprint getsummary payprint ad_form_id formframe formframe openform ad_form_id m_ps vpayprint vpayprint getformpanel setpayselection m_ps getc_payselection_id setvisible aenv showcenterscreen is the ui locked internal method return true if ui is locked public boolean isui locked return m islocked isuilocked m_islocked method to be executed async called from the a sync process worker param pi process info public void executea sync process info pi log config asyncprocess executeasync processinfo public bank info int newc bankaccount id int newc currency id string new name string new currency big decimal new balance boolean new transfers c bankaccount id newc bankaccount id c currency id newc currency id name new name currency new currency balance new balance bankinfo newc_bankaccount_id newc_currency_id newname newcurrency bigdecimal newbalance newtransfers c_bankaccount_id newc_bankaccount_id c_currency_id newc_currency_id newname newcurrency newbalance boolean transfers public string to string return name tostring constructor param column name param mandatory param is read only param is updateable param m account param title public v account string column name boolean mandatory boolean is read only boolean is updateable m account lookup m account string title super super set name column name m columnname column name m maccount m account m title title look and feel install border this text field border this set layout new border layout size this set preferred size m text get preferred size causes r o to be the same length int height m text get preferred size height button text m text set border null m text add action listener this m text set font compiereplaf getfont field m text set foreground compiereplaf gettextcolor normal this add m text border layout center m button set icon env get image icon account10 gif m button set margin new insets 0 0 0 0 m button set preferred size new dimension height height m button add action listener this m button set focusable false this add m button border layout east editable if is read only is updateable set read write false else set read write true set mandatory mandatory columnname isreadonly isupdateable maccount vaccount columnname isreadonly isupdateable maccountlookup maccount setname columnname m_columnname columnname m_maccount maccount m_title lookandfeel installborder textfield setlayout borderlayout setpreferredsize m_text getpreferredsize m_text getpreferredsize m_text setborder m_text addactionlistener m_text setfont getfont_field m_text setforeground gettextcolor_normal m_text borderlayout m_button seticon getimageicon m_button setmargin m_button setpreferredsize m_button addactionlistener m_button setfocusable m_button borderlayout isreadonly isupdateable setreadwrite setreadwrite setmandatory dispose public void dispose m text null m button null m maccount null m_text m_button m_maccount enable disable param value public void set read write boolean value m button set read write value m text set read write value if m button is visible value m button set visible value set background false setreadwrite m_button setreadwrite m_text setreadwrite m_button isvisible m_button setvisible setbackground is read write return true if read write public boolean is read write return m button is read write isreadwrite isreadwrite m_button isreadwrite set mandatory and back bolor param mandatory public void set mandatory boolean mandatory m button set mandatory mandatory set background false setmandatory m_button setmandatory setbackground is it mandatory return mandatory public boolean is mandatory return m button is mandatory ismandatory m_button ismandatory set background param color public void set background color color if color equals m text get background m text set background color setbackground m_text getbackground m_text setbackground set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if is mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive ismandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set foreground param fg public void set foreground color fg m text set foreground fg setforeground m_text setforeground set editor to value param value public void set value object value m value value m text set text m maccount get display value loads value m text set tool tip text m maccount get description setvalue m_value m_text settext m_maccount getdisplay m_text settooltiptext m_maccount getdescription request focus public void request focus m text request focus requestfocus m_text requestfocus property change listener param evt public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value return new integer m maccount c validcombination id getvalue m_maccount c_validcombination_id return display value return string representation public string get display return m text get text getdisplay m_text gettext action listener button start dialog param e public void action performed action event e if e get source m text cmd text else cmd button actionlistener actionperformed actionevent getsource m_text cmd_text cmd_button button start dialog public void cmd button set cursor cursor get predefined cursor cursor wait cursor int c acctschema id env get context as int env get ctx m windowno c acctschema id v account dialog ad new v account dialog env get frame this m title m maccount c acctschema id set cursor cursor get default cursor integer new value ad get value if new value null return set redisplay set value new value data binding try fire vetoable change m columnname null new value catch property veto exception pve cmd_button setcursor getpredefinedcursor wait_cursor c_acctschema_id getcontextasint getctx m_windowno c_acctschema_id vaccountdialog vaccountdialog getframe m_title m_maccount c_acctschema_id setcursor getdefaultcursor newvalue getvalue newvalue setvalue newvalue firevetoablechange m_columnname newvalue propertyvetoexception text try to find alias or start dialog public void cmd text string text m text get text log info text text if text null text length 0 text equals cmd button return if text ends with text string sql select c validcombination id from c validcombination where c acctschema id and upper alias like or upper combination like sql m role get default add accesssql sql c validcombination m role sql notqualified m role sql ro int c acctschema id env get context as int env get ctx m windowno c acctschema id int c validcombination id 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c acctschema id pstmt set string 2 text to upper case pstmt set string 3 text to upper case result set rs pstmt execute query if rs next c validcombination id rs get int 1 if rs next only one c validcombination id 0 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null we have a value if c validcombination id 0 integer new value new integer c validcombination id data binding try fire vetoable change m columnname null new value catch property veto exception pve else cmd button cmd_text m_text gettext cmd_button endswith c_validcombination_id c_validcombination c_acctschema_id mrole getdefault addaccesssql c_validcombination mrole sql_notqualified mrole sql_ro c_acctschema_id getcontextasint getctx m_windowno c_acctschema_id c_validcombination_id preparedstatement preparestatement setint c_acctschema_id setstring touppercase setstring touppercase resultset executequery c_validcombination_id getint c_validcombination_id c_validcombination_id newvalue c_validcombination_id firevetoablechange m_columnname newvalue propertyvetoexception cmd_button action listener interface param listener public void add action listener action listener listener m text add action listener listener addactionlistener actionlistener m_text addactionlistener set field window no for value preference nop param m field public void set field org compiere model m field m field if m field null m windowno m field get window no windowno valuepreference mfield setfield mfield mfield mfield m_windowno mfield getwindowno public character filter super 4 characterfilter returns the name of the filter public string get info return character filter getinfo characterfilter register things to be filtered public filter add attribute string name object attribute this put name attribute return this addattribute remove things to be filtered public filter remove attribute string name try this remove name catch exception e return this removeattribute check to see if something is going to be filtered public boolean has attribute string key return this contains key key hasattribute containskey perform the filtering operation public string process string to process if to process null to process length 0 return string buffer bs new string buffer to process length 50 string character iterator sci new string character iterator to process string tmp null for char c sci first c character iterator done c sci next tmp string value of c if has attribute tmp tmp string this get tmp int ii c if ii 255 tmp ii bs append tmp return bs to string to_process to_process to_process stringbuffer stringbuffer to_process stringcharacteriterator stringcharacteriterator to_process characteriterator valueof hasattribute tostring basic constructor use set methods public td constructor code new td popup center align type center align type middle true code param class name class name param h align horizontal e g align type left param v align vertical e g align type top param nowrap no wrap public td string class name string h align string v align boolean nowrap this if class name null set class class name if h align null set align h align if v align null setv align v align set no wrap nowrap popupcenter aligntype aligntype classname halign aligntype valign aligntype classname halign valign classname setclass classname halign setalign halign valign setvalign valign setnowrap constructor param class name class name param h align horizontal e g align type left param v align vertical e g align type top param value added element if null nbsp is added param nowrap no wrap public td string class name string h align string v align boolean nowrap element value this class name h align v align nowrap if value null add element nbsp else add element value classname halign aligntype valign aligntype classname halign valign classname halign valign addelement addelement basic constructor with element use set methods param value added element public td element value add element value addelement basic constructor with element use set methods param value added element public td string value add element value addelement sets the abbr attribute param cdata sets the abbr attribute public td set abbr string cdata add attribute abbr cdata return this setabbr addattribute sets the axis attribute param cdata sets the axis attribute public td set axis string cdata add attribute axis cdata return this setaxis addattribute sets the axes attribute param id refs list of id s for header cells public td set axes string id refs add attribute axes id refs return this id_refs setaxes id_refs addattribute id_refs sets the rowspan attribute param rowspan number of rows spaned by cell public td set row span int rowspan add attribute rowspan integer to string rowspan return this setrowspan addattribute tostring sets the rowspan attribute param rowspan number of rows spaned by cell public td set row span string rowspan add attribute rowspan rowspan return this setrowspan addattribute sets the colspan attribute param colspan number of columns spanned by cell public td set col span int colspan add attribute colspan integer to string colspan return this setcolspan addattribute tostring sets the colspan attribute param colspan number of columns spanned by cell public td set col span string colspan add attribute colspan colspan return this setcolspan addattribute sets word wrap on or off param wrap turn word wrap on or off public td set no wrap boolean wrap if wrap true add attribute nowrap nowrap else remove attribute nowrap return this setnowrap addattribute removeattribute supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public td set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public td set width string width add attribute width width return this setwidth addattribute supplies user agents with a recommended cell height pixel values param height how many pixels to make cell public td set height int height add attribute height integer to string height return this setheight addattribute tostring supplies user agents with a recommended cell height pixel values param height how many pixels to make cell public td set height string height add attribute height height return this setheight addattribute sets the align attribute convience variables are provided in the align type interface param h align sets the align attribute public td set align string h align if h align null h align equals align type left h align equals align type center h align equals align type right add attribute align h align else throw new illegal argument exception h align illegal for horizontal align left center right return this aligntype halign setalign halign halign halign aligntype halign aligntype halign aligntype addattribute halign illegalargumentexception halign sets the valign attribute convience variables are provided in the align type interface param v align sets the valign attribute public td setv align string v align if v align null v align equals align type top v align equals align type middle v align equals align type absmiddle v align equals align type bottom v align equals align type absbottom v align equals align type baseline add attribute valign v align else throw new illegal argument exception v align illegal for vertical align top middle bottom return this aligntype valign setvalign valign valign valign aligntype valign aligntype valign aligntype valign aligntype valign aligntype valign aligntype addattribute valign illegalargumentexception valign sets the char attribute param character the character to use for alignment public td set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public td set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public td set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the bgcolor attribute param color sets the background color of the cell public td set bg color string color add attribute bgcolor html color convert color color return this setbgcolor addattribute htmlcolor convertcolor sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public td add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public td add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public td add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public td add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public td remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute determine if this element needs a line break if pretty printing public boolean get need line break java util enumeration en elements int i 0 int j 0 while en has more elements j object obj en next element if obj instanceof img obj instanceof a i if i j return false return true getneedlinebreak hasmoreelements nextelement standard constructor public x c channel properties ctx int c channel id string trx name super ctx c channel id trx name if c channel id 0 setc channel id 0 set name null x_c_channel c_channel_id trxname c_channel_id trxname c_channel_id setc_channel_id setname load constructor public x c channel properties ctx result set rs string trx name super ctx rs trx name x_c_channel resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c channel append get id append return sb to string tostring stringbuffer stringbuffer x_c_channel get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set channel sales channel public void setc channel id int c channel id if c channel id 1 throw new illegal argument exception c channel id is mandatory set valuenocheck c channel id new integer c channel id setc_channel_id c_channel_id c_channel_id illegalargumentexception c_channel_id set_valuenocheck c_channel_id c_channel_id get channel sales channel public int getc channel id integer ii integer get value c channel id if ii null return 0 return ii int value getc_channel_id get_value c_channel_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x c bankaccount acct properties ctx int c bankaccount acct id string trx name super ctx c bankaccount acct id trx name if c bankaccount acct id 0 setb asset acct 0 setb expense acct 0 setb intransit acct 0 setb interestexp acct 0 setb interestrev acct 0 setb paymentselect acct 0 setb revaluationgain acct 0 setb revaluationloss acct 0 setb settlementgain acct 0 setb settlementloss acct 0 setb unallocatedcash acct 0 setb unidentified acct 0 setc acctschema id 0 setc bankaccount id 0 x_c_bankaccount_acct c_bankaccount_acct_id trxname c_bankaccount_acct_id trxname c_bankaccount_acct_id setb_asset_acct setb_expense_acct setb_intransit_acct setb_interestexp_acct setb_interestrev_acct setb_paymentselect_acct setb_revaluationgain_acct setb_revaluationloss_acct setb_settlementgain_acct setb_settlementloss_acct setb_unallocatedcash_acct setb_unidentified_acct setc_acctschema_id setc_bankaccount_id load constructor public x c bankaccount acct properties ctx result set rs string trx name super ctx rs trx name x_c_bankaccount_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bankaccount acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_bankaccount_acct get_id tostring set bank asset bank asset account public void setb asset acct int b asset acct set value b asset acct new integer b asset acct setb_asset_acct b_asset_acct set_value b_asset_acct b_asset_acct get bank asset bank asset account public int getb asset acct integer ii integer get value b asset acct if ii null return 0 return ii int value getb_asset_acct get_value b_asset_acct intvalue set bank expense bank expense account public void setb expense acct int b expense acct set value b expense acct new integer b expense acct setb_expense_acct b_expense_acct set_value b_expense_acct b_expense_acct get bank expense bank expense account public int getb expense acct integer ii integer get value b expense acct if ii null return 0 return ii int value getb_expense_acct get_value b_expense_acct intvalue set bank in transit bank in transit account public void setb intransit acct int b intransit acct set value b intransit acct new integer b intransit acct setb_intransit_acct b_intransit_acct set_value b_intransit_acct b_intransit_acct get bank in transit bank in transit account public int getb intransit acct integer ii integer get value b intransit acct if ii null return 0 return ii int value getb_intransit_acct get_value b_intransit_acct intvalue set bank interest expense bank interest expense account public void setb interestexp acct int b interestexp acct set value b interestexp acct new integer b interestexp acct setb_interestexp_acct b_interestexp_acct set_value b_interestexp_acct b_interestexp_acct get bank interest expense bank interest expense account public int getb interestexp acct integer ii integer get value b interestexp acct if ii null return 0 return ii int value getb_interestexp_acct get_value b_interestexp_acct intvalue set bank interest revenue bank interest revenue account public void setb interestrev acct int b interestrev acct set value b interestrev acct new integer b interestrev acct setb_interestrev_acct b_interestrev_acct set_value b_interestrev_acct b_interestrev_acct get bank interest revenue bank interest revenue account public int getb interestrev acct integer ii integer get value b interestrev acct if ii null return 0 return ii int value getb_interestrev_acct get_value b_interestrev_acct intvalue set payment selection ap payment selection clearing account public void setb paymentselect acct int b paymentselect acct set value b paymentselect acct new integer b paymentselect acct setb_paymentselect_acct b_paymentselect_acct set_value b_paymentselect_acct b_paymentselect_acct get payment selection ap payment selection clearing account public int getb paymentselect acct integer ii integer get value b paymentselect acct if ii null return 0 return ii int value getb_paymentselect_acct get_value b_paymentselect_acct intvalue set bank revaluation gain bank revaluation gain account public void setb revaluationgain acct int b revaluationgain acct set value b revaluationgain acct new integer b revaluationgain acct setb_revaluationgain_acct b_revaluationgain_acct set_value b_revaluationgain_acct b_revaluationgain_acct get bank revaluation gain bank revaluation gain account public int getb revaluationgain acct integer ii integer get value b revaluationgain acct if ii null return 0 return ii int value getb_revaluationgain_acct get_value b_revaluationgain_acct intvalue set bank revaluation loss bank revaluation loss account public void setb revaluationloss acct int b revaluationloss acct set value b revaluationloss acct new integer b revaluationloss acct setb_revaluationloss_acct b_revaluationloss_acct set_value b_revaluationloss_acct b_revaluationloss_acct get bank revaluation loss bank revaluation loss account public int getb revaluationloss acct integer ii integer get value b revaluationloss acct if ii null return 0 return ii int value getb_revaluationloss_acct get_value b_revaluationloss_acct intvalue set bank settlement gain bank settlement gain account public void setb settlementgain acct int b settlementgain acct set value b settlementgain acct new integer b settlementgain acct setb_settlementgain_acct b_settlementgain_acct set_value b_settlementgain_acct b_settlementgain_acct get bank settlement gain bank settlement gain account public int getb settlementgain acct integer ii integer get value b settlementgain acct if ii null return 0 return ii int value getb_settlementgain_acct get_value b_settlementgain_acct intvalue set bank settlement loss bank settlement loss account public void setb settlementloss acct int b settlementloss acct set value b settlementloss acct new integer b settlementloss acct setb_settlementloss_acct b_settlementloss_acct set_value b_settlementloss_acct b_settlementloss_acct get bank settlement loss bank settlement loss account public int getb settlementloss acct integer ii integer get value b settlementloss acct if ii null return 0 return ii int value getb_settlementloss_acct get_value b_settlementloss_acct intvalue set unallocated cash unallocated cash clearing account public void setb unallocatedcash acct int b unallocatedcash acct set value b unallocatedcash acct new integer b unallocatedcash acct setb_unallocatedcash_acct b_unallocatedcash_acct set_value b_unallocatedcash_acct b_unallocatedcash_acct get unallocated cash unallocated cash clearing account public int getb unallocatedcash acct integer ii integer get value b unallocatedcash acct if ii null return 0 return ii int value getb_unallocatedcash_acct get_value b_unallocatedcash_acct intvalue set bank unidentified receipts bank unidentified receipts account public void setb unidentified acct int b unidentified acct set value b unidentified acct new integer b unidentified acct setb_unidentified_acct b_unidentified_acct set_value b_unidentified_acct b_unidentified_acct get bank unidentified receipts bank unidentified receipts account public int getb unidentified acct integer ii integer get value b unidentified acct if ii null return 0 return ii int value getb_unidentified_acct get_value b_unidentified_acct intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set valuenocheck c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_valuenocheck c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue standard constructor param ctx context param c taxpostal id id public m tax postal properties ctx int c taxpostal id string trx name super ctx c taxpostal id trx name c_taxpostal_id mtaxpostal c_taxpostal_id trxname c_taxpostal_id trxname load constructor param ctx context param rs result set public m tax postal properties ctx result set rs string trx name super ctx rs trx name mtaxpostal resultset trxname trxname initialize global variables public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w help init servletconfig servletexception webenv initweb servletexception whelp process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception log fine do get w window status ws w window status get request web doc doc null if ws null doc web doc create popup no context doc add popup close else doc ws m window get help doc false web util create response request response this null doc false doget httpservletrequest httpservletresponse servletexception ioexception doget wwindowstatus wwindowstatus webdoc webdoc createpopup addpopupclose mwindow gethelpdoc webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create help post not implemented web util create response request response this null doc false dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc webutil createresponse standard constructor public x ad val rule properties ctx int ad val rule id string trx name super ctx ad val rule id trx name if ad val rule id 0 setad val rule id 0 set entity type null u set name null set type null x_ad_val_rule ad_val_rule_id trxname ad_val_rule_id trxname ad_val_rule_id setad_val_rule_id setentitytype setname settype load constructor public x ad val rule properties ctx result set rs string trx name super ctx rs trx name x_ad_val_rule resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad val rule append get id append return sb to string tostring stringbuffer stringbuffer x_ad_val_rule get_id tostring set dynamic validation dynamic validation rule public void setad val rule id int ad val rule id if ad val rule id 1 throw new illegal argument exception ad val rule id is mandatory set valuenocheck ad val rule id new integer ad val rule id setad_val_rule_id ad_val_rule_id ad_val_rule_id illegalargumentexception ad_val_rule_id set_valuenocheck ad_val_rule_id ad_val_rule_id get dynamic validation dynamic validation rule public int getad val rule id integer ii integer get value ad val rule id if ii null return 0 return ii int value getad_val_rule_id get_value ad_val_rule_id intvalue set validation code validation code public void set code string code if code null code length 2000 log warning length 2000 truncated code code substring 0 1999 set value code code setcode set_value get validation code validation code public string get code return string get value code getcode get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string type sql s set type type of validation sql java script java language public void set type string type if type null throw new illegal argument exception type is mandatory if type equals e type equals j type equals s else throw new illegal argument exception type invalid value type reference id 101 e j s if type length 1 log warning length 1 truncated type type substring 0 0 set value type type type_sql settype illegalargumentexception illegalargumentexception reference_id set_value get type type of validation sql java script java language public string get type return string get value type gettype get_value process archive info param pi process info public print info process info pi set name pi get title setad process id pi getad process id setad table id pi gettable id setrecord id pi getrecord id printinfo processinfo setname gettitle setad_process_id getad_process_id setad_table_id gettable_id setrecord_id getrecord_id document archive info param name name param ad table id table param record id record param c bpartner id bpartner public print info string name int ad table id int record id int c bpartner id set name name setad table id ad table id setrecord id record id setc bpartner id c bpartner id ad_table_id record_id c_bpartner_id printinfo ad_table_id record_id c_bpartner_id setname setad_table_id ad_table_id setrecord_id record_id setc_bpartner_id c_bpartner_id report archive info param name name param ad table id table param record id record public print info string name int ad table id int record id set name name setad table id ad table id setrecord id record id ad_table_id record_id printinfo ad_table_id record_id setname setad_table_id ad_table_id setrecord_id record_id is this a report return true if report public boolean is report return m ad process id 0 menu report m c bpartner id 0 isreport m_ad_process_id m_c_bpartner_id is this a document return true if b partner defined public boolean is document return m c bpartner id 0 bpartner isdocument m_c_bpartner_id return returns the copies public int get copies return m copies getcopies m_copies param copies the copies to set public void set copies int copies m copies copies setcopies m_copies return returns the printer name public string get printer name return m printername printername getprintername m_printername param printer name the printer name to set public void set printer name string printer name m printername printer name printername printername setprintername printername m_printername printername return returns the with dialog public boolean is with dialog return m withdialog withdialog iswithdialog m_withdialog param with dialog the with dialog to set public void set with dialog boolean with dialog m withdialog with dialog withdialog withdialog setwithdialog withdialog m_withdialog withdialog param is document copy the is document to set public void set document copy boolean is document copy m isdocumentcopy is document copy isdocumentcopy isdocument setdocumentcopy isdocumentcopy m_isdocumentcopy isdocumentcopy m isdocumentcopy is document copy public boolean is document copy return m isdocumentcopy is document m_isdocumentcopy isdocumentcopy isdocumentcopy m_isdocumentcopy isdocument is document return returns the ad process id public int getad process id return m ad process id isdocument ad_process_id getad_process_id m_ad_process_id param process id the ad process id to set public void setad process id int process id m ad process id process id process_id ad_process_id setad_process_id process_id m_ad_process_id process_id return returns the ad table id public int getad table id return m ad table id ad_table_id getad_table_id m_ad_table_id param table id the ad table id to set public void setad table id int table id m ad table id table id table_id ad_table_id setad_table_id table_id m_ad_table_id table_id return returns the c bpartner id public int getc bpartner id return m c bpartner id c_bpartner_id getc_bpartner_id m_c_bpartner_id param partner id the c bpartner id to set public void setc bpartner id int partner id m c bpartner id partner id partner_id c_bpartner_id setc_bpartner_id partner_id m_c_bpartner_id partner_id return returns the description public string get description return m description getdescription m_description param description the description to set public void set description string description m description description setdescription m_description return returns the help public string get help return m help gethelp m_help param help the help to set public void set help string help m help help sethelp m_help return returns the name public string get name if m name null m name length 0 return unknown return m name getname m_name m_name m_name param name the name to set public void set name string name m name name setname m_name return returns the record id public int getrecord id return m record id record_id getrecord_id m_record_id param record id the record id to set public void setrecord id int record id m record id record id record_id record_id setrecord_id record_id m_record_id record_id string representation return info public string to string string buffer sb new string buffer print info sb append get name if getad process id 0 sb append ad process id append getad process id if getad table id 0 sb append ad table id append getad table id if getrecord id 0 sb append record id append getrecord id if getc bpartner id 0 sb append c bpartner id append getc bpartner id sb append return sb to string tostring stringbuffer stringbuffer printinfo getname getad_process_id ad_process_id getad_process_id getad_table_id ad_table_id getad_table_id getrecord_id record_id getrecord_id getc_bpartner_id c_bpartner_id getc_bpartner_id tostring get organizational access of user param ctx context param ad user id user return array of user org access public static m user org access get of user properties ctx int ad user id return get ctx select from ad user orgaccess where ad user id ad user id ad_user_id muserorgaccess getofuser ad_user_id ad_user_orgaccess ad_user_id ad_user_id get organizational info param ctx context param sql sql command param id id return array of user org access private static m user org access get properties ctx string sql int id array list m user org access list new array list m user org access prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 id result set rs pstmt execute query while rs next list add new m user org access ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m user org access ret value new m user org access list size list to array ret value return ret value muserorgaccess arraylist muserorgaccess arraylist muserorgaccess preparedstatement preparestatement setint resultset executequery muserorgaccess s_log muserorgaccess retvalue muserorgaccess toarray retvalue retvalue load constructor param ctx context param rs result set public m user org access properties ctx result set rs string trx name super ctx rs trx name muserorgaccess resultset trxname trxname persistency constructor param ctx context param ignored ignored public m user org access properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set is read only false muserorgaccess trxname trxname illegalargumentexception setisreadonly organization constructor param org org param ad user id role public m user org access m org org int ad user id this org get ctx 0 org get trxname set client org org setad user id ad user id ad_user_id muserorgaccess morg ad_user_id getctx get_trxname setclientorg setad_user_id ad_user_id user constructor param user user param ad org id org public m user org access m user user int ad org id this user get ctx 0 user get trxname set client org user getad client id ad org id setad user id user getad user id m user org access string representation return info public string to string string buffer sb new string buffer m user org access sb append ad user id append getad user id append ad client id append getad client id append ad org id append getad org id append ro append is read only sb append return sb to string ad_org_id muserorgaccess muser ad_org_id getctx get_trxname setclientorg getad_client_id ad_org_id setad_user_id getad_user_id muserorgaccess tostring stringbuffer stringbuffer muserorgaccess ad_user_id getad_user_id ad_client_id getad_client_id ad_org_id getad_org_id isreadonly tostring extended string representation return extended info public string to stringx properties ctx string buffer sb new string buffer sb append msg translate ctx ad client id append append get client name append append msg translate ctx ad org id append append get org name return sb to string tostringx stringbuffer stringbuffer ad_client_id getclientname ad_org_id getorgname tostring get client name return name public string get client name if m clientname null string sql select c name o name from ad client c inner join ad org o on c ad client id o ad client id where o ad org id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad org id result set rs pstmt execute query if rs next m clientname rs get string 1 m orgname rs get string 2 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return m clientname getclientname m_clientname ad_client ad_org ad_client_id ad_client_id ad_org_id preparedstatement preparestatement setint getad_org_id resultset executequery m_clientname getstring m_orgname getstring m_clientname get client name return name public string get org name if m orgname null get client name return m orgname getorgname m_orgname getclientname m_orgname standard constructor public x r groupupdates properties ctx int r groupupdates id string trx name super ctx r groupupdates id trx name if r groupupdates id 0 setad user id 0 set is self service false setr group id 0 x_r_groupupdates r_groupupdates_id trxname r_groupupdates_id trxname r_groupupdates_id setad_user_id setisselfservice setr_group_id load constructor public x r groupupdates properties ctx result set rs string trx name super ctx rs trx name x_r_groupupdates resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r groupupdates append get id append return sb to string tostring stringbuffer stringbuffer x_r_groupupdates get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set group request group public void setr group id int r group id if r group id 1 throw new illegal argument exception r group id is mandatory set valuenocheck r group id new integer r group id setr_group_id r_group_id r_group_id illegalargumentexception r_group_id set_valuenocheck r_group_id r_group_id get group request group public int getr group id integer ii integer get value r group id if ii null return 0 return ii int value getr_group_id get_value r_group_id intvalue create new server thead param model model return server tread or null public static compiere server create compiere processor model if model instanceof m request processor return new request processor m request processor model if model instanceof m workflow processor return new workflow processor m workflow processor model if model instanceof m acct processor return new acct processor m acct processor model if model instanceof m alert processor return new alert processor m alert processor model if model instanceof m scheduler return new scheduler m scheduler model throw new illegal argument exception unknown processor compiereserver compiereprocessor mrequestprocessor requestprocessor mrequestprocessor mworkflowprocessor workflowprocessor mworkflowprocessor macctprocessor acctprocessor macctprocessor malertprocessor alertprocessor malertprocessor mscheduler mscheduler illegalargumentexception server base class param model model param initial nap delay time running in sec protected compiere server compiere processor model int initial nap super compiere server group get null model get name 0 p model model m ctx new properties model get ctx if p system null p system m system get m ctx p client m client get m ctx env set context m ctx ad client id p client getad client id m initialnap initial nap log info model get name get thread group initialnap compiereserver compiereprocessor initialnap compiereservergroup getname p_model m_ctx getctx p_system p_system msystem m_ctx p_client mclient m_ctx setcontext m_ctx ad_client_id p_client getad_client_id m_initialnap initialnap getname getthreadgroup get server context return context public properties get ctx return m ctx getctx m_ctx return returns the sleepms public long get sleepms return m sleepms getsleepms m_sleepms sleep for set time return true if not interrupted public boolean sleep if is interrupted log info get name interrupted return false log fine get name sleeping time util format elapsed m sleepms m sleeping true try sleep m sleepms catch interrupted exception e log info get name interrupted m sleeping false return false m sleeping false return true isinterrupted getname getname timeutil formatelapsed m_sleepms m_sleeping m_sleepms interruptedexception getname m_sleeping m_sleeping run now public void run now log info get name p startwork system current time millis do work long now system current time millis p runcount m runlastms now p startwork m runtotalms m runlastms p model set date last run new timestamp now p model save log fine get name get statistics runnow getname p_startwork currenttimemillis dowork currenttimemillis p_runcount m_runlastms p_startwork m_runtotalms m_runlastms p_model setdatelastrun p_model getname getstatistics run async public void run try log fine get name pre nap m initialnap sleep m initialnap 1000 catch interrupted exception e log log level severe get name pre nap interrupted e return m start system current time millis while true if m nextwork 0 timestamp date next run get date next run true if date next run null m nextwork date next run get time long now system current time millis if m nextwork now m sleepms m nextwork now if sleep break if is interrupted log info get name interrupted break p startwork system current time millis do work now system current time millis p runcount m runlastms now p startwork m runtotalms m runlastms m sleepms calculate sleep m nextwork now m sleepms p model set date last run new timestamp now p model set date next run new timestamp m nextwork p model save log fine get name get statistics if sleep break m start 0 getname m_initialnap m_initialnap interruptedexception getname m_start currenttimemillis m_nextwork datenextrun getdatenextrun datenextrun m_nextwork datenextrun gettime currenttimemillis m_nextwork m_sleepms m_nextwork isinterrupted getname p_startwork currenttimemillis dowork currenttimemillis p_runcount m_runlastms p_startwork m_runtotalms m_runlastms m_sleepms calculatesleep m_nextwork m_sleepms p_model setdatelastrun p_model setdatenextrun m_nextwork p_model getname getstatistics m_start get run statistics return statistic info public string get statistics return run p runcount last time util format elapsed m runlastms total time util format elapsed m runtotalms next time util format elapsed m nextwork system current time millis getstatistics p_runcount timeutil formatelapsed m_runlastms timeutil formatelapsed m_runtotalms timeutil formatelapsed m_nextwork currenttimemillis get statistics do the actual work protected abstract void do work getstatistics dowork get server info return info get unique id return unique id public string get serverid return p model get serverid getserverid p_model getserverid get the date next run param requery requery database return date next run public timestamp get date next run boolean requery return p model get date next run requery getdatenextrun p_model getdatenextrun get the date last run return date lext run public timestamp get date last run return p model get date last run getdatelastrun p_model getdatelastrun get description return description public string get description return p model get description getdescription p_model getdescription get model return model public compiere processor get model return p model compiereprocessor getmodel p_model calculate sleep ms return miliseconds private long calculate sleep string frequency type p model get frequency type int frequency p model get frequency if frequency 1 frequency 1 long type sec 600 10 minutes if frequency type null type sec 300 5 minutes else if m request processor frequencytype minute equals frequency type type sec 60 else if m request processor frequencytype hour equals frequency type type sec 3600 else if m request processor frequencytype day equals frequency type type sec 86400 return type sec 1000 frequency ms calculatesleep frequencytype p_model getfrequencytype p_model getfrequency typesec frequencytype typesec mrequestprocessor frequencytype_minute frequencytype typesec mrequestprocessor frequencytype_hour frequencytype typesec mrequestprocessor frequencytype_day frequencytype typesec typesec is sleeping return sleeping public boolean is sleeping return m sleeping issleeping m_sleeping string representation return info public string to string string buffer sb new string buffer get name append prio append get priority append append get thread group append alive append is alive append sleeping append m sleeping append last append get date last run if m sleeping sb append next append get date next run false return sb to string tostring stringbuffer stringbuffer getname getpriority getthreadgroup isalive m_sleeping getdatelastrun m_sleeping getdatenextrun tostring get seconds alive return seconds alive public int get seconds alive if m start 0 return 0 long now system current time millis long ms now m start 1000 return int ms getsecondsalive m_start currenttimemillis m_start get start time return start time public timestamp get start time if m start 0 return null return new timestamp m start getstarttime m_start m_start get processor logs return logs public compiere processor log get logs return p model get logs compiereprocessorlog getlogs p_model getlogs initialize panel param window no window param frame frame public void init int window no form frame frame log info v setup init m windowno window no m frame frame try jb init dyn init frame get content pane add center pane border layout center frame get content pane add confirm panel border layout south catch exception e log log level severe v setup init e windowno windowno formframe vsetup m_windowno windowno m_frame jbinit dyninit getcontentpane centerpane borderlayout getcontentpane confirmpanel borderlayout vsetup static init throws exception private void jb init throws exception compiere color set background this center panel set layout center layout string optional msg translate env get ctx optional l client name set label for f client name l client name set text msg translate env get ctx ad client id l client name set tool tip text f client name set text client f client name set columns 20 l org name set label for f org name l org name set text msg translate env get ctx ad org id f org name set text org f org name set columns 20 l currency set label for f currency l currency set text msg translate env get ctx c currency id l currency set tool tip text l user client set label for f user client l user client set text msg parse translation env get ctx ad user id ad client id l user client set tool tip text user name for client level access f user client set text client admin f user client set columns 20 l user org set label for f user org l user org set text msg parse translation env get ctx ad user id ad org id l user org set tool tip text f user org set text client user f user org set columns 20 l country set label for f country l country set text msg translate env get ctx c country id l city set label for f city l city set text msg translate env get ctx c city id f city set text city f city set columns 20 l region set label for f region l region set text msg translate env get ctx c region id l region set tool tip text optional l account seg set text optional fb partner set selected true fb partner set text msg translate env get ctx c bpartner id f product set selected true f product set text msg translate env get ctx m product id f project set text msg translate env get ctx c project id fm campaign set text msg translate env get ctx c campaign id fs region set text msg translate env get ctx c salesregion id button load acct set text msg get msg env get ctx load accounting values center pane get viewport add center panel null center panel add l client name new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 center panel add f client name new grid bag constraints 1 0 4 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 center panel add l org name new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f org name new grid bag constraints 1 1 4 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add l user client new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f user client new grid bag constraints 1 2 4 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add l user org new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f user org new grid bag constraints 1 3 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add l account seg new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f project new grid bag constraints 1 9 3 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add fb partner new grid bag constraints 1 8 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add fm campaign new grid bag constraints 1 10 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add f currency new grid bag constraints 1 4 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add l currency new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add button load acct new grid bag constraints 1 11 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 center panel add l country new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add l city new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f country new grid bag constraints 1 5 3 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add f city new grid bag constraints 1 6 3 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add f product new grid bag constraints 2 8 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 0 0 0 center panel add fs region new grid bag constraints 2 10 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 center panel add l region new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 5 5 5 0 0 center panel add f region new grid bag constraints 1 7 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 5 5 0 0 jbinit compierecolor setbackground centerpanel setlayout centerlayout getctx lclientname setlabelfor fclientname lclientname settext getctx ad_client_id lclientname settooltiptext fclientname settext fclientname setcolumns lorgname setlabelfor forgname lorgname settext getctx ad_org_id forgname settext forgname setcolumns lcurrency setlabelfor fcurrency lcurrency settext getctx c_currency_id lcurrency settooltiptext luserclient setlabelfor fuserclient luserclient settext parsetranslation getctx ad_user_id ad_client_id luserclient settooltiptext fuserclient settext clientadmin fuserclient setcolumns luserorg setlabelfor fuserorg luserorg settext parsetranslation getctx ad_user_id ad_org_id luserorg settooltiptext fuserorg settext clientuser fuserorg setcolumns lcountry setlabelfor fcountry lcountry settext getctx c_country_id lcity setlabelfor fcity lcity settext getctx c_city_id fcity settext fcity setcolumns lregion setlabelfor fregion lregion settext getctx c_region_id lregion settooltiptext laccountseg settext fbpartner setselected fbpartner settext getctx c_bpartner_id fproduct setselected fproduct settext getctx m_product_id fproject settext getctx c_project_id fmcampaign settext getctx c_campaign_id fsregion settext getctx c_salesregion_id buttonloadacct settext getmsg getctx loadaccountingvalues centerpane getviewport centerpanel centerpanel lclientname gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fclientname gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lorgname gridbagconstraints gridbagconstraints gridbagconstraints centerpanel forgname gridbagconstraints gridbagconstraints gridbagconstraints centerpanel luserclient gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fuserclient gridbagconstraints gridbagconstraints gridbagconstraints centerpanel luserorg gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fuserorg gridbagconstraints gridbagconstraints gridbagconstraints centerpanel laccountseg gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fproject gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fbpartner gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fmcampaign gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fcurrency gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lcurrency gridbagconstraints gridbagconstraints gridbagconstraints centerpanel buttonloadacct gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lcountry gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lcity gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fcountry gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fcity gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fproduct gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fsregion gridbagconstraints gridbagconstraints gridbagconstraints centerpanel lregion gridbagconstraints gridbagconstraints gridbagconstraints centerpanel fregion gridbagconstraints gridbagconstraints gridbagconstraints dynamic init private void dyn init currency string sql select c currency id description from c currency order by 1 usd first try statement stmt db create statement result set rs stmt execute query sql while rs next f currency add item new key name pair rs get int 1 rs get string 2 rs close stmt close catch sql exception e1 log log level severe v setup dyn init currency e1 f currency set selected index 0 country sql select c country id name from c country order by 1 us first try statement stmt db create statement result set rs stmt execute query sql while rs next f country add item new key name pair rs get int 1 rs get string 2 rs close stmt close catch sql exception e1 log log level severe v setup dyn init country e1 f country set selected index 0 region optional sql select c region id name from c region order by c country id name try f region add item new key name pair 0 statement stmt db create statement result set rs stmt execute query sql while rs next f region add item new key name pair rs get int 1 rs get string 2 rs close stmt close catch sql exception e1 log log level severe v setup dyn init region e1 f region set selected index 0 general listeners confirm panel add action listener this button load acct add action listener this confirm panel getok button set enabled false dyninit c_currency_id c_currency createstatement resultset executequery fcurrency additem keynamepair getint getstring sqlexception vsetup dyninit fcurrency setselectedindex c_country_id c_country createstatement resultset executequery fcountry additem keynamepair getint getstring sqlexception vsetup dyninit fcountry setselectedindex c_region_id c_region c_country_id fregion additem keynamepair createstatement resultset executequery fregion additem keynamepair getint getstring sqlexception vsetup dyninit fregion setselectedindex confirmpanel addactionlistener buttonloadacct addactionlistener confirmpanel getokbutton setenabled dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e load file if e get source equals button load acct m file get file ok else if e get action command equals confirm panel a ok m file null confirm panel get cancel button set enabled false confirm panel getok button set enabled false if create setup m frame start batch this else confirm panel get cancel button set enabled true confirm panel getok button set enabled true cancel else if e get action command equals confirm panel a cancel dispose actionlistener actionperformed actionevent getsource buttonloadacct m_file getfile getactioncommand confirmpanel a_ok m_file confirmpanel getcancelbutton setenabled confirmpanel getokbutton setenabled createsetup m_frame startbatch confirmpanel getcancelbutton setenabled confirmpanel getokbutton setenabled getactioncommand confirmpanel a_cancel get file for coa return file private file get file file file null string dir name org compiere compiere get compiere home file separator data file separator import log config dir name j file chooser chooser new j file chooser dir name chooser set file selection mode j file chooser files only chooser set multi selection enabled false chooser set dialog title msg translate env get ctx load accounting values chooser add choosable file filter new extension file filter csv msg get msg env get ctx filecsv try selecting file file new file dir name file path separator accountingus csv if file exists chooser set selected file file show it if chooser show open dialog this get parent j file chooser approve option file chooser get selected file else file null chooser null if file null button load acct set text msg translate env get ctx load accounting values else button load acct set text file get absolute path confirm panel getok button set enabled file null m frame pack return file getfile dirname getcompierehome dirname jfilechooser jfilechooser dirname setfileselectionmode jfilechooser files_only setmultiselectionenabled setdialogtitle getctx loadaccountingvalues addchoosablefilefilter extensionfilefilter getmsg getctx dirname pathseparator setselectedfile showopendialog getparent jfilechooser approve_option getselectedfile buttonloadacct settext getctx loadaccountingvalues buttonloadacct settext getabsolutepath confirmpanel getokbutton setenabled m_frame create setup return true if created private boolean create setup change critical characters f client name set text f client name get text replace f client name set text f client name get text replace f org name set text f org name get text replace f org name set text f org name get text replace f user client set text f user client get text replace f user client set text f user client get text replace f user org set text f user org get text replace f user org set text f user org get text replace unique client name string sql update ad client set created by 0 where name f client name get text if db execute update sql null 0 f client name set background compiereplaf getfieldbackground error a dialog error m windowno this not unique l client name get text f client name request focus return false f client name set background compiereplaf getfieldbackground normal unique org name sql update ad org set created by 0 where value f org name get text if db execute update sql 0 f org name set background compiereplaf getfieldbackground error a dialog error m windowno this not unique l org name get text return false f org name set background compiereplaf getfieldbackground normal unique user name sql update ad user set created by 0 where name f user client get text if db execute update sql null 0 f user client set background compiereplaf getfieldbackground error a dialog error m windowno this not unique l user client get text f user client request focus return false f user client set background compiereplaf getfieldbackground normal sql update ad user set created by 0 where name f user org get text if db execute update sql null 0 f user client get text equals f user org get text f user org set background compiereplaf getfieldbackground error a dialog error m windowno this not unique l user org get text f user org request focus return false f user org set background compiereplaf getfieldbackground normal return true createsetup fclientname settext fclientname gettext fclientname settext fclientname gettext forgname settext forgname gettext forgname settext forgname gettext fuserclient settext fuserclient gettext fuserclient settext fuserclient gettext fuserorg settext fuserorg gettext fuserorg settext fuserorg gettext ad_client createdby fclientname gettext executeupdate fclientname setbackground getfieldbackground_error adialog m_windowno notunique lclientname gettext fclientname requestfocus fclientname setbackground getfieldbackground_normal ad_org createdby forgname gettext executeupdate forgname setbackground getfieldbackground_error adialog m_windowno notunique lorgname gettext forgname setbackground getfieldbackground_normal ad_user createdby fuserclient gettext executeupdate fuserclient setbackground getfieldbackground_error adialog m_windowno notunique luserclient gettext fuserclient requestfocus fuserclient setbackground getfieldbackground_normal ad_user createdby fuserorg gettext executeupdate fuserclient gettext fuserorg gettext fuserorg setbackground getfieldbackground_error adialog m_windowno notunique luserorg gettext fuserorg requestfocus fuserorg setbackground getfieldbackground_normal create setup batch part if done disposes window public void run m setup ms new m setup env get ctx m windowno m frame set busy timer 45 step 1 boolean ok ms create client f client name get text f org name get text f user client get text f user org get text string info ms get info if ok generate accounting key name pair currency key name pair f currency get selected item if ms create accounting currency f product is selected fb partner is selected f project is selected fm campaign is selected fs region is selected m file a dialog error m windowno this account setup error dispose generate entities key name pair p key name pair f country get selected item int c country id p get key p key name pair f region get selected item int c region id p get key ms create entities c country id f city get text c region id currency get key info ms get info create print documents print util setup print form ms getad client id a dialog info m windowno this v setup info dispose msetup msetup getctx m_windowno m_frame setbusytimer createclient fclientname gettext forgname gettext fuserclient gettext fuserorg gettext getinfo keynamepair keynamepair fcurrency getselecteditem createaccounting fproduct isselected fbpartner isselected fproject isselected fmcampaign isselected fsregion isselected m_file adialog m_windowno accountsetuperror keynamepair keynamepair fcountry getselecteditem c_country_id getkey keynamepair fregion getselecteditem c_region_id getkey createentities c_country_id fcity gettext c_region_id getkey getinfo printutil setupprintform getad_client_id adialog m_windowno vsetup prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bp group id p c bp group id para i get parameter as int else if name equals c acctschema id p c acctschema id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bp_group_id p_c_bp_group_id getparameterasint c_acctschema_id p_c_acctschema_id getparameterasint process return message throws exception protected string do it throws exception log info c acctschema id p c acctschema id if p c acctschema id 0 throw new compiere system error c acctschema id 0 m acct schema as m acct schema get get ctx p c acctschema id if as get id 0 throw new compiere system error not found c acctschema id p c acctschema id string sql null int updated 0 int created 0 int updated total 0 int created total 0 update existing customers sql update c bp customer acct ca set c receivable acct c receivable services acct c prepayment acct select c receivable acct c receivable services acct c prepayment acct from c bp group acct where c bp group id p c bp group id and c acctschema id p c acctschema id updated sys date updated by 0 where ca c acctschema id p c acctschema id and exists select from c bpartner p where p c bpartner id ca c bpartner id and p c bp group id p c bp group id updated db execute update sql get trxname add log 0 null new big decimal updated updated c bpartner id is customer updated total updated insert new customer sql insert into c bp customer acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by c receivable acct c receivable services acct c prepayment acct select p c bpartner id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct c receivable acct acct c receivable services acct acct c prepayment acct from c bpartner p inner join c bp group acct acct on acct c bp group id p c bp group id where acct c acctschema id p c acctschema id and p c bp group id p c bp group id and not exists select from c bp customer acct ca where ca c bpartner id p c bpartner id and ca c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created c bpartner id is customer created total created update existing vendors sql update c bp vendor acct va set v liability acct v liability services acct v prepayment acct select v liability acct v liability services acct v prepayment acct from c bp group acct where c bp group id p c bp group id and c acctschema id p c acctschema id updated sys date updated by 0 where va c acctschema id p c acctschema id and exists select from c bpartner p where p c bpartner id va c bpartner id and p c bp group id p c bp group id updated db execute update sql get trxname add log 0 null new big decimal updated updated c bpartner id is vendor updated total updated insert new vendors sql insert into c bp vendor acct c bpartner id c acctschema id ad client id ad org id is active created created by updated updated by v liability acct v liability services acct v prepayment acct select p c bpartner id acct c acctschema id p ad client id p ad org id y sys date 0 sys date 0 acct v liability acct acct v liability services acct acct v prepayment acct from c bpartner p inner join c bp group acct acct on acct c bp group id p c bp group id where acct c acctschema id p c acctschema id and p c bp group id p c bp group id and not exists select from c bp vendor acct va where va c bpartner id p c bpartner id and va c acctschema id acct c acctschema id created db execute update sql get trxname add log 0 null new big decimal created created c bpartner id is vendor created total created return created created total updated updated total doit c_acctschema_id p_c_acctschema_id p_c_acctschema_id compieresystemerror c_acctschema_id macctschema macctschema getctx p_c_acctschema_id get_id compieresystemerror c_acctschema_id p_c_acctschema_id updatedtotal createdtotal c_bp_customer_acct c_receivable_acct c_receivable_services_acct c_prepayment_acct c_receivable_acct c_receivable_services_acct c_prepayment_acct c_bp_group_acct c_bp_group_id p_c_bp_group_id c_acctschema_id p_c_acctschema_id sysdate updatedby c_acctschema_id p_c_acctschema_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_c_bp_group_id executeupdate get_trxname addlog bigdecimal c_bpartner_id iscustomer updatedtotal c_bp_customer_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby c_receivable_acct c_receivable_services_acct c_prepayment_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate c_receivable_acct c_receivable_services_acct c_prepayment_acct c_bpartner c_bp_group_acct c_bp_group_id c_bp_group_id c_acctschema_id p_c_acctschema_id c_bp_group_id p_c_bp_group_id c_bp_customer_acct c_bpartner_id c_bpartner_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal c_bpartner_id iscustomer createdtotal c_bp_vendor_acct v_liability_acct v_liability_services_acct v_prepayment_acct v_liability_acct v_liability_services_acct v_prepayment_acct c_bp_group_acct c_bp_group_id p_c_bp_group_id c_acctschema_id p_c_acctschema_id sysdate updatedby c_acctschema_id p_c_acctschema_id c_bpartner c_bpartner_id c_bpartner_id c_bp_group_id p_c_bp_group_id executeupdate get_trxname addlog bigdecimal c_bpartner_id isvendor updatedtotal c_bp_vendor_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby v_liability_acct v_liability_services_acct v_prepayment_acct c_bpartner_id c_acctschema_id ad_client_id ad_org_id sysdate sysdate v_liability_acct v_liability_services_acct v_prepayment_acct c_bpartner c_bp_group_acct c_bp_group_id c_bp_group_id c_acctschema_id p_c_acctschema_id c_bp_group_id p_c_bp_group_id c_bp_vendor_acct c_bpartner_id c_bpartner_id c_acctschema_id c_acctschema_id executeupdate get_trxname addlog bigdecimal c_bpartner_id isvendor createdtotal createdtotal updatedtotal get content return content public object get contents return contents getcontents prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bpartner id m c bpartner id para i get parameter as int else if name equals date report m datefrom timestamp para i get parameter m dateto timestamp para i getparameter to else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter c_bpartner_id m_c_bpartner_id getparameterasint datereport m_datefrom getparameter m_dateto getparameter_to perform process return message clear text throws exception if not successful protected string do it throws java lang exception string buffer sql new string buffer select from s timeexpense e where e processed y and e ad client id 1 if m c bpartner id 0 sql append and e c bpartner id 2 if m datefrom null sql append and e date report 3 if m dateto null sql append and e date report 4 sql append and exists select from s timeexpenseline el where e s timeexpense id el s timeexpense id and el c invoiceline id is null and el converted amt 0 order by e c bpartner id e s timeexpense id int old bpartner id 1 m invoice invoice null prepared statement pstmt null try pstmt db prepare statement sql to string get trxname int par 1 pstmt set int par getad client id if m c bpartner id 0 pstmt set int par m c bpartner id if m datefrom null pstmt set timestamp par m datefrom if m dateto null pstmt set timestamp par m dateto result set rs pstmt execute query while rs next expense line loop m time expense te new m time expense get ctx rs get trxname new b partner new order if te getc bpartner id old bpartner id complete invoice invoice mb partner bp new mb partner get ctx te getc bpartner id get trxname log info new invoice for bp invoice new m invoice get ctx 0 null invoice set client org te getad client id te getad org id invoice setc doctypetarget id m doc type docbasetype apinvoice api invoice set document no te get document no invoice setb partner bp if invoice getc bpartner location id 0 log log level severe no bp location bp add log 0 te get date report null no location te get document no bp get name invoice null break invoice setm pricelist id te getm pricelist id invoice setsalesrep id te getdoc user id string descr msg translate get ctx s timeexpense id te get document no display type get date format display type date format te get date report invoice set description descr if invoice save new illegal state exception cannot save invoice old bpartner id bp getc bpartner id m time expense line tel te get lines false for int i 0 i tel length i m time expense line line tel i already invoiced or nothing to be reimbursed if line getc invoiceline id 0 env zero compare to line get qty reimbursed 0 env zero compare to line get price reimbursed 0 continue update header info if line getc activity id 0 line getc activity id invoice getc activity id invoice setc activity id line getc activity id if line getc campaign id 0 line getc campaign id invoice getc campaign id invoice setc campaign id line getc campaign id if line getc project id 0 line getc project id invoice getc project id invoice setc project id line getc project id if invoice save new illegal state exception cannot save invoice create order line m invoice line il new m invoice line invoice if line getm product id 0 il setm product id line getm product id true il set qty line get qty reimbursed entered invoiced il set description line get description il setc project id line getc project id il set price not really a list limit price for reimbursements il set price line get price reimbursed il set tax if il save new illegal state exception cannot save invoice line update tel line setc invoiceline id il getc invoiceline id line save for all expense lines expense line loop rs close pstmt close pstmt null catch exception e log log level severe sql to string e finally try if pstmt null pstmt close catch exception e pstmt null complete invoice invoice return created m noinvoices doit stringbuffer stringbuffer s_timeexpense ad_client_id m_c_bpartner_id c_bpartner_id m_datefrom datereport m_dateto datereport s_timeexpenseline s_timeexpense_id s_timeexpense_id c_invoiceline_id convertedamt c_bpartner_id s_timeexpense_id old_bpartner_id minvoice preparedstatement preparestatement tostring get_trxname setint getad_client_id m_c_bpartner_id setint m_c_bpartner_id m_datefrom settimestamp m_datefrom m_dateto settimestamp m_dateto resultset executequery mtimeexpense mtimeexpense getctx get_trxname bpartner getc_bpartner_id old_bpartner_id completeinvoice mbpartner mbpartner getctx getc_bpartner_id get_trxname minvoice getctx setclientorg getad_client_id getad_org_id setc_doctypetarget_id mdoctype docbasetype_apinvoice setdocumentno getdocumentno setbpartner getc_bpartner_location_id addlog getdatereport getdocumentno getname setm_pricelist_id getm_pricelist_id setsalesrep_id getdoc_user_id getctx s_timeexpense_id getdocumentno displaytype getdateformat displaytype getdatereport setdescription illegalstateexception old_bpartner_id getc_bpartner_id mtimeexpenseline getlines mtimeexpenseline getc_invoiceline_id compareto getqtyreimbursed compareto getpricereimbursed getc_activity_id getc_activity_id getc_activity_id setc_activity_id getc_activity_id getc_campaign_id getc_campaign_id getc_campaign_id setc_campaign_id getc_campaign_id getc_project_id getc_project_id getc_project_id setc_project_id getc_project_id illegalstateexception orderline minvoiceline minvoiceline getm_product_id setm_product_id getm_product_id setqty getqtyreimbursed setdescription getdescription setc_project_id getc_project_id setprice setprice getpricereimbursed settax illegalstateexception setc_invoiceline_id getc_invoiceline_id tostring completeinvoice m_noinvoices complete invoice param invoice invoice private void complete invoice m invoice invoice if invoice null return invoice set doc action doc action action prepare invoice process it doc action action prepare if invoice save new illegal state exception cannot save invoice m noinvoices add log invoice get id invoice get date invoiced invoice get grand total invoice get document no completeinvoice minvoice setdocaction docaction action_prepare processit docaction action_prepare illegalstateexception m_noinvoices addlog get_id getdateinvoiced getgrandtotal getdocumentno prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals delete old p deleteold y equals para i get parameter else log log level severe unknown parameter name p c taxdeclaration id getrecord id processinfoparameter getparameter getparametername getparameter deleteold p_deleteold getparameter p_c_taxdeclaration_id getrecord_id process return info throws exception protected string do it throws exception log info c taxdeclaration id p c taxdeclaration id m td new m tax declaration get ctx p c taxdeclaration id get trxname if m td get id 0 throw new compiere system error not dound c taxdeclaration id p c taxdeclaration id if p deleteold delete old string sql delete c taxdeclarationline where c taxdeclaration id int no db execute update sql p c taxdeclaration id false get trxname if no 0 log config delete line no sql delete c taxdeclarationacct where c taxdeclaration id no db execute update sql p c taxdeclaration id false get trxname if no 0 log config delete acct no get invoices string sql select from c invoice i where trunc i date invoiced and trunc i date invoiced and processed y and not exists select from c taxdeclarationline tdl where i c invoice id tdl c invoice id prepared statement pstmt null int no invoices 0 try pstmt db prepare statement sql get trxname pstmt set timestamp 1 m td get date from pstmt set timestamp 2 m td get date to result set rs pstmt execute query while rs next create new m invoice get ctx rs null no lock no invoices rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return c invoice id no invoices m nolines m noaccts doit c_taxdeclaration_id p_c_taxdeclaration_id m_td mtaxdeclaration getctx p_c_taxdeclaration_id get_trxname m_td get_id compieresystemerror notdound c_taxdeclaration_id p_c_taxdeclaration_id p_deleteold c_taxdeclarationline c_taxdeclaration_id executeupdate p_c_taxdeclaration_id get_trxname c_taxdeclarationacct c_taxdeclaration_id executeupdate p_c_taxdeclaration_id get_trxname c_invoice dateinvoiced dateinvoiced c_taxdeclarationline c_invoice_id c_invoice_id preparedstatement noinvoices preparestatement get_trxname settimestamp m_td getdatefrom settimestamp m_td getdateto resultset executequery minvoice getctx noinvoices c_invoice_id noinvoices m_nolines m_noaccts create data param invoice invoice private void create m invoice invoice lines m invoice line lines invoice get lines for int i 0 i lines length i m invoice line line lines i if line is description continue m tax declaration line tdl new m tax declaration line m td invoice line tdl set line m nolines 1 10 if tdl save m nolines invoice tax m invoice tax taxes invoice get taxes false for int i 0 i taxes length i m invoice tax t line taxes i m tax declaration line tdl new m tax declaration line m td invoice t line tdl set line m nolines 1 10 if tdl save m nolines acct string sql select from fact acct where ad table id and record id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m invoice table id pstmt set int 2 invoice getc invoice id result set rs pstmt execute query while rs next m fact acct fact new m fact acct get ctx rs null no lock m tax declaration acct tda new m tax declaration acct m td fact tda set line m noaccts 1 10 if tda save m noaccts rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null minvoice minvoiceline getlines minvoiceline isdescription mtaxdeclarationline mtaxdeclarationline m_td setline m_nolines m_nolines minvoicetax gettaxes minvoicetax tline mtaxdeclarationline mtaxdeclarationline m_td tline setline m_nolines m_nolines fact_acct ad_table_id record_id preparedstatement preparestatement setint minvoice table_id setint getc_invoice_id resultset executequery mfactacct mfactacct getctx mtaxdeclarationacct mtaxdeclarationacct m_td setline m_noaccts m_noaccts prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals is abort p isabort y equals para i get parameter else if name equals ad user id p ad user id para i get parameter as int else if name equals ad wf responsible id p ad wf responsible id para i get parameter as int else log log level severe unknown parameter name p ad wf activity id getrecord id processinfoparameter getparameter getparametername getparameter isabort p_isabort getparameter ad_user_id p_ad_user_id getparameterasint ad_wf_responsible_id p_ad_wf_responsible_id getparameterasint p_ad_wf_activity_id getrecord_id perform process return message variables are parsed throws exception if not successful protected string do it throws exception mwf activity activity new mwf activity get ctx p ad wf activity id get trxname log info do it activity m user user m user get get ctx getad user id abort if p isabort string msg user get name abort activity set text msg msg activity setad user id getad user id activity setwf state state engine state aborted return msg string msg null change user if p ad user id 0 activity getad user id p ad user id m user from m user get get ctx activity getad user id m user to m user get get ctx p ad user id msg user get name from get name to get name activity set text msg msg activity setad user id p ad user id change responsible if p ad wf responsible id 0 activity getad wf responsible id p ad wf responsible id mwf responsible from mwf responsible get get ctx activity getad wf responsible id mwf responsible to mwf responsible get get ctx p ad wf responsible id string msg1 user get name from get name to get name activity set text msg msg1 activity setad wf responsible id p ad wf responsible id if msg null msg msg1 else msg msg1 activity save return msg doit mwfactivity mwfactivity getctx p_ad_wf_activity_id get_trxname doit muser muser getctx getad_user_id p_isabort getname settextmsg setad_user_id getad_user_id setwfstate stateengine state_aborted p_ad_user_id getad_user_id p_ad_user_id muser muser getctx getad_user_id muser muser getctx p_ad_user_id getname getname getname settextmsg setad_user_id p_ad_user_id p_ad_wf_responsible_id getad_wf_responsible_id p_ad_wf_responsible_id mwfresponsible mwfresponsible getctx getad_wf_responsible_id mwfresponsible mwfresponsible getctx p_ad_wf_responsible_id getname getname getname settextmsg setad_wf_responsible_id p_ad_wf_responsible_id standard constructor public x ad system properties ctx int ad system id string trx name super ctx ad system id trx name if ad system id 0 setad system id 0 0 set info null set is allow statistics false set is auto error report true y set name null set password null set replication type null l set system status null e set user name null set version null x_ad_system ad_system_id trxname ad_system_id trxname ad_system_id setad_system_id setinfo setisallowstatistics setisautoerrorreport setname setpassword setreplicationtype setsystemstatus setusername setversion load constructor public x ad system properties ctx result set rs string trx name super ctx rs trx name x_ad_system resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad system append get id append return sb to string tostring stringbuffer stringbuffer x_ad_system get_id tostring set system system definition public void setad system id int ad system id if ad system id 1 throw new illegal argument exception ad system id is mandatory set valuenocheck ad system id new integer ad system id setad_system_id ad_system_id ad_system_id illegalargumentexception ad_system_id set_valuenocheck ad_system_id ad_system_id get system system definition public int getad system id integer ii integer get value ad system id if ii null return 0 return ii int value getad_system_id get_value ad_system_id intvalue set custom prefix prefix for custom entities public void set custom prefix string custom prefix if custom prefix null custom prefix length 60 log warning length 60 truncated custom prefix custom prefix substring 0 59 set value custom prefix custom prefix setcustomprefix customprefix customprefix customprefix customprefix customprefix set_value customprefix customprefix get custom prefix prefix for custom entities public string get custom prefix return string get value custom prefix getcustomprefix get_value customprefix set db address jdbc url of the database server public void setdb address string db address if db address null db address length 255 log warning length 255 truncated db address db address substring 0 254 set value db address db address setdbaddress dbaddress dbaddress dbaddress dbaddress dbaddress set_value dbaddress dbaddress get db address jdbc url of the database server public string getdb address return string get value db address getdbaddress get_value dbaddress set database name database name public void setdb instance string db instance if db instance null db instance length 60 log warning length 60 truncated db instance db instance substring 0 59 set value db instance db instance setdbinstance dbinstance dbinstance dbinstance dbinstance dbinstance set_value dbinstance dbinstance get database name database name public string getdb instance return string get value db instance getdbinstance get_value dbinstance set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set encryption class encryption class used for securing data content public void set encryption key string encryption key if encryption key null encryption key length 255 log warning length 255 truncated encryption key encryption key substring 0 254 set valuenocheck encryption key encryption key setencryptionkey encryptionkey encryptionkey encryptionkey encryptionkey encryptionkey set_valuenocheck encryptionkey encryptionkey get encryption class encryption class used for securing data content public string get encryption key return string get value encryption key getencryptionkey get_value encryptionkey set id range end end if the id range used public void setid range end big decimal id range end set value id range end id range end setidrangeend bigdecimal idrangeend set_value idrangeend idrangeend get id range end end if the id range used public big decimal getid range end big decimal bd big decimal get value id range end if bd null return env zero return bd bigdecimal getidrangeend bigdecimal bigdecimal get_value idrangeend set id range start start of the id range used public void setid range start big decimal id range start set value id range start id range start setidrangestart bigdecimal idrangestart set_value idrangestart idrangestart get id range start start of the id range used public big decimal getid range start big decimal bd big decimal get value id range start if bd null return env zero return bd bigdecimal getidrangestart bigdecimal bigdecimal get_value idrangestart set info information public void set info string info if info null throw new illegal argument exception info is mandatory if info length 255 log warning length 255 truncated info info substring 0 254 set valuenocheck info info setinfo illegalargumentexception set_valuenocheck get info information public string get info return string get value info getinfo get_value set maintain statistics maintain general statistics public void set is allow statistics boolean is allow statistics set value is allow statistics new boolean is allow statistics setisallowstatistics isallowstatistics set_value isallowstatistics isallowstatistics get maintain statistics maintain general statistics public boolean is allow statistics object oo get value is allow statistics if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallowstatistics get_value isallowstatistics booleanvalue set error reporting automatically report errors public void set is auto error report boolean is auto error report set value is auto error report new boolean is auto error report setisautoerrorreport isautoerrorreport set_value isautoerrorreport isautoerrorreport get error reporting automatically report errors public boolean is auto error report object oo get value is auto error report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isautoerrorreport get_value isautoerrorreport booleanvalue set just migrated value set by migration for post migation tasks public void set is just migrated boolean is just migrated set value is just migrated new boolean is just migrated setisjustmigrated isjustmigrated set_value isjustmigrated isjustmigrated get just migrated value set by migration for post migation tasks public boolean is just migrated object oo get value is just migrated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isjustmigrated get_value isjustmigrated booleanvalue set ldap domain directory service domain name e g compiere org public void setldap domain string ldap domain if ldap domain null ldap domain length 255 log warning length 255 truncated ldap domain ldap domain substring 0 254 set value ldap domain ldap domain setldapdomain ldapdomain ldapdomain ldapdomain ldapdomain ldapdomain set_value ldapdomain ldapdomain get ldap domain directory service domain name e g compiere org public string getldap domain return string get value ldap domain getldapdomain get_value ldapdomain set ldap url connection string to ldap server starting with ldap public void setldap host string ldap host if ldap host null ldap host length 60 log warning length 60 truncated ldap host ldap host substring 0 59 set value ldap host ldap host setldaphost ldaphost ldaphost ldaphost ldaphost ldaphost set_value ldaphost ldaphost get ldap url connection string to ldap server starting with ldap public string getldap host return string get value ldap host getldaphost get_value ldaphost set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set processors number of database processors public void set no processors int no processors set value no processors new integer no processors setnoprocessors noprocessors set_value noprocessors noprocessors get processors number of database processors public int get no processors integer ii integer get value no processors if ii null return 0 return ii int value getnoprocessors get_value noprocessors intvalue set old name public void set old name string old name if old name null old name length 60 log warning length 60 truncated old name old name substring 0 59 set valuenocheck old name old name setoldname oldname oldname oldname oldname oldname set_valuenocheck oldname oldname get old name public string get old name return string get value old name getoldname get_value oldname set password password of any length case sensitive public void set password string password if password null throw new illegal argument exception password is mandatory if password length 20 log warning length 20 truncated password password substring 0 19 set value password password setpassword illegalargumentexception set_value get password password of any length case sensitive public string get password return string get value password getpassword get_value set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set profile information to help profiling the system for solving support issues public void set profile info string profile info if profile info null profile info length 60 log warning length 60 truncated profile info profile info substring 0 59 set valuenocheck profile info profile info setprofileinfo profileinfo profileinfo profileinfo profileinfo profileinfo set_valuenocheck profileinfo profileinfo get profile information to help profiling the system for solving support issues public string get profile info return string get value profile info getprofileinfo get_value profileinfo set record id direct internal record id public void setrecord id int record id if record id 0 set value record id null else set value record id new integer record id setrecord_id record_id record_id set_value record_id set_value record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set release no internal release number public void set release no string release no if release no null release no length 4 log warning length 4 truncated release no release no substring 0 3 set valuenocheck release no release no setreleaseno releaseno releaseno releaseno releaseno releaseno set_valuenocheck releaseno releaseno get release no internal release number public string get release no return string get value release no getreleaseno get_value releaseno public static final string replicationtype reference r set replication type type of data replication public void set replication type string replication type if replication type null throw new illegal argument exception replication type is mandatory if replication type equals l replication type equals m replication type equals r else throw new illegal argument exception replication type invalid value replication type reference id 126 l m r if replication type length 1 log warning length 1 truncated replication type replication type substring 0 0 set value replication type replication type replicationtype_reference setreplicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype replicationtype replicationtype illegalargumentexception replicationtype replicationtype reference_id replicationtype replicationtype replicationtype set_value replicationtype replicationtype get replication type type of data replication public string get replication type return string get value replication type getreplicationtype get_value replicationtype set statistics information to help profiling the system for solving support issues public void set statistics info string statistics info if statistics info null statistics info length 60 log warning length 60 truncated statistics info statistics info substring 0 59 set valuenocheck statistics info statistics info setstatisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo statisticsinfo set_valuenocheck statisticsinfo statisticsinfo get statistics information to help profiling the system for solving support issues public string get statistics info return string get value statistics info getstatisticsinfo get_value statisticsinfo set summary textual summary of this request public void set summary string summary if summary null summary length 255 log warning length 255 truncated summary summary substring 0 254 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set support e mail e mail address to send support information and updates to public void set supporte mail string supporte mail if supporte mail null supporte mail length 60 log warning length 60 truncated supporte mail supporte mail substring 0 59 set value supporte mail supporte mail email email setsupportemail supportemail supportemail supportemail supportemail supportemail set_value supportemail supportemail get support e mail e mail address to send support information and updates to public string get supporte mail return string get value supporte mail email email getsupportemail get_value supportemail set support expires date when the compiere support expires public void set support exp date timestamp support exp date set valuenocheck support exp date support exp date setsupportexpdate supportexpdate set_valuenocheck supportexpdate supportexpdate get support expires date when the compiere support expires public timestamp get support exp date return timestamp get value support exp date getsupportexpdate get_value supportexpdate set internal users number of internal users for com piere support public void set support units int support units set valuenocheck support units new integer support units compiere setsupportunits supportunits set_valuenocheck supportunits supportunits get internal users number of internal users for com piere support public int get support units integer ii integer get value support units if ii null return 0 return ii int value compiere getsupportunits get_value supportunits intvalue public static final string systemstatus production p set system status status of the system support priority depends on system status public void set system status string system status if system status null throw new illegal argument exception system status is mandatory if system status equals e system status equals i system status equals p else throw new illegal argument exception system status invalid value system status reference id 374 e i p if system status length 1 log warning length 1 truncated system status system status substring 0 0 set value system status system status systemstatus_production setsystemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus systemstatus systemstatus illegalargumentexception systemstatus systemstatus reference_id systemstatus systemstatus systemstatus set_value systemstatus systemstatus get system status status of the system support priority depends on system status public string get system status return string get value system status getsystemstatus get_value systemstatus set registered e mail email of the responsible for the system public void set user name string user name if user name null throw new illegal argument exception user name is mandatory if user name length 60 log warning length 60 truncated user name user name substring 0 59 set value user name user name email setusername username username illegalargumentexception username username username username set_value username username get registered e mail email of the responsible for the system public string get user name return string get value user name email getusername get_value username set version version of the table definition public void set version string version if version null throw new illegal argument exception version is mandatory if version length 20 log warning length 20 truncated version version substring 0 19 set valuenocheck version version setversion illegalargumentexception set_valuenocheck get version version of the table definition public string get version return string get value version getversion get_value constructor param pos panel pos panel public pos sub panel pos panel pos panel super p pospanel pos panel p pos pos panel p pos init pospanel possubpanel pospanel pospanel p_pospanel pospanel p_pos pospanel p_pos public static insets insets2 new insets 2 2 2 2 initialize protected abstract void init get panel position protected grid bag constraints get grid bag constraints if p position null p position new grid bag constraints p position anchor grid bag constraints northwest p position fill grid bag constraints both p position weightx 0 1 p position weighty 0 1 return p position gridbagconstraints getgridbagconstraints p_position p_position gridbagconstraints p_position gridbagconstraints p_position gridbagconstraints p_position p_position p_position dispose free resources public void dispose p pos null p_pos create action button param action action return button protected c button create button action string action key stroke accelerator apps action act new apps action action accelerator false act set delegate this c button button c button act get button button set preferred size new dimension width height button set minimum size get preferred size button set maximum size get preferred size button set focusable false return button cbutton createbuttonaction keystroke appsaction appsaction setdelegate cbutton cbutton getbutton setpreferredsize setminimumsize getpreferredsize setmaximumsize getpreferredsize setfocusable create standard button param text text return button protected c button create button string text if text index of html 1 text html h4 text h4 html c button button new c button text button add action listener this button set preferred size new dimension width height button set minimum size get preferred size button set maximum size get preferred size button set focusable false return button cbutton createbutton indexof cbutton cbutton addactionlistener setpreferredsize setminimumsize getpreferredsize setmaximumsize getpreferredsize setfocusable action listener param e event public void action performed action event e actionperformed actionevent standard constructor public x c allocationline properties ctx int c allocationline id string trx name super ctx c allocationline id trx name if c allocationline id 0 set amount env zero setc allocationhdr id 0 setc allocationline id 0 set discount amt env zero set write off amt env zero x_c_allocationline c_allocationline_id trxname c_allocationline_id trxname c_allocationline_id setamount setc_allocationhdr_id setc_allocationline_id setdiscountamt setwriteoffamt load constructor public x c allocationline properties ctx result set rs string trx name super ctx rs trx name x_c_allocationline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c allocationline append get id append return sb to string tostring stringbuffer stringbuffer x_c_allocationline get_id tostring set amount amount in a defined currency public void set amount big decimal amount if amount null throw new illegal argument exception amount is mandatory set valuenocheck amount amount setamount bigdecimal illegalargumentexception set_valuenocheck get amount amount in a defined currency public big decimal get amount big decimal bd big decimal get value amount if bd null return env zero return bd bigdecimal getamount bigdecimal bigdecimal get_value set allocation payment allocation public void setc allocationhdr id int c allocationhdr id if c allocationhdr id 1 throw new illegal argument exception c allocationhdr id is mandatory set valuenocheck c allocationhdr id new integer c allocationhdr id setc_allocationhdr_id c_allocationhdr_id c_allocationhdr_id illegalargumentexception c_allocationhdr_id set_valuenocheck c_allocationhdr_id c_allocationhdr_id get allocation payment allocation public int getc allocationhdr id integer ii integer get value c allocationhdr id if ii null return 0 return ii int value getc_allocationhdr_id get_value c_allocationhdr_id intvalue set allocation line allocation line public void setc allocationline id int c allocationline id if c allocationline id 1 throw new illegal argument exception c allocationline id is mandatory set valuenocheck c allocationline id new integer c allocationline id setc_allocationline_id c_allocationline_id c_allocationline_id illegalargumentexception c_allocationline_id set_valuenocheck c_allocationline_id c_allocationline_id get allocation line allocation line public int getc allocationline id integer ii integer get value c allocationline id if ii null return 0 return ii int value getc_allocationline_id get_value c_allocationline_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set valuenocheck c bpartner id null else set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_valuenocheck c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set cash journal line cash journal line public void setc cashline id int c cashline id if c cashline id 0 set valuenocheck c cashline id null else set valuenocheck c cashline id new integer c cashline id setc_cashline_id c_cashline_id c_cashline_id set_valuenocheck c_cashline_id set_valuenocheck c_cashline_id c_cashline_id get cash journal line cash journal line public int getc cashline id integer ii integer get value c cashline id if ii null return 0 return ii int value getc_cashline_id get_value c_cashline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoice id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoice_id set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set valuenocheck c payment id null else set valuenocheck c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_valuenocheck c_payment_id set_valuenocheck c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set transaction date transaction date public void set date trx timestamp date trx set valuenocheck date trx date trx setdatetrx datetrx set_valuenocheck datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set discount amount calculated amount of discount public void set discount amt big decimal discount amt if discount amt null throw new illegal argument exception discount amt is mandatory set valuenocheck discount amt discount amt setdiscountamt bigdecimal discountamt discountamt illegalargumentexception discountamt set_valuenocheck discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set manual this is a manual process public void set is manual boolean is manual set valuenocheck is manual new boolean is manual setismanual ismanual set_valuenocheck ismanual ismanual get manual this is a manual process public boolean is manual object oo get value is manual if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismanual get_value ismanual booleanvalue set over under payment over payment unallocated or under payment partial payment amount public void set over under amt big decimal over under amt set value over under amt over under amt setoverunderamt bigdecimal overunderamt set_value overunderamt overunderamt get over under payment over payment unallocated or under payment partial payment amount public big decimal get over under amt big decimal bd big decimal get value over under amt if bd null return env zero return bd bigdecimal getoverunderamt bigdecimal bigdecimal get_value overunderamt set write off amount amount to write off public void set write off amt big decimal write off amt if write off amt null throw new illegal argument exception write off amt is mandatory set valuenocheck write off amt write off amt setwriteoffamt bigdecimal writeoffamt writeoffamt illegalargumentexception writeoffamt set_valuenocheck writeoffamt writeoffamt get write off amount amount to write off public big decimal get write off amt big decimal bd big decimal get value write off amt if bd null return env zero return bd bigdecimal getwriteoffamt bigdecimal bigdecimal get_value writeoffamt get achieved achievements of measure param measure measure return array of achievements public static m achievement get m measure measure return get of measure measure get ctx measure getpa measure id machievement mmeasure getofmeasure getctx getpa_measure_id get achieved achievements of measure param ctx context param pa measure id measure id return array of achievements public static m achievement get of measure properties ctx int pa measure id array list m achievement list new array list m achievement string sql select from pa achievement where pa measure id and is achieved y order by seq no date doc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 pa measure id result set rs pstmt execute query while rs next list add new m achievement ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m achievement ret value new m achievement list size list to array ret value return ret value pa_measure_id machievement getofmeasure pa_measure_id arraylist machievement arraylist machievement pa_achievement pa_measure_id isachieved seqno datedoc preparedstatement preparestatement setint pa_measure_id resultset executequery machievement s_log machievement retvalue machievement toarray retvalue retvalue standard constructor param ctx context param pa achievement id id param trx name trx public m achievement properties ctx int pa achievement id string trx name super ctx pa achievement id trx name pa_achievement_id trxname machievement pa_achievement_id trxname pa_achievement_id trxname load constructor param ctx context param rs result set param trx name trx public m achievement properties ctx result set rs string trx name super ctx rs trx name trxname machievement resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m achievement sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer machievement get_id getname tostring before save param new record new return true protected boolean before save boolean new record if is achieved if get manual actual signum 0 set manual actual env one if get date doc null set date doc new timestamp system current time millis return true newrecord beforesave newrecord isachieved getmanualactual setmanualactual getdatedoc setdatedoc currenttimemillis after save param new record new param success success return success protected boolean after save boolean new record boolean success if success update achievement goals return success newrecord aftersave newrecord updateachievementgoals after delete param success success return success protected boolean after delete boolean success if success update achievement goals return success afterdelete updateachievementgoals update goals with achievement private void update achievement goals m measure measure m measure get get ctx getpa measure id measure update goals updateachievementgoals mmeasure mmeasure getctx getpa_measure_id updategoals get compiere server manager return mgr public static compiere server mgr get if m servermgr null for faster subsequent calls m servermgr new compiere server mgr m servermgr start servers m servermgr log info m servermgr to string return m servermgr compiereservermgr m_servermgr m_servermgr compiereservermgr m_servermgr startservers m_servermgr m_servermgr tostring m_servermgr compiere server manager private compiere server mgr super start environment m servermgr start servers compiereservermgr startenvironment m_servermgr startservers start environment return true if started private boolean start environment compiere startup false log info set session m session session m session get get ctx true session set web store session false session set web session server session save return true startenvironment msession msession getctx setwebstoresession setwebsession start environment return true if started private boolean start servers log info int no servers 0 accounting m acct processor acct models m acct processor get active m ctx for int i 0 i acct models length i m acct processor p model acct models i compiere server server compiere server create p model server start server set priority thread norm priority 2 m servers add server request m request processor request models m request processor get active m ctx for int i 0 i request models length i m request processor p model request models i compiere server server compiere server create p model server start server set priority thread norm priority 2 m servers add server workflow m workflow processor workflow models m workflow processor get active m ctx for int i 0 i workflow models length i m workflow processor p model workflow models i compiere server server compiere server create p model server start server set priority thread norm priority 2 m servers add server alert m alert processor alert models m alert processor get active m ctx for int i 0 i alert models length i m alert processor p model alert models i compiere server server compiere server create p model server start server set priority thread norm priority 2 m servers add server scheduler m scheduler scheduler models m scheduler get active m ctx for int i 0 i scheduler models length i m scheduler p model scheduler models i compiere server server compiere server create p model server start server set priority thread norm priority 2 m servers add server log fine no servers return start all startservers noservers macctprocessor acctmodels macctprocessor getactive m_ctx acctmodels macctprocessor pmodel acctmodels compiereserver compiereserver pmodel setpriority norm_priority m_servers mrequestprocessor requestmodels mrequestprocessor getactive m_ctx requestmodels mrequestprocessor pmodel requestmodels compiereserver compiereserver pmodel setpriority norm_priority m_servers mworkflowprocessor workflowmodels mworkflowprocessor getactive m_ctx workflowmodels mworkflowprocessor pmodel workflowmodels compiereserver compiereserver pmodel setpriority norm_priority m_servers malertprocessor alertmodels malertprocessor getactive m_ctx alertmodels malertprocessor pmodel alertmodels compiereserver compiereserver pmodel setpriority norm_priority m_servers mscheduler schedulermodels mscheduler getactive m_ctx schedulermodels mscheduler pmodel schedulermodels compiereserver compiereserver pmodel setpriority norm_priority m_servers noservers startall get server context return ctx public properties get ctx return m ctx getctx m_ctx start all servers return true if started public boolean start all log info compiere server servers get in active for int i 0 i servers length i compiere server server servers i try if server is alive continue wait until dead if server is interrupted int max wait 10 10 iterations 1 sec while server is alive if max wait 0 log severe wait timeout for interruped server break try thread sleep 100 1 10 sec catch interrupted exception e log log level severe while sleeping e do start if server is alive replace server compiere server create server get model if server null m servers remove i else m servers set i server server start server set priority thread norm priority 2 catch exception e log log level severe server server e for all servers final check int no running 0 int no stopped 0 for int i 0 i servers length i compiere server server servers i try if server is alive log info alive server no running else log warning dead server no stopped catch exception e log log level severe checking server e no stopped log fine running no running stopped no stopped compiere server group get dump return no stopped 0 startall compiereserver getinactive compiereserver isalive isinterrupted maxwait isalive maxwait interruptedexception isalive compiereserver getmodel m_servers m_servers setpriority norm_priority norunning nostopped compiereserver isalive norunning nostopped nostopped norunning nostopped compiereservergroup nostopped start server if not started yet return true if started public boolean start string serverid compiere server server get server serverid if server null return false if server is alive return true try replace int index m servers index of server server compiere server create server get model if server null m servers remove index else m servers set index server server start server set priority thread norm priority 2 thread yield catch exception e log log level severe server serverid e return false log info server to string compiere server group get dump if server null return false return server is alive compiereserver getserver isalive m_servers indexof compiereserver getmodel m_servers m_servers setpriority norm_priority tostring compiereservergroup isalive stop all servers return true if stopped public boolean stop all log info compiere server servers get active interrupt for int i 0 i servers length i compiere server server servers i try if server is alive server is interrupted server set priority thread max priority 1 server interrupt catch exception e log log level severe interrupting server e for all servers thread yield wait for death for int i 0 i servers length i compiere server server servers i try int max wait 10 10 iterations 1 sec while server is alive if max wait 0 log severe wait timeout for interruped server break thread sleep 100 1 10 catch exception e log log level severe waiting server e for all servers final check int no running 0 int no stopped 0 for int i 0 i servers length i compiere server server servers i try if server is alive log warning alive server no running else log info stopped server no stopped catch exception e log log level severe checking server e no running log fine running no running stopped no stopped compiere server group get dump return no running 0 stopall compiereserver getactive compiereserver isalive isinterrupted setpriority max_priority compiereserver maxwait isalive maxwait norunning nostopped compiereserver isalive norunning nostopped norunning norunning nostopped compiereservergroup norunning stop server if not stopped return true if interrupted public boolean stop string serverid compiere server server get server serverid if server null return false if server is alive return true try server interrupt thread sleep 10 1 100 sec catch exception e log log level severe stop e return false log info server to string compiere server group get dump return server is alive compiereserver getserver isalive tostring compiereservergroup isalive destroy public void destroy log info stop all m servers clear stopall m_servers get active servers return array of active servers protected compiere server get active array list compiere server list new array list compiere server for int i 0 i m servers size i compiere server server compiere server m servers get i if server null server is alive server is interrupted list add server compiere server ret value new compiere server list size list to array ret value return ret value compiereserver getactive arraylist compiereserver arraylist compiereserver m_servers compiereserver compiereserver m_servers isalive isinterrupted compiereserver retvalue compiereserver toarray retvalue retvalue get in active servers return array of inactive servers protected compiere server get in active array list compiere server list new array list compiere server for int i 0 i m servers size i compiere server server compiere server m servers get i if server null server is alive server is interrupted list add server compiere server ret value new compiere server list size list to array ret value return ret value inactive compiereserver getinactive arraylist compiereserver arraylist compiereserver m_servers compiereserver compiereserver m_servers isalive isinterrupted compiereserver retvalue compiereserver toarray retvalue retvalue get all servers return array of servers public compiere server get all compiere server ret value new compiere server m servers size m servers to array ret value return ret value compiereserver getall compiereserver retvalue compiereserver m_servers m_servers toarray retvalue retvalue get server with id param serverid server id return server or null public compiere server get server string serverid if serverid null return null for int i 0 i m servers size i compiere server server compiere server m servers get i if serverid equals server get serverid return server return null compiereserver getserver m_servers compiereserver compiereserver m_servers getserverid string representation return info public string to string string buffer sb new string buffer compiere server mgr sb append servers append m servers size append context size append m ctx size append started append m start append return sb to string tostring stringbuffer stringbuffer compiereservermgr m_servers contextsize m_ctx m_start tostring get description return description public string get description return revision 1 11 getdescription get number servers return no of servers public string get server count int no running 0 int no stopped 0 for int i 0 i m servers size i compiere server server compiere server m servers get i if server is alive no running else no stopped string info string value of m servers size running no running stopped no stopped return info getservercount norunning nostopped m_servers compiereserver compiereserver m_servers isalive norunning nostopped valueof m_servers norunning nostopped get start date return start date public timestamp get start time return m start getstarttime m_start basic constructor public i basic constructor param element adds an element to the element public i element element add element element addelement basic constructor param element adds an element to the element public i string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public i add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public i add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public i add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public i add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public i remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get contents return context public object get contents return contents getcontents standard constructor public x ad field properties ctx int ad field id string trx name super ctx ad field id trx name if ad field id 0 setad column id 0 setad field id 0 setad tab id 0 set entity type null u set is centrally maintained true y set is displayed true y set is encrypted false set is field only false set is heading false set is read only false set is same line false set name null x_ad_field ad_field_id trxname ad_field_id trxname ad_field_id setad_column_id setad_field_id setad_tab_id setentitytype setiscentrallymaintained setisdisplayed setisencrypted setisfieldonly setisheading setisreadonly setissameline setname load constructor public x ad field properties ctx result set rs string trx name super ctx rs trx name x_ad_field resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad field append get id append return sb to string tostring stringbuffer stringbuffer x_ad_field get_id tostring set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set value ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_value ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set field group logical grouping of fields public void setad fieldgroup id int ad fieldgroup id if ad fieldgroup id 0 set value ad fieldgroup id null else set value ad fieldgroup id new integer ad fieldgroup id setad_fieldgroup_id ad_fieldgroup_id ad_fieldgroup_id set_value ad_fieldgroup_id set_value ad_fieldgroup_id ad_fieldgroup_id get field group logical grouping of fields public int getad fieldgroup id integer ii integer get value ad fieldgroup id if ii null return 0 return ii int value getad_fieldgroup_id get_value ad_fieldgroup_id intvalue set field field on a database table public void setad field id int ad field id if ad field id 1 throw new illegal argument exception ad field id is mandatory set valuenocheck ad field id new integer ad field id setad_field_id ad_field_id ad_field_id illegalargumentexception ad_field_id set_valuenocheck ad_field_id ad_field_id get field field on a database table public int getad field id integer ii integer get value ad field id if ii null return 0 return ii int value getad_field_id get_value ad_field_id intvalue set tab tab within a window public void setad tab id int ad tab id if ad tab id 1 throw new illegal argument exception ad tab id is mandatory set valuenocheck ad tab id new integer ad tab id setad_tab_id ad_tab_id ad_tab_id illegalargumentexception ad_tab_id set_valuenocheck ad_tab_id ad_tab_id get tab tab within a window public int getad tab id integer ii integer get value ad tab id if ii null return 0 return ii int value getad_tab_id get_value ad_tab_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set display length length of the display in characters public void set display length int display length set value display length new integer display length setdisplaylength displaylength set_value displaylength displaylength get display length length of the display in characters public int get display length integer ii integer get value display length if ii null return 0 return ii int value getdisplaylength get_value displaylength intvalue set display logic if the field is displayed the result determines if the field is actually displayed public void set display logic string display logic if display logic null display logic length 2000 log warning length 2000 truncated display logic display logic substring 0 1999 set value display logic display logic setdisplaylogic displaylogic displaylogic displaylogic displaylogic displaylogic set_value displaylogic displaylogic get display logic if the field is displayed the result determines if the field is actually displayed public string get display logic return string get value display logic getdisplaylogic get_value displaylogic public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set centrally maintained information maintained in system element table public void set is centrally maintained boolean is centrally maintained set value is centrally maintained new boolean is centrally maintained setiscentrallymaintained iscentrallymaintained set_value iscentrallymaintained iscentrallymaintained get centrally maintained information maintained in system element table public boolean is centrally maintained object oo get value is centrally maintained if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscentrallymaintained get_value iscentrallymaintained booleanvalue set displayed determines if this field is displayed public void set is displayed boolean is displayed set value is displayed new boolean is displayed setisdisplayed isdisplayed set_value isdisplayed isdisplayed get displayed determines if this field is displayed public boolean is displayed object oo get value is displayed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdisplayed get_value isdisplayed booleanvalue set encrypted display or storage is encrypted public void set is encrypted boolean is encrypted set value is encrypted new boolean is encrypted setisencrypted isencrypted set_value isencrypted isencrypted get encrypted display or storage is encrypted public boolean is encrypted object oo get value is encrypted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isencrypted get_value isencrypted booleanvalue set field only label is not displayed public void set is field only boolean is field only set value is field only new boolean is field only setisfieldonly isfieldonly set_value isfieldonly isfieldonly get field only label is not displayed public boolean is field only object oo get value is field only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfieldonly get_value isfieldonly booleanvalue set heading only field without column only label is displayed public void set is heading boolean is heading set value is heading new boolean is heading setisheading isheading set_value isheading isheading get heading only field without column only label is displayed public boolean is heading object oo get value is heading if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isheading get_value isheading booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set same line displayed on same line as previous field public void set is same line boolean is same line set value is same line new boolean is same line setissameline issameline set_value issameline issameline get same line displayed on same line as previous field public boolean is same line object oo get value is same line if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issameline get_value issameline booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final string obscuretype obscurealphanumericbutfirstlast4 a44 set obscure type of obscuring the data limiting the display public void set obscure type string obscure type if obscure type null throw new illegal argument exception obscure type is mandatory if obscure type null obscure type equals 904 obscure type equals 944 obscure type equals a04 obscure type equals a44 else throw new illegal argument exception obscure type invalid value obscure type reference id 291 904 944 a04 a44 if obscure type null obscure type length 3 log warning length 3 truncated obscure type obscure type substring 0 2 set value obscure type obscure type obscuretype_obscurealphanumericbutfirstlast4 setobscuretype obscuretype obscuretype illegalargumentexception obscuretype obscuretype obscuretype obscuretype obscuretype obscuretype illegalargumentexception obscuretype obscuretype reference_id obscuretype obscuretype obscuretype obscuretype set_value obscuretype obscuretype get obscure type of obscuring the data limiting the display public string get obscure type return string get value obscure type getobscuretype get_value obscuretype set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set record sort no determines in what order the records are displayed public void set sort no big decimal sort no set value sort no sort no setsortno bigdecimal sortno set_value sortno sortno get record sort no determines in what order the records are displayed public big decimal get sort no big decimal bd big decimal get value sort no if bd null return env zero return bd bigdecimal getsortno bigdecimal bigdecimal get_value sortno get content return content public object get contents return contents getcontents creates a code label code instance with the specified text image and horizontal alignment the label is centered vertically in its display area the text is on the trailing edge of the image param text the text to be displayed by the label param icon the image to be displayed by the label param horizontal alignment one of the following constants defined in code swing constants code code left code code center code code right code code leading code or code trailing code public c label string text icon icon int horizontal alignment super text icon horizontal alignment init horizontalalignment swingconstants clabel horizontalalignment horizontalalignment creates a code label code instance with the specified text and horizontal alignment the label is centered vertically in its display area param text the text to be displayed by the label param horizontal alignment one of the following constants defined in code swing constants code code left code code center code code right code code leading code or code trailing code public c label string text int horizontal alignment super text horizontal alignment init horizontalalignment swingconstants clabel horizontalalignment horizontalalignment creates a code label code instance with the specified text the label is aligned against the leading edge of its display area and centered vertically param text the text to be displayed by the label public c label string text super text default alignment init clabel default_alignment creates a code label code instance with the specified image and horizontal alignment the label is centered vertically in its display area param image the image to be displayed by the label param horizontal alignment one of the following constants defined in code swing constants code code left code code center code code right code code leading code or code trailing code public c label icon image int horizontal alignment super image horizontal alignment init horizontalalignment swingconstants clabel horizontalalignment horizontalalignment creates a code label code instance with the specified image the label is centered vertically and horizontally in its display area param image the image to be displayed by the label public c label icon image super image default alignment init clabel default_alignment creates a code j label code instance with no image and with an empty string for the title the label is centered vertically in its display area the label s contents once set will be displayed on the leading edge of the label s display area public c label super default alignment init jlabel clabel default_alignment creates a code label code instance with the specified text the label is aligned against the leading edge of its display area and centered vertically param label the text to be displayed by the label param tool tip the optional tooltip text public c label string label string tool tip super label default alignment if tool tip null tool tip length 0 super set tool tip text tool tip init tooltip clabel tooltip default_alignment tooltip tooltip settooltiptext tooltip trailing label for field param label label param field field public c label string label component field this label trailing set label for field clabel setlabelfor common init private void init set focusable false set opaque false if get tool tip text null force tool tip set tool tip text get text set foreground compiereplaf gettextcolor label set font compiereplaf getfont label setfocusable setopaque gettooltiptext settooltiptext gettext setforeground gettextcolor_label setfont getfont_label set background param bg background public void set background color bg if bg equals get background return super set background bg setbackground getbackground setbackground set font to bold param bold true bold false normal public void set font bold boolean bold font font get font if bold font is bold font new font font get name bold font bold font plain font get size set font font setfontbold getfont isbold getname getsize setfont set label text if it includes the next character is the mnemonic param mnemonic label label containing mnemonic public void set text string mnemonic label string text create mnemonic mnemonic label super set text text if text null get name null set name text mnemoniclabel settext mnemoniclabel createmnemonic mnemoniclabel settext getname setname create mnemonics of text containing based on ms notation of help h is mnemonics param text test with mnemonics return text w o see j label set label for java awt component private string create mnemonic string text if text null return text int pos text index of if pos 1 we have a nemonic char ch text char at pos 1 if ch is the character set displayed mnemonic ch set saved mnemonic ch return text substring 0 pos text substring pos 1 return text jlabel setlabelfor createmnemonic indexof charat _ setdisplayedmnemonic setsavedmnemonic set read write param rw enabled public void set read write boolean rw this set enabled rw readwrite setreadwrite setenabled set label for param c component public void set label for component c super set label for c if c get name null c set name get name setlabelfor setlabelfor getname setname getname return returns the saved mnemonic public char get saved mnemonic return m savedmnemonic savedmnemonic getsavedmnemonic m_savedmnemonic param saved mnemonic the saved mnemonic to set public void set saved mnemonic char saved mnemonic m savedmnemonic saved mnemonic savedmnemonic savedmnemonic setsavedmnemonic savedmnemonic m_savedmnemonic savedmnemonic standard constructor param ctx context param c rfq topicsubscriberonly id id public m rfq topic subscriber only properties ctx int c rfq topicsubscriberonly id string trx name super ctx c rfq topicsubscriberonly id trx name c_rfq_topicsubscriberonly_id mrfqtopicsubscriberonly c_rfq_topicsubscriberonly_id trxname c_rfq_topicsubscriberonly_id trxname load constructor param ctx context param rs result set public m rfq topic subscriber only properties ctx result set rs string trx name super ctx rs trx name mrfqtopicsubscriberonly resultset trxname trxname prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad org id p ad org id para i get parameter as int else if name equals ad orgtype id p ad orgtype id para i get parameter as int else if name equals ad role id p ad role id para i get parameter as int else log log level severe prepare unknown parameter name p c bpartner id getrecord id processinfoparameter getparameter getparametername getparameter ad_org_id p_ad_org_id getparameterasint ad_orgtype_id p_ad_orgtype_id getparameterasint ad_role_id p_ad_role_id getparameterasint p_c_bpartner_id getrecord_id perform process return message text with variables throws exception if not successful protected string do it throws exception log info c bpartner id p c bpartner id ad org id p ad org id ad orgtype id p ad orgtype id ad role id p ad role id if p c bpartner id 0 throw new compiere user error no business partner id mb partner bp new mb partner get ctx p c bpartner id get trxname if bp get id 0 throw new compiere user error business partner not found c bpartner id p c bpartner id bp location mb partner location locs bp get locations false if locs null locs length 0 throw new illegal argument exception business partner has no location location int c location id locs 0 getc location id if c location id 0 throw new illegal argument exception business partner location has no address create org boolean new org p ad org id 0 m org org new m org get ctx p ad org id get trxname if new org org set value bp get value org set name bp get name org set description bp get description if org save throw new exception organization not saved else check if linked to already int c bpartner id org getlinkedc bpartner id if c bpartner id 0 throw new illegal argument exception organization org get name already linked to c bpartner id c bpartner id p ad org id org getad org id update org info m org info o info org get info o info setad orgtype id p ad orgtype id if new org o info setc location id c location id create warehouse m warehouse wh null if new org m warehouse whs m warehouse get for org get ctx p ad org id if whs null whs length 0 wh whs 0 pick first new warehouse if wh null wh new m warehouse org if wh save throw new exception warehouse not saved create locator m locator m loc wh get default locator if m loc null m loc new m locator wh standard m loc set is default true m loc save update save org info o info setm warehouse id wh getm warehouse id if o info save throw new exception organization info not saved update b partner bp setad orgbp id p ad org id if bp getad org id 0 bp set client org bp getad client id 0 shared b partner save bp if bp save throw new exception business partner not updated limit to specific role if p ad role id 0 boolean found false m role org access org accesses m role org access get of org get ctx p ad org id delete all accesses except the specific for int i 0 i org accesses length i if org accesses i getad role id p ad role id found true else org accesses i delete true create access if found m role org access org access new m role org access org p ad role id org access save reset client role m role get default get ctx true return business partner organization link created doit c_bpartner_id p_c_bpartner_id ad_org_id p_ad_org_id ad_orgtype_id p_ad_orgtype_id ad_role_id p_ad_role_id p_c_bpartner_id compiereusererror mbpartner mbpartner getctx p_c_bpartner_id get_trxname get_id compiereusererror c_bpartner_id p_c_bpartner_id mbpartnerlocation getlocations illegalargumentexception c_location_id getc_location_id c_location_id illegalargumentexception neworg p_ad_org_id morg morg getctx p_ad_org_id get_trxname neworg setvalue getvalue setname getname setdescription getdescription c_bpartner_id getlinkedc_bpartner_id c_bpartner_id illegalargumentexception getname c_bpartner_id c_bpartner_id p_ad_org_id getad_org_id morginfo oinfo getinfo oinfo setad_orgtype_id p_ad_orgtype_id neworg oinfo setc_location_id c_location_id mwarehouse neworg mwarehouse mwarehouse getfororg getctx p_ad_org_id mwarehouse mlocator mloc getdefaultlocator mloc mloc mlocator mloc setisdefault mloc oinfo setm_warehouse_id getm_warehouse_id oinfo bpartner setad_orgbp_id p_ad_org_id getad_org_id setclientorg getad_client_id bpartner p_ad_role_id mroleorgaccess orgaccesses mroleorgaccess getoforg getctx p_ad_org_id orgaccesses orgaccesses getad_role_id p_ad_role_id orgaccesses mroleorgaccess orgaccess mroleorgaccess p_ad_role_id orgaccess mrole getdefault getctx create confirmation or return existing one param move movement param check existing if false new confirmation is created return confirmation public static m movement confirm create m movement move boolean check existing if check existing m movement confirm confirmations move get confirmations false for int i 0 i confirmations length i m movement confirm confirm confirmations i return confirm m movement confirm confirm new m movement confirm move confirm save move get trxname m movement line move lines move get lines false for int i 0 i move lines length i m movement line m line move lines i m movement line confirm c line new m movement line confirm confirm c line set movement line m line c line save move get trxname return confirm checkexisting mmovementconfirm mmovement checkexisting checkexisting mmovementconfirm getconfirmations mmovementconfirm mmovementconfirm mmovementconfirm get_trxname mmovementline movelines getlines movelines mmovementline mline movelines mmovementlineconfirm cline mmovementlineconfirm cline setmovementline mline cline get_trxname standard constructor param ctx context param m movementconfirm id id public m movement confirm properties ctx int m movementconfirm id string trx name super ctx m movementconfirm id trx name if m movementconfirm id 0 setm movement id 0 set doc action docaction complete set doc status docstatus drafted set is approved false n set processed false m_movementconfirm_id mmovementconfirm m_movementconfirm_id trxname m_movementconfirm_id trxname m_movementconfirm_id setm_movement_id setdocaction docaction_complete setdocstatus docstatus_drafted setisapproved setprocessed load constructor param ctx context param rs result set public m movement confirm properties ctx result set rs string trx name super ctx rs trx name mmovementconfirm resultset trxname trxname parent constructor param move movement public m movement confirm m movement move this move get ctx 0 move get trxname set client org move setm movement id move getm movement id mmovementconfirm mmovement getctx get_trxname setclientorg setm_movement_id getm_movement_id get lines param requery requery return array of lines public m movement line confirm get lines boolean requery if m lines null requery return m lines string sql select from m movementlineconfirm where m movementconfirm id array list m movement line confirm list new array list m movement line confirm prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm movementconfirm id result set rs pstmt execute query while rs next list add new m movement line confirm get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m movement line confirm list size list to array m lines return m lines mmovementlineconfirm getlines m_lines m_lines m_movementlineconfirm m_movementconfirm_id arraylist mmovementlineconfirm arraylist mmovementlineconfirm preparedstatement preparestatement get_trxname setint getm_movementconfirm_id resultset executequery mmovementlineconfirm getctx get_trxname m_lines mmovementlineconfirm toarray m_lines m_lines add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription set approved param is approved approval public void set is approved boolean is approved if is approved is approved int ad user id env getad user id get ctx m user user m user get get ctx ad user id string info user get name msg translate get ctx is approved new timestamp system current time millis add description info super set is approved is approved isapproved setisapproved isapproved isapproved isapproved ad_user_id getad_user_id getctx muser muser getctx ad_user_id getname getctx isapproved currenttimemillis adddescription setisapproved isapproved get document info return document info untranslated public string get document info return msg get element get ctx m movementconfirm id get document no getdocumentinfo getelement getctx m_movementconfirm_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string set doc action docaction prepare return true invalidateit invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get updated m doc type docbasetype materialmovement m processmsg period closed return doc action status invalid m movement line confirm lines get lines true if lines length 0 m processmsg no lines return doc action status invalid boolean difference false for int i 0 i lines length i if lines i is fully confirmed difference true break user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getupdated mdoctype docbasetype_materialmovement m_processmsg periodclosed docaction status_invalid mmovementlineconfirm getlines m_processmsg nolines docaction status_invalid isfullyconfirmed modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info complete it to string m movement move new m movement get ctx getm movement id get trxname m movement line confirm lines get lines false for int i 0 i lines length i m movement line confirm confirm lines i confirm set trxname get trxname if confirm process line m processmsg ship line not saved confirm return doc action status invalid if confirm is fully confirmed confirm set processed true confirm save get trxname else if create difference doc move confirm confirm set processed true confirm save get trxname else log log level severe complete it scrapped confirm get scrapped qty difference confirm get difference qty m processmsg differnce doc not created return doc action status invalid for all lines if m inventoryinfo null m processmsg m inventory id m inventoryinfo add description msg translate get ctx m inventory id m inventoryinfo set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit completeit tostring mmovement mmovement getctx getm_movement_id get_trxname mmovementlineconfirm getlines mmovementlineconfirm set_trxname get_trxname processline m_processmsg shipline docaction status_invalid isfullyconfirmed setprocessed get_trxname createdifferencedoc setprocessed get_trxname completeit getscrappedqty getdifferenceqty m_processmsg docaction status_invalid m_inventoryinfo m_processmsg m_inventory_id m_inventoryinfo adddescription getctx m_inventory_id m_inventoryinfo setprocessed setdocaction docaction_close docaction status_completed create difference document creates one or two inventory lines param confirm confirm line return true if created private boolean create difference doc m movement move m movement line confirm confirm m movement line m line confirm get line difference create inventory difference for source location if env zero compare to confirm get difference qty 0 get warehouse for source m locator loc m locator get get ctx m line getm locator id if m inventoryfrom null m inventoryfrom getm warehouse id loc getm warehouse id m inventoryfrom null if m inventoryfrom null m warehouse wh m warehouse get get ctx loc getm warehouse id m inventoryfrom new m inventory wh m inventoryfrom set description msg translate get ctx m movementconfirm id get document no if m inventoryfrom save get trxname m processmsg inventory not created return false first inventory if getm inventory id 0 setm inventory id m inventoryfrom getm inventory id m inventoryinfo m inventoryfrom get document no else m inventoryinfo m inventoryfrom get document no log info create difference doc difference confirm get difference qty m inventory line line new m inventory line m inventoryfrom m line getm locator id m line getm product id m line getm attributesetinstance id confirm get difference qty env zero line set description msg translate get ctx difference qty if line save get trxname m processmsg inventory line not created return false confirm setm inventoryline id line getm inventoryline id difference scrapped create inventory difference for target location if env zero compare to confirm get scrapped qty 0 get warehouse for target m locator loc m locator get get ctx m line getm locatorto id if m inventoryto null m inventoryto getm warehouse id loc getm warehouse id m inventoryto null if m inventoryto null m warehouse wh m warehouse get get ctx loc getm warehouse id m inventoryto new m inventory wh m inventoryto set description msg translate get ctx m movementconfirm id get document no if m inventoryto save get trxname m processmsg inventory not created return false first inventory if getm inventory id 0 setm inventory id m inventoryto getm inventory id m inventoryinfo m inventoryto get document no else m inventoryinfo m inventoryto get document no log info create difference doc scrapped confirm get scrapped qty m inventory line line new m inventory line m inventoryto m line getm locatorto id m line getm product id m line getm attributesetinstance id confirm get scrapped qty env zero line set description msg translate get ctx scrapped qty if line save get trxname m processmsg inventory line not created return false confirm setm inventoryline id line getm inventoryline id scrapped return true createdifferencedoc mmovement mmovementlineconfirm mmovementline mline getline compareto getdifferenceqty mlocator mlocator getctx mline getm_locator_id m_inventoryfrom m_inventoryfrom getm_warehouse_id getm_warehouse_id m_inventoryfrom m_inventoryfrom mwarehouse mwarehouse getctx getm_warehouse_id m_inventoryfrom minventory m_inventoryfrom setdescription getctx m_movementconfirm_id getdocumentno m_inventoryfrom get_trxname m_processmsg getm_inventory_id setm_inventory_id m_inventoryfrom getm_inventory_id m_inventoryinfo m_inventoryfrom getdocumentno m_inventoryinfo m_inventoryfrom getdocumentno createdifferencedoc getdifferenceqty minventoryline minventoryline m_inventoryfrom mline getm_locator_id mline getm_product_id mline getm_attributesetinstance_id getdifferenceqty setdescription getctx differenceqty get_trxname m_processmsg setm_inventoryline_id getm_inventoryline_id compareto getscrappedqty mlocator mlocator getctx mline getm_locatorto_id m_inventoryto m_inventoryto getm_warehouse_id getm_warehouse_id m_inventoryto m_inventoryto mwarehouse mwarehouse getctx getm_warehouse_id m_inventoryto minventory m_inventoryto setdescription getctx m_movementconfirm_id getdocumentno m_inventoryto get_trxname m_processmsg getm_inventory_id setm_inventory_id m_inventoryto getm_inventory_id m_inventoryinfo m_inventoryto getdocumentno m_inventoryinfo m_inventoryto getdocumentno createdifferencedoc getscrappedqty minventoryline minventoryline m_inventoryto mline getm_locatorto_id mline getm_product_id mline getm_attributesetinstance_id getscrappedqty setdescription getctx scrappedqty get_trxname m_processmsg setm_inventoryline_id getm_inventoryline_id void document return false public boolean void it log info void it to string return false voidit voidit tostring close document cancel not delivered qunatities return true if success public boolean close it log info close it to string close not delivered qty set doc action docaction none return true closeit closeit tostring setdocaction docaction_none reverse correction return false public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual none return false public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return false public boolean re activate it log info re activate it to string return false reactivateit reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx approval amt append append get approval amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx approvalamt getapprovalamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get updated by ad_user_id getdoc_user_id getupdatedby get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id return pl getc currency id return 0 c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id getc_currency_id standard constructor param ctx context param m transaction id id public m transaction properties ctx int m transaction id string trx name super ctx m transaction id trx name if m transaction id 0 setm transaction id 0 pk setm locator id 0 setm product id 0 set movement date new timestamp system current time millis set movement qty env zero set movement type movementtype customershipment m_transaction_id mtransaction m_transaction_id trxname m_transaction_id trxname m_transaction_id setm_transaction_id setm_locator_id setm_product_id setmovementdate currenttimemillis setmovementqty setmovementtype movementtype_customershipment load constructor param ctx context param rs result set public m transaction properties ctx result set rs string trx name super ctx rs trx name mtransaction resultset trxname trxname detail constructor param ctx context param movement type movement type param m locator id locator param m product id product param m attributesetinstance id attribute param movement qty qty param movement date optional date public m transaction properties ctx string movement type int m locator id int m product id int m attributesetinstance id big decimal movement qty timestamp movement date string trx name super ctx 0 trx name set movement type movement type if m locator id 0 throw new illegal argument exception no locator setm locator id m locator id if m product id 0 throw new illegal argument exception no product setm product id m product id setm attributesetinstance id m attributesetinstance id if movement qty null can be 0 set movement qty movement qty if movement date null set movement date new timestamp system current time millis else set movement date movement date movementtype m_locator_id m_product_id m_attributesetinstance_id movementqty movementdate mtransaction movementtype m_locator_id m_product_id m_attributesetinstance_id bigdecimal movementqty movementdate trxname trxname setmovementtype movementtype m_locator_id illegalargumentexception setm_locator_id m_locator_id m_product_id illegalargumentexception setm_product_id m_product_id setm_attributesetinstance_id m_attributesetinstance_id movementqty setmovementqty movementqty movementdate setmovementdate currenttimemillis setmovementdate movementdate string representation return info public string to string string buffer sb new string buffer m transaction sb append get id append append get movement type append qty append get movement qty append m product id append getm product id append asi append getm attributesetinstance id append return sb to string tostring stringbuffer stringbuffer mtransaction get_id getmovementtype getmovementqty m_product_id getm_product_id getm_attributesetinstance_id tostring standard constructor public x m replenish properties ctx int m replenish id string trx name super ctx m replenish id trx name if m replenish id 0 setlevel max env zero setlevel min env zero setm product id 0 setm warehouse id 0 set replenish type null x_m_replenish m_replenish_id trxname m_replenish_id trxname m_replenish_id setlevel_max setlevel_min setm_product_id setm_warehouse_id setreplenishtype load constructor public x m replenish properties ctx result set rs string trx name super ctx rs trx name x_m_replenish resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m replenish append get id append return sb to string tostring stringbuffer stringbuffer x_m_replenish get_id tostring set maximum level maximum inventory level for this product public void setlevel max big decimal level max if level max null throw new illegal argument exception level max is mandatory set value level max level max setlevel_max bigdecimal level_max level_max illegalargumentexception level_max set_value level_max level_max get maximum level maximum inventory level for this product public big decimal getlevel max big decimal bd big decimal get value level max if bd null return env zero return bd bigdecimal getlevel_max bigdecimal bigdecimal get_value level_max set minimum level minimum inventory level for this product public void setlevel min big decimal level min if level min null throw new illegal argument exception level min is mandatory set value level min level min setlevel_min bigdecimal level_min level_min illegalargumentexception level_min set_value level_min level_min get minimum level minimum inventory level for this product public big decimal getlevel min big decimal bd big decimal get value level min if bd null return env zero return bd bigdecimal getlevel_min bigdecimal bigdecimal get_value level_min set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int m warehousesource id ad reference id 197 set source warehouse optional warehouse to replenish from public void setm warehousesource id int m warehousesource id if m warehousesource id 0 set value m warehousesource id null else set value m warehousesource id new integer m warehousesource id m_warehousesource_id_ad_reference_id setm_warehousesource_id m_warehousesource_id m_warehousesource_id set_value m_warehousesource_id set_value m_warehousesource_id m_warehousesource_id get source warehouse optional warehouse to replenish from public int getm warehousesource id integer ii integer get value m warehousesource id if ii null return 0 return ii int value getm_warehousesource_id get_value m_warehousesource_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue public static final string replenishtype custom 9 set replenish type method for re ordering a product public void set replenish type string replenish type if replenish type null throw new illegal argument exception replenish type is mandatory if replenish type equals 0 replenish type equals 1 replenish type equals 2 replenish type equals 9 else throw new illegal argument exception replenish type invalid value replenish type reference id 164 0 1 2 9 if replenish type length 1 log warning length 1 truncated replenish type replenish type substring 0 0 set value replenish type replenish type replenishtype_custom setreplenishtype replenishtype replenishtype illegalargumentexception replenishtype replenishtype replenishtype replenishtype replenishtype illegalargumentexception replenishtype replenishtype reference_id replenishtype replenishtype replenishtype set_value replenishtype replenishtype get replenish type method for re ordering a product public string get replenish type return string get value replenish type getreplenishtype get_value replenishtype print screen painter param element window to print public print screen painter window element m element element printscreen printscreenpainter m_element get number of pages return 1 public int get number of pages return 1 getnumberofpages get printable param page index page index return this throws java lang index out of bounds exception public printable get printable int page index throws java lang index out of bounds exception return this pageindex indexoutofboundsexception getprintable pageindex indexoutofboundsexception get page format param page index page index return portrait throws java lang index out of bounds exception public page format get page format int page index throws java lang index out of bounds exception c paper paper new c paper false return paper get page format pageindex indexoutofboundsexception pageformat getpageformat pageindex indexoutofboundsexception cpaper cpaper getpageformat print param graphics graphics param page format page format param page index page index return no such page or page exists throws printer exception public int print graphics graphics page format page format int page index throws printer exception log config print screen painter print page index clip bounds graphics get clip bounds if page index 0 return printable no such page graphics2d g2 graphics2d graphics start position top of page g2 translate page format get imageablex page format get imageabley print header string header msg get msg env get ctx print screen display type get date format display type date time format new date int y g2 get font metrics get height leading ascent descent g2 draw string header 0 y leave one row free g2 translate 0 2 y double x ratio page format get imageable width m element get size width double y ratio page format get imageable height 2 y m element get size height sacle evenly but don t inflate double ratio math min math min x ratio y ratio 1 0 g2 scale ratio ratio print element m element print all g2 return printable page exists pageformat pageindex no_such_page page_exists printerexception pageformat pageformat pageindex printerexception printscreenpainter pageindex clipbounds getclipbounds pageindex no_such_page pageformat getimageablex pageformat getimageabley getmsg getctx printscreen displaytype getdateformat displaytype datetime getfontmetrics getheight drawstring xratio pageformat getimageablewidth m_element getsize yratio pageformat getimageableheight m_element getsize xratio yratio m_element printall page_exists static print start param element window public static void print screen window element print util print new print screen painter element null print screen 1 false printscreen printutil printscreenpainter printscreen get contents return data public object get contents return contents getcontents create info column r o and not color column param col header column header param colsql sql select code for column param col class class of column determines display public info column string col header string colsql class col class this col header colsql col class true false null colheader colclass info_column colheader colclass colheader colclass create info column r o and not color column param col header column header param colsql sql select code for column param col class class of column determines display param i dcolsql sql select for the id of the for the displayed column key name pair public info column string col header string colsql class col class string i dcolsql this col header colsql col class true false i dcolsql colheader colclass idcolsql keynamepair info_column colheader colclass idcolsql colheader colclass idcolsql create info column param col header column header param colsql sql select code for column param col class class of column determines display param read only column is read only param color column if true value of column determines foreground color param i dcolsql sql select for the id of the for the displayed column public info column string col header string colsql class col class boolean read only boolean color column string i dcolsql set col header col header set colsql colsql set col class col class set read only read only set color column color column seti dcolsql i dcolsql colheader colclass readonly colorcolumn idcolsql info_column colheader colclass readonly colorcolumn idcolsql setcolheader colheader setcolsql setcolclass colclass setreadonly readonly setcolorcolumn colorcolumn setidcolsql idcolsql private string m idcolsql public class get col class return m colclass m_idcolsql getcolclass m_colclass return m colclass public string get col header return m colheader m_colclass getcolheader m_colheader return m colheader public string get colsql return m colsql m_colheader getcolsql m_colsql return m colsql public boolean is read only return m readonly m_colsql isreadonly m_readonly return m readonly public void set col class class col class m colclass col class m_readonly setcolclass colclass m_colclass colclass public void set col header string col header m colheader col header if col header null int index col header index of if index 1 m colheader col header substring 0 index col header substring index 1 setcolheader colheader m_colheader colheader colheader colheader indexof m_colheader colheader colheader public void set colsql string colsql m colsql colsql setcolsql m_colsql m colsql colsql public void set read only boolean read only m readonly read only m_colsql setreadonly readonly m_readonly readonly m readonly read only public void set color column boolean color column m colorcolumn color column m_readonly readonly setcolorcolumn colorcolumn m_colorcolumn colorcolumn m colorcolumn color column public boolean is color column return m colorcolumn m_colorcolumn colorcolumn iscolorcolumn m_colorcolumn add id column sql for the displayed column the class for this should be key name pair public void seti dcolsql string i dcolsql m idcolsql i dcolsql if m idcolsql null m idcolsql keynamepair setidcolsql idcolsql m_idcolsql idcolsql m_idcolsql m_idcolsql m idcolsql public string geti dcolsql return m idcolsql m_idcolsql getidcolsql m_idcolsql return m idcolsql public boolean isi dcol return m idcolsql length 0 m_idcolsql isidcol m_idcolsql create tax param c tax id tax param name name param rate rate param tax base amt tax base amount param amount amount oaram sales tax sales tax flag public doc tax int c tax id string name big decimal rate big decimal tax base amt big decimal amount boolean sales tax m c tax id c tax id m name name m rate rate m amount amount m salestax sales tax c_tax_id taxbaseamt salestax doctax c_tax_id bigdecimal bigdecimal taxbaseamt bigdecimal salestax m_c_tax_id c_tax_id m_name m_rate m_amount m_salestax salestax get account param acct type see accttype param as account schema return account public m account get account int acct type m acct schema as if acct type 0 acct type 4 return null string sql select t due acct t liability acct t credit acct t receivables acct t expense acct from c tax acct where c tax id and c acctschema id int validcombination id 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m c tax id pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next validcombination id rs get int acct type 1 1 5 rs close pstmt close catch sql exception e log log level severe sql e if validcombination id 0 return null return m account get as get ctx validcombination id accttype accttype_ maccount getaccount accttype macctschema accttype accttype t_due_acct t_liability_acct t_credit_acct t_receivables_acct t_expense_acct c_tax_acct c_tax_id c_acctschema_id validcombination_id preparedstatement preparestatement setint m_c_tax_id setint getc_acctschema_id resultset executequery validcombination_id getint accttype sqlexception validcombination_id maccount getctx validcombination_id get amount return gross amount public big decimal get amount return m amount bigdecimal getamount m_amount get base amount return net amount public big decimal get tax base amt return m taxbaseamt bigdecimal gettaxbaseamt m_taxbaseamt get rate return tax rate in percent public big decimal get rate return m rate bigdecimal getrate m_rate get name of tax return name public string get name return m name getname m_name get c tax id return tax id public int getc tax id return m c tax id c_tax_id getc_tax_id m_c_tax_id get description tax name and base amount return tax anme and base amount public string get description return m name m taxbaseamt to string getdescription m_name m_taxbaseamt tostring add to included tax param amt amount public void add included tax big decimal amt m includedtax m includedtax add amt addincludedtax bigdecimal m_includedtax m_includedtax get included tax return tax amount public big decimal get included tax return m includedtax bigdecimal getincludedtax m_includedtax get included tax difference return tax ampunt included amount public big decimal get included tax difference return m amount subtract m includedtax bigdecimal getincludedtaxdifference m_amount m_includedtax included tax differs from tax amount return true if difference public boolean is included tax difference return env zero compare to get included tax difference 0 isincludedtaxdifference compareto getincludedtaxdifference get ap tax type return ap tax type credit or expense public int getap tax type if is sales tax return accttype taxexpense return accttype taxcredit getaptaxtype issalestax accttype_taxexpense accttype_taxcredit is sales tax return sales tax public boolean is sales tax return m salestax issalestax m_salestax return string representation return tax anme and base amount public string to string string buffer sb new string buffer tax sb append m name sb append amt append m amount sb append return sb to string tostring stringbuffer stringbuffer m_name m_amount tostring standard constructor requires init window public a window super set ui components this set icon image org compiere compiere get image16 this get content pane add m apanel border layout center this set glass pane m glasspane initwindow awindow seticonimage getimage16 getcontentpane m_apanel borderlayout setglasspane m_glasspane dynamic initialization workbench param ad workbench id workbench return true if loaded ok protected boolean init workbench int ad workbench id this set name awindow wb ad workbench id boolean loadedok m apanel init panel ad workbench id 0 null common init return loadedok ad_workbench_id initworkbench ad_workbench_id setname awindow_wb_ ad_workbench_id m_apanel initpanel ad_workbench_id commoninit dynamic initialization single window param ad window id window param query query return true if loaded ok public boolean init window int ad window id m query query this set name awindow ad window id setad window id ad window id boolean loadedok m apanel init panel 0 ad window id query common init return loadedok ad_window_id initwindow ad_window_id mquery setname awindow_ ad_window_id setad_window_id ad_window_id m_apanel initpanel ad_window_id commoninit common init after a panel loaded private void common init this setj menu bar m apanel get menu bar this set title m apanel get title image image m apanel get image if image null set icon image image apanel commoninit setjmenubar m_apanel getmenubar settitle m_apanel gettitle m_apanel getimage seticonimage set window busy param busy busy public void set busy boolean busy if busy m glasspane is visible c connection get is terminal server return log config get name busy m glasspane set message null m glasspane set visible busy if busy m glasspane request focus setbusy m_glasspane isvisible cconnection isterminalserver getname m_glasspane setmessage m_glasspane setvisible m_glasspane requestfocus set busy message param ad message message public void set busy message string ad message m glasspane set message ad message ad_message setbusymessage ad_message m_glasspane setmessage ad_message set and start busy counter param time in seconds public void set busy timer int time m glasspane set busy timer time setbusytimer m_glasspane setbusytimer window events param e event protected void process window event window event e super process window event e system out println apps we e getid frames get frames length e processwindowevent windowevent processwindowevent we_ getframes get application panel return application panel protected a panel geta panel return m apanel apanel getapanel m_apanel dispose public void dispose if env hide window this return log info to string if m apanel null m apanel dispose m apanel null this remove all super dispose system gc hidewindow tostring m_apanel m_apanel m_apanel removeall get window no of panel return window no public int get window no if m apanel null return m apanel get window no return 0 getwindowno m_apanel m_apanel getwindowno string representation return name public string to string return get name get window no tostring getname _ getwindowno standard constructor public x c poskeylayout properties ctx int c poskeylayout id string trx name super ctx c poskeylayout id trx name if c poskeylayout id 0 setc poskeylayout id 0 set name null x_c_poskeylayout c_poskeylayout_id trxname c_poskeylayout_id trxname c_poskeylayout_id setc_poskeylayout_id setname load constructor public x c poskeylayout properties ctx result set rs string trx name super ctx rs trx name x_c_poskeylayout resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c poskeylayout append get id append return sb to string tostring stringbuffer stringbuffer x_c_poskeylayout get_id tostring set pos key layout pos function key layout public void setc poskeylayout id int c poskeylayout id if c poskeylayout id 1 throw new illegal argument exception c poskeylayout id is mandatory set valuenocheck c poskeylayout id new integer c poskeylayout id setc_poskeylayout_id c_poskeylayout_id c_poskeylayout_id illegalargumentexception c_poskeylayout_id set_valuenocheck c_poskeylayout_id c_poskeylayout_id get pos key layout pos function key layout public int getc poskeylayout id integer ii integer get value c poskeylayout id if ii null return 0 return ii int value getc_poskeylayout_id get_value c_poskeylayout_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x m requisitionline properties ctx int m requisitionline id string trx name super ctx m requisitionline id trx name if m requisitionline id 0 set line 0 sql select coalesce max line 0 10 as default value from m requisitionline where m requisition id m requisition id set line net amt env zero setm requisitionline id 0 setm requisition id 0 set price actual env zero set qty env zero 1 x_m_requisitionline m_requisitionline_id trxname m_requisitionline_id trxname m_requisitionline_id setline defaultvalue m_requisitionline m_requisition_id m_requisition_id setlinenetamt setm_requisitionline_id setm_requisition_id setpriceactual setqty load constructor public x m requisitionline properties ctx result set rs string trx name super ctx rs trx name x_m_requisitionline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m requisitionline append get id append return sb to string tostring stringbuffer stringbuffer x_m_requisitionline get_id tostring set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set value c orderline id null else set value c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_value c_orderline_id set_value c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set line amount line extended amount quantity actual price without freight and charges public void set line net amt big decimal line net amt if line net amt null throw new illegal argument exception line net amt is mandatory set value line net amt line net amt setlinenetamt bigdecimal linenetamt linenetamt illegalargumentexception linenetamt set_value linenetamt linenetamt get line amount line extended amount quantity actual price without freight and charges public big decimal get line net amt big decimal bd big decimal get value line net amt if bd null return env zero return bd bigdecimal getlinenetamt bigdecimal bigdecimal get_value linenetamt set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 set value m attributesetinstance id null else set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_value m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set requisition line material requisition line public void setm requisitionline id int m requisitionline id if m requisitionline id 1 throw new illegal argument exception m requisitionline id is mandatory set valuenocheck m requisitionline id new integer m requisitionline id setm_requisitionline_id m_requisitionline_id m_requisitionline_id illegalargumentexception m_requisitionline_id set_valuenocheck m_requisitionline_id m_requisitionline_id get requisition line material requisition line public int getm requisitionline id integer ii integer get value m requisitionline id if ii null return 0 return ii int value getm_requisitionline_id get_value m_requisitionline_id intvalue set requisition material requisition public void setm requisition id int m requisition id if m requisition id 1 throw new illegal argument exception m requisition id is mandatory set valuenocheck m requisition id new integer m requisition id setm_requisition_id m_requisition_id m_requisition_id illegalargumentexception m_requisition_id set_valuenocheck m_requisition_id m_requisition_id get requisition material requisition public int getm requisition id integer ii integer get value m requisition id if ii null return 0 return ii int value getm_requisition_id get_value m_requisition_id intvalue set unit price actual price public void set price actual big decimal price actual if price actual null throw new illegal argument exception price actual is mandatory set value price actual price actual setpriceactual bigdecimal priceactual priceactual illegalargumentexception priceactual set_value priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value initialize global variables param config servlet configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception single item servletexception servletconfig servletexception webenv initweb servletexception singleitem clean up resources public void destroy log info destroy process the initial http get request param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info from request get remote host request get remote addr servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr get contents return contents public object get contents return contents getcontents basic constructor public small basic constructor param element adds an element to the element public small element element add element element addelement basic constructor param element adds an element to the element public small string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public small add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public small add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public small add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public small add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public small remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute public string get name return contrast getname new colorui resource 102 102 102 protected colorui resource get primary1 return primary1 coloruiresource coloruiresource getprimary1 protected colorui resource get primary2 return primary2 coloruiresource getprimary2 protected colorui resource get primary3 return primary3 coloruiresource getprimary3 public colorui resource get primary control highlight return primary highlight coloruiresource getprimarycontrolhighlight primaryhighlight protected colorui resource get secondary2 return secondary2 coloruiresource getsecondary2 protected colorui resource get secondary3 return secondary3 coloruiresource getsecondary3 public colorui resource get control highlight return super get secondary3 coloruiresource getcontrolhighlight getsecondary3 public colorui resource get focus color return get black coloruiresource getfocuscolor getblack public colorui resource get text highlight color return get black coloruiresource gettexthighlightcolor getblack public colorui resource get highlighted text color return get white coloruiresource gethighlightedtextcolor getwhite public colorui resource get menu selected background return get black coloruiresource getmenuselectedbackground getblack public colorui resource get menu selected foreground return get white coloruiresource getmenuselectedforeground getwhite public colorui resource get accelerator foreground return get black coloruiresource getacceleratorforeground getblack public colorui resource get accelerator selected foreground return get white coloruiresource getacceleratorselectedforeground getwhite public void add custom entries to table ui defaults table border black line border new borderui resource new line border get black border white line border new borderui resource new line border get white object text border new borderui resource new compound border black line border new basic borders margin border enhancements object defaults new object tool tip border black line border titled border border black line border text field border text border password field border text border text area border text border text pane border text border editor pane border text border combo box background get window background combo box foreground get user text color combo box selection background get text highlight color combo box selection foreground get highlighted text color progress bar foreground get user text color progress bar background get window background progress bar selection foreground get window background progress bar selection background get user text color option pane error dialog border background get primary1 option pane error dialog title pane foreground get primary3 option pane error dialog title pane background get primary1 option pane error dialog title pane shadow get primary2 option pane question dialog border background get primary1 option pane question dialog title pane foreground get primary3 option pane question dialog title pane background get primary1 option pane question dialog title pane shadow get primary2 option pane warning dialog border background get primary1 option pane warning dialog title pane foreground get primary3 option pane warning dialog title pane background get primary1 option pane warning dialog title pane shadow get primary2 table put defaults defaults addcustomentriestotable uidefaults blacklineborder borderuiresource lineborder getblack whitelineborder borderuiresource lineborder getwhite textborder borderuiresource compoundborder blacklineborder basicborders marginborder tooltip blacklineborder titledborder blacklineborder textfield textborder passwordfield textborder textarea textborder textpane textborder editorpane textborder combobox getwindowbackground combobox getusertextcolor combobox selectionbackground gettexthighlightcolor combobox selectionforeground gethighlightedtextcolor progressbar getusertextcolor progressbar getwindowbackground progressbar selectionforeground getwindowbackground progressbar selectionbackground getusertextcolor optionpane errordialog getprimary1 optionpane errordialog titlepane getprimary3 optionpane errordialog titlepane getprimary1 optionpane errordialog titlepane getprimary2 optionpane questiondialog getprimary1 optionpane questiondialog titlepane getprimary3 optionpane questiondialog titlepane getprimary1 optionpane questiondialog titlepane getprimary2 optionpane warningdialog getprimary1 optionpane warningdialog titlepane getprimary3 optionpane warningdialog titlepane getprimary1 optionpane warningdialog titlepane getprimary2 putdefaults initialize panel param window no window param frame frame public void init int window no form frame frame m windowno window no m frame frame log info v merge init win no m windowno try pre init jb init frame get content pane add this border layout center frame get content pane add status bar border layout south action loadtree catch exception ex log log level severe v tree maintenance init ex windowno windowno formframe m_windowno windowno m_frame vmerge winno m_windowno preinit jbinit getcontentpane borderlayout getcontentpane statusbar borderlayout action_loadtree vtreemaintenance fill tree combo private void pre init key name pair trees db get key name pairs m role get default add accesssql select ad tree id name from ad tree where tree type not in bb pc order by 2 ad tree m role sql notqualified m role sql rw false tree field new c combo box trees tree field add action listener this center tree new v tree panel m windowno false true center tree add property change listener v tree panel node selection this preinit keynamepair getkeynamepairs mrole getdefault addaccesssql ad_tree_id ad_tree treetype ad_tree mrole sql_notqualified mrole sql_rw treefield ccombobox treefield addactionlistener centertree vtreepanel m_windowno centertree addpropertychangelistener vtreepanel node_selection static init throws exception private void jb init throws exception this set layout main layout tree label set text msg translate env get ctx ad tree id cb all nodes set enabled false cb all nodes set text msg translate env get ctx is all nodes tree info set text b add set tool tip text add to tree b add all set tool tip text add all to tree b delete set tool tip text delete from tree b delete all set tool tip text delete all from tree b add add action listener this b add all add action listener this b delete add action listener this b delete all add action listener this north panel set layout north layout north layout set alignment flow layout left this add north panel border layout north north panel add tree label null north panel add tree field null north panel add cb all nodes null north panel add tree info null north panel add b add all null north panel add b add null north panel add b delete null north panel add b delete all null this add split pane border layout center split pane add center tree j split pane left split pane add new j scroll pane center list j split pane right center list set selection mode list selection model single selection center list add list selection listener this jbinit setlayout mainlayout treelabel settext getctx ad_tree_id cballnodes setenabled cballnodes settext getctx isallnodes treeinfo settext badd settooltiptext baddall settooltiptext bdelete settooltiptext bdeleteall settooltiptext badd addactionlistener baddall addactionlistener bdelete addactionlistener bdeleteall addactionlistener northpanel setlayout northlayout northlayout setalignment flowlayout northpanel borderlayout northpanel treelabel northpanel treefield northpanel cballnodes northpanel treeinfo northpanel baddall northpanel badd northpanel bdelete northpanel bdeleteall splitpane borderlayout splitpane centertree jsplitpane splitpane jscrollpane centerlist jsplitpane centerlist setselectionmode listselectionmodel single_selection centerlist addlistselectionlistener dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e if e get source tree field action loadtree else if e get source b add all action treeaddall else if e get source b add action treeadd list item center list get selected value else if e get source b delete action treedelete list item center list get selected value else if e get source b delete all action treedeleteall actionperformed actionevent getsource treefield action_loadtree getsource baddall action_treeaddall getsource badd action_treeadd listitem centerlist getselectedvalue getsource bdelete action_treedelete listitem centerlist getselectedvalue getsource bdeleteall action_treedeleteall action fill tree with all nodes private void action loadtree key name pair tree key name pair tree field get selected item log info tree tree if tree get key 0 center list set model new default list model return tree m tree new m tree env get ctx tree get key null cb all nodes set selected m tree is all nodes b add all set enabled m tree is all nodes b add set enabled m tree is all nodes b delete set enabled m tree is all nodes b delete all set enabled m tree is all nodes string from clause m tree get source table name false fully qualified string column namex m tree get source table name true string action color m tree get action color name list default list model model new default list model string sql select t column namex id t name t description t is summary action color from from clause where t is active y r o order by 2 sql m role get default add accesssql sql t m role sql fullyqualified m role sql ro log config sql prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next list item item new list item rs get int 1 rs get string 2 rs get string 3 y equals rs get string 4 rs get string 5 model add element item rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null list log config model get size center list set model model tree center tree init tree m tree getad tree id action_loadtree keynamepair keynamepair treefield getselecteditem getkey centerlist setmodel defaultlistmodel m_tree mtree getctx getkey cballnodes setselected m_tree isallnodes baddall setenabled m_tree isallnodes badd setenabled m_tree isallnodes bdelete setenabled m_tree isallnodes bdeleteall setenabled m_tree isallnodes fromclause m_tree getsourcetablename columnnamex m_tree getsourcetablename actioncolor m_tree getactioncolorname defaultlistmodel defaultlistmodel columnnamex _id issummary actioncolor fromclause isactive mrole getdefault addaccesssql mrole sql_fullyqualified mrole sql_ro preparedstatement preparestatement resultset executequery listitem listitem getint getstring getstring getstring getstring addelement getsize centerlist setmodel centertree inittree m_tree getad_tree_id list selection listener param e event public void value changed list selection event e if e get value is adjusting return list item selected null try throws a array index out of bounds exception if root is selected selected list item center list get selected value catch exception ex log info selected selected if selected null allow add if not in tree b add set enabled center tree set selected node selected id valuechanged listselectionevent getvalueisadjusting listitem arrayindexoutofboundsexception listitem centerlist getselectedvalue badd setenabled centertree setselectednode v tree panel changed param e event public void property change property change event e m tree node tn m tree node e get new value log info tn to string if tn null return list model model center list get model int size model get size int index 1 for index 0 index size index list item item list item model get element at index if item id tn getnode id break center list set selected index index vtreepanel propertychange propertychangeevent mtreenode mtreenode getnewvalue tostring listmodel centerlist getmodel getsize listitem listitem getelementat getnode_id centerlist setselectedindex action add node to tree private void action treeadd list item item log info item item if item null center tree node changed true item id item name item description item is summary item image indicator may cause error if in tree if m tree is product mtree nodepr node new mtree nodepr m tree item id node save else if m tree isb partner mtree nodebp node new mtree nodebp m tree item id node save else if m tree is menu mtree nodemm node new mtree nodemm m tree item id node save else mtree node node new mtree node m tree item id node save action_treeadd listitem centertree nodechanged issummary imageindicator m_tree isproduct mtree_nodepr mtree_nodepr m_tree m_tree isbpartner mtree_nodebp mtree_nodebp m_tree m_tree ismenu mtree_nodemm mtree_nodemm m_tree mtree_node mtree_node m_tree action delete node from tree private void action treedelete list item item log info item item if item null center tree node changed false item id item name item description item is summary item image indicator if m tree is product mtree nodepr node mtree nodepr get m tree item id if node null node delete true else if m tree isb partner mtree nodebp node mtree nodebp get m tree item id if node null node delete true else if m tree is menu mtree nodemm node mtree nodemm get m tree item id if node null node delete true else mtree node node mtree node get m tree item id if node null node delete true action_treedelete listitem centertree nodechanged issummary imageindicator m_tree isproduct mtree_nodepr mtree_nodepr m_tree m_tree isbpartner mtree_nodebp mtree_nodebp m_tree m_tree ismenu mtree_nodemm mtree_nodemm m_tree mtree_node mtree_node m_tree action add all nodes to tree private void action treeaddall log info list model model center list get model int size model get size int index 1 for index 0 index size index list item item list item model get element at index action treeadd item action_treeaddall listmodel centerlist getmodel getsize listitem listitem getelementat action_treeadd action delete all nodes from tree private void action treedeleteall log info list model model center list get model int size model get size int index 1 for index 0 index size index list item item list item model get element at index action treedelete item action_treedeleteall listmodel centerlist getmodel getsize listitem listitem getelementat action_treedelete public list item int id string name string description boolean is summary string image indicator this id id this name name this description description this is summary is summary this image indicator image indicator listitem issummary imageindicator issummary issummary imageindicator imageindicator to string return string representation public string to string string ret value name if description null description length 0 ret value description return ret value tostring retvalue retvalue retvalue constructor param panel ui panel public configuration data configuration panel panel super p panel panel configurationdata configurationpanel p_panel load configuration data return true if loaded public boolean load load c adempiere adempiere env properties string compiere home system get property compiere home if compiere home null compiere home length 0 compiere home system get property user dir boolean env loaded false string file name compiere home file separator compiere env file file env new file file name if env exists try file input stream fis new file input stream env p properties load fis fis close catch exception e log severe e to string log info env to string if p properties size 5 env loaded true set java type string p properties get java type init java set java home string p properties get java home set compiere home string p properties get compiere home string s string p properties get compiere keystorepass if s null s length 0 s keystore password set key store s set apps server type string p properties get compiere apps type init apps server set apps server string p properties get compiere apps server set apps server deploy dir string p properties get compiere apps deploy set apps serverjnp port string p properties get compiere jnp port set apps server web port string p properties get compiere web port set apps serverssl port string p properties get compiere ssl port set database type string p properties get compiere db type init database string p properties get compiere db name fills database options set database discovered string p properties get compiere db name set database server string p properties get compiere db server set database port string p properties get compiere db port set database name string p properties get compiere db name set database user string p properties get compiere db user set database password string p properties get compiere db password set database system password string p properties get compiere db system p panel f mail server set text string p properties get compiere mail server p panel f mail user set text string p properties get compiere mail user p panel f mail password set text string p properties get compiere mail password p panel f admine mail set text string p properties get compiere admin email inet address localhost null string host name unknown try localhost inet address get local host host name localhost get host name catch exception e log severe cannot get local host name no environment file found defaults env loaded false if env loaded log info defaults init java set compiere home compiere home set key store keystore password apps server init apps server set apps server host name database server init database set database name get database discovered set database system password set database server host name set database user adempiere set database password adempiere mail server p panel f mail server set text host name p panel f mail user set text info p panel f mail password set text p panel f admine mail set text info host name env loaded default ftp stuff if p properties contains key compiere ftp server p properties set property compiere ftp server localhost p properties set property compiere ftp user anonymous p properties set property compiere ftp password user host com p properties set property compiere ftp prefix my default java options if p properties contains key compiere java options p properties set property compiere java options xms64m xmx512m web alias if p properties contains key compiere web alias localhost null p properties set property compiere web alias localhost get canonical host name string p properties get compiere db url derived keystore alias if p properties contains key compiere keystorecodealias p properties set property compiere keystorecodealias adempiere if p properties contains key compiere keystorewebalias p properties set property compiere keystorewebalias adempiere return true adempiereenv compierehome getproperty compiere_home compierehome compierehome compierehome getproperty envloaded filename compierehome compiere_env_file filename fileinputstream fileinputstream p_properties tostring tostring p_properties envloaded setjavatype p_properties java_type initjava setjavahome p_properties java_home setcompierehome p_properties compiere_home p_properties compiere_keystorepass keystore_password setkeystore setappsservertype p_properties compiere_apps_type initappsserver setappsserver p_properties compiere_apps_server setappsserverdeploydir p_properties compiere_apps_deploy setappsserverjnpport p_properties compiere_jnp_port setappsserverwebport p_properties compiere_web_port setappsserversslport p_properties compiere_ssl_port setdatabasetype p_properties compiere_db_type initdatabase p_properties compiere_db_name setdatabasediscovered p_properties compiere_db_name setdatabaseserver p_properties compiere_db_server setdatabaseport p_properties compiere_db_port setdatabasename p_properties compiere_db_name setdatabaseuser p_properties compiere_db_user setdatabasepassword p_properties compiere_db_password setdatabasesystempassword p_properties compiere_db_system p_panel fmailserver settext p_properties compiere_mail_server p_panel fmailuser settext p_properties compiere_mail_user p_panel fmailpassword settext p_properties compiere_mail_password p_panel fadminemail settext p_properties compiere_admin_email inetaddress hostname inetaddress getlocalhost hostname gethostname envloaded envloaded initjava setcompierehome compierehome setkeystore keystore_password appsserver initappsserver setappsserver hostname initdatabase setdatabasename getdatabasediscovered setdatabasesystempassword setdatabaseserver hostname setdatabaseuser setdatabasepassword p_panel fmailserver settext hostname p_panel fmailuser settext p_panel fmailpassword settext p_panel fadminemail settext hostname envloaded p_properties containskey compiere_ftp_server p_properties setproperty compiere_ftp_server p_properties setproperty compiere_ftp_user p_properties setproperty compiere_ftp_password p_properties setproperty compiere_ftp_prefix p_properties containskey compiere_java_options p_properties setproperty compiere_java_options p_properties containskey compiere_web_alias p_properties setproperty compiere_web_alias getcanonicalhostname p_properties compiere_db_url p_properties containskey compiere_keystorecodealias p_properties setproperty compiere_keystorecodealias p_properties containskey compiere_keystorewebalias p_properties setproperty compiere_keystorewebalias test return true if test ok public boolean test string error test java if error null log severe error return false error test compiere if error null log severe error return false p panel set status bar p panel l apps server get text error test apps server if error null log severe error return false p panel set status bar p panel l database server get text error test database if error null log severe error return false p panel set status bar p panel l mail server get text error test mail if error null log severe error return false return true testjava testcompiere p_panel setstatusbar p_panel lappsserver gettext testappsserver p_panel setstatusbar p_panel ldatabaseserver gettext testdatabase p_panel setstatusbar p_panel lmailserver gettext testmail test compiere and set compiere home return error message or null if ok private string test compiere compiere home m compierehome new file get compiere home boolean pass m compierehome exists string error not found compiere home m compierehome p panel signalok p panel ok compiere home error compiere home pass true error if pass return error log info ok compiere home m compierehome p properties set property compiere home m compierehome get absolute path system set property compiere home m compierehome get absolute path key store string file name key store mgt get keystore file name m compierehome get absolute path p properties set property compiere keystore file name key store password string pw new string p panel f key store get password pass pw null pw length 0 error invalid key store password pw p panel signalok p panel ok key store key store password pass true error if pass return error p properties set property compiere keystorepass pw key store mgt ks new key store mgt file name p panel f key store get password error ks verify j frame swing utilities get window ancestor p panel pass error null p panel signalok p panel ok key store key store password pass true error if pass return error log info ok key store file name return null compierehome testcompiere m_compierehome getcompierehome m_compierehome compierehome m_compierehome p_panel p_panel okcompierehome errorcompierehome compierehome m_compierehome p_properties setproperty compiere_home m_compierehome getabsolutepath setproperty compiere_home m_compierehome getabsolutepath keystore filename keystoremgt getkeystorefilename m_compierehome getabsolutepath p_properties setproperty compiere_keystore filename keystore p_panel fkeystore getpassword p_panel p_panel okkeystore keystorepassword p_properties setproperty compiere_keystorepass keystoremgt keystoremgt filename p_panel fkeystore getpassword jframe swingutilities getwindowancestor p_panel p_panel p_panel okkeystore keystorepassword keystore filename test optional mail return error message or null if ok private string test mail mail server string server p panel f mail server get text boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 string error error mail server server inet address mail server null try if pass mail server inet address get by name server catch exception e error e get message pass false p panel signalok p panel ok mail server error mail server pass true error if pass p properties set property compiere mail server return error p properties set property compiere mail server mail server get host name mail user string mail user p panel f mail user get text string mail password new string p panel f mail password get password m errorstring error mail user log config mail user mail user mail password mail address string admine mail string p panel f admine mail get text internet address admine mail null try admine mail new internet address admine mail string catch exception e error not valid admine mail string e get message pass false if pass error not verified e mail admine mail pass test mail server mail server admine mail mail user mail password p panel signalok p panel ok mail user error mail pass false error if pass log info ok e mail admine mail p properties set property compiere admin email admine mail to string p properties set property compiere mail user mail user p properties set property compiere mail password mail password p properties set property compiere mail updated no else log warning error p properties set property compiere admin email p properties set property compiere mail user p properties set property compiere mail password p properties set property compiere mail updated return null testmail p_panel fmailserver gettext tolowercase indexof inetaddress mailserver mailserver inetaddress getbyname getmessage p_panel p_panel okmailserver errormailserver p_properties setproperty compiere_mail_server p_properties setproperty compiere_mail_server mailserver gethostname mailuser p_panel fmailuser gettext mailpassword p_panel fmailpassword getpassword m_errorstring errormailuser mailuser mailpassword adminemailstring p_panel fadminemail gettext internetaddress adminemail adminemail internetaddress adminemailstring adminemailstring getmessage email adminemail testmailserver mailserver adminemail mailuser mailpassword p_panel p_panel okmailuser errormail email adminemail p_properties setproperty compiere_admin_email adminemail tostring p_properties setproperty compiere_mail_user mailuser p_properties setproperty compiere_mail_password mailpassword p_properties setproperty compiere_mail_updated p_properties setproperty compiere_admin_email p_properties setproperty compiere_mail_user p_properties setproperty compiere_mail_password p_properties setproperty compiere_mail_updated test mail return true of ok private boolean test mail server inet address mail server internet address admine mail string mail user string mail password boolean smtpok false boolean imapok false if test port mail server 25 true log config ok smtp server contacted smtpok true else log info smtp server not available if test port mail server 110 true log config ok pop3 server contacted else log info pop3 server not available if test port mail server 143 true log config ok imap4 server contacted imapok true else log info imap4 server not available if smtpok string error no active mail server p panel signalok p panel ok mail server error mail server false false error log warning error return false try e mail email new e mail new properties mail server get host name admine mail to string admine mail to string a dempiere server setup test test get properties email create authenticator mail user mail password if e mail sent ok equals email send log info ok send test email to admine mail else log warning could not send email to admine mail catch exception ex log severe ex get localized message return false if imapok return false test read mail access properties props new properties props put mail store protocol smtp props put mail transport protocol smtp props put mail host mail server get host name props put mail user mail user props put mail smtp auth true log config connecting to mail server get host name session session null store store null try e mail authenticator auth new e mail authenticator mail user mail password session session get default instance props auth session set debug c log mgt is level finest log config session session connect to store store session get store imap log config store store catch no such provider exception nsp log warning mail imap provider nsp get message return false catch exception e log warning mail imap e get message return false try store connect mail server get host name mail user mail password log config store connected folder folder store get default folder folder inbox folder get folder inbox log info ok mail connect to inbox get full name msg inbox get message count store close catch messaging exception mex log severe mail connect mex get message return false return true testmailserver inetaddress mailserver internetaddress adminemail mailuser mailpassword testport mailserver testport mailserver testport mailserver p_panel p_panel okmailserver errormailserver email email mailserver gethostname adminemail tostring adminemail tostring adempiere getproperties createauthenticator mailuser mailpassword email sent_ok adminemail adminemail getlocalizedmessage mailserver gethostname mailuser mailserver gethostname emailauthenticator emailauthenticator mailuser mailpassword getdefaultinstance setdebug clogmgt islevelfinest getstore nosuchproviderexception getmessage getmessage mailserver gethostname mailuser mailpassword getdefaultfolder getfolder getfullname getmessagecount messagingexception getmessage test apps server port client perspective param protocol protocol http param server server name param port port param file file name return true if able to connect protected boolean test port string protocol string server int port string file url url null try url new url protocol server port file catch malformedurl exception ex log severe no url for protocol protocol server server ex get message return false try url connection c url open connection object o c get content log severe in use url error catch exception ex log fine not used url ok return false return true testport malformedurlexception getmessage urlconnection openconnection getcontent test server port param port port return true if able to create protected boolean test server port int port try server socket ss new server socket port log fine ss get inet address ss get local port created ss close catch exception ex log severe port port ex get message return false return true testserverport serversocket serversocket getinetaddress getlocalport getmessage test port param host host param port port param should be used true if it should be used return true if some server answered on port protected boolean test port inet address host int port boolean should be used socket ping socket null try ping socket new socket host port catch exception e if should be used log severe open socket host port e get message else log fine host port e get message return false if should be used log severe open socket host port ping socket log fine host port ping socket if ping socket null return false success try ping socket close catch io exception e log severe close socket e to string return true shouldbeused testport inetaddress shouldbeused pingsocket pingsocket shouldbeused getmessage getmessage shouldbeused pingsocket pingsocket pingsocket pingsocket ioexception tostring save settings return true if saved public boolean save add p properties set property compiere main version compiere main version p properties set property compiere date version compiere date version p properties set property compiere db version compiere db version log finest p properties to string before we save load ini ini set client false string file name m compierehome get absolute path file separator ini compiere property file ini load properties file name save environment file name m compierehome get absolute path file separator compiere env file try file output stream fos new file output stream new file file name p properties store fos compiere env file fos flush fos close catch exception e log severe cannot save properties to file name e to string j option pane show confirm dialog p panel configuration panel res get string error save configuration panel res get string compiere server setup j option pane default option j option pane error message return false catch throwable t log severe cannot save properties to file name t to string j option pane show confirm dialog p panel configuration panel res get string error save configuration panel res get string compiere server setup j option pane default option j option pane error message return false log info file name return save ini p_properties setproperty compiere_main_version main_version p_properties setproperty compiere_date_version date_version p_properties setproperty compiere_db_version db_version p_properties tostring setclient filename m_compierehome getabsolutepath compiere_property_file loadproperties filename filename m_compierehome getabsolutepath compiere_env_file fileoutputstream fileoutputstream filename p_properties compiere_env_file filename tostring joptionpane showconfirmdialog p_panel configurationpanel getstring errorsave configurationpanel getstring compiereserversetup joptionpane default_option joptionpane error_message filename tostring joptionpane showconfirmdialog p_panel configurationpanel getstring errorsave configurationpanel getstring compiereserversetup joptionpane default_option joptionpane error_message filename saveini synchronize and save connection info in ini private boolean save ini ini set compiere home m compierehome get absolute path create connection string cc type database db oracle if get database type equals dbtype sybase cc type database db sybase begin vpj cd e evolution 03 17 2005 postgresql if get database type equals dbtype postgresql80 get database type equals dbtype postgresql81 cc type database db postgresql end vpj cd e evolution 03 17 2005 postgresql c connection cc null try cc c connection get cc type get database server get database port get database name get database user get database password cc set apps host p panel f apps server get text cc set connection profile c connection profile lan catch exception e log log level severe connection e return false if cc null log severe no connection return false ini set property ini p connection cc to string long ini save properties false return true saveini setcompierehome m_compierehome getabsolutepath cctype db_oracle getdatabasetype dbtype_sybase cctype db_sybase getdatabasetype dbtype_postgresql80 getdatabasetype dbtype_postgresql81 cctype db_postgresql cconnection cconnection cctype getdatabaseserver getdatabaseport getdatabasename getdatabaseuser getdatabasepassword setappshost p_panel fappsserver gettext setconnectionprofile cconnection profile_lan setproperty p_connection tostringlong saveproperties get properties return properties properties get properties return p properties getproperties p_properties get compiere home return compiere home public string get compiere home return p panel f compiere home get text getcompierehome p_panel fcompierehome gettext get compiere home public void set compiere home string compiere home p panel f compiere home set text compiere home getcompierehome setcompierehome compierehome p_panel fcompierehome settext compierehome public string get key store char pw p panel f key store get password if pw null return new string pw return getkeystore p_panel fkeystore getpassword public void set key store string password p panel f key store set text password setkeystore p_panel fkeystore settext init database public void init java int index p panel f java type get selected index if index 0 index javatype length log warning java type index invalid index else if m javaconfig index null log warning java type config missing javatype index p panel f java type set selected index 0 else m javaconfig index init initjava p_panel fjavatype getselectedindex javatype m_javaconfig javatype p_panel fjavatype setselectedindex m_javaconfig test java return error message or null of ok public string test java int index p panel f java type get selected index if index 0 index javatype length return java type index invalid index else if m javaconfig index null return java type config class missing index return m javaconfig index test testjava p_panel fjavatype getselectedindex javatype m_javaconfig javatype m_javaconfig set java type param java type the java type to set public void set java type string java type int index 1 for int i 0 i javatype length i if javatype i equals java type index i break if index 1 index 0 log warning invalid java type java type p panel f java type set selected index index javatype javatype setjavatype javatype javatype javatype javatype p_panel fjavatype setselectedindex return returns the java type public string get java type return string p panel f java type get selected item javatype getjavatype p_panel fjavatype getselecteditem return returns the java home public string get java home return p panel f java home get text javahome getjavahome p_panel fjavahome gettext param java home the java home to set public void set java home string java home p panel f java home set text java home javahome javahome setjavahome javahome p_panel fjavahome settext javahome init apps server public void init apps server int index p panel f apps type get selected index if index 0 index appstype length log warning apps server type index invalid index else if m appsconfig index null log warning apps server type config missing appstype index p panel f apps type set selected index 0 else m appsconfig index init initappsserver p_panel fappstype getselectedindex appsservertype m_appsconfig appsservertype p_panel fappstype setselectedindex m_appsconfig test apps server return error message or null of ok public string test apps server int index p panel f apps type get selected index if index 0 index appstype length return apps server type index invalid index else if m appsconfig index null return apps server type config class missing index return m appsconfig index test testappsserver p_panel fappstype getselectedindex appsservertype m_appsconfig appsservertype m_appsconfig set apps server type param apps type the apps type to set public void set apps server type string apps type int index 1 for int i 0 i appstype length i if appstype i equals apps type index i break if index 1 index 0 log warning invalid apps type apps type p panel f apps type set selected index index appstype appstype setappsservertype appstype appstype appstype appstype p_panel fappstype setselectedindex get apps server type return apps server type public string get apps server type return string p panel f apps type get selected item getappsservertype p_panel fappstype getselecteditem return returns the apps server public string get apps server return p panel f apps server get text appsserver getappsserver p_panel fappsserver gettext param apps server the apps server to set public void set apps server string apps server p panel f apps server set text apps server appsserver appsserver setappsserver appsserver p_panel fappsserver settext appsserver return returns the apps server deploy dir public string get apps server deploy dir return p panel f deploy dir get text appsserverdeploydir getappsserverdeploydir p_panel fdeploydir gettext param apps server deploy dir the apps server deploy dir to set public void set apps server deploy dir string apps server deploy dir p panel f deploy dir set text apps server deploy dir appsserverdeploydir appsserverdeploydir setappsserverdeploydir appsserverdeploydir p_panel fdeploydir settext appsserverdeploydir param enable if true enable entry public void set apps server deploy dir boolean enable p panel f deploy dir set enabled enable p panel b deploy dir set enabled enable setappsserverdeploydir p_panel fdeploydir setenabled p_panel bdeploydir setenabled return returns the apps serverjnp port public int get apps serverjnp port try return integer parse int p panel fjnp port get text catch exception e set apps serverjnp port 0 return 0 appsserverjnpport getappsserverjnpport parseint p_panel fjnpport gettext setappsserverjnpport param apps serverjnp port the apps serverjnp port to set public void set apps serverjnp port string apps serverjnp port p panel fjnp port set text apps serverjnp port appsserverjnpport appsserverjnpport setappsserverjnpport appsserverjnpport p_panel fjnpport settext appsserverjnpport param enable if tre enable jnp entry public void set apps serverjnp port boolean enable p panel fjnp port set enabled enable setappsserverjnpport p_panel fjnpport setenabled return returns the apps serverssl port public int get apps serverssl port try return integer parse int p panel fssl port get text catch exception e set apps serverssl port 0 return 0 appsserversslport getappsserversslport parseint p_panel fsslport gettext setappsserversslport param apps serverssl port the apps serverssl port to set public void set apps serverssl port string apps serverssl port p panel fssl port set text apps serverssl port appsserversslport appsserversslport setappsserversslport appsserversslport p_panel fsslport settext appsserversslport param enable if tre enable ssl entry public void set apps serverssl port boolean enable p panel fssl port set enabled enable setappsserversslport p_panel fsslport setenabled return returns the apps server web port public int get apps server web port try return integer parse int p panel f web port get text catch exception e set apps server web port 0 return 0 appsserverwebport getappsserverwebport parseint p_panel fwebport gettext setappsserverwebport param apps server web port the apps server web port to set public void set apps server web port string apps server web port p panel f web port set text apps server web port appsserverwebport appsserverwebport setappsserverwebport appsserverwebport p_panel fwebport settext appsserverwebport param enable if tre enable web entry public void set apps server web port boolean enable p panel f web port set enabled enable setappsserverwebport p_panel fwebport setenabled init database param selected db public void init database string selected int index p panel f database type get selected index if index 0 index dbtype length log warning database type index invalid index else if m databaseconfig index null log warning database type config missing dbtype index p panel f database type set selected index 0 else m databaseconfig index init string databases m databaseconfig index discover databases selected default combo box model model new default combo box model databases p panel f database discovered set model model p panel f database discovered set enabled databases length 0 initdatabase p_panel fdatabasetype getselectedindex databasetype m_databaseconfig databasetype p_panel fdatabasetype setselectedindex m_databaseconfig m_databaseconfig discoverdatabases defaultcomboboxmodel defaultcomboboxmodel p_panel fdatabasediscovered setmodel p_panel fdatabasediscovered setenabled test database return error message or null of ok public string test database int index p panel f database type get selected index if index 0 index dbtype length return database type index invalid index else if m databaseconfig index null return database type config class missing index return m databaseconfig index test testdatabase p_panel fdatabasetype getselectedindex databasetype m_databaseconfig databasetype m_databaseconfig set database type param database type the database type to set public void set database type string database type int index 1 for int i 0 i dbtype length i if dbtype i equals database type index i break if index 1 index 0 log warning invalid database type database type p panel f database type set selected index index databasetype databasetype setdatabasetype databasetype databasetype databasetype databasetype p_panel fdatabasetype setselectedindex return returns the database type public string get database type return string p panel f database type get selected item databasetype getdatabasetype p_panel fdatabasetype getselecteditem return returns the database discovered public string get database discovered return string p panel f database discovered get selected item getdatabasediscovered p_panel fdatabasediscovered getselecteditem param database discovered the database discovered to set public void set database discovered string database discovered p panel f database discovered set selected item database discovered databasediscovered setdatabasediscovered databasediscovered p_panel fdatabasediscovered setselecteditem databasediscovered return returns the database name public string get database name return p panel f database name get text databasename getdatabasename p_panel fdatabasename gettext param database name the database name to set public void set database name string database name p panel f database name set text database name databasename databasename setdatabasename databasename p_panel fdatabasename settext databasename return returns the database user password public string get database password char pw p panel f database password get password if pw null return new string pw return getdatabasepassword p_panel fdatabasepassword getpassword param database password the database password to set public void set database password string database password p panel f database password set text database password databasepassword databasepassword setdatabasepassword databasepassword p_panel fdatabasepassword settext databasepassword return returns the database port public int get database port try return integer parse int p panel f database port get text catch exception e set database port 0 return 0 databaseport getdatabaseport parseint p_panel fdatabaseport gettext setdatabaseport get database port param database port the database port to set public void set database port string database port p panel f database port set text database port getdatabaseport databaseport databaseport setdatabaseport databaseport p_panel fdatabaseport settext databaseport return returns the database server public string get database server return p panel f database server get text databaseserver getdatabaseserver p_panel fdatabaseserver gettext param database server the database server to set public void set database server string database server p panel f database server set text database server databaseserver databaseserver setdatabaseserver databaseserver p_panel fdatabaseserver settext databaseserver return returns the database system password public string get database system password char pw p panel f system password get password if pw null return new string pw return databasesystempassword getdatabasesystempassword p_panel fsystempassword getpassword param database system password the database system password to set public void set database system password string database system password p panel f system password set text database system password databasesystempassword databasesystempassword setdatabasesystempassword databasesystempassword p_panel fsystempassword settext databasesystempassword return returns the database user public string get database user return p panel f database user get text databaseuser getdatabaseuser p_panel fdatabaseuser gettext param database user the database user to set public void set database user string database user p panel f database user set text database user databaseuser databaseuser setdatabaseuser databaseuser p_panel fdatabaseuser settext databaseuser get parameters protected void prepare p ad client id getrecord id if p ad client id 0 p ad client id env getad client id get ctx p_ad_client_id getrecord_id p_ad_client_id p_ad_client_id getad_client_id getctx process test e mail return info protected string do it throws exception m client client m client get get ctx p ad client id log info client to string test client mail string client test client teste mail add log 0 null null client get name client test test client document dir if ini is client string document dir client get document dir if document dir null document dir length 0 document dir file file new file document dir if file exists file is directory add log 0 null null found directory client get document dir else add log 0 null null not found directory client get document dir m store wstores m store get of client client for int i 0 i wstores length i m store store wstores i string test store teste mail add log 0 null null store get name test return client test email doit mclient mclient getctx p_ad_client_id tostring clienttest testemail addlog getname clienttest documentdir isclient documentdir getdocumentdir documentdir documentdir documentdir documentdir isdirectory addlog getdocumentdir addlog getdocumentdir mstore mstore getofclient mstore testemail addlog getname clienttest get client log handler param create create if not exists return handler public static c log error buffer get boolean create if s handler null create s handler new c log error buffer return s handler clogerrorbuffer s_handler s_handler clogerrorbuffer s_handler constructor public c log error buffer if s handler null s handler this else report error error handler exists already new illegal state exception existing handler error manager generic failure initialize clogerrorbuffer s_handler s_handler reporterror illegalstateexception errormanager generic_failure initialize private void initialize system out println c log console initialize foratting set formatter c log formatter get default level super set level level info filter set filter c log filter get clogconsole setformatter clogformatter setlevel setfilter clogfilter issue error return true if issue error public boolean is issue error return m issueerror isissueerror m_issueerror set issue error param issue error issue error public void set issue error boolean issue error m issueerror issue error issueerror setissueerror issueerror m_issueerror issueerror set level ignore off and higer then fine see java util logging handler set level java util logging level param new level ignored throws java lang security exception public synchronized void set level level new level throws security exception if new level null return if new level level off super set level level severe else if new level level all new level level finest new level level finer super set level level fine else super set level new level setlevel newlevel securityexception setlevel newlevel securityexception newlevel newlevel setlevel newlevel newlevel newlevel setlevel setlevel newlevel publish see java util logging handler publish java util logging log record param record log record public void publish log record record if is loggable record m logs null return output synchronized m logs if m logs size log size m logs remove first m logs add record we have an error if record get level level severe if m errors size error size m errors remove first m history remove first add error m errors add record record get source class name forces class name eval create history array list log record history new array list log record for int i m logs size 1 i 0 i log record rec log record m logs get i if rec get level level severe if history size 0 history add rec else break don t incluse previous error else history add rec if history size 10 break no more then 10 history records log record history array new log record history size int no 0 for int i history size 1 i 0 i history array no log record history get i m history add history array issue reporting if m issueerror string logger name record get logger name class name string class name record get source class name physical class string method name record get source method name if db is connected method name equals save error method name equals get value method name equals data save logger name index of issue 1 logger name index of c connection 1 m issueerror false m issue create record m issueerror true logrecord logrecord isloggable m_logs m_logs m_logs log_size m_logs removefirst m_logs getlevel m_errors error_size m_errors removefirst m_history removefirst m_errors getsourceclassname arraylist logrecord arraylist logrecord m_logs logrecord logrecord m_logs getlevel logrecord historyarray logrecord historyarray logrecord m_history historyarray m_issueerror loggername getloggername classname getsourceclassname methodname getsourcemethodname isconnected methodname saveerror methodname get_value methodname datasave loggername indexof loggername indexof cconnection m_issueerror missue m_issueerror flush nop see java util logging handler flush public void flush close see java util logging handler close throws security exception public void close throws security exception if m logs null m logs clear m logs null if m errors null m errors clear m errors null if m history null m history clear m history null securityexception securityexception m_logs m_logs m_logs m_errors m_errors m_errors m_history m_history m_history get column names of log entries param ctx context not used public vector string get column names properties ctx vector string cn new vector string cn add time cn add level cn add class method cn add message 2 cn add parameter cn add trace return cn columnnames getcolumnnames get log data param errors only if true errors otherwise log return data array public vector vector get log data boolean errors only log record records get records errors only system out println get log data events length vector vector rows new vector vector records length for int i 0 i records length i log record record records i vector object cols new vector object cols add new timestamp record get millis cols add record get level get name cols add c log formatter get class method record cols add record get message cols add c log formatter get parameters record cols add c log formatter get exception trace record rows add cols return rows errorsonly getlogdata errorsonly logrecord getrecords errorsonly getlogdata logrecord getmillis getlevel getname clogformatter getclassmethod getmessage clogformatter getparameters clogformatter getexceptiontrace get array of events with most recent first param errors only if true errors otherwise log return array of events public log record get records boolean errors only log record ret value null if errors only synchronized m errors ret value new log record m errors size m errors to array ret value else synchronized m logs ret value new log record m logs size m logs to array ret value return ret value errorsonly logrecord getrecords errorsonly logrecord retvalue errorsonly m_errors retvalue logrecord m_errors m_errors toarray retvalue m_logs retvalue logrecord m_logs m_logs toarray retvalue retvalue reset error buffer param errors only if true errors otherwise log public void reset buffer boolean errors only synchronized m errors m errors clear m history clear if errors only synchronized m logs m logs clear errorsonly resetbuffer errorsonly m_errors m_errors m_history errorsonly m_logs m_logs get put error info in string param ctx context param errors only if true errors otherwise log return error info public string get error info properties ctx boolean errors only string buffer sb new string buffer if errors only for int i 0 i m history size i sb append n log record records log record m history get i for int j 0 j records length j log record record records j sb append get formatter format record else for int i 0 i m logs size i log record record log record m logs get i sb append get formatter format record sb append n c log mgt get info sb c log mgt get info detail sb ctx return sb to string errorsonly geterrorinfo errorsonly stringbuffer stringbuffer errorsonly m_history logrecord logrecord m_history logrecord getformatter m_logs logrecord logrecord m_logs getformatter clogmgt getinfo clogmgt getinfodetail tostring string representation return info public string to string string buffer sb new string buffer c log error buffer sb append errors append m errors size append history append m history size append logs append m logs size append level append get level append return sb to string tostring stringbuffer stringbuffer clogerrorbuffer m_errors m_history m_logs getlevel tostring standard constructor public x c commissionrun properties ctx int c commissionrun id string trx name super ctx c commissionrun id trx name if c commissionrun id 0 setc commissionrun id 0 setc commission id 0 set document no null set grand total env zero set processed false set start date new timestamp system current time millis x_c_commissionrun c_commissionrun_id trxname c_commissionrun_id trxname c_commissionrun_id setc_commissionrun_id setc_commission_id setdocumentno setgrandtotal setprocessed setstartdate currenttimemillis load constructor public x c commissionrun properties ctx result set rs string trx name super ctx rs trx name x_c_commissionrun resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c commissionrun append get id append return sb to string tostring stringbuffer stringbuffer x_c_commissionrun get_id tostring set commission run commission run or process public void setc commissionrun id int c commissionrun id if c commissionrun id 1 throw new illegal argument exception c commissionrun id is mandatory set valuenocheck c commissionrun id new integer c commissionrun id setc_commissionrun_id c_commissionrun_id c_commissionrun_id illegalargumentexception c_commissionrun_id set_valuenocheck c_commissionrun_id c_commissionrun_id get commission run commission run or process public int getc commissionrun id integer ii integer get value c commissionrun id if ii null return 0 return ii int value getc_commissionrun_id get_value c_commissionrun_id intvalue set commission commission public void setc commission id int c commission id if c commission id 1 throw new illegal argument exception c commission id is mandatory set valuenocheck c commission id new integer c commission id setc_commission_id c_commission_id c_commission_id illegalargumentexception c_commission_id set_valuenocheck c_commission_id c_commission_id get commission commission public int getc commission id integer ii integer get value c commission id if ii null return 0 return ii int value getc_commission_id get_value c_commission_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set grand total total amount of document public void set grand total big decimal grand total if grand total null throw new illegal argument exception grand total is mandatory set valuenocheck grand total grand total setgrandtotal bigdecimal grandtotal grandtotal illegalargumentexception grandtotal set_valuenocheck grandtotal grandtotal get grand total total amount of document public big decimal get grand total big decimal bd big decimal get value grand total if bd null return env zero return bd bigdecimal getgrandtotal bigdecimal bigdecimal get_value grandtotal set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set start date first effective day inclusive public void set start date timestamp start date if start date null throw new illegal argument exception start date is mandatory set value start date start date setstartdate startdate startdate illegalargumentexception startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate get activities for table tecord param ctx context param ad table id table param record id record param active only if true only not processed records are returned return activity public static mwf activity get properties ctx int ad table id int record id boolean active only array list mwf activity list new array list mwf activity prepared statement pstmt null string sql select from ad wf activity where ad table id and record id if active only sql and processed y sql order by ad wf activity id try pstmt db prepare statement sql null pstmt set int 1 ad table id pstmt set int 2 record id result set rs pstmt execute query while rs next list add new mwf activity ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null mwf activity ret value new mwf activity list size list to array ret value return ret value ad_table_id record_id activeonly mwfactivity ad_table_id record_id activeonly arraylist mwfactivity arraylist mwfactivity preparedstatement ad_wf_activity ad_table_id record_id activeonly ad_wf_activity_id preparestatement setint ad_table_id setint record_id resultset executequery mwfactivity s_log mwfactivity retvalue mwfactivity toarray retvalue retvalue get active info param ctx context param ad table id table param record id record return activity summary public static string get active info properties ctx int ad table id int record id mwf activity acts get ctx ad table id record id true if acts null acts length 0 return null string buffer sb new string buffer for int i 0 i acts length i if i 0 sb append n mwf activity activity acts i sb append activity to stringx return sb to string ad_table_id record_id getactiveinfo ad_table_id record_id mwfactivity ad_table_id record_id stringbuffer stringbuffer mwfactivity tostringx tostring standard constructor param ctx context param ad wf activity id id public mwf activity properties ctx int ad wf activity id string trx name super ctx ad wf activity id trx name if ad wf activity id 0 throw new illegal argument exception cannot create new wf activity directly m state new state engine getwf state ad_wf_activity_id mwfactivity ad_wf_activity_id trxname ad_wf_activity_id trxname ad_wf_activity_id illegalargumentexception m_state stateengine getwfstate load constructor param ctx context param rs result set public mwf activity properties ctx result set rs string trx name super ctx rs trx name m state new state engine getwf state mwfactivity resultset trxname trxname m_state stateengine getwfstate parent contructor param process process param ad wf node id start node public mwf activity mwf process process int ad wf node id super process get ctx 0 process get trxname setad wf process id process getad wf process id set priority process get priority document link setad table id process getad table id setrecord id process getrecord id status super setwf state wfstate notstarted m state new state engine getwf state set processed false set workflow node setad workflow id process getad workflow id setad wf node id ad wf node id node priority end duration mwf node node mwf node get get ctx ad wf node id int priority node get priority if priority 0 priority get priority set priority priority long limitms node get limitms if limitms 0 set end wait time new timestamp limitms system current time millis responsible set responsible process save m audit new mwf event audit this m audit save m process process ad_wf_node_id mwfactivity mwfprocess ad_wf_node_id getctx get_trxname setad_wf_process_id getad_wf_process_id setpriority getpriority setad_table_id getad_table_id setrecord_id getrecord_id setwfstate wfstate_notstarted m_state stateengine getwfstate setprocessed setad_workflow_id getad_workflow_id setad_wf_node_id ad_wf_node_id mwfnode mwfnode getctx ad_wf_node_id getpriority getpriority setpriority getlimitms setendwaittime currenttimemillis setresponsible m_audit mwfeventaudit m_audit m_process get state return state public state engine get state return m state stateengine getstate m_state set activity state param wf state public void setwf state string wf state if m state null m state new state engine getwf state if m state is closed return if getwf state equals wf state return if m state is valid new state wf state string old state getwf state log fine old state wf state msg get text msg super setwf state wf state m state new state engine getwf state save closed in mwf process check activities update event audit inform process if m process null m process new mwf process get ctx getad wf process id null m process check activities else string msg set wf state ignored invalid transformation new wf state current getwf state log log level severe msg trace print stack set text msg msg save wfstate setwfstate wfstate m_state m_state stateengine getwfstate m_state isclosed getwfstate wfstate m_state isvalidnewstate wfstate oldstate getwfstate oldstate wfstate gettextmsg setwfstate wfstate m_state stateengine getwfstate mwfprocess checkactivities updateeventaudit m_process m_process mwfprocess getctx getad_wf_process_id m_process checkactivities wfstate wfstate getwfstate printstack settextmsg is activity closed public boolean is closed return m state is closed isclosed m_state isclosed update event audit private void update event audit log fine update event audit get event audit m audit set text msg get text msg m audit setwf state getwf state if m newvalue null m audit set new value m newvalue if m state is closed m audit set event type mwf event audit eventtype processcompleted long ms system current time millis m audit get created get time m audit set elapsed timems new big decimal ms else m audit set event type mwf event audit eventtype statechanged m audit save updateeventaudit updateeventaudit geteventaudit m_audit settextmsg gettextmsg m_audit setwfstate getwfstate m_newvalue m_audit setnewvalue m_newvalue m_state isclosed m_audit seteventtype mwfeventaudit eventtype_processcompleted currenttimemillis m_audit getcreated gettime m_audit setelapsedtimems bigdecimal m_audit seteventtype mwfeventaudit eventtype_statechanged m_audit get create event audit return event public mwf event audit get event audit if m audit null return m audit mwf event audit events mwf event audit get get ctx getad wf process id getad wf node id if events null events length 0 m audit new mwf event audit this else m audit events events length 1 last event return m audit mwfeventaudit geteventaudit m_audit m_audit mwfeventaudit mwfeventaudit getctx getad_wf_process_id getad_wf_node_id m_audit mwfeventaudit m_audit m_audit get persistent object in transaction return po public po getpo trx trx if m po null return m po m table table m table get get ctx getad table id if trx null m po table getpo getrecord id trx get trx name else m po table getpo getrecord id null return m po m_po m_po m_table m_table getctx getad_table_id m_po getrecord_id gettrxname m_po getrecord_id m_po get persistent object return po public po getpo return getpo null get po ad client id return client of po public int getpo ad client id if m po null getpo null if m po null return m po getad client id return 0 ad_client_id getpo_ad_client_id m_po m_po m_po getad_client_id get attribute value based on node of po return attribute value or null public object get attribute value mwf node node get node if node null return null int ad column id node getad column id if ad column id 0 return null po po getpo if po get id 0 return null return po get valueofcolumn ad column id getattributevalue mwfnode getnode ad_column_id getad_column_id ad_column_id get_id get_valueofcolumn ad_column_id is so trx return so trx or of not found true public boolean isso trx po po getpo if po get id 0 return true is there a column int index po get columnindex isso trx if index 0 if po get tablename starts with m return false return true we have a column try boolean isso trx boolean po get value index return isso trx boolean value catch exception e log log level severe e return true issotrx get_id get_columnindex issotrx get_tablename startswith m_ issotrx get_value issotrx booleanvalue set ad wf node id re set to not started param ad wf node id now node public void setad wf node id int ad wf node id if ad wf node id 0 throw new illegal argument exception workflow node is not defined super setad wf node id ad wf node id if wfstate notstarted equals getwf state super setwf state wfstate notstarted m state new state engine getwf state if is processed set processed false ad_wf_node_id ad_wf_node_id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception setad_wf_node_id ad_wf_node_id wfstate_notstarted getwfstate setwfstate wfstate_notstarted m_state stateengine getwfstate isprocessed setprocessed get wf node return node public mwf node get node if m node null m node mwf node get get ctx getad wf node id return m node mwfnode getnode m_node m_node mwfnode getctx getad_wf_node_id m_node get wf node name return translated node name public string get node name return get node get name true getnodename getnode getname get node description return translated node description public string get node description return get node get description true getnodedescription getnode getdescription get node help return translated node help public string get node help return get node get help true getnodehelp getnode gethelp is this an user approval step return true if user approval public boolean is user approval return get node is user approval isuserapproval getnode isuserapproval is this a manual user step return true if window form public boolean is user manual return get node is user manual isusermanual getnode isusermanual is this a user choice step return true if user choice public boolean is user choice return get node is user choice isuserchoice getnode isuserchoice set text msg add to existing param text msg public void set text msg string text msg if text msg null text msg length 0 return string old text get text msg if old text null old text length 0 super set text msg util trim size text msg 1000 else if text msg null text msg length 0 super set text msg util trim size old text n text msg 1000 textmsg settextmsg textmsg textmsg textmsg oldtext gettextmsg oldtext oldtext settextmsg trimsize textmsg textmsg textmsg settextmsg trimsize oldtext textmsg add to text msg param obj some object public void add text msg object obj if obj null return string buffer text msg new string buffer obj to string if obj instanceof exception exception ex exception obj while ex null stack trace element st ex get stack trace for int i 0 i st length i stack trace element ste st i if i 0 ste get class name starts with org compiere text msg append append i append append ste to string append n if ex get cause instanceof exception ex exception ex get cause else ex null string old text get text msg if old text null old text length 0 super set text msg util trim size text msg to string 1000 else if text msg null text msg length 0 super set text msg util trim size old text n text msg to string 1000 addtextmsg stringbuffer textmsg stringbuffer tostring stacktraceelement getstacktrace stacktraceelement getclassname startswith textmsg tostring getcause getcause oldtext gettextmsg oldtext oldtext settextmsg trimsize textmsg tostring textmsg textmsg settextmsg trimsize oldtext textmsg tostring get wf state text return state text public string getwf state text return m ref list get list name get ctx wfstate ad reference id getwf state getwfstatetext mreflist getlistname getctx wfstate_ad_reference_id getwfstate set responsible and user from process node param process process private void set responsible mwf process process responsible int ad wf responsible id get node getad wf responsible id if ad wf responsible id 0 not defined on node level ad wf responsible id process getad wf responsible id setad wf responsible id ad wf responsible id mwf responsible resp get responsible user directly responsible int ad user id resp getad user id invoker get sales rep or last updater of document if ad user id 0 resp is invoker ad user id process getad user id setad user id ad user id setresponsible mwfprocess ad_wf_responsible_id getnode getad_wf_responsible_id ad_wf_responsible_id ad_wf_responsible_id getad_wf_responsible_id setad_wf_responsible_id ad_wf_responsible_id mwfresponsible getresponsible ad_user_id getad_user_id ad_user_id isinvoker ad_user_id getad_user_id setad_user_id ad_user_id get responsible return responsible public mwf responsible get responsible mwf responsible resp mwf responsible get get ctx getad wf responsible id return resp mwfresponsible getresponsible mwfresponsible mwfresponsible getctx getad_wf_responsible_id is invoker no user no role return true if invoker public boolean is invoker return get responsible is invoker isinvoker getresponsible isinvoker get approval user if the returned user is the same the document is approved param ad user id starting user param c currency id currency param amount amount param ad org id document organization param own document the document is owned by ad user id return ad user id if 1 no approver public int get approval user int ad user id int c currency id big decimal amount int ad org id boolean own document nothing to approve if amount null amount signum 0 return ad user id starting user m user user m user get get ctx ad user id log info for user user amt amount own own document m user old user null while user null if user equals old user log info loop user get name return 1 old user user log fine user user get name get roles of user m role roles user get roles ad org id for int i 0 i roles length i m role role roles i if own document role is can approve own doc continue find a role with allows them to approve own big decimal role amt role get amt approval if role amt null role amt signum 0 continue if c currency id role getc currency id role getc currency id 0 no currency amt only role amt m conversion rate convert get ctx today default rate role amt role getc currency id c currency id getad client id ad org id if role amt null role amt signum 0 continue boolean approved amount compare to role amt 0 log fine approved approved user user get name role role get name approval amt role amt if approved return user getad user id find next user get supervisor if user getsupervisor id 0 user m user get get ctx user getsupervisor id log fine supervisor user get name else log fine no supervisor m org org m org get get ctx ad org id m org info org info org get info get org supervisor if org info getsupervisor id 0 user m user get get ctx org info getsupervisor id log fine org org get name supervisor user get name else log fine no org supervisor get parent org supervisor if org info getparent org id 0 org m org get get ctx org info getparent org id org info org get info if org info getsupervisor id 0 user m user get get ctx org info getsupervisor id log fine parent org supervisor user get name no supervisor while there is a user to approve log fine no user found return 1 ad_user_id c_currency_id ad_org_id owndocument ad_user_id ad_user_id getapprovaluser ad_user_id c_currency_id bigdecimal ad_org_id owndocument ad_user_id muser muser getctx ad_user_id owndocument muser olduser olduser getname olduser getname mrole getroles ad_org_id mrole owndocument iscanapproveowndoc bigdecimal roleamt getamtapproval roleamt roleamt c_currency_id getc_currency_id getc_currency_id roleamt mconversionrate getctx roleamt getc_currency_id c_currency_id getad_client_id ad_org_id roleamt roleamt compareto roleamt getname getname approvalamt roleamt getad_user_id getsupervisor_id muser getctx getsupervisor_id getname morg morg getctx ad_org_id morginfo orginfo getinfo orginfo getsupervisor_id muser getctx orginfo getsupervisor_id getname getname orginfo getparent_org_id morg getctx orginfo getparent_org_id orginfo getinfo orginfo getsupervisor_id muser getctx orginfo getsupervisor_id getname execute work called from mwf process start next feedback to process via setwf state check activities public void run log info node get node m newvalue null if m state is valid action state engine action start set text msg state getwf state cannot start setwf state state engine state terminated return setwf state state engine state running trx trx trx get trx create trx name wf true try if get node get id 0 set text msg node not found ad wf node id getad wf node id setwf state state engine state aborted return do work trx start boolean done perform work trx setwf state done state engine state completed state engine state suspended trx end trx commit trx close if m postimmediate null post immediate catch exception e log log level warning get node e trx rollback trx rollback trx close if e get cause null log log level warning cause e get cause string process msg e get localized message if process msg null process msg length 0 process msg e get message set text msg process msg add text msg e setwf state state engine state terminated mwfprocess startnext setwfstate checkactivities getnode m_newvalue m_state isvalidaction stateengine action_start settextmsg getwfstate setwfstate stateengine state_terminated setwfstate stateengine state_running createtrxname getnode get_id settextmsg ad_wf_node_id getad_wf_node_id setwfstate stateengine state_aborted performwork setwfstate stateengine state_completed stateengine state_suspended m_postimmediate postimmediate getnode getcause getcause processmsg getlocalizedmessage processmsg processmsg processmsg getmessage settextmsg processmsg addtextmsg setwfstate stateengine state_terminated perform work set text msg return true if completed false otherwise throws exception if error private boolean perform work trx trx throws exception log info m node trx get trx name m postimmediate null if m node get priority 0 overwrite priority if defined set priority m node get priority string action m node get action sleep start end if mwf node action waitsleep equals action log fine sleep wait time m node get wait time if m node get waiting time 0 return true done calendar cal calendar get instance cal add m node get duration calendar field m node get wait time set end wait time new timestamp cal get time in millis return false not done document action else if mwf node action documentaction equals action log fine document action m node get doc action getpo trx if m po null throw new exception persistent object not found ad table id getad table id record id getrecord id m po set trxname trx get trx name boolean success false string process msg null if m po instanceof doc action doc action doc doc action m po success doc process it m node get doc action do the work set text msg doc get summary process msg doc get process msg post immediate if success doc action action complete equals m node get doc action m client client m client get doc get ctx doc getad client id if client is post immediate m postimmediate doc if m process null m process set process msg process msg else throw new illegal state exception persistent object not doc action m po get class get name ad table id getad table id record id getrecord id if m po save success false process msg save error if success if process msg null process msg length 0 process msg perform work error m node to stringx throw new exception process msg return success document action report else if mwf node action appsreport equals action log fine report ad process id m node getad process id process m process process m process get get ctx m node getad process id if process is report process getad reportview id 0 throw new illegal state exception not a report ad process id m node getad process id process info pi new process info m node get name true m node getad process id getad table id getrecord id pi setad user id getad user id pi setad client id getad client id mp instance p instance new mp instance process getrecord id fill parameter p instance trx pi setad pinstance id p instance getad pinstance id report report engine re report engine get get ctx pi if re null throw new illegal state exception cannot create report ad process id m node getad process id file report re getpdf notice int ad message id 753 hardcoded workflow result m note note new m note get ctx ad message id getad user id trx get trx name note set text msg m node get name true note set description m node get description true note set record getad table id getrecord id note save attachment m attachment attachment new m attachment get ctx m note table id note getad note id get trxname attachment add entry report attachment set text msg m node get name true attachment save return true process else if mwf node action appsprocess equals action log fine process ad process id m node getad process id process m process process m process get get ctx m node getad process id process info pi new process info m node get name true m node getad process id getad table id getrecord id pi setad user id getad user id pi setad client id getad client id mp instance p instance new mp instance process getrecord id fill parameter p instance trx pi setad pinstance id p instance getad pinstance id return process process it pi trx todo start task else if mwf node action appstask equals action log warning task ad task id m node getad task id e mail else if mwf node action email equals action log fine e mail e mail recipient m node gete mail recipient getpo trx if m po null throw new exception persistent object not found ad table id getad table id record id getrecord id if m po instanceof doc action m emails new array list string sende mail set text msg m emails to string return true done e mail set variable else if mwf node action setvariable equals action string value m node get attribute value log fine set variable ad column id m node getad column id to value m column column m node get column int dt column getad reference id return set variable value dt null set variable todo start wf instance else if mwf node action subworkflow equals action log warning workflow ad workflow id m node getad workflow id user choice else if mwf node action userchoice equals action log fine user choice ad column id m node getad column id approval if m node is user approval getpo instanceof doc action doc action doc doc action m po boolean auto approval false approval hierarchy if is invoker set approver int startad user id getad user id if startad user id 0 startad user id doc getdoc user id int nextad user id get approval user startad user id doc getc currency id doc get approval amt doc getad org id startad user id doc getdoc user id own doc same user approved auto approval startad user id nextad user id if auto approval setad user id nextad user id else fixed approver mwf responsible resp get responsible auto approval resp getad user id getad user id if auto approval resp getad user id 0 setad user id resp getad user id if auto approval doc process it doc action action approve doc save return true done approval return false wait for user user workbench else if mwf node action userworkbench equals action log fine workbench return false user form else if mwf node action userform equals action log fine form ad form id m node getad form id return false user window else if mwf node action userwindow equals action log fine window ad window id m node getad window id return false throw new illegal argument exception invalid action not implemented action performwork m_node gettrxname m_postimmediate m_node getpriority setpriority m_node getpriority m_node getaction mwfnode action_waitsleep waittime m_node getwaittime m_node getwaitingtime getinstance m_node getdurationcalendarfield m_node getwaittime setendwaittime gettimeinmillis mwfnode action_documentaction documentaction m_node getdocaction m_po ad_table_id getad_table_id record_id getrecord_id m_po set_trxname gettrxname processmsg m_po docaction docaction docaction m_po processit m_node getdocaction settextmsg getsummary processmsg getprocessmsg docaction action_complete m_node getdocaction mclient mclient getctx getad_client_id ispostimmediate m_postimmediate m_process m_process setprocessmsg processmsg illegalstateexception docaction m_po getclass getname ad_table_id getad_table_id record_id getrecord_id m_po processmsg saveerror processmsg processmsg processmsg performwork m_node tostringx processmsg documentaction mwfnode action_appsreport ad_process_id m_node getad_process_id mprocess mprocess getctx m_node getad_process_id isreport getad_reportview_id illegalstateexception ad_process_id m_node getad_process_id processinfo processinfo m_node getname m_node getad_process_id getad_table_id getrecord_id setad_user_id getad_user_id setad_client_id getad_client_id mpinstance pinstance mpinstance getrecord_id fillparameter pinstance setad_pinstance_id pinstance getad_pinstance_id reportengine reportengine getctx illegalstateexception ad_process_id m_node getad_process_id ad_message_id workflowresult mnote mnote getctx ad_message_id getad_user_id gettrxname settextmsg m_node getname setdescription m_node getdescription setrecord getad_table_id getrecord_id mattachment mattachment getctx mnote table_id getad_note_id get_trxname addentry settextmsg m_node getname mwfnode action_appsprocess ad_process_id m_node getad_process_id mprocess mprocess getctx m_node getad_process_id processinfo processinfo m_node getname m_node getad_process_id getad_table_id getrecord_id setad_user_id getad_user_id setad_client_id getad_client_id mpinstance pinstance mpinstance getrecord_id fillparameter pinstance setad_pinstance_id pinstance getad_pinstance_id processit mwfnode action_appstask ad_task_id m_node getad_task_id email mwfnode action_email email emailrecipient m_node getemailrecipient m_po ad_table_id getad_table_id record_id getrecord_id m_po docaction m_emails arraylist sendemail settextmsg m_emails tostring email mwfnode action_setvariable m_node getattributevalue setvariable ad_column_id m_node getad_column_id m_column m_node getcolumn getad_reference_id setvariable setvariable mwfnode action_subworkflow ad_workflow_id m_node getad_workflow_id mwfnode action_userchoice userchoice ad_column_id m_node getad_column_id m_node isuserapproval docaction docaction docaction m_po autoapproval isinvoker startad_user_id getad_user_id startad_user_id startad_user_id getdoc_user_id nextad_user_id getapprovaluser startad_user_id getc_currency_id getapprovalamt getad_org_id startad_user_id getdoc_user_id autoapproval startad_user_id nextad_user_id autoapproval setad_user_id nextad_user_id mwfresponsible getresponsible autoapproval getad_user_id getad_user_id autoapproval getad_user_id setad_user_id getad_user_id autoapproval processit docaction action_approve mwfnode action_userworkbench mwfnode action_userform ad_form_id m_node getad_form_id mwfnode action_userwindow ad_window_id m_node getad_window_id illegalargumentexception set variable param value new value param display type display type param text msg optional message return true if set throws exception if error private boolean set variable string value int display type string text msg throws exception m newvalue null getpo if m po null throw new exception persistent object not found ad table id getad table id record id getrecord id set value object db value null if value null else if display type display type yes no db value new boolean y equals value else if display type is numeric display type db value new big decimal value else db value value m po set valueofcolumn get node getad column id db value m po save if db value equals m po get valueofcolumn get node getad column id throw new exception persistent object not updated ad table id getad table id record id getrecord id should value is m po get valueofcolumn m node getad column id info string msg get node get attribute name value if text msg null text msg length 0 msg text msg set text msg msg m newvalue value return true displaytype textmsg setvariable displaytype textmsg m_newvalue m_po ad_table_id getad_table_id record_id getrecord_id dbvalue displaytype displaytype yesno dbvalue displaytype isnumeric displaytype dbvalue bigdecimal dbvalue m_po set_valueofcolumn getnode getad_column_id dbvalue m_po dbvalue m_po get_valueofcolumn getnode getad_column_id ad_table_id getad_table_id record_id getrecord_id m_po get_valueofcolumn m_node getad_column_id getnode getattributename textmsg textmsg textmsg settextmsg m_newvalue set user choice param ad user id user param value new value param display type display type param text msg optional message return true if set throws exception if error public boolean set user choice int ad user id string value int display type string text msg throws exception check if user approves own document when a role is reponsible if get node is user approval getpo instanceof doc action doc action doc doc action m po m user user new m user get ctx ad user id null m role roles user get roles m po getad org id boolean can approve own doc false for int r 0 r roles length r if roles r is can approve own doc can approve own doc true break found a role which allows to approve own document if can approve own doc string info user get name cannot approve own document doc add text msg info log fine info return false ignore setwf state state engine state running setad user id ad user id boolean ok set variable value display type text msg if ok return false string new state state engine state completed approval if get node is user approval getpo instanceof doc action doc action doc doc action m po try not pproved if y equals value new state state engine state aborted if doc process it doc action action reject set text msg cannot reject document status doc get doc status else if is invoker int startad user id getad user id if startad user id 0 startad user id doc getdoc user id int nextad user id get approval user startad user id doc getc currency id doc get approval amt doc getad org id startad user id doc getdoc user id own doc no approver if nextad user id 0 new state state engine state aborted set text msg cannot approve no approver doc process it doc action action reject else if startad user id nextad user id forward to nextad user id next approver new state state engine state suspended else approve if doc process it doc action action approve new state state engine state aborted set text msg cannot approve document status doc get doc status no invoker approve else if doc process it doc action action approve new state state engine state aborted set text msg cannot approve document status doc get doc status doc save catch exception e new state state engine state terminated set text msg user choice e to string log log level warning e send approval notification if new state equals state engine state aborted m client client m client get get ctx doc getad client id client sende mail doc getdoc user id doc get document info msg get msg get ctx not approved doc get summary n doc get process msg n get text msg doc createpdf setwf state new state return ok ad_user_id displaytype textmsg setuserchoice ad_user_id displaytype textmsg getnode isuserapproval docaction docaction docaction m_po muser muser getctx ad_user_id mrole getroles m_po getad_org_id canapproveowndoc iscanapproveowndoc canapproveowndoc canapproveowndoc getname addtextmsg setwfstate stateengine state_running setad_user_id ad_user_id setvariable displaytype textmsg newstate stateengine state_completed getnode isuserapproval docaction docaction docaction m_po newstate stateengine state_aborted processit docaction action_reject settextmsg getdocstatus isinvoker startad_user_id getad_user_id startad_user_id startad_user_id getdoc_user_id nextad_user_id getapprovaluser startad_user_id getc_currency_id getapprovalamt getad_org_id startad_user_id getdoc_user_id nextad_user_id newstate stateengine state_aborted settextmsg processit docaction action_reject startad_user_id nextad_user_id forwardto nextad_user_id newstate stateengine state_suspended processit docaction action_approve newstate stateengine state_aborted settextmsg getdocstatus processit docaction action_approve newstate stateengine state_aborted settextmsg getdocstatus newstate stateengine state_terminated settextmsg tostring newstate stateengine state_aborted mclient mclient getctx getad_client_id sendemail getdoc_user_id getdocumentinfo getmsg getctx notapproved getsummary getprocessmsg gettextmsg setwfstate newstate forward to param ad user id user param text msg text message return true if forwarded public boolean forward to int ad user id string text msg if ad user id getad user id log log level warning same user ad user id ad user id return false m user old user m user get get ctx getad user id m user user m user get get ctx ad user id if user null user get id 0 log log level warning does not exist ad user id ad user id return false update setad user id user getad user id set text msg text msg save close up old event get event audit m audit setad user id old user getad user id m audit set text msg get text msg m audit set attribute name ad user id m audit set old value old user get name old user getad user id m audit set new value user get name user getad user id m audit setwf state getwf state m audit set event type mwf event audit eventtype statechanged long ms system current time millis m audit get created get time m audit set elapsed timems new big decimal ms m audit save create new one m audit new mwf event audit this m audit save return true ad_user_id textmsg forwardto ad_user_id textmsg ad_user_id getad_user_id ad_user_id ad_user_id muser olduser muser getctx getad_user_id muser muser getctx ad_user_id get_id ad_user_id ad_user_id setad_user_id getad_user_id settextmsg textmsg geteventaudit m_audit setad_user_id olduser getad_user_id m_audit settextmsg gettextmsg m_audit setattributename ad_user_id m_audit setoldvalue olduser getname olduser getad_user_id m_audit setnewvalue getname getad_user_id m_audit setwfstate getwfstate m_audit seteventtype mwfeventaudit eventtype_statechanged currenttimemillis m_audit getcreated gettime m_audit setelapsedtimems bigdecimal m_audit m_audit mwfeventaudit m_audit set user confirmation param text msg optional message public void set user confirmation int ad user id string text msg log fine text msg setwf state state engine state running setad user id ad user id if text msg null set text msg text msg setwf state state engine state completed textmsg setuserconfirmation ad_user_id textmsg textmsg setwfstate stateengine state_running setad_user_id ad_user_id textmsg settextmsg textmsg setwfstate stateengine state_completed fill parameter param p instance process instance private void fill parameter mp instance p instance trx trx getpo trx mwf node para n params m node get parameters mp instance para i params p instance get parameters for int pi 0 pi i params length pi mp instance para i para i params pi for int np 0 np n params length np mwf node para n para n params np if i para get parameter name equals n para get attribute name string variable name n para get attribute value log fine n para get attribute name variable name value constant variable object value variable name if variable name null variable name length 0 value null else if variable name index of 1 m po null we have a variable strip int index variable name index of string column name variable name substring index 1 index column name index of if index 1 log warning n para get attribute name cannot evaluate variable name break column name column name substring 0 index index m po get columnindex column name if index 1 value m po get value index else not a column try env string env env get context get ctx column name if env length 0 log warning n para get attribute name not column nor environment column name variable name break else value env variable no value if value null if n para is mandatory log warning n para get attribute name empty mandatory else log fine n para get attribute name empty break convert to type try if display type is numeric n para get display type display type isid n para get display type big decimal bd null if value instanceof big decimal bd big decimal value else if value instanceof integer bd new big decimal integer value int value else bd new big decimal value to string i para setp number bd log fine n para get attribute name variable name bd else if display type is date n para get display type timestamp ts null if value instanceof timestamp ts timestamp value else ts timestamp value of value to string i para setp date ts log fine n para get attribute name variable name ts else i para setp string value to string log fine n para get attribute name variable name value value get class get name if i para save log warning not saved n para get attribute name catch exception e log warning n para get attribute name variable name value value get class get name e get localized message break node parameter loop instance parameter loop pinstance fillparameter mpinstance pinstance mwfnodepara nparams m_node getparameters mpinstancepara iparams pinstance getparameters iparams mpinstancepara ipara iparams nparams mwfnodepara npara nparams ipara getparametername npara getattributename variablename npara getattributevalue npara getattributename variablename variablename variablename variablename variablename indexof m_po variablename indexof columnname variablename columnname indexof npara getattributename variablename columnname columnname m_po get_columnindex columnname m_po get_value getcontext getctx columnname npara getattributename columnname variablename npara ismandatory npara getattributename npara getattributename displaytype isnumeric npara getdisplaytype displaytype npara getdisplaytype bigdecimal bigdecimal bigdecimal bigdecimal intvalue bigdecimal tostring ipara setp_number npara getattributename variablename displaytype isdate npara getdisplaytype valueof tostring ipara setp_date npara getattributename variablename ipara setp_string tostring npara getattributename variablename getclass getname ipara npara getattributename npara getattributename variablename getclass getname getlocalizedmessage post immediate private void post immediate if c connection get is apps serverok false try server server c connection get get server if server null string error server post immediate env get ctx m postimmediate getad client id m postimmediate get table id m postimmediate get id true null m postimmediate get logger config server error null ok error return else m postimmediate get logger config no apps server catch remote exception e m postimmediate get logger config re e get message catch exception e m postimmediate get logger config ex e get message postimmediate cconnection isappsserverok cconnection getserver postimmediate getctx m_postimmediate getad_client_id m_postimmediate get_table_id m_postimmediate get_id m_postimmediate get_logger m_postimmediate get_logger noappsserver remoteexception m_postimmediate get_logger getmessage m_postimmediate get_logger getmessage send e mail private void sende mail doc action doc doc action m po m mail text text new m mail text get ctx m node getr mailtext id null text setpo m po true string subject doc get document info text get mail header string message text get mail text true n n doc get document info n doc get summary file pdf doc createpdf m client client m client get doc get ctx doc getad client id explicit e mail sende mail client 0 m node gete mail subject message pdf recipient type string recipient m node gete mail recipient email to document user if recipient null recipient length 0 sende mail client doc getdoc user id null subject message pdf else if recipient equals mwf node emailrecipient documentbusinesspartner int index m po get columnindex ad user id if index 0 object oo m po get value index if oo instanceof integer int ad user id integer oo int value if ad user id 0 sende mail client ad user id null subject message pdf else log fine no user in document else log fine empty user in document else log fine no user field in document else if recipient equals mwf node emailrecipient documentowner sende mail client doc getdoc user id null subject message pdf else if recipient equals mwf node emailrecipient wfresponsible mwf responsible resp get responsible if resp is invoker sende mail client doc getdoc user id null subject message pdf else if resp is human sende mail client resp getad user id null subject message pdf else if resp is role m role role resp get role if role null m user users m user get with role role for int i 0 i users length i sende mail client users i getad user id null subject message pdf else if resp is organization m org info org m org info get get ctx m po getad org id if org getsupervisor id 0 log fine no supervisor for ad org id m po getad org id else sende mail client org getsupervisor id null subject message pdf email sendemail docaction docaction m_po mmailtext mmailtext getctx m_node getr_mailtext_id m_po getdocumentinfo getmailheader getmailtext getdocumentinfo getsummary mclient mclient getctx getad_client_id email sendemail m_node getemail m_node getemailrecipient sendemail getdoc_user_id mwfnode emailrecipient_documentbusinesspartner m_po get_columnindex ad_user_id m_po get_value ad_user_id intvalue ad_user_id sendemail ad_user_id mwfnode emailrecipient_documentowner sendemail getdoc_user_id mwfnode emailrecipient_wfresponsible mwfresponsible getresponsible isinvoker sendemail getdoc_user_id ishuman sendemail getad_user_id isrole mrole getrole muser muser getwithrole sendemail getad_user_id isorganization morginfo morginfo getctx m_po getad_org_id getsupervisor_id ad_org_id m_po getad_org_id sendemail getsupervisor_id send actual e mail param client client param ad user id user param email email string param subject subject param message message param pdf attachment private void sende mail m client client int ad user id string email string subject string message file pdf if ad user id 0 m user user m user get get ctx ad user id email user gete mail if email null email length 0 email email trim if m emails contains email client sende mail null user subject message pdf m emails add email else log info no e mail for user user get name else if email null email length 0 just one if email index of 1 email email trim if m emails contains email client sende mail email subject message pdf m emails add email return multiple e mail string tokenizer st new string tokenizer email while st has more tokens string email1 st next token trim if email1 length 0 continue if m emails contains email1 client sende mail email1 subject message pdf m emails add email1 email ad_user_id sendemail mclient ad_user_id ad_user_id muser muser getctx ad_user_id getemail m_emails sendemail m_emails email getname indexof m_emails sendemail m_emails email stringtokenizer stringtokenizer hasmoretokens nexttoken m_emails sendemail m_emails get process activity event history return history public string get historyhtml simple date format format display type get date format display type date time string buffer sb new string buffer mwf event audit events mwf event audit get get ctx getad wf process id for int i 0 i events length i mwf event audit audit events i sb append p style width 400 sb append p sb append format format audit get created append append gethtm lpart b audit get node name append append gethtm lpart null audit get description append gethtm lpart i audit get text msg sb append p return sb to string gethistoryhtml simpledateformat displaytype getdateformat displaytype datetime stringbuffer stringbuffer mwfeventaudit mwfeventaudit getctx getad_wf_process_id mwfeventaudit getcreated gethtmlpart getnodename gethtmlpart getdescription gethtmlpart gettextmsg tostring get html part param tag html tag param content content return tag content tag private string buffer gethtm lpart string tag string content string buffer sb new string buffer if content null content length 0 return sb if tag null tag length 0 sb append append tag append sb append content if tag null tag length 0 sb append append tag append return sb stringbuffer gethtmlpart stringbuffer stringbuffer does the underlying po object have a pdf attachment return true if there is a pdf attachment public boolean is pdf attachment if getpo null return false return m po is pdf attachment ispdfattachment m_po ispdfattachment get pdf attachment of underlying po object return pdf data or null public byte get pdf attachment if getpo null return null return m po get pdf attachment getpdfattachment m_po getpdfattachment string representation return info public string to string string buffer sb new string buffer mwf activity sb append get id append node if m node null sb append getad wf node id else sb append m node get name sb append state append getwf state append ad user id append getad user id append append get created append return sb to string tostring stringbuffer stringbuffer mwfactivity get_id m_node getad_wf_node_id m_node getname getwfstate ad_user_id getad_user_id getcreated tostring user string representation suspended approve it joe return info public string to stringx string buffer sb new string buffer sb append getwf state text append append get node get name if getad user id 0 m user user m user get get ctx getad user id sb append append user get name append return sb to string tostringx stringbuffer stringbuffer getwfstatetext getnode getname getad_user_id muser muser getctx getad_user_id getname tostring basic constructor public map basic constructor param element adds an element to the element public map element element add element element addelement basic constructor param element adds an element to the element public map string element add element element addelement basic constructor param element adds an element to the element param name sets the name attribute public map element element string name add element element set name name addelement setname basic constructor param element adds an element to the element param name sets the name attribute public map string element string name add element element set name name addelement setname sets the name attribute param name the name attribute public map set name string name add attribute name name return this setname addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public map add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public map add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public map add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public map add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public map remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param the script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param the script public void set on blur string script add attribute onblur script setonblur addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get contsnts return contents public object get contents return contents getcontents standard constructor public x ad printform properties ctx int ad printform id string trx name super ctx ad printform id trx name if ad printform id 0 setad printform id 0 set name null x_ad_printform ad_printform_id trxname ad_printform_id trxname ad_printform_id setad_printform_id setname load constructor public x ad printform properties ctx result set rs string trx name super ctx rs trx name x_ad_printform resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad printform append get id append return sb to string tostring stringbuffer stringbuffer x_ad_printform get_id tostring set print form form public void setad printform id int ad printform id if ad printform id 1 throw new illegal argument exception ad printform id is mandatory set valuenocheck ad printform id new integer ad printform id setad_printform_id ad_printform_id ad_printform_id illegalargumentexception ad_printform_id set_valuenocheck ad_printform_id ad_printform_id get print form form public int getad printform id integer ii integer get value ad printform id if ii null return 0 return ii int value getad_printform_id get_value ad_printform_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final int invoice mailtext id ad reference id 274 set invoice mail text email text used for sending invoices public void setinvoice mailtext id int invoice mailtext id if invoice mailtext id 0 set value invoice mailtext id null else set value invoice mailtext id new integer invoice mailtext id invoice_mailtext_id_ad_reference_id setinvoice_mailtext_id invoice_mailtext_id invoice_mailtext_id set_value invoice_mailtext_id set_value invoice_mailtext_id invoice_mailtext_id get invoice mail text email text used for sending invoices public int getinvoice mailtext id integer ii integer get value invoice mailtext id if ii null return 0 return ii int value getinvoice_mailtext_id get_value invoice_mailtext_id intvalue public static final int invoice printformat id ad reference id 261 set invoice print format print format for printing invoices public void setinvoice printformat id int invoice printformat id if invoice printformat id 0 set value invoice printformat id null else set value invoice printformat id new integer invoice printformat id invoice_printformat_id_ad_reference_id setinvoice_printformat_id invoice_printformat_id invoice_printformat_id set_value invoice_printformat_id set_value invoice_printformat_id invoice_printformat_id get invoice print format print format for printing invoices public int getinvoice printformat id integer ii integer get value invoice printformat id if ii null return 0 return ii int value getinvoice_printformat_id get_value invoice_printformat_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int order mailtext id ad reference id 274 set order mail text email text used for sending order acknowledgements or quotations public void setorder mailtext id int order mailtext id if order mailtext id 0 set value order mailtext id null else set value order mailtext id new integer order mailtext id order_mailtext_id_ad_reference_id setorder_mailtext_id order_mailtext_id order_mailtext_id set_value order_mailtext_id set_value order_mailtext_id order_mailtext_id get order mail text email text used for sending order acknowledgements or quotations public int getorder mailtext id integer ii integer get value order mailtext id if ii null return 0 return ii int value getorder_mailtext_id get_value order_mailtext_id intvalue public static final int order printformat id ad reference id 262 set order print format print format for orders quotes offers public void setorder printformat id int order printformat id if order printformat id 0 set value order printformat id null else set value order printformat id new integer order printformat id order_printformat_id_ad_reference_id setorder_printformat_id order_printformat_id order_printformat_id set_value order_printformat_id set_value order_printformat_id order_printformat_id get order print format print format for orders quotes offers public int getorder printformat id integer ii integer get value order printformat id if ii null return 0 return ii int value getorder_printformat_id get_value order_printformat_id intvalue public static final int project mailtext id ad reference id 274 set project mail text standard text for project e mails public void setproject mailtext id int project mailtext id if project mailtext id 0 set value project mailtext id null else set value project mailtext id new integer project mailtext id project_mailtext_id_ad_reference_id emails setproject_mailtext_id project_mailtext_id project_mailtext_id set_value project_mailtext_id set_value project_mailtext_id project_mailtext_id get project mail text standard text for project e mails public int getproject mailtext id integer ii integer get value project mailtext id if ii null return 0 return ii int value emails getproject_mailtext_id get_value project_mailtext_id intvalue public static final int project printformat id ad reference id 259 set project print format standard project print format public void setproject printformat id int project printformat id if project printformat id 0 set value project printformat id null else set value project printformat id new integer project printformat id project_printformat_id_ad_reference_id setproject_printformat_id project_printformat_id project_printformat_id set_value project_printformat_id set_value project_printformat_id project_printformat_id get project print format standard project print format public int getproject printformat id integer ii integer get value project printformat id if ii null return 0 return ii int value getproject_printformat_id get_value project_printformat_id intvalue public static final int remittance mailtext id ad reference id 274 set remittance mail text email text used for sending payment remittances public void setremittance mailtext id int remittance mailtext id if remittance mailtext id 0 set value remittance mailtext id null else set value remittance mailtext id new integer remittance mailtext id remittance_mailtext_id_ad_reference_id setremittance_mailtext_id remittance_mailtext_id remittance_mailtext_id set_value remittance_mailtext_id set_value remittance_mailtext_id remittance_mailtext_id get remittance mail text email text used for sending payment remittances public int getremittance mailtext id integer ii integer get value remittance mailtext id if ii null return 0 return ii int value getremittance_mailtext_id get_value remittance_mailtext_id intvalue public static final int remittance printformat id ad reference id 268 set remittance print format print format for separate remittances public void setremittance printformat id int remittance printformat id if remittance printformat id 0 set value remittance printformat id null else set value remittance printformat id new integer remittance printformat id remittance_printformat_id_ad_reference_id setremittance_printformat_id remittance_printformat_id remittance_printformat_id set_value remittance_printformat_id set_value remittance_printformat_id remittance_printformat_id get remittance print format print format for separate remittances public int getremittance printformat id integer ii integer get value remittance printformat id if ii null return 0 return ii int value getremittance_printformat_id get_value remittance_printformat_id intvalue public static final int shipment mailtext id ad reference id 274 set shipment mail text email text used for sending delivery notes public void setshipment mailtext id int shipment mailtext id if shipment mailtext id 0 set value shipment mailtext id null else set value shipment mailtext id new integer shipment mailtext id shipment_mailtext_id_ad_reference_id setshipment_mailtext_id shipment_mailtext_id shipment_mailtext_id set_value shipment_mailtext_id set_value shipment_mailtext_id shipment_mailtext_id get shipment mail text email text used for sending delivery notes public int getshipment mailtext id integer ii integer get value shipment mailtext id if ii null return 0 return ii int value getshipment_mailtext_id get_value shipment_mailtext_id intvalue public static final int shipment printformat id ad reference id 263 set shipment print format print format for shipments receipts pick lists public void setshipment printformat id int shipment printformat id if shipment printformat id 0 set value shipment printformat id null else set value shipment printformat id new integer shipment printformat id shipment_printformat_id_ad_reference_id setshipment_printformat_id shipment_printformat_id shipment_printformat_id set_value shipment_printformat_id set_value shipment_printformat_id shipment_printformat_id get shipment print format print format for shipments receipts pick lists public int getshipment printformat id integer ii integer get value shipment printformat id if ii null return 0 return ii int value getshipment_printformat_id get_value shipment_printformat_id intvalue check if all variables are defined param source source param logic logic info return true if fully defined public static boolean is all variables defined evaluatee source string logic if logic null logic length 0 return true int pos 0 while pos logic length int first logic index of pos if first 1 return true int second logic index of first 1 if second 1 s log severe no second in logic logic return false string variable logic substring first 1 second 1 string eval source get valueasstring variable s log finest variable eval if eval null eval length 0 return false pos second 1 return true isallvariablesdefined indexof indexof s_log get_valueasstring s_log evaluate logic code format expression logic expression expression context ex logic value logic ex logic context any global or window context value strings can be with or logic operators and or or with the prevoius result from left to right example ad table test language gerger code param logic logic string return locic result public static boolean evaluate logic evaluatee source string logic conditional string tokenizer st new string tokenizer logic trim true int it st count tokens if it 2 it 1 2 0 only uneven arguments s log severe logic does not comply with format expression logic expression logic return false boolean ret value evaluate logic tuple source st next token while st has more tokens string log op st next token trim boolean temp evaluate logic tuple source st next token if log op equals ret value ret value temp else if log op equals ret value ret value temp else s log log level severe logic operant or expected logic return false has more tokens return ret value exlogic exlogic ad_table evaluatelogic stringtokenizer stringtokenizer counttokens s_log retvalue evaluatelogictuple nexttoken hasmoretokens logop nexttoken evaluatelogictuple nexttoken logop retvalue retvalue logop retvalue retvalue s_log hasmoretokens retvalue evaluate context value or context value or context value pre value strips and always no escape or mid stream value can also be a context variable pre param logic logic tuple return true or false private static boolean evaluate logic tuple evaluatee source string logic string tokenizer st new string tokenizer logic trim true if st count tokens 3 s log log level severe logic tuple does not comply with format context value where operand could be one of logic return false first part string first st next token trim get tag string first eval first trim if first index of 1 variable first first replace trim strip tag first eval source get valueasstring first replace with it s value first eval first eval replace replace trim strip and comperator string operand st next token second part string second st next token get value string second eval second trim if second index of 1 variable second second replace trim strip tag second eval source get valueasstring second replace with it s value second eval second eval replace replace trim strip and handling of id compare null 0 if first index of id 1 first eval length 0 first eval 0 if second index of id 1 second eval length 0 second eval 0 logical comparison boolean result evaluate logic tuple first eval operand second eval if c log mgt is level finest s log finest logic first eval operand second eval result return result evaluatelogictuple stringtokenizer stringtokenizer counttokens s_log nexttoken firsteval indexof firsteval get_valueasstring firsteval firsteval nexttoken nexttoken secondeval indexof secondeval get_valueasstring secondeval secondeval indexof _id firsteval firsteval indexof _id secondeval secondeval evaluatelogictuple firsteval secondeval clogmgt islevelfinest s_log firsteval secondeval evaluate logic tuple param value1 value param operand operand param value2 return evaluation private static boolean evaluate logic tuple string value1 string operand string value2 if value1 null operand null value2 null return false big decimal value1bd null big decimal value2bd null try if value1 starts with value1bd new big decimal value1 if value2 starts with value2bd new big decimal value2 catch exception e value1bd null value2bd null if operand equals if value1bd null value2bd null return value1bd compare to value2bd 0 return value1 compare to value2 0 else if operand equals if value1bd null value2bd null return value1bd compare to value2bd 0 return value1 compare to value2 0 else if operand equals if value1bd null value2bd null return value1bd compare to value2bd 0 return value1 compare to value2 0 else interpreted as not if value1bd null value2bd null return value1bd compare to value2bd 0 return value1 compare to value2 0 evaluatelogictuple bigdecimal bigdecimal startswith bigdecimal startswith bigdecimal compareto compareto compareto compareto compareto compareto compareto compareto standard constructor public x ad scheduler para properties ctx int ad scheduler para id string trx name super ctx ad scheduler para id trx name if ad scheduler para id 0 setad process para id 0 setad scheduler id 0 x_ad_scheduler_para ad_scheduler_para_id trxname ad_scheduler_para_id trxname ad_scheduler_para_id setad_process_para_id setad_scheduler_id load constructor public x ad scheduler para properties ctx result set rs string trx name super ctx rs trx name x_ad_scheduler_para resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad scheduler para append get id append return sb to string tostring stringbuffer stringbuffer x_ad_scheduler_para get_id tostring set process parameter public void setad process para id int ad process para id if ad process para id 1 throw new illegal argument exception ad process para id is mandatory set valuenocheck ad process para id new integer ad process para id setad_process_para_id ad_process_para_id ad_process_para_id illegalargumentexception ad_process_para_id set_valuenocheck ad_process_para_id ad_process_para_id get process parameter public int getad process para id integer ii integer get value ad process para id if ii null return 0 return ii int value getad_process_para_id get_value ad_process_para_id intvalue set scheduler schedule processes public void setad scheduler id int ad scheduler id if ad scheduler id 1 throw new illegal argument exception ad scheduler id is mandatory set valuenocheck ad scheduler id new integer ad scheduler id setad_scheduler_id ad_scheduler_id ad_scheduler_id illegalargumentexception ad_scheduler_id set_valuenocheck ad_scheduler_id ad_scheduler_id get scheduler schedule processes public int getad scheduler id integer ii integer get value ad scheduler id if ii null return 0 return ii int value getad_scheduler_id get_value ad_scheduler_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default parameter default value of the parameter public void set parameter default string parameter default if parameter default null parameter default length 60 log warning length 60 truncated parameter default parameter default substring 0 59 set value parameter default parameter default setparameterdefault parameterdefault parameterdefault parameterdefault parameterdefault parameterdefault set_value parameterdefault parameterdefault get default parameter default value of the parameter public string get parameter default return string get value parameter default getparameterdefault get_value parameterdefault constructor public result table super set cell selection enabled false set column selection allowed false set row selection allowed false set selection mode list selection model single selection set auto resize mode j table auto resize off default editor result table cell editor rtce new result table cell editor set cell editor rtce mouse listener add mouse listener this get table header add mouse listener this resulttable setcellselectionenabled setcolumnselectionallowed setrowselectionallowed setselectionmode listselectionmodel single_selection setautoresizemode jtable auto_resize_off resulttablecelleditor resulttablecelleditor setcelleditor addmouselistener gettableheader addmouselistener create a j table model from report model param report model public result table r model report model this set model report model jtable reportmodel reportmodel resulttable rmodel reportmodel setmodel reportmodel set model param report model public void set model r model report model log config report model to string super set model new result table model report model table column model tcm get column model set editor renderer for int i 0 i tcm get column count i table column tc tcm get column i r column rc report model getr column i if rc get col header equals tc get header value result table cell renderer rtcr new result table cell renderer report model rc tc set cell renderer rtcr else log log level severe r column rc get col header table column tc get header value auto size reportmodel setmodel rmodel reportmodel reportmodel tostring setmodel resulttablemodel reportmodel tablecolumnmodel getcolumnmodel getcolumncount tablecolumn getcolumn rcolumn reportmodel getrcolumn getcolheader getheadervalue resulttablecellrenderer resulttablecellrenderer reportmodel setcellrenderer rcolumn getcolheader tablecolumn getheadervalue autosize set model param ignored public void set model table model ignored throw new illegal argument exception requires r model default construvtor calls this super set model ignored setmodel tablemodel illegalargumentexception rmodel setmodel table model listener param e public void table changed table model event e super table changed e log fine type e get type tablechanged tablemodelevent tablechanged gettype mouse clicked param e public void mouse clicked mouse event e int col get column model get column index atx e getx log fine column col get column model get column col get header value table r this get selected row c this get selected column clicked cell if e get source this clicked header else int mc convert column index to model col sort mc mouseclicked mouseevent getcolumnmodel getcolumnindexatx getcolumnmodel getcolumn getheadervalue getselectedrow getselectedcolumn getsource convertcolumnindextomodel mouse clicked public void mouse pressed mouse event e mouseclicked mousepressed mouseevent public void mouse released mouse event e mousereleased mouseevent public void mouse entered mouse event e mouseentered mouseevent public void mouse exited mouse event e mouseexited mouseevent size columns private void auto size log config final int slack 8 making sure it fits in a column final int maxsize 300 max size of a column table column model tcm get column model for all columns for int col 0 col tcm get column count col table column tc tcm get column col log config column col tc get header value int width 0 header table cell renderer renderer tc get header renderer if renderer null renderer new default table cell renderer component comp renderer get table cell renderer component this tc get header value false false 0 0 log fine hdr preferred comp get preferred size width width comp get width width comp get preferred size width slack cells int max row math min 30 get row count first 30 rows for int row 0 row max row row renderer get cell renderer row col comp renderer get table cell renderer component this get value at row col false false row col int row width comp get preferred size width slack width math max width row width width not greater width math min maxsize width tc set preferred width width log fine width width for all columns autosize tablecolumnmodel getcolumnmodel getcolumncount tablecolumn getcolumn getheadervalue tablecellrenderer getheaderrenderer defaulttablecellrenderer gettablecellrenderercomponent getheadervalue getpreferredsize getwidth getpreferredsize maxrow getrowcount maxrow getcellrenderer gettablecellrenderercomponent getvalueat rowwidth getpreferredsize rowwidth setpreferredwidth sort table param model column index suppress warnings unchecked private void sort int model column index int rows get row count if rows 0 return other column if model column index m lastsortindex m asc true else m asc m asc m lastsortindex model column index log config model column index rows rows asc m asc result table model model result table model get model prepare sorting m sort sort new m sort 0 null sort set sort asc m asc while something to sort sorting while true create sort list array list m sort sort list new array list m sort rows fill with data entity for int i 0 i rows i object value model get value at i model column index sort list add new m sort i value sort list it collections sort sort list sort move out of sequence row for int i 0 i rows i int index m sort sort list get i index if i index log config move i to index model move row i index continue sorting we are done log config done break while something to sort modelcolumnindex suppresswarnings modelcolumnindex getrowcount modelcolumnindex m_lastsortindex m_asc m_asc m_asc m_lastsortindex modelcolumnindex modelcolumnindex m_asc resulttablemodel resulttablemodel getmodel msort msort setsortasc m_asc sortlist arraylist msort sortlist arraylist msort getvalueat modelcolumnindex sortlist msort sortlist msort sortlist moverow standard constructor public x pa achievement properties ctx int pa achievement id string trx name super ctx pa achievement id trx name if pa achievement id 0 set is achieved false set manual actual env zero set name null setpa achievement id 0 setpa measure id 0 set seq no 0 x_pa_achievement pa_achievement_id trxname pa_achievement_id trxname pa_achievement_id setisachieved setmanualactual setname setpa_achievement_id setpa_measure_id setseqno load constructor public x pa achievement properties ctx result set rs string trx name super ctx rs trx name x_pa_achievement resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa achievement append get id append return sb to string tostring stringbuffer stringbuffer x_pa_achievement get_id tostring set document date date of the document public void set date doc timestamp date doc set value date doc date doc setdatedoc datedoc set_value datedoc datedoc get document date date of the document public timestamp get date doc return timestamp get value date doc getdatedoc get_value datedoc set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set achieved the goal is achieved public void set is achieved boolean is achieved set value is achieved new boolean is achieved setisachieved isachieved set_value isachieved isachieved get achieved the goal is achieved public boolean is achieved object oo get value is achieved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isachieved get_value isachieved booleanvalue set manual actual manually entered actual value public void set manual actual big decimal manual actual if manual actual null throw new illegal argument exception manual actual is mandatory set value manual actual manual actual setmanualactual bigdecimal manualactual manualactual illegalargumentexception manualactual set_value manualactual manualactual get manual actual manually entered actual value public big decimal get manual actual big decimal bd big decimal get value manual actual if bd null return env zero return bd bigdecimal getmanualactual bigdecimal bigdecimal get_value manualactual set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set achievement performance achievement public void setpa achievement id int pa achievement id if pa achievement id 1 throw new illegal argument exception pa achievement id is mandatory set valuenocheck pa achievement id new integer pa achievement id setpa_achievement_id pa_achievement_id pa_achievement_id illegalargumentexception pa_achievement_id set_valuenocheck pa_achievement_id pa_achievement_id get achievement performance achievement public int getpa achievement id integer ii integer get value pa achievement id if ii null return 0 return ii int value getpa_achievement_id get_value pa_achievement_id intvalue set measure concrete performance measurement public void setpa measure id int pa measure id if pa measure id 1 throw new illegal argument exception pa measure id is mandatory set valuenocheck pa measure id new integer pa measure id setpa_measure_id pa_measure_id pa_measure_id illegalargumentexception pa_measure_id set_valuenocheck pa_measure_id pa_measure_id get measure concrete performance measurement public int getpa measure id integer ii integer get value pa measure id if ii null return 0 return ii int value getpa_measure_id get_value pa_measure_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x c commissionline properties ctx int c commissionline id string trx name super ctx c commissionline id trx name if c commissionline id 0 set amt multiplier env zero set amt subtract env zero setc commissionline id 0 setc commission id 0 set commission orders false set is positive only false set line 0 sql select nvl max line 0 10 as default value from c commissionline where c commission id c commission id set qty multiplier env zero set qty subtract env zero x_c_commissionline c_commissionline_id trxname c_commissionline_id trxname c_commissionline_id setamtmultiplier setamtsubtract setc_commissionline_id setc_commission_id setcommissionorders setispositiveonly setline defaultvalue c_commissionline c_commission_id c_commission_id setqtymultiplier setqtysubtract load constructor public x c commissionline properties ctx result set rs string trx name super ctx rs trx name x_c_commissionline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c commissionline append get id append return sb to string tostring stringbuffer stringbuffer x_c_commissionline get_id tostring set multiplier amount multiplier amount for generating commissions public void set amt multiplier big decimal amt multiplier if amt multiplier null throw new illegal argument exception amt multiplier is mandatory set value amt multiplier amt multiplier setamtmultiplier bigdecimal amtmultiplier amtmultiplier illegalargumentexception amtmultiplier set_value amtmultiplier amtmultiplier get multiplier amount multiplier amount for generating commissions public big decimal get amt multiplier big decimal bd big decimal get value amt multiplier if bd null return env zero return bd bigdecimal getamtmultiplier bigdecimal bigdecimal get_value amtmultiplier set subtract amount subtract amount for generating commissions public void set amt subtract big decimal amt subtract if amt subtract null throw new illegal argument exception amt subtract is mandatory set value amt subtract amt subtract setamtsubtract bigdecimal amtsubtract amtsubtract illegalargumentexception amtsubtract set_value amtsubtract amtsubtract get subtract amount subtract amount for generating commissions public big decimal get amt subtract big decimal bd big decimal get value amt subtract if bd null return env zero return bd bigdecimal getamtsubtract bigdecimal bigdecimal get_value amtsubtract set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 0 set value c bp group id null else set value c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id set_value c_bp_group_id set_value c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set commission line commission line public void setc commissionline id int c commissionline id if c commissionline id 1 throw new illegal argument exception c commissionline id is mandatory set valuenocheck c commissionline id new integer c commissionline id setc_commissionline_id c_commissionline_id c_commissionline_id illegalargumentexception c_commissionline_id set_valuenocheck c_commissionline_id c_commissionline_id get commission line commission line public int getc commissionline id integer ii integer get value c commissionline id if ii null return 0 return ii int value getc_commissionline_id get_value c_commissionline_id intvalue set commission commission public void setc commission id int c commission id if c commission id 1 throw new illegal argument exception c commission id is mandatory set valuenocheck c commission id new integer c commission id setc_commission_id c_commission_id c_commission_id illegalargumentexception c_commission_id set_valuenocheck c_commission_id c_commission_id get commission commission public int getc commission id integer ii integer get value c commission id if ii null return 0 return ii int value getc_commission_id get_value c_commission_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc commission id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_commission_id set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set commission only specified orders commission only orders or invoices where this sales rep is entered public void set commission orders boolean commission orders set value commission orders new boolean commission orders setcommissionorders commissionorders set_value commissionorders commissionorders get commission only specified orders commission only orders or invoices where this sales rep is entered public boolean is commission orders object oo get value commission orders if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscommissionorders get_value commissionorders booleanvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set positive only do not generate negative commissions public void set is positive only boolean is positive only set value is positive only new boolean is positive only setispositiveonly ispositiveonly set_value ispositiveonly ispositiveonly get positive only do not generate negative commissions public boolean is positive only object oo get value is positive only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispositiveonly get_value ispositiveonly booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int org id ad reference id 130 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set multiplier quantity value to multiply quantities by for generating commissions public void set qty multiplier big decimal qty multiplier if qty multiplier null throw new illegal argument exception qty multiplier is mandatory set value qty multiplier qty multiplier setqtymultiplier bigdecimal qtymultiplier qtymultiplier illegalargumentexception qtymultiplier set_value qtymultiplier qtymultiplier get multiplier quantity value to multiply quantities by for generating commissions public big decimal get qty multiplier big decimal bd big decimal get value qty multiplier if bd null return env zero return bd bigdecimal getqtymultiplier bigdecimal bigdecimal get_value qtymultiplier set subtract quantity quantity to subtract when generating commissions public void set qty subtract big decimal qty subtract if qty subtract null throw new illegal argument exception qty subtract is mandatory set value qty subtract qty subtract setqtysubtract bigdecimal qtysubtract qtysubtract illegalargumentexception qtysubtract set_value qtysubtract qtysubtract get subtract quantity quantity to subtract when generating commissions public big decimal get qty subtract big decimal bd big decimal get value qty subtract if bd null return env zero return bd bigdecimal getqtysubtract bigdecimal bigdecimal get_value qtysubtract standard constructor param ctx context param gl journalline id id public m journal line properties ctx int gl journalline id string trx name super ctx gl journalline id trx name if gl journalline id 0 setgl journalline id 0 pk setgl journal id 0 parent setc currency id 0 setc validcombination id 0 set line 0 set amt acct cr env zero set amt acct dr env zero set amt source cr env zero set amt source dr env zero set currency rate env one setc conversiontype id 0 set date acct new timestamp system current time millis set is generated true gl_journalline_id mjournalline gl_journalline_id trxname gl_journalline_id trxname gl_journalline_id setgl_journalline_id setgl_journal_id setc_currency_id setc_validcombination_id setline setamtacctcr setamtacctdr setamtsourcecr setamtsourcedr setcurrencyrate setc_conversiontype_id setdateacct currenttimemillis setisgenerated load constructor param ctx context param rs result set public m journal line properties ctx result set rs string trx name super ctx rs trx name mjournalline resultset trxname trxname parent constructor param parent journal public m journal line m journal parent this parent get ctx 0 parent get trxname set client org parent setgl journal id parent getgl journal id setc currency id parent getc currency id setc conversiontype id parent getc conversiontype id set date acct parent get date acct mjournalline mjournal getctx get_trxname setclientorg setgl_journal_id getgl_journal_id setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setdateacct getdateacct set currency info param c currency id currenct param c conversiontype id type param currency rate rate public void set currency int c currency id int c conversiontype id big decimal currency rate setc currency id c currency id if c conversiontype id 0 setc conversiontype id c conversiontype id if currency rate null currency rate signum 0 set currency rate currency rate c_currency_id c_conversiontype_id currencyrate setcurrency c_currency_id c_conversiontype_id bigdecimal currencyrate setc_currency_id c_currency_id c_conversiontype_id setc_conversiontype_id c_conversiontype_id currencyrate currencyrate setcurrencyrate currencyrate set c currency id and precision param c currency id currency public void setc currency id int c currency id if c currency id 0 return super setc currency id c currency id m precision m currency get std precision get ctx c currency id c_currency_id c_currency_id setc_currency_id c_currency_id c_currency_id setc_currency_id c_currency_id m_precision mcurrency getstdprecision getctx c_currency_id get currency precision return precision public int get precision return m precision getprecision m_precision set currency rate param currency rate check for null one public void set currency rate big decimal currency rate if currency rate null log warning was null set to 1 super set currency rate env one else if currency rate signum 0 log warning negative currency rate set to 1 super set currency rate env one else super set currency rate currency rate currencyrate setcurrencyrate bigdecimal currencyrate currencyrate setcurrencyrate currencyrate currencyrate setcurrencyrate setcurrencyrate currencyrate set accounted amounts only if not 0 amounts overwritten in before save set conversion rate param amt acct dr dr param amt acct cr cr public void set amt acct big decimal amt acct dr big decimal amt acct cr set conversion double ratedr 0 if amt acct dr null amt acct dr signum 0 ratedr amt acct dr double value get amt source dr double value super set amt acct dr amt acct dr double ratecr 0 if amt acct cr null amt acct cr signum 0 ratecr amt acct cr double value get amt source cr double value super set amt acct cr amt acct cr if ratedr 0 ratecr 0 ratedr ratecr log warning rates different dr ratedr used cr ratecr ignored ratecr 0 if ratedr 0 double is infinite ratedr double is nan ratedr log warning dr rate ignored ratedr return if ratecr 0 double is infinite ratecr double is nan ratecr log warning cr rate ignored ratecr return if ratedr 0 set currency rate new big decimal ratedr if ratecr 0 set currency rate new big decimal ratecr beforesave amtacctdr amtacctcr setamtacct bigdecimal amtacctdr bigdecimal amtacctcr setconversion amtacctdr amtacctdr amtacctdr doublevalue getamtsourcedr doublevalue setamtacctdr amtacctdr amtacctcr amtacctcr amtacctcr doublevalue getamtsourcecr doublevalue setamtacctcr amtacctcr isinfinite isnan isinfinite isnan setcurrencyrate bigdecimal setcurrencyrate bigdecimal set c validcombination id param c validcombination id id public void setc validcombination id int c validcombination id super setc validcombination id c validcombination id m account null m accountelement null c_validcombination_id c_validcombination_id setc_validcombination_id c_validcombination_id setc_validcombination_id c_validcombination_id m_account m_accountelement set c validcombination id param acct account public void setc validcombination id m account acct if acct null throw new illegal argument exception account is null super setc validcombination id acct getc validcombination id m account acct m accountelement null c_validcombination_id setc_validcombination_id maccount illegalargumentexception setc_validcombination_id getc_validcombination_id m_account m_accountelement get account valid combination return combination or null public m account get account if m account null getc validcombination id 0 m account new m account get ctx getc validcombination id get trxname return m account maccount getaccount m_account getc_validcombination_id m_account maccount getctx getc_validcombination_id get_trxname m_account get natural account element value return account public m element value get account element value if m accountelement null m account vc get account if vc null vc getaccount id 0 m accountelement new m element value get ctx vc getaccount id get trxname return m accountelement melementvalue getaccountelementvalue m_accountelement maccount getaccount getaccount_id m_accountelement melementvalue getctx getaccount_id get_trxname m_accountelement is it posting to a control acct return true if control acct public boolean is doc controlled m element value acct get account element value if acct null log warning account not found for c validcombination id getc validcombination id return false return acct is doc controlled isdoccontrolled melementvalue getaccountelementvalue c_validcombination_id getc_validcombination_id isdoccontrolled before save param new record new return true protected boolean before save boolean new record acct amts big decimal rate get currency rate big decimal amt rate multiply get amt source dr if amt scale get precision amt amt set scale get precision big decimal round half up set amt acct dr amt amt rate multiply get amt source cr if amt scale get precision amt amt set scale get precision big decimal round half up set amt acct cr amt set line org to acct org if new record is valuechanged c validcombination id is valuechanged ad org id setad org id get account getad org id return true newrecord beforesave newrecord bigdecimal getcurrencyrate bigdecimal getamtsourcedr getprecision setscale getprecision bigdecimal round_half_up setamtacctdr getamtsourcecr getprecision setscale getprecision bigdecimal round_half_up setamtacctcr newrecord is_valuechanged c_validcombination_id is_valuechanged ad_org_id setad_org_id getaccount getad_org_id after save update journal batch total param new record true if new record param success true if success protected boolean after save boolean new record boolean success if success return success return update journal total newrecord aftersave newrecord updatejournaltotal after delete param success true if deleted return true if success protected boolean after delete boolean success if success return success return update journal total afterdelete updatejournaltotal update journal and batch total return true if success private boolean update journal total update journal total string sql update gl journal j set total dr total cr select coalesce sum amt source dr 0 coalesce sum amt source cr 0 from gl journalline jl where jl is active y and j gl journal id jl gl journal id where gl journal id getgl journal id int no db execute update sql get trxname if no 1 log warning after save update journal no update batch total sql update gl journalbatch jb set total dr total cr select coalesce sum total dr 0 coalesce sum total cr 0 from gl journal j where jb gl journalbatch id j gl journalbatch id where gl journalbatch id select distinct gl journalbatch id from gl journal where gl journal id getgl journal id no db execute update sql get trxname if no 1 log warning update batch no return no 1 updatejournaltotal gl_journal totaldr totalcr amtsourcedr amtsourcecr gl_journalline isactive gl_journal_id gl_journal_id gl_journal_id getgl_journal_id executeupdate get_trxname aftersave gl_journalbatch totaldr totalcr totaldr totalcr gl_journal gl_journalbatch_id gl_journalbatch_id gl_journalbatch_id gl_journalbatch_id gl_journal gl_journal_id getgl_journal_id executeupdate get_trxname standard constructor param ctx context param r requestprocessor route id id public m request processor route properties ctx int r requestprocessor route id string trx name super ctx r requestprocessor route id trx name r_requestprocessor_route_id mrequestprocessorroute r_requestprocessor_route_id trxname r_requestprocessor_route_id trxname load constructor param ctx context param rs result set public m request processor route properties ctx result set rs string trx name super ctx rs trx name mrequestprocessorroute resultset trxname trxname standard constructor public x c calendar properties ctx int c calendar id string trx name super ctx c calendar id trx name if c calendar id 0 setc calendar id 0 set name null x_c_calendar c_calendar_id trxname c_calendar_id trxname c_calendar_id setc_calendar_id setname load constructor public x c calendar properties ctx result set rs string trx name super ctx rs trx name x_c_calendar resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c calendar append get id append return sb to string tostring stringbuffer stringbuffer x_c_calendar get_id tostring set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set valuenocheck c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_valuenocheck c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname basic constructor public sub basic constructor param element adds an element to the element public sub element element add element element addelement basic constructor param element adds an element to the element public sub string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public sub add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public sub add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public sub add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public sub add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public sub remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get contsnts return contents public object get contents return contents getcontents get in out invoice matches param ctx context param m inoutline id shipment param c invoiceline id invoice return array of matches public static m match inv get properties ctx int m inoutline id int c invoiceline id string trx name if m inoutline id 0 c invoiceline id 0 return new m match inv string sql select from m matchinv where m inoutline id and c invoiceline id array list m match inv list new array list m match inv prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inoutline id pstmt set int 2 c invoiceline id result set rs pstmt execute query while rs next list add new m match inv ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m match inv ret value new m match inv list size list to array ret value return ret value inout m_inoutline_id c_invoiceline_id mmatchinv m_inoutline_id c_invoiceline_id trxname m_inoutline_id c_invoiceline_id mmatchinv m_matchinv m_inoutline_id c_invoiceline_id arraylist mmatchinv arraylist mmatchinv preparedstatement preparestatement trxname setint m_inoutline_id setint c_invoiceline_id resultset executequery mmatchinv trxname s_log mmatchinv retvalue mmatchinv toarray retvalue retvalue get inv matches for in out param ctx context param m inout id shipment return array of matches public static m match inv get in out properties ctx int m inout id string trx name if m inout id 0 return new m match inv string sql select from m matchinv m inner join m inoutline l on m m inoutline id l m inoutline id where l m inout id array list m match inv list new array list m match inv prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m inout id result set rs pstmt execute query while rs next list add new m match inv ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m match inv ret value new m match inv list size list to array ret value return ret value inout m_inout_id mmatchinv getinout m_inout_id trxname m_inout_id mmatchinv m_matchinv m_inoutline m_inoutline_id m_inoutline_id m_inout_id arraylist mmatchinv arraylist mmatchinv preparedstatement preparestatement trxname setint m_inout_id resultset executequery mmatchinv trxname s_log mmatchinv retvalue mmatchinv toarray retvalue retvalue get inv matches for invoice param ctx context param c invoice id invoice return array of matches public static m match inv get invoice properties ctx int c invoice id string trx name if c invoice id 0 return new m match inv string sql select from m matchinv mi inner join c invoiceline il on mi c invoiceline id il c invoiceline id where il c invoice id array list m match inv list new array list m match inv prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c invoice id result set rs pstmt execute query while rs next list add new m match inv ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m match inv ret value new m match inv list size list to array ret value return ret value c_invoice_id mmatchinv getinvoice c_invoice_id trxname c_invoice_id mmatchinv m_matchinv c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice_id arraylist mmatchinv arraylist mmatchinv preparedstatement preparestatement trxname setint c_invoice_id resultset executequery mmatchinv trxname s_log mmatchinv retvalue mmatchinv toarray retvalue retvalue standard constructor param ctx context param m matchinv id id param trx name transaction public m match inv properties ctx int m matchinv id string trx name super ctx m matchinv id trx name if m matchinv id 0 set date trx new timestamp system current time millis setc invoiceline id 0 setm inoutline id 0 setm product id 0 setm attributesetinstance id 0 set qty env zero set posted false set processed false set processing false m_matchinv_id trxname mmatchinv m_matchinv_id trxname m_matchinv_id trxname m_matchinv_id setdatetrx currenttimemillis setc_invoiceline_id setm_inoutline_id setm_product_id setm_attributesetinstance_id setqty setposted setprocessed setprocessing load constructor param ctx context param rs result set public m match inv properties ctx result set rs string trx name super ctx rs trx name mmatchinv resultset trxname trxname invoice line constructor param i line invoice line param date trx optional date param qty matched quantity public m match inv m invoice line i line timestamp date trx big decimal qty this i line get ctx 0 i line get trxname set client org i line setc invoiceline id i line getc invoiceline id setm inoutline id i line getm inoutline id if date trx null set date trx date trx setm product id i line getm product id setm attributesetinstance id i line getm attributesetinstance id set qty qty set processed true auto iline datetrx mmatchinv minvoiceline iline datetrx bigdecimal iline getctx iline get_trxname setclientorg iline setc_invoiceline_id iline getc_invoiceline_id setm_inoutline_id iline getm_inoutline_id datetrx setdatetrx datetrx setm_product_id iline getm_product_id setm_attributesetinstance_id iline getm_attributesetinstance_id setqty setprocessed before save param new record new return true protected boolean before save boolean new record set trx date if get date trx null set date trx new timestamp system current time millis set acct date if get date acct null timestamp ts get newer date acct if ts null ts get date trx set date acct ts if getm attributesetinstance id 0 getm inoutline id 0 m in out line iol new m in out line get ctx getm inoutline id get trxname setm attributesetinstance id iol getm attributesetinstance id return true newrecord beforesave newrecord getdatetrx setdatetrx currenttimemillis getdateacct getnewerdateacct getdatetrx setdateacct getm_attributesetinstance_id getm_inoutline_id minoutline minoutline getctx getm_inoutline_id get_trxname setm_attributesetinstance_id getm_attributesetinstance_id get the later date acct from invoice or shipment return date or null private timestamp get newer date acct timestamp invoice date null timestamp ship date null string sql select i date acct from c invoiceline il inner join c invoice i on i c invoice id il c invoice id where c invoiceline id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getc invoiceline id result set rs pstmt execute query if rs next invoice date rs get timestamp 1 rs close pstmt close pstmt null catch exception e log log level severe sql e sql select io date acct from m inoutline iol inner join m inout io on io m inout id iol m inout id where iol m inoutline id try pstmt db prepare statement sql null pstmt set int 1 getm inoutline id result set rs pstmt execute query if rs next ship date rs get timestamp 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if invoice date null return ship date if ship date null return invoice date if invoice date after ship date return invoice date return ship date getnewerdateacct invoicedate shipdate dateacct c_invoiceline c_invoice c_invoice_id c_invoice_id c_invoiceline_id preparedstatement preparestatement setint getc_invoiceline_id resultset executequery invoicedate gettimestamp dateacct m_inoutline m_inout m_inout_id m_inout_id m_inoutline_id preparestatement setint getm_inoutline_id resultset executequery shipdate gettimestamp invoicedate shipdate shipdate invoicedate invoicedate shipdate invoicedate shipdate before delete return true if acct was deleted protected boolean before delete if is posted if m period is open get ctx get date trx m doc type docbasetype matchinvoice return false set posted false return m fact acct delete table id get id get trxname 0 return true beforedelete isposted mperiod isopen getctx getdatetrx mdoctype docbasetype_matchinvoice setposted mfactacct table_id get_id get_trxname after delete param success success return success protected boolean after delete boolean success if success get order and decrease invoices m invoice line i line new m invoice line get ctx getc invoiceline id get trxname int c orderline id i line getc orderline id if c orderline id 0 m in out line io line new m in out line get ctx getm inoutline id get trxname c orderline id io line getc orderline id no order found if c orderline id 0 return success find matchpo m matchpo mpo m matchpo get get ctx c orderline id getc invoiceline id get trxname for int i 0 i mpo length i if mpo i getm inoutline id 0 mpo i delete true else mpo i setc invoiceline id null mpo i save return success afterdelete minvoiceline iline minvoiceline getctx getc_invoiceline_id get_trxname c_orderline_id iline getc_orderline_id c_orderline_id minoutline ioline minoutline getctx getm_inoutline_id get_trxname c_orderline_id ioline getc_orderline_id c_orderline_id mmatchpo mmatchpo getctx c_orderline_id getc_invoiceline_id get_trxname getm_inoutline_id setc_invoiceline_id persistency constructor param ctx context param ignored ignored public m attribute use properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 throw new illegal argument exception multi key mattributeuse trxname trxname illegalargumentexception load cosntructor param ctx context param rs result set public m attribute use properties ctx result set rs string trx name super ctx rs trx name mattributeuse resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success also used for after delete string sql update m attributeset mas set is instance attribute y where m attributeset id getm attributeset id and is instance attribute n and is ser no y or is lot y or is guarantee date y or exists select from m attributeuse mau inner join m attribute ma on mau m attribute id ma m attribute id where mau m attributeset id mas m attributeset id and mau is active y and ma is active y and ma is instance attribute y int no db execute update sql get trxname if no 0 log fine after save set instance attribute sql update m attributeset mas set is instance attribute n where m attributeset id getm attributeset id and is instance attribute y and is ser no n and is lot n and is guarantee date n and not exists select from m attributeuse mau inner join m attribute ma on mau m attribute id ma m attribute id where mau m attributeset id mas m attributeset id and mau is active y and ma is active y and ma is instance attribute y no db execute update sql get trxname if no 0 log fine after save reset instance attribute return success newrecord aftersave newrecord afterdelete m_attributeset isinstanceattribute m_attributeset_id getm_attributeset_id isinstanceattribute isserno islot isguaranteedate m_attributeuse m_attribute m_attribute_id m_attribute_id m_attributeset_id m_attributeset_id isactive isactive isinstanceattribute executeupdate get_trxname aftersave m_attributeset isinstanceattribute m_attributeset_id getm_attributeset_id isinstanceattribute isserno islot isguaranteedate m_attributeuse m_attribute m_attribute_id m_attribute_id m_attributeset_id m_attributeset_id isactive isactive isinstanceattribute executeupdate get_trxname aftersave after delete param success success return success protected boolean after delete boolean success after save false success return success afterdelete aftersave construct new test instance param name the test name public e mail test string name super name emailtest perform pre test initialization throws exception see test case set up protected void set up throws exception super set up org compiere compiere startup true testcase setup setup setup test sending to internal public void test internal e mail email test new e mail host from from test internal test internal message assert equals email test send e mail sent ok test internal test sending to internal authenticated public void test internal authenticate e mail email test new e mail host from from test internal authenticate test internal authenticate message email test sete mail user usr pwd assert equals email test send e mail sent ok test internal authenticate test sending to external public void test external e mail email test new e mail host from to test external test external message assert not same email test send e mail sent ok test external test sending to external authenticated public void test external authenticate e mail email test new e mail host from to test external authenticate test external authenticate message email test sete mail user usr pwd assert equals email test send e mail sent ok test external authenticate test sending html public void testhtml e mail email test new e mail host from to email test add cc to2 email test set messagehtml testhtml test html message email test sete mail user usr pwd assert equals email test send e mail sent ok testhtml test sending attachment public void test attachment e mail email test new e mail host from to test attachment test attachment message email test add to to2 email test add cc to3 email test add attachment new file c adempiere run adempiere sh email test sete mail user usr pwd assert equals email test send e mail sent ok test attachmenthtml test sending attachment html public void test attachmenthtml e mail email test new e mail system get properties host from to null null email test add to to2 email test add cc to3 email test set messagehtml test attachmenthtml test attachment html message email test add attachment new file c adempiere run adempiere sh email test create authenticator usr pwd assert equals email test send e mail sent ok testinternal email emailtest email testinternal assertequals emailtest email sent_ok testinternal testinternalauthenticate email emailtest email testinternalauthenticate emailtest setemailuser assertequals emailtest email sent_ok testinternalauthenticate testexternal email emailtest email testexternal assertnotsame emailtest email sent_ok testexternal testexternalauthenticate email emailtest email testexternalauthenticate emailtest setemailuser assertequals emailtest email sent_ok testexternalauthenticate email emailtest email emailtest addcc emailtest setmessagehtml emailtest setemailuser assertequals emailtest email sent_ok testattachment email emailtest email testattachment emailtest addto emailtest addcc emailtest addattachment run_adempiere emailtest setemailuser assertequals emailtest email sent_ok testattachmenthtml testattachmenthtml email emailtest email getproperties emailtest addto emailtest addcc emailtest setmessagehtml testattachmenthtml emailtest addattachment run_adempiere emailtest createauthenticator assertequals emailtest email sent_ok launch the test param args string public static void main string args junit textui test runner run e mail test class testrunner emailtest constructor param ass accounting schemata param rs record parem trx name trx public doc production m acct schema ass result set rs string trx name super ass x m production class rs doctype matproduction trx name trxname doc_production macctschema resultset trxname x_m_production doctype_matproduction trxname load document details return error message or null protected string load document details setc currency id no currency x m production prod x m production getpo set date doc prod get movement date set date acct prod get movement date contained objects p lines load lines prod log fine lines p lines length return null loaddocumentdetails setc_currency_id no_currency x_m_production x_m_production setdatedoc getmovementdate setdateacct getmovementdate p_lines loadlines p_lines load invoice line return doa line array private doc line load lines x m production prod array list doc line list new array list doc line production production plan production line the real level string sqlpp select from m productionplan pp where pp m production id order by pp line string sqlpl select from m productionline pl where pl m productionplan id order by pl line try prepared statement pstmtpp db prepare statement sqlpp get trx name pstmtpp set int 1 get id result set rspp pstmtpp execute query while rspp next int m product id rspp get int m product id int m productionplan id rspp get int m productionplan id try prepared statement pstmtpl db prepare statement sqlpl get trx name pstmtpl set int 1 m productionplan id result set rspl pstmtpl execute query while rspl next x m productionline line new x m productionline get ctx rspl get trx name if line get movement qty signum 0 log info line qty 0 line continue doc line doc line new doc line line this doc line set qty line get movement qty false identify finished bom product doc line set productionbom line getm product id m product id log fine doc line to string list add doc line rspl close pstmtpl close catch exception ee log log level severe sqlpl ee rspp close pstmtpp close catch sql exception e log log level severe sqlpp e return array doc line dl new doc line list size list to array dl return dl doaline docline loadlines x_m_production arraylist docline arraylist docline productionplan productionline m_productionplan m_production_id m_productionline m_productionplan_id preparedstatement preparestatement gettrxname setint get_id resultset executequery m_product_id getint m_product_id m_productionplan_id getint m_productionplan_id preparedstatement preparestatement gettrxname setint m_productionplan_id resultset executequery x_m_productionline x_m_productionline getctx gettrxname getmovementqty lineqty docline docline docline docline setqty getmovementqty docline setproductionbom getm_product_id m_product_id docline tostring docline sqlexception docline docline toarray get balance return zero always balanced public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for mmp pre production inventory dr cr pre param as account schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual setc currency id as getc currency id line pointer fact line fl null for int i 0 i p lines length i doc line line p lines i calculate costs big decimal costs null if line is productionbom get bom cost sum of individual lines big decimal bom cost env zero for int ii 0 ii p lines length ii doc line line0 p lines ii if line0 getm productionplan id line getm productionplan id continue if line0 is productionbom bom cost bom cost add line0 get product costs as line getad org id false costs bom cost negate else costs line get product costs as line getad org id false inventory dr cr fl fact create line line line get account product cost accttype p asset as as getc currency id costs if fl null p error no costs for line line get line line return null fl setm locator id line getm locator id fl set qty line get qty cost detail string description line get description if description null description if line is productionbom description m cost detail create production as line getad org id line getm product id line getm attributesetinstance id line get id 0 costs line get qty description get trx name array list fact facts new array list fact facts add fact return facts arraylist createfacts macctschema post_actual setc_currency_id getc_currency_id factline p_lines docline p_lines bigdecimal isproductionbom bigdecimal bomcost p_lines docline p_lines getm_productionplan_id getm_productionplan_id isproductionbom bomcost bomcost getproductcosts getad_org_id bomcost getproductcosts getad_org_id createline getaccount productcost accttype_p_asset getc_currency_id p_error getline setm_locator_id getm_locator_id setqty getqty getdescription isproductionbom mcostdetail createproduction getad_org_id getm_product_id getm_attributesetinstance_id get_id getqty gettrxname arraylist arraylist standard constructor public x ad alertrule properties ctx int ad alertrule id string trx name super ctx ad alertrule id trx name if ad alertrule id 0 setad alertrule id 0 setad alert id 0 set from clause null set is valid true y set name null set select clause null x_ad_alertrule ad_alertrule_id trxname ad_alertrule_id trxname ad_alertrule_id setad_alertrule_id setad_alert_id setfromclause setisvalid setname setselectclause load constructor public x ad alertrule properties ctx result set rs string trx name super ctx rs trx name x_ad_alertrule resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad alertrule append get id append return sb to string tostring stringbuffer stringbuffer x_ad_alertrule get_id tostring set alert rule definition of the alert element public void setad alertrule id int ad alertrule id if ad alertrule id 1 throw new illegal argument exception ad alertrule id is mandatory set valuenocheck ad alertrule id new integer ad alertrule id setad_alertrule_id ad_alertrule_id ad_alertrule_id illegalargumentexception ad_alertrule_id set_valuenocheck ad_alertrule_id ad_alertrule_id get alert rule definition of the alert element public int getad alertrule id integer ii integer get value ad alertrule id if ii null return 0 return ii int value getad_alertrule_id get_value ad_alertrule_id intvalue set alert compiere alert public void setad alert id int ad alert id if ad alert id 1 throw new illegal argument exception ad alert id is mandatory set valuenocheck ad alert id new integer ad alert id setad_alert_id ad_alert_id ad_alert_id illegalargumentexception ad_alert_id set_valuenocheck ad_alert_id ad_alert_id get alert compiere alert public int getad alert id integer ii integer get value ad alert id if ii null return 0 return ii int value getad_alert_id get_value ad_alert_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 0 set value ad table id null else set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id set_value ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set error msg public void set error msg string error msg if error msg null error msg length 2000 log warning length 2000 truncated error msg error msg substring 0 1999 set value error msg error msg seterrormsg errormsg errormsg errormsg errormsg errormsg set_value errormsg errormsg get error msg public string get error msg return string get value error msg geterrormsg get_value errormsg set sql from sql from clause public void set from clause string from clause if from clause null throw new illegal argument exception from clause is mandatory if from clause length 2000 log warning length 2000 truncated from clause from clause substring 0 1999 set value from clause from clause setfromclause fromclause fromclause illegalargumentexception fromclause fromclause fromclause fromclause set_value fromclause fromclause get sql from sql from clause public string get from clause return string get value from clause getfromclause get_value fromclause set valid element is valid public void set is valid boolean is valid set value is valid new boolean is valid setisvalid isvalid set_value isvalid isvalid get valid element is valid public boolean is valid object oo get value is valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvalid get_value isvalid booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set other clause other sql clause public void set other clause string other clause if other clause null other clause length 2000 log warning length 2000 truncated other clause other clause substring 0 1999 set value other clause other clause setotherclause otherclause otherclause otherclause otherclause otherclause set_value otherclause otherclause get other clause other sql clause public string get other clause return string get value other clause getotherclause get_value otherclause set post processing process sql after executing the query public void set post processing string post processing if post processing null post processing length 2000 log warning length 2000 truncated post processing post processing substring 0 1999 set value post processing post processing setpostprocessing postprocessing postprocessing postprocessing postprocessing postprocessing set_value postprocessing postprocessing get post processing process sql after executing the query public string get post processing return string get value post processing getpostprocessing get_value postprocessing set pre processing process sql before executing the query public void set pre processing string pre processing if pre processing null pre processing length 2000 log warning length 2000 truncated pre processing pre processing substring 0 1999 set value pre processing pre processing setpreprocessing preprocessing preprocessing preprocessing preprocessing preprocessing set_value preprocessing preprocessing get pre processing process sql before executing the query public string get pre processing return string get value pre processing getpreprocessing get_value preprocessing set sql select sql select clause public void set select clause string select clause if select clause null throw new illegal argument exception select clause is mandatory if select clause length 2000 log warning length 2000 truncated select clause select clause substring 0 1999 set value select clause select clause setselectclause selectclause selectclause illegalargumentexception selectclause selectclause selectclause selectclause set_value selectclause selectclause get sql select sql select clause public string get select clause return string get value select clause getselectclause get_value selectclause set sql where fully qualified sql where clause public void set where clause string where clause if where clause null where clause length 2000 log warning length 2000 truncated where clause where clause substring 0 1999 set value where clause where clause setwhereclause whereclause whereclause whereclause whereclause whereclause set_value whereclause whereclause get sql where fully qualified sql where clause public string get where clause return string get value where clause getwhereclause get_value whereclause standard constructor public x m matchpo properties ctx int m matchpo id string trx name super ctx m matchpo id trx name if m matchpo id 0 setc orderline id 0 set date acct new timestamp system current time millis set date trx new timestamp system current time millis setm inoutline id 0 setm matchpo id 0 setm product id 0 set posted false set processed false set processing false set qty env zero x_m_matchpo m_matchpo_id trxname m_matchpo_id trxname m_matchpo_id setc_orderline_id setdateacct currenttimemillis setdatetrx currenttimemillis setm_inoutline_id setm_matchpo_id setm_product_id setposted setprocessed setprocessing setqty load constructor public x m matchpo properties ctx result set rs string trx name super ctx rs trx name x_m_matchpo resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m matchpo append get id append return sb to string tostring stringbuffer stringbuffer x_m_matchpo get_id tostring set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set valuenocheck c invoiceline id null else set valuenocheck c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_valuenocheck c_invoiceline_id set_valuenocheck c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 1 throw new illegal argument exception c orderline id is mandatory set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id illegalargumentexception c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set transaction date transaction date public void set date trx timestamp date trx if date trx null throw new illegal argument exception date trx is mandatory set valuenocheck date trx date trx setdatetrx datetrx datetrx illegalargumentexception datetrx set_valuenocheck datetrx datetrx get transaction date transaction date public timestamp get date trx return timestamp get value date trx getdatetrx get_value datetrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 set valuenocheck m attributesetinstance id null else set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set match po match purchase order to shipment receipt and invoice public void setm matchpo id int m matchpo id if m matchpo id 1 throw new illegal argument exception m matchpo id is mandatory set valuenocheck m matchpo id new integer m matchpo id setm_matchpo_id m_matchpo_id m_matchpo_id illegalargumentexception m_matchpo_id set_valuenocheck m_matchpo_id m_matchpo_id get match po match purchase order to shipment receipt and invoice public int getm matchpo id integer ii integer get value m matchpo id if ii null return 0 return ii int value getm_matchpo_id get_value m_matchpo_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set posted posting status public void set posted boolean posted set valuenocheck posted new boolean posted setposted set_valuenocheck get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set price match difference difference between purchase and invoice price per matched line public void set price match difference big decimal price match difference set value price match difference price match difference setpricematchdifference bigdecimal pricematchdifference set_value pricematchdifference pricematchdifference get price match difference difference between purchase and invoice price per matched line public big decimal get price match difference big decimal bd big decimal get value price match difference if bd null return env zero return bd bigdecimal getpricematchdifference bigdecimal bigdecimal get_value pricematchdifference set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set valuenocheck qty qty setqty bigdecimal illegalargumentexception set_valuenocheck get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value constructor param display type public v header renderer int display type super alignment if display type is numeric display type m button set horizontal alignment j label right else if display type display type yes no m button set horizontal alignment j label center else m button set horizontal alignment j label left m button set margin new insets 0 0 0 0 displaytype vheaderrenderer displaytype displaytype isnumeric displaytype m_button sethorizontalalignment jlabel displaytype displaytype yesno m_button sethorizontalalignment jlabel m_button sethorizontalalignment jlabel m_button setmargin get table cell renderer component param table param value param is selected param has focus param row param column return button public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int column log trace this 10 v header renderer get table cell renderer component value null null value to string indicator for invisible column if value null m button set preferred size new dimension 0 0 return m button m button set text value to string return m button tablecell renderercomponent isselected hasfocus gettablecellrenderercomponent jtable isselected hasfocus vheaderrenderer gettablecellrenderercomponent tostring m_button setpreferredsize m_button m_button settext tostring m_button standard constructor public x ad usermail properties ctx int ad usermail id string trx name super ctx ad usermail id trx name if ad usermail id 0 setad usermail id 0 setad user id 0 x_ad_usermail ad_usermail_id trxname ad_usermail_id trxname ad_usermail_id setad_usermail_id setad_user_id load constructor public x ad usermail properties ctx result set rs string trx name super ctx rs trx name x_ad_usermail resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad usermail append get id append return sb to string tostring stringbuffer stringbuffer x_ad_usermail get_id tostring set user mail mail sent to the user public void setad usermail id int ad usermail id if ad usermail id 1 throw new illegal argument exception ad usermail id is mandatory set valuenocheck ad usermail id new integer ad usermail id setad_usermail_id ad_usermail_id ad_usermail_id illegalargumentexception ad_usermail_id set_valuenocheck ad_usermail_id ad_usermail_id get user mail mail sent to the user public int getad usermail id integer ii integer get value ad usermail id if ii null return 0 return ii int value getad_usermail_id get_value ad_usermail_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id set delivery confirmation e mail delivery confirmation public void set delivery confirmation string delivery confirmation if delivery confirmation null delivery confirmation length 120 log warning length 120 truncated delivery confirmation delivery confirmation substring 0 119 set valuenocheck delivery confirmation delivery confirmation email setdeliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation deliveryconfirmation set_valuenocheck deliveryconfirmation deliveryconfirmation get delivery confirmation e mail delivery confirmation public string get delivery confirmation return string get value delivery confirmation email getdeliveryconfirmation get_value deliveryconfirmation public static final string isdelivered yes y set delivered public void set is delivered string is delivered if is delivered null throw new illegal argument exception is delivered is mandatory if is delivered null is delivered equals n is delivered equals y else throw new illegal argument exception is delivered invalid value is delivered reference id 319 n y if is delivered null is delivered length 1 log warning length 1 truncated is delivered is delivered substring 0 0 set valuenocheck is delivered is delivered isdelivered_yes setisdelivered isdelivered isdelivered illegalargumentexception isdelivered isdelivered isdelivered isdelivered illegalargumentexception isdelivered isdelivered reference_id isdelivered isdelivered isdelivered isdelivered set_valuenocheck isdelivered isdelivered get delivered public string get is delivered return string get value is delivered getisdelivered get_value isdelivered set mail text text used for mail message public void set mail text string mail text if mail text null mail text length 2000 log warning length 2000 truncated mail text mail text substring 0 1999 set value mail text mail text setmailtext mailtext mailtext mailtext mailtext mailtext set_value mailtext mailtext get mail text text used for mail message public string get mail text return string get value mail text getmailtext get_value mailtext set message id e mail message id public void set messageid string messageid if messageid null messageid length 120 log warning length 120 truncated messageid messageid substring 0 119 set valuenocheck messageid messageid email setmessageid set_valuenocheck get message id e mail message id public string get messageid return string get value messageid email getmessageid get_value set mail template text templates for mailings public void setr mailtext id int r mailtext id if r mailtext id 0 set valuenocheck r mailtext id null else set valuenocheck r mailtext id new integer r mailtext id setr_mailtext_id r_mailtext_id r_mailtext_id set_valuenocheck r_mailtext_id set_valuenocheck r_mailtext_id r_mailtext_id get mail template text templates for mailings public int getr mailtext id integer ii integer get value r mailtext id if ii null return 0 return ii int value getr_mailtext_id get_value r_mailtext_id intvalue set subject email message subject public void set subject string subject if subject null subject length 255 log warning length 255 truncated subject subject substring 0 254 set value subject subject setsubject set_value get subject email message subject public string get subject return string get value subject getsubject get_value set mail message web store mail message template public void setw mailmsg id int w mailmsg id if w mailmsg id 0 set valuenocheck w mailmsg id null else set valuenocheck w mailmsg id new integer w mailmsg id setw_mailmsg_id w_mailmsg_id w_mailmsg_id set_valuenocheck w_mailmsg_id set_valuenocheck w_mailmsg_id w_mailmsg_id get mail message web store mail message template public int getw mailmsg id integer ii integer get value w mailmsg id if ii null return 0 return ii int value getw_mailmsg_id get_value w_mailmsg_id intvalue standard constructor public x b buyer properties ctx int b buyer id string trx name super ctx b buyer id trx name if b buyer id 0 setad user id 0 set name null set valid to new timestamp system current time millis x_b_buyer b_buyer_id trxname b_buyer_id trxname b_buyer_id setad_user_id setname setvalidto currenttimemillis load constructor public x b buyer properties ctx result set rs string trx name super ctx rs trx name x_b_buyer resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b buyer append get id append return sb to string tostring stringbuffer stringbuffer x_b_buyer get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set valid to valid to including this date last day public void set valid to timestamp valid to if valid to null throw new illegal argument exception valid to is mandatory set value valid to valid to setvalidto validto validto illegalargumentexception validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto get storage info param ctx context param m locator id locator param m product id product param m attributesetinstance id instance return existing or null public static m storage get properties ctx int m locator id int m product id int m attributesetinstance id string trx name m storage ret value null string sql select from m storage where m locator id and m product id and if m attributesetinstance id 0 sql m attributesetinstance id or m attributesetinstance id is null else sql m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m locator id pstmt set int 2 m product id pstmt set int 3 m attributesetinstance id result set rs pstmt execute query if rs next ret value new m storage ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if ret value null s log fine not found m locator id m locator id m product id m product id m attributesetinstance id m attributesetinstance id else s log fine m locator id m locator id m product id m product id m attributesetinstance id m attributesetinstance id return ret value m_locator_id m_product_id m_attributesetinstance_id mstorage m_locator_id m_product_id m_attributesetinstance_id trxname mstorage retvalue m_storage m_locator_id m_product_id m_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id preparedstatement preparestatement trxname setint m_locator_id setint m_product_id setint m_attributesetinstance_id resultset executequery retvalue mstorage trxname sqlexception s_log sqlexception retvalue s_log m_locator_id m_locator_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id s_log m_locator_id m_locator_id m_product_id m_product_id m_attributesetinstance_id m_attributesetinstance_id retvalue get all storages for product with asi param ctx context param m product id product param m locator id locator param fi fo first in first out return existing or null public static m storage get all withasi properties ctx int m product id int m locator id boolean fi fo string trx name array list m storage list new array list m storage string sql select from m storage where m product id and m locator id and m attributesetinstance id 0 and qty on hand 0 order by m attributesetinstance id if fi fo sql desc prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id pstmt set int 2 m locator id result set rs pstmt execute query while rs next list add new m storage ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m storage ret value new m storage list size list to array ret value return ret value m_product_id m_locator_id fifo mstorage getallwithasi m_product_id m_locator_id fifo trxname arraylist mstorage arraylist mstorage m_storage m_product_id m_locator_id m_attributesetinstance_id qtyonhand m_attributesetinstance_id fifo preparedstatement preparestatement trxname setint m_product_id setint m_locator_id resultset executequery mstorage trxname sqlexception s_log sqlexception mstorage retvalue mstorage toarray retvalue retvalue get all storages for product param ctx context param m product id product param m locator id locator return existing or null public static m storage get all properties ctx int m product id int m locator id string trx name array list m storage list new array list m storage string sql select from m storage where m product id and m locator id and qty on hand 0 order by m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id pstmt set int 2 m locator id result set rs pstmt execute query while rs next list add new m storage ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m storage ret value new m storage list size list to array ret value return ret value m_product_id m_locator_id mstorage getall m_product_id m_locator_id trxname arraylist mstorage arraylist mstorage m_storage m_product_id m_locator_id qtyonhand m_attributesetinstance_id preparedstatement preparestatement trxname setint m_product_id setint m_locator_id resultset executequery mstorage trxname sqlexception s_log sqlexception mstorage retvalue mstorage toarray retvalue retvalue get storage info for product across warehouses param ctx context param m product id product return existing or null public static m storage get of product properties ctx int m product id string trx name array list m storage list new array list m storage string sql select from m storage where m product id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query if rs next list add new m storage ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m storage ret value new m storage list size list to array ret value return ret value m_product_id mstorage getofproduct m_product_id trxname arraylist mstorage arraylist mstorage m_storage m_product_id preparedstatement preparestatement trxname setint m_product_id resultset executequery mstorage trxname sqlexception s_log sqlexception mstorage retvalue mstorage toarray retvalue retvalue get storage info for warehouse param ctx context param m warehouse id param m product id product param m attributesetinstance id instance param all attribute instances if true all attribute set instances param min guarantee date optional minimum guarantee date if all attribute instances param fi fo first in first out return existing ordered by location priority desc and or guarantee date public static m storage get warehouse properties ctx int m warehouse id int m product id int m attributesetinstance id int m attributeset id boolean all attribute instances timestamp min guarantee date boolean fi fo string trx name if m warehouse id 0 m product id 0 return new m storage 0 if m attributeset id 0 all attribute instances true else m attribute set mas m attribute set get ctx m attributeset id if mas is instance attribute all attribute instances true array list m storage list new array list m storage specific attribute set instance string sql select s m product id s m locator id s m attributesetinstance id s ad client id s ad org id s is active s created s created by s updated s updated by s qty on hand s qty reserved s qty ordered s date last inventory from m storage s inner join m locator l on l m locator id s m locator id where l m warehouse id and s m product id and coalesce s m attributesetinstance id 0 order by l priority no desc m attributesetinstance id if fi fo sql desc all attribute set instances if all attribute instances sql select s m product id s m locator id s m attributesetinstance id s ad client id s ad org id s is active s created s created by s updated s updated by s qty on hand s qty reserved s qty ordered s date last inventory from m storage s inner join m locator l on l m locator id s m locator id left outer join m attributesetinstance asi on s m attributesetinstance id asi m attributesetinstance id where l m warehouse id and s m product id if min guarantee date null sql and asi guarantee date is null or asi guarantee date order by asi guarantee date m attributesetinstance id if fi fo sql desc sql l priority no desc s qty on hand desc else sql order by l priority no desc l m locator id s m attributesetinstance id if fi fo sql desc sql s qty on hand desc prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m warehouse id pstmt set int 2 m product id if all attribute instances pstmt set int 3 m attributesetinstance id else if min guarantee date null pstmt set timestamp 3 min guarantee date result set rs pstmt execute query while rs next list add new m storage ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m storage ret value new m storage list size list to array ret value return ret value m_warehouse_id m_product_id m_attributesetinstance_id allattributeinstances minguaranteedate fifo mstorage getwarehouse m_warehouse_id m_product_id m_attributesetinstance_id m_attributeset_id allattributeinstances minguaranteedate fifo trxname m_warehouse_id m_product_id mstorage m_attributeset_id allattributeinstances mattributeset mattributeset m_attributeset_id isinstanceattribute allattributeinstances arraylist mstorage arraylist mstorage m_product_id m_locator_id m_attributesetinstance_id ad_client_id ad_org_id isactive createdby updatedby qtyonhand qtyreserved qtyordered datelastinventory m_storage m_locator m_locator_id m_locator_id m_warehouse_id m_product_id m_attributesetinstance_id priorityno m_attributesetinstance_id fifo allattributeinstances m_product_id m_locator_id m_attributesetinstance_id ad_client_id ad_org_id isactive createdby updatedby qtyonhand qtyreserved qtyordered datelastinventory m_storage m_locator m_locator_id m_locator_id m_attributesetinstance m_attributesetinstance_id m_attributesetinstance_id m_warehouse_id m_product_id minguaranteedate guaranteedate guaranteedate guaranteedate m_attributesetinstance_id fifo priorityno qtyonhand priorityno m_locator_id m_attributesetinstance_id fifo qtyonhand preparedstatement preparestatement trxname setint m_warehouse_id setint m_product_id allattributeinstances setint m_attributesetinstance_id minguaranteedate settimestamp minguaranteedate resultset executequery mstorage trxname s_log mstorage retvalue mstorage toarray retvalue retvalue create or get storage info param ctx context param m locator id locator param m product id product param m attributesetinstance id instance return existing new or null public static m storage get create properties ctx int m locator id int m product id int m attributesetinstance id string trx name if m locator id 0 throw new illegal argument exception m locator id 0 if m product id 0 throw new illegal argument exception m product id 0 m storage ret value get ctx m locator id m product id m attributesetinstance id trx name if ret value null return ret value insert row based on locator m locator locator new m locator ctx m locator id trx name if locator get id m locator id throw new illegal argument exception not found m locator id m locator id ret value new m storage locator m product id m attributesetinstance id ret value save trx name s log fine new ret value return ret value m_locator_id m_product_id m_attributesetinstance_id mstorage getcreate m_locator_id m_product_id m_attributesetinstance_id trxname m_locator_id illegalargumentexception m_locator_id m_product_id illegalargumentexception m_product_id mstorage retvalue m_locator_id m_product_id m_attributesetinstance_id trxname retvalue retvalue mlocator mlocator m_locator_id trxname get_id m_locator_id illegalargumentexception m_locator_id m_locator_id retvalue mstorage m_product_id m_attributesetinstance_id retvalue trxname s_log retvalue retvalue update storage info add called from m project issue param ctx context param m locator id locator param m product id product param m attributesetinstance id as instance param reservationattributesetinstance id reservation as instance param diff qty on hand add on hand param diff qty reserved add reserved param diff qty ordered add order return true if updated public static boolean add properties ctx int m warehouse id int m locator id int m product id int m attributesetinstance id int reservationattributesetinstance id big decimal diff qty on hand big decimal diff qty reserved big decimal diff qty ordered string trx name m storage storage null string buffer diff text new string buffer get storage if storage null storage get create ctx m locator id m product id m attributesetinstance id trx name verify if storage getm locator id m locator id storage getm product id m product id storage getm attributesetinstance id m attributesetinstance id s log severe no storage found m locator id m locator id m product id m product id asi m attributesetinstance id return false m storage storage0 null if m attributesetinstance id reservationattributesetinstance id storage0 get ctx m locator id m product id reservationattributesetinstance id trx name if storage0 null create if not existing should not happen m warehouse wh m warehouse get ctx m warehouse id int xm locator id wh get default locator getm locator id storage0 get create ctx xm locator id m product id reservationattributesetinstance id trx name boolean changed false if diff qty on hand null diff qty on hand signum 0 storage set qty on hand storage get qty on hand add diff qty on hand diff text append on hand append diff qty on hand changed true if diff qty reserved null diff qty reserved signum 0 if storage0 null storage set qty reserved storage get qty reserved add diff qty reserved else storage0 set qty reserved storage0 get qty reserved add diff qty reserved diff text append reserved append diff qty reserved changed true if diff qty ordered null diff qty ordered signum 0 if storage0 null storage set qty ordered storage get qty ordered add diff qty ordered else storage0 set qty ordered storage0 get qty ordered add diff qty ordered diff text append ordered append diff qty ordered changed true if changed diff text append append storage to string s log fine diff text to string if storage0 null storage0 save trx name no attribute set instance reserved ordered return storage save trx name return true mprojectissue m_locator_id m_product_id m_attributesetinstance_id reservationattributesetinstance_id diffqtyonhand diffqtyreserved diffqtyordered m_warehouse_id m_locator_id m_product_id m_attributesetinstance_id reservationattributesetinstance_id bigdecimal diffqtyonhand bigdecimal diffqtyreserved bigdecimal diffqtyordered trxname mstorage stringbuffer difftext stringbuffer getcreate m_locator_id m_product_id m_attributesetinstance_id trxname getm_locator_id m_locator_id getm_product_id m_product_id getm_attributesetinstance_id m_attributesetinstance_id s_log m_locator_id m_locator_id m_product_id m_product_id m_attributesetinstance_id mstorage m_attributesetinstance_id reservationattributesetinstance_id m_locator_id m_product_id reservationattributesetinstance_id trxname mwarehouse mwarehouse m_warehouse_id xm_locator_id getdefaultlocator getm_locator_id getcreate xm_locator_id m_product_id reservationattributesetinstance_id trxname diffqtyonhand diffqtyonhand setqtyonhand getqtyonhand diffqtyonhand difftext onhand diffqtyonhand diffqtyreserved diffqtyreserved setqtyreserved getqtyreserved diffqtyreserved setqtyreserved getqtyreserved diffqtyreserved difftext diffqtyreserved diffqtyordered diffqtyordered setqtyordered getqtyordered diffqtyordered setqtyordered getqtyordered diffqtyordered difftext diffqtyordered difftext tostring s_log difftext tostring trxname attributesetinstance trxname get location with highest locator priority and a sufficient on hand qty param m warehouse id warehouse param m product id product param m attributesetinstance id asi return id public static int getm locator id int m warehouse id int m product id int m attributesetinstance id big decimal qty string trx name int m locator id 0 int firstm locator id 0 string sql select s m locator id s qty on hand from m storage s inner join m locator l on s m locator id l m locator id inner join m product p on s m product id p m product id left outer join m attributeset mas on p m attributeset id mas m attributeset id where l m warehouse id and s m product id and mas is instance attribute is null or mas is instance attribute n or s m attributesetinstance id and l is active y order by l priority no desc s qty on hand desc prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m warehouse id pstmt set int 2 m product id pstmt set int 3 m attributesetinstance id result set rs pstmt execute query while rs next big decimal qty on hand rs get big decimal 2 if qty on hand null qty compare to qty on hand 0 m locator id rs get int 1 break if firstm locator id 0 firstm locator id rs get int 1 rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null if m locator id 0 return m locator id return firstm locator id onhand m_warehouse_id m_product_id m_attributesetinstance_id getm_locator_id m_warehouse_id m_product_id m_attributesetinstance_id bigdecimal trxname m_locator_id firstm_locator_id m_locator_id qtyonhand m_storage m_locator m_locator_id m_locator_id m_product m_product_id m_product_id m_attributeset m_attributeset_id m_attributeset_id m_warehouse_id m_product_id isinstanceattribute isinstanceattribute m_attributesetinstance_id isactive priorityno qtyonhand preparedstatement preparestatement trxname setint m_warehouse_id setint m_product_id setint m_attributesetinstance_id resultset executequery bigdecimal qtyonhand getbigdecimal qtyonhand compareto qtyonhand m_locator_id getint firstm_locator_id firstm_locator_id getint sqlexception s_log sqlexception m_locator_id m_locator_id firstm_locator_id get available qty the call is accurate only if there is a storage record and assumes that the product is stocked param m warehouse id wh param m product id product param m attributesetinstance id masi return qty available qty on hand qty reserved or null public static big decimal get qty available int m warehouse id int m product id int m attributesetinstance id string trx name big decimal ret value null prepared statement pstmt null string sql select sum qty on hand qty reserved from m storage s inner join m locator l on s m locator id l m locator id where s m product id and l m warehouse id if m attributesetinstance id 0 sql and m attributesetinstance id try pstmt db prepare statement sql trx name pstmt set int 1 m product id pstmt set int 2 m warehouse id if m attributesetinstance id 0 pstmt set int 3 m attributesetinstance id result set rs pstmt execute query if rs next ret value rs get big decimal 1 if rs was null ret value null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null s log fine m warehouse id m warehouse id m product id m product id ret value return ret value m_warehouse_id m_product_id m_attributesetinstance_id qtyonhand qtyreserved bigdecimal getqtyavailable m_warehouse_id m_product_id m_attributesetinstance_id trxname bigdecimal retvalue preparedstatement qtyonhand qtyreserved m_storage m_locator m_locator_id m_locator_id m_product_id m_warehouse_id m_attributesetinstance_id m_attributesetinstance_id preparestatement trxname setint m_product_id setint m_warehouse_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery retvalue getbigdecimal wasnull retvalue s_log s_log m_warehouse_id m_warehouse_id m_product_id m_product_id retvalue retvalue persistency constructor param ctx context param ignored ignored public m storage properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key set qty on hand env zero set qty ordered env zero set qty reserved env zero mstorage trxname trxname illegalargumentexception setqtyonhand setqtyordered setqtyreserved load constructor param ctx context param rs result set public m storage properties ctx result set rs string trx name super ctx rs trx name mstorage resultset trxname trxname full new constructor param locator parent locator param m product id product param m attributesetinstance id attribute private m storage m locator locator int m product id int m attributesetinstance id this locator get ctx 0 locator get trxname set client org locator setm locator id locator getm locator id setm product id m product id setm attributesetinstance id m attributesetinstance id m_product_id m_attributesetinstance_id mstorage mlocator m_product_id m_attributesetinstance_id getctx get_trxname setclientorg setm_locator_id getm_locator_id setm_product_id m_product_id setm_attributesetinstance_id m_attributesetinstance_id change qty on hand param qty quantity param add add if true public void change qty on hand big decimal qty boolean add if qty null qty signum 0 return if add set qty on hand get qty on hand add qty else set qty on hand get qty on hand subtract qty onhand changeqtyonhand bigdecimal setqtyonhand getqtyonhand setqtyonhand getqtyonhand get m warehouse id of locator return warehouse public int getm warehouse id if m m warehouse id 0 m locator loc m locator get get ctx getm locator id m m warehouse id loc getm warehouse id return m m warehouse id m_warehouse_id getm_warehouse_id m_m_warehouse_id mlocator mlocator getctx getm_locator_id m_m_warehouse_id getm_warehouse_id m_m_warehouse_id string representation return info public string to string string buffer sb new string buffer m storage append m locator id append getm locator id append m product id append getm product id append m attributesetinstance id append getm attributesetinstance id append on hand append get qty on hand append reserved append get qty reserved append ordered append get qty ordered append return sb to string tostring stringbuffer stringbuffer mstorage m_locator_id getm_locator_id m_product_id getm_product_id m_attributesetinstance_id getm_attributesetinstance_id onhand getqtyonhand getqtyreserved getqtyordered tostring standard constructor public x c bp vendor acct properties ctx int c bp vendor acct id string trx name super ctx c bp vendor acct id trx name if c bp vendor acct id 0 setc acctschema id 0 setc bpartner id 0 setv liability acct 0 setv prepayment acct 0 x_c_bp_vendor_acct c_bp_vendor_acct_id trxname c_bp_vendor_acct_id trxname c_bp_vendor_acct_id setc_acctschema_id setc_bpartner_id setv_liability_acct setv_prepayment_acct load constructor public x c bp vendor acct properties ctx result set rs string trx name super ctx rs trx name x_c_bp_vendor_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp vendor acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_vendor_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set vendor liability account for vendor liability public void setv liability acct int v liability acct set value v liability acct new integer v liability acct setv_liability_acct v_liability_acct set_value v_liability_acct v_liability_acct get vendor liability account for vendor liability public int getv liability acct integer ii integer get value v liability acct if ii null return 0 return ii int value getv_liability_acct get_value v_liability_acct intvalue set vendor service liability account for vender service liability public void setv liability services acct int v liability services acct set value v liability services acct new integer v liability services acct setv_liability_services_acct v_liability_services_acct set_value v_liability_services_acct v_liability_services_acct get vendor service liability account for vender service liability public int getv liability services acct integer ii integer get value v liability services acct if ii null return 0 return ii int value getv_liability_services_acct get_value v_liability_services_acct intvalue set vendor prepayment account for vendor prepayments public void setv prepayment acct int v prepayment acct set value v prepayment acct new integer v prepayment acct setv_prepayment_acct v_prepayment_acct set_value v_prepayment_acct v_prepayment_acct get vendor prepayment account for vendor prepayments public int getv prepayment acct integer ii integer get value v prepayment acct if ii null return 0 return ii int value getv_prepayment_acct get_value v_prepayment_acct intvalue get inventory line with parameters param inventory inventory param m locator id locator param m product id product param m attributesetinstance id asi return line or null public static m inventory line get m inventory inventory int m locator id int m product id int m attributesetinstance id m inventory line ret value null string sql select from m inventoryline where m inventory id and m locator id and m product id and m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql inventory get trxname pstmt set int 1 inventory getm inventory id pstmt set int 2 m locator id pstmt set int 3 m product id pstmt set int 4 m attributesetinstance id result set rs pstmt execute query if rs next ret value new m inventory line inventory get ctx rs inventory get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value m_locator_id m_product_id m_attributesetinstance_id minventoryline minventory m_locator_id m_product_id m_attributesetinstance_id minventoryline retvalue m_inventoryline m_inventory_id m_locator_id m_product_id m_attributesetinstance_id preparedstatement preparestatement get_trxname setint getm_inventory_id setint m_locator_id setint m_product_id setint m_attributesetinstance_id resultset executequery retvalue minventoryline getctx get_trxname s_log retvalue default constructor param ctx context param m inventoryline id line public m inventory line properties ctx int m inventoryline id string trx name super ctx m inventoryline id trx name if m inventoryline id 0 setm inventory id 0 parent setm inventoryline id 0 pk setm locator id 0 fk set line 0 setm product id 0 fk setm attributesetinstance id 0 fk set inventory type inventorytype inventorydifference set qty book env zero set qty count env zero set processed false m_inventoryline_id minventoryline m_inventoryline_id trxname m_inventoryline_id trxname m_inventoryline_id setm_inventory_id setm_inventoryline_id setm_locator_id setline setm_product_id setm_attributesetinstance_id setinventorytype inventorytype_inventorydifference setqtybook setqtycount setprocessed load constructor param ctx context param rs result set public m inventory line properties ctx result set rs string trx name super ctx rs trx name minventoryline resultset trxname trxname detail constructor locator product attribute set instance must be unique param inventory parent param m locator id locator param m product id product param m attributesetinstance id instance param qty book book value param qty count count value public m inventory line m inventory inventory int m locator id int m product id int m attributesetinstance id big decimal qty book big decimal qty count this inventory get ctx 0 inventory get trxname if inventory get id 0 throw new illegal argument exception header not saved m parent inventory setm inventory id inventory getm inventory id parent set client org inventory getad client id inventory getad org id setm locator id m locator id fk setm product id m product id fk setm attributesetinstance id m attributesetinstance id if qty book null set qty book qty book if qty count null qty count signum 0 set qty count qty count m ismanualentry false attributesetinstance m_locator_id m_product_id m_attributesetinstance_id qtybook qtycount minventoryline minventory m_locator_id m_product_id m_attributesetinstance_id bigdecimal qtybook bigdecimal qtycount getctx get_trxname get_id illegalargumentexception m_parent setm_inventory_id getm_inventory_id setclientorg getad_client_id getad_org_id setm_locator_id m_locator_id setm_product_id m_product_id setm_attributesetinstance_id m_attributesetinstance_id qtybook setqtybook qtybook qtycount qtycount setqtycount qtycount m_ismanualentry get qty book return qty book public big decimal get qty book big decimal bd super get qty book if bd null bd env zero return bd bigdecimal getqtybook bigdecimal getqtybook get qty count return qty count public big decimal get qty count big decimal bd super get qty count if bd null bd env zero return bd bigdecimal getqtycount bigdecimal getqtycount add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get parent param parent parent protected void set parent m inventory parent m parent parent setparent minventory m_parent get parent return parent public m inventory get parent if m parent null m parent new m inventory get ctx getm inventory id get trxname return m parent minventory getparent m_parent m_parent minventory getctx getm_inventory_id get_trxname m_parent string representation return info public string to string string buffer sb new string buffer m inventory line sb append get id append m product id append getm product id append qty count append get qty count append qty internal use append get qty internal use append qty book append get qty book append m attributesetinstance id append getm attributesetinstance id append return sb to string tostring stringbuffer stringbuffer minventoryline get_id m_product_id getm_product_id qtycount getqtycount qtyinternaluse getqtyinternaluse qtybook getqtybook m_attributesetinstance_id getm_attributesetinstance_id tostring before save param new record new return true if can be saved protected boolean before save boolean new record if new record m ismanualentry product requires asi if getm attributesetinstance id 0 m product product m product get get ctx getm product id if product getm attributeset id 0 m attribute set mas m attribute set get get ctx product getm attributeset id if mas is instance attribute mas is mandatory mas is mandatory always log save error fill mandatory msg get element get ctx m attributesetinstance id return false no asi new or manual set line no if get line 0 string sql select coalesce max line 0 10 as default value from m inventoryline where m inventory id int ii db getsql value get trxname sql getm inventory id set line ii internal use inventory if env zero compare to get qty internal use 0 if inventorytype chargeaccount equals get inventory type set inventory type inventorytype chargeaccount if getc charge id 0 log save error internal use needs charge return false else if inventorytype chargeaccount equals get inventory type if getc charge id 0 log save error fill mandatory msg get element get ctx c charge id return false else if getc charge id 0 setc charge id 0 set ad org to parent if not charge if getc charge id 0 setad org id get parent getad org id return true newrecord beforesave newrecord newrecord m_ismanualentry getm_attributesetinstance_id mproduct mproduct getctx getm_product_id getm_attributeset_id mattributeset mattributeset getctx getm_attributeset_id isinstanceattribute ismandatory ismandatoryalways saveerror fillmandatory getelement getctx m_attributesetinstance_id getline defaultvalue m_inventoryline m_inventory_id getsqlvalue get_trxname getm_inventory_id setline internaluse compareto getqtyinternaluse inventorytype_chargeaccount getinventorytype setinventorytype inventorytype_chargeaccount getc_charge_id saveerror internaluseneedscharge inventorytype_chargeaccount getinventorytype getc_charge_id saveerror fillmandatory getelement getctx c_charge_id getc_charge_id setc_charge_id ad_org getc_charge_id setad_org_id getparent getad_org_id after save param new record new param success success return true protected boolean after save boolean new record boolean success create ma if new record success m ismanualentry getm attributesetinstance id 0 createma return true newrecord aftersave newrecord newrecord m_ismanualentry getm_attributesetinstance_id create material allocations for new instances private void createma m storage storages m storage get all get ctx getm product id getm locator id get trxname boolean all zeroasi true for int i 0 i storages length i if storages i getm attributesetinstance id 0 all zeroasi false break if all zeroasi return m inventory linema ma null big decimal sum env zero for int i 0 i storages length i m storage storage storages i if storage get qty on hand signum 0 continue if ma null ma getm attributesetinstance id storage getm attributesetinstance id ma set movement qty ma get movement qty add storage get qty on hand else ma new m inventory linema this storage getm attributesetinstance id storage get qty on hand if ma save sum sum add storage get qty on hand if sum compare to get qty book 0 log warning qty book get qty book corrected to sum of ma sum set qty book sum mstorage mstorage getall getctx getm_product_id getm_locator_id get_trxname allzeroasi getm_attributesetinstance_id allzeroasi allzeroasi minventorylinema bigdecimal mstorage getqtyonhand getm_attributesetinstance_id getm_attributesetinstance_id setmovementqty getmovementqty getqtyonhand minventorylinema getm_attributesetinstance_id getqtyonhand getqtyonhand compareto getqtybook qtybook getqtybook setqtybook default constructor public mini browser this null minibrowser create mini browser with url param url public mini browser string url this set default close operation j dialog dispose on close try jb init catch exception e e print stack trace seturl url compiereplaf show center screen this minibrowser minibrowser setdefaultcloseoperation jdialog dispose_on_close jbinit printstacktrace showcenterscreen static init throws exception private void jb init throws exception scroll pane set preferred size new dimension 500 500 this get content pane add scroll pane border layout center scroll pane get viewport add editor pane null jbinit scrollpane setpreferredsize getcontentpane scrollpane borderlayout scrollpane getviewport editorpane set url param url private void seturl string url string myurl url if url null myurl http www adempiere org this set title myurl set url url realurl null try realurl new url myurl catch exception e system err println mini browser seturl set e to string if realurl null return open try editor pane set page realurl catch exception e system err println mini browser seturl open e to string settitle minibrowser tostring editorpane setpage minibrowser tostring standard constructor public x m product category properties ctx int m product category id string trx name super ctx m product category id trx name if m product category id 0 set is default false set is self service true y setmm policy null f setm product category id 0 set name null set planned margin env zero set value null x_m_product_category m_product_category_id trxname m_product_category_id trxname m_product_category_id setisdefault setisselfservice setmmpolicy setm_product_category_id setname setplannedmargin setvalue load constructor public x m product category properties ctx result set rs string trx name super ctx rs trx name x_m_product_category resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m product category append get id append return sb to string tostring stringbuffer stringbuffer x_m_product_category get_id tostring set print color color used for printing and display public void setad printcolor id int ad printcolor id if ad printcolor id 0 set value ad printcolor id null else set value ad printcolor id new integer ad printcolor id setad_printcolor_id ad_printcolor_id ad_printcolor_id set_value ad_printcolor_id set_value ad_printcolor_id ad_printcolor_id get print color color used for printing and display public int getad printcolor id integer ii integer get value ad printcolor id if ii null return 0 return ii int value getad_printcolor_id get_value ad_printcolor_id intvalue set asset group group of assets public void seta asset group id int a asset group id if a asset group id 0 set value a asset group id null else set value a asset group id new integer a asset group id seta_asset_group_id a_asset_group_id a_asset_group_id set_value a_asset_group_id set_value a_asset_group_id a_asset_group_id get asset group group of assets public int geta asset group id integer ii integer get value a asset group id if ii null return 0 return ii int value geta_asset_group_id get_value a_asset_group_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue public static final string mmpolicy lifo l set material policy material movement policy public void setmm policy string mm policy if mm policy null throw new illegal argument exception mm policy is mandatory if mm policy equals f mm policy equals l else throw new illegal argument exception mm policy invalid value mm policy reference id 335 f l if mm policy length 1 log warning length 1 truncated mm policy mm policy substring 0 0 set value mm policy mm policy mmpolicy_lifo setmmpolicy mmpolicy mmpolicy illegalargumentexception mmpolicy mmpolicy mmpolicy illegalargumentexception mmpolicy mmpolicy reference_id mmpolicy mmpolicy mmpolicy set_value mmpolicy mmpolicy get material policy material movement policy public string getmm policy return string get value mm policy getmmpolicy get_value mmpolicy set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set valuenocheck m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_valuenocheck m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set planned margin project s planned margin as a percentage public void set planned margin big decimal planned margin if planned margin null throw new illegal argument exception planned margin is mandatory set value planned margin planned margin setplannedmargin bigdecimal plannedmargin plannedmargin illegalargumentexception plannedmargin set_value plannedmargin plannedmargin get planned margin project s planned margin as a percentage public big decimal get planned margin big decimal bd big decimal get value planned margin if bd null return env zero return bd bigdecimal getplannedmargin bigdecimal bigdecimal get_value plannedmargin set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value default constructor need to call load nodes explicitly param ctx context for security param ad tree id the tree to build public m tree properties ctx int ad tree id string trx name super ctx ad tree id trx name loadnodes ad_tree_id mtree ad_tree_id trxname ad_tree_id trxname construct load tree param ad tree id the tree to build param editable true if tree can be modified includes inactive and empty summary nodes param ctx context for security param client tree the tree is displayed on the java client not on web public m tree properties ctx int ad tree id boolean editable boolean client tree string trx name this ctx ad tree id trx name m editable editable int ad user id env get context as int ctx ad user id m clienttree client tree log info ad tree id ad tree id ad user id ad user id editable editable on client client tree load nodes ad user id ad_tree_id clienttree mtree ad_tree_id clienttree trxname ad_tree_id trxname m_editable ad_user_id getcontextasint ad_user_id m_clienttree clienttree ad_tree_id ad_tree_id ad_user_id ad_user_id onclient clienttree loadnodes ad_user_id get default oldest complete ad tree id for key column called from grid controller param key column name key column name eg c project id param ad client id client return ad tree id public static int getdefaultad tree id int ad client id string key column name s log config key column name if key column name null key column name length 0 return 0 string tree type null if key column name equals ad menu id tree type treetype menu else if key column name equals c elementvalue id tree type treetype elementvalue else if key column name equals m product id tree type treetype product else if key column name equals c bpartner id tree type treetype bpartner else if key column name equals ad org id tree type treetype organization else if key column name equals c project id tree type treetype project else if key column name equals m productcategory id tree type treetype productcategory else if key column name equals m bom id tree type treetype bom else if key column name equals c salesregion id tree type treetype salesregion else if key column name equals c campaign id tree type treetype campaign else if key column name equals c activity id tree type treetype activity else s log log level severe could not map key column name return 0 int ad tree id 0 string sql select ad tree id name from ad tree where ad client id and tree type and is active y and is all nodes y order by is default desc ad tree id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set string 2 tree type result set rs pstmt execute query if rs next ad tree id rs get int 1 rs close pstmt close catch sql exception e s log log level severe sql e return ad tree id ad_tree_id keycolumn gridcontroller keycolumnname c_project_id ad_client_id ad_tree_id getdefaultad_tree_id ad_client_id keycolumnname s_log keycolumnname keycolumnname keycolumnname treetype keycolumnname ad_menu_id treetype treetype_menu keycolumnname c_elementvalue_id treetype treetype_elementvalue keycolumnname m_product_id treetype treetype_product keycolumnname c_bpartner_id treetype treetype_bpartner keycolumnname ad_org_id treetype treetype_organization keycolumnname c_project_id treetype treetype_project keycolumnname m_productcategory_id treetype treetype_productcategory keycolumnname m_bom_id treetype treetype_bom keycolumnname c_salesregion_id treetype treetype_salesregion keycolumnname c_campaign_id treetype treetype_campaign keycolumnname c_activity_id treetype treetype_activity s_log keycolumnname ad_tree_id ad_tree_id ad_tree ad_client_id treetype isactive isallnodes isdefault ad_tree_id preparedstatement preparestatement setint ad_client_id setstring treetype resultset executequery ad_tree_id getint sqlexception s_log ad_tree_id load nodes and bar param ad user id user for tree bar private void load nodes int ad user id sql for tree nodes string buffer sql new string buffer select tn node id tn parent id tn seq no tb is active from append get node table name append tn left outer join ad treebar tb on tn ad tree id tb ad tree id and tn node id tb node id and tb ad user id 1 where tn ad tree id 2 if m editable sql append and tn is active y sql append order by coalesce tn parent id 1 tn seq no log finest sql to string the node loop try load node details add to tree get node detail get node details prepared statement pstmt db prepare statement sql to string get trxname pstmt set int 1 ad user id pstmt set int 2 getad tree id get tree bar result set rs pstmt execute query m root new m tree node 0 0 get name get description 0 true null false null while rs next int node id rs get int 1 int parent id rs get int 2 int seq no rs get int 3 boolean on bar rs get string 4 null if node id 0 parent id 0 else add to tree node id parent id seq no on bar calls get node detail rs close pstmt close m noderowset close m noderowset null catch sql exception e log log level severe sql to string e m noderowset null done with loading add remainder from buffer if m buffer size 0 log finest clearing buffer adding to m root for int i 0 i m buffer size i m tree node node m tree node m buffer get i m tree node parent m root find node node getparent id if parent null parent get allows children parent add node check buffer node m buffer remove i i 1 start again with i 0 nodes w o parent if m buffer size 0 log severe nodes w o parent adding to root m buffer for int i 0 i m buffer size i m tree node node m tree node m buffer get i m root add node check buffer node m buffer remove i i 1 if m buffer size 0 log severe still nodes in buffer m buffer nodes w o parents clean up if m editable m root get child count 0 trim tree diag print tree if c log mgt is level finest m root get child count 0 log fine child count m root get child count ad_user_id loadnodes ad_user_id treenodes stringbuffer stringbuffer node_id parent_id seqno isactive getnodetablename ad_treebar ad_tree_id ad_tree_id node_id node_id ad_user_id ad_tree_id m_editable isactive parent_id seqno tostring addtotree getnodedetail getnodedetails preparedstatement preparestatement tostring get_trxname setint ad_user_id setint getad_tree_id resultset executequery m_root mtreenode getname getdescription node_id getint parent_id getint seqno getint onbar getstring node_id parent_id addtotree node_id parent_id seqno onbar getnodedetail m_noderowset m_noderowset sqlexception tostring m_noderowset m_buffer m_root m_buffer mtreenode mtreenode m_buffer mtreenode m_root findnode getparent_id getallowschildren checkbuffer m_buffer m_buffer m_buffer m_buffer mtreenode mtreenode m_buffer m_root checkbuffer m_buffer m_buffer m_buffer m_editable m_root getchildcount trimtree diagprinttree clogmgt islevelfinest m_root getchildcount childcount m_root getchildcount add node to tree if not found add to buffer param node id node id param parent id parent id param seq no seq no param on bar on bar private void add to tree int node id int parent id int seq no boolean on bar create new node m tree node child get node detail node id parent id seq no on bar if child null return add to tree m tree node parent null if m root null parent m root find node parent id parent found if parent null parent get allows children parent add child see if we can add nodes from buffer if m buffer size 0 check buffer child else m buffer add child node_id node_id parent_id parent_id seqno seqno onbar addtotree node_id parent_id seqno onbar mtreenode getnodedetail node_id parent_id seqno onbar mtreenode m_root m_root findnode parent_id getallowschildren m_buffer checkbuffer m_buffer check the buffer for nodes which have new node as parents param new node new node private void check buffer m tree node new node ability to add nodes if new node is summary new node get allows children return for int i 0 i m buffer size i m tree node node m tree node m buffer get i if node getparent id new node getnode id try new node add node catch exception e log severe adding node get name to new node get name e get message m buffer remove i i newnode newnode checkbuffer mtreenode newnode newnode issummary newnode getallowschildren m_buffer mtreenode mtreenode m_buffer getparent_id newnode getnode_id newnode getname newnode getname getmessage m_buffer get node detail loads data into row set m noderowset columns id name description is summary image indicator additional for menu parameter node id the sql contains security access control private void get node details sql for node info string buffer sql node new string buffer string source table t string from clause get source table name false fully qualified string column namex get source table name true string color get action color name if get tree type equals treetype menu boolean base env is base language p ctx ad menu source table m if base sql node append select m ad menu id m name m description m is summary m action m ad window id m ad process id m ad form id m ad workflow id m ad task id m ad workbench id from ad menu m else sql node append select m ad menu id t name t description m is summary m action m ad window id m ad process id m ad form id m ad workflow id m ad task id m ad workbench id from ad menu m ad menu trl t if base sql node append where m ad menu id t ad menu id and t ad language append env getad language p ctx append if m editable boolean has where sql node index of where 1 sql node append has where and where append m is active y do not show beta if m client get get ctx is use beta functions boolean has where sql node index of where 1 sql node append has where and where sql node append m ad window id is null or exists select from ad window w where m ad window id w ad window id and w is beta functionality n append and m ad process id is null or exists select from ad process p where m ad process id p ad process id and p is beta functionality n append and m ad form id is null or exists select from ad form f where m ad form id f ad form id and f is beta functionality n in r o menu show only defined forms if m editable boolean has where sql node index of where 1 sql node append has where and where sql node append m ad form id is null or exists select from ad form f where m ad form id f ad form id and if m clienttree sql node append f classname else sql node append f jspurl sql node append is not null else if column namex null throw new illegal argument exception unknown tree type get tree type sql node append select t append column namex append id t name t description t is summary append color append from append from clause if m editable sql node append where t is active y string sql sql node to string if m editable editable menu etc window sql m role get default get ctx false add accesssql sql source table m role sql fullyqualified m editable log fine sql m noderowset db get row set sql true rowset m_noderowset issummary imageindicator node_id getnodedetails stringbuffer sqlnode stringbuffer sourcetable fromclause getsourcetablename columnnamex getsourcetablename getactioncolorname gettreetype treetype_menu isbaselanguage p_ctx ad_menu sourcetable sqlnode ad_menu_id issummary ad_window_id ad_process_id ad_form_id ad_workflow_id ad_task_id ad_workbench_id ad_menu sqlnode ad_menu_id issummary ad_window_id ad_process_id ad_form_id ad_workflow_id ad_task_id ad_workbench_id ad_menu ad_menu_trl sqlnode ad_menu_id ad_menu_id ad_language getad_language p_ctx m_editable haswhere sqlnode indexof sqlnode haswhere isactive mclient getctx isusebetafunctions haswhere sqlnode indexof sqlnode haswhere sqlnode ad_window_id ad_window ad_window_id ad_window_id isbetafunctionality ad_process_id ad_process ad_process_id ad_process_id isbetafunctionality ad_form_id ad_form ad_form_id ad_form_id isbetafunctionality m_editable haswhere sqlnode indexof sqlnode haswhere sqlnode ad_form_id ad_form ad_form_id ad_form_id m_clienttree sqlnode sqlnode sqlnode columnnamex illegalargumentexception treetype gettreetype sqlnode columnnamex _id issummary fromclause m_editable sqlnode isactive sqlnode tostring m_editable mrole getdefault getctx addaccesssql sourcetable mrole sql_fullyqualified m_editable m_noderowset getrowset get menu node details as sql contains security access not all nodes will be found param node id key of the record param parent id parent id of the record param seq no sort index param on bar node also on shortcut bar return node private m tree node get node detail int node id int parent id int seq no boolean on bar m tree node ret value null try m noderowset before first while m noderowset next int node m noderowset get int 1 if node id node search for correct one continue id name description is summary action color int index 2 string name m noderowset get string index string description m noderowset get string index boolean is summary y equals m noderowset get string index string action color m noderowset get string index menu only if get tree type equals treetype menu is summary int ad window id m noderowset get int index int ad process id m noderowset get int index int ad form id m noderowset get int index int ad workflow id m noderowset get int index int ad task id m noderowset get int index int ad workbench id m noderowset get int index m role role m role get default get ctx false boolean access null if x ad menu action window equals action color access role get window access ad window id else if x ad menu action process equals action color x ad menu action report equals action color access role get process access ad process id else if x ad menu action form equals action color access role get form access ad form id else if x ad menu action workflow equals action color access role get workflow access ad workflow id else if x ad menu action task equals action color access role get task access ad task id else if x ad menu action workbench equals action access role get workbench access ad window id log fine get node detail name action color access if access null rw or ro for role m editable menu window can see all ret value new m tree node node id seq no name description parent id is summary action color on bar null menu has no color else always add color color null action if action color null get tree type equals treetype menu m print color print color m print color get get ctx action color if print color null color print color get color ret value new m tree node node id seq no name description parent id is summary null on bar color no action catch sql exception e log log level severe e return ret value node_id parent_id seqno onbar mtreenode getnodedetail node_id parent_id seqno onbar mtreenode retvalue m_noderowset beforefirst m_noderowset m_noderowset getint node_id issummary m_noderowset getstring m_noderowset getstring issummary m_noderowset getstring actioncolor m_noderowset getstring gettreetype treetype_menu issummary ad_window_id m_noderowset getint ad_process_id m_noderowset getint ad_form_id m_noderowset getint ad_workflow_id m_noderowset getint ad_task_id m_noderowset getint ad_workbench_id m_noderowset getint mrole mrole getdefault getctx x_ad_menu action_window actioncolor getwindowaccess ad_window_id x_ad_menu action_process actioncolor x_ad_menu action_report actioncolor getprocessaccess ad_process_id x_ad_menu action_form actioncolor getformaccess ad_form_id x_ad_menu action_workflow actioncolor getworkflowaccess ad_workflow_id x_ad_menu action_task actioncolor gettaskaccess ad_task_id x_ad_menu action_workbench getworkbenchaccess ad_window_id getnodedetail actioncolor m_editable retvalue mtreenode node_id seqno parent_id issummary actioncolor onbar actioncolor gettreetype treetype_menu mprintcolor printcolor mprintcolor getctx actioncolor printcolor printcolor getcolor retvalue mtreenode node_id seqno parent_id issummary onbar sqlexception retvalue trim tree of empty summary nodes public void trim tree boolean needs trim m root null while needs trim needs trim false enumeration en m root preorder enumeration while m root get child count 0 en has more elements m tree node nd m tree node en next element if nd is summary nd get child count 0 nd remove from parent needs trim true trimtree needstrim m_root needstrim needstrim m_root preorderenumeration m_root getchildcount hasmoreelements mtreenode mtreenode nextelement issummary getchildcount removefromparent needstrim diagnostics print tree private void dump tree enumeration en m root preorder enumeration int count 0 while en has more elements string buffer sb new string buffer m tree node nd m tree node en next element for int i 0 i nd get level i sb append sb append id append nd getnode id append seq no append nd get seq no append append nd get name system out println sb to string count system out println count count dumptree m_root preorderenumeration hasmoreelements stringbuffer stringbuffer mtreenode mtreenode nextelement getlevel getnode_id seqno getseqno getname tostring get root node return root public m tree node get root return m root mtreenode getroot m_root is menu tree return true if menu public boolean is menu return treetype menu equals get tree type ismenu treetype_menu gettreetype is product tree return true if product public boolean is product return treetype product equals get tree type isproduct treetype_product gettreetype is business partner tree return true if partner public boolean isb partner return treetype bpartner equals get tree type isbpartner treetype_bpartner gettreetype string representation return info public string to string string buffer sb new string buffer m tree sb append ad tree id append getad tree id append name append get name sb append return sb to string tostring stringbuffer stringbuffer mtree ad_tree_id getad_tree_id getname tostring standard constructor public x c dunninglevel properties ctx int c dunninglevel id string trx name super ctx c dunninglevel id trx name if c dunninglevel id 0 setc dunninglevel id 0 setc dunning id 0 set charge fee false set charge interest false set days after due env zero set days between dunning 0 set name null set print name null x_c_dunninglevel c_dunninglevel_id trxname c_dunninglevel_id trxname c_dunninglevel_id setc_dunninglevel_id setc_dunning_id setchargefee setchargeinterest setdaysafterdue setdaysbetweendunning setname setprintname load constructor public x c dunninglevel properties ctx result set rs string trx name super ctx rs trx name x_c_dunninglevel resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c dunninglevel append get id append return sb to string tostring stringbuffer stringbuffer x_c_dunninglevel get_id tostring set dunning level public void setc dunninglevel id int c dunninglevel id if c dunninglevel id 1 throw new illegal argument exception c dunninglevel id is mandatory set valuenocheck c dunninglevel id new integer c dunninglevel id setc_dunninglevel_id c_dunninglevel_id c_dunninglevel_id illegalargumentexception c_dunninglevel_id set_valuenocheck c_dunninglevel_id c_dunninglevel_id get dunning level public int getc dunninglevel id integer ii integer get value c dunninglevel id if ii null return 0 return ii int value getc_dunninglevel_id get_value c_dunninglevel_id intvalue set dunning dunning rules for overdue invoices public void setc dunning id int c dunning id if c dunning id 1 throw new illegal argument exception c dunning id is mandatory set valuenocheck c dunning id new integer c dunning id setc_dunning_id c_dunning_id c_dunning_id illegalargumentexception c_dunning_id set_valuenocheck c_dunning_id c_dunning_id get dunning dunning rules for overdue invoices public int getc dunning id integer ii integer get value c dunning id if ii null return 0 return ii int value getc_dunning_id get_value c_dunning_id intvalue set charge fee indicates if fees will be charged for overdue invoices public void set charge fee boolean charge fee set value charge fee new boolean charge fee setchargefee chargefee set_value chargefee chargefee get charge fee indicates if fees will be charged for overdue invoices public boolean is charge fee object oo get value charge fee if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ischargefee get_value chargefee booleanvalue set charge interest indicates if interest will be charged on overdue invoices public void set charge interest boolean charge interest set value charge interest new boolean charge interest setchargeinterest chargeinterest set_value chargeinterest chargeinterest get charge interest indicates if interest will be charged on overdue invoices public boolean is charge interest object oo get value charge interest if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ischargeinterest get_value chargeinterest booleanvalue set days after due date days after due date to dun if negative days until due public void set days after due big decimal days after due if days after due null throw new illegal argument exception days after due is mandatory set value days after due days after due setdaysafterdue bigdecimal daysafterdue daysafterdue illegalargumentexception daysafterdue set_value daysafterdue daysafterdue get days after due date days after due date to dun if negative days until due public big decimal get days after due big decimal bd big decimal get value days after due if bd null return env zero return bd bigdecimal getdaysafterdue bigdecimal bigdecimal get_value daysafterdue set days between dunning days between sending dunning notices public void set days between dunning int days between dunning set value days between dunning new integer days between dunning setdaysbetweendunning daysbetweendunning set_value daysbetweendunning daysbetweendunning get days between dunning days between sending dunning notices public int get days between dunning integer ii integer get value days between dunning if ii null return 0 return ii int value getdaysbetweendunning get_value daysbetweendunning intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final int dunning printformat id ad reference id 259 set dunning print format print format for printing dunning letters public void setdunning printformat id int dunning printformat id if dunning printformat id 0 set value dunning printformat id null else set value dunning printformat id new integer dunning printformat id dunning_printformat_id_ad_reference_id setdunning_printformat_id dunning_printformat_id dunning_printformat_id set_value dunning_printformat_id set_value dunning_printformat_id dunning_printformat_id get dunning print format print format for printing dunning letters public int getdunning printformat id integer ii integer get value dunning printformat id if ii null return 0 return ii int value getdunning_printformat_id get_value dunning_printformat_id intvalue set fee amount fee amount in invoice currency public void set fee amt big decimal fee amt set value fee amt fee amt setfeeamt bigdecimal feeamt set_value feeamt feeamt get fee amount fee amount in invoice currency public big decimal get fee amt big decimal bd big decimal get value fee amt if bd null return env zero return bd bigdecimal getfeeamt bigdecimal bigdecimal get_value feeamt set interest in percent percentage interest to charge on overdue invoices public void set interest percent big decimal interest percent set value interest percent interest percent setinterestpercent bigdecimal interestpercent set_value interestpercent interestpercent get interest in percent percentage interest to charge on overdue invoices public big decimal get interest percent big decimal bd big decimal get value interest percent if bd null return env zero return bd bigdecimal getinterestpercent bigdecimal bigdecimal get_value interestpercent set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set print text the label text to be printed on a document or correspondence public void set print name string print name if print name null throw new illegal argument exception print name is mandatory if print name length 60 log warning length 60 truncated print name print name substring 0 59 set value print name print name setprintname printname printname illegalargumentexception printname printname printname printname set_value printname printname get print text the label text to be printed on a document or correspondence public string get print name return string get value print name getprintname get_value printname standard constructor public x c project acct properties ctx int c project acct id string trx name super ctx c project acct id trx name if c project acct id 0 setc acctschema id 0 setc project id 0 setpj asset acct 0 setpj wip acct 0 x_c_project_acct c_project_acct_id trxname c_project_acct_id trxname c_project_acct_id setc_acctschema_id setc_project_id setpj_asset_acct setpj_wip_acct load constructor public x c project acct properties ctx result set rs string trx name super ctx rs trx name x_c_project_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c project acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_project_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set project financial project public void setc project id int c project id if c project id 1 throw new illegal argument exception c project id is mandatory set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id illegalargumentexception c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set project asset project asset account public void setpj asset acct int pj asset acct set value pj asset acct new integer pj asset acct setpj_asset_acct pj_asset_acct set_value pj_asset_acct pj_asset_acct get project asset project asset account public int getpj asset acct integer ii integer get value pj asset acct if ii null return 0 return ii int value getpj_asset_acct get_value pj_asset_acct intvalue set work in progress account for work in progress public void setpj wip acct int pj wip acct set value pj wip acct new integer pj wip acct setpj_wip_acct pj_wip_acct set_value pj_wip_acct pj_wip_acct get work in progress account for work in progress public int getpj wip acct integer ii integer get value pj wip acct if ii null return 0 return ii int value getpj_wip_acct get_value pj_wip_acct intvalue get contents return context public object get contents return contents getcontents standard constructor param ctx context param r requestprocessorlog id id public m request processor log properties ctx int r requestprocessorlog id string trx name super ctx r requestprocessorlog id trx name if r requestprocessorlog id 0 set is error false r_requestprocessorlog_id mrequestprocessorlog r_requestprocessorlog_id trxname r_requestprocessorlog_id trxname r_requestprocessorlog_id setiserror load constructor param ctx context param rs result set public m request processor log properties ctx result set rs string trx name super ctx rs trx name mrequestprocessorlog resultset trxname trxname parent constructor param parent parent param summary summary public m request processor log m request processor parent string summary this parent get ctx 0 parent get trxname set client org parent setr requestprocessor id parent getr requestprocessor id set summary summary mrequestprocessorlog mrequestprocessor getctx get_trxname setclientorg setr_requestprocessor_id getr_requestprocessor_id setsummary standard constructor public x m attribute properties ctx int m attribute id string trx name super ctx m attribute id trx name if m attribute id 0 set attribute value type null s set is instance attribute false set is mandatory false setm attribute id 0 set name null x_m_attribute m_attribute_id trxname m_attribute_id trxname m_attribute_id setattributevaluetype setisinstanceattribute setismandatory setm_attribute_id setname load constructor public x m attribute properties ctx result set rs string trx name super ctx rs trx name x_m_attribute resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attribute append get id append return sb to string tostring stringbuffer stringbuffer x_m_attribute get_id tostring public static final string attributevaluetype stringmax40 s set attribute value type type of attribute value public void set attribute value type string attribute value type if attribute value type null throw new illegal argument exception attribute value type is mandatory if attribute value type equals l attribute value type equals n attribute value type equals s else throw new illegal argument exception attribute value type invalid value attribute value type reference id 326 l n s if attribute value type length 1 log warning length 1 truncated attribute value type attribute value type substring 0 0 set value attribute value type attribute value type attributevaluetype_stringmax40 setattributevaluetype attributevaluetype attributevaluetype illegalargumentexception attributevaluetype attributevaluetype attributevaluetype attributevaluetype illegalargumentexception attributevaluetype attributevaluetype reference_id attributevaluetype attributevaluetype attributevaluetype set_value attributevaluetype attributevaluetype get attribute value type type of attribute value public string get attribute value type return string get value attribute value type getattributevaluetype get_value attributevaluetype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public void set is instance attribute boolean is instance attribute set value is instance attribute new boolean is instance attribute setisinstanceattribute isinstanceattribute set_value isinstanceattribute isinstanceattribute get instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public boolean is instance attribute object oo get value is instance attribute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinstanceattribute get_value isinstanceattribute booleanvalue set mandatory data entry is required in this column public void set is mandatory boolean is mandatory set value is mandatory new boolean is mandatory setismandatory ismandatory set_value ismandatory ismandatory get mandatory data entry is required in this column public boolean is mandatory object oo get value is mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatory get_value ismandatory booleanvalue set attribute search common search attribute public void setm attributesearch id int m attributesearch id if m attributesearch id 0 set value m attributesearch id null else set value m attributesearch id new integer m attributesearch id setm_attributesearch_id m_attributesearch_id m_attributesearch_id set_value m_attributesearch_id set_value m_attributesearch_id m_attributesearch_id get attribute search common search attribute public int getm attributesearch id integer ii integer get value m attributesearch id if ii null return 0 return ii int value getm_attributesearch_id get_value m_attributesearch_id intvalue set attribute product attribute public void setm attribute id int m attribute id if m attribute id 1 throw new illegal argument exception m attribute id is mandatory set valuenocheck m attribute id new integer m attribute id setm_attribute_id m_attribute_id m_attribute_id illegalargumentexception m_attribute_id set_valuenocheck m_attribute_id m_attribute_id get attribute product attribute public int getm attribute id integer ii integer get value m attribute id if ii null return 0 return ii int value getm_attribute_id get_value m_attribute_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x gl distributionline properties ctx int gl distributionline id string trx name super ctx gl distributionline id trx name if gl distributionline id 0 setgl distributionline id 0 setgl distribution id 0 set line 0 sql select nvl max line 0 10 as default value from gl distributionline where gl distribution id gl distribution id set overwrite acct false set overwrite activity false set overwriteb partner false set overwrite campaign false set overwrite loc from false set overwrite loc to false set overwrite org false set overwrite org trx false set overwrite product false set overwrite project false set overwrite sales region false set overwrite user1 false set overwrite user2 false set percent env zero x_gl_distributionline gl_distributionline_id trxname gl_distributionline_id trxname gl_distributionline_id setgl_distributionline_id setgl_distribution_id setline defaultvalue gl_distributionline gl_distribution_id gl_distribution_id setoverwriteacct setoverwriteactivity setoverwritebpartner setoverwritecampaign setoverwritelocfrom setoverwritelocto setoverwriteorg setoverwriteorgtrx setoverwriteproduct setoverwriteproject setoverwritesalesregion setoverwriteuser1 setoverwriteuser2 setpercent load constructor public x gl distributionline properties ctx result set rs string trx name super ctx rs trx name x_gl_distributionline resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl distributionline append get id append return sb to string tostring stringbuffer stringbuffer x_gl_distributionline get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue public static final int account id ad reference id 132 set account account used public void setaccount id int account id if account id 0 set value account id null else set value account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id set_value account_id set_value account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set value c locfrom id null else set value c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_value c_locfrom_id set_value c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set value c locto id null else set value c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_value c_locto_id set_value c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gl distribution line general ledger distribution line public void setgl distributionline id int gl distributionline id if gl distributionline id 1 throw new illegal argument exception gl distributionline id is mandatory set valuenocheck gl distributionline id new integer gl distributionline id setgl_distributionline_id gl_distributionline_id gl_distributionline_id illegalargumentexception gl_distributionline_id set_valuenocheck gl_distributionline_id gl_distributionline_id get gl distribution line general ledger distribution line public int getgl distributionline id integer ii integer get value gl distributionline id if ii null return 0 return ii int value getgl_distributionline_id get_value gl_distributionline_id intvalue set gl distribution general ledger distribution public void setgl distribution id int gl distribution id if gl distribution id 1 throw new illegal argument exception gl distribution id is mandatory set valuenocheck gl distribution id new integer gl distribution id setgl_distribution_id gl_distribution_id gl_distribution_id illegalargumentexception gl_distribution_id set_valuenocheck gl_distribution_id gl_distribution_id get gl distribution general ledger distribution public int getgl distribution id integer ii integer get value gl distribution id if ii null return 0 return ii int value getgl_distribution_id get_value gl_distribution_id intvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue public static final int org id ad reference id 130 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set overwrite account overwrite the account segment account with the value specified public void set overwrite acct boolean overwrite acct set value overwrite acct new boolean overwrite acct setoverwriteacct overwriteacct set_value overwriteacct overwriteacct get overwrite account overwrite the account segment account with the value specified public boolean is overwrite acct object oo get value overwrite acct if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteacct get_value overwriteacct booleanvalue set overwrite activity overwrite the account segment activity with the value specified public void set overwrite activity boolean overwrite activity set value overwrite activity new boolean overwrite activity setoverwriteactivity overwriteactivity set_value overwriteactivity overwriteactivity get overwrite activity overwrite the account segment activity with the value specified public boolean is overwrite activity object oo get value overwrite activity if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteactivity get_value overwriteactivity booleanvalue set overwrite bus partner overwrite the account segment business partner with the value specified public void set overwriteb partner boolean overwriteb partner set value overwriteb partner new boolean overwriteb partner setoverwritebpartner overwritebpartner set_value overwritebpartner overwritebpartner get overwrite bus partner overwrite the account segment business partner with the value specified public boolean is overwriteb partner object oo get value overwriteb partner if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritebpartner get_value overwritebpartner booleanvalue set overwrite campaign overwrite the account segment campaign with the value specified public void set overwrite campaign boolean overwrite campaign set value overwrite campaign new boolean overwrite campaign setoverwritecampaign overwritecampaign set_value overwritecampaign overwritecampaign get overwrite campaign overwrite the account segment campaign with the value specified public boolean is overwrite campaign object oo get value overwrite campaign if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritecampaign get_value overwritecampaign booleanvalue set overwrite location from overwrite the account segment location from with the value specified public void set overwrite loc from boolean overwrite loc from set value overwrite loc from new boolean overwrite loc from setoverwritelocfrom overwritelocfrom set_value overwritelocfrom overwritelocfrom get overwrite location from overwrite the account segment location from with the value specified public boolean is overwrite loc from object oo get value overwrite loc from if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritelocfrom get_value overwritelocfrom booleanvalue set overwrite location to overwrite the account segment location from with the value specified public void set overwrite loc to boolean overwrite loc to set value overwrite loc to new boolean overwrite loc to setoverwritelocto overwritelocto set_value overwritelocto overwritelocto get overwrite location to overwrite the account segment location from with the value specified public boolean is overwrite loc to object oo get value overwrite loc to if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritelocto get_value overwritelocto booleanvalue set overwrite organization overwrite the account segment organization with the value specified public void set overwrite org boolean overwrite org set value overwrite org new boolean overwrite org setoverwriteorg overwriteorg set_value overwriteorg overwriteorg get overwrite organization overwrite the account segment organization with the value specified public boolean is overwrite org object oo get value overwrite org if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteorg get_value overwriteorg booleanvalue set overwrite trx organuzation overwrite the account segment transaction organization with the value specified public void set overwrite org trx boolean overwrite org trx set value overwrite org trx new boolean overwrite org trx setoverwriteorgtrx overwriteorgtrx set_value overwriteorgtrx overwriteorgtrx get overwrite trx organuzation overwrite the account segment transaction organization with the value specified public boolean is overwrite org trx object oo get value overwrite org trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteorgtrx get_value overwriteorgtrx booleanvalue set overwrite product overwrite the account segment product with the value specified public void set overwrite product boolean overwrite product set value overwrite product new boolean overwrite product setoverwriteproduct overwriteproduct set_value overwriteproduct overwriteproduct get overwrite product overwrite the account segment product with the value specified public boolean is overwrite product object oo get value overwrite product if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteproduct get_value overwriteproduct booleanvalue set overwrite project overwrite the account segment project with the value specified public void set overwrite project boolean overwrite project set value overwrite project new boolean overwrite project setoverwriteproject overwriteproject set_value overwriteproject overwriteproject get overwrite project overwrite the account segment project with the value specified public boolean is overwrite project object oo get value overwrite project if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteproject get_value overwriteproject booleanvalue set overwrite sales region overwrite the account segment sales region with the value specified public void set overwrite sales region boolean overwrite sales region set value overwrite sales region new boolean overwrite sales region setoverwritesalesregion overwritesalesregion set_value overwritesalesregion overwritesalesregion get overwrite sales region overwrite the account segment sales region with the value specified public boolean is overwrite sales region object oo get value overwrite sales region if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwritesalesregion get_value overwritesalesregion booleanvalue set overwrite user1 overwrite the account segment user 1 with the value specified public void set overwrite user1 boolean overwrite user1 set value overwrite user1 new boolean overwrite user1 setoverwriteuser1 overwriteuser1 set_value overwriteuser1 overwriteuser1 get overwrite user1 overwrite the account segment user 1 with the value specified public boolean is overwrite user1 object oo get value overwrite user1 if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteuser1 get_value overwriteuser1 booleanvalue set overwrite user2 overwrite the account segment user 2 with the value specified public void set overwrite user2 boolean overwrite user2 set value overwrite user2 new boolean overwrite user2 setoverwriteuser2 overwriteuser2 set_value overwriteuser2 overwriteuser2 get overwrite user2 overwrite the account segment user 2 with the value specified public boolean is overwrite user2 object oo get value overwrite user2 if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isoverwriteuser2 get_value overwriteuser2 booleanvalue set percent percentage public void set percent big decimal percent if percent null throw new illegal argument exception percent is mandatory set value percent percent setpercent bigdecimal illegalargumentexception set_value get percent percentage public big decimal get percent big decimal bd big decimal get value percent if bd null return env zero return bd bigdecimal getpercent bigdecimal bigdecimal get_value public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue public class null filter implements filter public filter add attribute string name object attribute return this nullfilter addattribute public filter remove attribute string name return this removeattribute public boolean has attribute string name return false hasattribute public string process string to process return to process to_process to_process public string get info return info getinfo constructor param ctx context param window no window no param ad client id client param ad table id table public acct viewer data properties ctx int window no int ad client id int ad table id window no window no ad client id ad client id if ad client id 0 ad client id env get context as int env get ctx window no ad client id if ad client id 0 ad client id env get context as int env get ctx ad client id ad table id ad table id a schemas m acct schema get client acct schema ctx ad client id a schema a schemas 0 windowno ad_client_id ad_table_id acctviewerdata windowno ad_client_id ad_table_id windowno windowno ad_client_id ad_client_id ad_client_id ad_client_id getcontextasint getctx windowno ad_client_id ad_client_id ad_client_id getcontextasint getctx ad_client_id ad_table_id ad_table_id aschemas macctschema getclientacctschema ad_client_id aschema aschemas dispose public void dispose a schemas null a schema null where info clear where info null env clear win context window no aschemas aschema whereinfo whereinfo clearwincontext windowno fill accounting schema param cb j combo box to be filled protected void fill acct schema j combo box cb for int i 0 i a schemas length i cb add item new key name pair a schemas i getc acctschema id a schemas i get name jcombobox fillacctschema jcombobox aschemas additem keynamepair aschemas getc_acctschema_id aschemas getname fill posting type param cb j combo box to be filled protected void fill posting type j combo box cb int ad reference id 125 value name pair pt m ref list get list ad reference id true for int i 0 i pt length i cb add item pt i jcombobox fillpostingtype jcombobox ad_reference_id valuenamepair mreflist getlist ad_reference_id additem fill table with value name pair table name translated key column name and table info with table name ad table id and select the entry for ad table id param cb j combo box to be filled protected void fill table j combo box cb value name pair select null string sql select ad table id table name from ad table t where exists select from ad column c where t ad table id c ad table id and c column name posted and is view n try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next int id rs get int 1 string table name rs get string 2 string name msg translate env get ctx table name id value name pair pp new value name pair table name name cb add item pp table info put table name new integer id if id ad table id select pp rs close pstmt close catch sql exception e log log level severe sql e if select null cb set selected item select valuenamepair tablename translatedkeycolumnname tableinfo tablename ad_table_id ad_table_id jcombobox filltable jcombobox valuenamepair ad_table_id tablename ad_table ad_column ad_table_id ad_table_id columnname isview preparedstatement preparestatement resultset executequery getint tablename getstring getctx tablename _id valuenamepair valuenamepair tablename additem tableinfo tablename ad_table_id sqlexception setselecteditem fill org param cb j combo box to be filled protected void fill org j combo box cb key name pair pp new key name pair 0 cb add item pp string sql select ad org id name from ad org where ad client id order by value try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad client id result set rs pstmt execute query while rs next cb add item new key name pair rs get int 1 rs get string 2 rs close pstmt close catch sql exception e log log level severe sql e jcombobox fillorg jcombobox keynamepair keynamepair additem ad_org_id ad_org ad_client_id preparedstatement preparestatement setint ad_client_id resultset executequery additem keynamepair getint getstring sqlexception get button text param table name table param column name column param selectsql sql return text on button protected string get button text string table name string column name string selectsql select embedded from table name avd where avd selectsql string buffer sql new string buffer select language language env get language env get ctx sql append m lookup factory getlookup tabledirembed language column name avd append from append table name append avd where avd append selectsql string ret value selectsql try statement stmt db create statement result set rs stmt execute query sql to string if rs next ret value rs get string 1 rs close stmt close catch sql exception e log log level severe sql to string e return ret value tablename columnname getbuttontext tablename columnname tablename stringbuffer stringbuffer getlanguage getctx mlookupfactory getlookup_tabledirembed columnname tablename retvalue createstatement resultset executequery tostring retvalue getstring sqlexception tostring retvalue create query and submit return report model protected r model query set where clause string buffer where clause new string buffer add organization if c acctschema id 0 where clause append r model table alias append c acctschema id append c acctschema id posting type selected if posting type null posting type length 0 if where clause length 0 where clause append and where clause append r model table alias append posting type append posting type append if document query if where clause length 0 where clause append and where clause append r model table alias append ad table id append ad table id append and append r model table alias append record id append record id else get values queries iterator it where info values iterator while it has next string where string it next if where null where length 0 add only if not empty if where clause length 0 where clause append and where clause append r model table alias append append where if date from null date to null if where clause length 0 where clause append and if date from null date to null where clause append trunc append r model table alias append date acct between append db to date date from append and append db to date date to else if date from null where clause append trunc append r model table alias append date acct append db to date date from else date to null where clause append trunc append r model table alias append date acct append db to date date to add organization if ad org id 0 if where clause length 0 where clause append and where clause append r model table alias append ad org id append ad org id set order by clause string buffer order clause new string buffer if sort by1 length 0 order clause append r model table alias append append sort by1 if sort by2 length 0 if order clause length 0 order clause append order clause append r model table alias append append sort by2 if sort by3 length 0 if order clause length 0 order clause append order clause append r model table alias append append sort by3 if sort by4 length 0 if order clause length 0 order clause append order clause append r model table alias append append sort by4 if order clause length 0 order clause append r model table alias append fact acct id r model rm getr model groups if group1 sort by1 length 0 rm set group sort by1 if group2 sort by2 length 0 rm set group sort by2 if group3 sort by3 length 0 rm set group sort by3 if group4 sort by4 length 0 rm set group sort by4 totals rm set function amt acct dr r model function sum rm set function amt acct cr r model function sum rm query env get ctx where clause to string order clause to string return rm rmodel stringbuffer whereclause stringbuffer c_acctschema_id whereclause rmodel table_alias c_acctschema_id c_acctschema_id postingtype postingtype whereclause whereclause whereclause rmodel table_alias postingtype postingtype documentquery whereclause whereclause whereclause rmodel table_alias ad_table_id ad_table_id rmodel table_alias record_id record_id whereinfo hasnext whereclause whereclause whereclause rmodel table_alias datefrom dateto whereclause whereclause datefrom dateto whereclause rmodel table_alias dateacct to_date datefrom to_date dateto datefrom whereclause rmodel table_alias dateacct to_date datefrom dateto whereclause rmodel table_alias dateacct to_date dateto ad_org_id whereclause whereclause whereclause rmodel table_alias ad_org_id ad_org_id stringbuffer orderclause stringbuffer sortby1 orderclause rmodel table_alias sortby1 sortby2 orderclause orderclause orderclause rmodel table_alias sortby2 sortby3 orderclause orderclause orderclause rmodel table_alias sortby3 sortby4 orderclause orderclause orderclause rmodel table_alias sortby4 orderclause orderclause rmodel table_alias fact_acct_id rmodel getrmodel sortby1 setgroup sortby1 sortby2 setgroup sortby2 sortby3 setgroup sortby3 sortby4 setgroup sortby4 setfunction amtacctdr rmodel function_sum setfunction amtacctcr rmodel function_sum getctx whereclause tostring orderclause tostring create report model columns return report model private r model getr model properties ctx env get ctx r model rm new r model fact acct add key lookups array list keys create key columns int max m leadingcolumns if max 0 max keys size for int i 0 i max i string column string keys get i if column null column starts with date rm add column new r column ctx column display type date else if column null column ends with id rm add column new r column ctx column display type table dir main info rm add column new r column ctx amt acct dr display type amount rm add column new r column ctx amt acct cr display type amount if display source amt if keys contains date trx rm add column new r column ctx date trx display type date rm add column new r column ctx c currency id display type table dir rm add column new r column ctx amt source dr display type amount rm add column new r column ctx amt source cr display type amount rm add column new r column ctx rate display type amount case when amt source dr amt source cr 0 then 0 else amt acct dr amt acct cr amt source dr amt source cr end remaining keys for int i max i keys size i string column string keys get i if column null column starts with date rm add column new r column ctx column display type date else if column null column ends with id rm add column new r column ctx column display type table dir info if keys contains date acct rm add column new r column ctx date acct display type date if keys contains c period id rm add column new r column ctx c period id display type table dir if display qty rm add column new r column ctx c uom id display type table dir rm add column new r column ctx qty display type quantity if display document info rm add column new r column ctx ad table id display type table dir rm add column new r column ctx record id display type id rm add column new r column ctx description display type string if posting type null posting type length 0 rm add column new r column ctx posting type display type list m fact acct postingtype ad reference id return rm rmodel getrmodel getctx rmodel rmodel fact_acct arraylist createkeycolumns m_leadingcolumns startswith addcolumn rcolumn displaytype endswith _id addcolumn rcolumn displaytype tabledir addcolumn rcolumn amtacctdr displaytype addcolumn rcolumn amtacctcr displaytype displaysourceamt datetrx addcolumn rcolumn datetrx displaytype addcolumn rcolumn c_currency_id displaytype tabledir addcolumn rcolumn amtsourcedr displaytype addcolumn rcolumn amtsourcecr displaytype addcolumn rcolumn displaytype amtsourcedr amtsourcecr amtacctdr amtacctcr amtsourcedr amtsourcecr startswith addcolumn rcolumn displaytype endswith _id addcolumn rcolumn displaytype tabledir dateacct addcolumn rcolumn dateacct displaytype c_period_id addcolumn rcolumn c_period_id displaytype tabledir displayqty addcolumn rcolumn c_uom_id displaytype tabledir addcolumn rcolumn displaytype displaydocumentinfo addcolumn rcolumn ad_table_id displaytype tabledir addcolumn rcolumn record_id displaytype addcolumn rcolumn displaytype postingtype postingtype addcolumn rcolumn postingtype displaytype mfactacct postingtype_ad_reference_id create the key columns in sequence return list of key columns private array list create key columns array list string columns new array list string m leadingcolumns 0 sorting fields columns add sort by1 may add if columns contains sort by2 columns add sort by2 if columns contains sort by3 columns add sort by3 if columns contains sort by4 columns add sort by4 add account segments m acct schema element elements a schema get acct schema elements for int i 0 i elements length i if m leadingcolumns 0 columns contains ad org id columns contains account id m leadingcolumns columns size m acct schema element ase elements i string column name ase get column name if columns contains column name columns add column name if m leadingcolumns 0 columns contains ad org id columns contains account id m leadingcolumns columns size return columns arraylist createkeycolumns arraylist arraylist m_leadingcolumns sortby1 sortby2 sortby2 sortby3 sortby3 sortby4 sortby4 macctschemaelement aschema getacctschemaelements m_leadingcolumns ad_org_id account_id m_leadingcolumns macctschemaelement columnname getcolumnname columnname columnname m_leadingcolumns ad_org_id account_id m_leadingcolumns standard constructor public x m packageline properties ctx int m packageline id string trx name super ctx m packageline id trx name if m packageline id 0 setm inoutline id 0 setm packageline id 0 setm package id 0 set qty env zero x_m_packageline m_packageline_id trxname m_packageline_id trxname m_packageline_id setm_inoutline_id setm_packageline_id setm_package_id setqty load constructor public x m packageline properties ctx result set rs string trx name super ctx rs trx name x_m_packageline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m packageline append get id append return sb to string tostring stringbuffer stringbuffer x_m_packageline get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 1 throw new illegal argument exception m inoutline id is mandatory set valuenocheck m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id illegalargumentexception m_inoutline_id set_valuenocheck m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set package line the detail content of the package public void setm packageline id int m packageline id if m packageline id 1 throw new illegal argument exception m packageline id is mandatory set valuenocheck m packageline id new integer m packageline id setm_packageline_id m_packageline_id m_packageline_id illegalargumentexception m_packageline_id set_valuenocheck m_packageline_id m_packageline_id get package line the detail content of the package public int getm packageline id integer ii integer get value m packageline id if ii null return 0 return ii int value getm_packageline_id get_value m_packageline_id intvalue set package shipment package public void setm package id int m package id if m package id 1 throw new illegal argument exception m package id is mandatory set valuenocheck m package id new integer m package id setm_package_id m_package_id m_package_id illegalargumentexception m_package_id set_valuenocheck m_package_id m_package_id get package shipment package public int getm package id integer ii integer get value m package id if ii null return 0 return ii int value getm_package_id get_value m_package_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm package id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_package_id set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value get order unreserved qty param ctx context param m warehouse id wh param m product id product param m attributesetinstance id asi param excludec orderline id exclude c orderline id return unreserved qty public static big decimal get not reserved properties ctx int m warehouse id int m product id int m attributesetinstance id int excludec orderline id big decimal ret value env zero string sql select sum qty ordered qty delivered qty reserved from c orderline ol inner join c order o on ol c order id o c order id where ol m warehouse id 1 and m product id 2 and o isso trx y and o doc status dr and qty ordered qty delivered qty reserved 0 and ol c orderline id if m attributesetinstance id 0 sql and m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m warehouse id pstmt set int 2 m product id pstmt set int 3 excludec orderline id if m attributesetinstance id 0 pstmt set int 4 m attributesetinstance id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log fine else s log fine ret value to string return ret value m_warehouse_id m_product_id m_attributesetinstance_id excludec_orderline_id c_orderline_id bigdecimal getnotreserved m_warehouse_id m_product_id m_attributesetinstance_id excludec_orderline_id bigdecimal retvalue qtyordered qtydelivered qtyreserved c_orderline c_order c_order_id c_order_id m_warehouse_id m_product_id issotrx docstatus qtyordered qtydelivered qtyreserved c_orderline_id m_attributesetinstance_id m_attributesetinstance_id preparedstatement preparestatement setint m_warehouse_id setint m_product_id setint excludec_orderline_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery retvalue getbigdecimal s_log retvalue s_log s_log retvalue tostring retvalue default constructor param ctx context param c orderline id order line to load param trx name trx name public m order line properties ctx int c orderline id string trx name super ctx c orderline id trx name if c orderline id 0 setc order id 0 set line 0 setm warehouse id 0 m warehouse id setc bpartner id 0 setc bpartner location id 0 c bpartner location id setc currency id 0 c currency id set date ordered new timestamp system current time millis date ordered setc tax id 0 setc uom id 0 set freight amt env zero set line net amt env zero set price entered env zero set price actual env zero set price limit env zero set price list env zero setm attributesetinstance id 0 set qty entered env zero set qty ordered env zero 1 set qty delivered env zero set qty invoiced env zero set qty reserved env zero set is description false n set processed false set line 0 c_orderline_id trxname morderline c_orderline_id trxname c_orderline_id trxname c_orderline_id setc_order_id setline setm_warehouse_id m_warehouse_id setc_bpartner_id setc_bpartner_location_id c_bpartner_location_id setc_currency_id c_currency_id setdateordered currenttimemillis dateordered setc_tax_id setc_uom_id setfreightamt setlinenetamt setpriceentered setpriceactual setpricelimit setpricelist setm_attributesetinstance_id setqtyentered setqtyordered setqtydelivered setqtyinvoiced setqtyreserved setisdescription setprocessed setline parent constructor ol setm product id wbl getm product id ol set qty ordered wbl get quantity ol set price ol set price actual wbl get price ol set tax ol save param order parent order public m order line m order order this order get ctx 0 order get trxname if order get id 0 throw new illegal argument exception header not saved setc order id order getc order id parent set order order setm_product_id getm_product_id setqtyordered getquantity setprice setpriceactual getprice settax morderline morder getctx get_trxname get_id illegalargumentexception setc_order_id getc_order_id setorder load constructor param ctx context param rs result set record public m order line properties ctx result set rs string trx name super ctx rs trx name morderline resultset trxname trxname set defaults from order does not set parent param order order public void set order m order order set client org order setc bpartner id order getc bpartner id setc bpartner location id order getc bpartner location id setm warehouse id order getm warehouse id set date ordered order get date ordered set date promised order get date promised setc currency id order getc currency id set header info order sets m order setorder morder setclientorg setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setm_warehouse_id getm_warehouse_id setdateordered getdateordered setdatepromised getdatepromised setc_currency_id getc_currency_id setheaderinfo m_order set header info param order order public void set header info m order order m parent order m precision new integer order get precision m m pricelist id order getm pricelist id m issotrx order isso trx setheaderinfo morder m_parent m_precision getprecision m_m_pricelist_id getm_pricelist_id m_issotrx issotrx get parent return parent public m order get parent if m parent null m parent new m order get ctx getc order id get trxname return m parent morder getparent m_parent m_parent morder getctx getc_order_id get_trxname m_parent set price entered actual use this method if the line uom is the product uom param price actual price public void set price big decimal price actual set price entered price actual set price actual price actual priceactual setprice bigdecimal priceactual setpriceentered priceactual setpriceactual priceactual set price actual actual price is not updateable param price actual actual price public void set price actual big decimal price actual if price actual null throw new illegal argument exception price actual is mandatory set valuenocheck price actual price actual priceactual setpriceactual bigdecimal priceactual priceactual illegalargumentexception priceactual set_valuenocheck priceactual priceactual set price for product and price list use only if newly created uses standard price list of not set by order constructor public void set price if getm product id 0 return if m m pricelist id 0 throw new illegal state exception price list unknown set price m m pricelist id pricelist setprice getm_product_id m_m_pricelist_id illegalstateexception pricelist setprice m_m_pricelist_id set price for product and price list param m pricelist id price list public void set price int m pricelist id if getm product id 0 return log fine m pricelist id m pricelist id get product pricing m pricelist id set price actual m productprice get price std set price list m productprice get price list set price limit m productprice get price limit if get qty entered compare to get qty ordered 0 set price entered get price actual else set price entered get price actual multiply get qty ordered divide get qty entered 12 big decimal round half up recision calculate discount set discount m productprice get discount set uom setc uom id m productprice getc uom id pricelist m_pricelist_id setprice m_pricelist_id getm_product_id m_pricelist_id m_pricelist_id getproductpricing m_pricelist_id setpriceactual m_productprice getpricestd setpricelist m_productprice getpricelist setpricelimit m_productprice getpricelimit getqtyentered compareto getqtyordered setpriceentered getpriceactual setpriceentered getpriceactual getqtyordered getqtyentered bigdecimal round_half_up setdiscount m_productprice getdiscount setc_uom_id m_productprice getc_uom_id get and calculate product pricing param m pricelist id id return product pricing private m product pricing get product pricing int m pricelist id m productprice new m product pricing getm product id getc bpartner id get qty ordered m issotrx m productprice setm pricelist id m pricelist id m productprice set price date get date ordered m productprice calculate price return m productprice m_pricelist_id mproductpricing getproductpricing m_pricelist_id m_productprice mproductpricing getm_product_id getc_bpartner_id getqtyordered m_issotrx m_productprice setm_pricelist_id m_pricelist_id m_productprice setpricedate getdateordered m_productprice calculateprice m_productprice set tax public boolean set tax int ii tax get get ctx getm product id getc charge id get date ordered get date ordered getad org id getm warehouse id getc bpartner location id should be bill to getc bpartner location id m issotrx if ii 0 log log level severe no tax found return false setc tax id ii return true settax getctx getm_product_id getc_charge_id getdateordered getdateordered getad_org_id getm_warehouse_id getc_bpartner_location_id getc_bpartner_location_id m_issotrx setc_tax_id calculate extended amt may or may not include tax public void set line net amt big decimal bd get price actual multiply get qty ordered if bd scale get precision bd bd set scale get precision big decimal round half up super set line net amt bd setlinenetamt bigdecimal getpriceactual getqtyordered getprecision setscale getprecision bigdecimal round_half_up setlinenetamt get currency precision from currency return precision public int get precision if m precision null return m precision int value if getc currency id 0 set order get parent if m precision null return m precision int value if getc currency id 0 m currency cur m currency get get ctx getc currency id if cur get id 0 m precision new integer cur get std precision return m precision int value fallback string sql select c std precision from c currency c inner join c order x on x c currency id c c currency id where x c order id int i db getsql value get trxname sql getc order id m precision new integer i return m precision int value getprecision m_precision m_precision intvalue getc_currency_id setorder getparent m_precision m_precision intvalue getc_currency_id mcurrency mcurrency getctx getc_currency_id get_id m_precision getstdprecision m_precision intvalue stdprecision c_currency c_order c_currency_id c_currency_id c_order_id getsqlvalue get_trxname getc_order_id m_precision m_precision intvalue set product param product product public void set product m product product m product product if m product null setm product id m product getm product id setc uom id m product getc uom id else setm product id 0 set valuenocheck c uom id null setm attributesetinstance id 0 setproduct mproduct m_product m_product setm_product_id m_product getm_product_id setc_uom_id m_product getc_uom_id setm_product_id set_valuenocheck c_uom_id setm_attributesetinstance_id set m product id param m product id product public void setm product id int m product id boolean setuom if setuom set product m product get get ctx m product id else super setm product id m product id setm attributesetinstance id 0 m_product_id m_product_id setm_product_id m_product_id setproduct mproduct getctx m_product_id setm_product_id m_product_id setm_attributesetinstance_id set product and uom param m product id product param c uom id uom public void setm product id int m product id int c uom id super setm product id m product id if c uom id 0 super setc uom id c uom id setm attributesetinstance id 0 m_product_id c_uom_id setm_product_id m_product_id c_uom_id setm_product_id m_product_id c_uom_id setc_uom_id c_uom_id setm_attributesetinstance_id get product return product or null public m product get product if m product null getm product id 0 m product m product get get ctx getm product id return m product mproduct getproduct m_product getm_product_id m_product mproduct getctx getm_product_id m_product set m attributesetinstance id param m attributesetinstance id id public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 0 is valid id set value m attributesetinstance id new integer 0 else super setm attributesetinstance id m attributesetinstance id m_attributesetinstance_id m_attributesetinstance_id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_value m_attributesetinstance_id setm_attributesetinstance_id m_attributesetinstance_id set warehouse param m warehouse id warehouse public void setm warehouse id int m warehouse id if getm warehouse id 0 getm warehouse id m warehouse id can change warehouse log severe ignored already delivered invoiced reserved else super setm warehouse id m warehouse id m_warehouse_id setm_warehouse_id m_warehouse_id getm_warehouse_id getm_warehouse_id m_warehouse_id canchangewarehouse setm_warehouse_id m_warehouse_id can change warehouse return true if warehouse can be changed public boolean can change warehouse if get qty delivered signum 0 log save error error msg translate get ctx qty delivered get qty delivered return false if get qty invoiced signum 0 log save error error msg translate get ctx qty invoiced get qty invoiced return false if get qty reserved signum 0 log save error error msg translate get ctx qty reserved get qty reserved return false we can change return true canchangewarehouse getqtydelivered saveerror getctx qtydelivered getqtydelivered getqtyinvoiced saveerror getctx qtyinvoiced getqtyinvoiced getqtyreserved saveerror getctx qtyreserved getqtyreserved get c project id return project public int getc project id int ii super getc project id if ii 0 ii get parent getc project id return ii c_project_id getc_project_id getc_project_id getparent getc_project_id get c activity id return activity public int getc activity id int ii 0 super getc activity id if ii 0 ii get parent getc activity id return ii c_activity_id getc_activity_id getc_activity_id getparent getc_activity_id get c campaign id return campaign public int getc campaign id int ii 0 super getc campaign id if ii 0 ii get parent getc campaign id return ii c_campaign_id getc_campaign_id getc_campaign_id getparent getc_campaign_id get user2 id return user2 public int getuser1 id int ii 0 super getuser1 id if ii 0 ii get parent getuser1 id return ii user2_id getuser1_id getuser1_id getparent getuser1_id get user2 id return user2 public int getuser2 id int ii 0 super getuser2 id if ii 0 ii get parent getuser2 id return ii user2_id getuser2_id getuser2_id getparent getuser2_id string representation return info public string to string string buffer sb new string buffer m order line append get id append line append get line append ordered append get qty ordered append delivered append get qty delivered append invoiced append get qty invoiced append reserved append get qty reserved append return sb to string tostring stringbuffer stringbuffer morderline get_id getline getqtyordered getqtydelivered getqtyinvoiced getqtyreserved tostring add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription get description text for jsp access vs is description return description public string get description text return super get description isdescription getdescriptiontext getdescription get name return get the name of the line from product public string get name get product if m product null return m product get name if getc charge id 0 m charge charge m charge get get ctx getc charge id return charge get name return getname getproduct m_product m_product getname getc_charge_id mcharge mcharge getctx getc_charge_id getname set c charge id param c charge id charge public void setc charge id int c charge id super setc charge id c charge id if c charge id 0 set valuenocheck c uom id null c_charge_id c_charge_id setc_charge_id c_charge_id setc_charge_id c_charge_id c_charge_id set_valuenocheck c_uom_id setc charge id set discount public void set discount big decimal list get price list no list price if env zero compare to list 0 return big decimal discount list subtract get price actual multiply new big decimal 100 divide list get precision big decimal round half up set discount discount setc_charge_id setdiscount bigdecimal getpricelist compareto bigdecimal getpriceactual bigdecimal getprecision bigdecimal round_half_up setdiscount is tax included in amount public boolean is tax included if m m pricelist id 0 m m pricelist id db getsql value get trxname select m pricelist id from c order where c order id getc order id m price list pl m price list get get ctx m m pricelist id get trxname return pl is tax included istaxincluded m_m_pricelist_id m_m_pricelist_id getsqlvalue get_trxname m_pricelist_id c_order c_order_id getc_order_id mpricelist mpricelist getctx m_m_pricelist_id get_trxname istaxincluded set qty entered ordered use this method if the line uom is the product uom param qty qty ordered entered public void set qty big decimal qty super set qty entered qty super set qty ordered qty qtyordered setqty bigdecimal setqtyentered setqtyordered before save param new record return true if it can be sabed protected boolean before save boolean new record get defaults from parent if getc bpartner id 0 getc bpartner location id 0 getm warehouse id 0 getc currency id 0 set order get parent if m m pricelist id 0 set header info get parent r o check product warehouse change if new record is valuechanged m product id is valuechanged m warehouse id if can change warehouse return false product changed charge if getc charge id 0 getm product id 0 setm product id 0 no product if getm product id 0 setm attributesetinstance id 0 product else set check product price set price if actual 0 if m productprice null env zero compare to get price actual 0 env zero compare to get price list 0 set price check if on price list if m productprice null get product pricing m m pricelist id if m productprice is calculated log save error error msg get msg get ctx product not on price list return false uom if getc uom id 0 getm product id 0 get price entered compare to env zero 0 getc charge id 0 int c uom id muom getdefault uom id get ctx if c uom id 0 setc uom id c uom id qty on instance asi for so if m issotrx getm attributesetinstance id 0 new record is valuechanged m product id is valuechanged m attributesetinstance id is valuechanged m warehouse id m product product get product int m attributeset id product getm attributeset id boolean is instance m attributeset id 0 if is instance m attribute set mas m attribute set get get ctx m attributeset id is instance mas is instance attribute max if is instance m storage storages m storage get warehouse get ctx getm warehouse id getm product id getm attributesetinstance id m attributeset id false null true get trxname big decimal qty env zero for int i 0 i storages length i if storages i getm attributesetinstance id getm attributesetinstance id qty qty add storages i get qty on hand if get qty ordered compare to qty 0 log warning qty stock qty ordered get qty ordered log save error qty insufficient qty return false freight amt not used if env zero compare to get freight amt 0 set freight amt env zero set tax if getc tax id 0 set tax get line no if get line 0 string sql select coalesce max line 0 10 from c orderline where c order id int ii db getsql value get trxname sql getc order id set line ii calculations rounding set line net amt extended amount with or without tax set discount return true newrecord beforesave newrecord getc_bpartner_id getc_bpartner_location_id getm_warehouse_id getc_currency_id setorder getparent m_m_pricelist_id setheaderinfo getparent newrecord is_valuechanged m_product_id is_valuechanged m_warehouse_id canchangewarehouse getc_charge_id getm_product_id setm_product_id getm_product_id setm_attributesetinstance_id m_productprice compareto getpriceactual compareto getpricelist setprice m_productprice getproductpricing m_m_pricelist_id m_productprice iscalculated saveerror getmsg getctx productnotonpricelist getc_uom_id getm_product_id getpriceentered compareto getc_charge_id c_uom_id getdefault_uom_id getctx c_uom_id setc_uom_id c_uom_id m_issotrx getm_attributesetinstance_id newrecord is_valuechanged m_product_id is_valuechanged m_attributesetinstance_id is_valuechanged m_warehouse_id mproduct getproduct m_attributeset_id getm_attributeset_id isinstance m_attributeset_id isinstance mattributeset mattributeset getctx m_attributeset_id isinstance isinstanceattribute isinstance mstorage mstorage getwarehouse getctx getm_warehouse_id getm_product_id getm_attributesetinstance_id m_attributeset_id get_trxname bigdecimal getm_attributesetinstance_id getm_attributesetinstance_id getqtyonhand getqtyordered compareto getqtyordered saveerror qtyinsufficient freightamt compareto getfreightamt setfreightamt getc_tax_id settax getline c_orderline c_order_id getsqlvalue get_trxname getc_order_id setline setlinenetamt setdiscount before delete return true if it can be deleted protected boolean before delete r o check something delivered etc if env zero compare to get qty delivered 0 log save error delete error msg translate get ctx qty delivered get qty delivered return false if env zero compare to get qty invoiced 0 log save error delete error msg translate get ctx qty invoiced get qty invoiced return false if env zero compare to get qty reserved 0 for po should be on order log save error delete error msg translate get ctx qty reserved get qty reserved return false return true beforedelete compareto getqtydelivered saveerror deleteerror getctx qtydelivered getqtydelivered compareto getqtyinvoiced saveerror deleteerror getctx qtyinvoiced getqtyinvoiced compareto getqtyreserved saveerror deleteerror getctx qtyreserved getqtyreserved after save param new record new param success success return saved protected boolean after save boolean new record boolean success if success return success if new record is valuechanged c tax id recalculate tax for old tax m order tax tax m order tax get this get precision true get trxname old tax if tax null if tax calculate tax from lines return false if tax save get trxname return false return update header tax newrecord aftersave newrecord newrecord is_valuechanged c_tax_id mordertax mordertax getprecision get_trxname calculatetaxfromlines get_trxname updateheadertax after delete param success success return deleted protected boolean after delete boolean success if success return success if gets resourceassignment id 0 m resource assignment ra new m resource assignment get ctx gets resourceassignment id get trxname ra delete true return update header tax afterdelete gets_resourceassignment_id mresourceassignment mresourceassignment getctx gets_resourceassignment_id get_trxname updateheadertax update tax header private boolean update header tax recalculate tax for this tax m order tax tax m order tax get this get precision false get trxname current tax if tax calculate tax from lines return false if tax save get trxname return false update order header string sql update c order i set total lines select coalesce sum line net amt 0 from c orderline il where i c order id il c order id where c order id getc order id int no db execute update sql get trxname if no 1 log warning 1 no if is tax included sql update c order i set grand total total lines where c order id getc order id else sql update c order i set grand total total lines select coalesce sum tax amt 0 from c ordertax it where i c order id it c order id where c order id getc order id no db execute update sql get trxname if no 1 log warning 2 no m parent null return no 1 updateheadertax mordertax mordertax getprecision get_trxname calculatetaxfromlines get_trxname c_order totallines linenetamt c_orderline c_order_id c_order_id c_order_id getc_order_id executeupdate get_trxname istaxincluded c_order grandtotal totallines c_order_id getc_order_id c_order grandtotal totallines taxamt c_ordertax c_order_id c_order_id c_order_id getc_order_id executeupdate get_trxname m_parent get case sensitive column name param column name case insentitive column name return case sensitive column name public static string get column name string column name if column name null column name length 0 return column name string ret value column name string sql select column name from ad element where upper column name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 column name to upper case result set rs pstmt execute query if rs next ret value rs get string 1 if rs next log warning not unique column name ret value rs get string 1 else log warning no found column name rs close pstmt close pstmt null catch exception e log log level severe column name e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value columnname getcolumnname columnname columnname columnname columnname retvalue columnname columnname ad_element columnname preparedstatement preparestatement setstring columnname touppercase resultset executequery retvalue getstring columnname retvalue getstring columnname columnname retvalue get element param column name case insentitive column name return case sensitive column name public static m element get properties ctx string column name if column name null column name length 0 return null m element ret value null string sql select from ad element where upper column name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 column name to upper case result set rs pstmt execute query if rs next ret value new m element ctx rs null if rs next log warning not unique column name ret value rs get string column name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value columnname m_element columnname columnname columnname m_element retvalue ad_element columnname preparedstatement preparestatement setstring columnname touppercase resultset executequery retvalue m_element columnname retvalue getstring columnname retvalue standard constructor param ctx context param ad element id element public m element properties ctx int ad element id string trx name super ctx ad element id trx name if ad element id 0 set column name null set entity type null u set name null set print name null ad_element_id m_element ad_element_id trxname ad_element_id trxname ad_element_id setcolumnname setentitytype setname setprintname load constructor param ctx context param rs result set public m element properties ctx result set rs string trx name super ctx rs trx name m_element resultset trxname trxname minimum constructor param ctx context param column name column param entity type entity type param trx name trx public m element properties ctx string column name string entity type string trx name super ctx 0 trx name set column name column name set name column name set print name column name set entity type entity type u columnname entitytype trxname m_element columnname entitytype trxname trxname setcolumnname columnname setname columnname setprintname columnname setentitytype entitytype after save param new record new param success success return success protected boolean after save boolean new record boolean success update columns fields parameters print info if new record column string buffer sql new string buffer update ad column set column name append db to string get column name append name append db to string get name append description append db to string get description append help append db to string get help append where ad element id append get id int no db execute update sql to string get trxname log fine after save columns updated no field sql new string buffer update ad field set name append db to string get name append description append db to string get description append help append db to string get help append where ad column id in select ad column id from ad column where ad element id append get id append and is centrally maintained y no db execute update sql to string get trxname log fine after save fields updated no parameter sql new string buffer update ad process para set column name append db to string get column name append name append db to string get name append description append db to string get description append help append db to string get help append ad element id append get id append where upper column name append db to string get column name to upper case append and is centrally maintained y and ad element id is null no db execute update sql to string get trxname sql new string buffer update ad process para set column name append db to string get column name append name append db to string get name append description append db to string get description append help append db to string get help append where ad element id append get id append and is centrally maintained y no db execute update sql to string get trxname log fine after save parameters updated no print info sql new string buffer update ad printformatitem pi set print name append db to string get print name append name append db to string get name append where ad client id 0 append and exists select from ad column c append where c ad column id pi ad column id and c ad element id append get id append no db execute update sql to string get trxname log fine after save print format item updated no return success newrecord aftersave newrecord newrecord stringbuffer stringbuffer ad_column columnname to_string getcolumnname to_string getname to_string getdescription to_string gethelp ad_element_id get_id executeupdate tostring get_trxname aftersave stringbuffer ad_field to_string getname to_string getdescription to_string gethelp ad_column_id ad_column_id ad_column ad_element_id get_id iscentrallymaintained executeupdate tostring get_trxname aftersave stringbuffer ad_process_para columnname to_string getcolumnname to_string getname to_string getdescription to_string gethelp ad_element_id get_id columnname to_string getcolumnname touppercase iscentrallymaintained ad_element_id executeupdate tostring get_trxname stringbuffer ad_process_para columnname to_string getcolumnname to_string getname to_string getdescription to_string gethelp ad_element_id get_id iscentrallymaintained executeupdate tostring get_trxname aftersave stringbuffer ad_printformatitem printname to_string getprintname to_string getname ad_client_id ad_column ad_column_id ad_column_id ad_element_id get_id executeupdate tostring get_trxname aftersave printformatitem compiere server param name server name public compiere server string name super s threadgroup name compiereserver compiereserver s_threadgroup is working return true if working public boolean is working return m working isworking m_working get poll count return number of polls public int get poll count return m pollcount getpollcount m_pollcount get work count return number of work runs public int get work count return m count getworkcount m_count get working time return working time in ms public int get work time return m time getworktime m_time get start of server return start of server public timestamp get start if m start 0 return null return new timestamp m start getstart m_start m_start get last start of server return last start of server public timestamp get last start if m laststart 0 return null return new timestamp m laststart getlaststart m_laststart m_laststart get sleep seconds return sleep seconds public int get sleep seconds return m sleepseconds getsleepseconds m_sleepseconds set sleep seconds param sleep seconds sleep seconds public void set sleep seconds int sleep seconds m sleepseconds sleep seconds sleepseconds setsleepseconds sleepseconds m_sleepseconds sleepseconds set server processor param processor processor public void set processor po processor p processor processor set name get processor name setprocessor p_processor setname getprocessorname statistics return info public string get statistics string buffer sb new string buffer sb append alive append is alive append start append get start append work count append get work count append work time append get work time append poll count append get poll count append working append is working append last append get last start append sleep sec append get sleep seconds return sb to string getstatistics stringbuffer stringbuffer isalive getstart workcount getworkcount worktime getworktime pollcount getpollcount isworking getlaststart sleepsec getsleepseconds tostring string representation return info public string to string string buffer sb new string buffer compiere server sb append get statistics append return sb to string tostring stringbuffer stringbuffer compiereserver getstatistics tostring run do the work see java lang runnable run public final void run if m start 0 m start system current time millis m cancontinue true while m cancontinue if is interrupted return m laststart system current time millis m working true try m pollcount if can do work m cancontinue do work m count catch exception e log log level severe run e m working false long end system current time millis m time end m laststart if is interrupted return try log fine sleeping m sleepseconds sleep m sleepseconds 1000 catch interrupted exception e1 log warning run e1 get localized message return while m_start m_start currenttimemillis m_cancontinue m_cancontinue isinterrupted m_laststart currenttimemillis m_working m_pollcount candowork m_cancontinue dowork m_count m_working currenttimemillis m_time m_laststart isinterrupted m_sleepseconds m_sleepseconds interruptedexception getlocalizedmessage get processor name return processor name is there work for the worker return true if do work should be called dowork worker do the work return true if worker can continue get client param ctx context param ad client id id return client public static m client get properties ctx int ad client id integer key new integer ad client id m client client m client s cache get key if client null return client client new m client ctx ad client id null s cache put key client return client ad_client_id mclient ad_client_id ad_client_id mclient mclient s_cache mclient ad_client_id s_cache get all clients param ctx context return clients public static m client get all properties ctx array list m client list new array list m client string sql select from ad client prepared statement pstmt null try pstmt db prepare statement sql null result set rs pstmt execute query while rs next m client client new m client ctx rs null s cache put new integer client getad client id client list add client rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m client ret value new m client list size list to array ret value return ret value mclient getall arraylist mclient arraylist mclient ad_client preparedstatement preparestatement resultset executequery mclient mclient s_cache getad_client_id s_log mclient retvalue mclient toarray retvalue retvalue get optionally cached client param ctx context return client public static m client get properties ctx return get ctx env getad client id ctx mclient getad_client_id standard constructor param ctx context param ad client id id param create new create new public m client properties ctx int ad client id boolean create new string trx name super ctx ad client id trx name m createnew create new if ad client id 0 if m createnew set value null set name null setad org id 0 set is multi lingual document false set is smtp authorization false set is use beta functions true set is servere mail false setad language language getbasead language set auto archive autoarchive none setmm policy mmpolicy fifo f set is post immediate false set is cost immediate false else load get trxname ad_client_id createnew mclient ad_client_id createnew trxname ad_client_id trxname m_createnew createnew ad_client_id m_createnew setvalue setname setad_org_id setismultilingualdocument setissmtpauthorization setisusebetafunctions setisserveremail setad_language getbasead_language setautoarchive autoarchive_none setmmpolicy mmpolicy_fifo setispostimmediate setiscostimmediate get_trxname standard constructor param ctx context param ad client id id public m client properties ctx int ad client id string trx name this ctx ad client id false trx name ad_client_id mclient ad_client_id trxname ad_client_id trxname load constructor param ctx context param rs result set public m client properties ctx result set rs string trx name super ctx rs trx name mclient resultset trxname trxname simplified constructor param ctx context public m client properties ctx string trx name this ctx env getad client id ctx trx name mclient trxname getad_client_id trxname get smtp host return smtp or loaclhost public string getsmtp host string s super getsmtp host if s null s localhost return s getsmtphost getsmtphost get client info return client info public m client info get info if m info null m info m client info get get ctx getad client id get trxname return m info mclientinfo getinfo m_info m_info mclientinfo getctx getad_client_id get_trxname m_info string representation return info public string to string string buffer sb new string buffer m client append get id append append get value append return sb to string tostring stringbuffer stringbuffer mclient get_id getvalue tostring get default accounting currency return currency or 0 public int getc currency id if m info null get info if m info null return m info getc currency id return 0 getc_currency_id m_info getinfo m_info m_info getc_currency_id get language return client language public language get language if m language null m language language get language getad language env verify language get ctx m language return m language getlanguage m_language m_language getlanguage getad_language verifylanguage getctx m_language m_language set ad language param ad language new language public void setad language string ad language m language null super setad language ad language ad_language ad_language setad_language ad_language m_language setad_language ad_language get ad language return language public string getad language string s super getad language if s null return language getbasead language return s ad_language getad_language getad_language getbasead_language get locale return locale public locale get locale language lang get language if lang null return lang get locale return locale get default getlocale getlanguage getlocale getdefault create trees and setup client info public boolean setup client info string language create trees string sql null if env is base language language ad ref list get tree types name sql select value name from ad ref list where ad reference id 120 and is active y else sql select l value t name from ad ref list l ad ref list trl t where l ad reference id 120 and l ad ref list id t ad ref list id and l is active y tree i ds int ad tree org id 0 ad tree bpartner id 0 ad tree project id 0 ad tree salesregion id 0 ad tree product id 0 ad tree campaign id 0 ad tree activity id 0 boolean success false try prepared statement stmt db prepare statement sql get trxname result set rs stmt execute query mtree base tree null while rs next string value rs get string 1 string name get name rs get string 2 if value equals mtree base treetype organization tree new mtree base this name value success tree save ad tree org id tree getad tree id else if value equals mtree base treetype bpartner tree new mtree base this name value success tree save ad tree bpartner id tree getad tree id else if value equals mtree base treetype project tree new mtree base this name value success tree save ad tree project id tree getad tree id else if value equals mtree base treetype salesregion tree new mtree base this name value success tree save ad tree salesregion id tree getad tree id else if value equals mtree base treetype product tree new mtree base this name value success tree save ad tree product id tree getad tree id else if value equals mtree base treetype elementvalue tree new mtree base this name value success tree save m ad tree account id tree getad tree id else if value equals mtree base treetype campaign tree new mtree base this name value success tree save ad tree campaign id tree getad tree id else if value equals mtree base treetype activity tree new mtree base this name value success tree save ad tree activity id tree getad tree id else if value equals mtree base treetype menu no menu success true else pc product category bb bom tree new mtree base this name value success tree save if success log log level severe tree not created name break rs close stmt close catch sql exception e1 log log level severe trees e1 success false if success return false create client info m client info client info new m client info this ad tree org id ad tree bpartner id ad tree project id ad tree salesregion id ad tree product id ad tree campaign id ad tree activity id get trxname success client info save return success setupclientinfo isbaselanguage ad_ref_list treetypes ad_ref_list ad_reference_id isactive ad_ref_list ad_ref_list_trl ad_reference_id ad_ref_list_id ad_ref_list_id isactive ids ad_tree_org_id ad_tree_bpartner_id ad_tree_project_id ad_tree_salesregion_id ad_tree_product_id ad_tree_campaign_id ad_tree_activity_id preparedstatement preparestatement get_trxname resultset executequery mtree_base getstring getname getstring mtree_base treetype_organization mtree_base ad_tree_org_id getad_tree_id mtree_base treetype_bpartner mtree_base ad_tree_bpartner_id getad_tree_id mtree_base treetype_project mtree_base ad_tree_project_id getad_tree_id mtree_base treetype_salesregion mtree_base ad_tree_salesregion_id getad_tree_id mtree_base treetype_product mtree_base ad_tree_product_id getad_tree_id mtree_base treetype_elementvalue mtree_base m_ad_tree_account_id getad_tree_id mtree_base treetype_campaign mtree_base ad_tree_campaign_id getad_tree_id mtree_base treetype_activity mtree_base ad_tree_activity_id getad_tree_id mtree_base treetype_menu mtree_base sqlexception clientinfo mclientinfo clientinfo mclientinfo ad_tree_org_id ad_tree_bpartner_id ad_tree_project_id ad_tree_salesregion_id ad_tree_product_id ad_tree_campaign_id ad_tree_activity_id get_trxname clientinfo get ad tree account id created in setup client info return account tree id public int getsetup ad tree account id return m ad tree account id ad_tree_account_id getsetup_ad_tree_account_id m_ad_tree_account_id is auto archive on return true if auto archive public boolean is auto archive string aa get auto archive return aa null aa equals autoarchive none isautoarchive getautoarchive autoarchive_none update trl tables automatically param table name table name return true if automatically translated public boolean is auto update trl string table name if super is multi lingual document return false if table name null return false not multi lingual documents only doc related if table name starts with ad return false return true tablename isautoupdatetrl tablename ismultilingualdocument tablename tablename startswith get primary accounting schema return acct schema or null public m acct schema get acct schema if m info null m info m client info get get ctx getad client id get trxname if m info null int c acctschema id m info getc acctschema1 id if c acctschema id 0 return m acct schema get get ctx c acctschema id return null macctschema getacctschema m_info m_info mclientinfo getctx getad_client_id get_trxname m_info c_acctschema_id m_info getc_acctschema1_id c_acctschema_id macctschema getctx c_acctschema_id save return true if saved public boolean save if get id 0 m createnew return save update return super save get_id m_createnew saveupdate test e mail return ok or error public string teste mail if get requeste mail null get requeste mail length 0 return no request e mail for get name e mail email createe mail get requeste mail a dempiere e mail test a dempiere e mail test to string if email null return could not create e mail get name try string msg email send if e mail sent ok equals msg log info sent test e mail to get requeste mail return ok else log warning could not send test e mail from getsmtp host get requeste mail get request user to get requeste mail msg return msg catch exception ex log severe get name ex get localized message return ex get localized message email testemail getrequestemail getrequestemail email getname email createemail getrequestemail adempiere email adempiere email tostring email getname email sent_ok email getrequestemail email getsmtphost getrequestemail getrequestuser getrequestemail getname getlocalizedmessage getlocalizedmessage send e mail from request user with trace param ad user id recipient param subject subject param message message param attachment optional attachment return true if sent public boolean sende mail int ad user id string subject string message file attachment m user to m user get get ctx ad user id string toe mail to gete mail if toe mail null toe mail length 0 log warning no e mail for recipient to return false e mail email createe mail null to subject message if email null return false if attachment null email add attachment attachment try return send email now null to email catch exception ex log severe get name ex get localized message return false email ad_user_id sendemail ad_user_id muser muser getctx ad_user_id toemail getemail toemail toemail email email createemail addattachment sendemailnow getname getlocalizedmessage send e mail from request user no trace param to recipient email address param subject subject param message message param attachment optional attachment return true if sent public boolean sende mail string to string subject string message file attachment e mail email createe mail to subject message if email null return false if attachment null email add attachment attachment try string msg email send if e mail sent ok equals msg log info sent e mail subject to to return true else log warning could not send email subject to to msg get name return false catch exception ex log severe get name ex get localized message return false email sendemail email createemail addattachment email sent_ok email getname getname getlocalizedmessage send e mail from user param from sender param to recipient param subject subject param message message param attachment optional attachment return true if sent public boolean sende mail m user from m user to string subject string message file attachment e mail email createe mail from to subject message if email null return false if attachment null email add attachment attachment internet address email from email get from try return send email now from to email catch exception ex log severe get name from email from to to ex get localized message return false email sendemail muser muser email createemail addattachment internetaddress emailfrom getfrom sendemailnow getname emailfrom getlocalizedmessage send email now param from optional from user param to to user param email email return true if sent private boolean send email now m user from m user to e mail email string msg email send x ad usermail um new x ad usermail get ctx 0 null um set client org this um setad user id to getad user id um set subject email get subject um set mail text email get messagecrlf if email is sentok um set messageid email get messageid else um set messageid email get sent msg um set is delivered x ad usermail isdelivered no um save if email is sentok if from null log info sent email email get subject from from gete mail to to gete mail else log info sent email email get subject to to gete mail return true else if from null log warning could not send email email get subject from from gete mail to to gete mail msg get name else log warning could not send email email get subject to to gete mail msg get name return false sendemailnow muser muser email x_ad_usermail x_ad_usermail getctx setclientorg setad_user_id getad_user_id setsubject getsubject setmailtext getmessagecrlf issentok setmessageid getmessageid setmessageid getsentmsg setisdelivered x_ad_usermail isdelivered_no issentok getsubject getemail getemail getsubject getemail getsubject getemail getemail getname getsubject getemail getname create e mail from request user param to recipient param subject sunject param message nessage return e mail public e mail createe mail string to string subject string message if to null to length 0 log warning no to return null e mail email null if is servere mail ini is client server server c connection get get server try if server null see server bean email server createe mail get ctx getad client id to subject message else log log level warning no apps server catch remote exception ex log log level severe get name apps server error ex if email null email new e mail this get requeste mail to subject message if is smtp authorization email create authenticator get request user get request userpw return email email email email createemail email isserveremail isclient cconnection getserver serverbean createemail getctx getad_client_id appsserver remoteexception getname appsserver email getrequestemail issmtpauthorization createauthenticator getrequestuser getrequestuserpw create e mail from user param from optional sender param to recipient param subject sunject param message nessage return e mail public e mail createe mail m user from m user to string subject string message if to null log warning no to user return null if to gete mail null to gete mail length 0 log warning no to address to return null return createe mail from to gete mail subject message email email email createemail muser muser getemail getemail createemail getemail create e mail from user param from optional sender param to recipient param subject sunject param message nessage return e mail public e mail createe mail m user from string to string subject string message if to null to length 0 log warning no to address return null no from send from request if from null return createe mail to subject message no from details error if from gete mail null from gete mail user null from gete mail userpw null log warning from e mail incomplete from get name return null e mail email null if is servere mail ini is client server server c connection get get server try if server null see server bean email server createe mail get ctx getad client id from getad user id to subject message else log log level warning no apps server catch remote exception ex log log level severe get name apps server error ex if email null email new e mail this from gete mail to subject message if is smtp authorization email create authenticator from gete mail user from gete mail userpw return email email email email createemail muser createemail getemail getemailuser getemailuserpw email getname email isserveremail isclient cconnection getserver serverbean createemail getctx getad_client_id getad_user_id appsserver remoteexception getname appsserver email getemail issmtpauthorization createauthenticator getemailuser getemailuserpw lookup param display type display type param window no window no public lookup int display type int window no m displaytype display type m windowno window no displaytype windowno displaytype windowno m_displaytype displaytype m_windowno windowno get display type return display type public int get display type return m displaytype getdisplaytype m_displaytype get window no return window no public int get window no return m windowno getwindowno m_windowno set the value of the selected item the selected item may be null p param an object the combo box value or null for no selection public void set selected item object an object if m selectedobject null m selectedobject equals an object m selectedobject null an object null if p data contains an object an object null m selectedobject an object log trace s ll lookup set selected item an object else m selectedobject null log fine get column name set selected item set to null if m worker null m worker is alive fire contents changed this 1 1 anobject setselecteditem anobject m_selectedobject m_selectedobject anobject m_selectedobject anobject p_data anobject anobject m_selectedobject anobject s_ll setselecteditem anobject m_selectedobject getcolumnname setselecteditem m_worker m_worker isalive firecontentschanged return previously selected item return value public object get selected item return m selectedobject getselecteditem m_selectedobject get size of model return size public int get size return p data size getsize p_data get element at index param index index return value public object get element at int index return p data get index getelementat p_data returns the index position of the specified object in the list param an object object return an int representing the index position where 0 is the first position public int get index of object an object return p data index of an object anobject getindexof anobject p_data indexof anobject add element at the end param an object object public void add element object an object p data add an object fire interval added this p data size 1 p data size 1 if p data size 1 m selectedobject null an object null set selected item an object anobject addelement anobject p_data anobject fireintervaladded p_data p_data p_data m_selectedobject anobject setselecteditem anobject insert element at param an object object param index index public void insert element at object an object int index p data add index an object fire interval added this index index anobject insertelementat anobject p_data anobject fireintervaladded remove item at index param index index public void remove element at int index if get element at index m selectedobject if index 0 set selected item get size 1 null get element at index 1 else set selected item get element at index 1 p data remove index fire interval removed this index index removeelementat getelementat m_selectedobject setselecteditem getsize getelementat setselecteditem getelementat p_data fireintervalremoved remove item param an object object public void remove element object an object int index p data index of an object if index 1 remove element at index anobject removeelement anobject p_data indexof anobject removeelementat empties the list public void remove all elements if p data size 0 int first index 0 int last index p data size 1 p data clear m selectedobject null fire interval removed this first index last index removeallelements p_data firstindex lastindex p_data p_data m_selectedobject fireintervalremoved firstindex lastindex put value param key key param value value public void put string key string value name pair pp new value name pair key value add element pp namepair valuenamepair addelement put value param key key param value value public void put int key string value name pair pp new key name pair key value add element pp namepair keynamepair addelement fill combo box with lookup data async using worker try to maintain selected item param mandatory has mandatory data only i e no null selection param only validated only validated param only active onlt active param temporary save current values restore via fill combo box true public void fill combo box boolean mandatory boolean only validated boolean only active boolean temporary long start time system current time millis save current data if temporary int size p data size m tempdata new object size we need to do a deep copy so store it in array p data to array m tempdata for int i 0 i size i m tempdata i p data get i object obj m selectedobject p data clear may cause delay the actual work p data get data mandatory only validated only active temporary selected object changed if obj m selectedobject log finest get column name fill combo box selected value changed obj m selectedobject obj m selectedobject if nothing selected mandatory select first if obj null mandatory p data size 0 obj p data get 0 m selectedobject obj log finest get column name fill combo box selected value set to first obj fire contents changed this 1 1 fire contents changed this 0 p data size if p data size 0 log fine get column name fill combo box 0 ms string value of system current time millis start time else log fine get column name fill combo box p data size ms string value of system current time millis start time combobox onlyvalidated onlyactive fillcombobox fillcombobox onlyvalidated onlyactive starttime currenttimemillis p_data m_tempdata p_data toarray m_tempdata m_tempdata p_data m_selectedobject p_data p_data getdata onlyvalidated onlyactive m_selectedobject getcolumnname fillcombobox selectedvalue m_selectedobject m_selectedobject p_data p_data m_selectedobject getcolumnname fillcombobox selectedvalue settofirst firecontentschanged firecontentschanged p_data p_data getcolumnname fillcombobox valueof currenttimemillis starttime getcolumnname fillcombobox p_data valueof currenttimemillis starttime fill combo box with old saved data if exists or all data available param restore if true use saved data else fill it with all data public void fill combo box boolean restore if restore m tempdata null object obj m selectedobject p data clear restore old data p data new array list object m tempdata length for int i 0 i m tempdata length i p data add m tempdata i m tempdata null if nothing selected select first if obj null p data size 0 obj p data get 0 set selected item obj fire contents changed this 0 p data size return if p data null fill combo box false false false false combobox fillcombobox m_tempdata m_selectedobject p_data p_data arraylist m_tempdata m_tempdata p_data m_tempdata m_tempdata p_data p_data setselecteditem firecontentschanged p_data p_data fillcombobox get display of key value param key key return string get object of key value param key key return object or null fill combo box with data value key name pair param mandatory has mandatory data only i e no null selection param only validated only validated param only active only active param temporary force load for temporary display return array list public abstract array list object get data boolean mandatory combobox keynamepair onlyvalidated onlyactive arraylist arraylist getdata get underlying fully qualified table column name used for v lookup action button zoom return column name vlookup actionbutton the lookup contains the key param key key return true if contains key refresh values default implementation return size public int refresh return 0 is validated default implementation return true if validated public boolean is validated return true isvalidated get dynamic validation sql none return validation public string get validation return getvalidation has inactive records default implementation return true if inactive public boolean has inactive return false hasinactive get zoom default implementation return zoom window public int get zoom return 0 getzoom get zoom default implementation param query query return zoom window here 0 public int get zoom m query query return 0 getzoom mquery get zoom query string default implementation return zoom query public m query get zoom query return null mquery getzoomquery get data direct from table default implementation does not requery param key key param save in cache save in cache for r w param cache local cache locally for r o return value public name pair get direct object key boolean save in cache boolean cache local return get key saveincache cachelocal namepair getdirect saveincache cachelocal dispose clear items w o firing events public void dispose if p data null p data clear p data null m selectedobject null m tempdata null p_data p_data p_data m_selectedobject m_tempdata wait until async load complete public void load complete loadcomplete default constructor public v check box this false false true null false vcheckbox standard constructor param column name param mandatory param is read only param is updateable param title param description param table editor public v check box string column name boolean mandatory boolean is read only boolean is updateable string title string description boolean table editor super super set name column name m columnname column name set mandatory mandatory if is read only is updateable set editable false else set editable true normal if table editor set text title if description null description length 0 set tool tip text description else set horizontal alignment j label center this add action listener this columnname isreadonly isupdateable tableeditor vcheckbox columnname isreadonly isupdateable tableeditor setname columnname m_columnname columnname setmandatory isreadonly isupdateable seteditable seteditable tableeditor settext settooltiptext sethorizontalalignment jlabel addactionlistener dispose public void dispose set editable param value public void set editable boolean value super set read write value seteditable setreadwrite is editable return true if editable public boolean is editable return super is read write iseditable iseditable isreadwrite set editor to value param value public void set value object value boolean sel false if value null if value instanceof boolean sel boolean value boolean value else sel y equals value set selected sel setvalue booleanvalue setselected property change listener param evt public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value return new boolean is selected getvalue isselected return display value return value public string get display string value is selected y n return msg translate env get ctx value getdisplay isselected getctx set background nop public void set background setbackground action listener data binding param e public void action performed action event e a debug info v check box action performed try fire vetoable change m columnname null get value catch property veto exception pve actionperformed actionevent adebug vcheckbox actionperformed firevetoablechange m_columnname getvalue propertyvetoexception set field window no for value preference nop param m field public void set field org compiere model m field m field windowno valuepreference mfield setfield mfield mfield return returns the saved mnemonic public char get saved mnemonic return m savedmnemonic savedmnemonic getsavedmnemonic m_savedmnemonic param saved mnemonic the saved mnemonic to set public void set saved mnemonic char saved mnemonic m savedmnemonic saved mnemonic savedmnemonic savedmnemonic setsavedmnemonic savedmnemonic m_savedmnemonic savedmnemonic get contsnts return contents public object get contents return contents getcontents initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception order servlet init servletexception servletconfig servletexception webenv initweb servletexception orderservlet get servlet information return info public string get servlet info return a dempiere web order servlet getservletinfo adempiere clean up resources public void destroy log fine process the http get request logout delete cookie sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr do post request response deletecookie servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr dopost process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session true session remove attribute web session ctx hdr message web user basket web user wu web user session get attribute web user name web basket wb web basket session get attribute web basket name m order order null boolean done false string url payment info jsp not logged in if wu null wu is logged in session set attribute check out y indicate checkout url login jsp done true else order get order request ctx we have an order if done order null if process order request order url orders jsp else web order wo new web order order m payment p create payment session ctx wu wo if p null session set attribute payment servlet attr payment p session set attribute web order name wo else url orders jsp done true nothing in basket if done wb null wb get line count 0 url basket jsp done true create order payment info if done web order wo new web order wu wb ctx we have an order do delete basket checkout indicator if wo is in progress wo is completed session remove attribute check out servlet attr checkout session remove attribute web basket name sende mail request ctx wo wu if the order is negative don t create a payment if wo get grand total compare to env zero 0 session set attribute web order name wo m payment p create payment session ctx wu wo if p null web util create forward page response payment could not be created orders jsp 5 return else session set attribute payment servlet attr payment p else url orders jsp log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession removeattribute websessionctx hdr_message webuser webuser getattribute webuser webbasket webbasket getattribute webbasket morder paymentinfo isloggedin setattribute checkout getorder processorder weborder weborder mpayment createpayment setattribute paymentservlet attr_payment setattribute weborder getlinecount weborder weborder isinprogress iscompleted removeattribute checkoutservlet attr_checkout removeattribute webbasket sendemail getgrandtotal compareto setattribute weborder mpayment createpayment webutil createforwardpage setattribute paymentservlet attr_payment requestdispatcher getservletcontext getrequestdispatcher create payment but don t save it param session session param ctx context param wu web user param wo order return payment private m payment create payment http session session properties ctx web user wu web order wo see payment servlet do get m payment p new m payment ctx 0 null p setad org id wo getad org id p set is self service true p set amount wo getc currency id wo get grand total for cc selection p set is online true sales cc trx p setc doctype id true p set trx type m payment trxtype sales p set tender type m payment tendertype creditcard order info p setc order id wo getc order id bp info p setbp bankaccount wu get bank account return p mpayment createpayment httpsession webuser weborder paymentservlet doget mpayment mpayment setad_org_id getad_org_id setisselfservice setamount getc_currency_id getgrandtotal setisonline setc_doctype_id settrxtype mpayment trxtype_sales settendertype mpayment tendertype_creditcard setc_order_id getc_order_id setbp_bankaccount getbankaccount get order param request request param ctx context return true if processed private m order get order http servlet request request properties ctx order string para web util get parameter request c order id if para null para length 0 return null int c order id 0 try c order id integer parse int para catch number format exception ex if c order id 0 return null log fine c order id c order id return new m order ctx c order id null morder getorder httpservletrequest webutil getparameter c_order_id c_order_id c_order_id parseint numberformatexception c_order_id c_order_id c_order_id morder c_order_id process order param request request param order order return true if processed ok private boolean process order http servlet request request m order order doc action string doc action web util get parameter request doc action if doc action null doc action length 0 return false m doc type dt m doc type get order get ctx order getc doctype id if order isso trx order get grand total compare to env zero 0 m doc type docbasetype salesorder equals dt get doc base type log warning not a valid sales order order return true we have a order no doc action log fine doc action doc action if m order docaction void equals doc action do not complete prepayment if m order status waitingpayment equals order get doc status return false if m doc type docsubtypeso prepayorder equals dt get doc sub typeso return false if m order docaction complete equals doc action log warning invalid doc action doc action return true order set doc action doc action true force creation boolean ok order process it doc action order save return ok processorder httpservletrequest morder docaction webutil getparameter docaction docaction docaction mdoctype mdoctype getctx getc_doctype_id issotrx getgrandtotal compareto mdoctype docbasetype_salesorder getdocbasetype docaction docaction docaction morder docaction_void docaction morder status_waitingpayment getdocstatus mdoctype docsubtypeso_prepayorder getdocsubtypeso morder docaction_complete docaction docaction docaction setdocaction docaction processit docaction send order e mail param request request param ctx context param wo web order param wu web user private void sende mail http servlet request request properties ctx web order wo web user wu string buffer message new string buffer n m order mo wo get order if mo null m order line ol mo get lines true null for int i 0 i ol length i message append n append ol i get qty ordered append append ol i get name if ol i get description null message append append ol i get description message append append ol i get price actual append append ol i get line net amt line order message append n n append msg get element ctx c order id append append wo get document no append append msg get element ctx grand total append append wo get grand total jsp env sende mail request wu m mail msg mailmsgtype orderacknowledgement new object wo get document no wu get name message to string email sendemail httpservletrequest weborder webuser stringbuffer stringbuffer morder getorder morderline getlines getqtyordered getname getdescription getdescription getpriceactual getlinenetamt getelement c_order_id getdocumentno getelement grandtotal getgrandtotal jspenv sendemail mmailmsg mailmsgtype_orderacknowledgement getdocumentno getname tostring prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id big decimal para i get parameter int value else if name equals ad org id p ad org id big decimal para i get parameter int value else if name equals c conversiontype id p c conversiontype id big decimal para i get parameter int value else if name equals valid from p validfrom timestamp para i get parameter else if name equals create reciprocal rate p createreciprocalrate y equals para i get parameter else if name equals delete old imported p deleteoldimported y equals para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id bigdecimal getparameter intvalue ad_org_id p_ad_org_id bigdecimal getparameter intvalue c_conversiontype_id p_c_conversiontype_id bigdecimal getparameter intvalue validfrom p_validfrom getparameter createreciprocalrate p_createreciprocalrate getparameter deleteoldimported p_deleteoldimported getparameter perrform process return message throws exception protected string do it throws exception log info do it ad client id p ad client id ad org id p ad org id c conversiontype id p c conversiontype id valid from p validfrom create reciprocal rate p createreciprocalrate string buffer sql null int no 0 string client check and ad client id p ad client id prepare delete old imported if p deleteoldimported sql new string buffer delete i conversion rate where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org location is active created updated sql new string buffer update i conversion rate set ad client id coalesce ad client id append p ad client id append ad org id coalesce ad org id append p ad org id append if p c conversiontype id 0 sql append c conversiontype id coalesce c conversiontype id append p c conversiontype id append if p validfrom null sql append valid from coalesce valid from append db to date p validfrom append else sql append valid from coalesce valid from sys date sql append create reciprocal rate coalesce create reciprocal rate append p createreciprocalrate y n append is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by append getad user id append i errormsg null processed n i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no org sql new string buffer update i conversion rate o set i isimported e i errormsg i errormsg err invalid org where ad org id is null or exists select from ad org oo where o ad org id oo ad org id and oo is summary y or oo is active n and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid org no conversion type sql new string buffer update i conversion rate i set c conversiontype id select c conversiontype id from c conversiontype c where c value i conversion type value and c ad client id in 0 i ad client id and c is active y where c conversiontype id is null and conversion type value is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log fine set conversion type no sql new string buffer update i conversion rate i set i isimported e i errormsg i errormsg err invalid conversion type where c conversiontype id is null or not exists select from c conversiontype c where i c conversiontype id c c conversiontype id and c is active y and c ad client id in 0 i ad client id and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid conversion type no currency sql new string buffer update i conversion rate i set c currency id select c currency id from c currency c where c iso code i iso code and c ad client id in 0 i ad client id and c is active y where c currency id is null and iso code is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log fine set currency no sql new string buffer update i conversion rate i set i isimported e i errormsg i errormsg err invalid currency where c currency id is null or not exists select from c currency c where i c currency id c c currency id and c is active y and c ad client id in 0 i ad client id and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid currency no currency to sql new string buffer update i conversion rate i set c currency id to select c currency id from c currency c where c iso code i iso code to and c ad client id in 0 i ad client id and c is active y where c currency id to is null and iso code to is not null and i isimported y append client check no db execute update sql to string get trxname if no 0 log fine set currency to no sql new string buffer update i conversion rate i set i isimported e i errormsg i errormsg err invalid currency to where c currency id to is null or not exists select from c currency c where i c currency id to c c currency id and c is active y and c ad client id in 0 i ad client id and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid currency to no rates sql new string buffer update i conversion rate i set multiply rate 1 divide rate where multiply rate is null or multiply rate 0 and divide rate is not null and divide rate 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log fine set multiply rate no sql new string buffer update i conversion rate i set divide rate 1 multiply rate where divide rate is null or divide rate 0 and multiply rate is not null and multiply rate 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log fine set divide rate no sql new string buffer update i conversion rate i set i isimported e i errormsg i errormsg err invalid rates where multiply rate is null or multiply rate 0 or divide rate is null or divide rate 0 and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid rates no sql new string buffer update i conversion rate i rate diff 10 set i isimported e i errormsg i errormsg err inconsistent rates multiply rate 1 divide rate where multiply rate 1 divide rate multiply rate 1 and i isimported y append client check no db execute update sql to string get trxname if no 0 log warn inconsistent rates no commit int no insert 0 sql new string buffer select from i conversion rate where i isimported n append client check append order by c currency id c currency id to valid from prepared statement pstmt null try pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next x i conversion rate imp new x i conversion rate get ctx rs get trxname m conversion rate rate new m conversion rate imp imp getc conversiontype id imp getc currency id imp getc currency id to imp get multiply rate imp get valid from if imp get valid to null rate set valid to imp get valid to if rate save imp setc conversion rate id rate getc conversion rate id imp seti isimported true imp set processed true imp save no insert if imp is create reciprocal rate rate new m conversion rate imp imp getc conversiontype id imp getc currency id to imp getc currency id imp get divide rate imp get valid from if imp get valid to null rate set valid to imp get valid to if rate save no insert rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null set error to indicator to not imported sql new string buffer update i conversion rate set i isimported n updated sys date where i isimported y append client check no db execute update sql to string get trxname add log 0 null new big decimal no errors add log 0 null new big decimal no insert c conversion rate id inserted return doit doit ad_client_id p_ad_client_id ad_org_id p_ad_org_id c_conversiontype_id p_c_conversiontype_id validfrom p_validfrom createreciprocalrate p_createreciprocalrate stringbuffer clientcheck ad_client_id p_ad_client_id p_deleteoldimported stringbuffer i_conversion_rate i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_conversion_rate ad_client_id ad_client_id p_ad_client_id ad_org_id ad_org_id p_ad_org_id p_c_conversiontype_id c_conversiontype_id c_conversiontype_id p_c_conversiontype_id p_validfrom validfrom validfrom to_date p_validfrom validfrom validfrom sysdate createreciprocalrate createreciprocalrate p_createreciprocalrate isactive isactive sysdate createdby createdby sysdate updatedby getad_user_id i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg ad_org_id ad_org ad_org_id ad_org_id issummary isactive i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate c_conversiontype_id c_conversiontype_id c_conversiontype conversiontypevalue ad_client_id ad_client_id isactive c_conversiontype_id conversiontypevalue i_isimported clientcheck executeupdate tostring get_trxname conversiontype stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg conversiontype c_conversiontype_id c_conversiontype c_conversiontype_id c_conversiontype_id isactive ad_client_id ad_client_id i_isimported clientcheck executeupdate tostring get_trxname conversiontype stringbuffer i_conversion_rate c_currency_id c_currency_id c_currency iso_code iso_code ad_client_id ad_client_id isactive c_currency_id iso_code i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg c_currency_id c_currency c_currency_id c_currency_id isactive ad_client_id ad_client_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate c_currency_id_to c_currency_id c_currency iso_code iso_code_to ad_client_id ad_client_id isactive c_currency_id_to iso_code_to i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg c_currency_id_to c_currency c_currency_id_to c_currency_id isactive ad_client_id ad_client_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate multiplyrate dividerate multiplyrate multiplyrate dividerate dividerate i_isimported clientcheck executeupdate tostring get_trxname multiplyrate stringbuffer i_conversion_rate dividerate multiplyrate dividerate dividerate multiplyrate multiplyrate i_isimported clientcheck executeupdate tostring get_trxname dividerate stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg multiplyrate multiplyrate dividerate dividerate i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_conversion_rate i_isimported i_errormsg i_errormsg multiplyrate dividerate multiplyrate dividerate multiplyrate i_isimported clientcheck executeupdate tostring get_trxname noinsert stringbuffer i_conversion_rate i_isimported clientcheck c_currency_id c_currency_id_to validfrom preparedstatement preparestatement tostring get_trxname resultset executequery x_i_conversion_rate x_i_conversion_rate getctx get_trxname mconversionrate mconversionrate getc_conversiontype_id getc_currency_id getc_currency_id_to getmultiplyrate getvalidfrom getvalidto setvalidto getvalidto setc_conversion_rate_id getc_conversion_rate_id seti_isimported setprocessed noinsert iscreatereciprocalrate mconversionrate getc_conversiontype_id getc_currency_id_to getc_currency_id getdividerate getvalidfrom getvalidto setvalidto getvalidto noinsert tostring stringbuffer i_conversion_rate i_isimported sysdate i_isimported clientcheck executeupdate tostring get_trxname addlog bigdecimal addlog bigdecimal noinsert c_conversion_rate_id get version date ejb interface method view type both return version e g 2002 09 02 public string get date version m versioncount log info get date version m versioncount return compiere date version getdateversion m_versioncount getdateversion m_versioncount date_version get main version ejb interface method view type both return main version e g version 2 4 3b public string get main version return compiere main version getmainversion main_version get database type ejb interface method view type both return database type public string get db type return c connection get get type getdbtype cconnection gettype get database host ejb interface method view type both return database host name public string get db host m databasecount log info get db host m databasecount return c connection get get db host getdbhost m_databasecount getdbhost m_databasecount cconnection getdbhost get database port ejb interface method view type both return database port public int get db port return c connection get get db port getdbport cconnection getdbport get database sid ejb interface method view type both return database sid public string get db name return c connection get get db name getdbname cconnection getdbname get database url ejb interface method view type both return database url public string get connectionurl return c connection get get connectionurl getconnectionurl cconnection getconnectionurl get database uid ejb interface method view type both return database user name public string get db uid return c connection get get db uid getdbuid cconnection getdbuid get database pwd ejb interface method view type both return database user password public string get db pwd return c connection get get db pwd getdbpwd cconnection getdbpwd get connection manager host ejb interface method view type both return connection manager host public string get fw host return c connection get get fw host getfwhost cconnection getfwhost get connection manager port ejb interface method view type both return connection manager port public int get fw port return c connection get get fw port getfwport cconnection getfwport get version count ejb interface method view type both return number of version inquiries public int get version count return m versioncount getversioncount m_versioncount get database count ejb interface method view type both return number of database inquiries public int get database count return m databasecount getdatabasecount m_databasecount describes the instance and its content for debugging purpose ejb interface method view type both return debugging information about the instance and its content public string get status string buffer sb new string buffer status bean no sb append m no append version count append m versioncount append database count append m versioncount append return sb to string getstatus stringbuffer stringbuffer statusbean m_no versioncount m_versioncount databasecount m_versioncount tostring string representation return info public string to string return get status tostring getstatus create the session bean throws ejb exception create exception ejb create method view type both public void ejb create throws ejb exception create exception m no s no try org compiere compiere startup false catch exception ex log log level severe ex throw new create exception log info m no get status ejbexception createexception ejbcreate ejbexception createexception m_no s_no createexception m_no getstatus public void set session context session context a context throws ejb exception m context a context setsessioncontext sessioncontext acontext ejbexception m_context acontext public void ejb activate throws ejb exception if log null log c logger getc logger get class log fine ejb activate ejbactivate ejbexception clogger getclogger getclass ejbactivate public void ejb passivate throws ejb exception log fine ejb passivate ejbpassivate ejbexception ejbpassivate public void ejb remove throws ejb exception log fine ejb remove ejbremove ejbexception ejbremove standard constructor public x ad window properties ctx int ad window id string trx name super ctx ad window id trx name if ad window id 0 setad window id 0 set entity type null u set is beta functionality false set is default false set isso trx true y set name null set window type null m x_ad_window ad_window_id trxname ad_window_id trxname ad_window_id setad_window_id setentitytype setisbetafunctionality setisdefault setissotrx setname setwindowtype load constructor public x ad window properties ctx result set rs string trx name super ctx rs trx name x_ad_window resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad window append get id append return sb to string tostring stringbuffer stringbuffer x_ad_window get_id tostring set system color color for backgrounds or indicators public void setad color id int ad color id if ad color id 0 set value ad color id null else set value ad color id new integer ad color id setad_color_id ad_color_id ad_color_id set_value ad_color_id set_value ad_color_id ad_color_id get system color color for backgrounds or indicators public int getad color id integer ii integer get value ad color id if ii null return 0 return ii int value getad_color_id get_value ad_color_id intvalue set image system image or icon public void setad image id int ad image id if ad image id 0 set value ad image id null else set value ad image id new integer ad image id setad_image_id ad_image_id ad_image_id set_value ad_image_id set_value ad_image_id ad_image_id get image system image or icon public int getad image id integer ii integer get value ad image id if ii null return 0 return ii int value getad_image_id get_value ad_image_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 1 throw new illegal argument exception ad window id is mandatory set valuenocheck ad window id new integer ad window id setad_window_id ad_window_id ad_window_id illegalargumentexception ad_window_id set_valuenocheck ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set beta functionality this functionality is considered beta public void set is beta functionality boolean is beta functionality set value is beta functionality new boolean is beta functionality setisbetafunctionality isbetafunctionality set_value isbetafunctionality isbetafunctionality get beta functionality this functionality is considered beta public boolean is beta functionality object oo get value is beta functionality if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbetafunctionality get_value isbetafunctionality booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set window height public void set win height int win height set value win height new integer win height setwinheight winheight set_value winheight winheight get window height public int get win height integer ii integer get value win height if ii null return 0 return ii int value getwinheight get_value winheight intvalue set window width public void set win width int win width set value win width new integer win width setwinwidth winwidth set_value winwidth winwidth get window width public int get win width integer ii integer get value win width if ii null return 0 return ii int value getwinwidth get_value winwidth intvalue public static final string windowtype transaction t set window type type or classification of a window public void set window type string window type if window type null throw new illegal argument exception window type is mandatory if window type equals m window type equals q window type equals s window type equals t else throw new illegal argument exception window type invalid value window type reference id 108 m q s t if window type length 1 log warning length 1 truncated window type window type substring 0 0 set value window type window type windowtype_transaction windowtype setwindowtype windowtype windowtype illegalargumentexception windowtype windowtype windowtype windowtype windowtype illegalargumentexception windowtype windowtype reference_id windowtype windowtype windowtype set_value windowtype windowtype get window type type or classification of a window public string get window type return string get value window type windowtype getwindowtype get_value windowtype get splash screen return splash screen public static splash get splash string msg if locale get default get language equals es espa ol msg new string cargando else default english msg new string loading return get splash msg getsplash getdefault getlanguage getsplash get splash screen param text splash text return splash screen public static splash get splash string text if s splash null s splash new splash text else s splash set text text return s splash getsplash s_splash s_splash s_splash settext s_splash standard constructor param text clear text public splash string text super a dempiere message set text text try jb init catch exception e system out println splash e print stack trace display adempiere settext jbinit printstacktrace static init throws exception private void jb init throws exception this set background color white this set name splash this set undecorated true product label set alignment label center message set font new java awt font serif 3 20 italic bold 20 pt message set foreground system color active caption message set alignment label center content panel set layout content layout content panel set name splash content content panel set background color white product label set font new java awt font serif 2 10 product label set foreground color blue product label set text compiere get subtitle product label set tool tip text compiere geturl content panel add c image new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 10 5 0 10 0 0 content panel add product label new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 5 0 10 0 0 content panel add message new grid bag constraints 1 2 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 10 10 0 0 this add a image border layout west this add content panel border layout east jbinit setbackground setname setundecorated productlabel setalignment setfont setforeground systemcolor activecaption setalignment contentpanel setlayout contentlayout contentpanel setname splashcontent contentpanel setbackground productlabel setfont productlabel setforeground productlabel settext getsubtitle productlabel settooltiptext contentpanel cimage gridbagconstraints gridbagconstraints gridbagconstraints contentpanel productlabel gridbagconstraints gridbagconstraints gridbagconstraints contentpanel gridbagconstraints gridbagconstraints gridbagconstraints aimage borderlayout contentpanel borderlayout set text 20 pt param text translated text to display public void set text string text message set text text display settext settext show window public void set visible boolean visible super set visible visible if visible to front setvisible setvisible tofront calculate size and display private void display pack dimension ss toolkit get default toolkit get screen size rectangle bounds get bounds set bounds ss width bounds width 2 ss height bounds height 2 bounds width bounds height set visible true getdefaulttoolkit getscreensize getbounds setbounds setvisible dispose splash public void dispose super dispose s splash null s_splash compiere image public c image m image compiere get image logo tracker add image m image 0 cimage m_image getimagelogo addimage m_image calculate size return size public dimension get preferred size try tracker wait forid 0 catch exception e system err println splash c image e print stack trace m dim new dimension m image get width this m image get height this return m dim getpreferredsize waitforid cimage printstacktrace m_dim m_image getwidth m_image getheight m_dim paint param g graphics public void paint graphics g if tracker checkid 0 g draw image m image 0 0 this drawimage m_image animation image public a image super url url org compiere compiere class get resource images java anim gif if url null url org compiere compiere class get resource images java logo gif if url null m image toolkit get default toolkit get image url tracker add image m image 1 aimage getresource java_anim getresource java_logo m_image getdefaulttoolkit getimage addimage m_image calculate size return size public dimension get preferred size try tracker wait forid 1 catch exception e system err println splash a image e print stack trace m dim new dimension m image get width this 15 m image get height this 15 return m dim getpreferredsize waitforid aimage printstacktrace m_dim m_image getwidth m_image getheight m_dim paint param g graphics public void paint graphics g if tracker checkid 1 g draw image m image 10 10 this drawimage m_image update param g graphics public void update graphics g paint g get mime type of file name param file name file name return mime type public static string get mime type string file name if file name null file name index of 0 return binary string extension file name substring file name last index of for int i 0 i types length i string type types i if type 0 equals extension return type 1 return application octet stream filename getmimetype filename filename filename indexof filename filename lastindexof get mime type of file name param file name file name return mime type public static mime type get string file name if file name null file name index of 0 return new mime type file name binary string extension file name substring file name last index of for int i 0 i types length i string type types i if type 0 equals extension return new mime type file name type 1 return new mime type extension binary filename mimetype filename filename filename indexof mimetype filename filename filename lastindexof mimetype filename mimetype mime type param extension extension with dot param mime type mime type public mime type string extension string mime type set extension extension set mime type mime type mimetype mimetype mimetype mimetype setextension setmimetype mimetype return returns the extension public string get extension return m extension getextension m_extension param extension the extension to set public void set extension string extension m extension extension setextension m_extension return returns the mime type content type public string get mime type return m mimetype getmimetype m_mimetype param mime type the mime type to set public void set mime type string mime type m mimetype mime type mimetype mimetype setmimetype mimetype m_mimetype mimetype string representation return info public string to string return m mimetype m extension tostring m_mimetype m_extension public class charcoal theme extends default metal theme public string get name return charcoal charcoaltheme defaultmetaltheme getname private final colorui resource white new colorui resource 0 0 0 protected colorui resource get primary1 return primary1 coloruiresource coloruiresource coloruiresource getprimary1 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 coloruiresource getprimary1 coloruiresource getprimary2 protected colorui resource get primary1 return primary1 protected colorui resource get primary2 return primary2 protected colorui resource get primary3 return primary3 coloruiresource getprimary1 coloruiresource getprimary2 coloruiresource getprimary3 protected colorui resource get primary3 return primary3 protected colorui resource get secondary1 return secondary1 coloruiresource getprimary3 coloruiresource getsecondary1 protected colorui resource get secondary1 return secondary1 protected colorui resource get secondary2 return secondary2 coloruiresource getsecondary1 coloruiresource getsecondary2 protected colorui resource get secondary1 return secondary1 protected colorui resource get secondary2 return secondary2 protected colorui resource get secondary3 return secondary3 coloruiresource getsecondary1 coloruiresource getsecondary2 coloruiresource getsecondary3 protected colorui resource get secondary3 return secondary3 protected colorui resource get black return black coloruiresource getsecondary3 coloruiresource getblack protected colorui resource get black return black protected colorui resource get white return white coloruiresource getblack coloruiresource getwhite prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name m c projectline id getrecord id processinfoparameter getparameter getparametername getparameter m_c_projectline_id getrecord_id perform process return message clear text throws exception if not successful protected string do it throws exception if m c projectline id 0 throw new illegal argument exception no project line m project line project line new m project line get ctx m c projectline id get trxname log info do it project line if project line getm product id 0 throw new illegal argument exception no product m project project new m project get ctx project line getc project id get trxname if project getm pricelist id 0 throw new illegal argument exception no price list boolean isso trx true m product pricing pp new m product pricing project line getm product id project getc bpartner id project line get planned qty isso trx pp setm pricelist id project getm pricelist id pp set price date project get date contract project line set planned price pp get price std project line set planned margin amt pp get price std subtract pp get price limit project line save string ret value msg get element get ctx price list pp get price list msg get element get ctx price std pp get price std msg get element get ctx price limit pp get price limit return ret value doit m_c_projectline_id illegalargumentexception mprojectline projectline mprojectline getctx m_c_projectline_id get_trxname doit projectline projectline getm_product_id illegalargumentexception mproject mproject getctx projectline getc_project_id get_trxname getm_pricelist_id illegalargumentexception pricelist issotrx mproductpricing mproductpricing projectline getm_product_id getc_bpartner_id projectline getplannedqty issotrx setm_pricelist_id getm_pricelist_id setpricedate getdatecontract projectline setplannedprice getpricestd projectline setplannedmarginamt getpricestd getpricelimit projectline retvalue getelement getctx pricelist getpricelist getelement getctx pricestd getpricestd getelement getctx pricelimit getpricelimit retvalue standard constructor public x c subscription delivery properties ctx int c subscription delivery id string trx name super ctx c subscription delivery id trx name if c subscription delivery id 0 setc subscription delivery id 0 setc subscription id 0 x_c_subscription_delivery c_subscription_delivery_id trxname c_subscription_delivery_id trxname c_subscription_delivery_id setc_subscription_delivery_id setc_subscription_id load constructor public x c subscription delivery properties ctx result set rs string trx name super ctx rs trx name x_c_subscription_delivery resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c subscription delivery append get id append return sb to string tostring stringbuffer stringbuffer x_c_subscription_delivery get_id tostring set subscription delivery optional delivery record for a subscription public void setc subscription delivery id int c subscription delivery id if c subscription delivery id 1 throw new illegal argument exception c subscription delivery id is mandatory set valuenocheck c subscription delivery id new integer c subscription delivery id setc_subscription_delivery_id c_subscription_delivery_id c_subscription_delivery_id illegalargumentexception c_subscription_delivery_id set_valuenocheck c_subscription_delivery_id c_subscription_delivery_id get subscription delivery optional delivery record for a subscription public int getc subscription delivery id integer ii integer get value c subscription delivery id if ii null return 0 return ii int value getc_subscription_delivery_id get_value c_subscription_delivery_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc subscription delivery id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_subscription_delivery_id set subscription subscription of a business partner of a product to renew public void setc subscription id int c subscription id if c subscription id 1 throw new illegal argument exception c subscription id is mandatory set valuenocheck c subscription id new integer c subscription id setc_subscription_id c_subscription_id c_subscription_id illegalargumentexception c_subscription_id set_valuenocheck c_subscription_id c_subscription_id get subscription subscription of a business partner of a product to renew public int getc subscription id integer ii integer get value c subscription id if ii null return 0 return ii int value getc_subscription_id get_value c_subscription_id intvalue standard constructor public x ad changelog properties ctx int ad changelog id string trx name super ctx ad changelog id trx name if ad changelog id 0 setad changelog id 0 setad column id 0 setad session id 0 setad table id 0 set is customization false setrecord id 0 x_ad_changelog ad_changelog_id trxname ad_changelog_id trxname ad_changelog_id setad_changelog_id setad_column_id setad_session_id setad_table_id setiscustomization setrecord_id load constructor public x ad changelog properties ctx result set rs string trx name super ctx rs trx name x_ad_changelog resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad changelog append get id append return sb to string tostring stringbuffer stringbuffer x_ad_changelog get_id tostring set change log log of data changes public void setad changelog id int ad changelog id if ad changelog id 1 throw new illegal argument exception ad changelog id is mandatory set valuenocheck ad changelog id new integer ad changelog id setad_changelog_id ad_changelog_id ad_changelog_id illegalargumentexception ad_changelog_id set_valuenocheck ad_changelog_id ad_changelog_id get change log log of data changes public int getad changelog id integer ii integer get value ad changelog id if ii null return 0 return ii int value getad_changelog_id get_value ad_changelog_id intvalue set column column in the table public void setad column id int ad column id if ad column id 1 throw new illegal argument exception ad column id is mandatory set valuenocheck ad column id new integer ad column id setad_column_id ad_column_id ad_column_id illegalargumentexception ad_column_id set_valuenocheck ad_column_id ad_column_id get column column in the table public int getad column id integer ii integer get value ad column id if ii null return 0 return ii int value getad_column_id get_value ad_column_id intvalue set session user session online or web public void setad session id int ad session id if ad session id 1 throw new illegal argument exception ad session id is mandatory set valuenocheck ad session id new integer ad session id setad_session_id ad_session_id ad_session_id illegalargumentexception ad_session_id set_valuenocheck ad_session_id ad_session_id get session user session online or web public int getad session id integer ii integer get value ad session id if ii null return 0 return ii int value getad_session_id get_value ad_session_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad session id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_session_id set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set customization the change is a customization of the data dictionary and can be applied after migration public void set is customization boolean is customization set value is customization new boolean is customization setiscustomization iscustomization set_value iscustomization iscustomization get customization the change is a customization of the data dictionary and can be applied after migration public boolean is customization object oo get value is customization if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscustomization get_value iscustomization booleanvalue set new value new field value public void set new value string new value if new value null new value length 2000 log warning length 2000 truncated new value new value substring 0 1999 set valuenocheck new value new value setnewvalue newvalue newvalue newvalue newvalue newvalue set_valuenocheck newvalue newvalue get new value new field value public string get new value return string get value new value getnewvalue get_value newvalue set old value the old file data public void set old value string old value if old value null old value length 2000 log warning length 2000 truncated old value old value substring 0 1999 set valuenocheck old value old value setoldvalue oldvalue oldvalue oldvalue oldvalue oldvalue set_valuenocheck oldvalue oldvalue get old value the old file data public string get old value return string get value old value getoldvalue get_value oldvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set redo public void set redo string redo if redo null redo length 1 log warning length 1 truncated redo redo substring 0 0 set value redo redo setredo set_value get redo public string get redo return string get value redo getredo get_value set transaction name of the transaction public void set trx name string trx name if trx name null trx name length 60 log warning length 60 truncated trx name trx name substring 0 59 set valuenocheck trx name trx name settrxname trxname trxname trxname trxname trxname set_valuenocheck trxname trxname get transaction name of the transaction public string get trx name return string get value trx name gettrxname get_value trxname set undo public void set undo string undo if undo null undo length 1 log warning length 1 truncated undo undo substring 0 0 set value undo undo setundo set_value get undo public string get undo return string get value undo getundo get_value get compiere server group return server group public static compiere server group get if s group null s group is destroyed s group new compiere server group return s group compiereservergroup s_group s_group isdestroyed s_group compiereservergroup s_group compiere server group private compiere server group super compiere servers set daemon true set max priority thread max priority log info get name parent get parent compiereservergroup compiereservergroup compiereservers setdaemon setmaxpriority max_priority getname getparent uncaught exception param t thread param e exception public void uncaught exception thread t throwable e log info uncaught exception e to string super uncaught exception t e uncaughtexception uncaughtexception tostring uncaughtexception string representation return name public string to string return get name tostring getname dump info public void dump log fine get name is destroyed destroyed log fine parent get parent thread list new thread active count log fine count enumerate list true for int i 0 i list length i log fine list i getname isdestroyed getparent activecount prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals selection p selection y equals para i get parameter else if name equals date invoiced p dateinvoiced timestamp para i get parameter else if name equals ad org id p ad org id para i get parameter as int else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c order id p c order id para i get parameter as int else if name equals consolidate document p consolidatedocument y equals para i get parameter else if name equals doc action p docaction string para i get parameter else log log level severe unknown parameter name login date if p dateinvoiced null p dateinvoiced env get context as date get ctx date if p dateinvoiced null p dateinvoiced new timestamp system current time millis doc action check if doc action action complete equals p docaction p docaction doc action action prepare processinfoparameter getparameter getparametername getparameter p_selection getparameter dateinvoiced p_dateinvoiced getparameter ad_org_id p_ad_org_id getparameterasint c_bpartner_id p_c_bpartner_id getparameterasint c_order_id p_c_order_id getparameterasint consolidatedocument p_consolidatedocument getparameter docaction p_docaction getparameter p_dateinvoiced p_dateinvoiced getcontextasdate getctx p_dateinvoiced p_dateinvoiced currenttimemillis docaction docaction action_complete p_docaction p_docaction docaction action_prepare generate invoices return info throws exception protected string do it throws exception log info selection p selection date invoiced p dateinvoiced ad org id p ad org id c bpartner id p c bpartner id c order id p c order id doc action p docaction consolidate p consolidatedocument string sql null if p selection v invoice gen sql select from c order where is selected y and doc status co and isso trx y order by m warehouse id priority rule c bpartner id c order id else sql select from c order o where doc status in co cl and isso trx y if p ad org id 0 sql and ad org id if p c bpartner id 0 sql and c bpartner id if p c order id 0 sql and c order id sql and exists select from c orderline ol where o c order id ol c order id and ol qty ordered ol qty invoiced order by m warehouse id priority rule c bpartner id c order id sql for update prepared statement pstmt null try pstmt db prepare statement sql get trxname int index 1 if p selection p ad org id 0 pstmt set int index p ad org id if p selection p c bpartner id 0 pstmt set int index p c bpartner id if p selection p c order id 0 pstmt set int index p c order id catch exception e log log level severe sql e return generate pstmt doit p_selection dateinvoiced p_dateinvoiced ad_org_id p_ad_org_id c_bpartner_id p_c_bpartner_id c_order_id p_c_order_id docaction p_docaction p_consolidatedocument p_selection vinvoicegen c_order isselected docstatus issotrx m_warehouse_id priorityrule c_bpartner_id c_order_id c_order docstatus issotrx p_ad_org_id ad_org_id p_c_bpartner_id c_bpartner_id p_c_order_id c_order_id c_orderline c_order_id c_order_id qtyordered qtyinvoiced m_warehouse_id priorityrule c_bpartner_id c_order_id preparedstatement preparestatement get_trxname p_selection p_ad_org_id setint p_ad_org_id p_selection p_c_bpartner_id setint p_c_bpartner_id p_selection p_c_order_id setint p_c_order_id generate shipments param pstmt order query return info private string generate prepared statement pstmt try result set rs pstmt execute query while rs next m order order new m order get ctx rs get trxname new invoice location if p consolidatedocument m invoice null m invoice getc bpartner location id order getbill location id complete invoice boolean complete order m order invoicerule afterorderdelivered equals order get invoice rule schedule after delivery boolean do invoice false if m order invoicerule customerscheduleafterdelivery equals order get invoice rule m bp new mb partner get ctx order getbill bpartner id null if m bp getc invoiceschedule id 0 log warning b partner has no schedule set to after delivery order set invoice rule m order invoicerule afterdelivery order save else m invoice schedule is m invoice schedule get get ctx m bp getc invoiceschedule id get trxname if is can invoice order get date ordered order get grand total do invoice true else continue schedule after delivery if do invoice m order invoicerule afterdelivery equals order get invoice rule m in out shipments order get shipments for int i 0 i shipments length i m in out ship shipments i if ship is complete ignore incomplete or reversals ship get doc status equals m in out docstatus reversed continue m in out line ship lines ship get lines false for int j 0 j ship lines length j m in out line ship line ship lines j if order is order line ship line getc orderline id continue if ship line is invoiced create line order ship ship line m line 1000 after order delivered immediate else m order line o lines order get lines true null for int i 0 i o lines length i m order line o line o lines i big decimal to invoice o line get qty ordered subtract o line get qty invoiced if to invoice compare to env zero 0 o line getm product id 0 continue big decimal not invoiced shipment o line get qty delivered subtract o line get qty invoiced boolean fully delivered o line get qty ordered compare to o line get qty delivered 0 complete order if complete order fully delivered log fine failed complete order o line complete order false break immediate else if m order invoicerule immediate equals order get invoice rule log fine immediate to invoice to invoice o line big decimal qty entered to invoice correct uom for qty entered if o line get qty entered compare to o line get qty ordered 0 qty entered to invoice multiply o line get qty entered divide o line get qty ordered 12 big decimal round half up create line order o line to invoice qty entered else log fine failed order get invoice rule to invoice to invoice o line for all order lines if m order invoicerule immediate equals order get invoice rule m line 1000 complete order successful if complete order m order invoicerule afterorderdelivered equals order get invoice rule m in out shipments order get shipments for int i 0 i shipments length i m in out ship shipments i if ship is complete ignore incomplete or reversals ship get doc status equals m in out docstatus reversed continue m in out line ship lines ship get lines false for int j 0 j ship lines length j m in out line ship line ship lines j if order is order line ship line getc orderline id continue if ship line is invoiced create line order ship ship line m line 1000 complete order for all orders rs close pstmt close pstmt null catch exception e log log level severe e try if pstmt null pstmt close pstmt null catch exception e pstmt null complete invoice return created m created preparedstatement resultset executequery morder morder getctx get_trxname p_consolidatedocument m_invoice m_invoice getc_bpartner_location_id getbill_location_id completeinvoice completeorder morder invoicerule_afterorderdelivered getinvoicerule doinvoice morder invoicerule_customerscheduleafterdelivery getinvoicerule m_bp mbpartner getctx getbill_bpartner_id m_bp getc_invoiceschedule_id bpartner setinvoicerule morder invoicerule_afterdelivery minvoiceschedule minvoiceschedule getctx m_bp getc_invoiceschedule_id get_trxname caninvoice getdateordered getgrandtotal doinvoice doinvoice morder invoicerule_afterdelivery getinvoicerule minout getshipments minout iscomplete getdocstatus minout docstatus_reversed minoutline shiplines getlines shiplines minoutline shipline shiplines isorderline shipline getc_orderline_id shipline isinvoiced createline shipline m_line morderline olines getlines olines morderline oline olines bigdecimal toinvoice oline getqtyordered oline getqtyinvoiced toinvoice compareto oline getm_product_id bigdecimal notinvoicedshipment oline getqtydelivered oline getqtyinvoiced fullydelivered oline getqtyordered compareto oline getqtydelivered completeorder fullydelivered completeorder oline completeorder morder invoicerule_immediate getinvoicerule toinvoice toinvoice oline bigdecimal qtyentered toinvoice qtyentered oline getqtyentered compareto oline getqtyordered qtyentered toinvoice oline getqtyentered oline getqtyordered bigdecimal round_half_up createline oline toinvoice qtyentered getinvoicerule toinvoice toinvoice oline morder invoicerule_immediate getinvoicerule m_line completeorder morder invoicerule_afterorderdelivered getinvoicerule minout getshipments minout iscomplete getdocstatus minout docstatus_reversed minoutline shiplines getlines shiplines minoutline shipline shiplines isorderline shipline getc_orderline_id shipline isinvoiced createline shipline m_line completeinvoice m_created create invoice line from order line param order order param order line line param qty invoiced qty param qty entered qty private void create line m order order m order line order line big decimal qty invoiced big decimal qty entered if m invoice null m invoice new m invoice order 0 p dateinvoiced if m invoice save throw new illegal state exception could not create invoice o m invoice line line new m invoice line m invoice line set order line order line line set qty invoiced qty invoiced line set qty entered qty entered line set line m line order line get line if line save throw new illegal state exception could not create invoice line o log fine line to string orderline qtyinvoiced qtyentered createline morder morderline orderline bigdecimal qtyinvoiced bigdecimal qtyentered m_invoice m_invoice minvoice p_dateinvoiced m_invoice illegalstateexception minvoiceline minvoiceline m_invoice setorderline orderline setqtyinvoiced qtyinvoiced setqtyentered qtyentered setline m_line orderline getline illegalstateexception tostring create invoice line from shipment param order order param ship shipment header param s line shipment line private void create line m order order m in out ship m in out line s line if m invoice null m invoice new m invoice order 0 p dateinvoiced if m invoice save throw new illegal state exception could not create invoice s create shipment comment line if m ship null m ship getm inout id ship getm inout id m doc type dt m doc type get get ctx ship getc doctype id if m bp null m bp getc bpartner id ship getc bpartner id m bp new mb partner get ctx ship getc bpartner id get trxname reference delivery 12345 12 12 12 m client client m client get get ctx string ad language client getad language if client is multi lingual document m bp getad language null ad language m bp getad language if ad language null ad language language getbasead language java text simple date format format display type get date format display type date language get language ad language string reference dt get print name m bp getad language ship get document no format format ship get movement date m ship ship m invoice line line new m invoice line m invoice line set is description true line set description reference line set line m line s line get line 2 if line save throw new illegal state exception could not create invoice comment line sh optional ship address if not bill address if order getbill location id ship getc bpartner location id m location addr m location getbp location get ctx ship getc bpartner location id null line new m invoice line m invoice line set is description true line set description addr to string line set line m line s line get line 1 if line save throw new illegal state exception could not create invoice comment line 2 sh m invoice line line new m invoice line m invoice line set ship line s line line set qty entered s line get qty entered line set qty invoiced s line get movement qty line set line m line s line get line if line save throw new illegal state exception could not create invoice line s link s line set is invoiced true if s line save throw new illegal state exception could not update shipment line log fine line to string sline createline morder minout minoutline sline m_invoice m_invoice minvoice p_dateinvoiced m_invoice illegalstateexception m_ship m_ship getm_inout_id getm_inout_id mdoctype mdoctype getctx getc_doctype_id m_bp m_bp getc_bpartner_id getc_bpartner_id m_bp mbpartner getctx getc_bpartner_id get_trxname mclient mclient getctx ad_language getad_language ismultilingualdocument m_bp getad_language ad_language m_bp getad_language ad_language ad_language getbasead_language simpledateformat displaytype getdateformat displaytype getlanguage ad_language getprintname m_bp getad_language getdocumentno getmovementdate m_ship minvoiceline minvoiceline m_invoice setisdescription setdescription setline m_line sline getline illegalstateexception getbill_location_id getc_bpartner_location_id mlocation mlocation getbplocation getctx getc_bpartner_location_id minvoiceline m_invoice setisdescription setdescription tostring setline m_line sline getline illegalstateexception minvoiceline minvoiceline m_invoice setshipline sline setqtyentered sline getqtyentered setqtyinvoiced sline getmovementqty setline m_line sline getline illegalstateexception sline setisinvoiced sline illegalstateexception tostring complete invoice private void complete invoice if m invoice null if m invoice process it p docaction log warning complete invoice failed m invoice m invoice save add log m invoice getc invoice id m invoice get date invoiced null m invoice get document no m created m invoice null m ship null m line 0 completeinvoice m_invoice m_invoice processit p_docaction completeinvoice m_invoice m_invoice addlog m_invoice getc_invoice_id m_invoice getdateinvoiced m_invoice getdocumentno m_created m_invoice m_ship m_line prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter perrform process return message throws exception if not successful protected string do it throws exception log info c paymentterm id getrecord id m payment term pt new m payment term get ctx getrecord id get trxname string msg pt validate pt save if ok equals msg return msg throw new compiere user error msg doit c_paymentterm_id getrecord_id mpaymentterm mpaymentterm getctx getrecord_id get_trxname compiereusererror get product attribute instance name previously m attribute name now product attribute test select m attribute name m attributesetinstance id from m inoutline where m attributesetinstance id 0 select p name from c invoiceline il left outer join m product p on il m product id p m product id select p name m attribute name il m attributesetinstance id from c invoiceline il left outer join m product p on il m product id p m product id param p m attributesetinstance id instance return name or public static string attribute name int p m attributesetinstance id throws sql exception if p m attributesetinstance id 0 return string buffer sb new string buffer get base info string sql select asi lot asi ser no asi guarantee date from m attributesetinstance asi where asi m attributesetinstance id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p m attributesetinstance id result set rs pstmt execute query if rs next string lot rs get string 1 if lot null lot length 0 sb append lot append string ser no rs get string 2 if ser no null ser no length 0 sb append append ser no append date guarantee rs get date 3 if guarantee null sb append guarantee append rs close pstmt close get instance info sql select ai value a name from m attributeinstance ai inner join m attribute a on ai m attribute id a m attribute id and a is instance attribute y where ai m attributesetinstance id pstmt compiere prepare statement sql pstmt set int 1 p m attributesetinstance id rs pstmt execute query while rs next sb append rs get string 1 value append append rs get string 2 name append rs close pstmt close if sb length 0 return sb insert 0 sb append return sb to string m_attribute_name productattribute m_attribute_name m_attributesetinstance_id m_inoutline m_attributesetinstance_id c_invoiceline m_product m_product_id m_product_id m_attribute_name m_attributesetinstance_id c_invoiceline m_product m_product_id m_product_id p_m_attributesetinstance_id attributename p_m_attributesetinstance_id sqlexception p_m_attributesetinstance_id stringbuffer stringbuffer serno guaranteedate m_attributesetinstance m_attributesetinstance_id preparedstatement preparestatement setint p_m_attributesetinstance_id resultset executequery getstring serno getstring serno serno serno getdate m_attributeinstance m_attribute m_attribute_id m_attribute_id isinstanceattribute m_attributesetinstance_id preparestatement setint p_m_attributesetinstance_id executequery getstring getstring tostring get bom price limit previously bom pricelimit now bom price limit param p m product id param p m pricelist version id return price limit public static big decimal bom price limit int p m product id int p m pricelist version id throws sql exception return bom price p m product id p m pricelist version id price limit bom_pricelimit bompricelimit p_m_product_id p_m_pricelist_version_id bigdecimal bompricelimit p_m_product_id p_m_pricelist_version_id sqlexception bomprice p_m_product_id p_m_pricelist_version_id pricelimit get bom price list previously bom pricelist now bom price list param p m product id param p m pricelist version id return price list public static big decimal bom price list int p m product id int p m pricelist version id throws sql exception return bom price p m product id p m pricelist version id price list bom_pricelist bompricelist p_m_product_id p_m_pricelist_version_id bigdecimal bompricelist p_m_product_id p_m_pricelist_version_id sqlexception bomprice p_m_product_id p_m_pricelist_version_id pricelist get bom price std previously bom pricestd now bom price std param p m product id param p m pricelist version id return price std public static big decimal bom price std int p m product id int p m pricelist version id throws sql exception return bom price p m product id p m pricelist version id price std bom_pricestd bompricestd p_m_product_id p_m_pricelist_version_id bigdecimal bompricestd p_m_product_id p_m_pricelist_version_id sqlexception bomprice p_m_product_id p_m_pricelist_version_id pricestd get bom price param p m product id param p m pricelist version id param p what variable name return price static big decimal bom price int p m product id int p m pricelist version id string p what throws sql exception big decimal price null try to get price from price list directly string sql select p what from m productprice where m pricelist version id and m product id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p m pricelist version id pstmt set int 2 p m product id result set rs pstmt execute query if rs next price rs get big decimal 1 rs close pstmt close loop through bom if price null price signum 0 price compiere zero sql select b m productbom id b bom qty p isbom from m product bom b m product p where b m productbom id p m product id and b m product id pstmt compiere prepare statement sql pstmt set int 1 p m product id rs pstmt execute query while rs next int m productbom id rs get int 1 big decimal qty rs get big decimal 2 big decimal product price bom price m productbom id p m pricelist version id p what product price product price multiply qty price price add product price rs close pstmt close return price p_m_product_id p_m_pricelist_version_id p_what bigdecimal bomprice p_m_product_id p_m_pricelist_version_id p_what sqlexception bigdecimal pricelist p_what m_productprice m_pricelist_version_id m_product_id preparedstatement preparestatement setint p_m_pricelist_version_id setint p_m_product_id resultset executequery getbigdecimal m_productbom_id bomqty m_product_bom m_product m_productbom_id m_product_id m_product_id preparestatement setint p_m_product_id executequery m_productbom_id getint bigdecimal getbigdecimal bigdecimal productprice bomprice m_productbom_id p_m_pricelist_version_id p_what productprice productprice productprice get bom quantity available previously bom qty available now bom qty available param p m product id product param p m warehouse id warehouse param p m locator id locator return quantity available public static big decimal bom qty available int p m product id int p m warehouse id int p m locator id throws sql exception return bom qty p m product id p m warehouse id p m locator id qty on hand subtract bom qty p m product id p m warehouse id p m locator id qty reserved bom_qty_available bomqtyavailable p_m_product_id p_m_warehouse_id p_m_locator_id bigdecimal bomqtyavailable p_m_product_id p_m_warehouse_id p_m_locator_id sqlexception bomqty p_m_product_id p_m_warehouse_id p_m_locator_id qtyonhand bomqty p_m_product_id p_m_warehouse_id p_m_locator_id qtyreserved get bom quantity on hand previously bom qty onhand now bom qty on hand param p m product id product param p m warehouse id warehouse param p m locator id locator return quantity available public static big decimal bom qty on hand int p m product id int p m warehouse id int p m locator id throws sql exception return bom qty p m product id p m warehouse id p m locator id qty on hand onhand bom_qty_onhand bomqtyonhand p_m_product_id p_m_warehouse_id p_m_locator_id bigdecimal bomqtyonhand p_m_product_id p_m_warehouse_id p_m_locator_id sqlexception bomqty p_m_product_id p_m_warehouse_id p_m_locator_id qtyonhand get bom quantity ordered previously bom qty ordered now bom qty ordered param p m product id product param p m warehouse id warehouse param p m locator id locator return quantity ordered public static big decimal bom qty ordered int p m product id int p m warehouse id int p m locator id throws sql exception return bom qty p m product id p m warehouse id p m locator id qty ordered bom_qty_ordered bomqtyordered p_m_product_id p_m_warehouse_id p_m_locator_id bigdecimal bomqtyordered p_m_product_id p_m_warehouse_id p_m_locator_id sqlexception bomqty p_m_product_id p_m_warehouse_id p_m_locator_id qtyordered get bom quantity reserved previously bom qty reserved now bom qty reserved param p m product id product param p m warehouse id warehouse param p m locator id locator return qyantity reserved public static big decimal bom qty reserved int p m product id int p m warehouse id int p m locator id throws sql exception return bom qty p m product id p m warehouse id p m locator id qty reserved bom_qty_reserved bomqtyreserved p_m_product_id p_m_warehouse_id p_m_locator_id bigdecimal bomqtyreserved p_m_product_id p_m_warehouse_id p_m_locator_id sqlexception bomqty p_m_product_id p_m_warehouse_id p_m_locator_id qtyreserved get bom quantity param p m product id product param p m warehouse id warehouse param p m locator id locator param p what variable name return quantity static big decimal bom qty int p m product id int p m warehouse id int p m locator id string p what throws sql exception check parameters int m warehouse id p m warehouse id if m warehouse id 0 if p m locator id 0 return compiere zero else string sql select m warehouse id from m locator where m locator id m warehouse id compiere getsql value sql p m locator id begin globalqss 2005 10 11 if m warehouse id 0 if m warehouse id 0 m warehouse id 1 end globalqss 2005 10 11 return compiere zero check if product exists and if it is stocked boolean isbom false string product type null boolean is stocked false string sql select isbom product type is stocked from m product where m product id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p m product id result set rs pstmt execute query if rs next isbom y equals rs get string 1 product type rs get string 2 is stocked y equals rs get string 3 rs close pstmt close no product if product type null return compiere zero unlimited capacity if no item if isbom product type equals i is stocked return unlimited get qty if is stocked return get storage qty p m product id m warehouse id p m locator id p what go through bom big decimal quantity unlimited big decimal product quantity null sql select b m productbom id b bom qty p isbom p is stocked p product type from m product bom b m product p where b m productbom id p m product id and b m product id pstmt compiere prepare statement sql pstmt set int 1 p m product id rs pstmt execute query while rs next int m productbom id rs get int 1 big decimal bom qty rs get big decimal 2 isbom y equals rs get string 3 is stocked y equals rs get string 4 product type rs get string 5 stocked items leaf node if product type equals i is stocked get product qty product quantity get storage qty m productbom id m warehouse id p m locator id p what get rounding precision int uom precision getuom precision m productbom id how much can we make with this product product quantity product quantity set scale uom precision divide bom qty uom precision big decimal round half up how much can we make overall if product quantity compare to quantity 0 quantity product quantity else if isbom another bom product quantity bom qty m productbom id m warehouse id p m locator id p what how much can we make overall if product quantity compare to quantity 0 quantity product quantity rs close pstmt close if quantity signum 0 int uom precision getuom precision p m product id return quantity set scale uom precision big decimal round half up return compiere zero p_m_product_id p_m_warehouse_id p_m_locator_id p_what bigdecimal bomqty p_m_product_id p_m_warehouse_id p_m_locator_id p_what sqlexception m_warehouse_id p_m_warehouse_id m_warehouse_id p_m_locator_id m_warehouse_id m_locator m_locator_id m_warehouse_id getsqlvalue p_m_locator_id m_warehouse_id m_warehouse_id m_warehouse_id producttype isstocked producttype isstocked m_product m_product_id preparedstatement preparestatement setint p_m_product_id resultset executequery getstring producttype getstring isstocked getstring producttype producttype isstocked isstocked getstorageqty p_m_product_id m_warehouse_id p_m_locator_id p_what bigdecimal bigdecimal productquantity m_productbom_id bomqty isstocked producttype m_product_bom m_product m_productbom_id m_product_id m_product_id preparestatement setint p_m_product_id executequery m_productbom_id getint bigdecimal bomqty getbigdecimal getstring isstocked getstring producttype getstring producttype isstocked productqty productquantity getstorageqty m_productbom_id m_warehouse_id p_m_locator_id p_what uomprecision getuomprecision m_productbom_id productquantity productquantity setscale uomprecision bomqty uomprecision bigdecimal round_half_up productquantity compareto productquantity productquantity bomqty m_productbom_id m_warehouse_id p_m_locator_id p_what productquantity compareto productquantity uomprecision getuomprecision p_m_product_id setscale uomprecision bigdecimal round_half_up get storage qty param p m product id product param m warehouse id warehouse param p m locator id locator param p what variable name return quantity or zero throws sql exception static big decimal get storage qty int p m product id int m warehouse id int p m locator id string p what throws sql exception big decimal quantity null string sql select sum p what from m storage s where m product id if p m locator id 0 sql and s m locator id else sql and exists select from m locator l where s m locator id l m locator id and l m warehouse id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p m product id if p m locator id 0 pstmt set int 2 p m locator id else pstmt set int 2 m warehouse id result set rs pstmt execute query if rs next quantity rs get big decimal 1 rs close pstmt close not found if quantity null return compiere zero return quantity p_m_product_id m_warehouse_id p_m_locator_id p_what sqlexception bigdecimal getstorageqty p_m_product_id m_warehouse_id p_m_locator_id p_what sqlexception bigdecimal p_what m_storage m_product_id p_m_locator_id m_locator_id m_locator m_locator_id m_locator_id m_warehouse_id preparedstatement preparestatement setint p_m_product_id p_m_locator_id setint p_m_locator_id setint m_warehouse_id resultset executequery getbigdecimal get uom precision for product param p m product id product return precision or 0 static int getuom precision int p m product id throws sql exception int precision 0 string sql select u std precision from c uom u inner join m product p on u c uom id p c uom id where p m product id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p m product id result set rs pstmt execute query if rs next precision rs get int 1 rs close pstmt close return precision p_m_product_id getuomprecision p_m_product_id sqlexception stdprecision c_uom m_product c_uom_id c_uom_id m_product_id preparedstatement preparestatement setint p_m_product_id resultset executequery getint standard constructor public x pa benchmarkdata properties ctx int pa benchmarkdata id string trx name super ctx pa benchmarkdata id trx name if pa benchmarkdata id 0 set benchmark date new timestamp system current time millis set benchmark value env zero set name null setpa benchmarkdata id 0 setpa benchmark id 0 x_pa_benchmarkdata pa_benchmarkdata_id trxname pa_benchmarkdata_id trxname pa_benchmarkdata_id setbenchmarkdate currenttimemillis setbenchmarkvalue setname setpa_benchmarkdata_id setpa_benchmark_id load constructor public x pa benchmarkdata properties ctx result set rs string trx name super ctx rs trx name x_pa_benchmarkdata resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa benchmarkdata append get id append return sb to string tostring stringbuffer stringbuffer x_pa_benchmarkdata get_id tostring set date benchmark date public void set benchmark date timestamp benchmark date if benchmark date null throw new illegal argument exception benchmark date is mandatory set value benchmark date benchmark date setbenchmarkdate benchmarkdate benchmarkdate illegalargumentexception benchmarkdate set_value benchmarkdate benchmarkdate get date benchmark date public timestamp get benchmark date return timestamp get value benchmark date getbenchmarkdate get_value benchmarkdate set value benchmark value public void set benchmark value big decimal benchmark value if benchmark value null throw new illegal argument exception benchmark value is mandatory set value benchmark value benchmark value setbenchmarkvalue bigdecimal benchmarkvalue benchmarkvalue illegalargumentexception benchmarkvalue set_value benchmarkvalue benchmarkvalue get value benchmark value public big decimal get benchmark value big decimal bd big decimal get value benchmark value if bd null return env zero return bd bigdecimal getbenchmarkvalue bigdecimal bigdecimal get_value benchmarkvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set benchmark data performance benchmark data point public void setpa benchmarkdata id int pa benchmarkdata id if pa benchmarkdata id 1 throw new illegal argument exception pa benchmarkdata id is mandatory set valuenocheck pa benchmarkdata id new integer pa benchmarkdata id setpa_benchmarkdata_id pa_benchmarkdata_id pa_benchmarkdata_id illegalargumentexception pa_benchmarkdata_id set_valuenocheck pa_benchmarkdata_id pa_benchmarkdata_id get benchmark data performance benchmark data point public int getpa benchmarkdata id integer ii integer get value pa benchmarkdata id if ii null return 0 return ii int value getpa_benchmarkdata_id get_value pa_benchmarkdata_id intvalue set benchmark performance benchmark public void setpa benchmark id int pa benchmark id if pa benchmark id 1 throw new illegal argument exception pa benchmark id is mandatory set valuenocheck pa benchmark id new integer pa benchmark id setpa_benchmark_id pa_benchmark_id pa_benchmark_id illegalargumentexception pa_benchmark_id set_valuenocheck pa_benchmark_id pa_benchmark_id get benchmark performance benchmark public int getpa benchmark id integer ii integer get value pa benchmark id if ii null return 0 return ii int value getpa_benchmark_id get_value pa_benchmark_id intvalue static create ui param c component return compiere table header ui public static componentui createui j component c return new compiere table headerui tableheader jcomponent compieretableheaderui install ui set not opaque param c public void installui j component c super installui c table header is in j viewpoiunt which is opaque when ui created table header not added to viewpoint c set opaque true c put client property compiereplaf background fill y jcomponent tableheader jviewpoiunt tableheader setopaque putclientproperty background_fill update this method is invoked by code j component code when the specified component is being painted by default this method will fill the specified component with its background color if its code opaque code property is code true code and then immediately call code paint code param g the code graphics code context in which to paint param c the component being painted see paint see javax swing j component paint component public void update graphics g j component c compiere utils print parents c parent is j viewpoint if c is opaque flat compiere utils fill rectange graphics2d g c compiere look and feel round paint g c jcomponent jcomponent paintcomponent jcomponent compiereutils printparents jviewpoint isopaque compiereutils fillrectange compierelookandfeel paint 3d box param g param c public void paint graphics g j component c super paint g c compiere utils paint3 deffect graphics2d g c compiere look and feel round true jcomponent compiereutils paint3deffect compierelookandfeel constructor param ui public compiere split pane divider basic split paneui ui super ui basic borders split pane divider border ignored set after constructor set border null compieresplitpanedivider basicsplitpaneui basicborders splitpanedividerborder setborder paints the divider if the border is painted it creates a light gray bar on top button still a light gray 1 pt shaddow border is painted on top button param g public void paint graphics g basic borders split pane divider border set border null super paint g basicborders splitpanedividerborder setborder get mwf block from cache param ctx context param ad wf block id id return mwf block public static mwf block get properties ctx int ad wf block id integer key new integer ad wf block id mwf block ret value mwf block s cache get key if ret value null return ret value ret value new mwf block ctx ad wf block id null if ret value get id 0 s cache put key ret value return ret value mwfblock ad_wf_block_id mwfblock mwfblock ad_wf_block_id ad_wf_block_id mwfblock retvalue mwfblock s_cache retvalue retvalue retvalue mwfblock ad_wf_block_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param ad wf block id id public mwf block properties ctx int ad wf block id string trx name super ctx ad wf block id trx name ad_wf_block_id mwfblock ad_wf_block_id trxname ad_wf_block_id trxname load constructor param ctx context param rs result set public mwf block properties ctx result set rs string trx name super ctx rs trx name mwfblock resultset trxname trxname standard constructor public x k entrycategory properties ctx int k entrycategory id string trx name super ctx k entrycategory id trx name if k entrycategory id 0 setk categoryvalue id 0 setk category id 0 setk entry id 0 x_k_entrycategory k_entrycategory_id trxname k_entrycategory_id trxname k_entrycategory_id setk_categoryvalue_id setk_category_id setk_entry_id load constructor public x k entrycategory properties ctx result set rs string trx name super ctx rs trx name x_k_entrycategory resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k entrycategory append get id append return sb to string tostring stringbuffer stringbuffer x_k_entrycategory get_id tostring set category value the value of the category public void setk categoryvalue id int k categoryvalue id if k categoryvalue id 1 throw new illegal argument exception k categoryvalue id is mandatory set value k categoryvalue id new integer k categoryvalue id setk_categoryvalue_id k_categoryvalue_id k_categoryvalue_id illegalargumentexception k_categoryvalue_id set_value k_categoryvalue_id k_categoryvalue_id get category value the value of the category public int getk categoryvalue id integer ii integer get value k categoryvalue id if ii null return 0 return ii int value getk_categoryvalue_id get_value k_categoryvalue_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getk categoryvalue id intvalue keynamepair getkeynamepair keynamepair get_id valueof getk_categoryvalue_id set knowledge category knowledge category public void setk category id int k category id if k category id 1 throw new illegal argument exception k category id is mandatory set value k category id new integer k category id setk_category_id k_category_id k_category_id illegalargumentexception k_category_id set_value k_category_id k_category_id get knowledge category knowledge category public int getk category id integer ii integer get value k category id if ii null return 0 return ii int value getk_category_id get_value k_category_id intvalue set entry knowledge entry public void setk entry id int k entry id if k entry id 1 throw new illegal argument exception k entry id is mandatory set valuenocheck k entry id new integer k entry id setk_entry_id k_entry_id k_entry_id illegalargumentexception k_entry_id set_valuenocheck k_entry_id k_entry_id get entry knowledge entry public int getk entry id integer ii integer get value k entry id if ii null return 0 return ii int value getk_entry_id get_value k_entry_id intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name m matchers m bank statement matcher get matchers get ctx get trxname processinfoparameter getparameter getparametername getparameter m_matchers mbankstatementmatcher getmatchers getctx get_trxname perform process return message throws exception if not successful protected string do it throws exception int table id gettable id int record id getrecord id if m matchers null m matchers length 0 throw new illegal state exception no matchers found log info do it table id table id record id record id matchers m matchers length if table id x i bankstatement table id return match new x i bankstatement get ctx record id get trxname else if table id m bank statement table id return match new m bank statement get ctx record id get trxname else if table id m bank statement line table id return match new m bank statement line get ctx record id get trxname return doit table_id gettable_id record_id getrecord_id m_matchers m_matchers illegalstateexception doit table_id table_id record_id record_id m_matchers table_id x_i_bankstatement table_id x_i_bankstatement getctx record_id get_trxname table_id mbankstatement table_id mbankstatement getctx record_id get_trxname table_id mbankstatementline table_id mbankstatementline getctx record_id get_trxname perform match param ibs import bank statement line return message private string match x i bankstatement ibs if m matchers null ibs null ibs getc payment id 0 return log fine ibs bank statement match info info null for int i 0 i m matchers length i if m matchers i is matcher valid info m matchers i get matcher find match ibs if info null info is matched if info getc payment id 0 ibs setc payment id info getc payment id if info getc invoice id 0 ibs setc invoice id info getc invoice id if info getc bpartner id 0 ibs setc bpartner id info getc bpartner id ibs save return ok for all matchers return x_i_bankstatement m_matchers getc_payment_id bankstatementmatchinfo m_matchers m_matchers ismatchervalid m_matchers getmatcher findmatch ismatched getc_payment_id setc_payment_id getc_payment_id getc_invoice_id setc_invoice_id getc_invoice_id getc_bpartner_id setc_bpartner_id getc_bpartner_id perform match param bsl bank statement line return message private string match m bank statement line bsl if m matchers null bsl null bsl getc payment id 0 return log fine match bsl bank statement match info info null for int i 0 i m matchers length i if m matchers i is matcher valid info m matchers i get matcher find match bsl if info null info is matched if info getc payment id 0 bsl setc payment id info getc payment id if info getc invoice id 0 bsl setc invoice id info getc invoice id if info getc bpartner id 0 bsl setc bpartner id info getc bpartner id bsl save return ok for all matchers return mbankstatementline m_matchers getc_payment_id bankstatementmatchinfo m_matchers m_matchers ismatchervalid m_matchers getmatcher findmatch ismatched getc_payment_id setc_payment_id getc_payment_id getc_invoice_id setc_invoice_id getc_invoice_id getc_bpartner_id setc_bpartner_id getc_bpartner_id perform match param bs bank statement return message private string match m bank statement bs if m matchers null bs null return log fine match bs int count 0 m bank statement line lines bs get lines false for int i 0 i lines length i if lines i getc payment id 0 match lines i count return string value of count mbankstatement m_matchers mbankstatementline getlines getc_payment_id valueof constructor param column name column param mandatory mandatory param is read only read only param is updateable updateable param text text param description description param help help param ad process id process to start public v button string column name boolean mandatory boolean is read only boolean is updateable string text string description string help int ad process id super text super set name column name super set action command column name m text text m columnname column name set mandatory mandatory if is read only is updateable set read write false else set read write true special buttons if column name equals payment rule read reference 195 this set foreground color blue set icon env get image icon payment16 gif 29 14 else if column name equals doc action read reference 135 this set foreground color blue set icon env get image icon process16 gif 16 16 else if column name equals create from set icon env get image icon copy16 gif 16 16 else if column name equals record id set icon env get image icon zoom16 gif 16 16 this set text msg get msg env get ctx zoom document else if column name equals posted read reference 234 this set foreground color magenta set icon env get image icon info account16 gif 16 16 deescription help m description description if description null description length 0 m description else set tool tip text m description m help help if help null m help m ad process id ad process id columnname isreadonly isupdateable ad_process_id vbutton columnname isreadonly isupdateable ad_process_id setname columnname setactioncommand columnname m_text m_columnname columnname setmandatory isreadonly isupdateable setreadwrite setreadwrite columnname paymentrule readreference setforeground seticon getimageicon columnname docaction readreference setforeground seticon getimageicon columnname createfrom seticon getimageicon columnname record_id seticon getimageicon settext getmsg getctx zoomdocument columnname readreference setforeground seticon getimageicon infoaccount16 m_description m_description settooltiptext m_description m_help m_help m_ad_process_id ad_process_id dispose public void dispose m actionlistener null if m values null m values clear m values null m_actionlistener m_values m_values m_values set value param value value public void set value object value m value value string text m text nothing to show or record id if value null m columnname equals record id else if m values null text string m values get value else if m lookup null name pair pp m lookup get value if pp null text pp get name display it set text text null text setvalue m_value m_text record_id m_columnname record_id m_values m_values m_lookup namepair m_lookup getname settext property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return value return value public object get value return m value getvalue m_value return display value return string value public string get display return m value to string getdisplay m_value tostring set mandatory nop param mandatory mandatory public void set mandatory boolean mandatory m mandatory mandatory setmandatory m_mandatory mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory set background nop param error error public void set background boolean error setbackground get column name return column name public string get column name return m columnname columnname getcolumnname m_columnname get description return description string public string get description return m description getdescription m_description get help return help string public string get help return m help gethelp m_help get ad process id return ad process id or 0 public int getprocess id return m ad process id ad_process_id ad_process_id getprocess_id m_ad_process_id add action listener param a listener listener public void add action listener action listener a listener m actionlistener a listener super add action listener a listener actionlistener alistener addactionlistener actionlistener alistener m_actionlistener alistener addactionlistener alistener string representation return string representation public string to string string buffer sb new string buffer v button sb append m columnname sb append append m value append return sb to string tostring stringbuffer stringbuffer vbutton m_columnname m_value tostring fill m values with ref list values param ad reference id reference private void read reference int ad reference id m values new hash map string string string sql if env is base language env get ctx ad ref list sql select value name from ad ref list where ad reference id else sql select l value t name from ad ref list l ad ref list trl t where l ad ref list id t ad ref list id and t ad language env getad language env get ctx and l ad reference id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad reference id result set rs pstmt execute query while rs next string value rs get string 1 string name rs get string 2 m values put value name rs close pstmt close catch sql exception e log log level severe sql e m_values ref_list ad_reference_id readreference ad_reference_id m_values hashmap isbaselanguage getctx ad_ref_list ad_ref_list ad_reference_id ad_ref_list ad_ref_list_trl ad_ref_list_id ad_ref_list_id ad_language getad_language getctx ad_reference_id preparedstatement preparestatement setint ad_reference_id resultset executequery getstring getstring m_values sqlexception return value name return hash map with value names public hash map get values return m values hashmap hashmap getvalues m_values set field window no for value preference param m field field model public void set field m field m field if m field get column name ends with id m field get column name equals record id m lookup m lookup factory get env get ctx m field get window no 0 m field getad column id display type search else if m field getad reference value id 0 assuming list m lookup m lookup factory get env get ctx m field get window no 0 m field getad column id display type list windowno valuepreference mfield setfield mfield mfield mfield getcolumnname endswith _id mfield getcolumnname record_id m_lookup mlookupfactory getctx mfield getwindowno mfield getad_column_id displaytype mfield getad_reference_value_id m_lookup mlookupfactory getctx mfield getwindowno mfield getad_column_id displaytype return returns the saved mnemonic public char get saved mnemonic return m savedmnemonic savedmnemonic getsavedmnemonic m_savedmnemonic param saved mnemonic the saved mnemonic to set public void set saved mnemonic char saved mnemonic m savedmnemonic saved mnemonic savedmnemonic savedmnemonic setsavedmnemonic savedmnemonic m_savedmnemonic savedmnemonic create styled document with title param plain if true adds standard css and standard js param title optional header title and h1 param java client true if java client browser otherwise return document public static web doc create boolean plain string title boolean java client web doc doc new web doc doc set up plain java client title return doc javaclient webdoc javaclient webdoc webdoc setup javaclient create document param plain if true adds stylesheet and standard js return document public static web doc create boolean plain return create plain null false webdoc create styled popup document with title param title header title and h1 return document public static web doc create popup string title web doc doc create title doc get head add element new script element null window js doc get head add element new link popup css link rel stylesheet link type css doc set classes popup table popup header doc get table set cell spacing 5 return doc webdoc createpopup webdoc gethead addelement gethead addelement rel_stylesheet type_css setclasses popuptable popupheader gettable setcellspacing create styled window document with title param title header title and h1 return document public static web doc create window string title web doc doc create title doc get head add element new link window css link rel stylesheet link type css doc get head add element new script element null window js doc set classes window table window header doc get table set cell spacing 5 return doc webdoc createwindow webdoc gethead addelement rel_stylesheet type_css gethead addelement setclasses windowtable windowheader gettable setcellspacing create styled web document with title param title optional header title and h1 return document public static web doc create string title return create false title false webdoc create new xhtml document structure private web doc webdoc set up document param plain if true adds stylesheet and standard js param java client true if java client browser otherwise param title header title and h1 private void set up boolean plain boolean java client string title m html add element m head m html add element m body m body add element new a set name top if title null m head add element new title title if plain return css js if java client m head add element new link http www adempiere org standard css link rel stylesheet link type css else m head add element new link web env get stylesheeturl link rel stylesheet link type css m head add element new script element null web env get base directory standard js m head add element new meta set http equiv content type text html charset utf 8 m head add element new meta set name description a dempiere html ui m table new table 0 2 0 100 null spacing 2 m toprow new tr title m topleft new td if title null m topleft add element nbsp else m topleft add element new h1 title m toprow add element m topleft logo m topright new td set align right if java client m topright add element new img http www adempiere org images a dempiere64x32 png set align align type right set alt a dempiere else m topright add element web env get logo m toprow add element m topright m table add element m toprow m body add element m table javaclient setup javaclient m_html addelement m_head m_html addelement m_body m_body addelement setname m_head addelement javaclient m_head addelement rel_stylesheet type_css m_head addelement webenv getstylesheeturl rel_stylesheet type_css m_head addelement webenv getbasedirectory m_head addelement sethttpequiv m_head addelement setname adempiere m_table m_toprow m_topleft m_topleft addelement m_topleft addelement m_toprow addelement m_topleft m_topright setalign javaclient m_topright addelement adempiere64x32 setalign aligntype setalt adempiere m_topright addelement webenv getlogo m_toprow addelement m_topright m_table addelement m_toprow m_body addelement m_table set css classes param table class optional class for table param td class optional class for left right td public void set classes string table class string td class if m table null table class null m table set class table class if m topleft null td class null m topleft set class td class if m topright null td class null m topright set class td class tableclass tdclass setclasses tableclass tdclass m_table tableclass m_table setclass tableclass m_topleft tdclass m_topleft setclass tdclass m_topright tdclass m_topright setclass tdclass get body return body public body get body return m body getbody m_body get head return header public head get head return m head gethead m_head get table no class set return table public table get table return m table gettable m_table get table row no class set return table row public tr get top row return m toprow gettoprow m_toprow get top row get table data left no class set return table data public td get top left return m topleft gettoprow gettopleft m_topleft get table data right no class set return table data public td get top right return m topright gettopright m_topright string representation return string public string to string return m html to string tostring m_html tostring output document param out out public void output output stream out m html output out outputstream m_html output document param out out public void output print writer out m html output out printwriter m_html add popup center param nowrap set nowrap in td return null or center single td public td add popup center boolean nowrap if m table null return null td center new td popup center align type center align type middle nowrap center set col span 2 m table add element new tr add element center return center addpopupcenter m_table popupcenter aligntype aligntype setcolspan m_table addelement addelement add popup close footer return null or array with left right td public td add popup close input button web util create close popup button if m table null m body add element button return null td left new td popup footer align type left align type middle false null td right new td popup footer align type right align type middle false button m table add element new tr add element left add element right return new td left right addpopupclose webutil createclosepopupbutton m_table m_body addelement popupfooter aligntype aligntype popupfooter aligntype aligntype m_table addelement addelement addelement add window center param nowrap set nowrap in td return empty single center td public td add window center boolean nowrap if m table null return null td center new td window center align type center align type middle nowrap center set col span 2 m table add element new tr add element center return center addwindowcenter m_table windowcenter aligntype aligntype setcolspan m_table addelement addelement add window footer return null or array with empty left right td public td add window footers if m table null return null td left new td window footer align type left align type middle false td right new td window footer align type right align type middle false m table add element new tr add element left add element right return new td left right addwindowfooters m_table windowfooter aligntype aligntype windowfooter aligntype aligntype m_table addelement addelement addelement add window footer return empty single center td public td add window footer if m table null return null td center new td window footer align type center align type middle false m table add element new tr add element center return center addwindowfooter m_table windowfooter aligntype aligntype m_table addelement addelement test class param args args public static void main string args web doc doc web doc create test doc get body add element new b 111 u0100 form f new form myaction f add element new input doc get body add element f system out println doc to string system out println doc output system out system out println webdoc webdoc getbody addelement addelement getbody addelement tostring initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception advertisement servlet init servletexception servletconfig servletexception webenv initweb servletexception advertisementservlet get servlet information return info public string get servlet info return a dempiere web advertisement servlet getservletinfo adempiere clean up resources public void destroy log fine process the http get request sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr forward to request jsp response send redirect advertisements jsp servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr sendredirect process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info post from request get remote host request get remote addr get session attributes http session session request get session true session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning no web user response send redirect login servlet forward to advertisement jsp entry return int w advertisement id web util get parameter as int request p advertisement id m advertisement ad new m advertisement ctx w advertisement id null if ad get id 0 web util create forward page response web advertisement not found advertisements jsp 0 return string buffer info new string buffer string name web util get parameter request name if name null name length 0 name equals ad get name ad set name name info append name string description web util get parameter request description if description null description length 0 description equals ad get description ad set description description info append description string imageurl null string ad text web util get parameter request ad text if ad text null ad text length 0 ad text equals ad get ad text ad set ad text ad text info append ad text string click targeturl web util get parameter request click targeturl if click targeturl null click targeturl length 0 click targeturl equals ad get click targeturl ad set click targeturl click targeturl info append click targeturl if info length 0 if ad save web util create forward page response web advertisement updated info to string advertisements jsp 0 else web util create forward page response web advertisement update error advertisements jsp 0 else web util create forward page response web advertisement not changed advertisements jsp 0 servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr httpsession getsession removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser sendredirect loginservlet forwardto w_advertisement_id webutil getparameterasint p_advertisement_id madvertisement madvertisement w_advertisement_id get_id webutil createforwardpage stringbuffer stringbuffer webutil getparameter getname setname webutil getparameter getdescription setdescription adtext webutil getparameter adtext adtext adtext adtext getadtext setadtext adtext adtext clicktargeturl webutil getparameter clicktargeturl clicktargeturl clicktargeturl clicktargeturl getclicktargeturl setclicktargeturl clicktargeturl clicktargeturl webutil createforwardpage tostring webutil createforwardpage webutil createforwardpage basic constructor use set methods public legend basic constructor use set methods param element sets the value public legend string value add element value addelement basic constructor use set methods param element sets the value public legend element value add element value addelement basic constructor use set methods param element sets the value param accesskey sets the accesskey attribute public legend string value string accesskey add element value set access key accesskey addelement setaccesskey basic constructor use set methods param element sets the value param accesskey sets the accesskey attribute public legend element value string accesskey add element value set access key accesskey addelement setaccesskey sets the accesskey attribute param accesskey sets the accesskey attribute public legend set access key string accesskey add attribute accesskey accesskey return this setaccesskey addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public legend add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public legend add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public legend add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public legend add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public legend remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute constructor param ctx context param window no window no public m locator lookup properties ctx int window no super display type table dir window no m ctx ctx m loader new loader m loader start windowno mlocatorlookup windowno displaytype tabledir windowno m_ctx m_loader m_loader dispose public void dispose log fine c locator id c locator id if m loader null while m loader is alive m loader interrupt m loader null if m lookup null m lookup clear m lookup null super dispose c_locator_id c_locator_id m_loader m_loader isalive m_loader m_loader m_lookup m_lookup m_lookup set warehouse restriction param only warehouse id wahrehouse public void setonly warehouse id int only warehouse id m only warehouse id only warehouse id only_warehouse_id setonly_warehouse_id only_warehouse_id m_only_warehouse_id only_warehouse_id get only wahrehouse return warehouse public int getonly warehouse id return m only warehouse id getonly_warehouse_id m_only_warehouse_id wait until async load complete public void load complete if m loader null try m loader join catch interrupted exception ie log log level severe join interrupted ie loadcomplete m_loader m_loader interruptedexception get value param key key return value value public name pair get object key if key null return null try cache m locator loc m locator m lookup get key if loc null return new key name pair loc getm locator id loc to string not found and waiting for loader if m loader is alive log fine waiting for loader load complete is most current loc m locator m lookup get key if loc null return new key name pair loc getm locator id loc to string try to get it directly return get direct key true null namepair mlocator mlocator m_lookup keynamepair getm_locator_id tostring m_loader isalive loadcomplete mlocator m_lookup keynamepair getm_locator_id tostring getdirect get display value param value value return string to display public string get display object value if value null return name pair display get value if display null return value to string return display to string getdisplay namepair tostring tostring the lookup contains the key param key key return true if lookup contains key public boolean contains key object key return m lookup contains key key containskey m_lookup containskey get data direct from table param key value integer key value param save in cache save in cache return object directly loaded public name pair get direct object key value boolean save in cache string trx name m locator loc getm locator key value trx name if loc null return null int key loc getm locator id if save in cache m lookup put new integer key loc name pair ret value new key name pair key loc to string return ret value keyvalue saveincache namepair getdirect keyvalue saveincache trxname mlocator getmlocator keyvalue trxname getm_locator_id saveincache m_lookup namepair retvalue keynamepair tostring retvalue get data direct from table param key value integer key value return object directly loaded public m locator getm locator object key value string trx name log fine m locator lookup get direct key value get class key value int m locator id 1 try m locator id integer parse int key value to string catch exception e if m locator id 1 log log level severe invalid key key value return null return new m locator m ctx m locator id trx name keyvalue mlocator getmlocator keyvalue trxname mlocatorlookup getdirect keyvalue getclass keyvalue m_locator_id m_locator_id parseint keyvalue tostring m_locator_id keyvalue mlocator m_ctx m_locator_id trxname return a string representation of the object public string to string return m locator lookup size m lookup size tostring mlocatorlookup m_lookup is locator with key valid warehouse param key key return true if valid public boolean is valid object key if key null return true try cache m locator loc m locator m lookup get key if loc null loc getm locator key null return is valid loc isvalid mlocator mlocator m_lookup getmlocator isvalid is locator with key valid warehouse param locator locator return true if valid public boolean is valid m locator locator if locator null m only warehouse id 0 return true return m only warehouse id locator getm warehouse id isvalid mlocator m_only_warehouse_id m_only_warehouse_id getm_warehouse_id class loader extends thread implements serializable public loader super m locator lookup loader mlocatorlookup load lookup public void run log config m locator lookup loader run m ad column id set info string buffer sql new string buffer select from m locator append where is active y if m only warehouse id 0 sql append and m warehouse id append m only warehouse id string final sql m role get default m ctx false add accesssql sql to string m locator m role sql notqualified m role sql ro if is interrupted log log level severe interrupted return reset m lookup clear int rows 0 try prepared statement pstmt db prepare statement final sql null result set rs pstmt execute query get first 100 rows while rs next rows s maxrows m locator loc new m locator m ctx rs null int m locator id loc getm locator id m lookup put new integer m locator id loc rs close pstmt close catch sql exception e log log level severe sql to string e log fine complete m lookup size mlocatorlookup m_ad_column_id stringbuffer stringbuffer m_locator isactive m_only_warehouse_id m_warehouse_id m_only_warehouse_id finalsql mrole getdefault m_ctx addaccesssql tostring m_locator mrole sql_notqualified mrole sql_ro isinterrupted m_lookup preparedstatement preparestatement finalsql resultset executequery s_maxrows mlocator mlocator m_ctx m_locator_id getm_locator_id m_lookup m_locator_id sqlexception tostring m_lookup return info as array list containing locator waits for the loader to finish return collection of lookup values public collection get data if m loader is alive log fine waiting for loader try m loader join catch interrupted exception ie log severe join interrupted ie get message return m lookup values arraylist getdata m_loader isalive m_loader interruptedexception getmessage m_lookup return data as sorted array list param mandatory mandatory param only validated only validated param only active only active param temporary force load for temporary display return array list of lookup values public array list object get data boolean mandatory boolean only validated boolean only active boolean temporary create list collection collection get data array list object list new array list object collection size iterator it collection iterator while it has next m locator loc m locator it next if is valid loc only valid warehouses list add loc sort data m locator l new m locator m ctx 0 if mandatory list add l collections sort list l return list arraylist onlyvalidated onlyactive arraylist arraylist getdata onlyvalidated onlyactive getdata arraylist arraylist hasnext mlocator mlocator isvalid mlocator mlocator m_ctx refresh values return new size of lookup public int refresh log fine start m loader new loader m loader start try m loader join catch interrupted exception ie log info m lookup size return m lookup size m_loader m_loader m_loader interruptedexception m_lookup m_lookup get underlying fully qualified table column name return table column name public string get column name return m locator m locator id columnname getcolumnname m_locator m_locator_id prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name log fine prepare para i if para i get parameter null else if name equals m product id p m product id para i get parameter as int else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter m_product_id p_m_product_id getparameterasint perform process return message text with variables throws exception if not successful protected string do it throws exception log info m product id p m product id if p m product id 0 throw new compiere user error not found m product id p m product id m product product m product get get ctx p m product id if product get id p m product id throw new compiere user error not found m product id p m product id if m cost detail process product product get trxname return ok return error doit m_product_id p_m_product_id p_m_product_id compiereusererror notfound m_product_id p_m_product_id mproduct mproduct getctx p_m_product_id get_id p_m_product_id compiereusererror notfound m_product_id p_m_product_id mcostdetail processproduct get_trxname constructor public reportcolumnset copy super reportcolumnset_copy prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals pa reportcolumnset id m pa reportcolumnset id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter pa_reportcolumnset_id m_pa_reportcolumnset_id bigdecimal getparameter intvalue perrform process return message throws exception protected string do it throws exception int to id super getrecord id log info from pa reportcolumnset id m pa reportcolumnset id to to id if to id 1 throw new exception msg saveerrorrownotfound m report column set to new m report column set get ctx to id get trxname m report column set rc set new m report column set get ctx m pa reportcolumnset id get trxname m report column rcs rc set get columns for int i 0 i rcs length i m report column rc m report column copy get ctx to getad client id to getad org id to id rcs i get trxname rc save oper 1 2 were set to null return copied rcs length doit to_id getrecord_id pa_reportcolumnset_id m_pa_reportcolumnset_id to_id to_id msg_saveerrorrownotfound mreportcolumnset mreportcolumnset getctx to_id get_trxname mreportcolumnset rcset mreportcolumnset getctx m_pa_reportcolumnset_id get_trxname mreportcolumn rcset getcolumns mreportcolumn mreportcolumn getctx getad_client_id getad_org_id to_id get_trxname standard constructor public x m changenotice properties ctx int m changenotice id string trx name super ctx m changenotice id trx name if m changenotice id 0 set is approved false n setm changenotice id 0 set name null set processed false x_m_changenotice m_changenotice_id trxname m_changenotice_id trxname m_changenotice_id setisapproved setm_changenotice_id setname setprocessed load constructor public x m changenotice properties ctx result set rs string trx name super ctx rs trx name x_m_changenotice resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m changenotice append get id append return sb to string tostring stringbuffer stringbuffer x_m_changenotice get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set detail information additional detail information public void set detail info string detail info if detail info null detail info length 4000 log warning length 4000 truncated detail info detail info substring 0 3999 set value detail info detail info setdetailinfo detailinfo detailinfo detailinfo detailinfo detailinfo set_value detailinfo detailinfo get detail information additional detail information public string get detail info return string get value detail info getdetailinfo get_value detailinfo set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set change notice bill of materials engineering change notice version public void setm changenotice id int m changenotice id if m changenotice id 1 throw new illegal argument exception m changenotice id is mandatory set valuenocheck m changenotice id new integer m changenotice id setm_changenotice_id m_changenotice_id m_changenotice_id illegalargumentexception m_changenotice_id set_valuenocheck m_changenotice_id m_changenotice_id get change notice bill of materials engineering change notice version public int getm changenotice id integer ii integer get value m changenotice id if ii null return 0 return ii int value getm_changenotice_id get_value m_changenotice_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue initialize global variables param config throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w account init servletexception servletconfig servletexception webenv initweb servletexception waccount process the http get request initial start needs to have parameters form name and column name param request param response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log config w account do get web session ctx wsc web session ctx get request w window status ws w window status get request if wsc null ws null web util create timeout page request response this null return get mandatory parameters string form name web util get parameter request form name string column name web util get parameter request column name m field m field ws cur tab get field column name log config form name form name column name column name m field m field to string if m field null form name null column name null form name equals column name equals web util create timeout page request response this msg get msg wsc ctx parameter missing return object value ws cur tab get value column name string target opener document form name column name create document web doc doc web doc create m field get header body body doc get body body set on blur self focus body add element fill table ws m field target reset cancel button reset new button reset add element reset translate reset set on click target value target d value window close button cancel new button cancel add element cancel translate cancel set on click window close body add element new p align type right add element reset add element nbsp add element cancel log fine doc to string web util create response request response this null doc false formname columnname servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception waccount doget websessionctx websessionctx wwindowstatus wwindowstatus webutil createtimeoutpage formname webutil getparameter formname columnname webutil getparameter columnname mfield mfield curtab getfield columnname formname formname columnname columnname mfield mfield tostring mfield formname columnname formname columnname webutil createtimeoutpage getmsg parametermissing curtab getvalue columnname formname columnname webdoc webdoc mfield getheader getbody setonblur addelement filltable mfield addelement setonclick _d addelement setonclick addelement aligntype addelement addelement addelement tostring webutil createresponse process the http post request perform do get param request param response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log config w account do post do get request response doget servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception waccount dopost doget fill table generic param ws window status param m field the field param target target field string return table with selection private table fill table w window status ws m field m field string target table table new table 1 tr line new tr line add element new th nbsp add element new th msg translate ws ctx name table add element line fill list options lookup lookup m field get lookup lookup fill combo box m field is mandatory false true true true no context check int size lookup get size for int i 0 i size i object l value lookup get element at i if l value null l value instanceof key name pair continue log fine l value to string key name pair np key name pair l value button button new button button add element gt string buffer script new string buffer target script append value append np get key append append target append d value append np get name append window close button set on click script to string line new tr line add element new td button string name np get name if name null name length 0 name nbsp line add element new td name table add element line restore lookup fill combo box true return table windowstatus mfield filltable wwindowstatus mfield mfield addelement addelement addelement mfield getlookup fillcombobox mfield ismandatory getsize lvalue getelementat lvalue lvalue keynamepair lvalue tostring keynamepair keynamepair lvalue addelement stringbuffer stringbuffer getkey _d getname setonclick tostring addelement getname addelement addelement fillcombobox get contsnts return contents public object get contents return contents getcontents execute method synchronously param parent parent param pi process info return result public static process info execute sync a sync process parent process info pi a sync worker worker new a sync worker parent pi worker start try worker join catch interrupted exception e log log level severe execute sync e return worker get result processinfo executesync asyncprocess processinfo asyncworker asyncworker interruptedexception executesync getresult constructor param parent parent process param pi process info public a sync worker a sync process parent process info pi m parent parent m pi pi asyncworker asyncprocess processinfo m_parent m_pi the worker method public void run swing utilities invoke later new runnable public void run m parent lockui m pi m parent executea sync m pi swing utilities invoke later new runnable public void run m parent unlockui m pi swingutilities invokelater m_parent m_pi m_parent executeasync m_pi swingutilities invokelater m_parent m_pi swing utilities invoke later new runnable public void run m parent lockui m pi swingutilities invokelater m_parent m_pi swing utilities invoke later new runnable public void run m parent unlockui m pi swingutilities invokelater m_parent m_pi get result usually not used as result is returned via unlockui return result public process info get result return m pi processinfo getresult m_pi base constructor param label label param value value public bar graph column string label double value m label label set value value add mouse listener this bargraphcolumn m_label setvalue addmouselistener single achievement constructor param achievement achievement public bar graph column m achievement achievement this achievement get name achievement get manual actual double value m achievement achievement bargraphcolumn machievement getname getmanualactual doublevalue m_achievement achievement goal constructor param goal goal param data count public bar graph column m goal goal big decimal data this data null 0 data double value m goal goal bargraphcolumn mgoal bigdecimal doublevalue m_goal measure calc constructor param mc measure calc public bar graph column m measure calc mc big decimal data this data null 0 data double value m mc mc measurecalc bargraphcolumn mmeasurecalc bigdecimal doublevalue m_mc request type constructor param rt request type public bar graph column m request type rt big decimal data int id this data null 0 data double value m rt rt m id id bargraphcolumn mrequesttype bigdecimal doublevalue m_rt m_id project type constructor param pt procet type public bar graph column m project type pt big decimal data int id this data null 0 data double value m pt pt m id id bargraphcolumn mprojecttype bigdecimal doublevalue m_pt m_id get achievement goal return achievement or null public m goal get goal return m goal mgoal getgoal m_goal get single achievement return achievement or null public m achievement get achievement return m achievement machievement getachievement m_achievement get measure calc return measure public m measure calc get measure calc return m mc measurecalc mmeasurecalc getmeasurecalc m_mc get measure calc public m request type get request type return m rt getmeasurecalc mrequesttype getrequesttype m_rt public m project type get project type return m pt mprojecttype getprojecttype m_pt public string get measure display return m measuredisplay get measure display getmeasuredisplay m_measuredisplay getmeasuredisplay get measure display public timestamp get date return m date get date getmeasuredisplay getdate m_date getdate get date public int getid return m id getdate m_id set background and matching foreground param bg background public void set background color bg super set background bg set foreground graph util get foreground bg setbackground setbackground setforeground graphutil getforeground return returns the label public string get label return m label getlabel m_label param label the label to set public void set label string label m label label if m label null m labelvalue s format format m value m label else m labelvalue s format format m value set tool tip text m labelvalue set name m labelvalue setlabel m_label m_label m_labelvalue s_format m_value m_label m_labelvalue s_format m_value settooltiptext m_labelvalue setname m_labelvalue param date for label param measure display measure display public void set label timestamp date string measure display if date null return m date date m measuredisplay measure display simple date format format display type get date format display type date string text format format date month only if m goal measuredisplay month equals measure display m goal measuredisplay quarter equals measure display string pattern format to pattern string mm text text int index pattern index of dd if index 0 dd mm yyyy mm text text substring 3 else if index 0 mm dd yyyy mm text text substring 0 index 1 if text length index 2 mm text text substring index 2 set label mm text else day set label text measuredisplay setlabel measuredisplay m_date m_measuredisplay measuredisplay simpledateformat displaytype getdateformat displaytype mgoal measuredisplay_month measuredisplay mgoal measuredisplay_quarter measuredisplay topattern mmtext indexof mmtext mmtext mmtext setlabel mmtext setlabel return returns the target value public double get target value return m targetvalue targetvalue gettargetvalue m_targetvalue param target value the target value to set public void set target value double target value m targetvalue target value targetvalue targetvalue settargetvalue targetvalue m_targetvalue targetvalue return returns the data value public double get value return m value getvalue m_value param value the data value to set public void set value double value m value value if m label null m labelvalue s format format m value m label else m labelvalue s format format m value set tool tip text m labelvalue set name m labelvalue setvalue m_value m_label m_labelvalue s_format m_value m_label m_labelvalue s_format m_value settooltiptext m_labelvalue setname m_labelvalue return returns the column width in pixles public double get col width return m width getcolwidth m_width param width the column width in pixles public void set col width double width m width width if is preferred size set set preferred size null setcolwidth m_width ispreferredsizeset setpreferredsize return returns the height in pixles public double get col height return m height getcolheight m_height param height the hight in pixles public void set col height double height m height height if is preferred size set set preferred size null setcolheight m_height ispreferredsizeset setpreferredsize get maximum size return size public dimension get maximum size return get preferred size getmaximumsize getpreferredsize get minimum size return size public dimension get minimum size return get preferred size getminimumsize getpreferredsize get preferred size return size public dimension get preferred size if is preferred size set dimension size new dimension int m width int m height set preferred size size return super get preferred size getpreferredsize ispreferredsizeset m_width m_height setpreferredsize getpreferredsize paint component param g graphics protected void paint component graphics g graphics2d g2d graphics2d g rectangle bounds get bounds background g2d set color get background dimension size get preferred size g2d fill3d rect 0 0 size width size height true paint label value color color get foreground g2d set paint color font font get font font metrics fm g2d get font metrics font int font height fm get height affine transform transform affine transform get rotate instance math pi 3 2 font font derive font transform g2d set font font int x int size width 2 font height 2 2 if x font height x font height 2 int y int size height 3 g2d draw string m labelvalue x y log finest x x font height font height y y m labelvalue paint target if m targetvalue 0 paintcomponent getbounds setcolor getbackground getpreferredsize fill3drect getforeground setpaint getfont fontmetrics getfontmetrics fontheight getheight affinetransform affinetransform getrotateinstance derivefont setfont fontheight fontheight fontheight drawstring m_labelvalue fontheight fontheight m_labelvalue m_targetvalue adds an code action listener code to the indicator param l the code action listener code to be added public void add action listener action listener l if l null listener list add action listener class l actionlistener actionlistener addactionlistener actionlistener listenerlist actionlistener removes an code action listener code from the indicator param l the listener to be removed public void remove action listener action listener l if l null listener list remove action listener class l actionlistener removeactionlistener actionlistener listenerlist actionlistener returns an array of all the code action listener code s added to this indicator with add action listener return all of the code action listener code s added or an empty array if no listeners have been added public action listener get action listeners return action listener listener list get listeners action listener class actionlistener addactionlistener actionlistener actionlistener getactionlisteners actionlistener listenerlist getlisteners actionlistener notifies all listeners that have registered interest for notification on this event type the event instance is lazily created using the code event code parameter param event the code action event code object see event listener list protected void fire action performed mouse event event guaranteed to return a non null array action listener listeners get action listeners action event e null process the listeners first to last for int i 0 i listeners length i lazily create the event if e null e new action event this action event action performed column m label event get when event get modifiers listeners i action performed e actionevent eventlistenerlist fireactionperformed mouseevent actionlistener getactionlisteners actionevent actionevent actionevent action_performed m_label getwhen getmodifiers actionperformed mouse clicked param e mouse event public void mouse clicked mouse event e if swing utilities is left mouse button e e get click count 1 fire action performed e mouseclicked mouseevent swingutilities isleftmousebutton getclickcount fireactionperformed mouse clicked public void mouse pressed mouse event e mouseclicked mousepressed mouseevent public void mouse released mouse event e mousereleased mouseevent public void mouse entered mouse event e mouseentered mouseevent public void mouse exited mouse event e mouseexited mouseevent standard constructor public x w advertisement properties ctx int w advertisement id string trx name super ctx w advertisement id trx name if w advertisement id 0 setad user id 0 1 setc bpartner id 0 set is self service true y set name null set publish status null u setw advertisement id 0 x_w_advertisement w_advertisement_id trxname w_advertisement_id trxname w_advertisement_id setad_user_id setc_bpartner_id setisselfservice setname setpublishstatus setw_advertisement_id load constructor public x w advertisement properties ctx result set rs string trx name super ctx rs trx name x_w_advertisement resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w advertisement append get id append return sb to string tostring stringbuffer stringbuffer x_w_advertisement get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set advertisement text text of the advertisement public void set ad text string ad text if ad text null ad text length 2000 log warning length 2000 truncated ad text ad text substring 0 1999 set value ad text ad text setadtext adtext adtext adtext adtext adtext set_value adtext adtext get advertisement text text of the advertisement public string get ad text return string get value ad text getadtext get_value adtext public static final int c bpartner id ad reference id 232 set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id c_bpartner_id_ad_reference_id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final string publishstatus void v set publication status status of publication public void set publish status string publish status if publish status null throw new illegal argument exception publish status is mandatory if publish status equals r publish status equals t publish status equals u publish status equals v else throw new illegal argument exception publish status invalid value publish status reference id 310 r t u v if publish status length 1 log warning length 1 truncated publish status publish status substring 0 0 set value publish status publish status publishstatus_void setpublishstatus publishstatus publishstatus illegalargumentexception publishstatus publishstatus publishstatus publishstatus publishstatus illegalargumentexception publishstatus publishstatus reference_id publishstatus publishstatus publishstatus set_value publishstatus publishstatus get publication status status of publication public string get publish status return string get value publish status getpublishstatus get_value publishstatus set valid from valid from including this date first day public void set valid from timestamp valid from set value valid from valid from setvalidfrom validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto set version version of the table definition public void set version int version set value version new integer version setversion set_value get version version of the table definition public int get version integer ii integer get value version if ii null return 0 return ii int value getversion get_value intvalue set advertisement web advertisement public void setw advertisement id int w advertisement id if w advertisement id 1 throw new illegal argument exception w advertisement id is mandatory set valuenocheck w advertisement id new integer w advertisement id setw_advertisement_id w_advertisement_id w_advertisement_id illegalargumentexception w_advertisement_id set_valuenocheck w_advertisement_id w_advertisement_id get advertisement web advertisement public int getw advertisement id integer ii integer get value w advertisement id if ii null return 0 return ii int value getw_advertisement_id get_value w_advertisement_id intvalue set click count web click management public void setw clickcount id int w clickcount id if w clickcount id 0 set value w clickcount id null else set value w clickcount id new integer w clickcount id setw_clickcount_id w_clickcount_id w_clickcount_id set_value w_clickcount_id set_value w_clickcount_id w_clickcount_id get click count web click management public int getw clickcount id integer ii integer get value w clickcount id if ii null return 0 return ii int value getw_clickcount_id get_value w_clickcount_id intvalue set counter count web counter count management public void setw countercount id int w countercount id if w countercount id 0 set value w countercount id null else set value w countercount id new integer w countercount id setw_countercount_id w_countercount_id w_countercount_id set_value w_countercount_id set_value w_countercount_id w_countercount_id get counter count web counter count management public int getw countercount id integer ii integer get value w countercount id if ii null return 0 return ii int value getw_countercount_id get_value w_countercount_id intvalue set web parameter 1 web site parameter 1 default header image public void set web param1 string web param1 if web param1 null web param1 length 2000 log warning length 2000 truncated web param1 web param1 substring 0 1999 set value web param1 web param1 setwebparam1 webparam1 webparam1 webparam1 webparam1 webparam1 set_value webparam1 webparam1 get web parameter 1 web site parameter 1 default header image public string get web param1 return string get value web param1 getwebparam1 get_value webparam1 set web parameter 2 web site parameter 2 default index page public void set web param2 string web param2 if web param2 null web param2 length 2000 log warning length 2000 truncated web param2 web param2 substring 0 1999 set value web param2 web param2 setwebparam2 webparam2 webparam2 webparam2 webparam2 webparam2 set_value webparam2 webparam2 get web parameter 2 web site parameter 2 default index page public string get web param2 return string get value web param2 getwebparam2 get_value webparam2 set web parameter 3 web site parameter 3 default left menu public void set web param3 string web param3 if web param3 null web param3 length 2000 log warning length 2000 truncated web param3 web param3 substring 0 1999 set value web param3 web param3 setwebparam3 webparam3 webparam3 webparam3 webparam3 webparam3 set_value webparam3 webparam3 get web parameter 3 web site parameter 3 default left menu public string get web param3 return string get value web param3 getwebparam3 get_value webparam3 set web parameter 4 web site parameter 4 default footer left public void set web param4 string web param4 if web param4 null web param4 length 2000 log warning length 2000 truncated web param4 web param4 substring 0 1999 set value web param4 web param4 setwebparam4 webparam4 webparam4 webparam4 webparam4 webparam4 set_value webparam4 webparam4 get web parameter 4 web site parameter 4 default footer left public string get web param4 return string get value web param4 getwebparam4 get_value webparam4 constructor requires call loadb partner param frame parent param window no window no public vb partner frame frame int window no super frame msg translate env get ctx c bpartner id true m windowno window no m readonly m role get default can update env getad client id env get ctx env getad org id env get ctx mb partner table id 0 false log info r o m readonly try jb init catch exception ex log log level severe ex get message initb partner a env position center window frame this loadbpartner windowno vbpartner windowno getctx c_bpartner_id m_windowno windowno m_readonly mrole getdefault canupdate getad_client_id getctx getad_org_id getctx mbpartner table_id m_readonly jbinit getmessage initbpartner aenv positioncenterwindow static init throws exception void jb init throws exception main panel set layout main layout south panel set layout south layout center panel set layout center layout main layout set vgap 5 get content pane add main panel main panel add center panel border layout center main panel add south panel border layout south south panel add confirm panel border layout center confirm panel add action listener this jbinit mainpanel setlayout mainlayout southpanel setlayout southlayout centerpanel setlayout centerlayout mainlayout setvgap getcontentpane mainpanel mainpanel centerpanel borderlayout mainpanel southpanel borderlayout southpanel confirmpanel borderlayout confirmpanel addactionlistener dynamic init private void initb partner get data m greeting fill greeting display m gbc anchor grid bag constraints northwest m gbc gridx 0 m gbc gridy 0 m gbc gridwidth 1 m gbc weightx 0 m gbc weighty 0 m gbc fill grid bag constraints horizontal m gbc ipadx 0 m gbc ipady 0 m line 0 value f value new v string value true false true 30 60 null f value add action listener this create line f value value true greeting business partner f greetingbp new j combo box m greeting create line f greetingbp greeting false name f name new v string name true false true 30 60 null f name add action listener this create line f name name false set font bold true name2 f name2 new v string name2 false false true 30 60 null create line f name2 name2 false contact f contact new v string contact false false true 30 60 null create line f contact contact true set font bold true greeting contact f greetingc new j combo box m greeting create line f greetingc greeting false title f title new v string title false false true 30 60 null create line f title title false email fe mail new v string e mail false false true 30 40 null create line fe mail e mail false location boolean ro m readonly if ro ro m role get default can update env getad client id env get ctx env getad org id env get ctx mb partner location table id 0 false if ro ro m role get default can update env getad client id env get ctx env getad org id env get ctx m location table id 0 false f address new v location c location id false ro true new m location lookup env get ctx m windowno f address set value null create line f address c location id true set font bold true phone f phone new v string phone false false true 30 40 null create line f phone phone true phone2 f phone2 new v string phone2 false false true 30 40 null create line f phone2 phone2 false fax f fax new v string fax false false true 30 40 null create line f fax fax false f name set background compiereplaf getfieldbackground mandatory f address set background compiereplaf getfieldbackground mandatory initbpartner m_greeting fillgreeting m_gbc gridbagconstraints m_gbc m_gbc m_gbc m_gbc m_gbc m_gbc gridbagconstraints m_gbc m_gbc m_line fvalue vstring fvalue addactionlistener createline fvalue fgreetingbp jcombobox m_greeting createline fgreetingbp fname vstring fname addactionlistener createline fname setfontbold fname2 vstring createline fname2 fcontact vstring createline fcontact setfontbold fgreetingc jcombobox m_greeting createline fgreetingc ftitle vstring createline ftitle femail vstring email createline femail email m_readonly mrole getdefault canupdate getad_client_id getctx getad_org_id getctx mbpartnerlocation table_id mrole getdefault canupdate getad_client_id getctx getad_org_id getctx mlocation table_id faddress vlocation c_location_id mlocationlookup getctx m_windowno faddress setvalue createline faddress c_location_id setfontbold fphone vstring createline fphone fphone2 vstring createline fphone2 ffax vstring createline ffax fname setbackground getfieldbackground_mandatory faddress setbackground getfieldbackground_mandatory create line param field field param title label value param add space add more space return label private c label create line j component field string title boolean add space if add space m gbc gridy m line m gbc gridx 1 m gbc insets m fieldinsets center panel add box create horizontal strut 6 m gbc line m gbc gridy m line label m gbc gridx 0 m gbc insets m labelinsets m gbc fill grid bag constraints horizontal c label label new c label msg translate env get ctx title center panel add label m gbc field m gbc gridx 1 m gbc insets m fieldinsets m gbc fill grid bag constraints horizontal center panel add field m gbc if m readonly field set enabled false return label addspace clabel createline jcomponent addspace addspace m_gbc m_line m_gbc m_gbc m_fieldinsets centerpanel createhorizontalstrut m_gbc m_gbc m_line m_gbc m_gbc m_labelinsets m_gbc gridbagconstraints clabel clabel getctx centerpanel m_gbc m_gbc m_gbc m_fieldinsets m_gbc gridbagconstraints centerpanel m_gbc m_readonly setenabled fill greeting return key name pair array of greetings private object fill greeting string sql select c greeting id name from c greeting where is active y order by 2 sql m role get default add accesssql sql c greeting m role sql notqualified m role sql ro return db get key name pairs sql true keynamepair fillgreeting c_greeting_id c_greeting isactive mrole getdefault addaccesssql c_greeting mrole sql_notqualified mrole sql_ro getkeynamepairs search m greeting for key param key c greeting id return greeting private key name pair get greeting int key for int i 0 i m greeting length i key name pair p key name pair m greeting i if p get key key return p return new key name pair 1 m_greeting c_greeting_id keynamepair getgreeting m_greeting keynamepair keynamepair m_greeting getkey keynamepair load b partner param c bpartner id existing b partner or 0 for new return true if loaded public boolean loadb partner int c bpartner id log config c bpartner id c bpartner id new bpartner if c bpartner id 0 m partner null m plocation null m user null return true m partner new mb partner env get ctx c bpartner id null if m partner get id 0 a dialog error m windowno this b partner not found return false b partner load values f value set text m partner get value f greetingbp set selected item get greeting m partner getc greeting id f name set text m partner get name f name2 set text m partner get name2 contact load values m plocation m partner get location env get context as int env get ctx m windowno c bpartner location id if m plocation null int location m plocation getc location id f address set value new integer location f phone set text m plocation get phone f phone2 set text m plocation get phone2 f fax set text m plocation get fax user load values m user m partner get contact env get context as int env get ctx m windowno ad user id if m user null f greetingc set selected item get greeting m user getc greeting id f contact set text m user get name f title set text m user get title fe mail set text m user gete mail f phone set text m user get phone f phone2 set text m user get phone2 f fax set text m user get fax return true bpartner c_bpartner_id bpartner loadbpartner c_bpartner_id c_bpartner_id c_bpartner_id c_bpartner_id m_partner m_plocation m_user m_partner mbpartner getctx c_bpartner_id m_partner get_id adialog m_windowno bpartnernotfound bpartner fvalue settext m_partner getvalue fgreetingbp setselecteditem getgreeting m_partner getc_greeting_id fname settext m_partner getname fname2 settext m_partner getname2 m_plocation m_partner getlocation getcontextasint getctx m_windowno c_bpartner_location_id m_plocation m_plocation getc_location_id faddress setvalue fphone settext m_plocation getphone fphone2 settext m_plocation getphone2 ffax settext m_plocation getfax m_user m_partner getcontact getcontextasint getctx m_windowno ad_user_id m_user fgreetingc setselecteditem getgreeting m_user getc_greeting_id fcontact settext m_user getname ftitle settext m_user gettitle femail settext m_user getemail fphone settext m_user getphone fphone2 settext m_user getphone2 ffax settext m_user getfax action listener param e event public void action performed action event e if m readonly dispose copy value else if e get source f value if f name get text null f name get text length 0 f name set text f value get text else if e get source f name if f contact get text null f contact get text length 0 f contact set text f name get text ok pressed else if e get action command equals confirm panel a ok action save dispose cancel pressed else if e get action command equals confirm panel a cancel dispose actionperformed actionevent m_readonly getsource fvalue fname gettext fname gettext fname settext fvalue gettext getsource fname fcontact gettext fcontact gettext fcontact settext fname gettext getactioncommand confirmpanel a_ok actionsave getactioncommand confirmpanel a_cancel save checks mandatory fields and saves partner contact and location return true if saved private boolean action save log config check mandatory fields if f name get text equals f name set background compiereplaf getfieldbackground error return false else f name set background compiereplaf getfieldbackground mandatory if f address getc location id 0 f address set background compiereplaf getfieldbackground error return false else f address set background compiereplaf getfieldbackground mandatory business partner if m partner null int ad client id env getad client id env get ctx m partner mb partner get template env get ctx ad client id boolean isso trx n equals env get context env get ctx m windowno isso trx m partner set is customer isso trx m partner set is vendor isso trx check value string value f value get text if value null value length 0 get table documet no value db get document no env getad client id env get ctx c bpartner null f value set text value m partner set value f value get text m partner set name f name get text m partner set name2 f name2 get text key name pair p key name pair f greetingbp get selected item if p null p get key 0 m partner setc greeting id p get key else m partner setc greeting id 0 if m partner save log fine c bpartner id m partner getc bpartner id else a dialog error m windowno this b partner not saved business partner location if m plocation null m plocation new mb partner location m partner m plocation setc location id f address getc location id m plocation set phone f phone get text m plocation set phone2 f phone2 get text m plocation set fax f fax get text if m plocation save log fine c bpartner location id m plocation getc bpartner location id else a dialog error m windowno this b partner not saved msg translate env get ctx c bpartner location id business partner user string contact f contact get text string email fe mail get text if m user null contact length 0 email length 0 m user new m user m partner if m user null if contact length 0 contact f name get text m user set name contact m user sete mail email m user set title f title get text p key name pair f greetingc get selected item if p null p get key 0 m user setc greeting id p get key else m user setc greeting id 0 m user set phone f phone get text m user set phone2 f phone2 get text m user set fax f fax get text if m user save log fine ad user id m user getad user id else a dialog error m windowno this b partner not saved msg translate env get ctx ad user id return true actionsave fname gettext fname setbackground getfieldbackground_error fname setbackground getfieldbackground_mandatory faddress getc_location_id faddress setbackground getfieldbackground_error faddress setbackground getfieldbackground_mandatory m_partner ad_client_id getad_client_id getctx m_partner mbpartner gettemplate getctx ad_client_id issotrx getcontext getctx m_windowno issotrx m_partner setiscustomer issotrx m_partner setisvendor issotrx fvalue gettext getdocumentno getad_client_id getctx c_bpartner fvalue settext m_partner setvalue fvalue gettext m_partner setname fname gettext m_partner setname2 fname2 gettext keynamepair keynamepair fgreetingbp getselecteditem getkey m_partner setc_greeting_id getkey m_partner setc_greeting_id m_partner c_bpartner_id m_partner getc_bpartner_id adialog m_windowno bpartnernotsaved m_plocation m_plocation mbpartnerlocation m_partner m_plocation setc_location_id faddress getc_location_id m_plocation setphone fphone gettext m_plocation setphone2 fphone2 gettext m_plocation setfax ffax gettext m_plocation c_bpartner_location_id m_plocation getc_bpartner_location_id adialog m_windowno bpartnernotsaved getctx c_bpartner_location_id fcontact gettext femail gettext m_user m_user muser m_partner m_user fname gettext m_user setname m_user setemail m_user settitle ftitle gettext keynamepair fgreetingc getselecteditem getkey m_user setc_greeting_id getkey m_user setc_greeting_id m_user setphone fphone gettext m_user setphone2 fphone2 gettext m_user setfax ffax gettext m_user ad_user_id m_user getad_user_id adialog m_windowno bpartnernotsaved getctx ad_user_id returns b partner id return c bpartner id 0 not saved public int getc bpartner id if m partner null return 0 return m partner getc bpartner id bpartner c_bpartner_id getc_bpartner_id m_partner m_partner getc_bpartner_id standard constructor param ctx context param m requisition id id public m requisition properties ctx int m requisition id string trx name super ctx m requisition id trx name if m requisition id 0 set document no null setad user id 0 setm pricelist id 0 setm warehouse id 0 set date doc new timestamp system current time millis set date required new timestamp system current time millis set doc action doc action action complete co set doc status doc action status drafted dr set priority rule priorityrule medium 5 set total lines env zero set is approved false set posted false set processed false m_requisition_id mrequisition m_requisition_id trxname m_requisition_id trxname m_requisition_id setdocumentno setad_user_id setm_pricelist_id setm_warehouse_id setdatedoc currenttimemillis setdaterequired currenttimemillis setdocaction docaction action_complete setdocstatus docaction status_drafted setpriorityrule priorityrule_medium settotallines setisapproved setposted setprocessed load constructor param ctx context param rs result set public m requisition properties ctx result set rs string trx name super ctx rs trx name mrequisition resultset trxname trxname get lines return array of lines public m requisition line get lines if m lines null return m lines array list m requisition line list new array list m requisition line string sql select from m requisitionline where m requisition id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm requisition id result set rs pstmt execute query while rs next list add new m requisition line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m requisition line list size list to array m lines return m lines mrequisitionline getlines m_lines m_lines arraylist mrequisitionline arraylist mrequisitionline m_requisitionline m_requisition_id preparedstatement preparestatement get_trxname setint getm_requisition_id resultset executequery mrequisitionline getctx get_trxname getlines m_lines mrequisitionline toarray m_lines m_lines string representation return info public string to string string buffer sb new string buffer m requisition sb append get id append append get document no append status append get doc status append action append get doc action append return sb to string tostring stringbuffer stringbuffer mrequisition get_id getdocumentno getdocstatus getdocaction tostring get document info return document info public string get document info return msg get element get ctx m requisition id get document no getdocumentinfo getelement getctx m_requisition_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id set default price list public void setm pricelist id m price list defaultpl m price list get default get ctx false if defaultpl null defaultpl m price list get default get ctx true if defaultpl null setm pricelist id defaultpl getm pricelist id pricelist setm_pricelist_id mpricelist mpricelist getdefault getctx mpricelist getdefault getctx setm_pricelist_id getm_pricelist_id before save param new record new return true protected boolean before save boolean new record if getm pricelist id 0 setm pricelist id return true newrecord beforesave newrecord getm_pricelist_id setm_pricelist_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string return true invalidateit invalidateit tostring prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m requisition line lines get lines invalid if getad user id 0 getm pricelist id 0 getm warehouse id 0 lines length 0 return doc action status invalid std period open if m period is open get ctx get date doc m doc type docbasetype purchaserequisition m processmsg period closed return doc action status invalid add up amounts int precision m price list get standard precision get ctx getm pricelist id big decimal total lines env zero for int i 0 i lines length i m requisition line line lines i big decimal line net line get qty multiply line get price actual line net line net set scale precision big decimal round half up if line net compare to line get line net amt 0 line set line net amt line net line save total lines total lines add line get line net amt if total lines compare to get total lines 0 set total lines total lines save m justprepared true return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mrequisitionline getlines getad_user_id getm_pricelist_id getm_warehouse_id docaction status_invalid mperiod isopen getctx getdatedoc mdoctype docbasetype_purchaserequisition m_processmsg periodclosed docaction status_invalid mpricelist getstandardprecision getctx getm_pricelist_id bigdecimal totallines mrequisitionline bigdecimal linenet getqty getpriceactual linenet linenet setscale bigdecimal round_half_up linenet compareto getlinenetamt setlinenetamt linenet totallines totallines getlinenetamt totallines compareto gettotallines settotallines totallines m_justprepared docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action action close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction action_close docaction status_completed void document same as close return true if success public boolean void it log info void it to string return close it voidit voidit tostring closeit close document cancel not delivered qunatities return true if success public boolean close it log info close it to string close not delivered qty m requisition line lines get lines big decimal total lines env zero for int i 0 i lines length i m requisition line line lines i big decimal final qty line get qty if line getc orderline id 0 final qty env zero else m order line ol new m order line get ctx line getc orderline id get trxname final qty ol get qty ordered final qty is not line qty if final qty compare to line get qty 0 string description line get description if description null description description line get qty line set description description line set qty final qty line set line net amt line save total lines total lines add line get line net amt if total lines compare to get total lines 0 set total lines total lines save return true closeit closeit tostring mrequisitionline getlines bigdecimal totallines mrequisitionline bigdecimal finalqty getqty getc_orderline_id finalqty morderline morderline getctx getc_orderline_id get_trxname finalqty getqtyordered finalqty compareto getqty getdescription getqty setdescription setqty finalqty setlinenetamt totallines totallines getlinenetamt totallines compareto gettotallines settotallines totallines reverse correction return true if success public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual none return true if success public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return true if success public boolean re activate it log info re activate it to string set processed false if reverse correct it return true return false reactivateit reactivateit tostring setprocessed reversecorrectit get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no user sb append append get user name total lines 123 00 1 sb append append msg translate get ctx total lines append append get total lines append append get lines length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getusername getctx totallines gettotallines getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner return ad user id public int getdoc user id return getad user id ad_user_id getdoc_user_id getad_user_id get document currency return c currency id public int getc currency id m price list pl m price list get get ctx getm pricelist id get trxname return pl getc currency id c_currency_id getc_currency_id mpricelist mpricelist getctx getm_pricelist_id get_trxname getc_currency_id get document approval amount return amount public big decimal get approval amt return get total lines bigdecimal getapprovalamt gettotallines get user name return user name public string get user name return m user get get ctx getad user id get name getusername muser getctx getad_user_id getname standard constructor public x gl category properties ctx int gl category id string trx name super ctx gl category id trx name if gl category id 0 set category type null m setgl category id 0 set is default false set name null x_gl_category gl_category_id trxname gl_category_id trxname gl_category_id setcategorytype setgl_category_id setisdefault setname load constructor public x gl category properties ctx result set rs string trx name super ctx rs trx name x_gl_category resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl category append get id append return sb to string tostring stringbuffer stringbuffer x_gl_category get_id tostring public static final string categorytype systemgenerated s set category type source of the journal with this category public void set category type string category type if category type null throw new illegal argument exception category type is mandatory if category type equals d category type equals i category type equals m category type equals s else throw new illegal argument exception category type invalid value category type reference id 207 d i m s if category type length 1 log warning length 1 truncated category type category type substring 0 0 set value category type category type categorytype_systemgenerated setcategorytype categorytype categorytype illegalargumentexception categorytype categorytype categorytype categorytype categorytype illegalargumentexception categorytype categorytype reference_id categorytype categorytype categorytype set_value categorytype categorytype get category type source of the journal with this category public string get category type return string get value category type getcategorytype get_value categorytype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gl category general ledger category public void setgl category id int gl category id if gl category id 1 throw new illegal argument exception gl category id is mandatory set valuenocheck gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id illegalargumentexception gl_category_id set_valuenocheck gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x m demand properties ctx int m demand id string trx name super ctx m demand id trx name if m demand id 0 setc calendar id 0 setc year id 0 set is default false setm demand id 0 set name null x_m_demand m_demand_id trxname m_demand_id trxname m_demand_id setc_calendar_id setc_year_id setisdefault setm_demand_id setname load constructor public x m demand properties ctx result set rs string trx name super ctx rs trx name x_m_demand resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m demand append get id append return sb to string tostring stringbuffer stringbuffer x_m_demand get_id tostring set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set valuenocheck c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_valuenocheck c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set year calendar year public void setc year id int c year id if c year id 1 throw new illegal argument exception c year id is mandatory set valuenocheck c year id new integer c year id setc_year_id c_year_id c_year_id illegalargumentexception c_year_id set_valuenocheck c_year_id c_year_id get year calendar year public int getc year id integer ii integer get value c year id if ii null return 0 return ii int value getc_year_id get_value c_year_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set demand material demand public void setm demand id int m demand id if m demand id 1 throw new illegal argument exception m demand id is mandatory set valuenocheck m demand id new integer m demand id setm_demand_id m_demand_id m_demand_id illegalargumentexception m_demand_id set_valuenocheck m_demand_id m_demand_id get demand material demand public int getm demand id integer ii integer get value m demand id if ii null return 0 return ii int value getm_demand_id get_value m_demand_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue create one package for shipment param shipment shipment param shipper shipper param ship date null for today return package public static m package create m in out shipment m shipper shipper timestamp ship date m package ret value new m package shipment shipper if ship date null ret value set ship date ship date ret value save lines m in out line lines shipment get lines false for int i 0 i lines length i m in out line s line lines i m package line p line new m package line ret value p line set in out line s line p line save lines return ret value shipdate mpackage minout mshipper shipdate mpackage retvalue mpackage shipdate retvalue setshipdate shipdate retvalue minoutline getlines minoutline sline mpackageline pline mpackageline retvalue pline setinoutline sline pline retvalue m package param ctx context param m package id od public m package properties ctx int m package id string trx name super ctx m package id trx name if m package id 0 setm shipper id 0 set document no null setm inout id 0 set ship date new timestamp system current time millis mpackage m_package_id mpackage m_package_id trxname m_package_id trxname m_package_id setm_shipper_id setdocumentno setm_inout_id setshipdate currenttimemillis load constructor param ctx context param rs result set public m package properties ctx result set rs string trx name super ctx rs trx name mpackage resultset trxname trxname shipment constructor param shipment shipment param shipper shipper public m package m in out shipment m shipper shipper this shipment get ctx 0 shipment get trxname set client org shipment setm inout id shipment getm inout id setm shipper id shipper getm shipper id mpackage minout mshipper getctx get_trxname setclientorg setm_inout_id getm_inout_id setm_shipper_id getm_shipper_id initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception asset servlet init servletexception servletconfig servletexception webenv initweb servletexception assetservlet get servlet information return info public string get servlet info return a dempiere web assets servlet getservletinfo adempiere clean up resources public void destroy log fine process the http get request logout delete cookie sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info get from request get remote host request get remote addr properties ctx jsp env get ctx request http session session request get session false string url assets jsp if session null session get attribute info name null session get attribute web user name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter asset id if invoice is valid and belongs to wu then create pdf stream it string msg stream asset request response if info null info set message msg parse translation ctx msg if msg null ok msg length 0 msg starts with if not returned results in exception cannot forward after response has been committed return log info forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response deletecookie servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception getremotehost getremoteaddr jspenv getctx httpsession getsession getattribute getattribute webuser removeattribute websessionctx hdr_message getattribute setmessage asset_id streamasset setmessage parsetranslation startswith requestdispatcher getservletcontext getrequestdispatcher process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception do get request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception doget stream asset param request request param response response return or error message protected string stream asset http servlet request request http servlet response response get asset id int a asset id web util get parameter as int request asset id if a asset id 0 log fine no id return no asset id byte asset info string value of a asset id get bytes get asset properties ctx jsp env get ctx request http session session request get session true web env dump request m asset asset new m asset ctx a asset id null if asset geta asset id a asset id log fine asset not found id a asset id return asset not found get web user compare with invoice web user wu web user session get attribute web user name if wu getc bpartner id asset getc bpartner id log warning a asset id a asset id bp invoice asset getc bpartner id bp user wu getc bpartner id return your asset not found if asset is downloadable wu is credit stop hold wu ise mail verified return asset not downloadable name url string pd web util get parameter request pd string dl name null string dl url null input stream in null int m productdownload id 0 if pd null pd length 0 m product download pdls asset get product downloads if pdls null for int i 0 i pdls length i if pdls i get downloadurl index of pd 1 m productdownload id pdls i getm productdownload id dl name pd dl url pdls i get downloadurl in pdls i get download stream ctx get property web session ctx ctx document dir break log fine dl name dl url if dl name null dl url null in null return not found a asset id pd download support contract pdf for jorg janke jjanke compiere org version 120 lot ser no guarantee date 5 30 05 thank you for using compiere customer asset management string lot asset get lot if lot null lot length 0 lot string ser asset get ser no if ser null ser length 0 ser object args new object dl name wu get name wu get email asset get version no lot ser asset get guarantee date string readme msg get msg ctx asset delivery template args send file m asset delivery ad asset confirm delivery request wu getad user id if m productdownload id 0 ad setm productdownload id m productdownload id ad set description dl name float speed 0 try response set content type application zip response set header content location asset zip response set content length length int buffer size 2048 2k buffer response set buffer size buffer size log fine in available in available long time system current time millis zip output stream servlet output stream out response get output stream zip output stream zip new zip output stream out servlet out zip set method zip output stream deflated zip set level deflater best compression zip set comment readme readme file zip entry entry new zip entry readme txt entry set extra asset info zip put next entry entry zip write readme get bytes 0 readme length zip close entry payload entry new zip entry dl name entry set extra asset info zip put next entry entry byte buffer new byte buffer size int count 0 int total size 0 do count in read buffer 0 buffer size read delivery if count 0 total size count zip write buffer 0 count write zip while count 1 zip close entry fini zip finish zip close in close time system current time millis time speed float total size 1024 float time 1000 string msg total size 1024 kb time ms speed kb sec log fine msg delivery record ad set delivery confirmation msg ad save asset save catch io exception ex string msg ex get message if msg null msg length 0 msg ex to string log warning msg delivery record try if msg length 120 msg msg substring 0 119 ad set delivery confirmation msg ad save asset save not delivered catch exception ex1 log log level severe 2 ex nned to differentiate error message as response committed return streaming error please retry return null streamasset httpservletrequest httpservletresponse a_asset_id webutil getparameterasint asset_id a_asset_id assetinfo valueof a_asset_id getbytes jspenv getctx httpsession getsession webenv masset masset a_asset_id geta_asset_id a_asset_id a_asset_id webuser webuser webuser getattribute webuser getc_bpartner_id getc_bpartner_id a_asset_id a_asset_id bp_invoice getc_bpartner_id bp_user getc_bpartner_id isdownloadable iscreditstophold isemailverified webutil getparameter dl_name dl_url inputstream m_productdownload_id mproductdownload getproductdownloads getdownloadurl indexof m_productdownload_id getm_productdownload_id dl_name dl_url getdownloadurl getdownloadstream getproperty websessionctx ctx_document_dir dl_name dl_url dl_name dl_url notfound a_asset_id supportcontract serno getlot getserno dl_name getname getemail getversionno getguaranteedate getmsg assetdeliverytemplate massetdelivery confirmdelivery getad_user_id m_productdownload_id setm_productdownload_id m_productdownload_id setdescription dl_name setcontenttype setheader setcontentlength buffersize setbuffersize buffersize currenttimemillis servletoutputstream getoutputstream zipoutputstream zipoutputstream setmethod zipoutputstream setlevel best_compression setcomment zipentry zipentry setextra assetinfo putnextentry getbytes closeentry zipentry dl_name setextra assetinfo putnextentry buffersize totalsize buffersize totalsize closeentry currenttimemillis totalsize totalsize setdeliveryconfirmation ioexception getmessage tostring setdeliveryconfirmation standard constructor public x m discountschemabreak properties ctx int m discountschemabreak id string trx name super ctx m discountschemabreak id trx name if m discountschemabreak id 0 set break discount env zero set break value env zero set isb partner flat discount false n setm discountschemabreak id 0 setm discountschema id 0 set seq no 0 sql select nvl max seq no 0 10 as default value from m discountschemabreak where m discountschema id m discountschema id x_m_discountschemabreak m_discountschemabreak_id trxname m_discountschemabreak_id trxname m_discountschemabreak_id setbreakdiscount setbreakvalue setisbpartnerflatdiscount setm_discountschemabreak_id setm_discountschema_id setseqno seqno defaultvalue m_discountschemabreak m_discountschema_id m_discountschema_id load constructor public x m discountschemabreak properties ctx result set rs string trx name super ctx rs trx name x_m_discountschemabreak resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m discountschemabreak append get id append return sb to string tostring stringbuffer stringbuffer x_m_discountschemabreak get_id tostring set break discount trade discount in percent for the break level public void set break discount big decimal break discount if break discount null throw new illegal argument exception break discount is mandatory set value break discount break discount setbreakdiscount bigdecimal breakdiscount breakdiscount illegalargumentexception breakdiscount set_value breakdiscount breakdiscount get break discount trade discount in percent for the break level public big decimal get break discount big decimal bd big decimal get value break discount if bd null return env zero return bd bigdecimal getbreakdiscount bigdecimal bigdecimal get_value breakdiscount set break value low value of trade discount break level public void set break value big decimal break value if break value null throw new illegal argument exception break value is mandatory set value break value break value setbreakvalue bigdecimal breakvalue breakvalue illegalargumentexception breakvalue set_value breakvalue breakvalue get break value low value of trade discount break level public big decimal get break value big decimal bd big decimal get value break value if bd null return env zero return bd bigdecimal getbreakvalue bigdecimal bigdecimal get_value breakvalue set b partner flat discount use flat discount defined on business partner level public void set isb partner flat discount boolean isb partner flat discount set value isb partner flat discount new boolean isb partner flat discount setisbpartnerflatdiscount isbpartnerflatdiscount set_value isbpartnerflatdiscount isbpartnerflatdiscount get b partner flat discount use flat discount defined on business partner level public boolean isb partner flat discount object oo get value isb partner flat discount if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbpartnerflatdiscount get_value isbpartnerflatdiscount booleanvalue set discount schema break trade discount break public void setm discountschemabreak id int m discountschemabreak id if m discountschemabreak id 1 throw new illegal argument exception m discountschemabreak id is mandatory set valuenocheck m discountschemabreak id new integer m discountschemabreak id setm_discountschemabreak_id m_discountschemabreak_id m_discountschemabreak_id illegalargumentexception m_discountschemabreak_id set_valuenocheck m_discountschemabreak_id m_discountschemabreak_id get discount schema break trade discount break public int getm discountschemabreak id integer ii integer get value m discountschemabreak id if ii null return 0 return ii int value getm_discountschemabreak_id get_value m_discountschemabreak_id intvalue set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 1 throw new illegal argument exception m discountschema id is mandatory set valuenocheck m discountschema id new integer m discountschema id setm_discountschema_id m_discountschema_id m_discountschema_id illegalargumentexception m_discountschema_id set_valuenocheck m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno standard constructor param ctx ctx param c taxdeclarationline id id param trx name trx public m tax declaration line properties ctx int c taxdeclarationline id string trx name super ctx c taxdeclarationline id trx name if c taxdeclarationline id 0 set is manual true set tax amt env zero set tax base amt env zero c_taxdeclarationline_id trxname mtaxdeclarationline c_taxdeclarationline_id trxname c_taxdeclarationline_id trxname c_taxdeclarationline_id setismanual settaxamt settaxbaseamt load constructor param ctx context param rs rs param trx name trx public m tax declaration line properties ctx result set rs string trx name super ctx rs trx name trxname mtaxdeclarationline resultset trxname trxname parent constructor param parent parent param invoice invoice param i line invoice line public m tax declaration line m tax declaration parent m invoice invoice m invoice line i line this parent get ctx 0 parent get trxname set client org invoice setc taxdeclaration id parent getc taxdeclaration id set is manual false setc invoice id invoice getc invoice id setc bpartner id invoice getc bpartner id setc currency id invoice getc currency id set date acct invoice get date acct setc invoiceline id i line getc invoiceline id setc tax id i line getc tax id if invoice is tax included set tax base amt i line get line net amt set tax amt i line get tax amt else set tax base amt i line get line net amt set tax amt i line get tax amt iline mtaxdeclarationline mtaxdeclaration minvoice minvoiceline iline getctx get_trxname setclientorg setc_taxdeclaration_id getc_taxdeclaration_id setismanual setc_invoice_id getc_invoice_id setc_bpartner_id getc_bpartner_id setc_currency_id getc_currency_id setdateacct getdateacct setc_invoiceline_id iline getc_invoiceline_id setc_tax_id iline getc_tax_id istaxincluded settaxbaseamt iline getlinenetamt settaxamt iline gettaxamt settaxbaseamt iline getlinenetamt settaxamt iline gettaxamt parent constructor param parent parent param invoice invoice param t line tax line public m tax declaration line m tax declaration parent m invoice invoice m invoice tax t line this parent get ctx 0 parent get trxname set client org invoice setc taxdeclaration id parent getc taxdeclaration id set is manual false setc invoice id invoice getc invoice id setc bpartner id invoice getc bpartner id setc currency id invoice getc currency id set date acct invoice get date acct setc tax id t line getc tax id set tax base amt t line get tax base amt set tax amt t line get tax amt tline mtaxdeclarationline mtaxdeclaration minvoice minvoicetax tline getctx get_trxname setclientorg setc_taxdeclaration_id getc_taxdeclaration_id setismanual setc_invoice_id getc_invoice_id setc_bpartner_id getc_bpartner_id setc_currency_id getc_currency_id setdateacct getdateacct setc_tax_id tline getc_tax_id settaxbaseamt tline gettaxbaseamt settaxamt tline gettaxamt prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals m product id p m product id para i get parameter as int else if name equals m product to id p m product to id para i get parameter as int else if name equals m locator id p m locator id para i get parameter as int else if name equals qty p qty big decimal para i get parameter else log log level severe unknown parameter name processinfoparameter getparameter getparametername getparameter m_product_id p_m_product_id getparameterasint m_product_to_id p_m_product_to_id getparameterasint m_locator_id p_m_locator_id getparameterasint p_qty bigdecimal getparameter process return message throws exception protected string do it throws exception if p m product id 0 p m product to id 0 p m locator id 0 p qty null env zero compare to p qty 0 throw new compiere user error invalid parameter m product product m product get get ctx p m product id m product product to m product get get ctx p m product to id log info product product product to product to m locator id p m locator id qty p qty muom conversion conversions muom conversion get product conversions get ctx product getm product id muom conversion conversion null for int i 0 i conversions length i if conversions i getc uom to id product to getc uom id conversion conversions i if conversion null throw new compiere user error not found c uom conversion id muom uom to muom get get ctx product to getc uom id big decimal qty to p qty divide conversion get divide rate uom to get std precision big decimal round half up big decimal qty to6 p qty divide conversion get divide rate 6 big decimal round half up if qty to compare to qty to6 0 throw new compiere user error std precision qty to qty to6 p qty conversion get divide rate log info conversion qty to set to beta return not completed yet doit p_m_product_id p_m_product_to_id p_m_locator_id p_qty compareto p_qty compiereusererror mproduct mproduct getctx p_m_product_id mproduct productto mproduct getctx p_m_product_to_id productto productto m_locator_id p_m_locator_id p_qty muomconversion muomconversion getproductconversions getctx getm_product_id muomconversion getc_uom_to_id productto getc_uom_id compiereusererror notfound c_uom_conversion_id uomto getctx productto getc_uom_id bigdecimal qtyto p_qty getdividerate uomto getstdprecision bigdecimal round_half_up bigdecimal qtyto6 p_qty getdividerate bigdecimal round_half_up qtyto compareto qtyto6 compiereusererror stdprecision qtyto qtyto6 p_qty getdividerate qtyto return map for sybase return tree map with pattern as key and the replacement as value public static tree map get sybase map if s sybase size 0 init sybase return s sybase treemap treemap getsybasemap s_sybase initsybase s_sybase return map for postgresql return tree map with pattern as key and the replacement as value public static tree map get postgesql map if s pg size 0 init postgresql return s pg treemap treemap getpostgesqlmap s_pg initpostgresql s_pg sybase init static private void init sybase oracle pattern replacement data types s sybase put bnumber b numeric s sybase put bdate b datetime s sybase put bvarchar2 b varchar s sybase put bnvarchar2 b nvarchar s sybase put bnchar b nchar s sybase put bblob b image s sybase put bclob b text storage s sybase put bcache b s sybase put busing index b s sybase put btablespace s w b s sybase put bstorage w s s sybase put bbitmap index b index select s sybase put bfor update b s sybase put btrunc convert date functions s sybase put b sys date b getdate s sybase put bsysdate b getdate s sybase put bnvl b coalesce s sybase put bto date b to timestamp s sybase put bdbms output put line b raise notice temporary s sybase put bglobal temporary b temporary s sybase put bon commit delete rows b s sybase put bon commit preserve rows b drop table x cascade constraints s sybase put bcascade constraints b select s sybase put sfrom s dual b statements s sybase put belsif b else if sequences s sybase put bstart with b start s sybase put bincrement by b increment initsybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase bsysdate s_sybase s_sybase s_sybase bto_date to_timestamp s_sybase bdbms_output put_line s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase s_sybase postgresql init static private void init postgresql oracle pattern replacement data types s pg put bnumber b numeric s pg put bdate b timestamp s pg put bvarchar2 b varchar s pg put bnvarchar2 b varchar s pg put bnchar b char begin vpj cd e evolution 03 11 2005 postgresql s pg put bblob b bytea blob not directly supported s pg put bclob b bytea clob not directly supported s pg put blimit b limit s pg put baction b action s pg put bblob b oid blob not directly supported s pg put bclob b oid clob not directly supported end vpj cd e evolution 03 11 2005 postgresql storage s pg put bcache b s pg put busing index b s pg put btablespace s w b s pg put bstorage w s s pg put bbitmap index b index functions s pg put bsysdate b current timestamp alternative now bug fix gunther hoppe 08 07 2005 e evolution begin s pg put b sys date b current timestamp s pg put sys date current timestamp end begin vpj cd e evolution 03 11 2005 postgresql s pg put bdump b md5 s pg put end case end s pg put bget date b current timestamp alternative now end vpj cd e evolution 03 11 2005 postgresql s pg put bnvl b coalesce s pg put bto date b to timestamp s pg put bdbms output put line b raise notice temporary s pg put bglobal temporary b temporary s pg put bon commit delete rows b s pg put bon commit preserve rows b ddl begin vpj cd e evolution 08 02 2005 postgresql s pg put bmodify b alter column s pg put bdefault b set default end vpj cd e evolution 08 02 2005 postgresql drop table x cascade constraints s pg put bcascade constraints b select s pg put sfrom s dual b statements s pg put belsif b else if begin vpj cd e evolution 03 11 2005 postgresql s pg put brec b as rec s pg put band srownum b limit end vpj cd e evolution 03 11 2005 postgresql sequences s pg put bstart with b start s pg put bincrement by b increment initpostgresql s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg current_timestamp s_pg bsysdate current_timestamp s_pg sysdate current_timestamp s_pg s_pg s_pg bgetdate current_timestamp s_pg s_pg bto_date to_timestamp s_pg bdbms_output put_line s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg s_pg basic constructor you need to set the attributes using the set methods public span use the set methods to set the values of the attributes param value set the value of lt span gt value lt span gt public span string value add element value addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public span add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public span add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public span add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public span add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public span remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x b sellerfunds properties ctx int b sellerfunds id string trx name super ctx b sellerfunds id trx name if b sellerfunds id 0 setad user id 0 setb sellerfunds id 0 set committed amt env zero set non committed amt env zero x_b_sellerfunds b_sellerfunds_id trxname b_sellerfunds_id trxname b_sellerfunds_id setad_user_id setb_sellerfunds_id setcommittedamt setnoncommittedamt load constructor public x b sellerfunds properties ctx result set rs string trx name super ctx rs trx name x_b_sellerfunds resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b sellerfunds append get id append return sb to string tostring stringbuffer stringbuffer x_b_sellerfunds get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id set seller funds seller funds from offers on topics public void setb sellerfunds id int b sellerfunds id if b sellerfunds id 1 throw new illegal argument exception b sellerfunds id is mandatory set valuenocheck b sellerfunds id new integer b sellerfunds id setb_sellerfunds_id b_sellerfunds_id b_sellerfunds_id illegalargumentexception b_sellerfunds_id set_valuenocheck b_sellerfunds_id b_sellerfunds_id get seller funds seller funds from offers on topics public int getb sellerfunds id integer ii integer get value b sellerfunds id if ii null return 0 return ii int value getb_sellerfunds_id get_value b_sellerfunds_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set committed amount the legal commitment amount public void set committed amt big decimal committed amt if committed amt null throw new illegal argument exception committed amt is mandatory set value committed amt committed amt setcommittedamt bigdecimal committedamt committedamt illegalargumentexception committedamt set_value committedamt committedamt get committed amount the legal commitment amount public big decimal get committed amt big decimal bd big decimal get value committed amt if bd null return env zero return bd bigdecimal getcommittedamt bigdecimal bigdecimal get_value committedamt set not committed aount amount not committed yet public void set non committed amt big decimal non committed amt if non committed amt null throw new illegal argument exception non committed amt is mandatory set value non committed amt non committed amt setnoncommittedamt bigdecimal noncommittedamt noncommittedamt illegalargumentexception noncommittedamt set_value noncommittedamt noncommittedamt get not committed aount amount not committed yet public big decimal get non committed amt big decimal bd big decimal get value non committed amt if bd null return env zero return bd bigdecimal getnoncommittedamt bigdecimal bigdecimal get_value noncommittedamt constructor param frame parent param m assignment optional assignment param create new if true allows to create new assignments public info schedule frame frame m resource assignment m assignment boolean create new super frame msg get msg env get ctx info schedule frame null create new if m assignment null m massignment new m resource assignment env get ctx 0 null else m massignment m assignment if m assignment null log info m assignment to string m datefrom m massignment get assign date from if m datefrom null m datefrom new timestamp system current time millis m createnew create new try jb init dyn init create new catch exception ex log log level severe info schedule ex a env show center window frame this massignment createnew infoschedule mresourceassignment massignment createnew getmsg getctx infoschedule createnew massignment m_massignment mresourceassignment getctx m_massignment massignment massignment massignment tostring m_datefrom m_massignment getassigndatefrom m_datefrom m_datefrom currenttimemillis m_createnew createnew jbinit dyninit createnew infoschedule aenv showcenterwindow ide constructor public info schedule this null null false infoschedule static layout throws exception private void jb init throws exception main panel set layout main layout parameter panel set layout parameter layout label resource type set horizontal text position swing constants leading label resource type set text msg translate env get ctx s resourcetype id label resource set horizontal text position swing constants leading label resource set text msg translate env get ctx s resource id b previous set margin new insets 0 0 0 0 b previous set text label date set text msg translate env get ctx date b next set margin new insets 0 0 0 0 b next set text get content pane add main panel border layout center main panel add parameter panel border layout north parameter panel add label resource type new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 8 8 0 0 0 0 parameter panel add field resource type new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 8 8 4 0 0 parameter panel add label resource new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 8 4 0 4 0 0 parameter panel add field resource new grid bag constraints 1 1 1 1 0 5 0 0 grid bag constraints center grid bag constraints horizontal new insets 0 0 8 4 0 0 parameter panel add b previous new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 0 8 8 0 0 0 parameter panel add label date new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 8 0 0 0 0 0 parameter panel add field date new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 0 0 8 0 0 0 parameter panel add b next new grid bag constraints 4 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 0 0 8 8 0 0 main panel add new j scroll pane time pane border layout center time pane add day schedule msg get msg env get ctx day time pane add week schedule msg get msg env get ctx week time pane add month schedule msg get msg env get ctx month time pane add day schedule msg get msg env get ctx day time pane add week schedule msg get msg env get ctx week time pane add month schedule msg get msg env get ctx month time pane add change listener this main panel add confirm panel border layout south this get content pane add status bar border layout south jbinit mainpanel setlayout mainlayout parameterpanel setlayout parameterlayout labelresourcetype sethorizontaltextposition swingconstants labelresourcetype settext getctx s_resourcetype_id labelresource sethorizontaltextposition swingconstants labelresource settext getctx s_resource_id bprevious setmargin bprevious settext labeldate settext getctx bnext setmargin bnext settext getcontentpane mainpanel borderlayout mainpanel parameterpanel borderlayout parameterpanel labelresourcetype gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldresourcetype gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labelresource gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fieldresource gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel bprevious gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel labeldate gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel fielddate gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel bnext gridbagconstraints gridbagconstraints gridbagconstraints mainpanel jscrollpane timepane borderlayout timepane dayschedule getmsg getctx timepane weekschedule getmsg getctx timepane monthschedule getmsg getctx timepane dayschedule getmsg getctx timepane weekschedule getmsg getctx timepane monthschedule getmsg getctx timepane addchangelistener mainpanel confirmpanel borderlayout getcontentpane statusbar borderlayout dynamic init param create new if true allows to create new assignments private void dyn init boolean create new resource fill resource type fill resource field resource type add action listener this field resource add action listener this date field date set value m datefrom field date add action listener this b previous add action listener this b next add action listener this set init values day schedule set create new create new week schedule set create new create new month schedule set create new create new confirm panel add action listener this display calendar createnew dyninit createnew fillresourcetype fillresource fieldresourcetype addactionlistener fieldresource addactionlistener fielddate setvalue m_datefrom fielddate addactionlistener bprevious addactionlistener bnext addactionlistener dayschedule setcreatenew createnew weekschedule setcreatenew createnew monthschedule setcreatenew createnew confirmpanel addactionlistener displaycalendar fill resource type one time private void fill resource type get resource type of selected resource int s resourcetype id 0 if m massignment gets resource id 0 string sql select s resourcetype id from s resource where s resource id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m massignment gets resource id result set rs pstmt execute query if rs next s resourcetype id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e get resource types string sql m role get default add accesssql select s resourcetype id name from s resourcetype where is active y order by 2 s resourcetype m role sql notqualified m role sql ro key name pair default value null try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next key name pair pp new key name pair rs get int 1 rs get string 2 if s resourcetype id pp get key default value pp field resource type add item pp rs close pstmt close catch sql exception e log log level severe sql e if default value null field resource type set selected item default value fillresourcetype resourcetype s_resourcetype_id m_massignment gets_resource_id s_resourcetype_id s_resource s_resource_id preparedstatement preparestatement setint m_massignment gets_resource_id resultset executequery s_resourcetype_id getint sqlexception mrole getdefault addaccesssql s_resourcetype_id s_resourcetype isactive s_resourcetype mrole sql_notqualified mrole sql_ro keynamepair defaultvalue preparedstatement preparestatement resultset executequery keynamepair keynamepair getint getstring s_resourcetype_id getkey defaultvalue fieldresourcetype additem sqlexception defaultvalue fieldresourcetype setselecteditem defaultvalue fill resource pick from resource type private void fill resource get resource type key name pair pp key name pair field resource type get selected item if pp null return int s resourcetype id pp get key key name pair default value null load resources m loading true field resource remove all items string sql select s resource id name from s resource where s resourcetype id order by 2 try prepared statement pstmt db prepare statement sql null pstmt set int 1 s resourcetype id result set rs pstmt execute query while rs next pp new key name pair rs get int 1 rs get string 2 if m massignment gets resource id pp get key default value pp field resource add item pp rs close pstmt close catch sql exception e log log level severe sql e if default value null field resource set selected item default value m loading false fillresource keynamepair keynamepair fieldresourcetype getselecteditem s_resourcetype_id getkey keynamepair defaultvalue m_loading fieldresource removeallitems s_resource_id s_resource s_resourcetype_id preparedstatement preparestatement setint s_resourcetype_id resultset executequery keynamepair getint getstring m_massignment gets_resource_id getkey defaultvalue fieldresource additem sqlexception defaultvalue fieldresource setselecteditem defaultvalue m_loading display calendar for selected resource time day week month and date private void display calendar get values key name pair pp key name pair field resource get selected item if pp null return int s resource id pp get key m massignment sets resource id s resource id timestamp date field date get timestamp int index time pane get selected index log config index index id s resource id date set info m loading true if index 0 day schedule recreate s resource id date else if index 1 week schedule recreate s resource id date else month schedule recreate s resource id date m loading false repaint displaycalendar keynamepair keynamepair fieldresource getselecteditem s_resource_id getkey m_massignment sets_resource_id s_resource_id fielddate gettimestamp timepane getselectedindex s_resource_id m_loading dayschedule s_resource_id weekschedule s_resource_id monthschedule s_resource_id m_loading dispose public void dispose day schedule dispose week schedule dispose month schedule dispose this remove all super dispose dayschedule weekschedule monthschedule removeall action listener param e event public void action performed action event e if m loading return this set cursor cursor get predefined cursor cursor wait cursor if e get action command equals confirm panel a ok dispose else if e get action command equals confirm panel a cancel dispose else if e get source field resource type fill resource display calendar else if e get source field resource e get source field date display calendar else if e get source b previous adjust date 1 else if e get source b next adjust date 1 this set cursor cursor get default cursor actionperformed actionevent m_loading setcursor getpredefinedcursor wait_cursor getactioncommand confirmpanel a_ok getactioncommand confirmpanel a_cancel getsource fieldresourcetype fillresource displaycalendar getsource fieldresource getsource fielddate displaycalendar getsource bprevious adjustdate getsource bnext adjustdate setcursor getdefaultcursor change listener tab pane param e event public void state changed change event e display calendar statechanged changeevent displaycalendar adjust date param diff difference private void adjust date int diff timestamp date field date get timestamp gregorian calendar cal new gregorian calendar cal set time date if time pane get selected index 0 cal add java util calendar day of year diff else if time pane get selected index 1 cal add java util calendar week of year diff else cal add java util calendar month diff field date set value new timestamp cal get time in millis display calendar adjustdate fielddate gettimestamp gregoriancalendar gregoriancalendar settime timepane getselectedindex day_of_year timepane getselectedindex week_of_year fielddate setvalue gettimeinmillis displaycalendar callback called from v schedule panel after v assignment dialog finished param assignment new changed assignment public void m assignment callback m resource assignment assignment m massignment assignment if m createnew dispose else display calendar vschedulepanel vassignmentdialog massignmentcallback mresourceassignment m_massignment m_createnew displaycalendar get assignment return assignment public m resource assignment getm resource assignment return m massignment mresourceassignment getmresourceassignment m_massignment standard constructor public x c rfq topic properties ctx int c rfq topic id string trx name super ctx c rfq topic id trx name if c rfq topic id 0 setc rfq topic id 0 set is self service false set name null x_c_rfq_topic c_rfq_topic_id trxname c_rfq_topic_id trxname c_rfq_topic_id setc_rfq_topic_id setisselfservice setname load constructor public x c rfq topic properties ctx result set rs string trx name super ctx rs trx name x_c_rfq_topic resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfq topic append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfq_topic get_id tostring set print format data print format public void setad printformat id int ad printformat id if ad printformat id 0 set value ad printformat id null else set value ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id set_value ad_printformat_id set_value ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set rfq topic topic for request for quotations public void setc rfq topic id int c rfq topic id if c rfq topic id 1 throw new illegal argument exception c rfq topic id is mandatory set valuenocheck c rfq topic id new integer c rfq topic id setc_rfq_topic_id c_rfq_topic_id c_rfq_topic_id illegalargumentexception c_rfq_topic_id set_valuenocheck c_rfq_topic_id c_rfq_topic_id get rfq topic topic for request for quotations public int getc rfq topic id integer ii integer get value c rfq topic id if ii null return 0 return ii int value getc_rfq_topic_id get_value c_rfq_topic_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname constructor param pos panel pos panel public sub basic keys pos panel pos panel super pos panel pospanel subbasickeys pospanel pospanel pospanel initialize public void init title titled border border new titled border set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets1 f b7 create button 7 gbc gridx 0 gbc gridy 0 add f b7 gbc f b8 create button 8 gbc gridx 1 gbc gridy 0 add f b8 gbc f b9 create button 9 gbc gridx 2 gbc gridy 0 add f b9 gbc f b4 create button 4 gbc gridx 0 gbc gridy 1 add f b4 gbc f b5 create button 5 gbc gridx 1 gbc gridy 1 add f b5 gbc f b6 create button 6 gbc gridx 2 gbc gridy 1 add f b6 gbc f b1 create button 1 gbc gridx 0 gbc gridy 2 add f b1 gbc f b2 create button 2 gbc gridx 1 gbc gridy 2 add f b2 gbc f b3 create button 3 gbc gridx 2 gbc gridy 2 add f b3 gbc f b0 create button 0 dimension size f b0 get preferred size size width size width 2 2 gbc gridx 0 gbc gridy 3 gbc gridwidth 2 gbc fill grid bag constraints vertical add f b0 gbc f bdot create button gbc gridx 2 gbc gridy 3 gbc gridwidth 1 gbc fill grid bag constraints none add f bdot gbc gbc gridx 4 gbc insets new insets 1 15 1 1 gbc gridy 0 f reset create button action reset null add f reset gbc f new create button action new null gbc gridy 3 add f new gbc titledborder titledborder setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_b7 createbutton f_b7 f_b8 createbutton f_b8 f_b9 createbutton f_b9 f_b4 createbutton f_b4 f_b5 createbutton f_b5 f_b6 createbutton f_b6 f_b1 createbutton f_b1 f_b2 createbutton f_b2 f_b3 createbutton f_b3 f_b0 createbutton f_b0 getpreferredsize gridbagconstraints f_b0 f_bdot createbutton gridbagconstraints f_bdot f_reset createbuttonaction f_reset f_new createbuttonaction f_new get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 1 gbc gridy 3 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info pos sub basic keys action performed action reset if action equals reset new else if action equals new p pospanel new order actionperformed actionevent getactioncommand possubbasickeys actionperformed p_pospanel neworder constructor param ctx context param pa report id id public m report properties ctx int pa report id string trx name super ctx pa report id trx name if pa report id 0 set name null setpa reportlineset id 0 setpa reportcolumnset id 0 set list sources false set list trx false else m columnset new m report column set ctx getpa reportcolumnset id trx name m lineset new m report line set ctx getpa reportlineset id trx name pa_report_id mreport pa_report_id trxname pa_report_id trxname pa_report_id setname setpa_reportlineset_id setpa_reportcolumnset_id setlistsources setlisttrx m_columnset mreportcolumnset getpa_reportcolumnset_id trxname m_lineset mreportlineset getpa_reportlineset_id trxname load constructor public m report properties ctx result set rs string trx name super ctx rs trx name m columnset new m report column set ctx getpa reportcolumnset id trx name m lineset new m report line set ctx getpa reportlineset id trx name mreport resultset trxname trxname m_columnset mreportcolumnset getpa_reportcolumnset_id trxname m_lineset mreportlineset getpa_reportlineset_id trxname list info public void list system out println to string if m columnset null m columnset list system out println if m lineset null m lineset list tostring m_columnset m_columnset m_lineset m_lineset get where clause for report return where clause for report public string get where clause ad client indirectly via acct schema string buffer sb new string buffer mandatory acct schema sb append c acctschema id append getc acctschema id return sb to string getwhereclause ad_client acctschema stringbuffer stringbuffer acctschema c_acctschema_id getc_acctschema_id tostring string representation return info public string to string string buffer sb new string buffer m report append get id append append get name if get description null sb append append get description append sb append c acctschema id append getc acctschema id append c calendar id append getc calendar id sb append return sb to string tostring stringbuffer stringbuffer mreport get_id getname getdescription getdescription c_acctschema_id getc_acctschema_id c_calendar_id getc_calendar_id tostring public m report column set get column set return m columnset mreportcolumnset getcolumnset m_columnset public m report line set get line set return m lineset mreportlineset getlineset m_lineset dialog to start process param ad process id process param isso trx is sales trx public process dialog int ad process id boolean isso trx super log info process ad process id so trx isso trx enable events awt event window event mask m ad process id ad process id m windowno env create window no this env set context env get ctx m windowno isso trx isso trx y n try jb init catch exception ex log log level severe ex ad_process_id issotrx processdialog ad_process_id issotrx ad_process_id sotrx issotrx enableevents awtevent window_event_mask m_ad_process_id ad_process_id m_windowno createwindowno setcontext getctx m_windowno issotrx issotrx jbinit static layout throws exception private void jb init throws exception set icon image env get image m process gif dialog set layout main layout bok add action listener this b print add action listener this south panel set layout south layout south layout set alignment flow layout right dialog set preferred size new dimension 500 150 message set content type text html message set editable false message set background compiereplaf getfieldbackground inactive message set focusable false get content pane add dialog dialog add south panel border layout south south panel add b print null south panel add bok null dialog add message pane border layout center this get root pane set default button bok jbinit seticonimage getimage mprocess setlayout mainlayout addactionlistener bprint addactionlistener southpanel setlayout southlayout southlayout setalignment flowlayout setpreferredsize setcontenttype seteditable setbackground getfieldbackground_inactive setfocusable getcontentpane southpanel borderlayout southpanel bprint southpanel messagepane borderlayout getrootpane setdefaultbutton set visible set focus to ok if visible param visible true if visible public void set visible boolean visible super set visible visible if visible bok request focus setvisible setvisible requestfocus dispose public void dispose env clear win context m windowno super dispose clearwincontext m_windowno dynamic init return true if there is something to process start from menu public boolean init log config boolean trl env is base language env get ctx ad process string sql select name description help is report from ad process where ad process id if trl sql select t name t description t help p is report from ad process p ad process trl t where p ad process id t ad process id and p ad process id and t ad language try prepared statement pstmt db prepare statement sql null pstmt set int 1 m ad process id if trl pstmt set string 2 env getad language env get ctx result set rs pstmt execute query if rs next m name rs get string 1 m isreport rs get string 4 equals y m messagetext append b string s rs get string 2 description if rs was null m messagetext append msg get msg env get ctx start process else m messagetext append s m messagetext append b s rs get string 3 help if rs was null m messagetext append p append s append p rs close pstmt close catch sql exception e log log level severe sql e return false if m name null return false this set title m name message set text m messagetext to string bok set text msg get msg env get ctx start start reports w o asking if m isreport bok do click return false don t show return true isbaselanguage getctx ad_process isreport ad_process ad_process_id isreport ad_process ad_process_trl ad_process_id ad_process_id ad_process_id ad_language preparedstatement preparestatement setint m_ad_process_id setstring getad_language getctx resultset executequery m_name getstring m_isreport getstring m_messagetext getstring wasnull m_messagetext getmsg getctx startprocess m_messagetext m_messagetext getstring wasnull m_messagetext sqlexception m_name settitle m_name settext m_messagetext tostring settext getmsg getctx m_isreport doclick action listener start param e action event public void action performed action event e if e get source bok if bok get text length 0 dispose else similar to a panel action button process info pi new process info m name m ad process id pi setad user id env getad user id env get ctx pi setad client id env getad client id env get ctx m messagetext append p append m name append p message set text m messagetext to string trx trx trx get trx create trx name process dialog true process ctl process this m windowno pi null else if e get source b print print screen actionlistener actionevent actionperformed actionevent getsource gettext apanel actionbutton processinfo processinfo m_name m_ad_process_id setad_user_id getad_user_id getctx setad_client_id getad_client_id getctx m_messagetext m_name settext m_messagetext tostring createtrxname processdialog processctl m_windowno getsource bprint printscreen lock user interface called from the worker before processing param pi process info public void lockui process info pi bok set text bok set enabled false this set enabled false m islocked true processinfo settext setenabled setenabled m_islocked unlock user interface called from the worker when processing is done param pi process info public void unlockui process info pi process info util set log fromdb pi m messagetext append p font color append pi is error ff0000 0000ff append append pi get summary append font p m messagetext append pi get log info true message set text m messagetext to string message set caret position message get document get length scroll down m ids pi geti ds bok set enabled true this set enabled true m islocked false after process task close automatically if m isreport pi is error bok do click processinfo processinfoutil setlogfromdb m_messagetext iserror getsummary m_messagetext getloginfo settext m_messagetext tostring setcaretposition getdocument getlength m_ids getids setenabled setenabled m_islocked afterprocesstask m_isreport iserror doclick is the ui locked internal method return true if ui is locked public boolean isui locked return m islocked isuilocked m_islocked method to be executed async called from the a sync process worker param pi process info public void executea sync process info pi log config asyncprocess executeasync processinfo optional processing task private void after process task something to do if m ids null m ids length 0 log config print invoices if m ad process id 119 print invoices else if m ad process id 118 print shipments afterprocesstask m_ids m_ids m_ad_process_id printinvoices m_ad_process_id printshipments print shipments private void print shipments if m ids null return if a dialog ask m windowno this print shipments return m messagetext append p append msg get msg env get ctx print shipments append p message set text m messagetext to string int ret value a dialog dialog a cancel do loop through all items for int i 0 i m ids length i int m inout id m ids i report ctl start document print report engine shipment m inout id true a dialog dialog d new a dialog dialog this env get header env get ctx m windowno msg get msg env get ctx printoutok j option pane question message ret value d get return code while ret value a dialog dialog a cancel printshipments m_ids adialog m_windowno printshipments m_messagetext getmsg getctx printshipments settext m_messagetext tostring retvalue adialogdialog a_cancel m_ids m_inout_id m_ids reportctl startdocumentprint reportengine m_inout_id adialogdialog adialogdialog getheader getctx m_windowno getmsg getctx joptionpane question_message retvalue getreturncode retvalue adialogdialog a_cancel print invoices private void print invoices if m ids null return if a dialog ask m windowno this print invoices return m messagetext append p append msg get msg env get ctx print invoices append p message set text m messagetext to string int ret value a dialog dialog a cancel do loop through all items for int i 0 i m ids length i int ad invoice id m ids i report ctl start document print report engine invoice ad invoice id true a dialog dialog d new a dialog dialog this env get header env get ctx m windowno msg get msg env get ctx printoutok j option pane question message ret value d get return code while ret value a dialog dialog a cancel printinvoices m_ids adialog m_windowno printinvoices m_messagetext getmsg getctx printinvoices settext m_messagetext tostring retvalue adialogdialog a_cancel m_ids ad_invoice_id m_ids reportctl startdocumentprint reportengine ad_invoice_id adialogdialog adialogdialog getheader getctx m_windowno getmsg getctx joptionpane question_message retvalue getreturncode retvalue adialogdialog a_cancel print screen private void print screen print screen painter print screen this printscreen printscreenpainter printscreen save ini parameters to disk param try user home get user home first public static void save properties boolean try user home string file name get file name try user home file output stream fos null try file f new file file name fos new file output stream f s prop store fos compiere fos flush fos close catch exception e log log level severe cannot save properties to file name e to string return catch throwable t log log level severe cannot save properties to file name t to string return log finer file name tryuserhome saveproperties tryuserhome filename getfilename tryuserhome fileoutputstream filename fileoutputstream s_prop filename tostring filename tostring filename load ini parameters from disk param reload reload public static void load properties boolean reload if reload s prop size 0 load properties get file name s client loadproperties s_prop loadproperties getfilename s_client load ini parameters from filename logger is on default level info param filename to load return true if first time public static boolean load properties string filename boolean loadok true boolean first time false s prop new properties file input stream fis null try fis new file input stream filename s prop load fis fis close catch file not found exception e log warning filename not found loadok false catch exception e log log level severe filename e to string loadok false catch throwable t log log level severe filename t to string loadok false if loadok log config filename first time true if ini dialog accept system exit 1 check set properties defaults for int i 0 i properties length i if values i length 0 check property properties i values i string temp dir system get property java io tmpdir if temp dir null temp dir length 1 temp dir get compiere home if temp dir null temp dir check property p temp dir temp dir save if not exist or could not be read if loadok save properties true s loaded true log info filename s prop size return first time loadproperties firsttime s_prop fileinputstream fileinputstream s_prop filenotfoundexception tostring tostring firsttime inidialog checkproperty tempdir getproperty tempdir tempdir tempdir getcompierehome tempdir tempdir checkproperty p_temp_dir tempdir saveproperties s_loaded s_prop firsttime load property and set to default if not existing param key key param default value default value return property private static string check property string key string default value string result null if key equals p warning key equals p warning de result default value else if is client result s prop get property key secure interface clearvalue start default value secure interface clearvalue end else result s prop get property key secure engine encrypt default value s prop set property key result return result defaultvalue checkproperty defaultvalue p_warning p_warning_de defaultvalue isclient s_prop getproperty secureinterface clearvalue_start defaultvalue secureinterface clearvalue_end s_prop getproperty secureengine defaultvalue s_prop setproperty return file name of ini file pre examples c winnt profiles jjanke adempiere properties d adempiere adempiere properties adempiere properties pre can be overwritten by d property file my file allowing multiple configurations property files param try user home get user home first return file name private static string get file name boolean try user home if system get property property file null return system get property property file string base null if try user home s client base system get property user home server if s client base null base length 0 string home get compiere home if home null base home if base null base ends with file separator base file separator if base null base return base compiere property file dpropertyfile myfile tryuserhome getfilename tryuserhome getproperty propertyfile getproperty propertyfile tryuserhome s_client getproperty s_client getcompierehome endswith compiere_property_file set property param key key param value value public static void set property string key string value log finer key value if s prop null s prop new properties if key equals p warning key equals p warning de s prop set property key value else if is client s prop set property key secure interface clearvalue start value secure interface clearvalue end else if value null s prop set property key else string e value secure engine encrypt value if e value null s prop set property key else s prop set property key e value setproperty s_prop s_prop p_warning p_warning_de s_prop setproperty isclient s_prop setproperty secureinterface clearvalue_start secureinterface clearvalue_end s_prop setproperty evalue secureengine evalue s_prop setproperty s_prop setproperty evalue set property param key key param value value public static void set property string key boolean value set property key value y n setproperty setproperty set property param key key param value value public static void set property string key int value set property key string value of value setproperty setproperty valueof get propery param key key return value public static string get property string key if key null return string ret str s prop get property key if ret str null ret str length 0 return string value secure engine decrypt ret str log finer key value if value null return return value getproperty retstr s_prop getproperty retstr retstr secureengine retstr get propery as boolean param key key return value public static boolean is property bool string key return get property key equals y ispropertybool getproperty cache windows return true if windows are cached public static boolean is cache window return get property p cache window equals y iscachewindow getproperty p_cache_window get properties return ini properties public static properties get properties return s prop getproperties s_prop to string return string representation public static string get as string string buffer buf new string buffer ini enumeration e s prop keys while e has more elements string key string e next element buf append key append buf append get property key append buf append return buf to string tostring getasstring stringbuffer stringbuffer s_prop hasmoreelements nextelement getproperty tostring are we in client mode return true if client public static boolean is client return s client isclient s_client set client mode param client client public static void set client boolean client s client client setclient s_client are the properties loaded return true if properties loaded public static boolean is loaded return s loaded isloaded s_loaded get compiere home from environment return compiere home or null public static string get compiere home string env system get property env prefix compiere home if env null env system get property compiere home return env compierehome getcompierehome getproperty env_prefix compiere_home getproperty compiere_home set compiere home param compiere home compiere home public static void set compiere home string compiere home if compiere home null compiere home length 0 system set property compiere home compiere home compierehome compiere_home setcompierehome compierehome compierehome compierehome setproperty compiere_home compierehome find compiere home return compiere home or null public static string find compiere home string ch get compiere home if ch null return ch file roots file list roots for int i 0 i roots length i if roots i get absolute path starts with a continue file subs roots i list files if subs null continue for int j 0 j subs length j if subs j is directory continue string file name subs j get absolute path globalqss it s leaving log in first directory with lib subdirectory i e oracle if file name index of adempiere 1 if file name index of adempiere 1 string lib dir file name file separator lib file lib new file lib dir if lib exists lib is directory return file name return ch findcompierehome getcompierehome listroots getabsolutepath startswith listfiles isdirectory filename getabsolutepath filename indexof filename indexof libdir filename libdir isdirectory filename get window dimension param ad window id window no return dimension or null public static dimension get window dimension int ad window id string key window dim ad window id string value string s prop get key if value null value length 0 return null int index value index of if index 1 return null try string w value substring 0 index string h value substring index 1 return new dimension integer parse int w integer parse int h catch exception e return null ad_window_id getwindowdimension ad_window_id windowdim ad_window_id s_prop indexof parseint parseint set window dimension param ad window id window param window dimension dimension null to remove public static void set window dimension int ad window id dimension window dimension string key window dim ad window id if window dimension null string value window dimension width window dimension height s prop put key value else s prop remove key ad_window_id windowdimension setwindowdimension ad_window_id windowdimension windowdim ad_window_id windowdimension windowdimension windowdimension s_prop s_prop get window location param ad window id window id return location or null public static point get window location int ad window id string key window loc ad window id string value string s prop get key if value null value length 0 return null int index value index of if index 1 return null try string x value substring 0 index string y value substring index 1 return new point integer parse int x integer parse int y catch exception e return null ad_window_id getwindowlocation ad_window_id windowloc ad_window_id s_prop indexof parseint parseint set window location param ad window id window param window location location null to remove public static void set window location int ad window id point window location string key window loc ad window id if window location null string value window location x window location y s prop put key value else s prop remove key ad_window_id windowlocation setwindowlocation ad_window_id windowlocation windowloc ad_window_id windowlocation windowlocation windowlocation s_prop s_prop get divider location return location public static int get divider location string key divider string value string s prop get key if value null value length 0 return 0 try return integer parse int value catch exception e return 0 getdividerlocation s_prop parseint set divider location param divider location location public static void set divider location int divider location string key divider string value string value of divider location s prop put key value dividerlocation setdividerlocation dividerlocation valueof dividerlocation s_prop get bank account from cache param ctx context param c bankaccount id id return m bank account public static m bank account get properties ctx int c bankaccount id integer key new integer c bankaccount id m bank account ret value m bank account s cache get key if ret value null return ret value ret value new m bank account ctx c bankaccount id null if ret value get id 0 s cache put key ret value return ret value bankaccount c_bankaccount_id mbankaccount mbankaccount c_bankaccount_id c_bankaccount_id mbankaccount retvalue mbankaccount s_cache retvalue retvalue retvalue mbankaccount c_bankaccount_id retvalue get_id s_cache retvalue retvalue bank account model param ctx context param c bankaccount id bank account public m bank account properties ctx int c bankaccount id string trx name super ctx c bankaccount id trx name if c bankaccount id 0 set is default false set bank account type bankaccounttype checking set current balance env zero setc currency id 0 set credit limit env zero setc bankaccount id 0 c_bankaccount_id mbankaccount c_bankaccount_id trxname c_bankaccount_id trxname c_bankaccount_id setisdefault setbankaccounttype bankaccounttype_checking setcurrentbalance setc_currency_id setcreditlimit setc_bankaccount_id bank account model param ctx context param rs result set public m bank account properties ctx result set rs string trx name super ctx rs trx name mbankaccount resultset trxname trxname string representation return info public string to string string buffer sb new string buffer m bank account append get id append append get account no append return sb to string tostring stringbuffer stringbuffer mbankaccount get_id getaccountno tostring get bank return bank parent public m bank get bank return m bank get get ctx getc bank id mbank getbank mbank getctx getc_bank_id get bank name and account no return bank account public string get name return get bank get name get account no getname getbank getname getaccountno after save param new record new record param success success return success protected boolean after save boolean new record boolean success if new record success return insert accounting c bankaccount acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_bankaccount_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c bankaccount acct beforedelete delete_accounting c_bankaccount_acct public class word filter extends java util hashtable implements filter public word filter super 4 wordfilter wordfilter returns the name of the filter public string get info return word filter getinfo wordfilter this method actually performs the filtering public string process string to process if to process null to process length 0 return string tmp the true at the end is the key to making it work string tokenizer st new string tokenizer to process true string buffer new value new string buffer to process length 50 while st has more tokens tmp st next token if has attribute tmp new value append string get tmp else new value append tmp return new value to string to_process to_process to_process stringtokenizer stringtokenizer to_process stringbuffer newvalue stringbuffer to_process hasmoretokens nexttoken hasattribute newvalue newvalue newvalue tostring put a filter somewhere we can get to it public filter add attribute string attribute object entity put attribute entity return this addattribute get rid of a current filter public filter remove attribute string attribute try remove attribute catch null pointer exception exc don t really care if this throws a null pointer exception return this removeattribute nullpointerexception does the filter filter this public boolean has attribute string attribute return contains key attribute hasattribute containskey constructor param parent parent frame public setup help frame parent super parent true init parent setup_help constructor param parent parent dialog public setup help dialog parent super parent true init parent setup_help constructor init param parent parent window private void init window parent enable events awt event window event mask try jb init dyn init catch exception e e print stack trace dimension dlg size get preferred size dimension frm size parent get size point loc parent get location set location frm size width dlg size width 2 loc x frm size height dlg size height 2 loc y try pack set visible true html load errors catch exception ex enableevents awtevent window_event_mask jbinit dyninit printstacktrace dlgsize getpreferredsize frmsize getsize getlocation setlocation frmsize dlgsize frmsize dlgsize setvisible static layout throws exception private void jb init throws exception image label set icon new image icon setupframe aboutbox class get resource your image this set title res get string compiere server setup res get string help main panel set layout main layout bok set text res get string ok bok add action listener this center scroll pane set preferred size new dimension 600 400 this get content pane add main panel null south panel add bok null main panel add south panel border layout south set resizable true main panel add center scroll pane border layout center center scroll pane get viewport add editor pane null jbinit imagelabel seticon imageicon setupframe_aboutbox getresource settitle getstring compiereserversetup getstring mainpanel setlayout mainlayout settext getstring addactionlistener centerscrollpane setpreferredsize getcontentpane mainpanel southpanel mainpanel southpanel borderlayout setresizable mainpanel centerscrollpane borderlayout centerscrollpane getviewport editorpane set content private void dyn init try editor pane set page http www compiere org help server setup html catch io exception ex editor pane set text res get string please check http www compiere org support p res get string unable to connect dyninit editorpane setpage serversetup ioexception editorpane settext getstring pleasecheck getstring unabletoconnect close dialog if closing param e event protected void process window event window event e if e getid window event window closing dispose super process window event e processwindowevent windowevent windowevent window_closing processwindowevent action listener param e event public void action performed action event e if e get source bok dispose actionperformed actionevent getsource standard constructor param ctx context param gl journal id id public m journal properties ctx int gl journal id string trx name super ctx gl journal id trx name if gl journal id 0 setgl journal id 0 pk setc acctschema id 0 setc currency id 0 setc doctype id 0 setc period id 0 set currency rate env one setc conversiontype id 0 set date acct new timestamp system current time millis set date doc new timestamp system current time millis set description null set doc action docaction complete set doc status docstatus drafted set document no null setgl category id 0 set posting type postingtype actual set total cr env zero set total dr env zero set is approved false set is printed false set posted false set processed false gl_journal_id mjournal gl_journal_id trxname gl_journal_id trxname gl_journal_id setgl_journal_id setc_acctschema_id setc_currency_id setc_doctype_id setc_period_id setcurrencyrate setc_conversiontype_id setdateacct currenttimemillis setdatedoc currenttimemillis setdescription setdocaction docaction_complete setdocstatus docstatus_drafted setdocumentno setgl_category_id setpostingtype postingtype_actual settotalcr settotaldr setisapproved setisprinted setposted setprocessed load constructor param ctx context param rs result set public m journal properties ctx result set rs string trx name super ctx rs trx name mjournal resultset trxname trxname parent constructor param parent batch public m journal m journal batch parent this parent get ctx 0 parent get trxname set client org parent setgl journalbatch id parent getgl journalbatch id setc doctype id parent getc doctype id set posting type parent get posting type set date doc parent get date doc setc period id parent getc period id set date acct parent get date acct setc currency id parent getc currency id mjournal mjournalbatch getctx get_trxname setclientorg setgl_journalbatch_id getgl_journalbatch_id setc_doctype_id getc_doctype_id setpostingtype getpostingtype setdatedoc getdatedoc setc_period_id getc_period_id setdateacct getdateacct setc_currency_id getc_currency_id copy constructor dos not copy dates period param original original public m journal m journal original this original get ctx 0 original get trxname set client org original setgl journalbatch id original getgl journalbatch id setc acctschema id original getc acctschema id setgl budget id original getgl budget id setgl category id original getgl category id set posting type original get posting type set description original get description setc doctype id original getc doctype id set control amt original get control amt setc currency id original getc currency id setc conversiontype id original getc conversiontype id set currency rate original get currency rate set date doc original get date doc set date acct original get date acct setc period id original getc period id mjournal mjournal getctx get_trxname setclientorg setgl_journalbatch_id getgl_journalbatch_id setc_acctschema_id getc_acctschema_id setgl_budget_id getgl_budget_id setgl_category_id getgl_category_id setpostingtype getpostingtype setdescription getdescription setc_doctype_id getc_doctype_id setcontrolamt getcontrolamt setc_currency_id getc_currency_id setc_conversiontype_id getc_conversiontype_id setcurrencyrate getcurrencyrate setdatedoc getdatedoc setdateacct getdateacct setc_period_id getc_period_id overwrite client org if required param ad client id client param ad org id org public void set client org int ad client id int ad org id super set client org ad client id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id setclientorg ad_client_id ad_org_id set accounting date set also period if not set earlier param date acct date public void set date acct timestamp date acct super set date acct date acct if date acct null return if getc period id 0 return int c period id m period getc period id get ctx date acct if c period id 0 log warning set date acct period not found else setc period id c period id dateacct setdateacct dateacct setdateacct dateacct dateacct getc_period_id c_period_id mperiod getc_period_id getctx dateacct c_period_id setdateacct setc_period_id c_period_id set currency info param c currency id currenct param c conversiontype id type param currency rate rate public void set currency int c currency id int c conversiontype id big decimal currency rate if c currency id 0 setc currency id c currency id if c conversiontype id 0 setc conversiontype id c conversiontype id if currency rate null currency rate compare to env zero 0 set currency rate currency rate c_currency_id c_conversiontype_id currencyrate setcurrency c_currency_id c_conversiontype_id bigdecimal currencyrate c_currency_id setc_currency_id c_currency_id c_conversiontype_id setc_conversiontype_id c_conversiontype_id currencyrate currencyrate compareto setcurrencyrate currencyrate get journal lines param requery requery return array of lines public m journal line get lines boolean requery array list m journal line list new array list m journal line string sql select from gl journalline where gl journal id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getgl journal id result set rs pstmt execute query while rs next list add new m journal line get ctx rs get trxname rs close pstmt close pstmt null catch sql exception ex log log level severe get lines ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m journal line ret value new m journal line list size list to array ret value return ret value mjournalline getlines arraylist mjournalline arraylist mjournalline gl_journalline gl_journal_id preparedstatement preparestatement get_trxname setint getgl_journal_id resultset executequery mjournalline getctx get_trxname sqlexception getlines sqlexception mjournalline retvalue mjournalline toarray retvalue retvalue copy lines from other journal param from journal journal param date acct date used if null original param typecr type of copying c orrect negate r everse flip dr cr otherwise just copy return number of lines copied public int copy lines from m journal from journal timestamp date acct char typecr if is processed from journal null return 0 int count 0 m journal line from lines from journal get lines false for int i 0 i from lines length i m journal line to line new m journal line get ctx 0 from journal get trxname po copy values from lines i to line getad client id getad org id to line setgl journal id getgl journal id if date acct null to line set date acct date acct amounts if typecr c correct to line set amt source dr from lines i get amt source dr negate to line set amt source cr from lines i get amt source cr negate else if typecr r reverse to line set amt source dr from lines i get amt source cr to line set amt source cr from lines i get amt source dr to line set is generated true to line set processed false if to line save count if from lines length count log log level severe copy lines from line difference journal lines from lines length saved count return count fromjournal dateacct copylinesfrom mjournal fromjournal dateacct isprocessed fromjournal mjournalline fromlines fromjournal getlines fromlines mjournalline toline mjournalline getctx fromjournal get_trxname copyvalues fromlines toline getad_client_id getad_org_id toline setgl_journal_id getgl_journal_id dateacct toline setdateacct dateacct toline setamtsourcedr fromlines getamtsourcedr toline setamtsourcecr fromlines getamtsourcecr toline setamtsourcedr fromlines getamtsourcecr toline setamtsourcecr fromlines getamtsourcedr toline setisgenerated toline setprocessed toline fromlines copylinesfrom journallines fromlines set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update gl journalline set processed processed y n where gl journal id getgl journal id int no line db execute update sql get trxname log fine processed lines no line setprocessed setprocessed get_id gl_journalline gl_journal_id getgl_journal_id noline executeupdate get_trxname noline before save param new record new return true protected boolean before save boolean new record imported journals may not have date if get date doc null if get date acct null set date doc new timestamp system current time millis else set date doc get date acct if get date acct null set date acct get date doc return true newrecord beforesave newrecord getdatedoc getdateacct setdatedoc currenttimemillis setdatedoc getdateacct getdateacct setdateacct getdatedoc after save update batch total param new record true if new record param success true if success protected boolean after save boolean new record boolean success if success return success return update batch newrecord aftersave newrecord updatebatch after delete param success true if deleted return true if success protected boolean after delete boolean success if success return success return update batch afterdelete updatebatch update batch total return true if ok private boolean update batch string sql update gl journalbatch jb set total dr total cr select coalesce sum total dr 0 coalesce sum total cr 0 from gl journal j where j is active y and jb gl journalbatch id j gl journalbatch id where gl journalbatch id getgl journalbatch id int no db execute update sql get trxname if no 1 log warning after save update batch no return no 1 updatebatch gl_journalbatch totaldr totalcr totaldr totalcr gl_journal isactive gl_journalbatch_id gl_journalbatch_id gl_journalbatch_id getgl_journalbatch_id executeupdate get_trxname aftersave process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string return true invalidateit tostring prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctype id get period m period period m period get get ctx get date acct if period null log warning no period for get date acct m processmsg period not found return doc action status invalid standard period if period getc period id getc period id period is standard period m processmsg period not valid return doc action status invalid boolean open period is open dt get doc base type if open log warning period get name not open for dt get doc base type get date acct m processmsg period closed return doc action status invalid lines m journal line lines get lines true if lines length 0 m processmsg no lines return doc action status invalid add up amounts big decimal amt source dr env zero big decimal amt source cr env zero for int i 0 i lines length i m journal line line lines i if is active continue if line is doc controlled m processmsg doc controlled error line line get line line get account element value return doc action status invalid amt source dr amt source dr add line get amt source dr amt source cr amt source cr add line get amt source cr set total dr amt source dr set total cr amt source cr control amount if env zero compare to get control amt 0 get control amt compare to get total dr 0 m processmsg control amt error return doc action status invalid unbalanced jornal not suspense if amt source dr compare to amt source cr 0 m acct schemagl gl m acct schemagl get get ctx getc acctschema id if gl null gl is use suspense balancing m processmsg unbalanced jornal return doc action status invalid if docaction complete equals get doc action set doc action docaction complete m justprepared true return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctype_id mperiod mperiod getctx getdateacct getdateacct m_processmsg periodnotfound docaction status_invalid getc_period_id getc_period_id isstandardperiod m_processmsg periodnotvalid docaction status_invalid isopen getdocbasetype getname getdocbasetype getdateacct m_processmsg periodclosed docaction status_invalid mjournalline getlines m_processmsg nolines docaction status_invalid bigdecimal amtsourcedr bigdecimal amtsourcecr mjournalline isactive isdoccontrolled m_processmsg doccontrollederror getline getaccountelementvalue docaction status_invalid amtsourcedr amtsourcedr getamtsourcedr amtsourcecr amtsourcecr getamtsourcecr settotaldr amtsourcedr settotalcr amtsourcecr compareto getcontrolamt getcontrolamt compareto gettotaldr m_processmsg controlamterror docaction status_invalid amtsourcedr compareto amtsourcecr macctschemagl macctschemagl getctx getc_acctschema_id isusesuspensebalancing m_processmsg unbalancedjornal docaction status_invalid docaction_complete getdocaction setdocaction docaction_complete m_justprepared docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document return true if success public boolean void it log info to string if docstatus drafted equals get doc status docstatus invalid equals get doc status set processed true set doc action docaction none return true return false voidit tostring docstatus_drafted getdocstatus docstatus_invalid getdocstatus setprocessed setdocaction docaction_none close document cancel not delivered qunatities return true if success public boolean close it log info to string if docstatus completed equals get doc status set processed true set doc action docaction none return true return false closeit tostring docstatus_completed getdocstatus setprocessed setdocaction docaction_none reverse correction in same batch as if nothing happened same date return true if success public boolean reverse correct it return reverse correct it getgl journalbatch id null reversecorrectit reversecorrectit getgl_journalbatch_id reverse correction as if nothing happened same date param gl journalbatch id reversal batch return reversed journal or null public m journal reverse correct it int gl journalbatch id log info to string journal m journal reverse new m journal this reverse setgl journalbatch id gl journalbatch id reverse set date doc get date doc reverse setc period id getc period id reverse set date acct get date acct reverse indicator string description reverse get description if description null description get document no else description get document no reverse set description description if reverse save return null lines reverse copy lines from this null c set processed true set doc action docaction none return reverse gl_journalbatch_id mjournal reversecorrectit gl_journalbatch_id tostring mjournal mjournal setgl_journalbatch_id gl_journalbatch_id setdatedoc getdatedoc setc_period_id getc_period_id setdateacct getdateacct getdescription getdocumentno getdocumentno setdescription copylinesfrom setprocessed setdocaction docaction_none reverse accrual sane batch flip dr cr use today s date return true if success public boolean reverse accrual it return reverse accrual it getgl journalbatch id null reverseaccrualit reverseaccrualit getgl_journalbatch_id reverse accrual flip dr cr use today s date param gl journalbatch id reversal batch return reversed journal or null public m journal reverse accrual it int gl journalbatch id log info to string journal m journal reverse new m journal this reverse setgl journalbatch id gl journalbatch id reverse setc period id 0 reverse set date doc new timestamp system current time millis reverse set date acct reverse get date doc reverse indicator string description reverse get description if description null description get document no else description get document no reverse set description description if reverse save return null lines reverse copy lines from this reverse get date acct r set processed true set doc action docaction none return reverse gl_journalbatch_id mjournal reverseaccrualit gl_journalbatch_id tostring mjournal mjournal setgl_journalbatch_id gl_journalbatch_id setc_period_id setdatedoc currenttimemillis setdateacct getdatedoc getdescription getdocumentno getdocumentno setdescription copylinesfrom getdateacct setprocessed setdocaction docaction_none re activate return true if success public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx total dr append append get total dr append append msg translate get ctx totalcr append append get total cr append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx totaldr gettotaldr getctx gettotalcr getlines getdescription getdescription getdescription tostring string representation return info public string to string string buffer sb new string buffer m journal sb append get id append append get description append dr append get total dr append cr append get total cr append return sb to string tostring stringbuffer stringbuffer mjournal get_id getdescription gettotaldr gettotalcr tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id created public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby get document approval amount return dr amount public big decimal get approval amt return get total dr bigdecimal getapprovalamt gettotaldr basic constructor public frameset basic constructor param element adds an element to the element public frameset element element add element element addelement basic constructor param element adds an element to the element public frameset string element add element element addelement basic constructor param rows sets the rows attribute param cols sets the cols attribute public frameset string rows string cols set rows rows set cols cols setrows setcols basic constructor param rows sets the rows attribute param cols sets the cols attribute param element adds an element to the element public frameset string rows string cols element element add element element set rows rows set cols cols addelement setrows setcols basic constructor param rows sets the rows attribute param cols sets the cols attribute param element adds an element to the element public frameset string rows string cols string element add element element set rows rows set cols cols addelement setrows setcols sets the rows attribute param rows sets the rows attribute public frameset set rows int rows set rows integer to string rows return this setrows setrows tostring sets the rows attribute param rows sets the rows attribute public frameset set rows string rows add attribute rows rows return this setrows addattribute sets the cols attribute param cols sets the cols attribute public frameset set cols int cols set cols integer to string cols return this setcols setcols tostring sets the cols attribute param cols sets the cols attribute public frameset set cols string cols add attribute cols cols return this setcols addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public frameset add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public frameset add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public frameset add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public frameset add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public frameset remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param the script public void set on load string script add attribute onload script setonload addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param the script public void set on unload string script add attribute onunload script setonunload addattribute basic constructor public string element stringelement basic constructor public string element string string if string null set tag text string else set tag text stringelement settagtext settagtext basic constructor public string element element element add element element stringelement addelement private string element append string string set tag text get tag text string return this stringelement settagtext gettagtext resets the interal string to be empty public string element reset set tag text return this stringelement settagtext set tag text param text text return element public element set tag text string text if text null text length 0 string character iterator sci new string character iterator text for char c sci first c character iterator done c sci next int ii c if ii 255 set filter state true break return super set tag text text settagtext stringcharacteriterator stringcharacteriterator characteriterator setfilterstate settagtext set filter state don t allow reset param filter state state return this public element set filter state boolean filter state if get filter state return super set filter state filter state return this filter_state setfilterstate filter_state getfilterstate setfilterstate filter_state adds an element to the element param hashcode name of element for hash table param element adds an element to the element public string element add element string hashcode element element add element to registry hashcode element return this stringelement addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public string element add element string hashcode string element we do it this way so that filtering will work 1 create a new string element element this is the only way that set text tag will get called 2 copy the filter state of this string element to this child 3 copy the filter for this string element to this child string element se new string element element se set filter state get filter state se set filter get filter add element to registry hashcode se return this stringelement addelement stringelement settexttag stringelement stringelement setfilterstate getfilterstate setfilter getfilter addelementtoregistry adds an element to the element param element adds an element to the element public string element add element string element add element integer to string element hash code element return this stringelement addelement addelement tostring hashcode adds an element to the element param element adds an element to the element public string element add element element element add element to registry element return this stringelement addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public string element remove element string hashcode remove element from registry hashcode return this stringelement removeelement removeelementfromregistry protected string create start tag return createstarttag return protected string create end tag return createendtag prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c commission id p c commission id para i get parameter as int else log log level severe prepare unknown parameter name p c commissionto id getrecord id processinfoparameter getparameter getparametername getparameter c_commission_id p_c_commission_id getparameterasint p_c_commissionto_id getrecord_id process copy return message throws exception protected string do it throws exception log info do it c commission id p c commission id copy to p c commissionto id m commission com from new m commission get ctx p c commission id get trxname if com from get id 0 throw new compiere user error no from commission m commission com to new m commission get ctx p c commissionto id get trxname if com to get id 0 throw new compiere user error no to commission int no com to copy lines from com from return copied no doit doit c_commission_id p_c_commission_id p_c_commissionto_id mcommission comfrom mcommission getctx p_c_commission_id get_trxname comfrom get_id compiereusererror mcommission comto mcommission getctx p_c_commissionto_id get_trxname comto get_id compiereusererror comto copylinesfrom comfrom methods public comment create a comment object containg this element public comment string element add element element addelement create a comment object containg this element public comment element element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public comment add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public comment add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public comment add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public comment add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public comment remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry protected string create start tag set end tag char string buffer out new string buffer out append get start tag char if get begin start modifier defined out append get begin start modifier out append get element type if get begin end modifier defined out append get begin end modifier out append get end tag char set end tag char put back the end tag character return out to string createstarttag setendtagchar stringbuffer stringbuffer getstarttagchar getbeginstartmodifierdefined getbeginstartmodifier getelementtype getbeginendmodifierdefined getbeginendmodifier getendtagchar setendtagchar tostring protected string create end tag string buffer out new string buffer set start tag char set end start modifier out append get start tag char if get end start modifier defined out append get end start modifier out append get element type if get end end modifier defined out append get end end modifier out append get end tag char set start tag char put back the tag start character return out to string createendtag stringbuffer stringbuffer setstarttagchar setendstartmodifier getstarttagchar getendstartmodifierdefined getendstartmodifier getelementtype getendendmodifierdefined getendendmodifier getendtagchar setstarttagchar tostring constructor param pos panel pos panel public sub current line pos panel pos panel super pos panel pospanel subcurrentline pospanel pospanel pospanel initialize public void init title titled border border new titled border msg get msg env get ctx current line set border border content set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc insets insets2 gbc gridy 0 f new create button action new key stroke get key stroke key event vk insert event shift mask gbc gridx 0 add f new gbc f reset create button action reset null gbc gridx grid bag constraints relative add f reset gbc f currency new c label gbc anchor grid bag constraints east gbc weightx 1 gbc fill grid bag constraints horizontal add f currency gbc f price new v number price actual false false true display type amount msg translate env get ctx price actual f price add action listener this f price set columns 10 25 gbc anchor grid bag constraints west gbc weightx 0 gbc fill grid bag constraints none add f price gbc set price env zero f uom new c label gbc anchor grid bag constraints east gbc weightx 1 gbc fill grid bag constraints horizontal add f uom gbc f minus create button action minus null gbc anchor grid bag constraints west gbc weightx 0 gbc fill grid bag constraints none add f minus gbc f quantity new v number qty ordered false false true display type quantity msg translate env get ctx qty ordered f quantity add action listener this f quantity set columns 5 25 add f quantity gbc set qty env one f plus create button action plus null add f plus gbc titledborder titledborder getmsg getctx currentline setborder setlayout gridbaglayout gridbagconstraints gridbagconstraints f_new createbuttonaction keystroke getkeystroke keyevent vk_insert shift_mask f_new f_reset createbuttonaction gridbagconstraints f_reset f_currency clabel gridbagconstraints gridbagconstraints f_currency f_price vnumber priceactual displaytype getctx priceactual f_price addactionlistener f_price setcolumns gridbagconstraints gridbagconstraints f_price setprice f_uom clabel gridbagconstraints gridbagconstraints f_uom f_minus createbuttonaction gridbagconstraints gridbagconstraints f_minus f_quantity vnumber qtyordered displaytype getctx qtyordered f_quantity addactionlistener f_quantity setcolumns f_quantity setqty f_plus createbuttonaction f_plus get panel position public grid bag constraints get grid bag constraints grid bag constraints gbc super get grid bag constraints gbc gridx 0 gbc gridy 1 return gbc gridbagconstraints getgridbagconstraints gridbagconstraints getgridbagconstraints dispose free resources public void dispose super dispose action listener param e event public void action performed action event e string action e get action command if action null action length 0 return log info sub current line action performed action new reset if action equals new save line else if action equals reset new line plus else if action equals plus f quantity plus minus else if action equals minus f quantity minus 1 v number else if e get source f price f price set value f price get value else if e get source f quantity f quantity set value f quantity get value actionperformed actionevent getactioncommand subcurrentline actionperformed saveline newline f_quantity f_quantity vnumber getsource f_price f_price setvalue f_price getvalue getsource f_quantity f_quantity setvalue f_quantity getvalue set currency param currency currency public void set currency string currency if currency null f currency set text else f currency set text currency setcurrency f_currency settext f_currency settext set uom param uom uom public void setuom string uom if uom null f uom set text else f uom set text uom f_uom settext f_uom settext set price param price price public void set price big decimal price if price null price env zero f price set value price boolean rw env zero compare to price 0 p pos is modify price f price set read write rw setprice bigdecimal f_price setvalue compareto p_pos ismodifyprice f_price setreadwrite get price return price public big decimal get price return big decimal f price get value bigdecimal getprice bigdecimal f_price getvalue set qty param qty qty public void set qty big decimal qty f quantity set value qty setqty bigdecimal f_quantity setvalue get qty return qty public big decimal get qty return big decimal f quantity get value bigdecimal getqty bigdecimal f_quantity getvalue new line public void new line p pospanel f product setm product id 0 set qty env one set price env zero p pospanel f lines update table m order newline p_pospanel f_product setm_product_id setqty setprice p_pospanel f_lines updatetable m_order save line return true if saved public boolean save line m product product p pospanel f product get product if product null return false big decimal qty ordered big decimal f quantity get value big decimal price actual big decimal f price get value m order line line create line product qty ordered price actual if line null return false if line save return false new line return true saveline mproduct p_pospanel f_product getproduct bigdecimal qtyordered bigdecimal f_quantity getvalue bigdecimal priceactual bigdecimal f_price getvalue morderline createline qtyordered priceactual newline get create header return header or null public m order get order if m order null m order new m order env get ctx 0 null m order setad org id p pos getad org id m order set isso trx true if p pos getc doctype id 0 m order setc doctypetarget id p pos getc doctype id else m order setc doctypetarget id m order docsubtypeso pos mb partner partner p pospanel f bpartner getb partner if partner null partner get id 0 partner p pos getb partner if partner null partner get id 0 log log level severe sub current line get order no b partner return null log info sub current line get order partner m order setb partner partner int id p pospanel f bpartner getc bpartner location id if id 0 m order setc bpartner location id id id p pospanel f bpartner getad user id if id 0 m order setad user id id m order setm pricelist id p pos getm pricelist id m order setm warehouse id p pos getm warehouse id m order setsalesrep id p pos getsalesrep id if m order save m order null return m order morder getorder m_order m_order morder getctx m_order setad_org_id p_pos getad_org_id m_order setissotrx p_pos getc_doctype_id m_order setc_doctypetarget_id p_pos getc_doctype_id m_order setc_doctypetarget_id morder docsubtypeso_pos mbpartner p_pospanel f_bpartner getbpartner get_id p_pos getbpartner get_id subcurrentline getorder bpartner subcurrentline getorder m_order setbpartner p_pospanel f_bpartner getc_bpartner_location_id m_order setc_bpartner_location_id p_pospanel f_bpartner getad_user_id m_order setad_user_id m_order setm_pricelist_id p_pos getm_pricelist_id m_order setm_warehouse_id p_pos getm_warehouse_id m_order setsalesrep_id p_pos getsalesrep_id m_order m_order m_order create new line return line or null public m order line create line m product product big decimal qty ordered big decimal price actual m order order get order if order null return null m order line line new m order line order line set product product line set qty qty ordered line set price sets list limit line set price price actual line save return line morderline createline mproduct bigdecimal qtyordered bigdecimal priceactual morder getorder morderline morderline setproduct setqty qtyordered setprice setprice priceactual prepare protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name p c rfq id getrecord id processinfoparameter getparameter getparametername getparameter p_c_rfq_id getrecord_id process see org compiere process svr process do it return message protected string do it throws exception m rfq rfq new m rfq get ctx p c rfq id get trxname if rfq get id 0 throw new illegal argument exception no rfq found log info do it rfq rfq set processed true rfq save int counter 0 m rfq response responses rfq get responses false false for int i 0 i responses length i responses i set processed false responses i save counter return counter svrprocess doit doit mrfq mrfq getctx p_c_rfq_id get_trxname get_id illegalargumentexception doit setprocessed mrfqresponse getresponses setprocessed detail constructor param init init param used used param committed committed param max max public c memory usage long init long used long committed long max super init used committed max cmemoryusage parent constructor param usage usage public c memory usage memory usage usage super usage get init usage get used usage get committed usage get max cmemoryusage memoryusage getinit getused getcommitted getmax get free committed used memory return memory public long get free return get committed get used getfree getcommitted getused get free committed used memory percent return memory public int get free percent long base get committed long no get free 100 if no 0 return 0 long percent no base return int percent getfreepercent getcommitted getfree get committed max committed memory percent return memory public int get committed percent long base get max long no get committed 100 if no 0 return 0 long percent no base return int percent getcommittedpercent getmax getcommitted format k m param info return string info private string format long info long infok info 1024 if infok 0 return string value of info long infom infok 1024 if infom 0 return s format format info return s format format infok k valueof s_format s_format string representation return info public string to string string buffer sb new string buffer sb append init append format get init append used append format get used append free append format get free append append get free percent append committed append format get committed append append get committed percent append max append format get max return sb to string tostring stringbuffer stringbuffer getinit getused getfree getfreepercent getcommitted getcommittedpercent getmax tostring standard constructor public x gl fund properties ctx int gl fund id string trx name super ctx gl fund id trx name if gl fund id 0 set amt env zero setc acctschema id 0 setgl fund id 0 set name null x_gl_fund gl_fund_id trxname gl_fund_id trxname gl_fund_id setamt setc_acctschema_id setgl_fund_id setname load constructor public x gl fund properties ctx result set rs string trx name super ctx rs trx name x_gl_fund resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl fund append get id append return sb to string tostring stringbuffer stringbuffer x_gl_fund get_id tostring set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set date from starting date for a range public void set date from timestamp date from set value date from date from setdatefrom datefrom set_value datefrom datefrom get date from starting date for a range public timestamp get date from return timestamp get value date from getdatefrom get_value datefrom set date to end date of a date range public void set date to timestamp date to set value date to date to setdateto dateto set_value dateto dateto get date to end date of a date range public timestamp get date to return timestamp get value date to getdateto get_value dateto set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set gl fund general ledger funds control public void setgl fund id int gl fund id if gl fund id 1 throw new illegal argument exception gl fund id is mandatory set valuenocheck gl fund id new integer gl fund id setgl_fund_id gl_fund_id gl_fund_id illegalargumentexception gl_fund_id set_valuenocheck gl_fund_id gl_fund_id get gl fund general ledger funds control public int getgl fund id integer ii integer get value gl fund id if ii null return 0 return ii int value getgl_fund_id get_value gl_fund_id intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x c period properties ctx int c period id string trx name super ctx c period id trx name if c period id 0 setc period id 0 setc year id 0 set name null set period no 0 set period type null s set start date new timestamp system current time millis x_c_period c_period_id trxname c_period_id trxname c_period_id setc_period_id setc_year_id setname setperiodno setperiodtype setstartdate currenttimemillis load constructor public x c period properties ctx result set rs string trx name super ctx rs trx name x_c_period resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c period append get id append return sb to string tostring stringbuffer stringbuffer x_c_period get_id tostring set period period of the calendar public void setc period id int c period id if c period id 1 throw new illegal argument exception c period id is mandatory set valuenocheck c period id new integer c period id setc_period_id c_period_id c_period_id illegalargumentexception c_period_id set_valuenocheck c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue set year calendar year public void setc year id int c year id if c year id 1 throw new illegal argument exception c year id is mandatory set valuenocheck c year id new integer c year id setc_year_id c_year_id c_year_id illegalargumentexception c_year_id set_valuenocheck c_year_id c_year_id get year calendar year public int getc year id integer ii integer get value c year id if ii null return 0 return ii int value getc_year_id get_value c_year_id intvalue set end date last effective date inclusive public void set end date timestamp end date set value end date end date setenddate enddate set_value enddate enddate get end date last effective date inclusive public timestamp get end date return timestamp get value end date getenddate get_value enddate set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set period no unique period number public void set period no int period no set value period no new integer period no setperiodno periodno set_value periodno periodno get period no unique period number public int get period no integer ii integer get value period no if ii null return 0 return ii int value getperiodno get_value periodno intvalue public static final string periodtype standardcalendarperiod s set period type period type public void set period type string period type if period type null throw new illegal argument exception period type is mandatory if period type equals a period type equals s else throw new illegal argument exception period type invalid value period type reference id 115 a s if period type length 1 log warning length 1 truncated period type period type substring 0 0 set valuenocheck period type period type periodtype_standardcalendarperiod setperiodtype periodtype periodtype illegalargumentexception periodtype periodtype periodtype illegalargumentexception periodtype periodtype reference_id periodtype periodtype periodtype set_valuenocheck periodtype periodtype get period type period type public string get period type return string get value period type getperiodtype get_value periodtype set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set start date first effective day inclusive public void set start date timestamp start date if start date null throw new illegal argument exception start date is mandatory set value start date start date setstartdate startdate startdate illegalargumentexception startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate get charge account param as account schema param amount amount for expense revenue return charge account or null public static m account get account int c charge id m acct schema as big decimal amount if c charge id 0 as null return null int acct index 1 expense positive amt if amount null amount signum 0 acct index 2 revenue negative amt string sql select ch expense acct ch revenue acct from c charge acct where c charge id and c acctschema id int account id 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c charge id pstmt set int 2 as getc acctschema id result set rs pstmt execute query if rs next account id rs get int acct index rs close pstmt close catch sql exception e s log log level severe sql e return null no account if account id 0 s log severe no account for c charge id c charge id return null return account m account acct m account get as get ctx account id return acct maccount getaccount c_charge_id macctschema bigdecimal c_charge_id acct_index acct_index ch_expense_acct ch_revenue_acct c_charge_acct c_charge_id c_acctschema_id account_id preparedstatement preparestatement setint c_charge_id setint getc_acctschema_id resultset executequery account_id getint acct_index sqlexception s_log account_id s_log c_charge_id c_charge_id maccount maccount getctx account_id get m charge from cache param ctx context param c charge id id return m charge public static m charge get properties ctx int c charge id integer key new integer c charge id m charge ret value m charge s cache get key if ret value null return ret value ret value new m charge ctx c charge id null if ret value get id 0 s cache put key ret value return ret value mcharge c_charge_id mcharge mcharge c_charge_id c_charge_id mcharge retvalue mcharge s_cache retvalue retvalue retvalue mcharge c_charge_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param c charge id id public m charge properties ctx int c charge id string trx name super ctx c charge id null if c charge id 0 set charge amt env zero set is same currency false set is same tax false set is tax included false n set name null setc taxcategory id 0 c_charge_id mcharge c_charge_id trxname c_charge_id c_charge_id setchargeamt setissamecurrency setissametax setistaxincluded setname setc_taxcategory_id load constructor param ctx ctx param rs result set public m charge properties ctx result set rs string trx name super ctx rs trx name mcharge resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record success insert accounting c charge acct c acctschema default null return success newrecord aftersave newrecord newrecord insert_accounting c_charge_acct c_acctschema_default before delete return true protected boolean before delete return delete accounting c charge acct beforedelete delete_accounting c_charge_acct standard constructor public x ad user orgaccess properties ctx int ad user orgaccess id string trx name super ctx ad user orgaccess id trx name if ad user orgaccess id 0 setad user id 0 set is read only false n x_ad_user_orgaccess ad_user_orgaccess_id trxname ad_user_orgaccess_id trxname ad_user_orgaccess_id setad_user_id setisreadonly load constructor public x ad user orgaccess properties ctx result set rs string trx name super ctx rs trx name x_ad_user_orgaccess resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad user orgaccess append get id append return sb to string tostring stringbuffer stringbuffer x_ad_user_orgaccess get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue standard constructor public x m productdownload properties ctx int m productdownload id string trx name super ctx m productdownload id trx name if m productdownload id 0 set downloadurl null setm productdownload id 0 setm product id 0 set name null x_m_productdownload m_productdownload_id trxname m_productdownload_id trxname m_productdownload_id setdownloadurl setm_productdownload_id setm_product_id setname load constructor public x m productdownload properties ctx result set rs string trx name super ctx rs trx name x_m_productdownload resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m productdownload append get id append return sb to string tostring stringbuffer stringbuffer x_m_productdownload get_id tostring set download url url of the download files public void set downloadurl string downloadurl if downloadurl null throw new illegal argument exception downloadurl is mandatory if downloadurl length 120 log warning length 120 truncated downloadurl downloadurl substring 0 119 set value downloadurl downloadurl setdownloadurl illegalargumentexception set_value get download url url of the download files public string get downloadurl return string get value downloadurl getdownloadurl get_value set product download product downloads public void setm productdownload id int m productdownload id if m productdownload id 1 throw new illegal argument exception m productdownload id is mandatory set valuenocheck m productdownload id new integer m productdownload id setm_productdownload_id m_productdownload_id m_productdownload_id illegalargumentexception m_productdownload_id set_valuenocheck m_productdownload_id m_productdownload_id get product download product downloads public int getm productdownload id integer ii integer get value m productdownload id if ii null return 0 return ii int value getm_productdownload_id get_value m_productdownload_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get reference list param ctx context param ad reference id reference param value value return list or null public static m ref list get properties ctx int ad reference id string value string trx name m ref list ret value null string sql select from ad ref list where ad reference id and value prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad reference id pstmt set string 2 value result set rs pstmt execute query if rs next ret value new m ref list ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return ret value ad_reference_id mreflist ad_reference_id trxname mreflist retvalue ad_ref_list ad_reference_id preparedstatement preparestatement trxname setint ad_reference_id setstring resultset executequery retvalue mreflist trxname sqlexception s_log sqlexception retvalue get reference list value name cached param ctx context param ad reference id reference param value value return list or null public static string get list name properties ctx int ad reference id string value string ad language env getad language ctx string key ad language ad reference id value string ret value string s cache get key if ret value null return ret value boolean is base language env is base language ad language ad ref list string sql is base language select name from ad ref list where ad reference id and value select t name from ad ref list trl t inner join ad ref list r on r ad ref list id t ad ref list id where r ad reference id and r value and t ad language prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad reference id pstmt set string 2 value if is base language pstmt set string 3 ad language result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close pstmt null catch sql exception ex s log log level severe sql key ex try if pstmt null pstmt close catch sql exception ex1 pstmt null save into cache if ret value null ret value s log warning get list name not found key s cache put key ret value return ret value ad_reference_id getlistname ad_reference_id ad_language getad_language ad_language _ ad_reference_id _ retvalue s_cache retvalue retvalue isbaselanguage isbaselanguage ad_language ad_ref_list isbaselanguage ad_ref_list ad_reference_id ad_ref_list_trl ad_ref_list ad_ref_list_id ad_ref_list_id ad_reference_id ad_language preparedstatement preparestatement setint ad_reference_id setstring isbaselanguage setstring ad_language resultset executequery retvalue getstring sqlexception s_log sqlexception retvalue retvalue s_log getlistname s_cache retvalue retvalue get reference list param ad reference id reference param optional if true add return list or null public static value name pair get list int ad reference id boolean optional string sql select value name from ad ref list where ad reference id and is active y order by 1 prepared statement pstmt null array list value name pair list new array list value name pair if optional list add new value name pair try pstmt db prepare statement sql null pstmt set int 1 ad reference id result set rs pstmt execute query while rs next list add new value name pair rs get string 1 rs get string 2 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null value name pair ret value new value name pair list size list to array ret value return ret value ad_reference_id valuenamepair getlist ad_reference_id ad_ref_list ad_reference_id isactive preparedstatement arraylist valuenamepair arraylist valuenamepair valuenamepair preparestatement setint ad_reference_id resultset executequery valuenamepair getstring getstring s_log valuenamepair retvalue valuenamepair toarray retvalue retvalue persistency constructor param ctx context param ad ref list id id public m ref list properties ctx int ad ref list id string trx name super ctx ad ref list id trx name if ad ref list id 0 setad reference id 0 setad ref list id 0 set entity type entitytype usermaintained u set name null set value null ad_ref_list_id mreflist ad_ref_list_id trxname ad_ref_list_id trxname ad_ref_list_id setad_reference_id setad_ref_list_id setentitytype entitytype_usermaintained setname setvalue load contructor param ctx context param rs result public m ref list properties ctx result set rs string trx name super ctx rs trx name mreflist resultset trxname trxname string representation return name public string to string return get name tostring getname persistency constructor param ctx context param r requestaction id id public m request action properties ctx int r requestaction id string trx name super ctx r requestaction id trx name r_requestaction_id mrequestaction r_requestaction_id trxname r_requestaction_id trxname load construtor param ctx context param rs result set public m request action properties ctx result set rs string trx name super ctx rs trx name mrequestaction resultset trxname trxname parent action constructor param request parent param new record new copy all public m request action m request request boolean new record this request get ctx 0 request get trxname set client org request setr request id request getr request id newrecord mrequestaction mrequest newrecord getctx get_trxname setclientorg setr_request_id getr_request_id add null column param column name public void add null column string column name string nc get null columns if nc null set null columns column name else set null columns nc column name columnname addnullcolumn columnname getnullcolumns setnullcolumns columnname setnullcolumns columnname get name of creator return name public string get created by name m user user m user get get ctx get created by return user get name getcreatedbyname muser muser getctx getcreatedby getname get changes as html string return changes public string get changeshtml string buffer sb new string buffer get changehtml sb priority get changehtml sb priority user get changehtml sb r category id get changehtml sb r group id get changehtml sb r requesttype id get changehtml sb r resolution id get changehtml sb r status id get changehtml sb salesrep id get changehtml sb summary get changehtml sb ad org id always stored get changehtml sb ad role id get changehtml sb ad user id get changehtml sb c activity id get changehtml sb c bpartner id get changehtml sb c invoice id get changehtml sb c order id get changehtml sb c payment id get changehtml sb c project id get changehtml sb date next action get changehtml sb is escalated get changehtml sb is invoiced get changehtml sb is self service get changehtml sb m inout id get changehtml sb m product id get changehtml sb m rma id get changehtml sb a asset id if sb length 0 sb append unicode check char chars sb to string to char array sb new string buffer chars length for int i 0 i chars length i char c chars i int ii int c if ii 255 sb append append ii append else sb append c return sb to string getchangeshtml stringbuffer stringbuffer getchangehtml getchangehtml priorityuser getchangehtml r_category_id getchangehtml r_group_id getchangehtml r_requesttype_id getchangehtml r_resolution_id getchangehtml r_status_id getchangehtml salesrep_id getchangehtml getchangehtml ad_org_id getchangehtml ad_role_id getchangehtml ad_user_id getchangehtml c_activity_id getchangehtml c_bpartner_id getchangehtml c_invoice_id getchangehtml c_order_id getchangehtml c_payment_id getchangehtml c_project_id getchangehtml datenextaction getchangehtml isescalated getchangehtml isinvoiced getchangehtml isselfservice getchangehtml m_inout_id getchangehtml m_product_id getchangehtml m_rma_id getchangehtml a_asset_id tostring tochararray stringbuffer tostring get individual change html param sb string to append to param column name column name private void get changehtml string buffer sb string column name if get value column name null if sb length 0 sb append br sb append msg get element get ctx column name append append get displayvalue column name true else string nc get null columns if nc null nc index of column name 1 if sb length 0 sb append br sb append append msg get element get ctx column name append columnname getchangehtml stringbuffer columnname get_value columnname getelement getctx columnname get_displayvalue columnname getnullcolumns indexof columnname getelement getctx columnname before save param new record new return true protected boolean before save boolean new record return true newrecord beforesave newrecord standard constructor param ctx context param ad schedulerlog id id public m scheduler log properties ctx int ad schedulerlog id string trx name super ctx ad schedulerlog id trx name ad_schedulerlog_id mschedulerlog ad_schedulerlog_id trxname ad_schedulerlog_id trxname load constructor param ctx context param rs result set public m scheduler log properties ctx result set rs string trx name super ctx rs trx name mschedulerlog resultset trxname trxname parent constructor param parent parent param summary summary public m scheduler log m scheduler parent string summary this parent get ctx 0 parent get trxname set client org parent setad scheduler id parent getad scheduler id set summary summary mschedulerlog mscheduler getctx get_trxname setclientorg setad_scheduler_id getad_scheduler_id setsummary standard constructor public x c orgassignment properties ctx int c orgassignment id string trx name super ctx c orgassignment id trx name if c orgassignment id 0 setad user id 0 setc orgassignment id 0 set valid from new timestamp system current time millis x_c_orgassignment c_orgassignment_id trxname c_orgassignment_id trxname c_orgassignment_id setad_user_id setc_orgassignment_id setvalidfrom currenttimemillis load constructor public x c orgassignment properties ctx result set rs string trx name super ctx rs trx name x_c_orgassignment resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c orgassignment append get id append return sb to string tostring stringbuffer stringbuffer x_c_orgassignment get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set org assignment assigment to transaction organization public void setc orgassignment id int c orgassignment id if c orgassignment id 1 throw new illegal argument exception c orgassignment id is mandatory set valuenocheck c orgassignment id new integer c orgassignment id setc_orgassignment_id c_orgassignment_id c_orgassignment_id illegalargumentexception c_orgassignment_id set_valuenocheck c_orgassignment_id c_orgassignment_id get org assignment assigment to transaction organization public int getc orgassignment id integer ii integer get value c orgassignment id if ii null return 0 return ii int value getc_orgassignment_id get_value c_orgassignment_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto ide bean constructor for 30 character updateable field public v string this string false false true 30 30 null vstring detail constructor param column name column name param mandatory mandatory param is read only read only param is updateable updateable param display length display length param field length field length param v format format public v string string column name boolean mandatory boolean is read only boolean is updateable int display length int field length string v format string obscure type super display length maxdisplay length maxdisplay length display length super set name column name m columnname column name if v format null v format m vformat v format m fieldlength field length if m vformat length 0 m fieldlength 0 set document new m doc string m vformat m fieldlength this if m vformat length 0 set caret new v ovr caret set mandatory mandatory if obscure type null obscure type length 0 m obscure new obscure obscure type m stdfont get font m obscurefont new font sans serif font italic m stdfont get size add focus listener this editable if is read only is updateable set editable false set background compiereplaf getfieldbackground inactive this add key listener this this add action listener this popup for editor if field length display length add mouse listener new vstring mouseadapter this m editor new c menu item msg get msg env get ctx editor env get image icon editor16 gif m editor add action listener this popup menu add m editor set foreground compiereplaf gettextcolor normal set background compiereplaf getfieldbackground normal columnname isreadonly isupdateable displaylength fieldlength vformat vstring columnname isreadonly isupdateable displaylength fieldlength vformat obscuretype displaylength maxdisplay_length maxdisplay_length displaylength setname columnname m_columnname columnname vformat vformat m_vformat vformat m_fieldlength fieldlength m_vformat m_fieldlength setdocument mdocstring m_vformat m_fieldlength m_vformat setcaret vovrcaret setmandatory obscuretype obscuretype m_obscure obscuretype m_stdfont getfont m_obscurefont sansserif m_stdfont getsize addfocuslistener isreadonly isupdateable seteditable setbackground getfieldbackground_inactive addkeylistener addactionlistener fieldlength displaylength addmouselistener vstring_mouseadapter meditor cmenuitem getmsg getctx getimageicon meditor addactionlistener popupmenu meditor setforeground gettextcolor_normal setbackground getfieldbackground_normal dispose public void dispose m mfield null m_mfield set editor to value param value value public void set value object value log config v string set value value if value null m oldtext else m oldtext value to string only set when not updated here if m setting return set text m oldtext m initialtext m oldtext if r o left justify if is editable is enabled set caret position 0 setvalue vstring setvalue m_oldtext m_oldtext tostring m_setting settext m_oldtext m_initialtext m_oldtext iseditable isenabled setcaretposition property change listener param evt event public void property change property change event evt if evt get property name equals org compiere model m field property set value evt get new value propertychange propertychangeevent getpropertyname mfield setvalue getnewvalue return editor value return value public object get value return get text getvalue gettext return display value return value public string get display return super get text optionally obscured getdisplay gettext key released if escape restore old text param e event public void key released key event e log finest key e get key code e get key char get text esc if e get key code key event vk escape set text m initialtext m setting true try string clear get text fire vetoable change m columnname m oldtext clear catch property veto exception pve m setting false keyreleased keyevent getkeycode getkeychar gettext getkeycode keyevent vk_escape settext m_initialtext m_setting gettext firevetoablechange m_columnname m_oldtext propertyvetoexception m_setting data binding to m table via grid controller enter pressed param e event public void action performed action event e if e get action command equals value preference name if m role get default is show preference value preference start m mfield get value return invoke editor if e get source m editor string s editor start editor this msg translate env get ctx m columnname get text is editable m fieldlength set text s data binding try fire vetoable change m columnname m oldtext get text catch property veto exception pve mtable gridcontroller actionperformed actionevent getactioncommand valuepreference mrole getdefault isshowpreference valuepreference m_mfield getvalue getsource meditor starteditor getctx m_columnname gettext iseditable m_fieldlength settext firevetoablechange m_columnname m_oldtext gettext propertyvetoexception set field window no for value preference param m field field public void set field m field m field m mfield m field if m mfield null m role get default is show preference value preference add menu this popup menu windowno valuepreference mfield setfield mfield mfield m_mfield mfield m_mfield mrole getdefault isshowpreference valuepreference addmenu popupmenu set text optionally obscured param text text public void set text string text if m obscure null m infocus super set font m obscurefont super set text m obscure get obscured value text super set foreground color gray else if m stdfont null super set font m stdfont super set foreground compiereplaf gettextcolor normal super set text text settext m_obscure m_infocus setfont m_obscurefont settext m_obscure getobscuredvalue setforeground m_stdfont setfont m_stdfont setforeground gettextcolor_normal settext get text clear return text public string get text string text super get text if m obscure null text null text length 0 if text equals m obscure get obscured value text m obscure get clear value return text gettext gettext m_obscure m_obscure getobscuredvalue m_obscure getclearvalue focus gained enabled with obscure param e event public void focus gained focus event e m infocus true set text get text clear focusgained focusevent m_infocus settext gettext focus lost enabled with obscure param e event public void focus lost focus event e m infocus false set text get text obscure focuslost focusevent m_infocus settext gettext constructor param adaptee adaptee vstring mouseadapter v string adaptee this adaptee adaptee vstring_mouseadapter vstring mouse listener param e event public void mouse clicked mouse event e popup menu if swing utilities is right mouse button e adaptee popup menu show component e get source e getx e gety mouseclicked mouseevent swingutilities isrightmousebutton popupmenu getsource standard constructor public x c year properties ctx int c year id string trx name super ctx c year id trx name if c year id 0 setc calendar id 0 setc year id 0 set year null x_c_year c_year_id trxname c_year_id trxname c_year_id setc_calendar_id setc_year_id setyear load constructor public x c year properties ctx result set rs string trx name super ctx rs trx name x_c_year resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c year append get id append return sb to string tostring stringbuffer stringbuffer x_c_year get_id tostring set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set valuenocheck c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_valuenocheck c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set year calendar year public void setc year id int c year id if c year id 1 throw new illegal argument exception c year id is mandatory set valuenocheck c year id new integer c year id setc_year_id c_year_id c_year_id illegalargumentexception c_year_id set_valuenocheck c_year_id c_year_id get year calendar year public int getc year id integer ii integer get value c year id if ii null return 0 return ii int value getc_year_id get_value c_year_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set year calendar year public void set year string year if year null throw new illegal argument exception year is mandatory if year length 10 log warning length 10 truncated year year substring 0 9 set value year year setyear illegalargumentexception set_value get year calendar year public string get year return string get value year getyear get_value return string get value year public key name pair get key name pair return new key name pair get id get year get_value keynamepair getkeynamepair keynamepair get_id getyear amtinwords in public amtinwords in super amtinwords_in amtinwords_in convenient method for link say number string buffer long param number number to say return said number public static string say number long number string buffer result new string buffer say number result number return result to string saynumber stringbuffer saynumber stringbuffer stringbuffer saynumber tostring say a number this method will append the result to the given string buffer param append to the string buffer param number number to say return said number throws illegal argument exception if the number equals to link long min value public static string say number string buffer append to long number throws illegal argument exception if number long min value throw new illegal argument exception out of range if number 0 append to append minus long abs math abs number if abs power three say simple number append to int abs else if abs power six int thousand int abs power six power three say simple number append to thousand append to append ribu long remainder abs thousand power three if remainder 0 append to append say number append to remainder else if abs power nine int million int abs power nine power six say simple number append to million append to append juta long remainder abs million power six if remainder 0 append to append say number append to remainder else if abs power twelve int billion int abs power twelve power nine say simple number append to billion append to append milyar long remainder abs billion power nine if remainder 0 append to append say number append to remainder else if abs power fifteen int trillion int abs power fifteen power twelve say simple number append to trillion append to append trilyun long remainder abs trillion power twelve if remainder 0 append to append say number append to remainder else int log int math floor math log abs math log 10 we want to break the number to several billions int log whole log log 12 long power whole long math pow 10 log whole long part abs power whole say number append to part append to append trilyun long remainder abs part power whole if remainder 0 append to append say number append to remainder return append to to string appendto illegalargumentexception min_value saynumber stringbuffer appendto illegalargumentexception min_value illegalargumentexception appendto power_three saysimplenumber appendto power_six power_six power_three saysimplenumber appendto appendto power_three appendto saynumber appendto power_nine power_nine power_six saysimplenumber appendto appendto power_six appendto saynumber appendto power_twelve power_twelve power_nine saysimplenumber appendto appendto power_nine appendto saynumber appendto power_fifteen power_fifteen power_twelve saysimplenumber appendto appendto power_twelve appendto saynumber appendto logwhole powerwhole logwhole powerwhole saynumber appendto appendto powerwhole appendto saynumber appendto appendto tostring static void say simple number string buffer append to int number assert number 1000 number 0 must be between 0 and 1000 if number 12 assert number 12 number 0 must be between 0 and 11 append to append basenumbers number else if number 20 assert number 12 number 19 must be between 12 and 19 int belasan number 10 append to append basenumbers belasan append to append belas else if number 100 assert number 20 number 99 must be between 20 and 99 int puluhan number 10 append to append basenumbers puluhan append to append puluh int remainder number puluhan 10 if remainder 0 append to append say simple number append to remainder else if number 200 assert number 100 number 199 must be between 100 and 199 append to append seratus int remainder number 100 if remainder 0 append to append say simple number append to remainder else if number 0 assert number 200 number 999 must be between 200 and 999 int ratusan number 1000 100 assert ratusan 0 ratusan 10 1 9 append to append basenumbers ratusan append to append ratus int remainder number ratusan 100 if remainder 0 append to append say simple number append to remainder saysimplenumber stringbuffer appendto appendto appendto appendto appendto appendto appendto saysimplenumber appendto appendto appendto saysimplenumber appendto appendto appendto appendto saysimplenumber appendto get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 public string get amt in words string amount throws exception if amount null return amount amount amount replace all float num float float parse float amount long number 0l number long num float return amtinwords in say number number getamtinwords replaceall numfloat parsefloat numfloat amtinwords_in saynumber test print param amt amount private void print string amt try system out println amt get amt in words amt catch exception e e print stack trace getamtinwords printstacktrace test param args ignored public static void main string args amtinwords in aiw new amtinwords in i doubt decimal support for rupiah is still needed aiw print 23 aiw print 948 776 477 778 778 778 aiw print 1 79 aiw print 12 345 aiw print 123 45 aiw print 1234 56 aiw print 12345 78 aiw print 123457 89 aiw print 1 234 578 90 amtinwords_in amtinwords_in standard constructor public x k entryrelated properties ctx int k entryrelated id string trx name super ctx k entryrelated id trx name if k entryrelated id 0 setk entryrelated id 0 setk entry id 0 x_k_entryrelated k_entryrelated_id trxname k_entryrelated_id trxname k_entryrelated_id setk_entryrelated_id setk_entry_id load constructor public x k entryrelated properties ctx result set rs string trx name super ctx rs trx name x_k_entryrelated resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k entryrelated append get id append return sb to string tostring stringbuffer stringbuffer x_k_entryrelated get_id tostring public static final int k entryrelated id ad reference id 285 set related entry related entry for this enntry public void setk entryrelated id int k entryrelated id if k entryrelated id 1 throw new illegal argument exception k entryrelated id is mandatory set valuenocheck k entryrelated id new integer k entryrelated id k_entryrelated_id_ad_reference_id setk_entryrelated_id k_entryrelated_id k_entryrelated_id illegalargumentexception k_entryrelated_id set_valuenocheck k_entryrelated_id k_entryrelated_id get related entry related entry for this enntry public int getk entryrelated id integer ii integer get value k entryrelated id if ii null return 0 return ii int value getk_entryrelated_id get_value k_entryrelated_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getk entryrelated id intvalue keynamepair getkeynamepair keynamepair get_id valueof getk_entryrelated_id set entry knowledge entry public void setk entry id int k entry id if k entry id 1 throw new illegal argument exception k entry id is mandatory set valuenocheck k entry id new integer k entry id setk_entry_id k_entry_id k_entry_id illegalargumentexception k_entry_id set_valuenocheck k_entry_id k_entry_id get entry knowledge entry public int getk entry id integer ii integer get value k entry id if ii null return 0 return ii int value getk_entry_id get_value k_entry_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value standard constructor param ctx context param c revenuerecognition plan id id public m revenue recognition plan properties ctx int c revenuerecognition plan id string trx name super ctx c revenuerecognition plan id trx name if c revenuerecognition plan id 0 setc acctschema id 0 setc currency id 0 setc invoiceline id 0 setc revenuerecognition id 0 setc revenuerecognition plan id 0 setp revenue acct 0 setunearnedrevenue acct 0 set total amt env zero set recognized amt env zero c_revenuerecognition_plan_id mrevenuerecognitionplan c_revenuerecognition_plan_id trxname c_revenuerecognition_plan_id trxname c_revenuerecognition_plan_id setc_acctschema_id setc_currency_id setc_invoiceline_id setc_revenuerecognition_id setc_revenuerecognition_plan_id setp_revenue_acct setunearnedrevenue_acct settotalamt setrecognizedamt load constructor param ctx context param rs result set public m revenue recognition plan properties ctx result set rs string trx name super ctx rs trx name mrevenuerecognitionplan resultset trxname trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record m revenue recognition rr new m revenue recognition get ctx getc revenuerecognition id get trxname if rr is time based get invoive qty select qty invoiced m product id into v qty v m product id from c invoiceline where c invoiceline id new c invoiceline id insert ad sequence next c servicelevel new ad client id v nextno insert into c servicelevel c servicelevel id c revenuerecognition plan id ad client id ad org id is active created created by updated updated by m product id description service level invoiced service level provided processing processed values v nextno new c revenuerecognition plan id new ad client id new ad org id y sys date new created by sys date new updated by v m product id null v qty 0 n n return success newrecord aftersave newrecord newrecord mrevenuerecognition mrevenuerecognition getctx getc_revenuerecognition_id get_trxname istimebased invoiveqty qtyinvoiced m_product_id v_qty v_m_product_id c_invoiceline c_invoiceline_id c_invoiceline_id ad_sequence_next c_servicelevel ad_client_id v_nextno c_servicelevel c_servicelevel_id c_revenuerecognition_plan_id ad_client_id ad_org_id isactive createdby updatedby m_product_id servicelevelinvoiced servicelevelprovided v_nextno c_revenuerecognition_plan_id ad_client_id ad_org_id sysdate createdby sysdate updatedby v_m_product_id v_qty basic constructor use set methods public ol basic constructor use set methods param list an array of li objects to be added to the ol element public ol li list add element list addelement basic constructor use set methods param list an array of strings to be made into li objects and br added to the ol element public ol string list add element list addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ol add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ol add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry add a list to the ul param list a list of li objects public ol add element li list for int x 0 x list length x add element list x return this addelement addelement adds an element to the element param element adds an element to the element public ol add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public ol add element string element add element to registry element return this addelement addelementtoregistry add a list to the ol param list a list of strings to be converted to li objects public ol add element string element li li new li add element element add element li return this addelement addelement addelement removes an element from the element param hashcode the name of the element to be removed public ol remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute init param window no param frame public void init int window no form frame frame log fine m windowno window no m frame frame try top selection panel m frame get content pane add selection panel border layout north center init panel c scroll pane scroll new c scroll pane this m frame get content pane add scroll border layout center south confirm panel add action listener this m frame get content pane add confirm panel border layout south catch exception e log log level severe e size it windowno windowno formframe m_windowno windowno m_frame m_frame getcontentpane selectionpanel borderlayout initpanel cscrollpane cscrollpane m_frame getcontentpane borderlayout confirmpanel addactionlistener m_frame getcontentpane confirmpanel borderlayout sizeit size window private void size it frame m frame pack dimension size m frame get preferred size size width window width m frame set size size sizeit m_frame m_frame getpreferredsize window_width m_frame setsize dispose public void dispose if m frame null m frame dispose m frame null remove all m_frame m_frame m_frame removeall init panel private void init panel box layout layout new box layout this box layout page axis m goal goals m goal get goals env get ctx for int i 0 i goals length i performance indicator pi new performance indicator goals i pi add action listener this add pi initpanel boxlayout boxlayout boxlayout page_axis mgoal mgoal getgoals getctx performanceindicator performanceindicator addactionlistener action listener for drill down param e event public void action performed action event e if e get action command equals confirm panel a ok dispose else if e get source instanceof performance indicator performance indicator pi performance indicator e get source log info pi get name m goal goal pi get goal if goal get measure null new performance detail goal actionperformed actionevent getactioncommand confirmpanel a_ok getsource performanceindicator performanceindicator performanceindicator getsource getname mgoal getgoal getmeasure performancedetail initialize global variables param config configuration throws servlet exception public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception workflow servlet init servletexception servletconfig servletexception webenv initweb servletexception workflowservlet get servlet information return info public string get servlet info return a dempiere web workflow servlet getservletinfo adempiere clean up resources public void destroy log fine destroy process the http get request sends web request page param request request param response response throws servlet exception throws io exception public void do get http servlet request request http servlet response response throws servlet exception io exception log info do get from request get remote host request get remote addr forward to notes jsp string url notes jsp http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message info info info session get attribute info name if info null info set message parameter activity id if valid and belongs to wu then create pdf stream it string msg stream attachment request response if msg null msg length 0 return if info null info set message msg log info do get forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception doget httpservletrequest httpservletresponse servletexception ioexception doget getremotehost getremoteaddr httpsession getsession getattribute removeattribute websessionctx hdr_message getattribute setmessage activity_id streamattachment setmessage doget requestdispatcher getservletcontext getrequestdispatcher stream attachment param request request param response response return or error message private string stream attachment http servlet request request http servlet response response get activity id int ad wf activity id web util get parameter as int request p wf activity id if ad wf activity id 0 log fine stream attachment no ad wf activity id return no activity id int attachment index web util get parameter as int request p attachment index if attachment index 0 log fine stream attachment no index return no request attachment index log info stream attachment ad wf activity id ad wf activity id attachment index get note properties ctx jsp env get ctx request mwf activity doc new mwf activity ctx ad wf activity id null if doc get id ad wf activity id log fine stream attachment activity not found id ad wf activity id return activity not found m attachment attachment doc get attachment false if attachment null log fine stream attachment no attachment for ad wf activity id ad wf activity id return notice attachment not found get web user compare with invoice http session session request get session true web user wu web user session get attribute web user name if wu getad user id doc getad user id log warning stream attachment ad wf activity id ad wf activity id user activity doc getad user id web user wu getad user id return your activity not found stream it return web util stream attachment response attachment attachment index streamattachment httpservletrequest httpservletresponse ad_wf_activity_id webutil getparameterasint p_wf_activity_id ad_wf_activity_id streamattachment ad_wf_activity_id attachmentindex webutil getparameterasint p_attachment_index attachmentindex streamattachment streamattachment ad_wf_activity_id ad_wf_activity_id attachmentindex jspenv getctx mwfactivity mwfactivity ad_wf_activity_id get_id ad_wf_activity_id streamattachment ad_wf_activity_id mattachment getattachment streamattachment ad_wf_activity_id ad_wf_activity_id webuser httpsession getsession webuser webuser getattribute webuser getad_user_id getad_user_id streamattachment ad_wf_activity_id ad_wf_activity_id user_activity getad_user_id web_user getad_user_id webutil streamattachment attachmentindex process the http post request param request request param response response throws servlet exception throws io exception public void do post http servlet request request http servlet response response throws servlet exception io exception log info do post from request get remote host request get remote addr string url notes jsp log set trace level 9 web env dump request http session session request get session false if session null session get attribute info name null url login jsp else session remove attribute web session ctx hdr message properties ctx jsp env get ctx request web user wu web user session get attribute web user name if wu null log warning do post no web user response send redirect login servlet forward to note jsp entry return get feedback int ad wf activity id web util get parameter as int request p wf activity id boolean is confirmed web util get parameter as boolean request is confirmed boolean is approved web util get parameter as boolean request is approved boolean is rejected web util get parameter as boolean request is approved string text msg web util get parameter request text msg log fine do post text msg text msg mwf activity act new mwf activity ctx ad wf activity id null log fine do post act if ad wf activity id 0 act null act getad wf activity id ad wf activity id session set attribute web session ctx hdr message activity not found else if act is user approval is approved is rejected try act set user choice wu getad user id is approved y n display type yes no text msg act save catch exception e approval else if act is user manual is confirmed act set user confirmation wu getad user id text msg act save else if text msg null text msg length 0 act set text msg text msg act save log info do get forward to url request dispatcher dispatcher get servlet context get request dispatcher url dispatcher forward request response servletexception ioexception dopost httpservletrequest httpservletresponse servletexception ioexception dopost getremotehost getremoteaddr settracelevel webenv httpsession getsession getattribute removeattribute websessionctx hdr_message jspenv getctx webuser webuser getattribute webuser dopost sendredirect loginservlet forwardto ad_wf_activity_id webutil getparameterasint p_wf_activity_id isconfirmed webutil getparameterasboolean isconfirmed isapproved webutil getparameterasboolean isapproved isrejected webutil getparameterasboolean isapproved textmsg webutil getparameter textmsg dopost textmsg textmsg mwfactivity mwfactivity ad_wf_activity_id dopost ad_wf_activity_id getad_wf_activity_id ad_wf_activity_id setattribute websessionctx hdr_message isuserapproval isapproved isrejected setuserchoice getad_user_id isapproved displaytype yesno textmsg isusermanual isconfirmed setuserconfirmation getad_user_id textmsg textmsg textmsg settextmsg textmsg doget requestdispatcher getservletcontext getrequestdispatcher standard constructor public x c bp employee acct properties ctx int c bp employee acct id string trx name super ctx c bp employee acct id trx name if c bp employee acct id 0 setc acctschema id 0 setc bpartner id 0 sete expense acct 0 sete prepayment acct 0 x_c_bp_employee_acct c_bp_employee_acct_id trxname c_bp_employee_acct_id trxname c_bp_employee_acct_id setc_acctschema_id setc_bpartner_id sete_expense_acct sete_prepayment_acct load constructor public x c bp employee acct properties ctx result set rs string trx name super ctx rs trx name x_c_bp_employee_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp employee acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_employee_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set employee expense account for employee expenses public void sete expense acct int e expense acct set value e expense acct new integer e expense acct sete_expense_acct e_expense_acct set_value e_expense_acct e_expense_acct get employee expense account for employee expenses public int gete expense acct integer ii integer get value e expense acct if ii null return 0 return ii int value gete_expense_acct get_value e_expense_acct intvalue set employee prepayment account for employee expense prepayments public void sete prepayment acct int e prepayment acct set value e prepayment acct new integer e prepayment acct sete_prepayment_acct e_prepayment_acct set_value e_prepayment_acct e_prepayment_acct get employee prepayment account for employee expense prepayments public int gete prepayment acct integer ii integer get value e prepayment acct if ii null return 0 return ii int value gete_prepayment_acct get_value e_prepayment_acct intvalue postgresql database public db postgresql db_postgresql get database name return database short name public string get name return database db postgresql getname db_postgresql get database description return database long name and version public string get description begin vpj cd e evolution 30 09 2005 return s driver to string try if s driver null get driver catch exception e if s driver null return s driver to string return no driver end vpj cd e evolution 30 09 2005 getdescription s_driver tostring s_driver getdriver s_driver s_driver tostring get standard jdbc port return standard port public int get standard port return default port getstandardport default_port get and register database driver return driver public java sql driver get driver throws sql exception if s driver null s driver new org postgresql driver driver manager register driver s driver driver manager set login timeout database connection timeout return s driver getdriver sqlexception s_driver s_driver drivermanager registerdriver s_driver drivermanager setlogintimeout connection_timeout s_driver get database connection string requirements createdb e unicode compiere param connection connection descriptor return connection string public string get connectionurl c connection connection jdbc postgresql hostname portnumber databasename encoding unicode string buffer sb new string buffer jdbc postgresql sb append append connection get db host append append connection get db port append append connection get db name append encoding unicode m connection sb to string return m connection getconnectionurl cconnection stringbuffer stringbuffer getdbhost getdbport getdbname m_connection tostring m_connection get connection url param db host db host param db port db port param db name sb name param user name user name return connection url public string get connectionurl string db host int db port string db name string user name return jdbc postgresql db host db port db name dbhost dbport dbname username getconnectionurl dbhost dbport dbname username dbhost dbport dbname get jdbc catalog return catalog database name public string get catalog if m dbname null return m dbname log severe database name not set yet call get connectionurl first return null getcatalog m_dbname m_dbname getconnectionurl get jdbc schema return schema dbo public string get schema begin vpj cd e evolution 03 04 2005 return adempiere end vpj cd e evolution 03 04 2005 getschema supports blob return true if blob is supported public boolean supportsblob return true string representation return info public string to string string buffer sb new string buffer db postgresql sb append m connection append return sb to string tostring stringbuffer stringbuffer db_postgresql m_connection tostring get status return status info public string get status return getstatus convert an individual oracle style statements to target database statement syntax param ora statement return converted statement throws exception public string convert statement string ora statement string ret value m convert convert ora statement begin vpj cd e evolution 03 14 2005 if ret value length 0 return ora statement end vpj cd e evolution 03 14 2005 if ret value null begin vpj cd 24 06 2005 e evolution log log level severe db postgresql convert statement not converted ora statement m convert get conversion error throw new illegal argument exception db postgresql convert statement not converted ora statement m convert get conversion error end vpj cd 24 06 2005 e evolution if ret value length 1 begin vpj cd 24 06 2005 e evolution log log level severe db postgresql convert statement convert command number ret value length ora statement m convert get conversion error throw new illegal argument exception db postgresql convert statement convert command number ret value length ora statement m convert get conversion error end vpj cd 24 06 2005 e evolution diagnostics show changed but not if ad error if ora statement equals ret value 0 ret value 0 index of ad error 1 begin vpj cd 24 06 2005 e evolution system out println postgresql ret value 0 ora statement log log level info postgresql ret value 0 ora statement end vpj cd 24 06 2005 e evolution return ret value 0 orastatement convertstatement orastatement retvalue m_convert orastatement retvalue orastatement retvalue db_postgresql convertstatement orastatement m_convert getconversionerror illegalargumentexception db_postgresql convertstatement orastatement m_convert getconversionerror retvalue db_postgresql convertstatement retvalue orastatement m_convert getconversionerror illegalargumentexception db_postgresql convertstatement retvalue orastatement m_convert getconversionerror ad_error orastatement retvalue retvalue indexof ad_error retvalue orastatement retvalue orastatement retvalue get name of system user return e g sa system public string get system user return postgres getsystemuser get name of system database param database name database name return e g master or database name public string get system database string database name return template1 databasename getsystemdatabase databasename create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return to date 2001 01 30 18 10 20 yyyy mm dd hh24 mi ss or to date 2001 01 30 yyyy mm dd public string to date timestamp time boolean day only if time null if day only return current date return current date string buffer date string new string buffer to date yyyy mm dd hh24 mi ss mmmm jdbc timestamp format string my date time to string if day only date string append my date substring 0 10 date string append yyyy mm dd else date string append my date substring 0 my date index of cut off miliseconds date string append yyyy mm dd hh24 mi ss return date string to string dayonly to_date to_date to_date dayonly dayonly current_date current_date stringbuffer datestring stringbuffer to_date mydate tostring dayonly datestring mydate datestring datestring mydate mydate indexof datestring datestring tostring create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env public string to char string column name int display type string ad language string buffer ret value new string buffer cast ret value append column name ret value append as text numbers if display type is numeric display type if display type display type amount ret value append as text else ret value append as text if language is decimal point ad language reversed ret value append nls numeric characters else if display type is date display type ret value append append language get language ad language getd bdate pattern append ret value append return ret value to string columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype to_char columnname displaytype ad_language stringbuffer retvalue stringbuffer retvalue columnname retvalue displaytype isnumeric displaytype displaytype displaytype retvalue retvalue isdecimalpoint ad_language retvalue nls_numeric_characters displaytype isdate displaytype retvalue getlanguage ad_language getdbdatepattern retvalue retvalue tostring return number as string for insert statements with correct precision param number number param display type display type return number as string public string to number big decimal number int display type if number null return null big decimal result number int scale display type get default precision display type if scale number scale try result number set scale scale big decimal round half up catch exception e log severe number number scale e get message return result to string displaytype to_number bigdecimal displaytype bigdecimal displaytype getdefaultprecision displaytype setscale bigdecimal round_half_up getmessage tostring get sql commands param cmd type cmd return array of commands to be executed public string get commands int cmd type if cmd create user cmd type return new string create user compiere if cmd create database cmd type return new string create database compiere owner compiere grant all privileges on compiere to compiere create schema compiere set search path to compiere if cmd drop database cmd type return new string drop database compiere return null cmdtype cmd_ getcommands cmdtype cmd_create_user cmdtype cmd_create_database cmdtype search_path cmd_drop_database cmdtype get row set param rs result set return row set throws sql exception public row set get row set java sql result set rs throws sql exception throw new unsupported operation exception postgresql does not support row sets rowset resultset rowset sqlexception rowset getrowset resultset sqlexception unsupportedoperationexception rowsets get cached connection param connection connection param auto commit auto commit param transaction isolation trx isolation return connection throws exception public connection get cached connection c connection connection boolean auto commit int transaction isolation throws exception if m ds null get data source connection connection conn m ds get connection connection conn get driver connection connection conn set auto commit auto commit conn set transaction isolation transaction isolation return conn autocommit transactionisolation getcachedconnection cconnection autocommit transactionisolation m_ds getdatasource m_ds getconnection getdriverconnection setautocommit autocommit settransactionisolation transactionisolation create data source client param connection connection return data dource public data source get data source c connection connection throw new unsupported operation exception not supported implemented if m ds null return m ds org postgresql ds pg pooling data source ds new org postgresql ds pg pooling data source org postgresql jdbc3 jdbc3 pooling data source ds new org postgresql jdbc3 jdbc3 pooling data source ds set data source name compiereds ds set server name connection get db host ds set database name connection get db name ds set user connection get db uid ds set password connection get db pwd ds set port number connection get db port ds set max connections 50 ds set initial connections 20 new initial context rebind data source source m ds ds return m ds datasource datasource getdatasource cconnection unsupportedoperationexception m_ds m_ds pgpoolingdatasource pgpoolingdatasource jdbc3poolingdatasource jdbc3poolingdatasource setdatasourcename setservername getdbhost setdatabasename getdbname setuser getdbuid setpassword getdbpwd setportnumber getdbport setmaxconnections setinitialconnections initialcontext datasource m_ds m_ds create pooled data source server param connection connection return data dource public connection pool data source create pool data source c connection connection throw new unsupported operation exception not supported implemented datasource connectionpooldatasource createpooldatasource cconnection unsupportedoperationexception get connection from driver param connection info return connection or null public connection get driver connection c connection connection throws sql exception get driver return driver manager get connection get connectionurl connection connection get db uid connection get db pwd getdriverconnection cconnection sqlexception getdriver drivermanager getconnection getconnectionurl getdbuid getdbpwd get driver connection param db url url param db uid user param db pwd password return connection throws sql exception public connection get driver connection string db url string db uid string db pwd throws sql exception get driver return driver manager get connection db url db uid db pwd dburl dbuid dbpwd sqlexception getdriverconnection dburl dbuid dbpwd sqlexception getdriver drivermanager getconnection dburl dbuid dbpwd close public void close log config to string if m ds null try m ds close catch exception e e print stack trace m ds null tostring m_ds m_ds printstacktrace m_ds test param args ignored public static void main string args db postgresql postgresql new db postgresql string database name adempiere string uid adempiere string pwd adempiere string jdbcurl postgresql get connectionurl vpj default port database name uid system out println jdbcurl try postgresql get driver connection conn driver manager get connection jdbcurl uid pwd cached row set impl crs null crs new cached row set impl crs set sync provider com sun rowset providers ri optimistic provider crs set concurrency result set concur read only crs set type result set type scroll insensitive crs set command select from ad client crs execute conn conn close conn null catch exception ex ex print stack trace db_postgresql db_postgresql databasename getconnectionurl default_port databasename getdriver drivermanager getconnection cachedrowsetimpl cachedrowsetimpl setsyncprovider rioptimisticprovider setconcurrency resultset concur_read_only settype resultset type_scroll_insensitive setcommand ad_client printstacktrace constructor 0 0 public dimension2d impl dimension2dimpl constructor 0 0 param dim dimension public dimension2d impl dimension dim set size dim dimension2dimpl setsize constructor 0 0 param width width param height height public dimension2d impl double width double height set size width height dimension2dimpl setsize set size param width width param height height public void set size double width double height this width width this height height setsize set size param dim dimension public void set size dimension dim this width dim get width this height dim get height setsize getwidth getheight add size below existing param d width width to increase if below param d height height to add public void add below double d width double d height if this width d width this width d width this height d height dwidth dheight addbelow dwidth dheight dwidth dwidth dheight add size below existing param dim add dimension public void add below dimension dim add below dim width dim height addbelow addbelow round to next int value public void round up width math ceil width height math ceil height roundup get width return width public double get width return width getwidth get height return height public double get height return height getheight hash code return hash code public int hash code long bits double double to long bits width bits double double to long bits height 31 return int bits int bits 32 hashcode doubletolongbits doubletolongbits equals param obj object return true if w h is same public boolean equals object obj if obj null obj instanceof dimension2d dimension2d d dimension2d obj if d get width width d get height height return true return false getwidth getheight string representation return info public string to string string buffer sb new string buffer sb append dimension2d w append width append h append height append return sb to string tostring stringbuffer stringbuffer tostring standard constructor param frame frame param modal modal param window no window no param value query value name or value if contains numbers param isso trx if false query vendors only param multi selection multiple selection param where clause where clause public infob partner frame frame boolean modal int window no string value boolean isso trx boolean multi selection string where clause super frame modal window no c bpartner c bpartner id multi selection where clause log info value set title msg get msg env get ctx infob partner m issotrx isso trx stat init init info value where clause int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no auto query if value null value length 0 execute query p loadedok true focus field value request focus a env position center window frame this windowno windowno issotrx multiselection whereclause infobpartner windowno issotrx multiselection whereclause windowno c_bpartner c_bpartner_id multiselection whereclause settitle getmsg getctx infobpartner m_issotrx issotrx statinit initinfo whereclause p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring autoquery executequery p_loadedok fieldvalue requestfocus aenv positioncenterwindow static setup add fields to parameter panel private void stat init label value set text msg get msg env get ctx value field value set background compiereplaf get info background field value add action listener this label name set text msg get msg env get ctx name field name set background compiereplaf get info background field name add action listener this label contact set text msg get msg env get ctx contact field contact set background compiereplaf get info background field contact add action listener this labele mail set text msg get msg env get ctx e mail fielde mail set background compiereplaf get info background fielde mail add action listener this label postal set text msg get msg env get ctx postal field postal set background compiereplaf get info background field postal add action listener this label phone set text msg translate env get ctx phone field phone set background compiereplaf get info background field phone add action listener this checkand set text msg get msg env get ctx searchand checkand set tool tip text msg get msg env get ctx searchand info checkand set selected true checkand add action listener this if m issotrx check customer set text msg get msg env get ctx only customers else check customer set text msg get msg env get ctx only vendors check customer set selected true check customer set focusable false check customer set request focus enabled false check customer add action listener this parameter panel set layout new a layout parameter panel add label value new a layout constraint 0 0 parameter panel add field value null parameter panel add label contact null parameter panel add field contact null parameter panel add label phone null parameter panel add field phone null parameter panel add check customer null parameter panel add label name new a layout constraint 1 0 parameter panel add field name null parameter panel add labele mail null parameter panel add fielde mail null parameter panel add label postal null parameter panel add field postal null parameter panel add checkand null parameterpanel statinit labelvalue settext getmsg getctx fieldvalue setbackground getinfobackground fieldvalue addactionlistener labelname settext getmsg getctx fieldname setbackground getinfobackground fieldname addactionlistener labelcontact settext getmsg getctx fieldcontact setbackground getinfobackground fieldcontact addactionlistener labelemail settext getmsg getctx email fieldemail setbackground getinfobackground fieldemail addactionlistener labelpostal settext getmsg getctx fieldpostal setbackground getinfobackground fieldpostal addactionlistener labelphone settext getctx fieldphone setbackground getinfobackground fieldphone addactionlistener settext getmsg getctx settooltiptext getmsg getctx searchandinfo setselected addactionlistener m_issotrx checkcustomer settext getmsg getctx onlycustomers checkcustomer settext getmsg getctx onlyvendors checkcustomer setselected checkcustomer setfocusable checkcustomer setrequestfocusenabled checkcustomer addactionlistener parameterpanel setlayout alayout parameterpanel labelvalue alayoutconstraint parameterpanel fieldvalue parameterpanel labelcontact parameterpanel fieldcontact parameterpanel labelphone parameterpanel fieldphone parameterpanel checkcustomer parameterpanel labelname alayoutconstraint parameterpanel fieldname parameterpanel labelemail parameterpanel fieldemail parameterpanel labelpostal parameterpanel fieldpostal parameterpanel dynamic init param value value param where clause where clause private void init info string value string where clause from c bpartner left outer join c bpartner location l on c bpartner c bpartner id l c bpartner id and l is active y left outer join ad user c on c bpartner c bpartner id c c bpartner id and c c bpartner location id is null or c c bpartner location id l c bpartner location id and c is active y left outer join c location a on l c location id a c location id create grid string buffer where new string buffer where append c bpartner is summary n and c bpartner is active y if where clause null where clause length 0 where append and append where clause prepare table s partnerlayout s partnerfrom where to string c bpartner value get indexes for int i 0 i p layout length i if p layout i geti dcolsql index of ad user id 1 m ad user id index i if p layout i geti dcolsql index of c bpartner location id 1 m c bpartner location id index i set value if value null value if value ends with value put query string in name if not numeric if value equals field name set text value no numbers entered else if value index of 0 value index of 1 value index of 2 value index of 3 value index of 4 value index of 5 value index of 6 value index of 7 value index of 8 value index of 9 10 if value starts with field name set text value else field name set text value number entered else field value set text value whereclause initinfo whereclause c_bpartner c_bpartner_location c_bpartner c_bpartner_id c_bpartner_id isactive ad_user c_bpartner c_bpartner_id c_bpartner_id c_bpartner_location_id c_bpartner_location_id c_bpartner_location_id isactive c_location c_location_id c_location_id stringbuffer stringbuffer c_bpartner issummary c_bpartner isactive whereclause whereclause whereclause preparetable s_partnerlayout s_partnerfrom tostring c_bpartner p_layout p_layout getidcolsql indexof ad_user_id m_ad_user_id_index p_layout getidcolsql indexof c_bpartner_location_id m_c_bpartner_location_id_index endswith fieldname settext indexof indexof indexof indexof indexof indexof indexof indexof indexof indexof startswith fieldname settext fieldname settext fieldvalue settext construct sql where clause and define parameters set parameters needs to set parameters includes first and return where clause string getsql where array list string list new array list string value string value field value get text to upper case if value equals value equals list add upper c bpartner value like name string name field name get text to upper case if name equals name equals list add upper c bpartner name like contact string contact field contact get text to upper case if contact equals contact equals list add upper c name like e mail string email fielde mail get text to upper case if email equals email equals list add upper c e mail like phone string phone field phone get text to upper case if phone equals phone equals list add upper c phone like postal string postal field postal get text to upper case if postal equals postal equals list add upper a postal like string buffer sql new string buffer int size list size just one if size 1 sql append and append list get 0 else if size 1 boolean and checkand is selected sql append and if and sql append for int i 0 i size i if i 0 sql append and and or sql append list get i if and sql append static sql if check customer is selected sql append and if m issotrx sql append c bpartner is customer y else sql append c bpartner is vendor y return sql to string setparameters getsqlwhere arraylist arraylist fieldvalue gettext touppercase c_bpartner fieldname gettext touppercase c_bpartner fieldcontact gettext touppercase email fieldemail gettext touppercase email fieldphone gettext touppercase fieldpostal gettext touppercase stringbuffer stringbuffer isselected checkcustomer isselected m_issotrx c_bpartner iscustomer c_bpartner isvendor tostring set parameters for query as defined in getsql where param pstmt pstmt param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 value string value field value get text to upper case if value equals value equals if value ends with value pstmt set string index value log fine value value name string name field name get text to upper case if name equals name equals if name ends with name pstmt set string index name log fine name name contact string contact field contact get text to upper case if contact equals contact equals if contact ends with contact pstmt set string index contact log fine contact contact e mail string email fielde mail get text to upper case if email equals email equals if email ends with email pstmt set string index email log fine e mail email phone string phone field phone get text to upper case if phone equals phone equals if phone ends with phone pstmt set string index phone log fine phone phone postal string postal field postal get text to upper case if postal equals postal equals if postal ends with postal pstmt set string index postal log fine postal postal getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fieldvalue gettext touppercase endswith setstring fieldname gettext touppercase endswith setstring fieldcontact gettext touppercase endswith setstring email fieldemail gettext touppercase endswith setstring email fieldphone gettext touppercase endswith setstring fieldpostal gettext touppercase endswith setstring save selection details get location partner info public void save selection detail int row p table get selected row if row 1 return int ad user id 0 int c bpartner location id 0 if m ad user id index 1 object data p table get model get value at row m ad user id index if data instanceof key name pair ad user id key name pair data get key if m c bpartner location id index 1 object data p table get model get value at row m c bpartner location id index if data instanceof key name pair c bpartner location id key name pair data get key publish for callout to read integer id get selected row key env set context env get ctx env window info env tab info c bpartner id id null 0 id to string env set context env get ctx env window info env tab info ad user id string value of ad user id env set context env get ctx env window info env tab info c bpartner location id string value of c bpartner location id saveselectiondetail p_table getselectedrow ad_user_id c_bpartner_location_id m_ad_user_id_index p_table getmodel getvalueat m_ad_user_id_index keynamepair ad_user_id keynamepair getkey m_c_bpartner_location_id_index p_table getmodel getvalueat m_c_bpartner_location_id_index keynamepair c_bpartner_location_id keynamepair getkey getselectedrowkey setcontext getctx window_info tab_info c_bpartner_id tostring setcontext getctx window_info tab_info ad_user_id valueof ad_user_id setcontext getctx window_info tab_info c_bpartner_location_id valueof c_bpartner_location_id show history void show history log info integer c bpartner id get selected row key if c bpartner id null return invoice history ih new invoice history this c bpartner id int value 0 0 0 ih set visible true ih null showhistory c_bpartner_id getselectedrowkey c_bpartner_id invoicehistory invoicehistory c_bpartner_id intvalue setvisible has history return true boolean has history return true hashistory zoom void zoom log info infob partner zoom integer c bpartner id get selected row key if c bpartner id null return a env zoom mb partner table id c bpartner id int value true so m query query new m query c bpartner query add restriction c bpartner id m query equal c bpartner id query set record count 1 int ad windowno getad window id c bpartner true so zoom ad windowno query infobpartner c_bpartner_id getselectedrowkey c_bpartner_id aenv mbpartner table_id c_bpartner_id intvalue mquery mquery c_bpartner addrestriction c_bpartner_id mquery c_bpartner_id setrecordcount ad_windowno getad_window_id c_bpartner ad_windowno has zoom return true boolean has zoom return true haszoom customize void customize log info infob partner customize infobpartner has customize return false boolean has customize return false for now hascustomize compiere button listener param b button public compiere button listener abstract button b super b compierebuttonlistener abstractbutton install keyboard actions param c component public void install keyboard actions j component c super install keyboard actions c update mnemonic bindingx abstract button c installkeyboardactions jcomponent installkeyboardactions updatemnemonicbindingx abstractbutton property change param e event public void property change property change event e string prop e get property name if prop abstract button mnemonic changed property update mnemonic bindingx abstract button e get source else super property change e propertychange propertychangeevent getpropertyname abstractbutton mnemonic_changed_property updatemnemonicbindingx abstractbutton getsource propertychange update mnemonic binding param b button void update mnemonic bindingx abstract button b int m b get mnemonic if m 0 input map map swing utilities getui input map b j component when in focused window if map null map new component input mapui resource b swing utilities replaceui input map b j component when in focused window map map clear string class name b get class get name int mask input event alt mask default buttons if b instanceof j check box in tab class name index of v button 1 mask input event shift mask input event ctrl mask map put key stroke get key stroke m mask false pressed map put key stroke get key stroke m mask true released map put key stroke get key stroke m 0 true released else input map map swing utilities getui input map b j component when in focused window if map null map clear updatemnemonicbindingx abstractbutton getmnemonic inputmap swingutilities getuiinputmap jcomponent when_in_focused_window componentinputmapuiresource swingutilities replaceuiinputmap jcomponent when_in_focused_window classname getclass getname inputevent alt_mask jcheckbox classname indexof vbutton inputevent shift_mask inputevent ctrl_mask keystroke getkeystroke keystroke getkeystroke keystroke getkeystroke inputmap swingutilities getuiinputmap jcomponent when_in_focused_window constructor param line cash line param doc header public docline cash m cash line line doc cash doc super line doc m cashtype line get cash type m c bankaccount id line getc bankaccount id m c invoice id line getc invoice id if m c invoice id 0 m invoice invoice m invoice get line get ctx m c invoice id setc bpartner id invoice getc bpartner id m amount line get amount m discountamt line get discount amt m writeoffamt line get write off amt set amount m amount docline_cash mcashline doc_cash m_cashtype getcashtype m_c_bankaccount_id getc_bankaccount_id m_c_invoice_id getc_invoice_id m_c_invoice_id minvoice minvoice getctx m_c_invoice_id setc_bpartner_id getc_bpartner_id m_amount getamount m_discountamt getdiscountamt m_writeoffamt getwriteoffamt setamount m_amount get cash type return cash type public string get cash type return m cashtype getcashtype m_cashtype get bank account return bank account public int getc bankaccount id return m c bankaccount id getc_bankaccount_id m_c_bankaccount_id get invoice return c invoice id public int getc invoice id return m c invoice id c_invoice_id getc_invoice_id m_c_invoice_id get amount return payment amount public big decimal get amount return m amount bigdecimal getamount m_amount get discount return discount amount public big decimal get discount amt return m discountamt bigdecimal getdiscountamt m_discountamt get write off return write off amount public big decimal get write off amt return m writeoffamt writeoff bigdecimal getwriteoffamt m_writeoffamt create ui param c return compiere viewpointui public static componentui createui j component c if viewportui null viewportui new compiere viewportui return viewportui compiereviewpointui jcomponent compiereviewportui install ui param c public void installui j component c super installui c will be ignored as set in constructor after updateui sun bug 4677611 c set opaque false jcomponent setopaque standard constructor public x i bankstatement properties ctx int i bankstatement id string trx name super ctx i bankstatement id trx name if i bankstatement id 0 seti bankstatement id 0 seti isimported false x_i_bankstatement i_bankstatement_id trxname i_bankstatement_id trxname i_bankstatement_id seti_bankstatement_id seti_isimported load constructor public x i bankstatement properties ctx result set rs string trx name super ctx rs trx name x_i_bankstatement resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i bankstatement append get id append return sb to string tostring stringbuffer stringbuffer x_i_bankstatement get_id tostring set business partner key key of the business partner public void setb partner value string b partner value if b partner value null b partner value length 40 log warning length 40 truncated b partner value b partner value substring 0 39 set value b partner value b partner value setbpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue set_value bpartnervalue bpartnervalue get business partner key key of the business partner public string getb partner value return string get value b partner value getbpartnervalue get_value bpartnervalue set bank account no bank account number public void set bank account no string bank account no if bank account no null bank account no length 20 log warning length 20 truncated bank account no bank account no substring 0 19 set value bank account no bank account no setbankaccountno bankaccountno bankaccountno bankaccountno bankaccountno bankaccountno set_value bankaccountno bankaccountno get bank account no bank account number public string get bank account no return string get value bank account no getbankaccountno get_value bankaccountno set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 0 set value c bankaccount id null else set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id set_value c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set bank statement line line on a statement from this bank public void setc bankstatementline id int c bankstatementline id if c bankstatementline id 0 set value c bankstatementline id null else set value c bankstatementline id new integer c bankstatementline id setc_bankstatementline_id c_bankstatementline_id c_bankstatementline_id set_value c_bankstatementline_id set_value c_bankstatementline_id c_bankstatementline_id get bank statement line line on a statement from this bank public int getc bankstatementline id integer ii integer get value c bankstatementline id if ii null return 0 return ii int value getc_bankstatementline_id get_value c_bankstatementline_id intvalue set bank statement bank statement of account public void setc bankstatement id int c bankstatement id if c bankstatement id 0 set value c bankstatement id null else set value c bankstatement id new integer c bankstatement id setc_bankstatement_id c_bankstatement_id c_bankstatement_id set_value c_bankstatement_id set_value c_bankstatement_id c_bankstatement_id get bank statement bank statement of account public int getc bankstatement id integer ii integer get value c bankstatement id if ii null return 0 return ii int value getc_bankstatement_id get_value c_bankstatement_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt set value charge amt charge amt setchargeamt bigdecimal chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set charge name name of the charge public void set charge name string charge name if charge name null charge name length 60 log warning length 60 truncated charge name charge name substring 0 59 set value charge name charge name setchargename chargename chargename chargename chargename chargename set_value chargename chargename get charge name name of the charge public string get charge name return string get value charge name getchargename get_value chargename set create payment public void set create payment string create payment if create payment null create payment length 1 log warning length 1 truncated create payment create payment substring 0 0 set value create payment create payment setcreatepayment createpayment createpayment createpayment createpayment createpayment set_value createpayment createpayment get create payment public string get create payment return string get value create payment getcreatepayment get_value createpayment set account date accounting date public void set date acct timestamp date acct set value date acct date acct setdateacct dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set eft amount electronic funds transfer amount public void set eft amt big decimal eft amt set value eft amt eft amt seteftamt bigdecimal eftamt set_value eftamt eftamt get eft amount electronic funds transfer amount public big decimal get eft amt big decimal bd big decimal get value eft amt if bd null return env zero return bd bigdecimal geteftamt bigdecimal bigdecimal get_value eftamt set eft check no electronic funds transfer check no public void set eft check no string eft check no if eft check no null eft check no length 20 log warning length 20 truncated eft check no eft check no substring 0 19 set value eft check no eft check no seteftcheckno eftcheckno eftcheckno eftcheckno eftcheckno eftcheckno set_value eftcheckno eftcheckno get eft check no electronic funds transfer check no public string get eft check no return string get value eft check no geteftcheckno get_value eftcheckno set eft currency electronic funds transfer currency public void set eft currency string eft currency if eft currency null eft currency length 20 log warning length 20 truncated eft currency eft currency substring 0 19 set value eft currency eft currency seteftcurrency eftcurrency eftcurrency eftcurrency eftcurrency eftcurrency set_value eftcurrency eftcurrency get eft currency electronic funds transfer currency public string get eft currency return string get value eft currency geteftcurrency get_value eftcurrency set eft memo electronic funds transfer memo public void set eft memo string eft memo if eft memo null eft memo length 2000 log warning length 2000 truncated eft memo eft memo substring 0 1999 set value eft memo eft memo seteftmemo eftmemo eftmemo eftmemo eftmemo eftmemo set_value eftmemo eftmemo get eft memo electronic funds transfer memo public string get eft memo return string get value eft memo geteftmemo get_value eftmemo set eft payee electronic funds transfer payee information public void set eft payee string eft payee if eft payee null eft payee length 255 log warning length 255 truncated eft payee eft payee substring 0 254 set value eft payee eft payee seteftpayee eftpayee eftpayee eftpayee eftpayee eftpayee set_value eftpayee eftpayee get eft payee electronic funds transfer payee information public string get eft payee return string get value eft payee geteftpayee get_value eftpayee set eft payee account electronic funds transfer payyee account information public void set eft payee account string eft payee account if eft payee account null eft payee account length 40 log warning length 40 truncated eft payee account eft payee account substring 0 39 set value eft payee account eft payee account seteftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount eftpayeeaccount set_value eftpayeeaccount eftpayeeaccount get eft payee account electronic funds transfer payyee account information public string get eft payee account return string get value eft payee account geteftpayeeaccount get_value eftpayeeaccount set eft reference electronic funds transfer reference public void set eft reference string eft reference if eft reference null eft reference length 60 log warning length 60 truncated eft reference eft reference substring 0 59 set value eft reference eft reference seteftreference eftreference eftreference eftreference eftreference eftreference set_value eftreference eftreference get eft reference electronic funds transfer reference public string get eft reference return string get value eft reference geteftreference get_value eftreference set eft statement date electronic funds transfer statement date public void set eft statement date timestamp eft statement date set value eft statement date eft statement date seteftstatementdate eftstatementdate set_value eftstatementdate eftstatementdate get eft statement date electronic funds transfer statement date public timestamp get eft statement date return timestamp get value eft statement date geteftstatementdate get_value eftstatementdate set eft statement line date electronic funds transfer statement line date public void set eft statement line date timestamp eft statement line date set value eft statement line date eft statement line date seteftstatementlinedate eftstatementlinedate set_value eftstatementlinedate eftstatementlinedate get eft statement line date electronic funds transfer statement line date public timestamp get eft statement line date return timestamp get value eft statement line date geteftstatementlinedate get_value eftstatementlinedate set eft statement reference electronic funds transfer statement reference public void set eft statement reference string eft statement reference if eft statement reference null eft statement reference length 60 log warning length 60 truncated eft statement reference eft statement reference substring 0 59 set value eft statement reference eft statement reference seteftstatementreference eftstatementreference eftstatementreference eftstatementreference eftstatementreference eftstatementreference set_value eftstatementreference eftstatementreference get eft statement reference electronic funds transfer statement reference public string get eft statement reference return string get value eft statement reference geteftstatementreference get_value eftstatementreference set eft trx id electronic funds transfer transaction id public void set eft trxid string eft trxid if eft trxid null eft trxid length 40 log warning length 40 truncated eft trxid eft trxid substring 0 39 set value eft trxid eft trxid setefttrxid efttrxid efttrxid efttrxid efttrxid efttrxid set_value efttrxid efttrxid get eft trx id electronic funds transfer transaction id public string get eft trxid return string get value eft trxid getefttrxid get_value efttrxid set eft trx type electronic funds transfer transaction type public void set eft trx type string eft trx type if eft trx type null eft trx type length 20 log warning length 20 truncated eft trx type eft trx type substring 0 19 set value eft trx type eft trx type setefttrxtype efttrxtype efttrxtype efttrxtype efttrxtype efttrxtype set_value efttrxtype efttrxtype get eft trx type electronic funds transfer transaction type public string get eft trx type return string get value eft trx type getefttrxtype get_value efttrxtype set eft effective date electronic funds transfer valuta effective date public void set eft valuta date timestamp eft valuta date set value eft valuta date eft valuta date seteftvalutadate eftvalutadate set_value eftvalutadate eftvalutadate get eft effective date electronic funds transfer valuta effective date public timestamp get eft valuta date return timestamp get value eft valuta date geteftvalutadate get_value eftvalutadate set iso currency code three letter iso 4217 code of the currency public void setiso code string iso code if iso code null iso code length 3 log warning length 3 truncated iso code iso code substring 0 2 set value iso code iso code setiso_code iso_code iso_code iso_code iso_code iso_code set_value iso_code iso_code get iso currency code three letter iso 4217 code of the currency public string getiso code return string get value iso code getiso_code get_value iso_code set import bank statement import of the bank statement public void seti bankstatement id int i bankstatement id if i bankstatement id 1 throw new illegal argument exception i bankstatement id is mandatory set valuenocheck i bankstatement id new integer i bankstatement id seti_bankstatement_id i_bankstatement_id i_bankstatement_id illegalargumentexception i_bankstatement_id set_valuenocheck i_bankstatement_id i_bankstatement_id get import bank statement import of the bank statement public int geti bankstatement id integer ii integer get value i bankstatement id if ii null return 0 return ii int value geti_bankstatement_id get_value i_bankstatement_id intvalue set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set interest amount interest amount public void set interest amt big decimal interest amt set value interest amt interest amt setinterestamt bigdecimal interestamt set_value interestamt interestamt get interest amount interest amount public big decimal get interest amt big decimal bd big decimal get value interest amt if bd null return env zero return bd bigdecimal getinterestamt bigdecimal bigdecimal get_value interestamt set invoice document no document number of the invoice public void set invoice document no string invoice document no if invoice document no null invoice document no length 30 log warning length 30 truncated invoice document no invoice document no substring 0 29 set value invoice document no invoice document no setinvoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno invoicedocumentno set_value invoicedocumentno invoicedocumentno get invoice document no document number of the invoice public string get invoice document no return string get value invoice document no getinvoicedocumentno get_value invoicedocumentno set reversal this is a reversing transaction public void set is reversal boolean is reversal set value is reversal new boolean is reversal setisreversal isreversal set_value isreversal isreversal get reversal this is a reversing transaction public boolean is reversal object oo get value is reversal if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreversal get_value isreversal booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set line description description of the line public void set line description string line description if line description null line description length 255 log warning length 255 truncated line description line description substring 0 254 set value line description line description setlinedescription linedescription linedescription linedescription linedescription linedescription set_value linedescription linedescription get line description description of the line public string get line description return string get value line description getlinedescription get_value linedescription set match statement public void set match statement string match statement if match statement null match statement length 1 log warning length 1 truncated match statement match statement substring 0 0 set value match statement match statement setmatchstatement matchstatement matchstatement matchstatement matchstatement matchstatement set_value matchstatement matchstatement get match statement public string get match statement return string get value match statement getmatchstatement get_value matchstatement set memo memo text public void set memo string memo if memo null memo length 255 log warning length 255 truncated memo memo substring 0 254 set value memo memo setmemo set_value get memo memo text public string get memo return string get value memo getmemo get_value set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set payment document no document number of the payment public void set payment document no string payment document no if payment document no null payment document no length 30 log warning length 30 truncated payment document no payment document no substring 0 29 set value payment document no payment document no setpaymentdocumentno paymentdocumentno paymentdocumentno paymentdocumentno paymentdocumentno paymentdocumentno set_value paymentdocumentno paymentdocumentno get payment document no document number of the payment public string get payment document no return string get value payment document no getpaymentdocumentno get_value paymentdocumentno set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set reference no your customer or vendor number at the business partner s site public void set reference no string reference no if reference no null reference no length 40 log warning length 40 truncated reference no reference no substring 0 39 set value reference no reference no setreferenceno referenceno referenceno referenceno referenceno referenceno set_value referenceno referenceno get reference no your customer or vendor number at the business partner s site public string get reference no return string get value reference no getreferenceno get_value referenceno set routing no bank routing number public void set routing no string routing no if routing no null routing no length 20 log warning length 20 truncated routing no routing no substring 0 19 set value routing no routing no setroutingno routingno routingno routingno routingno routingno set_value routingno routingno get routing no bank routing number public string get routing no return string get value routing no getroutingno get_value routingno set statement date date of the statement public void set statement date timestamp statement date set value statement date statement date setstatementdate statementdate set_value statementdate statementdate get statement date date of the statement public timestamp get statement date return timestamp get value statement date getstatementdate get_value statementdate set statement line date date of the statement line public void set statement line date timestamp statement line date set value statement line date statement line date setstatementlinedate statementlinedate set_value statementlinedate statementlinedate get statement line date date of the statement line public timestamp get statement line date return timestamp get value statement line date getstatementlinedate get_value statementlinedate set statement amount statement amount public void set stmt amt big decimal stmt amt set value stmt amt stmt amt setstmtamt bigdecimal stmtamt set_value stmtamt stmtamt get statement amount statement amount public big decimal get stmt amt big decimal bd big decimal get value stmt amt if bd null return env zero return bd bigdecimal getstmtamt bigdecimal bigdecimal get_value stmtamt set transaction amount amount of a transaction public void set trx amt big decimal trx amt set value trx amt trx amt settrxamt bigdecimal trxamt set_value trxamt trxamt get transaction amount amount of a transaction public big decimal get trx amt big decimal bd big decimal get value trx amt if bd null return env zero return bd bigdecimal gettrxamt bigdecimal bigdecimal get_value trxamt public static final string trxtype void v set transaction type type of credit card transaction public void set trx type string trx type if trx type null throw new illegal argument exception trx type is mandatory if trx type null trx type equals a trx type equals c trx type equals d trx type equals f trx type equals s trx type equals v else throw new illegal argument exception trx type invalid value trx type reference id 215 a c d f s v if trx type null trx type length 20 log warning length 20 truncated trx type trx type substring 0 19 set value trx type trx type trxtype_void settrxtype trxtype trxtype illegalargumentexception trxtype trxtype trxtype trxtype trxtype trxtype trxtype trxtype illegalargumentexception trxtype trxtype reference_id trxtype trxtype trxtype trxtype set_value trxtype trxtype get transaction type type of credit card transaction public string get trx type return string get value trx type gettrxtype get_value trxtype set effective date date when money is available public void set valuta date timestamp valuta date set value valuta date valuta date setvalutadate valutadate set_value valutadate valutadate get effective date date when money is available public timestamp get valuta date return timestamp get value valuta date getvalutadate get_value valutadate standard constructor public x m warehouse properties ctx int m warehouse id string trx name super ctx m warehouse id trx name if m warehouse id 0 setc location id 0 setm warehouse id 0 set name null set separator null set value null x_m_warehouse m_warehouse_id trxname m_warehouse_id trxname m_warehouse_id setc_location_id setm_warehouse_id setname setseparator setvalue load constructor public x m warehouse properties ctx result set rs string trx name super ctx rs trx name x_m_warehouse resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m warehouse append get id append return sb to string tostring stringbuffer stringbuffer x_m_warehouse get_id tostring set address location or address public void setc location id int c location id if c location id 1 throw new illegal argument exception c location id is mandatory set value c location id new integer c location id setc_location_id c_location_id c_location_id illegalargumentexception c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final int m warehousesource id ad reference id 197 set source warehouse optional warehouse to replenish from public void setm warehousesource id int m warehousesource id if m warehousesource id 0 set value m warehousesource id null else set value m warehousesource id new integer m warehousesource id m_warehousesource_id_ad_reference_id setm_warehousesource_id m_warehousesource_id m_warehousesource_id set_value m_warehousesource_id set_value m_warehousesource_id m_warehousesource_id get source warehouse optional warehouse to replenish from public int getm warehousesource id integer ii integer get value m warehousesource id if ii null return 0 return ii int value getm_warehousesource_id get_value m_warehousesource_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set replenishment class custom class to calculate quantity to order public void set replenishment class string replenishment class if replenishment class null replenishment class length 60 log warning length 60 truncated replenishment class replenishment class substring 0 59 set value replenishment class replenishment class setreplenishmentclass replenishmentclass replenishmentclass replenishmentclass replenishmentclass replenishmentclass set_value replenishmentclass replenishmentclass get replenishment class custom class to calculate quantity to order public string get replenishment class return string get value replenishment class getreplenishmentclass get_value replenishmentclass set element separator element separator public void set separator string separator if separator null throw new illegal argument exception separator is mandatory if separator length 1 log warning length 1 truncated separator separator substring 0 0 set value separator separator setseparator illegalargumentexception set_value get element separator element separator public string get separator return string get value separator getseparator get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value get cost allocations for invoice line param ctx context param c invoiceline id invoice line param trx name trx return landed cost alloc public static m landed cost allocation get of invoice line properties ctx int c invoiceline id string trx name array list m landed cost allocation list new array list m landed cost allocation string sql select from c landedcostallocation where c invoiceline id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c invoiceline id result set rs pstmt execute query while rs next list add new m landed cost allocation ctx rs trx name rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m landed cost allocation ret value new m landed cost allocation list size list to array ret value return ret value c_invoiceline_id trxname mlandedcostallocation getofinvoiceline c_invoiceline_id trxname arraylist mlandedcostallocation arraylist mlandedcostallocation c_landedcostallocation c_invoiceline_id preparedstatement preparestatement trxname setint c_invoiceline_id resultset executequery mlandedcostallocation trxname mlandedcostallocation retvalue mlandedcostallocation toarray retvalue retvalue standard constructor param ctx context param c landedcostallocation id id param trx name trx public m landed cost allocation properties ctx int c landedcostallocation id string trx name super ctx c landedcostallocation id trx name if c landedcostallocation id 0 setm costelement id 0 set amt env zero set qty env zero set base env zero c_landedcostallocation_id trxname mlandedcostallocation c_landedcostallocation_id trxname c_landedcostallocation_id trxname c_landedcostallocation_id setm_costelement_id setamt setqty setbase load constructor param ctx context param rs result name param trx name trx public m landed cost allocation properties ctx result set rs string trx name super ctx rs trx name trxname mlandedcostallocation resultset trxname trxname parent constructor param parent parent param m costelement id cost element public m landed cost allocation m invoice line parent int m costelement id this parent get ctx 0 parent get trxname set client org parent setc invoiceline id parent getc invoiceline id setm costelement id m costelement id m_costelement_id mlandedcostallocation minvoiceline m_costelement_id getctx get_trxname setclientorg setc_invoiceline_id getc_invoiceline_id setm_costelement_id m_costelement_id set amt param amt amount param precision precision public void set amt double amt int precision big decimal bd new big decimal amt if bd scale precision bd bd set scale precision big decimal round half up super set amt bd setamt bigdecimal bigdecimal setscale bigdecimal round_half_up setamt basic constructor public center basic constructor param element adds an element to the element public center element element add element element addelement basic constructor param element adds an element to the element public center string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public center add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public center add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public center add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public center add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public center remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get contents return contents public object get contents return contents getcontents standard constructor public x c cashline properties ctx int c cashline id string trx name super ctx c cashline id trx name if c cashline id 0 set amount env zero setc cashline id 0 setc cash id 0 set cash type null e set line 0 sql select coalesce max line 0 10 as default value from c cashline where c cash id c cash id set processed false x_c_cashline c_cashline_id trxname c_cashline_id trxname c_cashline_id setamount setc_cashline_id setc_cash_id setcashtype setline defaultvalue c_cashline c_cash_id c_cash_id setprocessed load constructor public x c cashline properties ctx result set rs string trx name super ctx rs trx name x_c_cashline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cashline append get id append return sb to string tostring stringbuffer stringbuffer x_c_cashline get_id tostring set amount amount in a defined currency public void set amount big decimal amount if amount null throw new illegal argument exception amount is mandatory set value amount amount setamount bigdecimal illegalargumentexception set_value get amount amount in a defined currency public big decimal get amount big decimal bd big decimal get value amount if bd null return env zero return bd bigdecimal getamount bigdecimal bigdecimal get_value set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 0 set value c bankaccount id null else set value c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id set_value c_bankaccount_id set_value c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set cash journal line cash journal line public void setc cashline id int c cashline id if c cashline id 1 throw new illegal argument exception c cashline id is mandatory set valuenocheck c cashline id new integer c cashline id setc_cashline_id c_cashline_id c_cashline_id illegalargumentexception c_cashline_id set_valuenocheck c_cashline_id c_cashline_id get cash journal line cash journal line public int getc cashline id integer ii integer get value c cashline id if ii null return 0 return ii int value getc_cashline_id get_value c_cashline_id intvalue set cash journal cash journal public void setc cash id int c cash id if c cash id 1 throw new illegal argument exception c cash id is mandatory set valuenocheck c cash id new integer c cash id setc_cash_id c_cash_id c_cash_id illegalargumentexception c_cash_id set_valuenocheck c_cash_id c_cash_id get cash journal cash journal public int getc cash id integer ii integer get value c cash id if ii null return 0 return ii int value getc_cash_id get_value c_cash_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc cash id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_cash_id set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set valuenocheck c currency id null else set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_valuenocheck c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue public static final string cashtype bankaccounttransfer t set cash type source of cash public void set cash type string cash type if cash type null throw new illegal argument exception cash type is mandatory if cash type equals c cash type equals d cash type equals e cash type equals i cash type equals r cash type equals t else throw new illegal argument exception cash type invalid value cash type reference id 217 c d e i r t if cash type length 1 log warning length 1 truncated cash type cash type substring 0 0 set valuenocheck cash type cash type cashtype_bankaccounttransfer setcashtype cashtype cashtype illegalargumentexception cashtype cashtype cashtype cashtype cashtype cashtype cashtype illegalargumentexception cashtype cashtype reference_id cashtype cashtype cashtype set_valuenocheck cashtype cashtype get cash type source of cash public string get cash type return string get value cash type getcashtype get_value cashtype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set discount amount calculated amount of discount public void set discount amt big decimal discount amt set value discount amt discount amt setdiscountamt bigdecimal discountamt set_value discountamt discountamt get discount amount calculated amount of discount public big decimal get discount amt big decimal bd big decimal get value discount amt if bd null return env zero return bd bigdecimal getdiscountamt bigdecimal bigdecimal get_value discountamt set generated this line is generated public void set is generated boolean is generated set valuenocheck is generated new boolean is generated setisgenerated isgenerated set_valuenocheck isgenerated isgenerated get generated this line is generated public boolean is generated object oo get value is generated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isgenerated get_value isgenerated booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set write off amount amount to write off public void set write off amt big decimal write off amt set value write off amt write off amt setwriteoffamt bigdecimal writeoffamt set_value writeoffamt writeoffamt get write off amount amount to write off public big decimal get write off amt big decimal bd big decimal get value write off amt if bd null return env zero return bd bigdecimal getwriteoffamt bigdecimal bigdecimal get_value writeoffamt prepare protected void prepare p c bpartner id getrecord id process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c bpartner id p c bpartner id para i get parameter as int else if name equals c bp group id p c bp group id para i get parameter as int else log log level severe unknown parameter name p_c_bpartner_id getrecord_id processinfoparameter getparameter getparametername getparameter c_bpartner_id p_c_bpartner_id getparameterasint c_bp_group_id p_c_bp_group_id getparameterasint process return info throws exception protected string do it throws exception log info c bpartner id p c bpartner id c bp group id p c bp group id if p c bpartner id 0 p c bp group id 0 throw new compiere user error no business partner group selected if p c bp group id 0 mb partner bp new mb partner get ctx p c bpartner id get trxname if bp get id 0 throw new compiere user error business partner not found c bpartner id p c bpartner id checkbp bp else string sql select from c bpartner where c bp group id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 p c bp group id result set rs pstmt execute query while rs next mb partner bp new mb partner get ctx rs get trxname checkbp bp rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ok doit c_bpartner_id p_c_bpartner_id c_bp_group_id p_c_bp_group_id p_c_bpartner_id p_c_bp_group_id compiereusererror p_c_bp_group_id mbpartner mbpartner getctx p_c_bpartner_id get_trxname get_id compiereusererror c_bpartner_id p_c_bpartner_id c_bpartner c_bp_group_id isactive preparedstatement preparestatement get_trxname setint p_c_bp_group_id resultset executequery mbpartner mbpartner getctx get_trxname check bp param bp bp private void checkbp mb partner bp add log 0 null null bp get name see also v merge post merge check payments bp check invoices bp bp set total open balance bp set actual life time value bp save if bp getso creditused signum 0 add log 0 null bp getso creditused msg get element get ctx so creditused add log 0 null bp get total open balance msg get element get ctx total open balance add log 0 null bp get actual life time value msg get element get ctx actual life time value commit mbpartner addlog getname vmerge postmerge checkpayments checkinvoices settotalopenbalance setactuallifetimevalue getso_creditused addlog getso_creditused getelement getctx so_creditused addlog gettotalopenbalance getelement getctx totalopenbalance addlog getactuallifetimevalue getelement getctx actuallifetimevalue check payments param bp business partner private void check payments mb partner bp see also v merge post merge int changed 0 m payment payments m payment get ofb partner get ctx bp getc bpartner id get trxname for int i 0 i payments length i m payment payment payments i if payment test allocation payment save changed if changed 0 add log 0 null new big decimal payments length msg get element get ctx c payment id changed checkpayments mbpartner vmerge postmerge mpayment mpayment getofbpartner getctx getc_bpartner_id get_trxname mpayment testallocation addlog bigdecimal getelement getctx c_payment_id check invoices param bp business partner private void check invoices mb partner bp see also v merge post merge int changed 0 m invoice invoices m invoice get ofb partner get ctx bp getc bpartner id get trxname for int i 0 i invoices length i m invoice invoice invoices i if invoice test allocation invoice save changed if changed 0 add log 0 null new big decimal invoices length msg get element get ctx c invoice id changed checkinvoices mbpartner vmerge postmerge minvoice minvoice getofbpartner getctx getc_bpartner_id get_trxname minvoice testallocation addlog bigdecimal getelement getctx c_invoice_id place this filter into service param filter config the filter configuration object throws servlet exception public void init filter config filter config throws servlet exception m filterconfig filter config web env init web filter config get servlet context if log null log c logger getc logger w filter class list all parameters log info filter config get filter name enumeration en filter config get init parameter names while en has more elements string name en next element to string string value filter config get init parameter name log config name value if name equals timing value equals y m timing true filterconfig servletexception filterconfig filterconfig servletexception m_filterconfig filterconfig webenv initweb filterconfig getservletcontext clogger getclogger wfilter filterconfig getfiltername filterconfig getinitparameternames hasmoreelements nextelement tostring filterconfig getinitparameter m_timing take this filter out of service public void destroy m filterconfig null m_filterconfig time the processing that is performed by all subsequent filters in the current filter stack including the ultimately invoked servlet param request the servlet request we are processing param response response param chain the filter chain we are processing exception io exception if an input output error occurs exception servlet exception if a servlet error occurs public void do filter servlet request request servlet response response filter chain chain throws io exception servlet exception get uri string uri if request instanceof http servlet request http servlet request req http servlet request request uri req get requesturi ignore static content boolean check true if uri starts with web env dir base not requesting adempiere uri ends with gif uri ends with jpg uri ends with png uri ends with html uri ends with css uri ends with js check false boolean pass true we need to check string buffer sb new string buffer parameters if check try string enc request get character encoding if enc null request set character encoding web env encoding catch exception e log log level severe set character endocung web env encoding e print parameter enumeration en request get parameter names while en has more elements string name string en next element sb append append name append append request get parameter name if uri ends with w window status pass false if pass check log info start uri sb to string timing long my time 0l if pass check m timing my time system current time millis start if pass chain do filter request response else log warning rejected uri string msg error access rejected web doc doc web doc create msg body body b doc get body b add element new p uri align type center fini response set content type text html print writer out new print writer response get output stream doc output out out close post if check pass if m timing my time system current time millis my time log info end uri m timing string value of my time null ioexception servletexception dofilter servletrequest servletresponse filterchain ioexception servletexception httpservletrequest httpservletrequest httpservletrequest getrequesturi startswith webenv dir_base endswith endswith endswith endswith endswith endswith stringbuffer stringbuffer getcharacterencoding setcharacterencoding webenv characterendocung webenv getparameternames hasmoreelements nextelement getparameter endswith wwindowstatus tostring mytime m_timing mytime currenttimemillis dofilter webdoc webdoc getbody addelement aligntype setcontenttype printwriter printwriter getoutputstream m_timing mytime currenttimemillis mytime m_timing valueof mytime return a string representation of this object return string info public string to string if m filterconfig null return w filter string buffer sb new string buffer w filter sb append m filterconfig sb append return sb to string tostring m_filterconfig wfilter stringbuffer stringbuffer wfilter m_filterconfig tostring standard constructor public x gl budgetcontrol properties ctx int gl budgetcontrol id string trx name super ctx gl budgetcontrol id trx name if gl budgetcontrol id 0 set budget control scope null setc acctschema id 0 set commitment type null c setgl budgetcontrol id 0 setgl budget id 0 set is before approval false set name null x_gl_budgetcontrol gl_budgetcontrol_id trxname gl_budgetcontrol_id trxname gl_budgetcontrol_id setbudgetcontrolscope setc_acctschema_id setcommitmenttype setgl_budgetcontrol_id setgl_budget_id setisbeforeapproval setname load constructor public x gl budgetcontrol properties ctx result set rs string trx name super ctx rs trx name x_gl_budgetcontrol resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x gl budgetcontrol append get id append return sb to string tostring stringbuffer stringbuffer x_gl_budgetcontrol get_id tostring public static final string budgetcontrolscope yeartodate y set control scope scope of the budget control public void set budget control scope string budget control scope if budget control scope null throw new illegal argument exception budget control scope is mandatory if budget control scope equals p budget control scope equals t budget control scope equals y else throw new illegal argument exception budget control scope invalid value budget control scope reference id 361 p t y if budget control scope length 1 log warning length 1 truncated budget control scope budget control scope substring 0 0 set value budget control scope budget control scope budgetcontrolscope_yeartodate setbudgetcontrolscope budgetcontrolscope budgetcontrolscope illegalargumentexception budgetcontrolscope budgetcontrolscope budgetcontrolscope budgetcontrolscope illegalargumentexception budgetcontrolscope budgetcontrolscope reference_id budgetcontrolscope budgetcontrolscope budgetcontrolscope set_value budgetcontrolscope budgetcontrolscope get control scope scope of the budget control public string get budget control scope return string get value budget control scope getbudgetcontrolscope get_value budgetcontrolscope set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue public static final string commitmenttype none n set commitment type create commitment and or reservations for budget control public void set commitment type string commitment type if commitment type null throw new illegal argument exception commitment type is mandatory if commitment type equals b commitment type equals c commitment type equals n else throw new illegal argument exception commitment type invalid value commitment type reference id 359 b c n if commitment type length 1 log warning length 1 truncated commitment type commitment type substring 0 0 set value commitment type commitment type commitmenttype_none setcommitmenttype commitmenttype commitmenttype illegalargumentexception commitmenttype commitmenttype commitmenttype commitmenttype illegalargumentexception commitmenttype commitmenttype reference_id commitmenttype commitmenttype commitmenttype set_value commitmenttype commitmenttype get commitment type create commitment and or reservations for budget control public string get commitment type return string get value commitment type getcommitmenttype get_value commitmenttype set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set budget control budget control public void setgl budgetcontrol id int gl budgetcontrol id if gl budgetcontrol id 1 throw new illegal argument exception gl budgetcontrol id is mandatory set valuenocheck gl budgetcontrol id new integer gl budgetcontrol id setgl_budgetcontrol_id gl_budgetcontrol_id gl_budgetcontrol_id illegalargumentexception gl_budgetcontrol_id set_valuenocheck gl_budgetcontrol_id gl_budgetcontrol_id get budget control budget control public int getgl budgetcontrol id integer ii integer get value gl budgetcontrol id if ii null return 0 return ii int value getgl_budgetcontrol_id get_value gl_budgetcontrol_id intvalue set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 1 throw new illegal argument exception gl budget id is mandatory set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id illegalargumentexception gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set before approval the check is before the manual approval public void set is before approval boolean is before approval set value is before approval new boolean is before approval setisbeforeapproval isbeforeapproval set_value isbeforeapproval isbeforeapproval get before approval the check is before the manual approval public boolean is before approval object oo get value is before approval if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbeforeapproval get_value isbeforeapproval booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x a asset retirement properties ctx int a asset retirement id string trx name super ctx a asset retirement id trx name if a asset retirement id 0 seta asset id 0 seta asset retirement id 0 set asset market value amt env zero set asset value amt env zero x_a_asset_retirement a_asset_retirement_id trxname a_asset_retirement_id trxname a_asset_retirement_id seta_asset_id seta_asset_retirement_id setassetmarketvalueamt setassetvalueamt load constructor public x a asset retirement properties ctx result set rs string trx name super ctx rs trx name x_a_asset_retirement resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a asset retirement append get id append return sb to string tostring stringbuffer stringbuffer x_a_asset_retirement get_id tostring set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 1 throw new illegal argument exception a asset id is mandatory set valuenocheck a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id illegalargumentexception a_asset_id set_valuenocheck a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set asset retirement internally used asset is not longer used public void seta asset retirement id int a asset retirement id if a asset retirement id 1 throw new illegal argument exception a asset retirement id is mandatory set valuenocheck a asset retirement id new integer a asset retirement id seta_asset_retirement_id a_asset_retirement_id a_asset_retirement_id illegalargumentexception a_asset_retirement_id set_valuenocheck a_asset_retirement_id a_asset_retirement_id get asset retirement internally used asset is not longer used public int geta asset retirement id integer ii integer get value a asset retirement id if ii null return 0 return ii int value geta_asset_retirement_id get_value a_asset_retirement_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geta asset retirement id intvalue keynamepair getkeynamepair keynamepair get_id valueof geta_asset_retirement_id set market value amount market value of the asset public void set asset market value amt big decimal asset market value amt if asset market value amt null throw new illegal argument exception asset market value amt is mandatory set value asset market value amt asset market value amt setassetmarketvalueamt bigdecimal assetmarketvalueamt assetmarketvalueamt illegalargumentexception assetmarketvalueamt set_value assetmarketvalueamt assetmarketvalueamt get market value amount market value of the asset public big decimal get asset market value amt big decimal bd big decimal get value asset market value amt if bd null return env zero return bd bigdecimal getassetmarketvalueamt bigdecimal bigdecimal get_value assetmarketvalueamt set asset value book value of the asset public void set asset value amt big decimal asset value amt if asset value amt null throw new illegal argument exception asset value amt is mandatory set value asset value amt asset value amt setassetvalueamt bigdecimal assetvalueamt assetvalueamt illegalargumentexception assetvalueamt set_value assetvalueamt assetvalueamt get asset value book value of the asset public big decimal get asset value amt big decimal bd big decimal get value asset value amt if bd null return env zero return bd bigdecimal getassetvalueamt bigdecimal bigdecimal get_value assetvalueamt set invoice line invoice detail line public void setc invoiceline id int c invoiceline id if c invoiceline id 0 set value c invoiceline id null else set value c invoiceline id new integer c invoiceline id setc_invoiceline_id c_invoiceline_id c_invoiceline_id set_value c_invoiceline_id set_value c_invoiceline_id c_invoiceline_id get invoice line invoice detail line public int getc invoiceline id integer ii integer get value c invoiceline id if ii null return 0 return ii int value getc_invoiceline_id get_value c_invoiceline_id intvalue constructs a new instance need to call init panel for dynamic initialization public a panel super m ctx env get ctx try jb init catch exception e log log level severe e create menu initpanel apanel m_ctx getctx jbinit createmenu dispose public void dispose log config ignore changes m disposing true if m curapaneltab null m curapaneltab unregister panel m curapaneltab null close panels tab panel dispose this tab panel null all workbenches for int i 0 i m mworkbench get window count i m curwindowno m mworkbench get window no i log info m curwindowno env set auto commit m ctx m curwindowno false m mworkbench dispose i env clear win context m ctx m curwindowno all workbenchens get rid of remaining model if m mworkbench null m mworkbench dispose m mworkbench null menu bar if menu bar null menu bar remove all menu bar null tool bar if tool bar null tool bar remove all tool bar null prepare gc this remove all m_disposing m_curapaneltab m_curapaneltab unregisterpanel m_curapaneltab tabpanel tabpanel m_mworkbench getwindowcount m_curwindowno m_mworkbench getwindowno m_curwindowno setautocommit m_ctx m_curwindowno m_mworkbench clearwincontext m_ctx m_curwindowno m_mworkbench m_mworkbench m_mworkbench menubar menubar menubar removeall menubar toolbar toolbar toolbar removeall toolbar removeall initializes the state of this instance throws exception private void jb init throws exception this set locale language get login language get locale this set layout main layout tab panel main layout set hgap 2 main layout set vgap 2 this add tab panel border layout center south panel this add status bar border layout south north panel this add north panel border layout north north panel set layout north layout north layout set alignment flow layout left north panel add tool bar null jbinit setlocale getloginlanguage getlocale setlayout mainlayout tabpanel mainlayout sethgap mainlayout setvgap tabpanel borderlayout southpanel statusbar borderlayout northpanel northpanel borderlayout northpanel setlayout northlayout northlayout setalignment flowlayout northpanel toolbar create menu and toolbar and registers keyboard actions started from constructor private void create menu menu menu bar set help menu file j menu m file a env get menu file menu bar add m file a print scr add action print screen m file key stroke get key stroke key event vk printscreen 0 false a scr shot add action screen shot m file key stroke get key stroke key event vk printscreen event shift mask false a report add action report m file key stroke get key stroke key event vk f11 0 false a print add action print m file key stroke get key stroke key event vk f12 0 false m file add separator a end add action end m file key stroke get key stroke key event vk x event alt mask false a exit add action exit m file key stroke get key stroke key event vk x event shift mask event alt mask false edit j menu m edit a env get menu edit menu bar add m edit a new add action new m edit key stroke get key stroke key event vk f2 0 false a save add action save m edit key stroke get key stroke key event vk f4 0 false m edit add separator a copy add action copy m edit key stroke get key stroke key event vk f2 event shift mask false a delete add action delete m edit key stroke get key stroke key event vk f3 0 false a ignore add action ignore m edit key stroke get key stroke key event vk escape 0 false a refresh add action refresh m edit key stroke get key stroke key event vk f5 0 false m edit add separator a find add action find m edit key stroke get key stroke key event vk f6 0 true toggle if m ispersonallock a lock add action lock m edit null true toggle view j menu m view a env get menu view menu bar add m view a product add action info product m view key stroke get key stroke key event vk i event alt mask false ab partner add action infob partner m view key stroke get key stroke key event vk i event shift mask event alt mask false if m role get default is show acct a account add action info account m view key stroke get key stroke key event vk i event alt mask event ctrl mask false a env add menu item info schedule null null m view this m view add separator a env add menu item info order info null m view this a env add menu item info invoice info null m view this a env add menu item info in out info null m view this a env add menu item info payment info null m view this a env add menu item info cash line info null m view this a env add menu item info assignment info null m view this a env add menu item info asset info null m view this m view add separator a attachment add action attachment m view key stroke get key stroke key event vk f7 0 true toggle a history add action history m view key stroke get key stroke key event vk f9 0 true toggle m view add separator a multi add action multi m view key stroke get key stroke key event vk f8 0 true toggle go j menu m go a env get menu go menu bar add m go a first add action first m go key stroke get key stroke key event vk page up event alt mask false a previous add action previous m go key stroke get key stroke key event vk up event alt mask false a next add action next m go key stroke get key stroke key event vk down event alt mask false a last add action last m go key stroke get key stroke key event vk page down event alt mask false m go add separator a parent add action parent m go key stroke get key stroke key event vk left event alt mask false a detail add action detail m go key stroke get key stroke key event vk right event alt mask false m go add separator a zoom across add action zoom across m go null false a request add action request m go null false a archive add action archive m go null false a home add action home m go null false tools j menu m tools a env get menu tools menu bar add m tools a calculator add action calculator m tools null false a calendar add action calendar m tools null false a editor add action editor m tools null false a script add action script m tools null false if y equals env get context m ctx sys admin set in db logindb a win size add action win size m tools null false if a env is workflow process a workflow add action work flow m tools null false if m role get default is show preference m tools add separator a preference add action preference m tools null false help j menu m help a env get menu help menu bar add m help a help add action help m help key stroke get key stroke key event vk f1 0 false a online add action online m help null false a mail support add action e mail support m help null false a about add action about m help null false tool bar tool bar add a ignore get button esc tool bar add separator tool bar add a help get button f1 tool bar add a new get button tool bar add a delete get button tool bar add a save get button tool bar add separator tool bar add a refresh get button f5 tool bar add a find get button tool bar add a attachment get button tool bar add a multi get button tool bar add separator tool bar add a history get button f9 tool bar add a home get button f10 is windows menu key tool bar add a parent get button tool bar add a detail get button tool bar add separator tool bar add a first get button tool bar add a previous get button tool bar add a next get button tool bar add a last get button tool bar add separator tool bar add a report get button tool bar add a archive get button tool bar add a print get button tool bar add separator if m ispersonallock tool bar add a lock get button tool bar add a zoom across get button if a workflow null tool bar add a workflow get button tool bar add a request get button tool bar add a product get button tool bar add separator tool bar add a end get button if c log mgt is level all util print action input map this createmenu menubar sethelpmenu jmenu mfile aenv getmenu menubar mfile aprintscr addaction printscreen mfile keystroke getkeystroke keyevent vk_printscreen ascrshot addaction screenshot mfile keystroke getkeystroke keyevent vk_printscreen shift_mask areport addaction mfile keystroke getkeystroke keyevent vk_f11 aprint addaction mfile keystroke getkeystroke keyevent vk_f12 mfile addseparator aend addaction mfile keystroke getkeystroke keyevent vk_x alt_mask aexit addaction mfile keystroke getkeystroke keyevent vk_x shift_mask alt_mask jmenu medit aenv getmenu menubar medit anew addaction medit keystroke getkeystroke keyevent vk_f2 asave addaction medit keystroke getkeystroke keyevent vk_f4 medit addseparator acopy addaction medit keystroke getkeystroke keyevent vk_f2 shift_mask adelete addaction medit keystroke getkeystroke keyevent vk_f3 aignore addaction medit keystroke getkeystroke keyevent vk_escape arefresh addaction medit keystroke getkeystroke keyevent vk_f5 medit addseparator afind addaction medit keystroke getkeystroke keyevent vk_f6 m_ispersonallock alock addaction medit jmenu mview aenv getmenu menubar mview aproduct addaction infoproduct mview keystroke getkeystroke keyevent vk_i alt_mask abpartner addaction infobpartner mview keystroke getkeystroke keyevent vk_i shift_mask alt_mask mrole getdefault isshowacct aaccount addaction infoaccount mview keystroke getkeystroke keyevent vk_i alt_mask ctrl_mask aenv addmenuitem infoschedule mview mview addseparator aenv addmenuitem infoorder mview aenv addmenuitem infoinvoice mview aenv addmenuitem infoinout mview aenv addmenuitem infopayment mview aenv addmenuitem infocashline mview aenv addmenuitem infoassignment mview aenv addmenuitem infoasset mview mview addseparator aattachment addaction mview keystroke getkeystroke keyevent vk_f7 ahistory addaction mview keystroke getkeystroke keyevent vk_f9 mview addseparator amulti addaction mview keystroke getkeystroke keyevent vk_f8 jmenu mgo aenv getmenu menubar mgo afirst addaction mgo keystroke getkeystroke keyevent vk_page_up alt_mask aprevious addaction mgo keystroke getkeystroke keyevent vk_up alt_mask anext addaction mgo keystroke getkeystroke keyevent vk_down alt_mask alast addaction mgo keystroke getkeystroke keyevent vk_page_down alt_mask mgo addseparator aparent addaction mgo keystroke getkeystroke keyevent vk_left alt_mask adetail addaction mgo keystroke getkeystroke keyevent vk_right alt_mask mgo addseparator azoomacross addaction zoomacross mgo arequest addaction mgo aarchive addaction mgo ahome addaction mgo jmenu mtools aenv getmenu menubar mtools acalculator addaction mtools acalendar addaction mtools aeditor addaction mtools ascript addaction mtools getcontext m_ctx sysadmin awinsize addaction winsize mtools aenv isworkflowprocess aworkflow addaction workflow mtools mrole getdefault isshowpreference mtools addseparator apreference addaction mtools jmenu mhelp aenv getmenu menubar mhelp ahelp addaction mhelp keystroke getkeystroke keyevent vk_f1 aonline addaction mhelp amailsupport addaction emailsupport mhelp aabout addaction mhelp toolbar toolbar aignore getbutton toolbar addseparator toolbar ahelp getbutton toolbar anew getbutton toolbar adelete getbutton toolbar asave getbutton toolbar addseparator toolbar arefresh getbutton toolbar afind getbutton toolbar aattachment getbutton toolbar amulti getbutton toolbar addseparator toolbar ahistory getbutton toolbar ahome getbutton toolbar aparent getbutton toolbar adetail getbutton toolbar addseparator toolbar afirst getbutton toolbar aprevious getbutton toolbar anext getbutton toolbar alast getbutton toolbar addseparator toolbar areport getbutton toolbar aarchive getbutton toolbar aprint getbutton toolbar addseparator m_ispersonallock toolbar alock getbutton toolbar azoomacross getbutton aworkflow toolbar aworkflow getbutton toolbar arequest getbutton toolbar aproduct getbutton toolbar addseparator toolbar aend getbutton clogmgt islevelall printactioninputmap add toggle action to toolbar and menu param action name action name param menu manu param accelerator accelerator param toggle toggle button return apps action private apps action add action string action name j menu menu key stroke accelerator boolean toggle apps action action new apps action action name accelerator toggle if menu null menu add action get menu item action set delegate this abstract button b action get button string s null if b null s b get tool tip text key strokes if accelerator null get input map when in focused window put accelerator action name get action map put action name action return action actionname appsaction appsaction addaction actionname jmenu keystroke appsaction appsaction actionname getmenuitem setdelegate abstractbutton getbutton gettooltiptext getinputmap when_in_focused_window actionname getactionmap actionname return menu bar return j menu bar public j menu bar get menu bar return menu bar menubar jmenubar jmenubar getmenubar menubar get title of window return string with title public string get title if m mworkbench get window count 1 string buffer sb new string buffer sb append m mworkbench get name append append env get context m ctx ad user name append append env get context m ctx ad client name append append env get context m ctx ad org name append append env get context m ctx db uid append return sb to string return env get header m ctx m curwindowno gettitle m_mworkbench getwindowcount stringbuffer stringbuffer m_mworkbench getname getcontext m_ctx ad_user_name getcontext m_ctx ad_client_name getcontext m_ctx ad_org_name getcontext m_ctx db_uid tostring getheader m_ctx m_curwindowno dynamic panel initialization either single window or workbench pre either workbench tab panel v tabbed pane tab grid controller or workbench tab panel v tabbed pane window v tabbed pane tab grid controller pre tab panel param ad workbench id if 0 this is a workbench ad window id ignored param ad window id if not a workbench window id param query if not a workbench zoom query additional sql where clause return true if panel is initialized successfully public boolean init panel int ad workbench id int ad window id m query query log info wb ad workbench id win ad window id query query this set name a panel ad window id single window if ad workbench id 0 m mworkbench new m workbench m ctx ad window id else workbench m mworkbench new m workbench m ctx if m mworkbench init workbench ad workbench id log log level severe a panel init window no workbench model return false tab panel set workbench true tab panel add change listener this a dialog warn 0 this not implemented yet return false dimension window size m mworkbench get window size work bench loop for int wb 0 wb m mworkbench get window count wb get set window no m curwindowno env create window no this timing ca 1 5 sec m mworkbench set window no wb m curwindowno set auto commit for this window env set auto commit m ctx m curwindowno env is auto commit m ctx boolean auto new env is auto new m ctx env set auto new m ctx m curwindowno auto new workbench window v tabbed pane window null just one window if m mworkbench get window count 1 window tab panel window set workbench false else v tabbed pane tp new v tabbed pane false window tp window init window add change listener this init model int wb type m mworkbench get window type wb window if wb type m workbench type window hash map integer grid controller included map new hash map integer grid controller 4 m windowvo wvo a env getm windowvo m curwindowno m mworkbench get windowid wb 0 if wvo null a dialog error 0 null access table no view no window model info return false m window m window new m window wvo timing ca 0 3 1 sec set so auto new for window env set context m ctx m curwindowno isso trx m window isso trx if auto new m window is transaction env set auto new m ctx m curwindowno true m mworkbench setm window wb m window if wb 0 m onlycurrentrows m window is transaction default only current if window size null window size m window get window size window tabs int tab size m window get tab count boolean go single row query null zoom query for int tab 0 tab tab size tab boolean included false m tab m tab m tab m mworkbench getm window wb get tab tab query first tab if tab 0 initial user query for single workbench tab if m mworkbench get window count 1 query initial query query m tab if query null query get record count 1 go single row true else if wb 0 workbench dynamic query for dependent windows query m mworkbench get query set initial query on first tab if query null m onlycurrentrows false query might involve history m tab set query query if wb 0 m curtab m tab query on first tab component tab element null grid controller if m tab is sort tab v sort tab st new v sort tab m curwindowno m tab getad table id m tab getad columnsortorder id m tab getad columnsortyesno id st set tab level m tab get tab level tab element st else normal tab grid controller gc new grid controller timing ca 1 sec compiere color cc m window get color if cc null gc set background color cc set color on window level gc init grid m tab false m curwindowno this m window will set color on tab level timing ca 6 7 sec for first 2 for next gc add data status listener this gc registeresc action a ignore register escape key set first tab if wb 0 tab 0 m curgc gc dimension size gc get preferred size screen sizing size width 4 size height 4 gc set preferred size size tab element gc if we have a zoom query switch to single row if tab 0 go single row gc switch single row store gc if it has a included tab if m tab getincluded tab id 0 included map put new integer m tab getincluded tab id gc is this tab included if included map size 0 grid controller parent grid controller included map get new integer m tab getad tab id if parent null included parent include tab gc if included log log level severe not included gc normal tab if included add to tabbed pane string buffer tab name new string buffer tab name append html if m tab is read only tab name append i int pos m tab get name index of if pos 1 tab name append m tab get name append br nbsp else tab name append m tab get name substring 0 pos append br append m tab get name substring pos 1 if m tab is read only tab name append i tab name append html add tab sets alt number and shift alt x window add tab tab name to string m tab get icon tab element m tab get description tab loop tab background window set background color new compiere color color magenta color green type m window single workbench window tab if m mworkbench get window count 1 window set tool tip text m mworkbench get description wb else add workbench window tab tab panel add tab m mworkbench get name wb m mworkbench get icon wb window m mworkbench get description wb used for env get header env set context m ctx m curwindowno window name m mworkbench get name wb workbench loop state changed triggered tool bar set name get title m curtab get table model set changed false set detail button a detail set enabled 0 m curwintab get tab count 1 if window size null set preferred size window size dimension size get preferred size log info fini size m curwintab request focus in window return true tabpanel vtabbedpane gridcontroller tabpanel vtabbedpane vtabbedpane gridcontroller tabpanel ad_workbench_id ad_window_id ad_window_id initpanel ad_workbench_id ad_window_id mquery ad_workbench_id ad_window_id setname apanel ad_window_id ad_workbench_id m_mworkbench mworkbench m_ctx ad_window_id m_mworkbench mworkbench m_ctx m_mworkbench initworkbench ad_workbench_id apanel initwindow tabpanel setworkbench tabpanel addchangelistener adialog windowsize m_mworkbench getwindowsize workbench m_mworkbench getwindowcount windowno m_curwindowno createwindowno m_mworkbench setwindowno m_curwindowno autocommit setautocommit m_ctx m_curwindowno isautocommit m_ctx autonew isautonew m_ctx setautonew m_ctx m_curwindowno autonew vtabbedpane m_mworkbench getwindowcount tabpanel setworkbench vtabbedpane vtabbedpane addchangelistener wbtype m_mworkbench getwindowtype wbtype mworkbench type_window hashmap gridcontroller includedmap hashmap gridcontroller mwindowvo aenv getmwindowvo m_curwindowno m_mworkbench getwindowid adialog accesstablenoview mwindow mwindow mwindow autonew setcontext m_ctx m_curwindowno issotrx mwindow issotrx autonew mwindow istransaction setautonew m_ctx m_curwindowno m_mworkbench setmwindow mwindow m_onlycurrentrows mwindow istransaction windowsize windowsize mwindow getwindowsize tabsize mwindow gettabcount gosinglerow tabsize mtab mtab mtab m_mworkbench getmwindow gettab m_mworkbench getwindowcount initialquery mtab getrecordcount gosinglerow m_mworkbench getquery m_onlycurrentrows mtab setquery m_curtab mtab tabelement gridcontroller mtab issorttab vsorttab vsorttab m_curwindowno mtab getad_table_id mtab getad_columnsortorder_id mtab getad_columnsortyesno_id settablevel mtab gettablevel tabelement gridcontroller gridcontroller compierecolor mwindow getcolor setbackgroundcolor initgrid mtab m_curwindowno mwindow adddatastatuslistener registerescaction aignore m_curgc getpreferredsize setpreferredsize tabelement gosinglerow switchsinglerow mtab getincluded_tab_id includedmap mtab getincluded_tab_id includedmap gridcontroller gridcontroller includedmap mtab getad_tab_id includetab tabbedpane stringbuffer tabname stringbuffer tabname mtab isreadonly tabname mtab getname indexof tabname mtab getname tabname mtab getname mtab getname mtab isreadonly tabname tabname addtab tabname tostring mtab geticon tabelement mtab getdescription setbackgroundcolor compierecolor mwindow m_mworkbench getwindowcount settooltiptext m_mworkbench getdescription tabpanel addtab m_mworkbench getname m_mworkbench geticon m_mworkbench getdescription getheader setcontext m_ctx m_curwindowno windowname m_mworkbench getname statechanged toolbar setname gettitle m_curtab gettablemodel setchanged adetail setenabled m_curwintab gettabcount windowsize setpreferredsize windowsize getpreferredsize m_curwintab requestfocusinwindow get current window no return win no public int get window no return m curwindowno getwindowno m_curwindowno initial query param query initial query param m tab tab return query or null private m query initial query m query query m tab m tab we have a zoom query if query null query is active query get record count 10 return query string buffer where new string buffer query automatically if high volume and no query boolean require m tab is high volume if require m onlycurrentrows no trx window string wh1 m tab get where extended if wh1 null wh1 length 0 wh1 m tab get where clause if wh1 null wh1 length 0 where append wh1 if query null string wh2 query get where clause if wh2 length 0 if where length 0 where append and where append wh2 string buffer sql new string buffer select count from append m tab get table name if where length 0 sql append where append where does not consider security int no db getsql value null sql to string require m role get default is query require no show query if require m field find fields m tab get fields find find new find env get frame this m curwindowno m tab get name m tab getad table id m tab get table name where to string find fields 10 no query below 10 query find get query find null return query mtab mquery initialquery mquery mtab mtab isactive getrecordcount stringbuffer stringbuffer mtab ishighvolume m_onlycurrentrows mtab getwhereextended mtab getwhereclause getwhereclause stringbuffer stringbuffer mtab gettablename getsqlvalue tostring mrole getdefault isqueryrequire mfield findfields mtab getfields getframe m_curwindowno mtab getname mtab getad_table_id mtab gettablename tostring findfields getquery get window index return window index private int get window index only one window if m mworkbench get window count 1 return 0 workbench return tab panel get selected index getwindowindex m_mworkbench getwindowcount tabpanel getselectedindex is first tab on window return true if the panel displays the first tab private boolean is first tab return m curwintab get selected index 0 isfirsttab m_curwintab getselectedindex get window image return image or null public image get image return m mworkbench get image get window index getimage m_mworkbench getimage getwindowindex data status listener row change v param e event public void data status changed data status event e if m disposing return log info e get message string db info e get message if m curtab null m curtab is query active db info db info status bar set statusdb db info e set message info if e getad message null e get info null string buffer sb new string buffer string msg e get message if msg null msg length 0 sb append msg get msg m ctx e getad message string info e get info if info null info length 0 if sb length 0 sb to string trim ends with sb append sb append info if sb length 0 int pos sb index of n if pos 1 replace cr nl sb replace pos pos 1 set status line sb to string e is error confirm error if e is error e is confirmed a dialog error m curwindowno this e getad message e get info e set confirmed true show just once if m table set current row is involved the status event is re issued m errordisplayed true confirm warning else if e is warning e is confirmed a dialog warn m curwindowno this e getad message e get info e set confirmed true show just once if m table set current row is involved the status event is re issued update navigation boolean first row e is first row a first set enabled first row a previous set enabled first row boolean last row e is last row a next set enabled last row a last set enabled last row update change boolean changed e is changed e is inserting boolean read only m curtab is read only boolean insert record read only if insert record insert record m curtab is insert record a new set enabled changed insert record a copy set enabled changed insert record a refresh set enabled changed a delete set enabled changed read only if read only m curtab is always update field read only false a ignore set enabled changed read only a save set enabled changed read only no rows if e get total rows 0 insert record a new set enabled true a delete set enabled false single multi a multi set pressed m curgc is single row history on first tab only if is first tab a history set pressed m curtab is only current rows transaction info string trx info m curtab get trx info if trx info null status bar set info trx info check attachment boolean can have attachment m curtab can have attachment not single id column if can have attachment e is loading m curtab get current row e get loaded rows can have attachment false if can have attachment m curtab getrecord id 1 no key can have attachment false if can have attachment a attachment set enabled true a attachment set pressed m curtab has attachment else a attachment set enabled false lock indicator if m ispersonallock a lock set pressed m curtab is locked log info a panel data status changed fini e get message datastatuschanged datastatusevent m_disposing getmessage dbinfo getmessage m_curtab m_curtab isqueryactive dbinfo dbinfo statusbar setstatusdb dbinfo getad_message getinfo stringbuffer stringbuffer getmessage getmsg m_ctx getad_message getinfo tostring endswith indexof setstatusline tostring iserror iserror isconfirmed adialog m_curwindowno getad_message getinfo setconfirmed mtable setcurrentrow m_errordisplayed iswarning isconfirmed adialog m_curwindowno getad_message getinfo setconfirmed mtable setcurrentrow firstrow isfirstrow afirst setenabled firstrow aprevious setenabled firstrow lastrow islastrow anext setenabled lastrow alast setenabled lastrow ischanged isinserting readonly m_curtab isreadonly insertrecord readonly insertrecord insertrecord m_curtab isinsertrecord anew setenabled insertrecord acopy setenabled insertrecord arefresh setenabled adelete setenabled readonly readonly m_curtab isalwaysupdatefield readonly aignore setenabled readonly asave setenabled readonly gettotalrows insertrecord anew setenabled adelete setenabled amulti setpressed m_curgc issinglerow isfirsttab ahistory setpressed m_curtab isonlycurrentrows trxinfo m_curtab gettrxinfo trxinfo statusbar setinfo trxinfo canhaveattachment m_curtab canhaveattachment _id canhaveattachment isloading m_curtab getcurrentrow getloadedrows canhaveattachment canhaveattachment m_curtab getrecord_id canhaveattachment canhaveattachment aattachment setenabled aattachment setpressed m_curtab hasattachment aattachment setenabled m_ispersonallock alock setpressed m_curtab islocked apanel datastatuschanged getmessage set status line to text param text clear text param error error flag public void set status line string text boolean error log fine text status bar set status line text error setstatusline statusbar setstatusline indicate busy param busy busy private void set busy boolean busy m islocked busy j frame frame env get frame this if frame null during init return if frame instanceof a window a window frame set busy busy string processing msg get msg m ctx processing if busy set status line processing this set cursor cursor get predefined cursor cursor wait cursor frame set cursor cursor get predefined cursor cursor wait cursor else this set cursor cursor get default cursor frame set cursor cursor get default cursor m curgc request focus if status bar get status line equals processing status bar set status line setbusy m_islocked jframe getframe awindow awindow setbusy getmsg m_ctx setstatusline setcursor getpredefinedcursor wait_cursor setcursor getpredefinedcursor wait_cursor setcursor getdefaultcursor setcursor getdefaultcursor m_curgc requestfocus statusbar getstatusline statusbar setstatusline change listener tab change param e event public void state changed change event e if m disposing return log info e to string set busy true v tabbed pane tp v tabbed pane e get source boolean back false boolean isa panel tab false workbench tab change if tp is workbench int wb index tab panel get selected index m curwindowno m mworkbench get window no wb index window change log info cur win m curwindowno win tp if tp get selected component instanceof j tabbed pane m curwintab j tabbed pane tp get selected component else throw new java lang illegal argument exception window does not contain tabs if m curwintab get selected component instanceof grid controller m curgc grid controller m curwintab get selected component else if m curwintab get selected component instanceof a panel tab isa panel tab true else throw new java lang illegal argument exception window tab does not contain grid controler change pointers m curtabindex m curwintab get selected index else just a tab change log info tab tp m curwintab tp int tp index m curwintab get selected index back tp index m curtabindex grid controller gc null if m curwintab get selected component instanceof grid controller gc grid controller m curwintab get selected component else if m curwintab get selected component instanceof a panel tab isa panel tab true else throw new java lang illegal argument exception tab does not contain grid controler save old tab if m curgc null m curgc stop editor true has anything changed if m curtab need save true false do we have real change if m curtab need save true true automatic save if env is auto commit m ctx m curwindowno m curtab data save true there is a problem so we go back m curwintab set selected index m curtabindex set busy false return explicitly ask when changing tabs else if a dialog ask m curwindowno this save changes m curtab get commit warning yes we want to save if m curtab data save true there is a problem so we go back m curwintab set selected index m curtabindex set busy false return else don t save m curtab data ignore else new record but nothing changed m curtab data ignore there is a change if m curapaneltab null m curapaneltab save data m curapaneltab unregister panel m curapaneltab null new tab if m curtabindex 0 m curwintab set foreground at m curtabindex compiereplaf gettextcolor normal m curwintab set foreground at tp index compiereplaf gettextcolor ok m curtabindex tp index if isa panel tab m curgc gc sort tab handling if isa panel tab m curapaneltab a panel tab m curwintab get selected component m curapaneltab registera panel this m curapaneltab load data else cur tab setting m curgc activate m curtab m curgc getm tab refresh only current row when tab is current if back m curtab is current m curtab data refresh else requery auto size m curgc query m onlycurrentrows m onlycurrentdays set initial record if m curtab get row count 0 automatically create new record if none tab not ro if m curtab is read only env is auto new m ctx m curwindowno m curtab is query new record log config no record creating new m curtab data new false else no records found a save set enabled false a delete set enabled false m curtab navigate current updates counter m curgc dynamic display 0 else change m curtab navigate current update navigation a detail set enabled m curtabindex m curwintab get tab count 1 a parent set enabled m curtabindex 0 m curwintab get tab count 1 history on first tab only if m mworkbench getm window get window index is transaction a history set enabled is first tab else a history set pressed false a history set enabled false document print a print set enabled m curtab is printed query a find set pressed m curtab is query active order tab if isa panel tab a multi set pressed false a multi set enabled false a new set enabled false a delete set enabled false a find set enabled false a refresh set enabled false a attachment set enabled false else grid tab a multi set enabled true a multi set pressed m curgc is single row a find set enabled true a refresh set enabled true a attachment set enabled true m curwintab request focus in window set busy false log config fini statechanged changeevent m_disposing tostring setbusy vtabbedpane vtabbedpane getsource isapaneltab isworkbench wbindex tabpanel getselectedindex m_curwindowno m_mworkbench getwindowno wbindex curwin m_curwindowno getselectedcomponent jtabbedpane m_curwintab jtabbedpane getselectedcomponent illegalargumentexception m_curwintab getselectedcomponent gridcontroller m_curgc gridcontroller m_curwintab getselectedcomponent m_curwintab getselectedcomponent apaneltab isapaneltab illegalargumentexception gridcontroler m_curtabindex m_curwintab getselectedindex m_curwintab tpindex m_curwintab getselectedindex tpindex m_curtabindex gridcontroller m_curwintab getselectedcomponent gridcontroller gridcontroller m_curwintab getselectedcomponent m_curwintab getselectedcomponent apaneltab isapaneltab illegalargumentexception gridcontroler m_curgc m_curgc stopeditor m_curtab needsave m_curtab needsave isautocommit m_ctx m_curwindowno m_curtab datasave m_curwintab setselectedindex m_curtabindex setbusy adialog m_curwindowno savechanges m_curtab getcommitwarning m_curtab datasave m_curwintab setselectedindex m_curtabindex setbusy m_curtab dataignore m_curtab dataignore m_curapaneltab m_curapaneltab savedata m_curapaneltab unregisterpanel m_curapaneltab m_curtabindex m_curwintab setforegroundat m_curtabindex gettextcolor_normal m_curwintab setforegroundat tpindex gettextcolor_ok m_curtabindex tpindex isapaneltab m_curgc isapaneltab m_curapaneltab apaneltab m_curwintab getselectedcomponent m_curapaneltab registerapanel m_curapaneltab loaddata m_curgc m_curtab m_curgc getmtab m_curtab iscurrent m_curtab datarefresh autosize m_curgc m_onlycurrentrows m_onlycurrentdays m_curtab getrowcount m_curtab isreadonly isautonew m_ctx m_curwindowno m_curtab isquerynewrecord m_curtab datanew asave setenabled adelete setenabled m_curtab navigatecurrent m_curgc dynamicdisplay m_curtab navigatecurrent adetail setenabled m_curtabindex m_curwintab gettabcount aparent setenabled m_curtabindex m_curwintab gettabcount m_mworkbench getmwindow getwindowindex istransaction ahistory setenabled isfirsttab ahistory setpressed ahistory setenabled aprint setenabled m_curtab isprinted afind setpressed m_curtab isqueryactive isapaneltab amulti setpressed amulti setenabled anew setenabled adelete setenabled afind setenabled arefresh setenabled aattachment setenabled amulti setenabled amulti setpressed m_curgc issinglerow afind setenabled arefresh setenabled aattachment setenabled m_curwintab requestfocusinwindow setbusy navigate to detail tab private void cmd detail int index m curwintab get selected index if index m curwintab get tab count 1 return m curgc get table remove editor m curwintab set selected index index 1 cmd_detail m_curwintab getselectedindex m_curwintab gettabcount m_curgc gettable removeeditor m_curwintab setselectedindex navigate to parent tab private void cmd parent int index m curwintab get selected index if index 0 return m curgc get table remove editor m curwintab set selected index index 1 cmd_parent m_curwintab getselectedindex m_curgc gettable removeeditor m_curwintab setselectedindex action listener param e event public void action performed action event e log info e get action command e get modifiers new timestamp e get when isui locked if m disposing isui locked return m lastmodifiers e get modifiers string cmd e get action command do screen shot w o busy if cmd equals screen shot a env action performed e get action command m curwindowno this return problem double click detection can t disable button as clicking button may change button status set busy true command buttons if e get source instanceof v button action button v button e get source set busy false return try file if cmd equals a report get name cmd report else if cmd equals a print get name cmd print else if cmd equals a end get name cmd end false else if cmd equals a exit get name cmd end true edit else if cmd equals a new get name cmd new false else if cmd equals a save get name cmd save true else if cmd equals a copy get name cmd new true else if cmd equals a delete get name cmd delete else if cmd equals a ignore get name cmd ignore else if cmd equals a refresh get name cmd refresh else if cmd equals a find get name cmd find else if m ispersonallock cmd equals a lock get name cmd lock view else if cmd equals a attachment get name cmd attachment else if cmd equals a history get name cmd history else if cmd equals a multi get name m curgc switch row presentation go else if cmd equals a first get name cmd save false m curgc get table remove editor m curtab navigate 0 else if cmd equals a previous get name cmd save false m curgc get table remove editor m curtab navigate relative 1 else if cmd equals a next get name cmd save false m curgc get table remove editor m curtab navigate relative 1 else if cmd equals a last get name cmd save false m curgc get table remove editor m curtab navigate m curtab get row count 1 else if cmd equals a parent get name cmd parent else if cmd equals a detail get name cmd detail else if cmd equals a zoom across get name cmd zoomacross else if cmd equals a request get name cmd request else if cmd equals a archive get name cmd archive tools else if a workflow null cmd equals a workflow get name if m curtab getrecord id 0 else if m curtab get tab no 0 m mworkbench getm window get window index is transaction a env start workflow process m curtab getad table id m curtab getrecord id else a env start workflow process m curtab getad table id m curtab getrecord id else if a win size null cmd equals a win size get name cmd winsize help else if cmd equals a help get name cmd help general commands environment else if a env action performed e get action command m curwindowno this log log level severe no action for cmd catch exception ex log log level severe cmd ex string msg ex get message if msg null msg length 0 msg ex to string msg msg parse translation m ctx msg a dialog error m curwindowno this error msg m curwintab request focus in window set busy false actionperformed actionevent getactioncommand getmodifiers getwhen isuilocked m_disposing isuilocked m_lastmodifiers getmodifiers getactioncommand screenshot screenshot aenv actionperformed getactioncommand m_curwindowno doubleclick setbusy getsource vbutton actionbutton vbutton getsource setbusy areport getname cmd_report aprint getname cmd_print aend getname cmd_end aexit getname cmd_end anew getname cmd_new asave getname cmd_save acopy getname cmd_new adelete getname cmd_delete aignore getname cmd_ignore arefresh getname cmd_refresh afind getname cmd_find m_ispersonallock alock getname cmd_lock aattachment getname cmd_attachment ahistory getname cmd_history amulti getname m_curgc switchrowpresentation afirst getname cmd_save m_curgc gettable removeeditor m_curtab aprevious getname cmd_save m_curgc gettable removeeditor m_curtab navigaterelative anext getname cmd_save m_curgc gettable removeeditor m_curtab navigaterelative alast getname cmd_save m_curgc gettable removeeditor m_curtab m_curtab getrowcount aparent getname cmd_parent adetail getname cmd_detail azoomacross getname cmd_zoomacross arequest getname cmd_request aarchive getname cmd_archive aworkflow aworkflow getname m_curtab getrecord_id m_curtab gettabno m_mworkbench getmwindow getwindowindex istransaction aenv startworkflowprocess m_curtab getad_table_id m_curtab getrecord_id aenv startworkflowprocess m_curtab getad_table_id m_curtab getrecord_id awinsize awinsize getname cmd_winsize ahelp getname cmd_help aenv actionperformed getactioncommand m_curwindowno getmessage tostring parsetranslation m_ctx adialog m_curwindowno m_curwintab requestfocusinwindow setbusy create new record param copy true if current record is to be copied private void cmd new boolean copy log config copy copy if m curtab is insert record log warning insert record disabled for tab return cmd save false m curtab data new copy m curgc dynamic display 0 m curtab get table model set changed false cmd_new m_curtab isinsertrecord cmd_save m_curtab datanew m_curgc dynamicdisplay m_curtab gettablemodel setchanged confirm delete record private void cmd delete if m curtab is read only return int keyid m curtab getrecord id if a dialog ask m curwindowno this delete record if m curtab data delete m curgc row changed false keyid m curgc dynamic display 0 cmd_delete m_curtab isreadonly m_curtab getrecord_id adialog m_curwindowno deleterecord m_curtab datadelete m_curgc rowchanged m_curgc dynamicdisplay if required ask if you want to save and save it param manual cmd true if invoked manually i e force return true if saved private boolean cmd save boolean manual cmd if m curapaneltab null manual cmd false log config manual manual cmd m errordisplayed false m curgc stop editor true boolean saveok true if m curapaneltab null m curapaneltab save data a save set enabled false set explicitly if m curtab get commit warning length 0 m curtab need save true false if a dialog ask m curwindowno this save changes m curtab get commit warning return false manually initiated boolean ret value m curtab data save manual cmd if there is no previous error if manual cmd ret value m errordisplayed a dialog error m curwindowno this save ignored set status line msg get msg m ctx save ignored true m curgc row changed true m curtab getrecord id if manual cmd m curgc dynamic display 0 return ret value manualcmd cmd_save manualcmd m_curapaneltab manualcmd manualcmd m_errordisplayed m_curgc stopeditor m_curapaneltab m_curapaneltab savedata asave setenabled m_curtab getcommitwarning m_curtab needsave adialog m_curwindowno savechanges m_curtab getcommitwarning retvalue m_curtab datasave manualcmd manualcmd retvalue m_errordisplayed adialog m_curwindowno saveignored setstatusline getmsg m_ctx saveignored m_curgc rowchanged m_curtab getrecord_id manualcmd m_curgc dynamicdisplay retvalue ignore private void cmd ignore m curgc stop editor false m curtab data ignore m curgc dynamic display 0 cmd_ignore m_curgc stopeditor m_curtab dataignore m_curgc dynamicdisplay refresh private void cmd refresh cmd save false m curtab data refresh all m curgc dynamic display 0 cmd_refresh cmd_save m_curtab datarefreshall m_curgc dynamicdisplay print standard report private void cmd report log info if m role get default is can report m curtab getad table id a dialog error m curwindowno this access cannot report return cmd save false query m query query new m query m curtab get table name link for detail records string query column m curtab get link column name current row otherwise if query column length 0 query column m curtab get key column name find display string info name null string info display null for int i 0 i m curtab get field count i m field field m curtab get field i if field is key info name field get header if field get column name equals name field get column name equals document no field get value null info display field get value to string if info name null info display null break if query column length 0 if query column ends with id query add restriction query column m query equal new integer env get context as int m ctx m curwindowno query column info name info display else query add restriction query column m query equal env get context m ctx m curwindowno query column info name info display new a report m curtab getad table id a report get button query cmd_report mrole getdefault iscanreport m_curtab getad_table_id adialog m_curwindowno accesscannotreport cmd_save mquery mquery m_curtab gettablename querycolumn m_curtab getlinkcolumnname querycolumn querycolumn m_curtab getkeycolumnname infoname infodisplay m_curtab getfieldcount mfield m_curtab getfield iskey infoname getheader getcolumnname getcolumnname documentno getvalue infodisplay getvalue tostring infoname infodisplay querycolumn querycolumn endswith _id addrestriction querycolumn mquery getcontextasint m_ctx m_curwindowno querycolumn infoname infodisplay addrestriction querycolumn mquery getcontext m_ctx m_curwindowno querycolumn infoname infodisplay areport m_curtab getad_table_id areport getbutton zoom across menu private void cmd zoomacross int record id m curtab getrecord id log info id record id if record id 0 return query m query query new m query current row string link m curtab get key column name link for detail records if link length 0 link m curtab get link column name if link length 0 if link ends with id query add restriction link m query equal new integer env get context as int m ctx m curwindowno link else query add restriction link m query equal env get context m ctx m curwindowno link new a zoom across a zoom across get button m curtab get table name query cmd_zoomacross record_id m_curtab getrecord_id record_id record_id mquery mquery m_curtab getkeycolumnname m_curtab getlinkcolumnname endswith _id addrestriction mquery getcontextasint m_ctx m_curwindowno addrestriction mquery getcontext m_ctx m_curwindowno azoomacross azoomacross getbutton m_curtab gettablename open view request private void cmd request int record id m curtab getrecord id log info id record id if record id 0 return int ad table id m curtab getad table id int c bpartner id 0 object bpartner id m curtab get value c bpartner id if bpartner id null c bpartner id integer bpartner id int value new a request a request get button ad table id record id c bpartner id cmd_request record_id m_curtab getrecord_id record_id record_id ad_table_id m_curtab getad_table_id c_bpartner_id bpartner_id m_curtab getvalue c_bpartner_id bpartner_id c_bpartner_id bpartner_id intvalue arequest arequest getbutton ad_table_id record_id c_bpartner_id open view archive private void cmd archive int record id m curtab getrecord id log info id record id if record id 0 return int ad table id m curtab getad table id new a archive a archive get button ad table id record id cmd_archive record_id m_curtab getrecord_id record_id record_id ad_table_id m_curtab getad_table_id aarchive aarchive getbutton ad_table_id record_id print specific report or start default report private void cmd print get process defined for this tab int ad process id m curtab getad process id log info id ad process id no report defined if ad process id 0 cmd report return cmd save false int table id m curtab getad table id int record id m curtab getrecord id process info pi new process info get title ad process id table id record id process ctl process this m curwindowno pi null calls lockui unlockui cmd_print ad_process_id m_curtab getad_process_id ad_process_id ad_process_id cmd_report cmd_save table_id m_curtab getad_table_id record_id m_curtab getrecord_id processinfo processinfo gettitle ad_process_id table_id record_id processctl m_curwindowno find set query private void cmd find if m curtab null return cmd save false gets fields from ad field v m field find fields m field create fields m ctx m curwindowno 0 m curtab getad tab id find find new find env get frame this m curwindowno m curtab get name m curtab getad table id m curtab get table name m curtab get where extended find fields 1 m query query find get query find null confirmed query if query null m onlycurrentrows false search history too m curtab set query query m curgc query m onlycurrentrows m onlycurrentdays auto size a find set pressed m curtab is query active cmd_find m_curtab cmd_save ad_field_v mfield findfields mfield createfields m_ctx m_curwindowno m_curtab getad_tab_id getframe m_curwindowno m_curtab getname m_curtab getad_table_id m_curtab gettablename m_curtab getwhereextended findfields mquery getquery m_onlycurrentrows m_curtab setquery m_curgc m_onlycurrentrows m_onlycurrentdays autosize afind setpressed m_curtab isqueryactive attachment private void cmd attachment log info int record id m curtab getrecord id if record id 1 no key a attachment set enabled false return attachment va new attachment env get frame this m curwindowno m curtab getad attachmentid m curtab getad table id record id null m curtab load attachments reload a attachment set pressed m curtab has attachment cmd_attachment record_id m_curtab getrecord_id record_id aattachment setenabled getframe m_curwindowno m_curtab getad_attachmentid m_curtab getad_table_id record_id m_curtab loadattachments aattachment setpressed m_curtab hasattachment lock private void cmd lock log info modifiers m lastmodifiers if m ispersonallock return int record id m curtab getrecord id if record id 1 no key return control pressed if m lastmodifiers input event ctrl mask 0 new record access dialog env get frame this m curtab getad table id record id else m curtab lock env get ctx record id a lock get button is selected m curtab load attachments reload a lock set pressed m curtab is locked cmd_lock m_lastmodifiers m_ispersonallock record_id m_curtab getrecord_id record_id m_lastmodifiers inputevent ctrl_mask recordaccessdialog getframe m_curtab getad_table_id record_id m_curtab getctx record_id alock getbutton isselected m_curtab loadattachments alock setpressed m_curtab islocked toggle history private void cmd history log info if m mworkbench getm window get window index is transaction if m curtab need save true true cmd save false return point pt new point 0 a history get button get bounds height swing utilities convert point to screen pt a history get button v only current days ocd new v only current days env get frame this pt m onlycurrentdays ocd get current days if m onlycurrentdays 1 day m onlycurrentrows true m onlycurrentdays 0 no created restriction else m onlycurrentrows false log config only current m onlycurrentrows days m onlycurrentdays no check for max query records m curgc query m onlycurrentrows m onlycurrentdays auto size cmd_history m_mworkbench getmwindow getwindowindex istransaction m_curtab needsave cmd_save ahistory getbutton getbounds swingutilities convertpointtoscreen ahistory getbutton vonlycurrentdays vonlycurrentdays getframe m_onlycurrentdays getcurrentdays m_onlycurrentdays m_onlycurrentrows m_onlycurrentdays m_onlycurrentrows onlycurrent m_onlycurrentrows m_onlycurrentdays m_curgc m_onlycurrentrows m_onlycurrentdays autosize help private void cmd help log info help hlp new help env get frame this this get title m mworkbench getm window get window index hlp set visible true cmd_help getframe gettitle m_mworkbench getmwindow getwindowindex setvisible close this screen after save param exit ask if user wants to exit application private void cmd end boolean exit boolean exit system false if cmd save false return if exit a dialog ask m curwindowno this exit application exit system true env get frame this dispose calls this dispose if exit system a env exit 0 cmd_end exitsystem cmd_save adialog m_curwindowno exitapplication exitsystem getframe exitsystem aenv set window size private void cmd winsize dimension size get size if a dialog ask m curwindowno this win size set x size width y size height set preferred size null swing utilities get window ancestor this pack size new dimension 0 0 m window win new m window m ctx m curtab getad window id null win set window size size win save cmd_winsize getsize adialog m_curwindowno winsizeset setpreferredsize swingutilities getwindowancestor m_window m_window m_ctx m_curtab getad_window_id setwindowsize start button process param v button button private void action button v button v button log info v button to string boolean startw oasking false string col v button get column name zoom if col equals record id int ad table id env get context as int m ctx m curwindowno ad table id int record id env get context as int m ctx m curwindowno record id a env zoom ad table id record id return zoom save first if m curtab need save true false if cmd save true return int table id m curtab getad table id record id int record id m curtab getrecord id record id language handling if record id 1 m curtab get key column name equals ad language record id env get context as int m ctx m curwindowno ad language id record id change log id if record id 1 v button getprocess id 306 v button getprocess id 307 integer id integer m curtab get value ad changelog id record id id int value ensure it s saved if record id 1 m curtab get key column name ends with id a dialog error m curwindowno this save error row not found return pop up payment rules if col equals payment rule v payment vp new v payment m curwindowno m curtab v button if vp is initok may not be allowed vp set visible true vp dispose if vp need save cmd save false cmd refresh payment rule pop up document action workflow else if col equals doc action v doc action vda new v doc action m curwindowno m curtab v button record id something to select from if vda get number of options 0 vda dispose log info doc action no options return else vda set visible true if vda get start process return startw oasking true vda dispose doc action pop up create from else if col equals create from m curwindowno v create from vcf v create from create m curtab if vcf null if vcf is initok vcf set visible true vcf dispose m curtab data refresh else vcf dispose return else may start process create from posting else if col equals posted m role get default is show acct check doc status string processed env get context m ctx m curwindowno processed if processed equals y string doc status env get context m ctx m curwindowno doc status if doc action status completed equals doc status doc action status closed equals doc status doc action status reversed equals doc status doc action status voided equals doc status else a dialog error m curwindowno this post doc not complete return check post status object ps m curtab get value posted if ps null ps equals y new org compiere acct acct viewer env get context as int m ctx m curwindowno ad client id m curtab getad table id m curtab getrecord id else if a dialog ask m curwindowno this post immediate string error a env post immediate m curwindowno env getad client id m ctx m curtab getad table id m curtab getrecord id false m curtab data refresh if error null a dialog error m curwindowno this posting error n error return posted start process log config process id v button getprocess id record id record id if v button getprocess id 0 return save item changed if m curtab need save true false if cmd save true return ask user to start process if description and help is not empty if startw oasking v button get description equals v button get help equals if a dialog ask m curwindowno this start process b i v button get text i b br v button get description n v button get help return string title v button get description if title null title length 0 title v button get name process info pi new process info title v button getprocess id table id record id pi setad user id env getad user id m ctx pi setad client id env getad client id m ctx trx trx trx get trx create trx name apps panel true process ctl process this m curwindowno pi null calls lockui unlockui vbutton actionbutton vbutton vbutton vbutton tostring startwoasking vbutton getcolumnname record_id ad_table_id getcontextasint m_ctx m_curwindowno ad_table_id record_id getcontextasint m_ctx m_curwindowno record_id aenv ad_table_id record_id m_curtab needsave cmd_save table_id m_curtab getad_table_id record_id record_id m_curtab getrecord_id record_id record_id m_curtab getkeycolumnname ad_language record_id getcontextasint m_ctx m_curwindowno ad_language_id record_id record_id vbutton getprocess_id vbutton getprocess_id m_curtab getvalue ad_changelog_id record_id intvalue record_id m_curtab getkeycolumnname endswith _id adialog m_curwindowno saveerrorrownotfound paymentrule vpayment vpayment m_curwindowno m_curtab vbutton isinitok setvisible needsave cmd_save cmd_refresh paymentrule docaction vdocaction vdocaction m_curwindowno m_curtab vbutton record_id getnumberofoptions docaction setvisible getstartprocess startwoasking docaction createfrom m_curwindowno vcreatefrom vcreatefrom m_curtab isinitok setvisible m_curtab datarefresh createfrom mrole getdefault isshowacct getcontext m_ctx m_curwindowno docstatus getcontext m_ctx m_curwindowno docstatus docaction status_completed docstatus docaction status_closed docstatus docaction status_reversed docstatus docaction status_voided docstatus adialog m_curwindowno postdocnotcomplete m_curtab getvalue acctviewer getcontextasint m_ctx m_curwindowno ad_client_id m_curtab getad_table_id m_curtab getrecord_id adialog m_curwindowno postimmediate aenv postimmediate m_curwindowno getad_client_id m_ctx m_curtab getad_table_id m_curtab getrecord_id m_curtab datarefresh adialog m_curwindowno postingerror process_id vbutton getprocess_id record_id record_id vbutton getprocess_id m_curtab needsave cmd_save startwoasking vbutton getdescription vbutton gethelp adialog m_curwindowno startprocess vbutton gettext vbutton getdescription vbutton gethelp vbutton getdescription vbutton getname processinfo processinfo vbutton getprocess_id table_id record_id setad_user_id getad_user_id m_ctx setad_client_id getad_client_id m_ctx createtrxname appspanel processctl m_curwindowno lock user interface called from the worker before processing param pi process info public void lockui process info pi log fine pi set busy true processinfo setbusy unlock user interface called from the worker when processing is done param pi of execute a sync call public void unlockui process info pi log fine pi set busy false process result if pi null refresh if not print pi getad process id m curtab getad process id refresh data m curtab data refresh m curgc dynamic display 0 update status line set status line pi get summary pi is error get log info process info util set log fromdb pi string log pi get log info if log length 0 a dialog info m curwindowno this env get header m ctx m curwindowno pi get title log clear text async processinfo setbusy getad_process_id m_curtab getad_process_id m_curtab datarefresh m_curgc dynamicdisplay setstatusline getsummary iserror processinfoutil setlogfromdb getloginfo adialog m_curwindowno getheader m_ctx m_curwindowno gettitle is the ui locked internal method return true if ui is locked public boolean isui locked return m islocked isuilocked m_islocked method to be executed async called from the a sync process worker param pi process info public void executea sync process info pi log config asyncprocess executeasync processinfo get current tab return current tab protected m tab get current tab return m curtab mtab getcurrenttab m_curtab string representation return string representation public string to string string s a panel cur window no m curwindowno if m mworkbench null s wb m mworkbench to string s return s tostring apanel curwindowno m_curwindowno m_mworkbench m_mworkbench tostring standard constructor public x ad desktopworkbench properties ctx int ad desktopworkbench id string trx name super ctx ad desktopworkbench id trx name if ad desktopworkbench id 0 setad desktopworkbench id 0 setad desktop id 0 setad workbench id 0 set seq no 0 x_ad_desktopworkbench ad_desktopworkbench_id trxname ad_desktopworkbench_id trxname ad_desktopworkbench_id setad_desktopworkbench_id setad_desktop_id setad_workbench_id setseqno load constructor public x ad desktopworkbench properties ctx result set rs string trx name super ctx rs trx name x_ad_desktopworkbench resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad desktopworkbench append get id append return sb to string tostring stringbuffer stringbuffer x_ad_desktopworkbench get_id tostring set desktop workbench public void setad desktopworkbench id int ad desktopworkbench id if ad desktopworkbench id 1 throw new illegal argument exception ad desktopworkbench id is mandatory set valuenocheck ad desktopworkbench id new integer ad desktopworkbench id setad_desktopworkbench_id ad_desktopworkbench_id ad_desktopworkbench_id illegalargumentexception ad_desktopworkbench_id set_valuenocheck ad_desktopworkbench_id ad_desktopworkbench_id get desktop workbench public int getad desktopworkbench id integer ii integer get value ad desktopworkbench id if ii null return 0 return ii int value getad_desktopworkbench_id get_value ad_desktopworkbench_id intvalue set desktop collection of workbenches public void setad desktop id int ad desktop id if ad desktop id 1 throw new illegal argument exception ad desktop id is mandatory set valuenocheck ad desktop id new integer ad desktop id setad_desktop_id ad_desktop_id ad_desktop_id illegalargumentexception ad_desktop_id set_valuenocheck ad_desktop_id ad_desktop_id get desktop collection of workbenches public int getad desktop id integer ii integer get value ad desktop id if ii null return 0 return ii int value getad_desktop_id get_value ad_desktop_id intvalue set workbench collection of windows reports public void setad workbench id int ad workbench id if ad workbench id 1 throw new illegal argument exception ad workbench id is mandatory set value ad workbench id new integer ad workbench id setad_workbench_id ad_workbench_id ad_workbench_id illegalargumentexception ad_workbench_id set_value ad_workbench_id ad_workbench_id get workbench collection of windows reports public int getad workbench id integer ii integer get value ad workbench id if ii null return 0 return ii int value getad_workbench_id get_value ad_workbench_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad workbench id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_workbench_id set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x m perpetualinv properties ctx int m perpetualinv id string trx name super ctx m perpetualinv id trx name if m perpetualinv id 0 set count high movement false set date next run new timestamp system current time millis setm perpetualinv id 0 set name null set no inventory count 0 1 set no product count 0 1 set number of runs 0 1 x_m_perpetualinv m_perpetualinv_id trxname m_perpetualinv_id trxname m_perpetualinv_id setcounthighmovement setdatenextrun currenttimemillis setm_perpetualinv_id setname setnoinventorycount setnoproductcount setnumberofruns load constructor public x m perpetualinv properties ctx result set rs string trx name super ctx rs trx name x_m_perpetualinv resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m perpetualinv append get id append return sb to string tostring stringbuffer stringbuffer x_m_perpetualinv get_id tostring set count high turnover items count high movement products public void set count high movement boolean count high movement set value count high movement new boolean count high movement setcounthighmovement counthighmovement set_value counthighmovement counthighmovement get count high turnover items count high movement products public boolean is count high movement object oo get value count high movement if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscounthighmovement get_value counthighmovement booleanvalue set date last run date the process was last run public void set date last run timestamp date last run set valuenocheck date last run date last run setdatelastrun datelastrun set_valuenocheck datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run if date next run null throw new illegal argument exception date next run is mandatory set valuenocheck date next run date next run setdatenextrun datenextrun datenextrun illegalargumentexception datenextrun set_valuenocheck datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set perpetual inventory rules for generating physical inventory public void setm perpetualinv id int m perpetualinv id if m perpetualinv id 1 throw new illegal argument exception m perpetualinv id is mandatory set valuenocheck m perpetualinv id new integer m perpetualinv id setm_perpetualinv_id m_perpetualinv_id m_perpetualinv_id illegalargumentexception m_perpetualinv_id set_valuenocheck m_perpetualinv_id m_perpetualinv_id get perpetual inventory rules for generating physical inventory public int getm perpetualinv id integer ii integer get value m perpetualinv id if ii null return 0 return ii int value getm_perpetualinv_id get_value m_perpetualinv_id intvalue set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set number of inventory counts frequency of inventory counts per year public void set no inventory count int no inventory count set value no inventory count new integer no inventory count setnoinventorycount noinventorycount set_value noinventorycount noinventorycount get number of inventory counts frequency of inventory counts per year public int get no inventory count integer ii integer get value no inventory count if ii null return 0 return ii int value getnoinventorycount get_value noinventorycount intvalue set number of product counts frequency of product counts per year public void set no product count int no product count set value no product count new integer no product count setnoproductcount noproductcount set_value noproductcount noproductcount get number of product counts frequency of product counts per year public int get no product count integer ii integer get value no product count if ii null return 0 return ii int value getnoproductcount get_value noproductcount intvalue set number of runs frequency of processing perpetual inventory public void set number of runs int number of runs set value number of runs new integer number of runs setnumberofruns numberofruns set_value numberofruns numberofruns get number of runs frequency of processing perpetual inventory public int get number of runs integer ii integer get value number of runs if ii null return 0 return ii int value getnumberofruns get_value numberofruns intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor param ctx context param m sernoctl id id public m ser no ctl properties ctx int m sernoctl id string trx name super ctx m sernoctl id trx name if m sernoctl id 0 setm sernoctl id 0 set start no 1 set current next 1 set increment no 1 set name null m_sernoctl_id msernoctl m_sernoctl_id trxname m_sernoctl_id trxname m_sernoctl_id setm_sernoctl_id setstartno setcurrentnext setincrementno setname load constructor param ctx context param rs result set public m ser no ctl properties ctx result set rs string trx name super ctx rs trx name msernoctl resultset trxname trxname create new lot increments current next and commits return saved lot public string create ser no string buffer name new string buffer if get prefix null name append get prefix int no get current next name append no if get suffix null name append get suffix no get increment no set current next no save return name to string createserno stringbuffer stringbuffer getprefix getprefix getcurrentnext getsuffix getsuffix getincrementno setcurrentnext tostring standard constructor public x ad orginfo properties ctx int ad orginfo id string trx name super ctx ad orginfo id trx name if ad orginfo id 0 setduns null set taxid null x_ad_orginfo ad_orginfo_id trxname ad_orginfo_id trxname ad_orginfo_id settaxid load constructor public x ad orginfo properties ctx result set rs string trx name super ctx rs trx name x_ad_orginfo resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad orginfo append get id append return sb to string tostring stringbuffer stringbuffer x_ad_orginfo get_id tostring set organization type organization type allows you to categorize your organizations public void setad orgtype id int ad orgtype id if ad orgtype id 0 set value ad orgtype id null else set value ad orgtype id new integer ad orgtype id setad_orgtype_id ad_orgtype_id ad_orgtype_id set_value ad_orgtype_id set_value ad_orgtype_id ad_orgtype_id get organization type organization type allows you to categorize your organizations public int getad orgtype id integer ii integer get value ad orgtype id if ii null return 0 return ii int value getad_orgtype_id get_value ad_orgtype_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set d u n s dun bradstreet number public void setduns string duns if duns null throw new illegal argument exception duns is mandatory if duns length 11 log warning length 11 truncated duns duns substring 0 10 set value duns duns illegalargumentexception set_value get d u n s dun bradstreet number public string getduns return string get value duns get_value set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue public static final int parent org id ad reference id 130 set parent organization parent superior organization public void setparent org id int parent org id if parent org id 0 set value parent org id null else set value parent org id new integer parent org id parent_org_id_ad_reference_id setparent_org_id parent_org_id parent_org_id set_value parent_org_id set_value parent_org_id parent_org_id get parent organization parent superior organization public int getparent org id integer ii integer get value parent org id if ii null return 0 return ii int value getparent_org_id get_value parent_org_id intvalue public static final int supervisor id ad reference id 286 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 0 set value supervisor id null else set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id set_value supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue set tax id tax identification public void set taxid string taxid if taxid null throw new illegal argument exception taxid is mandatory if taxid length 20 log warning length 20 truncated taxid taxid substring 0 19 set value taxid taxid settaxid illegalargumentexception set_value get tax id tax identification public string get taxid return string get value taxid gettaxid get_value standarc constructor param ctx ctx param c dunningrunline id id public m dunning run line properties ctx int c dunningrunline id string trx name super ctx c dunningrunline id trx name if c dunningrunline id 0 set amt env zero set open amt env zero set converted amt env zero set fee amt env zero set interest amt env zero set total amt env zero set days due 0 set times dunned 0 set is in dispute false set processed false c_dunningrunline_id mdunningrunline c_dunningrunline_id trxname c_dunningrunline_id trxname c_dunningrunline_id setamt setopenamt setconvertedamt setfeeamt setinterestamt settotalamt setdaysdue settimesdunned setisindispute setprocessed load constructor param ctx context param rs result set public m dunning run line properties ctx result set rs string trx name super ctx rs trx name mdunningrunline resultset trxname trxname parent constructor param parent parent public m dunning run line m dunning run entry parent this parent get ctx 0 parent get trxname set client org parent setc dunningrunentry id parent getc dunningrunentry id m parent parent m c currencyto id parent getc currency id mdunningrunline mdunningrunentry getctx get_trxname setclientorg setc_dunningrunentry_id getc_dunningrunentry_id m_parent m_c_currencyto_id getc_currency_id get parent return parent public m dunning run entry get parent if m parent null m parent new m dunning run entry get ctx getc dunningrunentry id get trxname return m parent mdunningrunentry getparent m_parent m_parent mdunningrunentry getctx getc_dunningrunentry_id get_trxname m_parent get invoice return returns the invoice public m invoice get invoice if getc invoice id 0 m invoice null else if m invoice null m invoice new m invoice get ctx getc invoice id get trxname return m invoice minvoice getinvoice getc_invoice_id m_invoice m_invoice m_invoice minvoice getctx getc_invoice_id get_trxname m_invoice set invoice param invoice the invoice to set public void set invoice m invoice invoice m invoice invoice if invoice null m c currencyfrom id invoice getc currency id set amt invoice get grand total set open amt get amt not correct set converted amt m conversion rate convert get ctx get open amt getc currencyfrom id getc currencyto id getad client id getad org id else m c currencyfrom id 0 set amt env zero set open amt env zero set converted amt env zero setinvoice minvoice m_invoice m_c_currencyfrom_id getc_currency_id setamt getgrandtotal setopenamt getamt setconvertedamt mconversionrate getctx getopenamt getc_currencyfrom_id getc_currencyto_id getad_client_id getad_org_id m_c_currencyfrom_id setamt setopenamt setconvertedamt set invoice param c invoice id param c currency id param grand total param open param days due param is in dispute param times dunned param days after last not used public void set invoice int c invoice id int c currency id big decimal grand total big decimal open int days due boolean is in dispute int times dunned int days after last setc invoice id c invoice id m c currencyfrom id c currency id set amt grand total set open amt open set converted amt m conversion rate convert get ctx get open amt c currency id getc currencyto id getad client id getad org id set is in dispute is in dispute set days due days due set times dunned times dunned c_invoice_id c_currency_id grandtotal daysdue isindispute timesdunned daysafterlast setinvoice c_invoice_id c_currency_id bigdecimal grandtotal bigdecimal daysdue isindispute timesdunned daysafterlast setc_invoice_id c_invoice_id m_c_currencyfrom_id c_currency_id setamt grandtotal setopenamt setconvertedamt mconversionrate getctx getopenamt c_currency_id getc_currencyto_id getad_client_id getad_org_id setisindispute isindispute setdaysdue daysdue settimesdunned timesdunned get payment return returns the payment public m payment get payment if getc payment id 0 m payment null else if m payment null m payment new m payment get ctx getc payment id get trxname return m payment mpayment getpayment getc_payment_id m_payment m_payment m_payment mpayment getctx getc_payment_id get_trxname m_payment set payment public void set payment m payment payment m payment payment if payment null m c currencyfrom id payment getc currency id set amt payment get pay amt need to reverse set open amt get amt not correct set converted amt m conversion rate convert get ctx get open amt getc currencyfrom id getc currencyto id getad client id getad org id else m c currencyfrom id 0 set amt env zero set converted amt env zero set payment set payment param c payment id param c currency id param pay amt param open amt public void set payment int c payment id int c currency id big decimal pay amt big decimal open amt setc payment id c payment id m c currencyfrom id c currency id set amt pay amt set open amt open amt set converted amt m conversion rate convert get ctx get open amt c currency id getc currencyto id getad client id getad org id setpayment mpayment m_payment m_c_currencyfrom_id getc_currency_id setamt getpayamt setopenamt getamt setconvertedamt mconversionrate getctx getopenamt getc_currencyfrom_id getc_currencyto_id getad_client_id getad_org_id m_c_currencyfrom_id setamt setconvertedamt setpayment c_payment_id c_currency_id payamt openamt setpayment c_payment_id c_currency_id bigdecimal payamt bigdecimal openamt setc_payment_id c_payment_id m_c_currencyfrom_id c_currency_id setamt payamt setopenamt openamt setconvertedamt mconversionrate getctx getopenamt c_currency_id getc_currencyto_id getad_client_id getad_org_id get currency from invoice payment return returns the currency from public int getc currencyfrom id if m c currencyfrom id 0 if getc invoice id 0 m c currencyfrom id get invoice getc currency id else if getc payment id 0 m c currencyfrom id get payment getc currency id return m c currencyfrom id getc_currencyfrom_id m_c_currencyfrom_id getc_invoice_id m_c_currencyfrom_id getinvoice getc_currency_id getc_payment_id m_c_currencyfrom_id getpayment getc_currency_id m_c_currencyfrom_id get currency to from parent return returns the currency to public int getc currencyto id if m c currencyto id 0 m c currencyto id get parent getc currency id return m c currencyto id getc_currencyto_id m_c_currencyto_id m_c_currencyto_id getparent getc_currency_id m_c_currencyto_id before save param new record new return true protected boolean before save boolean new record set amt if getc invoice id 0 getc payment id 0 set amt env zero set open amt env zero converted amt if env zero compare to get open amt 0 set converted amt env zero else if env zero compare to get converted amt 0 set converted amt m conversion rate convert get ctx get open amt getc currencyfrom id getc currencyto id getad client id getad org id total set total amt get converted amt add get fee amt add get interest amt return true newrecord beforesave newrecord getc_invoice_id getc_payment_id setamt setopenamt compareto getopenamt setconvertedamt compareto getconvertedamt setconvertedamt mconversionrate getctx getopenamt getc_currencyfrom_id getc_currencyto_id getad_client_id getad_org_id settotalamt getconvertedamt getfeeamt getinterestamt after save param new record new param success success return success protected boolean after save boolean new record boolean success update entry return success newrecord aftersave newrecord updateentry after delete param success success return success protected boolean after delete boolean success update entry return success afterdelete updateentry update entry calculate update amt qty private void update entry string sql update c dunningrunentry e set amt qty select sum amt count from c dunningrunline l where e c dunningrunentry id l c dunningrunentry id where c dunningrunentry id getc dunningrunentry id db execute update sql get trxname updateentry c_dunningrunentry c_dunningrunline c_dunningrunentry_id c_dunningrunentry_id c_dunningrunentry_id getc_dunningrunentry_id executeupdate get_trxname get cached row set required due to java sun bug 393865 return cached row set throws sql exception public static c cached row set get throws sql exception c cached row set crs null only first time call if s loc null s loc locale get default locale set default locale us crs new c cached row set locale set default s loc else crs new c cached row set return crs sqlexception ccachedrowset sqlexception ccachedrowset s_loc s_loc getdefault setdefault ccachedrowset setdefault s_loc ccachedrowset get row set read only scroll insensitive need to set parameters and call execute commection param sql sql return row set throws sql exception public static row set get row set string sql throws sql exception cached row set crs get crs set concurrency result set concur read only crs set type result set type scroll insensitive crs set command sql set parameters crs execute conn return crs sqlexception rowset getrowset sqlexception cachedrowset setconcurrency resultset concur_read_only settype resultset type_scroll_insensitive setcommand get and execute row set no parameters read only scroll insensitive param sql sql param conn connection return row set throws sql exception public static row set get row set string sql connection conn throws sql exception if db is oracle statement stmt conn create statement result set type scroll insensitive result set concur read only result set rs stmt execute query sql oracle cached row set crs new oracle cached row set crs populate rs stmt close return crs cached row set crs get crs set concurrency result set concur read only crs set type result set type scroll insensitive crs set command sql crs execute conn return crs sqlexception rowset getrowset sqlexception isoracle createstatement resultset type_scroll_insensitive resultset concur_read_only resultset executequery oraclecachedrowset oraclecachedrowset cachedrowset setconcurrency resultset concur_read_only settype resultset type_scroll_insensitive setcommand get cached row set required due to java sun bug 393865 also oracle number returns scale 127 return cached row set throws sql exception public static row set get row set result set rs throws sql exception if db is oracle oracle cached row set crs new oracle cached row set crs populate rs return crs cached row set crs get crs populate rs return crs sqlexception rowset getrowset resultset sqlexception isoracle oraclecachedrowset oraclecachedrowset cachedrowset compiere cached row set throws java sql sql exception private c cached row set throws sql exception super set sync provider com sun rowset providers ri optimistic provider rowset sqlexception ccachedrowset sqlexception setsyncprovider rioptimisticprovider compiere cached row set param arg0 hashtable throws java sql sql exception private c cached row set hashtable arg0 throws sql exception super arg0 set sync provider com sun rowset providers ri optimistic provider rowset sqlexception ccachedrowset sqlexception setsyncprovider rioptimisticprovider test param args ignored public static void main string args try locale set default locale canada get system out println ok 1 get system out println ok 1a new cached row set impl system out println ok 2 catch exception e e print stack trace setdefault cachedrowsetimpl printstacktrace to collection return a code collection code object that contains the values in each row in this code cached row set code object throws sql exception public collection to collection throws sql exception return super to collection cachedrowset sqlexception tocollection sqlexception tocollection to collection param column an code int code indicating the column whose values are to be represented in a code collection code object return a code collection code object that contains the values stored in the specified column of this code cached row set code object throws sql exception public collection to collection int column throws sql exception return super to collection column cachedrowset sqlexception tocollection sqlexception tocollection to collection param column a code string code object giving the name of the column whose values are to be represented in a collection return a code collection code object that contains the values stored in the specified column of this code cached row set code object throws sql exception if an error occurs generating the collection or an invalid column id is provided public collection to collection string column throws sql exception return super to collection column cachedrowset sqlexception tocollection sqlexception tocollection standard constructor param ctx context param m inoutlineconfirm id id param trx name transaction public m in out line confirm properties ctx int m inoutlineconfirm id string trx name super ctx m inoutlineconfirm id trx name if m inoutlineconfirm id 0 setm inoutconfirm id 0 setm inoutline id 0 set target qty env zero set confirmed qty env zero set difference qty env zero set scrapped qty env zero set processed false m_inoutlineconfirm_id trxname minoutlineconfirm m_inoutlineconfirm_id trxname m_inoutlineconfirm_id trxname m_inoutlineconfirm_id setm_inoutconfirm_id setm_inoutline_id settargetqty setconfirmedqty setdifferenceqty setscrappedqty setprocessed load construvtor param ctx context param rs result set public m in out line confirm properties ctx result set rs string trx name super ctx rs trx name minoutlineconfirm resultset trxname trxname parent construvtor param header parent public m in out line confirm m in out confirm header this header get ctx 0 header get trxname set client org header setm inoutconfirm id header getm inoutconfirm id minoutlineconfirm minoutconfirm getctx get_trxname setclientorg setm_inoutconfirm_id getm_inoutconfirm_id set shipment line param line shipment line public void set in out line m in out line line setm inoutline id line getm inoutline id set target qty line get movement qty confirmations in storage uom set confirmed qty get target qty suggestion m line line setinoutline minoutline setm_inoutline_id getm_inoutline_id settargetqty getmovementqty setconfirmedqty gettargetqty m_line get shipment line return line public m in out line get line if m line null m line new m in out line get ctx getm inoutline id get trxname return m line minoutline getline m_line m_line minoutline getctx getm_inoutline_id get_trxname m_line process confirmation line update in out line return success public boolean process line boolean isso trx string confirm type m in out line line get line customer if m in out confirm confirmtype customerconfirmation equals confirm type line set confirmed qty get confirmed qty drop ship else if m in out confirm confirmtype dropshipconfirm equals confirm type pick or qa else if m in out confirm confirmtype pickqaconfirm equals confirm type line set target qty get target qty line set movement qty get confirmed qty entered not changed line set picked qty get confirmed qty line set scrapped qty get scrapped qty ship or receipt else if m in out confirm confirmtype shipreceiptconfirm equals confirm type line set target qty get target qty big decimal qty get confirmed qty if isso trx in po we have the responsibility for scapped qty qty add get scrapped qty line set movement qty qty entered not changed line set scrapped qty get scrapped qty vendor else if m in out confirm confirmtype vendorconfirmation equals confirm type line set confirmed qty get confirmed qty return line save get trxname inout processline issotrx confirmtype minoutline getline minoutconfirm confirmtype_customerconfirmation confirmtype setconfirmedqty getconfirmedqty minoutconfirm confirmtype_dropshipconfirm confirmtype minoutconfirm confirmtype_pickqaconfirm confirmtype settargetqty gettargetqty setmovementqty getconfirmedqty setpickedqty getconfirmedqty setscrappedqty getscrappedqty minoutconfirm confirmtype_shipreceiptconfirm confirmtype settargetqty gettargetqty bigdecimal getconfirmedqty issotrx getscrappedqty setmovementqty setscrappedqty getscrappedqty minoutconfirm confirmtype_vendorconfirmation confirmtype setconfirmedqty getconfirmedqty get_trxname is fully confirmed return true if target confirmed qty public boolean is fully confirmed return get target qty compare to get confirmed qty 0 isfullyconfirmed gettargetqty compareto getconfirmedqty before delete do not delete return false protected boolean before delete log save error error msg get msg get ctx cannot delete return false beforedelete saveerror getmsg getctx cannotdelete before save param new record new return true protected boolean before save boolean new record calculate difference target confirmed scrapped big decimal difference get target qty difference difference subtract get confirmed qty difference difference subtract get scrapped qty set difference qty difference return true newrecord beforesave newrecord bigdecimal gettargetqty getconfirmedqty getscrappedqty setdifferenceqty standard constructor public x m operationresource properties ctx int m operationresource id string trx name super ctx m operationresource id trx name if m operationresource id 0 setm operationresource id 0 setm productoperation id 0 set name null set setup time env zero set teardown time env zero set unit runtime env zero x_m_operationresource m_operationresource_id trxname m_operationresource_id trxname m_operationresource_id setm_operationresource_id setm_productoperation_id setname setsetuptime setteardowntime setunitruntime load constructor public x m operationresource properties ctx result set rs string trx name super ctx rs trx name x_m_operationresource resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m operationresource append get id append return sb to string tostring stringbuffer stringbuffer x_m_operationresource get_id tostring set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set value a asset id null else set value a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_value a_asset_id set_value a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set position job position public void setc job id int c job id if c job id 0 set value c job id null else set value c job id new integer c job id setc_job_id c_job_id c_job_id set_value c_job_id set_value c_job_id c_job_id get position job position public int getc job id integer ii integer get value c job id if ii null return 0 return ii int value getc_job_id get_value c_job_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set operation resource product operation resource public void setm operationresource id int m operationresource id if m operationresource id 1 throw new illegal argument exception m operationresource id is mandatory set valuenocheck m operationresource id new integer m operationresource id setm_operationresource_id m_operationresource_id m_operationresource_id illegalargumentexception m_operationresource_id set_valuenocheck m_operationresource_id m_operationresource_id get operation resource product operation resource public int getm operationresource id integer ii integer get value m operationresource id if ii null return 0 return ii int value getm_operationresource_id get_value m_operationresource_id intvalue set product operation product manufacturing operation public void setm productoperation id int m productoperation id if m productoperation id 1 throw new illegal argument exception m productoperation id is mandatory set valuenocheck m productoperation id new integer m productoperation id setm_productoperation_id m_productoperation_id m_productoperation_id illegalargumentexception m_productoperation_id set_valuenocheck m_productoperation_id m_productoperation_id get product operation product manufacturing operation public int getm productoperation id integer ii integer get value m productoperation id if ii null return 0 return ii int value getm_productoperation_id get_value m_productoperation_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set setup time setup time before starting production public void set setup time big decimal setup time if setup time null throw new illegal argument exception setup time is mandatory set value setup time setup time setsetuptime bigdecimal setuptime setuptime illegalargumentexception setuptime set_value setuptime setuptime get setup time setup time before starting production public big decimal get setup time big decimal bd big decimal get value setup time if bd null return env zero return bd bigdecimal getsetuptime bigdecimal bigdecimal get_value setuptime set teardown time time at the end of the operation public void set teardown time big decimal teardown time if teardown time null throw new illegal argument exception teardown time is mandatory set value teardown time teardown time setteardowntime bigdecimal teardowntime teardowntime illegalargumentexception teardowntime set_value teardowntime teardowntime get teardown time time at the end of the operation public big decimal get teardown time big decimal bd big decimal get value teardown time if bd null return env zero return bd bigdecimal getteardowntime bigdecimal bigdecimal get_value teardowntime set runtime per unit time to produce one unit public void set unit runtime big decimal unit runtime if unit runtime null throw new illegal argument exception unit runtime is mandatory set value unit runtime unit runtime setunitruntime bigdecimal unitruntime unitruntime illegalargumentexception unitruntime set_value unitruntime unitruntime get runtime per unit time to produce one unit public big decimal get unit runtime big decimal bd big decimal get value unit runtime if bd null return env zero return bd bigdecimal getunitruntime bigdecimal bigdecimal get_value unitruntime get distribution for combination param acct account valid combination param posting type only posting type param c doctype id only document type return array of distributions public static m distribution get m account acct string posting type int c doctype id return get acct get ctx acct getc acctschema id posting type c doctype id acct getad org id acct getaccount id acct getm product id acct getc bpartner id acct getc project id acct getc campaign id acct getc activity id acct getad orgtrx id acct getc salesregion id acct getc locto id acct getc locfrom id acct getuser1 id acct getuser2 id validcombination postingtype c_doctype_id mdistribution maccount postingtype c_doctype_id getctx getc_acctschema_id postingtype c_doctype_id getad_org_id getaccount_id getm_product_id getc_bpartner_id getc_project_id getc_campaign_id getc_activity_id getad_orgtrx_id getc_salesregion_id getc_locto_id getc_locfrom_id getuser1_id getuser2_id get distributions for combination param ctx context param c acctschema id schema param ad org id org param account id account param m product id product param c bpartner id partner param c project id project param c campaign id campaign param c activity id activity param ad orgtrx id trx org param c salesregion id param c locto id location to param c locfrom id location from param user1 id user 1 param user2 id user 2 return array of distributions or null public static m distribution get properties ctx int c acctschema id string posting type int c doctype id int ad org id int account id int m product id int c bpartner id int c project id int c campaign id int c activity id int ad orgtrx id int c salesregion id int c locto id int c locfrom id int user1 id int user2 id m distribution acct list get ctx account id if acct list null acct list length 0 return null array list m distribution list new array list m distribution for int i 0 i acct list length i m distribution distribution acct list i if distribution is active distribution is valid continue mandatory acct schema if distribution getc acctschema id c acctschema id continue only posting type doc type if distribution get posting type null distribution get posting type equals posting type continue if distribution getc doctype id 0 distribution getc doctype id c doctype id continue optional elements non any if distribution is any org distribution getad org id ad org id continue if distribution is any acct distribution getaccount id account id continue if distribution is any product distribution getm product id m product id continue if distribution is anyb partner distribution getc bpartner id c bpartner id continue if distribution is any project distribution getc project id c project id continue if distribution is any campaign distribution getc campaign id c campaign id continue if distribution is any activity distribution getc activity id c activity id continue if distribution is any org trx distribution getad orgtrx id ad orgtrx id continue if distribution is any sales region distribution getc salesregion id c salesregion id continue if distribution is any loc to distribution getc locto id c locto id continue if distribution is any loc from distribution getc locfrom id c locfrom id continue if distribution is any user1 distribution getuser1 id user1 id continue if distribution is any user2 distribution getuser2 id user2 id continue list add distribution for all distributions with acct m distribution ret value new m distribution list size list to array ret value return ret value c_acctschema_id ad_org_id account_id m_product_id c_bpartner_id c_project_id c_campaign_id c_activity_id ad_orgtrx_id c_salesregion_id c_locto_id c_locfrom_id user1_id user2_id mdistribution c_acctschema_id postingtype c_doctype_id ad_org_id account_id m_product_id c_bpartner_id c_project_id c_campaign_id c_activity_id ad_orgtrx_id c_salesregion_id c_locto_id c_locfrom_id user1_id user2_id mdistribution acctlist account_id acctlist acctlist arraylist mdistribution arraylist mdistribution acctlist mdistribution acctlist isactive isvalid getc_acctschema_id c_acctschema_id doctype getpostingtype getpostingtype postingtype getc_doctype_id getc_doctype_id c_doctype_id isanyorg getad_org_id ad_org_id isanyacct getaccount_id account_id isanyproduct getm_product_id m_product_id isanybpartner getc_bpartner_id c_bpartner_id isanyproject getc_project_id c_project_id isanycampaign getc_campaign_id c_campaign_id isanyactivity getc_activity_id c_activity_id isanyorgtrx getad_orgtrx_id ad_orgtrx_id isanysalesregion getc_salesregion_id c_salesregion_id isanylocto getc_locto_id c_locto_id isanylocfrom getc_locfrom_id c_locfrom_id isanyuser1 getuser1_id user1_id isanyuser2 getuser2_id user2_id mdistribution retvalue mdistribution toarray retvalue retvalue get distributions for account param ctx context param account id id return array of distributions public static m distribution get properties ctx int account id integer key new integer account id m distribution ret value m distribution s accounts get key if ret value null return ret value string sql select from gl distribution where account id array list m distribution list new array list m distribution prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 account id result set rs pstmt execute query while rs next list add new m distribution ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null ret value new m distribution list size list to array ret value s accounts put key ret value return ret value account_id mdistribution account_id account_id mdistribution retvalue mdistribution s_accounts retvalue retvalue gl_distribution account_id arraylist mdistribution arraylist mdistribution preparedstatement preparestatement setint account_id resultset executequery mdistribution s_log retvalue mdistribution toarray retvalue s_accounts retvalue retvalue standard constructor param ctx context param gl distribution id id public m distribution properties ctx int gl distribution id string trx name super ctx gl distribution id trx name if gl distribution id 0 setc acctschema id 0 set name null set any acct true y set any activity true y set anyb partner true y set any campaign true y set any loc from true y set any loc to true y set any org true y set any org trx true y set any product true y set any project true y set any sales region true y set any user1 true y set any user2 true y set is valid false n set percent total env zero gl_distribution_id mdistribution gl_distribution_id trxname gl_distribution_id trxname gl_distribution_id setc_acctschema_id setname setanyacct setanyactivity setanybpartner setanycampaign setanylocfrom setanylocto setanyorg setanyorgtrx setanyproduct setanyproject setanysalesregion setanyuser1 setanyuser2 setisvalid setpercenttotal load constructor param ctx context param rs result set public m distribution properties ctx result set rs string trx name super ctx rs trx name mdistribution resultset trxname trxname get lines and calculate total param reload reload data return array of lines public m distribution line get lines boolean reload if m lines null reload return m lines big decimal percent total env zero array list m distribution line list new array list m distribution line string sql select from gl distributionline where gl distribution id order by line boolean has null remainder false prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getgl distribution id result set rs pstmt execute query while rs next m distribution line dl new m distribution line get ctx rs get trxname if dl is active percent total percent total add dl get percent has null remainder env zero compare to dl get percent 0 dl set parent this list add dl rs close pstmt close pstmt null catch exception e log log level severe get lines e try if pstmt null pstmt close pstmt null catch exception e pstmt null update ratio when saved and difference if has null remainder percent total env onehundred if get id 0 percent total compare to get percent total 0 set percent total percent total save return m lines new m distribution line list size list to array m lines return m lines mdistributionline getlines m_lines m_lines bigdecimal percenttotal arraylist mdistributionline arraylist mdistributionline gl_distributionline gl_distribution_id hasnullremainder preparedstatement preparestatement get_trxname setint getgl_distribution_id resultset executequery mdistributionline mdistributionline getctx get_trxname isactive percenttotal percenttotal getpercent hasnullremainder compareto getpercent setparent getlines hasnullremainder percenttotal get_id percenttotal compareto getpercenttotal setpercenttotal percenttotal m_lines mdistributionline toarray m_lines m_lines validate distribution return error message or null public string validate string ret value null get lines true if m lines length 0 ret value no lines else if get percent total compare to env onehundred 0 ret value percent total 100 else more then one line with 0 int line found 1 for int i 0 i m lines length i if m lines i get percent compare to env zero 0 if line found 0 m lines i get percent compare to env zero 0 ret value line line found m lines i get line 0 break line found m lines i get line for all lines set is valid ret value null return ret value retvalue getlines m_lines retvalue nolines getpercenttotal compareto retvalue percenttotal linefound m_lines m_lines getpercent compareto linefound m_lines getpercent compareto retvalue linefound m_lines getline linefound m_lines getline setisvalid retvalue retvalue distribute amount to lines param amt amount public void distribute m account acct big decimal amt int c currency id log info distribute amt amt acct get lines false int precision m currency get std precision get ctx c currency id first round big decimal total env zero int index biggest 1 int index zero percent 1 for int i 0 i m lines length i m distribution line dl m lines i if dl is active continue dl set account acct calculate amount dl calculate amt amt precision total total add dl get amt log fine distribute line dl get line dl get percent dl get amt total total remainder if dl get percent compare to env zero 0 index zero percent i if index zero percent 1 if index biggest 1 index biggest i else if dl get amt compare to m lines index biggest get amt 0 index biggest i adjust remainder big decimal difference amt subtract total if difference compare to env zero 0 if index zero percent 1 log fine distribute difference difference 0 line m lines index zero percent m lines index zero percent set amt difference else if index biggest 1 log fine distribute difference difference max line m lines index biggest m lines index biggest get amt m lines index biggest set amt m lines index biggest get amt add difference else log warning distribute remaining difference difference if c log mgt is level finest for int i 0 i m lines length i if m lines i is active log fine distribute amt m lines i get amt m lines i get account maccount bigdecimal c_currency_id getlines mcurrency getstdprecision getctx c_currency_id bigdecimal indexbiggest indexzeropercent m_lines mdistributionline m_lines isactive setaccount calculateamt getamt getline getpercent getamt getpercent compareto indexzeropercent indexzeropercent indexbiggest indexbiggest getamt compareto m_lines indexbiggest getamt indexbiggest bigdecimal compareto indexzeropercent m_lines indexzeropercent m_lines indexzeropercent setamt indexbiggest maxline m_lines indexbiggest m_lines indexbiggest getamt m_lines indexbiggest setamt m_lines indexbiggest getamt clogmgt islevelfinest m_lines m_lines isactive m_lines getamt m_lines getaccount before save param new record new return true protected boolean before save boolean new record reset not selected any if is any acct getaccount id 0 setaccount id 0 if is any activity getc activity id 0 setc activity id 0 if is anyb partner getc bpartner id 0 setc bpartner id 0 if is any campaign getc campaign id 0 setc campaign id 0 if is any loc from getc locfrom id 0 setc locfrom id 0 if is any loc to getc locto id 0 setc locto id 0 if is any org getorg id 0 setorg id 0 if is any org trx getad orgtrx id 0 setad orgtrx id 0 if is any product getm product id 0 setm product id 0 if is any project getc project id 0 setc project id 0 if is any sales region getc salesregion id 0 setc salesregion id 0 if is any user1 getuser1 id 0 setuser1 id 0 if is any user2 getuser2 id 0 setuser2 id 0 return true newrecord beforesave newrecord isanyacct getaccount_id setaccount_id isanyactivity getc_activity_id setc_activity_id isanybpartner getc_bpartner_id setc_bpartner_id isanycampaign getc_campaign_id setc_campaign_id isanylocfrom getc_locfrom_id setc_locfrom_id isanylocto getc_locto_id setc_locto_id isanyorg getorg_id setorg_id isanyorgtrx getad_orgtrx_id setad_orgtrx_id isanyproduct getm_product_id setm_product_id isanyproject getc_project_id setc_project_id isanysalesregion getc_salesregion_id setc_salesregion_id isanyuser1 getuser1_id setuser1_id isanyuser2 getuser2_id setuser2_id parameter element pre parameter from value to value pre param query query param ctx context param t format table format public parameter element m query query properties ctx m print table format t format super query get restriction count 4 set data 0 0 msg get msg ctx parameter t format getpageheader font t format getpageheaderfg color for int r 0 r query get restriction count r set data r 1 query get info name r t format getparameter font t format getparameter color set data r 2 query get info operator r t format getparameter font t format getparameter color set data r 3 query get info display all r t format getparameter font t format getparameter color fromvalue tovalue tformat parameterelement mquery mprinttableformat tformat getrestrictioncount setdata getmsg tformat getpageheader_font tformat getpageheaderfg_color getrestrictioncount setdata getinfoname tformat getparameter_font tformat getparameter_color setdata getinfooperator tformat getparameter_font tformat getparameter_color setdata getinfodisplayall tformat getparameter_font tformat getparameter_color standard constructor public x i gljournal properties ctx int i gljournal id string trx name super ctx i gljournal id trx name if i gljournal id 0 seti gljournal id 0 seti isimported false x_i_gljournal i_gljournal_id trxname i_gljournal_id trxname i_gljournal_id seti_gljournal_id seti_isimported load constructor public x i gljournal properties ctx result set rs string trx name super ctx rs trx name x_i_gljournal resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i gljournal append get id append return sb to string tostring stringbuffer stringbuffer x_i_gljournal get_id tostring public static final int ad orgdoc id ad reference id 130 set document org document organization independent from account organization public void setad orgdoc id int ad orgdoc id if ad orgdoc id 0 set value ad orgdoc id null else set value ad orgdoc id new integer ad orgdoc id ad_orgdoc_id_ad_reference_id setad_orgdoc_id ad_orgdoc_id ad_orgdoc_id set_value ad_orgdoc_id set_value ad_orgdoc_id ad_orgdoc_id get document org document organization independent from account organization public int getad orgdoc id integer ii integer get value ad orgdoc id if ii null return 0 return ii int value getad_orgdoc_id get_value ad_orgdoc_id intvalue public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set account key key of account element public void set account value string account value if account value null account value length 40 log warning length 40 truncated account value account value substring 0 39 set value account value account value setaccountvalue accountvalue accountvalue accountvalue accountvalue accountvalue set_value accountvalue accountvalue get account key key of account element public string get account value return string get value account value getaccountvalue get_value accountvalue public static final int account id ad reference id 132 set account account used public void setaccount id int account id if account id 0 set value account id null else set value account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id set_value account_id set_value account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set account schema name name of the accounting schema public void set acct schema name string acct schema name if acct schema name null acct schema name length 60 log warning length 60 truncated acct schema name acct schema name substring 0 59 set value acct schema name acct schema name setacctschemaname acctschemaname acctschemaname acctschemaname acctschemaname acctschemaname set_value acctschemaname acctschemaname get account schema name name of the accounting schema public string get acct schema name return string get value acct schema name getacctschemaname get_value acctschemaname set accounted credit accounted credit amount public void set amt acct cr big decimal amt acct cr set value amt acct cr amt acct cr setamtacctcr bigdecimal amtacctcr set_value amtacctcr amtacctcr get accounted credit accounted credit amount public big decimal get amt acct cr big decimal bd big decimal get value amt acct cr if bd null return env zero return bd bigdecimal getamtacctcr bigdecimal bigdecimal get_value amtacctcr set accounted debit accounted debit amount public void set amt acct dr big decimal amt acct dr set value amt acct dr amt acct dr setamtacctdr bigdecimal amtacctdr set_value amtacctdr amtacctdr get accounted debit accounted debit amount public big decimal get amt acct dr big decimal bd big decimal get value amt acct dr if bd null return env zero return bd bigdecimal getamtacctdr bigdecimal bigdecimal get_value amtacctdr set source credit source credit amount public void set amt source cr big decimal amt source cr set value amt source cr amt source cr setamtsourcecr bigdecimal amtsourcecr set_value amtsourcecr amtsourcecr get source credit source credit amount public big decimal get amt source cr big decimal bd big decimal get value amt source cr if bd null return env zero return bd bigdecimal getamtsourcecr bigdecimal bigdecimal get_value amtsourcecr set source debit source debit amount public void set amt source dr big decimal amt source dr set value amt source dr amt source dr setamtsourcedr bigdecimal amtsourcedr set_value amtsourcedr amtsourcedr get source debit source debit amount public big decimal get amt source dr big decimal bd big decimal get value amt source dr if bd null return env zero return bd bigdecimal getamtsourcedr bigdecimal bigdecimal get_value amtsourcedr set business partner key key of the business partner public void setb partner value string b partner value if b partner value null b partner value length 40 log warning length 40 truncated b partner value b partner value substring 0 39 set value b partner value b partner value setbpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue set_value bpartnervalue bpartnervalue get business partner key key of the business partner public string getb partner value return string get value b partner value getbpartnervalue get_value bpartnervalue set batch description description of the batch public void set batch description string batch description if batch description null batch description length 255 log warning length 255 truncated batch description batch description substring 0 254 set value batch description batch description setbatchdescription batchdescription batchdescription batchdescription batchdescription batchdescription set_value batchdescription batchdescription get batch description description of the batch public string get batch description return string get value batch description getbatchdescription get_value batchdescription set batch document no document number of the batch public void set batch document no string batch document no if batch document no null batch document no length 30 log warning length 30 truncated batch document no batch document no substring 0 29 set value batch document no batch document no setbatchdocumentno batchdocumentno batchdocumentno batchdocumentno batchdocumentno batchdocumentno set_value batchdocumentno batchdocumentno get batch document no document number of the batch public string get batch document no return string get value batch document no getbatchdocumentno get_value batchdocumentno set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 0 set value c acctschema id null else set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id set_value c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue public static final int c locfrom id ad reference id 133 set location from location that inventory was moved from public void setc locfrom id int c locfrom id if c locfrom id 0 set value c locfrom id null else set value c locfrom id new integer c locfrom id c_locfrom_id_ad_reference_id setc_locfrom_id c_locfrom_id c_locfrom_id set_value c_locfrom_id set_value c_locfrom_id c_locfrom_id get location from location that inventory was moved from public int getc locfrom id integer ii integer get value c locfrom id if ii null return 0 return ii int value getc_locfrom_id get_value c_locfrom_id intvalue public static final int c locto id ad reference id 133 set location to location that inventory was moved to public void setc locto id int c locto id if c locto id 0 set value c locto id null else set value c locto id new integer c locto id c_locto_id_ad_reference_id setc_locto_id c_locto_id c_locto_id set_value c_locto_id set_value c_locto_id c_locto_id get location to location that inventory was moved to public int getc locto id integer ii integer get value c locto id if ii null return 0 return ii int value getc_locto_id get_value c_locto_id intvalue set period period of the calendar public void setc period id int c period id if c period id 0 set value c period id null else set value c period id new integer c period id setc_period_id c_period_id c_period_id set_value c_period_id set_value c_period_id c_period_id get period period of the calendar public int getc period id integer ii integer get value c period id if ii null return 0 return ii int value getc_period_id get_value c_period_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set sales region sales coverage region public void setc salesregion id int c salesregion id if c salesregion id 0 set value c salesregion id null else set value c salesregion id new integer c salesregion id setc_salesregion_id c_salesregion_id c_salesregion_id set_value c_salesregion_id set_value c_salesregion_id c_salesregion_id get sales region sales coverage region public int getc salesregion id integer ii integer get value c salesregion id if ii null return 0 return ii int value getc_salesregion_id get_value c_salesregion_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set combination valid account combination public void setc validcombination id int c validcombination id if c validcombination id 0 set value c validcombination id null else set value c validcombination id new integer c validcombination id setc_validcombination_id c_validcombination_id c_validcombination_id set_value c_validcombination_id set_value c_validcombination_id c_validcombination_id get combination valid account combination public int getc validcombination id integer ii integer get value c validcombination id if ii null return 0 return ii int value getc_validcombination_id get_value c_validcombination_id intvalue set category name name of the category public void set category name string category name if category name null category name length 60 log warning length 60 truncated category name category name substring 0 59 set value category name category name setcategoryname categoryname categoryname categoryname categoryname categoryname set_value categoryname categoryname get category name name of the category public string get category name return string get value category name getcategoryname get_value categoryname set client key key of the client public void set client value string client value if client value null client value length 40 log warning length 40 truncated client value client value substring 0 39 set value client value client value setclientvalue clientvalue clientvalue clientvalue clientvalue clientvalue set_value clientvalue clientvalue get client key key of the client public string get client value return string get value client value getclientvalue get_value clientvalue set currency type key key value for the currency conversion rate type public void set conversion type value string conversion type value if conversion type value null conversion type value length 40 log warning length 40 truncated conversion type value conversion type value substring 0 39 set value conversion type value conversion type value setconversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue conversiontypevalue set_value conversiontypevalue conversiontypevalue get currency type key key value for the currency conversion rate type public string get conversion type value return string get value conversion type value getconversiontypevalue get_value conversiontypevalue set rate currency conversion rate public void set currency rate big decimal currency rate set value currency rate currency rate setcurrencyrate bigdecimal currencyrate set_value currencyrate currencyrate get rate currency conversion rate public big decimal get currency rate big decimal bd big decimal get value currency rate if bd null return env zero return bd bigdecimal getcurrencyrate bigdecimal bigdecimal get_value currencyrate set account date accounting date public void set date acct timestamp date acct set value date acct date acct setdateacct dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document type name name of the document type public void set doc type name string doc type name if doc type name null doc type name length 60 log warning length 60 truncated doc type name doc type name substring 0 59 set value doc type name doc type name setdoctypename doctypename doctypename doctypename doctypename doctypename set_value doctypename doctypename get document type name name of the document type public string get doc type name return string get value doc type name getdoctypename get_value doctypename set budget general ledger budget public void setgl budget id int gl budget id if gl budget id 0 set value gl budget id null else set value gl budget id new integer gl budget id setgl_budget_id gl_budget_id gl_budget_id set_value gl_budget_id set_value gl_budget_id gl_budget_id get budget general ledger budget public int getgl budget id integer ii integer get value gl budget id if ii null return 0 return ii int value getgl_budget_id get_value gl_budget_id intvalue set gl category general ledger category public void setgl category id int gl category id if gl category id 0 set value gl category id null else set value gl category id new integer gl category id setgl_category_id gl_category_id gl_category_id set_value gl_category_id set_value gl_category_id gl_category_id get gl category general ledger category public int getgl category id integer ii integer get value gl category id if ii null return 0 return ii int value getgl_category_id get_value gl_category_id intvalue set journal batch general ledger journal batch public void setgl journalbatch id int gl journalbatch id if gl journalbatch id 0 set value gl journalbatch id null else set value gl journalbatch id new integer gl journalbatch id setgl_journalbatch_id gl_journalbatch_id gl_journalbatch_id set_value gl_journalbatch_id set_value gl_journalbatch_id gl_journalbatch_id get journal batch general ledger journal batch public int getgl journalbatch id integer ii integer get value gl journalbatch id if ii null return 0 return ii int value getgl_journalbatch_id get_value gl_journalbatch_id intvalue set journal line general ledger journal line public void setgl journalline id int gl journalline id if gl journalline id 0 set value gl journalline id null else set value gl journalline id new integer gl journalline id setgl_journalline_id gl_journalline_id gl_journalline_id set_value gl_journalline_id set_value gl_journalline_id gl_journalline_id get journal line general ledger journal line public int getgl journalline id integer ii integer get value gl journalline id if ii null return 0 return ii int value getgl_journalline_id get_value gl_journalline_id intvalue set journal general ledger journal public void setgl journal id int gl journal id if gl journal id 0 set value gl journal id null else set value gl journal id new integer gl journal id setgl_journal_id gl_journal_id gl_journal_id set_value gl_journal_id set_value gl_journal_id gl_journal_id get journal general ledger journal public int getgl journal id integer ii integer get value gl journal id if ii null return 0 return ii int value getgl_journal_id get_value gl_journal_id intvalue set iso currency code three letter iso 4217 code of the currency public void setiso code string iso code if iso code null iso code length 3 log warning length 3 truncated iso code iso code substring 0 2 set value iso code iso code setiso_code iso_code iso_code iso_code iso_code iso_code set_value iso_code iso_code get iso currency code three letter iso 4217 code of the currency public string getiso code return string get value iso code getiso_code get_value iso_code set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set import gl journal import general ledger journal public void seti gljournal id int i gljournal id if i gljournal id 1 throw new illegal argument exception i gljournal id is mandatory set valuenocheck i gljournal id new integer i gljournal id seti_gljournal_id i_gljournal_id i_gljournal_id illegalargumentexception i_gljournal_id set_valuenocheck i_gljournal_id i_gljournal_id get import gl journal import general ledger journal public int geti gljournal id integer ii integer get value i gljournal id if ii null return 0 return ii int value geti_gljournal_id get_value i_gljournal_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of geti gljournal id intvalue keynamepair getkeynamepair keynamepair get_id valueof geti_gljournal_id set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set create new batch if selected a new batch is created public void set is create new batch boolean is create new batch set value is create new batch new boolean is create new batch setiscreatenewbatch iscreatenewbatch set_value iscreatenewbatch iscreatenewbatch get create new batch if selected a new batch is created public boolean is create new batch object oo get value is create new batch if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatenewbatch get_value iscreatenewbatch booleanvalue set create new journal if selected a new journal within the batch is created public void set is create new journal boolean is create new journal set value is create new journal new boolean is create new journal setiscreatenewjournal iscreatenewjournal set_value iscreatenewjournal iscreatenewjournal get create new journal if selected a new journal within the batch is created public boolean is create new journal object oo get value is create new journal if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscreatenewjournal get_value iscreatenewjournal booleanvalue set journal document no document number of the journal public void set journal document no string journal document no if journal document no null journal document no length 30 log warning length 30 truncated journal document no journal document no substring 0 29 set value journal document no journal document no setjournaldocumentno journaldocumentno journaldocumentno journaldocumentno journaldocumentno journaldocumentno set_value journaldocumentno journaldocumentno get journal document no document number of the journal public string get journal document no return string get value journal document no getjournaldocumentno get_value journaldocumentno set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set trx org key key of the transaction organization public void set org trx value string org trx value if org trx value null org trx value length 40 log warning length 40 truncated org trx value org trx value substring 0 39 set value org trx value org trx value setorgtrxvalue orgtrxvalue orgtrxvalue orgtrxvalue orgtrxvalue orgtrxvalue set_value orgtrxvalue orgtrxvalue get trx org key key of the transaction organization public string get org trx value return string get value org trx value getorgtrxvalue get_value orgtrxvalue set org key key of the organization public void set org value string org value if org value null org value length 40 log warning length 40 truncated org value org value substring 0 39 set value org value org value setorgvalue orgvalue orgvalue orgvalue orgvalue orgvalue set_value orgvalue orgvalue get org key key of the organization public string get org value return string get value org value getorgvalue get_value orgvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type null posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type null posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set product key key of the product public void set product value string product value if product value null product value length 40 log warning length 40 truncated product value product value substring 0 39 set value product value product value setproductvalue productvalue productvalue productvalue productvalue productvalue set_value productvalue productvalue get product key key of the product public string get product value return string get value product value getproductvalue get_value productvalue set project key key of the project public void set project value string project value if project value null project value length 40 log warning length 40 truncated project value project value substring 0 39 set value project value project value setprojectvalue projectvalue projectvalue projectvalue projectvalue projectvalue set_value projectvalue projectvalue get project key key of the project public string get project value return string get value project value getprojectvalue get_value projectvalue set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set value sku sku set_value get sku stock keeping unit public string getsku return string get value sku get_value set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue standard constructor public x ad wf node para properties ctx int ad wf node para id string trx name super ctx ad wf node para id trx name if ad wf node para id 0 setad wf node id 0 setad wf node para id 0 set entity type null u x_ad_wf_node_para ad_wf_node_para_id trxname ad_wf_node_para_id trxname ad_wf_node_para_id setad_wf_node_id setad_wf_node_para_id setentitytype load constructor public x ad wf node para properties ctx result set rs string trx name super ctx rs trx name x_ad_wf_node_para resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad wf node para append get id append return sb to string tostring stringbuffer stringbuffer x_ad_wf_node_para get_id tostring set process parameter public void setad process para id int ad process para id if ad process para id 0 set value ad process para id null else set value ad process para id new integer ad process para id setad_process_para_id ad_process_para_id ad_process_para_id set_value ad_process_para_id set_value ad_process_para_id ad_process_para_id get process parameter public int getad process para id integer ii integer get value ad process para id if ii null return 0 return ii int value getad_process_para_id get_value ad_process_para_id intvalue set node workflow node activity step or process public void setad wf node id int ad wf node id if ad wf node id 1 throw new illegal argument exception ad wf node id is mandatory set valuenocheck ad wf node id new integer ad wf node id setad_wf_node_id ad_wf_node_id ad_wf_node_id illegalargumentexception ad_wf_node_id set_valuenocheck ad_wf_node_id ad_wf_node_id get node workflow node activity step or process public int getad wf node id integer ii integer get value ad wf node id if ii null return 0 return ii int value getad_wf_node_id get_value ad_wf_node_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad wf node id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_wf_node_id set workflow node parameter workflow node execution parameter public void setad wf node para id int ad wf node para id if ad wf node para id 1 throw new illegal argument exception ad wf node para id is mandatory set valuenocheck ad wf node para id new integer ad wf node para id setad_wf_node_para_id ad_wf_node_para_id ad_wf_node_para_id illegalargumentexception ad_wf_node_para_id set_valuenocheck ad_wf_node_para_id ad_wf_node_para_id get workflow node parameter workflow node execution parameter public int getad wf node para id integer ii integer get value ad wf node para id if ii null return 0 return ii int value getad_wf_node_para_id get_value ad_wf_node_para_id intvalue set attribute name name of the attribute public void set attribute name string attribute name if attribute name null attribute name length 60 log warning length 60 truncated attribute name attribute name substring 0 59 set value attribute name attribute name setattributename attributename attributename attributename attributename attributename set_value attributename attributename get attribute name name of the attribute public string get attribute name return string get value attribute name getattributename get_value attributename set attribute value value of the attribute public void set attribute value string attribute value if attribute value null attribute value length 60 log warning length 60 truncated attribute value attribute value substring 0 59 set value attribute value attribute value setattributevalue attributevalue attributevalue attributevalue attributevalue attributevalue set_value attributevalue attributevalue get attribute value value of the attribute public string get attribute value return string get value attribute value getattributevalue get_value attributevalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype standard constructor public x pa colorschema properties ctx int pa colorschema id string trx name super ctx pa colorschema id trx name if pa colorschema id 0 setad printcolor1 id 0 setad printcolor2 id 0 set mark1 percent 0 set mark2 percent 0 set name null setpa colorschema id 0 x_pa_colorschema pa_colorschema_id trxname pa_colorschema_id trxname pa_colorschema_id setad_printcolor1_id setad_printcolor2_id setmark1percent setmark2percent setname setpa_colorschema_id load constructor public x pa colorschema properties ctx result set rs string trx name super ctx rs trx name x_pa_colorschema resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa colorschema append get id append return sb to string tostring stringbuffer stringbuffer x_pa_colorschema get_id tostring public static final int ad printcolor1 id ad reference id 266 set color 1 first color used public void setad printcolor1 id int ad printcolor1 id if ad printcolor1 id 1 throw new illegal argument exception ad printcolor1 id is mandatory set value ad printcolor1 id new integer ad printcolor1 id ad_printcolor1_id_ad_reference_id setad_printcolor1_id ad_printcolor1_id ad_printcolor1_id illegalargumentexception ad_printcolor1_id set_value ad_printcolor1_id ad_printcolor1_id get color 1 first color used public int getad printcolor1 id integer ii integer get value ad printcolor1 id if ii null return 0 return ii int value getad_printcolor1_id get_value ad_printcolor1_id intvalue public static final int ad printcolor2 id ad reference id 266 set color 2 second color used public void setad printcolor2 id int ad printcolor2 id if ad printcolor2 id 1 throw new illegal argument exception ad printcolor2 id is mandatory set value ad printcolor2 id new integer ad printcolor2 id ad_printcolor2_id_ad_reference_id setad_printcolor2_id ad_printcolor2_id ad_printcolor2_id illegalargumentexception ad_printcolor2_id set_value ad_printcolor2_id ad_printcolor2_id get color 2 second color used public int getad printcolor2 id integer ii integer get value ad printcolor2 id if ii null return 0 return ii int value getad_printcolor2_id get_value ad_printcolor2_id intvalue public static final int ad printcolor3 id ad reference id 266 set color 3 third color used public void setad printcolor3 id int ad printcolor3 id if ad printcolor3 id 0 set value ad printcolor3 id null else set value ad printcolor3 id new integer ad printcolor3 id ad_printcolor3_id_ad_reference_id setad_printcolor3_id ad_printcolor3_id ad_printcolor3_id set_value ad_printcolor3_id set_value ad_printcolor3_id ad_printcolor3_id get color 3 third color used public int getad printcolor3 id integer ii integer get value ad printcolor3 id if ii null return 0 return ii int value getad_printcolor3_id get_value ad_printcolor3_id intvalue public static final int ad printcolor4 id ad reference id 266 set color 4 forth color used public void setad printcolor4 id int ad printcolor4 id if ad printcolor4 id 0 set value ad printcolor4 id null else set value ad printcolor4 id new integer ad printcolor4 id ad_printcolor4_id_ad_reference_id setad_printcolor4_id ad_printcolor4_id ad_printcolor4_id set_value ad_printcolor4_id set_value ad_printcolor4_id ad_printcolor4_id get color 4 forth color used public int getad printcolor4 id integer ii integer get value ad printcolor4 id if ii null return 0 return ii int value getad_printcolor4_id get_value ad_printcolor4_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set mark 1 percent percentage up to this color is used public void set mark1 percent int mark1 percent set value mark1 percent new integer mark1 percent setmark1percent mark1percent set_value mark1percent mark1percent get mark 1 percent percentage up to this color is used public int get mark1 percent integer ii integer get value mark1 percent if ii null return 0 return ii int value getmark1percent get_value mark1percent intvalue set mark 2 percent percentage up to this color is used public void set mark2 percent int mark2 percent set value mark2 percent new integer mark2 percent setmark2percent mark2percent set_value mark2percent mark2percent get mark 2 percent percentage up to this color is used public int get mark2 percent integer ii integer get value mark2 percent if ii null return 0 return ii int value getmark2percent get_value mark2percent intvalue set mark 3 percent percentage up to this color is used public void set mark3 percent int mark3 percent set value mark3 percent new integer mark3 percent setmark3percent mark3percent set_value mark3percent mark3percent get mark 3 percent percentage up to this color is used public int get mark3 percent integer ii integer get value mark3 percent if ii null return 0 return ii int value getmark3percent get_value mark3percent intvalue set mark 4 percent percentage up to this color is used public void set mark4 percent int mark4 percent set value mark4 percent new integer mark4 percent setmark4percent mark4percent set_value mark4percent mark4percent get mark 4 percent percentage up to this color is used public int get mark4 percent integer ii integer get value mark4 percent if ii null return 0 return ii int value getmark4percent get_value mark4percent intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set color schema performance color schema public void setpa colorschema id int pa colorschema id if pa colorschema id 1 throw new illegal argument exception pa colorschema id is mandatory set valuenocheck pa colorschema id new integer pa colorschema id setpa_colorschema_id pa_colorschema_id pa_colorschema_id illegalargumentexception pa_colorschema_id set_valuenocheck pa_colorschema_id pa_colorschema_id get color schema performance color schema public int getpa colorschema id integer ii integer get value pa colorschema id if ii null return 0 return ii int value getpa_colorschema_id get_value pa_colorschema_id intvalue get web window status w window status ws w window status get ctx param request request return ctx or null public static w window status get http servlet request request http session session request get session false if session null return null return w window status session get attribute name wwindowstatus wwindowstatus wwindowstatus httpservletrequest httpsession getsession wwindowstatus getattribute constructor first tab first row single row br initialize formats param m windowvo window vo public w window status m windowvo m windowvo m window new m window m windowvo cur tab m window get tab 0 cur tab set single row true ctx m windowvo ctx mwindowvo wwindowstatus mwindowvo mwindowvo mwindow mwindow mwindowvo curtab mwindow gettab curtab setsinglerow mwindowvo string representation return string representation public string to string return w window status m window cur tab tostring wwindowstatus mwindow curtab get console handler param create create if not exists return console hander or null public static c log console get boolean create if s console null create s console new c log console return s console clogconsole s_console s_console clogconsole s_console constructor public c log console if s console null s console this else report error console handler exists already new illegal state exception existing handler error manager generic failure initialize clogconsole s_console s_console reporterror illegalstateexception errormanager generic_failure initialize private void initialize system out println c log console initialize set writers string encoding get encoding if encoding null try m writerout new print writer new output stream writer system out encoding m writererr new print writer new output stream writer system err encoding catch unsupported encoding exception ex report error opening encoded writers ex error manager open failure if m writerout null m writerout new print writer system out if m writererr null m writererr new print writer system err foratting set formatter c log formatter get default level set level level info filter set filter c log filter get clogconsole getencoding m_writerout printwriter outputstreamwriter m_writererr printwriter outputstreamwriter unsupportedencodingexception reporterror errormanager open_failure m_writerout m_writerout printwriter m_writererr m_writererr printwriter setformatter clogformatter setlevel setfilter clogfilter set encoding param encoding encoding throws security exception throws java io unsupported encoding exception public void set encoding string encoding throws security exception java io unsupported encoding exception super set encoding encoding replace the current writer with a writer for the new encoding flush initialize securityexception unsupportedencodingexception setencoding securityexception unsupportedencodingexception setencoding set level see java util logging handler set level java util logging level param new level new level throws java lang security exception public synchronized void set level level new level throws security exception if new level null return super set level new level boolean enablejdbc new level level finest if enablejdbc driver manager set log writer m writerout lists statements else driver manager set log writer null setlevel newlevel securityexception setlevel newlevel securityexception newlevel setlevel newlevel newlevel drivermanager setlogwriter m_writerout drivermanager setlogwriter publish see java util logging handler publish java util logging log record param record log record public void publish log record record if is loggable record m writerout null return format string msg null try msg get formatter format record catch exception ex report error formatting ex error manager format failure return output try if m doneheader m writerout write get formatter get head this m doneheader true if record get level level severe record get level level warning flush m writererr write msg flush else m writerout write msg m writerout flush catch exception ex report error writing ex error manager write failure logrecord logrecord isloggable m_writerout getformatter reporterror errormanager format_failure m_doneheader m_writerout getformatter gethead m_doneheader getlevel getlevel m_writererr m_writerout m_writerout reporterror errormanager write_failure flush see java util logging handler flush public void flush try if m writerout null m writerout flush catch exception ex report error flush out ex error manager flush failure try if m writererr null m writererr flush catch exception ex report error flush err ex error manager flush failure m_writerout m_writerout reporterror errormanager flush_failure m_writererr m_writererr reporterror errormanager flush_failure close see java util logging handler close throws security exception public void close throws security exception if m writerout null return write tail try if m doneheader m writerout write get formatter get head this m writerout write get formatter get tail this catch exception ex report error tail ex error manager write failure flush close try m writerout close catch exception ex report error close out ex error manager close failure m writerout null try m writererr close catch exception ex report error close err ex error manager close failure m writererr null securityexception securityexception m_writerout m_doneheader m_writerout getformatter gethead m_writerout getformatter gettail reporterror errormanager write_failure m_writerout reporterror errormanager close_failure m_writerout m_writererr reporterror errormanager close_failure m_writererr string representation return info public string to string string buffer sb new string buffer c log console sb append level append get level append return sb to string tostring stringbuffer stringbuffer clogconsole getlevel tostring standard constructor public x ad alertprocessor properties ctx int ad alertprocessor id string trx name super ctx ad alertprocessor id trx name if ad alertprocessor id 0 setad alertprocessor id 0 set frequency 0 set frequency type null set keep log days 0 7 set name null setsupervisor id 0 x_ad_alertprocessor ad_alertprocessor_id trxname ad_alertprocessor_id trxname ad_alertprocessor_id setad_alertprocessor_id setfrequency setfrequencytype setkeeplogdays setname setsupervisor_id load constructor public x ad alertprocessor properties ctx result set rs string trx name super ctx rs trx name x_ad_alertprocessor resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad alertprocessor append get id append return sb to string tostring stringbuffer stringbuffer x_ad_alertprocessor get_id tostring set alert processor alert processor server parameter public void setad alertprocessor id int ad alertprocessor id if ad alertprocessor id 1 throw new illegal argument exception ad alertprocessor id is mandatory set valuenocheck ad alertprocessor id new integer ad alertprocessor id setad_alertprocessor_id ad_alertprocessor_id ad_alertprocessor_id illegalargumentexception ad_alertprocessor_id set_valuenocheck ad_alertprocessor_id ad_alertprocessor_id get alert processor alert processor server parameter public int getad alertprocessor id integer ii integer get value ad alertprocessor id if ii null return 0 return ii int value getad_alertprocessor_id get_value ad_alertprocessor_id intvalue set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run set value date next run date next run setdatenextrun datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final int supervisor id ad reference id 316 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 1 throw new illegal argument exception supervisor id is mandatory set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id illegalargumentexception supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue get contents return contents public object get contents return contents getcontents basic constructor use the set methods public ul basic constructor use the set methods param list an array of li elements public ul li list add element list addelement basic constructor use the set methods param list an array of string elements to be converted to li public ul string list add element list addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute add a list to the ul param list a list of li objects public ul add element li list for int x 0 x list length x add element list x return this addelement addelement adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ul add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public ul add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public ul add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public ul add element string element add element to registry element return this addelement addelementtoregistry add a list to the ul param list a list of strings to be converted to li objects public ul add element string element li li new li add element element add element li return this addelement addelement addelement removes an element from the element param hashcode the name of the element to be removed public ul remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute set document value workflow manager param docwf mgr mgr public static void set doc workflow mgr doc workflow mgr docwf mgr s docwfmgr docwf mgr s log config s docwfmgr to string docwfmgr setdocworkflowmgr docworkflowmgr docwfmgr s_docwfmgr docwfmgr s_log s_docwfmgr tostring create new persisent object param ctx context public po properties ctx this ctx 0 null null create load existing persistent object param id the unique id of the object param ctx context param trx name transaction name public po properties ctx int id string trx name this ctx id trx name null trxname trxname trxname create load existing persistent object param ctx context param rs optional load from current result set position no navigation not closed if null a new record is created param trx name transaction name public po properties ctx result set rs string trx name this ctx 0 trx name rs trxname resultset trxname trxname create load existing persistent object pre you load an existing single key record with new po ctx record id or new po ctx record id trx name or new po ctx rs get trxname a new single key record with new po ctx 0 an existing multi key record with new po ctx rs get trxname a new multi key record with new po ctx null the id for new single key records is created automatically you need to set the i ds for multi key records explicitly pre param ctx context param id the id if 0 the record defaults are applied ignored if re exists param trx name transaction name param rs optional load from current result set position no navigation not closed public po properties ctx int id string trx name result set rs if ctx null throw new illegal argument exception no context p ctx ctx p info initpo ctx if p info null p info get table name null throw new illegal argument exception invalid po info p info int size p info get column count m oldvalues new object size m newvalues new object size m trxname trx name if rs null load rs will not have virtual columns else load id trx name record_id record_id trxname get_trxname get_trxname ids trxname trxname resultset illegalargumentexception p_ctx p_info p_info p_info gettablename illegalargumentexception p_info p_info getcolumncount m_oldvalues m_newvalues m_trxname trxname trxname create new po by copying existing key not copied param ctx context param source souce object param ad client id client param ad org id org public po properties ctx po source int ad client id int ad org id this ctx 0 null null create new if source null copy values source this setad client id ad client id setad org id ad org id ad_client_id ad_org_id ad_client_id ad_org_id copyvalues setad_client_id ad_client_id setad_org_id ad_org_id initialize and return po info param ctx context return po info po_info poinfo get table access level return access level string representation return string representation public string to string string buffer sb new string buffer po append get whereclause true append return sb to string tostring stringbuffer stringbuffer get_whereclause tostring equals based on id param cmp comperator return true if id the same public boolean equals object cmp if cmp null return false if cmp instanceof po return false if cmp get class equals this get class return po cmp get id get id return super equals cmp getclass getclass get_id get_id compare based on document no value name description param o1 object 1 param o2 object 2 return 1 if o1 o2 public int compare object o1 object o2 if o1 null return 1 else if o2 null return 1 if o1 instanceof po throw new class cast exception not po 1 o1 if o2 instanceof po throw new class cast exception not po 2 o2 same class if o1 get class equals o2 get class int index get columnindex document no if index 1 index get columnindex value if index 1 index get columnindex name if index 1 index get columnindex description if index 1 po po1 po o1 object comp1 po1 get value index po po2 po o2 object comp2 po2 get value index if comp1 null return 1 else if comp2 null return 1 return comp1 to string compare to comp2 to string return o1 to string compare to o2 to string documentno classcastexception classcastexception getclass getclass get_columnindex documentno get_columnindex get_columnindex get_columnindex get_value get_value tostring compareto tostring tostring compareto tostring get table name return table name public string get tablename return p info get table name tablename get_tablename p_info gettablename get key columns return table name public string get keycolumns return m keycolumns get_keycolumns m_keycolumns get table id return table id public int get table id return p info getad table id get_table_id p_info getad_table_id return single key record id return id or 0 public int get id object oo m ids 0 if oo null oo instanceof integer return integer oo int value return 0 get_id m_ids intvalue return deleted single key record id return id or 0 public int get idold return m idold get_idold m_idold get context return context public properties get ctx return p ctx getctx p_ctx get logger return logger public c logger get logger return log clogger get_logger get value param index index return value public final object get value int index if index 0 index get columncount log log level severe index invalid index return null if m newvalues index null if m newvalues index equals null null return null return m newvalues index return m oldvalues index get_value get_columncount m_newvalues m_newvalues m_newvalues m_oldvalues get value as int param index index return int value or 0 protected int get valueasint int index object value get value index if value null return 0 if value instanceof integer return integer value int value try return integer parse int value to string catch number format exception ex log warning p info get column name index ex get message return 0 get_valueasint get_value intvalue parseint tostring numberformatexception p_info getcolumnname getmessage get value param column name column name return value or null public final object get value string column name int index get columnindex column name if index 0 log log level severe column not found column name trace print stack return null return get value index columnname get_value columnname get_columnindex columnname columnname printstack get_value get encrypted value param column name column name return value or null protected final object get valuee string column name return get value column name columnname get_valuee columnname get_value columnname get column value param variable name name return value or public string get valueasstring string variable name object value get value variable name if value null return return value to string variablename get_valueasstring variablename get_value variablename tostring get value of column param ad column id column return value or null public final object get valueofcolumn int ad column id int index p info get column index ad column id if index 0 log log level severe not found ad column id ad column id return null return get value index ad_column_id get_valueofcolumn ad_column_id p_info getcolumnindex ad_column_id ad_column_id ad_column_id get_value get old value param index index return value public final object get valueold int index if index 0 index get columncount log log level severe index invalid index return null return m oldvalues index get_valueold get_columncount m_oldvalues get old value param column name column name return value or null public final object get valueold string column name int index get columnindex column name if index 0 log log level severe column not found column name return null return get valueold index columnname get_valueold columnname get_columnindex columnname columnname get_valueold get old value as int param column name column name return int value or 0 protected int get valueoldasint string column name object value get valueold column name if value null return 0 if value instanceof integer return integer value int value try return integer parse int value to string catch number format exception ex log warning column name ex get message return 0 columnname get_valueoldasint columnname get_valueold columnname intvalue parseint tostring numberformatexception columnname getmessage is value changed param index index return true if changed public final boolean is valuechanged int index if index 0 index get columncount log log level severe index invalid index return false if m newvalues index null return false return m newvalues index equals m oldvalues index is_valuechanged get_columncount m_newvalues m_newvalues m_oldvalues is value changed param column name column name return true if changed public final boolean is valuechanged string column name int index get columnindex column name if index 0 log log level severe column not found column name return false return is valuechanged index columnname is_valuechanged columnname get_columnindex columnname columnname is_valuechanged return new old new value if old valus is null new value old value if number otherwise null param index index return new old or null if not appropiate or not changed public final object get valuedifference int index if index 0 index get columncount log log level severe index invalid index return null object n value m newvalues index no new value or null if n value null n value null null return null object o value m oldvalues index if o value null o value null null return n value if n value instanceof big decimal big decimal obd big decimal o value return big decimal n value subtract obd else if n value instanceof integer int result integer n value int value result integer o value int value return new integer result log warning invalid type new n value return null get_valuedifference get_columncount nvalue m_newvalues nvalue nvalue ovalue m_oldvalues ovalue ovalue nvalue nvalue bigdecimal bigdecimal bigdecimal ovalue bigdecimal nvalue nvalue nvalue intvalue ovalue intvalue nvalue return new old new value if old valus is null new value old value if number otherwise null param column name column name return new old or null if not appropiate or not changed public final object get valuedifference string column name int index get columnindex column name if index 0 log log level severe column not found column name return null return get valuedifference index columnname get_valuedifference columnname get_columnindex columnname columnname get_valuedifference set value param column name column name param value value return true if value set protected final boolean set value string column name object value int index get columnindex column name if index 0 log log level severe column not found column name return false return set value index value columnname set_value columnname get_columnindex columnname columnname set_value set encrypted value param column name column name param value value return true if value set protected final boolean set valuee string column name object value return set value column name value columnname set_valuee columnname set_value columnname set value if updateable and correct class and to null if not mandatory param index index param value value return true if value set protected final boolean set value int index object value if index 0 index get columncount log log level severe index invalid index return false string column name p info get column name index string col info column name if p info is virtual column index log log level severe virtual column col info return false if p info is column updateable index col info new value value old value get value index log log level severe column not updateable col info return false if value null if p info is column mandatory index log log level severe cannot set mandatory column to null col info trace print stack return false m newvalues index null null correct log finer column name null else matching class or generic object if value get class equals p info get column class index p info get column class index object class m newvalues index value correct integer can be set as big decimal else if value get class big decimal class p info get column class index integer class m newvalues index new integer big decimal value int value set boolean else if p info get column class index boolean class y equals value n equals value m newvalues index new boolean y equals value else log log level severe column name class invalid value get class to string should be p info get column class index to string value return false validate min max string error p info validate index value if error null log log level severe column name value error return false length for string if p info get column class index string class string string value value to string int length p info get field length index if string value length length length 0 log warning column name value too long truncated to length length m newvalues index string value substring 0 length 1 log finest column name m newvalues index set keys column name m newvalues index return true set_value get_columncount columnname p_info getcolumnname colinfo columnname p_info isvirtualcolumn colinfo p_info iscolumnupdateable colinfo newvalue oldvalue get_value colinfo p_info iscolumnmandatory colinfo printstack m_newvalues columnname getclass p_info getcolumnclass p_info getcolumnclass m_newvalues bigdecimal getclass bigdecimal p_info getcolumnclass m_newvalues bigdecimal intvalue p_info getcolumnclass m_newvalues columnname getclass tostring p_info getcolumnclass tostring p_info columnname p_info getcolumnclass stringvalue tostring p_info getfieldlength stringvalue columnname m_newvalues stringvalue columnname m_newvalues set_keys columnname m_newvalues set value w o check update r o used when column is r o required for key and parent values param column name column name param value value return true if value set protected final boolean set valuenocheck string column name object value int index get columnindex column name if index 0 log log level severe column not found column name return false if value null m newvalues index null null write direct else matching class or generic object if value get class equals p info get column class index p info get column class index object class m newvalues index value correct integer can be set as big decimal else if value get class big decimal class p info get column class index integer class m newvalues index new integer big decimal value int value set boolean else if p info get column class index boolean class y equals value n equals value m newvalues index new boolean y equals value else log warning column name class invalid value get class to string should be p info get column class index to string value m newvalues index value correct validate min max string error p info validate index value if error null log warning column name value error length for string if p info get column class index string class string string value value to string int length p info get field length index if string value length length length 0 log warning column name value too long truncated to length length m newvalues index string value substring 0 length 1 log finest column name m newvalues index m newvalues index null m newvalues index get class get name set keys column name m newvalues index return true columnname set_valuenocheck columnname get_columnindex columnname columnname m_newvalues getclass p_info getcolumnclass p_info getcolumnclass m_newvalues bigdecimal getclass bigdecimal p_info getcolumnclass m_newvalues bigdecimal intvalue p_info getcolumnclass m_newvalues columnname getclass tostring p_info getcolumnclass tostring m_newvalues p_info columnname p_info getcolumnclass stringvalue tostring p_info getfieldlength stringvalue columnname m_newvalues stringvalue columnname m_newvalues m_newvalues m_newvalues getclass getname set_keys columnname m_newvalues set encrypted value w o check update r o used when column is r o required for key and parent values param column name column name param value value return true if value set protected final boolean set valuenochecke string column name object value return set valuenochecke column name value columnname set_valuenochecke columnname set_valuenochecke columnname set value of column param ad column id column param value value public final void set valueofcolumn int ad column id object value int index p info get column index ad column id if index 0 log log level severe not found ad column id ad column id set value index value ad_column_id set_valueofcolumn ad_column_id p_info getcolumnindex ad_column_id ad_column_id ad_column_id set_value set custom column param column name column param value value public final void set customcolumn string column name object value if m custom null m custom new hash map string string string value string null if value null else if value instanceof number value string value to string else if value instanceof boolean value string boolean value boolean value y n else if value instanceof timestamp value string db to date timestamp value false else if value instanceof string value string db to string value to string save it log log level info column name value string m custom put column name value string columnname set_customcolumn columnname m_custom m_custom hashmap valuestring valuestring tostring valuestring booleanvalue valuestring to_date valuestring to_string tostring columnname valuestring m_custom columnname valuestring set numeric key value param column name column name param value value private void set keys string column name object value update if key column for int i 0 i m ids length i if column name equals m keycolumns i m ids i value for all key columns columnname set_keys columnname keycolumn m_ids columnname m_keycolumns m_ids get column count return column count protected int get columncount return p info get column count get_columncount p_info getcolumncount get column name param index index return column name protected string get columnname int index return p info get column name index columnname get_columnname p_info getcolumnname get column label param index index return column label protected string get columnlabel int index return p info get column label index get_columnlabel p_info getcolumnlabel get column description param index index return column description protected string get columndescription int index return p info get column description index get_columndescription p_info getcolumndescription is column mandatory param index index return true if column mandatory protected boolean is column mandatory int index return p info is column mandatory index iscolumnmandatory p_info iscolumnmandatory is column updateable param index index return true if column updateable protected boolean is column updateable int index return p info is column updateable index iscolumnupdateable p_info iscolumnupdateable set column updateable param index index param updateable column updateable protected void set columnupdateable int index boolean updateable p info set column updateable index updateable set_columnupdateable p_info setcolumnupdateable set all columns updateable param updateable updateable protected void set updateable boolean updateable p info set updateable updateable setupdateable p_info setupdateable get column display type param index index protected int get columndisplaytype int index return p info get column display type index displaytype get_columndisplaytype p_info getcolumndisplaytype get lookup param index index return lookup or null protected lookup get columnlookup int index return p info get column lookup index get_columnlookup p_info getcolumnlookup get column index param column name column name return index of column with column name or 1 if not found public final int get columnindex string column name return p info get column index column name columnname columnname get_columnindex columnname p_info getcolumnindex columnname get display value of value param column name column name param current value current value return string value with as null protected string get displayvalue string column name boolean current value object value current value get value column name get valueold column name if value null return string ret value value to string int index get columnindex column name if index 0 return ret value int dt get columndisplaytype index if display type is text dt display type yes no dt return ret value lookup lookup lookup get columnlookup index if lookup null return lookup get display value other return ret value columnname columnname currentvalue get_displayvalue columnname currentvalue currentvalue get_value columnname get_valueold columnname retvalue tostring get_columnindex columnname retvalue get_columndisplaytype displaytype istext displaytype yesno retvalue get_columnlookup getdisplay retvalue copy old values of from to new values of to does not copy keys param from old existing unchanged po param to new not saved po param ad client id client param ad org id org protected static void copy values po from po to int ad client id int ad org id copy values from to to setad client id ad client id to setad org id ad org id ad_client_id ad_org_id copyvalues ad_client_id ad_org_id copyvalues setad_client_id ad_client_id setad_org_id ad_org_id copy old values of from to new values of to does not copy keys and ad client id ad org id param from old existing unchanged po param to new not saved po protected static void copy values po from po to s log fine from id from get id to id to get id begin e evolution vpj cd 16 feb 2006 fix bug overload object i e org eevolution model to org compiere model system out println from get class get superclass get name from get class get superclass get name to get class get name to get class get name if from get class to get class string superclass from get class get superclass get name string childclass to get class get name system out println childclass compare to superclass childclass compare to superclass if from get class to get class if childclass compare to superclass 0 end e evolution vpj cd 16 feb 2006 throw new illegal argument exception to class to get class not from from get class for int i 0 i from m oldvalues length i if from p info is virtual column i from p info is key i key column continue string col name from p info get column name i ignore standard values if col name starts with created col name starts with updated col name equals is active col name equals ad client id col name equals ad org id ignore else to m newvalues i from m oldvalues i ad_client_id ad_org_id copyvalues s_log get_id get_id getclass getsuperclass getname getclass getsuperclass getname getclass getname getclass getname getclass getclass getclass getsuperclass getname getclass getname compareto compareto getclass getclass compareto illegalargumentexception getclass getclass m_oldvalues p_info isvirtualcolumn p_info iskey keycolumn colname p_info getcolumnname colname startswith colname startswith colname isactive colname ad_client_id colname ad_org_id m_newvalues m_oldvalues load record with id param id id param trx name transaction name protected void load int id string trx name log finest id id if id 0 m ids new object new integer id m keycolumns new string p info get table name id load trx name else new load defaults m createnew true set key info sets m ids load complete true trxname trxname m_ids m_keycolumns p_info gettablename _id trxname loaddefaults m_createnew setkeyinfo m_ids loadcomplete re load record with m id public boolean load string trx name m trxname trx name boolean success true string buffer sql new string buffer select int size get columncount for int i 0 i size i if i 0 sql append sql append p info get columnsql i normal and virtual column sql append from append p info get table name append where append get whereclause false int index 1 if c log mgt is level finest log finest get whereclause true prepared statement pstmt null try pstmt db prepare statement sql to string m trxname local trx only for int i 0 i m ids length i object oo m ids i if oo instanceof integer pstmt set int i 1 integer m ids i int value else pstmt set string i 1 m ids i to string result set rs pstmt execute query if rs next success load rs else log log level severe no data found for get whereclause true new exception m ids new object i zero success false throw new db exception no data found for get whereclause true rs close pstmt close pstmt null m createnew false reset new values m newvalues new object size catch exception e string msg if m trxname null msg m trxname msg get whereclause true index index column get columnname index p info to string index sql sql to string success false m ids new object i zero log log level severe msg e throw new db exception e finish try if pstmt null pstmt close pstmt null catch sql exception e1 load complete success return success m_id trxname m_trxname trxname stringbuffer stringbuffer get_columncount p_info getcolumnsql p_info gettablename get_whereclause clogmgt islevelfinest get_whereclause preparedstatement preparestatement tostring m_trxname m_ids m_ids setint m_ids intvalue setstring m_ids tostring resultset executequery get_whereclause m_ids i_zero dbexception get_whereclause m_createnew m_newvalues m_trxname m_trxname get_whereclause get_columnname p_info tostring tostring m_ids i_zero dbexception sqlexception loadcomplete load from the current position of a result set param rs result set protected boolean load result set rs int size get columncount boolean success true int index 0 log finest rs load column values for index 0 index size index string column name p info get column name index class clazz p info get column class index int dt p info get column display type index try if clazz integer class m oldvalues index decrypt index new integer rs get int column name else if clazz big decimal class m oldvalues index decrypt index rs get big decimal column name else if clazz boolean class m oldvalues index new boolean y equals decrypt index rs get string column name else if clazz timestamp class m oldvalues index decrypt index rs get timestamp column name else if display type islob dt m oldvalues index get lob rs get object column name else if clazz string class m oldvalues index decrypt index rs get string column name else m oldvalues index load special rs index null if rs was null m oldvalues index null m oldvalues index null if c log mgt is level all log finest string value of index p info get column name index p info get column class index m oldvalues index catch sql exception e if p info is virtual column index if rs constructor used log log level finer virtual column not loaded column name else log log level severe rs string value of index p info get table name p info get column name index p info get column class index e success false m createnew false set key info load complete success return success resultset resultset get_columncount columnname p_info getcolumnname p_info getcolumnclass p_info getcolumndisplaytype m_oldvalues getint columnname bigdecimal m_oldvalues getbigdecimal columnname m_oldvalues getstring columnname m_oldvalues gettimestamp columnname displaytype m_oldvalues get_lob getobject columnname m_oldvalues getstring columnname m_oldvalues loadspecial wasnull m_oldvalues m_oldvalues clogmgt islevelall valueof p_info getcolumnname p_info getcolumnclass m_oldvalues sqlexception p_info isvirtualcolumn columnname valueof p_info gettablename p_info getcolumnname p_info getcolumnclass m_createnew setkeyinfo loadcomplete load from hash map param hm in protected boolean load hash map string string hm in int size get columncount boolean success true int index 0 log finest hm load column values for index 0 index size index string column name p info get column name index string value string hm in get column name if value null continue class clazz p info get column class index int dt p info get column display type index try if clazz integer class m oldvalues index new integer value else if clazz big decimal class m oldvalues index new big decimal value else if clazz boolean class m oldvalues index new boolean y equals value else if clazz timestamp class m oldvalues index timestamp value of value else if display type islob dt m oldvalues index null get lob rs get object column name else if clazz string class m oldvalues index value else m oldvalues index null load special rs index if c log mgt is level all log finest string value of index p info get column name index p info get column class index m oldvalues index catch exception e if p info is virtual column index if rs constructor used log log level finer virtual column not loaded column name else log log level severe ht string value of index p info get table name p info get column name index p info get column class index e success false m createnew false overwrite set standard defaults set key info load complete success return success hashmap hmin hashmap hmin get_columncount columnname p_info getcolumnname hmin columnname p_info getcolumnclass p_info getcolumndisplaytype m_oldvalues bigdecimal m_oldvalues bigdecimal m_oldvalues m_oldvalues valueof displaytype m_oldvalues get_lob getobject columnname m_oldvalues m_oldvalues loadspecial clogmgt islevelall valueof p_info getcolumnname p_info getcolumnclass m_oldvalues p_info isvirtualcolumn columnname valueof p_info gettablename p_info getcolumnname p_info getcolumnclass m_createnew setstandarddefaults setkeyinfo loadcomplete create hashmap with data as strings return hash map protected hash map string string get hashmap hash map string string hm out new hash map string string int size get columncount for int i 0 i size i object value get value i don t insert null values allows database defaults if value null p info is virtual column i continue display type int dt p info get column display type i based on class of definition not class of value class c p info get column class i string string value null if c object class save new special value i else if value null value equals null null else if value instanceof integer value instanceof big decimal string value value to string else if c boolean class boolean b value false if value instanceof boolean b value boolean value boolean value else b value y equals value string value b value y n else if value instanceof timestamp string value value to string else if c string class string value string value else if display type islob dt else save new special value i if string value null hm out put p info get column name i string value custom columns if m custom null iterator it m custom key set iterator while it has next string column string it next int index p info get column index column string value string m custom get column if value null hm out put column value m custom null return hm out hashmap hashmap get_hashmap hashmap hmout hashmap get_columncount get_value p_info isvirtualcolumn p_info getcolumndisplaytype p_info getcolumnclass stringvalue savenewspecial bigdecimal stringvalue tostring bvalue bvalue booleanvalue bvalue stringvalue bvalue stringvalue tostring stringvalue displaytype savenewspecial stringvalue hmout p_info getcolumnname stringvalue m_custom m_custom keyset hasnext p_info getcolumnindex m_custom hmout m_custom hmout load special data images to be extended by sub classes param rs result set param index zero based index return value value throws sql exception protected object load special result set rs int index throws sql exception log finest nop p info get column name index return null sqlexception loadspecial resultset sqlexception p_info getcolumnname load is complete param success success to be extended by sub classes protected void load complete boolean success loadcomplete load defaults protected void load defaults set standard defaults todo defaults from field m field get default p info get default logic i loaddefaults setstandarddefaults mfield getdefault p_info getdefaultlogic set default values client org created updated by is active protected void set standard defaults int size get columncount for int i 0 i size i if p info is virtual column i continue string col name p info get column name i set standard values if col name ends with ted by m newvalues i new integer env get context as int p ctx ad user id else if col name equals created col name equals updated m newvalues i new timestamp system current time millis else if col name equals p info get table name id key column m newvalues i i zero else if col name equals is active m newvalues i new boolean true else if col name equals ad client id m newvalues i new integer env getad client id p ctx else if col name equals ad org id m newvalues i new integer env getad org id p ctx else if col name equals processed m newvalues i new boolean false else if col name equals processing m newvalues i new boolean false else if col name equals posted m newvalues i new boolean false isactive setstandarddefaults get_columncount p_info isvirtualcolumn colname p_info getcolumnname colname endswith tedby m_newvalues getcontextasint p_ctx ad_user_id colname colname m_newvalues currenttimemillis colname p_info gettablename _id keycolumn m_newvalues i_zero colname isactive m_newvalues colname ad_client_id m_newvalues getad_client_id p_ctx colname ad_org_id m_newvalues getad_org_id p_ctx colname m_newvalues colname m_newvalues colname m_newvalues set key info i ds and key columns private void set key info search for primary key for int i 0 i p info get column count i if p info is key i p info get column name i ends with id string column name p info get column name i m keycolumns new string column name integer ii integer get value i if ii null m ids new object i zero else m ids new object ii log finest pk column name ii return primary key search search for parents array list string column names new array list string for int i 0 i p info get column count i if p info is column parent i column names add p info get column name i set f ks int size column names size if size 0 throw new illegal state exception no pk nor fk p info get table name m ids new object size m keycolumns new string size for int i 0 i size i m keycolumns i string column names get i if m keycolumns i ends with id integer ii null try ii integer get value m keycolumns i catch exception e log log level severe e if ii null m ids i ii else m ids i get value m keycolumns i log finest fk m keycolumns i m ids i ids keycolumns setkeyinfo p_info getcolumncount p_info iskey p_info getcolumnname endswith _id columnname p_info getcolumnname m_keycolumns columnname get_value m_ids i_zero m_ids columnname arraylist columnnames arraylist p_info getcolumncount p_info iscolumnparent columnnames p_info getcolumnname fks columnnames illegalstateexception p_info gettablename m_ids m_keycolumns m_keycolumns columnnames m_keycolumns endswith _id get_value m_keycolumns m_ids m_ids get_value m_keycolumns m_keycolumns m_ids are all mandatory fields filled i e can we save stops at first null mandatory field return true if all mandatory fields are ok protected boolean is mandatoryok int size get columncount for int i 0 i size i if p info is column mandatory i if p info is virtual column i continue if get value i null get value i equals null null log info p info get column name i return false return true ismandatoryok get_columncount p_info iscolumnmandatory p_info isvirtualcolumn get_value get_value p_info getcolumnname set ad client param ad client id client final protected void setad client id int ad client id set valuenocheck ad client id new integer ad client id ad_client ad_client_id setad_client_id ad_client_id set_valuenocheck ad_client_id ad_client_id get ad client return ad client id public final int getad client id integer ii integer get value ad client id if ii null return 0 return ii int value ad_client ad_client_id getad_client_id get_value ad_client_id intvalue set ad org param ad org id org final public void setad org id int ad org id set valuenocheck ad org id new integer ad org id ad_org ad_org_id setad_org_id ad_org_id set_valuenocheck ad_org_id ad_org_id get ad org return ad org id public int getad org id integer ii integer get value ad org id if ii null return 0 return ii int value ad_org ad_org_id getad_org_id get_value ad_org_id intvalue overwrite client org if different param ad client id client param ad org id org protected void set client org int ad client id int ad org id if ad client id getad client id setad client id ad client id if ad org id getad org id setad org id ad org id ad_client_id ad_org_id setclientorg ad_client_id ad_org_id ad_client_id getad_client_id setad_client_id ad_client_id ad_org_id getad_org_id setad_org_id ad_org_id overwrite client org if different param po persistent object protected void set client org po po set client org po getad client id po getad org id setclientorg setclientorg getad_client_id getad_org_id set active param active active public final void set is active boolean active set value is active new boolean active setisactive set_value isactive is active return is active public final boolean is active boolean bb boolean get value is active if bb null return bb boolean value return false isactive get_value isactive booleanvalue get created return created final public timestamp get created return timestamp get value created getcreated get_value get updated return updated final public timestamp get updated return timestamp get value updated getupdated get_value get created by return ad user id final public int get created by integer ii integer get value created by if ii null return 0 return ii int value createdby ad_user_id getcreatedby get_value createdby intvalue get updated by return ad user id final public int get updated by integer ii integer get value updated by if ii null return 0 return ii int value updatedby ad_user_id getupdatedby get_value updatedby intvalue set updated by param ad user id user final protected void set updated by int ad user id set valuenocheck updated by new integer ad user id updatedby ad_user_id setupdatedby ad_user_id set_valuenocheck updatedby ad_user_id get translation of column param column name param ad language return translation or null if not found protected string get translation string column name string ad language if column name null ad language null m ids length 1 m ids 0 equals i zero m ids 0 instanceof integer log severe invalid argument column name column name ad language ad language id length m ids length id m ids 0 return null int id integer m ids 0 int value string ret value null string buffer sql new string buffer select append column name append from append p info get table name append trl where append m keycolumns 0 append append and ad language prepared statement pstmt null try pstmt db prepare statement sql to string get trxname pstmt set int 1 id pstmt set string 2 ad language result set rs pstmt execute query if rs next ret value rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value columnname ad_language get_translation columnname ad_language columnname ad_language m_ids m_ids i_zero m_ids columnname columnname ad_language ad_language m_ids m_ids m_ids intvalue retvalue stringbuffer stringbuffer columnname p_info gettablename _trl m_keycolumns ad_language preparedstatement preparestatement tostring get_trxname setint setstring ad_language resultset executequery retvalue getstring tostring retvalue is new record return true if new public boolean is new if m createnew return true for int i 0 i m ids length i if m ids i equals i zero continue return false one value is non zero return true is_new m_createnew m_ids m_ids i_zero update value or create new record to reload call load not updated return true if saved public boolean save boolean new record is new save locally as load resets if new record is changed log fine nothing changed p info get table name return true organization check if getad org id 0 get accesslevel accesslevel org get accesslevel accesslevel clientorg m client share is org level only getad client id get table id log save error fill mandatory msg get element get ctx ad org id return false should be org 0 if getad org id 0 boolean reset get accesslevel accesslevel system if reset m client share is client level only getad client id get table id reset get accesslevel accesslevel client get accesslevel accesslevel systemclient get accesslevel accesslevel clientorg if reset log warning set org to 0 setad org id 0 before save try if before save new record log warning before save failed to string return false catch exception e log log level severe before save to string e log save error error e to string false throw new db exception e return false string error msg model validation engine get fire model change this new record model validator type new model validator type change if error msg null log warning validation failed error msg log save error error error msg return false save boolean success false if new record return save new else return save update newrecord is_new newrecord is_changed p_info gettablename getad_org_id get_accesslevel accesslevel_org get_accesslevel accesslevel_clientorg mclientshare isorglevelonly getad_client_id get_table_id saveerror fillmandatory getelement getctx ad_org_id getad_org_id get_accesslevel accesslevel_system mclientshare isclientlevelonly getad_client_id get_table_id get_accesslevel accesslevel_client get_accesslevel accesslevel_systemclient get_accesslevel accesslevel_clientorg setad_org_id beforesave newrecord beforesave tostring beforesave tostring saveerror tostring dbexception errormsg modelvalidationengine firemodelchange newrecord modelvalidator type_new modelvalidator type_change errormsg errormsg saveerror errormsg newrecord savenew saveupdate finish save process param new record new param success success return true if saved private boolean save finish boolean new record boolean success translations if success if new record insert translations else update translations try success after save new record success catch exception e log log level severe after save e log save error error e to string false success false throw new db exception e ok if success if s docwfmgr null try class for name org compiere wf doc workflow manager catch exception e if s docwfmgr null s docwfmgr process this p info getad table id copy to old values int size p info get column count for int i 0 i size i if m newvalues i null if m newvalues i null null m oldvalues i null else m oldvalues i m newvalues i m newvalues new object size m createnew false if new record cache mgt get reset p info get table name return success newrecord savefinish newrecord newrecord inserttranslations updatetranslations aftersave newrecord aftersave saveerror tostring dbexception s_docwfmgr forname docworkflowmanager s_docwfmgr s_docwfmgr p_info getad_table_id p_info getcolumncount m_newvalues m_newvalues m_oldvalues m_oldvalues m_newvalues m_newvalues m_createnew newrecord cachemgt p_info gettablename update value or create new record to reload call load not updated param trx name transaction return true if saved public boolean save string trx name set trxname trx name return save trxname trxname set_trxname trxname is there a change to be saved return true if record changed public boolean is changed int size get columncount for int i 0 i size i if m newvalues i null return true something changed return false is_changed get_columncount m_newvalues called before save for pre save operation param new record new record return true if record can be saved protected boolean before save boolean new record log save error error msg parse translation get ctx c currency id c currency id log save error fill mandatory msg get element get ctx price entered log save warning ad message message log save info ad message message return true newrecord beforesave newrecord saveerror parsetranslation getctx c_currency_id c_currency_id saveerror fillmandatory getelement getctx priceentered savewarning ad_message saveinfo ad_message called after save for post save operation param new record new record param success true if save operation was success return if save was a success protected boolean after save boolean new record boolean success return success newrecord aftersave newrecord update record directly return true if updated protected boolean save update string where get whereclause true boolean changes false string buffer sql new string buffer update sql append p info get table name append set boolean updated false boolean updated by false lob reset change log m session session m session get p ctx false if session null log fine no session found int ad changelog id 0 int size get columncount for int i 0 i size i object value m newvalues i if value null p info is virtual column i continue we have a change class c p info get column class i int dt p info get column display type i string column name p info get column name i updated by if column name equals updated by if updated by explicit continue updated by true else if column name equals updated if updated continue updated true if display type islob dt lob add value i dt if no changes set updated by explicitly to ensure commit of lob if changes updated by int ad user id env get context as int p ctx ad user id set valuenocheck updated by new integer ad user id sql append updated by append ad user id changes true updated by true continue update document no if column name equals document no string str value string value if str value starts with str value ends with value null int ad client id getad client id int index p info get column index c doctypetarget id if index 1 index p info get column index c doctype id if index 1 get based on doc type might return null value db get document no get valueasint index m trxname if value null not overwritten by doc type and not manually entered value db get document no ad client id p info get table name m trxname else log warning document no updated m oldvalues i value if changes sql append changes true sql append column name append values if value null null sql append null else if value instanceof integer value instanceof big decimal sql append encrypt i value else if c boolean class boolean b value false if value instanceof boolean b value boolean value boolean value else b value y equals value sql append encrypt i b value y n else if value instanceof timestamp sql append db to date timestamp encrypt i value p info get column display type i display type date else sql append encrypt i db to string value to string change log only if session null m ids length 1 p info is encrypted i not encrypted p info is virtual column i no virtual column password equals column name object oldv m oldvalues i object newv value if oldv null oldv null null oldv null if newv null newv null null newv null m change log c log session change log m trxname ad changelog id p info getad table id p info get column i ad column id get id getad client id getad org id oldv newv if c log null ad changelog id c log getad changelog id for all fields custom columns cannot be logged as no column if m custom null iterator it m custom key set iterator while it has next if changes sql append changes true string column string it next string value string m custom get column int index p info get column index column sql append column append append encrypt index value m custom null something changed if changes if m trxname null log fine p info get table name where else log fine m trxname p info get table name where if updated updated not explicitly set timestamp now new timestamp system current time millis set valuenocheck updated now sql append updated append db to date now false if updated by updated by not explicitly set int ad user id env get context as int p ctx ad user id set valuenocheck updated by new integer ad user id sql append updated by append ad user id sql append where append where todo status locking goes here log finest sql to string int no db execute update sql to string m trxname boolean ok no 1 if ok ok lob save else if m trxname null log log level warning p info get table name where else log log level warning m trxname p info get table name where return save finish false ok nothing changed so ok return save finish false true saveupdate get_whereclause stringbuffer stringbuffer p_info gettablename updatedby lobreset msession msession p_ctx ad_changelog_id get_columncount m_newvalues p_info isvirtualcolumn p_info getcolumnclass p_info getcolumndisplaytype columnname p_info getcolumnname columnname updatedby updatedby updatedby columnname displaytype lobadd updatedby updatedby ad_user_id getcontextasint p_ctx ad_user_id set_valuenocheck updatedby ad_user_id updatedby ad_user_id updatedby columnname documentno strvalue strvalue startswith strvalue endswith ad_client_id getad_client_id p_info getcolumnindex c_doctypetarget_id p_info getcolumnindex c_doctype_id getdocumentno get_valueasint m_trxname doctype getdocumentno ad_client_id p_info gettablename m_trxname documentno m_oldvalues columnname bigdecimal bvalue bvalue booleanvalue bvalue bvalue to_date p_info getcolumndisplaytype displaytype to_string tostring m_ids p_info isencrypted p_info isvirtualcolumn columnname m_oldvalues mchangelog clog changelog m_trxname ad_changelog_id p_info getad_table_id p_info getcolumn ad_column_id get_id getad_client_id getad_org_id clog ad_changelog_id clog getad_changelog_id m_custom m_custom keyset hasnext m_custom p_info getcolumnindex m_custom m_trxname p_info gettablename m_trxname p_info gettablename currenttimemillis set_valuenocheck to_date updatedby updatedby ad_user_id getcontextasint p_ctx ad_user_id set_valuenocheck updatedby ad_user_id updatedby ad_user_id tostring executeupdate tostring m_trxname lobsave m_trxname p_info gettablename m_trxname p_info gettablename savefinish savefinish create new record return true if new record inserted private boolean save new set id for single key multi key values need explicitly be set previously if m ids length 1 p info has key column m keycolumns 0 equals ad language int no db get nextid getad client id p info get table name m trxname if no 0 log severe no nextid no return save finish true false m ids 0 new integer no set valuenocheck m keycolumns 0 m ids 0 if m trxname null log fine p info get table name get whereclause true else log fine m trxname p info get table name get whereclause true set new document no string column name document no int index p info get column index column name if index 1 string value string get value index if value null value starts with value ends with value null if value null value length 0 int ad client id getad client id int dt p info get column index c doctypetarget id if dt 1 dt p info get column index c doctype id if dt 1 get based on doc type might return null value db get document no get valueasint dt m trxname if value null not overwritten by doc type and not manually entered value db get document no ad client id p info get table name m trxname set valuenocheck column name value set empty value column name value index p info get column index column name if index 1 string value string get value index if value null value length 0 value db get document no getad client id p info get table name m trxname set valuenocheck column name value lob reset sql string buffer sql insert new string buffer insert into sql insert append p info get table name append string buffer sql values new string buffer values int size get columncount boolean do comma false for int i 0 i size i object value get value i don t insert null values allows database defaults if value null p info is virtual column i continue display type int dt p info get column display type i if display type islob dt lob add value i dt add column if do comma sql insert append sql values append else do comma true sql insert append p info get column name i based on class of definition not class of value class c p info get column class i try if c object class may have need to deal with null values differently sql values append save new special value i else if value null value equals null null sql values append null else if value instanceof integer value instanceof big decimal sql values append encrypt i value else if c boolean class boolean b value false if value instanceof boolean b value boolean value boolean value else b value y equals value sql values append encrypt i b value y n else if value instanceof timestamp sql values append db to date timestamp encrypt i value p info get column display type i display type date else if c string class sql values append encrypt i db to string string value else if display type islob dt sql values append null no db dependent stuff here else sql values append save new special value i catch exception e string msg if m trxname null msg m trxname msg p info to string i value value value null null value get class get name log log level severe msg e throw new db exception e fini custom columns if m custom null iterator it m custom key set iterator while it has next string column string it next index p info get column index column string value string m custom get column if do comma sql insert append sql values append else do comma true sql insert append column sql values append encrypt index value m custom null sql insert append sql values append int no db execute update sql insert to string m trxname boolean ok no 1 if ok ok lob save if load m trxname re read info if m trxname null log log level severe reloading else log log level severe m trxname reloading ok false else string msg not inserted if c log mgt is level finer msg sql insert to string else msg get tablename if m trxname null log log level warning msg else log log level warning m trxname msg return save finish true ok savenew m_ids p_info haskeycolumn m_keycolumns ad_language getnextid getad_client_id p_info gettablename m_trxname savefinish m_ids set_valuenocheck m_keycolumns m_ids m_trxname p_info gettablename get_whereclause m_trxname p_info gettablename get_whereclause documentno columnname documentno p_info getcolumnindex columnname get_value startswith endswith ad_client_id getad_client_id p_info getcolumnindex c_doctypetarget_id p_info getcolumnindex c_doctype_id getdocumentno get_valueasint m_trxname doctype getdocumentno ad_client_id p_info gettablename m_trxname set_valuenocheck columnname columnname p_info getcolumnindex columnname get_value getdocumentno getad_client_id p_info gettablename m_trxname set_valuenocheck columnname lobreset stringbuffer sqlinsert stringbuffer sqlinsert p_info gettablename stringbuffer sqlvalues stringbuffer get_columncount docomma get_value p_info isvirtualcolumn p_info getcolumndisplaytype displaytype lobadd docomma sqlinsert sqlvalues docomma sqlinsert p_info getcolumnname p_info getcolumnclass sqlvalues savenewspecial sqlvalues bigdecimal sqlvalues bvalue bvalue booleanvalue bvalue sqlvalues bvalue sqlvalues to_date p_info getcolumndisplaytype displaytype sqlvalues to_string displaytype sqlvalues sqlvalues savenewspecial m_trxname m_trxname p_info tostring getclass getname dbexception m_custom m_custom keyset hasnext p_info getcolumnindex m_custom docomma sqlinsert sqlvalues docomma sqlinsert sqlvalues m_custom sqlinsert sqlvalues executeupdate sqlinsert tostring m_trxname lobsave m_trxname m_trxname m_trxname clogmgt islevelfiner sqlinsert tostring get_tablename m_trxname m_trxname savefinish create single multi key where clause param with values if true uses actual values otherwise return where clause public string get whereclause boolean with values string buffer sb new string buffer for int i 0 i m ids length i if i 0 sb append and sb append m keycolumns i append if with values if m keycolumns i ends with id sb append m ids i else sb append append m ids i append else sb append return sb to string withvalues get_whereclause withvalues stringbuffer stringbuffer m_ids m_keycolumns withvalues m_keycolumns endswith _id m_ids m_ids tostring save special data to be extended by sub classes param value value param index index return sql code for insert values clause protected string save new special object value int index string col name p info get column name index string col class p info get column class index to string string col value value null null value get class to string int dt p info get column display type index log log level severe unknown class for column col name col class value col value if value null return null return value to string savenewspecial colname p_info getcolumnname colclass p_info getcolumnclass tostring colvalue getclass tostring p_info getcolumndisplaytype colname colclass colvalue tostring encrypt data not lob special values obkects param index index param xx data return xx private object encrypt int index object xx if xx null return null if index 1 p info is encrypted index return secure engine encrypt xx return xx p_info isencrypted secureengine decrypt data param index index param yy data return yy private object decrypt int index object yy if yy null return null if index 1 p info is encrypted index return secure engine decrypt yy return yy p_info isencrypted secureengine delete current record param force delete also processed records return true if deleted public boolean delete boolean force if is new return true if force int i processed get columnindex processed if i processed 1 boolean processed boolean get value i processed if processed null processed boolean value log warning record processed log save error processed processed false return false processed force try if before delete log warning before delete failed return false catch exception e log log level severe before delete e log save error error e to string false throw new db exception e return false string error msg model validation engine get fire model change this model validator type delete if error msg null log save error error error msg return false prepare delete attachment string buffer attachment new string buffer delete from ad attachment where ad table id append p info getad table id append and record id append m ids 0 the delete statement string buffer sql new string buffer delete append p info get table name append where append get whereclause true delete translations int no db execute update sql to string m trxname save id m idold get id boolean success no 1 if success change log m session session m session get p ctx false if session null log fine no session found else if m ids length 1 m change log is logged p info getad table id int ad changelog id 0 int size get columncount for int i 0 i size i object value m oldvalues i if value null p info is encrypted i not encrypted p info is virtual column i no virtual column password equals p info get column name i m change log c log session change log m trxname ad changelog id p info getad table id p info get column i ad column id get id getad client id getad org id value null if c log null ad changelog id c log getad changelog id for all fields delete attachments db execute update attachment to string m trxname housekeeping m ids 0 i zero if m trxname null log fine complete else log fine m trxname complete else log warning not deleted m attachment null try success after delete success catch exception e log log level severe after delete e log save error error e to string false success false throw new db exception e reset m idold 0 int size p info get column count m oldvalues new object size m newvalues new object size cache mgt get reset p info get table name log info success return success is_new iprocessed get_columnindex iprocessed get_value iprocessed booleanvalue saveerror beforedelete beforedelete beforedelete saveerror tostring dbexception errormsg modelvalidationengine firemodelchange modelvalidator type_delete errormsg saveerror errormsg stringbuffer stringbuffer ad_attachment ad_table_id p_info getad_table_id record_id m_ids stringbuffer stringbuffer p_info gettablename get_whereclause deletetranslations executeupdate tostring m_trxname m_idold get_id msession msession p_ctx m_ids mchangelog islogged p_info getad_table_id ad_changelog_id get_columncount m_oldvalues p_info isencrypted p_info isvirtualcolumn p_info getcolumnname mchangelog clog changelog m_trxname ad_changelog_id p_info getad_table_id p_info getcolumn ad_column_id get_id getad_client_id getad_org_id clog ad_changelog_id clog getad_changelog_id executeupdate tostring m_trxname m_ids i_zero m_trxname m_trxname m_attachment afterdelete afterdelete saveerror tostring dbexception m_idold p_info getcolumncount m_oldvalues m_newvalues cachemgt p_info gettablename delete current record param force delete also processed records param trx name transaction public boolean delete boolean force string trx name set trxname trx name return delete force trxname trxname set_trxname trxname executed before delete operation return true if record can be deleted protected boolean before delete log save error error msg get msg get ctx cannot delete return true beforedelete saveerror getmsg getctx cannotdelete executed after delete operation param success true if record deleted return true if delete is a success protected boolean after delete boolean success return success afterdelete insert missing translation records return false if error true if no translation or success private boolean insert translations not a translation table if m ids length 1 m ids 0 equals i zero p info is translated m ids 0 instanceof integer return true string buffer i columns new string buffer string buffer s columns new string buffer for int i 0 i p info get column count i if p info is column translated i i columns append p info get column name i append s columns append t append p info get column name i append if i columns length 0 return true string table name p info get table name string key column m keycolumns 0 string buffer sql new string buffer insert into append table name append trl ad language append key column append append i columns append is translated ad client id ad org id created createdby updated updated by append select l ad language t append key column append append s columns append n t ad client id t ad org id t created t createdby t updated t updated by append from ad language l append table name append t append where l is active y and l is system language y and l is base language n and t append key column append append get id append and not exists select from append table name append trl tt where tt ad language l ad language and tt append key column append t append key column append int no db execute update sql to string m trxname log fine no return no 0 inserttranslations m_ids m_ids i_zero p_info istranslated m_ids stringbuffer icolumns stringbuffer stringbuffer scolumns stringbuffer p_info getcolumncount p_info iscolumntranslated icolumns p_info getcolumnname scolumns p_info getcolumnname icolumns tablename p_info gettablename keycolumn m_keycolumns stringbuffer stringbuffer tablename _trl ad_language keycolumn icolumns istranslated ad_client_id ad_org_id updatedby ad_language keycolumn scolumns ad_client_id ad_org_id updatedby ad_language tablename isactive issystemlanguage isbaselanguage keycolumn get_id tablename _trl ad_language ad_language keycolumn keycolumn executeupdate tostring m_trxname update translations return false if error true if no translation or success private boolean update translations not a translation table if m ids length 1 m ids 0 equals i zero p info is translated m ids 0 instanceof integer return true boolean trl column changed false for int i 0 i p info get column count i if p info is column translated i is valuechanged p info get column name i trl column changed true break if trl column changed return true m client client m client get get ctx string table name p info get table name string key column m keycolumns 0 string buffer sql new string buffer update append table name append trl set if client is auto update trl table name for int i 0 i p info get column count i if p info is column translated i string column name p info get column name i sql append column name append object value get value column name if value null sql append null else if value instanceof string sql append db to string string value else if value instanceof boolean sql append boolean value boolean value y n else if value instanceof timestamp sql append db to date timestamp value else sql append value to string sql append sql append is translated y else sql append is translated n sql append where append key column append append get id int no db execute update sql to string m trxname log fine no return no 0 updatetranslations m_ids m_ids i_zero p_info istranslated m_ids trlcolumnchanged p_info getcolumncount p_info iscolumntranslated is_valuechanged p_info getcolumnname trlcolumnchanged trlcolumnchanged mclient mclient getctx tablename p_info gettablename keycolumn m_keycolumns stringbuffer stringbuffer tablename _trl isautoupdatetrl tablename p_info getcolumncount p_info iscolumntranslated columnname p_info getcolumnname columnname get_value columnname to_string booleanvalue to_date tostring istranslated istranslated keycolumn get_id executeupdate tostring m_trxname delete translation records return false if error true if no translation or success private boolean delete translations not a translation table if m ids length 1 m ids 0 equals i zero p info is translated m ids 0 instanceof integer return true string table name p info get table name string key column m keycolumns 0 string buffer sql new string buffer delete append table name append trl where append key column append append get id int no db execute update sql to string m trxname log fine no return no 0 deletetranslations m_ids m_ids i_zero p_info istranslated m_ids tablename p_info gettablename keycolumn m_keycolumns stringbuffer stringbuffer tablename _trl keycolumn get_id executeupdate tostring m_trxname insert accounting records param acct table accounting sub table param acct base table acct table to get data from param where clause optional where clause with alisa p for acct base table return true if records inserted protected boolean insert accounting string acct table string acct base table string where clause if s acctcolumns null cannot cache c bp acct as there are 3 acct table starts with c bp s acctcolumns new array list string string sql select c column name from ad column c inner join ad table t on c ad table id t ad table id where t table name and c is active y and c ad reference id 25 order by 1 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 acct table result set rs pstmt execute query while rs next s acctcolumns add rs get string 1 rs close pstmt close pstmt null catch exception e log log level severe acct table e try if pstmt null pstmt close pstmt null catch exception e pstmt null if s acctcolumns size 0 log severe no columns for acct table return false create sql statement insert string buffer sb new string buffer insert into append acct table append append get tablename append id c acctschema id ad client id ad org id is active created created by updated updated by for int i 0 i s acctcolumns size i sb append append s acctcolumns get i select sb append select append get id append p c acctschema id p ad client id 0 y sys date append get updated by append sys date append get updated by for int i 0 i s acctcolumns size i sb append p append s acctcolumns get i from sb append from append acct base table append p where p ad client id append getad client id if where clause null where clause length 0 sb append and append where clause sb append and not exists select from append acct table append e where e c acctschema id p c acctschema id and e append get tablename append id append get id append int no db execute update sb to string get trxname if no 0 log fine no else log warning no table acct table from acct base table return no 0 accttable acctbasetable whereclause acctbasetable insert_accounting accttable acctbasetable whereclause s_acctcolumns c_bp_ _acct accttable startswith c_bp_ s_acctcolumns arraylist columnname ad_column ad_table ad_table_id ad_table_id tablename isactive ad_reference_id preparedstatement preparestatement setstring accttable resultset executequery s_acctcolumns getstring accttable s_acctcolumns accttable stringbuffer stringbuffer accttable get_tablename _id c_acctschema_id ad_client_id ad_org_id isactive createdby updatedby s_acctcolumns s_acctcolumns get_id c_acctschema_id ad_client_id sysdate getupdatedby sysdate getupdatedby s_acctcolumns s_acctcolumns acctbasetable ad_client_id getad_client_id whereclause whereclause whereclause accttable c_acctschema_id c_acctschema_id get_tablename _id get_id executeupdate tostring get_trxname accttable acctbasetable delete accounting records nop done by database constraints param acct table accounting sub table return true protected boolean delete accounting string acct table return true accttable delete_accounting accttable insert id data into tree param tree type m tree treetype return true if inserted protected boolean insert tree string tree type return insert tree tree type 0 treetype mtree treetype_ insert_tree treetype insert_tree treetype insert id data into tree param tree type m tree treetype param c element id element for accounting element values return true if inserted protected boolean insert tree string tree type int c element id string buffer sb new string buffer insert into append mtree base get node table name tree type append ad client id ad org id is active created created by updated updated by ad tree id node id parent id seq no select t ad client id 0 y sys date 0 sys date 0 t ad tree id append get id append 0 999 from ad tree t where t ad client id append getad client id append and t is active y account element value handling if c element id 0 sb append and exists select from c element ae where ae c element id append c element id append and t ad tree id ae ad tree id else std trees sb append and t is all nodes y and t tree type append tree type append duplicate check sb append and not exists select from mtree base get node table name tree type e where e ad tree id t ad tree id and node id append get id append int no db execute update sb to string get trxname if no 0 log fine no tree type tree type else log warning no tree type tree type return no 0 treetype mtree treetype_ c_element_id insert_tree treetype c_element_id stringbuffer stringbuffer mtree_base getnodetablename treetype ad_client_id ad_org_id isactive createdby updatedby ad_tree_id node_id parent_id seqno ad_client_id sysdate sysdate ad_tree_id get_id ad_tree ad_client_id getad_client_id isactive c_element_id c_element c_element_id c_element_id ad_tree_id ad_tree_id isallnodes treetype treetype mtree_base getnodetablename treetype ad_tree_id ad_tree_id node_id get_id executeupdate tostring get_trxname treetype treetype treetype treetype delete id tree nodes param tree type m tree treetype return true if deleted protected boolean delete tree string tree type string buffer sb new string buffer delete from append mtree base get node table name tree type append n where node id append get id append and exists select from ad tree t where t ad tree id n ad tree id and t tree type append tree type append int no db execute update sb to string get trxname if no 0 log fine no else log warning no tree type tree type return no 0 treetype mtree treetype_ delete_tree treetype stringbuffer stringbuffer mtree_base getnodetablename treetype node_id get_id ad_tree ad_tree_id ad_tree_id treetype treetype executeupdate tostring get_trxname treetype treetype lock it return true if locked public boolean lock int index get processingindex if index 1 m newvalues index boolean true direct string sql update p info get table name set processing y where processing n or processing is null and get whereclause true boolean success db execute update sql null 1 outside trx if success log fine success else log log level severe failed return success return false get_processingindex m_newvalues p_info gettablename get_whereclause executeupdate get the column processing index return index or 1 private int get processingindex return p info get column index processing get_processingindex p_info getcolumnindex un lock it return true if unlocked false only if unlock fails e evolution vpj cd public boolean unlock public boolean unlock string trx name int index get processingindex if index 1 m newvalues index boolean false direct string sql update p info get table name set processing n where get whereclause true e evolution vpj cd boolean success db execute update sql null 1 outside trx boolean success db execute update sql trx name 1 outside trx if success log fine success else log log level severe failed return success return true unlock trxname get_processingindex m_newvalues p_info gettablename get_whereclause executeupdate executeupdate trxname set trx param trx name transaction public void set trxname string trx name m trxname trx name trxname set_trxname trxname m_trxname trxname get trx return transaction public string get trxname return m trxname get_trxname m_trxname get attachments an attachment may have multiple entries return attachment or null public m attachment get attachment return get attachment false mattachment getattachment getattachment get attachments param requery requery return attachment or null public m attachment get attachment boolean requery if m attachment null requery m attachment m attachment get get ctx p info getad table id get id return m attachment mattachment getattachment m_attachment m_attachment mattachment getctx p_info getad_table_id get_id m_attachment create return attachment for po if not exist create new return attachment public m attachment create attachment get attachment false if m attachment null m attachment new m attachment get ctx p info getad table id get id null return m attachment mattachment createattachment getattachment m_attachment m_attachment mattachment getctx p_info getad_table_id get_id m_attachment do we have a attachment of type param extension extension e g pdf return true if there is a attachment of type public boolean is attachment string extension get attachment false if m attachment null return false for int i 0 i m attachment get entry count i if m attachment get entry name i ends with extension log fine i m attachment get entry name i return true return false isattachment getattachment m_attachment m_attachment getentrycount m_attachment getentryname endswith m_attachment getentryname get attachment data of type param extension extension e g pdf return data or null public byte get attachment data string extension get attachment false if m attachment null return null for int i 0 i m attachment get entry count i if m attachment get entry name i ends with extension log fine i m attachment get entry name i return m attachment get entry data i return null getattachmentdata getattachment m_attachment m_attachment getentrycount m_attachment getentryname endswith m_attachment getentryname m_attachment getentrydata do we have a pdf attachment return true if there is a pdf attachment public boolean is pdf attachment return is attachment pdf ispdfattachment isattachment get pdf attachment data return data or null public byte get pdf attachment return get attachment data pdf getpdfattachment getattachmentdata dump record public void dump if c log mgt is level finest log finer get whereclause true for int i 0 i get columncount i dump i clogmgt islevelfinest get_whereclause get_columncount dump column param index index public void dump int index string buffer sb new string buffer append index if index 0 index get columncount log finest sb append invalid to string return sb append append get columnname index append append m oldvalues index append append m newvalues index append log finest sb to string stringbuffer stringbuffer get_columncount tostring get_columnname m_oldvalues m_newvalues tostring get all i ds of table used for listing all entities code int i ds po get alli ds ad printfont null for int i 0 i i ds length i pf new m print font env get ctx i ds i system out println i ds i pf get font code param table name table name key column with id param where clause optional where clause return array of i ds or null public static int get alli ds string table name string where clause string trx name array list integer list new array list integer string buffer sql new string buffer select sql append table name append id from append table name if where clause null where clause length 0 sql append where append where clause try prepared statement pstmt db prepare statement sql to string trx name result set rs pstmt execute query while rs next list add new integer rs get int 1 rs close pstmt close catch sql exception e s log log level severe sql to string e return null convert to array int ret value new int list size for int i 0 i ret value length i ret value i integer list get i int value return ret value ids ids getallids ad_printfont ids mprintfont getctx ids ids getfont tablename _id whereclause ids getallids tablename whereclause trxname arraylist arraylist stringbuffer stringbuffer tablename _id tablename whereclause whereclause whereclause preparedstatement preparestatement tostring trxname resultset executequery getint sqlexception s_log tostring retvalue retvalue retvalue intvalue retvalue get find parameter convert to upper case and add at the end param query in string return out string protected static string get find parameter string query if query null return null if query length 0 query equals return null if query ends with query return query to upper case getfindparameter endswith touppercase load lob param value lob private object get lob object value log fine value value if value null return null object ret value null begin vpj cd e evolution 03 11 2005 postgresql if db is postgresql byte buf byte value ret value buf return ret value end vpj cd e evolution 03 11 2005 postgresql long length 99 try if value instanceof clob returns string clob clob clob value length clob length ret value clob get sub string 1 int length else if value instanceof blob returns byte blob blob blob value length blob length int index 1 correct if blob get class get name equals oracle jdbc rowset oracle serial blob index 0 oracle bug invalid arguments at oracle jdbc rowset oracle serial blob get bytes oracle serial blob java 130 ret value blob get bytes index int length else log log level severe unknown value catch exception e log log level severe length length e return ret value get_lob retvalue ispostgresql retvalue retvalue retvalue getsubstring getclass getname oracleserialblob oracleserialblob getbytes oracleserialblob retvalue getbytes retvalue reset lob info private void lob reset m lobinfo null lobreset m_lobinfo prepare lob save param value value param index index param display type display type private void lob add object value int index int display type log finest value value po lob lob new po lob p info get table name get columnname index get whereclause true display type value if m lobinfo null m lobinfo new array list po lob m lobinfo add lob displaytype lobadd displaytype po_lob po_lob p_info gettablename get_columnname get_whereclause displaytype m_lobinfo m_lobinfo arraylist po_lob m_lobinfo save lob return true if saved or ok private boolean lob save if m lobinfo null return true boolean ret value true for int i 0 i m lobinfo size i po lob lob po lob m lobinfo get i if lob save get trxname ret value false break for all lo bs lob reset return ret value lobsave m_lobinfo retvalue m_lobinfo po_lob po_lob m_lobinfo get_trxname retvalue lobs lobreset retvalue amtinwords es public amtinwords es super amtinwords_es amtinwords_es convert less than one thousand param number return amt private string convert less than one thousand int number string so far esta dentro de los 1os diecinueve iscap if number 100 20 so far num names number 100 number 100 else so far num names number 10 number 10 string s integer to string number if s ends with 2 so far so far veinti so far trim else if so far so far tens names number 10 so far else so far tens names number 10 y so far number 10 if number 0 return so far if number 1 so far s so far if number 1 so far number 0 return num names number ciento so far convertlessthanonethousand sofar sofar numnames sofar numnames tostring endswith sofar sofar sofar sofar sofar tensnames sofar sofar tensnames sofar sofar sofar sofar sofar numnames sofar convert param number return amt private string convert int number special case if number 0 return cero string prefix if number 0 number number prefix menos string so far int place 0 do int n number 1000 if n 0 string s convert less than one thousand n if s starts with cinco cientos 1 s s replace first cinco cientos quinientos if s starts with siete cientos 1 s s replace first siete cientos setecientos if s starts with nueve cientos 1 s s replace first nueve cientos novecientos if s uno so far major names place so far else so far s major names place so far place number 1000 while number 0 return prefix so far trim sofar convertlessthanonethousand startswith replacefirst startswith replacefirst startswith replacefirst sofar majornames sofar sofar majornames sofar sofar get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 public string get amt in words string amount throws exception if amount null return amount string buffer sb new string buffer int pos amount last index of int pos2 amount last index of if pos2 pos pos pos2 string oldamt amount amount amount replace all int newpos amount last index of int pesos integer parse int amount substring 0 newpos sb append convert pesos for int i 0 i oldamt length i if pos i we are done string cents oldamt substring i 1 sb append append cents append 100 append 100 pesos break return sb to string getamtinwords stringbuffer stringbuffer lastindexof lastindexof replaceall lastindexof parseint tostring basic constructor public doctype update element type updateelementtype constructor param name root element of the xml document param id public identifier param uri uri of the dtd public doctype string name string id string uri this name name this visibility public this identifier id this uri uri update element type updateelementtype constructor param name root element of the xml document param id public identifier param uri uri of the dtd public doctype string name string visibility string id string uri this name name this visibility visibility this identifier id this uri uri update element type updateelementtype should be called when any of the fields are changed protected void update element type set element type element name name visibility identifier uri updateelementtype setelementtype elementname updates the name of the root element param name name of the root element return a value of type doctype public doctype set name string name this name name update element type return this setname updateelementtype updates the name of the root element param name name of the root element return a value of type doctype public doctype set visibility string visibility this visibility visibility update element type return this setvisibility updateelementtype updates the name of the public identifier param identifier the public identifier return a value of type doctype public doctype set identifier string identifier this identifier identifier update element type return this setidentifier updateelementtype updates the uri of the dtd param uri uri of the dtd return a value of type doctype public doctype set uri string uri this uri uri update element type return this seturi updateelementtype adds and element to the element param hashcode name of the element for hash table param element adds an element to the element return a value of type doctype public doctype add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of the element for the hash table param element adds an element to the element return a value of type doctype public doctype add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element return a value of type doctype public doctype add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element return a value of type doctype public doctype add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed return a value of type doctype public doctype remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry public html40 strict this name html this visibility public this identifier w3c dtd html 4 0 en this uri http www w3 org tr rec html40 strict dtd this update element type html40strict updateelementtype public html40 transitional this name html this visibility public this identifier w3c dtd html 4 0 transitional en this uri http www w3 org tr rec html40 loose dtd this update element type html40transitional updateelementtype public html40 frameset this name html this visibility public this identifier w3c dtd html 4 0 frameset en this uri http www w3 org tr rec html40 frameset dtd this update element type html40frameset updateelementtype public x html10 strict this name html this visibility public this identifier w3c dtd xhtml 1 0 strict en this uri http www w3 org tr xhtml1 dtd xhtml1 strict dtd this update element type xhtml10strict updateelementtype public x html10 transitional this name html this visibility public this identifier w3c dtd xhtml 1 0 transitional en this uri http www w3 org tr xhtml1 dtd xhtml1 transitional dtd this update element type xhtml10transitional updateelementtype public x html10 frameset this name html this visibility public this identifier w3c dtd xhtml 1 0 frameset en this uri http www w3 org tr xhtml1 dtd xhtml1 frameset dtd this update element type xhtml10frameset updateelementtype retrieve calculate current cost price param product product param m attributesetinstance id real asi param as accounting schema param ad org id real org param costing method acct schema costingmethod param qty qty param c orderline id optional order line param zero costsok zero no costs are ok return current cost price or null public static big decimal get current cost m product product int m attributesetinstance id m acct schema as int ad org id string costing method big decimal qty int c orderline id boolean zero costsok string trx name string costing level as get costing level m product category acct pca m product category acct get product get ctx product getm product category id as getc acctschema id null if pca null throw new illegal state exception cannot find acct for m product category id product getm product category id c acctschema id as getc acctschema id costing level if pca get costing level null costing level pca get costing level if m acct schema costinglevel client equals costing level ad org id 0 m attributesetinstance id 0 else if m acct schema costinglevel organization equals costing level m attributesetinstance id 0 else if m acct schema costinglevel batchlot equals costing level ad org id 0 costing method if costing method null costing method pca get costing method if costing method null costing method as get costing method if costing method null throw new illegal argument exception no costing method costing method m acct schema costingmethod standardcosting create update costs m cost detail process product product trx name return get current cost product m attributesetinstance id as ad org id as getm costtype id costing method qty c orderline id zero costsok trx name m_attributesetinstance_id ad_org_id costingmethod acctschema costingmethod_ c_orderline_id zerocostsok bigdecimal getcurrentcost mproduct m_attributesetinstance_id macctschema ad_org_id costingmethod bigdecimal c_orderline_id zerocostsok trxname costinglevel getcostinglevel mproductcategoryacct mproductcategoryacct getctx getm_product_category_id getc_acctschema_id illegalstateexception m_product_category_id getm_product_category_id c_acctschema_id getc_acctschema_id getcostinglevel costinglevel getcostinglevel macctschema costinglevel_client costinglevel ad_org_id m_attributesetinstance_id macctschema costinglevel_organization costinglevel m_attributesetinstance_id macctschema costinglevel_batchlot costinglevel ad_org_id costingmethod costingmethod getcostingmethod costingmethod costingmethod getcostingmethod costingmethod illegalargumentexception costingmethod macctschema costingmethod_standardcosting mcostdetail processproduct trxname getcurrentcost m_attributesetinstance_id ad_org_id getm_costtype_id costingmethod c_orderline_id zerocostsok trxname get current cost price for costing level param product product param m asi id costing level asi param org id costing level org param m costtype id cost type param as acct schema param costing method method param qty quantity param c orderline id optional order line param zero costsok zero no costs are ok return cost price or null private static big decimal get current cost m product product int m asi id m acct schema as int org id int m costtype id string costing method big decimal qty int c orderline id boolean zero costsok string trx name big decimal current cost price null string cost element type null int m costelement id 0 big decimal percent null big decimal material cost each env zero big decimal other cost each env zero big decimal percentage env zero int count 0 string sql select sum c current cost price ce cost element type ce costing method c percent c m costelement id 4 5 from m cost c left outer join m costelement ce on c m costelement id ce m costelement id where c ad client id and c ad org id 1 2 and c m product id 3 and c m attributesetinstance id or c m attributesetinstance id 0 4 and c m costtype id and c c acctschema id 5 6 and ce costing method is null or ce costing method 7 group by ce cost element type ce costing method c percent c m costelement id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 product getad client id pstmt set int 2 org id pstmt set int 3 product getm product id pstmt set int 4 m asi id pstmt set int 5 m costtype id pstmt set int 6 as getc acctschema id pstmt set string 7 costing method result set rs pstmt execute query while rs next current cost price rs get big decimal 1 cost element type rs get string 2 string cm rs get string 3 percent rs get big decimal 4 m costelement id rs get int 5 s log finest current cost price current cost price cost element type cost element type costing method cm percent percent if current cost price null current cost price signum 0 if cm null material cost each material cost each add current cost price else other cost each other cost each add current cost price if percent null percent signum 0 percentage percentage add percent count rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if count 1 print summary s log finest material cost material cost each other costs other cost each percentage percentage seed initial costs if material cost each signum 0 no costs if zero costsok return env zero material cost each get seed costs product m asi id as org id costing method c orderline id if material cost each null return null material costs big decimal material cost material cost each multiply qty standard costs just material costs if m cost element costingmethod standardcosting equals costing method s log finer material costs material cost return material cost if m cost element costingmethod fifo equals costing method m cost element costingmethod lifo equals costing method m cost element ce m cost element get material cost element as costing method material cost m cost queue get costs product m asi id as org id ce qty trx name other costs big decimal other cost other cost each multiply qty costs big decimal costs other cost add material cost if costs signum 0 return null s log finer sum costs costs int precision as get costing precision if percentage signum 0 no percentages if costs scale precision costs costs set scale precision big decimal round half up return costs big decimal percent cost costs multiply percentage percent cost percent cost divide env onehundred precision big decimal round half up costs costs add percent cost if costs scale precision costs costs set scale precision big decimal round half up s log finer sum costs costs add percent cost return costs m_asi_id org_id m_costtype_id acctschema costingmethod c_orderline_id zerocostsok bigdecimal getcurrentcost mproduct m_asi_id macctschema org_id m_costtype_id costingmethod bigdecimal c_orderline_id zerocostsok trxname bigdecimal currentcostprice costelementtype m_costelement_id bigdecimal bigdecimal materialcosteach bigdecimal othercosteach bigdecimal currentcostprice costelementtype costingmethod m_costelement_id m_cost m_costelement m_costelement_id m_costelement_id ad_client_id ad_org_id m_product_id m_attributesetinstance_id m_attributesetinstance_id m_costtype_id c_acctschema_id costingmethod costingmethod costelementtype costingmethod m_costelement_id preparedstatement preparestatement trxname setint getad_client_id setint org_id setint getm_product_id setint m_asi_id setint m_costtype_id setint getc_acctschema_id setstring costingmethod resultset executequery currentcostprice getbigdecimal costelementtype getstring getstring getbigdecimal m_costelement_id getint s_log currentcostprice currentcostprice costelementtype costelementtype costingmethod currentcostprice currentcostprice materialcosteach materialcosteach currentcostprice othercosteach othercosteach currentcostprice s_log s_log materialcost materialcosteach othercosts othercosteach materialcosteach zerocostsok materialcosteach getseedcosts m_asi_id org_id costingmethod c_orderline_id materialcosteach bigdecimal materialcost materialcosteach mcostelement costingmethod_standardcosting costingmethod s_log materialcosts materialcost materialcost mcostelement costingmethod_fifo costingmethod mcostelement costingmethod_lifo costingmethod mcostelement mcostelement getmaterialcostelement costingmethod materialcost mcostqueue getcosts m_asi_id org_id trxname bigdecimal othercost othercosteach bigdecimal othercost materialcost s_log getcostingprecision setscale bigdecimal round_half_up bigdecimal percentcost percentcost percentcost bigdecimal round_half_up percentcost setscale bigdecimal round_half_up s_log percentcost get seed costs param product product param m asi id costing level asi param as accounting schema param org id costing level org param costing method costing method param c orderline id optional order line return price or null public static big decimal get seed costs m product product int m asi id m acct schema as int org id string costing method int c orderline id big decimal ret value null direct data if m cost element costingmethod averageinvoice equals costing method ret value calculate average inv product m asi id as org id else if m cost element costingmethod averagepo equals costing method ret value calculate averagepo product m asi id as org id else if m cost element costingmethod fifo equals costing method ret value calculate fi fo product m asi id as org id else if m cost element costingmethod lifo equals costing method ret value calculate li fo product m asi id as org id else if m cost element costingmethod lastinvoice equals costing method ret value get last invoice price product m asi id org id as getc currency id else if m cost element costingmethod lastpoprice equals costing method if c orderline id 0 ret value getpo price product c orderline id as getc currency id if ret value null ret value signum 0 ret value get lastpo price product m asi id org id as getc currency id else if m cost element costingmethod standardcosting equals costing method migrate old costs m product costing pc m product costing get product get ctx product getm product id as getc acctschema id null if pc null ret value pc get current cost price else if m cost element costingmethod userdefined equals costing method else throw new illegal argument exception unknown costing method costing method if ret value null ret value signum 0 s log fine product get name costing method costing method ret value return ret value look for exact order line if c orderline id 0 ret value getpo price product c orderline id as getc currency id if ret value null ret value signum 0 s log fine product get name po ret value return ret value look for standard costs first if m cost element costingmethod standardcosting equals costing method m cost element ce m cost element get material cost element as m cost element costingmethod standardcosting m cost cost get product m asi id as org id ce getm costelement id if cost null cost get current cost price signum 0 s log fine product get name standard ret value return cost get current cost price we do not have a price po first if m cost element costingmethod averagepo equals costing method m cost element costingmethod lastpoprice equals costing method m cost element costingmethod standardcosting equals costing method try last po ret value get lastpo price product m asi id org id as getc currency id if org id 0 ret value null ret value signum 0 ret value get lastpo price product m asi id 0 as getc currency id if ret value null ret value signum 0 s log fine product get name lastpo ret value return ret value else inv first try last inv ret value get last invoice price product m asi id org id as getc currency id if org id 0 ret value null ret value signum 0 ret value get last invoice price product m asi id 0 as getc currency id if ret value null ret value signum 0 s log fine product get name last inv ret value return ret value still nothing inv second if m cost element costingmethod averagepo equals costing method m cost element costingmethod lastpoprice equals costing method m cost element costingmethod standardcosting equals costing method try last inv ret value get last invoice price product m asi id org id as getc currency id if org id 0 ret value null ret value signum 0 ret value get last invoice price product m asi id 0 as getc currency id if ret value null ret value signum 0 s log fine product get name last inv ret value return ret value else po second try last po ret value get lastpo price product m asi id org id as getc currency id if org id 0 ret value null ret value signum 0 ret value get lastpo price product m asi id 0 as getc currency id if ret value null ret value signum 0 s log fine product get name lastpo ret value return ret value still nothing try productpo m productpo pos m productpo get of product product get ctx product getm product id null for int i 0 i pos length i big decimal price pos i get pricepo if price null price signum 0 price pos 0 get price list if price null price signum 0 price m conversion rate convert product get ctx price pos 0 getc currency id as getc currency id as getad client id org id if price null price signum 0 ret value price s log fine product get name product po ret value return ret value still nothing try purchase price list s log fine product get name ret value return ret value m_asi_id org_id costingmethod c_orderline_id bigdecimal getseedcosts mproduct m_asi_id macctschema org_id costingmethod c_orderline_id bigdecimal retvalue mcostelement costingmethod_averageinvoice costingmethod retvalue calculateaverageinv m_asi_id org_id mcostelement costingmethod_averagepo costingmethod retvalue calculateaveragepo m_asi_id org_id mcostelement costingmethod_fifo costingmethod retvalue calculatefifo m_asi_id org_id mcostelement costingmethod_lifo costingmethod retvalue calculatelifo m_asi_id org_id mcostelement costingmethod_lastinvoice costingmethod retvalue getlastinvoiceprice m_asi_id org_id getc_currency_id mcostelement costingmethod_lastpoprice costingmethod c_orderline_id retvalue getpoprice c_orderline_id getc_currency_id retvalue retvalue retvalue getlastpoprice m_asi_id org_id getc_currency_id mcostelement costingmethod_standardcosting costingmethod mproductcosting mproductcosting getctx getm_product_id getc_acctschema_id retvalue getcurrentcostprice mcostelement costingmethod_userdefined costingmethod illegalargumentexception costingmethod retvalue retvalue s_log getname costingmethod costingmethod retvalue retvalue c_orderline_id retvalue getpoprice c_orderline_id getc_currency_id retvalue retvalue s_log getname retvalue retvalue mcostelement costingmethod_standardcosting costingmethod mcostelement mcostelement getmaterialcostelement mcostelement costingmethod_standardcosting mcost m_asi_id org_id getm_costelement_id getcurrentcostprice s_log getname retvalue getcurrentcostprice mcostelement costingmethod_averagepo costingmethod mcostelement costingmethod_lastpoprice costingmethod mcostelement costingmethod_standardcosting costingmethod retvalue getlastpoprice m_asi_id org_id getc_currency_id org_id retvalue retvalue retvalue getlastpoprice m_asi_id getc_currency_id retvalue retvalue s_log getname retvalue retvalue retvalue getlastinvoiceprice m_asi_id org_id getc_currency_id org_id retvalue retvalue retvalue getlastinvoiceprice m_asi_id getc_currency_id retvalue retvalue s_log getname lastinv retvalue retvalue mcostelement costingmethod_averagepo costingmethod mcostelement costingmethod_lastpoprice costingmethod mcostelement costingmethod_standardcosting costingmethod retvalue getlastinvoiceprice m_asi_id org_id getc_currency_id org_id retvalue retvalue retvalue getlastinvoiceprice m_asi_id getc_currency_id retvalue retvalue s_log getname lastinv retvalue retvalue retvalue getlastpoprice m_asi_id org_id getc_currency_id org_id retvalue retvalue retvalue getlastpoprice m_asi_id getc_currency_id retvalue retvalue s_log getname retvalue retvalue mproductpo mproductpo getofproduct getctx getm_product_id bigdecimal getpricepo getpricelist mconversionrate getctx getc_currency_id getc_currency_id getad_client_id org_id retvalue s_log getname product_po retvalue retvalue s_log getname retvalue retvalue get last invoice price in currency param product product param ad org id org param c currency id accounting currency return last invoice price in currency public static big decimal get last invoice price m product product int m asi id int ad org id int c currency id big decimal ret value null string sql select currency convert il price actual i c currency id i date acct i c conversiontype id il ad client id il ad org id il price actual il qty invoiced i date invoiced il line from c invoiceline il inner join c invoice i on il c invoice id i c invoice id where il m product id and i isso trx n if ad org id 0 sql and il ad org id else if m asi id 0 sql and il m attributesetinstance id sql order by i date invoiced desc il line desc prepared statement pstmt null try pstmt db prepare statement sql product get trxname pstmt set int 1 c currency id pstmt set int 2 product getm product id if ad org id 0 pstmt set int 3 ad org id else if m asi id 0 pstmt set int 3 m asi id result set rs pstmt execute query if rs next ret value rs get big decimal 1 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log finer product get name ret value return ret value return null ad_org_id c_currency_id bigdecimal getlastinvoiceprice mproduct m_asi_id ad_org_id c_currency_id bigdecimal retvalue currencyconvert priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id priceactual qtyinvoiced dateinvoiced c_invoiceline c_invoice c_invoice_id c_invoice_id m_product_id issotrx ad_org_id ad_org_id m_asi_id m_attributesetinstance_id dateinvoiced preparedstatement preparestatement get_trxname setint c_currency_id setint getm_product_id ad_org_id setint ad_org_id m_asi_id setint m_asi_id resultset executequery retvalue getbigdecimal s_log retvalue s_log getname retvalue retvalue get last po price in currency param product product param ad org id org param c currency id accounting currency return last po price in currency or null public static big decimal get lastpo price m product product int m asi id int ad org id int c currency id big decimal ret value null string sql select currency convert ol price cost o c currency id o date acct o c conversiontype id ol ad client id ol ad org id currency convert ol price actual o c currency id o date acct o c conversiontype id ol ad client id ol ad org id ol price cost ol price actual ol qty ordered o date ordered ol line from c orderline ol inner join c order o on ol c order id o c order id where ol m product id and o isso trx n if ad org id 0 sql and ol ad org id else if m asi id 0 sql and t m attributesetinstance id sql order by o date ordered desc ol line desc prepared statement pstmt null try pstmt db prepare statement sql product get trxname pstmt set int 1 c currency id pstmt set int 2 c currency id pstmt set int 3 product getm product id if ad org id 0 pstmt set int 4 ad org id else if m asi id 0 pstmt set int 4 m asi id result set rs pstmt execute query if rs next ret value rs get big decimal 1 if ret value null ret value signum 0 ret value rs get big decimal 2 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log finer product get name ret value return ret value return null ad_org_id c_currency_id bigdecimal getlastpoprice mproduct m_asi_id ad_org_id c_currency_id bigdecimal retvalue currencyconvert pricecost c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id currencyconvert priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id pricecost priceactual qtyordered dateordered c_orderline c_order c_order_id c_order_id m_product_id issotrx ad_org_id ad_org_id m_asi_id m_attributesetinstance_id dateordered preparedstatement preparestatement get_trxname setint c_currency_id setint c_currency_id setint getm_product_id ad_org_id setint ad_org_id m_asi_id setint m_asi_id resultset executequery retvalue getbigdecimal retvalue retvalue retvalue getbigdecimal s_log retvalue s_log getname retvalue retvalue get po price in currency param product product param c orderline id order line param c currency id accounting currency return last po price in currency or null public static big decimal getpo price m product product int c orderline id int c currency id big decimal ret value null string sql select currency convert ol price cost o c currency id o date acct o c conversiontype id ol ad client id ol ad org id currency convert ol price actual o c currency id o date acct o c conversiontype id ol ad client id ol ad org id ol price cost ol price actual ol qty ordered o date ordered ol line from c orderline ol inner join c order o on ol c order id o c order id where ol c orderline id and o isso trx n prepared statement pstmt null try pstmt db prepare statement sql product get trxname pstmt set int 1 c currency id pstmt set int 2 c currency id pstmt set int 3 c orderline id result set rs pstmt execute query if rs next ret value rs get big decimal 1 if ret value null ret value signum 0 ret value rs get big decimal 2 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log finer product get name ret value return ret value return null c_orderline_id c_currency_id bigdecimal getpoprice mproduct c_orderline_id c_currency_id bigdecimal retvalue currencyconvert pricecost c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id currencyconvert priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id pricecost priceactual qtyordered dateordered c_orderline c_order c_order_id c_order_id c_orderline_id issotrx preparedstatement preparestatement get_trxname setint c_currency_id setint c_currency_id setint c_orderline_id resultset executequery retvalue getbigdecimal retvalue retvalue retvalue getbigdecimal s_log retvalue s_log getname retvalue retvalue create costing for client handles transaction if not in a transaction param client client protected static void create m client client m acct schema ass m acct schema get client acct schema client get ctx client getad client id string trx name client get trxname string trx name used trx name trx trx null if trx name null trx name used trx create trx name cost trx trx get trx name used true boolean success true for all products string sql select from m product p where ad client id and exists select from m costdetail cd where p m product id cd m product id and processed n prepared statement pstmt null try pstmt db prepare statement sql trx name used pstmt set int 1 client getad client id result set rs pstmt execute query while rs next m product product new m product client get ctx rs trx name used for int i 0 i ass length i big decimal cost get current cost product 0 ass i 0 null env one 0 false null create non zero costs s log info product get name cost rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null transaction if trx null if success trx commit else trx rollback mclient macctschema macctschema getclientacctschema getctx getad_client_id trxname get_trxname trxnameused trxname trxname trxnameused createtrxname trxnameused m_product ad_client_id m_costdetail m_product_id m_product_id preparedstatement preparestatement trxnameused setint getad_client_id resultset executequery mproduct mproduct getctx trxnameused bigdecimal getcurrentcost s_log getname s_log calculate average invoice from trx param product product param m attributesetinstance id optional asi param as acct schema param ad org id optonal org return average costs or null public static big decimal calculate average inv m product product int m attributesetinstance id m acct schema as int ad org id string sql select t movement qty mi qty il qty invoiced il price actual i c currency id i date acct i c conversiontype id i ad client id i ad org id t m transaction id from m transaction t inner join m matchinv mi on t m inoutline id mi m inoutline id inner join c invoiceline il on mi c invoiceline id il c invoiceline id inner join c invoice i on il c invoice id i c invoice id where t m product id if ad org id 0 sql and t ad org id else if m attributesetinstance id 0 sql and t m attributesetinstance id sql order by t m transaction id prepared statement pstmt null big decimal new stock qty env zero big decimal new average amt env zero int oldtransaction id 0 try pstmt db prepare statement sql null pstmt set int 1 product getm product id if ad org id 0 pstmt set int 2 ad org id else if m attributesetinstance id 0 pstmt set int 2 m attributesetinstance id result set rs pstmt execute query while rs next big decimal old stock qty new stock qty big decimal movement qty rs get big decimal 1 int m transaction id rs get int 10 if m transaction id oldtransaction id new stock qty old stock qty add movement qty m transaction id oldtransaction id big decimal match qty rs get big decimal 2 if match qty null s log finer movement movement qty stock qty new stock qty continue assumption everything is matched big decimal price rs get big decimal 4 int c currency id rs get int 5 timestamp date acct rs get timestamp 6 int c conversiontype id rs get int 7 int client id rs get int 8 int org id rs get int 9 big decimal cost m conversion rate convert product get ctx price c currency id as getc currency id date acct c conversiontype id client id org id big decimal old average amt new average amt big decimal average current old stock qty multiply old average amt big decimal average increase match qty multiply cost big decimal new amt average current add average increase new amt new amt set scale as get costing precision new average amt new amt divide new stock qty as get costing precision big decimal round half up s log finer movement movement qty stock qty new stock qty match match qty cost cost new avg new average amt rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if new average amt null new average amt signum 0 s log finer product get name new average amt return new average amt return null m_attributesetinstance_id ad_org_id bigdecimal calculateaverageinv mproduct m_attributesetinstance_id macctschema ad_org_id movementqty qtyinvoiced priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id m_transaction_id m_transaction m_matchinv m_inoutline_id m_inoutline_id c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice c_invoice_id c_invoice_id m_product_id ad_org_id ad_org_id m_attributesetinstance_id m_attributesetinstance_id m_transaction_id preparedstatement bigdecimal newstockqty bigdecimal newaverageamt oldtransaction_id preparestatement setint getm_product_id ad_org_id setint ad_org_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery bigdecimal oldstockqty newstockqty bigdecimal movementqty getbigdecimal m_transaction_id getint m_transaction_id oldtransaction_id newstockqty oldstockqty movementqty m_transaction_id oldtransaction_id bigdecimal matchqty getbigdecimal matchqty s_log movementqty stockqty newstockqty bigdecimal getbigdecimal c_currency_id getint dateacct gettimestamp c_conversiontype_id getint client_id getint org_id getint bigdecimal mconversionrate getctx c_currency_id getc_currency_id dateacct c_conversiontype_id client_id org_id bigdecimal oldaverageamt newaverageamt bigdecimal averagecurrent oldstockqty oldaverageamt bigdecimal averageincrease matchqty bigdecimal newamt averagecurrent averageincrease newamt newamt setscale getcostingprecision newaverageamt newamt newstockqty getcostingprecision bigdecimal round_half_up s_log movementqty stockqty newstockqty matchqty newavg newaverageamt s_log newaverageamt newaverageamt s_log getname newaverageamt newaverageamt calculate average po param product product param m attributesetinstance id asi param as acct schema param ad org id org return costs or null public static big decimal calculate averagepo m product product int m attributesetinstance id m acct schema as int ad org id string sql select t movement qty mp qty ol qty ordered ol price cost ol price actual 1 5 o c currency id o date acct o c conversiontype id 6 8 o ad client id o ad org id t m transaction id 9 11 from m transaction t inner join m matchpo mp on t m inoutline id mp m inoutline id inner join c orderline ol on mp c orderline id ol c orderline id inner join c order o on ol c order id o c order id where t m product id if ad org id 0 sql and t ad org id else if m attributesetinstance id 0 sql and t m attributesetinstance id sql order by t m transaction id prepared statement pstmt null big decimal new stock qty env zero big decimal new average amt env zero int oldtransaction id 0 try pstmt db prepare statement sql null pstmt set int 1 product getm product id if ad org id 0 pstmt set int 2 ad org id else if m attributesetinstance id 0 pstmt set int 2 m attributesetinstance id result set rs pstmt execute query while rs next big decimal old stock qty new stock qty big decimal movement qty rs get big decimal 1 int m transaction id rs get int 11 if m transaction id oldtransaction id new stock qty old stock qty add movement qty m transaction id oldtransaction id big decimal match qty rs get big decimal 2 if match qty null s log finer movement movement qty stock qty new stock qty continue assumption everything is matched big decimal price rs get big decimal 4 if price null price signum 0 price rs get big decimal 5 int c currency id rs get int 6 timestamp date acct rs get timestamp 7 int c conversiontype id rs get int 8 int client id rs get int 9 int org id rs get int 10 big decimal cost m conversion rate convert product get ctx price c currency id as getc currency id date acct c conversiontype id client id org id big decimal old average amt new average amt big decimal average current old stock qty multiply old average amt big decimal average increase match qty multiply cost big decimal new amt average current add average increase new amt new amt set scale as get costing precision new average amt new amt divide new stock qty as get costing precision big decimal round half up s log finer movement movement qty stock qty new stock qty match match qty cost cost new avg new average amt rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if new average amt null new average amt signum 0 s log finer product get name new average amt return new average amt return null m_attributesetinstance_id ad_org_id bigdecimal calculateaveragepo mproduct m_attributesetinstance_id macctschema ad_org_id movementqty qtyordered pricecost priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id m_transaction_id m_transaction m_matchpo m_inoutline_id m_inoutline_id c_orderline c_orderline_id c_orderline_id c_order c_order_id c_order_id m_product_id ad_org_id ad_org_id m_attributesetinstance_id m_attributesetinstance_id m_transaction_id preparedstatement bigdecimal newstockqty bigdecimal newaverageamt oldtransaction_id preparestatement setint getm_product_id ad_org_id setint ad_org_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery bigdecimal oldstockqty newstockqty bigdecimal movementqty getbigdecimal m_transaction_id getint m_transaction_id oldtransaction_id newstockqty oldstockqty movementqty m_transaction_id oldtransaction_id bigdecimal matchqty getbigdecimal matchqty s_log movementqty stockqty newstockqty bigdecimal getbigdecimal getbigdecimal c_currency_id getint dateacct gettimestamp c_conversiontype_id getint client_id getint org_id getint bigdecimal mconversionrate getctx c_currency_id getc_currency_id dateacct c_conversiontype_id client_id org_id bigdecimal oldaverageamt newaverageamt bigdecimal averagecurrent oldstockqty oldaverageamt bigdecimal averageincrease matchqty bigdecimal newamt averagecurrent averageincrease newamt newamt setscale getcostingprecision newaverageamt newamt newstockqty getcostingprecision bigdecimal round_half_up s_log movementqty stockqty newstockqty matchqty newavg newaverageamt s_log newaverageamt newaverageamt s_log getname newaverageamt newaverageamt calculate fi fo cost param product product param m attributesetinstance id asi param as acct schema param ad org id org return costs or null public static big decimal calculate fi fo m product product int m attributesetinstance id m acct schema as int ad org id string sql select t movement qty mi qty il qty invoiced il price actual i c currency id i date acct i c conversiontype id i ad client id i ad org id t m transaction id from m transaction t inner join m matchinv mi on t m inoutline id mi m inoutline id inner join c invoiceline il on mi c invoiceline id il c invoiceline id inner join c invoice i on il c invoice id i c invoice id where t m product id if ad org id 0 sql and t ad org id else if m attributesetinstance id 0 sql and t m attributesetinstance id sql order by t m transaction id prepared statement pstmt null int oldtransaction id 0 array list qty cost fifo new array list qty cost try pstmt db prepare statement sql null pstmt set int 1 product getm product id if ad org id 0 pstmt set int 2 ad org id else if m attributesetinstance id 0 pstmt set int 2 m attributesetinstance id result set rs pstmt execute query while rs next big decimal movement qty rs get big decimal 1 int m transaction id rs get int 10 if m transaction id oldtransaction id continue assuming same price for receipt m transaction id oldtransaction id big decimal match qty rs get big decimal 2 if match qty null out negative if fifo size 0 qty cost pp qty cost fifo get 0 pp qty pp qty add movement qty big decimal remainder pp qty if remainder signum 0 fifo remove 0 else while remainder signum 0 if fifo size 1 last pp cost env zero remainder env zero else fifo remove 0 pp qty cost fifo get 0 pp qty pp qty add movement qty remainder pp qty else qty cost pp new qty cost movement qty env zero fifo add pp s log finer movement movement qty size fifo size continue assumption everything is matched big decimal price rs get big decimal 4 int c currency id rs get int 5 timestamp date acct rs get timestamp 6 int c conversiontype id rs get int 7 int client id rs get int 8 int org id rs get int 9 big decimal cost m conversion rate convert product get ctx price c currency id as getc currency id date acct c conversiontype id client id org id add stock boolean used false if fifo size 1 qty cost pp qty cost fifo get 0 if pp qty signum 0 pp qty pp qty add movement qty if pp qty signum 0 fifo remove 0 else pp cost cost used true if used qty cost pp new qty cost movement qty cost fifo add pp s log finer movement movement qty size fifo size rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if fifo size 0 return null qty cost pp qty cost fifo get 0 s log finer product get name pp cost return pp cost fifo m_attributesetinstance_id ad_org_id bigdecimal calculatefifo mproduct m_attributesetinstance_id macctschema ad_org_id movementqty qtyinvoiced priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id m_transaction_id m_transaction m_matchinv m_inoutline_id m_inoutline_id c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice c_invoice_id c_invoice_id m_product_id ad_org_id ad_org_id m_attributesetinstance_id m_attributesetinstance_id m_transaction_id preparedstatement oldtransaction_id arraylist qtycost arraylist qtycost preparestatement setint getm_product_id ad_org_id setint ad_org_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery bigdecimal movementqty getbigdecimal m_transaction_id getint m_transaction_id oldtransaction_id m_transaction_id oldtransaction_id bigdecimal matchqty getbigdecimal matchqty qtycost qtycost movementqty bigdecimal qtycost movementqty qtycost qtycost movementqty s_log movementqty bigdecimal getbigdecimal c_currency_id getint dateacct gettimestamp c_conversiontype_id getint client_id getint org_id getint bigdecimal mconversionrate getctx c_currency_id getc_currency_id dateacct c_conversiontype_id client_id org_id qtycost qtycost movementqty qtycost qtycost movementqty s_log movementqty s_log qtycost qtycost s_log getname calculate li fo costs param product product param m attributesetinstance id asi param as acct schema param ad org id org return costs or null public static big decimal calculate li fo m product product int m attributesetinstance id m acct schema as int ad org id string sql select t movement qty mi qty il qty invoiced il price actual i c currency id i date acct i c conversiontype id i ad client id i ad org id t m transaction id from m transaction t inner join m matchinv mi on t m inoutline id mi m inoutline id inner join c invoiceline il on mi c invoiceline id il c invoiceline id inner join c invoice i on il c invoice id i c invoice id where t m product id if ad org id 0 sql and t ad org id else if m attributesetinstance id 0 sql and t m attributesetinstance id starting point sql order by t m transaction id desc prepared statement pstmt null int oldtransaction id 0 array list qty cost lifo new array list qty cost try pstmt db prepare statement sql null pstmt set int 1 product getm product id if ad org id 0 pstmt set int 2 ad org id else if m attributesetinstance id 0 pstmt set int 2 m attributesetinstance id result set rs pstmt execute query while rs next big decimal movement qty rs get big decimal 1 int m transaction id rs get int 10 if m transaction id oldtransaction id continue assuming same price for receipt m transaction id oldtransaction id big decimal match qty rs get big decimal 2 if match qty null out negative if lifo size 0 qty cost pp qty cost lifo get lifo size 1 pp qty pp qty add movement qty big decimal remainder pp qty if remainder signum 0 lifo remove lifo size 1 else while remainder signum 0 if lifo size 1 last pp cost env zero remainder env zero else lifo remove lifo size 1 pp qty cost lifo get lifo size 1 pp qty pp qty add movement qty remainder pp qty else qty cost pp new qty cost movement qty env zero lifo add pp s log finer movement movement qty size lifo size continue assumption everything is matched big decimal price rs get big decimal 4 int c currency id rs get int 5 timestamp date acct rs get timestamp 6 int c conversiontype id rs get int 7 int client id rs get int 8 int org id rs get int 9 big decimal cost m conversion rate convert product get ctx price c currency id as getc currency id date acct c conversiontype id client id org id qty cost pp new qty cost movement qty cost lifo add pp s log finer movement movement qty size lifo size rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if lifo size 0 return null qty cost pp qty cost lifo get lifo size 1 s log finer product get name pp cost return pp cost lifo m_attributesetinstance_id ad_org_id bigdecimal calculatelifo mproduct m_attributesetinstance_id macctschema ad_org_id movementqty qtyinvoiced priceactual c_currency_id dateacct c_conversiontype_id ad_client_id ad_org_id m_transaction_id m_transaction m_matchinv m_inoutline_id m_inoutline_id c_invoiceline c_invoiceline_id c_invoiceline_id c_invoice c_invoice_id c_invoice_id m_product_id ad_org_id ad_org_id m_attributesetinstance_id m_attributesetinstance_id m_transaction_id preparedstatement oldtransaction_id arraylist qtycost arraylist qtycost preparestatement setint getm_product_id ad_org_id setint ad_org_id m_attributesetinstance_id setint m_attributesetinstance_id resultset executequery bigdecimal movementqty getbigdecimal m_transaction_id getint m_transaction_id oldtransaction_id m_transaction_id oldtransaction_id bigdecimal matchqty getbigdecimal matchqty qtycost qtycost movementqty bigdecimal qtycost movementqty qtycost qtycost movementqty s_log movementqty bigdecimal getbigdecimal c_currency_id getint dateacct gettimestamp c_conversiontype_id getint client_id getint org_id getint bigdecimal mconversionrate getctx c_currency_id getc_currency_id dateacct c_conversiontype_id client_id org_id qtycost qtycost movementqty s_log movementqty s_log qtycost qtycost s_log getname public qty cost big decimal qty big decimal cost qty qty cost cost qtycost bigdecimal bigdecimal string representation return info public string to string string buffer sb new string buffer qty append qty append cost append cost return sb to string tostring stringbuffer stringbuffer tostring get create cost record costing level is not validated param product product param m attributesetinstance id costing level asi param as accounting schema param ad org id costing level org param m costelement id element return cost price or null public static m cost get m product product int m attributesetinstance id m acct schema as int ad org id int m costelement id m cost cost null string sql select from m cost c where ad client id and ad org id and m product id and m attributesetinstance id and m costtype id and c acctschema id and m costelement id prepared statement pstmt null try pstmt db prepare statement sql product get trxname pstmt set int 1 product getad client id pstmt set int 2 ad org id pstmt set int 3 product getm product id pstmt set int 4 m attributesetinstance id pstmt set int 5 as getm costtype id pstmt set int 6 as getc acctschema id pstmt set int 7 m costelement id result set rs pstmt execute query if rs next cost new m cost product get ctx rs product get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null new if cost null cost new m cost product m attributesetinstance id as ad org id m costelement id return cost costinglevel m_attributesetinstance_id ad_org_id m_costelement_id mcost mproduct m_attributesetinstance_id macctschema ad_org_id m_costelement_id mcost m_cost ad_client_id ad_org_id m_product_id m_attributesetinstance_id m_costtype_id c_acctschema_id m_costelement_id preparedstatement preparestatement get_trxname setint getad_client_id setint ad_org_id setint getm_product_id setint m_attributesetinstance_id setint getm_costtype_id setint getc_acctschema_id setint m_costelement_id resultset executequery mcost getctx get_trxname s_log mcost m_attributesetinstance_id ad_org_id m_costelement_id get costs param ad client id client param ad org id org param m product id product param m costtype id cost type param c acctschema id as param m costelement id cost element param m attributesetinstance id asi return cost or null public static m cost get properties ctx int ad client id int ad org id int m product id int m costtype id int c acctschema id int m costelement id int m attributesetinstance id m cost ret value null string sql select from m cost where ad client id and ad org id and m product id and m costtype id and c acctschema id and m costelement id and m attributesetinstance id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad client id pstmt set int 2 ad org id pstmt set int 3 m product id pstmt set int 4 m costtype id pstmt set int 5 c acctschema id pstmt set int 6 m costelement id pstmt set int 7 m attributesetinstance id result set rs pstmt execute query if rs next ret value new m cost ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value ad_client_id ad_org_id m_product_id m_costtype_id c_acctschema_id m_costelement_id m_attributesetinstance_id mcost ad_client_id ad_org_id m_product_id m_costtype_id c_acctschema_id m_costelement_id m_attributesetinstance_id mcost retvalue m_cost ad_client_id ad_org_id m_product_id m_costtype_id c_acctschema_id m_costelement_id m_attributesetinstance_id preparedstatement preparestatement setint ad_client_id setint ad_org_id setint m_product_id setint m_costtype_id setint c_acctschema_id setint m_costelement_id setint m_attributesetinstance_id resultset executequery retvalue mcost s_log retvalue standard constructor param ctx context param ignored multi key param trx name trx public m cost properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 setc acctschema id 0 setm costelement id 0 setm costtype id 0 setm product id 0 setm attributesetinstance id 0 set current cost price env zero set future cost price env zero set current qty env zero set cumulated amt env zero set cumulated qty env zero else throw new illegal argument exception multi key trxname mcost trxname trxname setc_acctschema_id setm_costelement_id setm_costtype_id setm_product_id setm_attributesetinstance_id setcurrentcostprice setfuturecostprice setcurrentqty setcumulatedamt setcumulatedqty illegalargumentexception load constructor param ctx context param rs result set param trx name trx public m cost properties ctx result set rs string trx name super ctx rs trx name m manual false trxname mcost resultset trxname trxname m_manual parent constructor param product product param m attributesetinstance id asi param as acct schema param ad org id org param m costelement id cost element public m cost m product product int m attributesetinstance id m acct schema as int ad org id int m costelement id this product get ctx 0 product get trxname set client org product getad client id ad org id setc acctschema id as getc acctschema id setm costtype id as getm costtype id setm product id product getm product id setm attributesetinstance id m attributesetinstance id setm costelement id m costelement id m manual false m_attributesetinstance_id ad_org_id m_costelement_id mcost mproduct m_attributesetinstance_id macctschema ad_org_id m_costelement_id getctx get_trxname setclientorg getad_client_id ad_org_id setc_acctschema_id getc_acctschema_id setm_costtype_id getm_costtype_id setm_product_id getm_product_id setm_attributesetinstance_id m_attributesetinstance_id setm_costelement_id m_costelement_id m_manual add cumulative amt qty and current qty param amt amt param qty qty public void add big decimal amt big decimal qty set cumulated amt get cumulated amt add amt set cumulated qty get cumulated qty add qty set current qty get current qty add qty bigdecimal bigdecimal setcumulatedamt getcumulatedamt setcumulatedqty getcumulatedqty setcurrentqty getcurrentqty add amt qty and calculate weighted average old avg old qty price qty old qty qty param amt total amt price qty param qty qty public void set weighted average big decimal amt big decimal qty big decimal old sum get current cost price multiply get current qty big decimal new sum amt is total already big decimal sum amt old sum add new sum big decimal sum qty get current qty add qty if sum qty signum 0 big decimal cost sum amt divide sum qty get precision big decimal round half up set current cost price cost set cumulated amt get cumulated amt add amt set cumulated qty get cumulated qty add qty set current qty get current qty add qty oldavg oldqty oldqty setweightedaverage bigdecimal bigdecimal bigdecimal oldsum getcurrentcostprice getcurrentqty bigdecimal newsum bigdecimal sumamt oldsum newsum bigdecimal sumqty getcurrentqty sumqty bigdecimal sumamt sumqty getprecision bigdecimal round_half_up setcurrentcostprice setcumulatedamt getcumulatedamt setcumulatedqty getcumulatedqty setcurrentqty getcurrentqty get costing precision return precision 6 private int get precision m acct schema as m acct schema get get ctx getc acctschema id if as null return as get costing precision return 6 getprecision macctschema macctschema getctx getc_acctschema_id getcostingprecision set current cost price param current cost price if null set to 0 public void set current cost price big decimal current cost price if current cost price null super set current cost price current cost price else super set current cost price env zero currentcostprice setcurrentcostprice bigdecimal currentcostprice currentcostprice setcurrentcostprice currentcostprice setcurrentcostprice get history average amt qty return average if amt aty 0 otherwise null public big decimal get history average big decimal ret value null if get cumulated qty signum 0 get cumulated amt signum 0 ret value get cumulated amt divide get cumulated qty get precision big decimal round half up return ret value bigdecimal gethistoryaverage bigdecimal retvalue getcumulatedqty getcumulatedamt retvalue getcumulatedamt getcumulatedqty getprecision bigdecimal round_half_up retvalue string representation return info public string to string string buffer sb new string buffer m cost sb append ad client id append getad client id if getad org id 0 sb append ad org id append getad org id sb append m product id append getm product id if getm attributesetinstance id 0 sb append ad asi id append getm attributesetinstance id sb append c acctschema id append getc acctschema id sb append m costtype id append getm costtype id sb append m costelement id append getm costelement id sb append current cost append get current cost price append c amt append get cumulated amt append c qty append get cumulated qty append return sb to string tostring stringbuffer stringbuffer mcost ad_client_id getad_client_id getad_org_id ad_org_id getad_org_id m_product_id getm_product_id getm_attributesetinstance_id ad_asi_id getm_attributesetinstance_id c_acctschema_id getc_acctschema_id m_costtype_id getm_costtype_id m_costelement_id getm_costelement_id currentcost getcurrentcostprice getcumulatedamt getcumulatedqty tostring get cost element return cost element public m cost element get cost element int m costelement id getm costelement id if m costelement id 0 return null return m cost element get get ctx m costelement id mcostelement getcostelement m_costelement_id getm_costelement_id m_costelement_id mcostelement getctx m_costelement_id before save param new record new return true if can be saved protected boolean before save boolean new record m cost element ce get cost element check if data entry makes sense if m manual m acct schema as new m acct schema get ctx getc acctschema id null string costing level as get costing level m product product m product get get ctx getm product id m product category acct pca m product category acct get get ctx product getm product category id as getc acctschema id null if pca get costing level null costing level pca get costing level if m acct schema costinglevel client equals costing level if getad org id 0 getm attributesetinstance id 0 log save error costing level client return false else if m acct schema costinglevel batchlot equals costing level if getm attributesetinstance id 0 ce is costing method log save error fill mandatory msg get element get ctx m attributesetinstance id return false if getad org id 0 setad org id 0 cannot enter calculated if m manual ce null ce is calculated log save error error msg get element get ctx is calculated return false percentage if ce null if ce is calculated m cost element costelementtype material equals ce get cost element type get percent 0 set percent 0 if get percent 0 if get current cost price signum 0 set current cost price env zero if get future cost price signum 0 set future cost price env zero if get cumulated amt signum 0 set cumulated amt env zero if get cumulated qty signum 0 set cumulated qty env zero return true newrecord beforesave newrecord mcostelement getcostelement m_manual macctschema macctschema getctx getc_acctschema_id costinglevel getcostinglevel mproduct mproduct getctx getm_product_id mproductcategoryacct mproductcategoryacct getctx getm_product_category_id getc_acctschema_id getcostinglevel costinglevel getcostinglevel macctschema costinglevel_client costinglevel getad_org_id getm_attributesetinstance_id saveerror costinglevelclient macctschema costinglevel_batchlot costinglevel getm_attributesetinstance_id iscostingmethod saveerror fillmandatory getelement getctx m_attributesetinstance_id getad_org_id setad_org_id m_manual iscalculated saveerror getelement getctx iscalculated iscalculated mcostelement costelementtype_material getcostelementtype getpercent setpercent getpercent getcurrentcostprice setcurrentcostprice getfuturecostprice setfuturecostprice getcumulatedamt setcumulatedamt getcumulatedqty setcumulatedqty before delete return true protected boolean before delete return true beforedelete test param args ignored public static void main string args delete m cost c where exists select from m costelement ce where c m costelement id ce m costelement id and ce is calculated y update m cost set cumulated amt 0 cumulated qty 0 update m costdetail set processed n where processed y commit compiere startup true m client client m client get env get ctx 11 garden world create client m_cost m_costelement m_costelement_id m_costelement_id iscalculated m_cost cumulatedamt cumulatedqty m_costdetail mclient mclient getctx gardenworld standard constructor public x m storage properties ctx int m storage id string trx name super ctx m storage id trx name if m storage id 0 setm attributesetinstance id 0 setm locator id 0 setm product id 0 set qty on hand env zero set qty ordered env zero set qty reserved env zero x_m_storage m_storage_id trxname m_storage_id trxname m_storage_id setm_attributesetinstance_id setm_locator_id setm_product_id setqtyonhand setqtyordered setqtyreserved load constructor public x m storage properties ctx result set rs string trx name super ctx rs trx name x_m_storage resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m storage append get id append return sb to string tostring stringbuffer stringbuffer x_m_storage get_id tostring set date last inventory count date of last inventory count public void set date last inventory timestamp date last inventory set value date last inventory date last inventory setdatelastinventory datelastinventory set_value datelastinventory datelastinventory get date last inventory count date of last inventory count public timestamp get date last inventory return timestamp get value date last inventory getdatelastinventory get_value datelastinventory set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 1 throw new illegal argument exception m locator id is mandatory set valuenocheck m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id illegalargumentexception m_locator_id set_valuenocheck m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set on hand quantity on hand quantity public void set qty on hand big decimal qty on hand if qty on hand null throw new illegal argument exception qty on hand is mandatory set valuenocheck qty on hand qty on hand setqtyonhand bigdecimal qtyonhand qtyonhand illegalargumentexception qtyonhand set_valuenocheck qtyonhand qtyonhand get on hand quantity on hand quantity public big decimal get qty on hand big decimal bd big decimal get value qty on hand if bd null return env zero return bd bigdecimal getqtyonhand bigdecimal bigdecimal get_value qtyonhand set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered if qty ordered null throw new illegal argument exception qty ordered is mandatory set valuenocheck qty ordered qty ordered setqtyordered bigdecimal qtyordered qtyordered illegalargumentexception qtyordered set_valuenocheck qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set reserved quantity reserved quantity public void set qty reserved big decimal qty reserved if qty reserved null throw new illegal argument exception qty reserved is mandatory set valuenocheck qty reserved qty reserved setqtyreserved bigdecimal qtyreserved qtyreserved illegalargumentexception qtyreserved set_valuenocheck qtyreserved qtyreserved get reserved quantity reserved quantity public big decimal get qty reserved big decimal bd big decimal get value qty reserved if bd null return env zero return bd bigdecimal getqtyreserved bigdecimal bigdecimal get_value qtyreserved get contsnts return contents public object get contents return contents getcontents delivery accuracy public delivery accuracy super deliveryaccuracy deliveryaccuracy create new measures for the goal param goal the goal return number created public int create measures msla goal goal string sql select m inout id io movement date o date promised 1 2 io movement date o date promised o document no from m inout io inner join c order o on io c order id o c order id where io c bpartner id and not exists select from pa sla measure m where m pa sla goal id and m ad table id m in out table id and m record id io m inout id int counter 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 goal getc bpartner id pstmt set int 2 goal getpa sla goal id result set rs pstmt execute query while rs next int m inout id rs get int 1 big decimal measure actual rs get big decimal 2 timestamp movement date rs get timestamp 3 string description rs get string 5 rs get timestamp 4 if goal is date valid movement date msla measure measure new msla measure goal movement date measure actual description measure set link m in out table id m inout id if measure save counter rs close pstmt close pstmt null catch exception e log log level severe create measures e try if pstmt null pstmt close pstmt null catch exception e pstmt null return counter createmeasures mslagoal m_inout_id movementdate datepromised movementdate datepromised documentno m_inout c_order c_order_id c_order_id c_bpartner_id pa_sla_measure pa_sla_goal_id ad_table_id minout table_id record_id m_inout_id preparedstatement preparestatement setint getc_bpartner_id setint getpa_sla_goal_id resultset executequery m_inout_id getint bigdecimal measureactual getbigdecimal movementdate gettimestamp getstring gettimestamp isdatevalid movementdate mslameasure mslameasure movementdate measureactual setlink minout table_id m_inout_id createmeasures calculate goal actual from unprocessed measures return goal actual measure public big decimal calculate measure msla goal goal average big decimal ret value env zero big decimal total env zero int count 0 msla measure measures goal get all measures for int i 0 i measures length i msla measure measure measures i if measure is active goal get valid from null measure get date trx before goal get valid from goal get valid to null measure get date trx after goal get valid to continue total total add measure get measure actual count if measure is processed measure set processed true measure save goal expired if goal get valid to null goal get valid to after new timestamp system current time millis goal set processed true calculate with 2 digits precision if count 0 ret value total divide new big decimal count 2 big decimal round half up return ret value bigdecimal calculatemeasure mslagoal bigdecimal retvalue bigdecimal mslameasure getallmeasures mslameasure isactive getvalidfrom getdatetrx getvalidfrom getvalidto getdatetrx getvalidto getmeasureactual isprocessed setprocessed getvalidto getvalidto currenttimemillis setprocessed retvalue bigdecimal bigdecimal round_half_up retvalue get cash journal for currency org and date param ctx context param c currency id currency param ad org id org param date acct date return cash public static m cash get properties ctx int ad org id timestamp date acct int c currency id string trx name m cash ret value null existing journal string sql select from c cash c where c ad org id 1 and trunc c statement date 2 and c processed n and exists select from c cashbook cb where c c cashbook id cb c cashbook id and cb ad org id c ad org id and cb c currency id 3 prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 ad org id pstmt set timestamp 2 time util get day date acct pstmt set int 3 c currency id result set rs pstmt execute query if rs next ret value new m cash ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null return ret value get cash book m cash book cb m cash book get ctx ad org id c currency id if cb null s log warning no cash book for ad org id ad org id c currency id c currency id return null create new journal ret value new m cash cb date acct ret value save trx name return ret value c_currency_id ad_org_id dateacct mcash ad_org_id dateacct c_currency_id trxname mcash retvalue c_cash ad_org_id statementdate c_cashbook c_cashbook_id c_cashbook_id ad_org_id ad_org_id c_currency_id preparedstatement preparestatement trxname setint ad_org_id settimestamp timeutil getday dateacct setint c_currency_id resultset executequery retvalue mcash trxname s_log retvalue retvalue cashbook mcashbook mcashbook ad_org_id c_currency_id s_log cashbook ad_org_id ad_org_id c_currency_id c_currency_id retvalue mcash dateacct retvalue trxname retvalue get cash journal for cash book and date param ctx context param c cashbook id cashbook param date acct date return cash public static m cash get properties ctx int c cashbook id timestamp date acct string trx name m cash ret value null existing journal string sql select from c cash c where c c cashbook id 1 and trunc c statement date 2 and c processed n prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 c cashbook id pstmt set timestamp 2 time util get day date acct result set rs pstmt execute query if rs next ret value new m cash ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null return ret value get cash book m cash book cb new m cash book ctx c cashbook id trx name if cb get id 0 s log warning not found c cashbook id c cashbook id return null create new journal ret value new m cash cb date acct ret value save trx name return ret value cashbook c_cashbook_id dateacct mcash c_cashbook_id dateacct trxname mcash retvalue c_cash c_cashbook_id statementdate preparedstatement preparestatement trxname setint c_cashbook_id settimestamp timeutil getday dateacct resultset executequery retvalue mcash trxname s_log retvalue retvalue cashbook mcashbook mcashbook c_cashbook_id trxname get_id s_log c_cashbook_id c_cashbook_id retvalue mcash dateacct retvalue trxname retvalue standard constructor param ctx context param c cash id id public m cash properties ctx int c cash id string trx name super ctx c cash id trx name if c cash id 0 setc cashbook id 0 fk set beginning balance env zero set ending balance env zero set statement difference env zero set doc action docaction complete set doc status docstatus drafted timestamp today time util get day system current time millis set statement date today date set date acct today date string name display type get date format display type date format today m org get ctx getad org id get value set name name set is approved false set posted false n set processed false c_cash_id mcash c_cash_id trxname c_cash_id trxname c_cash_id setc_cashbook_id setbeginningbalance setendingbalance setstatementdifference setdocaction docaction_complete setdocstatus docstatus_drafted timeutil getday currenttimemillis setstatementdate setdateacct displaytype getdateformat displaytype morg getad_org_id getvalue setname setisapproved setposted setprocessed load constructor param ctx context param rs result set public m cash properties ctx result set rs string trx name super ctx rs trx name mcash resultset trxname trxname parent constructor param cb cash book param today date if null today public m cash m cash book cb timestamp today this cb get ctx 0 cb get trxname set client org cb setc cashbook id cb getc cashbook id if today null set statement date today set date acct today string name display type get date format display type date format today cb get name set name name m book cb mcash mcashbook getctx get_trxname setclientorg setc_cashbook_id getc_cashbook_id setstatementdate setdateacct displaytype getdateformat displaytype getname setname m_book get lines param requery requery return lines public m cash line get lines boolean requery if m lines null requery return m lines array list m cash line list new array list m cash line string sql select from c cashline where c cash id order by line prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc cash id result set rs pstmt execute query while rs next list add new m cash line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new m cash line list size list to array m lines return m lines mcashline getlines m_lines m_lines arraylist mcashline arraylist mcashline c_cashline c_cash_id preparedstatement preparestatement get_trxname setint getc_cash_id resultset executequery mcashline getctx get_trxname m_lines mcashline toarray m_lines m_lines get cash book return cash book public m cash book get cash book if m book null m book m cash book get get ctx getc cashbook id return m book mcashbook getcashbook m_book m_book mcashbook getctx getc_cashbook_id m_book get document no return name public string get document no return get name getdocumentno getname get document info return document info untranslated public string get document info return msg get element get ctx c cash id get document no getdocumentinfo getelement getctx c_cash_id getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save param new record return true protected boolean before save boolean new record setad org id get cash book getad org id if getad org id 0 log save error error msg parse translation get ctx ad org id return false calculate end balance set ending balance get beginning balance add get statement difference return true newrecord beforesave newrecord setad_org_id getcashbook getad_org_id getad_org_id saveerror parsetranslation getctx ad_org_id setendingbalance getbeginningbalance getstatementdifference process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid std period open if m period is open get ctx get date acct m doc type docbasetype cashjournal m processmsg period closed return doc action status invalid m cash line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid add up amounts big decimal difference env zero int c currency id getc currency id for int i 0 i lines length i m cash line line lines i if line is active continue if c currency id line getc currency id difference difference add line get amount else big decimal amt m conversion rate convert get ctx line get amount line getc currency id c currency id get date acct 0 getad client id getad org id if amt null m processmsg no conversion rate found c cashline id line get line return doc action status invalid difference difference add amt set statement difference difference set ending balance get beginning balance add get statement difference m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mperiod isopen getctx getdateacct mdoctype docbasetype_cashjournal m_processmsg periodclosed docaction status_invalid mcashline getlines m_processmsg nolines docaction status_invalid bigdecimal c_currency_id getc_currency_id mcashline isactive c_currency_id getc_currency_id getamount bigdecimal mconversionrate getctx getamount getc_currency_id c_currency_id getdateacct getad_client_id getad_org_id m_processmsg c_cashline_id getline docaction status_invalid setstatementdifference setendingbalance getbeginningbalance getstatementdifference m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info to string allocation header m allocation hdr alloc new m allocation hdr get ctx false get date acct getc currency id msg translate get ctx c cash id get name get trxname alloc setad org id getad org id if alloc save m processmsg could not create allocation hdr return doc action status invalid m cash line lines get lines false for int i 0 i lines length i m cash line line lines i if m cash line cashtype invoice equals line get cash type boolean different currency getc currency id line getc currency id m allocation hdr hdr alloc if different currency hdr new m allocation hdr get ctx false get date acct line getc currency id msg translate get ctx c cash id get name get trxname hdr setad org id getad org id if hdr save m processmsg could not create allocation hdr return doc action status invalid allocation line m allocation line a line new m allocation line hdr line get amount line get discount amt line get write off amt env zero a line setc invoice id line getc invoice id a line setc cashline id line getc cashline id if a line save m processmsg could not create allocation line return doc action status invalid if different currency should start wf hdr process it doc action action complete hdr save else if m cash line cashtype bankaccounttransfer equals line get cash type payment just as intermediate info m payment pay new m payment get ctx 0 get trxname pay setad org id getad org id string document no get name pay set document no document no pay setr pnref document no pay set value trx type x transfer pay set value tender type x pay setc bankaccount id line getc bankaccount id pay setc doctype id true receipt pay set date trx get statement date pay set date acct get date acct pay set amount line getc currency id line get amount negate transfer pay set description line get description pay set doc status m payment docstatus closed pay set doc action m payment docaction none pay set posted true pay set is allocated true has no allocation pay set processed true if pay save m processmsg could not create payment return doc action status invalid should start wf alloc process it doc action action complete alloc save user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit tostring mallocationhdr mallocationhdr getctx getdateacct getc_currency_id getctx c_cash_id getname get_trxname setad_org_id getad_org_id m_processmsg docaction status_invalid mcashline getlines mcashline mcashline cashtype_invoice getcashtype differentcurrency getc_currency_id getc_currency_id mallocationhdr differentcurrency mallocationhdr getctx getdateacct getc_currency_id getctx c_cash_id getname get_trxname setad_org_id getad_org_id m_processmsg docaction status_invalid mallocationline aline mallocationline getamount getdiscountamt getwriteoffamt aline setc_invoice_id getc_invoice_id aline setc_cashline_id getc_cashline_id aline m_processmsg docaction status_invalid differentcurrency processit docaction action_complete mcashline cashtype_bankaccounttransfer getcashtype mpayment mpayment getctx get_trxname setad_org_id getad_org_id documentno getname setdocumentno documentno setr_pnref documentno set_value trxtype set_value tendertype setc_bankaccount_id getc_bankaccount_id setc_doctype_id setdatetrx getstatementdate setdateacct getdateacct setamount getc_currency_id getamount setdescription getdescription setdocstatus mpayment docstatus_closed setdocaction mpayment docaction_none setposted setisallocated setprocessed m_processmsg docaction status_invalid processit docaction action_complete modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document same as close return true if success public boolean void it log info to string set doc action docaction none return false voidit tostring setdocaction docaction_none close document cancel not delivered qunatities return true if success public boolean close it log info to string set doc action docaction none return true closeit tostring setdocaction docaction_none reverse correction return true if success public boolean reverse correct it log info to string return false reversecorrectit tostring reverse accrual none return true if success public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return true if success public boolean re activate it log info to string set processed false if reverse correct it return true return false reactivateit tostring setprocessed reversecorrectit set processed param processed processed public void set processed boolean processed super set processed processed string sql update c cashline set processed processed y n where c cash id getc cash id int no line db execute update sql get trxname m lines null log fine processed lines no line setprocessed setprocessed c_cashline c_cash_id getc_cash_id noline executeupdate get_trxname m_lines noline string representation return info public string to string string buffer sb new string buffer m cash sb append get id append append get name append balance append get beginning balance append append get ending balance append return sb to string tostring stringbuffer stringbuffer mcash get_id getname getbeginningbalance getendingbalance tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get name total lines 123 00 1 sb append append msg translate get ctx beginning balance append append get beginning balance append append msg translate get ctx ending balance append append get ending balance append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getname getctx beginningbalance getbeginningbalance getctx endingbalance getendingbalance getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return get created by ad_user_id getdoc_user_id getcreatedby get document approval amount return amount difference public big decimal get approval amt return get statement difference bigdecimal getapprovalamt getstatementdifference get currency return currency public int getc currency id return get cash book getc currency id getc_currency_id getcashbook getc_currency_id standard constructor public x r resolution properties ctx int r resolution id string trx name super ctx r resolution id trx name if r resolution id 0 set name null setr resolution id 0 x_r_resolution r_resolution_id trxname r_resolution_id trxname r_resolution_id setname setr_resolution_id load constructor public x r resolution properties ctx result set rs string trx name super ctx rs trx name x_r_resolution resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r resolution append get id append return sb to string tostring stringbuffer stringbuffer x_r_resolution get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set resolution request resolution public void setr resolution id int r resolution id if r resolution id 1 throw new illegal argument exception r resolution id is mandatory set valuenocheck r resolution id new integer r resolution id setr_resolution_id r_resolution_id r_resolution_id illegalargumentexception r_resolution_id set_valuenocheck r_resolution_id r_resolution_id get resolution request resolution public int getr resolution id integer ii integer get value r resolution id if ii null return 0 return ii int value getr_resolution_id get_value r_resolution_id intvalue standard constructor public x b bid properties ctx int b bid id string trx name super ctx b bid id trx name if b bid id 0 setad user id 0 setb bid id 0 setb buyerfunds id 0 setb topic id 0 set is willing to commit false set name null x_b_bid b_bid_id trxname b_bid_id trxname b_bid_id setad_user_id setb_bid_id setb_buyerfunds_id setb_topic_id setiswillingtocommit setname load constructor public x b bid properties ctx result set rs string trx name super ctx rs trx name x_b_bid resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x b bid append get id append return sb to string tostring stringbuffer stringbuffer x_b_bid get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set bid bid for a topic public void setb bid id int b bid id if b bid id 1 throw new illegal argument exception b bid id is mandatory set valuenocheck b bid id new integer b bid id setb_bid_id b_bid_id b_bid_id illegalargumentexception b_bid_id set_valuenocheck b_bid_id b_bid_id get bid bid for a topic public int getb bid id integer ii integer get value b bid id if ii null return 0 return ii int value getb_bid_id get_value b_bid_id intvalue set buyer funds buyer funds for bids on topics public void setb buyerfunds id int b buyerfunds id if b buyerfunds id 1 throw new illegal argument exception b buyerfunds id is mandatory set value b buyerfunds id new integer b buyerfunds id setb_buyerfunds_id b_buyerfunds_id b_buyerfunds_id illegalargumentexception b_buyerfunds_id set_value b_buyerfunds_id b_buyerfunds_id get buyer funds buyer funds for bids on topics public int getb buyerfunds id integer ii integer get value b buyerfunds id if ii null return 0 return ii int value getb_buyerfunds_id get_value b_buyerfunds_id intvalue set topic auction topic public void setb topic id int b topic id if b topic id 1 throw new illegal argument exception b topic id is mandatory set value b topic id new integer b topic id setb_topic_id b_topic_id b_topic_id illegalargumentexception b_topic_id set_value b_topic_id b_topic_id get topic auction topic public int getb topic id integer ii integer get value b topic id if ii null return 0 return ii int value getb_topic_id get_value b_topic_id intvalue set willing to commit public void set is willing to commit boolean is willing to commit set value is willing to commit new boolean is willing to commit setiswillingtocommit iswillingtocommit set_value iswillingtocommit iswillingtocommit get willing to commit public boolean is willing to commit object oo get value is willing to commit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iswillingtocommit get_value iswillingtocommit booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set private note private note not visible to the other parties public void set private note string private note if private note null private note length 2000 log warning length 2000 truncated private note private note substring 0 1999 set value private note private note setprivatenote privatenote privatenote privatenote privatenote privatenote set_value privatenote privatenote get private note private note not visible to the other parties public string get private note return string get value private note getprivatenote get_value privatenote set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg get contents return context public object get contents return contents getcontents initialize panel param window no window param frame frame public void init int window no form frame frame m windowno window no m frame frame env set context env get ctx m windowno isso trx y defaults to no m c currency id env get context as int env get ctx c currency id default log info currency m c currency id try dyn init jb init calculate frame get content pane add main panel border layout center frame get content pane add status bar border layout south catch exception e log log level severe e windowno windowno formframe m_windowno windowno m_frame setcontext getctx m_windowno issotrx m_c_currency_id getcontextasint getctx c_currency_id m_c_currency_id dyninit jbinit getcontentpane mainpanel borderlayout getcontentpane statusbar borderlayout static init throws exception private void jb init throws exception compiere color set background this main panel set layout main layout date label set text msg get msg env get ctx date auto write off set selected false auto write off set text msg get msg env get ctx auto write off true auto write off set tool tip text msg get msg env get ctx auto write off false parameter panel set layout parameter layout allocation panel set layout allocation layout bpartner label set text msg translate env get ctx c bpartner id payment label set request focus enabled false payment label set text msg translate env get ctx c payment id invoice label set request focus enabled false invoice label set text msg translate env get ctx c invoice id payment panel set layout payment layout invoice panel set layout invoice layout invoice info set horizontal alignment swing constants right invoice info set horizontal text position swing constants right invoice info set text payment info set horizontal alignment swing constants right payment info set horizontal text position swing constants right payment info set text difference label set text msg get msg env get ctx difference difference field set background compiereplaf getfieldbackground inactive difference field set editable false difference field set text 0 difference field set columns 8 difference field set horizontal alignment swing constants right allocate button set text msg get msg env get ctx process allocate button add action listener this currency label set text msg translate env get ctx c currency id multi currency set text msg get msg env get ctx multi currency multi currency add action listener this alloc currency label set text invoice scroll pane set preferred size new dimension 200 200 payment scroll pane set preferred size new dimension 200 200 main panel add parameter panel border layout north parameter panel add bpartner label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add bpartner search new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 parameter panel add date label new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add date field new grid bag constraints 3 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 parameter panel add currency label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 parameter panel add currency pick new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 parameter panel add multi currency new grid bag constraints 3 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 main panel add allocation panel border layout south allocation panel add difference label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 0 0 0 allocation panel add difference field new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 allocation panel add allocate button new grid bag constraints 5 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 0 5 5 0 0 allocation panel add alloc currency label new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 allocation panel add auto write off new grid bag constraints 4 0 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 payment panel add payment label border layout north payment panel add payment info border layout south payment panel add payment scroll pane border layout center payment scroll pane get viewport add payment table null invoice panel add invoice label border layout north invoice panel add invoice info border layout south invoice panel add invoice scroll pane border layout center invoice scroll pane get viewport add invoice table null main panel add info panel border layout center info panel set orientation j split pane vertical split info panel set border border factory create etched border info panel set top component payment panel info panel set bottom component invoice panel info panel add payment panel j split pane top info panel add invoice panel j split pane bottom info panel set continuous layout true info panel set preferred size new dimension 670 250 info panel set divider location 110 jbinit compierecolor setbackground mainpanel setlayout mainlayout datelabel settext getmsg getctx autowriteoff setselected autowriteoff settext getmsg getctx autowriteoff autowriteoff settooltiptext getmsg getctx autowriteoff parameterpanel setlayout parameterlayout allocationpanel setlayout allocationlayout bpartnerlabel settext getctx c_bpartner_id paymentlabel setrequestfocusenabled paymentlabel settext getctx c_payment_id invoicelabel setrequestfocusenabled invoicelabel settext getctx c_invoice_id paymentpanel setlayout paymentlayout invoicepanel setlayout invoicelayout invoiceinfo sethorizontalalignment swingconstants invoiceinfo sethorizontaltextposition swingconstants invoiceinfo settext paymentinfo sethorizontalalignment swingconstants paymentinfo sethorizontaltextposition swingconstants paymentinfo settext differencelabel settext getmsg getctx differencefield setbackground getfieldbackground_inactive differencefield seteditable differencefield settext differencefield setcolumns differencefield sethorizontalalignment swingconstants allocatebutton settext getmsg getctx allocatebutton addactionlistener currencylabel settext getctx c_currency_id multicurrency settext getmsg getctx multicurrency multicurrency addactionlistener alloccurrencylabel settext invoicescrollpane setpreferredsize paymentscrollpane setpreferredsize mainpanel parameterpanel borderlayout parameterpanel bpartnerlabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel bpartnersearch gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel datelabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel datefield gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel currencylabel gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel currencypick gridbagconstraints gridbagconstraints gridbagconstraints parameterpanel multicurrency gridbagconstraints gridbagconstraints gridbagconstraints mainpanel allocationpanel borderlayout allocationpanel differencelabel gridbagconstraints gridbagconstraints gridbagconstraints allocationpanel differencefield gridbagconstraints gridbagconstraints gridbagconstraints allocationpanel allocatebutton gridbagconstraints gridbagconstraints gridbagconstraints allocationpanel alloccurrencylabel gridbagconstraints gridbagconstraints gridbagconstraints allocationpanel autowriteoff gridbagconstraints gridbagconstraints gridbagconstraints paymentpanel paymentlabel borderlayout paymentpanel paymentinfo borderlayout paymentpanel paymentscrollpane borderlayout paymentscrollpane getviewport paymenttable invoicepanel invoicelabel borderlayout invoicepanel invoiceinfo borderlayout invoicepanel invoicescrollpane borderlayout invoicescrollpane getviewport invoicetable mainpanel infopanel borderlayout infopanel setorientation jsplitpane vertical_split infopanel setborder borderfactory createetchedborder infopanel settopcomponent paymentpanel infopanel setbottomcomponent invoicepanel infopanel paymentpanel jsplitpane infopanel invoicepanel jsplitpane infopanel setcontinuouslayout infopanel setpreferredsize infopanel setdividerlocation dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame dynamic init prepare dynamic fields throws exception if lookups cannot be initialized private void dyn init throws exception currency int ad column id 3505 c invoice c currency id m lookup lookup cur m lookup factory get env get ctx m windowno 0 ad column id display type table dir currency pick new v lookup c currency id true false true lookup cur currency pick set value new integer m c currency id currency pick add vetoable change listener this b partner ad column id 3499 c invoice c bpartner id m lookup lookupbp m lookup factory get env get ctx m windowno 0 ad column id display type search bpartner search new v lookup c bpartner id true false true lookupbp bpartner search add vetoable change listener this translation status bar set status line msg get msg env get ctx allocate status status bar set statusdb date set to login date date field set value env get context as date env get ctx date date field add vetoable change listener this dyninit ad_column_id c_invoice c_currency_id mlookup lookupcur mlookupfactory getctx m_windowno ad_column_id displaytype tabledir currencypick vlookup c_currency_id lookupcur currencypick setvalue m_c_currency_id currencypick addvetoablechangelistener bpartner ad_column_id c_invoice c_bpartner_id mlookup mlookupfactory getctx m_windowno ad_column_id displaytype bpartnersearch vlookup c_bpartner_id bpartnersearch addvetoablechangelistener statusbar setstatusline getmsg getctx allocatestatus statusbar setstatusdb datefield setvalue getcontextasdate getctx datefield addvetoablechangelistener load business partner info payments invoices private void loadb partner log config b partner m c bpartner id cur m c currency id need to have both values if m c bpartner id 0 m c currency id 0 return async b partner test integer key new integer m c bpartner id if m bpartnercheck contains key new thread public void run m payment set is allocated env get ctx m c bpartner id null m invoice set is paid env get ctx m c bpartner id null start m bpartnercheck add key load unallocated payments 1 trx date 2 document no 3 currency 4 pay amt 5 conv amt 6 conv open 7 allocated vector vector object data new vector vector object string buffer sql new string buffer select p date trx p document no p c payment id 1 3 c iso code p pay amt 4 5 currency convert p pay amt p c currency id p date trx p c conversiontype id p ad client id p ad org id 6 1 currency convert payment available c payment id p c currency id p date trx p c conversiontype id p ad client id p ad org id 7 2 p multiplierap from c payment v p corrected for ap ar inner join c currency c on p c currency id c c currency id where p is allocated n and p processed y and p c charge id is null prepayments ok and p c bpartner id 3 if multi currency is selected sql append and p c currency id 4 sql append order by p date trx p document no log fine paysql sql to string try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m c currency id pstmt set int 2 m c currency id pstmt set int 3 m c bpartner id if multi currency is selected pstmt set int 4 m c currency id result set rs pstmt execute query while rs next vector object line new vector object line add new boolean false 0 selection line add rs get timestamp 1 1 trx date key name pair pp new key name pair rs get int 3 rs get string 2 line add pp 2 document no if multi currency is selected line add rs get string 4 3 currency line add rs get big decimal 5 4 pay amt line add rs get big decimal 6 3 5 conv amt big decimal available rs get big decimal 7 if available null available signum 0 nothing available continue line add available 4 6 conv open available line add env zero 5 7 payment line add rs get big decimal 8 6 8 multiplier data add line rs close pstmt close catch sql exception e log log level severe sql to string e remove previous listeners payment table get model remove table model listener this header info vector string column names new vector string column names add msg get msg env get ctx select column names add msg translate env get ctx date column names add msg translate env get ctx document no if multi currency is selected column names add msg get msg env get ctx trx currency column names add msg translate env get ctx amount column names add msg get msg env get ctx converted amount column names add msg get msg env get ctx open amt column names add msg get msg env get ctx applied amt column names add multiplier set model default table model modelp new default table model data column names modelp add table model listener this payment table set model modelp int i 0 payment table set column class i boolean class false 0 selection payment table set column class i timestamp class true 1 trx date payment table set column class i string class true 2 value if multi currency is selected payment table set column class i string class true 3 currency payment table set column class i big decimal class true 4 pay amt payment table set column class i big decimal class true 5 conv amt payment table set column class i big decimal class true 6 conv open payment table set column class i big decimal class false 7 allocated payment table set column class i big decimal class true 8 multiplier i payment multi currency is selected 7 5 table ui payment table auto size load unpaid invoices 1 trx date 2 value 3 currency 4 inv amt 5 conv amt 6 conv open 7 conv disc 8 write off 9 applied select i date invoiced i document no i c invoice id c iso code i grand total i multiplierap grand total currency convert i grand total i multiplierap i c currency id i c currency id i date invoiced i c conversiontype id i ad client id i ad org id grand total invoice open c invoice id c invoicepayschedule id open currency convert invoice open c invoice id c invoicepayschedule id i c currency id i c currency id i date invoiced i c conversiontype id i ad client id i ad org id i multiplierap open invoice discount i c invoice id sys date c invoicepayschedule id discount currency convert invoice discount i c invoice id sys date c invoicepayschedule id i c currency id i c currency id i date invoiced i c conversiontype id i ad client id i ad org id i multiplier i multiplierap discount i multiplierap i multiplier from c invoice v i inner join c currency c on i c currency id c c currency id where i is paid n and i processed y and i c bpartner id 1000001 data new vector vector object sql new string buffer select i date invoiced i document no i c invoice id 1 3 c iso code i grand total i multiplierap 4 5 orig currency currency convert i grand total i multiplierap i c currency id i date invoiced i c conversiontype id i ad client id i ad org id 6 1 converted currency convert invoice open c invoice id c invoicepayschedule id i c currency id i date invoiced i c conversiontype id i ad client id i ad org id i multiplierap 7 2 converted open currency convert invoice discount 8 allowed discount i c invoice id c invoicepayschedule id i c currency id i date invoiced i c conversiontype id i ad client id i ad org id i multiplier i multiplierap 3 4 i multiplierap from c invoice v i corrected for cm split inner join c currency c on i c currency id c c currency id where i is paid n and i processed y and i c bpartner id 5 if multi currency is selected sql append and i c currency id 6 sql append order by i date invoiced i document no log fine invsql sql to string try prepared statement pstmt db prepare statement sql to string null pstmt set int 1 m c currency id pstmt set int 2 m c currency id pstmt set timestamp 3 timestamp date field get value pstmt set int 4 m c currency id pstmt set int 5 m c bpartner id if multi currency is selected pstmt set int 6 m c currency id result set rs pstmt execute query while rs next vector object line new vector object line add new boolean false 0 selection line add rs get timestamp 1 1 trx date key name pair pp new key name pair rs get int 3 rs get string 2 line add pp 2 value if multi currency is selected line add rs get string 4 3 currency line add rs get big decimal 5 4 orig amount line add rs get big decimal 6 3 5 conv amt big decimal open rs get big decimal 7 if open null no conversion rate open env zero line add open 4 6 conv open big decimal discount rs get big decimal 8 if discount null no concersion rate discount env zero line add discount 5 7 conv allowed disc line add env zero 6 8 write off line add env zero 7 9 applied line add rs get big decimal 9 8 10 multiplier add when open 0 i e not if no conversion rate if env zero compare to open 0 data add line rs close pstmt close catch sql exception e log log level severe sql to string e remove previous listeners invoice table get model remove table model listener this header info column names new vector string column names add msg get msg env get ctx select column names add msg translate env get ctx date column names add msg translate env get ctx document no if multi currency is selected column names add msg get msg env get ctx trx currency column names add msg translate env get ctx amount column names add msg get msg env get ctx converted amount column names add msg get msg env get ctx open amt column names add msg get msg env get ctx discount column names add msg get msg env get ctx write off column names add msg get msg env get ctx applied amt column names add multiplier set model default table model modeli new default table model data column names modeli add table model listener this invoice table set model modeli i 0 loadbpartner bpartner m_c_bpartner_id m_c_currency_id m_c_bpartner_id m_c_currency_id bpartner m_c_bpartner_id m_bpartnercheck mpayment setisallocated getctx m_c_bpartner_id minvoice setispaid getctx m_c_bpartner_id m_bpartnercheck trxdate documentno payamt convamt convopen stringbuffer stringbuffer datetrx documentno c_payment_id iso_code payamt currencyconvert payamt c_currency_id datetrx c_conversiontype_id ad_client_id ad_org_id currencyconvert paymentavailable c_payment_id c_currency_id datetrx c_conversiontype_id ad_client_id ad_org_id c_payment_v c_currency c_currency_id c_currency_id isallocated c_charge_id c_bpartner_id multicurrency isselected c_currency_id datetrx documentno tostring preparedstatement preparestatement tostring setint m_c_currency_id setint m_c_currency_id setint m_c_bpartner_id multicurrency isselected setint m_c_currency_id resultset executequery gettimestamp trxdate keynamepair keynamepair getint getstring documentno multicurrency isselected getstring getbigdecimal payamt getbigdecimal convamt bigdecimal getbigdecimal convopen getbigdecimal sqlexception tostring paymenttable getmodel removetablemodellistener columnnames columnnames getmsg getctx columnnames getctx columnnames getctx documentno multicurrency isselected columnnames getmsg getctx trxcurrency columnnames getctx columnnames getmsg getctx convertedamount columnnames getmsg getctx openamt columnnames getmsg getctx appliedamt columnnames defaulttablemodel defaulttablemodel columnnames addtablemodellistener paymenttable setmodel paymenttable setcolumnclass paymenttable setcolumnclass trxdate paymenttable setcolumnclass multicurrency isselected paymenttable setcolumnclass paymenttable setcolumnclass bigdecimal payamt paymenttable setcolumnclass bigdecimal convamt paymenttable setcolumnclass bigdecimal convopen paymenttable setcolumnclass bigdecimal paymenttable setcolumnclass bigdecimal i_payment multicurrency isselected paymenttable autosize trxdate invamt convamt convopen convdisc writeoff dateinvoiced documentno c_invoice_id iso_code grandtotal grandtotal currencyconvert grandtotal c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id grandtotal invoiceopen c_invoice_id c_invoicepayschedule_id currencyconvert invoiceopen c_invoice_id c_invoicepayschedule_id c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id invoicediscount c_invoice_id sysdate c_invoicepayschedule_id currencyconvert invoicediscount c_invoice_id sysdate c_invoicepayschedule_id c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id c_invoice_v c_currency c_currency_id c_currency_id ispaid c_bpartner_id stringbuffer dateinvoiced documentno c_invoice_id iso_code grandtotal currencyconvert grandtotal c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id currencyconvert invoiceopen c_invoice_id c_invoicepayschedule_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id currencyconvert invoicediscount alloweddiscount c_invoice_id c_invoicepayschedule_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id c_invoice_v c_currency c_currency_id c_currency_id ispaid c_bpartner_id multicurrency isselected c_currency_id dateinvoiced documentno tostring preparedstatement preparestatement tostring setint m_c_currency_id setint m_c_currency_id settimestamp datefield getvalue setint m_c_currency_id setint m_c_bpartner_id multicurrency isselected setint m_c_currency_id resultset executequery gettimestamp trxdate keynamepair keynamepair getint getstring multicurrency isselected getstring getbigdecimal getbigdecimal convamt bigdecimal getbigdecimal convopen bigdecimal getbigdecimal convalloweddisc writeoff getbigdecimal compareto sqlexception tostring invoicetable getmodel removetablemodellistener columnnames columnnames getmsg getctx columnnames getctx columnnames getctx documentno multicurrency isselected columnnames getmsg getctx trxcurrency columnnames getctx columnnames getmsg getctx convertedamount columnnames getmsg getctx openamt columnnames getmsg getctx columnnames getmsg getctx writeoff columnnames getmsg getctx appliedamt columnnames defaulttablemodel defaulttablemodel columnnames addtablemodellistener invoicetable setmodel public void run m payment set is allocated env get ctx m c bpartner id null m invoice set is paid env get ctx m c bpartner id null mpayment setisallocated getctx m_c_bpartner_id minvoice setispaid getctx m_c_bpartner_id action listener multi currency allocate param e event public void action performed action event e log config if e get source equals multi currency loadb partner allocate else if e get source equals allocate button allocate button set enabled false save data loadb partner allocate button set enabled true multicurrency actionperformed actionevent getsource multicurrency loadbpartner getsource allocatebutton allocatebutton setenabled savedata loadbpartner allocatebutton setenabled table model listener recalculate totals param e event public void table changed table model event e boolean is update e get type table model event update not a table update if is update calculate return setting defaults if m calculating avoid recursive calls return m calculating true int row e get first row int col e get column boolean is invoice e get source equals invoice table get model log config row row col col invoice table is invoice payments if is invoice table model payment payment table get model if col 0 selected set payment amount if boolean payment get value at row col boolean value big decimal amount big decimal payment get value at row i open open amount payment set value at amount row i payment else de selected payment set value at env zero row i payment invoice selection else if col 0 table model invoice invoice table get model selected set applied amount if boolean invoice get value at row col boolean value big decimal amount big decimal invoice get value at row i open open amount amount amount subtract big decimal invoice get value at row i discount invoice set value at env zero row i writeoff to be sure invoice set value at amount row i applied else de selected invoice set value at env zero row i writeoff invoice set value at env zero row i applied invoice table repaint update r o invoice try to balance entry else if auto write off is selected table model invoice invoice table get model if applied entered adjust write off if col i applied big decimal open amount big decimal invoice get value at row i open open amount big decimal amount open amount subtract big decimal invoice get value at row i discount amount amount subtract big decimal invoice get value at row i applied invoice set value at amount row i writeoff warning if 30 if amount double value open amount double value 30 a dialog warn m windowno this allocation write off warn else adjust applied big decimal amount big decimal invoice get value at row i open open amount amount amount subtract big decimal invoice get value at row i discount amount amount subtract big decimal invoice get value at row i writeoff invoice set value at amount row i applied m calculating false calculate tablechanged tablemodelevent isupdate gettype tablemodelevent isupdate m_calculating m_calculating getfirstrow getcolumn isinvoice getsource invoicetable getmodel invoicetable isinvoice isinvoice tablemodel paymenttable getmodel getvalueat booleanvalue bigdecimal bigdecimal getvalueat i_open setvalueat i_payment setvalueat i_payment tablemodel invoicetable getmodel getvalueat booleanvalue bigdecimal bigdecimal getvalueat i_open bigdecimal getvalueat i_discount setvalueat i_writeoff setvalueat i_applied setvalueat i_writeoff setvalueat i_applied invoicetable autowriteoff isselected tablemodel invoicetable getmodel writeoff i_applied bigdecimal openamount bigdecimal getvalueat i_open bigdecimal openamount bigdecimal getvalueat i_discount bigdecimal getvalueat i_applied setvalueat i_writeoff doublevalue openamount doublevalue adialog m_windowno allocationwriteoffwarn bigdecimal bigdecimal getvalueat i_open bigdecimal getvalueat i_discount bigdecimal getvalueat i_writeoff setvalueat i_applied m_calculating calculate allocation info private void calculate log config decimal format format display type get number format display type amount timestamp alloc date null payment table model payment payment table get model big decimal total pay new big decimal 0 0 int rows payment get row count m nopayments 0 for int i 0 i rows i if boolean payment get value at i 0 boolean value timestamp ts timestamp payment get value at i 1 alloc date time util max alloc date ts big decimal bd big decimal payment get value at i i payment total pay total pay add bd applied pay m nopayments log fine payment i bd total total pay payment info set text string value of m nopayments msg get msg env get ctx sum format format total pay invoices table model invoice invoice table get model big decimal total inv new big decimal 0 0 rows invoice get row count m noinvoices 0 for int i 0 i rows i if boolean invoice get value at i 0 boolean value timestamp ts timestamp invoice get value at i 1 alloc date time util max alloc date ts big decimal bd big decimal invoice get value at i i applied total inv total inv add bd applied inv m noinvoices log fine invoice i bd total total pay invoice info set text string value of m noinvoices msg get msg env get ctx sum format format total inv set allocation date if alloc date null date field set value alloc date set allocation currency alloc currency label set text currency pick get display difference big decimal difference total pay subtract total inv difference field set text format format difference if difference compare to new big decimal 0 0 0 allocate button set enabled true else allocate button set enabled false decimalformat displaytype getnumberformat displaytype allocdate tablemodel paymenttable getmodel bigdecimal totalpay bigdecimal getrowcount m_nopayments getvalueat booleanvalue getvalueat allocdate timeutil allocdate bigdecimal bigdecimal getvalueat i_payment totalpay totalpay m_nopayments payment_ totalpay paymentinfo settext valueof m_nopayments getmsg getctx totalpay tablemodel invoicetable getmodel bigdecimal totalinv bigdecimal getrowcount m_noinvoices getvalueat booleanvalue getvalueat allocdate timeutil allocdate bigdecimal bigdecimal getvalueat i_applied totalinv totalinv m_noinvoices invoice_ totalpay invoiceinfo settext valueof m_noinvoices getmsg getctx totalinv allocationdate allocdate datefield setvalue allocdate alloccurrencylabel settext currencypick getdisplay bigdecimal totalpay totalinv differencefield settext compareto bigdecimal allocatebutton setenabled allocatebutton setenabled vetoable change listener business partner currency date param e event public void vetoable change property change event e string name e get property name object value e get new value log config name value if value null return b partner if name equals c bpartner id bpartner search set value value m c bpartner id integer value int value loadb partner currency else if name equals c currency id m c currency id integer value int value loadb partner date for multi currency else if name equals date multi currency is selected loadb partner vetoablechange propertychangeevent getpropertyname getnewvalue bpartner c_bpartner_id bpartnersearch setvalue m_c_bpartner_id intvalue loadbpartner c_currency_id m_c_currency_id intvalue loadbpartner multicurrency isselected loadbpartner save data private void save data if m noinvoices m nopayments 0 return fixed fields int ad client id env get context as int env get ctx m windowno ad client id int ad org id env get context as int env get ctx m windowno ad org id int c bpartner id m c bpartner id int c order id 0 int c cashline id 0 timestamp date trx timestamp date field get value int c currency id m c currency id the allocation currency if ad org id 0 a dialog error m windowno this org0 not allowed null return log config client ad client id org ad org id b partner c bpartner id date date trx trx trx trx get trx create trx name al true generation of allocations amount discount write off if there is one payment one line per invoice is generated with both the invoice and payment reference pay 80 inv 100 disc 10 w off 10 80 10 10 pay 1 inv 1 or pay 160 inv 100 disc 10 w off 10 80 10 10 pay 1 inv 1 pay 160 inv 100 disc 10 w off 10 80 10 10 pay 1 inv 2 if there are multiple payment lines the amounts are allocated starting with the first payment and payment pay 60 inv 100 disc 10 w off 10 60 10 10 pay 1 inv 1 pay 100 inv 100 disc 10 w off 10 20 0 0 pay 2 inv 1 pay 100 inv 100 disc 10 w off 10 80 10 10 pay 2 inv 2 if you apply a credit memo to an invoice inv 10 disc 0 w off 0 10 0 0 inv 1 inv 10 disc 0 w off 0 10 0 0 inv 2 if you want to write off a partial invoice without applying enter zero in applied inv 10 disc 1 w off 9 0 1 9 inv 1 issues you cannot write off a payment payment loop and add them to payment list amount list int p rows payment table get row count table model payment payment table get model array list integer payment list new array list integer p rows array list big decimal amount list new array list big decimal p rows big decimal payment applied amt env zero for int i 0 i p rows i payment line is selected if boolean payment get value at i 0 boolean value key name pair pp key name pair payment get value at i 2 value payment variables int c payment id pp get key payment list add new integer c payment id big decimal payment amt big decimal payment get value at i i payment applied payment amount list add payment amt payment applied amt payment applied amt add payment amt log fine c payment id c payment id payment amt payment amt multiplier payment amt abs log config number of payments payment list size total payment applied amt invoices loop and generate alloctions int i rows invoice table get row count table model invoice invoice table get model big decimal total applied amt env zero create allocation but don t save yet m allocation hdr alloc new m allocation hdr env get ctx true manual date trx c currency id env get context env get ctx ad user name trx get trx name alloc setad org id ad org id for all invoices int invoice lines 0 for int i 0 i i rows i invoice line is selected if boolean invoice get value at i 0 boolean value invoice lines key name pair pp key name pair invoice get value at i 2 value invoice variables int c invoice id pp get key big decimal applied amt big decimal invoice get value at i i applied semi fixed fields reset after first invoice big decimal discount amt big decimal invoice get value at i i discount big decimal write off amt big decimal invoice get value at i i writeoff over under amt needs to be in allocation currency big decimal over under amt big decimal invoice get value at i i open subtract applied amt subtract discount amt subtract write off amt log config invoice i applied amt applied amt applied abs loop through all payments until invoice applied int no payments 0 for int j 0 j payment list size applied amt signum 0 j int c payment id integer payment list get j int value big decimal payment amt big decimal amount list get j if payment amt signum 0 log config with payment j amt payment amt no payments use invoice applied amt big decimal amount applied amt log fine c payment id c payment id c invoice id c invoice id amount amount discount discount amt write off write off amt allocation header if alloc get id 0 alloc save log log level severe allocation not created return allocation line m allocation line a line new m allocation line alloc amount discount amt write off amt over under amt a line set doc info c bpartner id c order id c invoice id a line set payment info c payment id c cashline id if a line save log log level severe allocation line not written invoice c invoice id apply discounts and write off only first time discount amt env zero write off amt env zero subtract amount from payment invoice applied amt applied amt subtract amount payment amt payment amt subtract amount log fine allocation amount amount remaining applied applied amt payment payment amt amount list set j payment amt update for all applied amounts noop through payments for invoice no payments allocated and none existing e g inv cm if no payments 0 payment list size 0 int c payment id 0 log config no payment total applied total applied amt create allocation log fine c payment id c payment id c invoice id c invoice id amount applied amt discount discount amt write off write off amt allocation header if alloc get id 0 alloc save log log level severe allocation not created return allocation line m allocation line a line new m allocation line alloc applied amt discount amt write off amt over under amt a line set doc info c bpartner id c order id c invoice id a line set payment info c payment id c cashline id if a line save trx get trx name log log level severe allocation line not written invoice c invoice id log fine allocation amount applied amt total applied amt total applied amt add applied amt log config total remaining total applied amt invoice selected invoice loop only payments and total of 0 e g payment reversal if invoice lines 0 payment list size 0 payment applied amt signum 0 for int i 0 i payment list size i int c payment id integer payment list get i int value big decimal payment amt big decimal amount list get i big decimal payment multiplier big decimal multiplier list get i big decimal payment abs payment amt multiply payment multiplier log fine payment c payment id amount payment amt abs payment abs allocation header if alloc get id 0 alloc save log log level severe allocation not created return allocation line m allocation line a line new m allocation line alloc payment amt env zero env zero env zero a line set doc info c bpartner id 0 0 a line set payment info c payment id 0 if a line save trx get trx name log log level severe allocation line not saved payment c payment id only payments if total applied amt signum 0 log log level severe remaining total applied amt total applied amt should start wf if alloc get id 0 alloc process it doc action action complete alloc save test set is paid for invoice requires that allocation is posted for int i 0 i i rows i invoice line is selected if boolean invoice get value at i 0 boolean value key name pair pp key name pair invoice get value at i 2 value invoice variables int c invoice id pp get key string sql select invoice open c invoice id 0 from c invoice where c invoice id big decimal open db getsql valuebd trx get trx name sql c invoice id if open null open signum 0 sql update c invoice set is paid y where c invoice id c invoice id int no db execute update sql trx get trx name log config invoice i is paid else log config invoice i is not paid open test set payment is fully allocated for int i 0 i payment list size i int c payment id integer payment list get i int value m payment pay new m payment env get ctx c payment id trx get trx name if pay test allocation pay save log config payment i pay is allocated not is fully allocated payment list clear amount list clear trx commit trx c savedata m_noinvoices m_nopayments ad_client_id getcontextasint getctx m_windowno ad_client_id ad_org_id getcontextasint getctx m_windowno ad_org_id c_bpartner_id m_c_bpartner_id c_order_id c_cashline_id datetrx datefield getvalue c_currency_id m_c_currency_id ad_org_id adialog m_windowno org0notallowed ad_client_id ad_org_id bpartner c_bpartner_id datetrx createtrxname writeoff woff woff woff woff woff woff woff woff woff paymentlist amountlist prows paymenttable getrowcount tablemodel paymenttable getmodel arraylist paymentlist arraylist prows arraylist bigdecimal amountlist arraylist bigdecimal prows bigdecimal paymentappliedamt prows getvalueat booleanvalue keynamepair keynamepair getvalueat c_payment_id getkey paymentlist c_payment_id bigdecimal paymentamt bigdecimal getvalueat i_payment amountlist paymentamt paymentappliedamt paymentappliedamt paymentamt c_payment_id c_payment_id paymentamt paymentamt paymentamtabs paymentlist paymentappliedamt irows invoicetable getrowcount tablemodel invoicetable getmodel bigdecimal totalappliedamt mallocationhdr mallocationhdr getctx datetrx c_currency_id getcontext getctx ad_user_name gettrxname setad_org_id ad_org_id invoicelines irows getvalueat booleanvalue invoicelines keynamepair keynamepair getvalueat c_invoice_id getkey bigdecimal appliedamt bigdecimal getvalueat i_applied bigdecimal discountamt bigdecimal getvalueat i_discount bigdecimal writeoffamt bigdecimal getvalueat i_writeoff overunderamt bigdecimal overunderamt bigdecimal getvalueat i_open appliedamt discountamt writeoffamt appliedamt appliedamt appliedabs nopayments paymentlist appliedamt c_payment_id paymentlist intvalue bigdecimal paymentamt bigdecimal amountlist paymentamt paymentamt nopayments bigdecimal appliedamt c_payment_id c_payment_id c_invoice_id c_invoice_id discountamt writeoff writeoffamt get_id mallocationline aline mallocationline discountamt writeoffamt overunderamt aline setdocinfo c_bpartner_id c_order_id c_invoice_id aline setpaymentinfo c_payment_id c_cashline_id aline c_invoice_id writeoff discountamt writeoffamt appliedamt appliedamt paymentamt paymentamt appliedamt paymentamt amountlist paymentamt nopayments paymentlist c_payment_id totalapplied totalappliedamt c_payment_id c_payment_id c_invoice_id c_invoice_id appliedamt discountamt writeoff writeoffamt get_id mallocationline aline mallocationline appliedamt discountamt writeoffamt overunderamt aline setdocinfo c_bpartner_id c_order_id c_invoice_id aline setpaymentinfo c_payment_id c_cashline_id aline gettrxname c_invoice_id appliedamt totalappliedamt totalappliedamt appliedamt totalremaining totalappliedamt invoicelines paymentlist paymentappliedamt paymentlist c_payment_id paymentlist intvalue bigdecimal paymentamt bigdecimal amountlist bigdecimal paymentmultiplier bigdecimal multiplierlist bigdecimal paymentabs paymentamt paymentmultiplier c_payment_id paymentamt paymentabs get_id mallocationline aline mallocationline paymentamt aline setdocinfo c_bpartner_id aline setpaymentinfo c_payment_id aline gettrxname c_payment_id onlypayments totalappliedamt totalappliedamt totalappliedamt get_id processit docaction action_complete ispaid irows getvalueat booleanvalue keynamepair keynamepair getvalueat c_invoice_id getkey invoiceopen c_invoice_id c_invoice c_invoice_id bigdecimal getsqlvaluebd gettrxname c_invoice_id c_invoice ispaid c_invoice_id c_invoice_id executeupdate gettrxname paymentlist c_payment_id paymentlist intvalue mpayment mpayment getctx c_payment_id gettrxname testallocation isallocated paymentlist amountlist standard constructor public x ad treenodebp properties ctx int ad treenodebp id string trx name super ctx ad treenodebp id trx name if ad treenodebp id 0 setad tree id 0 setnode id 0 x_ad_treenodebp ad_treenodebp_id trxname ad_treenodebp_id trxname ad_treenodebp_id setad_tree_id setnode_id load constructor public x ad treenodebp properties ctx result set rs string trx name super ctx rs trx name x_ad_treenodebp resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad treenodebp append get id append return sb to string tostring stringbuffer stringbuffer x_ad_treenodebp get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set node id public void setnode id int node id if node id 0 throw new illegal argument exception node id is mandatory set valuenocheck node id new integer node id node_id setnode_id node_id node_id illegalargumentexception node_id set_valuenocheck node_id node_id get node id public int getnode id integer ii integer get value node id if ii null return 0 return ii int value node_id getnode_id get_value node_id intvalue set parent parent of entity public void setparent id int parent id if parent id 0 set value parent id null else set value parent id new integer parent id setparent_id parent_id parent_id set_value parent_id set_value parent_id parent_id get parent parent of entity public int getparent id integer ii integer get value parent id if ii null return 0 return ii int value getparent_id get_value parent_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null continue else if name equals c projecttype id m c projecttype id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_projecttype_id m_c_projecttype_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception m c project id getrecord id log info do it c project id m c project id c projecttype id m c projecttype id m project project new m project get ctx m c project id get trxname if project getc project id 0 project getc project id m c project id throw new illegal argument exception project not found c project id m c project id if project getc projecttype id int 0 throw new illegal argument exception project already has type cannot overwrite project getc projecttype id m project type type new m project type get ctx m c projecttype id get trxname if type getc projecttype id 0 type getc projecttype id m c projecttype id throw new illegal argument exception project type not found c projecttype id m c projecttype id set copy if service project set project type type if project save throw new exception error return ok doit m_c_project_id getrecord_id doit c_project_id m_c_project_id c_projecttype_id m_c_projecttype_id mproject mproject getctx m_c_project_id get_trxname getc_project_id getc_project_id m_c_project_id illegalargumentexception c_project_id m_c_project_id getc_projecttype_id_int illegalargumentexception getc_projecttype_id mprojecttype mprojecttype getctx m_c_projecttype_id get_trxname getc_projecttype_id getc_projecttype_id m_c_projecttype_id illegalargumentexception c_projecttype_id m_c_projecttype_id setprojecttype public m recurring run properties ctx int c recurring run id string trx name super ctx c recurring run id trx name m recurring run mrecurringrun c_recurring_run_id trxname c_recurring_run_id trxname mrecurringrun public m recurring run properties ctx m recurring recurring super ctx 0 recurring get trxname if recurring null setad client id recurring getad client id setad org id recurring getad org id setc recurring id recurring getc recurring id set date doc recurring get date next run mrecurringrun mrecurring get_trxname setad_client_id getad_client_id setad_org_id getad_org_id setc_recurring_id getc_recurring_id setdatedoc getdatenextrun m recurring run public m recurring run properties ctx result set rs string trx name super ctx rs trx name m recurring run mrecurringrun mrecurringrun resultset trxname trxname mrecurringrun cosntructor param type sql type java sql types public null parameter int type m type type nullparameter m_type get type return type public int get type return m type gettype m_type string representation return info public string to string return null parameter type m type tostring nullparameter m_type standard constructor public x m attributevalue properties ctx int m attributevalue id string trx name super ctx m attributevalue id trx name if m attributevalue id 0 setm attributevalue id 0 setm attribute id 0 set name null set value null x_m_attributevalue m_attributevalue_id trxname m_attributevalue_id trxname m_attributevalue_id setm_attributevalue_id setm_attribute_id setname setvalue load constructor public x m attributevalue properties ctx result set rs string trx name super ctx rs trx name x_m_attributevalue resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m attributevalue append get id append return sb to string tostring stringbuffer stringbuffer x_m_attributevalue get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set attribute value product attribute value public void setm attributevalue id int m attributevalue id if m attributevalue id 1 throw new illegal argument exception m attributevalue id is mandatory set valuenocheck m attributevalue id new integer m attributevalue id setm_attributevalue_id m_attributevalue_id m_attributevalue_id illegalargumentexception m_attributevalue_id set_valuenocheck m_attributevalue_id m_attributevalue_id get attribute value product attribute value public int getm attributevalue id integer ii integer get value m attributevalue id if ii null return 0 return ii int value getm_attributevalue_id get_value m_attributevalue_id intvalue set attribute product attribute public void setm attribute id int m attribute id if m attribute id 1 throw new illegal argument exception m attribute id is mandatory set valuenocheck m attribute id new integer m attribute id setm_attribute_id m_attribute_id m_attribute_id illegalargumentexception m_attribute_id set_valuenocheck m_attribute_id m_attribute_id get attribute product attribute public int getm attribute id integer ii integer get value m attribute id if ii null return 0 return ii int value getm_attribute_id get_value m_attribute_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value factory start editor param jc container to get parent frame param header heading param text initial text param editable if false r o param max size max size return edited string public static string start editor container jc string header string text boolean editable int max size find frame j frame frame env get frame jc string hdr header if hdr null hdr length 0 hdr msg get msg env get ctx editor start it editor ed new editor frame hdr text editable max size a env show center window frame ed string s ed get text ed null return s maxsize starteditor maxsize jframe getframe getmsg getctx maxsize aenv showcenterwindow gettext minimum constructor param frame parent public editor frame frame this frame msg get msg env get ctx editor true 0 getmsg getctx standard constructor param frame parent param header heading param text initial text param editable if false r o param max size max size 0 ignore public editor frame frame string header string text boolean editable int max size super frame header frame null try m maxsize max size jb init set default close operation j dialog dispose on close catch exception ex log log level severe ex set text m text text text area set text m text text area set editable editable if editable text area set background compiereplaf getfieldbackground normal else text area set background compiereplaf getfieldbackground inactive text pane set background compiereplaf getfieldbackground inactive update status bar maxsize maxsize m_maxsize maxsize jbinit setdefaultcloseoperation jdialog dispose_on_close m_text textarea settext m_text textarea seteditable textarea setbackground getfieldbackground_normal textarea setbackground getfieldbackground_inactive textpane setbackground getfieldbackground_inactive updatestatusbar static init throws exception private void jb init throws exception panel set layout panel layout this setj menu bar menu bar text tab text area set preferred size new dimension 300 300 text area set wrap style word true text area set line wrap true tabbed pane add text area text text area add key listener this html tab text pane set content type text html text pane set editable false tabbed pane add text pane html m file set text file m import set text import m import add action listener this m export set text export m export add action listener this tabbed pane add change listener this panel add tabbed pane border layout center confirm panel add action listener this panel add confirm panel border layout south this get content pane add panel border layout center this get content pane add status bar border layout south menu bar add m file m file add m import m file add m export update status bar jbinit setlayout panellayout setjmenubar menubar textarea setpreferredsize textarea setwrapstyleword textarea setlinewrap tabbedpane textarea textarea addkeylistener textpane setcontenttype textpane seteditable tabbedpane textpane mfile settext mimport settext mimport addactionlistener mexport settext mexport addactionlistener tabbedpane addchangelistener tabbedpane borderlayout confirmpanel addactionlistener confirmpanel borderlayout getcontentpane borderlayout getcontentpane statusbar borderlayout menubar mfile mfile mimport mfile mexport updatestatusbar action listener param e event public void action performed action event e if e get action command equals confirm panel a ok m text text area get text log fine ok length m text length dispose else if e get action command equals confirm panel a cancel dispose else if e get source m import import text else if e get source m export export text actionlistener actionperformed actionevent getactioncommand confirmpanel a_ok m_text textarea gettext m_text getactioncommand confirmpanel a_cancel getsource mimport importtext getsource mexport exporttext update status bar private void update status bar string str text area get text int length str length status bar set statusdb length int size length try size str get bytes utf 8 length catch unsupported encoding exception e log log level severe str e if m maxsize 0 status bar set status line string value of size else if size m maxsize status bar set status line size m maxsize false else if size m maxsize status bar set status line size m maxsize false else status bar set status line size m maxsize true toolkit get default toolkit beep updatestatusbar textarea gettext statusbar setstatusdb getbytes unsupportedencodingexception m_maxsize statusbar setstatusline valueof m_maxsize statusbar setstatusline m_maxsize m_maxsize statusbar setstatusline m_maxsize statusbar setstatusline m_maxsize getdefaulttoolkit get text return edited text public string get text return m text gettext m_text import text from file private void import text j file chooser jc new j file chooser jc set dialog title msg get msg env get ctx import text jc set dialog type j file chooser open dialog jc set file selection mode j file chooser files only if jc show open dialog this j file chooser approve option return string buffer sb new string buffer try input stream reader in new input stream reader new file input stream jc get selected file char cbuf new char 1024 int count while count in read cbuf 0 sb append cbuf 0 count in close catch exception e log log level warning e get message return text area set text sb to string update status bar importtext jfilechooser jfilechooser setdialogtitle getmsg getctx importtext setdialogtype jfilechooser open_dialog setfileselectionmode jfilechooser files_only showopendialog jfilechooser approve_option stringbuffer stringbuffer inputstreamreader inputstreamreader fileinputstream getselectedfile getmessage textarea settext tostring updatestatusbar export text to file private void export text j file chooser jc new j file chooser jc set dialog title msg get msg env get ctx export text jc set dialog type j file chooser save dialog jc set file selection mode j file chooser files only if jc show save dialog this j file chooser approve option return try buffered writer bout new buffered writer new output stream writer new file output stream jc get selected file bout write text area get text bout flush bout close catch exception e log log level warning e get message exporttext jfilechooser jfilechooser setdialogtitle getmsg getctx exporttext setdialogtype jfilechooser save_dialog setfileselectionmode jfilechooser files_only showsavedialog jfilechooser approve_option bufferedwriter bufferedwriter outputstreamwriter fileoutputstream getselectedfile textarea gettext getmessage change listener for tabbed pane param e event public void state changed change event e if tabbed pane get selected index 1 switch to html text pane set text text area get text changelistener tabbedpane statechanged changeevent tabbedpane getselectedindex textpane settext textarea gettext state changed public void key typed key event e statechanged keytyped keyevent public void key pressed key event e keypressed keyevent public void key released key event e update status bar keyreleased keyevent updatestatusbar get account schema of client param ctx context param c acctschema id schema id return accounting schema public static m acct schema get properties ctx int c acctschema id return get ctx c acctschema id null accountschema c_acctschema_id macctschema c_acctschema_id c_acctschema_id get account schema of client param ctx context param c acctschema id schema id param trx name optional trx return accounting schema public static m acct schema get properties ctx int c acctschema id string trx name check cache integer key new integer c acctschema id m acct schema ret value m acct schema s cache get key if ret value null return ret value ret value new m acct schema ctx c acctschema id trx name if trx name null s cache put key ret value return ret value accountschema c_acctschema_id trxname macctschema c_acctschema_id trxname c_acctschema_id macctschema retvalue macctschema s_cache retvalue retvalue retvalue macctschema c_acctschema_id trxname trxname s_cache retvalue retvalue get account schema of client param ctx context param ad client id client or 0 for all return array of acct schema of client public static m acct schema get client acct schema properties ctx int ad client id return get client acct schema ctx ad client id null accountschema ad_client_id acctschema macctschema getclientacctschema ad_client_id getclientacctschema ad_client_id get account schema of client param ctx context param ad client id client or 0 for all param trx name optional trx return array of acct schema of client public static m acct schema get client acct schema properties ctx int ad client id string trx name check cache integer key new integer ad client id if s schema contains key key return m acct schema s schema get key create new array list m acct schema list new array list m acct schema m client info info m client info get ctx ad client id trx name m acct schema as m acct schema get ctx info getc acctschema1 id trx name if as get id 0 trx name null list add as other string sql select c acctschema id from c acctschema acs where is active y and exists select from c acctschema gl gl where acs c acctschema id gl c acctschema id and exists select from c acctschema default d where acs c acctschema id d c acctschema id if ad client id 0 sql and ad client id sql order by c acctschema id try prepared statement pstmt db prepare statement sql trx name if ad client id 0 pstmt set int 1 ad client id result set rs pstmt execute query while rs next int id rs get int 1 if id info getc acctschema1 id already in list as m acct schema get ctx id trx name if as get id 0 trx name null list add as rs close pstmt close catch sql exception e s log log level severe sql e save m acct schema ret value new m acct schema list size list to array ret value if trx name null s schema put key ret value return ret value accountschema ad_client_id trxname acctschema macctschema getclientacctschema ad_client_id trxname ad_client_id s_schema containskey macctschema s_schema arraylist macctschema arraylist macctschema mclientinfo mclientinfo ad_client_id trxname macctschema macctschema getc_acctschema1_id trxname get_id trxname c_acctschema_id c_acctschema isactive c_acctschema_gl c_acctschema_id c_acctschema_id c_acctschema_default c_acctschema_id c_acctschema_id ad_client_id ad_client_id c_acctschema_id preparedstatement preparestatement trxname ad_client_id setint ad_client_id resultset executequery getint getc_acctschema1_id macctschema trxname get_id trxname sqlexception s_log macctschema retvalue macctschema toarray retvalue trxname s_schema retvalue retvalue standard constructor param ctx context param c acctschema id id public m acct schema properties ctx int c acctschema id string trx name super ctx c acctschema id trx name if c acctschema id 0 setc currency id 0 set name null set auto period control true setperiod openfuture 2 setperiod openhistory 2 set costing method costingmethod standardcosting set costing level costinglevel client set is adjustcogs false setgaap gaap internationalgaap set has alias true set has combination false set is accrual true y set commitment type commitmenttype none set is discount corrects tax false set is trade discount posted false set is post services false set is explicit cost adjustment false set separator c_acctschema_id macctschema c_acctschema_id trxname c_acctschema_id trxname c_acctschema_id setc_currency_id setname setautoperiodcontrol setperiod_openfuture setperiod_openhistory setcostingmethod costingmethod_standardcosting setcostinglevel costinglevel_client setisadjustcogs gaap_internationalgaap sethasalias sethascombination setisaccrual setcommitmenttype commitmenttype_none setisdiscountcorrectstax setistradediscountposted setispostservices setisexplicitcostadjustment setseparator load constructor param ctx context param rs result set public m acct schema properties ctx result set rs string trx name super ctx rs trx name macctschema resultset trxname trxname parent constructor param client client param currency currency public m acct schema m client client key name pair currency this client get ctx 0 client get trxname set client org client setc currency id currency get key set name client get name getgaap get columncount currency get name macctschema mclient keynamepair getctx get_trxname setclientorg setc_currency_id getkey setname getname get_columncount getname acct schema elements return array list of acct schema element public m acct schema element get acct schema elements if m elements null m elements m acct schema element get acct schema elements this return m elements acctschema arraylist acctschemaelement macctschemaelement getacctschemaelements m_elements m_elements macctschemaelement getacctschemaelements m_elements get acct schema element param element type segment type acct schema element elementtype return acct schema element public m acct schema element get acct schema element string element type if m elements null get acct schema elements for int i 0 i m elements length i m acct schema element ase m elements i if ase get element type equals element type return ase return null acctschema elementtype acctschemaelement elementtype_ acctschemaelement macctschemaelement getacctschemaelement elementtype m_elements getacctschemaelements m_elements macctschemaelement m_elements getelementtype elementtype has acct schema element param segment type segment type acct schema element segment return true if schema has segment type public boolean is acct schema element string segment type return get acct schema element segment type null acctschema segmenttype acctschemaelement segment_ isacctschemaelement segmenttype getacctschemaelement segmenttype get acct schema gl info return gl info public m acct schemagl get acct schemagl if m gl null m gl m acct schemagl get get ctx getc acctschema id if m gl null throw new illegal state exception no gl definition for c acctschema id getc acctschema id return m gl acctschema macctschemagl getacctschemagl m_gl m_gl macctschemagl getctx getc_acctschema_id m_gl illegalstateexception c_acctschema_id getc_acctschema_id m_gl get acct schema defaults return defaults public m acct schema default get acct schema default if m default null m default m acct schema default get get ctx getc acctschema id if m default null throw new illegal state exception no default definition for c acctschema id getc acctschema id return m default acctschema macctschemadefault getacctschemadefault m_default m_default macctschemadefault getctx getc_acctschema_id m_default illegalstateexception c_acctschema_id getc_acctschema_id m_default string representation return string rep public string to string string buffer sb new string buffer acct schema sb append get id append append get name append return sb to string tostring stringbuffer stringbuffer acctschema get_id getname tostring is suspense balancing active return suspense balancing public boolean is suspense balancing if m gl null get acct schemagl return m gl is use suspense balancing m gl getsuspensebalancing acct 0 issuspensebalancing m_gl getacctschemagl m_gl isusesuspensebalancing m_gl getsuspensebalancing_acct get suspense error account return suspense error account public m account getsuspensebalancing acct if m suspenseerror acct null return m suspenseerror acct if m gl null get acct schemagl int c validcombination id m gl getsuspensebalancing acct m suspenseerror acct m account get get ctx c validcombination id return m suspenseerror acct maccount getsuspensebalancing_acct m_suspenseerror_acct m_suspenseerror_acct m_gl getacctschemagl c_validcombination_id m_gl getsuspensebalancing_acct m_suspenseerror_acct maccount getctx c_validcombination_id m_suspenseerror_acct is currency balancing active return suspense balancing public boolean is currency balancing if m gl null get acct schemagl return m gl is use currency balancing iscurrencybalancing m_gl getacctschemagl m_gl isusecurrencybalancing get currency balancing account return currency balancing account public m account getcurrencybalancing acct if m currencybalancing acct null return m currencybalancing acct if m gl null get acct schemagl int c validcombination id m gl getcurrencybalancing acct m currencybalancing acct m account get get ctx c validcombination id return m currencybalancing acct maccount getcurrencybalancing_acct m_currencybalancing_acct m_currencybalancing_acct m_gl getacctschemagl c_validcombination_id m_gl getcurrencybalancing_acct m_currencybalancing_acct maccount getctx c_validcombination_id m_currencybalancing_acct get due to account for segment param segment ignored return account public m account getdueto acct string segment if m dueto acct null return m dueto acct if m gl null get acct schemagl int c validcombination id m gl getintercompanydueto acct m dueto acct m account get get ctx c validcombination id return m dueto acct maccount getdueto_acct m_dueto_acct m_dueto_acct m_gl getacctschemagl c_validcombination_id m_gl getintercompanydueto_acct m_dueto_acct maccount getctx c_validcombination_id m_dueto_acct get due from account for segment param segment ignored return account public m account getduefrom acct string segment if m duefrom acct null return m duefrom acct if m gl null get acct schemagl int c validcombination id m gl getintercompanyduefrom acct m duefrom acct m account get get ctx c validcombination id return m duefrom acct maccount getduefrom_acct m_duefrom_acct m_duefrom_acct m_gl getacctschemagl c_validcombination_id m_gl getintercompanyduefrom_acct m_duefrom_acct maccount getctx c_validcombination_id m_duefrom_acct set only org childs param orgs public void set only orgs integer orgs m onlyorgs orgs setonlyorgs m_onlyorgs set only org childs return orgs public integer get only orgs return m onlyorgs getonlyorgs m_onlyorgs skip creating postings for this org requires set only orgs m report tree requires m tree in basis param ad org id return true if to skip public boolean is skip org int ad org id if getad orgonly id 0 return false only organization if getad orgonly id ad org id return false if m onlyorg null m onlyorg m org get get ctx getad orgonly id not summary only i e skip it if m onlyorg is summary return true if m onlyorgs null return false for int i 0 i m onlyorgs length i if ad org id m onlyorgs i int value return false return true setonlyorgs mreporttree mtree ad_org_id isskiporg ad_org_id getad_orgonly_id getad_orgonly_id ad_org_id m_onlyorg m_onlyorg morg getctx getad_orgonly_id m_onlyorg issummary m_onlyorgs m_onlyorgs ad_org_id m_onlyorgs intvalue get std precision of accounting currency return precision public int get std precision if m stdprecision 0 m currency cur m currency get get ctx getc currency id m stdprecision cur get std precision m costprecision cur get costing precision return m stdprecision getstdprecision m_stdprecision mcurrency mcurrency getctx getc_currency_id m_stdprecision getstdprecision m_costprecision getcostingprecision m_stdprecision get costing precision of accounting currency return precision public int get costing precision if m costprecision 0 get std precision return m costprecision getcostingprecision m_costprecision getstdprecision m_costprecision check costing setup make sure that there is a cost type and cost element public void check costing log info to string create cost type if getm costtype id 0 m cost type ct new m cost type get ctx 0 get trxname ct set client org getad client id 0 ct set name get name ct save setm costtype id ct getm costtype id create cost elements m cost element get material cost element this get costing method default costing level if get costing level null set costing level costinglevel client if get costing method null set costing method costingmethod standardcosting if getgaap null setgaap gaap internationalgaap checkcosting tostring getm_costtype_id mcosttype mcosttype getctx get_trxname setclientorg getad_client_id setname getname setm_costtype_id getm_costtype_id mcostelement getmaterialcostelement getcostingmethod getcostinglevel setcostinglevel costinglevel_client getcostingmethod setcostingmethod costingmethod_standardcosting gaap_internationalgaap is client costing level default return true if client public boolean is costing level client string s get costing level if s null costinglevel client equals s return true return false iscostinglevelclient getcostinglevel costinglevel_client is org costing level return true if org public boolean is costing level org return costinglevel organization equals get costing level iscostinglevelorg costinglevel_organization getcostinglevel is batch costing level return true if batch public boolean is costing level batch return costinglevel batchlot equals get costing level iscostinglevelbatch costinglevel_batchlot getcostinglevel create commitment accounting return true if creaet commitments public boolean is create commitment string s get commitment type if s null return false return commitmenttype commitmentonly equals s commitmenttype commitmentreservation equals s iscreatecommitment getcommitmenttype commitmenttype_commitmentonly commitmenttype_commitmentreservation create commitment reservation accounting return true if create reservations public boolean is create reservation string s get commitment type if s null return false return commitmenttype commitmentreservation equals s iscreatereservation getcommitmenttype commitmenttype_commitmentreservation before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 check costing check primary if getad orgonly id 0 m client info info m client info get get ctx getad client id if info getc acctschema1 id getc acctschema id setad orgonly id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id checkcosting getad_orgonly_id mclientinfo mclientinfo getctx getad_client_id getc_acctschema1_id getc_acctschema_id setad_orgonly_id get create cost queue record costing level is not validated param product product param m attributesetinstance id real asi param as accounting schema param ad org id real org param m costelement id element return cost queue or null public static m cost queue get m product product int m attributesetinstance id m acct schema as int ad org id int m costelement id string trx name m cost queue costq null string sql select from m costqueue where ad client id and ad org id and m product id and m attributesetinstance id and m costtype id and c acctschema id and m costelement id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 product getad client id pstmt set int 2 ad org id pstmt set int 3 product getm product id pstmt set int 4 m attributesetinstance id pstmt set int 5 as getm costtype id pstmt set int 6 as getc acctschema id pstmt set int 7 m costelement id result set rs pstmt execute query if rs next costq new m cost queue product get ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null new if costq null costq new m cost queue product m attributesetinstance id as ad org id m costelement id trx name return costq costinglevel m_attributesetinstance_id ad_org_id m_costelement_id mcostqueue mproduct m_attributesetinstance_id macctschema ad_org_id m_costelement_id trxname mcostqueue m_costqueue ad_client_id ad_org_id m_product_id m_attributesetinstance_id m_costtype_id c_acctschema_id m_costelement_id preparedstatement preparestatement trxname setint getad_client_id setint ad_org_id setint getm_product_id setint m_attributesetinstance_id setint getm_costtype_id setint getc_acctschema_id setint m_costelement_id resultset executequery mcostqueue getctx trxname s_log mcostqueue m_attributesetinstance_id ad_org_id m_costelement_id trxname get cost queue records in lifo fifo order param product product param m asi id costing level asi param as accounting schema param org id costing level org param ce cost element return cost queue or null public static m cost queue get queue m product product int m asi id m acct schema as int org id m cost element ce string trx name array list m cost queue list new array list m cost queue string sql select from m costqueue where ad client id and ad org id and m product id and m costtype id and c acctschema id and m costelement id if m asi id 0 sql and m attributesetinstance id sql and current qty 0 order by m attributesetinstance id if ce is fifo sql desc prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 product getad client id pstmt set int 2 org id pstmt set int 3 product getm product id pstmt set int 4 as getm costtype id pstmt set int 5 as getc acctschema id pstmt set int 6 ce getm costelement id if m asi id 0 pstmt set int 7 m asi id result set rs pstmt execute query while rs next list add new m cost queue product get ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m cost queue costq new m cost queue list size list to array costq return costq m_asi_id org_id mcostqueue getqueue mproduct m_asi_id macctschema org_id mcostelement trxname arraylist mcostqueue arraylist mcostqueue m_costqueue ad_client_id ad_org_id m_product_id m_costtype_id c_acctschema_id m_costelement_id m_asi_id m_attributesetinstance_id currentqty m_attributesetinstance_id isfifo preparedstatement preparestatement trxname setint getad_client_id setint org_id setint getm_product_id setint getm_costtype_id setint getc_acctschema_id setint getm_costelement_id m_asi_id setint m_asi_id resultset executequery mcostqueue getctx trxname s_log mcostqueue mcostqueue toarray adjust qty based on in lifo fifo order param product product param m asi id costing level asi param as accounting schema param org id costing level org param ce cost element param qty quantity to be reduced return cost price reduced or null of error public static big decimal adjust qty m product product int m asi id m acct schema as int org id m cost element ce big decimal qty string trx name if qty signum 0 return env zero m cost queue costq get queue product m asi id as org id ce trx name big decimal remaining qty qty for int i 0 i costq length i m cost queue queue costq i negative qty i e add if remaining qty signum 0 big decimal old qty queue get current qty big decimal new qty old qty subtract remaining qty queue set current qty new qty if queue save s log fine qty remaining qty asi queue getm attributesetinstance id old qty new qty return queue get current cost price else return null positive queue if queue get current qty signum 0 big decimal reduction remaining qty if reduction compare to queue get current qty 0 reduction queue get current qty big decimal old qty queue get current qty big decimal new qty old qty subtract reduction queue set current qty new qty if queue save s log fine qty reduction asi queue getm attributesetinstance id old qty new qty remaining qty remaining qty subtract reduction else return null if remaining qty signum 0 return queue get current cost price for queue s log fine remaining qty remaining qty return null m_asi_id org_id bigdecimal adjustqty mproduct m_asi_id macctschema org_id mcostelement bigdecimal trxname mcostqueue getqueue m_asi_id org_id trxname bigdecimal remainingqty mcostqueue remainingqty bigdecimal oldqty getcurrentqty bigdecimal newqty oldqty remainingqty setcurrentqty newqty s_log remainingqty getm_attributesetinstance_id oldqty newqty getcurrentcostprice getcurrentqty bigdecimal remainingqty compareto getcurrentqty getcurrentqty bigdecimal oldqty getcurrentqty bigdecimal newqty oldqty setcurrentqty newqty s_log getm_attributesetinstance_id oldqty newqty remainingqty remainingqty remainingqty getcurrentcostprice s_log remainingqty remainingqty calculate cost based on qty based on in lifo fifo order param product product param m asi id costing level asi param as accounting schema param org id costing level org param ce cost element param qty quantity to be reduced return cost for qty or null of error public static big decimal get costs m product product int m asi id m acct schema as int org id m cost element ce big decimal qty string trx name if qty signum 0 return env zero m cost queue costq get queue product m asi id as org id ce trx name big decimal cost env zero big decimal remaining qty qty big decimal first price null big decimal last price null for int i 0 i costq length i m cost queue queue costq i negative qty i e add if remaining qty signum 0 big decimal old qty queue get current qty last price queue get current cost price big decimal cost batch last price multiply remaining qty cost cost add cost batch s log config asi queue getm attributesetinstance id cost last price qty remaining qty cost batch return cost positive queue if queue get current qty signum 0 big decimal reduction remaining qty if reduction compare to queue get current qty 0 reduction queue get current qty big decimal old qty queue get current qty last price queue get current cost price big decimal cost batch last price multiply reduction cost cost add cost batch s log fine asi queue getm attributesetinstance id cost last price qty reduction cost batch remaining qty remaining qty subtract reduction done if remaining qty signum 0 s log config cost cost return cost if first price null first price last price for queue if last price null last price m cost get seed costs product m asi id as org id ce get costing method 0 if last price null s log info no price found return null s log info no cost queue big decimal cost batch last price multiply remaining qty s log fine remaining qty remaining qty last price last price cost batch cost cost add cost batch s log config cost cost return cost m_asi_id org_id bigdecimal getcosts mproduct m_asi_id macctschema org_id mcostelement bigdecimal trxname mcostqueue getqueue m_asi_id org_id trxname bigdecimal bigdecimal remainingqty bigdecimal firstprice bigdecimal lastprice mcostqueue remainingqty bigdecimal oldqty getcurrentqty lastprice getcurrentcostprice bigdecimal costbatch lastprice remainingqty costbatch s_log getm_attributesetinstance_id lastprice remainingqty costbatch getcurrentqty bigdecimal remainingqty compareto getcurrentqty getcurrentqty bigdecimal oldqty getcurrentqty lastprice getcurrentcostprice bigdecimal costbatch lastprice costbatch s_log getm_attributesetinstance_id lastprice costbatch remainingqty remainingqty remainingqty s_log firstprice firstprice lastprice lastprice lastprice mcost getseedcosts m_asi_id org_id getcostingmethod lastprice s_log s_log bigdecimal costbatch lastprice remainingqty s_log remainingqty remainingqty lastprice lastprice costbatch costbatch s_log standard constructor param ctx context param ignored multi key param trx name trx public m cost queue properties ctx int ignored string trx name super ctx ignored trx name if ignored 0 setc acctschema id 0 setm attributesetinstance id 0 setm costelement id 0 setm costtype id 0 setm product id 0 set current cost price env zero set current qty env zero else throw new illegal argument exception multi key trxname mcostqueue trxname trxname setc_acctschema_id setm_attributesetinstance_id setm_costelement_id setm_costtype_id setm_product_id setcurrentcostprice setcurrentqty illegalargumentexception load cosntructor param ctx context param rs result set param trx name trx public m cost queue properties ctx result set rs string trx name super ctx rs trx name trxname mcostqueue resultset trxname trxname parent constructor param product product param m attributesetinstance id asi param as acct schema param ad org id org param m costelement id cost element public m cost queue m product product int m attributesetinstance id m acct schema as int ad org id int m costelement id string trx name this product get ctx 0 trx name set client org product getad client id ad org id setc acctschema id as getc acctschema id setm costtype id as getm costtype id setm product id product getm product id setm attributesetinstance id m attributesetinstance id setm costelement id m costelement id m_attributesetinstance_id ad_org_id m_costelement_id mcostqueue mproduct m_attributesetinstance_id macctschema ad_org_id m_costelement_id trxname getctx trxname setclientorg getad_client_id ad_org_id setc_acctschema_id getc_acctschema_id setm_costtype_id getm_costtype_id setm_product_id getm_product_id setm_attributesetinstance_id m_attributesetinstance_id setm_costelement_id m_costelement_id update record old avg old qty price qty old qty qty param amt total amount param qty quantity param precision costing precision public void set costs big decimal amt big decimal qty int precision big decimal old sum get current cost price multiply get current qty big decimal new sum amt is total already big decimal sum amt old sum add new sum big decimal sum qty get current qty add qty if sum qty signum 0 big decimal cost sum amt divide sum qty precision big decimal round half up set current cost price cost set current qty get current qty add qty oldavg oldqty oldqty setcosts bigdecimal bigdecimal bigdecimal oldsum getcurrentcostprice getcurrentqty bigdecimal newsum bigdecimal sumamt oldsum newsum bigdecimal sumqty getcurrentqty sumqty bigdecimal sumamt sumqty bigdecimal round_half_up setcurrentcostprice setcurrentqty getcurrentqty standard constructor public x ad tree properties ctx int ad tree id string trx name super ctx ad tree id trx name if ad tree id 0 setad tree id 0 set is all nodes false set is default false n set name null set tree type null x_ad_tree ad_tree_id trxname ad_tree_id trxname ad_tree_id setad_tree_id setisallnodes setisdefault setname settreetype load constructor public x ad tree properties ctx result set rs string trx name super ctx rs trx name x_ad_tree resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad tree append get id append return sb to string tostring stringbuffer stringbuffer x_ad_tree get_id tostring set tree identifies a tree public void setad tree id int ad tree id if ad tree id 1 throw new illegal argument exception ad tree id is mandatory set valuenocheck ad tree id new integer ad tree id setad_tree_id ad_tree_id ad_tree_id illegalargumentexception ad_tree_id set_valuenocheck ad_tree_id ad_tree_id get tree identifies a tree public int getad tree id integer ii integer get value ad tree id if ii null return 0 return ii int value getad_tree_id get_value ad_tree_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set all nodes all nodes are included complete tree public void set is all nodes boolean is all nodes set value is all nodes new boolean is all nodes setisallnodes isallnodes set_value isallnodes isallnodes get all nodes all nodes are included complete tree public boolean is all nodes object oo get value is all nodes if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallnodes get_value isallnodes booleanvalue set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue public static final string treetype salesregion sr set type area element this tree is built on i e product business partner public void set tree type string tree type if tree type null throw new illegal argument exception tree type is mandatory if tree type equals ay tree type equals bb tree type equals bp tree type equals ev tree type equals mc tree type equals mm tree type equals oo tree type equals pc tree type equals pj tree type equals pr tree type equals sr else throw new illegal argument exception tree type invalid value tree type reference id 120 ay bb bp ev mc mm oo pc pj pr sr if tree type length 2 log warning length 2 truncated tree type tree type substring 0 1 set valuenocheck tree type tree type treetype_salesregion settreetype treetype treetype illegalargumentexception treetype treetype treetype treetype treetype treetype treetype treetype treetype treetype treetype treetype illegalargumentexception treetype treetype reference_id treetype treetype treetype set_valuenocheck treetype treetype get type area element this tree is built on i e product business partner public string get tree type return string get value tree type gettreetype get_value treetype constructor public jdbc info connection conn throws sql exception m md conn get meta data log info m md get database product name log config m md get database product version log config m md get database major version m md get database minor version log info m md get driver name log config m md get driver version log config m md get driver major version m md get driver minor version log info jdbc m md getjdbc major version m md getjdbc minor version jdbcinfo sqlexception m_md getmetadata m_md getdatabaseproductname m_md getdatabaseproductversion m_md getdatabasemajorversion m_md getdatabaseminorversion m_md getdrivername m_md getdriverversion m_md getdrivermajorversion m_md getdriverminorversion m_md getjdbcmajorversion m_md getjdbcminorversion list catalogs public void list catalogs throws sql exception log info m md get catalog term m md get catalog separator result set rs m md get catalogs while rs next dump rs listcatalogs sqlexception m_md getcatalogterm m_md getcatalogseparator resultset m_md getcatalogs list schemas public void list schemas throws sql exception log info m md get schema term result set rs m md get schemas while rs next dump rs listschemas sqlexception m_md getschematerm resultset m_md getschemas list types public void list types throws sql exception result set rs m md get type info while rs next log info dump rs listtypes sqlexception resultset m_md gettypeinfo dump the current row of a result set param rs result set public static void dump result set rs throws sql exception result set meta data md rs get meta data for int i 0 i md get column count i int index i 1 string info md get column label index string name md get column name index if info null info name else if name null name equals info info name info rs get string index info md get column type name index md get precision index if md get scale index 0 info md get scale index info log fine info resultset sqlexception resultsetmetadata getmetadata getcolumncount getcolumnlabel getcolumnname getstring getcolumntypename getprecision getscale getscale test param args ignored public static void main string args compiere startup true c log mgt set level level all try jdbc info info new jdbc info db create connection true connection transaction read committed info list catalogs info list schemas info list types catch exception e log log level severe e clogmgt setlevel jdbcinfo jdbcinfo createconnection transaction_read_committed listcatalogs listschemas listtypes persistency constructor param ctx context param ignored ignored public m commission detail properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mcommissiondetail trxname trxname illegalargumentexception parent constructor param amt commission amt public m commission detail m commission amt amt int c currency id big decimal amt big decimal qty super amt get ctx 0 amt get trxname set client org amt setc commissionamt id amt getc commissionamt id setc currency id c currency id set actual amt amt set actual qty qty set converted amt env zero mcommissiondetail mcommissionamt c_currency_id bigdecimal bigdecimal getctx get_trxname setclientorg setc_commissionamt_id getc_commissionamt_id setc_currency_id c_currency_id setactualamt setactualqty setconvertedamt load constructor param ctx context param rs result set public m commission detail properties ctx result set rs string trx name super ctx rs trx name mcommissiondetail resultset trxname trxname set line i ds param c orderline id order param c invoiceline id invoice public void set linei ds int c orderline id int c invoiceline id if c orderline id 0 setc orderline id c orderline id if c invoiceline id 0 setc invoiceline id c invoiceline id ids c_orderline_id c_invoiceline_id setlineids c_orderline_id c_invoiceline_id c_orderline_id setc_orderline_id c_orderline_id c_invoiceline_id setc_invoiceline_id c_invoiceline_id set converted amt param date for conversion public void set converted amt timestamp date big decimal amt m conversion rate convert base get ctx get actual amt getc currency id date 0 type getad client id getad org id if amt null set converted amt amt setconvertedamt bigdecimal mconversionrate convertbase getctx getactualamt getc_currency_id getad_client_id getad_org_id setconvertedamt after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record update amt header return success newrecord aftersave newrecord newrecord updateamtheader after delete param success success return success protected boolean after delete boolean success if success update amt header return success afterdelete updateamtheader update amt header private void update amt header m commission amt amt new m commission amt get ctx getc commissionamt id get trxname amt calculate commission amt save updateamtheader mcommissionamt mcommissionamt getctx getc_commissionamt_id get_trxname calculatecommission persistency constructor param ctx context param ignored ignored public m registration value properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mregistrationvalue trxname trxname illegalargumentexception load constructor param ctx context param rs result set public m registration value properties ctx result set rs string trx name super ctx rs trx name mregistrationvalue resultset trxname trxname parent constructor param registration parent param a registrationattribute id attribute param name value public m registration value m registration registration int a registrationattribute id string name super registration get ctx 0 registration get trxname set client org registration seta registration id registration geta registration id seta registrationattribute id a registrationattribute id set name name a_registrationattribute_id mregistrationvalue mregistration a_registrationattribute_id getctx get_trxname setclientorg seta_registration_id geta_registration_id seta_registrationattribute_id a_registrationattribute_id setname get registration attribute return name of registration attribute public string get registration attribute if m registrationattribute null int a registrationattribute id geta registrationattribute id m registration attribute att m registration attribute get get ctx a registrationattribute id get trxname m registrationattribute att get name m registrationattributedescription att get description m seqno att get seq no return m registrationattribute getregistrationattribute m_registrationattribute a_registrationattribute_id geta_registrationattribute_id mregistrationattribute mregistrationattribute getctx a_registrationattribute_id get_trxname m_registrationattribute getname m_registrationattributedescription getdescription m_seqno getseqno m_registrationattribute get registration attribute description return description of registration attribute public string get registration attribute description if m registrationattributedescription null get registration attribute return m registrationattributedescription getregistrationattributedescription m_registrationattributedescription getregistrationattribute m_registrationattributedescription get attribute seq no return seq no public int get seq no if m seqno 1 get registration attribute return m seqno seqno getseqno m_seqno getregistrationattribute m_seqno compare to param o the object to be compared return a negative integer zero or a positive integer as this object is less than equal to or greater than the specified object public int compare to object o if o null return 0 m registration value oo m registration value o int compare get seq no oo get seq no return compare compareto mregistrationvalue mregistrationvalue getseqno getseqno string representation return info public string to string string buffer sb new string buffer sb append get seq no append append get registration attribute append append get name return sb to string tostring stringbuffer stringbuffer getseqno getregistrationattribute getname tostring standard constructor public x c revenuerecognition properties ctx int c revenuerecognition id string trx name super ctx c revenuerecognition id trx name if c revenuerecognition id 0 setc revenuerecognition id 0 set is time based false set name null set recognition frequency null x_c_revenuerecognition c_revenuerecognition_id trxname c_revenuerecognition_id trxname c_revenuerecognition_id setc_revenuerecognition_id setistimebased setname setrecognitionfrequency load constructor public x c revenuerecognition properties ctx result set rs string trx name super ctx rs trx name x_c_revenuerecognition resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c revenuerecognition append get id append return sb to string tostring stringbuffer stringbuffer x_c_revenuerecognition get_id tostring set revenue recognition method for recording revenue public void setc revenuerecognition id int c revenuerecognition id if c revenuerecognition id 1 throw new illegal argument exception c revenuerecognition id is mandatory set valuenocheck c revenuerecognition id new integer c revenuerecognition id setc_revenuerecognition_id c_revenuerecognition_id c_revenuerecognition_id illegalargumentexception c_revenuerecognition_id set_valuenocheck c_revenuerecognition_id c_revenuerecognition_id get revenue recognition method for recording revenue public int getc revenuerecognition id integer ii integer get value c revenuerecognition id if ii null return 0 return ii int value getc_revenuerecognition_id get_value c_revenuerecognition_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set time based time based revenue recognition rather than service level based public void set is time based boolean is time based set value is time based new boolean is time based setistimebased istimebased set_value istimebased istimebased get time based time based revenue recognition rather than service level based public boolean is time based object oo get value is time based if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istimebased get_value istimebased booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set number of months public void set no months int no months set value no months new integer no months setnomonths nomonths set_value nomonths nomonths get number of months public int get no months integer ii integer get value no months if ii null return 0 return ii int value getnomonths get_value nomonths intvalue public static final string recognitionfrequency year y set recognition frequency public void set recognition frequency string recognition frequency if recognition frequency null throw new illegal argument exception recognition frequency is mandatory if recognition frequency equals m recognition frequency equals q recognition frequency equals y else throw new illegal argument exception recognition frequency invalid value recognition frequency reference id 196 m q y if recognition frequency length 1 log warning length 1 truncated recognition frequency recognition frequency substring 0 0 set value recognition frequency recognition frequency recognitionfrequency_year setrecognitionfrequency recognitionfrequency recognitionfrequency illegalargumentexception recognitionfrequency recognitionfrequency recognitionfrequency recognitionfrequency illegalargumentexception recognitionfrequency recognitionfrequency reference_id recognitionfrequency recognitionfrequency recognitionfrequency set_value recognitionfrequency recognitionfrequency get recognition frequency public string get recognition frequency return string get value recognition frequency getrecognitionfrequency get_value recognitionfrequency constructor public v rowid renderer boolean enable selection m select enable selection vrowidrenderer enableselection m_select enableselection enable selection to be displayed public void set enable selection boolean show selection m select show selection setenableselection showselection m_select showselection return table cell renderer component public component get table cell renderer component j table table object value boolean is selected boolean has focus int row int column if m select if m check null m check new j check box object data object value if data null data 1 null m check set selected false else boolean sel boolean data 1 m check set selected sel boolean value return m check else return m button tablecell gettablecellrenderercomponent jtable isselected hasfocus m_select m_check m_check jcheckbox m_check setselected m_check setselected booleanvalue m_check m_button get material cost element or create it param po parent param costing method method return cost element public static m cost element get material cost element po po string costing method if costing method null costing method length 0 s log severe no costing method return null m cost element ret value null string sql select from m costelement where ad client id and costing method order by ad org id prepared statement pstmt null try pstmt db prepare statement sql po get trxname pstmt set int 1 po getad client id pstmt set string 2 costing method result set rs pstmt execute query if rs next ret value new m cost element po get ctx rs po get trxname if rs next s log warning more then one material cost element for costing method costing method rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null return ret value create new ret value new m cost element po get ctx 0 po get trxname ret value set client org po getad client id 0 string name m ref list get list name po get ctx costingmethod ad reference id costing method if name null name length 0 name costing method ret value set name name ret value set cost element type costelementtype material ret value set costing method costing method ret value save return ret value costingmethod mcostelement getmaterialcostelement costingmethod costingmethod costingmethod s_log costingmethod mcostelement retvalue m_costelement ad_client_id costingmethod ad_org_id preparedstatement preparestatement get_trxname setint getad_client_id setstring costingmethod resultset executequery retvalue mcostelement getctx get_trxname s_log costingmethod costingmethod s_log retvalue retvalue retvalue mcostelement getctx get_trxname retvalue setclientorg getad_client_id mreflist getlistname getctx costingmethod_ad_reference_id costingmethod costingmethod retvalue setname retvalue setcostelementtype costelementtype_material retvalue setcostingmethod costingmethod retvalue retvalue get first material cost element param ctx context param costing method costing method return cost element or null public static m cost element get material cost element properties ctx string costing method m cost element ret value null string sql select from m costelement where ad client id and costing method order by ad org id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx pstmt set string 2 costing method result set rs pstmt execute query if rs next ret value new m cost element ctx rs null if rs next s log info more then one material cost element for costing method costing method rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value costingmethod mcostelement getmaterialcostelement costingmethod mcostelement retvalue m_costelement ad_client_id costingmethod ad_org_id preparedstatement preparestatement setint getad_client_id setstring costingmethod resultset executequery retvalue mcostelement s_log costingmethod costingmethod s_log retvalue get active material cost element for client param po parent return cost element array public static m cost element get costing methods po po array list m cost element list new array list m cost element string sql select from m costelement where ad client id and is active y and cost element type m and costing method is not null prepared statement pstmt null try pstmt db prepare statement sql po get trxname pstmt set int 1 po getad client id result set rs pstmt execute query while rs next list add new m cost element po get ctx rs po get trxname rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m cost element ret value new m cost element list size list to array ret value return ret value mcostelement getcostingmethods arraylist mcostelement arraylist mcostelement m_costelement ad_client_id isactive costelementtype costingmethod preparedstatement preparestatement get_trxname setint getad_client_id resultset executequery mcostelement getctx get_trxname s_log mcostelement retvalue mcostelement toarray retvalue retvalue get cost element from cache param ctx context param m costelement id id return cost element public static m cost element get properties ctx int m costelement id integer key new integer m costelement id m cost element ret value m cost element s cache get key if ret value null return ret value ret value new m cost element ctx m costelement id null if ret value get id 0 s cache put key ret value return ret value m_costelement_id mcostelement m_costelement_id m_costelement_id mcostelement retvalue mcostelement s_cache retvalue retvalue retvalue mcostelement m_costelement_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param m costelement id id param trx name trx public m cost element properties ctx int m costelement id string trx name super ctx m costelement id trx name if m costelement id 0 set name null set cost element type costelementtype material set is calculated false m_costelement_id trxname mcostelement m_costelement_id trxname m_costelement_id trxname m_costelement_id setname setcostelementtype costelementtype_material setiscalculated load constructor param ctx context param rs result set param trx name trx public m cost element properties ctx result set rs string trx name super ctx rs trx name trxname mcostelement resultset trxname trxname before save param new record new return true protected boolean before save boolean new record check unique costing method if costelementtype material equals get cost element type new record is valuechanged costing method string sql select coalesce max m costelement id 0 from m costelement where ad client id and costing method int id db getsql value get trxname sql getad client id get costing method if id 0 id get id log save error already exists msg get element get ctx costing method return false maintain calclated if costelementtype material equals get cost element type string cm get costing method if cm null cm length 0 costingmethod standardcosting equals cm set is calculated false else set is calculated true else if is calculated set is calculated false if get costing method null set costing method null if getad org id 0 setad org id 0 return true newrecord beforesave newrecord costelementtype_material getcostelementtype newrecord is_valuechanged costingmethod m_costelement_id m_costelement ad_client_id costingmethod getsqlvalue get_trxname getad_client_id getcostingmethod get_id saveerror alreadyexists getelement getctx costingmethod costelementtype_material getcostelementtype getcostingmethod costingmethod_standardcosting setiscalculated setiscalculated iscalculated setiscalculated getcostingmethod setcostingmethod getad_org_id setad_org_id before delete return true if can be deleted protected boolean before delete string cm get costing method if cm null costelementtype material equals get cost element type return true costing methods on as level m acct schema ass m acct schema get client acct schema get ctx getad client id for int i 0 i ass length i if ass i get costing method equals get costing method log save error cannot delete used msg get element get ctx c acctschema id ass i get name return false costing methods on pc level string sql select m product category id from m product category acct where ad client id and costing method int m product category id 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad client id pstmt set string 2 get costing method result set rs pstmt execute query if rs next m product category id rs get int 1 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if m product category id 0 log save error cannot delete used msg get element get ctx m product category id id m product category id return false return true beforedelete getcostingmethod costelementtype_material getcostelementtype macctschema macctschema getclientacctschema getctx getad_client_id getcostingmethod getcostingmethod saveerror cannotdeleteused getelement getctx c_acctschema_id getname m_product_category_id m_product_category_acct ad_client_id costingmethod m_product_category_id preparedstatement preparestatement setint getad_client_id setstring getcostingmethod resultset executequery m_product_category_id getint m_product_category_id saveerror cannotdeleteused getelement getctx m_product_category_id m_product_category_id is this a costing method return true if not material cost or no costing method public boolean is costing method return costelementtype material equals get cost element type get costing method null iscostingmethod costelementtype_material getcostelementtype getcostingmethod is avg invoice costing method return true if average invoice public boolean is average invoice string cm get costing method return cm null cm equals costingmethod averageinvoice costelementtype material equals get cost element type averageinvoice isaverageinvoice getcostingmethod costingmethod_averageinvoice costelementtype_material getcostelementtype is avg po costing method return true if averagepo public boolean is averagepo string cm get costing method return cm null cm equals costingmethod averagepo costelementtype material equals get cost element type isaveragepo getcostingmethod costingmethod_averagepo costelementtype_material getcostelementtype is averagepo is fi fo costing method return true if fifo public boolean is fifo string cm get costing method return cm null cm equals costingmethod fifo costelementtype material equals get cost element type isaveragepo fifo isfifo getcostingmethod costingmethod_fifo costelementtype_material getcostelementtype is fifo is last invoice costing method return true if last invoice public boolean is last invoice string cm get costing method return cm null cm equals costingmethod lastinvoice costelementtype material equals get cost element type isfifo lastinvoice islastinvoice getcostingmethod costingmethod_lastinvoice costelementtype_material getcostelementtype is last invoice is last po costing method return true if lastpo price public boolean is lastpo price string cm get costing method return cm null cm equals costingmethod lastpoprice costelementtype material equals get cost element type islastinvoice lastpoprice islastpoprice getcostingmethod costingmethod_lastpoprice costelementtype_material getcostelementtype is lastpo price is li fo costing method return true if lifo public boolean is lifo string cm get costing method return cm null cm equals costingmethod lifo costelementtype material equals get cost element type islastpoprice lifo islifo getcostingmethod costingmethod_lifo costelementtype_material getcostelementtype is li fo is std costing method return true if standard costing public boolean is standard costing string cm get costing method return cm null cm equals costingmethod standardcosting costelementtype material equals get cost element type islifo standardcosting isstandardcosting getcostingmethod costingmethod_standardcosting costelementtype_material getcostelementtype is standard costing is user costing method return true if user defined public boolean is user defined string cm get costing method return cm null cm equals costingmethod userdefined costelementtype material equals get cost element type isstandardcosting isuserdefined getcostingmethod costingmethod_userdefined costelementtype_material getcostelementtype string representation return info public string to string string buffer sb new string buffer m cost element sb append get id append append get name append type append get cost element type append method append get costing method append return sb to string tostring stringbuffer stringbuffer mcostelement get_id getname getcostelementtype getcostingmethod tostring constructor param database type compiere database type param database host database host param database port database port 0 for default param system password system password public create compiere string database type string database host int database port string system password init database database type m databasehost database host if database port 0 m databaseport m dbtarget get standard port else m databaseport database port m systempassword system password log info m dbtarget get name on database host databasetype compieredatabase type_ databasehost databaseport systempassword createcompiere databasetype databasehost databaseport systempassword initdatabase databasetype m_databasehost databasehost databaseport m_databaseport m_dbtarget getstandardport m_databaseport databaseport m_systempassword systempassword m_dbtarget getname databasehost create compiere database param database type database db private void init database string database type try for int i 0 i database db names length i if database db names i equals database type m dbtarget compiere database database db classes i new instance break catch exception e log severe e to string e print stack trace if m dbtarget null throw new illegal state exception no database database type source database m dbsource db get database databasetype db_ initdatabase databasetype db_names db_names databasetype m_dbtarget compieredatabase db_classes newinstance tostring printstacktrace m_dbtarget illegalstateexception databasetype m_dbsource getdatabase clean start drop re create db public void clean start connection conn get connection true true if conn null throw new illegal state exception no database drop database conn create user conn create database conn try if conn null conn close catch sql exception e2 log log level severe close connection e2 conn null cleanstart getconnection illegalstateexception dropdatabase createuser createdatabase sqlexception set compiere user param compiere user compiere id param compiere password compiere password public void set compiere user string compiere user string compiere password m compiereuser compiere user m compierepassword compiere password compiereuser compierepassword setcompiereuser compiereuser compierepassword m_compiereuser compiereuser m_compierepassword compierepassword set database name param database name db name param database device device or table space public void set database name string database name string database device m databasename database name m databasedevice database device databasename databasedevice setdatabasename databasename databasedevice m_databasename databasename m_databasedevice databasedevice test connection return connection public boolean test connection string db url m dbtarget get connectionurl m databasehost m databaseport m databasename m dbtarget get system user compiere may not be defined yet log info db url m dbtarget get system user m systempassword try connection conn m dbtarget get driver connection db url m dbtarget get system user m systempassword jdbc info info new jdbc info conn if c log mgt is level finest info list catalogs info list schemas catch exception e log log level severe test e return false return true testconnection dburl m_dbtarget getconnectionurl m_databasehost m_databaseport m_databasename m_dbtarget getsystemuser dburl m_dbtarget getsystemuser m_systempassword m_dbtarget getdriverconnection dburl m_dbtarget getsystemuser m_systempassword jdbcinfo jdbcinfo clogmgt islevelfinest listcatalogs listschemas create user return true if success public boolean create user connection sys conn log info m compiereuser m compierepassword return execute commands m dbtarget get commands compiere database cmd create user sys conn true false createuser sysconn m_compiereuser m_compierepassword executecommands m_dbtarget getcommands compieredatabase cmd_create_user sysconn create database return true if success public boolean create database connection sys conn log info m databasename m databasedevice return execute commands m dbtarget get commands compiere database cmd create database sys conn true false createdatabase sysconn m_databasename m_databasedevice executecommands m_dbtarget getcommands compieredatabase cmd_create_database sysconn drop database return true if success public boolean drop database connection sys conn log info m databasename return execute commands m dbtarget get commands compiere database cmd drop database sys conn true false dropdatabase sysconn m_databasename executecommands m_dbtarget getcommands compieredatabase cmd_drop_database sysconn create tables and copy data param where clause optional where clause param drop first drop first return true if executed public boolean copy string where clause boolean drop first log info where clause if get connection false true null return false boolean success true int count 0 array list string list new array list string string sql select from ad table if where clause null where clause length 0 sql where where clause sql order by table name prepared statement pstmt null try pstmt db prepare statement sql null database meta data md pstmt get connection get meta data result set rs pstmt execute query while rs next success m table table new m table m ctx rs null if table is view continue if drop first execute commands new string drop table table get table name m conn false false if create table table md list add table get table name count else success false rs close pstmt close pstmt null catch exception e log log level severe sql e success false try if pstmt null pstmt close pstmt null catch exception e pstmt null if success return false enable contraints enable constraints list database build log info count try if m conn null m conn close catch sql exception e2 log log level severe close connection e2 m conn null return success whereclause dropfirst whereclause dropfirst whereclause getconnection arraylist arraylist ad_table whereclause whereclause whereclause tablename preparedstatement preparestatement databasemetadata getconnection getmetadata resultset executequery m_table m_table m_ctx isview dropfirst executecommands gettablename m_conn createtable gettablename enableconstraints databasebuild m_conn m_conn sqlexception m_conn execute script return true if executed public boolean execute file script return false create table param m table table model param md meta data return true if created private boolean create table m table m table database meta data md string table name m table get table name log info table name string catalog m dbsource get catalog string schema m dbsource get schema string table table name to upper case m column columns m table get columns false string buffer sb new string buffer create table sb append table name append try columns boolean first true result set source columns md get columns catalog schema table null while source columns next sb append first first false case sensitive column name m column column null string column name source columns get string column name for int i 0 i columns length i string cn columns i get column name if cn equals ignore case column name column name cn column columns i break sb append column name append data type precision int sql type source columns get int data type sql types string type name source columns get string type name db dependent int size source columns get int column size int dec digits source columns get int decimal digits if source columns was null dec digits 1 if type name equals number oracle style if dec digits 1 sb append type name else sb append type name append append size append append dec digits append other d bs int dt column getad reference id if display type isid dt sb append integer else int scale display type get default precision dt sb append decimal append 18 scale append append scale append else if type name equals date type name equals blob type name equals clob sb append type name else if type name equals char type name starts with varchar sb append type name append append size append else if type name starts with nchar type name starts with nvar sb append type name append append size 2 append else if type name starts with timestamp sb append date else log severe do not support data type type name default string def source columns get string column def if def null sb append default append def null if source columns get int nullable database meta data column no nulls sb append not null else sb append null check contraints for all columns source columns close primary key result set sourcepk md get primary keys catalog schema table table cat null table schem reference table name a asset column name a asset id key seq 1 pk name a asset key first true boolean haspk false while sourcepk next haspk true begin vpj cd e evolution 06 14 2005 string pk name sourcepk get string pk name if pk name index of key 0 pk name pk name key end vpj cd e evolution if first begin vpj cd e evolution 06 14 2005 sb append constraint append sourcepk get string pk name append primary key sb append constraint append pk name append primary key end vpj cd e evolution 06 14 2005 else sb append first false string column name sourcepk get string column name sb append check column name column name if haspk close constraint sb append using index tablespace indx sourcepk close sb append close create table catch exception ex log log level severe create table ex return false execute create table if execute commands new string sb to string m conn false true return true continue create inexes begin vpj cd e evolution 03 11 2005 create table indexes m table md end vpj cd e evolution 03 11 2005 return create table data m table mtable createtable m_table mtable databasemetadata tablename mtable gettablename tablename m_dbsource getcatalog m_dbsource getschema tablename touppercase m_column mtable getcolumns stringbuffer stringbuffer tablename resultset sourcecolumns getcolumns sourcecolumns m_column columnname sourcecolumns getstring column_name getcolumnname equalsignorecase columnname columnname columnname sqltype sourcecolumns getint data_type typename sourcecolumns getstring type_name sourcecolumns getint column_size decdigits sourcecolumns getint decimal_digits sourcecolumns wasnull decdigits typename decdigits typename typename decdigits dbs getad_reference_id displaytype displaytype getdefaultprecision typename typename typename typename typename typename startswith typename typename startswith typename startswith typename typename startswith typename sourcecolumns getstring column_def sourcecolumns getint databasemetadata columnnonulls sourcecolumns resultset getprimarykeys table_cat table_schem table_name a_asset column_name a_asset_id key_seq pk_name a_asset_key pk_name getstring pk_name pk_name indexof pk_name pk_name _key getstring pk_name pk_name columnname getstring column_name checkcolumnname columnname createtable executecommands tostring m_conn createtableindexes mtable createtabledata mtable check column name param column name column name return column name with correct case private string check column name string column name return m element get column name column name columnname checkcolumnname columnname m_element getcolumnname columnname create table indexes param m table table private void create table indexes m table m table database meta data md string table name m table get table name log info table name string catalog m dbsource get catalog string schema m dbsource get schema string table table name to upper case try result set source index md get index info catalog schema table false false catch exception e mtable createtableindexes m_table mtable databasemetadata tablename mtable gettablename tablename m_dbsource getcatalog m_dbsource getschema tablename touppercase resultset sourceindex getindexinfo create copy table data param m table model table return true if data created copied private boolean create table data m table m table boolean success true int count 0 int errors 0 long start system current time millis get table data string sql select from m table get table name prepared statement pstmt null try pstmt db prepare statement sql m table get trxname result set rs pstmt execute query while rs next if create table data row rs m table count else errors rs close pstmt close pstmt null catch exception e log log level severe sql e success false try if pstmt null pstmt close pstmt null catch exception e pstmt null long elapsed system current time millis start log config inserted count errors errors elapsed ms return success mtable createtabledata m_table mtable currenttimemillis mtable gettablename preparedstatement preparestatement mtable get_trxname resultset executequery createtabledatarow mtable currenttimemillis create table data row param rs result set param m table table return true if created private boolean create table data row result set rs m table m table string buffer insert new string buffer insert into append m table get table name append string buffer values new string buffer m column columns m table get columns false for int i 0 i columns length i if i 0 insert append values append m column column columns i string column name column get column name insert append column name int dt column getad reference id try object value rs get object column name if rs was null values append null else if column name ends with id record id c projecttype defined as button display type is numeric dt display type isid dt column name equals ad language big decimal bd rs get big decimal column name string s m dbtarget to number bd dt values append s else if display type is date dt timestamp ts rs get timestamp column name string ts string m dbtarget to date ts dt display type date values append ts string else if display type islob dt ignored values append null else if display type is text dt dt display type yes no dt display type list dt display type button column name equals ad language string s rs get string column name values append db to string s else log warning unknown display type dt value value get class get name values append nu ll catch exception e log log level severe column name e for all columns insert append values append values append return execute commands new string insert to string m conn false false do not convert as text is converted mtable createtabledatarow resultset m_table mtable stringbuffer stringbuffer mtable gettablename stringbuffer stringbuffer m_column mtable getcolumns m_column columnname getcolumnname columnname getad_reference_id getobject columnname wasnull columnname endswith _id record_id c_projecttype displaytype isnumeric displaytype columnname ad_language bigdecimal getbigdecimal columnname m_dbtarget to_number displaytype isdate gettimestamp columnname tsstring m_dbtarget to_date displaytype tsstring displaytype displaytype istext displaytype yesno displaytype displaytype columnname ad_language getstring columnname to_string displaytype getclass getname null columnname executecommands tostring m_conn enable constraints param list list return true if constraints enabled created private boolean enable constraints array list list log info return false enableconstraints arraylist private void database build build script string file name c compiere compiere all2 db database database build sql file file new file file name if file exists log severe no file file name file reader reader new file reader file databasebuild filename databasebuild filename filename filereader filereader get connection param as system if true execute as db system administrator return connection or null private connection get connection boolean as system boolean create new if create new m conn null return m conn string db url m dbtarget get connectionurl m databasehost m databaseport as system m dbtarget get system database m databasename m databasename as system m dbtarget get system user m compiereuser try if as system m conn m dbtarget get driver connection db url m dbtarget get system user m systempassword else m conn m dbtarget get driver connection db url m compiereuser m compierepassword catch exception e log log level severe db url e return m conn assystem getconnection assystem createnew createnew m_conn m_conn dburl m_dbtarget getconnectionurl m_databasehost m_databaseport assystem m_dbtarget getsystemdatabase m_databasename m_databasename assystem m_dbtarget getsystemuser m_compiereuser assystem m_conn m_dbtarget getdriverconnection dburl m_dbtarget getsystemuser m_systempassword m_conn m_dbtarget getdriverconnection dburl m_compiereuser m_compierepassword dburl m_conn execute commands param cmds array of sql commands param conn connection param batch tf true commit as batch param do convert convert to db specific notation return true if success private boolean execute commands string cmds connection conn boolean batch boolean do convert if cmds null cmds length 0 log warning no commands return false statement stmt null string cmd null string cmd original null try if conn null conn get connection false false if conn null return false if conn get auto commit batch conn set auto commit batch stmt conn create statement commands for int i 0 i cmds length i cmd cmds i cmd original cmds i if cmd null cmd length 0 continue if cmd index of 1 cmd util replace cmd system password m systempassword cmd util replace cmd compiere user m compiereuser cmd util replace cmd compiere password m compierepassword cmd util replace cmd system password m systempassword cmd util replace cmd database name m databasename if m databasedevice null cmd util replace cmd database device m databasedevice if do convert cmd m dbtarget convert statement cmd write log cmd log finer cmd int no stmt execute update cmd log finest no stmt close stmt null if batch conn commit return true catch exception e string msg e get message if msg null msg length 0 msg e to string msg if e instanceof sql exception msg state sql exception e getsql state error code sql exception e get error code msg if cmd original null cmd original equals cmd msg cmd original msg n cmd log log level severe msg error clean up try if stmt null stmt close catch sql exception e1 log log level severe close statement e1 stmt null return false doconvert executecommands doconvert cmdoriginal getconnection getautocommit setautocommit createstatement cmdoriginal indexof systempassword m_systempassword compiereuser m_compiereuser compierepassword m_compierepassword systempassword m_systempassword databasename m_databasename m_databasedevice databasedevice m_databasedevice doconvert m_dbtarget convertstatement writelog executeupdate getmessage tostring sqlexception sqlexception getsqlstate errorcode sqlexception geterrorcode cmdoriginal cmdoriginal cmdoriginal sqlexception write to file log param cmd cmd private void write log string cmd try if m writer null file file file create temp file create log m writer new print writer new file writer file log info file to string m writer println cmd m writer flush catch exception e log severe e to string writelog m_writer createtempfile m_writer printwriter filewriter tostring m_writer m_writer tostring create db param args public static void main string args compiere startup true c log mgt set level level fine c log mgt set logger level level fine null c uom conversion i bankstatement sybase begin vpj cd e evolution 03 03 2005 postgresql postgresql create compiere cc new create compiere database db sybase dev2 0 cc set compiere user adempiere adempiere cc set database name adempiere adempiere create compiere cc new create compiere database db postgresql vpj 5432 postgres cc set compiere user adempiere adempiere cc set database name adempiere adempiere end begin vpj cd e evolution 03 03 2005 postgresql if cc test connection return cc clean start cc copy null false cc copy table name c rfqresponselineqty false clogmgt setlevel clogmgt setloggerlevel c_uom_conversion i_bankstatement createcompiere createcompiere db_sybase setcompiereuser setdatabasename createcompiere createcompiere db_postgresql setcompiereuser setdatabasename testconnection cleanstart tablename c_rfqresponselineqty constructor param title title param ad process id ad process id param table id ad table id param record id record id public process info string title int ad process id int table id int record id set title title setad process id ad process id settable id table id setrecord id record id ad_process_id ad_process_id table_id ad_table_id record_id record_id processinfo ad_process_id table_id record_id settitle setad_process_id ad_process_id settable_id table_id setrecord_id record_id constructor param title title param ad process id ad process id public process info string title int ad process id this title ad process id 0 0 ad_process_id ad_process_id processinfo ad_process_id ad_process_id string representation return string representation public string to string string buffer sb new string buffer process info sb append m title append process id append m ad process id if m ad pinstance id 0 sb append ad pinstance id append m ad pinstance id if m record id 0 sb append record id append m record id if m classname null sb append class name append m classname sb append error append is error if m transientobject null sb append transient append m transientobject if m serializableobject null sb append serializable append m serializableobject sb append summary append get summary append log append m logs null 0 m logs size append get log info false sb append return sb to string tostring stringbuffer stringbuffer processinfo m_title process_id m_ad_process_id m_ad_pinstance_id ad_pinstance_id m_ad_pinstance_id m_record_id record_id m_record_id m_classname classname m_classname iserror m_transientobject m_transientobject m_serializableobject m_serializableobject getsummary m_logs m_logs getloginfo tostring set summary param summary summary will be translated public void set summary string summary m summary summary setsummary m_summary set summary method get summary return string public string get summary return util clean amp m summary setsummary getsummary getsummary cleanamp m_summary method set summary param translated summary string param error boolean public void set summary string translated summary boolean error set summary translated summary set error error setsummary translatedsummary setsummary translatedsummary setsummary translatedsummary seterror set summary method add summary param additional summary string public void add summary string additional summary m summary additional summary setsummary addsummary additionalsummary addsummary additionalsummary m_summary additionalsummary method set error param error boolean public void set error boolean error m error error seterror seterror m_error set error method is error return boolean public boolean is error return m error seterror iserror iserror m_error set log of process pre translated process message list of log entries date number msg pre param html if true with html markup return log info public string get log info boolean html if m logs null return string buffer sb new string buffer simple date format date format display type get date format display type date time if html sb append table width 100 border 1 cellspacing 0 cellpadding 2 for int i 0 i m logs size i if html sb append tr else if i 0 sb append n process info log log process info log m logs get i if log getp id 0 sb append html td append log getp id append html td t if log getp date null sb append html td append date format format log getp date append html td t if log getp number null sb append html td append log getp number append html td t if log getp msg null sb append html td append msg parse translation env get ctx log getp msg append html td if html sb append tr if html sb append table return sb to string getloginfo m_logs stringbuffer stringbuffer simpledateformat dateformat displaytype getdateformat displaytype datetime m_logs processinfolog processinfolog m_logs getp_id getp_id getp_date dateformat getp_date getp_number getp_number getp_msg parsetranslation getctx getp_msg tostring get ascii log info return log info public string get log info return get log info false getloginfo getloginfo method getad pinstance id return int public int getad pinstance id return m ad pinstance id getad_pinstance_id getad_pinstance_id m_ad_pinstance_id method setad pinstance id param ad pinstance id int public void setad pinstance id int ad pinstance id m ad pinstance id ad pinstance id setad_pinstance_id ad_pinstance_id setad_pinstance_id ad_pinstance_id m_ad_pinstance_id ad_pinstance_id method getad process id return int public int getad process id return m ad process id getad_process_id getad_process_id m_ad_process_id method setad process id param ad process id int public void setad process id int ad process id m ad process id ad process id setad_process_id ad_process_id setad_process_id ad_process_id m_ad_process_id ad_process_id method get class name return string or null public string get class name return m classname getclassname getclassname m_classname method set class name param class name string public void set class name string class name m classname class name if m classname null m classname length 0 m classname null setclassname classname setclassname classname m_classname classname m_classname m_classname m_classname method get transient object return object public object get transient object return m transientobject gettransientobject gettransientobject m_transientobject method set transient object param transient object object public void set transient object object transient object m transientobject transient object settransientobject transientobject settransientobject transientobject m_transientobject transientobject method get serializable object return serializable public serializable get serializable object return m serializableobject getserializableobject getserializableobject m_serializableobject method set serializable object param serializable object serializable public void set serializable object serializable serializable object m serializableobject serializable object setserializableobject serializableobject setserializableobject serializableobject m_serializableobject serializableobject method get est seconds return int public int get est seconds return m estseconds getestseconds getestseconds m_estseconds method set est seconds param est seconds int public void set est seconds int est seconds m estseconds est seconds setestseconds estseconds setestseconds estseconds m_estseconds estseconds method gettable id return int public int gettable id return m table id gettable_id gettable_id m_table_id method settable id param ad table id int public void settable id int ad table id m table id ad table id settable_id ad_table_id settable_id ad_table_id m_table_id ad_table_id method getrecord id return int public int getrecord id return m record id getrecord_id getrecord_id m_record_id method setrecord id param record id int public void setrecord id int record id m record id record id setrecord_id record_id setrecord_id record_id m_record_id record_id method get title return string public string get title return m title gettitle gettitle m_title method set title param title string public void set title string title m title title settitle settitle m_title method setad client id param ad client id int public void setad client id int ad client id m ad client id new integer ad client id setad_client_id ad_client_id setad_client_id ad_client_id m_ad_client_id ad_client_id method getad client id return integer public integer getad client id return m ad client id getad_client_id getad_client_id m_ad_client_id method setad user id param ad user id int public void setad user id int ad user id m ad user id new integer ad user id setad_user_id ad_user_id setad_user_id ad_user_id m_ad_user_id ad_user_id method getad user id return integer public integer getad user id return m ad user id getad_user_id getad_user_id m_ad_user_id get parameter return parameter array public process info parameter get parameter return m parameter processinfoparameter getparameter m_parameter set parameter param parameter parameter array public void set parameter process info parameter parameter m parameter parameter setparameter processinfoparameter m_parameter add to log param log id log id param p id process id param p date process date param p number process number param p msg process message public void add log int log id int p id timestamp p date big decimal p number string p msg add log new process info log log id p id p date p number p msg log_id p_id p_date p_number p_msg addlog log_id p_id p_date bigdecimal p_number p_msg addlog processinfolog log_id p_id p_date p_number p_msg add to log param p id process id param p date process date param p number process number param p msg process message public void add log int p id timestamp p date big decimal p number string p msg add log new process info log p id p date p number p msg p_id p_date p_number p_msg addlog p_id p_date bigdecimal p_number p_msg addlog processinfolog p_id p_date p_number p_msg add to log param log entry log entry public void add log process info log log entry if log entry null return if m logs null m logs new array list process info log m logs add log entry logentry addlog processinfolog logentry logentry m_logs m_logs arraylist processinfolog m_logs logentry method get logs return process info log public process info log get logs if m logs null return null process info log logs new process info log m logs size m logs to array logs return logs getlogs processinfolog processinfolog getlogs m_logs processinfolog processinfolog m_logs m_logs toarray method geti ds return int public int geti ds if m logs null return null int ids new int m logs size for int i 0 i m logs size i ids i process info log m logs get i getp id return ids getids getids m_logs m_logs m_logs processinfolog m_logs getp_id method get log list return array list protected array list get log list return m logs getloglist arraylist arraylist getloglist m_logs method set log list param logs array list protected void set log list array list process info log logs m logs logs setloglist arraylist setloglist arraylist processinfolog m_logs jdbc based buffered table param ctx properties param table name table name param window no window no param tab no tab no param with access control if true adds ad client org restrictuins public m table properties ctx int ad table id string table name int window no int tab no boolean with access control super log info table name m ctx ctx m ad table id ad table id set table name table name m windowno window no m tabno tab no m withaccesscontrol with access control tablename windowno tabno withaccesscontrol ad_client mtable ad_table_id tablename windowno tabno withaccesscontrol tablename m_ctx m_ad_table_id ad_table_id settablename tablename m_windowno windowno m_tabno tabno m_withaccesscontrol withaccesscontrol set table name param new table name table name public void set table name string new table name if m open log log level severe table already open ignored return if new table name null new table name length 0 return m tablename new table name newtablename settablename newtablename m_open newtablename newtablename m_tablename newtablename get table name return table name public string get table name return m tablename gettablename m_tablename set where clause w o the where and w o history param new where clause sql where clause param only current rows only current rows param only current days how many days back for current return true if where clase set public boolean set select where clause string new where clause boolean only current rows int only current days if m open log log level severe table already open ignored return false m whereclause new where clause m onlycurrentrows only current rows m onlycurrentdays only current days if m whereclause null m whereclause return true newwhereclause onlycurrentrows onlycurrentdays setselectwhereclause newwhereclause onlycurrentrows onlycurrentdays m_open m_whereclause newwhereclause m_onlycurrentrows onlycurrentrows m_onlycurrentdays onlycurrentdays m_whereclause m_whereclause get record set where clause w o the where and w o history return where clause public string get select where clause return m whereclause getselectwhereclause m_whereclause is history displayed return true if history displayed public boolean is only current rows displayed return m onlycurrentrows isonlycurrentrowsdisplayed m_onlycurrentrows set order clause w o the order by param new order clause sql order by clause public void set order clause string new order clause m orderclause new order clause if m orderclause null m orderclause neworderclause setorderclause neworderclause m_orderclause neworderclause m_orderclause m_orderclause get order clause w o the order by return order by clause public string get order clause return m orderclause getorderclause m_orderclause assemble store m sql and m countsql return m sql private string create select sql if m fields size 0 m tablename null m tablename equals return create select part string buffer select new string buffer select for int i 0 i m fields size i if i 0 select append m field field m field m fields get i select append field get columnsql true column name or virtual column select append from append m tablename m sql select select to string m sql count select count from m tablename string buffer where new string buffer where if m whereclause length 0 where append where if m whereclause index of 1 where append m whereclause else replace variables where append env parse context m ctx m windowno m whereclause false if m onlycurrentrows m tabno 0 if where to string index of where 1 where append where else where append and show only unprocessed or the one updated within x days where append processed n or updated if db is sybase where append dateadd dd 1 getdate else where append sys date 1 where append ro rw access m sql m sql select where to string m sql count where to string if m withaccesscontrol boolean ro m role sql ro if m readonly ro m role sql rw m sql m role get default m ctx false add accesssql m sql m tablename m role sql fullyqualified m role sql ro m sql count m role get default m ctx false add accesssql m sql count m tablename m role sql fullyqualified m role sql ro order by if m orderclause equals m sql order by m orderclause log fine m sql count env set context m ctx m windowno m tabno sql m sql return m sql m_sql m_countsql m_sql createselectsql m_fields m_tablename m_tablename stringbuffer stringbuffer m_fields mfield mfield m_fields getcolumnsql columnname m_tablename m_sql_select tostring m_sql_count m_tablename stringbuffer stringbuffer m_whereclause m_whereclause indexof m_whereclause parsecontext m_ctx m_windowno m_whereclause m_onlycurrentrows m_tabno tostring indexof issybase sysdate m_sql m_sql_select tostring m_sql_count tostring m_withaccesscontrol mrole sql_ro m_readonly mrole sql_rw m_sql mrole getdefault m_ctx addaccesssql m_sql m_tablename mrole sql_fullyqualified mrole sql_ro m_sql_count mrole getdefault m_ctx addaccesssql m_sql_count m_tablename mrole sql_fullyqualified mrole sql_ro m_orderclause m_sql m_orderclause m_sql_count setcontext m_ctx m_windowno m_tabno m_sql m_sql add field to table param field field public void add field m field field log fine m tablename field get column name if m open log log level severe table already open ignored field get column name return if m role get default m ctx false is column access m ad table id field getad column id true log fine no column access field get column name return set index for key column if field is key m indexkeycolumn m fields size else if field get column name equals is active m indexactivecolumn m fields size else if field get column name equals processed m indexprocessedcolumn m fields size else if field get column name equals ad client id m indexclientcolumn m fields size else if field get column name equals ad org id m indexorgcolumn m fields size m fields add field addfield mfield m_tablename getcolumnname m_open getcolumnname mrole getdefault m_ctx iscolumnaccess m_ad_table_id getad_column_id getcolumnname iskey m_indexkeycolumn m_fields getcolumnname isactive m_indexactivecolumn m_fields getcolumnname m_indexprocessedcolumn m_fields getcolumnname ad_client_id m_indexclientcolumn m_fields getcolumnname ad_org_id m_indexorgcolumn m_fields m_fields returns database column name param index the column being queried return column name public string get column name int index if index 0 index m fields size log log level severe invalid index index return m field field m field m fields get index return field get column name getcolumnname m_fields mfield mfield m_fields getcolumnname returns a column given its name param column name string containing name of column to be located return the column index with code column name code or 1 if not found public int find column string column name for int i 0 i m fields size i m field field m field m fields get i if column name equals field get column name return i return 1 columnname columnname findcolumn columnname m_fields mfield mfield m_fields columnname getcolumnname returns class of database column field param index the column being queried return the class public class get column class int index if index 0 index m fields size log log level severe invalid index index return null m field field m field m fields get index return display type get class field get display type false getcolumnclass m_fields mfield mfield m_fields displaytype getclass getdisplaytype set select clause parameter assumes that you set parameters starting from index zero param index index param parameter parameter public void set parameterselect int index object parameter if index m parameterselect size m parameterselect add parameter else m parameterselect set index parameter setparameterselect m_parameterselect m_parameterselect m_parameterselect set where clause parameter assumes that you set parameters starting from index zero param index index param parameter parameter public void set parameterwhere int index object parameter if index m parameterwhere size m parameterwhere add parameter else m parameterwhere set index parameter setparameterwhere m_parameterwhere m_parameterwhere m_parameterwhere get column at index param index index return m field protected m field get field int index if index 0 index m fields size return null return m field m fields get index mfield mfield getfield m_fields mfield m_fields return columns with indentifier column name param identifier column name return m field protected m field get field string identifier if identifier null identifier length 0 return null int cols m fields size for int i 0 i cols i m field field m field m fields get i if identifier equals ignore case field get column name return field log log level severe get field not found identifier return null columnname mfield mfield getfield m_fields mfield mfield m_fields equalsignorecase getcolumnname getfield get all fields return m fields public m field get fields m field ret value new m field m fields size m fields to array ret value return ret value mfields mfield getfields mfield retvalue mfield m_fields m_fields toarray retvalue retvalue open database if already opened data is refreshed return true if success public boolean open log info if m open log fine already open data refresh all return true create m sql and m countsql create select sql if m sql null m sql equals log log level severe no sql return false start loading m loader new loader m rowcount m loader open m buffer new array list object m rowcount 10 m sort new array list m sort m rowcount 10 if m rowcount 0 m loader start else m loader close m open true m changed false m rowchanged 1 return true m_open datarefreshall m_sql m_countsql createselectsql m_sql m_sql m_loader m_rowcount m_loader m_buffer arraylist m_rowcount m_sort arraylist msort m_rowcount m_rowcount m_loader m_loader m_open m_changed m_rowchanged wait until async loader of table and lookup fields is complete used for performance tests public void load complete wait for loader if m loader null if m loader is alive try m loader join catch interrupted exception ie log log level severe join interrupted ie wait for field lookup loaders for int i 0 i m fields size i m field field m field m fields get i field lookup load complete loadcomplete m_loader m_loader isalive m_loader interruptedexception m_fields mfield mfield m_fields lookuploadcomplete is loading return true if loading public boolean is loading if m loader null m loader is alive return true return false isloading m_loader m_loader isalive is it open return true if opened public boolean is open return m open isopen m_open close resultset param final call final call public void close boolean final call if m open return log fine final final call remove listeners if final call data status listener evl data status listener listener list get listeners data status listener class for int i 0 i evl length i listener list remove data status listener class evl i table model listener ev2 table model listener listener list get listeners table model listener class for int i 0 i ev2 length i listener list remove table model listener class ev2 i vetoable change listener vcl m vetoablechangesupport get vetoable change listeners for int i 0 i vcl length i m vetoablechangesupport remove vetoable change listener vcl i stop loader while m loader null m loader is alive log fine interrupting loader m loader interrupt try thread sleep 200 2 second catch interrupted exception ie if m inserting data save false not manual if m buffer null m buffer clear m buffer null if m sort null m sort clear m sort null if final call dispose fields are disposed from m tab log fine m open false finalcall finalcall m_open finalcall finalcall datastatuslistener datastatuslistener listenerlist getlisteners datastatuslistener listenerlist datastatuslistener tablemodellistener tablemodellistener listenerlist getlisteners tablemodellistener listenerlist tablemodellistener vetoablechangelistener m_vetoablechangesupport getvetoablechangelisteners m_vetoablechangesupport removevetoablechangelistener m_loader m_loader isalive m_loader interruptedexception m_inserting datasave m_buffer m_buffer m_buffer m_sort m_sort m_sort finalcall mtab m_open dispose m table called by close final private void dispose m fields for int i 0 i m fields size i m field m fields get i dispose m fields clear m fields null m vetoablechangesupport null m parameterselect clear m parameterselect null m parameterwhere clear m parameterwhere null clear data arrays m buffer null m sort null m rowdata null m oldvalue null m loader null mtable mfields m_fields mfield m_fields m_fields m_fields m_vetoablechangesupport m_parameterselect m_parameterselect m_parameterwhere m_parameterwhere m_buffer m_sort m_rowdata m_oldvalue m_loader get total database column count displayed and not displayed return column count public int get column count return m fields size getcolumncount m_fields get displayed field count return field count public int get field count return m fields size getfieldcount m_fields return number of rows return number of rows or 0 if not opened public int get row count return m rowcount getrowcount m_rowcount set the column to determine the color of the row param column name column name public void set color column string column name m indexcolorcolumn find column column name columnname setcolorcolumn columnname m_indexcolorcolumn findcolumn columnname get color code for row pre if numerical value in compare column is negative 1 positive 1 otherwise 0 pre see set color column param row row return color code public int get color code int row if m indexcolorcolumn 1 return 0 object data get value at row m indexcolorcolumn we need to have a number if data null data instanceof big decimal return 0 big decimal bd big decimal data return bd signum colorcode setcolorcolumn getcolorcode m_indexcolorcolumn getvalueat m_indexcolorcolumn bigdecimal bigdecimal bigdecimal sort entries by column actually the rows are not sorted just the access pointer array list with the same size as m buffer with m sort entities param col col param ascending ascending suppress warnings unchecked public void sort int col boolean ascending log info col ascending if get row count 0 return m field field get field col rowi ds are not sorted if field get display type display type rowid return boolean is lookup display type is lookup field get display type boolean isasi display type p attribute field get display type fill m sort entities with data entity for int i 0 i m sort size i m sort sort m sort m sort get i object row data object m buffer get sort index if row data col null sort data null else if is lookup isasi sort data field get lookup get display row data col lookup else sort data row data col data log info field to string m sort size sort it m sort sort new m sort 0 null sort set sort asc ascending collections sort m sort sort update ui fire table data changed info detected by m tab data status changed and current row set to 0 fire data statusi event sorted m sort size arraylist m_buffer msort suppresswarnings getrowcount mfield getfield rowids getdisplaytype displaytype islookup displaytype islookup getdisplaytype displaytype pattribute getdisplaytype msort m_sort msort msort m_sort rowdata m_buffer rowdata islookup getlookup getdisplay rowdata rowdata tostring m_sort msort msort setsortasc m_sort firetabledatachanged mtab datastatuschanged firedatastatusievent m_sort get key id or 1 of none param row row return id or 1 public int get keyid int row log info m table get keyid row row key col idx m indexkeycolumn if m indexkeycolumn 1 try integer ii integer get value at row m indexkeycolumn if ii null return 1 return ii int value catch exception e alpha key return 1 return 1 getkeyid mtable getkeyid keycolidx m_indexkeycolumn m_indexkeycolumn getvalueat m_indexkeycolumn intvalue get key column name return key column name public string get key column name if m indexkeycolumn 1 return get column name m indexkeycolumn return columnname getkeycolumnname m_indexkeycolumn getcolumnname m_indexkeycolumn get value in resultset param row row param col col return object of that row column public object get value at int row int col log config m table get value at r row c col if m open row 0 col 0 row m rowcount log fine out of bounds open m open row count m rowcount return null need to wait for data read into buffer int loops 0 while row m buffer size m loader is alive loops 15 log fine waiting for loader row row size m buffer size try thread sleep 500 1 2 second catch interrupted exception ie loops empty buffer if row m buffer size log fine empty buffer return null return data item m sort sort m sort m sort get row object row data object m buffer get sort index out of bounds if row data null col row data length log fine no data or column out of bounds return null return row data col getvalueat mtable getvalueat m_open m_rowcount m_open rowcount m_rowcount m_buffer m_loader isalive m_buffer interruptedexception m_buffer msort msort m_sort rowdata m_buffer rowdata rowdata rowdata indicate that there will be a change param changed changed public void set changed boolean changed can we edit if m open m readonly return indicate change m changed changed if changed m rowchanged 1 if changed fire data statusi event setchanged m_open m_readonly m_changed m_rowchanged firedatastatusievent set value in data and update m field called directly or from j table editing stopped param value value to assign to cell param row row index of cell param col column index of cell public final void set value at object value int row int col set value at value row col false mfield jtable editingstopped setvalueat setvalueat set value in data and update m field called directly or from j table editing stopped param value value to assign to cell param row row index of cell param col column index of cell param force force setting new value public final void set value at object value int row int col boolean force can we edit if m open m readonly not accessible row 0 col 0 invalid index col 0 cannot change id m rowcount 0 no rows log finest r row c col r o m readonly rows m rowcount ignored return data save row false has anything changed object old value get value at row col if force old value null value null old value null old value equals value old value null value null old value to string equals value to string log finest r row c col new value old old value ignored return log fine r row c col value old value save old value m oldvalue new object 3 m oldvalue 0 new integer row m oldvalue 1 new integer col m oldvalue 2 old value set data item m sort sort m sort m sort get row object row data object m buffer get sort index m rowchanged row selection if col 0 row data col value m buffer set sort index row data return save original value shallow copy if m rowdata null int size m fields size m rowdata new object size for int i 0 i size i m rowdata i row data i save update row data col value m buffer set sort index row data update table fire table cell updated row col update m field m field field get field col field set value value m inserting inform data status event evt createdse evt set changed column col fire data status changed evt mfield jtable editingstopped setvalueat m_open m_readonly m_rowcount m_readonly m_rowcount datasave oldvalue getvalueat oldvalue oldvalue oldvalue oldvalue oldvalue tostring tostring oldvalue oldvalue m_oldvalue m_oldvalue m_oldvalue m_oldvalue oldvalue msort msort m_sort rowdata m_buffer m_rowchanged rowdata m_buffer rowdata m_rowdata m_fields m_rowdata m_rowdata rowdata rowdata m_buffer rowdata firetablecellupdated mfield mfield getfield setvalue m_inserting datastatusevent setchangedcolumn firedatastatuschanged get old value param row row param col col return old value public object get old value int row int col if m oldvalue null return null if integer m oldvalue 0 int value row integer m oldvalue 1 int value col return m oldvalue 2 return null getoldvalue m_oldvalue m_oldvalue intvalue m_oldvalue intvalue m_oldvalue check if the current row needs to be saved param only real change if true the value of a field was actually changed e g for new records which have not been changed default false return true it needs to be saved public boolean need save boolean only real change return need save m rowchanged only real change onlyrealchange needsave onlyrealchange needsave m_rowchanged onlyrealchange check if the row needs to be saved only if nothing was changed return true it needs to be saved public boolean need save return need save m rowchanged false needsave needsave m_rowchanged check if the row needs to be saved only when row changed only if nothing was changed param new row to check return true it needs to be saved public boolean need save int new row return need save new row false newrow needsave newrow needsave newrow check if the row needs to be saved only when row changed only if nothing was changed param new row to check param only real change if true the value of a field was actually changed e g for new records which have not been changed default false return true it needs to be saved public boolean need save int new row boolean only real change log fine row new row changed m rowchanged m changed m rowchanged set in set value at nothing done if m changed m rowchanged 1 return false e g new unchanged records if m changed m rowchanged 1 only real change return false same row if new row m rowchanged return false return true newrow onlyrealchange needsave newrow onlyrealchange newrow m_rowchanged m_changed m_rowchanged setvalueat m_changed m_rowchanged m_changed m_rowchanged onlyrealchange newrow m_rowchanged check if it needs to be saved and save it param new row row param manual cmd manual command to save return true if not needed to be saved or successful saved public boolean data save int new row boolean manual cmd log fine row new row changed m rowchanged m changed m rowchanged set in set value at nothing done if m changed m rowchanged 1 return true same row don t save yet if new row m rowchanged return true return data save manual cmd save ok newrow manualcmd datasave newrow manualcmd newrow m_rowchanged m_changed m_rowchanged setvalueat m_changed m_rowchanged newrow m_rowchanged datasave manualcmd save_ok save unconditional param manual cmd if true no vetoable property change will be fired for save confirmation return ok or error condition error info access fill mandatory save error not unique save error row not found save error data changed is saved in the log public char data save boolean manual cmd cannot save if m open log warning error open m open return save error no need not changed row not positioned no value changed if m rowchanged 1 log config no need changed m changed row m rowchanged return save error if manual cmd return save ok value not changed if m rowdata null log fine no changes return save error if m readonly if processed not editable find always editable ok for changing payment terms etc log warning is read only ignored data ignore return save access row not positioned no value changed if m rowchanged 1 if m newrow 1 new row and nothing changed might be ok m rowchanged m newrow else fire data statuse event save error no change false return save error can we change int co get client org m rowchanged int ad client id co 0 int ad org id co 1 if m role get default m ctx false can update ad client id ad org id m ad table id 0 true fire data statuse event c logger retrieve error data ignore return save access log info row m rowchanged inform about data save action if not manually initiated try if manual cmd m vetoablechangesupport fire vetoable change property 0 m rowchanged catch property veto exception pve log warning pve get message data ignore return save abort get updated row data m sort sort m sort m sort get m rowchanged object row data object m buffer get sort index check mandatory string missing columns get mandatory row data if missing columns length 0 trace print stack false false fire data statuse event fill mandatory missing columns n true return save mandatory update row int record id 0 if m inserting record id get keyid m rowchanged try if m tablename ends with trl translation tables have no model return data savepo record id catch exception e if e instanceof class not found exception log warning m tablename e get localized message else log log level severe persistency issue m tablename e get localized message e return save error manual update of row i e not via po class log info nonpo boolean error false lob reset string is null final string error error final string info info update sql with specific where clause string buffer select new string buffer select for int i 0 i m fields size i m field field m field m fields get i if field is virtual column continue if i 0 select append select append field get columnsql true column name or virtual column select append from append m tablename string buffer single rowwhere new string buffer string buffer multi rowwhere new string buffer create sql rowid if m inserting select append where 1 2 else for update causes ora 01002 fetch out of sequence select append where append get where clause row data prepared statement pstmt null try pstmt db prepare statement select to string result set type scroll sensitive result set concur updatable null result set rs pstmt execute query only one row if m inserting rs next rs close pstmt close fire data statuse event save error row not found true data refresh m rowchanged return save error object row datadb null prepare boolean manual update result set concur read only rs get concurrency if db is remote objects manual update true if manual update create update sql reset if m inserting if manual update log fine prepare inserting manual else log fine prepare inserting row set rs move to insert row else log fine prepare updating manual manual update get current data in db row datadb read data rs data m rowdata original data row data updated data row datadb current data in db 1 difference between original updated data n next 2 difference between original current data y don t update 3 update current data 4 refresh to get last data changed by trigger constants for created updated by timestamp now new timestamp system current time millis int user env get context as int m ctx ad user id for every column int size m fields size int col rs 1 for int col 0 col size col m field field m field m fields get col if field is virtual column continue string column name field get column name log fine column name m rowdata col db row datadb col row data col rowid virtual column if field get display type display type rowid field is virtual column ignore new key else if field is key m inserting if column name ends with id column name to upper case ends with id int insertid db get nextid m ctx m tablename null no trx if manual update create update sql column name string value of insertid else rs update int col rs insertid single rowwhere append column name append append insertid is info column name insertid key else key with string value string str row data col to string if manual update create update sql column name db to string str else rs update string col rs str single rowwhere new string buffer overwrite single rowwhere append column name append append db to string str is info column name str string key log fine is new key new document no else if column name equals document no boolean new doc no false string doc no string row data col we need to have a doc number if doc no null doc no length 0 new doc no true preliminary id from callout system else if doc no starts with doc no ends with new doc no true if new doc no m inserting string insert doc null always overwrite if insering with mandatory doc type doc no if m inserting insert doc db get document no m ctx m windowno m tablename true null only doc type no trx log fine document no entered doc no doc type insert insert doc new doc no new doc no can we use entered doc no if insert doc null insert doc length 0 if new doc no doc no null doc no length 0 insert doc doc no else get a number from doc type or table insert doc db get document no m ctx m windowno m tablename false null no trx there might not be an automatic document no for this document if insert doc null insert doc length 0 in case db function did not return a value if doc no null doc no length 0 insert doc string row data col else error true is error field get column name row data col no document no log fine is break if manual update create update sql column name db to string insert doc else rs update string col rs insert doc is info column name insert doc doc no log fine is new document no new value key else if column name equals value m inserting string value string row data col get from sequence if not entered if value null value length 0 value db get document no m ctx m windowno m tablename false null no value if value null value length 0 error true is error field get column name row data col no value log fine is break if manual update create update sql column name db to string value else rs update string col rs value is info column name value value log fine is new value key updated check database else if column name equals updated if m comparedb m inserting m rowdata col equals row datadb col changed error true is error field get column name m rowdata col db row datadb col log fine is break if manual update create update sql column name db to date now false else rs update timestamp col rs now is info updated by now user log fine is manualcmd propertychange fillmandatory saveerrornotunique saveerrorrownotfound saveerrordatachanged datasave manualcmd m_open m_open save_error m_rowchanged noneed m_changed m_rowchanged save_error manualcmd save_ok m_rowdata save_error m_readonly isreadonly dataignore save_access m_rowchanged m_newrow m_rowchanged m_newrow firedatastatuseevent saveerrornochange save_error getclientorg m_rowchanged ad_client_id ad_org_id mrole getdefault m_ctx canupdate ad_client_id ad_org_id m_ad_table_id firedatastatuseevent clogger retrieveerror dataignore save_access m_rowchanged manualcmd m_vetoablechangesupport firevetoablechange m_rowchanged propertyvetoexception getmessage dataignore save_abort msort msort m_sort m_rowchanged rowdata m_buffer missingcolumns getmandatory rowdata missingcolumns printstack firedatastatuseevent fillmandatory missingcolumns save_mandatory record_id m_inserting record_id getkeyid m_rowchanged m_tablename endswith _trl datasavepo record_id classnotfoundexception m_tablename getlocalizedmessage m_tablename getlocalizedmessage save_error lobreset stringbuffer stringbuffer m_fields mfield mfield m_fields isvirtualcolumn getcolumnsql columnname m_tablename stringbuffer singlerowwhere stringbuffer stringbuffer multirowwhere stringbuffer m_inserting getwhereclause rowdata preparedstatement preparestatement tostring resultset type_scroll_sensitive resultset concur_updatable resultset executequery m_inserting firedatastatuseevent saveerrorrownotfound datarefresh m_rowchanged save_error rowdatadb manualupdate resultset concur_read_only getconcurrency isremoteobjects manualupdate manualupdate createupdatesqlreset m_inserting manualupdate rowset movetoinsertrow manualupdate rowdatadb readdata m_rowdata rowdata rowdatadb currenttimemillis getcontextasint m_ctx ad_user_id m_fields colrs mfield mfield m_fields isvirtualcolumn columnname getcolumnname columnname m_rowdata rowdatadb rowdata getdisplaytype displaytype isvirtualcolumn iskey m_inserting columnname endswith _id columnname touppercase endswith _id getnextid m_ctx m_tablename manualupdate createupdatesql columnname valueof updateint colrs singlerowwhere columnname columnname rowdata tostring manualupdate createupdatesql columnname to_string updatestring colrs singlerowwhere stringbuffer singlerowwhere columnname to_string columnname stringkey documentno columnname documentno newdocno docno rowdata docno docno newdocno calloutsystem docno startswith docno endswith newdocno newdocno m_inserting insertdoc doctype docno m_inserting insertdoc getdocumentno m_ctx m_windowno m_tablename documentno docno doctypeinsert insertdoc newdocno newdocno docno insertdoc insertdoc newdocno docno docno insertdoc docno doctype insertdoc getdocumentno m_ctx m_windowno m_tablename insertdoc insertdoc docno docno insertdoc rowdata getcolumnname rowdata documentno manualupdate createupdatesql columnname to_string insertdoc updatestring colrs insertdoc columnname insertdoc docno documentno columnname m_inserting rowdata getdocumentno m_ctx m_windowno m_tablename getcolumnname rowdata manualupdate createupdatesql columnname to_string updatestring colrs columnname columnname m_comparedb m_inserting m_rowdata rowdatadb getcolumnname m_rowdata rowdatadb manualupdate createupdatesql columnname to_date updatetimestamp colrs save via po param record id return save error or save ok private char data savepo int record id throws exception log fine id record id m sort sort m sort m sort get m rowchanged object row data object m buffer get sort index m table table m table get m ctx m ad table id po po null if record id 1 po table getpo record id null else multi key po table getpo get where clause row data null no persistent object if po null throw new class not found exception no persistent object int size m fields size for int col 0 col size col m field field m field m fields get col if field is virtual column continue string column name field get column name object value row data col object old value m rowdata col rowid if field get display type display type rowid ignore nothing changed null else if old value null value null ignore data changed else if m inserting old value null value null old value null value null old value equals value changed check existence int po index po get columnindex column name if po index 0 custom fields not in po po set customcolumn column name value log log level severe column not found column name continue object db value po get value po index if m inserting m comparedb original db old value null db value null old value null old value equals db value target db changed by trigger to new value already value null db value null value null value equals db value po set valuenocheck column name value original db else string msg column name old value old value null old value get class get name db db value db value null db value get class get name new value value null value get class get name c log mgt set level level finest po dump fire data statuse event save error data changed msg true data refresh m rowchanged return save error data changed for every column if po save string msg save error string info value name pair pp c logger retrieve error if pp null msg pp get value info pp get name unique constraint exception ex c logger retrieve exception if ex null ex instanceof sql exception sql exception ex get error code 1 msg save error not unique fire data statuse event msg info true return save error refresh update buffer string where clause po get whereclause true log fine reading where clause string buffer refreshsql new string buffer m sql select append where append where clause prepared statement pstmt db prepare statement refreshsql to string null try result set rs pstmt execute query if rs next object row datadb read data rs update buffer m buffer set sort index row datadb fire table rows updated m rowchanged m rowchanged rs close pstmt close pstmt null catch sql exception e try if pstmt null pstmt close pstmt null catch exception ex string msg save error log log level severe refreshsql to string e fire data statuse event msg e get localized message true return save error everything ok m rowdata null m changed false m comparedb true m rowchanged 1 m newrow 1 m inserting false value name pair pp c logger retrieve warning if pp null string msg pp get value string info pp get name fire data statuse event msg info false else pp c logger retrieve info string msg saved string info if pp null msg pp get value info pp get name fire data statusi event msg info log config fini return save ok record_id save_error save_ok datasavepo record_id record_id msort msort m_sort m_rowchanged rowdata m_buffer m_table m_table m_ctx m_ad_table_id record_id record_id getwhereclause rowdata classnotfoundexception m_fields mfield mfield m_fields isvirtualcolumn columnname getcolumnname rowdata oldvalue m_rowdata getdisplaytype displaytype oldvalue m_inserting oldvalue oldvalue oldvalue poindex get_columnindex columnname poindex set_customcolumn columnname columnname dbvalue get_value poindex m_inserting m_comparedb oldvalue dbvalue oldvalue oldvalue dbvalue dbvalue dbvalue set_valuenocheck columnname columnname oldvalue oldvalue oldvalue getclass getname dbvalue dbvalue dbvalue getclass getname getclass getname clogmgt setlevel firedatastatuseevent saveerrordatachanged datarefresh m_rowchanged save_error saveerror valuenamepair clogger retrieveerror getvalue getname clogger retrieveexception sqlexception sqlexception geterrorcode saveerrornotunique firedatastatuseevent save_error whereclause get_whereclause whereclause stringbuffer stringbuffer m_sql_select whereclause preparedstatement preparestatement tostring resultset executequery rowdatadb readdata m_buffer rowdatadb firetablerowsupdated m_rowchanged m_rowchanged sqlexception saveerror tostring firedatastatuseevent getlocalizedmessage save_error m_rowdata m_changed m_comparedb m_rowchanged m_newrow m_inserting valuenamepair clogger retrievewarning getvalue getname firedatastatuseevent clogger retrieveinfo getvalue getname firedatastatusievent save_ok get record where clause from data single key or multi parent param row data data return where clause or null private string get where clause object row data int size m fields size string buffer single rowwhere null string buffer multi rowwhere null for int col 0 col size col m field field m field m fields get col if field is key string column name field get column name object value row data col if value null log log level warning pk data is null column name return null if column name ends with id single rowwhere new string buffer column name append append value else single rowwhere new string buffer column name append append db to string value to string else if field is parent column string column name field get column name object value row data col if value null log log level info fk data is null column name continue if multi rowwhere null multi rowwhere new string buffer else multi rowwhere append and if column name ends with id multi rowwhere append column name append append value else multi rowwhere append column name append append db to string value to string for all columns if single rowwhere null return single rowwhere to string if multi rowwhere null return multi rowwhere to string log log level warning no key found return null rowdata getwhereclause rowdata m_fields stringbuffer singlerowwhere stringbuffer multirowwhere mfield mfield m_fields iskey columnname getcolumnname rowdata columnname columnname endswith _id singlerowwhere stringbuffer columnname singlerowwhere stringbuffer columnname to_string tostring isparentcolumn columnname getcolumnname rowdata columnname multirowwhere multirowwhere stringbuffer multirowwhere columnname endswith _id multirowwhere columnname multirowwhere columnname to_string tostring singlerowwhere singlerowwhere tostring multirowwhere multirowwhere tostring prepare sql creation param column name column name param value value private void create update sql string column name string value m createsqlcolumn add column name m createsqlvalue add value log finest m createsqlcolumn size column name value columnname createupdatesql columnname m_createsqlcolumn columnname m_createsqlvalue m_createsqlcolumn columnname create update insert sql param insert true if insert update otherwise param where clause where clause for update return sql statement private string create update sql boolean insert string where clause string buffer sb new string buffer if insert sb append insert into append m tablename append for int i 0 i m createsqlcolumn size i if i 0 sb append sb append m createsqlcolumn get i sb append values for int i 0 i m createsqlvalue size i if i 0 sb append sb append m createsqlvalue get i sb append else sb append update append m tablename append set for int i 0 i m createsqlcolumn size i if i 0 sb append sb append m createsqlcolumn get i append append m createsqlvalue get i sb append where append where clause log fine sb to string reset create update sql reset return sb to string whereclause createupdatesql whereclause stringbuffer stringbuffer m_tablename m_createsqlcolumn m_createsqlcolumn m_createsqlvalue m_createsqlvalue m_tablename m_createsqlcolumn m_createsqlcolumn m_createsqlvalue whereclause tostring createupdatesqlreset tostring reset update data private void create update sql reset m createsqlcolumn new array list string m createsqlvalue new array list string createupdatesqlreset m_createsqlcolumn arraylist m_createsqlvalue arraylist get mandatory empty columns param row data row data return string with missing column headers labels private string get mandatory object row data see also process parameter save parameter string buffer sb new string buffer check all columns int size m fields size for int i 0 i size i m field field m field m fields get i if field is mandatory true check context if row data i null row data i to string length 0 field set inserting true set editable otherwise deadlock field set error true if sb length 0 sb append sb append field get header else field set error false if sb length 0 return return sb to string rowdata getmandatory rowdata processparameter saveparameter stringbuffer stringbuffer m_fields mfield mfield m_fields ismandatory rowdata rowdata tostring setinserting seterror getheader seterror tostring reset lob info private void lob reset m lobinfo null lobreset m_lobinfo prepare lob save param lob value private void lob add po lob lob log fine lob lob if m lobinfo null m lobinfo new array list po lob m lobinfo add lob lobadd po_lob m_lobinfo m_lobinfo arraylist po_lob m_lobinfo save lob private void lob save string where clause if m lobinfo null return for int i 0 i m lobinfo size i po lob lob po lob m lobinfo get i lob save where clause null for all lo bs lob reset lobsave whereclause m_lobinfo m_lobinfo po_lob po_lob m_lobinfo whereclause lobs lobreset new record after current row param current row row param copy current copy return true if success error info access access cannot insert is saved in the log public boolean data new int current row boolean copy current log info current current row copy copy current read only if m readonly fire data statuse event access cannot insert true return false todo no table level access can view insert m ctx m windowno table level true true fire data status event log retrieve error see if we need to save data save 2 false m inserting true create default data int size m fields size m rowdata new object size original data object row data new object size fill data if copy current m sort sort m sort m sort get current row object orig data object m buffer get sort index for int i 0 i size i m field field m field m fields get i string column name field get column name if field is virtual column else if field is key column name equals ad client id column name starts with created column name starts with updated column name equals entity type column name equals document no column name equals processed column name equals is self service column name equals doc action column name equals doc status column name starts with ref order invoice column name equals grand total column name equals total lines column name equals c cashline id column name equals c payment id column name equals is paid column name equals is allocated begin armen 2006 10 01 patch 1568542 column name equals posted column name equals is reconciled end armen row data i field get default field set value row data i m inserting else row data i orig data i else new for int i 0 i size i m field field m field m fields get i row data i field get default field set value row data i m inserting m changed true m comparedb true m rowchanged 1 only changed in set value at m newrow current row 1 if there is no record the current row could be 0 and not 1 if m buffer size m newrow m newrow m buffer size add data at end of buffer m sort sort new m sort m buffer size null index m buffer add row data add sort pointer m sort add m newrow sort m rowcount inform log fine current current row new m newrow fire table rows inserted m newrow m newrow fire data statusi event copy current update copied inserted log fine current current row new m newrow complete return true currentrow copycurrent accesscannotinsert datanew currentrow copycurrent currentrow copycurrent m_readonly firedatastatuseevent accesscannotinsert tablelevel canviewinsert m_ctx m_windowno tablelevel firedatastatusevent retrieveerror datasave m_inserting m_fields m_rowdata rowdata copycurrent msort msort m_sort currentrow origdata m_buffer mfield mfield m_fields columnname getcolumnname isvirtualcolumn iskey columnname ad_client_id columnname startswith columnname startswith columnname entitytype columnname documentno columnname columnname isselfservice columnname docaction columnname docstatus columnname startswith ref_ columnname grandtotal columnname totallines columnname c_cashline_id columnname c_payment_id columnname ispaid columnname isallocated columnname columnname isreconciled rowdata getdefault setvalue rowdata m_inserting rowdata origdata mfield mfield m_fields rowdata getdefault setvalue rowdata m_inserting m_changed m_comparedb m_rowchanged setvalueat m_newrow currentrow m_buffer m_newrow m_newrow m_buffer msort msort m_buffer m_buffer rowdata m_sort m_newrow m_rowcount currentrow m_newrow firetablerowsinserted m_newrow m_newrow firedatastatusievent copycurrent updatecopied currentrow m_newrow delete data param row row return true if success error info access access not deleteable delete error dependent delete error is saved in the log public boolean data delete int row log info row row if row 0 return false tab r o if m readonly fire data statuse event access cannot delete true previleges return false is this record deletable if m deleteable fire data statuse event access not deleteable true audit return false processed column and not an import table if m indexprocessedcolumn 0 m tablename starts with i boolean processed boolean get value at row m indexprocessedcolumn if processed null processed boolean value fire data statuse event cannot delete trx true return false todo check access fire data status event log retrieve error m sort sort m sort m sort get row object row data object m buffer get sort index m table table m table get m ctx m ad table id po po null int record id get keyid m rowchanged if record id 1 po table getpo record id null else multi key po table getpo get where clause row data null delete via po if po null boolean ok false try ok po delete false catch throwable t log log level severe delete t if ok value name pair vp c logger retrieve error if vp null fire data statuse event vp else fire data statuse event delete error true return false else delete via sql string buffer sql new string buffer delete sql append m tablename append where append get where clause row data int no 0 try globalqss 2005 10 25 error transaction is read only prepared statement pstmt db prepare statement sql to string prepared statement pstmt db prepare statement sql to string result set type scroll insensitive result set concur updatable null end globalqss 2005 10 25 error transaction is read only no pstmt execute update pstmt close catch sql exception e log log level severe sql to string e string msg delete error if e get error code 2292 child record found msg delete error dependent fire data statuse event msg e get localized message true return false check result if no 1 log log level severe number of deleted rows no return false get sort int buffer row sort index delete row in buffer and shifts all below up m buffer remove buffer row m rowcount delete row in sort m sort remove row correct pointer in sort for int i 0 i m sort size i m sort ptr m sort m sort get i if ptr index buffer row ptr index move up inform m changed false m rowchanged 1 fire table rows deleted row row fire data statusi event deleted log fine row row complete return true accessnotdeleteable deleteerrordependent deleteerror datadelete m_readonly firedatastatuseevent accesscannotdelete m_deleteable firedatastatuseevent accessnotdeleteable m_indexprocessedcolumn m_tablename startswith i_ getvalueat m_indexprocessedcolumn booleanvalue firedatastatuseevent cannotdeletetrx firedatastatusevent retrieveerror msort msort m_sort rowdata m_buffer m_table m_table m_ctx m_ad_table_id record_id getkeyid m_rowchanged record_id record_id getwhereclause rowdata valuenamepair clogger retrieveerror firedatastatuseevent firedatastatuseevent deleteerror stringbuffer stringbuffer m_tablename getwhereclause rowdata preparedstatement preparestatement tostring preparedstatement preparestatement tostring resultset type_scroll_insensitive resultset concur_updatable executeupdate sqlexception tostring deleteerror geterrorcode deleteerrordependent firedatastatuseevent getlocalizedmessage bufferrow m_buffer bufferrow m_rowcount m_sort m_sort msort msort m_sort bufferrow m_changed m_rowchanged firetablerowsdeleted firedatastatusievent ignore changes public void data ignore if m inserting m changed m rowchanged 0 log fine nothing to ignore return log info inserting m inserting inserting delete new row if m inserting get sort m sort sort m sort m sort get m newrow int buffer row sort index delete row in buffer and shifts all below up m buffer remove buffer row m rowcount delete row in sort m sort remove m newrow pintint to the last column so no adjustment m changed false m rowdata null m rowchanged 1 m inserting false inform fire table rows deleted m newrow m newrow else update buffer if m rowdata null m sort sort m sort m sort get m rowchanged m buffer set sort index m rowdata m changed false m rowdata null m rowchanged 1 m inserting false inform fire table rows updated m rowchanged m rowchanged messes up display clear selection m newrow 1 fire data statusi event ignored dataignore m_inserting m_changed m_rowchanged m_inserting m_inserting msort msort m_sort m_newrow bufferrow m_buffer bufferrow m_rowcount m_sort m_newrow m_changed m_rowdata m_rowchanged m_inserting firetablerowsdeleted m_newrow m_newrow m_rowdata msort msort m_sort m_rowchanged m_buffer m_rowdata m_changed m_rowdata m_rowchanged m_inserting firetablerowsupdated m_rowchanged m_rowchanged clearselection m_newrow firedatastatusievent refresh row ignore changes param row row public void data refresh int row log info row row if row 0 m sort size 0 m inserting return m sort sort m sort m sort get row object row data object m buffer get sort index ignore data ignore create sql string where get where clause row data if where null where length 0 where 1 2 string sql m sql select where where sort m sort m sort get row object row datadb null try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query only one row if rs next row datadb read data rs rs close pstmt close catch sql exception e log log level severe sql e fire table rows updated row row fire data statuse event refresh error sql true return update buffer m buffer set sort index row datadb info m rowdata null m changed false m rowchanged 1 m inserting false fire table rows updated row row fire data statusi event refreshed datarefresh m_sort m_inserting msort msort m_sort rowdata m_buffer dataignore getwhereclause rowdata m_sql_select msort m_sort rowdatadb preparedstatement preparestatement resultset executequery rowdatadb readdata sqlexception firetablerowsupdated firedatastatuseevent refresherror m_buffer rowdatadb m_rowdata m_changed m_rowchanged m_inserting firetablerowsupdated firedatastatusievent refresh all rows ignore changes public void data refresh all log info m inserting false should not happen data ignore close false open info m rowdata null m changed false m rowchanged 1 m inserting false fire table data changed fire data statusi event refreshed datarefreshall m_inserting dataignore m_rowdata m_changed m_rowchanged m_inserting firetabledatachanged firedatastatusievent requery with new where clause param where clause sql where clause param only current rows only current rows param only current days how many days back return true if success public boolean data requery string where clause boolean only current rows int only current days log info where clause only current only current rows close false m onlycurrentdays only current days set select where clause where clause only current rows m onlycurrentdays open info m rowdata null m changed false m rowchanged 1 m inserting false fire table data changed fire data statusi event refreshed return true whereclause whereclause onlycurrentrows onlycurrentdays datarequery whereclause onlycurrentrows onlycurrentdays whereclause onlycurrent onlycurrentrows m_onlycurrentdays onlycurrentdays setselectwhereclause whereclause onlycurrentrows m_onlycurrentdays m_rowdata m_changed m_rowchanged m_inserting firetabledatachanged firedatastatusievent is cell editable is queried from j table before checking v cell editor is cell editable param row the row index being queried param col the column index being queried return true if editable public boolean is cell editable int row int col log fine m table is cell editable row row col col make rows selectable if col 0 return true entire table not editable if m readonly return false key not editable if col m indexkeycolumn return false todo check link columns check column range if col 0 col m fields size return false is active column always editable if no processed exists if col m indexactivecolumn m indexprocessedcolumn 1 return true row if is row editable row return false column return m field m fields get col is editable false jtable vcelleditor iscelleditable iscelleditable mtable iscelleditable m_readonly m_indexkeycolumn m_fields isactive m_indexactivecolumn m_indexprocessedcolumn isroweditable mfield m_fields iseditable is current row editable param row row return true if editable public boolean is row editable int row log fine m table is row editable row row entire table not editable or no row if m readonly row 0 return false if not active not editable if m indexactivecolumn 0 m tabno find s tabno object value get value at row m indexactivecolumn if value instanceof boolean if boolean value boolean value return false else if n equals value return false if processed not editable find always editable if m indexprocessedcolumn 0 m tabno find s tabno object processed get value at row m indexprocessedcolumn if processed instanceof boolean if boolean processed boolean value return false else if y equals processed return false int co get client org row int ad client id co 0 int ad org id co 1 int record id get keyid row return m role get default m ctx false can update ad client id ad org id m ad table id record id false isroweditable mtable isroweditable m_readonly m_indexactivecolumn m_tabno s_tabno getvalueat m_indexactivecolumn booleanvalue m_indexprocessedcolumn m_tabno s_tabno getvalueat m_indexprocessedcolumn booleanvalue getclientorg ad_client_id ad_org_id record_id getkeyid mrole getdefault m_ctx canupdate ad_client_id ad_org_id m_ad_table_id record_id get client org for row param row row return array 0 client 1 org a value of 1 is not defined found private int get client org int row int ad client id 1 if m indexclientcolumn 1 integer ii integer get value at row m indexclientcolumn if ii null ad client id ii int value int ad org id 0 if m indexorgcolumn 1 integer ii integer get value at row m indexorgcolumn if ii null ad org id ii int value return new int ad client id ad org id getclientorg ad_client_id m_indexclientcolumn getvalueat m_indexclientcolumn ad_client_id intvalue ad_org_id m_indexorgcolumn getvalueat m_indexorgcolumn ad_org_id intvalue ad_client_id ad_org_id set entire table as read only param value new read only value public void set read only boolean value log fine read only value m readonly value setreadonly readonly m_readonly is entire table read only return true if read only public boolean is read only return m readonly isreadonly m_readonly is inserting return true if inserting public boolean is inserting return m inserting isinserting m_inserting set compare db if set to false save overwrites the record regardless of db changes when a payment is changed in sales order the payment reversal clears the payment id param comparedb compare db false forces overwrite public void set comparedb boolean comparedb m comparedb comparedb setcomparedb m_comparedb get compare db return false if save overwrites the record regardless of db changes false forces overwrite public boolean get comparedb return m comparedb getcomparedb m_comparedb can table rows be deleted param value new deleteable value public void set deleteable boolean value log fine deleteable value m deleteable value setdeleteable m_deleteable read data from recordset param rs result set return data array private object read data result set rs int size m fields size object row data new object size string column name null int display type 0 types see also m field create default try get row data for int j 0 j size j column info m field field m field m fields get j column name field get column name display type field get display type integer id lookup updated by is a numeric column if display type display type integer display type isid display type column name ends with id column name ends with acct column name equals ad key column name equals ad display column name ends with ated by row data j new integer rs get int j 1 integer if rs was null row data j null number else if display type is numeric display type row data j rs get big decimal j 1 big decimal date else if display type is date display type row data j rs get timestamp j 1 timestamp rowid or key and selection else if display type display type rowid row data j null yes no else if display type display type yes no string str rs get string j 1 if field is encrypted column str string decrypt str row data j new boolean y equals str boolean lob else if display type display type text long object value rs get object j 1 if rs was null row data j null else if value instanceof clob clob lob clob value long length lob length row data j lob get sub string 1 int length string else row data j rs get string j 1 string encrypted if field is encrypted column display type display type yes no row data j decrypt row data j catch sql exception e log log level severe column name dt display type e return row data readdata resultset m_fields rowdata columnname displaytype mfield createdefault mfield mfield m_fields columnname getcolumnname displaytype getdisplaytype updatedby displaytype displaytype displaytype displaytype columnname endswith _id columnname endswith _acct columnname ad_key columnname ad_display columnname endswith atedby rowdata getint wasnull rowdata displaytype isnumeric displaytype rowdata getbigdecimal bigdecimal displaytype isdate displaytype rowdata gettimestamp displaytype displaytype rowdata yesno displaytype displaytype yesno getstring isencryptedcolumn rowdata displaytype displaytype textlong getobject wasnull rowdata rowdata getsubstring rowdata getstring isencryptedcolumn displaytype displaytype yesno rowdata rowdata sqlexception columnname displaytype rowdata encrypt param xx clear data return encrypted value private object encrypt object xx if xx null return null return secure engine encrypt xx secureengine decrypt param yy encrypted data return clear data private object decrypt object yy if yy null return null return secure engine decrypt yy secureengine remove data status listener param l listener public synchronized void remove data status listener data status listener l listener list remove data status listener class l removedatastatuslistener datastatuslistener listenerlist datastatuslistener add data status listener param l listener public synchronized void add data status listener data status listener l listener list add data status listener class l adddatastatuslistener datastatuslistener listenerlist datastatuslistener inform listeners param e event private void fire data status changed data status event e data status listener listeners listener list get listeners data status listener class for int i 0 i listeners length i listeners i data status changed e firedatastatuschanged datastatusevent datastatuslistener listenerlist getlisteners datastatuslistener datastatuschanged create data status event return data status event private data status event createdse boolean changed m changed if m rowchanged 1 changed true data status event dse new data status event this m rowcount changed env is auto commit m ctx m windowno m inserting dse ad table id m ad table id dse record id null return dse datastatusevent m_changed m_rowchanged datastatusevent datastatusevent m_rowcount isautocommit m_ctx m_windowno m_inserting ad_table_id m_ad_table_id record_id create and fire data status info event param ad message message param info additional info protected void fire data statusi event string ad message string info data status event e createdse e set info ad message info false false fire data status changed e ad_message firedatastatusievent ad_message datastatusevent setinfo ad_message firedatastatuschanged create and fire data status error event param ad message message param info info protected void fire data statuse event string ad message string info boolean is error org compiere util trace print stack data status event e createdse e set info ad message info is error is error if is error log save error ad message info fire data status changed e ad_message firedatastatuseevent ad_message iserror printstack datastatusevent setinfo ad_message iserror iserror iserror saveerror ad_message firedatastatuschanged create and fire data status event from error log param error log error log info protected void fire data statuse event value name pair error log if error log null fire data statuse event error log get value error log get name true errorlog firedatastatuseevent valuenamepair errorlog errorlog firedatastatuseevent errorlog getvalue errorlog getname remove vetoable change listener for row changes param l listener public synchronized void remove vetoable change listener vetoable change listener l m vetoablechangesupport remove vetoable change listener l removevetoablechangelistener vetoablechangelistener m_vetoablechangesupport removevetoablechangelistener add vetoable change listener for row changes param l listener public synchronized void add vetoable change listener vetoable change listener l m vetoablechangesupport add vetoable change listener l addvetoablechangelistener vetoablechangelistener m_vetoablechangesupport addvetoablechangelistener fire vetoable change listener for row changes param e event throws property veto exception protected void fire vetoable change property change event e throws java beans property veto exception m vetoablechangesupport fire vetoable change e propertyvetoexception firevetoablechange propertychangeevent propertyvetoexception m_vetoablechangesupport firevetoablechange to string return string representation public string to string return new string buffer m table append m tablename append window no append m windowno append tab append m tabno append to string tostring tostring stringbuffer mtable m_tablename windowno m_windowno m_tabno tostring construct loader public loader super t loader tloader open result set return number of records protected int open log config m table loader open get number of rows int rows 0 try prepared statement pstmt db prepare statement m sql count null set parameter pstmt true result set rs pstmt execute query if rs next rows rs get int 1 rs close pstmt close catch sql exception e0 zoom query may have invalid where clause if e0 get error code 904 ora 00904 c x id invalid identifier log warning count e0 get localized message nsql m sql count else log log level severe count sql m sql count e0 return 0 open statement closed by loader close try m pstmt db prepare statement m sql null m pstmt set fetch size 20 set parameter m pstmt false m rs m pstmt execute query catch sql exception e log log level severe m sql e return 0 string buffer info new string buffer rows info append rows if rows 0 info append append m sql count log fine info to string return rows resultset mtable preparedstatement preparestatement m_sql_count setparameter resultset executequery getint sqlexception geterrorcode c_x_id getlocalizedmessage m_sql_count m_sql_count m_pstmt preparestatement m_sql m_pstmt setfetchsize setparameter m_pstmt m_rs m_pstmt executequery sqlexception m_sql stringbuffer stringbuffer m_sql_count tostring close rs and statement private void close log config m table loader close try if m rs null m rs close if m pstmt null m pstmt close catch sql exception e log log level severe closers e m rs null m pstmt null mtable m_rs m_rs m_pstmt m_pstmt sqlexception m_rs m_pstmt fill buffer to include row public void run log info if m rs null return try while m rs next if this is interrupted log fine interrupted close return get data object row data read data m rs add data m sort sort new m sort m buffer size null index m buffer add row data m sort add sort statement all 250 rows sleep if m buffer size 250 0 give the other processes a chance try yield sleep 10 01 second catch interrupted exception ie log fine interrupted while sleeping close return data status event evt createdse evt set loading m buffer size fire data status changed evt while rs next catch sql exception e log log level severe run e close fire data statusi event m_rs m_rs isinterrupted rowdata readdata m_rs msort msort m_buffer m_buffer rowdata m_sort m_buffer interruptedexception datastatusevent setloading m_buffer firedatastatuschanged sqlexception firedatastatusievent set parameter for query elements must be integer big decimal string default param pstmt prepared statement param countsql count private void set parameter prepared statement pstmt boolean countsql if m parameterselect size 0 m parameterwhere size 0 return try int pos 1 position in statement select clause parameters for int i 0 countsql i m parameterselect size i object para m parameterselect get i if para null log fine select i para if para null else if para instanceof integer integer ii integer para pstmt set int pos ii int value else if para instanceof big decimal pstmt set big decimal pos big decimal para else pstmt set string pos para to string where clause parameters for int i 0 i m parameterwhere size i object para m parameterwhere get i if para null log fine where i para if para null else if para instanceof integer integer ii integer para pstmt set int pos ii int value else if para instanceof big decimal pstmt set big decimal pos big decimal para else pstmt set string pos para to string catch sql exception e log log level severe parameter e bigdecimal setparameter preparedstatement m_parameterselect m_parameterwhere m_parameterselect m_parameterselect setint intvalue bigdecimal setbigdecimal bigdecimal setstring tostring m_parameterwhere m_parameterwhere setint intvalue bigdecimal setbigdecimal bigdecimal setstring tostring sqlexception basic constructor public noframes basic constructor param element adds an element to the element public noframes element element add element element addelement basic constructor param element adds an element to the element public noframes string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public noframes add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public noframes add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public noframes add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public noframes add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public noframes remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param ctx context param c bankstatementline id id public m bank statement line properties ctx int c bankstatementline id string trx name super ctx c bankstatementline id trx name if c bankstatementline id 0 setc bankstatement id 0 parent setc charge id 0 setc currency id 0 bank acct currency set line 0 sql select nvl max line 0 10 as default value from c bankstatementline where c bankstatement id c bankstatement id set stmt amt env zero set trx amt env zero set interest amt env zero set charge amt env zero set is reversal false set valuta date new timestamp system current time millis statement date set date acct new timestamp system current time millis statement date c_bankstatementline_id mbankstatementline c_bankstatementline_id trxname c_bankstatementline_id trxname c_bankstatementline_id setc_bankstatement_id setc_charge_id setc_currency_id setline defaultvalue c_bankstatementline c_bankstatement_id c_bankstatement_id setstmtamt settrxamt setinterestamt setchargeamt setisreversal setvalutadate currenttimemillis statementdate setdateacct currenttimemillis statementdate load constructor param ctx context param rs result set public m bank statement line properties ctx result set rs string trx name super ctx rs trx name mbankstatementline resultset trxname trxname parent constructor param statement bank statement that the line is part of public m bank statement line m bank statement statement this statement get ctx 0 statement get trxname set client org statement setc bankstatement id statement getc bankstatement id set statement line date statement get statement date mbankstatementline mbankstatement getctx get_trxname setclientorg setc_bankstatement_id getc_bankstatement_id setstatementlinedate getstatementdate parent constructor param statement bank statement that the line is part of param line no position of the line within the statement public m bank statement line m bank statement statement int line no this statement set line line no lineno mbankstatementline mbankstatement lineno setline lineno set statement line date and all other dates valuta acct param statement line date date public void set statement line date timestamp statement line date super set statement line date statement line date set valuta date statement line date set date acct statement line date statementlinedate setstatementlinedate statementlinedate setstatementlinedate statementlinedate setvalutadate statementlinedate setdateacct statementlinedate set payment param payment payment public void set payment m payment payment setc payment id payment getc payment id setc currency id payment getc currency id big decimal amt payment get pay amt true set trx amt amt set stmt amt amt set description payment get description setpayment mpayment setc_payment_id getc_payment_id setc_currency_id getc_currency_id bigdecimal getpayamt settrxamt setstmtamt setdescription getdescription add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription before save param new record new return true protected boolean before save boolean new record if get charge amt signum 0 getc charge id 0 log save error fill mandatory msg get element get ctx c charge id return false set line no if get line 0 string sql select coalesce max line 0 10 as default value from c bankstatementline where c bankstatement id int ii db getsql value get trxname sql getc bankstatement id set line ii set references if getc payment id 0 getc bpartner id 0 m payment payment new m payment get ctx getc payment id get trxname setc bpartner id payment getc bpartner id if payment getc invoice id 0 setc invoice id payment getc invoice id if getc invoice id 0 getc bpartner id 0 m invoice invoice new m invoice get ctx getc invoice id get trxname setc bpartner id invoice getc bpartner id calculate charge statement trx interest big decimal amt get stmt amt amt amt subtract get trx amt amt amt subtract get interest amt if amt compare to get charge amt 0 set charge amt amt return true newrecord beforesave newrecord getchargeamt getc_charge_id saveerror fillmandatory getelement getctx c_charge_id getline defaultvalue c_bankstatementline c_bankstatement_id getsqlvalue get_trxname getc_bankstatement_id setline getc_payment_id getc_bpartner_id mpayment mpayment getctx getc_payment_id get_trxname setc_bpartner_id getc_bpartner_id getc_invoice_id setc_invoice_id getc_invoice_id getc_invoice_id getc_bpartner_id minvoice minvoice getctx getc_invoice_id get_trxname setc_bpartner_id getc_bpartner_id bigdecimal getstmtamt gettrxamt getinterestamt compareto getchargeamt setchargeamt after save param new record new param success success return success protected boolean after save boolean new record boolean success update header return success newrecord aftersave newrecord updateheader after delete param success success return success protected boolean after delete boolean success update header return success afterdelete updateheader update header private void update header string sql update c bankstatement bs set statement difference select sum stmt amt from c bankstatementline bsl where bsl c bankstatement id bs c bankstatement id and bsl is active y where c bankstatement id getc bankstatement id db execute update sql get trxname sql update c bankstatement bs set ending balance beginning balance statement difference where c bankstatement id getc bankstatement id db execute update sql get trxname updateheader c_bankstatement statementdifference stmtamt c_bankstatementline c_bankstatement_id c_bankstatement_id isactive c_bankstatement_id getc_bankstatement_id executeupdate get_trxname c_bankstatement endingbalance beginningbalance statementdifference c_bankstatement_id getc_bankstatement_id executeupdate get_trxname field constructor requires init field for complete instatanciation param vo value objecy public m field m fieldvo vo m vo vo set attributes load lookup set error false initfield valueobjecy mfield mfieldvo m_vo loadlookup seterror dispose protected void dispose log fine m field dispose m vo column name m propertychangelisteners null if m lookup null m lookup dispose m lookup null m vo lookup info null m vo null mfield m_vo columnname m_propertychangelisteners m_lookup m_lookup m_lookup m_vo lookupinfo m_vo set lookup for columns with lookup public void load lookup if is lookup return log config m vo column name if display type is lookup m vo display type if m vo lookup info null log log level severe m vo column name no lookup info return prevent loading of created by updated by if m vo display type display type table m vo column name equals created by m vo column name equals updated by m vo lookup info is creaded updated by true m vo lookup info is key is key m lookup ml new m lookup m vo lookup info m vo tab no m lookup ml else if m vo display type display type location not cached m location lookup ml new m location lookup m vo ctx m vo window no m lookup ml else if m vo display type display type locator m locator lookup ml new m locator lookup m vo ctx m vo window no m lookup ml else if m vo display type display type account not cached m account lookup ma new m account lookup m vo ctx m vo window no m lookup ma else if m vo display type display type p attribute not cached mp attribute lookup pa new mp attribute lookup m vo ctx m vo window no m lookup pa loadlookup islookup m_vo columnname displaytype islookup m_vo displaytype m_vo lookupinfo m_vo columnname lookupinfo createdby updatedby m_vo displaytype displaytype m_vo columnname createdby m_vo columnname updatedby m_vo lookupinfo iscreadedupdatedby m_vo lookupinfo iskey iskey mlookup mlookup m_vo lookupinfo m_vo tabno m_lookup m_vo displaytype displaytype mlocationlookup mlocationlookup m_vo m_vo windowno m_lookup m_vo displaytype displaytype mlocatorlookup mlocatorlookup m_vo m_vo windowno m_lookup m_vo displaytype displaytype maccountlookup maccountlookup m_vo m_vo windowno m_lookup m_vo displaytype displaytype pattribute mpattributelookup mpattributelookup m_vo m_vo windowno m_lookup wait until load is complete public void lookup load complete if m lookup null return m lookup load complete lookuploadcomplete m_lookup m_lookup loadcomplete get lookup may return null return lookup public lookup get lookup return m lookup getlookup m_lookup is this field a lookup return true if lookup field public boolean is lookup boolean ret value false if m vo is key ret value false else if m vo column name equals created by m vo column name equals updated by ret value false else if display type is lookup m vo display type ret value true else if m vo display type display type location m vo display type display type locator m vo display type display type account m vo display type display type p attribute ret value true return ret value islookup retvalue m_vo iskey retvalue m_vo columnname createdby m_vo columnname updatedby retvalue displaytype islookup m_vo displaytype retvalue m_vo displaytype displaytype m_vo displaytype displaytype m_vo displaytype displaytype m_vo displaytype displaytype pattribute retvalue retvalue refresh lookup if the lookup is unstable return true if lookup is validated public boolean refresh lookup if there is a validation string the lookup is unstable if m lookup null m lookup get validation length 0 return true log fine m vo column name m lookup refresh return m lookup is validated refreshlookup m_lookup m_lookup getvalidation m_vo columnname m_lookup m_lookup isvalidated get a list of fields this field is dependent on for display purposes or for lookup purposes return array list public array list string get dependent on array list string list new array list string display parse depends list m vo display logic parse depends list m vo read only logic lookup if m lookup null parse depends list m lookup get validation if list size 0 c log mgt is level finer string buffer sb new string buffer for int i 0 i list size i sb append list get i append log finer m vo column name sb to string return list arraylist arraylist getdependenton arraylist arraylist parsedepends m_vo displaylogic parsedepends m_vo readonlylogic m_lookup parsedepends m_lookup getvalidation clogmgt islevelfiner stringbuffer stringbuffer m_vo columnname tostring parse string and add variables with to the list param list list to be added to param parse string string to parse for variables private void parse depends array list string list string parse string if parse string null parse string length 0 return log fine m field parse depends parse string string s parse string while we have variables while s index of 1 int pos s index of s s substring pos 1 pos s index of if pos 1 continue error number of not correct string variable s substring 0 pos s s substring pos 1 log fine variable list add variable parsestring parsedepends arraylist parsestring parsestring parsestring mfield parsedepends parsestring parsestring indexof indexof indexof set error used by editors to set the color param error true if error public void set error boolean error m error error seterror m_error get background error return error public boolean is error return m error iserror m_error is it mandatory to enter for user mandatory checking is dome in m table get mandatory param check context check environment requires correct row position return true if mandatory public boolean is mandatory boolean check context not mandatory if m vo is mandatory is virtual column return false numeric keys and created updated as well as document no value asi ars not mandatory persistency layer manages them if m vo is key m vo column name ends with id m vo column name starts with created m vo column name starts with updated m vo column name equals value m vo column name equals document no m vo column name equals m attributesetinstance id 0 is valid return false mandatory if displayed return is displayed check context mtable getmandatory checkcontext ismandatory checkcontext m_vo ismandatory isvirtualcolumn documentno m_vo iskey m_vo columnname endswith _id m_vo columnname startswith m_vo columnname startswith m_vo columnname m_vo columnname documentno m_vo columnname m_attributesetinstance_id isdisplayed checkcontext is it editable checks is active is updateable and is displayed param check context if true checks context for active is processed link column return true if editable public boolean is editable boolean check context if is virtual column return false fields always enabled are usually not updateable if m vo column name equals posted m vo column name equals record id m vo display type display type button zoom return true fields always updareable if m vo is always updateable zoom return true tab or field is r o if m vo tab read only m vo is read only log finest m vo column name no tabro m vo tab read only fieldro m vo is read only return false not updateable only editable if new updateable row if m vo is updateable m inserting log finest m vo column name no field updateable m vo is updateable return false field is the link column of the tab if m vo column name equals env get context m vo ctx m vo window no m vo tab no link column name log finest m vo column name no link column return false role access column access if check context int ad client id env get context as int m vo ctx m vo window no m vo tab no ad client id int ad org id env get context as int m vo ctx m vo window no m vo tab no ad org id string key column env get context m vo ctx m vo window no m vo tab no key column name int record id env get context as int m vo ctx m vo window no m vo tab no key column int ad table id m vo ad table id if m role get default m vo ctx false can update ad client id ad org id ad table id record id false return false if m role get default m vo ctx false is column access ad table id m vo ad column id false return false do we have a readonly rule if check context m vo read only logic length 0 boolean ret value evaluator evaluate logic this m vo read only logic log finest m vo column name r o m vo read only logic r w ret value if ret value return false always editable if active if m vo column name equals processing m vo column name equals payment rule m vo column name equals doc action m vo column name equals generate to return true record is processed if check context env get context m vo ctx m vo window no processed equals y return false is active field is editable if record not processed if m vo column name equals is active return true record is not active if check context env get context m vo ctx m vo window no is active equals y return false ultimately visibily decides return is displayed check context isactive isupdateable isdisplayed checkcontext isprocessed linkcolumn iseditable checkcontext isvirtualcolumn m_vo columnname m_vo columnname record_id m_vo displaytype displaytype m_vo isalwaysupdateable m_vo tabreadonly m_vo isreadonly m_vo columnname m_vo tabreadonly m_vo isreadonly m_vo isupdateable m_inserting m_vo columnname fieldupdateable m_vo isupdateable m_vo columnname getcontext m_vo m_vo windowno m_vo tabno linkcolumnname m_vo columnname linkcolumn checkcontext ad_client_id getcontextasint m_vo m_vo windowno m_vo tabno ad_client_id ad_org_id getcontextasint m_vo m_vo windowno m_vo tabno ad_org_id keycolumn getcontext m_vo m_vo windowno m_vo tabno keycolumnname record_id getcontextasint m_vo m_vo windowno m_vo tabno keycolumn ad_table_id m_vo ad_table_id mrole getdefault m_vo canupdate ad_client_id ad_org_id ad_table_id record_id mrole getdefault m_vo iscolumnaccess ad_table_id m_vo ad_column_id checkcontext m_vo readonlylogic retvalue evaluatelogic m_vo readonlylogic m_vo columnname m_vo readonlylogic retvalue retvalue m_vo columnname m_vo columnname paymentrule m_vo columnname docaction m_vo columnname generateto checkcontext getcontext m_vo m_vo windowno isactive m_vo columnname isactive checkcontext getcontext m_vo m_vo windowno isactive isdisplayed checkcontext set inserting allows to enter not updateable fields reset when setting the field value param inserting true if inserting public void set inserting boolean inserting m inserting inserting setinserting m_inserting create default value pre a key parent is active system access b sql default c column default system integrity d user preference e system preference f data type defaults don t default from context use explicit default value would otherwise copy previous record pre return default value or null public object get default a key parent is active system access no defaults for these fields if m vo is key m vo display type display type rowid m vo display type display type binary return null set parent to context if not explitly set if is parent value m vo default value null m vo default value length 0 string parent env get context m vo ctx m vo window no m vo column name log fine parent m vo column name parent return create default parent always active if m vo column name equals is active log fine is active m vo column name y return y set client org to system if system access if x ad table accesslevel systemonly equals env get context m vo ctx m vo window no m vo tab no access level m vo column name equals ad client id m vo column name equals ad org id log fine system access m vo column name 0 return new integer 0 set org to system if client access else if x ad table accesslevel systemplusclient equals env get context m vo ctx m vo window no m vo tab no access level m vo column name equals ad org id log fine client access m vo column name 0 return new integer 0 b sql statement for data integity consistency string def str if m vo default value starts with sql string sql m vo default value substring 5 w o tag sql env parse context m vo ctx m vo window no sql false true replace variables if sql equals log log level severe m vo column name default sql variable parse failed m vo default value else try prepared statement stmt db prepare statement sql null result set rs stmt execute query if rs next def str rs get string 1 else log log level severe m vo column name no result sql rs close stmt close catch sql exception e log log level severe m vo column name sql e if def str equals log fine sql m vo column name def str return create default def str sql statement c field default value similar code in a startrp dialog get default if m vo default value equals m vo default value starts with sql def str it is one or more variables constants string tokenizer st new string tokenizer m vo default value false while st has more tokens def str st next token trim if def str equals sys date system time return new timestamp system current time millis else if def str index of 1 it is a variable def str env get context m vo ctx m vo window no def str replace trim else if def str index of 1 it is a string def str def str replace trim if def str equals log fine default value m vo column name def str return create default def str while more tokens default value d preference user p def str env get preference m vo ctx m vo ad window id m vo column name false if def str equals log fine user preference m vo column name def str return create default def str e preference system def str env get preference m vo ctx m vo ad window id m vo column name true if def str equals log fine system preference m vo column name def str return create default def str f data type defaults button to n if m vo display type display type button m vo column name ends with id log fine button n m vo column name return n check boxes default to no if m vo display type display type yes no log fine yes no n m vo column name return n lookups with one value if display type is lookup m vo display type m lookup get size 1 todo default if only one lookup value i ds remain null if m vo column name ends with id log fine id null m vo column name return null actual numbers default to zero if display type is numeric m vo display type log fine number 0 m vo column name return create default 0 no resolution log fine none m vo column name return null isactive systemaccess datatype defaultvalue getdefault isactive systemaccess m_vo iskey m_vo displaytype displaytype m_vo displaytype displaytype isparentvalue m_vo defaultvalue m_vo defaultvalue getcontext m_vo m_vo windowno m_vo columnname m_vo columnname createdefault m_vo columnname isactive isactive m_vo columnname x_ad_table accesslevel_systemonly getcontext m_vo m_vo windowno m_vo tabno accesslevel m_vo columnname ad_client_id m_vo columnname ad_org_id systemaccess m_vo columnname x_ad_table accesslevel_systemplusclient getcontext m_vo m_vo windowno m_vo tabno accesslevel m_vo columnname ad_org_id clientaccess m_vo columnname defstr m_vo defaultvalue startswith m_vo defaultvalue parsecontext m_vo m_vo windowno m_vo columnname m_vo defaultvalue preparedstatement preparestatement resultset executequery defstr getstring m_vo columnname sqlexception m_vo columnname defstr m_vo columnname defstr createdefault defstr defaultvalue astartrpdialog getdefault m_vo defaultvalue m_vo defaultvalue startswith defstr stringtokenizer stringtokenizer m_vo defaultvalue hasmoretokens defstr nexttoken defstr sysdate currenttimemillis defstr indexof defstr getcontext m_vo m_vo windowno defstr defstr indexof defstr defstr defstr defaultvalue m_vo columnname defstr createdefault defstr defstr getpreference m_vo m_vo ad_window_id m_vo columnname defstr userpreference m_vo columnname defstr createdefault defstr defstr getpreference m_vo m_vo ad_window_id m_vo columnname defstr systempreference m_vo columnname defstr createdefault defstr datatype m_vo displaytype displaytype m_vo columnname endswith _id m_vo columnname checkboxes m_vo displaytype displaytype yesno yesno m_vo columnname displaytype islookup m_vo displaytype m_lookup getsize ids m_vo columnname endswith _id m_vo columnname displaytype isnumeric m_vo displaytype m_vo columnname createdefault m_vo columnname create default object type pre integer i ds integer big decimal numbers timestamp dates boolean yes no default string pre param value string return type dependent converted object private object create default string value true null if value null value to string length 0 return null see also m table read data try i ds integer created by updated by if m vo column name ends with ated by m vo column name ends with id try defaults 1 null int ii integer parse int value if ii 0 return null return new integer ii catch exception e log warning cannot parse value e get message return new integer 0 integer if m vo display type display type integer return new integer value number if display type is numeric m vo display type return new big decimal value timestamps if display type is date m vo display type java util date date display type getdateformat jdbc parse value return new timestamp date get time boolean if m vo display type display type yes no return new boolean y equals value default return value catch exception e log log level severe m vo column name e get message return null ids bigdecimal yesno createdefault tostring mtable readdata ids createdby updatedby m_vo columnname endswith atedby m_vo columnname endswith _id parseint getmessage m_vo displaytype displaytype displaytype isnumeric m_vo displaytype bigdecimal displaytype isdate m_vo displaytype displaytype getdateformat_jdbc gettime m_vo displaytype displaytype yesno m_vo columnname getmessage validate initial field value called from m tab data new and m tab set current row when inserting return true if valid public boolean validate value null if m value null m value to string length 0 if is mandatory true m error true return false else return true search not cached if get display type display type search m lookup null need to re set invalid values ok b partner in po line not ok sales rep in invoice if m lookup get direct m value false true null log finest m vo column name serach not valid set to null set value null m inserting m error true return false return true cannot be validated if is lookup m lookup contains key m value return true it s not null a lookup and does not have the key if is key is parent value parents ket are not validated return true log finest m vo column name set to null set value null m inserting m error true return false mtab datanew mtab setcurrentrow validatevalue m_value m_value tostring ismandatory m_error getdisplaytype displaytype m_lookup bpartner salesrep m_lookup getdirect m_value m_vo columnname setvalue m_inserting m_error islookup m_lookup containskey m_value iskey isparentvalue m_vo columnname setvalue m_inserting m_error is the column visible param check context check environment requires correct row position return true if visible public boolean is displayed boolean check context static content not displayed if m vo is displayed return false no restrictions if m vo display logic equals return true dynamic content if check context boolean ret value evaluator evaluate logic this m vo display logic log finest m vo column name m vo display logic ret value return ret value return true checkcontext isdisplayed checkcontext m_vo isdisplayed m_vo displaylogic checkcontext retvalue evaluatelogic m_vo displaylogic m_vo columnname m_vo displaylogic retvalue retvalue get variable value evaluatee param variable name name return value public string get valueasstring string variable name return env get context m vo ctx m vo window no variable name true variablename get_valueasstring variablename getcontext m_vo m_vo windowno variablename add display dependencies to given list source display logic param list list to be added to public void add dependencies array list string list nothing to parse if m vo is displayed m vo display logic equals return string tokenizer logic new string tokenizer m vo display logic trim false while logic has more tokens string tokenizer st new string tokenizer logic next token trim false while st has more tokens string tag st next token trim get tag do we have a variable if tag index of 1 tag tag replace trim strip tag add columns they might not be a column but then it is static if list contains tag list add tag displaylogic adddependencies arraylist m_vo isdisplayed m_vo displaylogic stringtokenizer stringtokenizer m_vo displaylogic hasmoretokens stringtokenizer stringtokenizer nexttoken hasmoretokens nexttoken indexof get column name return column name public string get column name return m vo column name getcolumnname m_vo columnname get column name or sql with without as param withas include as column name for virtual columns in select statements return column name public string get columnsql boolean withas if m vo columnsql null m vo columnsql length 0 if withas return m vo columnsql as m vo column name else return m vo columnsql return m vo column name columnname getcolumnsql m_vo m_vo m_vo m_vo columnname m_vo m_vo columnname is virtual column return column is virtual public boolean is virtual column if m vo columnsql null m vo columnsql length 0 return true return false isvirtualcolumn m_vo m_vo is column virtual public string get header return m vo header iscolumnvirtual getheader m_vo return m vo header public int get display type return m vo display type m_vo getdisplaytype m_vo displaytype return m vo display type public int getad reference value id return m vo ad reference value id m_vo displaytype getad_reference_value_id m_vo ad_reference_value_id return m vo ad reference value id public int getad window id return m vo ad window id m_vo ad_reference_value_id getad_window_id m_vo ad_window_id return m vo ad window id public int get window no return m vo window no m_vo ad_window_id getwindowno m_vo windowno return m vo window no public int getad column id return m vo ad column id m_vo windowno getad_column_id m_vo ad_column_id return m vo ad column id public int get display length return m vo display length m_vo ad_column_id getdisplaylength m_vo displaylength return m vo display length public boolean is same line return m vo is same line m_vo displaylength issameline m_vo issameline return m vo is same line public boolean is displayed return m vo is displayed m_vo issameline isdisplayed m_vo isdisplayed return m vo is displayed public string get display logic return m vo display logic m_vo isdisplayed getdisplaylogic m_vo displaylogic return m vo display logic public string get default value return m vo default value m_vo displaylogic getdefaultvalue m_vo defaultvalue public boolean is read only if is virtual column return true return m vo is read only isreadonly isvirtualcolumn m_vo isreadonly public boolean is create mnemonic if is read only m vo column name equals ad client id m vo column name equals ad org id m vo column name equals document no return false return true iscreatemnemonic isreadonly m_vo columnname ad_client_id m_vo columnname ad_org_id m_vo columnname documentno public boolean is updateable if is virtual column return false return m vo is updateable isupdateable isvirtualcolumn m_vo isupdateable public boolean is always updateable if is virtual column return false return m vo is always updateable isalwaysupdateable isvirtualcolumn m_vo isalwaysupdateable return m vo is always updateable public boolean is heading return m vo is heading m_vo isalwaysupdateable isheading m_vo isheading return m vo is heading public boolean is field only return m vo is field only m_vo isheading isfieldonly m_vo isfieldonly return m vo is field only public boolean is encrypted field return m vo is encrypted field m_vo isfieldonly isencryptedfield m_vo isencryptedfield return m vo is encrypted field public boolean is encrypted column return m vo is encrypted column m_vo isencryptedfield isencryptedcolumn m_vo isencryptedcolumn return m vo is encrypted column public boolean is selection column return m vo is selection column m_vo isencryptedcolumn isselectioncolumn m_vo isselectioncolumn return m vo is selection column public string get obscure type return m vo obscure type m_vo isselectioncolumn getobscuretype m_vo obscuretype return m vo obscure type public int get sort no return m vo sort no m_vo obscuretype getsortno m_vo sortno return m vo sort no public int get field length return m vo field length m_vo sortno getfieldlength m_vo fieldlength return m vo field length public string getv format return m vo v format m_vo fieldlength getvformat m_vo vformat return m vo v format public string get value min return m vo value min m_vo vformat getvaluemin m_vo valuemin return m vo value min public string get value max return m vo value max m_vo valuemin getvaluemax m_vo valuemax return m vo value max public string get field group return m vo field group m_vo valuemax getfieldgroup m_vo fieldgroup return m vo field group public boolean is key return m vo is key m_vo fieldgroup iskey m_vo iskey return m vo is key public boolean is parent column return m vo is parent m_vo iskey isparentcolumn m_vo isparent public boolean is parent value if m parentchecked return m vo is parent if display type isid m vo display type m vo tab no 0 m vo is parent false else string link column name env get context m vo ctx m vo window no m vo tab no link column name if link column name length 0 else m vo is parent m vo column name equals link column name if m vo is parent log config m vo is parent link link column name w m vo window no t m vo tab no m vo column name m parentchecked true return m vo is parent isparentvalue m_parentchecked m_vo isparent displaytype m_vo displaytype m_vo tabno m_vo isparent linkcolumnname getcontext m_vo m_vo windowno m_vo tabno linkcolumnname linkcolumnname m_vo isparent m_vo columnname linkcolumnname m_vo isparent m_vo isparent linkcolumnname m_vo windowno m_vo tabno m_vo columnname m_parentchecked m_vo isparent return m vo is parent public string get callout return m vo callout m_vo isparent getcallout m_vo return m vo callout public int getad process id return m vo ad process id m_vo getad_process_id m_vo ad_process_id return m vo ad process id public string get description return m vo description m_vo ad_process_id getdescription m_vo return m vo description public string get help return m vo help m_vo gethelp m_vo return m vo help public m fieldvo getvo return m vo m_vo mfieldvo m_vo is this a long string text field over 60 2 30 characters return true if long field public boolean is long field if m vo display type display type string m vo display type display type text m vo display type display type memo m vo display type display type text long m vo display type display type image return m vo display length maxdisplay length 2 return false islongfield m_vo displaytype displaytype m_vo displaytype displaytype m_vo displaytype displaytype m_vo displaytype displaytype textlong m_vo displaytype displaytype m_vo displaylength maxdisplay_length set value to null p do not update context called from m tab set current row send bean property change if there is a change public void set value log fine m field set value column name new value if m valuenofire set the old value m oldvalue m value m value null m inserting false m error false reset error does not fire if same value m propertychangelisteners fire property change property m oldvalue m value m propertychangelisteners fire property change property s oldvalue null mtab setcurrentrow propertychange setvalue mfield setvalue columnname newvalue m_valuenofire m_oldvalue m_value m_value m_inserting m_error m_propertychangelisteners firepropertychange m_oldvalue m_value m_propertychangelisteners firepropertychange s_oldvalue set value p update context if not text or rowid send bean property change if there is a change param new value new value param inserting true if inserting public void set value object new value boolean inserting log fine m field set value column name new value if m valuenofire set the old value m oldvalue m value m value new value m inserting inserting m error false reset error set context if m vo display type display type text m vo display type display type memo m vo display type display type text long m vo display type display type binary m vo display type display type rowid ignore else if new value instanceof boolean env set context m vo ctx m vo window no m vo column name boolean new value boolean value else if new value instanceof timestamp env set context m vo ctx m vo window no m vo column name timestamp m value else env set context m vo ctx m vo window no m vo column name m value null null m value to string does not fire if same value object old value m oldvalue if inserting old value inserting m propertychangelisteners fire property change property old value m value propertychange newvalue setvalue newvalue mfield setvalue columnname newvalue m_valuenofire m_oldvalue m_value m_value newvalue m_inserting m_error m_vo displaytype displaytype m_vo displaytype displaytype m_vo displaytype displaytype textlong m_vo displaytype displaytype m_vo displaytype displaytype newvalue setcontext m_vo m_vo windowno m_vo columnname newvalue booleanvalue newvalue setcontext m_vo m_vo windowno m_vo columnname m_value setcontext m_vo m_vo windowno m_vo columnname m_value m_value tostring oldvalue m_oldvalue oldvalue m_propertychangelisteners firepropertychange oldvalue m_value get value return current value public object get value return m value getvalue m_value set old previous value i e don t fire property change used by v color set field param value if false property change will always be fires public void set value no fire boolean value m valuenofire value vcolor setfield setvaluenofire m_valuenofire get old previous value called from m tab process callout return old value public object get old value return m oldvalue mtab processcallout getoldvalue m_oldvalue set error value the value which cuased some error param error value error message public void set error value string error value m errorvalue error value m errorvalueflag true errorvalue seterrorvalue errorvalue m_errorvalue errorvalue m_errorvalueflag get error value the value which cuased some error b and b reset it to null return error value public string get error value string s m errorvalue m errorvalue null m errorvalueflag false return s geterrorvalue m_errorvalue m_errorvalue m_errorvalueflag return true if value has error for html interface b and b reset it to false return has error public boolean is error value boolean b m errorvalueflag m errorvalueflag false return b iserrorvalue m_errorvalueflag m_errorvalueflag overwrite default display length param length new length public void set display length int length m vo display length length displaylength setdisplaylength m_vo displaylength overwrite displayed param displayed trie if displayed public void set displayed boolean displayed m vo is displayed displayed setdisplayed m_vo isdisplayed string representation return string representation public string to string string buffer sb new string buffer m field sb append m vo column name append append m value append return sb to string tostring stringbuffer stringbuffer mfield m_vo columnname m_value tostring extended string representation return string representation public string to stringx string buffer sb new string buffer m field sb append m vo column name append append m value append display type append get display type append return sb to string tostringx stringbuffer stringbuffer mfield m_vo columnname m_value displaytype getdisplaytype tostring remove property change listener param l listener public synchronized void remove property change listener property change listener l m propertychangelisteners remove property change listener l removepropertychangelistener propertychangelistener m_propertychangelisteners removepropertychangelistener add property change listener param l listener public synchronized void add property change listener property change listener l m propertychangelisteners add property change listener l addpropertychangelistener propertychangelistener m_propertychangelisteners addpropertychangelistener create fields param ad tab id tab return array of fields public static m field create fields properties ctx int window no int tab no int ad tab id array list m fieldvo listvo new array list m fieldvo int ad window id 0 boolean read only false string sql m fieldvo getsql ctx prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad tab id result set rs pstmt execute query while rs next m fieldvo vo m fieldvo create ctx window no tab no ad window id read only rs listvo add vo rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m field ret value new m field listvo size for int i 0 i listvo size i ret value i new m field m fieldvo listvo get i return ret value ad_tab_id mfield createfields windowno tabno ad_tab_id arraylist mfieldvo arraylist mfieldvo ad_window_id readonly mfieldvo preparedstatement preparestatement setint ad_tab_id resultset executequery mfieldvo mfieldvo windowno tabno ad_window_id readonly mfield retvalue mfield retvalue mfield mfieldvo retvalue get contents return contents public object get contents return contents getcontents create shipment from order param order order param movement date optional movement date param force delivery ignore order delivery rule param all attribute instances if true all attribute set instances param min guarantee date optional minimum guarantee date if all attribute instances param complete complete document process if false complete if true return shipment or null public static m in out create from m order order timestamp movement date boolean force delivery boolean all attribute instances timestamp min guarantee date boolean complete string trx name if order null throw new illegal argument exception no order if force delivery deliveryrule completeline equals order get delivery rule return null create meader m in out ret value new m in out order 0 movement date ret value set doc action complete docaction complete docaction prepare check if we can create the lines m order line o lines order get lines true m product id for int i 0 i o lines length i big decimal qty o lines i get qty ordered subtract o lines i get qty delivered nothing to deliver if qty signum 0 continue stock info m storage storages null m product product o lines i get product if product null product get id 0 product is stocked m product category pc m product category get order get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 m client client m client get order get ctx mm policy client getmm policy storages m storage get warehouse order get ctx order getm warehouse id o lines i getm product id o lines i getm attributesetinstance id product getm attributeset id all attribute instances min guarantee date m client mmpolicy fifo equals mm policy trx name if force delivery big decimal max qty env zero for int ll 0 ll storages length ll max qty max qty add storages ll get qty on hand if deliveryrule availability equals order get delivery rule if max qty compare to qty 0 qty max qty else if deliveryrule completeline equals order get delivery rule if max qty compare to qty 0 continue create line if ret value get id 0 not saved yet ret value save trx name create a line until qty is reached for int ll 0 ll storages length ll big decimal line qty storages ll get qty on hand if line qty compare to qty 0 line qty qty m in out line line new m in out line ret value line set order line o lines i storages ll getm locator id order isso trx line qty env zero line set qty line qty correct uom for qty entered if o lines i get qty entered compare to o lines i get qty ordered 0 line set qty entered line qty multiply o lines i get qty entered divide o lines i get qty ordered 12 big decimal round half up line save trx name delivered everything qty qty subtract line qty storage ll change qty on hand line qty order isso trx credit memo not considered storage ll save get trxname if qty signum 0 break for all order lines no lines saved if ret value get id 0 return null return ret value movementdate forcedelivery allattributeinstances minguaranteedate minout createfrom morder movementdate forcedelivery allattributeinstances minguaranteedate trxname illegalargumentexception forcedelivery deliveryrule_completeline getdeliveryrule minout retvalue minout movementdate retvalue setdocaction docaction_complete docaction_prepare morderline olines getlines m_product_id olines bigdecimal olines getqtyordered olines getqtydelivered mstorage mproduct olines getproduct get_id isstocked mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mclient mclient getctx mmpolicy getmmpolicy mstorage getwarehouse getctx getm_warehouse_id olines getm_product_id olines getm_attributesetinstance_id getm_attributeset_id allattributeinstances minguaranteedate mclient mmpolicy_fifo mmpolicy trxname forcedelivery bigdecimal maxqty maxqty maxqty getqtyonhand deliveryrule_availability getdeliveryrule maxqty compareto maxqty deliveryrule_completeline getdeliveryrule maxqty compareto retvalue get_id retvalue trxname bigdecimal lineqty getqtyonhand lineqty compareto lineqty minoutline minoutline retvalue setorderline olines getm_locator_id issotrx lineqty setqty lineqty qtyentered olines getqtyentered compareto olines getqtyordered setqtyentered lineqty olines getqtyentered olines getqtyordered bigdecimal round_half_up trxname lineqty changeqtyonhand lineqty issotrx get_trxname retvalue get_id retvalue create new shipment by copying param from shipment param date doc date of the document date param c doctype id doc type param isso trx sales order param counter create counter links param trx name trx param set order set the order link return shipment public static m in out copy from m in out from timestamp date doc int c doctype id boolean isso trx boolean counter string trx name boolean set order m in out to new m in out from get ctx 0 null to set trxname trx name copy values from to from getad client id from getad org id to set valuenocheck m inout id i zero to set valuenocheck document no null to set doc status docstatus drafted draft to set doc action docaction complete to setc doctype id c doctype id to set isso trx isso trx if counter to set movement type isso trx movementtype customershipment movementtype vendorreceipts to set date ordered date doc to set date acct date doc to set movement date date doc to set date printed null to set is printed false to set date received null to set no packages 0 to set ship date null to set pick date null to set is in transit false to set is approved false to setc invoice id 0 to set tracking no null to set is in dispute false to set posted false to set processed false to setc order id 0 overwritten by set order if counter to setc order id 0 to setref inout id from getm inout id try to find order invoice link if from getc order id 0 m order peer new m order from get ctx from getc order id from get trxname if peer getref order id 0 to setc order id peer getref order id if from getc invoice id 0 m invoice peer new m invoice from get ctx from getc invoice id from get trxname if peer getref invoice id 0 to setc invoice id peer getref invoice id else to setref inout id 0 if set order to setc order id from getc order id if to save trx name throw new illegal state exception could not create shipment if counter from setref inout id to getm inout id if to copy lines from from counter set order 0 throw new illegal state exception could not create shipment lines return to datedoc c_doctype_id issotrx trxname setorder minout copyfrom minout datedoc c_doctype_id issotrx trxname setorder minout minout getctx set_trxname trxname copyvalues getad_client_id getad_org_id set_valuenocheck m_inout_id i_zero set_valuenocheck documentno setdocstatus docstatus_drafted setdocaction docaction_complete setc_doctype_id c_doctype_id setissotrx issotrx setmovementtype issotrx movementtype_customershipment movementtype_vendorreceipts setdateordered datedoc setdateacct datedoc setmovementdate datedoc setdateprinted setisprinted setdatereceived setnopackages setshipdate setpickdate setisintransit setisapproved setc_invoice_id settrackingno setisindispute setposted setprocessed setc_order_id setorder setc_order_id setref_inout_id getm_inout_id getc_order_id morder morder getctx getc_order_id get_trxname getref_order_id setc_order_id getref_order_id getc_invoice_id minvoice minvoice getctx getc_invoice_id get_trxname getref_invoice_id setc_invoice_id getref_invoice_id setref_inout_id setorder setc_order_id getc_order_id trxname illegalstateexception setref_inout_id getm_inout_id copylinesfrom setorder illegalstateexception standard constructor param ctx context param m inout id param trx name rx name public m in out properties ctx int m inout id string trx name super ctx m inout id trx name if m inout id 0 set document no null setc bpartner id 0 setc bpartner location id 0 setm warehouse id 0 setc doctype id 0 set isso trx false set movement date new timestamp system current time millis set date acct get movement date set movement type movementtype customershipment set delivery rule deliveryrule availability set delivery via rule deliveryviarule pickup set freight cost rule freightcostrule freightincluded set doc status docstatus drafted set doc action docaction complete set priority rule priorityrule medium set no packages 0 set is in transit false set is printed false set sende mail false set is in dispute false set is approved false super set processed false set processing false set posted false m_inout_id trxname minout m_inout_id trxname m_inout_id trxname m_inout_id setdocumentno setc_bpartner_id setc_bpartner_location_id setm_warehouse_id setc_doctype_id setissotrx setmovementdate currenttimemillis setdateacct getmovementdate setmovementtype movementtype_customershipment setdeliveryrule deliveryrule_availability setdeliveryviarule deliveryviarule_pickup setfreightcostrule freightcostrule_freightincluded setdocstatus docstatus_drafted setdocaction docaction_complete setpriorityrule priorityrule_medium setnopackages setisintransit setisprinted setsendemail setisindispute setisapproved setprocessed setprocessing setposted load constructor param ctx context param rs result set record public m in out properties ctx result set rs string trx name super ctx rs trx name minout resultset trxname trxname order constructor create header only param order order param movement date optional movement date default today param c doctypeshipment id document type or 0 public m in out m order order int c doctypeshipment id timestamp movement date this order get ctx 0 order get trxname set client org order setc bpartner id order getc bpartner id setc bpartner location id order getc bpartner location id shipment address setad user id order getad user id setm warehouse id order getm warehouse id set isso trx order isso trx set movement type order isso trx movementtype customershipment movementtype vendorreceipts if c doctypeshipment id 0 c doctypeshipment id db getsql value null select c doctypeshipment id from c doctype where c doctype id order getc doctype id setc doctype id c doctypeshipment id default today if movement date null set movement date movement date set date acct get movement date copy from order setc order id order getc order id set delivery rule order get delivery rule set delivery via rule order get delivery via rule setm shipper id order getm shipper id set freight cost rule order get freight cost rule set freight amt order get freight amt setsalesrep id order getsalesrep id setc activity id order getc activity id setc campaign id order getc campaign id setc charge id order getc charge id set charge amt order get charge amt setc project id order getc project id set date ordered order get date ordered set description order get description setpo reference order getpo reference setsalesrep id order getsalesrep id setad orgtrx id order getad orgtrx id setuser1 id order getuser1 id setuser2 id order getuser2 id movementdate c_doctypeshipment_id minout morder c_doctypeshipment_id movementdate getctx get_trxname setclientorg setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id setm_warehouse_id getm_warehouse_id setissotrx issotrx setmovementtype issotrx movementtype_customershipment movementtype_vendorreceipts c_doctypeshipment_id c_doctypeshipment_id getsqlvalue c_doctypeshipment_id c_doctype c_doctype_id getc_doctype_id setc_doctype_id c_doctypeshipment_id movementdate setmovementdate movementdate setdateacct getmovementdate setc_order_id getc_order_id setdeliveryrule getdeliveryrule setdeliveryviarule getdeliveryviarule setm_shipper_id getm_shipper_id setfreightcostrule getfreightcostrule setfreightamt getfreightamt setsalesrep_id getsalesrep_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_charge_id getc_charge_id setchargeamt getchargeamt setc_project_id getc_project_id setdateordered getdateordered setdescription getdescription setporeference getporeference setsalesrep_id getsalesrep_id setad_orgtrx_id getad_orgtrx_id setuser1_id getuser1_id setuser2_id getuser2_id invoice constructor create header only param invoice invoice param movement date optional movement date default today param c doctypeshipment id document type or 0 public m in out m invoice invoice int c doctypeshipment id timestamp movement date int m warehouse id this invoice get ctx 0 invoice get trxname set client org invoice setc bpartner id invoice getc bpartner id setc bpartner location id invoice getc bpartner location id shipment address setad user id invoice getad user id setm warehouse id m warehouse id set isso trx invoice isso trx set movement type invoice isso trx movementtype customershipment movementtype vendorreceipts m order order null if invoice getc order id 0 order new m order invoice get ctx invoice getc order id invoice get trxname if c doctypeshipment id 0 order null c doctypeshipment id db getsql value null select c doctypeshipment id from c doctype where c doctype id order getc doctype id if c doctypeshipment id 0 setc doctype id c doctypeshipment id else setc doctype id default today if movement date null set movement date movement date set date acct get movement date copy from invoice setc order id invoice getc order id setsalesrep id invoice getsalesrep id setc activity id invoice getc activity id setc campaign id invoice getc campaign id setc charge id invoice getc charge id set charge amt invoice get charge amt setc project id invoice getc project id set date ordered invoice get date ordered set description invoice get description setpo reference invoice getpo reference setad orgtrx id invoice getad orgtrx id setuser1 id invoice getuser1 id setuser2 id invoice getuser2 id if order null set delivery rule order get delivery rule set delivery via rule order get delivery via rule setm shipper id order getm shipper id set freight cost rule order get freight cost rule set freight amt order get freight amt movementdate c_doctypeshipment_id minout minvoice c_doctypeshipment_id movementdate m_warehouse_id getctx get_trxname setclientorg setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id setm_warehouse_id m_warehouse_id setissotrx issotrx setmovementtype issotrx movementtype_customershipment movementtype_vendorreceipts morder getc_order_id morder getctx getc_order_id get_trxname c_doctypeshipment_id c_doctypeshipment_id getsqlvalue c_doctypeshipment_id c_doctype c_doctype_id getc_doctype_id c_doctypeshipment_id setc_doctype_id c_doctypeshipment_id setc_doctype_id movementdate setmovementdate movementdate setdateacct getmovementdate setc_order_id getc_order_id setsalesrep_id getsalesrep_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_charge_id getc_charge_id setchargeamt getchargeamt setc_project_id getc_project_id setdateordered getdateordered setdescription getdescription setporeference getporeference setad_orgtrx_id getad_orgtrx_id setuser1_id getuser1_id setuser2_id getuser2_id setdeliveryrule getdeliveryrule setdeliveryviarule getdeliveryviarule setm_shipper_id getm_shipper_id setfreightcostrule getfreightcostrule setfreightamt getfreightamt copy constructor create header only param original original param movement date optional movement date default today param c doctypeshipment id document type or 0 public m in out m in out original int c doctypeshipment id timestamp movement date this original get ctx 0 original get trxname set client org original setc bpartner id original getc bpartner id setc bpartner location id original getc bpartner location id shipment address setad user id original getad user id setm warehouse id original getm warehouse id set isso trx original isso trx set movement type original get movement type if c doctypeshipment id 0 setc doctype id original getc doctype id else setc doctype id c doctypeshipment id default today if movement date null set movement date movement date set date acct get movement date copy from order setc order id original getc order id set delivery rule original get delivery rule set delivery via rule original get delivery via rule setm shipper id original getm shipper id set freight cost rule original get freight cost rule set freight amt original get freight amt setsalesrep id original getsalesrep id setc activity id original getc activity id setc campaign id original getc campaign id setc charge id original getc charge id set charge amt original get charge amt setc project id original getc project id set date ordered original get date ordered set description original get description setpo reference original getpo reference setsalesrep id original getsalesrep id setad orgtrx id original getad orgtrx id setuser1 id original getuser1 id setuser2 id original getuser2 id movementdate c_doctypeshipment_id minout minout c_doctypeshipment_id movementdate getctx get_trxname setclientorg setc_bpartner_id getc_bpartner_id setc_bpartner_location_id getc_bpartner_location_id setad_user_id getad_user_id setm_warehouse_id getm_warehouse_id setissotrx issotrx setmovementtype getmovementtype c_doctypeshipment_id setc_doctype_id getc_doctype_id setc_doctype_id c_doctypeshipment_id movementdate setmovementdate movementdate setdateacct getmovementdate setc_order_id getc_order_id setdeliveryrule getdeliveryrule setdeliveryviarule getdeliveryviarule setm_shipper_id getm_shipper_id setfreightcostrule getfreightcostrule setfreightamt getfreightamt setsalesrep_id getsalesrep_id setc_activity_id getc_activity_id setc_campaign_id getc_campaign_id setc_charge_id getc_charge_id setchargeamt getchargeamt setc_project_id getc_project_id setdateordered getdateordered setdescription getdescription setporeference getporeference setsalesrep_id getsalesrep_id setad_orgtrx_id getad_orgtrx_id setuser1_id getuser1_id setuser2_id getuser2_id get document status return document status clear text public string get doc status name return m ref list get list name get ctx 131 get doc status getdocstatusname mreflist getlistname getctx getdocstatus add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription string representation return info public string to string string buffer sb new string buffer m in out append get id append append get document no append doc status append get doc status append return sb to string tostring stringbuffer stringbuffer minout get_id getdocumentno docstatus getdocstatus tostring get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine shipment getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id get lines of shipment return lines public m in out line get lines boolean requery if m lines null requery return m lines array list m in out line list new array list m in out line string sql select from m inoutline where m inout id order by line prepared statement pstmt null result set rs null try pstmt db prepare statement sql get trxname pstmt set int 1 getm inout id rs pstmt execute query while rs next list add new m in out line get ctx rs get trxname rs close rs null pstmt close pstmt null catch sql exception ex log log level severe sql ex list null throw new db exception ex finally try if rs null rs close if pstmt null pstmt close catch sql exception e pstmt null rs null if list null return null m lines new m in out line list size list to array m lines return m lines minoutline getlines m_lines m_lines arraylist minoutline arraylist minoutline m_inoutline m_inout_id preparedstatement resultset preparestatement get_trxname setint getm_inout_id executequery minoutline getctx get_trxname sqlexception dbexception sqlexception m_lines minoutline toarray m_lines m_lines get lines of shipment return lines public m in out line get lines return get lines false minoutline getlines getlines get confirmations param requery requery return array of confirmations public m in out confirm get confirmations boolean requery if m confirms null requery return m confirms array list m in out confirm list new array list m in out confirm string sql select from m inoutconfirm where m inout id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm inout id result set rs pstmt execute query while rs next list add new m in out confirm get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m confirms new m in out confirm list size list to array m confirms return m confirms minoutconfirm getconfirmations m_confirms m_confirms arraylist minoutconfirm arraylist minoutconfirm m_inoutconfirm m_inout_id preparedstatement preparestatement get_trxname setint getm_inout_id resultset executequery minoutconfirm getctx get_trxname m_confirms minoutconfirm toarray m_confirms m_confirms copy lines from other shipment param other shipment shipment param counter set counter info param set order set order link return number of lines copied public int copy lines from m in out other shipment boolean counter boolean set order if is processed is posted other shipment null return 0 m in out line from lines other shipment get lines false int count 0 for int i 0 i from lines length i m in out line line new m in out line this m in out line from line from lines i line set trxname get trxname if counter header po copy values from line line getad client id getad org id else po copy values from line line from line getad client id from line getad org id line setm inout id getm inout id line set valuenocheck m inoutline id i zero new reset if set order line setc orderline id 0 if counter line setm attributesetinstance id 0 line sets resourceassignment id 0 line setref inoutline id 0 line set is invoiced false line set confirmed qty env zero line set picked qty env zero line set scrapped qty env zero line set target qty env zero set locator based on header warehouse if getm warehouse id other shipment getm warehouse id line setm locator id 0 line setm locator id env zero if counter line setref inoutline id from line getm inoutline id if from line getc orderline id 0 m order line peer new m order line get ctx from line getc orderline id get trxname if peer getref orderline id 0 line setc orderline id peer getref orderline id line set processed false if line save get trxname count cross link if counter from line setref inoutline id line getm inoutline id from line save get trxname if from lines length count log log level severe line difference from from lines length saved count return count othershipment setorder copylinesfrom minout othershipment setorder isprocessed isposted othershipment minoutline fromlines othershipment getlines fromlines minoutline minoutline minoutline fromline fromlines set_trxname get_trxname copyvalues fromline getad_client_id getad_org_id copyvalues fromline fromline getad_client_id fromline getad_org_id setm_inout_id getm_inout_id set_valuenocheck m_inoutline_id i_zero setorder setc_orderline_id setm_attributesetinstance_id sets_resourceassignment_id setref_inoutline_id setisinvoiced setconfirmedqty setpickedqty setscrappedqty settargetqty getm_warehouse_id othershipment getm_warehouse_id setm_locator_id setm_locator_id setref_inoutline_id fromline getm_inoutline_id fromline getc_orderline_id morderline morderline getctx fromline getc_orderline_id get_trxname getref_orderline_id setc_orderline_id getref_orderline_id setprocessed get_trxname fromline setref_inoutline_id getm_inoutline_id fromline get_trxname fromlines fromlines set reversal param reversal reversal private void set reversal boolean reversal m reversal reversal setreversal m_reversal set reversal is reversal return reversal private boolean is reversal return m reversal setreversal isreversal m_reversal set processed propergate to lines taxes param processed processed public void set processed boolean processed super set processed processed if get id 0 return string sql update m inoutline set processed processed y n where m inout id getm inout id int no line db execute update sql get trxname m lines null log fine processed lines no line setprocessed setprocessed get_id m_inoutline m_inout_id getm_inout_id noline executeupdate get_trxname m_lines noline get b partner return partner public mb partner getb partner if m partner null m partner new mb partner get ctx getc bpartner id get trxname return m partner bpartner mbpartner getbpartner m_partner m_partner mbpartner getctx getc_bpartner_id get_trxname m_partner set document type param doc base type doc type m doc type docbasetype public void setc doctype id string doc base type string sql select c doctype id from c doctype where ad client id and doc base type and isso trx isso trx y n order by is default desc int c doctype id db getsql value null sql getad client id doc base type if c doctype id 0 log log level severe not found for ac client id getad client id doc base type else log fine doc base type doc base type c doctype id c doctype id setc doctype id c doctype id boolean isso trx m doc type docbasetype materialdelivery equals doc base type set isso trx isso trx docbasetype mdoctype docbasetype_ setc_doctype_id docbasetype c_doctype_id c_doctype ad_client_id docbasetype issotrx issotrx isdefault c_doctype_id getsqlvalue getad_client_id docbasetype c_doctype_id ac_client_id getad_client_id docbasetype docbasetype docbasetype c_doctype_id c_doctype_id setc_doctype_id c_doctype_id issotrx mdoctype docbasetype_materialdelivery docbasetype setissotrx issotrx set default c doctype id based on so flag public void setc doctype id if isso trx setc doctype id m doc type docbasetype materialdelivery else setc doctype id m doc type docbasetype materialreceipt c_doctype_id setc_doctype_id issotrx setc_doctype_id mdoctype docbasetype_materialdelivery setc_doctype_id mdoctype docbasetype_materialreceipt set business partner defaults details param bp business partner public void setb partner mb partner bp if bp null return setc bpartner id bp getc bpartner id set locations mb partner location locs bp get locations false if locs null for int i 0 i locs length i if locs i is ship to setc bpartner location id locs i getc bpartner location id set to first if not set if getc bpartner location id 0 locs length 0 setc bpartner location id locs 0 getc bpartner location id if getc bpartner location id 0 log log level severe has no to address bp set contact m user contacts bp get contacts false if contacts null contacts length 0 get first user setad user id contacts 0 getad user id setbpartner mbpartner setc_bpartner_id getc_bpartner_id mbpartnerlocation getlocations isshipto setc_bpartner_location_id getc_bpartner_location_id getc_bpartner_location_id setc_bpartner_location_id getc_bpartner_location_id getc_bpartner_location_id muser getcontacts setad_user_id getad_user_id create the missing next confirmation public void create confirmation m doc type dt m doc type get get ctx getc doctype id boolean pick dt is pickqa confirm boolean ship dt is ship confirm nothing to do if pick ship log fine no need return create both after each other if pick ship boolean have pick false boolean have ship false m in out confirm confirmations get confirmations false for int i 0 i confirmations length i m in out confirm confirm confirmations i if m in out confirm confirmtype pickqaconfirm equals confirm get confirm type if confirm is processed wait intil done log fine unprocessed confirm return have pick true else if m in out confirm confirmtype shipreceiptconfirm equals confirm get confirm type have ship true create pick if have pick m in out confirm create this m in out confirm confirmtype pickqaconfirm false return create ship if have ship m in out confirm create this m in out confirm confirmtype shipreceiptconfirm false return return create just one if pick m in out confirm create this m in out confirm confirmtype pickqaconfirm true else if ship m in out confirm create this m in out confirm confirmtype shipreceiptconfirm true createconfirmation mdoctype mdoctype getctx getc_doctype_id ispickqaconfirm isshipconfirm havepick haveship minoutconfirm getconfirmations minoutconfirm minoutconfirm confirmtype_pickqaconfirm getconfirmtype isprocessed havepick minoutconfirm confirmtype_shipreceiptconfirm getconfirmtype haveship havepick minoutconfirm minoutconfirm confirmtype_pickqaconfirm haveship minoutconfirm minoutconfirm confirmtype_shipreceiptconfirm minoutconfirm minoutconfirm confirmtype_pickqaconfirm minoutconfirm minoutconfirm confirmtype_shipreceiptconfirm set warehouse and check set organization param m warehouse id id public void setm warehouse id int m warehouse id if m warehouse id 0 log severe ignored cannot set ad warehouse id to 0 return super setm warehouse id m warehouse id m warehouse wh m warehouse get get ctx getm warehouse id if wh getad org id getad org id log warning m warehouse id m warehouse id overwritten ad org id getad org id wh getad org id setad org id wh getad org id m_warehouse_id setm_warehouse_id m_warehouse_id m_warehouse_id ad_warehouse_id setm_warehouse_id m_warehouse_id mwarehouse mwarehouse getctx getm_warehouse_id getad_org_id getad_org_id m_warehouse_id m_warehouse_id ad_org_id getad_org_id getad_org_id setad_org_id getad_org_id before save param new record new return true or false protected boolean before save boolean new record warehouse org if new record m warehouse wh m warehouse get get ctx getm warehouse id if wh getad org id getad org id log save error warehouse org conflict return false shipment needs order if isso trx getc order id 0 log save error fill mandatory msg translate get ctx c order id return false return true newrecord beforesave newrecord newrecord mwarehouse mwarehouse getctx getm_warehouse_id getad_org_id getad_org_id saveerror warehouseorgconflict issotrx getc_order_id saveerror fillmandatory getctx c_order_id after save param new record new param success success return success protected boolean after save boolean new record boolean success if success new record return success if is valuechanged ad org id string sql update m inoutline ol set ad org id select ad org id from m inout o where ol m inout id o m inout id where m inout id getc order id int no db execute update sql get trxname log fine lines no return true newrecord aftersave newrecord newrecord is_valuechanged ad_org_id m_inoutline ad_org_id ad_org_id m_inout m_inout_id m_inout_id m_inout_id getc_order_id executeupdate get_trxname process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info to string set processing false return true unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info to string set doc action docaction prepare return true invalidateit tostring setdocaction docaction_prepare prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctype id std period open if m period is open get ctx get date acct dt get doc base type m processmsg period closed return doc action status invalid credit check if isso trx is reversal mb partner bp new mb partner get ctx getc bpartner id null if mb partner socreditstatus creditstop equals bp getso credit status m processmsg b partner credit stop total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid if mb partner socreditstatus credithold equals bp getso credit status m processmsg b partner credit hold total open balance bp get total open balance so creditlimit bp getso creditlimit return doc action status invalid big decimal not invoiced amt mb partner get not invoiced amt getc bpartner id if mb partner socreditstatus credithold equals bp getso credit status not invoiced amt m processmsg b partner overs credit hold total open balance bp get total open balance not invoiced amt not invoiced amt so creditlimit bp getso creditlimit return doc action status invalid lines m in out line lines get lines true if lines null lines length 0 m processmsg no lines return doc action status invalid mandatory attributes for int i 0 i lines length i if lines i getm attributesetinstance id 0 continue m product product lines i get product if product null int m attributeset id product getm attributeset id if m attributeset id 0 m attribute set mas m attribute set get get ctx m attributeset id if mas null isso trx mas is mandatory isso trx mas is mandatory always m processmsg m attributeset id is mandatory return doc action status invalid if is reversal don t change reversal check material policy set masi create confirmation m justprepared true if docaction complete equals get doc action set doc action docaction complete return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed docaction status_invalid issotrx isreversal mbpartner mbpartner getctx getc_bpartner_id mbpartner socreditstatus_creditstop getsocreditstatus m_processmsg bpartnercreditstop totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid mbpartner socreditstatus_credithold getsocreditstatus m_processmsg bpartnercredithold totalopenbalance gettotalopenbalance so_creditlimit getso_creditlimit docaction status_invalid bigdecimal notinvoicedamt mbpartner getnotinvoicedamt getc_bpartner_id mbpartner socreditstatus_credithold getsocreditstatus notinvoicedamt m_processmsg bpartneroverscredithold totalopenbalance gettotalopenbalance notinvoicedamt notinvoicedamt so_creditlimit getso_creditlimit docaction status_invalid minoutline getlines m_processmsg nolines docaction status_invalid getm_attributesetinstance_id mproduct getproduct m_attributeset_id getm_attributeset_id m_attributeset_id mattributeset mattributeset getctx m_attributeset_id issotrx ismandatory issotrx ismandatoryalways m_processmsg m_attributeset_id ismandatory docaction status_invalid isreversal checkmaterialpolicy createconfirmation m_justprepared docaction_complete getdocaction setdocaction docaction_complete docaction status_inprogress approve document return true if success public boolean approve it log info to string set is approved true return true approveit tostring setisapproved reject approval return true if success public boolean reject it log info to string set is approved false return true rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status outstanding not processed incoming confirmations m in out confirm confirmations get confirmations true for int i 0 i confirmations length i m in out confirm confirm confirmations i if confirm is processed if m in out confirm confirmtype customerconfirmation equals confirm get confirm type continue m processmsg open m inoutconfirm id confirm get confirm type name confirm get document no return doc action status inprogress implicit approval if is approved approve it log info to string string buffer info new string buffer for all lines m in out line lines get lines false for int line index 0 line index lines length line index m in out line s line lines line index m product product s line get product qty type string movement type get movement type big decimal qty s line get movement qty if movement type char at 1 c customer shipment v vendor return qty qty negate big decimal qtyso env zero big decimal qtypo env zero update order line m order line o line null if s line getc orderline id 0 o line new m order line get ctx s line getc orderline id get trxname log fine order line reserved o line get qty reserved delivered o line get qty delivered if isso trx qtyso s line get movement qty else qtypo s line get movement qty log info line s line get line qty s line get movement qty stock movement counterpart m order reserve stock if product null product is stocked log fine material transaction m transaction mtrx null reservation asi assume none int reservationattributesetinstance id 0 s line getm attributesetinstance id if o line null reservationattributesetinstance id o line getm attributesetinstance id if s line getm attributesetinstance id 0 m in out linema mas m in out linema get get ctx s line getm inoutline id get trxname for int j 0 j mas length j m in out linema ma mas j big decimal qtyma ma get movement qty if movement type char at 1 c customer shipment v vendor return qtyma qtyma negate big decimal qtysoma env zero big decimal qtypoma env zero if s line getc orderline id 0 if isso trx qtysoma ma get movement qty else qtypoma ma get movement qty update storage see also v match create match record if m storage add get ctx getm warehouse id s line getm locator id s line getm product id ma getm attributesetinstance id reservationattributesetinstance id qtyma qtysoma negate qtypoma negate get trxname m processmsg cannot correct inventory ma return doc action status invalid create transaction mtrx new m transaction get ctx movement type s line getm locator id s line getm product id ma getm attributesetinstance id qtyma get movement date get trxname mtrx setm inoutline id s line getm inoutline id if mtrx save m processmsg could not create material transaction ma return doc action status invalid s line getm attributesetinstance id 0 if mtrx null fallback update storage see also v match create match record if m storage add get ctx getm warehouse id s line getm locator id s line getm product id s line getm attributesetinstance id reservationattributesetinstance id qty qtyso negate qtypo negate get trxname m processmsg cannot correct inventory return doc action status invalid fall back create transaction mtrx new m transaction get ctx movement type s line getm locator id s line getm product id s line getm attributesetinstance id qty get movement date get trxname mtrx setm inoutline id s line getm inoutline id if mtrx save m processmsg could not create material transaction return doc action status invalid stock movement correct order line if product null o line null other in v match create match record o line set qty reserved o line get qty reserved subtract s line get movement qty update sales order line if o line null if isso trx po is done by matching s line getm product id 0 po charges empty lines if isso trx o line set qty delivered o line get qty delivered subtract qty else o line set qty delivered o line get qty delivered add qty o line set date delivered get movement date overwrite last if o line save m processmsg could not update order line return doc action status invalid else log fine order line reserved o line get qty reserved delivered o line get qty reserved create asset for so if product null isso trx product is create asset s line get movement qty signum 0 is reversal log fine asset info append a asset id int no assets s line get movement qty int value if product is one asset peruom no assets 1 for int i 0 i no assets i if i 0 info append int delivery count i 1 if product is one asset peruom delivery count 0 m asset asset new m asset this s line delivery count if asset save get trxname m processmsg could not create asset return doc action status invalid info append asset get value asset matching if isso trx s line getm product id 0 is reversal big decimal match qty s line get movement qty invoice receipt match requires product m invoice line i line m invoice line get of in out line s line if i line null i line getm product id 0 m match inv matches m match inv get get ctx s line getm inoutline id i line getc invoiceline id get trxname if matches null matches length 0 m match inv inv new m match inv i line get movement date match qty if s line getm attributesetinstance id i line getm attributesetinstance id i line setm attributesetinstance id s line getm attributesetinstance id i line save update matched invoice with asi inv setm attributesetinstance id s line getm attributesetinstance id if inv save get trxname m processmsg could not create inv matching return doc action status invalid link to order if s line getc orderline id 0 log fine po matching ship po m matchpo po m matchpo create null s line get movement date match qty if po save get trxname m processmsg could not create po matching return doc action status invalid update po with asi if o line null o line getm attributesetinstance id 0 o line setm attributesetinstance id s line getm attributesetinstance id o line save get trxname else no order try finding links via invoice invoice has an order link if i line null i line getc orderline id 0 invoice is created before shipment log fine po inv matching ship invoice m matchpo po m matchpo create i line s line get movement date match qty if po save get trxname m processmsg could not create po inv matching return doc action status invalid update po with asi o line new m order line get ctx po getc orderline id get trxname if o line null o line getm attributesetinstance id 0 o line setm attributesetinstance id s line getm attributesetinstance id o line save get trxname no order po matching for all lines counter documents m in out counter create counter doc if counter null info append counter doc m inout id append counter get document no user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid m processmsg info to string set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress minoutconfirm getconfirmations minoutconfirm isprocessed minoutconfirm confirmtype_customerconfirmation getconfirmtype m_processmsg m_inoutconfirm_id getconfirmtypename getdocumentno docaction status_inprogress isapproved approveit tostring stringbuffer stringbuffer minoutline getlines lineindex lineindex lineindex minoutline sline lineindex mproduct sline getproduct movementtype getmovementtype bigdecimal sline getmovementqty movementtype charat bigdecimal bigdecimal morderline oline sline getc_orderline_id oline morderline getctx sline getc_orderline_id get_trxname orderline oline getqtyreserved oline getqtydelivered issotrx sline getmovementqty sline getmovementqty sline getline sline getmovementqty morder reservestock isstocked mtransaction reservationattributesetinstance_id sline getm_attributesetinstance_id oline reservationattributesetinstance_id oline getm_attributesetinstance_id sline getm_attributesetinstance_id minoutlinema minoutlinema getctx sline getm_inoutline_id get_trxname minoutlinema bigdecimal getmovementqty movementtype charat bigdecimal bigdecimal sline getc_orderline_id issotrx getmovementqty getmovementqty vmatch creatematchrecord mstorage getctx getm_warehouse_id sline getm_locator_id sline getm_product_id getm_attributesetinstance_id reservationattributesetinstance_id get_trxname m_processmsg docaction status_invalid mtransaction getctx movementtype sline getm_locator_id sline getm_product_id getm_attributesetinstance_id getmovementdate get_trxname setm_inoutline_id sline getm_inoutline_id m_processmsg docaction status_invalid sline getm_attributesetinstance_id vmatch creatematchrecord mstorage getctx getm_warehouse_id sline getm_locator_id sline getm_product_id sline getm_attributesetinstance_id reservationattributesetinstance_id get_trxname m_processmsg docaction status_invalid fallback mtransaction getctx movementtype sline getm_locator_id sline getm_product_id sline getm_attributesetinstance_id getmovementdate get_trxname setm_inoutline_id sline getm_inoutline_id m_processmsg docaction status_invalid oline vmatch creatematchrecord oline setqtyreserved oline getqtyreserved sline getmovementqty oline issotrx sline getm_product_id issotrx oline setqtydelivered oline getqtydelivered oline setqtydelivered oline getqtydelivered oline setdatedelivered getmovementdate oline m_processmsg docaction status_invalid orderline oline getqtyreserved oline getqtyreserved issotrx iscreateasset sline getmovementqty isreversal a_asset_id noassets sline getmovementqty intvalue isoneassetperuom noassets noassets deliverycount isoneassetperuom deliverycount masset masset sline deliverycount get_trxname m_processmsg docaction status_invalid getvalue issotrx sline getm_product_id isreversal bigdecimal matchqty sline getmovementqty minvoiceline iline minvoiceline getofinoutline sline iline iline getm_product_id mmatchinv mmatchinv getctx sline getm_inoutline_id iline getc_invoiceline_id get_trxname mmatchinv mmatchinv iline getmovementdate matchqty sline getm_attributesetinstance_id iline getm_attributesetinstance_id iline setm_attributesetinstance_id sline getm_attributesetinstance_id iline setm_attributesetinstance_id sline getm_attributesetinstance_id get_trxname m_processmsg docaction status_invalid sline getc_orderline_id mmatchpo mmatchpo sline getmovementdate matchqty get_trxname m_processmsg docaction status_invalid oline oline getm_attributesetinstance_id oline setm_attributesetinstance_id sline getm_attributesetinstance_id oline get_trxname iline iline getc_orderline_id mmatchpo mmatchpo iline sline getmovementdate matchqty get_trxname m_processmsg docaction status_invalid oline morderline getctx getc_orderline_id get_trxname oline oline getm_attributesetinstance_id oline setm_attributesetinstance_id sline getm_attributesetinstance_id oline get_trxname minout createcounterdoc counterdoc m_inout_id getdocumentno modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid m_processmsg tostring setprocessed setdocaction docaction_close docaction status_completed check material policy sets line asi private void check material policy int no m in out linema delete in outma getm inout id get trxname if no 0 log config delete old no m in out line lines get lines false incoming trx string movement type get movement type boolean in trx movement type char at 1 v vendor receipt m client client m client get get ctx check lines for int i 0 i lines length i m in out line line lines i boolean need save false m product product line get product need to have location if product null line getm locator id 0 line setm warehouse id getm warehouse id line setm locator id in trx env zero line get movement qty default locator need save true attribute set instance if product null line getm attributesetinstance id 0 if in trx m attribute set instance asi new m attribute set instance get ctx 0 get trxname asi set client org getad client id 0 asi setm attributeset id product getm attributeset id if asi save line setm attributesetinstance id asi getm attributesetinstance id log config new asi line need save true else outgoing trx m product category pc m product category get get ctx product getm product category id string mm policy pc getmm policy if mm policy null mm policy length 0 mm policy client getmm policy m storage storages m storage get all withasi get ctx line getm product id line getm locator id m client mmpolicy fifo equals mm policy get trxname big decimal qty to deliver line get movement qty for int ii 0 ii storages length ii m storage storage storages ii if ii 0 if storage get qty on hand compare to qty to deliver 0 line setm attributesetinstance id storage getm attributesetinstance id need save true log config direct line qty to deliver env zero else log config split line m in out linema ma new m in out linema line storage getm attributesetinstance id storage get qty on hand if ma save qty to deliver qty to deliver subtract storage get qty on hand log fine ii ma qty to deliver qty to deliver else create addl material allocation m in out linema ma new m in out linema line storage getm attributesetinstance id qty to deliver if storage get qty on hand compare to qty to deliver 0 qty to deliver env zero else ma set movement qty storage get qty on hand qty to deliver qty to deliver subtract storage get qty on hand if ma save log fine ii ma qty to deliver qty to deliver if qty to deliver signum 0 break for all storages no attribute set instance found for remainder if qty to deliver signum 0 m in out linema ma new m in out linema line 0 qty to deliver if ma save log fine ma outgoing trx attribute set instance if need save line save log severe not saved line for all lines checkmaterialpolicy minoutlinema deleteinoutma getm_inout_id get_trxname minoutline getlines movementtype getmovementtype intrx movementtype charat mclient mclient getctx minoutline needsave mproduct getproduct getm_locator_id setm_warehouse_id getm_warehouse_id setm_locator_id intrx getmovementqty needsave getm_attributesetinstance_id intrx mattributesetinstance mattributesetinstance getctx get_trxname setclientorg getad_client_id setm_attributeset_id getm_attributeset_id setm_attributesetinstance_id getm_attributesetinstance_id needsave mproductcategory mproductcategory getctx getm_product_category_id mmpolicy getmmpolicy mmpolicy mmpolicy mmpolicy getmmpolicy mstorage mstorage getallwithasi getctx getm_product_id getm_locator_id mclient mmpolicy_fifo mmpolicy get_trxname bigdecimal qtytodeliver getmovementqty mstorage getqtyonhand compareto qtytodeliver setm_attributesetinstance_id getm_attributesetinstance_id needsave qtytodeliver minoutlinema minoutlinema getm_attributesetinstance_id getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver minoutlinema minoutlinema getm_attributesetinstance_id qtytodeliver getqtyonhand compareto qtytodeliver qtytodeliver setmovementqty getqtyonhand qtytodeliver qtytodeliver getqtyonhand qtytodeliver qtytodeliver qtytodeliver attributesetinstance qtytodeliver minoutlinema minoutlinema qtytodeliver attributesetinstance needsave create counter document private m in out create counter doc is this a counter doc if getref inout id 0 return null org must be linked to b partner m org org m org get get ctx getad org id int counterc bpartner id org getlinkedc bpartner id if counterc bpartner id 0 return null business partner needs to be linked to org mb partner bp new mb partner get ctx getc bpartner id null int counterad org id bp getad orgbp id int if counterad org id 0 return null mb partner counterbp new mb partner get ctx counterc bpartner id null m org info counter org info m org info get get ctx counterad org id log info counter bp counterbp get name document type int c doctypetarget id 0 m doc type counter counterdt m doc type counter get counter doc type get ctx getc doctype id if counterdt null log fine counterdt to string if counterdt is create counter counterdt is valid return null c doctypetarget id counterdt getcounter c doctype id else indirect c doctypetarget id m doc type counter getcounterdoctype id get ctx getc doctype id log fine indirect c doctypetarget id c doctypetarget id if c doctypetarget id 0 return null deep copy m in out counter copy from this get movement date c doctypetarget id isso trx true get trxname true counter setad org id counterad org id counter setm warehouse id counter org info getm warehouse id counter setb partner counterbp refernces should not be required counter setsalesrep id getsalesrep id counter save get trxname string movement type counter get movement type boolean in trx movement type char at 1 v vendor receipt update copied lines m in out line counter lines counter get lines true for int i 0 i counter lines length i m in out line counter line counter lines i counter line set client org counter counter line setm warehouse id counter getm warehouse id counter line setm locator id 0 counter line setm locator id in trx env zero counter line get movement qty counter line save get trxname log fine counter to string document action if counterdt null if counterdt get doc action null counter set doc action counterdt get doc action counter process it counterdt get doc action counter save get trxname return counter minout createcounterdoc getref_inout_id bpartner morg morg getctx getad_org_id counterc_bpartner_id getlinkedc_bpartner_id counterc_bpartner_id mbpartner mbpartner getctx getc_bpartner_id counterad_org_id getad_orgbp_id_int counterad_org_id mbpartner mbpartner getctx counterc_bpartner_id morginfo counterorginfo morginfo getctx counterad_org_id getname c_doctypetarget_id mdoctypecounter mdoctypecounter getcounterdoctype getctx getc_doctype_id tostring iscreatecounter isvalid c_doctypetarget_id getcounter_c_doctype_id c_doctypetarget_id mdoctypecounter getcounterdoctype_id getctx getc_doctype_id c_doctypetarget_id c_doctypetarget_id c_doctypetarget_id minout copyfrom getmovementdate c_doctypetarget_id issotrx get_trxname setad_org_id counterad_org_id setm_warehouse_id counterorginfo getm_warehouse_id setbpartner setsalesrep_id getsalesrep_id get_trxname movementtype getmovementtype intrx movementtype charat minoutline counterlines getlines counterlines minoutline counterline counterlines counterline setclientorg counterline setm_warehouse_id getm_warehouse_id counterline setm_locator_id counterline setm_locator_id intrx counterline getmovementqty counterline get_trxname tostring getdocaction setdocaction getdocaction processit getdocaction get_trxname void document return true if success public boolean void it log info to string if docstatus closed equals get doc status docstatus reversed equals get doc status docstatus voided equals get doc status m processmsg document closed get doc status return false not processed if docstatus drafted equals get doc status docstatus invalid equals get doc status docstatus inprogress equals get doc status docstatus approved equals get doc status docstatus notapproved equals get doc status set lines to 0 m in out line lines get lines false for int i 0 i lines length i m in out line line lines i big decimal old line get movement qty if old signum 0 line set qty env zero line add description void old line save get trxname else return reverse correct it set processed true set doc action docaction none return true voidit tostring docstatus_closed getdocstatus docstatus_reversed getdocstatus docstatus_voided getdocstatus m_processmsg getdocstatus docstatus_drafted getdocstatus docstatus_invalid getdocstatus docstatus_inprogress getdocstatus docstatus_approved getdocstatus docstatus_notapproved getdocstatus minoutline getlines minoutline bigdecimal getmovementqty setqty adddescription get_trxname reversecorrectit setprocessed setdocaction docaction_none close document return true if success public boolean close it log info to string set processed true set doc action docaction none return true closeit tostring setprocessed setdocaction docaction_none reverse correction same date return true if success public boolean reverse correct it log info to string m doc type dt m doc type get get ctx getc doctype id if m period is open get ctx get date acct dt get doc base type m processmsg period closed return false reverse delete matching if isso trx m match inv m inv m match inv get in out get ctx getm inout id get trxname for int i 0 i m inv length i m inv i delete true m matchpo mpo m matchpo get in out get ctx getm inout id get trxname for int i 0 i mpo length i if mpo i getc invoiceline id 0 mpo i delete true else mpo i setm inoutline id 0 mpo i save deep copy m in out reversal copy from this get movement date getc doctype id isso trx false get trxname true if reversal null m processmsg could not create ship reversal return false reversal set reversal true reverse line qty m in out line s lines get lines false m in out line r lines reversal get lines false for int i 0 i r lines length i m in out line r line r lines i r line set qty entered r line get qty entered negate r line set movement qty r line get movement qty negate r line setm attributesetinstance id s lines i getm attributesetinstance id if r line save get trxname m processmsg could not correct ship reversal line return false we need to copy ma if r line getm attributesetinstance id 0 m in out linema mas m in out linema get get ctx s lines i getm inoutline id get trxname for int j 0 j mas length j m in out linema ma new m in out linema r line mas j getm attributesetinstance id mas j get movement qty negate if ma save de activate asset m asset asset m asset get from shipment get ctx s lines i getm inoutline id get trxname if asset null asset set is active false asset add description reversal get document no r line get line asset save reversal setc order id getc order id reversal add description get document no if reversal process it doc action action complete reversal get doc status equals doc action status completed m processmsg reversal error reversal get process msg return false reversal close it reversal set doc status docstatus reversed reversal set doc action docaction none reversal save get trxname add description reversal get document no m processmsg reversal get document no set processed true set doc status docstatus reversed may come from void set doc action docaction none return true reversecorrectit tostring mdoctype mdoctype getctx getc_doctype_id mperiod isopen getctx getdateacct getdocbasetype m_processmsg periodclosed issotrx mmatchinv minv mmatchinv getinout getctx getm_inout_id get_trxname minv minv mmatchpo mmatchpo getinout getctx getm_inout_id get_trxname getc_invoiceline_id setm_inoutline_id minout copyfrom getmovementdate getc_doctype_id issotrx get_trxname m_processmsg setreversal minoutline slines getlines minoutline rlines getlines rlines minoutline rline rlines rline setqtyentered rline getqtyentered rline setmovementqty rline getmovementqty rline setm_attributesetinstance_id slines getm_attributesetinstance_id rline get_trxname m_processmsg rline getm_attributesetinstance_id minoutlinema minoutlinema getctx slines getm_inoutline_id get_trxname minoutlinema minoutlinema rline getm_attributesetinstance_id getmovementqty masset masset getfromshipment getctx slines getm_inoutline_id get_trxname setisactive adddescription getdocumentno rline getline setc_order_id getc_order_id adddescription getdocumentno processit docaction action_complete getdocstatus docaction status_completed m_processmsg getprocessmsg closeit setdocstatus docstatus_reversed setdocaction docaction_none get_trxname adddescription getdocumentno m_processmsg getdocumentno setprocessed setdocstatus docstatus_reversed setdocaction docaction_none reverse accrual none return false public boolean reverse accrual it log info to string return false reverseaccrualit tostring re activate return false public boolean re activate it log info to string return false reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx total lines append append get total lines append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx totallines gettotallines getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return getsalesrep id ad_user_id getdoc_user_id getsalesrep_id get document approval amount return amount public big decimal get approval amt return env zero bigdecimal getapprovalamt get c currency id return accounting currency public int getc currency id return env get context as int get ctx c currency id c_currency_id getc_currency_id getcontextasint getctx c_currency_id document status is complete or closed return true if co cl or re public boolean is complete string ds get doc status return docstatus completed equals ds docstatus closed equals ds docstatus reversed equals ds iscomplete getdocstatus docstatus_completed docstatus_closed docstatus_reversed data parent constructor param name data element name public print data properties ctx string name if name null throw new illegal argument exception name cannot be null m ctx ctx m name name printdata illegalargumentexception m_ctx m_name data parent constructor param name data element name param nodes array list with nodes content not checked public print data properties ctx string name array list object nodes if name null throw new illegal argument exception name cannot be null m ctx ctx m name name if nodes null m nodes nodes arraylist printdata arraylist illegalargumentexception m_ctx m_name m_nodes get context return context public properties get ctx return m ctx getctx m_ctx get name return name public string get name return m name getname m_name set optional column info param new info column info public void set column info print data column new info m columninfo new info newinfo setcolumninfo printdatacolumn newinfo m_columninfo newinfo get optional column info return column info public print data column get column info return m columninfo printdatacolumn getcolumninfo m_columninfo set sql optional param sql sql public void setsql string sql m sql sql m_sql get optional sql return sql public string getsql return m sql m_sql set table name optional param table name table name public void set table name string table name m tablename table name tablename tablename tablename settablename tablename m_tablename tablename get optional table name return table name public string get table name return m tablename tablename tablename gettablename m_tablename string representation return info public string to string string buffer sb new string buffer print data sb append m name append rows append m rows size if m tablename null sb append table name append m tablename sb append return sb to string tostring stringbuffer stringbuffer printdata m_name m_rows m_tablename tablename m_tablename tostring returns true if no nodes in row return true if no nodes in row public boolean is empty if m nodes null return true return m nodes size 0 isempty m_nodes m_nodes return number of nodes in row return number of nodes in row public int get node count if m nodes null return 0 return m nodes size getnodecount m_nodes m_nodes add row param function row true if function row param level no line detail level number 0 normal public void add row boolean function row int level no m nodes new array list object m row m rows size m rows add m nodes if function row m functionrows add new integer m row if m haslevelno level no 0 add node new print data element level no new integer level no display type integer functionrow levelno addrow functionrow levelno m_nodes arraylist m_row m_rows m_rows m_nodes functionrow m_functionrows m_row m_haslevelno levelno addnode printdataelement level_no levelno displaytype set row index param row row index return true if success public boolean set row index int row if row 0 row m rows size return false m row row m nodes array list object m rows get m row return true setrowindex m_rows m_row m_nodes arraylist m_rows m_row set row index to next return true if success public boolean set row next return set row index m row 1 setrownext setrowindex m_row get row count return row count public int get row count return m rows size getrowcount m_rows get current row index return row index public int get row index return m row getrowindex m_row is the row a function row param row row no return true if function row public boolean is function row int row return m functionrows contains new integer row isfunctionrow m_functionrows is the current row a function row return true if function row public boolean is function row return m functionrows contains new integer m row isfunctionrow m_functionrows m_row is the current row a function row return true if function row public boolean is page break page break requires function and meta data if is function row m nodes null for int i 0 i m nodes size i object o m nodes get i if o instanceof print data element print data element pde print data element o if pde is page break return true return false ispagebreak isfunctionrow m_nodes m_nodes m_nodes printdataelement printdataelement printdataelement ispagebreak print data has level no param has level no true if sql contains level no public void set has level no boolean has level no m haslevelno has level no printdata haslevelno levelno sethaslevelno haslevelno m_haslevelno haslevelno print data has level no return true if sql contains level no public boolean has level no return m haslevelno printdata levelno haslevelno m_haslevelno get line level number for current row return line level no 0 default public int get line level no if m nodes null m haslevelno return 0 for int i 0 i m nodes size i object o m nodes get i if o instanceof print data element print data element pde print data element o if level no equals pde get column name integer ii integer pde get value return ii int value return 0 getlinelevelno m_nodes m_haslevelno m_nodes m_nodes printdataelement printdataelement printdataelement level_no getcolumnname getvalue intvalue add parent node to data structure row param parent parent public void add node print data parent if parent null throw new illegal argument exception parent cannot be null if m nodes null add row false 0 m nodes add parent addnode printdata illegalargumentexception m_nodes addrow m_nodes add node to data structure row param node node public void add node print data element node if node null throw new illegal argument exception node cannot be null if m nodes null add row false 0 m nodes add node addnode printdataelement illegalargumentexception m_nodes addrow m_nodes get node with index in row param index index return print data element of index or null public object get node int index if m nodes null index 0 index m nodes size return null return m nodes get index printdata getnode m_nodes m_nodes m_nodes get node with name in row param name name return print data element with name or null public object get node string name int index get index name if index 0 return null return m nodes get index printdata getnode getindex m_nodes get node with ad column id in row param ad column id ad column id return print data element with ad column id or null public object get node integer ad column id int index get index ad column id int value if index 0 return null return m nodes get index ad_column_id ad_column_id ad_column_id printdata ad_column_id getnode ad_column_id getindex ad_column_id intvalue m_nodes get primary key in row return pk or null public print data element getp key if m nodes null return null for int i 0 i m nodes size i object o m nodes get i if o instanceof print data element print data element pde print data element o if pde isp key return pde return null printdataelement getpkey m_nodes m_nodes m_nodes printdataelement printdataelement printdataelement ispkey get index of node in structure not recursing row param column name name return index or 1 public int get index string column name if m nodes null return 1 for int i 0 i m nodes size i object o m nodes get i if o instanceof print data element if column name equals print data element o get column name return i else if o instanceof print data if column name equals print data o get name return i else log log level severe element not print data element o get class get name as data is stored sparse there might be lots of null values log log level severe print data get index element not found name return 1 columnname getindex columnname m_nodes m_nodes m_nodes printdataelement columnname printdataelement getcolumnname printdata columnname printdata getname printdata getclass getname printdata getindex get index of node in structure not recursing row param ad column id ad column id return index or 1 public int get index int ad column id if m columninfo null return 1 for int i 0 i m columninfo length i if m columninfo i getad column id ad column id return get index m columninfo i get column name log log level severe column not found ad column id ad column id if ad column id 0 trace print stack return 1 ad_column_id ad_column_id getindex ad_column_id m_columninfo m_columninfo m_columninfo getad_column_id ad_column_id getindex m_columninfo getcolumnname ad_column_id ad_column_id ad_column_id printstack dump all data header and rows public void dump dump this dump all data public void dump header dump header this dumpheader dumpheader dump all data public void dump current row dump row this m row dumpcurrentrow dumprow m_row dump all print data header and rows param pd print data private static void dump print data pd dump header pd for int i 0 i pd get row count i dump row pd i printdata printdata dumpheader getrowcount dumprow dump print data header param pd print data private static void dump header print data pd log info pd to string if pd get column info null for int i 0 i pd get column info length i log config i pd get column info i printdata dumpheader printdata tostring getcolumninfo getcolumninfo getcolumninfo dump row param pd print data param row row private static void dump row print data pd int row log info row row if row 0 row pd get row count log warning invalid return pd set row index row if pd get node count 0 log config n a return for int i 0 i pd get node count i object obj pd get node i if obj null log config null else if obj instanceof print data log config included dump print data obj else if obj instanceof print data element log config print data element obj to stringx else log config invalid obj dumprow printdata getrowcount setrowindex getnodecount getnodecount getnode printdata printdata printdataelement printdataelement tostringx get xml document representation return xml document public document get document document document null try document builder factory factory document builder factory new instance system out println factory get class get name document builder builder factory new document builder document builder new document document append child document create comment compiere get summary ascii catch exception e system err println e e print stack trace root element root document create element print data xml tag root set attribute xml attribute name get name root set attribute xml attribute count string value of get row count document append child root processxml this document root return document getdocument documentbuilderfactory documentbuilderfactory newinstance getclass getname documentbuilder newdocumentbuilder newdocument appendchild createcomment getsummaryascii printstacktrace createelement printdata xml_tag setattribute xml_attribute_name getname setattribute xml_attribute_count valueof getrowcount appendchild process print data tree param pd print data param document document param root element to add to private static void processxml print data pd document document element root for int r 0 r pd get row count r pd set row index r element row document create element print data xml row tag row set attribute xml attribute no string value of r if pd is function row row set attribute xml attribute function row yes root append child row for int i 0 i pd get node count i object o pd get node i if o instanceof print data print data pd x print data o element element document create element print data xml tag element set attribute xml attribute name pd x get name element set attribute xml attribute count string value of pd x get row count row append child element processxml pd x document element recursive call else if o instanceof print data element print data element pde print data element o if pde is null element element document create element print data element xml tag element set attribute print data element xml attribute name pde get column name if pde has key element set attribute print data element xml attribute key pde get value key element append child document create text node pde get value display null not formatted row append child element else log log level severe element not print data element o get class get name columns rows printdata printdata getrowcount setrowindex createelement printdata xml_row_tag setattribute xml_attribute_no valueof isfunctionrow setattribute xml_attribute_function_row appendchild getnodecount getnode printdata printdata pd_x printdata createelement printdata xml_tag setattribute xml_attribute_name pd_x getname setattribute xml_attribute_count valueof pd_x getrowcount appendchild pd_x printdataelement printdataelement printdataelement isnull createelement printdataelement xml_tag setattribute printdataelement xml_attribute_name getcolumnname haskey setattribute printdataelement xml_attribute_key getvaluekey appendchild createtextnode getvaluedisplay appendchild printdata getclass getname create xml representation to stream result param result stream result return true if success public boolean createxml stream result result try dom source source new dom source get document transformer factory t factory transformer factory new instance transformer transformer t factory new transformer transformer transform source result catch exception e log log level severe stream result e return false return true streamresult streamresult streamresult domsource domsource getdocument transformerfactory tfactory transformerfactory newinstance tfactory newtransformer streamresult create xml representation to file param file name file name return true if success public boolean createxml string file name try file file new file file name file create new file stream result result new stream result file createxml result catch exception e log log level severe file e return false return true filename filename filename createnewfile streamresult streamresult create print data from xml param input input source return print data public static print data parsexml properties ctx file input log config input to string print data pd null try print data handler handler new print data handler ctx sax parser factory factory sax parser factory new instance sax parser parser factory newsax parser parser parse input handler pd handler get print data catch exception e log log level severe e return pd printdata inputsource printdata printdata tostring printdata printdatahandler printdatahandler saxparserfactory saxparserfactory newinstance saxparser newsaxparser getprintdata test param args test public static void main string args print data pd new print data new properties test1 pd add node new print data element test1element1 testvalue 1 0 pd add node new print data element test1element2 testvalue 2 0 print data pdx new print data new properties test2 pdx add node new print data element test2element1 1 testvalue11 0 pdx add node new print data element test2element1 2 testvalue12 0 pdx add row false 0 pdx add node new print data element test2element2 1 testvalue21 0 pdx add node new print data element test2element2 2 testvalue22 0 pd add node pdx pd add node new print data element test1element3 testvalue 3 0 pd createxml c temp print data xml pd createxml new stream result system out system out println pd dump parse system out println print data pd1 parsexml new properties new file c temp print data xml pd1 createxml new stream result system out system out println pd1 dump printdata printdata addnode printdataelement addnode printdataelement printdata printdata addnode printdataelement addnode printdataelement addrow addnode printdataelement addnode printdataelement addnode addnode printdataelement printdata streamresult printdata printdata streamresult public col sets the span attribute param span sets the span attribute public col set span string span add attribute span span return this setspan addattribute sets the span attribute param span sets the span attribute public col set span int span add attribute span integer to string span return this setspan addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public col set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public col set width string width add attribute width width return this setwidth addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public col set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public col setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public col set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public col set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public col set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public col add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public col add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public col add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public col add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public col remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry get earliest time of a day truncate param time day and time return day with 00 00 static public timestamp get day long time if time 0 time system current time millis gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 return new timestamp cal get time in millis getday currenttimemillis gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis hour_of_day gettimeinmillis get earliest time of a day truncate param day time day and time return day with 00 00 static public timestamp get day timestamp day time if day time null return get day system current time millis return get day day time get time daytime getday daytime daytime getday currenttimemillis getday daytime gettime get earliest time of a day truncate param day day 1 31 param month month 1 12 param year year if two diguts 50 is 2000 50 is 1900 return timestamp not too reliable static public timestamp get day int year int month int day if year 50 year 2000 else if year 100 year 1900 if month 1 month 12 throw new illegal argument exception invalid month month if day 1 day 31 throw new illegal argument exception invalid day month gregorian calendar cal new gregorian calendar year month 1 day return new timestamp cal get time in millis getday illegalargumentexception illegalargumentexception gregoriancalendar gregoriancalendar gettimeinmillis get today truncate return day with 00 00 static public calendar get today gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis system current time millis cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 return cal gettoday gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis currenttimemillis hour_of_day get earliest time of next day param day day return next day with 00 00 static public timestamp get next day timestamp day if day null day new timestamp system current time millis gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis day get time cal add calendar day of year 1 next cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 return new timestamp cal get time in millis getnextday currenttimemillis gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis gettime day_of_year hour_of_day gettimeinmillis get last date in month param day day return last day with 00 00 static public timestamp get month last day timestamp day if day null day new timestamp system current time millis gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis day get time cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 cal add calendar month 1 next cal set calendar day of month 1 first cal add calendar day of year 1 previous return new timestamp cal get time in millis getmonthlastday currenttimemillis gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis gettime hour_of_day day_of_month day_of_year gettimeinmillis return the day and time param day day part param time time part return day time static public timestamp get day time timestamp day timestamp time gregorian calendar cal 1 new gregorian calendar cal 1 set time in millis day get time gregorian calendar cal 2 new gregorian calendar cal 2 set time in millis time get time gregorian calendar cal new gregorian calendar language get login language get locale cal set cal 1 get calendar year cal 1 get calendar month cal 1 get calendar day of month cal 2 get calendar hour of day cal 2 get calendar minute cal 2 get calendar second cal set calendar millisecond 0 timestamp ret value new timestamp cal get time in millis log fine time util get day time day day time time ret value return ret value getdaytime gregoriancalendar cal_1 gregoriancalendar cal_1 settimeinmillis gettime gregoriancalendar cal_2 gregoriancalendar cal_2 settimeinmillis gettime gregoriancalendar gregoriancalendar getloginlanguage getlocale cal_1 cal_1 cal_1 day_of_month cal_2 hour_of_day cal_2 cal_2 retvalue gettimeinmillis timeutil getdaytime retvalue retvalue is the 1 in the range of 2 pre time 1 x time 2 a b c pre the function returns true for b and false for a b param start 1 start 1 param end 1 not included end 1 param start 2 start 2 param end 2 not included 2 return true if in range static public boolean in range timestamp start 1 timestamp end 1 timestamp start 2 timestamp end 2 validity check if end 1 before start 1 throw new unsupported operation exception time util in range end 1 end 1 before start 1 start 1 if end 2 before start 2 throw new unsupported operation exception time util in range end 2 end 2 before start 2 start 2 case a if end 2 after start 1 end not including log fine time util in range no start 1 end 1 start 2 end 2 return false case c if start 2 before end 1 end not including log fine time util in range no start 1 end 1 start 2 end 2 return false log fine time util in range yes start 1 end 1 start 2 end 2 return true _1 _2 time_1 time_2 start_1 end_1 start_2 end_2 inrange start_1 end_1 start_2 end_2 end_1 start_1 unsupportedoperationexception timeutil inrange end_1 end_1 start_1 start_1 end_2 start_2 unsupportedoperationexception timeutil inrange end_2 end_2 start_2 start_2 end_2 start_1 timeutil inrange start_1 end_1 start_2 end_2 start_2 end_1 timeutil inrange start_1 end_1 start_2 end_2 timeutil inrange start_1 end_1 start_2 end_2 is start end on one of the days param start start day param end end day not including param on monday true if ok param on tuesday true if ok param on wednesday true if ok param on thursday true if ok param on friday true if ok param on saturday true if ok param on sunday true if ok return true if on one of the days static public boolean in range timestamp start timestamp end boolean on monday boolean on tuesday boolean on wednesday boolean on thursday boolean on friday boolean on saturday boolean on sunday are there restrictions if on saturday on sunday on monday on tuesday on wednesday on thursday on friday return false gregorian calendar cal start new gregorian calendar cal start set time in millis start get time int day start cal start get calendar day of week gregorian calendar cal end new gregorian calendar cal end set time in millis end get time cal end add calendar day of year 1 not including int day end cal end get calendar day of week on same day if cal start get calendar year cal end get calendar year cal start get calendar month cal end get calendar month cal start get calendar day of month cal end get calendar day of year if on saturday day start calendar saturday on sunday day start calendar sunday on monday day start calendar monday on tuesday day start calendar tuesday on wednesday day start calendar wednesday on thursday day start calendar thursday on friday day start calendar friday log fine time util in range same day yes start end on monday on tuesday on wednesday on thursday on friday on saturday on sunday return true log fine time util in range same day no start end on monday on tuesday on wednesday on thursday on friday on saturday on sunday return false log fine time util in range week day start day start incl end day end calendar sunday 1 saturday 7 bit set days new bit set 8 set covered days in bit array if day end day start day end 7 for int i day start i day end i int index i if index 7 index 7 days set index system out println set index index i i for int i calendar sunday i calendar saturday i system out println result i i days get i compare days to availability if on saturday days get calendar saturday on sunday days get calendar sunday on monday days get calendar monday on tuesday days get calendar tuesday on wednesday days get calendar wednesday on thursday days get calendar thursday on friday days get calendar friday log fine m assignment in range yes start end on monday on tuesday on wednesday on thursday on friday on saturday on sunday return true log fine m assignment in range no start end on monday on tuesday on wednesday on thursday on friday on saturday on sunday return false onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday inrange onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday onsaturday onsunday onmonday ontuesday onwednesday onthursday onfriday gregoriancalendar calstart gregoriancalendar calstart settimeinmillis gettime daystart calstart day_of_week gregoriancalendar calend gregoriancalendar calend settimeinmillis gettime calend day_of_year dayend calend day_of_week calstart calend calstart calend calstart day_of_month calend day_of_year onsaturday daystart onsunday daystart onmonday daystart ontuesday daystart onwednesday daystart onthursday daystart onfriday daystart timeutil inrange sameday onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday timeutil inrange sameday onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday timeutil inrange weekday daystart dayend bitset bitset bitarray dayend daystart dayend daystart dayend onsaturday onsunday onmonday ontuesday onwednesday onthursday onfriday massignment inrange onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday massignment inrange onmonday ontuesday onwednesday onthursday onfriday onsaturday onsunday is it the same day param one day param two compared day return true if the same day static public boolean is same day timestamp one timestamp two gregorian calendar cal one new gregorian calendar if one null cal one set time in millis one get time gregorian calendar cal two new gregorian calendar if two null cal two set time in millis two get time if cal one get calendar year cal two get calendar year cal one get calendar month cal two get calendar month cal one get calendar day of month cal two get calendar day of year return true return false issameday gregoriancalendar calone gregoriancalendar calone settimeinmillis gettime gregoriancalendar caltwo gregoriancalendar caltwo settimeinmillis gettime calone caltwo calone caltwo calone day_of_month caltwo day_of_year is it the same hour param one day time param two compared day time return true if the same day static public boolean is same hour timestamp one timestamp two gregorian calendar cal one new gregorian calendar if one null cal one set time in millis one get time gregorian calendar cal two new gregorian calendar if two null cal two set time in millis two get time if cal one get calendar year cal two get calendar year cal one get calendar month cal two get calendar month cal one get calendar day of month cal two get calendar day of year cal one get calendar hour of day cal two get calendar hour of day return true return false issamehour gregoriancalendar calone gregoriancalendar calone settimeinmillis gettime gregoriancalendar caltwo gregoriancalendar caltwo settimeinmillis gettime calone caltwo calone caltwo calone day_of_month caltwo day_of_year calone hour_of_day caltwo hour_of_day is all day param start start date param end end date return true if all day 00 00 00 00 next day static public boolean is all day timestamp start timestamp end gregorian calendar cal start new gregorian calendar cal start set time in millis start get time gregorian calendar cal end new gregorian calendar cal end set time in millis end get time if cal start get calendar hour of day cal end get calendar hour of day cal start get calendar minute cal end get calendar minute cal start get calendar second cal end get calendar second cal start get calendar millisecond cal end get calendar millisecond cal start get calendar hour of day 0 cal start get calendar minute 0 cal start get calendar second 0 cal start get calendar millisecond 0 start before end return true return false isallday gregoriancalendar calstart gregoriancalendar calstart settimeinmillis gettime gregoriancalendar calend gregoriancalendar calend settimeinmillis gettime calstart hour_of_day calend hour_of_day calstart calend calstart calend calstart calend calstart hour_of_day calstart calstart calstart calculate the number of days between start and end param start start date param end end date return number of days 0 same static public int get days between timestamp start timestamp end boolean negative false if end before start negative true timestamp temp start start end end temp gregorian calendar cal new gregorian calendar cal set time start cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 gregorian calendar cal end new gregorian calendar cal end set time end cal end set calendar hour of day 0 cal end set calendar minute 0 cal end set calendar second 0 cal end set calendar millisecond 0 system out println start start end end day start cal get calendar day of year day end cal end get calendar day of year in same year if cal get calendar year cal end get calendar year if negative return cal end get calendar day of year cal get calendar day of year 1 return cal end get calendar day of year cal get calendar day of year not very efficient but correct int counter 0 while cal end after cal cal add calendar day of year 1 counter if negative return counter 1 return counter getdaysbetween gregoriancalendar gregoriancalendar settime hour_of_day gregoriancalendar calend gregoriancalendar calend settime calend hour_of_day calend calend calend daystart day_of_year dayend calend day_of_year calend calend day_of_year day_of_year calend day_of_year day_of_year calend day_of_year return day offset truncates param day day param offset day offset return day offset at 00 00 static public timestamp add days timestamp day int offset if day null day new timestamp system current time millis gregorian calendar cal new gregorian calendar cal set time day cal set calendar hour of day 0 cal set calendar minute 0 cal set calendar second 0 cal set calendar millisecond 0 if offset 0 return new timestamp cal get time in millis cal add calendar day of year offset may have a problem with negative before 1 1 return new timestamp cal get time in millis adddays currenttimemillis gregoriancalendar gregoriancalendar settime hour_of_day gettimeinmillis day_of_year gettimeinmillis return date time offset in minutes param date time date and time param offset minute offset return date time offset in minutes static public timestamp add minutess timestamp date time int offset if date time null date time new timestamp system current time millis if offset 0 return date time gregorian calendar cal new gregorian calendar cal set time date time cal add calendar minute offset may have a problem with negative return new timestamp cal get time in millis datetime datetime datetime addminutess datetime datetime datetime currenttimemillis datetime gregoriancalendar gregoriancalendar settime datetime gettimeinmillis format elapsed time param start start time or null for now param end end time or null for now return formatted time string 1 23 59 59 999 public static string format elapsed timestamp start timestamp end long start time 0 if start null start time system current time millis else start time start get time long end time 0 if end null end time system current time millis else end time end get time return format elapsed end time start time formatelapsed starttime starttime currenttimemillis starttime gettime endtime endtime currenttimemillis endtime gettime formatelapsed endtime starttime format elapsed time until now param start start time return formatted time string 1 23 59 59 999 public static string format elapsed timestamp start if start null return no start time long start time start get time long end time system current time millis return format elapsed end time start time formatelapsed nostarttime starttime gettime endtime currenttimemillis formatelapsed endtime starttime format elapsed time param elapsedms time in ms return formatted time string 1 23 59 59 999 d hh mm ss xxx public static string format elapsed long elapsedms if elapsedms 0 return 0 string buffer sb new string buffer if elapsedms 0 elapsedms elapsedms sb append long mili seconds elapsedms 1000 elapsedms elapsedms 1000 long seconds elapsedms 60 elapsedms elapsedms 60 long minutes elapsedms 60 elapsedms elapsedms 60 long hours elapsedms 24 long days elapsedms 24 if days 0 sb append days append hh if hours 0 sb append get2digits hours append else if days 0 sb append 00 mm if minutes 0 sb append get2digits minutes append else if hours 0 days 0 sb append 00 ss sb append get2digits seconds append append mili seconds return sb to string formatelapsed stringbuffer stringbuffer miliseconds miliseconds tostring get minimum of 2 digits param no number return string private static string get2digits long no string s string value of no if s length 1 return s return 0 s valueof is it valid today param valid from valid from param valid to valid to return true if walid public static boolean is valid timestamp valid from timestamp valid to return is valid valid from valid to new timestamp system current time millis validfrom validto isvalid validfrom validto isvalid validfrom validto currenttimemillis is it valid on test date param valid from valid from param valid to valid to param test date date return true if walid public static boolean is valid timestamp valid from timestamp valid to timestamp test date if test date null return true if valid from null valid to null return true valid from ok if valid from null valid from after test date return false ok valid to if valid to null valid to before test date return false return true validfrom validto testdate isvalid validfrom validto testdate testdate validfrom validto validfrom validfrom validfrom testdate validto validto validto testdate max date param ts1 p1 param ts2 p2 return max time public static timestamp max timestamp ts1 timestamp ts2 if ts1 null return ts2 if ts2 null return ts1 if ts2 after ts1 return ts2 return ts1 get truncated day time param day time day return next day with 00 00 static public timestamp trunc timestamp day time string trunc if day time null day time new timestamp system current time millis gregorian calendar cal new gregorian calendar language get login language get locale cal set time in millis day time get time cal set calendar millisecond 0 cal set calendar second 0 cal set calendar minute 0 d cal set calendar hour of day 0 if trunc null trunc equals trunc day return new timestamp cal get time in millis w if trunc equals trunc week cal set calendar day of week cal get first day of week return new timestamp cal get time in millis mm cal set calendar day of month 1 if trunc equals trunc month return new timestamp cal get time in millis q if trunc equals trunc quarter int mm cal get calendar month if mm 4 mm 1 else if mm 7 mm 4 else if mm 10 mm 7 else mm 10 cal set calendar month mm return new timestamp cal get time in millis cal set calendar day of year 1 return new timestamp cal get time in millis daytime daytime daytime daytime currenttimemillis gregoriancalendar gregoriancalendar getloginlanguage getlocale settimeinmillis daytime gettime hour_of_day trunc_day gettimeinmillis trunc_week day_of_week getfirstdayofweek gettimeinmillis day_of_month trunc_month gettimeinmillis trunc_quarter gettimeinmillis day_of_year gettimeinmillis test param args ignored public static void main string args timestamp t1 get day 01 01 01 timestamp t2 get day 02 02 02 timestamp t3 get day 03 03 03 system out println t1 t3 system out println t2 is valid t1 t3 t2 getday getday getday isvalid standard constructor public x ad workflowprocessor properties ctx int ad workflowprocessor id string trx name super ctx ad workflowprocessor id trx name if ad workflowprocessor id 0 setad workflowprocessor id 0 set frequency 0 set frequency type null set keep log days 0 7 set name null setsupervisor id 0 x_ad_workflowprocessor ad_workflowprocessor_id trxname ad_workflowprocessor_id trxname ad_workflowprocessor_id setad_workflowprocessor_id setfrequency setfrequencytype setkeeplogdays setname setsupervisor_id load constructor public x ad workflowprocessor properties ctx result set rs string trx name super ctx rs trx name x_ad_workflowprocessor resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workflowprocessor append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workflowprocessor get_id tostring set workflow processor workflow processor server public void setad workflowprocessor id int ad workflowprocessor id if ad workflowprocessor id 1 throw new illegal argument exception ad workflowprocessor id is mandatory set valuenocheck ad workflowprocessor id new integer ad workflowprocessor id setad_workflowprocessor_id ad_workflowprocessor_id ad_workflowprocessor_id illegalargumentexception ad_workflowprocessor_id set_valuenocheck ad_workflowprocessor_id ad_workflowprocessor_id get workflow processor workflow processor server public int getad workflowprocessor id integer ii integer get value ad workflowprocessor id if ii null return 0 return ii int value getad_workflowprocessor_id get_value ad_workflowprocessor_id intvalue set alert over priority send alert email when over priority public void set alert over priority int alert over priority set value alert over priority new integer alert over priority setalertoverpriority alertoverpriority set_value alertoverpriority alertoverpriority get alert over priority send alert email when over priority public int get alert over priority integer ii integer get value alert over priority if ii null return 0 return ii int value getalertoverpriority get_value alertoverpriority intvalue set date last run date the process was last run public void set date last run timestamp date last run set value date last run date last run setdatelastrun datelastrun set_value datelastrun datelastrun get date last run date the process was last run public timestamp get date last run return timestamp get value date last run getdatelastrun get_value datelastrun set date next run date the process will run next public void set date next run timestamp date next run set value date next run date next run setdatenextrun datenextrun set_value datenextrun datenextrun get date next run date the process will run next public timestamp get date next run return timestamp get value date next run getdatenextrun get_value datenextrun set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set frequency frequency of events public void set frequency int frequency set value frequency new integer frequency setfrequency set_value get frequency frequency of events public int get frequency integer ii integer get value frequency if ii null return 0 return ii int value getfrequency get_value intvalue public static final string frequencytype minute m set frequency type frequency of event public void set frequency type string frequency type if frequency type null throw new illegal argument exception frequency type is mandatory if frequency type equals d frequency type equals h frequency type equals m else throw new illegal argument exception frequency type invalid value frequency type reference id 221 d h m if frequency type length 1 log warning length 1 truncated frequency type frequency type substring 0 0 set value frequency type frequency type frequencytype_minute setfrequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype frequencytype frequencytype illegalargumentexception frequencytype frequencytype reference_id frequencytype frequencytype frequencytype set_value frequencytype frequencytype get frequency type frequency of event public string get frequency type return string get value frequency type getfrequencytype get_value frequencytype set inactivity alert days send alert when there is no activity after days 0 no alert public void set inactivity alert days int inactivity alert days set value inactivity alert days new integer inactivity alert days setinactivityalertdays inactivityalertdays set_value inactivityalertdays inactivityalertdays get inactivity alert days send alert when there is no activity after days 0 no alert public int get inactivity alert days integer ii integer get value inactivity alert days if ii null return 0 return ii int value getinactivityalertdays get_value inactivityalertdays intvalue set days to keep log number of days to keep the log entries public void set keep log days int keep log days set value keep log days new integer keep log days setkeeplogdays keeplogdays set_value keeplogdays keeplogdays get days to keep log number of days to keep the log entries public int get keep log days integer ii integer get value keep log days if ii null return 0 return ii int value getkeeplogdays get_value keeplogdays intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set reminder days days between sending reminder emails for a due or inactive document public void set remind days int remind days set value remind days new integer remind days setreminddays reminddays set_value reminddays reminddays get reminder days days between sending reminder emails for a due or inactive document public int get remind days integer ii integer get value remind days if ii null return 0 return ii int value getreminddays get_value reminddays intvalue public static final int supervisor id ad reference id 316 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 1 throw new illegal argument exception supervisor id is mandatory set value supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id illegalargumentexception supervisor_id set_value supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue standard constructor public x ad language properties ctx int ad language id string trx name super ctx ad language id trx name if ad language id 0 setad language null setad language id 0 sql select nvl max ad language id 0 1 as default value from ad language set is base language false n set is decimal point false set is system language false set name null x_ad_language ad_language_id trxname ad_language_id trxname ad_language_id setad_language setad_language_id ad_language_id defaultvalue ad_language setisbaselanguage setisdecimalpoint setissystemlanguage setname load constructor public x ad language properties ctx result set rs string trx name super ctx rs trx name x_ad_language resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad language append get id append return sb to string tostring stringbuffer stringbuffer x_ad_language get_id tostring set language language for this entity public void setad language string ad language if ad language null throw new illegal argument exception ad language is mandatory if ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set valuenocheck ad language ad language setad_language ad_language ad_language illegalargumentexception ad_language ad_language ad_language ad_language set_valuenocheck ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language set language id public void setad language id int ad language id if ad language id 1 throw new illegal argument exception ad language id is mandatory set valuenocheck ad language id new integer ad language id setad_language_id ad_language_id ad_language_id illegalargumentexception ad_language_id set_valuenocheck ad_language_id ad_language_id get language id public int getad language id integer ii integer get value ad language id if ii null return 0 return ii int value getad_language_id get_value ad_language_id intvalue set iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public void set country code string country code if country code null country code length 2 log warning length 2 truncated country code country code substring 0 1 set value country code country code iso_3166 setcountrycode countrycode countrycode countrycode countrycode countrycode set_value countrycode countrycode get iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public string get country code return string get value country code iso_3166 getcountrycode get_value countrycode set date pattern java date pattern public void set date pattern string date pattern if date pattern null date pattern length 20 log warning length 20 truncated date pattern date pattern substring 0 19 set value date pattern date pattern setdatepattern datepattern datepattern datepattern datepattern datepattern set_value datepattern datepattern get date pattern java date pattern public string get date pattern return string get value date pattern getdatepattern get_value datepattern set base language the system information is maintained in this language public void set is base language boolean is base language set valuenocheck is base language new boolean is base language setisbaselanguage isbaselanguage set_valuenocheck isbaselanguage isbaselanguage get base language the system information is maintained in this language public boolean is base language object oo get value is base language if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbaselanguage get_value isbaselanguage booleanvalue set decimal point the number notation has a decimal point no decimal comma public void set is decimal point boolean is decimal point set value is decimal point new boolean is decimal point setisdecimalpoint isdecimalpoint set_value isdecimalpoint isdecimalpoint get decimal point the number notation has a decimal point no decimal comma public boolean is decimal point object oo get value is decimal point if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdecimalpoint get_value isdecimalpoint booleanvalue set system language the screens etc are maintained in this language public void set is system language boolean is system language set value is system language new boolean is system language setissystemlanguage issystemlanguage set_value issystemlanguage issystemlanguage get system language the screens etc are maintained in this language public boolean is system language object oo get value is system language if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issystemlanguage get_value issystemlanguage booleanvalue set iso language code lower case two letter iso 3166 code http www ics uci edu pub ietf http related iso639 txt public void set languageiso string languageiso if languageiso null languageiso length 2 log warning length 2 truncated languageiso languageiso substring 0 1 set value languageiso languageiso setlanguageiso set_value get iso language code lower case two letter iso 3166 code http www ics uci edu pub ietf http related iso639 txt public string get languageiso return string get value languageiso getlanguageiso get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set time pattern java time pattern public void set time pattern string time pattern if time pattern null time pattern length 20 log warning length 20 truncated time pattern time pattern substring 0 19 set value time pattern time pattern settimepattern timepattern timepattern timepattern timepattern timepattern set_value timepattern timepattern get time pattern java time pattern public string get time pattern return string get value time pattern gettimepattern get_value timepattern standard constructor public x c tax properties ctx int c tax id string trx name super ctx c tax id trx name if c tax id 0 setc taxcategory id 0 setc tax id 0 set is default false set is document level false set is sales tax false n set is summary false set is tax exempt false set name null set rate env zero set requires tax certificate false setsopo type null b set valid from new timestamp system current time millis x_c_tax c_tax_id trxname c_tax_id trxname c_tax_id setc_taxcategory_id setc_tax_id setisdefault setisdocumentlevel setissalestax setissummary setistaxexempt setname setrate setrequirestaxcertificate setsopotype setvalidfrom currenttimemillis load constructor public x c tax properties ctx result set rs string trx name super ctx rs trx name x_c_tax resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c tax append get id append return sb to string tostring stringbuffer stringbuffer x_c_tax get_id tostring public static final int c country id ad reference id 156 set country country public void setc country id int c country id if c country id 0 set value c country id null else set value c country id new integer c country id c_country_id_ad_reference_id setc_country_id c_country_id c_country_id set_value c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue public static final int c region id ad reference id 157 set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id c_region_id_ad_reference_id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set valuenocheck c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_valuenocheck c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set default default value public void set is default boolean is default set value is default new boolean is default setisdefault isdefault set_value isdefault isdefault get default default value public boolean is default object oo get value is default if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdefault get_value isdefault booleanvalue set document level tax is calculated on document level rather than line by line public void set is document level boolean is document level set value is document level new boolean is document level setisdocumentlevel isdocumentlevel set_value isdocumentlevel isdocumentlevel get document level tax is calculated on document level rather than line by line public boolean is document level object oo get value is document level if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdocumentlevel get_value isdocumentlevel booleanvalue set sales tax this is a sales tax i e not a value added tax public void set is sales tax boolean is sales tax set value is sales tax new boolean is sales tax setissalestax issalestax set_value issalestax issalestax get sales tax this is a sales tax i e not a value added tax public boolean is sales tax object oo get value is sales tax if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issalestax get_value issalestax booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set value is summary new boolean is summary setissummary issummary set_value issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set tax exempt business partner is exempt from tax public void set is tax exempt boolean is tax exempt set value is tax exempt new boolean is tax exempt setistaxexempt istaxexempt set_value istaxexempt istaxexempt get tax exempt business partner is exempt from tax public boolean is tax exempt object oo get value is tax exempt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxexempt get_value istaxexempt booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int parent tax id ad reference id 158 set parent tax parent tax indicates a tax that is made up of multiple taxes public void setparent tax id int parent tax id if parent tax id 0 set value parent tax id null else set value parent tax id new integer parent tax id parent_tax_id_ad_reference_id setparent_tax_id parent_tax_id parent_tax_id set_value parent_tax_id set_value parent_tax_id parent_tax_id get parent tax parent tax indicates a tax that is made up of multiple taxes public int getparent tax id integer ii integer get value parent tax id if ii null return 0 return ii int value getparent_tax_id get_value parent_tax_id intvalue set rate rate or tax or exchange public void set rate big decimal rate if rate null throw new illegal argument exception rate is mandatory set value rate rate setrate bigdecimal illegalargumentexception set_value get rate rate or tax or exchange public big decimal get rate big decimal bd big decimal get value rate if bd null return env zero return bd bigdecimal getrate bigdecimal bigdecimal get_value set requires tax certificate this tax rate requires the business partner to be tax exempt public void set requires tax certificate boolean requires tax certificate set value requires tax certificate new boolean requires tax certificate setrequirestaxcertificate requirestaxcertificate set_value requirestaxcertificate requirestaxcertificate get requires tax certificate this tax rate requires the business partner to be tax exempt public boolean is requires tax certificate object oo get value requires tax certificate if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrequirestaxcertificate get_value requirestaxcertificate booleanvalue public static final string sopotype salestax s set so po type sales tax applies to sales situations purchase tax to purchase situations public void setsopo type string sopo type if sopo type null throw new illegal argument exception sopo type is mandatory if sopo type equals b sopo type equals p sopo type equals s else throw new illegal argument exception sopo type invalid value sopo type reference id 287 b p s if sopo type length 1 log warning length 1 truncated sopo type sopo type substring 0 0 set value sopo type sopo type sopotype_salestax setsopotype sopotype sopotype illegalargumentexception sopotype sopotype sopotype sopotype illegalargumentexception sopotype sopotype reference_id sopotype sopotype sopotype set_value sopotype sopotype get so po type sales tax applies to sales situations purchase tax to purchase situations public string getsopo type return string get value sopo type getsopotype get_value sopotype set tax indicator short form for tax to be printed on documents public void set tax indicator string tax indicator if tax indicator null tax indicator length 10 log warning length 10 truncated tax indicator tax indicator substring 0 9 set value tax indicator tax indicator settaxindicator taxindicator taxindicator taxindicator taxindicator taxindicator set_value taxindicator taxindicator get tax indicator short form for tax to be printed on documents public string get tax indicator return string get value tax indicator gettaxindicator get_value taxindicator public static final int to country id ad reference id 156 set to receiving country public void setto country id int to country id if to country id 0 set value to country id null else set value to country id new integer to country id to_country_id_ad_reference_id setto_country_id to_country_id to_country_id set_value to_country_id set_value to_country_id to_country_id get to receiving country public int getto country id integer ii integer get value to country id if ii null return 0 return ii int value getto_country_id get_value to_country_id intvalue public static final int to region id ad reference id 157 set to receiving region public void setto region id int to region id if to region id 0 set value to region id null else set value to region id new integer to region id to_region_id_ad_reference_id setto_region_id to_region_id to_region_id set_value to_region_id set_value to_region_id to_region_id get to receiving region public int getto region id integer ii integer get value to region id if ii null return 0 return ii int value getto_region_id get_value to_region_id intvalue set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom standard constructor param ctx context param s resourceunavailable id id param trx name trx public m resource un available properties ctx int s resourceunavailable id string trx name super ctx s resourceunavailable id trx name s_resourceunavailable_id trxname mresourceunavailable s_resourceunavailable_id trxname s_resourceunavailable_id trxname m resource un available param ctx context param rs result set public m resource un available properties ctx result set rs string trx name super ctx rs trx name mresourceunavailable mresourceunavailable resultset trxname trxname before save param new record new return true protected boolean before save boolean new record if get date to null set date to get date from if get date from after get date to log save error error msg parse translation get ctx date to date from return false return true newrecord beforesave newrecord getdateto setdateto getdatefrom getdatefrom getdateto saveerror parsetranslation getctx dateto datefrom standard constructor public x ad message properties ctx int ad message id string trx name super ctx ad message id trx name if ad message id 0 setad message id 0 set entity type null u set msg text null set msg type null i set value null x_ad_message ad_message_id trxname ad_message_id trxname ad_message_id setad_message_id setentitytype setmsgtext setmsgtype setvalue load constructor public x ad message properties ctx result set rs string trx name super ctx rs trx name x_ad_message resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad message append get id append return sb to string tostring stringbuffer stringbuffer x_ad_message get_id tostring set message system message public void setad message id int ad message id if ad message id 1 throw new illegal argument exception ad message id is mandatory set valuenocheck ad message id new integer ad message id setad_message_id ad_message_id ad_message_id illegalargumentexception ad_message_id set_valuenocheck ad_message_id ad_message_id get message system message public int getad message id integer ii integer get value ad message id if ii null return 0 return ii int value getad_message_id get_value ad_message_id intvalue public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set message text textual informational menu or error message public void set msg text string msg text if msg text null throw new illegal argument exception msg text is mandatory if msg text length 2000 log warning length 2000 truncated msg text msg text substring 0 1999 set value msg text msg text setmsgtext msgtext msgtext illegalargumentexception msgtext msgtext msgtext msgtext set_value msgtext msgtext get message text textual informational menu or error message public string get msg text return string get value msg text getmsgtext get_value msgtext set message tip additional tip or help for this message public void set msg tip string msg tip if msg tip null msg tip length 2000 log warning length 2000 truncated msg tip msg tip substring 0 1999 set value msg tip msg tip setmsgtip msgtip msgtip msgtip msgtip msgtip set_value msgtip msgtip get message tip additional tip or help for this message public string get msg tip return string get value msg tip getmsgtip get_value msgtip public static final string msgtype menu m set message type type of message informational menu or error public void set msg type string msg type if msg type null throw new illegal argument exception msg type is mandatory if msg type equals e msg type equals i msg type equals m else throw new illegal argument exception msg type invalid value msg type reference id 103 e i m if msg type length 1 log warning length 1 truncated msg type msg type substring 0 0 set value msg type msg type msgtype_menu setmsgtype msgtype msgtype illegalargumentexception msgtype msgtype msgtype msgtype illegalargumentexception msgtype msgtype reference_id msgtype msgtype msgtype set_value msgtype msgtype get message type type of message informational menu or error public string get msg type return string get value msg type getmsgtype get_value msgtype set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value return string get value value public key name pair get key name pair return new key name pair get id get value get_value keynamepair getkeynamepair keynamepair get_id getvalue prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id m ad client id big decimal para i get parameter int value else if name equals c element id m c element id big decimal para i get parameter int value else if name equals update default accounts m updatedefaultaccounts y equals para i get parameter else if name equals create new combination m createnewcombination y equals para i get parameter else if name equals delete old imported m deleteoldimported y equals para i get parameter else log log level severe unknown parameter name if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername getparameter ad_client_id m_ad_client_id bigdecimal getparameter intvalue c_element_id m_c_element_id bigdecimal getparameter intvalue updatedefaultaccounts m_updatedefaultaccounts getparameter createnewcombination m_createnewcombination getparameter deleteoldimported m_deleteoldimported getparameter m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null int no 0 string client check and ad client id m ad client id prepare delete old imported if m deleteoldimported sql new string buffer delete i elementvalue where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set client org is active created updated sql new string buffer update i elementvalue set ad client id coalesce ad client id append m ad client id append ad org id coalesce ad org id 0 is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log fine reset no prepare set element if m c element id 0 sql new string buffer update i elementvalue set element name select name from c element where c element id append m c element id append where element name is null and c element id is null and i isimported y append client check no db execute update sql to string get trxname log fine set element default no sql new string buffer update i elementvalue i set c element id select c element id from c element e where i element name e name and i ad client id e ad client id where c element id is null and i isimported y append client check no db execute update sql to string get trxname log fine set element no sql new string buffer update i elementvalue set i isimported e i errormsg err invalid element where c element id is null and i isimported y append client check no db execute update sql to string get trxname log config invalid element no set column sql new string buffer update i elementvalue i set ad column id select ad column id from ad column c where upper i default account upper c column name and c ad table id in 315 266 and ad reference id 25 where default account is not null and ad column id is null and i isimported y append client check no db execute update sql to string get trxname log fine set column no sql new string buffer update i elementvalue set i isimported e i errormsg i errormsg err invalid column where ad column id is null and default account is not null and upper default account default acct ignore default account and i isimported y append client check no db execute update sql to string get trxname log config invalid column no set post defaults ignore errors string y columns new string post actual post budget post statistical post encumbrance for int i 0 i y columns length i sql new string buffer update i elementvalue set append y columns i append y where append y columns i append is null or append y columns i append not in y n and i isimported y append client check no db execute update sql to string get trxname log fine set y columns i default no summary sql new string buffer update i elementvalue set is summary n where is summary is null or is summary not in y n and i isimported y append client check no db execute update sql to string get trxname log fine set is summary default no doc controlled sql new string buffer update i elementvalue set is doc controlled case when ad column id is not null then y else n end where is doc controlled is null or is doc controlled not in y n and i isimported n append client check no db execute update sql to string get trxname log fine set is document controlled default no check account type a e l m o r sql new string buffer update i elementvalue set account type e where account type is null and i isimported y append client check no db execute update sql to string get trxname log fine set account type default no sql new string buffer update i elementvalue set i isimported e i errormsg i errormsg err invalid account type where account type not in a e l m o r and i isimported y append client check no db execute update sql to string get trxname log config invalid account type no check account sign n c b sql new string buffer update i elementvalue set account sign n where account sign is null and i isimported y append client check no db execute update sql to string get trxname log fine set account sign default no sql new string buffer update i elementvalue set i isimported e i errormsg i errormsg err invalid account sign where account sign not in n c d and i isimported y append client check no db execute update sql to string get trxname log config invalid account sign no no value sql new string buffer update i elementvalue set i isimported e i errormsg i errormsg err no key where value is null or value and i isimported y append client check no db execute update sql to string get trxname log config invalid key no update element value from existing sql new string buffer update i elementvalue i set c elementvalue id select c elementvalue id from c elementvalue ev inner join c element e on ev c element id e c element id where i c element id e c element id and i ad client id e ad client id and i value ev value where c elementvalue id is null and i isimported n append client check no db execute update sql to string get trxname log fine found element value no commit int no insert 0 int no update 0 go through records sql new string buffer select from i elementvalue where i isimported n append client check append order by i elementvalue id try prepared statement pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next x i elementvalue impev new x i elementvalue get ctx rs get trxname int c elementvalue id impev getc elementvalue id int i elementvalue id impev geti elementvalue id create update element value if c elementvalue id 0 new m element value ev new m element value impev if ev save no insert impev setc elementvalue id ev getc elementvalue id impev seti isimported true impev save else sql new string buffer update i elementvalue i set i isimported e i errormsg i errormsg append db to string insert element value append where i elementvalue id append i elementvalue id db execute update sql to string get trxname else update existing m element value ev new m element value get ctx c elementvalue id null if ev get id c elementvalue id ev set impev if ev save no update impev seti isimported true impev save else sql new string buffer update i elementvalue i set i isimported e i errormsg i errormsg append db to string update element value append where i elementvalue id append i elementvalue id db execute update sql to string get trxname for all i product rs close pstmt close catch sql exception e throw new exception create e set error to indicator to not imported sql new string buffer update i elementvalue set i isimported n updated sys date where i isimported y append client check no db execute update sql to string get trxname add log 0 null new big decimal no errors add log 0 null new big decimal no insert c elementvalue id inserted add log 0 null new big decimal no update c elementvalue id updated commit set parent sql new string buffer update i elementvalue i set parentelementvalue id select c elementvalue id from c elementvalue ev where i c element id ev c element id and i parent value ev value and i ad client id ev ad client id where parentelementvalue id is null and i isimported y append client check no db execute update sql to string get trxname log fine found parent element value no sql new string buffer update i elementvalue set i errormsg i errormsg info parent not found where parentelementvalue id is null and parent value is not null and i isimported y append client check no db execute update sql to string get trxname log config not found patent element value no sql new string buffer select i parentelementvalue id i i elementvalu doit stringbuffer clientcheck ad_client_id m_ad_client_id m_deleteoldimported stringbuffer i_elementvalue i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_elementvalue ad_client_id ad_client_id m_ad_client_id ad_org_id ad_org_id isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname m_c_element_id stringbuffer i_elementvalue elementname c_element c_element_id m_c_element_id elementname c_element_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_elementvalue c_element_id c_element_id c_element elementname ad_client_id ad_client_id c_element_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_elementvalue i_isimported i_errormsg c_element_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_elementvalue ad_column_id ad_column_id ad_column default_account columnname ad_table_id ad_reference_id default_account ad_column_id i_isimported clientcheck executeupdate tostring get_trxname stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg ad_column_id default_account default_account default_acct i_isimported clientcheck executeupdate tostring get_trxname ycolumns postactual postbudget poststatistical postencumbrance ycolumns stringbuffer i_elementvalue ycolumns ycolumns ycolumns i_isimported clientcheck executeupdate tostring get_trxname ycolumns stringbuffer i_elementvalue issummary issummary issummary i_isimported clientcheck executeupdate tostring get_trxname issummary stringbuffer i_elementvalue isdoccontrolled ad_column_id isdoccontrolled isdoccontrolled i_isimported clientcheck executeupdate tostring get_trxname isdocumentcontrolled stringbuffer i_elementvalue accounttype accounttype i_isimported clientcheck executeupdate tostring get_trxname accounttype stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg accounttype accounttype i_isimported clientcheck executeupdate tostring get_trxname accounttype stringbuffer i_elementvalue accountsign accountsign i_isimported clientcheck executeupdate tostring get_trxname accountsign stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg accountsign accountsign i_isimported clientcheck executeupdate tostring get_trxname accountsign stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg i_isimported clientcheck executeupdate tostring get_trxname elementvalue stringbuffer i_elementvalue c_elementvalue_id c_elementvalue_id c_elementvalue c_element c_element_id c_element_id c_element_id c_element_id ad_client_id ad_client_id c_elementvalue_id i_isimported clientcheck executeupdate tostring get_trxname elementvalue noinsert noupdate stringbuffer i_elementvalue i_isimported clientcheck i_elementvalue_id preparedstatement preparestatement tostring get_trxname resultset executequery x_i_elementvalue x_i_elementvalue getctx get_trxname c_elementvalue_id getc_elementvalue_id i_elementvalue_id geti_elementvalue_id elementvalue c_elementvalue_id melementvalue melementvalue noinsert setc_elementvalue_id getc_elementvalue_id seti_isimported stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg to_string elementvalue i_elementvalue_id i_elementvalue_id executeupdate tostring get_trxname melementvalue melementvalue getctx c_elementvalue_id get_id c_elementvalue_id noupdate seti_isimported stringbuffer i_elementvalue i_isimported i_errormsg i_errormsg to_string elementvalue i_elementvalue_id i_elementvalue_id executeupdate tostring get_trxname i_product sqlexception stringbuffer i_elementvalue i_isimported sysdate i_isimported clientcheck executeupdate tostring get_trxname addlog bigdecimal addlog bigdecimal noinsert c_elementvalue_id addlog bigdecimal noupdate c_elementvalue_id stringbuffer i_elementvalue parentelementvalue_id c_elementvalue_id c_elementvalue c_element_id c_element_id parentvalue ad_client_id ad_client_id parentelementvalue_id i_isimported clientcheck executeupdate tostring get_trxname elementvalue stringbuffer i_elementvalue i_errormsg i_errormsg parentnotfound parentelementvalue_id parentvalue i_isimported clientcheck executeupdate tostring get_trxname elementvalue stringbuffer parentelementvalue_id i_elementvalu update default accounts param client check client where cluase private void update defaults string client check log config create new combination m createnewcombination update defaults string buffer sql new string buffer select c acctschema id from c acctschema element where c element id append client check try prepared statement pstmt db prepare statement sql to string get trxname pstmt set int 1 m c element id result set rs pstmt execute query while rs next update default accounts rs get int 1 rs close pstmt close catch sql exception e log log level severe sql to string e default account default acct sql new string buffer update c acctschema element e set c elementvalue id select c elementvalue id from i elementvalue i where e c element id i c element id and i c elementvalue id is not null and upper i default account default acct where exists select from i elementvalue i where e c element id i c element id and i c elementvalue id is not null and upper i default account default acct and i i isimported y append client check int no db execute update sql to string get trxname add log 0 null new big decimal no c acctschema element id updated clientcheck updatedefaults clientcheck createnewcombination m_createnewcombination stringbuffer stringbuffer c_acctschema_id c_acctschema_element c_element_id clientcheck preparedstatement preparestatement tostring get_trxname setint m_c_element_id resultset executequery updatedefaultaccounts getint sqlexception tostring default_acct stringbuffer c_acctschema_element c_elementvalue_id c_elementvalue_id i_elementvalue c_element_id c_element_id c_elementvalue_id default_account default_acct i_elementvalue c_element_id c_element_id c_elementvalue_id default_account default_acct i_isimported clientcheck executeupdate tostring get_trxname addlog bigdecimal c_acctschema_element_id update default accounts default xxxx c validcombination id account id c elementvalue id param c acctschema id accounting schema private void update default accounts int c acctschema id log config c acctschema id c acctschema id m acct schema as new m acct schema get ctx c acctschema id null if as get acct schema element ac getc element id m c element id log log level severe c element id m c element id not in acct schema as return int counts new int 0 0 0 string sql select i c elementvalue id t table name c column name i i elementvalue id from i elementvalue i inner join ad column c on i ad column id c ad column id inner join ad table t on c ad table id t ad table id where i i isimported y and i processed y and processing y and i c elementvalue id is not null and c element id try prepared statement pstmt db prepare statement sql get trxname pstmt set int 1 m c element id result set rs pstmt execute query while rs next int c elementvalue id rs get int 1 string table name rs get string 2 string column name rs get string 3 int i elementvalue id rs get int 4 update it int u update default account table name column name c acctschema id c elementvalue id counts u if u update error sql update i elementvalue set processing n where i elementvalue id i elementvalue id int no db execute update sql to string get trxname if no 1 log log level severe updated no rs close pstmt close catch sql exception e log log level severe e add log 0 null new big decimal counts update error as to string errors add log 0 null new big decimal counts update yes as to string updated add log 0 null new big decimal counts update same as to string ok _default c_validcombination_id account_id c_elementvalue_id c_acctschema_id updatedefaultaccounts c_acctschema_id c_acctschema_id c_acctschema_id macctschema macctschema getctx c_acctschema_id getacctschemaelement getc_element_id m_c_element_id c_element_id m_c_element_id acctschema c_elementvalue_id tablename columnname i_elementvalue_id i_elementvalue ad_column ad_column_id ad_column_id ad_table ad_table_id ad_table_id i_isimported c_elementvalue_id c_element_id preparedstatement preparestatement get_trxname setint m_c_element_id resultset executequery c_elementvalue_id getint tablename getstring columnname getstring i_elementvalue_id getint updatedefaultaccount tablename columnname c_acctschema_id c_elementvalue_id update_error i_elementvalue i_elementvalue_id i_elementvalue_id executeupdate tostring get_trxname sqlexception addlog bigdecimal update_error tostring addlog bigdecimal update_yes tostring addlog bigdecimal update_same tostring update default account this is the sql to delete unused accounts with the import still in the table delete c elementvalue e where not exists select from fact acct f where f account id e c elementvalue id and not exists select from c validcombination vc where vc account id e c elementvalue id and not exists select from i elementvalue i where i c elementvalue id e c elementvalue id param table name table name param column name column name param c acctschema id account schema param c elementvalue id new account return update status private int update default account string table name string column name int c acctschema id int c elementvalue id log fine table name column name c elementvalue id int ret value update error string buffer sql new string buffer select x append column name append account id from append table name append x inner join c validcombination vc on x append column name append vc c validcombination id append where x c acctschema id append c acctschema id try prepared statement pstmt db prepare statement sql to string get trxname result set rs pstmt execute query if rs next int c validcombination id rs get int 1 int account id rs get int 2 the current account value is the same if account id c elementvalue id ret value update same log fine account id same as new value we need to update the account value else if m createnewcombination m account acct m account get get ctx c validcombination id acct setaccount id c elementvalue id if acct save int newc validcombination id acct getc validcombination id if c validcombination id newc validcombination id sql new string buffer update append table name append set append column name append append newc validcombination id append where c acctschema id append c acctschema id int no db execute update sql to string get trxname log fine import account update default account no table name column name c elementvalue id c validcombination id newc validcombination id if no 1 ret value update yes else log log level severe account not saved acct else replace combination only acct combination directly sql new string buffer update c validcombination set account id append c elementvalue id append where c validcombination id append c validcombination id int no db execute update sql to string get trxname log fine import account update default account replace no c validcombination id c validcombination id new account id c elementvalue id if no 1 ret value update yes where acct was used sql new string buffer update c validcombination set account id append c elementvalue id append where account id append account id no db execute update sql to string get trxname log fine import account update default account replace vc no account id account id new account id c elementvalue id sql new string buffer update fact acct set account id append c elementvalue id append where account id append account id no db execute update sql to string get trxname log fine import account update default account replace fact no account id account id new account id c elementvalue id replace combination need to update for all default accounts else log log level severe account not found sql rs close pstmt close catch sql exception e log log level severe sql to string e return ret value c_elementvalue fact_acct account_id c_elementvalue_id c_validcombination account_id c_elementvalue_id i_elementvalue c_elementvalue_id c_elementvalue_id tablename columnname c_acctschema_id c_elementvalue_id update_ updatedefaultaccount tablename columnname c_acctschema_id c_elementvalue_id tablename columnname c_elementvalue_id retvalue update_error stringbuffer stringbuffer columnname account_id tablename c_validcombination columnname c_validcombination_id c_acctschema_id c_acctschema_id preparedstatement preparestatement tostring get_trxname resultset executequery c_validcombination_id getint account_id getint account_id c_elementvalue_id retvalue update_same account_id m_createnewcombination maccount maccount getctx c_validcombination_id setaccount_id c_elementvalue_id newc_validcombination_id getc_validcombination_id c_validcombination_id newc_validcombination_id stringbuffer tablename columnname newc_validcombination_id c_acctschema_id c_acctschema_id executeupdate tostring get_trxname importaccount updatedefaultaccount tablename columnname c_elementvalue_id c_validcombination_id newc_validcombination_id retvalue update_yes stringbuffer c_validcombination account_id c_elementvalue_id c_validcombination_id c_validcombination_id executeupdate tostring get_trxname importaccount updatedefaultaccount c_validcombination_id c_validcombination_id account_id c_elementvalue_id retvalue update_yes stringbuffer c_validcombination account_id c_elementvalue_id account_id account_id executeupdate tostring get_trxname importaccount updatedefaultaccount account_id account_id account_id c_elementvalue_id stringbuffer fact_acct account_id c_elementvalue_id account_id account_id executeupdate tostring get_trxname importaccount updatedefaultaccount account_id account_id account_id c_elementvalue_id sqlexception tostring retvalue request copy mail text b callout b param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string copy mail properties ctx int window no m tab m tab m field m field object value string col name m field get column name log info col name value if value null return integer r mailtext id integer value string sql select mail header mail text from r mailtext where r mailtext id try prepared statement pstmt db prepare statement sql null pstmt set int 1 r mailtext id int value result set rs pstmt execute query if rs next string txt rs get string 2 txt env parse context ctx window no txt false true m tab set value result txt rs close pstmt close catch sql exception e log log level severe sql e return windowno mtab mfield copymail windowno mtab mtab mfield mfield colname mfield getcolumnname colname r_mailtext_id mailheader mailtext r_mailtext r_mailtext_id preparedstatement preparestatement setint r_mailtext_id intvalue resultset executequery getstring parsecontext windowno mtab setvalue sqlexception request copy response text b callout b param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string copy response properties ctx int window no m tab m tab m field m field object value string col name m field get column name log info col name value if value null return integer r standardresponse id integer value string sql select name response text from r standardresponse where r standardresponse id try prepared statement pstmt db prepare statement sql null pstmt set int 1 r standardresponse id int value result set rs pstmt execute query if rs next string txt rs get string 2 txt env parse context ctx window no txt false true m tab set value result txt rs close pstmt close catch sql exception e log log level severe sql e return windowno mtab mfield copyresponse windowno mtab mtab mfield mfield colname mfield getcolumnname colname r_standardresponse_id responsetext r_standardresponse r_standardresponse_id preparedstatement preparestatement setint r_standardresponse_id intvalue resultset executequery getstring parsecontext windowno mtab setvalue sqlexception request chane of request type b callout b param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string type properties ctx int window no m tab m tab m field m field object value string col name m field get column name log info col name value m tab set value r status id null if value null return int r requesttype id integer value int value if r requesttype id 0 return m request type rt m request type get ctx r requesttype id int r status id rt getdefaultr status id if r status id 0 m tab set value r status id new integer r status id return windowno mtab mfield windowno mtab mtab mfield mfield colname mfield getcolumnname colname mtab setvalue r_status_id r_requesttype_id intvalue r_requesttype_id mrequesttype mrequesttype r_requesttype_id r_status_id getdefaultr_status_id r_status_id mtab setvalue r_status_id r_status_id get default keyboard focus mgr return focus manager public static a keyboard focus manager get if s kfm null s kfm new a keyboard focus manager return s kfm akeyboardfocusmanager s_kfm s_kfm akeyboardfocusmanager s_kfm constructor public a keyboard focus manager super set default focus traversal policy a focus traversal policy get akeyboardfocusmanager setdefaultfocustraversalpolicy afocustraversalpolicy standard constructor public x ad task properties ctx int ad task id string trx name super ctx ad task id trx name if ad task id 0 setad task id 0 set access level null set entity type null u set is server process false n set name null setos command null x_ad_task ad_task_id trxname ad_task_id trxname ad_task_id setad_task_id setaccesslevel setentitytype setisserverprocess setname setos_command load constructor public x ad task properties ctx result set rs string trx name super ctx rs trx name x_ad_task resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad task append get id append return sb to string tostring stringbuffer stringbuffer x_ad_task get_id tostring set os task operation system task public void setad task id int ad task id if ad task id 1 throw new illegal argument exception ad task id is mandatory set valuenocheck ad task id new integer ad task id setad_task_id ad_task_id ad_task_id illegalargumentexception ad_task_id set_valuenocheck ad_task_id ad_task_id get os task operation system task public int getad task id integer ii integer get value ad task id if ii null return 0 return ii int value getad_task_id get_value ad_task_id intvalue public static final string accesslevel all 7 set data access level access level required public void set access level string access level if access level null throw new illegal argument exception access level is mandatory if access level equals 1 access level equals 2 access level equals 3 access level equals 4 access level equals 6 access level equals 7 else throw new illegal argument exception access level invalid value access level reference id 5 1 2 3 4 6 7 if access level length 1 log warning length 1 truncated access level access level substring 0 0 set value access level access level accesslevel_all setaccesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel reference_id accesslevel accesslevel accesslevel set_value accesslevel accesslevel get data access level access level required public string get access level return string get value access level getaccesslevel get_value accesslevel set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set server process run this process on server only public void set is server process boolean is server process set value is server process new boolean is server process setisserverprocess isserverprocess set_value isserverprocess isserverprocess get server process run this process on server only public boolean is server process object oo get value is server process if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isserverprocess get_value isserverprocess booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set os command operating system command public void setos command string os command if os command null throw new illegal argument exception os command is mandatory if os command length 2000 log warning length 2000 truncated os command os command substring 0 1999 set value os command os command setos_command os_command os_command illegalargumentexception os_command os_command os_command os_command set_value os_command os_command get os command operating system command public string getos command return string get value os command getos_command get_value os_command standard constructor public x c bp customer acct properties ctx int c bp customer acct id string trx name super ctx c bp customer acct id trx name if c bp customer acct id 0 setc acctschema id 0 setc bpartner id 0 setc prepayment acct 0 setc receivable acct 0 setc receivable services acct 0 x_c_bp_customer_acct c_bp_customer_acct_id trxname c_bp_customer_acct_id trxname c_bp_customer_acct_id setc_acctschema_id setc_bpartner_id setc_prepayment_acct setc_receivable_acct setc_receivable_services_acct load constructor public x c bp customer acct properties ctx result set rs string trx name super ctx rs trx name x_c_bp_customer_acct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c bp customer acct append get id append return sb to string tostring stringbuffer stringbuffer x_c_bp_customer_acct get_id tostring set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set valuenocheck c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_valuenocheck c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set customer prepayment account for customer prepayments public void setc prepayment acct int c prepayment acct set value c prepayment acct new integer c prepayment acct setc_prepayment_acct c_prepayment_acct set_value c_prepayment_acct c_prepayment_acct get customer prepayment account for customer prepayments public int getc prepayment acct integer ii integer get value c prepayment acct if ii null return 0 return ii int value getc_prepayment_acct get_value c_prepayment_acct intvalue set customer receivables account for customer receivables public void setc receivable acct int c receivable acct set value c receivable acct new integer c receivable acct setc_receivable_acct c_receivable_acct set_value c_receivable_acct c_receivable_acct get customer receivables account for customer receivables public int getc receivable acct integer ii integer get value c receivable acct if ii null return 0 return ii int value getc_receivable_acct get_value c_receivable_acct intvalue set receivable services customer accounts receivables services account public void setc receivable services acct int c receivable services acct set value c receivable services acct new integer c receivable services acct setc_receivable_services_acct c_receivable_services_acct set_value c_receivable_services_acct c_receivable_services_acct get receivable services customer accounts receivables services account public int getc receivable services acct integer ii integer get value c receivable services acct if ii null return 0 return ii int value getc_receivable_services_acct get_value c_receivable_services_acct intvalue standard constructor public x c invoice properties ctx int c invoice id string trx name super ctx c invoice id trx name if c invoice id 0 setc bpartner id 0 setc bpartner location id 0 setc currency id 0 c currency id setc doctypetarget id 0 setc doctype id 0 0 setc invoice id 0 setc paymentterm id 0 set date acct new timestamp system current time millis date set date invoiced new timestamp system current time millis date set doc action null co set doc status null dr set document no null set grand total env zero set is approved false is approved set is discount printed false set is in dispute false n set is paid false set is pay schedule valid false set is printed false set isso trx false isso trx set is self service false set is tax included false set is transferred false setm pricelist id 0 set payment rule null p set posted false n set processed false set sende mail false set total lines env zero x_c_invoice c_invoice_id trxname c_invoice_id trxname c_invoice_id setc_bpartner_id setc_bpartner_location_id setc_currency_id c_currency_id setc_doctypetarget_id setc_doctype_id setc_invoice_id setc_paymentterm_id setdateacct currenttimemillis setdateinvoiced currenttimemillis setdocaction setdocstatus setdocumentno setgrandtotal setisapproved isapproved setisdiscountprinted setisindispute setispaid setispayschedulevalid setisprinted setissotrx issotrx setisselfservice setistaxincluded setistransferred setm_pricelist_id setpaymentrule setposted setprocessed setsendemail settotallines load constructor public x c invoice properties ctx result set rs string trx name super ctx rs trx name x_c_invoice resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c invoice append get id append return sb to string tostring stringbuffer stringbuffer x_c_invoice get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set cash journal line cash journal line public void setc cashline id int c cashline id if c cashline id 0 set value c cashline id null else set value c cashline id new integer c cashline id setc_cashline_id c_cashline_id c_cashline_id set_value c_cashline_id set_value c_cashline_id c_cashline_id get cash journal line cash journal line public int getc cashline id integer ii integer get value c cashline id if ii null return 0 return ii int value getc_cashline_id get_value c_cashline_id intvalue public static final int c charge id ad reference id 200 set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id c_charge_id_ad_reference_id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 0 set value c conversiontype id null else set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id set_value c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c doctypetarget id ad reference id 170 set target document type target document type for conversing documents public void setc doctypetarget id int c doctypetarget id if c doctypetarget id 1 throw new illegal argument exception c doctypetarget id is mandatory set value c doctypetarget id new integer c doctypetarget id c_doctypetarget_id_ad_reference_id setc_doctypetarget_id c_doctypetarget_id c_doctypetarget_id illegalargumentexception c_doctypetarget_id set_value c_doctypetarget_id c_doctypetarget_id get target document type target document type for conversing documents public int getc doctypetarget id integer ii integer get value c doctypetarget id if ii null return 0 return ii int value getc_doctypetarget_id get_value c_doctypetarget_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 throw new illegal argument exception c doctype id is mandatory set valuenocheck c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id illegalargumentexception c_doctype_id set_valuenocheck c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 1 throw new illegal argument exception c paymentterm id is mandatory set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id illegalargumentexception c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set charge amount charge amount public void set charge amt big decimal charge amt set value charge amt charge amt setchargeamt bigdecimal chargeamt set_value chargeamt chargeamt get charge amount charge amount public big decimal get charge amt big decimal bd big decimal get value charge amt if bd null return env zero return bd bigdecimal getchargeamt bigdecimal bigdecimal get_value chargeamt set copy from copy from record public void set copy from string copy from if copy from null copy from length 1 log warning length 1 truncated copy from copy from substring 0 0 set value copy from copy from setcopyfrom copyfrom copyfrom copyfrom copyfrom copyfrom set_value copyfrom copyfrom get copy from copy from record public string get copy from return string get value copy from getcopyfrom get_value copyfrom set create lines from process which will generate a new document lines based on an existing document public void set create from string create from if create from null create from length 1 log warning length 1 truncated create from create from substring 0 0 set value create from create from setcreatefrom createfrom createfrom createfrom createfrom createfrom set_value createfrom createfrom get create lines from process which will generate a new document lines based on an existing document public string get create from return string get value create from getcreatefrom get_value createfrom set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date invoiced date printed on invoice public void set date invoiced timestamp date invoiced if date invoiced null throw new illegal argument exception date invoiced is mandatory set value date invoiced date invoiced setdateinvoiced dateinvoiced dateinvoiced illegalargumentexception dateinvoiced set_value dateinvoiced dateinvoiced get date invoiced date printed on invoice public timestamp get date invoiced return timestamp get value date invoiced getdateinvoiced get_value dateinvoiced set date ordered date of order public void set date ordered timestamp date ordered set valuenocheck date ordered date ordered setdateordered dateordered set_valuenocheck dateordered dateordered get date ordered date of order public timestamp get date ordered return timestamp get value date ordered getdateordered get_value dateordered set date printed date the document was printed public void set date printed timestamp date printed set value date printed date printed setdateprinted dateprinted set_value dateprinted dateprinted get date printed date the document was printed public timestamp get date printed return timestamp get value date printed getdateprinted get_value dateprinted set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set document no document sequence number of the document public void set document no string document no if document no null throw new illegal argument exception document no is mandatory if document no length 30 log warning length 30 truncated document no document no substring 0 29 set valuenocheck document no document no setdocumentno documentno documentno illegalargumentexception documentno documentno documentno documentno set_valuenocheck documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set generate to generate to public void set generate to string generate to if generate to null generate to length 1 log warning length 1 truncated generate to generate to substring 0 0 set value generate to generate to setgenerateto generateto generateto generateto generateto generateto set_value generateto generateto get generate to generate to public string get generate to return string get value generate to getgenerateto get_value generateto set grand total total amount of document public void set grand total big decimal grand total if grand total null throw new illegal argument exception grand total is mandatory set valuenocheck grand total grand total setgrandtotal bigdecimal grandtotal grandtotal illegalargumentexception grandtotal set_valuenocheck grandtotal grandtotal get grand total total amount of document public big decimal get grand total big decimal bd big decimal get value grand total if bd null return env zero return bd bigdecimal getgrandtotal bigdecimal bigdecimal get_value grandtotal set approved indicates if this document requires approval public void set is approved boolean is approved set valuenocheck is approved new boolean is approved setisapproved isapproved set_valuenocheck isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set discount printed print discount on invoice and order public void set is discount printed boolean is discount printed set value is discount printed new boolean is discount printed setisdiscountprinted isdiscountprinted set_value isdiscountprinted isdiscountprinted get discount printed print discount on invoice and order public boolean is discount printed object oo get value is discount printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountprinted get_value isdiscountprinted booleanvalue set in dispute document is in dispute public void set is in dispute boolean is in dispute set value is in dispute new boolean is in dispute setisindispute isindispute set_value isindispute isindispute get in dispute document is in dispute public boolean is in dispute object oo get value is in dispute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isindispute get_value isindispute booleanvalue set paid the document is paid public void set is paid boolean is paid set value is paid new boolean is paid setispaid ispaid set_value ispaid ispaid get paid the document is paid public boolean is paid object oo get value is paid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispaid get_value ispaid booleanvalue set pay schedule valid is the payment schedule is valid public void set is pay schedule valid boolean is pay schedule valid set valuenocheck is pay schedule valid new boolean is pay schedule valid setispayschedulevalid ispayschedulevalid set_valuenocheck ispayschedulevalid ispayschedulevalid get pay schedule valid is the payment schedule is valid public boolean is pay schedule valid object oo get value is pay schedule valid if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispayschedulevalid get_value ispayschedulevalid booleanvalue set printed indicates if this document line is printed public void set is printed boolean is printed set valuenocheck is printed new boolean is printed setisprinted isprinted set_valuenocheck isprinted isprinted get printed indicates if this document line is printed public boolean is printed object oo get value is printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprinted get_value isprinted booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set valuenocheck isso trx new boolean isso trx setissotrx issotrx set_valuenocheck issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue set price includes tax tax is included in the price public void set is tax included boolean is tax included set value is tax included new boolean is tax included setistaxincluded istaxincluded set_value istaxincluded istaxincluded get price includes tax tax is included in the price public boolean is tax included object oo get value is tax included if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxincluded get_value istaxincluded booleanvalue set transferred transferred to general ledger i e accounted public void set is transferred boolean is transferred set valuenocheck is transferred new boolean is transferred setistransferred istransferred set_valuenocheck istransferred istransferred get transferred transferred to general ledger i e accounted public boolean is transferred object oo get value is transferred if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istransferred get_value istransferred booleanvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 1 throw new illegal argument exception m pricelist id is mandatory set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id illegalargumentexception m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set value po reference po reference setporeference poreference poreference poreference poreference poreference set_value poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set value payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule set_value paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set valuenocheck processed new boolean processed setprocessed set_valuenocheck get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set referenced invoice public void setref invoice id int ref invoice id if ref invoice id 0 set value ref invoice id null else set value ref invoice id new integer ref invoice id setref_invoice_id ref_invoice_id ref_invoice_id set_value ref_invoice_id set_value ref_invoice_id ref_invoice_id get referenced invoice public int getref invoice id integer ii integer get value ref invoice id if ii null return 0 return ii int value getref_invoice_id get_value ref_invoice_id intvalue public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set send e mail enable sending document e mail public void set sende mail boolean sende mail set value sende mail new boolean sende mail email email setsendemail sendemail set_value sendemail sendemail get send e mail enable sending document e mail public boolean is sende mail object oo get value sende mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email issendemail get_value sendemail booleanvalue set total lines total of all document lines public void set total lines big decimal total lines if total lines null throw new illegal argument exception total lines is mandatory set valuenocheck total lines total lines settotallines bigdecimal totallines totallines illegalargumentexception totallines set_valuenocheck totallines totallines get total lines total of all document lines public big decimal get total lines big decimal bd big decimal get value total lines if bd null return env zero return bd bigdecimal gettotallines bigdecimal bigdecimal get_value totallines public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue constructor param ctx context param pa reportcolumnset id id public m report column set properties ctx int pa reportcolumnset id string trx name super ctx pa reportcolumnset id trx name if pa reportcolumnset id 0 else load columns pa_reportcolumnset_id mreportcolumnset pa_reportcolumnset_id trxname pa_reportcolumnset_id trxname pa_reportcolumnset_id loadcolumns load contained columns private void load columns array list m report column list new array list m report column string sql select from pa reportcolumn where pa reportcolumnset id and is active y order by seq no prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa reportcolumnset id result set rs pstmt execute query while rs next list add new m report column get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m columns new m report column list size list to array m columns log finest id getpa reportcolumnset id size list size loadcolumns arraylist mreportcolumn arraylist mreportcolumn pa_reportcolumn pa_reportcolumnset_id isactive seqno preparedstatement preparestatement get_trxname setint getpa_reportcolumnset_id resultset executequery mreportcolumn getctx m_columns mreportcolumn toarray m_columns getpa_reportcolumnset_id get columns return columns public m report column get columns return m columns mreportcolumn getcolumns m_columns list info public void list system out println to string if m columns null return for int i 0 i m columns length i system out println m columns i to string tostring m_columns m_columns m_columns tostring string representation return info public string to string string buffer sb new string buffer m report column set append get id append append get name append return sb to string tostring stringbuffer stringbuffer mreportcolumnset get_id getname tostring record access dialog param owner owner param ad table id table param record id record public record access dialog j frame owner int ad table id int record id super owner msg translate env get ctx record access dialog log info ad table id ad table id record id record id m ad table id ad table id m record id record id try dyn init jb init catch exception e log log level severe e a env show center window owner this ad_table_id record_id recordaccessdialog jframe ad_table_id record_id getctx recordaccessdialog ad_table_id ad_table_id record_id record_id m_ad_table_id ad_table_id m_record_id record_id dyninit jbinit aenv showcenterwindow dynamic init private void dyn init load roles string sql m role get default add accesssql select ad role id name from ad role order by 2 ad role m role sql notqualified m role sql ro role field new c combo box db get key name pairs sql false load record access for all roles sql select from ad record access where ad table id and record id and ad client id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m ad table id pstmt set int 2 m record id pstmt set int 3 env getad client id env get ctx result set rs pstmt execute query while rs next m recordaccesss add new m record access env get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null log fine m recordaccesss size set line 0 false dyninit mrole getdefault addaccesssql ad_role_id ad_role ad_role mrole sql_notqualified mrole sql_ro rolefield ccombobox getkeynamepairs ad_record_access ad_table_id record_id ad_client_id preparedstatement preparestatement setint m_ad_table_id setint m_record_id setint getad_client_id getctx resultset executequery m_recordaccesss mrecordaccess getctx m_recordaccesss setline static init throws exception private void jb init throws exception this get content pane set layout main layout this get content pane add center panel border layout center this get content pane add confirm panel border layout south center panel add b up new a layout constraint 0 0 center panel add b new new a layout constraint 0 6 center panel add role label new a layout constraint 1 0 center panel add role field null center panel add cb active null center panel add cb exclude null center panel add cb read only null center panel add cb dependent null center panel add b delete null center panel add b down new a layout constraint 2 0 center panel add row no label new a layout constraint 2 6 dimension size center panel get preferred size size width 600 center panel set preferred size size b up add action listener this b down add action listener this b delete add action listener this b new add action listener this confirm panel add action listener this jbinit getcontentpane setlayout mainlayout getcontentpane centerpanel borderlayout getcontentpane confirmpanel borderlayout centerpanel bup alayoutconstraint centerpanel bnew alayoutconstraint centerpanel rolelabel alayoutconstraint centerpanel rolefield centerpanel cbactive centerpanel cbexclude centerpanel cbreadonly centerpanel cbdependent centerpanel bdelete centerpanel bdown alayoutconstraint centerpanel rownolabel alayoutconstraint centerpanel getpreferredsize centerpanel setpreferredsize bup addactionlistener bdown addactionlistener bdelete addactionlistener bnew addactionlistener confirmpanel addactionlistener set line param row delta delta to current row private void set line int row delta boolean new record log fine delta row delta new new record current row m currentrow size m recordaccesss size int max index 0 nothing defined if m recordaccesss size 0 m currentrow 0 max index 0 new record true set line null else if new record m currentrow m recordaccesss size max index m currentrow set line null else m currentrow row delta max index m recordaccesss size 1 if m currentrow 0 m currentrow 0 else if m currentrow max index m currentrow max index m record access ra m record access m recordaccesss get m currentrow set line ra label string buffer txt new string buffer if new record txt append txt append m currentrow 1 append append max index 1 row no label set text txt to string set up down b up set enabled m currentrow 0 b down set enabled m currentrow max index rowdelta setline rowdelta newrecord rowdelta newrecord currentrow m_currentrow m_recordaccesss maxindex m_recordaccesss m_currentrow maxindex newrecord setline newrecord m_currentrow m_recordaccesss maxindex m_currentrow setline m_currentrow rowdelta maxindex m_recordaccesss m_currentrow m_currentrow m_currentrow maxindex m_currentrow maxindex mrecordaccess mrecordaccess m_recordaccesss m_currentrow setline stringbuffer stringbuffer newrecord m_currentrow maxindex rownolabel settext tostring bup setenabled m_currentrow bdown setenabled m_currentrow maxindex set selection param ra record access private void set line m record access ra int ad role id 0 boolean active true boolean exclude true boolean readonly false boolean dependent false if ra null ad role id ra getad role id active ra is active exclude ra is exclude readonly ra is read only dependent ra is dependent entities cb active set selected active cb exclude set selected exclude cb read only set selected readonly cb dependent set selected dependent b delete set enabled ra null key name pair selection null for int i 0 i role field get item count i key name pair pp key name pair role field get item at i if pp get key ad role id selection pp if selection null ra null role field set selected item selection m currentdata ra log fine ra else m currentdata null setline mrecordaccess ad_role_id ad_role_id getad_role_id isactive isexclude isreadonly isdependententities cbactive setselected cbexclude setselected cbreadonly setselected cbdependent setselected bdelete setenabled keynamepair rolefield getitemcount keynamepair keynamepair rolefield getitemat getkey ad_role_id rolefield setselecteditem m_currentdata m_currentdata action listener param e event public void action performed action event e if e get source b up set line 1 false else if e get source b down set line 1 false else if e get source b new set line 0 true else if e get source b delete cmd delete else if e get action command equals confirm panel a ok if cmd save return dispose actionperformed actionevent getsource bup setline getsource bdown setline getsource bnew setline getsource bdelete cmd_delete getactioncommand confirmpanel a_ok cmd_save save command return true if saved private boolean cmd save key name pair pp key name pair role field get selected item role field set background pp null if pp null return false int ad role id pp get key boolean is active cb active is selected boolean is exclude cb exclude is selected boolean is read only cb read only is selected boolean is dependent entities cb dependent is selected if m currentdata null m currentdata new m record access env get ctx ad role id m ad table id m record id null m recordaccesss add m currentdata m currentrow m recordaccesss size 1 m currentdata set is active is active m currentdata set is exclude is exclude m currentdata set is read only is read only m currentdata set is dependent entities is dependent entities boolean success m currentdata save log fine success success return success cmd_save keynamepair keynamepair rolefield getselecteditem rolefield setbackground ad_role_id getkey isactive cbactive isselected isexclude cbexclude isselected isreadonly cbreadonly isselected isdependententities cbdependent isselected m_currentdata m_currentdata mrecordaccess getctx ad_role_id m_ad_table_id m_record_id m_recordaccesss m_currentdata m_currentrow m_recordaccesss m_currentdata setisactive isactive m_currentdata setisexclude isexclude m_currentdata setisreadonly isreadonly m_currentdata setisdependententities isdependententities m_currentdata delete command return true if deleted private boolean cmd delete boolean success false if m currentdata null log log level severe no data else success m currentdata delete true m currentdata null m recordaccesss remove m currentrow log fine success success return success cmd_delete m_currentdata m_currentdata m_currentdata m_recordaccesss m_currentrow standard constructor public x ad form properties ctx int ad form id string trx name super ctx ad form id trx name if ad form id 0 setad form id 0 set access level null set entity type null u set is beta functionality false set name null x_ad_form ad_form_id trxname ad_form_id trxname ad_form_id setad_form_id setaccesslevel setentitytype setisbetafunctionality setname load constructor public x ad form properties ctx result set rs string trx name super ctx rs trx name x_ad_form resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad form append get id append return sb to string tostring stringbuffer stringbuffer x_ad_form get_id tostring set special form special form public void setad form id int ad form id if ad form id 1 throw new illegal argument exception ad form id is mandatory set valuenocheck ad form id new integer ad form id setad_form_id ad_form_id ad_form_id illegalargumentexception ad_form_id set_valuenocheck ad_form_id ad_form_id get special form special form public int getad form id integer ii integer get value ad form id if ii null return 0 return ii int value getad_form_id get_value ad_form_id intvalue public static final string accesslevel all 7 set data access level access level required public void set access level string access level if access level null throw new illegal argument exception access level is mandatory if access level equals 1 access level equals 2 access level equals 3 access level equals 4 access level equals 6 access level equals 7 else throw new illegal argument exception access level invalid value access level reference id 5 1 2 3 4 6 7 if access level length 1 log warning length 1 truncated access level access level substring 0 0 set value access level access level accesslevel_all setaccesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel accesslevel illegalargumentexception accesslevel accesslevel reference_id accesslevel accesslevel accesslevel set_value accesslevel accesslevel get data access level access level required public string get access level return string get value access level getaccesslevel get_value accesslevel set classname java classname public void set classname string classname if classname null classname length 60 log warning length 60 truncated classname classname substring 0 59 set value classname classname setclassname set_value get classname java classname public string get classname return string get value classname getclassname get_value set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set beta functionality this functionality is considered beta public void set is beta functionality boolean is beta functionality set value is beta functionality new boolean is beta functionality setisbetafunctionality isbetafunctionality set_value isbetafunctionality isbetafunctionality get beta functionality this functionality is considered beta public boolean is beta functionality object oo get value is beta functionality if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isbetafunctionality get_value isbetafunctionality booleanvalue set jsp url web url of the jsp function public void setjspurl string jspurl if jspurl null jspurl length 120 log warning length 120 truncated jspurl jspurl substring 0 119 set value jspurl jspurl set_value get jsp url web url of the jsp function public string getjspurl return string get value jspurl get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname get allocated payment amount payment allocated param p c payment id payment param p c currency id currency return allocated amount throws sql exception public static big decimal allocated int p c payment id int p c currency id throws sql exception charge nothing available string sql select c charge id from c payment where c payment id int c charge id compiere getsql value sql p c payment id if c charge id 0 return compiere zero int c conversiontype id 0 calculate allocated amount big decimal allocated amt get allocated amt p c payment id p c currency id c conversiontype id round return currency round allocated amt p c currency id null paymentallocated p_c_payment_id p_c_currency_id sqlexception bigdecimal p_c_payment_id p_c_currency_id sqlexception c_charge_id c_payment c_payment_id c_charge_id getsqlvalue p_c_payment_id c_charge_id c_conversiontype_id bigdecimal allocatedamt getallocatedamt p_c_payment_id p_c_currency_id c_conversiontype_id allocatedamt p_c_currency_id get available payment amount in payment currency param p c payment id payment return available amt throws sql exception public static big decimal available int p c payment id throws sql exception if p c payment id 0 return null int c currency id 0 int c conversiontype id 0 big decimal pay amt null int c charge id 0 string sql select c currency id c conversiontype id pay amt c charge id from c payment v corrected for ap ar where c payment id prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c payment id result set rs pstmt execute query if rs next c currency id rs get int 1 c conversiontype id rs get int 2 pay amt rs get big decimal 3 c charge id rs get int 4 rs close pstmt close not found if pay amt null return null charge nothing available if c charge id 0 return compiere zero calculate allocated amount big decimal allocated amt get allocated amt p c payment id c currency id c conversiontype id big decimal available pay amt subtract allocated amt round return currency round available c currency id null p_c_payment_id sqlexception bigdecimal p_c_payment_id sqlexception p_c_payment_id c_currency_id c_conversiontype_id bigdecimal payamt c_charge_id c_currency_id c_conversiontype_id payamt c_charge_id c_payment_v c_payment_id preparedstatement preparestatement setint p_c_payment_id resultset executequery c_currency_id getint c_conversiontype_id getint payamt getbigdecimal c_charge_id getint payamt c_charge_id bigdecimal allocatedamt getallocatedamt p_c_payment_id c_currency_id c_conversiontype_id bigdecimal payamt allocatedamt c_currency_id get allocated amt param p c payment id payment param p c currency id currency param p c conversiontype id conversion type return allocated amount in currency throws sql exception static big decimal get allocated amt int p c payment id int p c currency id int p c conversiontype id throws sql exception calculate allocated amount big decimal allocated amt compiere zero string sql select a ad client id a ad org id al amount a c currency id a date trx from c allocationline al inner join c allocationhdr a on al c allocationhdr id a c allocationhdr id where al c payment id and a is active y and al c invoice id is not null prepared statement pstmt compiere prepare statement sql pstmt set int 1 p c payment id result set rs pstmt execute query while rs next int ad client id rs get int 1 int ad org id rs get int 2 big decimal amount rs get big decimal 3 int c currencyfrom id rs get int 4 timestamp date trx rs get timestamp 5 big decimal allocation currency convert amount multiply multiplierap c currencyfrom id p c currency id date trx p c conversiontype id ad client id ad org id if allocation null allocated amt allocated amt add allocation rs close pstmt close return allocated amt p_c_payment_id p_c_currency_id p_c_conversiontype_id sqlexception bigdecimal getallocatedamt p_c_payment_id p_c_currency_id p_c_conversiontype_id sqlexception bigdecimal allocatedamt ad_client_id ad_org_id c_currency_id datetrx c_allocationline c_allocationhdr c_allocationhdr_id c_allocationhdr_id c_payment_id isactive c_invoice_id preparedstatement preparestatement setint p_c_payment_id resultset executequery ad_client_id getint ad_org_id getint bigdecimal getbigdecimal c_currencyfrom_id getint datetrx gettimestamp bigdecimal c_currencyfrom_id p_c_currency_id datetrx p_c_conversiontype_id ad_client_id ad_org_id allocatedamt allocatedamt allocatedamt basic constructor use set methods public font basic constructor param face create new font object with this face public font string face set face face setface basic constructor param face param color create a new font object with the face abd color already set convience colors are defined in html color interface public font string face string color set face face set color color htmlcolor setface setcolor basic constructor param face param color param size create a new font object with the face color and size already set convience colors are defined in html color interface public font string face string color int size set face face set color color set size size htmlcolor setface setcolor setsize basic constructor param size create a new font object with the size already set public font int size set size size setsize basic constructor param size param face create a new font object with the size and face already set public font int size string face set size size set face face setsize setface basic constructor param color param size create a new font object with the size and color already set public font string color int size set size size set color color setsize setcolor sets the face attribute param face sets the face attribute public font set face string face add attribute face face return this setface addattribute sets the color attribute param color sets the color attribute convience colors are defined in the html colors interface public font set color string color add attribute color html color convert color color return this htmlcolors setcolor addattribute htmlcolor convertcolor sets the size attribute param size sets the size attribute public font set size int size add attribute size integer to string size return this setsize addattribute tostring sets the size attribute param size sets the size attribute public font set size string size add attribute size size return this setsize addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public font add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public font add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public font add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds and element to the element public font add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public font remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry null constructor private null string representation return info public string to string return null tostring standard constructor public x w basketline properties ctx int w basketline id string trx name super ctx w basketline id trx name if w basketline id 0 set description null set line 0 set price env zero set product null set qty env zero setw basketline id 0 setw basket id 0 x_w_basketline w_basketline_id trxname w_basketline_id trxname w_basketline_id setdescription setline setprice setproduct setqty setw_basketline_id setw_basket_id load constructor public x w basketline properties ctx result set rs string trx name super ctx rs trx name x_w_basketline resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x w basketline append get id append return sb to string tostring stringbuffer stringbuffer x_w_basketline get_id tostring set description optional short description of the record public void set description string description if description null throw new illegal argument exception description is mandatory if description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription illegalargumentexception set_value get description optional short description of the record public string get description return string get value description getdescription get_value set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set price price public void set price big decimal price if price null throw new illegal argument exception price is mandatory set value price price setprice bigdecimal illegalargumentexception set_value get price price public big decimal get price big decimal bd big decimal get value price if bd null return env zero return bd bigdecimal getprice bigdecimal bigdecimal get_value set product public void set product string product if product null throw new illegal argument exception product is mandatory if product length 40 log warning length 40 truncated product product substring 0 39 set value product product setproduct illegalargumentexception set_value get product public string get product return string get value product getproduct get_value set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set basket line web basket line public void setw basketline id int w basketline id if w basketline id 1 throw new illegal argument exception w basketline id is mandatory set valuenocheck w basketline id new integer w basketline id setw_basketline_id w_basketline_id w_basketline_id illegalargumentexception w_basketline_id set_valuenocheck w_basketline_id w_basketline_id get basket line web basket line public int getw basketline id integer ii integer get value w basketline id if ii null return 0 return ii int value getw_basketline_id get_value w_basketline_id intvalue set w basket id web basket public void setw basket id int w basket id if w basket id 1 throw new illegal argument exception w basket id is mandatory set valuenocheck w basket id new integer w basket id w_basket_id setw_basket_id w_basket_id w_basket_id illegalargumentexception w_basket_id set_valuenocheck w_basket_id w_basket_id get w basket id web basket public int getw basket id integer ii integer get value w basket id if ii null return 0 return ii int value w_basket_id getw_basket_id get_value w_basket_id intvalue convert qty to target uom and round param ctx context param c uom id from uom param c uom to id to uom param qty qty return converted qty std precision static public big decimal convert properties ctx int c uom id int c uom to id big decimal qty if qty null qty equals env zero c uom id c uom to id return qty big decimal ret value get rate ctx c uom id c uom to id if ret value null muom uom muom get ctx c uom to id if uom null return uom round ret value multiply qty true return ret value multiply qty return null c_uom_id c_uom_to_id bigdecimal c_uom_id c_uom_to_id bigdecimal c_uom_id c_uom_to_id bigdecimal retvalue getrate c_uom_id c_uom_to_id retvalue c_uom_to_id retvalue retvalue get multiplier rate to target uom param ctx context param c uom id from uom param c uom to id to uom return multiplier static public big decimal get rate properties ctx int c uom id int c uom to id nothing to do if c uom id c uom to id return env one point p new point c uom id c uom to id get conversion big decimal ret value get rate ctx p return ret value c_uom_id c_uom_to_id bigdecimal getrate c_uom_id c_uom_to_id c_uom_id c_uom_to_id c_uom_id c_uom_to_id bigdecimal retvalue getrate retvalue convert qty to target uom and round param ctx context param c uom id from uom param qty qty return minutes 0 if not found static public int convert to minutes properties ctx int c uom id big decimal qty if qty null return 0 int c uom to id muom getminute uom id ctx if c uom id c uom to id return qty int value big decimal result convert ctx c uom id c uom to id qty if result null return 0 return result int value c_uom_id converttominutes c_uom_id bigdecimal c_uom_to_id getminute_uom_id c_uom_id c_uom_to_id intvalue bigdecimal c_uom_id c_uom_to_id intvalue calculate end date based on start date and qty param ctx context param start date date param c uom id uom param qty qty return end date static public timestamp get end date properties ctx timestamp start date int c uom id big decimal qty gregorian calendar end date new gregorian calendar end date set time start date int minutes muom conversion convert to minutes ctx c uom id qty end date add calendar minute minutes timestamp ret value new timestamp end date get time in millis log config time util get end date start start date qty qty end ret value return ret value startdate c_uom_id getenddate startdate c_uom_id bigdecimal gregoriancalendar enddate gregoriancalendar enddate settime startdate muomconversion converttominutes c_uom_id enddate retvalue enddate gettimeinmillis timeutil getenddate startdate retvalue retvalue get conversion multiplier rate try to derive it if not found directly param ctx context param p point with from x to y c uom id return conversion multiplier or null static private big decimal get rate properties ctx point p big decimal ret value null if ini is client if s conversions null create rates ctx ret value big decimal s conversions get p else ret value get rate p x p y if ret value null return ret value try to derive return derive rate ctx p x p y c_uom_id bigdecimal getrate bigdecimal retvalue isclient s_conversions createrates retvalue bigdecimal s_conversions retvalue getrate retvalue retvalue deriverate create conversion matrix client param ctx context private static void create rates properties ctx s conversions new c cache point big decimal c uomconversion 20 string sql m role get default ctx false add accesssql select c uom id c uom to id multiply rate divide rate from c uom conversion where is active y and m product id is null c uom conversion m role sql notqualified m role sql ro try prepared statement pstmt db prepare statement sql null result set rs pstmt execute query while rs next point p new point rs get int 1 rs get int 2 big decimal mr rs get big decimal 3 big decimal dr rs get big decimal 4 if mr null s conversions put p mr reverse if dr null mr null dr env one divide mr big decimal round half up if dr null s conversions put new point p y p x dr rs close pstmt close catch sql exception e s log log level severe sql e createrates s_conversions ccache bigdecimal c_uomconversion mrole getdefault addaccesssql c_uom_id c_uom_to_id multiplyrate dividerate c_uom_conversion isactive m_product_id c_uom_conversion mrole sql_notqualified mrole sql_ro preparedstatement preparestatement resultset executequery getint getint bigdecimal getbigdecimal bigdecimal getbigdecimal s_conversions bigdecimal round_half_up s_conversions sqlexception s_log derive standard conversions param ctx context param c uom id from uom param c uom to id to uom return conversion or null public static big decimal derive rate properties ctx int c uom id int c uom to id if c uom id c uom to id return env one get info muom from muom get ctx c uom id muom to muom get ctx c uom to id if from null to null return null time minute if from is minute if to is hour return new big decimal 1 0 60 0 if to is day return new big decimal 1 0 1440 0 24 60 if to is work day return new big decimal 1 0 480 0 8 60 if to is week return new big decimal 1 0 10080 0 7 24 60 if to is month return new big decimal 1 0 43200 0 30 24 60 if to is work month return new big decimal 1 0 9600 0 4 5 8 60 if to is year return new big decimal 1 0 525600 0 365 24 60 time hour if from is hour if to is minute return new big decimal 60 0 if to is day return new big decimal 1 0 24 0 if to is work day return new big decimal 1 0 8 0 if to is week return new big decimal 1 0 168 0 7 24 if to is month return new big decimal 1 0 720 0 30 24 if to is work month return new big decimal 1 0 160 0 4 5 8 if to is year return new big decimal 1 0 8760 0 365 24 time day if from is day if to is minute return new big decimal 1440 0 24 60 if to is hour return new big decimal 24 0 if to is work day return new big decimal 3 0 24 8 if to is week return new big decimal 1 0 7 0 7 if to is month return new big decimal 1 0 30 0 30 if to is work month return new big decimal 1 0 20 0 4 5 if to is year return new big decimal 1 0 365 0 365 time work day if from is work day if to is minute return new big decimal 480 0 8 60 if to is hour return new big decimal 8 0 8 if to is day return new big decimal 1 0 3 0 24 8 if to is week return new big decimal 1 0 5 5 if to is month return new big decimal 1 0 20 0 4 5 if to is work month return new big decimal 1 0 20 0 4 5 if to is year return new big decimal 1 0 240 0 4 5 12 time week if from is week if to is minute return new big decimal 10080 0 7 24 60 if to is hour return new big decimal 168 0 7 24 if to is day return new big decimal 7 0 if to is work day return new big decimal 5 0 if to is month return new big decimal 1 0 4 0 4 if to is work month return new big decimal 1 0 4 0 4 if to is year return new big decimal 1 0 50 0 50 time month if from is month if to is minute return new big decimal 43200 0 30 24 60 if to is hour return new big decimal 720 0 30 24 if to is day return new big decimal 30 0 30 if to is work day return new big decimal 20 0 4 5 if to is week return new big decimal 4 0 4 if to is work month return new big decimal 1 5 30 20 if to is year return new big decimal 1 0 12 0 12 time work month if from is work month if to is minute return new big decimal 9600 0 4 5 8 60 if to is hour return new big decimal 160 0 4 5 8 if to is day return new big decimal 20 0 4 5 if to is work day return new big decimal 20 0 4 5 if to is week return new big decimal 4 0 4 if to is month return new big decimal 20 0 30 0 20 30 if to is year return new big decimal 1 0 12 0 12 time year if from is year if to is minute return new big decimal 518400 0 12 30 24 60 if to is hour return new big decimal 8640 0 12 30 24 if to is day return new big decimal 365 0 365 if to is work day return new big decimal 240 0 12 4 5 if to is week return new big decimal 50 0 52 if to is month return new big decimal 12 0 12 if to is work month return new big decimal 12 0 12 return null c_uom_id c_uom_to_id bigdecimal deriverate c_uom_id c_uom_to_id c_uom_id c_uom_to_id c_uom_id c_uom_to_id isminute ishour bigdecimal isday bigdecimal isworkday bigdecimal isweek bigdecimal ismonth bigdecimal isworkmonth bigdecimal isyear bigdecimal ishour isminute bigdecimal isday bigdecimal isworkday bigdecimal isweek bigdecimal ismonth bigdecimal isworkmonth bigdecimal isyear bigdecimal isday isminute bigdecimal ishour bigdecimal isworkday bigdecimal isweek bigdecimal ismonth bigdecimal isworkmonth bigdecimal isyear bigdecimal workday isworkday isminute bigdecimal ishour bigdecimal isday bigdecimal isweek bigdecimal ismonth bigdecimal isworkmonth bigdecimal isyear bigdecimal isweek isminute bigdecimal ishour bigdecimal isday bigdecimal isworkday bigdecimal ismonth bigdecimal isworkmonth bigdecimal isyear bigdecimal ismonth isminute bigdecimal ishour bigdecimal isday bigdecimal isworkday bigdecimal isweek bigdecimal isworkmonth bigdecimal isyear bigdecimal workmonth isworkmonth isminute bigdecimal ishour bigdecimal isday bigdecimal isworkday bigdecimal isweek bigdecimal ismonth bigdecimal isyear bigdecimal isyear isminute bigdecimal ishour bigdecimal isday bigdecimal isworkday bigdecimal isweek bigdecimal ismonth bigdecimal isworkmonth bigdecimal get conversion multiplier rate from server param c uom id from uom param c uom to id to uom return conversion multiplier or null public static big decimal get rate int c uom id int c uom to id return convert c uom id c uom to id getrate false c_uom_id c_uom_to_id bigdecimal getrate c_uom_id c_uom_to_id c_uom_id c_uom_to_id get converted qty from server no cache param qty the quantity to be converted param c uom from id the c uom id of the qty param c uom to id the targeted uom param std precision if true standard precision if false costing precision return amount depreciated should not be used public static big decimal convert int c uom from id int c uom to id big decimal qty boolean std precision nothing to do if qty null qty equals env zero c uom from id c uom to id return qty big decimal ret value null int precision 2 string sql select c multiply rate uom to std precision uom to costing precision from c uom conversion c inner join c uom uom to on c c uom to id uom to c uom id where c is active y and c c uom id and c c uom to id 1 2 and c m product id is null order by c ad client id desc c ad org id desc prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c uom from id pstmt set int 2 c uom to id result set rs pstmt execute query if rs next ret value rs get big decimal 1 precision rs get int std precision 2 3 rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null s log info not found fromuom c uom from id touom c uom to id return null just get rate if getrate equals qty return ret value calculate scale ret value ret value multiply qty if ret value scale precision ret value ret value set scale precision big decimal round half up return ret value c_uom_from_id c_uom_id c_uom_to_id stdprecision bigdecimal c_uom_from_id c_uom_to_id bigdecimal stdprecision c_uom_from_id c_uom_to_id bigdecimal retvalue multiplyrate uomto stdprecision uomto costingprecision c_uom_conversion c_uom uomto c_uom_to_id uomto c_uom_id isactive c_uom_id c_uom_to_id m_product_id ad_client_id ad_org_id preparedstatement preparestatement setint c_uom_from_id setint c_uom_to_id resultset executequery retvalue getbigdecimal getint stdprecision s_log retvalue s_log c_uom_from_id c_uom_to_id retvalue retvalue retvalue retvalue retvalue retvalue setscale bigdecimal round_half_up retvalue convert qty amt from entered uom to product uom and round param ctx context param m product id product param c uom to id entered uom param qty price entered quantity or price return product qty amt in product uom precision rounded static public big decimal convert product to properties ctx int m product id int c uom to id big decimal qty price if qty price null qty price signum 0 m product id 0 c uom to id 0 return qty price big decimal ret value get product rate to ctx m product id c uom to id if ret value null if env one compare to ret value 0 return qty price muom uom muom get ctx c uom to id if uom null return uom round ret value multiply qty price true return ret value multiply qty price return null m_product_id c_uom_to_id qtyprice bigdecimal convertproductto m_product_id c_uom_to_id bigdecimal qtyprice qtyprice qtyprice m_product_id c_uom_to_id qtyprice bigdecimal retvalue getproductrateto m_product_id c_uom_to_id retvalue compareto retvalue qtyprice c_uom_to_id retvalue qtyprice retvalue qtyprice get multiplier rate from entered uom to product uom param ctx context param m product id product param c uom to id entered uom return multiplier or null static public big decimal get product rate to properties ctx int m product id int c uom to id if m product id 0 return null muom conversion rates get product conversions ctx m product id if rates length 0 s log fine none found return null for int i 0 i rates length i muom conversion rate rates i if rate getc uom to id c uom to id return rate get multiply rate s log fine none applied return null m_product_id c_uom_to_id bigdecimal getproductrateto m_product_id c_uom_to_id m_product_id muomconversion getproductconversions m_product_id s_log muomconversion getc_uom_to_id c_uom_to_id getmultiplyrate s_log convert qty amt from product uom to entered uom and round param ctx context param m product id product param c uom to id entered uom param qty price quantity or price return entered qty in entered uom precision rounded static public big decimal convert product from properties ctx int m product id int c uom to id big decimal qty price no conversion if qty price null qty price equals env zero c uom to id 0 m product id 0 s log fine no conversion qty price qty price return qty price big decimal ret value get product rate from ctx m product id c uom to id if ret value null if env one compare to ret value 0 return qty price muom uom muom get ctx c uom to id if uom null return uom round ret value multiply qty price true return ret value multiply qty price s log fine no rate m product id m product id return null m_product_id c_uom_to_id qtyprice bigdecimal convertproductfrom m_product_id c_uom_to_id bigdecimal qtyprice qtyprice qtyprice c_uom_to_id m_product_id s_log qtyprice qtyprice qtyprice bigdecimal retvalue getproductratefrom m_product_id c_uom_to_id retvalue compareto retvalue qtyprice c_uom_to_id retvalue qtyprice retvalue qtyprice s_log m_product_id m_product_id get divide rate from product uom to entered uom and round param ctx context param m product id product param c uom to id entered uom return divisor or null static public big decimal get product rate from properties ctx int m product id int c uom to id muom conversion rates get product conversions ctx m product id if rates length 0 s log fine get product rate from none found return null for int i 0 i rates length i muom conversion rate rates i if rate getc uom to id c uom to id return rate get divide rate s log fine none applied return null m_product_id c_uom_to_id bigdecimal getproductratefrom m_product_id c_uom_to_id muomconversion getproductconversions m_product_id s_log getproductratefrom muomconversion getc_uom_to_id c_uom_to_id getdividerate s_log get product conversions cached param ctx context param m product id product return array of conversions static public muom conversion get product conversions properties ctx int m product id if m product id 0 return new muom conversion 0 integer key new integer m product id muom conversion result muom conversion s conversionproduct get key if result null return result array list muom conversion list new array list muom conversion add default conversion muom conversion def rate new muom conversion m product get ctx m product id list add def rate string sql select from c uom conversion c where c m product id and exists select from m product p where c m product id p m product id and c c uom id p c uom id and c is active y prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m product id result set rs pstmt execute query while rs next list add new muom conversion ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert save result new muom conversion list size list to array result s conversionproduct put key result s log fine get product conversions m product id m product id result length return result m_product_id muomconversion getproductconversions m_product_id m_product_id muomconversion m_product_id muomconversion muomconversion s_conversionproduct arraylist muomconversion arraylist muomconversion muomconversion defrate muomconversion mproduct m_product_id defrate c_uom_conversion m_product_id m_product m_product_id m_product_id c_uom_id c_uom_id isactive preparedstatement preparestatement setint m_product_id resultset executequery muomconversion s_log muomconversion toarray s_conversionproduct s_log getproductconversions m_product_id m_product_id default constructor param ctx context param c uom conversion id id public muom conversion properties ctx int c uom conversion id string trx name super ctx c uom conversion id trx name c_uom_conversion_id muomconversion c_uom_conversion_id trxname c_uom_conversion_id trxname load constructor param ctx context param rs result set public muom conversion properties ctx result set rs string trx name super ctx rs trx name muomconversion resultset trxname trxname parent constructor param parent uom parent public muom conversion muom parent this parent get ctx 0 parent get trxname set client org parent setc uom id parent getc uom id setm product id 0 setc uom to id parent getc uom id set multiply rate env one set divide rate env one muomconversion getctx get_trxname setclientorg setc_uom_id getc_uom_id setm_product_id setc_uom_to_id getc_uom_id setmultiplyrate setdividerate parent constructor param parent product parent public muom conversion m product parent this parent get ctx 0 parent get trxname set client org parent setc uom id parent getc uom id setm product id parent getm product id setc uom to id parent getc uom id set multiply rate env one set divide rate env one muomconversion mproduct getctx get_trxname setclientorg setc_uom_id getc_uom_id setm_product_id getm_product_id setc_uom_to_id getc_uom_id setmultiplyrate setdividerate before save param new record new return true if can be saved protected boolean before save boolean new record from to is the same if getc uom id getc uom to id log save error error msg parse translation get ctx c uom id c uom id return false nothing to convert if get multiply rate compare to env zero 0 log save error error msg parse translation get ctx multiply rate 0 return false enforce product uom if getm product id 0 new record is valuechanged m product id m product product m product get get ctx getm product id if product getc uom id getc uom id muom uom muom get get ctx product getc uom id log save error productuom conversionuom error uom get name return false the product uom needs to be the smallest uom multiplier must be 0 if getm product id 0 get divide rate compare to env one 0 log save error productuom conversion rate error return false return true newrecord beforesave newrecord getc_uom_id getc_uom_to_id saveerror parsetranslation getctx c_uom_id c_uom_id getmultiplyrate compareto saveerror parsetranslation getctx multiplyrate getm_product_id newrecord is_valuechanged m_product_id mproduct mproduct getctx getm_product_id getc_uom_id getc_uom_id getctx getc_uom_id saveerror productuomconversionuomerror getname getm_product_id getdividerate compareto saveerror productuomconversionrateerror string representation return info public string to string string buffer sb new string buffer muom conversion sb append get id append c uom id append getc uom id append c uom to id append getc uom to id append m product id append getm product id append multiply append get multiply rate append divide append get divide rate append return sb to string tostring stringbuffer stringbuffer muomconversion get_id c_uom_id getc_uom_id c_uom_to_id getc_uom_to_id m_product_id getm_product_id getmultiplyrate getdividerate tostring standard constructor param ctx context param c cashline id id public m cash line properties ctx int c cashline id string trx name super ctx c cashline id trx name if c cashline id 0 set line 0 set cash type cashtype generalexpense set amount env zero set discount amt env zero set write off amt env zero set is generated false c_cashline_id mcashline c_cashline_id trxname c_cashline_id trxname c_cashline_id setline setcashtype cashtype_generalexpense setamount setdiscountamt setwriteoffamt setisgenerated load cosntructor param ctx context param rs result set public m cash line properties ctx result set rs string trx name super ctx rs trx name mcashline resultset trxname trxname parent cosntructor param cash parent public m cash line m cash cash this cash get ctx 0 cash get trxname set client org cash setc cash id cash getc cash id m parent cash m cashbook m parent get cash book mcashline mcash getctx get_trxname setclientorg setc_cash_id getc_cash_id m_parent m_cashbook m_parent getcashbook add to description param description text public void add description string description string desc get description if desc null set description description else set description desc description adddescription getdescription setdescription setdescription set invoice no discount param invoice invoice public void set invoice m invoice invoice setc invoice id invoice getc invoice id set cash type cashtype invoice setc currency id invoice getc currency id amount m doc type dt m doc type get get ctx invoice getc doctype id big decimal amt invoice get grand total if m doc type docbasetype apinvoice equals dt get doc base type m doc type docbasetype arcreditmemo equals dt get doc base type amt amt negate set amount amt set discount amt env zero set write off amt env zero set is generated true m invoice invoice setinvoice minvoice setc_invoice_id getc_invoice_id setcashtype cashtype_invoice setc_currency_id getc_currency_id mdoctype mdoctype getctx getc_doctype_id bigdecimal getgrandtotal mdoctype docbasetype_apinvoice getdocbasetype mdoctype docbasetype_arcreditmemo getdocbasetype setamount setdiscountamt setwriteoffamt setisgenerated m_invoice set order no discount param order order public void set order m order order string trx name set cash type cashtype invoice setc currency id order getc currency id amount big decimal amt order get grand total set amount amt set discount amt env zero set write off amt env zero set is generated true if m order docstatus waitingpayment equals order get doc status save trx name order setc cashline id getc cashline id order process it m order action waitcomplete order save trx name set invoice m invoice invoices order get invoices int length invoices length if length 0 get last invoice m invoice invoices length 1 setc invoice id m invoice getc invoice id setorder morder trxname setcashtype cashtype_invoice setc_currency_id getc_currency_id bigdecimal getgrandtotal setamount setdiscountamt setwriteoffamt setisgenerated morder docstatus_waitingpayment getdocstatus trxname setc_cashline_id getc_cashline_id processit morder action_waitcomplete trxname minvoice getinvoices m_invoice setc_invoice_id m_invoice getc_invoice_id get statement date from header return date public timestamp get statement date return get parent get statement date getstatementdate getparent getstatementdate create line reversal return new reversed cash line public m cash line create reversal m cash parent get parent if parent is processed saved parent m cash get get ctx parent getad org id parent get statement date parent getc currency id get trxname m cash line reversal new m cash line parent reversal set client org this reversal setc bankaccount id getc bankaccount id reversal setc charge id getc charge id reversal setc currency id getc currency id reversal setc invoice id getc invoice id reversal set cash type get cash type reversal set description get description reversal set is generated true reversal set amount get amount negate if get discount amt null set discount amt env zero else reversal set discount amt get discount amt negate if get write off amt null set write off amt env zero else reversal set write off amt get write off amt negate reversal add description get line return reversal cashline mcashline createreversal mcash getparent isprocessed mcash getctx getad_org_id getstatementdate getc_currency_id get_trxname mcashline mcashline setclientorg setc_bankaccount_id getc_bankaccount_id setc_charge_id getc_charge_id setc_currency_id getc_currency_id setc_invoice_id getc_invoice_id setcashtype getcashtype setdescription getdescription setisgenerated setamount getamount getdiscountamt setdiscountamt setdiscountamt getdiscountamt getwriteoffamt setwriteoffamt setwriteoffamt getwriteoffamt adddescription getline get cash parent return cash public m cash get parent if m parent null m parent new m cash get ctx getc cash id get trxname return m parent mcash getparent m_parent m_parent mcash getctx getc_cash_id get_trxname m_parent get cash book return cash book public m cash book get cash book if m cashbook null m cashbook m cash book get get ctx get parent getc cashbook id return m cashbook cashbook mcashbook getcashbook m_cashbook m_cashbook mcashbook getctx getparent getc_cashbook_id m_cashbook get bank account return bank account public m bank account get bank account if m bankaccount null getc bankaccount id 0 m bankaccount m bank account get get ctx getc bankaccount id return m bankaccount mbankaccount getbankaccount m_bankaccount getc_bankaccount_id m_bankaccount mbankaccount getctx getc_bankaccount_id m_bankaccount get invoice return invoice public m invoice get invoice if m invoice null getc invoice id 0 m invoice m invoice get get ctx getc invoice id return m invoice minvoice getinvoice m_invoice getc_invoice_id m_invoice minvoice getctx getc_invoice_id m_invoice before delete return true false protected boolean before delete cannot delete generated invoices boolean generated boolean get valueold is generated if generated null generated boolean value if get valueold c invoice id null log warning cannot delete line with generated invoice return false return true beforedelete get_valueold isgenerated booleanvalue get_valueold c_invoice_id after delete param success return true false protected boolean after delete boolean success if success return success return update header afterdelete updateheader before save param new record return true false protected boolean before save boolean new record cannot change generated invoices if is valuechanged c invoice id object generated get valueold is generated if generated null boolean generated boolean value log warning cannot change line with generated invoice return false verify cash type if cashtype invoice equals get cash type getc invoice id 0 set cash type cashtype generalexpense if cashtype bankaccounttransfer equals get cash type getc bankaccount id 0 set cash type cashtype generalexpense if cashtype charge equals get cash type getc charge id 0 set cash type cashtype generalexpense boolean verify new record is valuechanged cash type is valuechanged c invoice id is valuechanged c bankaccount id if verify verify currency if cashtype bankaccounttransfer equals get cash type setc currency id get bank account getc currency id else if cashtype invoice equals get cash type setc currency id get invoice getc currency id else cash setc currency id get cash book getc currency id set organization if cashtype bankaccounttransfer equals get cash type setad org id get bank account getad org id cash book else if cashtype invoice equals get cash type setad org id get cash book getad org id otherwise charge leave it enforce org if getad org id 0 setad org id get parent getad org id general fix of currency update c cashline cl set c currency id select c currency id from c invoice i where i c invoice id cl c invoice id where c currency id is null and c invoice id is not null update c cashline cl set c currency id select c currency id from c bankaccount b where b c bankaccount id cl c bankaccount id where c currency id is null and c bankaccount id is not null update c cashline cl set c currency id select b c currency id from c cash c c cashbook b where c c cash id cl c cash id and c c cashbook id b c cashbook id where c currency id is null get line no if get line 0 string sql select coalesce max line 0 10 from c cashline where c cash id int ii db getsql value get trxname sql getc cash id set line ii return true newrecord beforesave newrecord is_valuechanged c_invoice_id get_valueold isgenerated booleanvalue cashtype cashtype_invoice getcashtype getc_invoice_id setcashtype cashtype_generalexpense cashtype_bankaccounttransfer getcashtype getc_bankaccount_id setcashtype cashtype_generalexpense cashtype_charge getcashtype getc_charge_id setcashtype cashtype_generalexpense newrecord is_valuechanged cashtype is_valuechanged c_invoice_id is_valuechanged c_bankaccount_id cashtype_bankaccounttransfer getcashtype setc_currency_id getbankaccount getc_currency_id cashtype_invoice getcashtype setc_currency_id getinvoice getc_currency_id setc_currency_id getcashbook getc_currency_id cashtype_bankaccounttransfer getcashtype setad_org_id getbankaccount getad_org_id cashtype_invoice getcashtype setad_org_id getcashbook getad_org_id getad_org_id setad_org_id getparent getad_org_id c_cashline c_currency_id c_currency_id c_invoice c_invoice_id c_invoice_id c_currency_id c_invoice_id c_cashline c_currency_id c_currency_id c_bankaccount c_bankaccount_id c_bankaccount_id c_currency_id c_bankaccount_id c_cashline c_currency_id c_currency_id c_cash c_cashbook c_cash_id c_cash_id c_cashbook_id c_cashbook_id c_currency_id getline c_cashline c_cash_id getsqlvalue get_trxname getc_cash_id setline after save param new record param success protected boolean after save boolean new record boolean success if success return success return update header newrecord aftersave newrecord updateheader update cash header statement difference ending balance return true if success private boolean update header string sql update c cash c set statement difference select coalesce sum currency convert cl amount cl c currency id cb c currency id c date acct null c ad client id c ad org id 0 from c cashline cl c cashbook cb where cb c cashbook id c c cashbook id and cl c cash id c c cash id where c cash id getc cash id int no db execute update sql get trxname if no 1 log warning difference no ending balance sql update c cash set ending balance beginning balance statement difference where c cash id getc cash id no db execute update sql get trxname if no 1 log warning balance no return no 1 updateheader c_cash statementdifference currencyconvert c_currency_id c_currency_id dateacct ad_client_id ad_org_id c_cashline c_cashbook c_cashbook_id c_cashbook_id c_cash_id c_cash_id c_cash_id getc_cash_id executeupdate get_trxname c_cash endingbalance beginningbalance statementdifference c_cash_id getc_cash_id executeupdate get_trxname get location from cache param ctx context param c location id id return m location public static m location get properties ctx int c location id string trx name new if c location id 0 return new m location ctx c location id trx name integer key new integer c location id m location ret value m location s cache get key if ret value null return ret value ret value new m location ctx c location id trx name if ret value get id 0 found s cache put key ret value return ret value return null not found c_location_id mlocation mlocation c_location_id trxname c_location_id mlocation c_location_id trxname c_location_id mlocation retvalue mlocation s_cache retvalue retvalue retvalue mlocation c_location_id trxname retvalue get_id s_cache retvalue retvalue load location with id if business partner location param c bpartner location id business partner location return loaction or null public static m location getbp location properties ctx int c bpartner location id string trx name if c bpartner location id 0 load default return null m location loc null string sql select from c location l where c location id select c location id from c bpartner location where c bpartner location id try prepared statement pstmt db prepare statement sql trx name pstmt set int 1 c bpartner location id result set rs pstmt execute query if rs next loc new m location ctx rs trx name rs close pstmt close catch sql exception e s log log level severe sql c bpartner location id e loc null return loc c_bpartner_location_id mlocation getbplocation c_bpartner_location_id trxname c_bpartner_location_id mlocation c_location c_location_id c_location_id c_bpartner_location c_bpartner_location_id preparedstatement preparestatement trxname setint c_bpartner_location_id resultset executequery mlocation trxname sqlexception s_log c_bpartner_location_id standard constructor param ctx context param c location id id public m location properties ctx int c location id string trx name super ctx c location id trx name if c location id 0 m country default country m country get default get ctx set country default country m region default region m region get default get ctx if default region null default region getc country id default country getc country id set region default region c_location_id mlocation c_location_id trxname c_location_id trxname c_location_id mcountry defaultcountry mcountry getdefault getctx setcountry defaultcountry mregion defaultregion mregion getdefault getctx defaultregion defaultregion getc_country_id defaultcountry getc_country_id setregion defaultregion parent constructor param country mandatory country param region optional region public m location m country country m region region super country get ctx 0 country get trxname set country country set region region mlocation mcountry mregion getctx get_trxname setcountry setregion full constructor param ctx context param c country id country param c region id region param city city public m location properties ctx int c country id int c region id string city string trx name super ctx 0 trx name setc country id c country id setc region id c region id set city city c_country_id c_region_id mlocation c_country_id c_region_id trxname trxname setc_country_id c_country_id setc_region_id c_region_id setcity load constructor param ctx context param rs result set public m location properties ctx result set rs string trx name super ctx rs trx name mlocation resultset trxname trxname set country param country public void set country m country country if country null m c country else m c m country get default get ctx super setc country id m c getc country id setcountry mcountry m_c m_c mcountry getdefault getctx setc_country_id m_c getc_country_id set c country id param c country id id public void setc country id int c country id if getc country id c country id set region null set country m country get get ctx c country id c_country_id c_country_id setc_country_id c_country_id getc_country_id c_country_id setregion setcountry mcountry getctx c_country_id get country return country public m country get country if m c null if getc country id 0 m c m country get get ctx getc country id else m c m country get default get ctx return m c mcountry getcountry m_c getc_country_id m_c mcountry getctx getc_country_id m_c mcountry getdefault getctx m_c get country name return country name public string get country name return get country get name getcountryname getcountry getname get country line param local if true only foreign country is returned return country or null public string get country boolean local if local getc country id m country get default get ctx getc country id return null return get country name getcountry getc_country_id mcountry getdefault getctx getc_country_id getcountryname set region param region public void set region m region region m r region if region null super setc region id 0 else super setc region id m r getc region id if m r getc country id getc country id log info region region c country id region getc country id from c country id getc country id setc country id region getc country id setregion mregion m_r setc_region_id setc_region_id m_r getc_region_id m_r getc_country_id getc_country_id c_country_id getc_country_id c_country_id getc_country_id setc_country_id getc_country_id set c region id param c region id region public void setc region id int c region id if c region id 0 set region null country defined else if getc country id 0 m country cc get country if cc is valid region c region id super setc region id c region id else set region null else set region m region get get ctx c region id c_region_id c_region_id setc_region_id c_region_id c_region_id setregion getc_country_id mcountry getcountry isvalidregion c_region_id setc_region_id c_region_id setregion setregion mregion getctx c_region_id get region return region public m region get region if m r null getc region id 0 m r m region get get ctx getc region id return m r mregion getregion m_r getc_region_id m_r mregion getctx getc_region_id m_r get local region name return region name or public string get region name return get region name false getregionname getregionname get region name param get from region get from region not locally return region name or public string get region name boolean get from region if get from region get country is has region get region null super set region name avoid duplicates return get region get name string region name super get region name if region name null region name return region name getfromregion getregionname getfromregion getfromregion getcountry ishasregion getregion setregionname getregion getname regionname getregionname regionname regionname regionname compares to current record param c country id if 0 ignored param c region id if 0 ignored param postal match postal param postal add match postal add param city match city param address1 match address 1 param address2 match addtess 2 return true if equals public boolean equals int c country id int c region id string postal string postal add string city string address1 string address2 if c country id 0 getc country id c country id return false if c region id 0 getc region id c region id return false must match if equals null postal get postal return false if equals null postal add getpostal add return false if equals null city get city return false if equals null address1 get address1 return false if equals null address2 get address2 return false return true c_country_id c_region_id postal_add c_country_id c_region_id postal_add c_country_id getc_country_id c_country_id c_region_id getc_region_id c_region_id equalsnull getpostal equalsnull postal_add getpostal_add equalsnull getcity equalsnull getaddress1 equalsnull getaddress2 equals if or null param c1 c1 param c2 c2 return true if equal ignore case private boolean equals null string c1 string c2 if c1 null c1 if c2 null c2 return c1 equals ignore case c2 equalsnull equalsignorecase equals param cmp comperator return true if id the same public boolean equals object cmp if cmp null return false if cmp get class equals this get class return po cmp get id get id return equals cmp getclass getclass get_id get_id print address reverse order return true if reverse depending on country public boolean is address lines reverse local if getc country id m country get default get ctx getc country id return get country is address lines local reverse return get country is address lines reverse isaddresslinesreverse getc_country_id mcountry getdefault getctx getc_country_id getcountry isaddresslineslocalreverse getcountry isaddresslinesreverse get formatted city region postal line return city region postal public string get city region postal return parsecrp get country getcityregionpostal getcountry parse according ctiy postal region according to display sequence c city r region p postal a postal add param c country return parsed string private string parsecrp m country c if c null return country not found boolean local getc country id m country get default get ctx getc country id string in str local c get display sequence local c get display sequence string buffer out str new string buffer string token int i in str index of while i 1 out str append in str substring 0 i up to in str in str substring i 1 in str length from first int j in str index of next if j 0 token no second tag j i 1 else token in str substring 0 j tokens if token equals c if get city null out str append get city else if token equals r if get region null we have a region out str append get region get name else if super get region name null super get region name length 0 out str append super get region name local region name else if token equals p if get postal null out str append get postal else if token equals a string add getpostal add if add null add length 0 out str append append add else out str append append token append in str in str substring j 1 in str length from second i in str index of out str append in str add the rest of the string print region name if entered and not part of pattern if c get display sequence index of r 1 super get region name null super get region name length 0 out str append append super get region name string ret value util replace out str to string n n log finest parsecrp c get display sequence ret value return ret value displaysequence postaladd mcountry countrynotfound getc_country_id mcountry getdefault getctx getc_country_id instr getdisplaysequencelocal getdisplaysequence stringbuffer outstr stringbuffer instr indexof outstr instr instr instr instr instr indexof instr getcity outstr getcity getregion outstr getregion getname getregionname getregionname outstr getregionname getpostal outstr getpostal getpostal_add outstr outstr instr instr instr instr indexof outstr instr getdisplaysequence indexof getregionname getregionname outstr getregionname retvalue outstr tostring getdisplaysequence retvalue retvalue return printable string representation return string public string to string string buffer ret str new string buffer if is address lines reverse city region postal ret str append append parsecrp get country if get address4 null get address4 length 0 ret str append append get address4 if get address3 null get address3 length 0 ret str append append get address3 if get address2 null get address2 length 0 ret str append append get address2 if get address1 null ret str append get address1 else if get address1 null ret str append get address1 if get address2 null get address2 length 0 ret str append append get address2 if get address3 null get address3 length 0 ret str append append get address3 if get address4 null get address4 length 0 ret str append append get address4 city region postal ret str append append parsecrp get country add country would come here return ret str to string tostring stringbuffer retstr stringbuffer isaddresslinesreverse retstr getcountry getaddress4 getaddress4 retstr getaddress4 getaddress3 getaddress3 retstr getaddress3 getaddress2 getaddress2 retstr getaddress2 getaddress1 retstr getaddress1 getaddress1 retstr getaddress1 getaddress2 getaddress2 retstr getaddress2 getaddress3 getaddress3 retstr getaddress3 getaddress4 getaddress4 retstr getaddress4 retstr getcountry retstr tostring return string representation with cr at line end return string public string to stringcr string buffer ret str new string buffer if is address lines reverse city region postal ret str append parsecrp get country if get address4 null get address4 length 0 ret str append n append get address4 if get address3 null get address3 length 0 ret str append n append get address3 if get address2 null get address2 length 0 ret str append n append get address2 if get address1 null ret str append n append get address1 else if get address1 null ret str append get address1 if get address2 null get address2 length 0 ret str append n append get address2 if get address3 null get address3 length 0 ret str append n append get address3 if get address4 null get address4 length 0 ret str append n append get address4 city region postal ret str append n append parsecrp get country add country would come here return ret str to string tostringcr stringbuffer retstr stringbuffer isaddresslinesreverse retstr getcountry getaddress4 getaddress4 retstr getaddress4 getaddress3 getaddress3 retstr getaddress3 getaddress2 getaddress2 retstr getaddress2 getaddress1 retstr getaddress1 getaddress1 retstr getaddress1 getaddress2 getaddress2 retstr getaddress2 getaddress3 getaddress3 retstr getaddress3 getaddress4 getaddress4 retstr getaddress4 retstr getcountry retstr tostring return detailed string representation return string public string to stringx string buffer sb new string buffer m location sb append get id append c country id append getc country id append c region id append getc region id append postal append get postal append return sb to string tostringx stringbuffer stringbuffer mlocation get_id c_country_id getc_country_id c_region_id getc_region_id getpostal tostring before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 region check if getc region id 0 if m c null m c getc country id getc country id get country if m c is has region setc region id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id getc_region_id m_c m_c getc_country_id getc_country_id getcountry m_c ishasregion setc_region_id after save param new record new param success success return success protected boolean after save boolean new record boolean success value name change in account if new record y equals env get context get ctx element lf y equals env get context get ctx element lt is valuechanged postal is valuechanged city m account update value description get ctx c locfrom id getc location id or c locto id getc location id get trxname return success newrecord aftersave newrecord newrecord getcontext getctx element_lf getcontext getctx element_lt is_valuechanged is_valuechanged maccount updatevaluedescription getctx c_locfrom_id getc_location_id c_locto_id getc_location_id get_trxname constructs a new code text field code a default model is created the initial string is code null code and the number of columns is set to 0 public c text field super init textfield ctextfield constructs a new code text field code initialized with the specified text a default model is created and the number of columns is 0 param text the text to be displayed or code null code public c text field string text super text init textfield ctextfield constructs a new empty code text field code with the specified number of columns a default model is created and the initial string is set to code null code param columns the number of columns to use to calculate the preferred width if columns is set to zero the preferred width will be whatever naturally results from the component implementation public c text field int columns super columns init textfield ctextfield constructs a new code text field code initialized with the specified text and columns a default model is created param text the text to be displayed or code null code param columns the number of columns to use to calculate the preferred width if columns is set to zero the preferred width will be whatever naturally results from the component implementation public c text field string text int columns super text columns init textfield ctextfield constructs a new code j text field code that uses the given text storage model and the given number of columns this is the constructor through which the other constructors feed if the document is code null code a default model is created param doc the text storage to use if this is code null code a default will be provided by calling the code create default model code method param text the initial string to display or code null code param columns the number of columns to use to calculate the preferred width 0 if code columns code is set to zero the preferred width will be whatever naturally results from the component implementation exception illegal argument exception if code columns code 0 public c text field document doc string text int columns super doc text columns init jtextfield createdefaultmodel illegalargumentexception ctextfield initialization private void init set font compiereplaf getfont field set foreground compiereplaf gettextcolor normal set background false minimum size dimension size get preferred size if size null size new dimension 20 10 size width 30 set minimum size size setfont getfont_field setforeground gettextcolor_normal setbackground getpreferredsize setminimumsize set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if super is editable rw super set editable rw set background false setreadwrite iseditable seteditable setbackground is it possible to edit return true if editable public boolean is read write return super is editable isreadwrite iseditable set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal set background param bg background public void set background color bg if bg equals get background return super set background bg setbackground getbackground setbackground set editor to value param value value of the editor public void set value object value if value null set text else set text value to string setvalue settext settext tostring return editor value return current value public object get value return get text getvalue gettext return display value return displayed string value public string get display return get text getdisplay gettext key pressed see java awt event key listener key pressed java awt event key event param e public void key pressed key event e keylistener keypressed keyevent keypressed keyevent key released see java awt event key listener key released java awt event key event param e public void key released key event e keylistener keyreleased keyevent keyreleased keyevent key typed see java awt event key listener key typed java awt event key event param e public void key typed key event e keylistener keytyped keyevent keytyped keyevent constructor param ass accounting schemata param rs record parem trx name trx public doc inventory m acct schema ass result set rs string trx name super ass m inventory class rs doctype matinventory trx name trxname doc_inventory macctschema resultset trxname minventory doctype_matinventory trxname load document details return error message or null protected string load document details setc currency id no currency m inventory inventory m inventory getpo set date doc inventory get movement date set date acct inventory get movement date contained objects p lines load lines inventory log fine lines p lines length return null loaddocumentdetails setc_currency_id no_currency minventory minventory setdatedoc getmovementdate setdateacct getmovementdate p_lines loadlines p_lines load invoice line return doc line array private doc line load lines m inventory inventory array list doc line list new array list doc line m inventory line lines inventory get lines false for int i 0 i lines length i m inventory line line lines i nothing to post if line get qty book compare to line get qty count 0 line get qty internal use signum 0 continue doc line doc line new doc line line this big decimal qty line get qty internal use if qty signum 0 qty qty negate internal use entered positive else big decimal qty book line get qty book big decimal qty count line get qty count qty qty count subtract qty book doc line set qty qty false 5 5 log fine doc line to string list add doc line return array doc line dls new doc line list size list to array dls return dls docline docline loadlines minventory arraylist docline arraylist docline minventoryline getlines minventoryline getqtybook compareto getqtycount getqtyinternaluse docline docline docline bigdecimal getqtyinternaluse bigdecimal qtybook getqtybook bigdecimal qtycount getqtycount qtycount qtybook docline setqty docline tostring docline docline docline toarray get balance return zero always balanced public big decimal get balance big decimal ret value env zero return ret value bigdecimal getbalance bigdecimal retvalue retvalue create facts the accounting logic for mmi pre inventory inventory dr cr inventory diff dr cr or charge pre param as account schema return fact public array list fact create facts m acct schema as create fact header fact fact new fact this as fact post actual setc currency id as getc currency id line pointers fact line dr null fact line cr null for int i 0 i p lines length i doc line line p lines i big decimal costs line get product costs as line getad org id false if costs null costs signum 0 p error no costs for line get product get name return null inventory dr cr dr fact create line line line get account product cost accttype p asset as as getc currency id costs may be zero difference no line created if dr null continue dr setm locator id line getm locator id inventory diff dr cr or charge m account inv diff line get charge account as costs negate if inv diff null inv diff get account doc accttype invdifferences as cr fact create line line inv diff as getc currency id costs negate if cr null continue cr setm locator id line getm locator id cr set qty line get qty negate if line getc charge id 0 explicit overwrite for charge cr setad org id line getad org id cost detail m cost detail create inventory as line getad org id line getm product id line getm attributesetinstance id line get id 0 costs line get qty line get description get trx name array list fact facts new array list fact facts add fact return facts inventorydiff arraylist createfacts macctschema post_actual setc_currency_id getc_currency_id factline factline p_lines docline p_lines bigdecimal getproductcosts getad_org_id p_error getproduct getname createline getaccount productcost accttype_p_asset getc_currency_id setm_locator_id getm_locator_id inventorydiff maccount invdiff getchargeaccount invdiff invdiff getaccount accttype_invdifferences createline invdiff getc_currency_id setm_locator_id getm_locator_id setqty getqty getc_charge_id setad_org_id getad_org_id mcostdetail createinventory getad_org_id getm_product_id getm_attributesetinstance_id get_id getqty getdescription gettrxname arraylist arraylist initialize global variables this servlet is also loaded on startup to initialize the system public void init servlet config config throws servlet exception super init config if web env init web config throw new servlet exception w status init servletconfig servletexception webenv initweb servletexception wstatus process the http get request public void do get http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w status get request web util create response request response this null doc true doget httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wstatus webutil createresponse process the http post request public void do post http servlet request request http servlet response response throws servlet exception io exception web doc doc web doc create w status post request web util create response request response this null doc true dopost httpservletrequest httpservletresponse servletexception ioexception webdoc webdoc wstatus webutil createresponse standard constructor public x c acctprocessorlog properties ctx int c acctprocessorlog id string trx name super ctx c acctprocessorlog id trx name if c acctprocessorlog id 0 setc acctprocessorlog id 0 setc acctprocessor id 0 set is error false x_c_acctprocessorlog c_acctprocessorlog_id trxname c_acctprocessorlog_id trxname c_acctprocessorlog_id setc_acctprocessorlog_id setc_acctprocessor_id setiserror load constructor public x c acctprocessorlog properties ctx result set rs string trx name super ctx rs trx name x_c_acctprocessorlog resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c acctprocessorlog append get id append return sb to string tostring stringbuffer stringbuffer x_c_acctprocessorlog get_id tostring set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set accounting processor log result of the execution of the accounting processor public void setc acctprocessorlog id int c acctprocessorlog id if c acctprocessorlog id 1 throw new illegal argument exception c acctprocessorlog id is mandatory set valuenocheck c acctprocessorlog id new integer c acctprocessorlog id setc_acctprocessorlog_id c_acctprocessorlog_id c_acctprocessorlog_id illegalargumentexception c_acctprocessorlog_id set_valuenocheck c_acctprocessorlog_id c_acctprocessorlog_id get accounting processor log result of the execution of the accounting processor public int getc acctprocessorlog id integer ii integer get value c acctprocessorlog id if ii null return 0 return ii int value getc_acctprocessorlog_id get_value c_acctprocessorlog_id intvalue set accounting processor accounting processor server parameters public void setc acctprocessor id int c acctprocessor id if c acctprocessor id 1 throw new illegal argument exception c acctprocessor id is mandatory set valuenocheck c acctprocessor id new integer c acctprocessor id setc_acctprocessor_id c_acctprocessor_id c_acctprocessor_id illegalargumentexception c_acctprocessor_id set_valuenocheck c_acctprocessor_id c_acctprocessor_id get accounting processor accounting processor server parameters public int getc acctprocessor id integer ii integer get value c acctprocessor id if ii null return 0 return ii int value getc_acctprocessor_id get_value c_acctprocessor_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set error an error occured in the execution public void set is error boolean is error set value is error new boolean is error setiserror iserror set_value iserror iserror get error an error occured in the execution public boolean is error object oo get value is error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iserror get_value iserror booleanvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg standard constructor public x a asset properties ctx int a asset id string trx name super ctx a asset id trx name if a asset id 0 seta asset group id 0 seta asset id 0 set is depreciated false set is disposed false set is fully depreciated false n set is in posession false set is owned false setm attributesetinstance id 0 set name null set value null x_a_asset a_asset_id trxname a_asset_id trxname a_asset_id seta_asset_group_id seta_asset_id setisdepreciated setisdisposed setisfullydepreciated setisinposession setisowned setm_attributesetinstance_id setname setvalue load constructor public x a asset properties ctx result set rs string trx name super ctx rs trx name x_a_asset resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x a asset append get id append return sb to string tostring stringbuffer stringbuffer x_a_asset get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set asset group group of assets public void seta asset group id int a asset group id if a asset group id 1 throw new illegal argument exception a asset group id is mandatory set value a asset group id new integer a asset group id seta_asset_group_id a_asset_group_id a_asset_group_id illegalargumentexception a_asset_group_id set_value a_asset_group_id a_asset_group_id get asset group group of assets public int geta asset group id integer ii integer get value a asset group id if ii null return 0 return ii int value geta_asset_group_id get_value a_asset_group_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 1 throw new illegal argument exception a asset id is mandatory set valuenocheck a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id illegalargumentexception a_asset_id set_valuenocheck a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set asset depreciation date date of last depreciation public void set asset depreciation date timestamp asset depreciation date set value asset depreciation date asset depreciation date setassetdepreciationdate assetdepreciationdate set_value assetdepreciationdate assetdepreciationdate get asset depreciation date date of last depreciation public timestamp get asset depreciation date return timestamp get value asset depreciation date getassetdepreciationdate get_value assetdepreciationdate set asset disposal date date when the asset is was disposed public void set asset disposal date timestamp asset disposal date set value asset disposal date asset disposal date setassetdisposaldate assetdisposaldate set_value assetdisposaldate assetdisposaldate get asset disposal date date when the asset is was disposed public timestamp get asset disposal date return timestamp get value asset disposal date getassetdisposaldate get_value assetdisposaldate set in service date date when asset was put into service public void set asset service date timestamp asset service date set value asset service date asset service date setassetservicedate assetservicedate set_value assetservicedate assetservicedate get in service date date when asset was put into service public timestamp get asset service date return timestamp get value asset service date getassetservicedate get_value assetservicedate public static final int c bpartnersr id ad reference id 353 set b partner agent business partner agent or sales rep public void setc bpartnersr id int c bpartnersr id if c bpartnersr id 0 set value c bpartnersr id null else set value c bpartnersr id new integer c bpartnersr id c_bpartnersr_id_ad_reference_id bpartner setc_bpartnersr_id c_bpartnersr_id c_bpartnersr_id set_value c_bpartnersr_id set_value c_bpartnersr_id c_bpartnersr_id get b partner agent business partner agent or sales rep public int getc bpartnersr id integer ii integer get value c bpartnersr id if ii null return 0 return ii int value bpartner getc_bpartnersr_id get_value c_bpartnersr_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set guarantee date date when guarantee expires public void set guarantee date timestamp guarantee date set value guarantee date guarantee date setguaranteedate guaranteedate set_value guaranteedate guaranteedate get guarantee date date when guarantee expires public timestamp get guarantee date return timestamp get value guarantee date getguaranteedate get_value guaranteedate set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set depreciate the asset will be depreciated public void set is depreciated boolean is depreciated set value is depreciated new boolean is depreciated setisdepreciated isdepreciated set_value isdepreciated isdepreciated get depreciate the asset will be depreciated public boolean is depreciated object oo get value is depreciated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdepreciated get_value isdepreciated booleanvalue set disposed the asset is disposed public void set is disposed boolean is disposed set value is disposed new boolean is disposed setisdisposed isdisposed set_value isdisposed isdisposed get disposed the asset is disposed public boolean is disposed object oo get value is disposed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdisposed get_value isdisposed booleanvalue set fully depreciated the asset is fully depreciated public void set is fully depreciated boolean is fully depreciated set valuenocheck is fully depreciated new boolean is fully depreciated setisfullydepreciated isfullydepreciated set_valuenocheck isfullydepreciated isfullydepreciated get fully depreciated the asset is fully depreciated public boolean is fully depreciated object oo get value is fully depreciated if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfullydepreciated get_value isfullydepreciated booleanvalue set in possession the asset is in the possession of the organization public void set is in posession boolean is in posession set value is in posession new boolean is in posession setisinposession isinposession set_value isinposession isinposession get in possession the asset is in the possession of the organization public boolean is in posession object oo get value is in posession if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinposession get_value isinposession booleanvalue set owned the asset is owned by the organization public void set is owned boolean is owned set value is owned new boolean is owned setisowned isowned set_value isowned isowned get owned the asset is owned by the organization public boolean is owned object oo get value is owned if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isowned get_value isowned booleanvalue set last maintenance last maintenance date public void set last maintenance date timestamp last maintenance date set value last maintenance date last maintenance date setlastmaintenancedate lastmaintenancedate set_value lastmaintenancedate lastmaintenancedate get last maintenance last maintenance date public timestamp get last maintenance date return timestamp get value last maintenance date getlastmaintenancedate get_value lastmaintenancedate set last note last maintenance note public void set last maintenance note string last maintenance note if last maintenance note null last maintenance note length 60 log warning length 60 truncated last maintenance note last maintenance note substring 0 59 set value last maintenance note last maintenance note setlastmaintenancenote lastmaintenancenote lastmaintenancenote lastmaintenancenote lastmaintenancenote lastmaintenancenote set_value lastmaintenancenote lastmaintenancenote get last note last maintenance note public string get last maintenance note return string get value last maintenance note getlastmaintenancenote get_value lastmaintenancenote set last unit last maintenance unit public void set last maintenance unit int last maintenance unit set value last maintenance unit new integer last maintenance unit setlastmaintenanceunit lastmaintenanceunit set_value lastmaintenanceunit lastmaintenanceunit get last unit last maintenance unit public int get last maintenance unit integer ii integer get value last maintenance unit if ii null return 0 return ii int value getlastmaintenanceunit get_value lastmaintenanceunit intvalue set lease termination lease termination date public void set lease termination date timestamp lease termination date set value lease termination date lease termination date setleaseterminationdate leaseterminationdate set_value leaseterminationdate leaseterminationdate get lease termination lease termination date public timestamp get lease termination date return timestamp get value lease termination date getleaseterminationdate get_value leaseterminationdate public static final int lease bpartner id ad reference id 192 set lessor the business partner who rents or leases public void setlease bpartner id int lease bpartner id if lease bpartner id 0 set value lease bpartner id null else set value lease bpartner id new integer lease bpartner id lease_bpartner_id_ad_reference_id setlease_bpartner_id lease_bpartner_id lease_bpartner_id set_value lease_bpartner_id set_value lease_bpartner_id lease_bpartner_id get lessor the business partner who rents or leases public int getlease bpartner id integer ii integer get value lease bpartner id if ii null return 0 return ii int value getlease_bpartner_id get_value lease_bpartner_id intvalue set life use units of use until the asset is not usable anymore public void set life use units int life use units set value life use units new integer life use units setlifeuseunits lifeuseunits set_value lifeuseunits lifeuseunits get life use units of use until the asset is not usable anymore public int get life use units integer ii integer get value life use units if ii null return 0 return ii int value getlifeuseunits get_value lifeuseunits intvalue set location comment additional comments or remarks concerning the location public void set location comment string location comment if location comment null location comment length 255 log warning length 255 truncated location comment location comment substring 0 254 set value location comment location comment setlocationcomment locationcomment locationcomment locationcomment locationcomment locationcomment set_value locationcomment locationcomment get location comment additional comments or remarks concerning the location public string get location comment return string get value location comment getlocationcomment get_value locationcomment set lot no lot number alphanumeric public void set lot string lot if lot null lot length 255 log warning length 255 truncated lot lot substring 0 254 set value lot lot setlot set_value get lot no lot number alphanumeric public string get lot return string get value lot getlot get_value set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set valuenocheck m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_valuenocheck m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set shipment receipt line line on shipment or receipt document public void setm inoutline id int m inoutline id if m inoutline id 0 set value m inoutline id null else set value m inoutline id new integer m inoutline id setm_inoutline_id m_inoutline_id m_inoutline_id set_value m_inoutline_id set_value m_inoutline_id m_inoutline_id get shipment receipt line line on shipment or receipt document public int getm inoutline id integer ii integer get value m inoutline id if ii null return 0 return ii int value getm_inoutline_id get_value m_inoutline_id intvalue set locator warehouse locator public void setm locator id int m locator id if m locator id 0 set value m locator id null else set value m locator id new integer m locator id setm_locator_id m_locator_id m_locator_id set_value m_locator_id set_value m_locator_id m_locator_id get locator warehouse locator public int getm locator id integer ii integer get value m locator id if ii null return 0 return ii int value getm_locator_id get_value m_locator_id intvalue set product product service item public void setm product id int m product id if m product id 0 set valuenocheck m product id null else set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id set_valuenocheck m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set next maintenence next maintenence date public void set next maintenence date timestamp next maintenence date set value next maintenence date next maintenence date setnextmaintenencedate nextmaintenencedate set_value nextmaintenencedate nextmaintenencedate get next maintenence next maintenence date public timestamp get next maintenence date return timestamp get value next maintenence date getnextmaintenencedate get_value nextmaintenencedate set next unit next maintenence unit public void set next maintenence unit int next maintenence unit set value next maintenence unit new integer next maintenence unit setnextmaintenenceunit nextmaintenenceunit set_value nextmaintenenceunit nextmaintenenceunit get next unit next maintenence unit public int get next maintenence unit integer ii integer get value next maintenence unit if ii null return 0 return ii int value getnextmaintenenceunit get_value nextmaintenenceunit intvalue set quantity quantity public void set qty big decimal qty set value qty qty setqty bigdecimal set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value set serial no product serial number public void set ser no string ser no if ser no null ser no length 255 log warning length 255 truncated ser no ser no substring 0 254 set value ser no ser no setserno serno serno serno serno serno set_value serno serno get serial no product serial number public string get ser no return string get value ser no getserno get_value serno set usable life months months of the usable life of the asset public void set use life months int use life months set value use life months new integer use life months setuselifemonths uselifemonths set_value uselifemonths uselifemonths get usable life months months of the usable life of the asset public int get use life months integer ii integer get value use life months if ii null return 0 return ii int value getuselifemonths get_value uselifemonths intvalue set usable life years years of the usable life of the asset public void set use life years int use life years set value use life years new integer use life years setuselifeyears uselifeyears set_value uselifeyears uselifeyears get usable life years years of the usable life of the asset public int get use life years integer ii integer get value use life years if ii null return 0 return ii int value getuselifeyears get_value uselifeyears intvalue set use units currently used units of the assets public void set use units int use units set valuenocheck use units new integer use units setuseunits useunits set_valuenocheck useunits useunits get use units currently used units of the assets public int get use units integer ii integer get value use units if ii null return 0 return ii int value getuseunits get_value useunits intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set version no version number public void set version no string version no if version no null version no length 20 log warning length 20 truncated version no version no substring 0 19 set value version no version no setversionno versionno versionno versionno versionno versionno set_value versionno versionno get version no version number public string get version no return string get value version no getversionno get_value versionno config oracle public configdb2 configuration data data super data configoracle configurationdata init public void init p data set database port string value of db db2 default port 0 p data set database name adempier p_data setdatabaseport valueof db_db2 default_port_0 p_data setdatabasename test return error message or null if ok public string test database server string server p data get database server boolean pass server null server length 0 server to lower case index of localhost 1 server equals 127 0 0 1 string error not correct db server server inet address database server null try if pass database server inet address get by name server catch exception e error e get message pass false signalok get panel ok database server error database server pass true error log info ok database server database server set property configuration data compiere db server database server get host name set property configuration data compiere db type p data get database type database port int database port p data get database port pass p data test port database server database port true error db server port database port signalok get panel ok database server error database port pass true error if pass return error log info ok database port database port set property configuration data compiere db port string value of database port jdbc database info string database name p data get database name service name string system password p data get database system password pass system password null system password length 0 error no database system password entered signalok get panel ok database system errorjdbc pass true error if pass return error url derived jdbc oracle thin prod1 1521 prod1 string url jdbc db2 database server get host name database port database name pass testjdbc url db2admin system password error error connecting url as db2admin system password signalok get panel ok database system errorjdbc pass true error if pass return error log info ok connection url set property configuration data compiere db url url log info ok database system user database name set property configuration data compiere db name database name set property configuration data compiere db system system password database user info string database user p data get database user uid string database password p data get database password pwd pass database password null database password length 0 error invalid database user password signalok get panel ok database user errorjdbc pass true error if pass return error ignore result as it might not be imported pass testjdbc url database user database password error database imported cannot connect to user database user database password signalok get panel ok database user errorjdbc pass false error if pass log info ok database user database user if m con null set property configuration data compiere webstores get web stores m con else log warning error set property configuration data compiere db user database user set property configuration data compiere db password database password if p data get apps server type equals configuration data appstype tomcat string cmd db2 if env is windows cmd db2cmd c w i db2 string sqlcmd1 cmd connect to xx string sqlcmd2 cmd f utils db2 test sql log config sqlcmd2 pass testsql sqlcmd2 error error connecting via sqlcmd2 signalok get panel ok databasesql errortns pass true error if pass log info ok database sql connection m con null return null p_data getdatabaseserver tolowercase indexof inetaddress databaseserver databaseserver inetaddress getbyname getmessage getpanel okdatabaseserver errordatabaseserver databaseserver setproperty configurationdata compiere_db_server databaseserver gethostname setproperty configurationdata compiere_db_type p_data getdatabasetype databaseport p_data getdatabaseport p_data testport databaseserver databaseport databaseport getpanel okdatabaseserver errordatabaseport databaseport setproperty configurationdata compiere_db_port valueof databaseport databasename p_data getdatabasename systempassword p_data getdatabasesystempassword systempassword systempassword getpanel okdatabasesystem databaseserver gethostname databaseport databasename systempassword systempassword getpanel okdatabasesystem setproperty configurationdata compiere_db_url databasename setproperty configurationdata compiere_db_name databasename setproperty configurationdata compiere_db_system systempassword databaseuser p_data getdatabaseuser databasepassword p_data getdatabasepassword databasepassword databasepassword getpanel okdatabaseuser databaseuser databasepassword databaseuser databasepassword getpanel okdatabaseuser databaseuser m_con setproperty configurationdata compiere_webstores getwebstores m_con setproperty configurationdata compiere_db_user databaseuser setproperty configurationdata compiere_db_password databasepassword p_data getappsservertype configurationdata appstype_tomcat iswindows getpanel okdatabasesql m_con test jdbc connection to server param url connection string param uid user id param pwd password return true if ok private boolean testjdbc string url string uid string pwd log fine url url uid uid try if s db2driver null s db2driver new db2 driver driver manager register driver s db2driver m con driver manager get connection url uid pwd catch exception e log severe e to string return false return true s_db2driver s_db2driver db2driver drivermanager registerdriver s_db2driver m_con drivermanager getconnection tostring test command line connection param sqlcmd sql command line return true if ok private boolean testsql string sqlcmd if true return true string buffer sb out new string buffer string buffer sb err new string buffer int result 1 try process p runtime get runtime exec sqlcmd input stream in p get input stream int c while c in read 1 sb out append char c system out print char c in close in p get error stream while c in read 1 sb err append char c in close get result try thread yield result p exit value catch exception e timing issue on solaris thread sleep 200 2 sec result p exit value catch exception ex log severe ex to string log finer sb out to string if sb err length 0 log warning sb err to string return result 0 stringbuffer sbout stringbuffer stringbuffer sberr stringbuffer getruntime inputstream getinputstream sbout geterrorstream sberr exitvalue exitvalue tostring sbout tostring sberr sberr tostring layout constraint to indicate grid position param row row 0 x param col column 0 x public a layout constraint int row int col m row row m col col alayoutconstraint m_row m_col create next in row return a layout constraint for additional column in same row public a layout constraint create next return new a layout constraint m row m col 1 alayoutconstraint alayoutconstraint createnext alayoutconstraint m_row m_col get row return roe no public int get row return m row getrow m_row get column return col no public int get col return m col getcol m_col compares this object with the specified object for order returns a negative integer zero or a positive integer as this object is less than equal to or greater than the specified object p param o the object to be compared return a negative integer if this object is less than the specified object zero if equal or a positive integer if this object is greater than the specified object public int compare to object o a layout constraint comp null if o instanceof a layout constraint comp a layout constraint o if comp null return 111 row compare int row comp m row comp get row if row comp 0 return row comp column compare return m col comp get col compareto alayoutconstraint alayoutconstraint alayoutconstraint rowcomp m_row getrow rowcomp rowcomp m_col getcol is object equal param o return true if equal public boolean equals object o if o instanceof a layout constraint return compare to o 0 return false alayoutconstraint compareto to string return info public string to string return a layout constraint row m row col m col tostring alayoutconstraint m_row m_col get content return content public object get contents return contents getcontents create image from url param imageurl string image url public static image element get string imageurl string object key imageurl string image element image image element s cache get key if image null image new image element imageurl string s cache put key image return new image element image get image imageurlstring imageelement imageurlstring imageurlstring imageelement imageelement s_cache imageelement imageurlstring s_cache imageelement getimage create image from url param imageurl image url public static image element get url imageurl object key imageurl image element image image element s cache get key if image null image new image element imageurl s cache put key image return new image element image get image imageelement imageelement imageelement s_cache imageelement s_cache imageelement getimage create image from attachment param ad printformatitem id record id public static image element get int ad printformatitem id object key new integer ad printformatitem id image element image image element s cache get key if image null image new image element ad printformatitem id s cache put key image return new image element image get image ad_printformatitem_id imageelement ad_printformatitem_id ad_printformatitem_id imageelement imageelement s_cache imageelement ad_printformatitem_id s_cache imageelement getimage create from existing image param image image public image element image image m image image if m image null log fine image image else log log level warning image is null imageelement m_image m_image create image from url param imageur lstring image url private image element string imageur lstring url imageurl geturl imageur lstring if imageurl null m image toolkit get default toolkit get image imageurl if m image null log fine url imageurl else log log level warning not loaded url imageurl else log log level warning invalid url imageur lstring imageurlstring imageelement imageurlstring imageurlstring m_image getdefaulttoolkit getimage m_image imageurlstring create image from url param imageurl image url private image element url imageurl if imageurl null m image toolkit get default toolkit get image imageurl if m image null log fine url imageurl else log log level warning not loaded url imageurl else log severe imageurl is null imageelement m_image getdefaulttoolkit getimage m_image create image from attachment param ad printformatitem id record id private image element int ad printformatitem id load attachment ad printformatitem id ad_printformatitem_id imageelement ad_printformatitem_id loadattachment ad_printformatitem_id get url from string param url string url or resource return url or null private url geturl string url string url url null not a url may be a resource if url string index of 1 class loader cl get class get class loader url cl get resource url string if url null return url log log level warning not found url string return null load url try url new url url string catch malformedurl exception ex log log level warning url string ex return url urlstring urlstring urlstring indexof classloader getclass getclassloader getresource urlstring urlstring urlstring malformedurlexception urlstring load attachment param ad printformatitem id record id private void load attachment int ad printformatitem id m attachment attachment m attachment get env get ctx m print format item table id ad printformatitem id if attachment null log log level warning no attachment ad printformatitem id ad printformatitem id return if attachment get entry count 1 log log level warning need just 1 attachment entry attachment get entry count return byte image data attachment get entry data 0 if image data null m image toolkit get default toolkit create image image data if m image null log fine attachment get entry name 0 size image data length else log log level warning attachment get entry name 0 not loaded must be gif or jpg ad printformatitem id ad printformatitem id ad_printformatitem_id loadattachment ad_printformatitem_id mattachment mattachment getctx mprintformatitem table_id ad_printformatitem_id ad_printformatitem_id ad_printformatitem_id getentrycount getentrycount imagedata getentrydata imagedata m_image getdefaulttoolkit createimage imagedata m_image getentryname imagedata getentryname ad_printformatitem_id ad_printformatitem_id calculate image size set p width p height return true if calculated protected boolean calculate size p width 0 p height 0 if m image null return true we have an image wait for load m image if m image null p width m image get width this p height m image get height this if p width p height 0 return true don t bother scaling and prevent div by 0 0 unlimited so scale to fit restricted dimension if p maxwidth p maxheight 0 scale to maintain aspect ratio if p width p height p maxwidth p maxheight image fatter than available area m scalefactor p maxwidth p width else m scalefactor p maxheight p height p width float m scalefactor p width p height float m scalefactor p height return true p_width p_height calculatesize p_width p_height m_image waitforload m_image m_image p_width m_image getwidth p_height m_image getheight p_width p_height p_maxwidth p_maxheight p_width p_height p_maxwidth p_maxheight m_scalefactor p_maxwidth p_width m_scalefactor p_maxheight p_height p_width m_scalefactor p_width p_height m_scalefactor p_height get the image return image public image get image return m image getimage m_image paint image param g2d graphics param page start top left location of page param page no page number for multi page support 0 header footer ignored param ctx print context param is view true if online view i ds are links public void paint graphics2d g2d int page no point2d page start properties ctx boolean is view if m image null return position point2d double location get absolute location page start int x int location x if m print format item fieldalignmenttype trailingright equals p fieldalignmenttype x p maxwidth p width else if m print format item fieldalignmenttype center equals p fieldalignmenttype x p maxwidth p width 2 int y int location y map a scaled and shifted version of the image to device space affine transform transform new affine transform transform translate x y transform scale m scalefactor m scalefactor g2d draw image m image transform this pagestart pageno isview ids pageno pagestart isview m_image getabsolutelocation pagestart mprintformatitem fieldalignmenttype_trailingright p_fieldalignmenttype p_maxwidth p_width mprintformatitem fieldalignmenttype_center p_fieldalignmenttype p_maxwidth p_width affinetransform affinetransform m_scalefactor m_scalefactor drawimage m_image standard constructor public x ad labelprinter properties ctx int ad labelprinter id string trx name super ctx ad labelprinter id trx name if ad labelprinter id 0 setad labelprinter id 0 set name null x_ad_labelprinter ad_labelprinter_id trxname ad_labelprinter_id trxname ad_labelprinter_id setad_labelprinter_id setname load constructor public x ad labelprinter properties ctx result set rs string trx name super ctx rs trx name x_ad_labelprinter resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad labelprinter append get id append return sb to string tostring stringbuffer stringbuffer x_ad_labelprinter get_id tostring set label printer label printer definition public void setad labelprinter id int ad labelprinter id if ad labelprinter id 1 throw new illegal argument exception ad labelprinter id is mandatory set valuenocheck ad labelprinter id new integer ad labelprinter id setad_labelprinter_id ad_labelprinter_id ad_labelprinter_id illegalargumentexception ad_labelprinter_id set_valuenocheck ad_labelprinter_id ad_labelprinter_id get label printer label printer definition public int getad labelprinter id integer ii integer get value ad labelprinter id if ii null return 0 return ii int value getad_labelprinter_id get_value ad_labelprinter_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname standard constructor public x s resourceunavailable properties ctx int s resourceunavailable id string trx name super ctx s resourceunavailable id trx name if s resourceunavailable id 0 set date from new timestamp system current time millis sets resourceunavailable id 0 sets resource id 0 x_s_resourceunavailable s_resourceunavailable_id trxname s_resourceunavailable_id trxname s_resourceunavailable_id setdatefrom currenttimemillis sets_resourceunavailable_id sets_resource_id load constructor public x s resourceunavailable properties ctx result set rs string trx name super ctx rs trx name x_s_resourceunavailable resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s resourceunavailable append get id append return sb to string tostring stringbuffer stringbuffer x_s_resourceunavailable get_id tostring set date from starting date for a range public void set date from timestamp date from if date from null throw new illegal argument exception date from is mandatory set value date from date from setdatefrom datefrom datefrom illegalargumentexception datefrom set_value datefrom datefrom get date from starting date for a range public timestamp get date from return timestamp get value date from getdatefrom get_value datefrom set date to end date of a date range public void set date to timestamp date to set value date to date to setdateto dateto set_value dateto dateto get date to end date of a date range public timestamp get date to return timestamp get value date to getdateto get_value dateto set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set resource unavailability public void sets resourceunavailable id int s resourceunavailable id if s resourceunavailable id 1 throw new illegal argument exception s resourceunavailable id is mandatory set valuenocheck s resourceunavailable id new integer s resourceunavailable id sets_resourceunavailable_id s_resourceunavailable_id s_resourceunavailable_id illegalargumentexception s_resourceunavailable_id set_valuenocheck s_resourceunavailable_id s_resourceunavailable_id get resource unavailability public int gets resourceunavailable id integer ii integer get value s resourceunavailable id if ii null return 0 return ii int value gets_resourceunavailable_id get_value s_resourceunavailable_id intvalue set resource resource public void sets resource id int s resource id if s resource id 1 throw new illegal argument exception s resource id is mandatory set valuenocheck s resource id new integer s resource id sets_resource_id s_resource_id s_resource_id illegalargumentexception s_resource_id set_valuenocheck s_resource_id s_resource_id get resource resource public int gets resource id integer ii integer get value s resource id if ii null return 0 return ii int value gets_resource_id get_value s_resource_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of gets resource id intvalue keynamepair getkeynamepair keynamepair get_id valueof gets_resource_id get wf responsible from cache param ctx context param ad wf responsible id id return mwf responsible public static mwf responsible get properties ctx int ad wf responsible id integer key new integer ad wf responsible id mwf responsible ret value mwf responsible s cache get key if ret value null return ret value ret value new mwf responsible ctx ad wf responsible id null if ret value get id 0 s cache put key ret value return ret value ad_wf_responsible_id mwfresponsible mwfresponsible ad_wf_responsible_id ad_wf_responsible_id mwfresponsible retvalue mwfresponsible s_cache retvalue retvalue retvalue mwfresponsible ad_wf_responsible_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param ad wf responsible id id public mwf responsible properties ctx int ad wf responsible id string trx name super ctx ad wf responsible id trx name ad_wf_responsible_id mwfresponsible ad_wf_responsible_id trxname ad_wf_responsible_id trxname load constructor param ctx context param rs result set public mwf responsible properties ctx result set rs string trx name super ctx rs trx name mwfresponsible resultset trxname trxname invoker return true if no user and no role return true if invoker public boolean is invoker return getad user id 0 getad role id 0 isinvoker getad_user_id getad_role_id is role responsible return true if role public boolean is role return responsibletype role equals get responsible type getad role id 0 isrole responsibletype_role getresponsibletype getad_role_id is role responsible return true if role public m role get role if is role return null return m role get get ctx getad role id mrole getrole isrole mrole getctx getad_role_id is human responsible return true if human public boolean is human return responsibletype human equals get responsible type getad user id 0 ishuman responsibletype_human getresponsibletype getad_user_id is org responsible return true if org public boolean is organization return responsibletype organization equals get responsible type getad org id 0 isorganization responsibletype_organization getresponsibletype getad_org_id before save param new record new return tre if can be saved protected boolean before save boolean new record if responsibletype human equals get responsible type getad user id 0 return true if responsibletype role equals get responsible type getad role id 0 getad client id 0 log save error error msg parse translation get ctx required enter ad role id return false user not used if responsibletype human equals get responsible type getad user id 0 setad user id 0 role not used if responsibletype role equals get responsible type getad role id 0 setad role id 0 return true newrecord beforesave newrecord responsibletype_human getresponsibletype getad_user_id responsibletype_role getresponsibletype getad_role_id getad_client_id saveerror parsetranslation getctx requiredenter ad_role_id responsibletype_human getresponsibletype getad_user_id setad_user_id responsibletype_role getresponsibletype getad_role_id setad_role_id string representation return info public string to string string buffer sb new string buffer mwf responsible sb append get id append append get name append type append get responsible type if getad user id 0 sb append ad user id append getad user id if getad role id 0 sb append ad role id append getad role id sb append return sb to string tostring stringbuffer stringbuffer mwfresponsible get_id getname getresponsibletype getad_user_id ad_user_id getad_user_id getad_role_id ad_role_id getad_role_id tostring public c check box menu item super c check box menu item ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item icon icon super icon c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item string text super text c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item action a super a c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item string text icon icon super text icon c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item string text boolean b super text b c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem c check box menu item public c check box menu item string text icon icon boolean b super text icon b c check box menu item ccheckboxmenuitem ccheckboxmenuitem ccheckboxmenuitem set text param text text public void set text string text if text null super set text text return int pos text index of if pos 1 text length pos we have a nemonic creates alt int mnemonic text to upper case char at pos 1 if mnemonic set mnemonic mnemonic text text substring 0 pos text substring pos 1 super set text text if get name null set name text settext settext indexof _ touppercase charat setmnemonic settext getname setname construct new test instance param name the test name public access sql parser test string name super name accesssqlparsertest launch the test param args string public static void main string args junit swingui test runner run access sql parser test class testrunner accesssqlparsertest perform pre test initialization throws exception see test case set up protected void set up throws exception super set up compiere startup true testcase setup setup setup run the one table test public void test one table string sql select ad table id table name from ad table where is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table 0 fixture to string onetable testonetable ad_table_id tablename ad_table isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table tostring run the one table syn test public void test one table syn string sql select t ad table id t table name from ad table t where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t 0 fixture to string onetablesyn testonetablesyn ad_table_id tablename ad_table isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table tostring run the one table syn test public void test one table synas string sql select t ad table id t table name from ad table as t where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t 0 fixture to string onetablesyn testonetablesynas ad_table_id tablename ad_table isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table tostring run the two table test public void test two table string sql select t ad table id t table name c ad column id c column name from ad table t ad column c where t ad table id c ad table id and t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t ad column c 0 fixture to string twotable testtwotable ad_table_id tablename ad_column_id columnname ad_table ad_column ad_table_id ad_table_id isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table ad_column tostring run the two table syn test public void test two table syn string sql select t ad table id t table name c ad column id c column name from ad table as t ad column as c where t ad table id c ad table id and t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t ad column c 0 fixture to string twotablesyn testtwotablesyn ad_table_id tablename ad_column_id columnname ad_table ad_column ad_table_id ad_table_id isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table ad_column tostring run the join inner test public void test join inner string sql select t ad table id t table name c ad column id c column name from ad table t inner join ad column c on t ad table id c ad table id where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t ad column c 0 fixture to string joininner testjoininner ad_table_id tablename ad_column_id columnname ad_table ad_column ad_table_id ad_table_id isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table ad_column tostring run the join outer test public void test join outer string sql select t ad table id t table name c ad column id c column name from ad table t left outer join ad column c on t ad table id c ad table id where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad table t ad column c 0 fixture to string joinouter testjoinouter ad_table_id tablename ad_column_id columnname ad_table ad_column ad_table_id ad_table_id isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_table ad_column tostring run the exists test public void test exists string sql select ad table ad table id ad table table name from ad table where exists select from ad column c where ad table ad table id c ad table id access sql parser fixture new access sql parser sql assert equals access sql parser ad column c ad table 1 fixture to string testexists ad_table ad_table_id ad_table tablename ad_table ad_column ad_table ad_table_id ad_table_id accesssqlparser accesssqlparser assertequals accesssqlparser ad_column ad_table tostring run the exists test with syn public void test exists syn string sql select t ad table id t table name from ad table t where exists select from ad column c where t ad table id c ad table id access sql parser fixture new access sql parser sql assert equals access sql parser ad column c ad table t 1 fixture to string testexistssyn ad_table_id tablename ad_table ad_column ad_table_id ad_table_id accesssqlparser accesssqlparser assertequals accesssqlparser ad_column ad_table tostring run the embedded select test public void test embedded select string sql select t ad table id t table name select count c column name from ad column c where t ad table id c ad table id from ad table t where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad column c ad table t 1 fixture to string embeddedselect testembeddedselect ad_table_id tablename columnname ad_column ad_table_id ad_table_id ad_table isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_column ad_table tostring run the embedded from test public void test embedded from string sql select t ad table id t table name cc c count from ad table t select count column name as c count from ad column cc where t is active y access sql parser fixture new access sql parser sql assert equals access sql parser ad column ad table t cc 1 fixture to string embeddedfrom testembeddedfrom ad_table_id tablename ccount ad_table columnname ccount ad_column isactive accesssqlparser accesssqlparser assertequals accesssqlparser ad_column ad_table tostring run the product instance attribute query public void test product instance attribute query string sql select p m product id p discontinued p value p name bom qty available p m product id as qty available bom qty list p m product id pr m pricelist version id as price list bom qty std p m product id pr m pricelist version id as price std bom qty onhand p m product id as qty on hand bom qty reserved p m product id as qty reserved bom qty ordered p m product id as qty ordered bom qty std p m product id pr m pricelist version id bom qty limit p m product id pr m pricelist version id as margin bom qty limit p m product id pr m pricelist version id as price limit pa is instance attribute from m product p inner join m productprice pr on p m product id pr m product id left outer join m attributeset pa on p m attributeset id pa m attributeset id where p is summary n and p is active y and pr is active y and pr m pricelist version id and exists select from m storage s inner join m attributesetinstance asi on s m attributesetinstance id asi m attributesetinstance id where s m product id p m product id and asi ser no like 33 and asi lot like 33 and asi m lot id 101 and trunc asi guarantee date to date 2003 10 16 yyyy mm dd and asi m attributesetinstance id in select m attributesetinstance id from m attributeinstance where m attribute id 103 and value like 33 and m attribute id 102 and m attributevalue id 106 and p m attributesetinstance id in select m attributesetinstance id from m attributeinstance where m attribute id 101 and m attributevalue id 105 and m attribute id 100 and m attributevalue id 102 and p ad client id in 0 11 and p ad org id in 0 11 12 order by qty available desc margin desc access sql parser fixture new access sql parser sql assert equals access sql parser m attributeinstance m storage s m attributesetinstance asi m attributeinstance m product p m productprice pr m attributeset pa 3 fixture to string testproductinstanceattributequery m_product_id bom_qty_available m_product_id qtyavailable bomqtylist m_product_id m_pricelist_version_id pricelist bomqtystd m_product_id m_pricelist_version_id pricestd bom_qty_onhand m_product_id qtyonhand bom_qty_reserved m_product_id qtyreserved bom_qty_ordered m_product_id qtyordered bomqtystd m_product_id m_pricelist_version_id bomqtylimit m_product_id m_pricelist_version_id bomqtylimit m_product_id m_pricelist_version_id pricelimit isinstanceattribute m_product m_productprice m_product_id m_product_id m_attributeset m_attributeset_id m_attributeset_id issummary isactive isactive m_pricelist_version_id m_storage m_attributesetinstance m_attributesetinstance_id m_attributesetinstance_id m_product_id m_product_id serno m_lot_id guaranteedate to_date m_attributesetinstance_id m_attributesetinstance_id m_attributeinstance m_attribute_id m_attribute_id m_attributevalue_id m_attributesetinstance_id m_attributesetinstance_id m_attributeinstance m_attribute_id m_attributevalue_id m_attribute_id m_attributevalue_id ad_client_id ad_org_id qtyavailable accesssqlparser accesssqlparser assertequals accesssqlparser m_attributeinstance m_storage m_attributesetinstance m_attributeinstance m_product m_productprice m_attributeset tostring run the product attribute query public void test product attribute query string sql select p m product id p discontinued p value p name bom qty available p m product id as qty available bom qty list p m product id pr m pricelist version id as price list bom qty std p m product id pr m pricelist version id as price std bom qty onhand p m product id as qty on hand bom qty reserved p m product id as qty reserved bom qty ordered p m product id as qty ordered bom qty std p m product id pr m pricelist version id bom qty limit p m product id pr m pricelist version id as margin bom qty limit p m product id pr m pricelist version id as price limit pa is instance attribute from m product p inner join m productprice pr on p m product id pr m product id left outer join m attributeset pa on p m attributeset id pa m attributeset id where p is summary n and p is active y and pr is active y and pr m pricelist version id and p m attributesetinstance id in select m attributesetinstance id from m attributeinstance where m attribute id 100 and m attributevalue id 101 order by qty available desc margin desc access sql parser fixture new access sql parser sql assert equals access sql parser m attributeinstance m product p m productprice pr m attributeset pa 1 fixture to string testproductattributequery m_product_id bom_qty_available m_product_id qtyavailable bomqtylist m_product_id m_pricelist_version_id pricelist bomqtystd m_product_id m_pricelist_version_id pricestd bom_qty_onhand m_product_id qtyonhand bom_qty_reserved m_product_id qtyreserved bom_qty_ordered m_product_id qtyordered bomqtystd m_product_id m_pricelist_version_id bomqtylimit m_product_id m_pricelist_version_id bomqtylimit m_product_id m_pricelist_version_id pricelimit isinstanceattribute m_product m_productprice m_product_id m_product_id m_attributeset m_attributeset_id m_attributeset_id issummary isactive isactive m_pricelist_version_id m_attributesetinstance_id m_attributesetinstance_id m_attributeinstance m_attribute_id m_attributevalue_id qtyavailable accesssqlparser accesssqlparser assertequals accesssqlparser m_attributeinstance m_product m_productprice m_attributeset tostring public void test hinttech string sql select xx htc1 employee v c bpartner id null xx htc1 employee v c bpartner name xx htc1 employee v is active from xx htc1 employee v where xx htc1 employee v ad user id in select ur ad user id from ad user roles ur inner join ad role r on ur ad role id r ad role id where r name like field manager access sql parser fixture new access sql parser sql testhinttech xx_htc1_employee_v c_bpartner_id xx_htc1_employee_v c_bpartner_name xx_htc1_employee_v isactive xx_htc1_employee_v xx_htc1_employee_v ad_user_id ad_user_id ad_user_roles ad_role ad_role_id ad_role_id accesssqlparser accesssqlparser public rmi util test port try system out println registry registry registry locate registry get registry system out println registry string list registry list system out println size list length for int i 0 i list length i system out println list i catch exception ex ex print stack trace try system out println server system out println remote server get client host string list naming list rmi localhost 1099 system out println size list length for int i 0 i list length i system out println list i catch exception ex ex print stack trace rmiutil testport locateregistry getregistry printstacktrace remoteserver getclienthost printstacktrace private void test port try system out println test port socket socket new socket localhost 1099 system out println socket socket input stream in socket get input stream int i 0 while i 0 i in read if i 0 system out println char i catch io exception ex ex print stack trace testport inputstream getinputstream ioexception printstacktrace test param args args public static void main string args new rmi util rmiutil private string icon mono32x32 filename public status bar bean info iconmono32x32filename statusbarbeaninfo public property descriptor get property descriptors try property descriptor info new property descriptor info bean class null set info property descriptor statusdb new property descriptor statusdb bean class null set statusdb property descriptor statusline new property descriptor status line bean class get status line set status line property descriptor pds new property descriptor info statusdb statusline return pds catch introspection exception ex ex print stack trace return null propertydescriptor getpropertydescriptors propertydescriptor _info propertydescriptor beanclass setinfo propertydescriptor _statusdb propertydescriptor beanclass setstatusdb propertydescriptor _statusline propertydescriptor statusline beanclass getstatusline setstatusline propertydescriptor propertydescriptor _info _statusdb _statusline introspectionexception printstacktrace public java awt image get icon int icon kind switch icon kind case bean info icon color 16x16 return icon color16x16 filename null load image icon color16x16 filename null case bean info icon color 32x32 return icon color32x32 filename null load image icon color32x32 filename null case bean info icon mono 16x16 return icon mono16x16 filename null load image icon mono16x16 filename null case bean info icon mono 32x32 return icon mono32x32 filename null load image icon mono32x32 filename null return null geticon iconkind iconkind beaninfo icon_color_16x16 iconcolor16x16filename loadimage iconcolor16x16filename beaninfo icon_color_32x32 iconcolor32x32filename loadimage iconcolor32x32filename beaninfo icon_mono_16x16 iconmono16x16filename loadimage iconmono16x16filename beaninfo icon_mono_32x32 iconmono32x32filename loadimage iconmono32x32filename public bean info get additional bean info class superclass bean class get superclass try bean info super bean info introspector get bean info superclass return new bean info super bean info catch introspection exception ex ex print stack trace return null beaninfo getadditionalbeaninfo beanclass getsuperclass beaninfo superbeaninfo getbeaninfo beaninfo superbeaninfo introspectionexception printstacktrace prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals ad client id p ad client id big decimal para i get parameter int value else if name equals delete old imported p deleteoldimported y equals para i get parameter else log log level severe unknown parameter name p i inoutlineconfirm id getrecord id processinfoparameter getparameter getparametername getparameter ad_client_id p_ad_client_id bigdecimal getparameter intvalue deleteoldimported p_deleteoldimported getparameter p_i_inoutlineconfirm_id getrecord_id do it return info protected string do it throws exception log info string buffer sql null int no 0 string client check and ad client id p ad client id delete old imported if p deleteoldimported sql new string buffer delete i inoutlineconfirm where i isimported y append client check no db execute update sql to string get trxname log fine delete old impored no set is active created updated sql new string buffer update i inoutlineconfirm set is active coalesce is active y created coalesce created sys date created by coalesce created by 0 updated coalesce updated sys date updated by coalesce updated by 0 i errormsg null i isimported n where i isimported y or i isimported is null no db execute update sql to string get trxname log info reset no set client from name sql new string buffer update i inoutlineconfirm i set ad client id coalesce ad client id append p ad client id append where ad client id is null or ad client id 0 and i isimported y no db execute update sql to string get trxname log fine set client from value no error confirmation line sql new string buffer update i inoutlineconfirm i set i isimported e i errormsg i errormsg err invalid confirmation line where m inoutlineconfirm id is null or m inoutlineconfirm id 0 or not exists select from m inoutlineconfirm c where i m inoutlineconfirm id c m inoutlineconfirm id and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid in out line confirm no error confirmation no sql new string buffer update i inoutlineconfirm i set i isimported e i errormsg i errormsg err missing confirmation no where confirmation no is null or confirmation no and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid confirmation no no qty sql new string buffer update i inoutlineconfirm i set i isimported e i errormsg i errormsg err target confirmed difference scrapped where exists select from m inoutlineconfirm c where i m inoutlineconfirm id c m inoutlineconfirm id and c target qty i confirmed qty i scrapped qty i difference qty and i isimported y append client check no db execute update sql to string get trxname if no 0 log warning invalid qty no commit prepared statement pstmt null sql new string buffer select from i inoutlineconfirm where i isimported n append client check append order by i inoutlineconfirm id no 0 try pstmt db prepare statement sql to string get trxname result set rs pstmt execute query while rs next x i inoutlineconfirm import line new x i inoutlineconfirm get ctx rs get trxname m in out line confirm confirm line new m in out line confirm get ctx import line getm inoutlineconfirm id get trxname if confirm line get id 0 confirm line get id import line getm inoutlineconfirm id import line seti isimported false import line seti errormsg id not found import line save else confirm line set confirmation no import line get confirmation no confirm line set confirmed qty import line get confirmed qty confirm line set difference qty import line get difference qty confirm line set scrapped qty import line get scrapped qty confirm line set description import line get description if confirm line save import import line seti isimported true import line set processed true if import line save no rs close pstmt close pstmt null catch exception e log log level severe sql to string e try if pstmt null pstmt close pstmt null catch exception e pstmt null return updated no doit doit stringbuffer clientcheck ad_client_id p_ad_client_id p_deleteoldimported stringbuffer i_inoutlineconfirm i_isimported clientcheck executeupdate tostring get_trxname isactive stringbuffer i_inoutlineconfirm isactive isactive sysdate createdby createdby sysdate updatedby updatedby i_errormsg i_isimported i_isimported i_isimported executeupdate tostring get_trxname stringbuffer i_inoutlineconfirm ad_client_id ad_client_id p_ad_client_id ad_client_id ad_client_id i_isimported executeupdate tostring get_trxname stringbuffer i_inoutlineconfirm i_isimported i_errormsg i_errormsg m_inoutlineconfirm_id m_inoutlineconfirm_id m_inoutlineconfirm m_inoutlineconfirm_id m_inoutlineconfirm_id i_isimported clientcheck executeupdate tostring get_trxname inoutlineconfirm stringbuffer i_inoutlineconfirm i_isimported i_errormsg i_errormsg confirmationno confirmationno i_isimported clientcheck executeupdate tostring get_trxname confirmationno stringbuffer i_inoutlineconfirm i_isimported i_errormsg i_errormsg m_inoutlineconfirm m_inoutlineconfirm_id m_inoutlineconfirm_id targetqty confirmedqty scrappedqty differenceqty i_isimported clientcheck executeupdate tostring get_trxname preparedstatement stringbuffer i_inoutlineconfirm i_isimported clientcheck i_inoutlineconfirm_id preparestatement tostring get_trxname resultset executequery x_i_inoutlineconfirm importline x_i_inoutlineconfirm getctx get_trxname minoutlineconfirm confirmline minoutlineconfirm getctx importline getm_inoutlineconfirm_id get_trxname confirmline get_id confirmline get_id importline getm_inoutlineconfirm_id importline seti_isimported importline seti_errormsg importline confirmline setconfirmationno importline getconfirmationno confirmline setconfirmedqty importline getconfirmedqty confirmline setdifferenceqty importline getdifferenceqty confirmline setscrappedqty importline getscrappedqty confirmline setdescription importline getdescription confirmline importline seti_isimported importline setprocessed importline tostring get unprocessed clicks param ctx context return array of unprocessed clicks public static m click get unprocessed properties ctx array list m click list new array list m click string sql select from w click where ad client id and processed n prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 env getad client id ctx result set rs pstmt execute query while rs next list add new m click ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m click ret value new m click list size list to array ret value return ret value mclick getunprocessed arraylist mclick arraylist mclick w_click ad_client_id preparedstatement preparestatement setint getad_client_id resultset executequery mclick s_log mclick retvalue mclick toarray retvalue retvalue actual click param ctx context param w click id id public m click properties ctx int w click id string trx name super ctx w click id trx name if w click id 0 set processed false w_click_id mclick w_click_id trxname w_click_id trxname w_click_id setprocessed actual click param ctx context param targeturl url public m click properties ctx string targeturl string trx name this ctx 0 trx name set targeturl targeturl mclick trxname trxname settargeturl load constructor param ctx context param rs result set param trx name transaction public m click properties ctx result set rs string trx name super ctx rs trx name trxname mclick resultset trxname trxname set target url reset click count param targeturl public void set targeturl string targeturl super set targeturl targeturl super setw clickcount id 0 settargeturl settargeturl setw_clickcount_id find click count public void setw clickcount id clean up url string url get targeturl if url null url length 0 return string exacturl url remove everything before first if url starts with http url url substring 7 int dot url index of int slash url index of while dot slash slash 1 url url substring slash 1 dot url index of slash url index of remove everything after if slash 1 url url substring 0 slash log fine exacturl url int w clickcount id search url exacturl try minumum if w clickcount id 0 int last dot url last index of int first dot url index of while last dot first dot url url substring first dot 1 last dot url last index of first dot url index of log fine exacturl url w clickcount id search url exacturl not found if w clickcount id 0 log warning not found url exacturl referrer get referrer return ok set processed true super setw clickcount id w clickcount id setw_clickcount_id gettargeturl startswith indexof indexof indexof indexof w_clickcount_id w_clickcount_id lastdot lastindexof firstdot indexof lastdot firstdot firstdot lastdot lastindexof firstdot indexof w_clickcount_id w_clickcount_id getreferrer setprocessed setw_clickcount_id w_clickcount_id search for click count param url url param exacturl original url return w clickcount id private int search string url string exacturl string sql select w clickcount id targeturl from w clickcount where targeturl like int w clickcount id 0 int exactw clickcount id 0 prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 url result set rs pstmt execute query while rs next w clickcount id rs get int 1 if exacturl equals rs get string 2 exactw clickcount id w clickcount id break rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null set click count if exactw clickcount id 0 w clickcount id exactw clickcount id return w clickcount id w_clickcount_id w_clickcount_id w_clickcount w_clickcount_id exactw_clickcount_id preparedstatement preparestatement setstring resultset executequery w_clickcount_id getint getstring exactw_clickcount_id w_clickcount_id sqlexception sqlexception exactw_clickcount_id w_clickcount_id exactw_clickcount_id w_clickcount_id before save param new record new return true protected boolean before save boolean new record if getw clickcount id 0 setw clickcount id return true newrecord beforesave newrecord getw_clickcount_id setw_clickcount_id test param args ignored public static void main string args compiere startup true env set context env get ctx ad client id 1000000 m click clicks get unprocessed env get ctx int counter 0 for int i 0 i clicks length i m click click clicks i if click getw clickcount id 0 click setw clickcount id if click getw clickcount id 0 click save counter system out println counter setcontext getctx ad_client_id mclick getunprocessed getctx mclick getw_clickcount_id setw_clickcount_id getw_clickcount_id standard constructor public x r issuestatus properties ctx int r issuestatus id string trx name super ctx r issuestatus id trx name if r issuestatus id 0 set name null setr issuestatus id 0 x_r_issuestatus r_issuestatus_id trxname r_issuestatus_id trxname r_issuestatus_id setname setr_issuestatus_id load constructor public x r issuestatus properties ctx result set rs string trx name super ctx rs trx name x_r_issuestatus resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r issuestatus append get id append return sb to string tostring stringbuffer stringbuffer x_r_issuestatus get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set issue status status of an issue public void setr issuestatus id int r issuestatus id if r issuestatus id 1 throw new illegal argument exception r issuestatus id is mandatory set valuenocheck r issuestatus id new integer r issuestatus id setr_issuestatus_id r_issuestatus_id r_issuestatus_id illegalargumentexception r_issuestatus_id set_valuenocheck r_issuestatus_id r_issuestatus_id get issue status status of an issue public int getr issuestatus id integer ii integer get value r issuestatus id if ii null return 0 return ii int value getr_issuestatus_id get_value r_issuestatus_id intvalue create m tab vo param wvo value object param tab no tab no param rs result set from ad tab v param isro true if window is r o param only current rows if true query is limited to not processed records return tabvo public static m tabvo create m windowvo wvo int tab no result set rs boolean isro boolean only current rows c logger get config tab no m tabvo vo new m tabvo wvo ctx wvo window no vo ad window id wvo ad window id vo tab no tab no if load tab details vo rs return null if isro c logger get fine tab is read only vo is read only true vo only current rows only current rows create fields if vo is sort tab vo fields new array list m fieldvo dummy else create fields vo if vo fields null vo fields size 0 c logger get log level severe no fields return null return vo mtab tabno resultset ad_tab_v onlycurrentrows mtabvo mwindowvo tabno resultset onlycurrentrows clogger tabno mtabvo mtabvo windowno ad_window_id ad_window_id tabno tabno loadtabdetails clogger readonly isreadonly onlycurrentrows onlycurrentrows issorttab arraylist mfieldvo createfields clogger load tab details from rs into vo param vo tab value object param rs result set from ad tab v t return true if read ok private static boolean load tab details m tabvo vo result set rs m role role m role get default vo ctx false boolean show trl y equals env get context vo ctx show trl boolean show acct y equals env get context vo ctx show acct boolean show advanced y equals env get context vo ctx show advanced c logger get warning show trl show trl show acct show acct try vo ad tab id rs get int ad tab id env set context vo ctx vo window no vo tab no ad tab id string value of vo ad tab id vo name rs get string name env set context vo ctx vo window no vo tab no name vo name translation tab if rs get string is translation tab equals y document translation vo table name rs get string table name if env is base translation vo table name c uom env is multi lingual document vo ctx show trl false if show trl c logger get config trl tab not displayed ad tab id vo ad tab id vo name table vo table name base trl env is base translation vo table name multi lingual env is multi lingual document vo ctx return false advanced tab if show advanced rs get string is advanced tab equals y c logger get config advanced tab not displayed ad tab id vo ad tab id vo name return false accounting info tab if show acct rs get string is info tab equals y c logger get fine acct tab not displayed ad tab id vo ad tab id vo name return false display logic vo display logic rs get string display logic if vo display logic null vo display logic length 0 if env parse context vo ctx 0 vo display logic false false length 0 evaluator evaluate logic vo vo display logic c logger get config tab not displayed vo display logic ad tab id vo ad tab id vo name return false access level vo access level rs get string access level if role can view vo ctx vo access level no access c logger get fine no role access ad tab id vo ad tab id vo name return false used by m field get default env set context vo ctx vo window no vo tab no access level vo access level table access vo ad table id rs get int ad table id env set context vo ctx vo window no vo tab no ad table id string value of vo ad table id if role is table access vo ad table id true c logger get config no table access ad tab id vo ad tab id vo name return false if rs get string is read only equals y vo is read only true vo read only logic rs get string read only logic if rs get string is insert record equals n vo is insert record false vo description rs get string description if vo description null vo description vo help rs get string help if vo help null vo help if rs get string is single row equals y vo is single row true if rs get string has tree equals y vo has tree true vo ad table id rs get int ad table id vo table name rs get string table name if rs get string is view equals y vo is view true vo ad column id rs get int ad column id primary parent column if rs get string is security enabled equals y vo is security enabled true if rs get string is deleteable equals y vo is deleteable true if rs get string is high volume equals y vo is high volume true vo commit warning rs get string commit warning if vo commit warning null vo commit warning vo where clause rs get string where clause if vo where clause null vo where clause vo order by clause rs get string order by clause if vo order by clause null vo order by clause vo ad process id rs get int ad process id if rs was null vo ad process id 0 vo ad image id rs get int ad image id if rs was null vo ad image id 0 vo included tab id rs get int included tab id if rs was null vo included tab id 0 vo tab level rs get int tab level if rs was null vo tab level 0 vo is sort tab rs get string is sort tab equals y if vo is sort tab vo ad columnsortorder id rs get int ad columnsortorder id vo ad columnsortyesno id rs get int ad columnsortyesno id replication type set r o if reference try int index rs find column replication type vo replication type rs get string index if r equals vo replication type vo is read only true catch exception e catch sql exception ex c logger get log level severe ex return false return true resultset ad_tab_v loadtabdetails mtabvo resultset mrole mrole getdefault showtrl getcontext showtrl showacct getcontext showacct showadvanced getcontext showadvanced clogger showtrl showtrl showacct showacct ad_tab_id getint ad_tab_id setcontext windowno tabno ad_tab_id valueof ad_tab_id getstring setcontext windowno tabno getstring istranslationtab tablename getstring tablename isbasetranslation tablename c_uom ismultilingualdocument showtrl showtrl clogger trltab ad_tab_id ad_tab_id tablename basetrl isbasetranslation tablename multilingual ismultilingualdocument showadvanced getstring isadvancedtab clogger advancedtab ad_tab_id ad_tab_id showacct getstring isinfotab clogger accttab ad_tab_id ad_tab_id displaylogic displaylogic getstring displaylogic displaylogic displaylogic parsecontext displaylogic evaluatelogic displaylogic clogger displaylogic ad_tab_id ad_tab_id accesslevel getstring accesslevel canview accesslevel clogger ad_tab_id ad_tab_id mfield getdefault setcontext windowno tabno accesslevel accesslevel ad_table_id getint ad_table_id setcontext windowno tabno ad_table_id valueof ad_table_id istableaccess ad_table_id clogger ad_tab_id ad_tab_id getstring isreadonly isreadonly readonlylogic getstring readonlylogic getstring isinsertrecord isinsertrecord getstring getstring getstring issinglerow issinglerow getstring hastree hastree ad_table_id getint ad_table_id tablename getstring tablename getstring isview isview ad_column_id getint ad_column_id getstring issecurityenabled issecurityenabled getstring isdeleteable isdeleteable getstring ishighvolume ishighvolume commitwarning getstring commitwarning commitwarning commitwarning whereclause getstring whereclause whereclause whereclause orderbyclause getstring orderbyclause orderbyclause orderbyclause ad_process_id getint ad_process_id wasnull ad_process_id ad_image_id getint ad_image_id wasnull ad_image_id included_tab_id getint included_tab_id wasnull included_tab_id tablevel getint tablevel wasnull tablevel issorttab getstring issorttab issorttab ad_columnsortorder_id getint ad_columnsortorder_id ad_columnsortyesno_id getint ad_columnsortyesno_id findcolumn replicationtype replicationtype getstring replicationtype isreadonly sqlexception clogger create tab fields param m tabvo tab value object return true if fields were created private static boolean create fields m tabvo m tabvo m tabvo fields new array list m fieldvo string sql m fieldvo getsql m tabvo ctx try prepared statement pstmt db prepare statement sql null pstmt set int 1 m tabvo ad tab id result set rs pstmt execute query while rs next m fieldvo vof m fieldvo create m tabvo ctx m tabvo window no m tabvo tab no m tabvo ad window id m tabvo is read only rs if vof null m tabvo fields add vof rs close pstmt close catch exception e c logger get log level severe e return false return m tabvo fields size 0 mtabvo createfields mtabvo mtabvo mtabvo arraylist mfieldvo mfieldvo mtabvo preparedstatement preparestatement setint mtabvo ad_tab_id resultset executequery mfieldvo mfieldvo mtabvo mtabvo windowno mtabvo tabno mtabvo ad_window_id mtabvo isreadonly mtabvo clogger mtabvo return the sql statement used for the m tabvo create param ctx context return sql select string protected static string getsql properties ctx view only returns is active y string sql select from ad tab v where ad window id order by seq no if env is base language ctx ad window sql select from ad tab vt where ad window id and ad language env getad language ctx order by seq no return sql mtabvo isactive ad_tab_v ad_window_id seqno isbaselanguage ad_window ad_tab_vt ad_window_id ad_language getad_language seqno private constructor must use factory private m tabvo properties ctx int window no this ctx ctx this window no window no mtabvo windowno windowno windowno set context including contained elements param new ctx new context public void set ctx properties new ctx ctx new ctx for int i 0 i fields size i m fieldvo field m fieldvo fields get i field set ctx new ctx newctx setctx newctx newctx mfieldvo mfieldvo setctx newctx get variable value evaluatee param variable name name return value public string get valueasstring string variable name return env get context ctx window no variable name false not just window variablename get_valueasstring variablename getcontext windowno variablename clone param ctx context param window no no return m tabvo or null protected m tabvo clone properties ctx int window no m tabvo clone new m tabvo ctx window no clone ad window id ad window id clone tab no tab no env set context ctx window no clone tab no ad tab id string value of clone ad tab id clone ad tab id ad tab id clone name name env set context ctx window no clone tab no name clone name clone description description clone help help clone is single row is single row clone is read only is read only clone is insert record is insert record clone has tree has tree clone ad table id ad table id clone ad column id ad column id clone table name table name clone is view is view clone access level access level clone is security enabled is security enabled clone is deleteable is deleteable clone is high volume is high volume clone ad process id ad process id clone commit warning commit warning clone where clause where clause clone order by clause order by clause clone read only logic read only logic clone display logic display logic clone tab level tab level clone ad image id ad image id clone included tab id included tab id clone replication type replication type env set context ctx window no clone tab no access level clone access level env set context ctx window no clone tab no ad table id string value of clone ad table id clone is sort tab is sort tab clone ad columnsortorder id ad columnsortorder id clone ad columnsortyesno id ad columnsortyesno id derived clone only current rows true clone only current days 0 clone fields new array list m fieldvo for int i 0 i fields size i m fieldvo field fields get i m fieldvo clone field field clone ctx window no tab no ad window id is read only if clone field null return null clone fields add clone field return clone windowno mtabvo mtabvo windowno mtabvo mtabvo windowno ad_window_id ad_window_id tabno tabno setcontext windowno tabno ad_tab_id valueof ad_tab_id ad_tab_id ad_tab_id setcontext windowno tabno issinglerow issinglerow isreadonly isreadonly isinsertrecord isinsertrecord hastree hastree ad_table_id ad_table_id ad_column_id ad_column_id tablename tablename isview isview accesslevel accesslevel issecurityenabled issecurityenabled isdeleteable isdeleteable ishighvolume ishighvolume ad_process_id ad_process_id commitwarning commitwarning whereclause whereclause orderbyclause orderbyclause readonlylogic readonlylogic displaylogic displaylogic tablevel tablevel ad_image_id ad_image_id included_tab_id included_tab_id replicationtype replicationtype setcontext windowno tabno accesslevel accesslevel setcontext windowno tabno ad_table_id valueof ad_table_id issorttab issorttab ad_columnsortorder_id ad_columnsortorder_id ad_columnsortyesno_id ad_columnsortyesno_id onlycurrentrows onlycurrentdays arraylist mfieldvo mfieldvo mfieldvo clonefield windowno tabno ad_window_id isreadonly clonefield clonefield initialize panel param window no window param frame parent frame public void init int window no form frame frame log info m windowno window no m frame frame try jb init dyn init frame get content pane add main panel border layout center frame get content pane add confirm panel border layout south catch exception e log log level severe e windowno windowno formframe m_windowno windowno m_frame jbinit dyninit getcontentpane mainpanel borderlayout getcontentpane confirmpanel borderlayout static init throws exception private void jb init throws exception compiere color set background this new border new titled border account border new titled border main panel set layout main layout new panel set border new border new panel set layout new layout new border set title msg get msg env get ctx charge new account value label set text msg translate env get ctx value is expense set selected true is expense set text msg get msg env get ctx expense name label set text msg translate env get ctx name name field set columns 20 value field set columns 10 new button set text msg get msg env get ctx create new button add action listener this account panel set border account border account panel set layout account layout account border set title msg get msg env get ctx charge from account account button set text msg get msg env get ctx create account button add action listener this accountok panel set layout accountok layout accountok layout set alignment flow layout right confirm panel add action listener this main panel add new panel border layout north new panel add value label new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 new panel add value field new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 new panel add name label new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 new panel add name field new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 0 5 5 0 0 new panel add is expense new grid bag constraints 2 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 new panel add new button new grid bag constraints 2 1 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 5 5 0 0 main panel add account panel border layout center account panel add accountok panel border layout south accountok panel add account button null account panel add data pane border layout center data pane get viewport add data table null jbinit compierecolor setbackground newborder titledborder accountborder titledborder mainpanel setlayout mainlayout newpanel setborder newborder newpanel setlayout newlayout newborder settitle getmsg getctx chargenewaccount valuelabel settext getctx isexpense setselected isexpense settext getmsg getctx namelabel settext getctx namefield setcolumns valuefield setcolumns newbutton settext getmsg getctx newbutton addactionlistener accountpanel setborder accountborder accountpanel setlayout accountlayout accountborder settitle getmsg getctx chargefromaccount accountbutton settext getmsg getctx accountbutton addactionlistener accountokpanel setlayout accountoklayout accountoklayout setalignment flowlayout confirmpanel addactionlistener mainpanel newpanel borderlayout newpanel valuelabel gridbagconstraints gridbagconstraints gridbagconstraints newpanel valuefield gridbagconstraints gridbagconstraints gridbagconstraints newpanel namelabel gridbagconstraints gridbagconstraints gridbagconstraints newpanel namefield gridbagconstraints gridbagconstraints gridbagconstraints newpanel isexpense gridbagconstraints gridbagconstraints gridbagconstraints newpanel newbutton gridbagconstraints gridbagconstraints gridbagconstraints mainpanel accountpanel borderlayout accountpanel accountokpanel borderlayout accountokpanel accountbutton accountpanel datapane borderlayout datapane getviewport datatable dynamic init get defaults for primary acct schema create table with accounts private void dyn init m c acctschema id env get context as int env get ctx c acctschema id get element string sql select c element id from c acctschema element where element type ac and c acctschema id try prepared statement pstmt db prepare statement sql null pstmt set int 1 m c acctschema id result set rs pstmt execute query if rs next m c element id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e if m c element id 0 return table vector vector object data new vector vector object sql select c elementvalue id value name account type from c elementvalue where account type in r e and is summary n and c element id order by 2 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m c element id result set rs pstmt execute query while rs next vector object line new vector object 4 line add new boolean false 0 selection key name pair pp new key name pair rs get int 1 rs get string 2 line add pp 1 value line add rs get string 3 2 name boolean is expense type rs get string 4 equals e line add new boolean is expense type 3 expense data add line rs close pstmt close catch sql exception e log log level severe sql e header info vector string column names new vector string 4 column names add msg get msg env get ctx select column names add msg translate env get ctx value column names add msg translate env get ctx name column names add msg get msg env get ctx expense set model default table model model new default table model data column names data table set model model data table set column class 0 boolean class false 0 selection data table set column class 1 string class true 1 value data table set column class 2 string class true 2 name data table set column class 3 boolean class true 3 expense table ui data table auto size other defaults m ad client id env getad client id env get ctx m ad org id env getad org id env get ctx m createdby env getad user id env get ctx tax category sql select c taxcategory id from c taxcategory where is default y and ad client id m c taxcategory id 0 try prepared statement pstmt db prepare statement sql null pstmt set int 1 m ad client id result set rs pstmt execute query if rs next m c taxcategory id rs get int 1 rs close pstmt close catch sql exception e log log level severe sql e acctschema dyninit m_c_acctschema_id getcontextasint getctx c_acctschema_id c_element_id c_acctschema_element elementtype c_acctschema_id preparedstatement preparestatement setint m_c_acctschema_id resultset executequery m_c_element_id getint sqlexception m_c_element_id c_elementvalue_id accounttype c_elementvalue accounttype issummary c_element_id preparedstatement preparestatement setint m_c_element_id resultset executequery keynamepair keynamepair getint getstring getstring isexpensetype getstring isexpensetype sqlexception columnnames columnnames getmsg getctx columnnames getctx columnnames getctx columnnames getmsg getctx defaulttablemodel defaulttablemodel columnnames datatable setmodel datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable setcolumnclass datatable autosize m_ad_client_id getad_client_id getctx m_ad_org_id getad_org_id getctx m_createdby getad_user_id getctx taxcategory c_taxcategory_id c_taxcategory isdefault ad_client_id m_c_taxcategory_id preparedstatement preparestatement setint m_ad_client_id resultset executequery m_c_taxcategory_id getint sqlexception dispose public void dispose if m frame null m frame dispose m frame null m_frame m_frame m_frame action listener param e event public void action performed action event e log info e get action command if e get action command equals confirm panel a ok m c element id 0 dispose new account else if e get source equals new button create new else if e get source equals account button create account actionperformed actionevent getactioncommand getactioncommand confirmpanel a_ok m_c_element_id getsource newbutton createnew getsource accountbutton createaccount create new account and charge private void create new log config get input string value value field get text if value length 0 value field set background compiereplaf getfieldbackground error return string name name field get text if name length 0 name field set background compiereplaf getfieldbackground error return create element int c elementvalue id create elementvalue value name is expense is selected if c elementvalue id 0 a dialog error m windowno this charge not created name return create charge int c charge id create charge name c elementvalue id if c charge id 0 a dialog error m windowno this charge not created name return a dialog info m windowno this charge created name createnew valuefield gettext valuefield setbackground getfieldbackground_error namefield gettext namefield setbackground getfieldbackground_error c_elementvalue_id create_elementvalue isexpense isselected c_elementvalue_id adialog m_windowno chargenotcreated c_charge_id create_charge c_elementvalue_id c_charge_id adialog m_windowno chargenotcreated adialog m_windowno chargecreated create charges from accounts private void create account log config string buffer list created new string buffer string buffer list rejected new string buffer table model model data table get model int rows model get row count for int i 0 i rows i if boolean model get value at i 0 boolean value key name pair pp key name pair model get value at i 1 int c elementvalue id pp get key string name string model get value at i 2 int c charge id create charge name c elementvalue id if c charge id 0 if list rejected length 0 list rejected append list rejected append name else if list created length 0 list created append list created append name reset selection model set value at new boolean false i 0 if list created length 0 a dialog info m windowno this charge created list created to string if list rejected length 0 a dialog error m windowno this charge not created list rejected to string createaccount stringbuffer listcreated stringbuffer stringbuffer listrejected stringbuffer tablemodel datatable getmodel getrowcount getvalueat booleanvalue keynamepair keynamepair getvalueat c_elementvalue_id getkey getvalueat c_charge_id create_charge c_elementvalue_id c_charge_id listrejected listrejected listrejected listcreated listcreated listcreated setvalueat listcreated adialog m_windowno chargecreated listcreated tostring listrejected adialog m_windowno chargenotcreated listrejected tostring create element value for primary acct schema param value value param name name param is expense type is expense return element value private int create elementvalue string value string name boolean is expense type log config name int c elementvalue id db get nextid env get ctx c elementvalue null string buffer sql new string buffer insert into c elementvalue c elementvalue id c element id ad client id ad org id is active created created by updated updated by value name description account type account sign is doc controlled is summary valid from valid to post actual post budget post encumbrance post statistical is bank account c bankaccount id is foreign currency c currency id values c elementvalue id c element id sql append c elementvalue id append append m c element id append ad client id ad org id is active created created by updated updated by sql append m ad client id append append m ad org id sql append y sys date append m createdby append sys date append m createdby append value name description sql append append value append append name append null account type account sign sql append is expense type e r append n is doc controlled is summary sql append n n valid from valid to sql append to date 01 jan 1970 null post actual post budget post encumbrance post statistical sql append y y y y is bank account c bankaccount id is foreign currency c currency id sql append n null n null int no db execute update sql to string null if no 1 log log level severe no n sql to string c elementvalue id 0 else log config c elementvalue id c elementvalue id value name return c elementvalue id elementvalue acctschema isexpensetype create_elementvalue isexpensetype c_elementvalue_id getnextid getctx c_elementvalue stringbuffer stringbuffer c_elementvalue c_elementvalue_id c_element_id ad_client_id ad_org_id isactive createdby updatedby accounttype accountsign isdoccontrolled issummary validfrom validto postactual postbudget postencumbrance poststatistical isbankaccount c_bankaccount_id isforeigncurrency c_currency_id c_elementvalue_id c_element_id c_elementvalue_id m_c_element_id ad_client_id ad_org_id isactive createdby updatedby m_ad_client_id m_ad_org_id sysdate m_createdby sysdate m_createdby accounttype accountsign isexpensetype isdoccontrolled issummary validfrom validto to_date postactual postbudget postencumbrance poststatistical isbankaccount c_bankaccount_id isforeigncurrency c_currency_id executeupdate tostring tostring c_elementvalue_id c_elementvalue_id c_elementvalue_id c_elementvalue_id create charge and account entries for primary acct schema param name name param c elementvalue id element value return charge private int create charge string name int c elementvalue id log config name m charge charge new m charge env get ctx 0 null charge set name name charge setc taxcategory id m c taxcategory id if charge save log log level severe name not created return 0 get acct schama if m acctschema null m acctschema new m acct schema env get ctx m c acctschema id null if m acctschema null m acctschema getc acctschema id 0 return 0 target account m account default acct m account get default m acctschema true optional null m account acct m account get env get ctx charge getad client id charge getad org id m acctschema getc acctschema id c elementvalue id default acct getc subacct id default acct getm product id default acct getc bpartner id default acct getad orgtrx id default acct getc locfrom id default acct getc locto id default acct getc salesregion id default acct getc project id default acct getc campaign id default acct getc activity id default acct getuser1 id default acct getuser2 id default acct getuserelement1 id default acct getuserelement2 id if acct null return 0 update accounts string buffer sql new string buffer update c charge acct sql append set ch expense acct append acct getc validcombination id sql append ch revenue acct append acct getc validcombination id sql append where c charge id append charge getc charge id sql append and c acctschema id append m c acctschema id int no db execute update sql to string null if no 1 log log level severe update no n sql to string return charge getc charge id acctschema c_elementvalue_id create_charge c_elementvalue_id mcharge mcharge getctx setname setc_taxcategory_id m_c_taxcategory_id acctschama m_acctschema m_acctschema macctschema getctx m_c_acctschema_id m_acctschema m_acctschema getc_acctschema_id maccount defaultacct maccount getdefault m_acctschema maccount maccount getctx getad_client_id getad_org_id m_acctschema getc_acctschema_id c_elementvalue_id defaultacct getc_subacct_id defaultacct getm_product_id defaultacct getc_bpartner_id defaultacct getad_orgtrx_id defaultacct getc_locfrom_id defaultacct getc_locto_id defaultacct getc_salesregion_id defaultacct getc_project_id defaultacct getc_campaign_id defaultacct getc_activity_id defaultacct getuser1_id defaultacct getuser2_id defaultacct getuserelement1_id defaultacct getuserelement2_id stringbuffer stringbuffer c_charge_acct ch_expense_acct getc_validcombination_id ch_revenue_acct getc_validcombination_id c_charge_id getc_charge_id c_acctschema_id m_c_acctschema_id executeupdate tostring tostring getc_charge_id public colgroup sets the span attribute param span sets the span attribute public colgroup set span string span add attribute span span return this setspan addattribute sets the span attribute param span sets the span attribute public colgroup set span int span add attribute span integer to string span return this setspan addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public colgroup set width int width add attribute width integer to string width return this setwidth addattribute tostring supplies user agents with a recommended cell width pixel values param width how many pixels to make cell public colgroup set width string width add attribute width width return this setwidth addattribute sets the align attribute convience variables are provided in the align type interface param align sets the align attribute public colgroup set align string align add attribute align align return this aligntype setalign addattribute sets the valign attribute convience variables are provided in the align type interface param valign sets the valign attribute public colgroup setv align string valign add attribute valign valign return this aligntype setvalign addattribute sets the char attribute param character the character to use for alignment public colgroup set char string character add attribute char character return this setchar addattribute sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public colgroup set char off int char off add attribute charoff integer to string char off return this char_off setcharoff char_off addattribute tostring char_off sets the charoff attribute param char off when present this attribute specifies the offset of the first occurrence of the alignment character on each line public colgroup set char off string char off add attribute charoff char off return this char_off setcharoff char_off addattribute char_off sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public colgroup add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public colgroup add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public colgroup add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public colgroup add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public colgroup remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry constructor public v ovr caret super vovrcaret renders the caret as a top and button bracket param g the graphics context see damage public void paint graphics g boolean dotltr true left to right position bias dot bias position bias forward if is visible try textui mapper get component getui rectangle r mapper model to view get component get dot dot bias rectangle e mapper model to view get component get dot 1 dot bias g set color get component get caret color g set color color blue int c width e x r x int c height 4 int c thick 2 g fill rect r x 1 r y c width c thick top g fill rect r x 1 r y c thick c height g fill rect r x 1 c width r y c thick c height int y start r y r height g fill rect r x 1 y start c thick c width c thick button g fill rect r x 1 y start c height c thick c height g fill rect r x 1 c width y start c height c thick c height catch bad location exception e can t render system err println can t render cursor is visible dotbias isvisible getcomponent modeltoview getcomponent getdot dotbias modeltoview getcomponent getdot dotbias setcolor getcomponent getcaretcolor setcolor cwidth cheight cthick fillrect cwidth cthick fillrect cthick cheight fillrect cwidth cthick cheight ystart fillrect ystart cthick cwidth cthick fillrect ystart cheight cthick cheight fillrect cwidth ystart cheight cthick cheight badlocationexception isvisible damages the area surrounding the caret to cause it to be repainted in a new location this method should update the caret bounds x y width and height param r the current location of the caret see paint protected synchronized void damage rectangle r if r null x r x 4 start 4 pixles before one required y r y width 18 sufficent for standard font 18 4 14 height r height repaint minimum constructor public script editor this msg get msg env get ctx script null 0 scripteditor getmsg getctx constructor param title field name param script the script public script editor string title scriptlet script int window no super title m windowno window no if m windowno 0 m windowno env create window no this log info window m windowno try jb init set script script dyn init a env show center screen this to front catch exception ex log log level severe ex scripteditor windowno m_windowno windowno m_windowno m_windowno createwindowno m_windowno jbinit setscript dyninit aenv showcenterscreen tofront static layout throws exception void jb init throws exception this set icon image env get image bean16 gif this set default close operation j frame dispose on close titled border1 new titled border border factory create etched border color white new color 148 145 140 msg get msg env get ctx script variables titled border2 new titled border border factory create etched border color white new color 148 145 140 msg get msg env get ctx script editor main panel set layout border layout1 editor set line wrap true editor set tab size 4 editor set wrap style word true bok add action listener this b cancel add action listener this b help add action listener this b process add action listener this variables set background color light gray variables set editable false variables set content type text html variables pane set border titled border1 editor pane set border titled border2 center pane set preferred size new dimension 500 500 center pane set left component editor pane center pane set right component variables pane south panel set layout south layout result panel set layout result layout l result set text msg get msg env get ctx script result f result set background color light gray f result set editable false f result set text north panel set layout north layout l result variable set text msg get msg env get ctx script result variable f result variable set background color light gray f result variable set editable false result variable panel set layout result variable layout ok panel set layout ok layout north panel add result variable panel border layout center get content pane add main panel editor pane get viewport add editor null variables pane get viewport add variables null main panel add north panel border layout north main panel add south panel border layout south south panel add ok panel border layout east ok panel add b cancel null ok panel add bok null south panel add result panel border layout center result panel add b process new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 result panel add l result new grid bag constraints 1 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 result panel add f result new grid bag constraints 2 0 1 1 1 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 5 5 0 0 main panel add center pane border layout center result variable panel add l result variable new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 result variable panel add f result variable new grid bag constraints 1 0 1 1 1 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 5 5 5 5 0 0 north panel add help panel border layout east help panel add b help null center pane set divider location 350 jbinit seticonimage getimage setdefaultcloseoperation jframe dispose_on_close titledborder1 titledborder borderfactory createetchedborder getmsg getctx scriptvariables titledborder2 titledborder borderfactory createetchedborder getmsg getctx scripteditor mainpanel setlayout borderlayout1 setlinewrap settabsize setwrapstyleword addactionlistener bcancel addactionlistener bhelp addactionlistener bprocess addactionlistener setbackground lightgray seteditable setcontenttype variablespane setborder titledborder1 editorpane setborder titledborder2 centerpane setpreferredsize centerpane setleftcomponent editorpane centerpane setrightcomponent variablespane southpanel setlayout southlayout resultpanel setlayout resultlayout lresult settext getmsg getctx scriptresult fresult setbackground lightgray fresult seteditable fresult settext northpanel setlayout northlayout lresultvariable settext getmsg getctx scriptresultvariable fresultvariable setbackground lightgray fresultvariable seteditable resultvariablepanel setlayout resultvariablelayout okpanel setlayout oklayout northpanel resultvariablepanel borderlayout getcontentpane mainpanel editorpane getviewport variablespane getviewport mainpanel northpanel borderlayout mainpanel southpanel borderlayout southpanel okpanel borderlayout okpanel bcancel okpanel southpanel resultpanel borderlayout resultpanel bprocess gridbagconstraints gridbagconstraints gridbagconstraints resultpanel lresult gridbagconstraints gridbagconstraints gridbagconstraints resultpanel fresult gridbagconstraints gridbagconstraints gridbagconstraints mainpanel centerpane borderlayout resultvariablepanel lresultvariable gridbagconstraints gridbagconstraints gridbagconstraints resultvariablepanel fresultvariable gridbagconstraints gridbagconstraints gridbagconstraints northpanel helppanel borderlayout helppanel bhelp centerpane setdividerlocation set script param script the script public void set script scriptlet script if script null m script new scriptlet scriptlet variable env get ctx m windowno else m script script f result variable set text m script get variable m origscript m script get script editor set text m script get script string buffer sb new string buffer html body hash map string object ctx m script get environment string pp new string ctx size ctx key set to array pp arrays sort pp for int i 0 i pp length i string key pp i to string object value ctx get key sb append font color append append get color value append append append key append append value append font br sb append body html variables set text sb to string variables set caret position 0 setscript m_script getctx m_windowno m_script fresultvariable settext m_script getvariable m_origscript m_script getscript settext m_script getscript stringbuffer stringbuffer hashmap m_script getenvironment keyset toarray tostring getcolor settext tostring setcaretposition get color code param value the object return html color code private string get color object value if value instanceof string return 009900 green else if value instanceof integer return 0000ff blue else if value instanceof double return 00ffff cyan else if value instanceof timestamp return ff00ff magenta else if value instanceof boolean return ff9900 orange return ff0000 red getcolor dynamic init private void dyn init dyninit action listener param e public void action performed action event e if e get source bok dispose else if e get source b cancel m script set script m origscript dispose else if e get source b process action process else if e get source b help help h new help this msg get msg env get ctx script help get class get resource script html h set visible true actionperformed actionevent getsource getsource bcancel m_script setscript m_origscript getsource bprocess actionprocess getsource bhelp getmsg getctx scripthelp getclass getresource setvisible process script private void action process example import org compiere util db import java sql prepared statement pstmt db prepare statement select name password from ad user where name like super result set rs pstmt execute query if rs next result rs get string name password rs get string password m user user m user get env get ctx if user is administrator f result set text not administrator return m script set script editor get text exception e m script execute if e null a dialog error m windowno this script error e to string object result m script get result false f result set text result null result to string actionprocess preparedstatement preparestatement ad_user resultset executequery getstring getstring muser muser getctx isadministrator fresult settext m_script setscript gettext m_script adialog m_windowno scripterror tostring m_script getresult fresult settext tostring start script editor param header title param script script code param editable return updated script public static string start string header string script boolean editable int window no scriptlet scr new scriptlet scriptlet variable script env get ctx window no script editor se new script editor header scr window no return scr get script scripteditor scriptcode windowno getctx windowno scripteditor scripteditor windowno getscript constructor param ctx context param pa reportline id id public m report line properties ctx int pa reportline id string trx name super ctx pa reportline id trx name if pa reportline id 0 set seq no 0 set is summary false not active in dd set is printed false else load sources pa_reportline_id mreportline pa_reportline_id trxname pa_reportline_id trxname pa_reportline_id setseqno setissummary setisprinted loadsources constructor param ctx context param rs result set to load from public m report line properties ctx result set rs string trx name super ctx rs trx name load sources resultset mreportline resultset trxname trxname loadsources load contained sources private void load sources array list m report source list new array list m report source string sql select from pa reportsource where pa reportline id and is active y prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa reportline id result set rs pstmt execute query while rs next list add new m report source get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe null e finally try if pstmt null pstmt close catch exception e pstmt null m sources new m report source list size list to array m sources log finest id getpa reportline id size list size loadsources arraylist mreportsource arraylist mreportsource pa_reportsource pa_reportline_id isactive preparedstatement preparestatement get_trxname setint getpa_reportline_id resultset executequery mreportsource getctx m_sources mreportsource toarray m_sources getpa_reportline_id get sources return sources public m report source get sources return m sources mreportsource getsources m_sources list info public void list system out println to string if m sources null return for int i 0 i m sources length i system out println m sources i to string tostring m_sources m_sources m_sources tostring get source column name return source column name public string get source column name string column name null for int i 0 i m sources length i string col m acct schema element get column name m sources i get element type if column name null column name length 0 column name col else if column name equals col log config more than one column name col return null return column name columnname getsourcecolumnname columnname m_sources macctschemaelement getcolumnname m_sources getelementtype columnname columnname columnname columnname columnname columnname get value query for segment type return query for first source element or null public string get source value query if m sources null m sources length 0 return m acct schema element get value query m sources 0 get element type return null getsourcevaluequery m_sources m_sources macctschemaelement getvaluequery m_sources getelementtype get sql select clause param with sum with sum function return select clause amt acctcr amt acctdr etc or null if not defined public string get select clause boolean with sum string at get amount type substring 0 1 first letter string buffer sb new string buffer if with sum sb append sum if amounttype balance equals at sb append amt acct dr amt acct cr sb append acct balance account id amt acct dr amt acct cr else if amounttype cr equals at sb append amt acct cr else if amounttype dr equals at sb append amt acct dr else if amounttype qty equals at sb append qty else log log level severe amount type get amount type at at return null if with sum sb append return sb to string withsum amtacctcr amtacctdr getselectclause withsum getamounttype stringbuffer stringbuffer withsum amounttype_balance amtacctdr amtacctcr acctbalance account_id amtacctdr amtacctcr amounttype_cr amtacctcr amounttype_dr amtacctdr amounttype_qty amounttype getamounttype withsum tostring is it period return true if period amount type public boolean is period string at get amount type if at null return false return amounttype periodbalance equals at amounttype periodcreditonly equals at amounttype perioddebitonly equals at amounttype periodquantity equals at isperiod getamounttype amounttype_periodbalance amounttype_periodcreditonly amounttype_perioddebitonly amounttype_periodquantity is it year return true if year amount type public boolean is year string at get amount type if at null return false return amounttype yearbalance equals at amounttype yearcreditonly equals at amounttype yeardebitonly equals at amounttype yearquantity equals at isyear getamounttype amounttype_yearbalance amounttype_yearcreditonly amounttype_yeardebitonly amounttype_yearquantity is it total return true if year amount type public boolean is total string at get amount type if at null return false return amounttype totalbalance equals at amounttype totalcreditonly equals at amounttype totaldebitonly equals at amounttype totalquantity equals at istotal getamounttype amounttype_totalbalance amounttype_totalcreditonly amounttype_totaldebitonly amounttype_totalquantity get sql where clause sources posting type param pa hierarchy id hierarchy return where clause public string get where clause int pa hierarchy id if m sources null return if m whereclause null only one if m sources length 0 m whereclause else if m sources length 1 m whereclause m sources 0 get where clause pa hierarchy id else multiple string buffer sb new string buffer for int i 0 i m sources length i if i 0 sb append or sb append m sources i get where clause pa hierarchy id sb append m whereclause sb to string posting type string posting type get posting type if posting type null posting type length 0 if m whereclause length 0 m whereclause and m whereclause posting type posting type log fine m whereclause return m whereclause pa_hierarchy_id getwhereclause pa_hierarchy_id m_sources m_whereclause m_sources m_whereclause m_sources m_whereclause m_sources getwhereclause pa_hierarchy_id stringbuffer stringbuffer m_sources m_sources getwhereclause pa_hierarchy_id m_whereclause tostring postingtype getpostingtype postingtype postingtype m_whereclause m_whereclause m_whereclause postingtype postingtype m_whereclause m_whereclause has posting type return true if posting public boolean is posting type string posting type get posting type return posting type null posting type length 0 ispostingtype postingtype getpostingtype postingtype postingtype string representation return info public string to string string buffer sb new string buffer m report line append get id append append get name append append get description append seq no append get seq no append amount type append get amount type append line type append get line type if is line type calculation sb append calculation append get calculation type append append getoper 1 id append append getoper 2 id else segment value sb append segment value posting type append get posting type append amount type append get amount type sb append return sb to string tostring stringbuffer stringbuffer mreportline get_id getname getdescription seqno getseqno amounttype getamounttype linetype getlinetype islinetypecalculation getcalculationtype getoper_1_id getoper_2_id segmentvalue segmentvalue postingtype getpostingtype amounttype getamounttype tostring public boolean is line type calculation return linetype calculation equals get line type islinetypecalculation linetype_calculation getlinetype return linetype calculation equals get line type public boolean is line type segment value return linetype segmentvalue equals get line type linetype_calculation getlinetype islinetypesegmentvalue linetype_segmentvalue getlinetype public boolean is calculation type range return calculationtype addrangeop1toop2 equals get calculation type iscalculationtyperange calculationtype_addrangeop1toop2 getcalculationtype return calculationtype addrangeop1toop2 equals get calculation type public boolean is calculation type add return calculationtype addop1plusop2 equals get calculation type calculationtype_addrangeop1toop2 getcalculationtype iscalculationtypeadd calculationtype_addop1plusop2 getcalculationtype return calculationtype addop1plusop2 equals get calculation type public boolean is calculation type subtract return calculationtype subtractop1 op2 equals get calculation type calculationtype_addop1plusop2 getcalculationtype iscalculationtypesubtract calculationtype_subtractop1_op2 getcalculationtype return calculationtype subtractop1 op2 equals get calculation type public boolean is calculation type percent return calculationtype percentageop1ofop2 equals get calculation type calculationtype_subtractop1_op2 getcalculationtype iscalculationtypepercent calculationtype_percentageop1ofop2 getcalculationtype before save param new record new return true protected boolean before save boolean new record if linetype segmentvalue equals get line type if get calculation type null set calculation type null if getoper 1 id 0 setoper 1 id 0 if getoper 2 id 0 setoper 2 id 0 return true newrecord beforesave newrecord linetype_segmentvalue getlinetype getcalculationtype setcalculationtype getoper_1_id setoper_1_id getoper_2_id setoper_2_id copy param ctx context param ad client id parent param ad org id parent param pa reportlineset id parent param source copy source return report line public static m report line copy properties ctx int ad client id int ad org id int pa reportlineset id m report line source string trx name m report line ret value new m report line ctx 0 trx name m report line copy values source ret value ad client id ad org id ret value setpa reportlineset id pa reportlineset id ret value setoper 1 id 0 ret value setoper 2 id 0 return ret value ad_client_id ad_org_id pa_reportlineset_id mreportline ad_client_id ad_org_id pa_reportlineset_id mreportline trxname mreportline retvalue mreportline trxname mreportline copyvalues retvalue ad_client_id ad_org_id retvalue setpa_reportlineset_id pa_reportlineset_id retvalue setoper_1_id retvalue setoper_2_id retvalue standard constructor public x i order properties ctx int i order id string trx name super ctx i order id trx name if i order id 0 seti isimported false seti order id 0 x_i_order i_order_id trxname i_order_id trxname i_order_id seti_isimported seti_order_id load constructor public x i order properties ctx result set rs string trx name super ctx rs trx name x_i_order resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x i order append get id append return sb to string tostring stringbuffer stringbuffer x_i_order get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set address 1 address line 1 for this location public void set address1 string address1 if address1 null address1 length 60 log warning length 60 truncated address1 address1 substring 0 59 set value address1 address1 setaddress1 set_value get address 1 address line 1 for this location public string get address1 return string get value address1 getaddress1 get_value set address 2 address line 2 for this location public void set address2 string address2 if address2 null address2 length 60 log warning length 60 truncated address2 address2 substring 0 59 set value address2 address2 setaddress2 set_value get address 2 address line 2 for this location public string get address2 return string get value address2 getaddress2 get_value set business partner key key of the business partner public void setb partner value string b partner value if b partner value null b partner value length 40 log warning length 40 truncated b partner value b partner value substring 0 39 set value b partner value b partner value setbpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue bpartnervalue set_value bpartnervalue bpartnervalue get business partner key key of the business partner public string getb partner value return string get value b partner value getbpartnervalue get_value bpartnervalue public static final int billto id ad reference id 159 set invoice to bill to address public void setbillto id int billto id if billto id 0 set value billto id null else set value billto id new integer billto id billto_id_ad_reference_id setbillto_id billto_id billto_id set_value billto_id set_value billto_id billto_id get invoice to bill to address public int getbillto id integer ii integer get value billto id if ii null return 0 return ii int value getbillto_id get_value billto_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 0 set value c bpartner location id null else set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id set_value c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set country country public void setc country id int c country id if c country id 0 set value c country id null else set value c country id new integer c country id setc_country_id c_country_id c_country_id set_value c_country_id set_value c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set document type document type or rules public void setc doctype id int c doctype id if c doctype id 0 set value c doctype id null else set value c doctype id new integer c doctype id setc_doctype_id c_doctype_id c_doctype_id set_value c_doctype_id set_value c_doctype_id c_doctype_id get document type document type or rules public int getc doctype id integer ii integer get value c doctype id if ii null return 0 return ii int value getc_doctype_id get_value c_doctype_id intvalue set address location or address public void setc location id int c location id if c location id 0 set value c location id null else set value c location id new integer c location id setc_location_id c_location_id c_location_id set_value c_location_id set_value c_location_id c_location_id get address location or address public int getc location id integer ii integer get value c location id if ii null return 0 return ii int value getc_location_id get_value c_location_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set value c orderline id null else set value c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_value c_orderline_id set_value c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set order order public void setc order id int c order id if c order id 0 set value c order id null else set value c order id new integer c order id setc_order_id c_order_id c_order_id set_value c_order_id set_value c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 0 set value c paymentterm id null else set value c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id set_value c_paymentterm_id set_value c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set value c region id null else set value c region id new integer c region id setc_region_id c_region_id c_region_id set_value c_region_id set_value c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 0 set value c tax id null else set value c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id set_value c_tax_id set_value c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 0 set value c uom id null else set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id set_value c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set city identifies a city public void set city string city if city null city length 60 log warning length 60 truncated city city substring 0 59 set value city city setcity set_value get city identifies a city public string get city return string get value city getcity get_value set contact name business partner contact name public void set contact name string contact name if contact name null contact name length 60 log warning length 60 truncated contact name contact name substring 0 59 set value contact name contact name setcontactname contactname contactname contactname contactname contactname set_value contactname contactname get contact name business partner contact name public string get contact name return string get value contact name getcontactname get_value contactname set iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public void set country code string country code if country code null country code length 2 log warning length 2 truncated country code country code substring 0 1 set value country code country code iso_3166 setcountrycode countrycode countrycode countrycode countrycode countrycode set_value countrycode countrycode get iso country code upper case two letter alphanumeric iso country code according to iso 3166 1 http www chemie fu berlin de diverse doc iso 3166 html public string get country code return string get value country code iso_3166 getcountrycode get_value countrycode set account date accounting date public void set date acct timestamp date acct set value date acct date acct setdateacct dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set date ordered date of order public void set date ordered timestamp date ordered set value date ordered date ordered setdateordered dateordered set_value dateordered dateordered get date ordered date of order public timestamp get date ordered return timestamp get value date ordered getdateordered get_value dateordered set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set document type name name of the document type public void set doc type name string doc type name if doc type name null doc type name length 60 log warning length 60 truncated doc type name doc type name substring 0 59 set value doc type name doc type name setdoctypename doctypename doctypename doctypename doctypename doctypename set_value doctypename doctypename get document type name name of the document type public string get doc type name return string get value doc type name getdoctypename get_value doctypename set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set value e mail e mail email setemail email email email email email set_value email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set freight amount freight amount public void set freight amt big decimal freight amt set value freight amt freight amt setfreightamt bigdecimal freightamt set_value freightamt freightamt get freight amount freight amount public big decimal get freight amt big decimal bd big decimal get value freight amt if bd null return env zero return bd bigdecimal getfreightamt bigdecimal bigdecimal get_value freightamt set import error message messages generated from import process public void seti errormsg string i errormsg if i errormsg null i errormsg length 2000 log warning length 2000 truncated i errormsg i errormsg substring 0 1999 set value i errormsg i errormsg seti_errormsg i_errormsg i_errormsg i_errormsg i_errormsg i_errormsg set_value i_errormsg i_errormsg get import error message messages generated from import process public string geti errormsg return string get value i errormsg geti_errormsg get_value i_errormsg set imported has this import been processed public void seti isimported boolean i isimported set value i isimported new boolean i isimported seti_isimported i_isimported set_value i_isimported i_isimported get imported has this import been processed public boolean isi isimported object oo get value i isimported if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isi_isimported get_value i_isimported booleanvalue set import order import orders public void seti order id int i order id if i order id 1 throw new illegal argument exception i order id is mandatory set valuenocheck i order id new integer i order id seti_order_id i_order_id i_order_id illegalargumentexception i_order_id set_valuenocheck i_order_id i_order_id get import order import orders public int geti order id integer ii integer get value i order id if ii null return 0 return ii int value geti_order_id get_value i_order_id intvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set line description description of the line public void set line description string line description if line description null line description length 255 log warning length 255 truncated line description line description substring 0 254 set value line description line description setlinedescription linedescription linedescription linedescription linedescription linedescription set_value linedescription linedescription get line description description of the line public string get line description return string get value line description getlinedescription get_value linedescription set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set value m pricelist id null else set value m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_value m_pricelist_id set_value m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 0 set value m shipper id null else set value m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id set_value m_shipper_id set_value m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 0 set value m warehouse id null else set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id set_value m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set payment term key key of the payment term public void set payment term value string payment term value if payment term value null payment term value length 40 log warning length 40 truncated payment term value payment term value substring 0 39 set value payment term value payment term value setpaymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue paymenttermvalue set_value paymenttermvalue paymenttermvalue get payment term key key of the payment term public string get payment term value return string get value payment term value getpaymenttermvalue get_value paymenttermvalue set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set value phone phone setphone set_value get phone identifies a telephone number public string get phone return string get value phone getphone get_value set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set value postal postal setpostal set_value get zip postal code public string get postal return string get value postal getpostal get_value set unit price actual price public void set price actual big decimal price actual set value price actual price actual setpriceactual bigdecimal priceactual set_value priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set product key key of the product public void set product value string product value if product value null product value length 40 log warning length 40 truncated product value product value substring 0 39 set value product value product value setproductvalue productvalue productvalue productvalue productvalue productvalue set_value productvalue productvalue get product key key of the product public string get product value return string get value product value getproductvalue get_value productvalue set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered set value qty ordered qty ordered setqtyordered bigdecimal qtyordered set_value qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set region name of the region public void set region name string region name if region name null region name length 60 log warning length 60 truncated region name region name substring 0 59 set value region name region name setregionname regionname regionname regionname regionname regionname set_value regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set value sku sku set_value get sku stock keeping unit public string getsku return string get value sku get_value public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set value salesrep id null else set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_value salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set tax amount tax amount for a document public void set tax amt big decimal tax amt set value tax amt tax amt settaxamt bigdecimal taxamt set_value taxamt taxamt get tax amount tax amount for a document public big decimal get tax amt big decimal bd big decimal get value tax amt if bd null return env zero return bd bigdecimal gettaxamt bigdecimal bigdecimal get_value taxamt set tax indicator short form for tax to be printed on documents public void set tax indicator string tax indicator if tax indicator null tax indicator length 5 log warning length 5 truncated tax indicator tax indicator substring 0 4 set value tax indicator tax indicator settaxindicator taxindicator taxindicator taxindicator taxindicator taxindicator set_value taxindicator taxindicator get tax indicator short form for tax to be printed on documents public string get tax indicator return string get value tax indicator gettaxindicator get_value taxindicator set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set value upc upc set_value get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value prepare protected void prepare m ad issue id getrecord id m_ad_issue_id getrecord_id do it return info throws exception protected string do it throws exception log info ad issue id m ad issue id if m system get get ctx is auto error report return not reported enable error reporting in window system m issue issue new m issue get ctx m ad issue id get trxname if issue get id 0 return no issue to report id m ad issue id string error issue report if error null throw new compiere system error error if issue save return issue reported issue get request document no throw new compiere system error issue not saved doit ad_issue_id m_ad_issue_id msystem getctx isautoerrorreport missue missue getctx m_ad_issue_id get_trxname get_id m_ad_issue_id compieresystemerror getrequestdocumentno compieresystemerror amtinwords en public amtinwords en super amtinwords_en amtinwords_en convert less than one thousand param number return amt private string convert less than one thousand int number string so far below 20 if number 100 20 so far num names number 100 number 100 else so far num names number 10 number 10 so far tens names number 10 so far number 10 if number 0 return so far return num names number hundred so far convertlessthanonethousand sofar sofar numnames sofar numnames sofar tensnames sofar sofar numnames sofar convert param number return amt private string convert long number special case if number 0 return zero string prefix if number 0 number number prefix negative string so far int place 0 do long n number 1000 if n 0 string s convert less than one thousand int n so far s major names place so far place number 1000 while number 0 return prefix so far trim sofar convertlessthanonethousand sofar majornames sofar sofar get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 public string get amt in words string amount throws exception if amount null return amount string buffer sb new string buffer int pos amount last index of int pos2 amount last index of if pos2 pos pos pos2 string oldamt amount amount amount replace all int newpos amount last index of long dollars long parse long amount substring 0 newpos sb append convert dollars for int i 0 i oldamt length i if pos i we are done string cents oldamt substring i 1 sb append append cents append 100 break return sb to string getamtinwords stringbuffer stringbuffer lastindexof lastindexof replaceall lastindexof parselong tostring test print param amt amount private void print string amt try system out println amt get amt in words amt catch exception e e print stack trace getamtinwords printstacktrace test param args ignored public static void main string args amtinwords en aiw new amtinwords en aiw print 23 error aiw print 0 23 aiw print 1 23 aiw print 12 345 aiw print 123 45 aiw print 1234 56 aiw print 12345 78 aiw print 123457 89 aiw print 1 234 578 90 amtinwords_en amtinwords_en construct key value pair param value value param name string representation public value name pair string value string name super name m value value if m value null m value keyvalue valuenamepair m_value m_value m_value get value return value public string get value return m value getvalue m_value get id return value public string getid return m value m_value equals param obj object return true if equal public boolean equals object obj if obj instanceof value name pair value name pair pp value name pair obj if pp get name null pp get value null pp get name equals get name pp get value equals m value return true return false return false valuenamepair valuenamepair valuenamepair getname getvalue getname getname getvalue m_value return hashcode of value return hascode public int hash code return m value hash code hashcode m_value hashcode prepare protected void prepare p c landedcost id getrecord id p_c_landedcost_id getrecord_id process return info throws exception protected string do it throws exception m lc new m landed cost get ctx p c landedcost id get trxname log info m lc to string if m lc get id 0 throw new compiere user error not found c landedcost id p c landedcost id string error m lc allocate costs if error null error length 0 return ok return error doit m_lc mlandedcost getctx p_c_landedcost_id get_trxname m_lc tostring m_lc get_id compiereusererror notfound c_landedcost_id p_c_landedcost_id m_lc allocatecosts get content return content public object get contents return contents getcontents main test param args public static void main string args try load the jdbc driver driver manager register driver new org postgresql driver s ctype c multiple statement timing statement timing statement timing s fetchsize 10 standard value s ctype c shared s do yield false run test run test s do yield true run test run test s ctype c multiple s do yield false run test run test s do yield true run test run test s ctype c precreated s do yield false run test run test s do yield true run test run test catch exception e e print stack trace drivermanager registerdriver s_ctype c_multiple statementtiming statementtiming statementtiming s_fetchsize s_ctype c_shared s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_multiple s_do_yield runtest runtest s_do_yield runtest runtest s_ctype c_precreated s_do_yield runtest runtest s_do_yield runtest runtest printstacktrace run the test throws exception static void run test throws exception create the threads thread thread list new thread num of threads s conn new connection num of threads if s ctype c shared s sconn driver manager get connection connection uid pwd spawn threads for int i 0 i num of threads i if with output system out println starting i if s ctype c precreated s conn i driver manager get connection connection uid pwd thread list i new jdbc testpg i thread list i start start everyone at the same time long start system current time millis set green light wait for all threads to end for int i 0 i num of threads i thread list i join if s sconn null s sconn close s sconn null for int i 0 i num of threads i if s conn i null s conn i close s conn i null long result system current time millis start system out print c info s ctype threads num of threads t yield s do yield tms result teach result num of threads system out println runtest threadlist num_of_threads s_conn num_of_threads s_ctype c_shared s_sconn drivermanager getconnection num_of_threads with_output s_ctype c_precreated s_conn drivermanager getconnection threadlist jdbctestpg threadlist currenttimemillis setgreenlight num_of_threads threadlist s_sconn s_sconn s_sconn num_of_threads s_conn s_conn s_conn currenttimemillis c_info s_ctype num_of_threads tyield s_do_yield num_of_threads statement timing private static void statement timing try long start connection system current time millis connection conn null if s ctype c multiple conn driver manager get connection connection uid pwd long start statement system current time millis statement stmt conn create statement stmt set fetch size s fetchsize long start query system current time millis result set rs stmt execute query statement int i 0 long start retrieve system current time millis while rs next rs get string 1 i long end retrieve system current time millis system out println i rs close rs null long end query system current time millis stmt close stmt null long end statement system current time millis conn close conn null long end connection system current time millis system out println c info s ctype fetch s fetchsize t conn start statement start connection t stmt start query start statement t query start retrieve start query t retrieve end retrieve start retrieve t cl rs end query end retrieve t cl stmt end statement end query t cl conn end connection end statement t total end connection start connection t stmt end statement start statement t query end query start query catch sql exception e e print stack trace statementtiming startconnection currenttimemillis s_ctype c_multiple drivermanager getconnection startstatement currenttimemillis createstatement setfetchsize s_fetchsize startquery currenttimemillis resultset executequery startretrieve currenttimemillis getstring endretrieve currenttimemillis endquery currenttimemillis endstatement currenttimemillis endconnection currenttimemillis c_info s_ctype s_fetchsize tconn startstatement startconnection tstmt startquery startstatement tquery startretrieve startquery tretrieve endretrieve startretrieve tclrs endquery endretrieve tclstmt endstatement endquery tclconn endconnection endstatement endconnection startconnection tstmt endstatement startstatement tquery endquery startquery sqlexception printstacktrace jdbc test thread param id thread id public jdbc testpg int id super m myid id jdbctest jdbctestpg m_myid async worker public void run result set rs null statement stmt null try if with output system out println thread m myid waiting while get green light yield if with output system out println thread m myid started get the connection statement if s ctype c shared stmt s sconn create statement else if s ctype c multiple s conn m myid driver manager get connection connection uid pwd stmt s conn m myid create statement else if s ctype c precreated stmt s conn m myid create statement stmt set fetch size s fetchsize execute the query rs stmt execute query statement loop through the results while rs next if s do yield yield yield to other threads close all the resources rs close rs null close the statement stmt close stmt null close the local connection if s ctype c shared s ctype c precreated else s conn m myid close s conn m myid null catch exception e system out println thread m myid got exception e e print stack trace return if with output system out println thread m myid finished resultset with_output m_myid getgreenlight with_output m_myid s_ctype c_shared s_sconn createstatement s_ctype c_multiple s_conn m_myid drivermanager getconnection s_conn m_myid createstatement s_ctype c_precreated s_conn m_myid createstatement setfetchsize s_fetchsize executequery s_do_yield s_ctype c_shared s_ctype c_precreated s_conn m_myid s_conn m_myid m_myid printstacktrace with_output m_myid static boolean green light false static synchronized void set green light green light true greenlight setgreenlight greenlight static boolean green light false static synchronized void set green light green light true synchronized boolean get green light return green light greenlight setgreenlight greenlight getgreenlight greenlight prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals c order id p c order id big decimal para i get parameter int value else if name equals c invoice id p c invoice id big decimal para i get parameter int value else log log level severe prepare unknown parameter name processinfoparameter getparameter getparametername getparameter c_order_id p_c_order_id bigdecimal getparameter intvalue c_invoice_id p_c_invoice_id bigdecimal getparameter intvalue perrform process return message clear text throws exception if not successful protected string do it throws exception log info c order id p c order id c invoice id p c invoice id if p c order id 0 p c invoice id 0 throw new illegal argument exception nothing to do string ret value if p c order id 0 m order order new m order get ctx p c order id get trxname big decimal old price order get grand total m order line lines order get lines for int i 0 i lines length i lines i set price order getm pricelist id lines i save order new m order get ctx p c order id get trxname big decimal new price order get grand total ret value order get document no old price new price if p c invoice id 0 m invoice invoice new m invoice get ctx p c invoice id null big decimal old price invoice get grand total m invoice line lines invoice get lines false for int i 0 i lines length i lines i set price invoice getm pricelist id invoice getc bpartner id lines i save invoice new m invoice get ctx p c invoice id null big decimal new price invoice get grand total if ret value length 0 ret value env nl ret value invoice get document no old price new price return ret value doit c_order_id p_c_order_id c_invoice_id p_c_invoice_id p_c_order_id p_c_invoice_id illegalargumentexception retvalue p_c_order_id morder morder getctx p_c_order_id get_trxname bigdecimal oldprice getgrandtotal morderline getlines setprice getm_pricelist_id morder getctx p_c_order_id get_trxname bigdecimal newprice getgrandtotal retvalue getdocumentno oldprice newprice p_c_invoice_id minvoice minvoice getctx p_c_invoice_id bigdecimal oldprice getgrandtotal minvoiceline getlines setprice getm_pricelist_id getc_bpartner_id minvoice getctx p_c_invoice_id bigdecimal newprice getgrandtotal retvalue retvalue retvalue getdocumentno oldprice newprice retvalue standard constructor public x c cash properties ctx int c cash id string trx name super ctx c cash id trx name if c cash id 0 set beginning balance env zero setc cashbook id 0 setc cash id 0 set date acct new timestamp system current time millis date set doc action null co set doc status null dr set ending balance env zero set is approved false set name null date set posted false n set processed false set statement date new timestamp system current time millis date x_c_cash c_cash_id trxname c_cash_id trxname c_cash_id setbeginningbalance setc_cashbook_id setc_cash_id setdateacct currenttimemillis setdocaction setdocstatus setendingbalance setisapproved setname setposted setprocessed setstatementdate currenttimemillis load constructor public x c cash properties ctx result set rs string trx name super ctx rs trx name x_c_cash resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c cash append get id append return sb to string tostring stringbuffer stringbuffer x_c_cash get_id tostring public static final int ad orgtrx id ad reference id 130 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set value ad orgtrx id null else set value ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_value ad_orgtrx_id set_value ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set beginning balance balance prior to any transactions public void set beginning balance big decimal beginning balance if beginning balance null throw new illegal argument exception beginning balance is mandatory set value beginning balance beginning balance setbeginningbalance bigdecimal beginningbalance beginningbalance illegalargumentexception beginningbalance set_value beginningbalance beginningbalance get beginning balance balance prior to any transactions public big decimal get beginning balance big decimal bd big decimal get value beginning balance if bd null return env zero return bd bigdecimal getbeginningbalance bigdecimal bigdecimal get_value beginningbalance set activity business activity public void setc activity id int c activity id if c activity id 0 set value c activity id null else set value c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_value c_activity_id set_value c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set campaign marketing campaign public void setc campaign id int c campaign id if c campaign id 0 set value c campaign id null else set value c campaign id new integer c campaign id setc_campaign_id c_campaign_id c_campaign_id set_value c_campaign_id set_value c_campaign_id c_campaign_id get campaign marketing campaign public int getc campaign id integer ii integer get value c campaign id if ii null return 0 return ii int value getc_campaign_id get_value c_campaign_id intvalue set cash book cash book for recording petty cash transactions public void setc cashbook id int c cashbook id if c cashbook id 1 throw new illegal argument exception c cashbook id is mandatory set valuenocheck c cashbook id new integer c cashbook id setc_cashbook_id c_cashbook_id c_cashbook_id illegalargumentexception c_cashbook_id set_valuenocheck c_cashbook_id c_cashbook_id get cash book cash book for recording petty cash transactions public int getc cashbook id integer ii integer get value c cashbook id if ii null return 0 return ii int value getc_cashbook_id get_value c_cashbook_id intvalue set cash journal cash journal public void setc cash id int c cash id if c cash id 1 throw new illegal argument exception c cash id is mandatory set valuenocheck c cash id new integer c cash id setc_cash_id c_cash_id c_cash_id illegalargumentexception c_cash_id set_valuenocheck c_cash_id c_cash_id get cash journal cash journal public int getc cash id integer ii integer get value c cash id if ii null return 0 return ii int value getc_cash_id get_value c_cash_id intvalue set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set account date accounting date public void set date acct timestamp date acct if date acct null throw new illegal argument exception date acct is mandatory set value date acct date acct setdateacct dateacct dateacct illegalargumentexception dateacct set_value dateacct dateacct get account date accounting date public timestamp get date acct return timestamp get value date acct getdateacct get_value dateacct set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string docaction unlock xl set document action the targeted status of the document public void set doc action string doc action if doc action null throw new illegal argument exception doc action is mandatory if doc action equals doc action equals ap doc action equals cl doc action equals co doc action equals in doc action equals po doc action equals pr doc action equals ra doc action equals rc doc action equals re doc action equals rj doc action equals vo doc action equals wc doc action equals xl else throw new illegal argument exception doc action invalid value doc action reference id 135 ap cl co in po pr ra rc re rj vo wc xl if doc action length 2 log warning length 2 truncated doc action doc action substring 0 1 set value doc action doc action docaction_unlock setdocaction docaction docaction illegalargumentexception docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction docaction illegalargumentexception docaction docaction reference_id docaction docaction docaction set_value docaction docaction get document action the targeted status of the document public string get doc action return string get value doc action getdocaction get_value docaction public static final string docstatus waitingpayment wp set document status the current status of the document public void set doc status string doc status if doc status null throw new illegal argument exception doc status is mandatory if doc status equals doc status equals ap doc status equals cl doc status equals co doc status equals dr doc status equals in doc status equals ip doc status equals na doc status equals re doc status equals vo doc status equals wc doc status equals wp else throw new illegal argument exception doc status invalid value doc status reference id 131 ap cl co dr in ip na re vo wc wp if doc status length 2 log warning length 2 truncated doc status doc status substring 0 1 set value doc status doc status docstatus_waitingpayment setdocstatus docstatus docstatus illegalargumentexception docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus docstatus illegalargumentexception docstatus docstatus reference_id docstatus docstatus docstatus set_value docstatus docstatus get document status the current status of the document public string get doc status return string get value doc status getdocstatus get_value docstatus set ending balance ending or closing balance public void set ending balance big decimal ending balance if ending balance null throw new illegal argument exception ending balance is mandatory set value ending balance ending balance setendingbalance bigdecimal endingbalance endingbalance illegalargumentexception endingbalance set_value endingbalance endingbalance get ending balance ending or closing balance public big decimal get ending balance big decimal bd big decimal get value ending balance if bd null return env zero return bd bigdecimal getendingbalance bigdecimal bigdecimal get_value endingbalance set approved indicates if this document requires approval public void set is approved boolean is approved set value is approved new boolean is approved setisapproved isapproved set_value isapproved isapproved get approved indicates if this document requires approval public boolean is approved object oo get value is approved if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isapproved get_value isapproved booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set posted posting status public void set posted boolean posted set value posted new boolean posted setposted set_value get posted posting status public boolean is posted object oo get value posted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isposted get_value booleanvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set statement date date of the statement public void set statement date timestamp statement date if statement date null throw new illegal argument exception statement date is mandatory set value statement date statement date setstatementdate statementdate statementdate illegalargumentexception statementdate set_value statementdate statementdate get statement date date of the statement public timestamp get statement date return timestamp get value statement date getstatementdate get_value statementdate set statement difference difference between statement ending balance and actual ending balance public void set statement difference big decimal statement difference set value statement difference statement difference setstatementdifference bigdecimal statementdifference set_value statementdifference statementdifference get statement difference difference between statement ending balance and actual ending balance public big decimal get statement difference big decimal bd big decimal get value statement difference if bd null return env zero return bd bigdecimal getstatementdifference bigdecimal bigdecimal get_value statementdifference public static final int user1 id ad reference id 134 set user list 1 user defined list element 1 public void setuser1 id int user1 id if user1 id 0 set value user1 id null else set value user1 id new integer user1 id user1_id_ad_reference_id setuser1_id user1_id user1_id set_value user1_id set_value user1_id user1_id get user list 1 user defined list element 1 public int getuser1 id integer ii integer get value user1 id if ii null return 0 return ii int value getuser1_id get_value user1_id intvalue public static final int user2 id ad reference id 137 set user list 2 user defined list element 2 public void setuser2 id int user2 id if user2 id 0 set value user2 id null else set value user2 id new integer user2 id user2_id_ad_reference_id setuser2_id user2_id user2_id set_value user2_id set_value user2_id user2_id get user list 2 user defined list element 2 public int getuser2 id integer ii integer get value user2 id if ii null return 0 return ii int value getuser2_id get_value user2_id intvalue replace string values param value string to be processed param old part old part param new part replacement can be null or return string with replaced values public static string replace string value string old part string new part if value null value length 0 old part null old part length 0 return value int old part length old part length string old value value string buffer ret value new string buffer int pos old value index of old part while pos 1 ret value append old value substring 0 pos if new part null new part length 0 ret value append new part old value old value substring pos old part length pos old value index of old part ret value append old value log fine env replace value old old part new new part result ret value to string return ret value to string oldpart newpart oldpart newpart oldpart oldpart oldpartlength oldpart oldvalue stringbuffer retvalue stringbuffer oldvalue indexof oldpart retvalue oldvalue newpart newpart retvalue newpart oldvalue oldvalue oldpartlength oldvalue indexof oldpart retvalue oldvalue oldpart newpart retvalue tostring retvalue tostring remove cr lf from string param in input return cleaned string public static string removecrlf string in char in array in to char array string buffer out new string buffer in array length for int i 0 i in array length i char c in array i if c n c r else out append c return out to string inarray tochararray stringbuffer stringbuffer inarray inarray inarray tostring mask html content i e replace characters with values param content content return masked content public static string maskhtml string content if content null content length 0 content equals return nbsp string buffer out new string buffer char chars content to char array for int i 0 i chars length i char c chars i switch c case out append lt break case out append gt break case out append amp break case out append quot break case out append 039 break default int ii int c if ii 255 write unicode out append append ii append else out append c break return out to string stringbuffer stringbuffer tochararray tostring get the number of occurances of count char in string param string string to be searched param count char to be counted character return number of occurances public static int get count string string char count char if string null string length 0 return 0 int counter 0 char array string to char array for int i 0 i array length i if array i count char counter return counter countchar countchar getcount countchar tochararray countchar is string empty param str string return true if 1 char public static boolean is empty string str return str null str length 0 isempty find index of search character in str this ignores content in and texts param str string param search search character return index or 1 if not found public static int find index of string str char search return find index of str search search findindexof findindexof find index of search characters in str this ignores content in and texts param str string param search1 first search character param search2 second search character or return index or 1 if not found public static int find index of string str char search1 char search2 if str null return 1 int end index 1 int par count 0 boolean ignoring text false int size str length while end index size char c str char at end index if c ignoring text ignoring text else if ignoring text if par count 0 c search1 c search2 return end index else if c par count else if c par count return 1 findindexof endindex parcount ignoringtext endindex charat endindex ignoringtext ignoringtext ignoringtext parcount endindex parcount parcount find index of search character in str this ignores content in and texts param str string param search search character return index or 1 if not found public static int find index of string str string search if str null search null search length 0 return 1 int end index 1 int par count 0 boolean ignoring text false int size str length while end index size char c str char at end index if c ignoring text ignoring text else if ignoring text if par count 0 c search char at 0 if str substring end index starts with search return end index else if c par count else if c par count return 1 findindexof endindex parcount ignoringtext endindex charat endindex ignoringtext ignoringtext ignoringtext parcount charat endindex startswith endindex parcount parcount return hex string representation of byte b param b byte return hex static public string to hex byte b char hex digit 0 1 2 3 4 5 6 7 8 9 a b c d e f char array hex digit b 4 0x0f hex digit b 0x0f return new string array tohex hexdigit hexdigit hexdigit return hex string representation of char c param c character return hex static public string to hex char c byte hi byte c 8 byte lo byte c 0xff return to hex hi to hex lo tohex tohex tohex init cap words with spaces param in string return init cap public static string init cap string in if in null in length 0 return in boolean capitalize true char data in to char array for int i 0 i data length i if data i character is whitespace data i capitalize true else if capitalize data i character to upper case data i capitalize false else data i character to lower case data i return new string data initcap tochararray iswhitespace touppercase tolowercase return a iterator with only the relevant attributes fixes implementation in attributed string which returns everything param a string attributed string param relevant attributes relevant attributes return iterator static public attributed character iterator get iterator attributed string a string attributed character iterator attribute relevant attributes attributed character iterator iter a string get iterator set set iter get all attribute keys system out println all attribute keys set if set size 0 return iter check if there are unwanted attributes set attributed character iterator attribute unwanted new hash set attributed character iterator attribute iter get all attribute keys for int i 0 i relevant attributes length i unwanted remove relevant attributes i if unwanted size 0 return iter create new string string buffer sb new string buffer for char c iter first c attributed character iterator done c iter next sb append c a string new attributed string sb to string copy relevant attributes iterator it iter get all attribute keys iterator while it has next attributed character iterator attribute att attributed character iterator attribute it next if unwanted contains att for char c iter first c attributed character iterator done c iter next object value iter get attribute att if value null int start iter get run start att int limit iter get run limit att system out println attribute att value value start start limit limit a string add attribute att value start limit iter set index limit else system out println unwanted att return a string get iterator attributedstring astring relevantattributes attributedcharacteriterator getiterator attributedstring astring attributedcharacteriterator relevantattributes attributedcharacteriterator astring getiterator getallattributekeys allattributekeys attributedcharacteriterator hashset attributedcharacteriterator getallattributekeys relevantattributes relevantattributes stringbuffer stringbuffer attributedcharacteriterator astring attributedstring tostring getallattributekeys hasnext attributedcharacteriterator attributedcharacteriterator attributedcharacteriterator getattribute getrunstart getrunlimit astring addattribute setindex astring getiterator dump a map key value to out param map map static public void dump map map system out println dump map size map size iterator it map key set iterator while it has next object key it next object value map get key system out println key value keyset hasnext print action and input map for component param comp component with action map public static void print action input map j component comp action map action map am comp get action map object am keys am all keys including parents if am keys null system out println system out println action map for component comp to string for int i 0 i am keys length i action a am get am keys i string buffer sb new string buffer sb append a get value action name if a get value action action command key null sb append cmd append a get value action action command key if a get value action short description null sb append append a get value action short description system out println sb to string a same as below key stroke k strokes comp get registered key strokes if k strokes null system out println system out println registered key strokes comp to string for int i 0 i k strokes length i system out println k strokes i to string focused input map im comp get input map j component when focused key stroke k strokes im all keys if k strokes null system out println system out println input map for component when focused comp to string for int i 0 i k strokes length i system out println k strokes i to string im get k strokes i to string focused in window im comp get input map j component when in focused window k strokes im all keys if k strokes null system out println system out println input map for component when focused in window comp to string for int i 0 i k strokes length i system out println k strokes i to string im get k strokes i to string focused when ancester im comp get input map j component when ancestor of focused component k strokes im all keys if k strokes null system out println system out println input map for component when ancestor comp to string for int i 0 i k strokes length i system out println k strokes i to string im get k strokes i to string system out println actionmap printactioninputmap jcomponent actionmap getactionmap amkeys allkeys amkeys actionmap tostring amkeys amkeys stringbuffer stringbuffer getvalue getvalue action_command_key getvalue action_command_key getvalue short_description getvalue short_description tostring keystroke kstrokes getregisteredkeystrokes kstrokes tostring kstrokes kstrokes tostring inputmap getinputmap jcomponent when_focused keystroke kstrokes allkeys kstrokes inputmap tostring kstrokes kstrokes tostring kstrokes tostring getinputmap jcomponent when_in_focused_window kstrokes allkeys kstrokes inputmap tostring kstrokes kstrokes tostring kstrokes tostring getinputmap jcomponent when_ancestor_of_focused_component kstrokes allkeys kstrokes inputmap tostring kstrokes kstrokes tostring kstrokes tostring is 8 bit param str string return true if string contains chars 255 public static boolean is8 bit string str if str null str length 0 return true char cc str to char array for int i 0 i cc length i if cc i 255 system out println not 8 bit str return false return true is8bit tochararray clean ampersand used to indicate shortcut param in input return cleaned string public static string clean amp string in if in null return in int pos in index of if pos 1 return in if pos 1 in length in char at pos 1 in in substring 0 pos in substring pos 1 return in cleanamp indexof charat trim to max character length param str string param length max incl character length return string public static string trim length string str int length if str null return str if length 0 throw new illegal argument exception trim length invalid length if str length length return str substring 0 length return str trimlength illegalargumentexception size of string in bytes param str string return size in bytes public static int size string str if str null return 0 int length str length int size length try size str get bytes utf 8 length catch unsupported encoding exception e log log level severe str e return size getbytes unsupportedencodingexception trim to max byte size param str string param size max size in bytes return string public static string trim size string str int size if str null return str if size 0 throw new illegal argument exception trim size invalid size assume two byte code int length str length if length size 2 return str try byte bytes str get bytes utf 8 if bytes length size return str create new may cut last character in half byte result new byte size system arraycopy bytes 0 result 0 size return new string result utf 8 catch unsupported encoding exception e log log level severe str e return str trimsize illegalargumentexception getbytes unsupportedencodingexception test param args args public static void main string args string str a b c d e f g system out println str str length size str string str1 trim length str 10 system out println str1 str1 length size str1 string str2 trim size str 10 system out println str2 str2 length size str2 attributed string a string new attributed string test test a string add attribute text attribute foreground color blue a string add attribute text attribute underline text attribute underline on 2 4 get iterator a string new attributed character iterator attribute text attribute underline trimlength trimsize attributedstring astring attributedstring astring addattribute textattribute astring addattribute textattribute textattribute underline_on getiterator astring attributedcharacteriterator textattribute standard constructor public x m sernoctl properties ctx int m sernoctl id string trx name super ctx m sernoctl id trx name if m sernoctl id 0 set current next 0 100 set increment no 0 1 setm sernoctl id 0 set name null set start no 0 100 x_m_sernoctl m_sernoctl_id trxname m_sernoctl_id trxname m_sernoctl_id setcurrentnext setincrementno setm_sernoctl_id setname setstartno load constructor public x m sernoctl properties ctx result set rs string trx name super ctx rs trx name x_m_sernoctl resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m sernoctl append get id append return sb to string tostring stringbuffer stringbuffer x_m_sernoctl get_id tostring set current next the next number to be used public void set current next int current next set value current next new integer current next setcurrentnext currentnext set_value currentnext currentnext get current next the next number to be used public int get current next integer ii integer get value current next if ii null return 0 return ii int value getcurrentnext get_value currentnext intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set increment the number to increment the last document number by public void set increment no int increment no set value increment no new integer increment no setincrementno incrementno set_value incrementno incrementno get increment the number to increment the last document number by public int get increment no integer ii integer get value increment no if ii null return 0 return ii int value getincrementno get_value incrementno intvalue set serial no control product serial number control public void setm sernoctl id int m sernoctl id if m sernoctl id 1 throw new illegal argument exception m sernoctl id is mandatory set valuenocheck m sernoctl id new integer m sernoctl id setm_sernoctl_id m_sernoctl_id m_sernoctl_id illegalargumentexception m_sernoctl_id set_valuenocheck m_sernoctl_id m_sernoctl_id get serial no control product serial number control public int getm sernoctl id integer ii integer get value m sernoctl id if ii null return 0 return ii int value getm_sernoctl_id get_value m_sernoctl_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set prefix prefix before the sequence number public void set prefix string prefix if prefix null prefix length 10 log warning length 10 truncated prefix prefix substring 0 9 set value prefix prefix setprefix set_value get prefix prefix before the sequence number public string get prefix return string get value prefix getprefix get_value set start no starting number position public void set start no int start no set value start no new integer start no setstartno startno set_value startno startno get start no starting number position public int get start no integer ii integer get value start no if ii null return 0 return ii int value getstartno get_value startno intvalue set suffix suffix after the number public void set suffix string suffix if suffix null suffix length 10 log warning length 10 truncated suffix suffix substring 0 9 set value suffix suffix setsuffix set_value get suffix suffix after the number public string get suffix return string get value suffix getsuffix get_value standard constructor public x rv bpartner properties ctx int rv bpartner id string trx name super ctx rv bpartner id trx name if rv bpartner id 0 setc bp group id 0 setc bpartner id 0 setc bpartner location id 0 setc country id 0 set contact name null set country name null set is customer false set is employee false set is one time false set is prospect false set is sales rep false set is summary false set is vendor false setldap user false set name null set notification type null set sende mail false set value null x_rv_bpartner rv_bpartner_id trxname rv_bpartner_id trxname rv_bpartner_id setc_bp_group_id setc_bpartner_id setc_bpartner_location_id setc_country_id setcontactname setcountryname setiscustomer setisemployee setisonetime setisprospect setissalesrep setissummary setisvendor setldapuser setname setnotificationtype setsendemail setvalue load constructor public x rv bpartner properties ctx result set rs string trx name super ctx rs trx name x_rv_bpartner resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x rv bpartner append get id append return sb to string tostring stringbuffer stringbuffer x_rv_bpartner get_id tostring public static final int ad language ad reference id 106 set language language for this entity public void setad language string ad language if ad language null ad language length 6 log warning length 6 truncated ad language ad language substring 0 5 set valuenocheck ad language ad language ad_language_ad_reference_id setad_language ad_language ad_language ad_language ad_language ad_language set_valuenocheck ad_language ad_language get language language for this entity public string getad language return string get value ad language getad_language get_value ad_language public static final int ad orgbp id ad reference id 276 set linked organization the business partner is another organization for explicit inter org transactions public void setad orgbp id int ad orgbp id if ad orgbp id 0 set valuenocheck ad orgbp id null else set valuenocheck ad orgbp id new integer ad orgbp id ad_orgbp_id_ad_reference_id setad_orgbp_id ad_orgbp_id ad_orgbp_id set_valuenocheck ad_orgbp_id set_valuenocheck ad_orgbp_id ad_orgbp_id get linked organization the business partner is another organization for explicit inter org transactions public int getad orgbp id integer ii integer get value ad orgbp id if ii null return 0 return ii int value getad_orgbp_id get_value ad_orgbp_id intvalue public static final int ad orgtrx id ad reference id 276 set trx organization performing or initiating organization public void setad orgtrx id int ad orgtrx id if ad orgtrx id 0 set valuenocheck ad orgtrx id null else set valuenocheck ad orgtrx id new integer ad orgtrx id ad_orgtrx_id_ad_reference_id setad_orgtrx_id ad_orgtrx_id ad_orgtrx_id set_valuenocheck ad_orgtrx_id set_valuenocheck ad_orgtrx_id ad_orgtrx_id get trx organization performing or initiating organization public int getad orgtrx id integer ii integer get value ad orgtrx id if ii null return 0 return ii int value getad_orgtrx_id get_value ad_orgtrx_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set valuenocheck ad user id null else set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_valuenocheck ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set acquisition cost the cost of gaining the prospect as a customer public void set acqusition cost big decimal acqusition cost set valuenocheck acqusition cost acqusition cost setacqusitioncost bigdecimal acqusitioncost set_valuenocheck acqusitioncost acqusitioncost get acquisition cost the cost of gaining the prospect as a customer public big decimal get acqusition cost big decimal bd big decimal get value acqusition cost if bd null return env zero return bd bigdecimal getacqusitioncost bigdecimal bigdecimal get_value acqusitioncost set actual life time value actual life time revenue public void set actual life time value big decimal actual life time value set valuenocheck actual life time value actual life time value setactuallifetimevalue bigdecimal actuallifetimevalue set_valuenocheck actuallifetimevalue actuallifetimevalue get actual life time value actual life time revenue public big decimal get actual life time value big decimal bd big decimal get value actual life time value if bd null return env zero return bd bigdecimal getactuallifetimevalue bigdecimal bigdecimal get_value actuallifetimevalue set address 1 address line 1 for this location public void set address1 string address1 if address1 null address1 length 60 log warning length 60 truncated address1 address1 substring 0 59 set valuenocheck address1 address1 setaddress1 set_valuenocheck get address 1 address line 1 for this location public string get address1 return string get value address1 getaddress1 get_value set address 2 address line 2 for this location public void set address2 string address2 if address2 null address2 length 60 log warning length 60 truncated address2 address2 substring 0 59 set valuenocheck address2 address2 setaddress2 set_valuenocheck get address 2 address line 2 for this location public string get address2 return string get value address2 getaddress2 get_value set address 3 address line 3 for the location public void set address3 string address3 if address3 null address3 length 60 log warning length 60 truncated address3 address3 substring 0 59 set valuenocheck address3 address3 setaddress3 set_valuenocheck get address 3 address line 3 for the location public string get address3 return string get value address3 getaddress3 get_value public static final int bpcontactgreeting ad reference id 356 set bp contact greeting greeting for business partner contact public void setbp contact greeting int bp contact greeting set valuenocheck bp contact greeting new integer bp contact greeting bpcontactgreeting_ad_reference_id setbpcontactgreeting bpcontactgreeting set_valuenocheck bpcontactgreeting bpcontactgreeting get bp contact greeting greeting for business partner contact public int getbp contact greeting integer ii integer get value bp contact greeting if ii null return 0 return ii int value getbpcontactgreeting get_value bpcontactgreeting intvalue public static final int bpartner parent id ad reference id 124 set partner parent business partner parent public void setbpartner parent id int bpartner parent id if bpartner parent id 0 set valuenocheck bpartner parent id null else set valuenocheck bpartner parent id new integer bpartner parent id bpartner_parent_id_ad_reference_id setbpartner_parent_id bpartner_parent_id bpartner_parent_id set_valuenocheck bpartner_parent_id set_valuenocheck bpartner_parent_id bpartner_parent_id get partner parent business partner parent public int getbpartner parent id integer ii integer get value bpartner parent id if ii null return 0 return ii int value getbpartner_parent_id get_value bpartner_parent_id intvalue set birthday birthday or anniversary day public void set birthday timestamp birthday set valuenocheck birthday birthday setbirthday set_valuenocheck get birthday birthday or anniversary day public timestamp get birthday return timestamp get value birthday getbirthday get_value set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 1 throw new illegal argument exception c bp group id is mandatory set valuenocheck c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id illegalargumentexception c_bp_group_id set_valuenocheck c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set valuenocheck c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_valuenocheck c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set country country public void setc country id int c country id if c country id 1 throw new illegal argument exception c country id is mandatory set valuenocheck c country id new integer c country id setc_country_id c_country_id c_country_id illegalargumentexception c_country_id set_valuenocheck c_country_id c_country_id get country country public int getc country id integer ii integer get value c country id if ii null return 0 return ii int value getc_country_id get_value c_country_id intvalue set dunning dunning rules for overdue invoices public void setc dunning id int c dunning id if c dunning id 0 set valuenocheck c dunning id null else set valuenocheck c dunning id new integer c dunning id setc_dunning_id c_dunning_id c_dunning_id set_valuenocheck c_dunning_id set_valuenocheck c_dunning_id c_dunning_id get dunning dunning rules for overdue invoices public int getc dunning id integer ii integer get value c dunning id if ii null return 0 return ii int value getc_dunning_id get_value c_dunning_id intvalue set greeting greeting to print on correspondence public void setc greeting id int c greeting id if c greeting id 0 set valuenocheck c greeting id null else set valuenocheck c greeting id new integer c greeting id setc_greeting_id c_greeting_id c_greeting_id set_valuenocheck c_greeting_id set_valuenocheck c_greeting_id c_greeting_id get greeting greeting to print on correspondence public int getc greeting id integer ii integer get value c greeting id if ii null return 0 return ii int value getc_greeting_id get_value c_greeting_id intvalue set invoice schedule schedule for generating invoices public void setc invoiceschedule id int c invoiceschedule id if c invoiceschedule id 0 set valuenocheck c invoiceschedule id null else set valuenocheck c invoiceschedule id new integer c invoiceschedule id setc_invoiceschedule_id c_invoiceschedule_id c_invoiceschedule_id set_valuenocheck c_invoiceschedule_id set_valuenocheck c_invoiceschedule_id c_invoiceschedule_id get invoice schedule schedule for generating invoices public int getc invoiceschedule id integer ii integer get value c invoiceschedule id if ii null return 0 return ii int value getc_invoiceschedule_id get_value c_invoiceschedule_id intvalue set payment term the terms of payment timing discount public void setc paymentterm id int c paymentterm id if c paymentterm id 0 set valuenocheck c paymentterm id null else set valuenocheck c paymentterm id new integer c paymentterm id setc_paymentterm_id c_paymentterm_id c_paymentterm_id set_valuenocheck c_paymentterm_id set_valuenocheck c_paymentterm_id c_paymentterm_id get payment term the terms of payment timing discount public int getc paymentterm id integer ii integer get value c paymentterm id if ii null return 0 return ii int value getc_paymentterm_id get_value c_paymentterm_id intvalue set region identifies a geographical region public void setc region id int c region id if c region id 0 set valuenocheck c region id null else set valuenocheck c region id new integer c region id setc_region_id c_region_id c_region_id set_valuenocheck c_region_id set_valuenocheck c_region_id c_region_id get region identifies a geographical region public int getc region id integer ii integer get value c region id if ii null return 0 return ii int value getc_region_id get_value c_region_id intvalue set city identifies a city public void set city string city if city null city length 60 log warning length 60 truncated city city substring 0 59 set valuenocheck city city setcity set_valuenocheck get city identifies a city public string get city return string get value city getcity get_value set comments comments or additional information public void set comments string comments if comments null comments length 2000 log warning length 2000 truncated comments comments substring 0 1999 set valuenocheck comments comments setcomments set_valuenocheck get comments comments or additional information public string get comments return string get value comments getcomments get_value set contact description description of contact public void set contact description string contact description if contact description null contact description length 255 log warning length 255 truncated contact description contact description substring 0 254 set valuenocheck contact description contact description setcontactdescription contactdescription contactdescription contactdescription contactdescription contactdescription set_valuenocheck contactdescription contactdescription get contact description description of contact public string get contact description return string get value contact description getcontactdescription get_value contactdescription set contact name business partner contact name public void set contact name string contact name if contact name null throw new illegal argument exception contact name is mandatory if contact name length 60 log warning length 60 truncated contact name contact name substring 0 59 set valuenocheck contact name contact name setcontactname contactname contactname illegalargumentexception contactname contactname contactname contactname set_valuenocheck contactname contactname get contact name business partner contact name public string get contact name return string get value contact name getcontactname get_value contactname set country country name public void set country name string country name if country name null throw new illegal argument exception country name is mandatory if country name length 60 log warning length 60 truncated country name country name substring 0 59 set valuenocheck country name country name setcountryname countryname countryname illegalargumentexception countryname countryname countryname countryname set_valuenocheck countryname countryname get country country name public string get country name return string get value country name getcountryname get_value countryname set d u n s dun bradstreet number public void setduns string duns if duns null duns length 11 log warning length 11 truncated duns duns substring 0 10 set valuenocheck duns duns set_valuenocheck get d u n s dun bradstreet number public string getduns return string get value duns get_value public static final string deliveryrule afterreceipt r set delivery rule defines the timing of delivery public void set delivery rule string delivery rule if delivery rule null throw new illegal argument exception delivery rule is mandatory if delivery rule null delivery rule equals a delivery rule equals f delivery rule equals l delivery rule equals m delivery rule equals o delivery rule equals r else throw new illegal argument exception delivery rule invalid value delivery rule reference id 151 a f l m o r if delivery rule null delivery rule length 1 log warning length 1 truncated delivery rule delivery rule substring 0 0 set valuenocheck delivery rule delivery rule deliveryrule_afterreceipt setdeliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule deliveryrule illegalargumentexception deliveryrule deliveryrule reference_id deliveryrule deliveryrule deliveryrule deliveryrule set_valuenocheck deliveryrule deliveryrule get delivery rule defines the timing of delivery public string get delivery rule return string get value delivery rule getdeliveryrule get_value deliveryrule public static final string deliveryviarule shipper s set delivery via how the order will be delivered public void set delivery via rule string delivery via rule if delivery via rule null throw new illegal argument exception delivery via rule is mandatory if delivery via rule null delivery via rule equals d delivery via rule equals p delivery via rule equals s else throw new illegal argument exception delivery via rule invalid value delivery via rule reference id 152 d p s if delivery via rule null delivery via rule length 1 log warning length 1 truncated delivery via rule delivery via rule substring 0 0 set valuenocheck delivery via rule delivery via rule deliveryviarule_shipper setdeliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule deliveryviarule deliveryviarule deliveryviarule illegalargumentexception deliveryviarule deliveryviarule reference_id deliveryviarule deliveryviarule deliveryviarule deliveryviarule set_valuenocheck deliveryviarule deliveryviarule get delivery via how the order will be delivered public string get delivery via rule return string get value delivery via rule getdeliveryviarule get_value deliveryviarule set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set valuenocheck description description setdescription set_valuenocheck get description optional short description of the record public string get description return string get value description getdescription get_value set document copies number of copies to be printed public void set document copies int document copies set valuenocheck document copies new integer document copies setdocumentcopies documentcopies set_valuenocheck documentcopies documentcopies get document copies number of copies to be printed public int get document copies integer ii integer get value document copies if ii null return 0 return ii int value getdocumentcopies get_value documentcopies intvalue set e mail address electronic mail address public void sete mail string e mail if e mail null e mail length 60 log warning length 60 truncated e mail e mail substring 0 59 set valuenocheck e mail e mail email setemail email email email email email set_valuenocheck email email get e mail address electronic mail address public string gete mail return string get value e mail email getemail get_value email set e mail user id user name id in the mail system public void sete mail user string e mail user if e mail user null e mail user length 60 log warning length 60 truncated e mail user e mail user substring 0 59 set valuenocheck e mail user e mail user email setemailuser emailuser emailuser emailuser emailuser emailuser set_valuenocheck emailuser emailuser get e mail user id user name id in the mail system public string gete mail user return string get value e mail user email getemailuser get_value emailuser set verification info verification information of e mail address public void sete mail verify string e mail verify if e mail verify null e mail verify length 40 log warning length 40 truncated e mail verify e mail verify substring 0 39 set valuenocheck e mail verify e mail verify email setemailverify emailverify emailverify emailverify emailverify emailverify set_valuenocheck emailverify emailverify get verification info verification information of e mail address public string gete mail verify return string get value e mail verify email getemailverify get_value emailverify set e mail verify date email was verified public void sete mail verify date timestamp e mail verify date set valuenocheck e mail verify date e mail verify date email setemailverifydate emailverifydate set_valuenocheck emailverifydate emailverifydate get e mail verify date email was verified public timestamp gete mail verify date return timestamp get value e mail verify date email getemailverifydate get_value emailverifydate set fax facsimile number public void set fax string fax if fax null fax length 40 log warning length 40 truncated fax fax substring 0 39 set valuenocheck fax fax setfax set_valuenocheck get fax facsimile number public string get fax return string get value fax getfax get_value set first sale date of first sale public void set first sale timestamp first sale set valuenocheck first sale first sale setfirstsale firstsale set_valuenocheck firstsale firstsale get first sale date of first sale public timestamp get first sale return timestamp get value first sale getfirstsale get_value firstsale set flat discount flat discount percentage public void set flat discount big decimal flat discount set valuenocheck flat discount flat discount setflatdiscount bigdecimal flatdiscount set_valuenocheck flatdiscount flatdiscount get flat discount flat discount percentage public big decimal get flat discount big decimal bd big decimal get value flat discount if bd null return env zero return bd bigdecimal getflatdiscount bigdecimal bigdecimal get_value flatdiscount public static final string freightcostrule line l set freight cost rule method for charging freight public void set freight cost rule string freight cost rule if freight cost rule null throw new illegal argument exception freight cost rule is mandatory if freight cost rule null freight cost rule equals c freight cost rule equals f freight cost rule equals i freight cost rule equals l else throw new illegal argument exception freight cost rule invalid value freight cost rule reference id 153 c f i l if freight cost rule null freight cost rule length 1 log warning length 1 truncated freight cost rule freight cost rule substring 0 0 set valuenocheck freight cost rule freight cost rule freightcostrule_line setfreightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule freightcostrule illegalargumentexception freightcostrule freightcostrule reference_id freightcostrule freightcostrule freightcostrule freightcostrule set_valuenocheck freightcostrule freightcostrule get freight cost rule method for charging freight public string get freight cost rule return string get value freight cost rule getfreightcostrule get_value freightcostrule public static final string invoicerule customerscheduleafterdelivery s set invoice rule frequency and method of invoicing public void set invoice rule string invoice rule if invoice rule null throw new illegal argument exception invoice rule is mandatory if invoice rule null invoice rule equals d invoice rule equals i invoice rule equals o invoice rule equals s else throw new illegal argument exception invoice rule invalid value invoice rule reference id 150 d i o s if invoice rule null invoice rule length 1 log warning length 1 truncated invoice rule invoice rule substring 0 0 set valuenocheck invoice rule invoice rule invoicerule_customerscheduleafterdelivery setinvoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule invoicerule invoicerule invoicerule invoicerule illegalargumentexception invoicerule invoicerule reference_id invoicerule invoicerule invoicerule invoicerule set_valuenocheck invoicerule invoicerule get invoice rule frequency and method of invoicing public string get invoice rule return string get value invoice rule getinvoicerule get_value invoicerule public static final int invoice printformat id ad reference id 259 set invoice print format print format for printing invoices public void setinvoice printformat id int invoice printformat id if invoice printformat id 0 set valuenocheck invoice printformat id null else set valuenocheck invoice printformat id new integer invoice printformat id invoice_printformat_id_ad_reference_id setinvoice_printformat_id invoice_printformat_id invoice_printformat_id set_valuenocheck invoice_printformat_id set_valuenocheck invoice_printformat_id invoice_printformat_id get invoice print format print format for printing invoices public int getinvoice printformat id integer ii integer get value invoice printformat id if ii null return 0 return ii int value getinvoice_printformat_id get_value invoice_printformat_id intvalue set customer indicates if this business partner is a customer public void set is customer boolean is customer set valuenocheck is customer new boolean is customer setiscustomer iscustomer set_valuenocheck iscustomer iscustomer get customer indicates if this business partner is a customer public boolean is customer object oo get value is customer if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscustomer get_value iscustomer booleanvalue set discount printed print discount on invoice and order public void set is discount printed boolean is discount printed set valuenocheck is discount printed new boolean is discount printed setisdiscountprinted isdiscountprinted set_valuenocheck isdiscountprinted isdiscountprinted get discount printed print discount on invoice and order public boolean is discount printed object oo get value is discount printed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdiscountprinted get_value isdiscountprinted booleanvalue set employee indicates if this business partner is an employee public void set is employee boolean is employee set valuenocheck is employee new boolean is employee setisemployee isemployee set_valuenocheck isemployee isemployee get employee indicates if this business partner is an employee public boolean is employee object oo get value is employee if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isemployee get_value isemployee booleanvalue set one time transaction public void set is one time boolean is one time set valuenocheck is one time new boolean is one time setisonetime isonetime set_valuenocheck isonetime isonetime get one time transaction public boolean is one time object oo get value is one time if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isonetime get_value isonetime booleanvalue set prospect indicates this is a prospect public void set is prospect boolean is prospect set valuenocheck is prospect new boolean is prospect setisprospect isprospect set_valuenocheck isprospect isprospect get prospect indicates this is a prospect public boolean is prospect object oo get value is prospect if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprospect get_value isprospect booleanvalue set sales representative indicates if the business partner is a sales representative or company agent public void set is sales rep boolean is sales rep set valuenocheck is sales rep new boolean is sales rep setissalesrep issalesrep set_valuenocheck issalesrep issalesrep get sales representative indicates if the business partner is a sales representative or company agent public boolean is sales rep object oo get value is sales rep if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issalesrep get_value issalesrep booleanvalue set summary level this is a summary entity public void set is summary boolean is summary set valuenocheck is summary new boolean is summary setissummary issummary set_valuenocheck issummary issummary get summary level this is a summary entity public boolean is summary object oo get value is summary if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issummary get_value issummary booleanvalue set tax exempt business partner is exempt from tax public void set is tax exempt boolean is tax exempt set valuenocheck is tax exempt new boolean is tax exempt setistaxexempt istaxexempt set_valuenocheck istaxexempt istaxexempt get tax exempt business partner is exempt from tax public boolean is tax exempt object oo get value is tax exempt if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false istaxexempt get_value istaxexempt booleanvalue set vendor indicates if this business partner is a vendor public void set is vendor boolean is vendor set valuenocheck is vendor new boolean is vendor setisvendor isvendor set_valuenocheck isvendor isvendor get vendor indicates if this business partner is a vendor public boolean is vendor object oo get value is vendor if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isvendor get_value isvendor booleanvalue set ldap user name user name used for authorization via ldap directory services public void setldap user boolean ldap user set valuenocheck ldap user new boolean ldap user setldapuser ldapuser set_valuenocheck ldapuser ldapuser get ldap user name user name used for authorization via ldap directory services public boolean isldap user object oo get value ldap user if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isldapuser get_value ldapuser booleanvalue set last contact date this individual was last contacted public void set last contact timestamp last contact set valuenocheck last contact last contact setlastcontact lastcontact set_valuenocheck lastcontact lastcontact get last contact date this individual was last contacted public timestamp get last contact return timestamp get value last contact getlastcontact get_value lastcontact set last result result of last contact public void set last result string last result if last result null last result length 255 log warning length 255 truncated last result last result substring 0 254 set valuenocheck last result last result setlastresult lastresult lastresult lastresult lastresult lastresult set_valuenocheck lastresult lastresult get last result result of last contact public string get last result return string get value last result getlastresult get_value lastresult set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 0 set valuenocheck m discountschema id null else set valuenocheck m discountschema id new integer m discountschema id setm_discountschema_id m_discountschema_id m_discountschema_id set_valuenocheck m_discountschema_id set_valuenocheck m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set price list unique identifier of a price list public void setm pricelist id int m pricelist id if m pricelist id 0 set valuenocheck m pricelist id null else set valuenocheck m pricelist id new integer m pricelist id setm_pricelist_id m_pricelist_id m_pricelist_id set_valuenocheck m_pricelist_id set_valuenocheck m_pricelist_id m_pricelist_id get price list unique identifier of a price list public int getm pricelist id integer ii integer get value m pricelist id if ii null return 0 return ii int value getm_pricelist_id get_value m_pricelist_id intvalue set naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public void setnaics string naics if naics null naics length 6 log warning length 6 truncated naics naics substring 0 5 set valuenocheck naics naics set_valuenocheck get naics sic standard industry code or its successor naic http www osha gov oshstats sicser html public string getnaics return string get value naics get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set valuenocheck name name setname illegalargumentexception set_valuenocheck get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set name 2 additional name public void set name2 string name2 if name2 null name2 length 60 log warning length 60 truncated name2 name2 substring 0 59 set valuenocheck name2 name2 setname2 set_valuenocheck get name 2 additional name public string get name2 return string get value name2 getname2 get_value public static final string notificationtype none x set notification type type of notifications public void set notification type string notification type if notification type null throw new illegal argument exception notification type is mandatory if notification type equals b notification type equals e notification type equals n notification type equals x else throw new illegal argument exception notification type invalid value notification type reference id 344 b e n x if notification type length 1 log warning length 1 truncated notification type notification type substring 0 0 set valuenocheck notification type notification type notificationtype_none setnotificationtype notificationtype notificationtype illegalargumentexception notificationtype notificationtype notificationtype notificationtype notificationtype illegalargumentexception notificationtype notificationtype reference_id notificationtype notificationtype notificationtype set_valuenocheck notificationtype notificationtype get notification type type of notifications public string get notification type return string get value notification type getnotificationtype get_value notificationtype set employees number of employees public void set number employees int number employees set valuenocheck number employees new integer number employees setnumberemployees numberemployees set_valuenocheck numberemployees numberemployees get employees number of employees public int get number employees integer ii integer get value number employees if ii null return 0 return ii int value getnumberemployees get_value numberemployees intvalue set order reference transaction reference number sales order purchase order of your business partner public void setpo reference string po reference if po reference null po reference length 20 log warning length 20 truncated po reference po reference substring 0 19 set valuenocheck po reference po reference setporeference poreference poreference poreference poreference poreference set_valuenocheck poreference poreference get order reference transaction reference number sales order purchase order of your business partner public string getpo reference return string get value po reference getporeference get_value poreference public static final int po discountschema id ad reference id 249 set po discount schema schema to calculate the purchase trade discount percentage public void setpo discountschema id int po discountschema id if po discountschema id 0 set valuenocheck po discountschema id null else set valuenocheck po discountschema id new integer po discountschema id po_discountschema_id_ad_reference_id setpo_discountschema_id po_discountschema_id po_discountschema_id set_valuenocheck po_discountschema_id set_valuenocheck po_discountschema_id po_discountschema_id get po discount schema schema to calculate the purchase trade discount percentage public int getpo discountschema id integer ii integer get value po discountschema id if ii null return 0 return ii int value getpo_discountschema_id get_value po_discountschema_id intvalue public static final int po paymentterm id ad reference id 227 set po payment term payment rules for a purchase order public void setpo paymentterm id int po paymentterm id if po paymentterm id 0 set valuenocheck po paymentterm id null else set valuenocheck po paymentterm id new integer po paymentterm id po_paymentterm_id_ad_reference_id setpo_paymentterm_id po_paymentterm_id po_paymentterm_id set_valuenocheck po_paymentterm_id set_valuenocheck po_paymentterm_id po_paymentterm_id get po payment term payment rules for a purchase order public int getpo paymentterm id integer ii integer get value po paymentterm id if ii null return 0 return ii int value getpo_paymentterm_id get_value po_paymentterm_id intvalue public static final int po pricelist id ad reference id 166 set purchase pricelist price list used by this business partner public void setpo pricelist id int po pricelist id if po pricelist id 0 set valuenocheck po pricelist id null else set valuenocheck po pricelist id new integer po pricelist id po_pricelist_id_ad_reference_id setpo_pricelist_id po_pricelist_id po_pricelist_id set_valuenocheck po_pricelist_id set_valuenocheck po_pricelist_id po_pricelist_id get purchase pricelist price list used by this business partner public int getpo pricelist id integer ii integer get value po pricelist id if ii null return 0 return ii int value getpo_pricelist_id get_value po_pricelist_id intvalue public static final string paymentrule directdeposit t set payment rule how you pay the invoice public void set payment rule string payment rule if payment rule null throw new illegal argument exception payment rule is mandatory if payment rule null payment rule equals b payment rule equals d payment rule equals k payment rule equals p payment rule equals s payment rule equals t else throw new illegal argument exception payment rule invalid value payment rule reference id 195 b d k p s t if payment rule null payment rule length 1 log warning length 1 truncated payment rule payment rule substring 0 0 set valuenocheck payment rule payment rule paymentrule_directdeposit setpaymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule paymentrule illegalargumentexception paymentrule paymentrule reference_id paymentrule paymentrule paymentrule paymentrule set_valuenocheck paymentrule paymentrule get payment rule how you pay the invoice public string get payment rule return string get value payment rule getpaymentrule get_value paymentrule public static final string paymentrulepo directdeposit t set payment rule purchase payment option public void set payment rulepo string payment rulepo if payment rulepo null throw new illegal argument exception payment rulepo is mandatory if payment rulepo null payment rulepo equals b payment rulepo equals d payment rulepo equals k payment rulepo equals p payment rulepo equals s payment rulepo equals t else throw new illegal argument exception payment rulepo invalid value payment rulepo reference id 195 b d k p s t if payment rulepo null payment rulepo length 1 log warning length 1 truncated payment rulepo payment rulepo substring 0 0 set valuenocheck payment rulepo payment rulepo paymentrulepo_directdeposit setpaymentrulepo paymentrulepo paymentrulepo illegalargumentexception paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo paymentrulepo illegalargumentexception paymentrulepo paymentrulepo reference_id paymentrulepo paymentrulepo paymentrulepo paymentrulepo set_valuenocheck paymentrulepo paymentrulepo get payment rule purchase payment option public string get payment rulepo return string get value payment rulepo getpaymentrulepo get_value paymentrulepo set phone identifies a telephone number public void set phone string phone if phone null phone length 40 log warning length 40 truncated phone phone substring 0 39 set valuenocheck phone phone setphone set_valuenocheck get phone identifies a telephone number public string get phone return string get value phone getphone get_value set 2nd phone identifies an alternate telephone number public void set phone2 string phone2 if phone2 null phone2 length 40 log warning length 40 truncated phone2 phone2 substring 0 39 set valuenocheck phone2 phone2 setphone2 set_valuenocheck get 2nd phone identifies an alternate telephone number public string get phone2 return string get value phone2 getphone2 get_value set zip postal code public void set postal string postal if postal null postal length 10 log warning length 10 truncated postal postal substring 0 9 set valuenocheck postal postal setpostal set_valuenocheck get zip postal code public string get postal return string get value postal getpostal get_value set potential life time value total revenue expected public void set potential life time value big decimal potential life time value set valuenocheck potential life time value potential life time value setpotentiallifetimevalue bigdecimal potentiallifetimevalue set_valuenocheck potentiallifetimevalue potentiallifetimevalue get potential life time value total revenue expected public big decimal get potential life time value big decimal bd big decimal get value potential life time value if bd null return env zero return bd bigdecimal getpotentiallifetimevalue bigdecimal bigdecimal get_value potentiallifetimevalue set rating classification or importance public void set rating string rating if rating null rating length 1 log warning length 1 truncated rating rating substring 0 0 set valuenocheck rating rating setrating set_valuenocheck get rating classification or importance public string get rating return string get value rating getrating get_value set reference no your customer or vendor number at the business partner s site public void set reference no string reference no if reference no null reference no length 40 log warning length 40 truncated reference no reference no substring 0 39 set valuenocheck reference no reference no setreferenceno referenceno referenceno referenceno referenceno referenceno set_valuenocheck referenceno referenceno get reference no your customer or vendor number at the business partner s site public string get reference no return string get value reference no getreferenceno get_value referenceno set region name of the region public void set region name string region name if region name null region name length 60 log warning length 60 truncated region name region name substring 0 59 set valuenocheck region name region name setregionname regionname regionname regionname regionname regionname set_valuenocheck regionname regionname get region name of the region public string get region name return string get value region name getregionname get_value regionname public static final string socreditstatus nocreditcheck x set credit status business partner credit status public void setso credit status string so credit status if so credit status null throw new illegal argument exception so credit status is mandatory if so credit status null so credit status equals h so credit status equals o so credit status equals s so credit status equals w so credit status equals x else throw new illegal argument exception so credit status invalid value so credit status reference id 289 h o s w x if so credit status null so credit status length 1 log warning length 1 truncated so credit status so credit status substring 0 0 set valuenocheck so credit status so credit status socreditstatus_nocreditcheck setsocreditstatus socreditstatus socreditstatus illegalargumentexception socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus socreditstatus illegalargumentexception socreditstatus socreditstatus reference_id socreditstatus socreditstatus socreditstatus socreditstatus set_valuenocheck socreditstatus socreditstatus get credit status business partner credit status public string getso credit status return string get value so credit status getsocreditstatus get_value socreditstatus set credit available available credit based on credit limit not total open balance and credit used public void setso creditavailable big decimal so creditavailable set valuenocheck so creditavailable so creditavailable setso_creditavailable bigdecimal so_creditavailable set_valuenocheck so_creditavailable so_creditavailable get credit available available credit based on credit limit not total open balance and credit used public big decimal getso creditavailable big decimal bd big decimal get value so creditavailable if bd null return env zero return bd bigdecimal getso_creditavailable bigdecimal bigdecimal get_value so_creditavailable set credit limit total outstanding invoice amounts allowed public void setso creditlimit big decimal so creditlimit set valuenocheck so creditlimit so creditlimit setso_creditlimit bigdecimal so_creditlimit set_valuenocheck so_creditlimit so_creditlimit get credit limit total outstanding invoice amounts allowed public big decimal getso creditlimit big decimal bd big decimal get value so creditlimit if bd null return env zero return bd bigdecimal getso_creditlimit bigdecimal bigdecimal get_value so_creditlimit set credit used current open balance public void setso creditused big decimal so creditused set valuenocheck so creditused so creditused setso_creditused bigdecimal so_creditused set_valuenocheck so_creditused so_creditused get credit used current open balance public big decimal getso creditused big decimal bd big decimal get value so creditused if bd null return env zero return bd bigdecimal getso_creditused bigdecimal bigdecimal get_value so_creditused set order description description to be used on orders public void setso description string so description if so description null so description length 255 log warning length 255 truncated so description so description substring 0 254 set valuenocheck so description so description setso_description so_description so_description so_description so_description so_description set_valuenocheck so_description so_description get order description description to be used on orders public string getso description return string get value so description getso_description get_value so_description public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set valuenocheck salesrep id null else set valuenocheck salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_valuenocheck salesrep_id set_valuenocheck salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set sales volume in 1 000 total volume of sales in thousands of currency public void set sales volume big decimal sales volume set valuenocheck sales volume sales volume setsalesvolume bigdecimal salesvolume set_valuenocheck salesvolume salesvolume get sales volume in 1 000 total volume of sales in thousands of currency public big decimal get sales volume big decimal bd big decimal get value sales volume if bd null return env zero return bd bigdecimal getsalesvolume bigdecimal bigdecimal get_value salesvolume set send e mail enable sending document e mail public void set sende mail boolean sende mail set valuenocheck sende mail new boolean sende mail email email setsendemail sendemail set_valuenocheck sendemail sendemail get send e mail enable sending document e mail public boolean is sende mail object oo get value sende mail if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false email email issendemail get_value sendemail booleanvalue set share share of customer s business as a percentage public void set share of customer int share of customer set valuenocheck share of customer new integer share of customer setshareofcustomer shareofcustomer set_valuenocheck shareofcustomer shareofcustomer get share share of customer s business as a percentage public int get share of customer integer ii integer get value share of customer if ii null return 0 return ii int value getshareofcustomer get_value shareofcustomer intvalue set min shelf life minimum shelf life in percent based on product instance guarantee date public void set shelf life min pct int shelf life min pct set valuenocheck shelf life min pct new integer shelf life min pct setshelflifeminpct shelflifeminpct set_valuenocheck shelflifeminpct shelflifeminpct get min shelf life minimum shelf life in percent based on product instance guarantee date public int get shelf life min pct integer ii integer get value shelf life min pct if ii null return 0 return ii int value getshelflifeminpct get_value shelflifeminpct intvalue public static final int supervisor id ad reference id 110 set supervisor supervisor for this user organization used for escalation and approval public void setsupervisor id int supervisor id if supervisor id 0 set valuenocheck supervisor id null else set valuenocheck supervisor id new integer supervisor id supervisor_id_ad_reference_id setsupervisor_id supervisor_id supervisor_id set_valuenocheck supervisor_id set_valuenocheck supervisor_id supervisor_id get supervisor supervisor for this user organization used for escalation and approval public int getsupervisor id integer ii integer get value supervisor id if ii null return 0 return ii int value getsupervisor_id get_value supervisor_id intvalue set tax id tax identification public void set taxid string taxid if taxid null taxid length 20 log warning length 20 truncated taxid taxid substring 0 19 set valuenocheck taxid taxid settaxid set_valuenocheck get tax id tax identification public string get taxid return string get value taxid gettaxid get_value set title name this entity is referred to as public void set title string title if title null title length 40 log warning length 40 truncated title title substring 0 39 set valuenocheck title title settitle set_valuenocheck get title name this entity is referred to as public string get title return string get value title gettitle get_value set open balance total open balance amount in primary accounting currency public void set total open balance big decimal total open balance set valuenocheck total open balance total open balance settotalopenbalance bigdecimal totalopenbalance set_valuenocheck totalopenbalance totalopenbalance get open balance total open balance amount in primary accounting currency public big decimal get total open balance big decimal bd big decimal get value total open balance if bd null return env zero return bd bigdecimal gettotalopenbalance bigdecimal bigdecimal get_value totalopenbalance set url full url address e g http www compiere org public void seturl string url if url null url length 120 log warning length 120 truncated url url substring 0 119 set valuenocheck url url set_valuenocheck get url full url address e g http www compiere org public string geturl return string get value url get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set valuenocheck value value setvalue illegalargumentexception set_valuenocheck get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value standard constructor public x c rfqresponseline properties ctx int c rfqresponseline id string trx name super ctx c rfqresponseline id trx name if c rfqresponseline id 0 setc rfqline id 0 setc rfqresponseline id 0 setc rfqresponse id 0 set is selected winner false set is self service false x_c_rfqresponseline c_rfqresponseline_id trxname c_rfqresponseline_id trxname c_rfqresponseline_id setc_rfqline_id setc_rfqresponseline_id setc_rfqresponse_id setisselectedwinner setisselfservice load constructor public x c rfqresponseline properties ctx result set rs string trx name super ctx rs trx name x_c_rfqresponseline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c rfqresponseline append get id append return sb to string tostring stringbuffer stringbuffer x_c_rfqresponseline get_id tostring set rfq line request for quotation line public void setc rfqline id int c rfqline id if c rfqline id 1 throw new illegal argument exception c rfqline id is mandatory set valuenocheck c rfqline id new integer c rfqline id setc_rfqline_id c_rfqline_id c_rfqline_id illegalargumentexception c_rfqline_id set_valuenocheck c_rfqline_id c_rfqline_id get rfq line request for quotation line public int getc rfqline id integer ii integer get value c rfqline id if ii null return 0 return ii int value getc_rfqline_id get_value c_rfqline_id intvalue set rfq response line request for quotation response line public void setc rfqresponseline id int c rfqresponseline id if c rfqresponseline id 1 throw new illegal argument exception c rfqresponseline id is mandatory set valuenocheck c rfqresponseline id new integer c rfqresponseline id setc_rfqresponseline_id c_rfqresponseline_id c_rfqresponseline_id illegalargumentexception c_rfqresponseline_id set_valuenocheck c_rfqresponseline_id c_rfqresponseline_id get rfq response line request for quotation response line public int getc rfqresponseline id integer ii integer get value c rfqresponseline id if ii null return 0 return ii int value getc_rfqresponseline_id get_value c_rfqresponseline_id intvalue set rfq response request for quotation response from a potential vendor public void setc rfqresponse id int c rfqresponse id if c rfqresponse id 1 throw new illegal argument exception c rfqresponse id is mandatory set valuenocheck c rfqresponse id new integer c rfqresponse id setc_rfqresponse_id c_rfqresponse_id c_rfqresponse_id illegalargumentexception c_rfqresponse_id set_valuenocheck c_rfqresponse_id c_rfqresponse_id get rfq response request for quotation response from a potential vendor public int getc rfqresponse id integer ii integer get value c rfqresponse id if ii null return 0 return ii int value getc_rfqresponse_id get_value c_rfqresponse_id intvalue set work complete date when work is planned to be complete public void set date work complete timestamp date work complete set value date work complete date work complete setdateworkcomplete dateworkcomplete set_value dateworkcomplete dateworkcomplete get work complete date when work is planned to be complete public timestamp get date work complete return timestamp get value date work complete getdateworkcomplete get_value dateworkcomplete set work start date when work is planned to be started public void set date work start timestamp date work start set value date work start date work start setdateworkstart dateworkstart set_value dateworkstart dateworkstart get work start date when work is planned to be started public timestamp get date work start return timestamp get value date work start getdateworkstart get_value dateworkstart set delivery days number of days planned until delivery public void set delivery days int delivery days set value delivery days new integer delivery days setdeliverydays deliverydays set_value deliverydays deliverydays get delivery days number of days planned until delivery public int get delivery days integer ii integer get value delivery days if ii null return 0 return ii int value getdeliverydays get_value deliverydays intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set selected winner the resonse is the selected winner public void set is selected winner boolean is selected winner set value is selected winner new boolean is selected winner setisselectedwinner isselectedwinner set_value isselectedwinner isselectedwinner get selected winner the resonse is the selected winner public boolean is selected winner object oo get value is selected winner if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselectedwinner get_value isselectedwinner booleanvalue set self service this is a self service entry or this entry can be changed via self service public void set is self service boolean is self service set value is self service new boolean is self service setisselfservice isselfservice set_value isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public boolean is self service object oo get value is self service if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isselfservice get_value isselfservice booleanvalue standard constructor param ctx context param c poskey id id public mpos key properties ctx int c poskey id string trx name super ctx c poskey id trx name c_poskey_id mposkey c_poskey_id trxname c_poskey_id trxname load constructor param ctx context param rs result set public mpos key properties ctx result set rs string trx name super ctx rs trx name mposkey resultset trxname trxname standard constructor public x c servicelevel properties ctx int c servicelevel id string trx name super ctx c servicelevel id trx name if c servicelevel id 0 setc revenuerecognition plan id 0 setc servicelevel id 0 setm product id 0 set service level invoiced env zero set service level provided env zero x_c_servicelevel c_servicelevel_id trxname c_servicelevel_id trxname c_servicelevel_id setc_revenuerecognition_plan_id setc_servicelevel_id setm_product_id setservicelevelinvoiced setservicelevelprovided load constructor public x c servicelevel properties ctx result set rs string trx name super ctx rs trx name x_c_servicelevel resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c servicelevel append get id append return sb to string tostring stringbuffer stringbuffer x_c_servicelevel get_id tostring set revenue recognition plan plan for recognizing or recording revenue public void setc revenuerecognition plan id int c revenuerecognition plan id if c revenuerecognition plan id 1 throw new illegal argument exception c revenuerecognition plan id is mandatory set valuenocheck c revenuerecognition plan id new integer c revenuerecognition plan id setc_revenuerecognition_plan_id c_revenuerecognition_plan_id c_revenuerecognition_plan_id illegalargumentexception c_revenuerecognition_plan_id set_valuenocheck c_revenuerecognition_plan_id c_revenuerecognition_plan_id get revenue recognition plan plan for recognizing or recording revenue public int getc revenuerecognition plan id integer ii integer get value c revenuerecognition plan id if ii null return 0 return ii int value getc_revenuerecognition_plan_id get_value c_revenuerecognition_plan_id intvalue set service level product revenue recognition service level public void setc servicelevel id int c servicelevel id if c servicelevel id 1 throw new illegal argument exception c servicelevel id is mandatory set valuenocheck c servicelevel id new integer c servicelevel id setc_servicelevel_id c_servicelevel_id c_servicelevel_id illegalargumentexception c_servicelevel_id set_valuenocheck c_servicelevel_id c_servicelevel_id get service level product revenue recognition service level public int getc servicelevel id integer ii integer get value c servicelevel id if ii null return 0 return ii int value getc_servicelevel_id get_value c_servicelevel_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value return string get value description public key name pair get key name pair return new key name pair get id get description get_value keynamepair getkeynamepair keynamepair get_id getdescription set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set quantity invoiced quantity of product or service invoiced public void set service level invoiced big decimal service level invoiced if service level invoiced null throw new illegal argument exception service level invoiced is mandatory set valuenocheck service level invoiced service level invoiced setservicelevelinvoiced bigdecimal servicelevelinvoiced servicelevelinvoiced illegalargumentexception servicelevelinvoiced set_valuenocheck servicelevelinvoiced servicelevelinvoiced get quantity invoiced quantity of product or service invoiced public big decimal get service level invoiced big decimal bd big decimal get value service level invoiced if bd null return env zero return bd bigdecimal getservicelevelinvoiced bigdecimal bigdecimal get_value servicelevelinvoiced set quantity provided quantity of service or product provided public void set service level provided big decimal service level provided if service level provided null throw new illegal argument exception service level provided is mandatory set valuenocheck service level provided service level provided setservicelevelprovided bigdecimal servicelevelprovided servicelevelprovided illegalargumentexception servicelevelprovided set_valuenocheck servicelevelprovided servicelevelprovided get quantity provided quantity of service or product provided public big decimal get service level provided big decimal bd big decimal get value service level provided if bd null return env zero return bd bigdecimal getservicelevelprovided bigdecimal bigdecimal get_value servicelevelprovided get content return content public object get contents return contents getcontents get content return content public object get contents return contents getcontents standard constructor public x s training properties ctx int s training id string trx name super ctx s training id trx name if s training id 0 setc taxcategory id 0 setc uom id 0 setm product category id 0 set name null sets training id 0 x_s_training s_training_id trxname s_training_id trxname s_training_id setc_taxcategory_id setc_uom_id setm_product_category_id setname sets_training_id load constructor public x s training properties ctx result set rs string trx name super ctx rs trx name x_s_training resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s training append get id append return sb to string tostring stringbuffer stringbuffer x_s_training get_id tostring set tax category tax category public void setc taxcategory id int c taxcategory id if c taxcategory id 1 throw new illegal argument exception c taxcategory id is mandatory set value c taxcategory id new integer c taxcategory id setc_taxcategory_id c_taxcategory_id c_taxcategory_id illegalargumentexception c_taxcategory_id set_value c_taxcategory_id c_taxcategory_id get tax category tax category public int getc taxcategory id integer ii integer get value c taxcategory id if ii null return 0 return ii int value getc_taxcategory_id get_value c_taxcategory_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set value c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_value c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set description url url for the description public void set descriptionurl string descriptionurl if descriptionurl null descriptionurl length 120 log warning length 120 truncated descriptionurl descriptionurl substring 0 119 set value descriptionurl descriptionurl setdescriptionurl set_value get description url url for the description public string get descriptionurl return string get value descriptionurl getdescriptionurl get_value set document note additional information for a document public void set document note string document note if document note null document note length 2000 log warning length 2000 truncated document note document note substring 0 1999 set value document note document note setdocumentnote documentnote documentnote documentnote documentnote documentnote set_value documentnote documentnote get document note additional information for a document public string get document note return string get value document note getdocumentnote get_value documentnote set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set image url url of image public void set imageurl string imageurl if imageurl null imageurl length 120 log warning length 120 truncated imageurl imageurl substring 0 119 set value imageurl imageurl setimageurl set_value get image url url of image public string get imageurl return string get value imageurl getimageurl get_value set product category category of a product public void setm product category id int m product category id if m product category id 1 throw new illegal argument exception m product category id is mandatory set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id illegalargumentexception m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set training repeated training public void sets training id int s training id if s training id 1 throw new illegal argument exception s training id is mandatory set valuenocheck s training id new integer s training id sets_training_id s_training_id s_training_id illegalargumentexception s_training_id set_valuenocheck s_training_id s_training_id get training repeated training public int gets training id integer ii integer get value s training id if ii null return 0 return ii int value gets_training_id get_value s_training_id intvalue prepare protected void prepare p m matchpo id getrecord id p_m_matchpo_id getrecord_id process return message throws exception protected string do it throws exception log info m matchpo id p m matchpo id m matchpo po new m matchpo get ctx p m matchpo id get trxname if po get id 0 throw new compiere user error not found m matchpo id p m matchpo id if po delete true return ok po save return error doit m_matchpo_id p_m_matchpo_id mmatchpo mmatchpo getctx p_m_matchpo_id get_trxname get_id compiereusererror notfound m_matchpo_id p_m_matchpo_id return normal field background color text windows white return color public static color getfieldbackground normal window white return color blind get dichromat color ui manager get color text getfieldbackground_normal colorblind getdichromatcolor uimanager getcolor return error field background compiere theme return color public static color getfieldbackground error return color blind get dichromat color compiere theme error compieretheme getfieldbackground_error colorblind getdichromatcolor compieretheme return mandatory field background color compiere theme return color public static color getfieldbackground mandatory return color blind get dichromat color compiere theme mandatory compieretheme getfieldbackground_mandatory colorblind getdichromatcolor compieretheme return inactive field background color compiere theme return color public static color getfieldbackground inactive return color blind get dichromat color compiere theme inactive compieretheme getfieldbackground_inactive colorblind getdichromatcolor compieretheme return form background color control windows light gray return color public static color get form background return color blind get dichromat color ui manager get color control lightgray getformbackground colorblind getdichromatcolor uimanager getcolor info background color info windows info light yellow return color public static color get info background return color blind get dichromat color compiere theme info getinfobackground colorblind getdichromatcolor compieretheme normal field text foreground color text text windows black return color public static color gettextcolor normal return color blind get dichromat color ui manager get color text text texttext gettextcolor_normal colorblind getdichromatcolor uimanager getcolor texttext ok text foreground color theme return color public static color gettextcolor ok return color blind get dichromat color compiere theme txt ok gettextcolor_ok colorblind getdichromatcolor compieretheme txt_ok issue text foreground color theme return color public static color gettextcolor issue return color blind get dichromat color compiere theme txt error gettextcolor_issue colorblind getdichromatcolor compieretheme txt_error label text foreground color control text windows black return color public static color gettextcolor label return color blind get dichromat color ui manager get color control text controltext gettextcolor_label colorblind getdichromatcolor uimanager getcolor controltext public static color get primary1 return color blind get dichromat color compiere theme primary1 getprimary1 colorblind getdichromatcolor compieretheme return color blind get dichromat color compiere theme primary1 public static color get primary2 return color blind get dichromat color compiere theme primary2 colorblind getdichromatcolor compieretheme getprimary2 colorblind getdichromatcolor compieretheme return color blind get dichromat color compiere theme primary2 public static color get primary3 return color blind get dichromat color compiere theme primary3 colorblind getdichromatcolor compieretheme getprimary3 colorblind getdichromatcolor compieretheme return color blind get dichromat color compiere theme primary3 public static color get secondary1 return color blind get dichromat color compiere theme secondary1 colorblind getdichromatcolor compieretheme getsecondary1 colorblind getdichromatcolor compieretheme return color blind get dichromat color compiere theme secondary1 public static color get secondary2 return color blind get dichromat color compiere theme secondary2 colorblind getdichromatcolor compieretheme getsecondary2 colorblind getdichromatcolor compieretheme return color blind get dichromat color compiere theme secondary2 public static color get secondary3 return color blind get dichromat color compiere theme secondary3 colorblind getdichromatcolor compieretheme getsecondary3 colorblind getdichromatcolor compieretheme get header font window label font return font public static font getfont header return compiere theme window font return ui manager get font label font getfont_header compieretheme windowfont uimanager getfont get field font return font public static font getfont field return compiere theme user font return ui manager get font text field font getfont_field compieretheme userfont uimanager getfont textfield get label font return font public static font getfont label return compiere theme control font return ui manager get font label font getfont_label compieretheme controlfont uimanager getfont get small report font return font public static font getfont small return compiere theme small font getfont_small compieretheme smallfont get available look and feels return array of value name pair with name and class of look and feel public static value name pair getpla fs return s looks valuenamepair valuenamepair getplafs s_looks get the list of available metal themes if the current l f is a metal l f return array of strings with names of metal themes public static value name pair get themes if ui manager get look and feel instanceof metal look and feel return s themes return new value name pair 0 valuenamepair getthemes uimanager getlookandfeel metallookandfeel s_themes valuenamepair set plaf based on ini properties param win optional window public static void setplaf window win string look ini get property ini p ui look string look theme ini get property ini p ui theme search for plaf value name pair plaf null for int i 0 i s looks length i if s looks i get name equals look plaf s looks i break search for theme value name pair theme null for int i 0 i s themes length i if s themes i get name equals look theme theme s themes i break set plaf setplaf plaf null s defaultplaf plaf theme win getproperty p_ui_look looktheme getproperty p_ui_theme valuenamepair s_looks s_looks getname s_looks valuenamepair s_themes s_themes getname looktheme s_themes s_defaultplaf set plaf and update ini param plaf value name pair of the plaf to be set param theme optional theme name param win optional window public static void setplaf value name pair plaf value name pair theme window win if plaf null return log config plaf theme null theme look feel try ui manager set look and feel plaf get value catch exception e log severe e get message look and feel laf ui manager get look and feel ini set property ini p ui look plaf get name optional theme ini set property ini p ui theme default theme if theme null laf instanceof metal look and feel string class name laf get class get name if class name equals javax swing plaf metal metal look and feel theme s vp metaltheme else if class name equals org compiere plaf compiere look and feel theme s vp compieretheme else if class name equals com incors plaf kunststoff kunststoff look and feel theme s vp kunststofftheme if theme null laf instanceof metal look and feel theme get value length 0 try class c class for name theme get value metal theme t metal theme c new instance if laf instanceof compiere look and feel compiere look and feel set current theme t else metal look and feel set current theme t boolean flat ini is property bool ini p ui flat compiere theme set theme t flat copies it if not compiere theme ini set property ini p ui theme theme get name catch exception e log severe theme e get message updateui win log config plaf theme printplaf defaults valuenamepair valuenamepair valuenamepair uimanager setlookandfeel getvalue getmessage lookandfeel uimanager getlookandfeel setproperty p_ui_look getname setproperty p_ui_theme metallookandfeel classname getclass getname classname metallookandfeel s_vp_metaltheme classname compierelookandfeel s_vp_compieretheme classname kunststofflookandfeel s_vp_kunststofftheme metallookandfeel getvalue forname getvalue metaltheme metaltheme newinstance compierelookandfeel compierelookandfeel setcurrenttheme metallookandfeel setcurrenttheme ispropertybool p_ui_flat compieretheme settheme compieretheme setproperty p_ui_theme getname getmessage printplafdefaults update ui of this and parent windows param win window public static void updateui window win if win null return window c win do swing utilities update component treeui c c invalidate c pack c validate c repaint c c get owner while c null swingutilities updatecomponenttreeui getowner reset plaf settings param win window to be reset public static void reset window win clean theme properties compiere theme reset sets properties compiereplaf setplaf win compieretheme print current ui defaults public static void printplaf defaults system out println ui manager get look and feel object keys ui manager get look and feel defaults key set to array arrays sort keys char last start for int i 0 i keys length i string buffer sb new string buffer sb append keys i append append ui manager get keys i if keys i to string char at 0 last start system out println last start keys i to string char at 0 system out println sb uidefaults printplafdefaults uimanager getlookandfeel uimanager getlookandfeeldefaults keyset toarray laststart stringbuffer stringbuffer uimanager tostring charat laststart laststart tostring charat is compierel f the active l f return true if l f is compiere public static boolean is active return ui manager get look and feel instanceof compiere look and feel isactive uimanager getlookandfeel compierelookandfeel create ok button return ok button public static c button getok button c button b new c button b set icon new image icon compiereplaf class get resource icons ok24 gif b set margin new insets 0 10 0 10 b set tool tip text s res get string ok return b cbutton getokbutton cbutton cbutton seticon imageicon getresource setmargin settooltiptext s_res getstring create cancel button return cancel button public static c button get cancel button c button b new c button b set icon new image icon compiereplaf class get resource icons cancel24 gif b set margin new insets 0 10 0 10 b set tool tip text s res get string cancel return b cbutton getcancelbutton cbutton cbutton seticon imageicon getresource setmargin settooltiptext s_res getstring center window on screen and show it param window window public static void show center screen window window window pack dimension s size toolkit get default toolkit get screen size dimension w size window get size window set location s size width w size width 2 s size height w size height 2 window to front window set visible true showcenterscreen ssize getdefaulttoolkit getscreensize wsize getsize setlocation ssize wsize ssize wsize tofront setvisible start class with compiere look or compiere plaf editor param args first parameter is class to start if none start plaf editor public static void main string args string j version system get property java version if j version starts with 1 5 j option pane show message dialog null require java version 1 5 or up not j version compiereplaf version conflict j option pane error message system exit 1 set the defined plaf ini load properties true compiere theme load setplaf null if args length 0 compiereplaf frame frame new compiereplaf frame return string class name args 0 find class class start class null try start class class for name class name catch exception e log severe did not find class name e print stack trace system exit 1 try static main method try method methods start class get methods for int i 0 i methods length i if modifier is static methods i get modifiers methods i get name equals main string start args new string args length 1 for int ii 1 ii args length ii start args ii i args ii methods i invoke null new object start args return catch exception ee log severe problems invoking main ee print stack trace start the class try start class new instance catch exception e log severe cannot start class name e print stack trace system exit 1 jversion getproperty jversion startswith joptionpane showmessagedialog jversion joptionpane error_message loadproperties compieretheme compiereplafframe compiereplafframe classname startclass startclass forname classname classname printstacktrace startclass getmethods isstatic getmodifiers getname startargs startargs startargs printstacktrace startclass newinstance classname printstacktrace frame to display editor public compiereplaf frame super compiereplaf set default close operation j frame exit on close set icon image toolkit get default toolkit get image compiereplaf class get resource icons cl16 gif compiereplaf show center screen this compiereplafframe setdefaultcloseoperation jframe exit_on_close seticonimage getdefaulttoolkit getimage getresource showcenterscreen show editor param e event protected void process window event window event e super process window event e if e getid window event window opened compiereplaf editor ed new compiereplaf editor this true dispose processwindowevent windowevent processwindowevent windowevent window_opened compiereplafeditor compiereplafeditor constructor param ctx context param pa reportcolumn id id public m report column properties ctx int pa reportcolumn id string trx name super ctx pa reportcolumn id trx name if pa reportcolumn id 0 set is printed true set seq no 0 pa_reportcolumn_id mreportcolumn pa_reportcolumn_id trxname pa_reportcolumn_id trxname pa_reportcolumn_id setisprinted setseqno constructor param ctx context param rs result set to load from public m report column properties ctx result set rs string trx name super ctx rs trx name resultset mreportcolumn resultset trxname trxname get column sql select clause param with sum with sum function return select clause amt acctcr amt acctdr etc or null if not defined public string get select clause boolean with sum amount type period balance period credit string amount type get amount type substring 0 1 first character string buffer sb new string buffer if with sum sb append sum if amounttype balance equals amount type sb append amt acct dr amt acct cr sb append acct balance account id amt acct dr amt acct cr else if amounttype cr equals amount type sb append amt acct cr else if amounttype dr equals amount type sb append amt acct dr else if amounttype qty equals amount type sb append qty else log log level severe amount type get amount type at amount type return null if with sum sb append return sb to string withsum amtacctcr amtacctdr getselectclause withsum amounttype getamounttype stringbuffer stringbuffer withsum amounttype_balance amounttype amtacctdr amtacctcr acctbalance account_id amtacctdr amtacctcr amounttype_cr amounttype amtacctcr amounttype_dr amounttype amtacctdr amounttype_qty amounttype amounttype getamounttype amounttype withsum tostring is it period info return true if period amount type public boolean is period string at get amount type if at null return false return amounttype periodbalance equals at amounttype periodcreditonly equals at amounttype perioddebitonly equals at amounttype periodquantity equals at isperiod getamounttype amounttype_periodbalance amounttype_periodcreditonly amounttype_perioddebitonly amounttype_periodquantity is it year info return true if year amount type public boolean is year string at get amount type if at null return false return amounttype yearbalance equals at amounttype yearcreditonly equals at amounttype yeardebitonly equals at amounttype yearquantity equals at isyear getamounttype amounttype_yearbalance amounttype_yearcreditonly amounttype_yeardebitonly amounttype_yearquantity is it total info return true if year amount type public boolean is total string at get amount type if at null return false return amounttype totalbalance equals at amounttype totalcreditonly equals at amounttype totaldebitonly equals at amounttype totalquantity equals at istotal getamounttype amounttype_totalbalance amounttype_totalcreditonly amounttype_totaldebitonly amounttype_totalquantity get string representation return string representation public string to string string buffer sb new string buffer m report column append get id append append get name append append get description append seq no append get seq no append amount type append get amount type append currency type append get currency type append append getc currency id append column type append get column type if is column type calculation sb append calculation append get calculation type append append getoper 1 id append append getoper 2 id else if is column type relative period sb append period append get relative period else sb append segment value element type append get element type sb append return sb to string tostring stringbuffer stringbuffer mreportcolumn get_id getname getdescription seqno getseqno amounttype getamounttype currencytype getcurrencytype getc_currency_id columntype getcolumntype iscolumntypecalculation getcalculationtype getoper_1_id getoper_2_id iscolumntyperelativeperiod getrelativeperiod segmentvalue elementtype getelementtype tostring public boolean is calculation type range return calculationtype addrangeop1toop2 equals get calculation type iscalculationtyperange calculationtype_addrangeop1toop2 getcalculationtype return calculationtype addrangeop1toop2 equals get calculation type public boolean is calculation type add return calculationtype addop1plusop2 equals get calculation type calculationtype_addrangeop1toop2 getcalculationtype iscalculationtypeadd calculationtype_addop1plusop2 getcalculationtype return calculationtype addop1plusop2 equals get calculation type public boolean is calculation type subtract return calculationtype subtractop1 op2 equals get calculation type calculationtype_addop1plusop2 getcalculationtype iscalculationtypesubtract calculationtype_subtractop1_op2 getcalculationtype return calculationtype subtractop1 op2 equals get calculation type public boolean is calculation type percent return calculationtype percentageop1ofop2 equals get calculation type calculationtype_subtractop1_op2 getcalculationtype iscalculationtypepercent calculationtype_percentageop1ofop2 getcalculationtype public boolean is column type calculation return columntype calculation equals get column type iscolumntypecalculation columntype_calculation getcolumntype return columntype calculation equals get column type public boolean is column type relative period return columntype relativeperiod equals get column type columntype_calculation getcolumntype iscolumntyperelativeperiod columntype_relativeperiod getcolumntype return columntype relativeperiod equals get column type public boolean is column type segment value return columntype segmentvalue equals get column type columntype_relativeperiod getcolumntype iscolumntypesegmentvalue columntype_segmentvalue getcolumntype public int get relative period as int big decimal bd get relative period if bd null return 0 return bd int value getrelativeperiodasint bigdecimal getrelativeperiod intvalue copy param ctx context param ad client id parent param ad org id parent param pa reportcolumnset id parent param source copy source return report column public static m report column copy properties ctx int ad client id int ad org id int pa reportcolumnset id m report column source string trx name m report column ret value new m report column ctx 0 trx name m report column copy values source ret value ad client id ad org id ret value setpa reportcolumnset id pa reportcolumnset id parent ret value setoper 1 id 0 ret value setoper 2 id 0 return ret value ad_client_id ad_org_id pa_reportcolumnset_id mreportcolumn ad_client_id ad_org_id pa_reportcolumnset_id mreportcolumn trxname mreportcolumn retvalue mreportcolumn trxname mreportcolumn copyvalues retvalue ad_client_id ad_org_id retvalue setpa_reportcolumnset_id pa_reportcolumnset_id retvalue setoper_1_id retvalue setoper_2_id retvalue standard constructor public x c phase properties ctx int c phase id string trx name super ctx c phase id trx name if c phase id 0 setc phase id 0 setc projecttype id 0 set name null set seq no 0 sql select nvl max seq no 0 10 as default value from c phase where c projecttype id c projecttype id set standard qty env zero 1 x_c_phase c_phase_id trxname c_phase_id trxname c_phase_id setc_phase_id setc_projecttype_id setname setseqno seqno defaultvalue c_phase c_projecttype_id c_projecttype_id setstandardqty load constructor public x c phase properties ctx result set rs string trx name super ctx rs trx name x_c_phase resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c phase append get id append return sb to string tostring stringbuffer stringbuffer x_c_phase get_id tostring set standard phase standard phase of the project type public void setc phase id int c phase id if c phase id 1 throw new illegal argument exception c phase id is mandatory set valuenocheck c phase id new integer c phase id setc_phase_id c_phase_id c_phase_id illegalargumentexception c_phase_id set_valuenocheck c_phase_id c_phase_id get standard phase standard phase of the project type public int getc phase id integer ii integer get value c phase id if ii null return 0 return ii int value getc_phase_id get_value c_phase_id intvalue set project type type of the project public void setc projecttype id int c projecttype id if c projecttype id 1 throw new illegal argument exception c projecttype id is mandatory set valuenocheck c projecttype id new integer c projecttype id setc_projecttype_id c_projecttype_id c_projecttype_id illegalargumentexception c_projecttype_id set_valuenocheck c_projecttype_id c_projecttype_id get project type type of the project public int getc projecttype id integer ii integer get value c projecttype id if ii null return 0 return ii int value getc_projecttype_id get_value c_projecttype_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set standard quantity standard quantity public void set standard qty big decimal standard qty if standard qty null throw new illegal argument exception standard qty is mandatory set value standard qty standard qty setstandardqty bigdecimal standardqty standardqty illegalargumentexception standardqty set_value standardqty standardqty get standard quantity standard quantity public big decimal get standard qty big decimal bd big decimal get value standard qty if bd null return env zero return bd bigdecimal getstandardqty bigdecimal bigdecimal get_value standardqty standard constructor public x ad preference properties ctx int ad preference id string trx name super ctx ad preference id trx name if ad preference id 0 setad preference id 0 set attribute null set value null x_ad_preference ad_preference_id trxname ad_preference_id trxname ad_preference_id setad_preference_id setattribute setvalue load constructor public x ad preference properties ctx result set rs string trx name super ctx rs trx name x_ad_preference resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad preference append get id append return sb to string tostring stringbuffer stringbuffer x_ad_preference get_id tostring set preference personal value preference public void setad preference id int ad preference id if ad preference id 1 throw new illegal argument exception ad preference id is mandatory set valuenocheck ad preference id new integer ad preference id setad_preference_id ad_preference_id ad_preference_id illegalargumentexception ad_preference_id set_valuenocheck ad_preference_id ad_preference_id get preference personal value preference public int getad preference id integer ii integer get value ad preference id if ii null return 0 return ii int value getad_preference_id get_value ad_preference_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set window data entry or display window public void setad window id int ad window id if ad window id 0 set value ad window id null else set value ad window id new integer ad window id setad_window_id ad_window_id ad_window_id set_value ad_window_id set_value ad_window_id ad_window_id get window data entry or display window public int getad window id integer ii integer get value ad window id if ii null return 0 return ii int value getad_window_id get_value ad_window_id intvalue set attribute public void set attribute string attribute if attribute null throw new illegal argument exception attribute is mandatory if attribute length 60 log warning length 60 truncated attribute attribute substring 0 59 set value attribute attribute setattribute illegalargumentexception set_value get attribute public string get attribute return string get value attribute getattribute get_value return string get value attribute public key name pair get key name pair return new key name pair get id get attribute get_value keynamepair getkeynamepair keynamepair get_id getattribute set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 60 log warning length 60 truncated value value substring 0 59 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value constructor param ctx context param c location id location param font font param color color public location element properties ctx int c location id font font paint color super 10 1 max set gap 0 0 m location ml m location get ctx c location id null log fine c location id c location id if ml null int index 0 if ml is address lines reverse set data index 0 ml get country true font color string lines pattern compile pattern multiline split ml get city region postal for int i 0 i lines length i set data index 0 lines i font color if ml get address4 null ml get address4 length 0 set data index 0 ml get address4 font color if ml get address3 null ml get address3 length 0 set data index 0 ml get address3 font color if ml get address2 null ml get address2 length 0 set data index 0 ml get address2 font color if ml get address1 null ml get address1 length 0 set data index 0 ml get address1 font color else if ml get address1 null ml get address1 length 0 set data index 0 ml get address1 font color if ml get address2 null ml get address2 length 0 set data index 0 ml get address2 font color if ml get address3 null ml get address3 length 0 set data index 0 ml get address3 font color if ml get address4 null ml get address4 length 0 set data index 0 ml get address4 font color string lines pattern compile pattern multiline split ml get city region postal for int i 0 i lines length i set data index 0 lines i font color set data index 0 ml get country true font color c_location_id locationelement c_location_id setgap mlocation mlocation c_location_id c_location_id c_location_id isaddresslinesreverse setdata getcountry getcityregionpostal setdata getaddress4 getaddress4 setdata getaddress4 getaddress3 getaddress3 setdata getaddress3 getaddress2 getaddress2 setdata getaddress2 getaddress1 getaddress1 setdata getaddress1 getaddress1 getaddress1 setdata getaddress1 getaddress2 getaddress2 setdata getaddress2 getaddress3 getaddress3 setdata getaddress3 getaddress4 getaddress4 setdata getaddress4 getcityregionpostal setdata setdata getcountry get contact interest param ctx context param r interestarea id interest ares param ad user id user param is active create as active return contact interest public static m contact interest get properties ctx int r interestarea id int ad user id boolean is active string trx name m contact interest ret value null string sql select from r contactinterest where r interestarea id and ad user id prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 r interestarea id pstmt set int 2 ad user id result set rs pstmt execute query if rs next ret value new m contact interest ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null if ret value null ret value new m contact interest ctx r interestarea id ad user id is active trx name s log fine not found ret value else s log fine found ret value return ret value r_interestarea_id ad_user_id isactive mcontactinterest r_interestarea_id ad_user_id isactive trxname mcontactinterest retvalue r_contactinterest r_interestarea_id ad_user_id preparedstatement preparestatement trxname setint r_interestarea_id setint ad_user_id resultset executequery retvalue mcontactinterest trxname s_log retvalue retvalue mcontactinterest r_interestarea_id ad_user_id isactive trxname s_log retvalue s_log retvalue retvalue persistency constructor param ctx context param ignored ignored public m contact interest properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mcontactinterest trxname trxname illegalargumentexception constructor param ctx context param r interestarea id interest area param ad user id partner contact param is active create as active public m contact interest properties ctx int r interestarea id int ad user id boolean is active string trx name super ctx 0 trx name setr interestarea id r interestarea id setad user id ad user id set is active is active r_interestarea_id ad_user_id isactive mcontactinterest r_interestarea_id ad_user_id isactive trxname trxname setr_interestarea_id r_interestarea_id setad_user_id ad_user_id setisactive isactive create load existing persistent object param ctx context param rs load from current result set position no navigation not closed public m contact interest properties ctx result set rs string trx name super ctx rs trx name mcontactinterest resultset trxname trxname set opt out date user action only param opt out date date public void set opt out date timestamp opt out date if opt out date null opt out date new timestamp system current time millis log fine opt out date super set opt out date opt out date set is active false optout optoutdate setoptoutdate optoutdate optoutdate optoutdate currenttimemillis optoutdate setoptoutdate optoutdate setisactive unsubscribe user action only public void unsubscribe set opt out date null setoptoutdate is opted out return true if opted out public boolean is opt out return get opt out date null isoptout getoptoutdate set subscribe date user action only param subscribe date date public void set subscribe date timestamp subscribe date if subscribe date null subscribe date new timestamp system current time millis log fine subscribe date super set subscribe date subscribe date super set opt out date null set is active true subscribedate setsubscribedate subscribedate subscribedate subscribedate currenttimemillis subscribedate setsubscribedate subscribedate setoptoutdate setisactive subscribe user action only public void subscribe set subscribe date null if is active set is active true setsubscribedate isactive setisactive subscribe user action only public void subscribe boolean subscribe if subscribe set subscribe date null else set opt out date null setsubscribedate setoptoutdate is subscribed active is set internally the opt out date is set by the user via the web ui return true if subscribed public boolean is subscribed return is active get opt out date null issubscribed isactive getoptoutdate string representation return info public string to string string buffer sb new string buffer m contact interest append r interestarea id append getr interestarea id append ad user id append getad user id append subscribed append is subscribed append return sb to string tostring stringbuffer stringbuffer mcontactinterest r_interestarea_id getr_interestarea_id ad_user_id getad_user_id issubscribed tostring public static void main string args org compiere compiere startup true int r interestarea id 1000002 int ad user id 1000002 m contact interest ci m contact interest get env get ctx r interestarea id ad user id false null ci subscribe ci save ci m contact interest get env get ctx r interestarea id ad user id false null r_interestarea_id ad_user_id mcontactinterest mcontactinterest getctx r_interestarea_id ad_user_id mcontactinterest getctx r_interestarea_id ad_user_id standard constructor public x r requestaction properties ctx int r requestaction id string trx name super ctx r requestaction id trx name if r requestaction id 0 setr requestaction id 0 setr request id 0 x_r_requestaction r_requestaction_id trxname r_requestaction_id trxname r_requestaction_id setr_requestaction_id setr_request_id load constructor public x r requestaction properties ctx result set rs string trx name super ctx rs trx name x_r_requestaction resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestaction append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestaction get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 set valuenocheck ad role id null else set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_valuenocheck ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set valuenocheck ad user id null else set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_valuenocheck ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set asset asset used internally or by customers public void seta asset id int a asset id if a asset id 0 set valuenocheck a asset id null else set valuenocheck a asset id new integer a asset id seta_asset_id a_asset_id a_asset_id set_valuenocheck a_asset_id set_valuenocheck a_asset_id a_asset_id get asset asset used internally or by customers public int geta asset id integer ii integer get value a asset id if ii null return 0 return ii int value geta_asset_id get_value a_asset_id intvalue set activity business activity public void setc activity id int c activity id if c activity id 0 set valuenocheck c activity id null else set valuenocheck c activity id new integer c activity id setc_activity_id c_activity_id c_activity_id set_valuenocheck c_activity_id set_valuenocheck c_activity_id c_activity_id get activity business activity public int getc activity id integer ii integer get value c activity id if ii null return 0 return ii int value getc_activity_id get_value c_activity_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set valuenocheck c bpartner id null else set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_valuenocheck c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set order order public void setc order id int c order id if c order id 0 set valuenocheck c order id null else set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id set_valuenocheck c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue set payment payment identifier public void setc payment id int c payment id if c payment id 0 set valuenocheck c payment id null else set valuenocheck c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_valuenocheck c_payment_id set_valuenocheck c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set project financial project public void setc project id int c project id if c project id 0 set valuenocheck c project id null else set valuenocheck c project id new integer c project id setc_project_id c_project_id c_project_id set_valuenocheck c_project_id set_valuenocheck c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue public static final string confidentialtype privateinformation p set confidentiality type of confidentiality public void set confidential type string confidential type if confidential type null throw new illegal argument exception confidential type is mandatory if confidential type null confidential type equals a confidential type equals c confidential type equals i confidential type equals p else throw new illegal argument exception confidential type invalid value confidential type reference id 340 a c i p if confidential type null confidential type length 1 log warning length 1 truncated confidential type confidential type substring 0 0 set valuenocheck confidential type confidential type confidentialtype_privateinformation setconfidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype confidentialtype confidentialtype confidentialtype confidentialtype illegalargumentexception confidentialtype confidentialtype reference_id confidentialtype confidentialtype confidentialtype confidentialtype set_valuenocheck confidentialtype confidentialtype get confidentiality type of confidentiality public string get confidential type return string get value confidential type getconfidentialtype get_value confidentialtype set complete plan planned completion date public void set date complete plan timestamp date complete plan set value date complete plan date complete plan setdatecompleteplan datecompleteplan set_value datecompleteplan datecompleteplan get complete plan planned completion date public timestamp get date complete plan return timestamp get value date complete plan getdatecompleteplan get_value datecompleteplan set date next action date that this request should be acted on public void set date next action timestamp date next action set valuenocheck date next action date next action setdatenextaction datenextaction set_valuenocheck datenextaction datenextaction get date next action date that this request should be acted on public timestamp get date next action return timestamp get value date next action getdatenextaction get_value datenextaction set start plan planned start date public void set date start plan timestamp date start plan set value date start plan date start plan setdatestartplan datestartplan set_value datestartplan datestartplan get start plan planned start date public timestamp get date start plan return timestamp get value date start plan getdatestartplan get_value datestartplan set end date last effective date inclusive public void set end date timestamp end date set value end date end date setenddate enddate set_value enddate enddate get end date last effective date inclusive public timestamp get end date return timestamp get value end date getenddate get_value enddate public static final string isescalated yes y set escalated this request has been escalated public void set is escalated string is escalated if is escalated null throw new illegal argument exception is escalated is mandatory if is escalated null is escalated equals n is escalated equals y else throw new illegal argument exception is escalated invalid value is escalated reference id 319 n y if is escalated null is escalated length 1 log warning length 1 truncated is escalated is escalated substring 0 0 set valuenocheck is escalated is escalated isescalated_yes setisescalated isescalated isescalated illegalargumentexception isescalated isescalated isescalated isescalated illegalargumentexception isescalated isescalated reference_id isescalated isescalated isescalated isescalated set_valuenocheck isescalated isescalated get escalated this request has been escalated public string get is escalated return string get value is escalated getisescalated get_value isescalated public static final string isinvoiced yes y set invoiced is this invoiced public void set is invoiced string is invoiced if is invoiced null throw new illegal argument exception is invoiced is mandatory if is invoiced null is invoiced equals n is invoiced equals y else throw new illegal argument exception is invoiced invalid value is invoiced reference id 319 n y if is invoiced null is invoiced length 1 log warning length 1 truncated is invoiced is invoiced substring 0 0 set valuenocheck is invoiced is invoiced isinvoiced_yes setisinvoiced isinvoiced isinvoiced illegalargumentexception isinvoiced isinvoiced isinvoiced isinvoiced illegalargumentexception isinvoiced isinvoiced reference_id isinvoiced isinvoiced isinvoiced isinvoiced set_valuenocheck isinvoiced isinvoiced get invoiced is this invoiced public string get is invoiced return string get value is invoiced getisinvoiced get_value isinvoiced public static final string isselfservice yes y set self service this is a self service entry or this entry can be changed via self service public void set is self service string is self service if is self service null throw new illegal argument exception is self service is mandatory if is self service null is self service equals n is self service equals y else throw new illegal argument exception is self service invalid value is self service reference id 319 n y if is self service null is self service length 1 log warning length 1 truncated is self service is self service substring 0 0 set valuenocheck is self service is self service isselfservice_yes setisselfservice isselfservice isselfservice illegalargumentexception isselfservice isselfservice isselfservice isselfservice illegalargumentexception isselfservice isselfservice reference_id isselfservice isselfservice isselfservice isselfservice set_valuenocheck isselfservice isselfservice get self service this is a self service entry or this entry can be changed via self service public string get is self service return string get value is self service getisselfservice get_value isselfservice set shipment receipt material shipment document public void setm inout id int m inout id if m inout id 0 set valuenocheck m inout id null else set valuenocheck m inout id new integer m inout id setm_inout_id m_inout_id m_inout_id set_valuenocheck m_inout_id set_valuenocheck m_inout_id m_inout_id get shipment receipt material shipment document public int getm inout id integer ii integer get value m inout id if ii null return 0 return ii int value getm_inout_id get_value m_inout_id intvalue public static final int m productspent id ad reference id 162 set product used product resource service used in request public void setm productspent id int m productspent id if m productspent id 0 set value m productspent id null else set value m productspent id new integer m productspent id m_productspent_id_ad_reference_id setm_productspent_id m_productspent_id m_productspent_id set_value m_productspent_id set_value m_productspent_id m_productspent_id get product used product resource service used in request public int getm productspent id integer ii integer get value m productspent id if ii null return 0 return ii int value getm_productspent_id get_value m_productspent_id intvalue set product product service item public void setm product id int m product id if m product id 0 set valuenocheck m product id null else set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id set_valuenocheck m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set rma return material authorization public void setm rma id int m rma id if m rma id 0 set valuenocheck m rma id null else set valuenocheck m rma id new integer m rma id setm_rma_id m_rma_id m_rma_id set_valuenocheck m_rma_id set_valuenocheck m_rma_id m_rma_id get rma return material authorization public int getm rma id integer ii integer get value m rma id if ii null return 0 return ii int value getm_rma_id get_value m_rma_id intvalue set null columns columns with null value public void set null columns string null columns if null columns null null columns length 255 log warning length 255 truncated null columns null columns substring 0 254 set valuenocheck null columns null columns setnullcolumns nullcolumns nullcolumns nullcolumns nullcolumns nullcolumns set_valuenocheck nullcolumns nullcolumns get null columns columns with null value public string get null columns return string get value null columns getnullcolumns get_value nullcolumns public static final string priority minor 9 set priority indicates if this request is of a high medium or low priority public void set priority string priority if priority null throw new illegal argument exception priority is mandatory if priority null priority equals 1 priority equals 3 priority equals 5 priority equals 7 priority equals 9 else throw new illegal argument exception priority invalid value priority reference id 154 1 3 5 7 9 if priority null priority length 1 log warning length 1 truncated priority priority substring 0 0 set valuenocheck priority priority priority_minor setpriority illegalargumentexception illegalargumentexception reference_id set_valuenocheck get priority indicates if this request is of a high medium or low priority public string get priority return string get value priority getpriority get_value public static final string priorityuser minor 9 set user importance priority of the issue for the user public void set priority user string priority user if priority user null throw new illegal argument exception priority user is mandatory if priority user null priority user equals 1 priority user equals 3 priority user equals 5 priority user equals 7 priority user equals 9 else throw new illegal argument exception priority user invalid value priority user reference id 154 1 3 5 7 9 if priority user null priority user length 1 log warning length 1 truncated priority user priority user substring 0 0 set valuenocheck priority user priority user priorityuser_minor setpriorityuser priorityuser priorityuser illegalargumentexception priorityuser priorityuser priorityuser priorityuser priorityuser priorityuser priorityuser illegalargumentexception priorityuser priorityuser reference_id priorityuser priorityuser priorityuser priorityuser set_valuenocheck priorityuser priorityuser get user importance priority of the issue for the user public string get priority user return string get value priority user getpriorityuser get_value priorityuser set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set quantity plan planned quantity public void set qty plan big decimal qty plan set value qty plan qty plan setqtyplan bigdecimal qtyplan set_value qtyplan qtyplan get quantity plan planned quantity public big decimal get qty plan big decimal bd big decimal get value qty plan if bd null return env zero return bd bigdecimal getqtyplan bigdecimal bigdecimal get_value qtyplan set quantity used quantity used for this event public void set qty spent big decimal qty spent set value qty spent qty spent setqtyspent bigdecimal qtyspent set_value qtyspent qtyspent get quantity used quantity used for this event public big decimal get qty spent big decimal bd big decimal get value qty spent if bd null return env zero return bd bigdecimal getqtyspent bigdecimal bigdecimal get_value qtyspent set category request category public void setr category id int r category id if r category id 0 set valuenocheck r category id null else set valuenocheck r category id new integer r category id setr_category_id r_category_id r_category_id set_valuenocheck r_category_id set_valuenocheck r_category_id r_category_id get category request category public int getr category id integer ii integer get value r category id if ii null return 0 return ii int value getr_category_id get_value r_category_id intvalue set group request group public void setr group id int r group id if r group id 0 set valuenocheck r group id null else set valuenocheck r group id new integer r group id setr_group_id r_group_id r_group_id set_valuenocheck r_group_id set_valuenocheck r_group_id r_group_id get group request group public int getr group id integer ii integer get value r group id if ii null return 0 return ii int value getr_group_id get_value r_group_id intvalue set request history request has been changed public void setr requestaction id int r requestaction id if r requestaction id 1 throw new illegal argument exception r requestaction id is mandatory set valuenocheck r requestaction id new integer r requestaction id setr_requestaction_id r_requestaction_id r_requestaction_id illegalargumentexception r_requestaction_id set_valuenocheck r_requestaction_id r_requestaction_id get request history request has been changed public int getr requestaction id integer ii integer get value r requestaction id if ii null return 0 return ii int value getr_requestaction_id get_value r_requestaction_id intvalue set request type type of request e g inquiry complaint public void setr requesttype id int r requesttype id if r requesttype id 0 set valuenocheck r requesttype id null else set valuenocheck r requesttype id new integer r requesttype id setr_requesttype_id r_requesttype_id r_requesttype_id set_valuenocheck r_requesttype_id set_valuenocheck r_requesttype_id r_requesttype_id get request type type of request e g inquiry complaint public int getr requesttype id integer ii integer get value r requesttype id if ii null return 0 return ii int value getr_requesttype_id get_value r_requesttype_id intvalue set request request from a business partner or prospect public void setr request id int r request id if r request id 1 throw new illegal argument exception r request id is mandatory set valuenocheck r request id new integer r request id setr_request_id r_request_id r_request_id illegalargumentexception r_request_id set_valuenocheck r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue set resolution request resolution public void setr resolution id int r resolution id if r resolution id 0 set valuenocheck r resolution id null else set valuenocheck r resolution id new integer r resolution id setr_resolution_id r_resolution_id r_resolution_id set_valuenocheck r_resolution_id set_valuenocheck r_resolution_id r_resolution_id get resolution request resolution public int getr resolution id integer ii integer get value r resolution id if ii null return 0 return ii int value getr_resolution_id get_value r_resolution_id intvalue set status request status public void setr status id int r status id if r status id 0 set valuenocheck r status id null else set valuenocheck r status id new integer r status id setr_status_id r_status_id r_status_id set_valuenocheck r_status_id set_valuenocheck r_status_id r_status_id get status request status public int getr status id integer ii integer get value r status id if ii null return 0 return ii int value getr_status_id get_value r_status_id intvalue public static final int salesrep id ad reference id 110 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 0 set valuenocheck salesrep id null else set valuenocheck salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id set_valuenocheck salesrep_id set_valuenocheck salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue set start date first effective day inclusive public void set start date timestamp start date set value start date start date setstartdate startdate set_value startdate startdate get start date first effective day inclusive public timestamp get start date return timestamp get value start date getstartdate get_value startdate set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set valuenocheck summary summary setsummary set_valuenocheck get summary textual summary of this request public string get summary return string get value summary getsummary get_value public static final string taskstatus 100complete d set task status status of the task public void set task status string task status if task status null throw new illegal argument exception task status is mandatory if task status null task status equals 0 task status equals 2 task status equals 4 task status equals 6 task status equals 8 task status equals 9 task status equals a task status equals c task status equals d else throw new illegal argument exception task status invalid value task status reference id 366 0 2 4 6 8 9 a c d if task status null task status length 1 log warning length 1 truncated task status task status substring 0 0 set value task status task status taskstatus_100complete settaskstatus taskstatus taskstatus illegalargumentexception taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus taskstatus illegalargumentexception taskstatus taskstatus reference_id taskstatus taskstatus taskstatus taskstatus set_value taskstatus taskstatus get task status status of the task public string get task status return string get value task status gettaskstatus get_value taskstatus standard constructor public x pa ratioelement properties ctx int pa ratioelement id string trx name super ctx pa ratioelement id trx name if pa ratioelement id 0 set name null setpa ratioelement id 0 setpa ratio id 0 set ratio element type null set ratio operand null p set seq no 0 x_pa_ratioelement pa_ratioelement_id trxname pa_ratioelement_id trxname pa_ratioelement_id setname setpa_ratioelement_id setpa_ratio_id setratioelementtype setratiooperand setseqno load constructor public x pa ratioelement properties ctx result set rs string trx name super ctx rs trx name x_pa_ratioelement resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa ratioelement append get id append return sb to string tostring stringbuffer stringbuffer x_pa_ratioelement get_id tostring public static final int account id ad reference id 331 set account account used public void setaccount id int account id if account id 0 set value account id null else set value account id new integer account id account_id_ad_reference_id setaccount_id account_id account_id set_value account_id set_value account_id account_id get account account used public int getaccount id integer ii integer get value account id if ii null return 0 return ii int value getaccount_id get_value account_id intvalue set constant value constant value public void set constant value big decimal constant value set value constant value constant value setconstantvalue bigdecimal constantvalue set_value constantvalue constantvalue get constant value constant value public big decimal get constant value big decimal bd big decimal get value constant value if bd null return env zero return bd bigdecimal getconstantvalue bigdecimal bigdecimal get_value constantvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set measure calculation calculation method for measuring performance public void setpa measurecalc id int pa measurecalc id if pa measurecalc id 0 set value pa measurecalc id null else set value pa measurecalc id new integer pa measurecalc id setpa_measurecalc_id pa_measurecalc_id pa_measurecalc_id set_value pa_measurecalc_id set_value pa_measurecalc_id pa_measurecalc_id get measure calculation calculation method for measuring performance public int getpa measurecalc id integer ii integer get value pa measurecalc id if ii null return 0 return ii int value getpa_measurecalc_id get_value pa_measurecalc_id intvalue set ratio element performance ratio element public void setpa ratioelement id int pa ratioelement id if pa ratioelement id 1 throw new illegal argument exception pa ratioelement id is mandatory set valuenocheck pa ratioelement id new integer pa ratioelement id setpa_ratioelement_id pa_ratioelement_id pa_ratioelement_id illegalargumentexception pa_ratioelement_id set_valuenocheck pa_ratioelement_id pa_ratioelement_id get ratio element performance ratio element public int getpa ratioelement id integer ii integer get value pa ratioelement id if ii null return 0 return ii int value getpa_ratioelement_id get_value pa_ratioelement_id intvalue public static final int pa ratioused id ad reference id 371 set ratio used performace ratio used public void setpa ratioused id int pa ratioused id if pa ratioused id 0 set value pa ratioused id null else set value pa ratioused id new integer pa ratioused id pa_ratioused_id_ad_reference_id setpa_ratioused_id pa_ratioused_id pa_ratioused_id set_value pa_ratioused_id set_value pa_ratioused_id pa_ratioused_id get ratio used performace ratio used public int getpa ratioused id integer ii integer get value pa ratioused id if ii null return 0 return ii int value getpa_ratioused_id get_value pa_ratioused_id intvalue set ratio performace ratio public void setpa ratio id int pa ratio id if pa ratio id 1 throw new illegal argument exception pa ratio id is mandatory set valuenocheck pa ratio id new integer pa ratio id setpa_ratio_id pa_ratio_id pa_ratio_id illegalargumentexception pa_ratio_id set_valuenocheck pa_ratio_id pa_ratio_id get ratio performace ratio public int getpa ratio id integer ii integer get value pa ratio id if ii null return 0 return ii int value getpa_ratio_id get_value pa_ratio_id intvalue public static final string postingtype statistical s set posting type the type of posted amount for the transaction public void set posting type string posting type if posting type null throw new illegal argument exception posting type is mandatory if posting type null posting type equals a posting type equals b posting type equals e posting type equals r posting type equals s else throw new illegal argument exception posting type invalid value posting type reference id 125 a b e r s if posting type null posting type length 1 log warning length 1 truncated posting type posting type substring 0 0 set value posting type posting type postingtype_statistical postingtype setpostingtype postingtype postingtype illegalargumentexception postingtype postingtype postingtype postingtype postingtype postingtype postingtype illegalargumentexception postingtype postingtype reference_id postingtype postingtype postingtype postingtype set_value postingtype postingtype get posting type the type of posted amount for the transaction public string get posting type return string get value posting type postingtype getpostingtype get_value postingtype public static final string ratioelementtype calculation x set element type ratio element type public void set ratio element type string ratio element type if ratio element type null throw new illegal argument exception ratio element type is mandatory if ratio element type equals a ratio element type equals c ratio element type equals r ratio element type equals x else throw new illegal argument exception ratio element type invalid value ratio element type reference id 372 a c r x if ratio element type length 1 log warning length 1 truncated ratio element type ratio element type substring 0 0 set value ratio element type ratio element type ratioelementtype_calculation setratioelementtype ratioelementtype ratioelementtype illegalargumentexception ratioelementtype ratioelementtype ratioelementtype ratioelementtype ratioelementtype illegalargumentexception ratioelementtype ratioelementtype reference_id ratioelementtype ratioelementtype ratioelementtype set_value ratioelementtype ratioelementtype get element type ratio element type public string get ratio element type return string get value ratio element type getratioelementtype get_value ratioelementtype public static final string ratiooperand plus p set operand ratio operand public void set ratio operand string ratio operand if ratio operand null throw new illegal argument exception ratio operand is mandatory if ratio operand equals d ratio operand equals m ratio operand equals n ratio operand equals p else throw new illegal argument exception ratio operand invalid value ratio operand reference id 373 d m n p if ratio operand length 1 log warning length 1 truncated ratio operand ratio operand substring 0 0 set value ratio operand ratio operand ratiooperand_plus setratiooperand ratiooperand ratiooperand illegalargumentexception ratiooperand ratiooperand ratiooperand ratiooperand ratiooperand illegalargumentexception ratiooperand ratiooperand reference_id ratiooperand ratiooperand ratiooperand set_value ratiooperand ratiooperand get operand ratio operand public string get ratio operand return string get value ratio operand getratiooperand get_value ratiooperand set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno standard constructor public x r requestupdate properties ctx int r requestupdate id string trx name super ctx r requestupdate id trx name if r requestupdate id 0 set confidential type entry null setr requestupdate id 0 setr request id 0 x_r_requestupdate r_requestupdate_id trxname r_requestupdate_id trxname r_requestupdate_id setconfidentialtypeentry setr_requestupdate_id setr_request_id load constructor public x r requestupdate properties ctx result set rs string trx name super ctx rs trx name x_r_requestupdate resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r requestupdate append get id append return sb to string tostring stringbuffer stringbuffer x_r_requestupdate get_id tostring public static final string confidentialtypeentry privateinformation p set entry confidentiality confidentiality of the individual entry public void set confidential type entry string confidential type entry if confidential type entry null throw new illegal argument exception confidential type entry is mandatory if confidential type entry equals a confidential type entry equals c confidential type entry equals i confidential type entry equals p else throw new illegal argument exception confidential type entry invalid value confidential type entry reference id 340 a c i p if confidential type entry length 1 log warning length 1 truncated confidential type entry confidential type entry substring 0 0 set value confidential type entry confidential type entry confidentialtypeentry_privateinformation setconfidentialtypeentry confidentialtypeentry confidentialtypeentry illegalargumentexception confidentialtypeentry confidentialtypeentry confidentialtypeentry confidentialtypeentry confidentialtypeentry illegalargumentexception confidentialtypeentry confidentialtypeentry reference_id confidentialtypeentry confidentialtypeentry confidentialtypeentry set_value confidentialtypeentry confidentialtypeentry get entry confidentiality confidentiality of the individual entry public string get confidential type entry return string get value confidential type entry getconfidentialtypeentry get_value confidentialtypeentry set end time end of the time span public void set end time timestamp end time set value end time end time setendtime endtime set_value endtime endtime get end time end of the time span public timestamp get end time return timestamp get value end time getendtime get_value endtime public static final int m productspent id ad reference id 162 set product used product resource service used in request public void setm productspent id int m productspent id if m productspent id 0 set value m productspent id null else set value m productspent id new integer m productspent id m_productspent_id_ad_reference_id setm_productspent_id m_productspent_id m_productspent_id set_value m_productspent_id set_value m_productspent_id m_productspent_id get product used product resource service used in request public int getm productspent id integer ii integer get value m productspent id if ii null return 0 return ii int value getm_productspent_id get_value m_productspent_id intvalue set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced set value qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced set_value qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set quantity used quantity used for this event public void set qty spent big decimal qty spent set value qty spent qty spent setqtyspent bigdecimal qtyspent set_value qtyspent qtyspent get quantity used quantity used for this event public big decimal get qty spent big decimal bd big decimal get value qty spent if bd null return env zero return bd bigdecimal getqtyspent bigdecimal bigdecimal get_value qtyspent set request update request updates public void setr requestupdate id int r requestupdate id if r requestupdate id 1 throw new illegal argument exception r requestupdate id is mandatory set valuenocheck r requestupdate id new integer r requestupdate id setr_requestupdate_id r_requestupdate_id r_requestupdate_id illegalargumentexception r_requestupdate_id set_valuenocheck r_requestupdate_id r_requestupdate_id get request update request updates public int getr requestupdate id integer ii integer get value r requestupdate id if ii null return 0 return ii int value getr_requestupdate_id get_value r_requestupdate_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getr requestupdate id intvalue keynamepair getkeynamepair keynamepair get_id valueof getr_requestupdate_id set request request from a business partner or prospect public void setr request id int r request id if r request id 1 throw new illegal argument exception r request id is mandatory set valuenocheck r request id new integer r request id setr_request_id r_request_id r_request_id illegalargumentexception r_request_id set_valuenocheck r_request_id r_request_id get request request from a business partner or prospect public int getr request id integer ii integer get value r request id if ii null return 0 return ii int value getr_request_id get_value r_request_id intvalue set result result of the action taken public void set result string result if result null result length 2000 log warning length 2000 truncated result result substring 0 1999 set valuenocheck result result setresult set_valuenocheck get result result of the action taken public string get result return string get value result getresult get_value set start time time started public void set start time timestamp start time set value start time start time setstarttime starttime set_value starttime starttime get start time time started public timestamp get start time return timestamp get value start time getstarttime get_value starttime prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else if name equals date invoiced m dateinvoiced from timestamp para i get parameter m dateinvoiced to timestamp para i getparameter to else if name equals e mailpdf p emailpdf y equals para i get parameter else if name equals r mailtext id p r mailtext id para i get parameter as int else if name equals c bpartner id m c bpartner id para i get parameter as int else if name equals c invoice id m c invoice id para i get parameter as int else if name equals document no m documentno from string para i get parameter m documentno to string para i getparameter to else log log level severe prepare unknown parameter name if m documentno from null m documentno from length 0 m documentno from null if m documentno to null m documentno to length 0 m documentno to null processinfoparameter getparameter getparametername getparameter dateinvoiced m_dateinvoiced_from getparameter m_dateinvoiced_to getparameter_to emailpdf p_emailpdf getparameter r_mailtext_id p_r_mailtext_id getparameterasint c_bpartner_id m_c_bpartner_id getparameterasint c_invoice_id m_c_invoice_id getparameterasint documentno m_documentno_from getparameter m_documentno_to getparameter_to m_documentno_from m_documentno_from m_documentno_from m_documentno_to m_documentno_to m_documentno_to perrform process return message throws exception protected string do it throws java lang exception need to have template if p emailpdf p r mailtext id 0 throw new compiere user error not found r mailtext id m mail text m text null if p r mailtext id 0 m text new m mail text get ctx p r mailtext id get trxname if m text get id p r mailtext id throw new compiere user error not found r mailtext id p r mailtext id too broad selection if m c bpartner id 0 m c invoice id 0 m dateinvoiced from null m dateinvoiced to null m documentno from null m documentno to null throw new compiere user error restrict selection m client client m client get get ctx get info string buffer sql new string buffer select i c invoice id bp ad language c is multi lingual document 1 3 prio 1 b partner 2 doc type 3 print format org see report ctl m invoice coalesce bp invoice printformat id dt ad printformat id pf invoice printformat id 4 dt document copies bp document copies 5 bpc ad user id i document no 6 7 bp c bpartner id 8 from c invoice i inner join c bpartner bp on i c bpartner id bp c bpartner id left outer join ad user bpc on i ad user id bpc ad user id inner join ad client c on i ad client id c ad client id inner join ad printform pf on i ad client id pf ad client id inner join c doctype dt on i c doctype id dt c doctype id append where pf ad org id in 0 i ad org id and more them 1 pf boolean need and false if m c invoice id 0 sql append i c invoice id append m c invoice id else if m c bpartner id 0 sql append i c bpartner id append m c bpartner id need and true if m dateinvoiced from null m dateinvoiced to null if need and sql append and sql append trunc i date invoiced between append db to date m dateinvoiced from true append and append db to date m dateinvoiced to true need and true else if m dateinvoiced from null if need and sql append and sql append trunc i date invoiced append db to date m dateinvoiced from true need and true else if m dateinvoiced to null if need and sql append and sql append trunc i date invoiced append db to date m dateinvoiced to true need and true else if m documentno from null m documentno to null if need and sql append and sql append i document no between append db to string m documentno from append and append db to string m documentno to else if m documentno from null if need and sql append and if m documentno from index of 1 sql append i document no append db to string m documentno from else sql append i document no like append db to string m documentno from sql append order by i c invoice id pf ad org id desc more than 1 pf record log fine sql to string m print format format null int old ad printformat id 1 int old c invoice id 1 int c bpartner id 0 int count 0 int errors 0 try statement stmt db create statement result set rs stmt execute query sql to string while rs next int c invoice id rs get int 1 if c invoice id old c invoice id multiple pf records continue old c invoice id c invoice id set language when enabled language language language get login language base language string ad language rs get string 2 if ad language null y equals rs get string 3 language language get language ad language int ad printformat id rs get int 4 int copies rs get int 5 if copies 0 copies 1 int ad user id rs get int 6 m user to new m user get ctx ad user id get trxname string document no rs get string 7 c bpartner id rs get int 8 string document dir client get document dir if document dir null document dir length 0 document dir if p emailpdf to get id 0 to gete mail null to gete mail length 0 add log c invoice id null null document no request actione mail no to errors continue if ad printformat id 0 add log c invoice id null null document no no print format errors continue get format data if ad printformat id old ad printformat id format m print format get get ctx ad printformat id false old ad printformat id ad printformat id format set language language format set translation language language query m query query new m query c invoice header v query add restriction c invoice id m query equal new integer c invoice id engine print info info new print info document no x c invoice table id c invoice id c bpartner id info set copies copies report engine re new report engine get ctx format query info boolean printed false if p emailpdf string subject m text get mail header document no e mail email client createe mail to gete mail subject null if email is valid add log c invoice id null null document no request actione mail error invalid e mail to errors continue m text set user to context m text setb partner c bpartner id context m text setpo new m invoice get ctx c invoice id get trxname string message m text get mail text true if m text is html email set messagehtml subject message else email set subject subject email set message text message file invoice null if ini is client invoice new file m invoice getpdf file name document dir c invoice id file attachment re getpdf invoice log fine to attachment email add attachment attachment string msg email send m user mail um new m user mail m text getad user id email um save if msg equals e mail sent ok add log c invoice id null null document no request actione mailok to gete mail count printed true else add log c invoice id null null document no request actione mail error msg to gete mail errors else re print count printed true print confirm if printed string buffer sb new string buffer update c invoice set date printed sys date is printed y where c invoice id append c invoice id int no db execute update sb to string get trxname for all entries rs close stmt close catch exception e log log level severe do it sql e throw new exception e if p emailpdf return sent count errors errors return printed count doit p_emailpdf p_r_mailtext_id compiereusererror notfound r_mailtext_id mmailtext mtext p_r_mailtext_id mtext mmailtext getctx p_r_mailtext_id get_trxname mtext get_id p_r_mailtext_id compiereusererror notfound r_mailtext_id p_r_mailtext_id m_c_bpartner_id m_c_invoice_id m_dateinvoiced_from m_dateinvoiced_to m_documentno_from m_documentno_to compiereusererror restrictselection mclient mclient getctx stringbuffer stringbuffer c_invoice_id ad_language ismultilingualdocument bpartner doctype printformat reportctl minvoice invoice_printformat_id ad_printformat_id invoice_printformat_id documentcopies documentcopies ad_user_id documentno c_bpartner_id c_invoice c_bpartner c_bpartner_id c_bpartner_id ad_user ad_user_id ad_user_id ad_client ad_client_id ad_client_id ad_printform ad_client_id ad_client_id c_doctype c_doctype_id c_doctype_id ad_org_id ad_org_id needand m_c_invoice_id c_invoice_id m_c_invoice_id m_c_bpartner_id c_bpartner_id m_c_bpartner_id needand m_dateinvoiced_from m_dateinvoiced_to needand dateinvoiced to_date m_dateinvoiced_from to_date m_dateinvoiced_to needand m_dateinvoiced_from needand dateinvoiced to_date m_dateinvoiced_from needand m_dateinvoiced_to needand dateinvoiced to_date m_dateinvoiced_to needand m_documentno_from m_documentno_to needand documentno to_string m_documentno_from to_string m_documentno_to m_documentno_from needand m_documentno_from indexof documentno to_string m_documentno_from documentno to_string m_documentno_from c_invoice_id ad_org_id tostring mprintformat old_ad_printformat_id old_c_invoice_id c_bpartner_id createstatement resultset executequery tostring c_invoice_id getint c_invoice_id old_c_invoice_id old_c_invoice_id c_invoice_id getloginlanguage ad_language getstring ad_language getstring getlanguage ad_language ad_printformat_id getint getint ad_user_id getint muser muser getctx ad_user_id get_trxname documentno getstring c_bpartner_id getint documentdir getdocumentdir documentdir documentdir documentdir p_emailpdf get_id getemail getemail addlog c_invoice_id documentno requestactionemailnoto ad_printformat_id addlog c_invoice_id documentno ad_printformat_id old_ad_printformat_id mprintformat getctx ad_printformat_id old_ad_printformat_id ad_printformat_id setlanguage settranslationlanguage mquery mquery c_invoice_header_v addrestriction c_invoice_id mquery c_invoice_id printinfo printinfo documentno x_c_invoice table_id c_invoice_id c_bpartner_id setcopies reportengine reportengine getctx p_emailpdf mtext getmailheader documentno email createemail getemail isvalid addlog c_invoice_id documentno requestactionemailerror email mtext setuser mtext setbpartner c_bpartner_id mtext minvoice getctx c_invoice_id get_trxname mtext getmailtext mtext ishtml setmessagehtml setsubject setmessagetext isclient minvoice getpdffilename documentdir c_invoice_id addattachment musermail musermail mtext getad_user_id email sent_ok addlog c_invoice_id documentno requestactionemailok getemail addlog c_invoice_id documentno requestactionemailerror getemail stringbuffer stringbuffer c_invoice dateprinted sysdate isprinted c_invoice_id c_invoice_id executeupdate tostring get_trxname doit p_emailpdf standard constructor public x ad workflowprocessorlog properties ctx int ad workflowprocessorlog id string trx name super ctx ad workflowprocessorlog id trx name if ad workflowprocessorlog id 0 setad workflowprocessorlog id 0 setad workflowprocessor id 0 set is error false x_ad_workflowprocessorlog ad_workflowprocessorlog_id trxname ad_workflowprocessorlog_id trxname ad_workflowprocessorlog_id setad_workflowprocessorlog_id setad_workflowprocessor_id setiserror load constructor public x ad workflowprocessorlog properties ctx result set rs string trx name super ctx rs trx name x_ad_workflowprocessorlog resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad workflowprocessorlog append get id append return sb to string tostring stringbuffer stringbuffer x_ad_workflowprocessorlog get_id tostring set workflow processorl log result of the execution of the workflow processor public void setad workflowprocessorlog id int ad workflowprocessorlog id if ad workflowprocessorlog id 1 throw new illegal argument exception ad workflowprocessorlog id is mandatory set valuenocheck ad workflowprocessorlog id new integer ad workflowprocessorlog id setad_workflowprocessorlog_id ad_workflowprocessorlog_id ad_workflowprocessorlog_id illegalargumentexception ad_workflowprocessorlog_id set_valuenocheck ad_workflowprocessorlog_id ad_workflowprocessorlog_id get workflow processorl log result of the execution of the workflow processor public int getad workflowprocessorlog id integer ii integer get value ad workflowprocessorlog id if ii null return 0 return ii int value getad_workflowprocessorlog_id get_value ad_workflowprocessorlog_id intvalue set workflow processor workflow processor server public void setad workflowprocessor id int ad workflowprocessor id if ad workflowprocessor id 1 throw new illegal argument exception ad workflowprocessor id is mandatory set valuenocheck ad workflowprocessor id new integer ad workflowprocessor id setad_workflowprocessor_id ad_workflowprocessor_id ad_workflowprocessor_id illegalargumentexception ad_workflowprocessor_id set_valuenocheck ad_workflowprocessor_id ad_workflowprocessor_id get workflow processor workflow processor server public int getad workflowprocessor id integer ii integer get value ad workflowprocessor id if ii null return 0 return ii int value getad_workflowprocessor_id get_value ad_workflowprocessor_id intvalue set binary data binary data public void set binary data byte binary data set value binary data binary data binarydata setbinarydata binarydata set_value binarydata binarydata get binary data binary data public byte get binary data return byte get value binary data binarydata getbinarydata get_value binarydata set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set error an error occured in the execution public void set is error boolean is error set value is error new boolean is error setiserror iserror set_value iserror iserror get error an error occured in the execution public boolean is error object oo get value is error if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iserror get_value iserror booleanvalue set reference reference for this record public void set reference string reference if reference null reference length 60 log warning length 60 truncated reference reference substring 0 59 set value reference reference setreference set_value get reference reference for this record public string get reference return string get value reference getreference get_value set summary textual summary of this request public void set summary string summary if summary null summary length 2000 log warning length 2000 truncated summary summary substring 0 1999 set value summary summary setsummary set_value get summary textual summary of this request public string get summary return string get value summary getsummary get_value set text message text message public void set text msg string text msg if text msg null text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg standard constructor public x ad table access properties ctx int ad table access id string trx name super ctx ad table access id trx name if ad table access id 0 setad role id 0 setad table id 0 set access type rule null a set is can export false set is can report false set is exclude true y set is read only false x_ad_table_access ad_table_access_id trxname ad_table_access_id trxname ad_table_access_id setad_role_id setad_table_id setaccesstyperule setiscanexport setiscanreport setisexclude setisreadonly load constructor public x ad table access properties ctx result set rs string trx name super ctx rs trx name x_ad_table_access resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad table access append get id append return sb to string tostring stringbuffer stringbuffer x_ad_table_access get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set valuenocheck ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_valuenocheck ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad table id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_table_id public static final string accesstyperule reporting r set access type the type of access for this rule public void set access type rule string access type rule if access type rule null throw new illegal argument exception access type rule is mandatory if access type rule equals a access type rule equals e access type rule equals r else throw new illegal argument exception access type rule invalid value access type rule reference id 293 a e r if access type rule length 1 log warning length 1 truncated access type rule access type rule substring 0 0 set valuenocheck access type rule access type rule accesstyperule_reporting setaccesstyperule accesstyperule accesstyperule illegalargumentexception accesstyperule accesstyperule accesstyperule accesstyperule illegalargumentexception accesstyperule accesstyperule reference_id accesstyperule accesstyperule accesstyperule set_valuenocheck accesstyperule accesstyperule get access type the type of access for this rule public string get access type rule return string get value access type rule getaccesstyperule get_value accesstyperule set can export users with this role can export data public void set is can export boolean is can export set value is can export new boolean is can export setiscanexport iscanexport set_value iscanexport iscanexport get can export users with this role can export data public boolean is can export object oo get value is can export if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscanexport get_value iscanexport booleanvalue set can report users with this role can create reports public void set is can report boolean is can report set value is can report new boolean is can report setiscanreport iscanreport set_value iscanreport iscanreport get can report users with this role can create reports public boolean is can report object oo get value is can report if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscanreport get_value iscanreport booleanvalue set exclude exclude access to the data if not selected include access to the data public void set is exclude boolean is exclude set value is exclude new boolean is exclude setisexclude isexclude set_value isexclude isexclude get exclude exclude access to the data if not selected include access to the data public boolean is exclude object oo get value is exclude if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isexclude get_value isexclude booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue format param name name param ad table id table param format type format type public imp format string name int ad table id string format type set name name set table ad table id set format type format type ad_table_id formattype impformat ad_table_id formattype setname settable ad_table_id setformattype formattype set name param new name new name public void set name string new name if new name null new name length 0 throw new illegal argument exception name must be at least 1 char else m name new name newname setname newname newname newname illegalargumentexception m_name newname get name return name public string get name return m name getname m_name import table param ad table id table public void set table int ad table id m ad table id ad table id m tablename null m tablepk null string sql select t table name c column name from ad table t inner join ad column c on t ad table id c ad table id and c is key y where t ad table id try prepared statement pstmt db prepare statement sql null pstmt set int 1 ad table id result set rs pstmt execute query if rs next m tablename rs get string 1 m tablepk rs get string 2 rs close pstmt close catch sql exception e log log level severe imp format set table e if m tablename null m tablepk null log log level severe data not found for ad table id ad table id set additional table info m tableunique1 m tableunique2 m tableuniqueparent m tableuniquechild if m ad table id 311 i 061 syncitem m tableunique1 h upc upc unique m tableunique2 value m tableuniquechild h commodity1 vendor no may not be unique m tableuniqueparent h partnrid makes it unique else if m ad table id 532 i product m tableunique1 upc upc unique m tableunique2 value m tableuniquechild vendor product no vendor no may not be unique m tableuniqueparent bpartner value makes it unique else if m ad table id 533 i bpartner m tableunique1 value the key else if m ad table id 534 i elementvalue m tableuniqueparent element name the parent key m tableuniquechild value the key else if m ad table id 535 i reportline m tableuniqueparent report line set name the parent key m tableuniquechild name the key ad_table_id settable ad_table_id m_ad_table_id ad_table_id m_tablename m_tablepk tablename columnname ad_table ad_column ad_table_id ad_table_id iskey ad_table_id preparedstatement preparestatement setint ad_table_id resultset executequery m_tablename getstring m_tablepk getstring sqlexception impformat settable m_tablename m_tablepk ad_table_id ad_table_id m_tableunique1 m_tableunique2 m_tableuniqueparent m_tableuniquechild m_ad_table_id i_061_syncitem m_tableunique1 h_upc m_tableunique2 m_tableuniquechild h_commodity1 m_tableuniqueparent h_partnrid m_ad_table_id i_product m_tableunique1 m_tableunique2 m_tableuniquechild vendorproductno m_tableuniqueparent bpartner_value m_ad_table_id i_bpartner m_tableunique1 m_ad_table_id i_elementvalue m_tableuniqueparent elementname m_tableuniquechild m_ad_table_id i_reportline m_tableuniqueparent reportlinesetname m_tableuniquechild get import table name return ad table id public int getad table id return m ad table id ad_table_id getad_table_id m_ad_table_id set format type param new format type f c t x public void set format type string new format type if new format type equals formattype fixed new format type equals formattype comma new format type equals formattype tab new format type equals formattype xml m formattype new format type else throw new illegal argument exception format type must be f c t x newformattype setformattype newformattype newformattype formattype_fixed newformattype formattype_comma newformattype formattype_tab newformattype formattype_xml m_formattype newformattype illegalargumentexception formattype set format type return format type f c t x public string get format type return m formattype getformattype m_formattype set business partner param newb partner value public void setb partner string newb partner m bpartner newb partner newbpartner setbpartner newbpartner m_bpartner newbpartner get business partner return b partner value public string getb partner return m bpartner bpartner getbpartner m_bpartner add format row param row row public void add row imp format row row m rows add row addrow impformatrow m_rows get row param index index return import format row public imp format row get row int index if index 0 index m rows size return imp format row m rows get index return null impformatrow getrow m_rows impformatrow m_rows get row count return row count public int get row count return m rows size getrowcount m_rows factory load param name name return import format public static imp format load string name log config name imp format ret value null string sql select from ad impformat where name int id 0 try prepared statement pstmt db prepare statement sql null pstmt set string 1 name result set rs pstmt execute query if rs next ret value new imp format name rs get int ad table id rs get string format type id rs get int ad impformat id rs close pstmt close catch sql exception e log log level severe sql e return null load rows ret value id return ret value impformat impformat retvalue ad_impformat preparedstatement preparestatement setstring resultset executequery retvalue impformat getint ad_table_id getstring formattype getint ad_impformat_id sqlexception loadrows retvalue retvalue load format rows with id param format format param id id private static void load rows imp format format int id string sql select f seq no c column name f start no f end no f data type c field length 1 6 f data format f decimal point f divide by100 f constant value f callout 7 11 from ad impformat row f ad column c where f ad impformat id and f ad column id c ad column id and f is active y order by f seq no try prepared statement pstmt db prepare statement sql null pstmt set int 1 id result set rs pstmt execute query while rs next imp format row row new imp format row rs get int 1 rs get string 2 rs get int 3 rs get int 4 rs get string 5 rs get int 6 row set format info rs get string 7 rs get string 8 rs get string 9 equals y rs get string 10 rs get string 11 format add row row rs close pstmt close catch sql exception e log log level severe sql e loadrows impformat seqno columnname startno endno datatype fieldlength dataformat decimalpoint divideby100 constantvalue ad_impformat_row ad_column ad_impformat_id ad_column_id ad_column_id isactive seqno preparedstatement preparestatement setint resultset executequery impformatrow impformatrow getint getstring getint getint getstring getint setformatinfo getstring getstring getstring getstring getstring addrow sqlexception parse line returns array list of values param line line param with label true if with label param trace create trace info param ignore empty ignore empty fields return array of values public string parse line string line boolean with label boolean trace boolean ignore empty if trace log config line array list string list new array list string for all columns for int i 0 i m rows size i imp format row row imp format row m rows get i string buffer entry new string buffer label start if with label entry append row get column name entry append if row is string entry append else if row is date entry append to date get data string info null if row is constant info constant else if m formattype equals formattype fixed check length if row get start no 0 row get end no line length info line substring row get start no 1 row get end no else info parse flex format line m formattype row get start no if info null info interpret data entry append row parse info label end if with label if row is string entry append else if row is date entry append yyyy mm dd hh24 mi ss jdbc timestamp format w o miliseconds if ignore empty ignore empty info length 0 list add entry to string if trace log fine info entry to string length info length for all columns string ret value new string list size list to array ret value return ret value arraylist withlabel ignoreempty parseline withlabel ignoreempty arraylist arraylist m_rows impformatrow impformatrow m_rows stringbuffer stringbuffer withlabel getcolumnname isstring isdate to_date isconstant m_formattype formattype_fixed getstartno getendno getstartno getendno parseflexformat m_formattype getstartno withlabel isstring isdate ignoreempty ignoreempty tostring tostring retvalue toarray retvalue retvalue parse flexible line format a bit inefficient as it always starts from the start param line the line to be parsed param format type comma or tab param field no number of field to be returned return field in lime or throws illegal argument exception if format unknows private string parse flex format string line string format type int field no final char quote check input char delimiter if format type equals formattype comma delimiter else if format type equals formattype tab delimiter t else throw new illegal argument exception imp format parse flex format unknown format format type if line null line length 0 field no 0 return we need to read line sequentially as the fields may be delimited with quotes when fields contain the delimiter example artikel bez artikel nr dem eur needs to result in artikel bez artikel nr dem eur int pos 0 int length line length for int field 1 field field no pos length field string buffer content new string buffer two delimiter directly after each other if line char at pos delimiter pos continue handle quotes if line char at pos quote pos move over beginning quote while pos length double quote if line char at pos quote pos 1 length line char at pos 1 quote content append line char at pos pos end quote else if line char at pos quote pos break normal character else content append line char at pos we should be at end of line or a delimiter if pos length line char at pos delimiter log info did not find delimiter at pos pos line pos move over delimiter else plain copy while pos length line char at pos delimiter content append line char at pos pos move over delimiter if field field no return content to string nothing found return formattype fieldno illegalargumentexception parseflexformat formattype fieldno formattype formattype_comma formattype formattype_tab illegalargumentexception impformat parseflexformat formattype fieldno fieldno stringbuffer stringbuffer charat charat charat charat charat charat charat charat charat charat fieldno tostring insert update database param ctx context param line line return true if inserted updated public boolean updatedb properties ctx string line string trx name if line null line trim length 0 log finest no line return false string nodes parse line line true false true with label no trace ignore empty if nodes length 0 log finest nothing parsed from line return false log config imp format updatedb list size nodes length standard fields int ad client id env getad client id ctx int ad org id env getad org id ctx if getad table id x i gljournal table id ad org id 0 int updated by env getad user id ctx check if the record is already there string buffer sql new string buffer select count max append m tablepk append from append m tablename append where ad client id append ad client id append and string where1 null string where2 null string where parent child null for int i 0 i nodes length i if nodes i ends with nodes i ends with 0 else if nodes i starts with m tableunique1 where1 nodes i else if nodes i starts with m tableunique2 where2 nodes i else if nodes i starts with m tableuniqueparent nodes i starts with m tableuniquechild if where parent child null where parent child nodes i else where parent child and nodes i string buffer find new string buffer if where1 null find append where1 if where2 null if find length 0 find append or find append where2 if where parent child null where parent child index of and 1 need to have both criteria if find length 0 find append or append where parent child append may have only one else find append where parent child sql append find append int count 0 int id 0 try if find length 0 prepared statement pstmt db prepare statement sql to string trx name result set rs pstmt execute query if rs next count rs get int 1 if count 1 id rs get int 2 rs close pstmt close catch sql exception e log log level severe sql to string e return false insert basic record if id 0 id db get nextid ctx m tablename null get id sql new string buffer insert into append m tablename append append m tablepk append append ad client id ad org id created created by updated updated by is active std fields append values append id append append ad client id append append ad org id append sys date append updated by append sys date append updated by append y append int no db execute update sql to string trx name if no 1 log log level severe insert records no sql sql to string return false log finer new id id find else log finer old id id find update info sql new string buffer update append m tablename append set for int i 0 i nodes length i sql append nodes i append column value sql append is active y processed n i isimported n updated sys date updated by append updated by sql append where append m tablepk append append id update cmd int no db execute update sql to string trx name if no 1 log log level severe m tablepk id rows updated no return false return true trxname parseline impformat listsize ad_client_id getad_client_id ad_org_id getad_org_id getad_table_id x_i_gljournal table_id ad_org_id updatedby getad_user_id stringbuffer stringbuffer m_tablepk m_tablename ad_client_id ad_client_id whereparentchild endswith endswith startswith m_tableunique1 startswith m_tableunique2 startswith m_tableuniqueparent startswith m_tableuniquechild whereparentchild whereparentchild whereparentchild stringbuffer stringbuffer whereparentchild whereparentchild indexof whereparentchild whereparentchild preparedstatement preparestatement tostring trxname resultset executequery getint getint sqlexception tostring getnextid m_tablename stringbuffer m_tablename m_tablepk ad_client_id ad_org_id createdby updatedby isactive stdfields ad_client_id ad_org_id sysdate updatedby sysdate updatedby executeupdate tostring trxname tostring stringbuffer m_tablename isactive i_isimported sysdate updatedby updatedby m_tablepk executeupdate tostring trxname m_tablepk standard constructor public x ad attribute properties ctx int ad attribute id string trx name super ctx ad attribute id trx name if ad attribute id 0 setad attribute id 0 setad reference id 0 setad table id 0 set is encrypted false set is field only false set is heading false set is mandatory false set is read only false set is same line false set is updateable false set name null x_ad_attribute ad_attribute_id trxname ad_attribute_id trxname ad_attribute_id setad_attribute_id setad_reference_id setad_table_id setisencrypted setisfieldonly setisheading setismandatory setisreadonly setissameline setisupdateable setname load constructor public x ad attribute properties ctx result set rs string trx name super ctx rs trx name x_ad_attribute resultset trxname trxname protected big decimal access level new big decimal 7 access level 7 system client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad attribute append get id append return sb to string tostring stringbuffer stringbuffer x_ad_attribute get_id tostring set system attribute public void setad attribute id int ad attribute id if ad attribute id 1 throw new illegal argument exception ad attribute id is mandatory set valuenocheck ad attribute id new integer ad attribute id setad_attribute_id ad_attribute_id ad_attribute_id illegalargumentexception ad_attribute_id set_valuenocheck ad_attribute_id ad_attribute_id get system attribute public int getad attribute id integer ii integer get value ad attribute id if ii null return 0 return ii int value getad_attribute_id get_value ad_attribute_id intvalue public static final int ad reference id ad reference id 1 set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set value ad reference id new integer ad reference id ad_reference_id_ad_reference_id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_value ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue public static final int ad reference value id ad reference id 4 set reference key required to specify if data type is table or list public void setad reference value id int ad reference value id if ad reference value id 0 set value ad reference value id null else set value ad reference value id new integer ad reference value id ad_reference_value_id_ad_reference_id setad_reference_value_id ad_reference_value_id ad_reference_value_id set_value ad_reference_value_id set_value ad_reference_value_id ad_reference_value_id get reference key required to specify if data type is table or list public int getad reference value id integer ii integer get value ad reference value id if ii null return 0 return ii int value getad_reference_value_id get_value ad_reference_value_id intvalue set table table for the fields public void setad table id int ad table id if ad table id 1 throw new illegal argument exception ad table id is mandatory set value ad table id new integer ad table id setad_table_id ad_table_id ad_table_id illegalargumentexception ad_table_id set_value ad_table_id ad_table_id get table table for the fields public int getad table id integer ii integer get value ad table id if ii null return 0 return ii int value getad_table_id get_value ad_table_id intvalue set dynamic validation dynamic validation rule public void setad val rule id int ad val rule id if ad val rule id 0 set value ad val rule id null else set value ad val rule id new integer ad val rule id setad_val_rule_id ad_val_rule_id ad_val_rule_id set_value ad_val_rule_id set_value ad_val_rule_id ad_val_rule_id get dynamic validation dynamic validation rule public int getad val rule id integer ii integer get value ad val rule id if ii null return 0 return ii int value getad_val_rule_id get_value ad_val_rule_id intvalue set callout fully qualified class names and method separated by semicolons public void set callout string callout if callout null callout length 60 log warning length 60 truncated callout callout substring 0 59 set value callout callout setcallout set_value get callout fully qualified class names and method separated by semicolons public string get callout return string get value callout getcallout get_value set default logic default value hierarchy separated by public void set default value string default value if default value null default value length 2000 log warning length 2000 truncated default value default value substring 0 1999 set value default value default value setdefaultvalue defaultvalue defaultvalue defaultvalue defaultvalue defaultvalue set_value defaultvalue defaultvalue get default logic default value hierarchy separated by public string get default value return string get value default value getdefaultvalue get_value defaultvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set display length length of the display in characters public void set display length int display length set value display length new integer display length setdisplaylength displaylength set_value displaylength displaylength get display length length of the display in characters public int get display length integer ii integer get value display length if ii null return 0 return ii int value getdisplaylength get_value displaylength intvalue set display logic if the field is displayed the result determines if the field is actually displayed public void set display logic string display logic if display logic null display logic length 2000 log warning length 2000 truncated display logic display logic substring 0 1999 set value display logic display logic setdisplaylogic displaylogic displaylogic displaylogic displaylogic displaylogic set_value displaylogic displaylogic get display logic if the field is displayed the result determines if the field is actually displayed public string get display logic return string get value display logic getdisplaylogic get_value displaylogic set length length of the column in the database public void set field length int field length set value field length new integer field length setfieldlength fieldlength set_value fieldlength fieldlength get length length of the column in the database public int get field length integer ii integer get value field length if ii null return 0 return ii int value getfieldlength get_value fieldlength intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set encrypted display or storage is encrypted public void set is encrypted boolean is encrypted set value is encrypted new boolean is encrypted setisencrypted isencrypted set_value isencrypted isencrypted get encrypted display or storage is encrypted public boolean is encrypted object oo get value is encrypted if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isencrypted get_value isencrypted booleanvalue set field only label is not displayed public void set is field only boolean is field only set value is field only new boolean is field only setisfieldonly isfieldonly set_value isfieldonly isfieldonly get field only label is not displayed public boolean is field only object oo get value is field only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isfieldonly get_value isfieldonly booleanvalue set heading only field without column only label is displayed public void set is heading boolean is heading set value is heading new boolean is heading setisheading isheading set_value isheading isheading get heading only field without column only label is displayed public boolean is heading object oo get value is heading if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isheading get_value isheading booleanvalue set mandatory data entry is required in this column public void set is mandatory boolean is mandatory set value is mandatory new boolean is mandatory setismandatory ismandatory set_value ismandatory ismandatory get mandatory data entry is required in this column public boolean is mandatory object oo get value is mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatory get_value ismandatory booleanvalue set read only field is read only public void set is read only boolean is read only set value is read only new boolean is read only setisreadonly isreadonly set_value isreadonly isreadonly get read only field is read only public boolean is read only object oo get value is read only if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isreadonly get_value isreadonly booleanvalue set same line displayed on same line as previous field public void set is same line boolean is same line set value is same line new boolean is same line setissameline issameline set_value issameline issameline get same line displayed on same line as previous field public boolean is same line object oo get value is same line if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issameline get_value issameline booleanvalue set updateable determines if the field can be updated public void set is updateable boolean is updateable set value is updateable new boolean is updateable setisupdateable isupdateable set_value isupdateable isupdateable get updateable determines if the field can be updated public boolean is updateable object oo get value is updateable if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isupdateable get_value isupdateable booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 60 log warning length 60 truncated v format v format substring 0 59 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat set max value maximum value for a field public void set value max string value max if value max null value max length 20 log warning length 20 truncated value max value max substring 0 19 set value value max value max setvaluemax valuemax valuemax valuemax valuemax valuemax set_value valuemax valuemax get max value maximum value for a field public string get value max return string get value value max getvaluemax get_value valuemax set min value minimum value for a field public void set value min string value min if value min null value min length 20 log warning length 20 truncated value min value min substring 0 19 set value value min value min setvaluemin valuemin valuemin valuemin valuemin valuemin set_value valuemin valuemin get min value minimum value for a field public string get value min return string get value value min getvaluemin get_value valuemin standard constructor public x m bomproduct properties ctx int m bomproduct id string trx name super ctx m bomproduct id trx name if m bomproduct id 0 setbom product type null s setbom qty env zero 1 set is phantom false set lead time offset 0 set line 0 sql select nvl max line 0 10 as default value from m bomproduct where m bom id m bom id setm bomproduct id 0 setm bom id 0 x_m_bomproduct m_bomproduct_id trxname m_bomproduct_id trxname m_bomproduct_id setbomproducttype setbomqty setisphantom setleadtimeoffset setline defaultvalue m_bomproduct m_bom_id m_bom_id setm_bomproduct_id setm_bom_id load constructor public x m bomproduct properties ctx result set rs string trx name super ctx rs trx name x_m_bomproduct resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m bomproduct append get id append return sb to string tostring stringbuffer stringbuffer x_m_bomproduct get_id tostring public static final string bomproducttype outsideprocessing x set component type bom product type public void setbom product type string bom product type if bom product type null throw new illegal argument exception bom product type is mandatory if bom product type equals a bom product type equals d bom product type equals o bom product type equals s bom product type equals x else throw new illegal argument exception bom product type invalid value bom product type reference id 349 a d o s x if bom product type length 1 log warning length 1 truncated bom product type bom product type substring 0 0 set value bom product type bom product type bomproducttype_outsideprocessing setbomproducttype bomproducttype bomproducttype illegalargumentexception bomproducttype bomproducttype bomproducttype bomproducttype bomproducttype bomproducttype illegalargumentexception bomproducttype bomproducttype reference_id bomproducttype bomproducttype bomproducttype set_value bomproducttype bomproducttype get component type bom product type public string getbom product type return string get value bom product type getbomproducttype get_value bomproducttype set bom quantity bill of materials quantity public void setbom qty big decimal bom qty if bom qty null throw new illegal argument exception bom qty is mandatory set value bom qty bom qty setbomqty bigdecimal bomqty bomqty illegalargumentexception bomqty set_value bomqty bomqty get bom quantity bill of materials quantity public big decimal getbom qty big decimal bd big decimal get value bom qty if bd null return env zero return bd bigdecimal getbomqty bigdecimal bigdecimal get_value bomqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set phantom phantom component public void set is phantom boolean is phantom set value is phantom new boolean is phantom setisphantom isphantom set_value isphantom isphantom get phantom phantom component public boolean is phantom object oo get value is phantom if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isphantom get_value isphantom booleanvalue set lead time offset optional lead time offest before starting production public void set lead time offset int lead time offset set value lead time offset new integer lead time offset setleadtimeoffset leadtimeoffset set_value leadtimeoffset leadtimeoffset get lead time offset optional lead time offest before starting production public int get lead time offset integer ii integer get value lead time offset if ii null return 0 return ii int value getleadtimeoffset get_value leadtimeoffset intvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get line intvalue keynamepair getkeynamepair keynamepair get_id valueof getline set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 set value m attributesetinstance id null else set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id set_value m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set alternative group product bom alternative group public void setm bomalternative id int m bomalternative id if m bomalternative id 0 set value m bomalternative id null else set value m bomalternative id new integer m bomalternative id setm_bomalternative_id m_bomalternative_id m_bomalternative_id set_value m_bomalternative_id set_value m_bomalternative_id m_bomalternative_id get alternative group product bom alternative group public int getm bomalternative id integer ii integer get value m bomalternative id if ii null return 0 return ii int value getm_bomalternative_id get_value m_bomalternative_id intvalue set bom component bill of material component product public void setm bomproduct id int m bomproduct id if m bomproduct id 1 throw new illegal argument exception m bomproduct id is mandatory set valuenocheck m bomproduct id new integer m bomproduct id setm_bomproduct_id m_bomproduct_id m_bomproduct_id illegalargumentexception m_bomproduct_id set_valuenocheck m_bomproduct_id m_bomproduct_id get bom component bill of material component product public int getm bomproduct id integer ii integer get value m bomproduct id if ii null return 0 return ii int value getm_bomproduct_id get_value m_bomproduct_id intvalue set bom bill of material public void setm bom id int m bom id if m bom id 1 throw new illegal argument exception m bom id is mandatory set valuenocheck m bom id new integer m bom id setm_bom_id m_bom_id m_bom_id illegalargumentexception m_bom_id set_valuenocheck m_bom_id m_bom_id get bom bill of material public int getm bom id integer ii integer get value m bom id if ii null return 0 return ii int value getm_bom_id get_value m_bom_id intvalue set change notice bill of materials engineering change notice version public void setm changenotice id int m changenotice id if m changenotice id 0 set value m changenotice id null else set value m changenotice id new integer m changenotice id setm_changenotice_id m_changenotice_id m_changenotice_id set_value m_changenotice_id set_value m_changenotice_id m_changenotice_id get change notice bill of materials engineering change notice version public int getm changenotice id integer ii integer get value m changenotice id if ii null return 0 return ii int value getm_changenotice_id get_value m_changenotice_id intvalue public static final int m productbom id ad reference id 162 set bom product bill of material component product public void setm productbom id int m productbom id if m productbom id 0 set value m productbom id null else set value m productbom id new integer m productbom id m_productbom_id_ad_reference_id setm_productbom_id m_productbom_id m_productbom_id set_value m_productbom_id set_value m_productbom_id m_productbom_id get bom product bill of material component product public int getm productbom id integer ii integer get value m productbom id if ii null return 0 return ii int value getm_productbom_id get_value m_productbom_id intvalue set product operation product manufacturing operation public void setm productoperation id int m productoperation id if m productoperation id 0 set value m productoperation id null else set value m productoperation id new integer m productoperation id setm_productoperation_id m_productoperation_id m_productoperation_id set_value m_productoperation_id set_value m_productoperation_id m_productoperation_id get product operation product manufacturing operation public int getm productoperation id integer ii integer get value m productoperation id if ii null return 0 return ii int value getm_productoperation_id get_value m_productoperation_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue basic constructor you need to set the attributes using the set methods public a this constructor creates ah lt a gt tag param href the uri that goes between double quotes public a string href set href href sethref this constructor creates an lt a gt tag param href the uri that goes between double quotes param value what goes between lt start tag gt lt end tag gt public a string href string value set href href add element value start_tag end_tag sethref addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param value what goes between lt start tag gt lt end tag gt public a string href element value set href href add element value start_tag end_tag sethref addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the name attribute param value what goes between lt start tag gt lt end tag gt public a string href string name string value set href href set name name add element value start_tag end_tag sethref setname addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the name attribute param value what goes between lt start tag gt lt end tag gt public a string href string name element value set href href set name name add element value start_tag end_tag sethref setname addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the optional name attribute param target the target attribute param value the value that goes between lt start tag gt lt end tag gt public a string href string name string target element value set href href if name null set name name set target target add element value start_tag end_tag sethref setname settarget addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the optional name attribute param target the optional target attribute param value the value that goes between lt start tag gt lt end tag gt public a string href string name string target string value set href href if name null set name name if target null set target target add element value start_tag end_tag sethref setname settarget addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the optional name attribute param target the target attribute param lang the lang and xml lang attributes param value the value that goes between lt start tag gt lt end tag gt public a string href string name string target string lang string value set href href if name null set name name set target target set lang lang add element value start_tag end_tag sethref setname settarget setlang addelement this constructor creates an lt a gt tag param href the uri that goes between double quotes param name the optional name attribute param target the target attribute param lang the lang and xml lang attributes param value the value that goes between lt start tag gt lt end tag gt public a string href string name string target string lang element value set href href if name null set name name set target target set lang lang add element value start_tag end_tag sethref setname settarget setlang addelement sets the href attribute param href the href attribute public a set href string href add attribute href href return this sethref addattribute sets the name attribute param name the name attribute public a set name string name add attribute name name return this setname addattribute sets the target attribute param target the target attribute public a set target string target add attribute target target return this settarget addattribute sets the rel attribute param rel the rel attribute public a set rel string rel add attribute rel rel return this setrel addattribute sets the rev attribute param rev the rev attribute public a set rev string rev add attribute rev rev return this setrev addattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param element adds an element to the element public a add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public a add element string element add element to registry element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public a add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public a add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public a remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param script script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param script script public void set on blur string script add attribute onblur script setonblur addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onnlouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute determine if this element needs a line break if pretty printing public boolean get need line break java util enumeration en elements int i 0 int j 0 while en has more elements j object obj en next element if obj instanceof img i if i j return false return true getneedlinebreak hasmoreelements nextelement get contents return context public object get contents return contents getcontents standard constructor public x c paymentprocessor properties ctx int c paymentprocessor id string trx name super ctx c paymentprocessor id trx name if c paymentprocessor id 0 set acceptamex false set acceptatm false set accept check false set accept corporate false set accept diners false set accept direct debit false set accept direct deposit false set accept discover false set acceptmc false set accept visa false setc bankaccount id 0 setc paymentprocessor id 0 set commission env zero set cost per trx env zero set host address null set host port 0 set name null set password null set requirevv false set userid null x_c_paymentprocessor c_paymentprocessor_id trxname c_paymentprocessor_id trxname c_paymentprocessor_id setacceptamex setacceptatm setacceptcheck setacceptcorporate setacceptdiners setacceptdirectdebit setacceptdirectdeposit setacceptdiscover setacceptmc setacceptvisa setc_bankaccount_id setc_paymentprocessor_id setcommission setcostpertrx sethostaddress sethostport setname setpassword setrequirevv setuserid load constructor public x c paymentprocessor properties ctx result set rs string trx name super ctx rs trx name x_c_paymentprocessor resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c paymentprocessor append get id append return sb to string tostring stringbuffer stringbuffer x_c_paymentprocessor get_id tostring public static final int ad sequence id ad reference id 128 set sequence document sequence public void setad sequence id int ad sequence id if ad sequence id 0 set value ad sequence id null else set value ad sequence id new integer ad sequence id ad_sequence_id_ad_reference_id setad_sequence_id ad_sequence_id ad_sequence_id set_value ad_sequence_id set_value ad_sequence_id ad_sequence_id get sequence document sequence public int getad sequence id integer ii integer get value ad sequence id if ii null return 0 return ii int value getad_sequence_id get_value ad_sequence_id intvalue set accept amex accept american express card public void set acceptamex boolean acceptamex set value acceptamex new boolean acceptamex setacceptamex set_value get accept amex accept american express card public boolean is acceptamex object oo get value acceptamex if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptamex get_value booleanvalue set accept atm accept bank atm card public void set acceptatm boolean acceptatm set value acceptatm new boolean acceptatm setacceptatm set_value get accept atm accept bank atm card public boolean is acceptatm object oo get value acceptatm if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptatm get_value booleanvalue set accept electronic check accept e check electronic checks public void set accept check boolean accept check set value accept check new boolean accept check echeck setacceptcheck acceptcheck set_value acceptcheck acceptcheck get accept electronic check accept e check electronic checks public boolean is accept check object oo get value accept check if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false echeck isacceptcheck get_value acceptcheck booleanvalue set accept corporate accept corporate purchase cards public void set accept corporate boolean accept corporate set value accept corporate new boolean accept corporate setacceptcorporate acceptcorporate set_value acceptcorporate acceptcorporate get accept corporate accept corporate purchase cards public boolean is accept corporate object oo get value accept corporate if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptcorporate get_value acceptcorporate booleanvalue set accept diners accept diner s club public void set accept diners boolean accept diners set value accept diners new boolean accept diners setacceptdiners acceptdiners set_value acceptdiners acceptdiners get accept diners accept diner s club public boolean is accept diners object oo get value accept diners if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptdiners get_value acceptdiners booleanvalue set accept direct debit accept direct debits vendor initiated public void set accept direct debit boolean accept direct debit set value accept direct debit new boolean accept direct debit setacceptdirectdebit acceptdirectdebit set_value acceptdirectdebit acceptdirectdebit get accept direct debit accept direct debits vendor initiated public boolean is accept direct debit object oo get value accept direct debit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptdirectdebit get_value acceptdirectdebit booleanvalue set accept direct deposit accept direct deposit payee initiated public void set accept direct deposit boolean accept direct deposit set value accept direct deposit new boolean accept direct deposit setacceptdirectdeposit acceptdirectdeposit set_value acceptdirectdeposit acceptdirectdeposit get accept direct deposit accept direct deposit payee initiated public boolean is accept direct deposit object oo get value accept direct deposit if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptdirectdeposit get_value acceptdirectdeposit booleanvalue set accept discover accept discover card public void set accept discover boolean accept discover set value accept discover new boolean accept discover setacceptdiscover acceptdiscover set_value acceptdiscover acceptdiscover get accept discover accept discover card public boolean is accept discover object oo get value accept discover if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptdiscover get_value acceptdiscover booleanvalue set accept master card accept master card public void set acceptmc boolean acceptmc set value acceptmc new boolean acceptmc mastercard setacceptmc set_value get accept master card accept master card public boolean is acceptmc object oo get value acceptmc if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false mastercard isacceptmc get_value booleanvalue set accept visa accept visa cards public void set accept visa boolean accept visa set value accept visa new boolean accept visa setacceptvisa acceptvisa set_value acceptvisa acceptvisa get accept visa accept visa cards public boolean is accept visa object oo get value accept visa if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isacceptvisa get_value acceptvisa booleanvalue set bank account account at the bank public void setc bankaccount id int c bankaccount id if c bankaccount id 1 throw new illegal argument exception c bankaccount id is mandatory set valuenocheck c bankaccount id new integer c bankaccount id setc_bankaccount_id c_bankaccount_id c_bankaccount_id illegalargumentexception c_bankaccount_id set_valuenocheck c_bankaccount_id c_bankaccount_id get bank account account at the bank public int getc bankaccount id integer ii integer get value c bankaccount id if ii null return 0 return ii int value getc_bankaccount_id get_value c_bankaccount_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 0 set value c currency id null else set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id set_value c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set payment processor payment processor for electronic payments public void setc paymentprocessor id int c paymentprocessor id if c paymentprocessor id 1 throw new illegal argument exception c paymentprocessor id is mandatory set valuenocheck c paymentprocessor id new integer c paymentprocessor id setc_paymentprocessor_id c_paymentprocessor_id c_paymentprocessor_id illegalargumentexception c_paymentprocessor_id set_valuenocheck c_paymentprocessor_id c_paymentprocessor_id get payment processor payment processor for electronic payments public int getc paymentprocessor id integer ii integer get value c paymentprocessor id if ii null return 0 return ii int value getc_paymentprocessor_id get_value c_paymentprocessor_id intvalue set commission commission stated as a percentage public void set commission big decimal commission if commission null throw new illegal argument exception commission is mandatory set value commission commission setcommission bigdecimal illegalargumentexception set_value get commission commission stated as a percentage public big decimal get commission big decimal bd big decimal get value commission if bd null return env zero return bd bigdecimal getcommission bigdecimal bigdecimal get_value set cost per transaction fixed cost per transaction public void set cost per trx big decimal cost per trx if cost per trx null throw new illegal argument exception cost per trx is mandatory set value cost per trx cost per trx setcostpertrx bigdecimal costpertrx costpertrx illegalargumentexception costpertrx set_value costpertrx costpertrx get cost per transaction fixed cost per transaction public big decimal get cost per trx big decimal bd big decimal get value cost per trx if bd null return env zero return bd bigdecimal getcostpertrx bigdecimal bigdecimal get_value costpertrx set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set host address host address url or dns public void set host address string host address if host address null throw new illegal argument exception host address is mandatory if host address length 60 log warning length 60 truncated host address host address substring 0 59 set value host address host address sethostaddress hostaddress hostaddress illegalargumentexception hostaddress hostaddress hostaddress hostaddress set_value hostaddress hostaddress get host address host address url or dns public string get host address return string get value host address gethostaddress get_value hostaddress set host port host communication port public void set host port int host port set value host port new integer host port sethostport hostport set_value hostport hostport get host port host communication port public int get host port integer ii integer get value host port if ii null return 0 return ii int value gethostport get_value hostport intvalue set minimum amt minumum amout in document currency public void set minimum amt big decimal minimum amt set value minimum amt minimum amt setminimumamt bigdecimal minimumamt set_value minimumamt minimumamt get minimum amt minumum amout in document currency public big decimal get minimum amt big decimal bd big decimal get value minimum amt if bd null return env zero return bd bigdecimal getminimumamt bigdecimal bigdecimal get_value minimumamt set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set partner id partner id or account for the payment processor public void set partnerid string partnerid if partnerid null partnerid length 60 log warning length 60 truncated partnerid partnerid substring 0 59 set value partnerid partnerid setpartnerid set_value get partner id partner id or account for the payment processor public string get partnerid return string get value partnerid getpartnerid get_value set password password of any length case sensitive public void set password string password if password null throw new illegal argument exception password is mandatory if password length 60 log warning length 60 truncated password password substring 0 59 set valuee password password setpassword illegalargumentexception set_valuee get password password of any length case sensitive public string get password return string get valuee password getpassword get_valuee set payment processor class payment processor java class public void set pay processor class string pay processor class if pay processor class null pay processor class length 60 log warning length 60 truncated pay processor class pay processor class substring 0 59 set value pay processor class pay processor class setpayprocessorclass payprocessorclass payprocessorclass payprocessorclass payprocessorclass payprocessorclass set_value payprocessorclass payprocessorclass get payment processor class payment processor java class public string get pay processor class return string get value pay processor class getpayprocessorclass get_value payprocessorclass set proxy address address of your proxy server public void set proxy address string proxy address if proxy address null proxy address length 60 log warning length 60 truncated proxy address proxy address substring 0 59 set value proxy address proxy address setproxyaddress proxyaddress proxyaddress proxyaddress proxyaddress proxyaddress set_value proxyaddress proxyaddress get proxy address address of your proxy server public string get proxy address return string get value proxy address getproxyaddress get_value proxyaddress set proxy logon logon of your proxy server public void set proxy logon string proxy logon if proxy logon null proxy logon length 60 log warning length 60 truncated proxy logon proxy logon substring 0 59 set value proxy logon proxy logon setproxylogon proxylogon proxylogon proxylogon proxylogon proxylogon set_value proxylogon proxylogon get proxy logon logon of your proxy server public string get proxy logon return string get value proxy logon getproxylogon get_value proxylogon set proxy password password of your proxy server public void set proxy password string proxy password if proxy password null proxy password length 60 log warning length 60 truncated proxy password proxy password substring 0 59 set valuee proxy password proxy password setproxypassword proxypassword proxypassword proxypassword proxypassword proxypassword set_valuee proxypassword proxypassword get proxy password password of your proxy server public string get proxy password return string get valuee proxy password getproxypassword get_valuee proxypassword set proxy port port of your proxy server public void set proxy port int proxy port set value proxy port new integer proxy port setproxyport proxyport set_value proxyport proxyport get proxy port port of your proxy server public int get proxy port integer ii integer get value proxy port if ii null return 0 return ii int value getproxyport get_value proxyport intvalue set require credit card verification code require 3 4 digit credit verification code public void set requirevv boolean requirevv set value requirevv new boolean requirevv creditcard setrequirevv set_value get require credit card verification code require 3 4 digit credit verification code public boolean is requirevv object oo get value requirevv if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false creditcard isrequirevv get_value booleanvalue set user id user id or account number public void set userid string userid if userid null throw new illegal argument exception userid is mandatory if userid length 60 log warning length 60 truncated userid userid substring 0 59 set value userid userid setuserid illegalargumentexception set_value get user id user id or account number public string get userid return string get value userid getuserid get_value set vendor id vendor id for the payment processor public void set vendorid string vendorid if vendorid null vendorid length 60 log warning length 60 truncated vendorid vendorid substring 0 59 set value vendorid vendorid setvendorid set_value get vendor id vendor id for the payment processor public string get vendorid return string get value vendorid getvendorid get_value get current po of product param m product id product return po current vendor first public static m productpo get of product properties ctx int m product id string trx name array list m productpo list new array list m productpo string sql select from m product po where m product id and is active y order by is current vendor desc prepared statement pstmt null try pstmt db prepare statement sql trx name pstmt set int 1 m product id result set rs pstmt execute query if rs next list add new m productpo ctx rs trx name rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null m productpo ret value new m productpo list size list to array ret value return ret value m_product_id mproductpo getofproduct m_product_id trxname arraylist mproductpo arraylist mproductpo m_product_po m_product_id isactive iscurrentvendor preparedstatement preparestatement trxname setint m_product_id resultset executequery mproductpo trxname sqlexception s_log sqlexception mproductpo retvalue mproductpo toarray retvalue retvalue persistency constructor param ctx context param ignored ignored public m productpo properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key else setm product id 0 m product id setc bpartner id 0 0 set vendor product no null value set is current vendor true y mproductpo trxname trxname illegalargumentexception setm_product_id m_product_id setc_bpartner_id setvendorproductno setiscurrentvendor load constructor param ctx context param rs result set public m productpo properties ctx result set rs string trx name super ctx rs trx name mproductpo resultset trxname trxname standard constructor public x ad schedulerrecipient properties ctx int ad schedulerrecipient id string trx name super ctx ad schedulerrecipient id trx name if ad schedulerrecipient id 0 setad schedulerrecipient id 0 setad scheduler id 0 x_ad_schedulerrecipient ad_schedulerrecipient_id trxname ad_schedulerrecipient_id trxname ad_schedulerrecipient_id setad_schedulerrecipient_id setad_scheduler_id load constructor public x ad schedulerrecipient properties ctx result set rs string trx name super ctx rs trx name x_ad_schedulerrecipient resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad schedulerrecipient append get id append return sb to string tostring stringbuffer stringbuffer x_ad_schedulerrecipient get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 set value ad role id null else set value ad role id new integer ad role id setad_role_id ad_role_id ad_role_id set_value ad_role_id set_value ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set scheduler recipient recipient of the scheduler notification public void setad schedulerrecipient id int ad schedulerrecipient id if ad schedulerrecipient id 1 throw new illegal argument exception ad schedulerrecipient id is mandatory set valuenocheck ad schedulerrecipient id new integer ad schedulerrecipient id setad_schedulerrecipient_id ad_schedulerrecipient_id ad_schedulerrecipient_id illegalargumentexception ad_schedulerrecipient_id set_valuenocheck ad_schedulerrecipient_id ad_schedulerrecipient_id get scheduler recipient recipient of the scheduler notification public int getad schedulerrecipient id integer ii integer get value ad schedulerrecipient id if ii null return 0 return ii int value getad_schedulerrecipient_id get_value ad_schedulerrecipient_id intvalue set scheduler schedule processes public void setad scheduler id int ad scheduler id if ad scheduler id 1 throw new illegal argument exception ad scheduler id is mandatory set valuenocheck ad scheduler id new integer ad scheduler id setad_scheduler_id ad_scheduler_id ad_scheduler_id illegalargumentexception ad_scheduler_id set_valuenocheck ad_scheduler_id ad_scheduler_id get scheduler schedule processes public int getad scheduler id integer ii integer get value ad scheduler id if ii null return 0 return ii int value getad_scheduler_id get_value ad_scheduler_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id payment invoice when invoice selected set c currency id c bpartner id discount amt c invoice discount id date trx pay amt invoice open id discount write off amt 0 public string invoice properties ctx int window no m tab m tab m field m field object value integer c invoice id integer value if is callout active assuming it is resetting value c invoice id null c invoice id int value 0 return set callout active true m tab set value c order id null m tab set value c charge id null m tab set value is prepayment boolean false m tab set value discount amt env zero m tab set value write off amt env zero m tab set value is over under payment boolean false m tab set value over under amt env zero int c invoicepayschedule id 0 if env get context as int ctx env window info env tab info c invoice id c invoice id int value env get context as int ctx env window info env tab info c invoicepayschedule id 0 c invoicepayschedule id env get context as int ctx env window info env tab info c invoicepayschedule id payment date timestamp ts timestamp m tab get value date trx if ts null ts new timestamp system current time millis string sql select c bpartner id c currency id 1 2 invoice open c invoice id 3 1 invoice discount c invoice id isso trx 4 5 2 3 from c invoice where c invoice id 4 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c invoicepayschedule id pstmt set timestamp 2 ts pstmt set int 3 c invoicepayschedule id pstmt set int 4 c invoice id int value result set rs pstmt execute query if rs next m tab set value c bpartner id new integer rs get int 1 int c currency id rs get int 2 set invoice currency m tab set value c currency id new integer c currency id big decimal invoice open rs get big decimal 3 set invoice o pen amount if invoice open null invoice open env zero big decimal discount amt rs get big decimal 4 set discount amt if discount amt null discount amt env zero m tab set value pay amt invoice open subtract discount amt m tab set value discount amt discount amt reset as dependent fields get reset env set context ctx window no c invoice id c invoice id to string m tab set value c invoice id c invoice id rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message set callout active false return doc type ctx window no m tab m field value payment_invoice c_currency_id c_bpartner_id discountamt c_invoice_discount datetrx payamt invoiceopen writeoffamt windowno mtab mtab mfield mfield c_invoice_id iscalloutactive c_invoice_id c_invoice_id intvalue setcalloutactive mtab setvalue c_order_id mtab setvalue c_charge_id mtab setvalue isprepayment mtab setvalue discountamt mtab setvalue writeoffamt mtab setvalue isoverunderpayment mtab setvalue overunderamt c_invoicepayschedule_id getcontextasint window_info tab_info c_invoice_id c_invoice_id intvalue getcontextasint window_info tab_info c_invoicepayschedule_id c_invoicepayschedule_id getcontextasint window_info tab_info c_invoicepayschedule_id mtab getvalue datetrx currenttimemillis c_bpartner_id c_currency_id invoiceopen c_invoice_id invoicediscount c_invoice_id issotrx c_invoice c_invoice_id preparedstatement preparestatement setint c_invoicepayschedule_id settimestamp setint c_invoicepayschedule_id setint c_invoice_id intvalue resultset executequery mtab setvalue c_bpartner_id getint c_currency_id getint mtab setvalue c_currency_id c_currency_id bigdecimal invoiceopen getbigdecimal open invoiceopen invoiceopen bigdecimal discountamt getbigdecimal discountamt discountamt mtab setvalue payamt invoiceopen discountamt mtab setvalue discountamt discountamt setcontext windowno c_invoice_id c_invoice_id tostring mtab setvalue c_invoice_id c_invoice_id sqlexception setcalloutactive getlocalizedmessage setcalloutactive doctype windowno mtab mfield payment order when waiting payment order selected set c currency id c bpartner id discount amt c invoice discount id date trx pay amt invoice open id discount write off amt 0 public string order properties ctx int window no m tab m tab m field m field object value integer c order id integer value if is callout active assuming it is resetting value c order id null c order id int value 0 return set callout active true m tab set value c invoice id null m tab set value c charge id null m tab set value is prepayment boolean true m tab set value discount amt env zero m tab set value write off amt env zero m tab set value is over under payment boolean false m tab set value over under amt env zero payment date timestamp ts timestamp m tab get value date trx if ts null ts new timestamp system current time millis string sql select c bpartner id c currency id grand total from c order where c order id 1 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c order id int value result set rs pstmt execute query if rs next m tab set value c bpartner id new integer rs get int 1 int c currency id rs get int 2 set order currency m tab set value c currency id new integer c currency id big decimal grand total rs get big decimal 3 set pay amount if grand total null grand total env zero m tab set value pay amt grand total rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message set callout active false return doc type ctx window no m tab m field value payment_order c_currency_id c_bpartner_id discountamt c_invoice_discount datetrx payamt invoiceopen writeoffamt windowno mtab mtab mfield mfield c_order_id iscalloutactive c_order_id c_order_id intvalue setcalloutactive mtab setvalue c_invoice_id mtab setvalue c_charge_id mtab setvalue isprepayment mtab setvalue discountamt mtab setvalue writeoffamt mtab setvalue isoverunderpayment mtab setvalue overunderamt mtab getvalue datetrx currenttimemillis c_bpartner_id c_currency_id grandtotal c_order c_order_id preparedstatement preparestatement setint c_order_id intvalue resultset executequery mtab setvalue c_bpartner_id getint c_currency_id getint mtab setvalue c_currency_id c_currency_id bigdecimal grandtotal getbigdecimal grandtotal grandtotal mtab setvalue payamt grandtotal sqlexception setcalloutactive getlocalizedmessage setcalloutactive doctype windowno mtab mfield payment project reset c bpartner id invoice order project discount write off public string project properties ctx int window no m tab m tab m field m field object value integer c project id integer value if is callout active assuming it is resetting value c project id null c project id int value 0 return set callout active true m tab set value c charge id null set callout active false return payment_project c_bpartner_id writeoff windowno mtab mtab mfield mfield c_project_id iscalloutactive c_project_id c_project_id intvalue setcalloutactive mtab setvalue c_charge_id setcalloutactive payment charge reset c bpartner id invoice order project discount write off public string charge properties ctx int window no m tab m tab m field m field object value integer c charge id integer value if is callout active assuming it is resetting value c charge id null c charge id int value 0 return set callout active true m tab set value c invoice id null m tab set value c order id null m tab set value c project id null m tab set value is prepayment boolean false m tab set value discount amt env zero m tab set value write off amt env zero m tab set value is over under payment boolean false m tab set value over under amt env zero set callout active false return payment_charge c_bpartner_id writeoff windowno mtab mtab mfield mfield c_charge_id iscalloutactive c_charge_id c_charge_id intvalue setcalloutactive mtab setvalue c_invoice_id mtab setvalue c_order_id mtab setvalue c_project_id mtab setvalue isprepayment mtab setvalue discountamt mtab setvalue writeoffamt mtab setvalue isoverunderpayment mtab setvalue overunderamt setcalloutactive payment document type verify that document type ap ar and invoice so po are in sync public string doc type properties ctx int window no m tab m tab m field m field object value int c invoice id env get context as int ctx window no c invoice id int c order id env get context as int ctx window no c order id int c doctype id env get context as int ctx window no c doctype id log fine payment doctype c invoice id c invoice id c doctype id c doctype id m doc type dt null if c doctype id 0 dt m doc type get ctx c doctype id env set context ctx window no isso trx dt isso trx y n invoice if c invoice id 0 m invoice inv new m invoice ctx c invoice id null if dt null if inv isso trx dt isso trx return payment doc type invoice inconsistent order waiting payment can only be so if c order id 0 dt isso trx return payment doc type invoice inconsistent return payment_document doctype windowno mtab mtab mfield mfield c_invoice_id getcontextasint windowno c_invoice_id c_order_id getcontextasint windowno c_order_id c_doctype_id getcontextasint windowno c_doctype_id payment_doctype c_invoice_id c_invoice_id c_doctype_id c_doctype_id mdoctype c_doctype_id mdoctype c_doctype_id setcontext windowno issotrx issotrx c_invoice_id minvoice minvoice c_invoice_id issotrx issotrx paymentdoctypeinvoiceinconsistent c_order_id issotrx paymentdoctypeinvoiceinconsistent payment amounts change of is over under payment set over under amt to 0 c currency id c convesionrate id convert all pay amt discount amt write off amt over under amt pay amt make sure that add up to invoice open amt public string amounts properties ctx int window no m tab m tab m field m field object value object old value if is callout active assuming it is resetting value return int c invoice id env get context as int ctx window no c invoice id new payment if env get context as int ctx window no c payment id 0 env get context as int ctx window no c bpartner id 0 c invoice id 0 return set callout active true changed column string col name m field get column name if col name equals is over under payment set over under amt to zero y equals env get context ctx window no is over under payment m tab set value over under amt env zero int c invoicepayschedule id 0 if env get context as int ctx env window info env tab info c invoice id c invoice id env get context as int ctx env window info env tab info c invoicepayschedule id 0 c invoicepayschedule id env get context as int ctx env window info env tab info c invoicepayschedule id get open amount invoice currency big decimal invoice open amt env zero int c currency invoice id 0 if c invoice id 0 timestamp ts timestamp m tab get value date trx if ts null ts new timestamp system current time millis string sql select c bpartner id c currency id 1 2 invoice open c invoice id 3 1 invoice discount c invoice id isso trx 4 5 2 3 from c invoice where c invoice id 4 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c invoicepayschedule id pstmt set timestamp 2 ts pstmt set int 3 c invoicepayschedule id pstmt set int 4 c invoice id result set rs pstmt execute query if rs next c currency invoice id rs get int 2 invoice open amt rs get big decimal 3 set invoice open amount if invoice open amt null invoice open amt env zero rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message get invoice info log fine open invoice open amt c invoice id c invoice id c currency id c currency invoice id get info from tab big decimal pay amt big decimal m tab get value pay amt big decimal discount amt big decimal m tab get value discount amt big decimal write off amt big decimal m tab get value write off amt big decimal over under amt big decimal m tab get value over under amt log fine pay pay amt discount discount amt write off write off amt over under amt over under amt get currency info int c currency id integer m tab get value c currency id int value m currency currency m currency get ctx c currency id timestamp conv date timestamp m tab get value date trx int c conversiontype id 0 integer ii integer m tab get value c conversiontype id if ii null c conversiontype id ii int value int ad client id env get context as int ctx window no ad client id int ad org id env get context as int ctx window no ad org id get currency rate big decimal currency rate env one if c currency id 0 c currency invoice id 0 c currency id c currency invoice id col name equals c currency id col name equals c conversiontype id log fine inv currency c currency invoice id pay currency c currency id date conv date type c conversiontype id currency rate m conversion rate get rate c currency invoice id c currency id conv date c conversiontype id ad client id ad org id if currency rate null currency rate compare to env zero 0 m tab set value c currency id new integer c currency invoice id does not work set callout active false if c currency invoice id 0 return no error message when no invoice is selected return no currency conversion invoice open amt invoice open amt multiply currency rate set scale currency get std precision big decimal round half up log fine rate currency rate invoice open amt invoice open amt currency changed convert all if col name equals c currency id col name equals c conversiontype id pay amt pay amt multiply currency rate set scale currency get std precision big decimal round half up m tab set value pay amt pay amt discount amt discount amt multiply currency rate set scale currency get std precision big decimal round half up m tab set value discount amt discount amt write off amt write off amt multiply currency rate set scale currency get std precision big decimal round half up m tab set value write off amt write off amt over under amt over under amt multiply currency rate set scale currency get std precision big decimal round half up m tab set value over under amt over under amt no invoice set discount witeoff under over to 0 else if c invoice id 0 if env zero compare to discount amt 0 m tab set value discount amt env zero if env zero compare to write off amt 0 m tab set value write off amt env zero if env zero compare to over under amt 0 m tab set value over under amt env zero pay amt calculate write off else if col name equals pay amt write off amt invoice open amt subtract pay amt subtract discount amt subtract over under amt m tab set value write off amt write off amt else calculate pay amt pay amt invoice open amt subtract discount amt subtract write off amt subtract over under amt m tab set value pay amt pay amt set callout active false return payment_amounts isoverunderpayment overunderamt c_currency_id c_convesionrate_id payamt discountamt writeoffamt overunderamt payamt invoiceopenamt windowno mtab mtab mfield mfield oldvalue iscalloutactive c_invoice_id getcontextasint windowno c_invoice_id getcontextasint windowno c_payment_id getcontextasint windowno c_bpartner_id c_invoice_id setcalloutactive colname mfield getcolumnname colname isoverunderpayment getcontext windowno isoverunderpayment mtab setvalue overunderamt c_invoicepayschedule_id getcontextasint window_info tab_info c_invoice_id c_invoice_id getcontextasint window_info tab_info c_invoicepayschedule_id c_invoicepayschedule_id getcontextasint window_info tab_info c_invoicepayschedule_id bigdecimal invoiceopenamt c_currency_invoice_id c_invoice_id mtab getvalue datetrx currenttimemillis c_bpartner_id c_currency_id invoiceopen c_invoice_id invoicediscount c_invoice_id issotrx c_invoice c_invoice_id preparedstatement preparestatement setint c_invoicepayschedule_id settimestamp setint c_invoicepayschedule_id setint c_invoice_id resultset executequery c_currency_invoice_id getint invoiceopenamt getbigdecimal invoiceopenamt invoiceopenamt sqlexception setcalloutactive getlocalizedmessage invoiceopenamt c_invoice_id c_invoice_id c_currency_id c_currency_invoice_id bigdecimal payamt bigdecimal mtab getvalue payamt bigdecimal discountamt bigdecimal mtab getvalue discountamt bigdecimal writeoffamt bigdecimal mtab getvalue writeoffamt bigdecimal overunderamt bigdecimal mtab getvalue overunderamt payamt discountamt writeoff writeoffamt overunderamt overunderamt c_currency_id mtab getvalue c_currency_id intvalue mcurrency mcurrency c_currency_id convdate mtab getvalue datetrx c_conversiontype_id mtab getvalue c_conversiontype_id c_conversiontype_id intvalue ad_client_id getcontextasint windowno ad_client_id ad_org_id getcontextasint windowno ad_org_id bigdecimal currencyrate c_currency_id c_currency_invoice_id c_currency_id c_currency_invoice_id colname c_currency_id colname c_conversiontype_id invcurrency c_currency_invoice_id paycurrency c_currency_id convdate c_conversiontype_id currencyrate mconversionrate getrate c_currency_invoice_id c_currency_id convdate c_conversiontype_id ad_client_id ad_org_id currencyrate currencyrate compareto mtab setvalue c_currency_id c_currency_invoice_id setcalloutactive c_currency_invoice_id nocurrencyconversion invoiceopenamt invoiceopenamt currencyrate setscale getstdprecision bigdecimal round_half_up currencyrate invoiceopenamt invoiceopenamt colname c_currency_id colname c_conversiontype_id payamt payamt currencyrate setscale getstdprecision bigdecimal round_half_up mtab setvalue payamt payamt discountamt discountamt currencyrate setscale getstdprecision bigdecimal round_half_up mtab setvalue discountamt discountamt writeoffamt writeoffamt currencyrate setscale getstdprecision bigdecimal round_half_up mtab setvalue writeoffamt writeoffamt overunderamt overunderamt currencyrate setscale getstdprecision bigdecimal round_half_up mtab setvalue overunderamt overunderamt c_invoice_id compareto discountamt mtab setvalue discountamt compareto writeoffamt mtab setvalue writeoffamt compareto overunderamt mtab setvalue overunderamt payamt colname payamt writeoffamt invoiceopenamt payamt discountamt overunderamt mtab setvalue writeoffamt writeoffamt payamt payamt invoiceopenamt discountamt writeoffamt overunderamt mtab setvalue payamt payamt setcalloutactive standard constructor public x t aging properties ctx int t aging id string trx name super ctx t aging id trx name if t aging id 0 setad pinstance id 0 setc bp group id 0 setc bpartner id 0 setc currency id 0 setc invoicepayschedule id 0 0 set due0 env zero setdue0 30 env zero setdue0 7 env zero setdue1 7 env zero setdue31 60 env zero setdue31 plus env zero setdue61 90 env zero setdue61 plus env zero setdue8 30 env zero setdue91 plus env zero set due amt env zero set due date new timestamp system current time millis set invoiced amt env zero set is list invoices false set isso trx false set open amt env zero setpastdue1 30 env zero setpastdue1 7 env zero setpastdue31 60 env zero setpastdue31 plus env zero setpastdue61 90 env zero setpastdue61 plus env zero setpastdue8 30 env zero setpastdue91 plus env zero set past due amt env zero x_t_aging t_aging_id trxname t_aging_id trxname t_aging_id setad_pinstance_id setc_bp_group_id setc_bpartner_id setc_currency_id setc_invoicepayschedule_id setdue0 setdue0_30 setdue0_7 setdue1_7 setdue31_60 setdue31_plus setdue61_90 setdue61_plus setdue8_30 setdue91_plus setdueamt setduedate currenttimemillis setinvoicedamt setislistinvoices setissotrx setopenamt setpastdue1_30 setpastdue1_7 setpastdue31_60 setpastdue31_plus setpastdue61_90 setpastdue61_plus setpastdue8_30 setpastdue91_plus setpastdueamt load constructor public x t aging properties ctx result set rs string trx name super ctx rs trx name x_t_aging resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t aging append get id append return sb to string tostring stringbuffer stringbuffer x_t_aging get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 1 throw new illegal argument exception c bp group id is mandatory set value c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id illegalargumentexception c_bp_group_id set_value c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set invoice payment schedule invoice payment schedule public void setc invoicepayschedule id int c invoicepayschedule id if c invoicepayschedule id 1 throw new illegal argument exception c invoicepayschedule id is mandatory set value c invoicepayschedule id new integer c invoicepayschedule id setc_invoicepayschedule_id c_invoicepayschedule_id c_invoicepayschedule_id illegalargumentexception c_invoicepayschedule_id set_value c_invoicepayschedule_id c_invoicepayschedule_id get invoice payment schedule invoice payment schedule public int getc invoicepayschedule id integer ii integer get value c invoicepayschedule id if ii null return 0 return ii int value getc_invoicepayschedule_id get_value c_invoicepayschedule_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set valuenocheck c invoice id null else set valuenocheck c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_valuenocheck c_invoice_id set_valuenocheck c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set due today public void set due0 big decimal due0 if due0 null throw new illegal argument exception due0 is mandatory set value due0 due0 setdue0 bigdecimal illegalargumentexception set_value get due today public big decimal get due0 big decimal bd big decimal get value due0 if bd null return env zero return bd bigdecimal getdue0 bigdecimal bigdecimal get_value set due today 30 public void setdue0 30 big decimal due0 30 if due0 30 null throw new illegal argument exception due0 30 is mandatory set value due0 30 due0 30 setdue0_30 bigdecimal due0_30 due0_30 illegalargumentexception due0_30 set_value due0_30 due0_30 get due today 30 public big decimal getdue0 30 big decimal bd big decimal get value due0 30 if bd null return env zero return bd bigdecimal getdue0_30 bigdecimal bigdecimal get_value due0_30 set due today 7 public void setdue0 7 big decimal due0 7 if due0 7 null throw new illegal argument exception due0 7 is mandatory set value due0 7 due0 7 setdue0_7 bigdecimal due0_7 due0_7 illegalargumentexception due0_7 set_value due0_7 due0_7 get due today 7 public big decimal getdue0 7 big decimal bd big decimal get value due0 7 if bd null return env zero return bd bigdecimal getdue0_7 bigdecimal bigdecimal get_value due0_7 set due 1 7 public void setdue1 7 big decimal due1 7 if due1 7 null throw new illegal argument exception due1 7 is mandatory set value due1 7 due1 7 setdue1_7 bigdecimal due1_7 due1_7 illegalargumentexception due1_7 set_value due1_7 due1_7 get due 1 7 public big decimal getdue1 7 big decimal bd big decimal get value due1 7 if bd null return env zero return bd bigdecimal getdue1_7 bigdecimal bigdecimal get_value due1_7 set due 31 60 public void setdue31 60 big decimal due31 60 if due31 60 null throw new illegal argument exception due31 60 is mandatory set value due31 60 due31 60 setdue31_60 bigdecimal due31_60 due31_60 illegalargumentexception due31_60 set_value due31_60 due31_60 get due 31 60 public big decimal getdue31 60 big decimal bd big decimal get value due31 60 if bd null return env zero return bd bigdecimal getdue31_60 bigdecimal bigdecimal get_value due31_60 set due 31 public void setdue31 plus big decimal due31 plus if due31 plus null throw new illegal argument exception due31 plus is mandatory set value due31 plus due31 plus setdue31_plus bigdecimal due31_plus due31_plus illegalargumentexception due31_plus set_value due31_plus due31_plus get due 31 public big decimal getdue31 plus big decimal bd big decimal get value due31 plus if bd null return env zero return bd bigdecimal getdue31_plus bigdecimal bigdecimal get_value due31_plus set due 61 90 public void setdue61 90 big decimal due61 90 if due61 90 null throw new illegal argument exception due61 90 is mandatory set value due61 90 due61 90 setdue61_90 bigdecimal due61_90 due61_90 illegalargumentexception due61_90 set_value due61_90 due61_90 get due 61 90 public big decimal getdue61 90 big decimal bd big decimal get value due61 90 if bd null return env zero return bd bigdecimal getdue61_90 bigdecimal bigdecimal get_value due61_90 set due 61 public void setdue61 plus big decimal due61 plus if due61 plus null throw new illegal argument exception due61 plus is mandatory set value due61 plus due61 plus setdue61_plus bigdecimal due61_plus due61_plus illegalargumentexception due61_plus set_value due61_plus due61_plus get due 61 public big decimal getdue61 plus big decimal bd big decimal get value due61 plus if bd null return env zero return bd bigdecimal getdue61_plus bigdecimal bigdecimal get_value due61_plus set due 8 30 public void setdue8 30 big decimal due8 30 if due8 30 null throw new illegal argument exception due8 30 is mandatory set value due8 30 due8 30 setdue8_30 bigdecimal due8_30 due8_30 illegalargumentexception due8_30 set_value due8_30 due8_30 get due 8 30 public big decimal getdue8 30 big decimal bd big decimal get value due8 30 if bd null return env zero return bd bigdecimal getdue8_30 bigdecimal bigdecimal get_value due8_30 set due 91 public void setdue91 plus big decimal due91 plus if due91 plus null throw new illegal argument exception due91 plus is mandatory set value due91 plus due91 plus setdue91_plus bigdecimal due91_plus due91_plus illegalargumentexception due91_plus set_value due91_plus due91_plus get due 91 public big decimal getdue91 plus big decimal bd big decimal get value due91 plus if bd null return env zero return bd bigdecimal getdue91_plus bigdecimal bigdecimal get_value due91_plus set amount due amount of the payment due public void set due amt big decimal due amt if due amt null throw new illegal argument exception due amt is mandatory set value due amt due amt setdueamt bigdecimal dueamt dueamt illegalargumentexception dueamt set_value dueamt dueamt get amount due amount of the payment due public big decimal get due amt big decimal bd big decimal get value due amt if bd null return env zero return bd bigdecimal getdueamt bigdecimal bigdecimal get_value dueamt set due date date when the payment is due public void set due date timestamp due date if due date null throw new illegal argument exception due date is mandatory set value due date due date setduedate duedate duedate illegalargumentexception duedate set_value duedate duedate get due date date when the payment is due public timestamp get due date return timestamp get value due date getduedate get_value duedate set invoiced amount the amount invoiced public void set invoiced amt big decimal invoiced amt if invoiced amt null throw new illegal argument exception invoiced amt is mandatory set value invoiced amt invoiced amt setinvoicedamt bigdecimal invoicedamt invoicedamt illegalargumentexception invoicedamt set_value invoicedamt invoicedamt get invoiced amount the amount invoiced public big decimal get invoiced amt big decimal bd big decimal get value invoiced amt if bd null return env zero return bd bigdecimal getinvoicedamt bigdecimal bigdecimal get_value invoicedamt set list invoices include list of invoices public void set is list invoices boolean is list invoices set value is list invoices new boolean is list invoices setislistinvoices islistinvoices set_value islistinvoices islistinvoices get list invoices include list of invoices public boolean is list invoices object oo get value is list invoices if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islistinvoices get_value islistinvoices booleanvalue set sales transaction this is a sales transaction public void set isso trx boolean isso trx set value isso trx new boolean isso trx setissotrx issotrx set_value issotrx issotrx get sales transaction this is a sales transaction public boolean isso trx object oo get value isso trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false issotrx get_value issotrx booleanvalue set open amount open item amount public void set open amt big decimal open amt if open amt null throw new illegal argument exception open amt is mandatory set value open amt open amt setopenamt bigdecimal openamt openamt illegalargumentexception openamt set_value openamt openamt get open amount open item amount public big decimal get open amt big decimal bd big decimal get value open amt if bd null return env zero return bd bigdecimal getopenamt bigdecimal bigdecimal get_value openamt set past due 1 30 public void setpastdue1 30 big decimal pastdue1 30 if pastdue1 30 null throw new illegal argument exception pastdue1 30 is mandatory set value pastdue1 30 pastdue1 30 setpastdue1_30 bigdecimal pastdue1_30 pastdue1_30 illegalargumentexception pastdue1_30 set_value pastdue1_30 pastdue1_30 get past due 1 30 public big decimal getpastdue1 30 big decimal bd big decimal get value pastdue1 30 if bd null return env zero return bd bigdecimal getpastdue1_30 bigdecimal bigdecimal get_value pastdue1_30 set past due 1 7 public void setpastdue1 7 big decimal pastdue1 7 if pastdue1 7 null throw new illegal argument exception pastdue1 7 is mandatory set value pastdue1 7 pastdue1 7 setpastdue1_7 bigdecimal pastdue1_7 pastdue1_7 illegalargumentexception pastdue1_7 set_value pastdue1_7 pastdue1_7 get past due 1 7 public big decimal getpastdue1 7 big decimal bd big decimal get value pastdue1 7 if bd null return env zero return bd bigdecimal getpastdue1_7 bigdecimal bigdecimal get_value pastdue1_7 set past due 31 60 public void setpastdue31 60 big decimal pastdue31 60 if pastdue31 60 null throw new illegal argument exception pastdue31 60 is mandatory set value pastdue31 60 pastdue31 60 setpastdue31_60 bigdecimal pastdue31_60 pastdue31_60 illegalargumentexception pastdue31_60 set_value pastdue31_60 pastdue31_60 get past due 31 60 public big decimal getpastdue31 60 big decimal bd big decimal get value pastdue31 60 if bd null return env zero return bd bigdecimal getpastdue31_60 bigdecimal bigdecimal get_value pastdue31_60 set past due 31 public void setpastdue31 plus big decimal pastdue31 plus if pastdue31 plus null throw new illegal argument exception pastdue31 plus is mandatory set value pastdue31 plus pastdue31 plus setpastdue31_plus bigdecimal pastdue31_plus pastdue31_plus illegalargumentexception pastdue31_plus set_value pastdue31_plus pastdue31_plus get past due 31 public big decimal getpastdue31 plus big decimal bd big decimal get value pastdue31 plus if bd null return env zero return bd bigdecimal getpastdue31_plus bigdecimal bigdecimal get_value pastdue31_plus set past due 61 90 public void setpastdue61 90 big decimal pastdue61 90 if pastdue61 90 null throw new illegal argument exception pastdue61 90 is mandatory set value pastdue61 90 pastdue61 90 setpastdue61_90 bigdecimal pastdue61_90 pastdue61_90 illegalargumentexception pastdue61_90 set_value pastdue61_90 pastdue61_90 get past due 61 90 public big decimal getpastdue61 90 big decimal bd big decimal get value pastdue61 90 if bd null return env zero return bd bigdecimal getpastdue61_90 bigdecimal bigdecimal get_value pastdue61_90 set past due 61 public void setpastdue61 plus big decimal pastdue61 plus if pastdue61 plus null throw new illegal argument exception pastdue61 plus is mandatory set value pastdue61 plus pastdue61 plus setpastdue61_plus bigdecimal pastdue61_plus pastdue61_plus illegalargumentexception pastdue61_plus set_value pastdue61_plus pastdue61_plus get past due 61 public big decimal getpastdue61 plus big decimal bd big decimal get value pastdue61 plus if bd null return env zero return bd bigdecimal getpastdue61_plus bigdecimal bigdecimal get_value pastdue61_plus set past due 8 30 public void setpastdue8 30 big decimal pastdue8 30 if pastdue8 30 null throw new illegal argument exception pastdue8 30 is mandatory set value pastdue8 30 pastdue8 30 setpastdue8_30 bigdecimal pastdue8_30 pastdue8_30 illegalargumentexception pastdue8_30 set_value pastdue8_30 pastdue8_30 get past due 8 30 public big decimal getpastdue8 30 big decimal bd big decimal get value pastdue8 30 if bd null return env zero return bd bigdecimal getpastdue8_30 bigdecimal bigdecimal get_value pastdue8_30 set past due 91 public void setpastdue91 plus big decimal pastdue91 plus if pastdue91 plus null throw new illegal argument exception pastdue91 plus is mandatory set value pastdue91 plus pastdue91 plus setpastdue91_plus bigdecimal pastdue91_plus pastdue91_plus illegalargumentexception pastdue91_plus set_value pastdue91_plus pastdue91_plus get past due 91 public big decimal getpastdue91 plus big decimal bd big decimal get value pastdue91 plus if bd null return env zero return bd bigdecimal getpastdue91_plus bigdecimal bigdecimal get_value pastdue91_plus set past due public void set past due amt big decimal past due amt if past due amt null throw new illegal argument exception past due amt is mandatory set value past due amt past due amt setpastdueamt bigdecimal pastdueamt pastdueamt illegalargumentexception pastdueamt set_value pastdueamt pastdueamt get past due public big decimal get past due amt big decimal bd big decimal get value past due amt if bd null return env zero return bd bigdecimal getpastdueamt bigdecimal bigdecimal get_value pastdueamt comparator constructor public m assignment slot this null null null null status timeslot massignmentslot status_timeslot timeslot constructor param start time start time param end time end time public m assignment slot timestamp start time timestamp end time this start time end time null null status timeslot set display display time from starttime endtime massignmentslot starttime endtime starttime endtime status_timeslot setdisplay display_time_from timeslot constructor param start time start time param end time end time public m assignment slot long start time long end time this new timestamp start time new timestamp end time null null status timeslot set display display time from starttime endtime massignmentslot starttime endtime starttime endtime status_timeslot setdisplay display_time_from non assignment constructor param start time start time param end time end time param name name param description description param status status public m assignment slot timestamp start time timestamp end time string name string description int status set start time start time set end time end time set name name set description description set status status log fine to string starttime endtime massignmentslot starttime endtime setstarttime starttime setendtime endtime setname setdescription setstatus tostring assignment constructor param assignment m assignment public m assignment slot m resource assignment assignment set status assignment is confirmed status confirmed status notconfirmed setm assignment assignment log fine to string massignment massignmentslot mresourceassignment setstatus isconfirmed status_confirmed status_notconfirmed setmassignment tostring set status param status status public void set status int status m status status status_ setstatus m_status get status return status public int get status return m status status_ getstatus m_status is the slot an assignment return true if slot is an assignment public boolean is assignment return m status status notconfirmed m status status confirmed isassignment m_status status_notconfirmed m_status status_confirmed get color for status param background true if background or foreground return color public color get color boolean background not found inactive not available if m status status notavailable return background color gray color magenta holiday else if m status status unavailable return background color gray color pink vacation else if m status status nonbusinessday return background color light gray color red out of normal hours else if m status status notinslotday m status status notinslottime return background color light gray color black assigned else if m status status notconfirmed return background color blue color white confirmed else if m status status confirmed return background color blue color black unknown return background color black color white getcolor m_status status_notavailable m_status status_unavailable m_status status_nonbusinessday lightgray m_status status_notinslotday m_status status_notinslottime lightgray m_status status_notconfirmed m_status status_confirmed get start time return start time public timestamp get start time return m starttime getstarttime m_starttime set start time param start time start time if null use current time public void set start time timestamp start time if start time null m starttime new timestamp system current time millis else m starttime start time starttime setstarttime starttime starttime m_starttime currenttimemillis m_starttime starttime get end time return end time public timestamp get end time return m endtime getendtime m_endtime set end time param end time end time if null use start time public void set end time timestamp end time if end time null m endtime m starttime else m endtime end time endtime setendtime endtime endtime m_endtime m_starttime m_endtime endtime set assignment param assignment m assignment public void setm assignment m resource assignment assignment if assignment null return if is assignment throw new illegal argument exception assignment slot not an assignment m massignment assignment set start time m massignment get assign date from set end time m massignment get assign date to set name m massignment get name set description m massignment get description set status m massignment is confirmed status confirmed status notconfirmed massignment setmassignment mresourceassignment isassignment illegalargumentexception m_massignment setstarttime m_massignment getassigndatefrom setendtime m_massignment getassigndateto setname m_massignment getname setdescription m_massignment getdescription setstatus m_massignment isconfirmed status_confirmed status_notconfirmed get assugnment return assignment public m resource assignment getm assignment return m massignment mresourceassignment getmassignment m_massignment set name param name name public void set name string name if name null m name else m name name setname m_name m_name get name return name public string get name return m name getname m_name set description param description description public void set description string description if description null m description else m description description setdescription m_description m_description get description return description public string get description return m description getdescription m_description set y position param y start zero based y start index param y end zero based y end index public void sety int y start int y end m ystart y start m yend y end ystart yend ystart yend m_ystart ystart m_yend yend get y start position return zero based y start index public int gety start return m ystart getystart m_ystart get y end position return zero based y end index public int gety end return m yend getyend m_yend set x position param x pos zero based x position index param x max number of parallel columns public void setx int x pos int x max m xpos x pos if x max m xmax m xmax x max xpos xmax xpos xmax m_xpos xpos xmax m_xmax m_xmax xmax get x position return zero based x position index public int getx pos return m xpos getxpos m_xpos get x columns return number of parallel columns public int getx max return m xmax getxmax m_xmax set language param language language public void set language language language m language language setlanguage m_language set display mode of to string param display mode display public void set display int display mode m displaymode display mode tostring displaymode display_ setdisplay displaymode m_displaymode displaymode string representation return info public string to string if m displaymode display time from return get info time from else if m displaymode display time from to return get info time from to else if m displaymode display datetime from to return get info date time from to else if m displaymode display name return m name else if m displaymode display name description return get info name description else if m displaymode display full return get info display all string buffer sb new string buffer m assignment slot sb append m starttime append append m endtime append status append m status append name append m name append append m description append return sb to string tostring m_displaymode display_time_from getinfotimefrom m_displaymode display_time_from_to getinfotimefromto m_displaymode display_datetime_from_to getinfodatetimefromto m_displaymode display_name m_name m_displaymode display_name_description getinfonamedescription m_displaymode display_full getinfo display_all stringbuffer stringbuffer massignmentslot m_starttime m_endtime m_status m_name m_description tostring get info with time from return info 00 00 public string get info time from return m language get time format format m starttime getinfotimefrom m_language gettimeformat m_starttime get info with time from to return info 00 00 01 00 public string get info time from to string buffer sb new string buffer sb append m language get time format format m starttime append append m language get time format format m endtime return sb to string getinfotimefromto stringbuffer stringbuffer m_language gettimeformat m_starttime m_language gettimeformat m_endtime tostring get info with date time from to return info 12 12 01 00 00 01 00 or 12 12 01 00 00 12 13 01 01 00 public string get info date time from to string buffer sb new string buffer sb append m language get date time format format m starttime append if time util is same day m starttime m endtime sb append m language get time format format m endtime else m language get date time format format m endtime return sb to string getinfodatetimefromto stringbuffer stringbuffer m_language getdatetimeformat m_starttime timeutil issameday m_starttime m_endtime m_language gettimeformat m_endtime m_language getdatetimeformat m_endtime tostring get info with name and optional description return name description public string get info name description string buffer sb new string buffer m name if m description length 0 sb append append m description append return sb to string getinfonamedescription stringbuffer stringbuffer m_name m_description m_description tostring get info with date time from to name description return 12 12 01 00 00 01 00 name description public string get info string buffer sb new string buffer get info date time from to sb append append m name if m description length 0 sb append append m description append return sb to string getinfo stringbuffer stringbuffer getinfodatetimefromto m_name m_description m_description tostring returns true if time is between start and end time date part is ignored pre example slots 0 00 9 00 9 00 10 00 10 00 11 00 in slot 9 00 false 1 start time in slot 10 00 true 1 end time pre param time time of the day param end time if true the end time is included return true if within slot public boolean in slot timestamp time boolean end time compare gregorian calendar cal new gregorian calendar cal set time time cal set calendar year 1970 cal set calendar day of year 1 handle 00 00 end time if end time cal get calendar hour of day 0 cal get calendar minute 0 cal set calendar hour of day 23 cal set calendar minute 59 time compare new time cal get time in millis start time cal set time m starttime cal set calendar year 1970 cal set calendar day of year 1 time start new time cal get time in millis end time cal set time m endtime cal set calendar year 1970 cal set calendar day of year 1 if cal get calendar hour of day 0 cal get calendar minute 0 cal set calendar hour of day 23 cal set calendar minute 59 time end new time cal get time in millis before start x if compare before start system out println in slot false compare compare before start start return false after end x if compare after end system out println in slot false compare compare after end end return false start x if end time compare equals start system out println in slot true compare compare start start return true end x if end time compare equals end system out println in slot true compare compare end end return true between start end x if compare before end system out println in slot true compare compare before end end return true return false inslot inslot endtime inslot endtime gregoriancalendar gregoriancalendar settime day_of_year endtime hour_of_day hour_of_day gettimeinmillis settime m_starttime day_of_year gettimeinmillis settime m_endtime day_of_year hour_of_day hour_of_day gettimeinmillis inslot inslot endtime inslot endtime inslot inslot compares its two arguments for order returns a negative integer zero or a positive integer as the first argument is less than equal to or greater than the second param o1 the first object to be compared param o2 the second object to be compared return a negative integer zero or a positive integer as the first argument is less than equal to or greater than the second throws class cast exception if the arguments types prevent them from being compared by this comparator public int compare object o1 object o2 if o1 instanceof m assignment slot o2 instanceof m assignment slot throw new class cast exception m assignment slot compare arguments not m assignment slot m assignment slot s1 m assignment slot o1 m assignment slot s2 m assignment slot o2 start date int result s1 get start time compare to s2 get start time if result 0 return result status result s2 get status s1 get status if result 0 return result end date result s1 get end time compare to s2 get end time if result 0 return result name result s1 get name compare to s2 get name if result 0 return result description return s1 get description compare to s2 get description classcastexception massignmentslot massignmentslot classcastexception massignmentslot massignmentslot massignmentslot massignmentslot massignmentslot massignmentslot getstarttime compareto getstarttime getstatus getstatus getendtime compareto getendtime getname compareto getname getdescription compareto getdescription indicates whether some other object is quot equal to quot this comparator param obj the reference object with which to compare return code true code only if the specified object is also a comparator and it imposes the same ordering as this comparator see java lang object equals java lang object see java lang object hash code public boolean equals object obj if obj instanceof m assignment slot m assignment slot cmp m assignment slot obj if m starttime equals cmp get start time m endtime equals cmp get end time m status cmp get status m name equals cmp get name m description equals cmp get description return true return false hashcode massignmentslot massignmentslot massignmentslot m_starttime getstarttime m_endtime getendtime m_status getstatus m_name getname m_description getdescription hash code of m assignment slot return has code public int hash code return m starttime hash code m endtime hash code m status m name hash code m description hash code hashcode massignmentslot hashcode m_starttime hashcode m_endtime hashcode m_status m_name hashcode m_description hashcode basic constructor use the set methods to set the values of the attributes public input basic constructor use the set methods to set the values of the attributes public input string type string name string value set type type set name name set value value settype setname setvalue basic constructor use the set methods to set the values of the attributes public input string type string name int value set type type set name name set value value settype setname setvalue basic constructor use the set methods to set the values of the attributes public input string type string name integer value set type type set name name set value value settype setname setvalue basic constructor use the set methods to set the values of the attributes public input string type string name double value set type type set name name set value value settype setname setvalue sets the type attribute param type the type attribute public input set type string type add attribute type type return this settype addattribute sets the src attribute param src the src attribute public input set src string src add attribute src src return this setsrc addattribute sets the border attribute param border the border attribute public input set border int border add attribute border integer to string border return this setborder addattribute tostring sets the alt attribute param alt the alt attribute public input set alt string alt add attribute alt alt return this setalt addattribute sets the name attribute param name the name attribute public input set name string name add attribute name name return this setname addattribute sets the value attribute param value the value attribute public input set value string value add attribute value value return this setvalue addattribute sets the value attribute param value the value attribute public input set value int value add attribute value integer to string value return this setvalue addattribute tostring sets the value attribute param value the value attribute public input set value integer value add attribute value value to string return this setvalue addattribute tostring sets the value attribute param value the value attribute public input set value double value add attribute value double to string value return this setvalue addattribute tostring sets the accept attribute param accept the accept attribute public input set accept string accept add attribute accept accept return this setaccept addattribute sets the size attribute param size the size attribute public input set size string size add attribute size size return this setsize addattribute sets the size attribute param size the size attribute public input set size int size set size integer to string size return this setsize setsize tostring sets the maxlength attribute param maxlength the maxlength attribute public input set maxlength string maxlength add attribute maxlength maxlength return this setmaxlength addattribute sets the maxlength attribute param maxlength the maxlength attribute public input set maxlength int maxlength set maxlength integer to string maxlength return this setmaxlength setmaxlength tostring sets the usemap attribute param usemap the usemap attribute public input set usemap string usemap add attribute usemap usemap return this setusemap addattribute sets the tabindex attribute param index the tabindex attribute public input set tabindex string index add attribute tabindex index return this settabindex addattribute sets the tabindex attribute param index the tabindex attribute public input set tabindex int index set tabindex integer to string index return this settabindex settabindex tostring sets the checked value param checked true or false public input set checked boolean checked if checked true add attribute checked checked else remove attribute checked return this setchecked addattribute removeattribute sets the readonly value param readonly true or false public input set read only boolean readonly if readonly true add attribute readonly readonly else remove attribute readonly return this setreadonly addattribute removeattribute sets the disabled value param disabled true or false public input set disabled boolean disabled if disabled true add attribute disabled disabled else remove attribute disabled return this setdisabled addattribute removeattribute sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public input add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public input add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public input add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public input add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public input remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onsubmit event occurs when a form is submitted it only applies to the form element param script script public void set on submit string script add attribute onsubmit script setonsubmit addattribute the onreset event occurs when a form is reset it only applies to the form element param script script public void set on reset string script add attribute onreset script setonreset addattribute the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements param script script public void set on select string script add attribute onselect script setonselect addattribute the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea param script script public void set on change string script add attribute onchange script setonchange addattribute the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements param script script public void set on load string script add attribute onload script setonload addattribute the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements param script script public void set on unload string script add attribute onunload script setonunload addattribute the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button param script script public void set on focus string script add attribute onfocus script setonfocus addattribute the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus param script script public void set on blur string script add attribute onblur script setonblur addattribute the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor param ctx context param s resource id id public m resource properties ctx int s resource id string trx name super ctx s resource id trx name s_resource_id mresource s_resource_id trxname s_resource_id trxname load constructor param ctx context param rs result set public m resource properties ctx result set rs string trx name super ctx rs trx name mresource resultset trxname trxname get cached resource type return resource type public m resource type get resource type if m resourcetype null gets resourcetype id 0 m resourcetype new m resource type get ctx gets resourcetype id get trxname return m resourcetype mresourcetype getresourcetype m_resourcetype gets_resourcetype_id m_resourcetype mresourcetype getctx gets_resourcetype_id get_trxname m_resourcetype get product return product public m product get product if m product null m product products m product get get ctx s resource id gets resource id get trxname if products length 0 m product products 0 return m product mproduct getproduct m_product mproduct mproduct getctx s_resource_id gets_resource_id get_trxname m_product m_product before save param new record new return true if it can be saved protected boolean before save boolean new record if new record if get value null get value length 0 set value get name m product new m product this get resource type return m product save get trxname return true newrecord beforesave newrecord newrecord getvalue getvalue setvalue getname m_product mproduct getresourcetype m_product get_trxname after save param new record new param success success return success protected boolean after save boolean new record boolean success if success return success m product prod get product if prod set resource this prod save get trxname return success newrecord aftersave newrecord mproduct getproduct setresource get_trxname standard constructor public x c dunningrunentry properties ctx int c dunningrunentry id string trx name super ctx c dunningrunentry id trx name if c dunningrunentry id 0 set amt env zero setc bpartner id 0 setc bpartner location id 0 setc currency id 0 setc dunningrunentry id 0 setc dunningrun id 0 set processed false set qty env zero setsalesrep id 0 x_c_dunningrunentry c_dunningrunentry_id trxname c_dunningrunentry_id trxname c_dunningrunentry_id setamt setc_bpartner_id setc_bpartner_location_id setc_currency_id setc_dunningrunentry_id setc_dunningrun_id setprocessed setqty setsalesrep_id load constructor public x c dunningrunentry properties ctx result set rs string trx name super ctx rs trx name x_c_dunningrunentry resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c dunningrunentry append get id append return sb to string tostring stringbuffer stringbuffer x_c_dunningrunentry get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 1 throw new illegal argument exception c bpartner id is mandatory set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id illegalargumentexception c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set dunning run entry dunning run entry public void setc dunningrunentry id int c dunningrunentry id if c dunningrunentry id 1 throw new illegal argument exception c dunningrunentry id is mandatory set valuenocheck c dunningrunentry id new integer c dunningrunentry id setc_dunningrunentry_id c_dunningrunentry_id c_dunningrunentry_id illegalargumentexception c_dunningrunentry_id set_valuenocheck c_dunningrunentry_id c_dunningrunentry_id get dunning run entry dunning run entry public int getc dunningrunentry id integer ii integer get value c dunningrunentry id if ii null return 0 return ii int value getc_dunningrunentry_id get_value c_dunningrunentry_id intvalue set dunning run dunning run public void setc dunningrun id int c dunningrun id if c dunningrun id 1 throw new illegal argument exception c dunningrun id is mandatory set valuenocheck c dunningrun id new integer c dunningrun id setc_dunningrun_id c_dunningrun_id c_dunningrun_id illegalargumentexception c_dunningrun_id set_valuenocheck c_dunningrun_id c_dunningrun_id get dunning run dunning run public int getc dunningrun id integer ii integer get value c dunningrun id if ii null return 0 return ii int value getc_dunningrun_id get_value c_dunningrun_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc dunningrun id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_dunningrun_id set note optional additional user defined information public void set note string note if note null note length 2000 log warning length 2000 truncated note note substring 0 1999 set value note note setnote set_value get note optional additional user defined information public string get note return string get value note getnote get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set quantity quantity public void set qty big decimal qty if qty null throw new illegal argument exception qty is mandatory set value qty qty setqty bigdecimal illegalargumentexception set_value get quantity quantity public big decimal get qty big decimal bd big decimal get value qty if bd null return env zero return bd bigdecimal getqty bigdecimal bigdecimal get_value public static final int salesrep id ad reference id 190 set sales representative sales representative or company agent public void setsalesrep id int salesrep id if salesrep id 1 throw new illegal argument exception salesrep id is mandatory set value salesrep id new integer salesrep id salesrep_id_ad_reference_id setsalesrep_id salesrep_id salesrep_id illegalargumentexception salesrep_id set_value salesrep_id salesrep_id get sales representative sales representative or company agent public int getsalesrep id integer ii integer get value salesrep id if ii null return 0 return ii int value getsalesrep_id get_value salesrep_id intvalue prepare e g get parameters public void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe prepare unknown parameter name m system m system get get ctx processinfoparameter getparameter getparametername getparameter m_system msystem getctx perrform process return message throws exception if not successful public string do it throws exception process info pi get process info log info do it pi get title if pi get serializable object instanceof remote setupvo return setup remote else if pi get serializable object instanceof remote merge datavo return merge data with central else if pi get serializable object instanceof remote updatevo return receive update from central else if pi get serializable object instanceof timestamp return exit else throw new exception replication remote unknown vo pi get serializable object doit processinfo getprocessinfo doit gettitle getserializableobject remotesetupvo setupremote getserializableobject remotemergedatavo mergedatawithcentral getserializableobject remoteupdatevo receiveupdatefromcentral getserializableobject replicationremote getserializableobject setup remote ad system ad table ad sequence for remote management return or error message throws exception private string setup remote throws exception process info pi get process info remote setupvo data remote setupvo pi get serializable object log info setup remote start pi data row set rs data replication table try update ad system if data id range start null data id range end null throw new exception setup remote id range cannot be null if data test boolean value setupremotead system data id range start data id range end update ad sequence setupremotead sequence data id range start update doc no prefix suffix setupremotec doctype data ad client id data prefix data suffix update tables while rs next int ad table id rs get int 1 string replication type rs get string 2 string table name rs get string 3 log fine setup remote table name replication type if data test boolean value setupremotead table table name replication type pi set summary ok test data test false catch exception ex log log level severe setup remote ex pi set summary ex to string true object result do it replication local start init new object m system if result null boolean true equals result throw new exception setup remote init error result pi set serializable object null pi add log 0 0 m startdate null null log info setup remote end pi data return remote setup remote ok ad_system ad_table ad_sequence setupremote processinfo getprocessinfo remotesetupvo remotesetupvo getserializableobject setupremote rowset replicationtable ad_system idrangestart idrangeend setupremote idrange booleanvalue setupremotead_system idrangestart idrangeend ad_sequence setupremotead_sequence idrangestart docno setupremotec_doctype ad_client_id ad_table_id getint replicationtype getstring tablename getstring setupremote tablename replicationtype booleanvalue setupremotead_table tablename replicationtype setsummary setupremote setsummary tostring doit replicationlocal m_system setupremote setserializableobject addlog m_startdate setupremote setupremote update replication type and id range of ad system param id range start start param id range end end throws exception if sql error private void setupremotead system big decimal id range start big decimal id range end throws exception m system setid range start id range start m system setid range end id range end m system set replication type m system replicationtype merge m system save ad_system idrangestart idrangeend setupremotead_system bigdecimal idrangestart bigdecimal idrangeend m_system setidrangestart idrangestart m_system setidrangeend idrangeend m_system setreplicationtype msystem replicationtype_merge m_system update start no current next current next sys in ad sequence param id range start start throws exception if sql error private void setupremotead sequence big decimal id range start throws exception string sql update ad sequence set start no id range start where is tableid y and start no id range start int no db execute update sql get trxname if no 1 throw new exception setupremotead sequence start sql update ad sequence set current next id range start where is tableid y and current next id range start no db execute update sql get trxname if no 1 throw new exception setupremotead sequence next sql update ad sequence set current next sys 1 where is tableid y and current next sys 1 no db execute update sql get trxname if no 1 throw new exception setupremotead sequence sys startno currentnext currentnextsys ad_sequence idrangestart setupremotead_sequence bigdecimal idrangestart ad_sequence startno idrangestart istableid startno idrangestart executeupdate get_trxname setupremotead_sequence_start ad_sequence currentnext idrangestart istableid currentnext idrangestart executeupdate get_trxname setupremotead_sequence_next ad_sequence currentnextsys istableid currentnextsys executeupdate get_trxname setupremotead_sequence_sys update document prefix suffix param ad client id client param prefix prefix param suffix suffix throws exception if sql error private void setupremotec doctype int ad client id string prefix string suffix throws exception if prefix null prefix if suffix null suffix docnosequence id string sql update ad sequence set prefix db to string prefix suffix db to string suffix where ad sequence id in select docnosequence id from c doctype where ad client id ad client id and docnosequence id is not null int no db execute update sql get trxname if no 1 throw new exception setupremotec doctype docno batchnosequence id sql update ad sequence set prefix db to string prefix suffix db to string suffix where ad sequence id in select batchnosequence id from c doctype where ad client id ad client id and batchnosequence id is not null no db execute update sql get trxname if no 1 throw new exception setupremotec doctype batch ad_client_id setupremotec_doctype ad_client_id docnosequence_id ad_sequence to_string to_string ad_sequence_id docnosequence_id c_doctype ad_client_id ad_client_id docnosequence_id executeupdate get_trxname setupremotec_doctype_docno batchnosequence_id ad_sequence to_string to_string ad_sequence_id batchnosequence_id c_doctype ad_client_id ad_client_id batchnosequence_id executeupdate get_trxname setupremotec_doctype_batch set replication type of ad table param table name table name param replication type replication type throws exception if sql error private void setupremotead table string table name string replication type throws exception string sql update ad table set replication type replication type where table name table name and replication type replication type int no db execute update sql get trxname if no 1 throw new exception setupremotead table replicationtype ad_table tablename replicationtype setupremotead_table tablename replicationtype ad_table replicationtype replicationtype tablename tablename replicationtype replicationtype executeupdate get_trxname setupremotead_table send new data from remote transcation data changed return info throws exception private string merge data with central throws exception process info pi get process info remote merge datavo data remote merge datavo pi get serializable object log info merge data with central start pi data merge data from central row set sourcers data central data if sourcers null log log level severe merge data with central no data data else if data test boolean value row set targetrs replication local get row set data sql null object result do it replication local start sync new object merge data table name data key columns sourcers targetrs data test boolean true log fine receive update from central data table name result pi set serializable object null boolean replicated replication local is replicated result if replicated pi set error true if result null pi add log 0 null null result to string if boolean false equals result throw new exception receive update from central data table name result local remote data row set rowset replication local get row set data sql null result pi set serializable object serializable rowset log info merge data with central end pi data return remote merge data with central data table name mergedatawithcentral processinfo getprocessinfo remotemergedatavo remotemergedatavo getserializableobject mergedatawithcentral rowset centraldata mergedatawithcentral booleanvalue rowset replicationlocal getrowset doit replicationlocal tablename keycolumns receiveupdatefromcentral tablename setserializableobject replicationlocal isreplicated seterror addlog tostring receiveupdatefromcentral tablename rowset replicationlocal getrowset setserializableobject mergedatawithcentral mergedatawithcentral tablename receive update from central return info throws exception private string receive update from central throws exception process info pi get process info remote updatevo data remote updatevo pi get serializable object log info receive update from central start pi data row set sourcers data central data if sourcers null log log level severe receive update from central no data data pi set summary no data true else if data test boolean value row set targetrs replication local get row set data sql null object result do it replication local start sync new object sync data table name data key columns sourcers targetrs data test boolean false log fine receive update from central data table name result pi set serializable object null boolean replicated replication local is replicated result if replicated pi set error true if result null pi add log 0 null null result to string if boolean false equals result throw new exception receive update from central data table name result pi set serializable object null log info receive update from central end pi data return remote receive update from central ok receiveupdatefromcentral processinfo getprocessinfo remoteupdatevo remoteupdatevo getserializableobject receiveupdatefromcentral rowset centraldata receiveupdatefromcentral setsummary nodata booleanvalue rowset replicationlocal getrowset doit replicationlocal tablename keycolumns receiveupdatefromcentral tablename setserializableobject replicationlocal isreplicated seterror addlog tostring receiveupdatefromcentral tablename setserializableobject receiveupdatefromcentral clean up resources connections return exit throws exception private string exit throws exception log info exit process info pi get process info object result do it replication local start exit null return exit processinfo getprocessinfo doit replicationlocal standard constructor public x rv warehouseprice properties ctx int rv warehouseprice id string trx name super ctx rv warehouseprice id trx name if rv warehouseprice id 0 setc uom id 0 setm pricelist version id 0 setm product id 0 setm warehouse id 0 set name null set value null set warehouse name null x_rv_warehouseprice rv_warehouseprice_id trxname rv_warehouseprice_id trxname rv_warehouseprice_id setc_uom_id setm_pricelist_version_id setm_product_id setm_warehouse_id setname setvalue setwarehousename load constructor public x rv warehouseprice properties ctx result set rs string trx name super ctx rs trx name x_rv_warehouseprice resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x rv warehouseprice append get id append return sb to string tostring stringbuffer stringbuffer x_rv_warehouseprice get_id tostring set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public void set is instance attribute boolean is instance attribute set valuenocheck is instance attribute new boolean is instance attribute setisinstanceattribute isinstanceattribute set_valuenocheck isinstanceattribute isinstanceattribute get instance attribute the product attribute is specific to the instance like serial no lot or guarantee date public boolean is instance attribute object oo get value is instance attribute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isinstanceattribute get_value isinstanceattribute booleanvalue set price list version identifies a unique instance of a price list public void setm pricelist version id int m pricelist version id if m pricelist version id 1 throw new illegal argument exception m pricelist version id is mandatory set valuenocheck m pricelist version id new integer m pricelist version id setm_pricelist_version_id m_pricelist_version_id m_pricelist_version_id illegalargumentexception m_pricelist_version_id set_valuenocheck m_pricelist_version_id m_pricelist_version_id get price list version identifies a unique instance of a price list public int getm pricelist version id integer ii integer get value m pricelist version id if ii null return 0 return ii int value getm_pricelist_version_id get_value m_pricelist_version_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set valuenocheck m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_valuenocheck m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set margin margin for a product as a percentage public void set margin big decimal margin set valuenocheck margin margin setmargin bigdecimal set_valuenocheck get margin margin for a product as a percentage public big decimal get margin big decimal bd big decimal get value margin if bd null return env zero return bd bigdecimal getmargin bigdecimal bigdecimal get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set valuenocheck name name setname illegalargumentexception set_valuenocheck get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set limit price lowest price for a product public void set price limit big decimal price limit set valuenocheck price limit price limit setpricelimit bigdecimal pricelimit set_valuenocheck pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set list price list price public void set price list big decimal price list set valuenocheck price list price list setpricelist bigdecimal pricelist set_valuenocheck pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set standard price standard price public void set price std big decimal price std set valuenocheck price std price std setpricestd bigdecimal pricestd set_valuenocheck pricestd pricestd get standard price standard price public big decimal get price std big decimal bd big decimal get value price std if bd null return env zero return bd bigdecimal getpricestd bigdecimal bigdecimal get_value pricestd set available quantity available quantity on hand reserved public void set qty available big decimal qty available set valuenocheck qty available qty available setqtyavailable bigdecimal qtyavailable set_valuenocheck qtyavailable qtyavailable get available quantity available quantity on hand reserved public big decimal get qty available big decimal bd big decimal get value qty available if bd null return env zero return bd bigdecimal getqtyavailable bigdecimal bigdecimal get_value qtyavailable set on hand quantity on hand quantity public void set qty on hand big decimal qty on hand set valuenocheck qty on hand qty on hand setqtyonhand bigdecimal qtyonhand set_valuenocheck qtyonhand qtyonhand get on hand quantity on hand quantity public big decimal get qty on hand big decimal bd big decimal get value qty on hand if bd null return env zero return bd bigdecimal getqtyonhand bigdecimal bigdecimal get_value qtyonhand set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered set valuenocheck qty ordered qty ordered setqtyordered bigdecimal qtyordered set_valuenocheck qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set reserved quantity reserved quantity public void set qty reserved big decimal qty reserved set valuenocheck qty reserved qty reserved setqtyreserved bigdecimal qtyreserved set_valuenocheck qtyreserved qtyreserved get reserved quantity reserved quantity public big decimal get qty reserved big decimal bd big decimal get value qty reserved if bd null return env zero return bd bigdecimal getqtyreserved bigdecimal bigdecimal get_value qtyreserved set sku stock keeping unit public void setsku string sku if sku null sku length 30 log warning length 30 truncated sku sku substring 0 29 set valuenocheck sku sku set_valuenocheck get sku stock keeping unit public string getsku return string get value sku get_value set symbol symbol for a unit of measure public void setuom symbol string uom symbol if uom symbol null uom symbol length 10 log warning length 10 truncated uom symbol uom symbol substring 0 9 set valuenocheck uom symbol uom symbol setuomsymbol uomsymbol uomsymbol uomsymbol uomsymbol uomsymbol set_valuenocheck uomsymbol uomsymbol get symbol symbol for a unit of measure public string getuom symbol return string get value uom symbol getuomsymbol get_value uomsymbol set upc ean bar code universal product code or its superset european article number public void setupc string upc if upc null upc length 30 log warning length 30 truncated upc upc substring 0 29 set valuenocheck upc upc set_valuenocheck get upc ean bar code universal product code or its superset european article number public string getupc return string get value upc get_value set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set valuenocheck value value setvalue illegalargumentexception set_valuenocheck get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value set warehouse warehouse name public void set warehouse name string warehouse name if warehouse name null throw new illegal argument exception warehouse name is mandatory if warehouse name length 60 log warning length 60 truncated warehouse name warehouse name substring 0 59 set valuenocheck warehouse name warehouse name setwarehousename warehousename warehousename illegalargumentexception warehousename warehousename warehousename warehousename set_valuenocheck warehousename warehousename get warehouse warehouse name public string get warehouse name return string get value warehouse name getwarehousename get_value warehousename get m process from cache param ctx context param ad process id id return m process public static m process get properties ctx int ad process id integer key new integer ad process id m process ret value m process s cache get key if ret value null return ret value ret value new m process ctx ad process id null if ret value get id 0 s cache put key ret value return ret value mprocess ad_process_id mprocess mprocess ad_process_id ad_process_id mprocess retvalue mprocess s_cache retvalue retvalue retvalue mprocess ad_process_id retvalue get_id s_cache retvalue retvalue get m process from menu param ctx context param ad menu id id return m process or null public static m process get from menu properties ctx int ad menu id m process ret value null string sql select from ad process p where exists select from ad menu m where m ad process id p ad process id and m ad menu id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 ad menu id result set rs pstmt execute query if rs next ret value new m process ctx rs null save in cache integer key new integer ret value getad process id s cache put key ret value rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value mprocess ad_menu_id mprocess mprocess getfrommenu ad_menu_id mprocess retvalue ad_process ad_menu ad_process_id ad_process_id ad_menu_id preparedstatement preparestatement setint ad_menu_id resultset executequery retvalue mprocess retvalue getad_process_id s_cache retvalue s_log retvalue standard constructor param ctx context param ad process id process public m process properties ctx int ad process id string ignored super ctx ad process id null if ad process id 0 set value null set name null set is report false set is server process false set access level accesslevel all set entity type entitytype usermaintained set is beta functionality false ad_process_id mprocess ad_process_id ad_process_id ad_process_id setvalue setname setisreport setisserverprocess setaccesslevel accesslevel_all setentitytype entitytype_usermaintained setisbetafunctionality load contsructor param ctx context param rs result set public m process properties ctx result set rs string ignored super ctx rs null mprocess resultset get parameters return parameters public m process para get parameters if m parameters null return m parameters array list m process para list new array list m process para string sql select from ad process para where ad process id order by seq no prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getad process id result set rs pstmt execute query while rs next list add new m process para get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e finally try if pstmt null pstmt close catch exception e pstmt null m parameters new m process para list size list to array m parameters return m parameters mprocesspara getparameters m_parameters m_parameters arraylist mprocesspara arraylist mprocesspara ad_process_para ad_process_id seqno preparedstatement preparestatement setint getad_process_id resultset executequery mprocesspara getctx m_parameters mprocesspara toarray m_parameters m_parameters get parameter with column name param name column name return parameter or null public m process para get parameter string name get parameters for int i 0 i m parameters length i if m parameters i get column name equals name return m parameters i return null columnname mprocesspara getparameter getparameters m_parameters m_parameters getcolumnname m_parameters string representation return info public string to string string buffer sb new string buffer m process append get id append return sb to string tostring stringbuffer stringbuffer mprocess get_id tostring process w o parameter param record id record return process instance public mp instance process it int record id trx trx mp instance p instance new mp instance this record id lock p instance set is processing true p instance save boolean ok true pl sql procedure string procedure name get procedure name if procedure name null procedure name length 0 ok start process procedure name p instance unlock p instance set result ok mp instance result ok mp instance result error p instance set is processing false p instance save p instance log return p instance record_id mpinstance processit record_id mpinstance pinstance mpinstance record_id pinstance setisprocessing pinstance procedurename getprocedurename procedurename procedurename startprocess procedurename pinstance pinstance setresult mpinstance result_ok mpinstance result_error pinstance setisprocessing pinstance pinstance pinstance process it sync param pi process info param trx transaction return process instance public boolean process it process info pi trx trx if pi getad pinstance id 0 mp instance p instance new mp instance this pi getrecord id lock p instance set is processing true p instance save boolean ok false java class string classname get classname if classname null classname length 0 ok start class classname pi trx else log severe no classname return ok processit processinfo getad_pinstance_id mpinstance pinstance mpinstance getrecord_id pinstance setisprocessing pinstance getclassname startclass is this a java process return true if java process public boolean is java process string classname get classname return classname null classname length 0 isjavaprocess getclassname start database process param procedure name pl sql procedure name param p instance process instance see process ctl start process return true if success private boolean start process string procedure name mp instance p instance int ad pinstance id p instance getad pinstance id execute on this thread connection log info procedure name ad pinstance id string sql call procedure name try callable statement cstmt db prepare call sql ro cstmt set int 1 ad pinstance id cstmt execute update cstmt close catch exception e log log level severe sql e p instance set result mp instance result error p instance set error msg e get localized message return false p instance set result mp instance result ok return true procedurename pinstance processctl startprocess startprocess procedurename mpinstance pinstance ad_pinstance_id pinstance getad_pinstance_id procedurename ad_pinstance_id procedurename callablestatement preparecall setint ad_pinstance_id executeupdate pinstance setresult mpinstance result_error pinstance seterrormsg getlocalizedmessage pinstance setresult mpinstance result_ok start java class sync instanciate the class implementing the interface process call the class can be a server client class when in package org compiere process or org compiere model or a client only class e g in org compiere report param classname name of the class to call param pi process info return true if success see process ctl start class private boolean start class string classname process info pi trx trx log info classname pi boolean ret value false process call my object null try class my class class for name classname my object process call my class new instance if my object null ret value false else ret value my object start process get ctx pi trx catch exception e pi set summary error start class classname true log log level severe classname e throw new runtime exception e return true processcall processctl startclass startclass processinfo retvalue processcall myobject myclass forname myobject processcall myclass newinstance myobject retvalue retvalue myobject startprocess getctx setsummary runtimeexception is it a workflow return true if workflow public boolean is workflow return getad workflow id 0 isworkflow getad_workflow_id update statistics param seconds sec public void add statistics int seconds setstatistic count getstatistic count 1 setstatistic seconds getstatistic seconds seconds addstatistics setstatistic_count getstatistic_count setstatistic_seconds getstatistic_seconds after save param new record new param success success return success protected boolean after save boolean new record boolean success if new record add to all automatic roles m role roles m role get of get ctx is manual n for int i 0 i roles length i m process access pa new m process access this roles i getad role id pa save menu workflow else if is valuechanged is active is valuechanged name is valuechanged description is valuechanged help m menu menues m menu get get ctx ad process id getad process id for int i 0 i menues length i menues i set is active is active menues i set name get name menues i set description get description menues i save x ad wf node nodes m window getwf nodes get ctx ad process id getad process id for int i 0 i nodes length i boolean changed false if nodes i is active is active nodes i set is active is active changed true if nodes i is centrally maintained nodes i set name get name nodes i set description get description nodes i set help get help changed true if changed nodes i save return success newrecord aftersave newrecord newrecord mrole mrole getof getctx ismanual mprocessaccess mprocessaccess getad_role_id is_valuechanged isactive is_valuechanged is_valuechanged is_valuechanged mmenu mmenu getctx ad_process_id getad_process_id setisactive isactive setname getname setdescription getdescription x_ad_wf_node m_window getwfnodes getctx ad_process_id getad_process_id isactive isactive setisactive isactive iscentrallymaintained setname getname setdescription getdescription sethelp gethelp standard constructor public x c conversion rate properties ctx int c conversion rate id string trx name super ctx c conversion rate id trx name if c conversion rate id 0 setc conversiontype id 0 setc conversion rate id 0 setc currency id 0 setc currency id to 0 set divide rate env zero set multiply rate env zero set valid from new timestamp system current time millis x_c_conversion_rate c_conversion_rate_id trxname c_conversion_rate_id trxname c_conversion_rate_id setc_conversiontype_id setc_conversion_rate_id setc_currency_id setc_currency_id_to setdividerate setmultiplyrate setvalidfrom currenttimemillis load constructor public x c conversion rate properties ctx result set rs string trx name super ctx rs trx name x_c_conversion_rate resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c conversion rate append get id append return sb to string tostring stringbuffer stringbuffer x_c_conversion_rate get_id tostring set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 1 throw new illegal argument exception c conversiontype id is mandatory set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id illegalargumentexception c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set conversion rate rate used for converting currencies public void setc conversion rate id int c conversion rate id if c conversion rate id 1 throw new illegal argument exception c conversion rate id is mandatory set valuenocheck c conversion rate id new integer c conversion rate id setc_conversion_rate_id c_conversion_rate_id c_conversion_rate_id illegalargumentexception c_conversion_rate_id set_valuenocheck c_conversion_rate_id c_conversion_rate_id get conversion rate rate used for converting currencies public int getc conversion rate id integer ii integer get value c conversion rate id if ii null return 0 return ii int value getc_conversion_rate_id get_value c_conversion_rate_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc conversion rate id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_conversion_rate_id public static final int c currency id ad reference id 112 set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set value c currency id new integer c currency id c_currency_id_ad_reference_id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_value c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue public static final int c currency id to ad reference id 112 set currency to target currency public void setc currency id to int c currency id to set value c currency id to new integer c currency id to c_currency_id_to_ad_reference_id setc_currency_id_to c_currency_id_to set_value c_currency_id_to c_currency_id_to get currency to target currency public int getc currency id to integer ii integer get value c currency id to if ii null return 0 return ii int value getc_currency_id_to get_value c_currency_id_to intvalue set divide rate to convert source number to target number the source is divided public void set divide rate big decimal divide rate if divide rate null throw new illegal argument exception divide rate is mandatory set value divide rate divide rate setdividerate bigdecimal dividerate dividerate illegalargumentexception dividerate set_value dividerate dividerate get divide rate to convert source number to target number the source is divided public big decimal get divide rate big decimal bd big decimal get value divide rate if bd null return env zero return bd bigdecimal getdividerate bigdecimal bigdecimal get_value dividerate set multiply rate rate to multiple the source by to calculate the target public void set multiply rate big decimal multiply rate if multiply rate null throw new illegal argument exception multiply rate is mandatory set value multiply rate multiply rate setmultiplyrate bigdecimal multiplyrate multiplyrate illegalargumentexception multiplyrate set_value multiplyrate multiplyrate get multiply rate rate to multiple the source by to calculate the target public big decimal get multiply rate big decimal bd big decimal get value multiply rate if bd null return env zero return bd bigdecimal getmultiplyrate bigdecimal bigdecimal get_value multiplyrate set valid from valid from including this date first day public void set valid from timestamp valid from if valid from null throw new illegal argument exception valid from is mandatory set value valid from valid from setvalidfrom validfrom validfrom illegalargumentexception validfrom set_value validfrom validfrom get valid from valid from including this date first day public timestamp get valid from return timestamp get value valid from getvalidfrom get_value validfrom set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto this sets the document up since an xml document can be pretty much anything you want all it does is create an xml instruction for the default version and sets the document to be standalone public xml document this default xml version true xmldocument default_xml_version this sets the document up since an xml document can be pretty much anything all this does is create the xml instruction for the version specified and set the document to be standalone param version version of xml this document is public xml document double version this version true xmldocument this sets the document up since an xml document can be pretty much anything all this does is create the xml instruction with the version specified and identifies the document as standalone if set param version version of xml document is param standalone boolean code true code if standalone else false public xml document double version boolean standalone prolog new vector 2 string buffer version str new string buffer version str append xml version version str append version version str append standalone if standalone version str append yes else version str append no n this version decl version str to string fixme ecs currently does not do any ordering of attributes although about 99 of the time this has no problems in the initial xml declaration it can be a problem in certain frameworks e g cocoon xerces xalan so instead of adding an element here we have to store this first command in a string and add it to the output at output time pi version decl new pi set target xml if standalone version decl add instruction standalone yes else version decl add instruction standalone no version decl set version version prolog add element version decl xmldocument stringbuffer versionstr stringbuffer versionstr versionstr versionstr versionstr versionstr versiondecl versionstr tostring versiondecl settarget versiondecl addinstruction versiondecl addinstruction versiondecl setversion addelement versiondecl this sets the document up since an xml document can be pretty much anything all this does is create the xml instruction with the version specified and identifies the document as standalone if set this also allows the codeset to be set as well param version version of xml document is param standalone boolean code true code if standalone else false param codeset string codeset to use public xml document double version boolean standalone string codeset this version standalone set codeset codeset xmldocument setcodeset this sets the codeset for this document param codeset string representation of codeset for this document public void set codeset string codeset this codeset codeset setcodeset this gets the codeset for this document return string the codeset for this document public string get codeset return codeset getcodeset this adds a stylesheet to the xml document param href string reference to stylesheet param type string type of stylesheet public xml document add stylesheet string href string type pi pi new pi pi set target xml stylesheet add instruction href href add instruction type type prolog add element pi return this xmldocument addstylesheet settarget addinstruction addinstruction addelement this adds a stylesheet to the xml document and assumes the default code text xsl code type param href string reference to stylesheet public xml document add stylesheet string href return add stylesheet href text xsl xmldocument addstylesheet addstylesheet this adds the specified element to the prolog of the document param element element to add public xml document add to prolog concrete element element prolog add element element return this xmldocument addtoprolog concreteelement addelement this adds an element to the xml document if the document is empty it sets the passed in element as the root element param element xml element to add return xml document modified document public xml document add element xml element if content null content element else content add element element return this xmldocument xmldocument addelement addelement write the document to the output stream param out output stream to write to public void output output stream out fixme the other part of the version hack add the version declaration to the beginning of the document try out write version decl get bytes catch exception e for int i 0 i prolog size i concrete element e concrete element prolog element at i e output out if content null content output out outputstream outputstream outputstream versiondecl getbytes concreteelement concreteelement elementat write the document to the printe writer param out print writer to write to public void output print writer out fixme the other part of the version hack add the version declaration to the beginning of the document out write version decl for int i 0 i prolog size i concrete element e concrete element prolog element at i e output out if content null content output out printewriter printwriter printwriter versiondecl concreteelement concreteelement elementat override to string so it does something useful return string representation of the document public final string to string string buffer ret val new string buffer if codeset null for int i 0 i prolog size i concrete element e concrete element prolog element at i ret val append e to string get codeset n if content null ret val append content to string get codeset else for int i 0 i prolog size i concrete element e concrete element prolog element at i ret val append e to string n if content null ret val append content to string fixme the other part of the version hack add the version declaration to the beginning of the document return version decl ret val to string tostring tostring stringbuffer retval stringbuffer concreteelement concreteelement elementat retval tostring getcodeset retval tostring getcodeset concreteelement concreteelement elementat retval tostring retval tostring versiondecl retval tostring override to string so it prints something useful param codeset string codeset to use return string representation of the document public final string to string string codeset string buffer ret val new string buffer for int i 0 i prolog size i concrete element e concrete element prolog element at i ret val append e to string get codeset n if content null ret val append content to string get codeset n fixme the other part of the version hack add the version declaration to the beginning of the document return version decl ret val to string tostring tostring stringbuffer retval stringbuffer concreteelement concreteelement elementat retval tostring getcodeset retval tostring getcodeset versiondecl retval tostring clone this document return object cloned xml document public object clone return content clone xmldocument get content return content public object get contents return contents getcontents standard constructor public x m bomalternative properties ctx int m bomalternative id string trx name super ctx m bomalternative id trx name if m bomalternative id 0 setm bomalternative id 0 setm product id 0 set name null x_m_bomalternative m_bomalternative_id trxname m_bomalternative_id trxname m_bomalternative_id setm_bomalternative_id setm_product_id setname load constructor public x m bomalternative properties ctx result set rs string trx name super ctx rs trx name x_m_bomalternative resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m bomalternative append get id append return sb to string tostring stringbuffer stringbuffer x_m_bomalternative get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set alternative group product bom alternative group public void setm bomalternative id int m bomalternative id if m bomalternative id 1 throw new illegal argument exception m bomalternative id is mandatory set valuenocheck m bomalternative id new integer m bomalternative id setm_bomalternative_id m_bomalternative_id m_bomalternative_id illegalargumentexception m_bomalternative_id set_valuenocheck m_bomalternative_id m_bomalternative_id get alternative group product bom alternative group public int getm bomalternative id integer ii integer get value m bomalternative id if ii null return 0 return ii int value getm_bomalternative_id get_value m_bomalternative_id intvalue set product product service item public void setm product id int m product id if m product id 1 throw new illegal argument exception m product id is mandatory set valuenocheck m product id new integer m product id setm_product_id m_product_id m_product_id illegalargumentexception m_product_id set_valuenocheck m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set country param info el country info public void set countryid string info el m countryid el info el info_el setcountryid info_el m_countryid_el info_el set region param info el region info public void set regionid string info el m regionid el info el info_el setregionid info_el m_regionid_el info_el set region param info el region info public void set region name string info el m regionname el info el info_el setregionname info_el m_regionname_el info_el set city param info el city info public void set city string info el m city el info el info_el setcity info_el m_city_el info_el set postal param info el postal info public void set postal string info el m postal el info el info_el setpostal info_el m_postal_el info_el start tag return skip body throws jsp exception public int do start tag throws jsp exception properties ctx jsp env get ctx http servlet request page context get request country int c country id 0 try string info string expression util eval not null location countryid m countryid el string class this page context if info null info length 0 c country id integer parse int info catch exception e log severe country e m location loc new m location ctx 0 null if c country id 0 c country id loc getc country id default string name c country id select sel new select name get countries loc c country id sel setid id name sel set class c mandatory tr tr country create row name msg translate ctx name sel region int c region id 0 try string info string expression util eval not null location regionid m regionid el string class this page context if info null info length 0 c region id integer parse int info catch exception e log log level severe regionid e if c region id 0 c region id loc getc region id default name c region id tr tr region null string region name string expression util eval not null location region name m regionname el string class this page context input field new input input type text region name region name field set size 40 set maxlength 60 setid id regionname if m country null m country is has region sel new select name get regions loc c country id c region id sel setid id name tr region create row name m country get region name sel field region name else tr region create row name msg translate ctx name field name only city name city string city string expression util eval not null location city m city el string class this page context field new input input type text name city field set size 40 set maxlength 60 setid id name field set class c mandatory tr tr city create row name msg translate ctx name field name postal string postal string expression util eval not null location postal m postal el string class this page context field new input input type text name postal field set size 10 set maxlength 10 setid id name field set class c mandatory tr tr postal create row name msg translate ctx name field log fine c country id c country id c region id c region id region name region name city city postal postal assemble html code html new html code if m country null m country display sequence html add element tr city html add element tr postal html add element tr region html add element tr country else html add element tr city html add element tr postal html add element tr region html add element tr country jsp writer out page context get out html output out return skip body skip_body jspexception dostarttag jspexception jspenv getctx httpservletrequest pagecontext getrequest c_country_id expressionutil evalnotnull m_countryid_el pagecontext c_country_id parseint mlocation mlocation c_country_id c_country_id getc_country_id c_country_id getcountries c_country_id id_ setclass c_mandatory tr_country createrow c_region_id expressionutil evalnotnull m_regionid_el pagecontext c_region_id parseint c_region_id c_region_id getc_region_id c_region_id tr_region regionname expressionutil evalnotnull regionname m_regionname_el pagecontext type_text regionname regionname setsize setmaxlength id_regionname m_country m_country ishasregion getregions c_country_id c_region_id id_ tr_region createrow m_country getregionname tr_region createrow expressionutil evalnotnull m_city_el pagecontext type_text setsize setmaxlength id_ setclass c_mandatory tr_city createrow expressionutil evalnotnull m_postal_el pagecontext type_text setsize setmaxlength id_ setclass c_mandatory tr_postal createrow c_country_id c_country_id c_region_id c_region_id regionname regionname htmlcode htmlcode m_country m_country displaysequence addelement tr_city addelement tr_postal addelement tr_region addelement tr_country addelement tr_city addelement tr_postal addelement tr_region addelement tr_country jspwriter pagecontext getout skip_body end tag nop return eval page throws jsp exception public int do end tag throws jsp exception return eval page eval_page jspexception doendtag jspexception eval_page get country options add regions for selected country set default param loc m location param c country id default country return array of country options private option get countries m location loc int c country id m country countries m country get countries loc get ctx option options new option countries length m country null for int i 0 i countries length i options i new option string value of countries i getc country id options i add element util maskhtml countries i get name if countries i getc country id c country id m country countries i options i set selected true return options mlocation c_country_id getcountries mlocation c_country_id mcountry mcountry getcountries getctx m_country valueof getc_country_id addelement getname getc_country_id c_country_id m_country setselected get region options for country param loc location param c country id country param c region id default region return region array private option get regions m location loc int c country id int c region id m region regions m region get regions loc get ctx c country id option options new option regions length 1 options 0 new option 0 options 0 add element for int i 0 i regions length i options i 1 new option string value of regions i getc region id options i 1 add element regions i get name if regions i getc region id c region id options i 1 set selected true return options c_country_id c_region_id getregions mlocation c_country_id c_region_id mregion mregion getregions getctx c_country_id addelement valueof getc_region_id addelement getname getc_region_id c_region_id setselected add line to html param name name param label text label text param data data element return table row private tr create row string name string label text concrete element data tr tr new tr label td td new td tr add element td td set align right label label new label td add element label label setid id name label set for name label add element label text data td new td tr add element td td set align left td add element data return tr labeltext createrow labeltext concreteelement addelement setalign addelement id_ setfor addelement labeltext addelement setalign addelement add line to html param name name param label text label text param data data element param data2 second data element return table row private tr create row string name string label text concrete element data concrete element data2 tr tr new tr label td td new td tr add element td td set align right label label new label td add element label label setid id name label set for name label add element label text data td new td tr add element td td set align left td add element data td add element td add element data2 return tr labeltext createrow labeltext concreteelement concreteelement addelement setalign addelement id_ setfor addelement labeltext addelement setalign addelement addelement addelement get m attribute set from cache param ctx context param m attributeset id id return m attribute set public static m attribute set get properties ctx int m attributeset id integer key new integer m attributeset id m attribute set ret value m attribute set s cache get key if ret value null return ret value ret value new m attribute set ctx m attributeset id null if ret value get id 0 s cache put key ret value return ret value mattributeset m_attributeset_id mattributeset mattributeset m_attributeset_id m_attributeset_id mattributeset retvalue mattributeset s_cache retvalue retvalue retvalue mattributeset m_attributeset_id retvalue get_id s_cache retvalue retvalue standard constructor param ctx context param m attributeset id id public m attribute set properties ctx int m attributeset id string trx name super ctx m attributeset id trx name if m attributeset id 0 set name null set is guarantee date false set is guarantee date mandatory false set is lot false set is lot mandatory false set is ser no false set is ser no mandatory false set is instance attribute false set mandatory type mandatorytype notmandatary m_attributeset_id mattributeset m_attributeset_id trxname m_attributeset_id trxname m_attributeset_id setname setisguaranteedate setisguaranteedatemandatory setislot setislotmandatory setisserno setissernomandatory setisinstanceattribute setmandatorytype mandatorytype_notmandatary load constructor param ctx context param rs result set public m attribute set properties ctx result set rs string trx name super ctx rs trx name mattributeset resultset trxname trxname get attribute array param instance attributes true if for instance return instance or product attribute array public m attribute getm attributes boolean instance attributes if m instanceattributes null instance attributes m productattributes null instance attributes string sql select mau m attribute id from m attributeuse mau inner join m attribute ma on mau m attribute id ma m attribute id where mau is active y and ma is active y and mau m attributeset id and ma is instance attribute 1 2 order by mau seq no array list m attribute list new array list m attribute prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm attributeset id pstmt set string 2 instance attributes y n result set rs pstmt execute query while rs next m attribute ma new m attribute get ctx rs get int 1 get trxname list add ma rs close pstmt close pstmt null catch sql exception ex log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null differentiate attributes if instance attributes m instanceattributes new m attribute list size list to array m instanceattributes else m productattributes new m attribute list size list to array m productattributes if instance attributes if is instance attribute m instanceattributes length 0 set is instance attribute m instanceattributes length 0 return if instance attributes return m instanceattributes return m productattributes instanceattributes mattribute getmattributes instanceattributes m_instanceattributes instanceattributes m_productattributes instanceattributes m_attribute_id m_attributeuse m_attribute m_attribute_id m_attribute_id isactive isactive m_attributeset_id isinstanceattribute seqno arraylist mattribute arraylist mattribute preparedstatement preparestatement get_trxname setint getm_attributeset_id setstring instanceattributes resultset executequery mattribute mattribute getctx getint get_trxname sqlexception sqlexception instanceattributes m_instanceattributes mattribute toarray m_instanceattributes m_productattributes mattribute toarray m_productattributes instanceattributes isinstanceattribute m_instanceattributes setisinstanceattribute m_instanceattributes instanceattributes m_instanceattributes m_productattributes something is mandatory return true if something is mandatory public boolean is mandatory return mandatorytype notmandatary equals get mandatory type is lot mandatory is ser no mandatory is guarantee date mandatory ismandatory mandatorytype_notmandatary getmandatorytype islotmandatory issernomandatory isguaranteedatemandatory is always mandatory return mandatory public boolean is mandatory always return mandatorytype alwaysmandatory equals get mandatory type ismandatoryalways mandatorytype_alwaysmandatory getmandatorytype is mandatory when shipping return true if required for shipping public boolean is mandatory shipping return mandatorytype whenshipping equals get mandatory type ismandatoryshipping mandatorytype_whenshipping getmandatorytype exclude entry param ad column id column param isso trx sales order return true if excluded public boolean exclude entry int ad column id boolean isso trx if m excludes null array list x m attributesetexclude list new array list x m attributesetexclude string sql select from m attributesetexclude where is active y and m attributeset id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm attributeset id result set rs pstmt execute query while rs next list add new x m attributesetexclude get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m excludes new x m attributesetexclude list size list to array m excludes find it if m excludes null m excludes length 0 m column column m column get get ctx ad column id for int i 0 i m excludes length i if m excludes i getad table id column getad table id m excludes i isso trx isso trx return true return false ad_column_id issotrx excludeentry ad_column_id issotrx m_excludes arraylist x_m_attributesetexclude arraylist x_m_attributesetexclude m_attributesetexclude isactive m_attributeset_id preparedstatement preparestatement setint getm_attributeset_id resultset executequery x_m_attributesetexclude getctx m_excludes x_m_attributesetexclude toarray m_excludes m_excludes m_excludes m_column m_column getctx ad_column_id m_excludes m_excludes getad_table_id getad_table_id m_excludes issotrx issotrx exclude lot creation param ad column id column param isso trx so return true if excluded public boolean is exclude lot int ad column id boolean isso trx if getm lotctl id 0 return true if m excludelots null array list x m lotctlexclude list new array list x m lotctlexclude string sql select from m lotctlexclude where is active y and m lotctl id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm lotctl id result set rs pstmt execute query while rs next list add new x m lotctlexclude get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m excludelots new x m lotctlexclude list size list to array m excludelots find it if m excludelots null m excludelots length 0 m column column m column get get ctx ad column id for int i 0 i m excludelots length i if m excludelots i getad table id column getad table id m excludelots i isso trx isso trx return true return false ad_column_id issotrx isexcludelot ad_column_id issotrx getm_lotctl_id m_excludelots arraylist x_m_lotctlexclude arraylist x_m_lotctlexclude m_lotctlexclude isactive m_lotctl_id preparedstatement preparestatement setint getm_lotctl_id resultset executequery x_m_lotctlexclude getctx m_excludelots x_m_lotctlexclude toarray m_excludelots m_excludelots m_excludelots m_column m_column getctx ad_column_id m_excludelots m_excludelots getad_table_id getad_table_id m_excludelots issotrx issotrx exclude ser no creation param ad column id column param isso trx so return true if excluded public boolean is exclude ser no int ad column id boolean isso trx if getm sernoctl id 0 return true if m excludesernos null array list x m sernoctlexclude list new array list x m sernoctlexclude string sql select from m sernoctlexclude where is active y and m sernoctl id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 getm sernoctl id result set rs pstmt execute query while rs next list add new x m sernoctlexclude get ctx rs null rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m excludesernos new x m sernoctlexclude list size list to array m excludesernos find it if m excludesernos null m excludesernos length 0 m column column m column get get ctx ad column id for int i 0 i m excludesernos length i if m excludesernos i getad table id column getad table id m excludesernos i isso trx isso trx return true return false serno ad_column_id issotrx isexcludeserno ad_column_id issotrx getm_sernoctl_id m_excludesernos arraylist x_m_sernoctlexclude arraylist x_m_sernoctlexclude m_sernoctlexclude isactive m_sernoctl_id preparedstatement preparestatement setint getm_sernoctl_id resultset executequery x_m_sernoctlexclude getctx m_excludesernos x_m_sernoctlexclude toarray m_excludesernos m_excludesernos m_excludesernos m_column m_column getctx ad_column_id m_excludesernos m_excludesernos getad_table_id getad_table_id m_excludesernos issotrx issotrx get lot char start return defined or u00ab public string get lot char start string s super get lot chars overwrite if s null s length 1 s equals return s return u00ab getlotcharstart getlotcharsoverwrite get lot char end return defined or u00bb public string get lot char end string s super get lot chare overwrite if s null s length 1 s equals return s return u00bb getlotcharend getlotchareoverwrite get ser no char start return defined or public string get ser no char start string s super get ser no chars overwrite if s null s length 1 s equals return s return serno getsernocharstart getsernocharsoverwrite get ser no char end return defined or none public string get ser no char end string s super get ser no chare overwrite if s null s length 1 s equals return s return serno getsernocharend getsernochareoverwrite before save set instance attribute flag param new record new return true protected boolean before save boolean new record if is instance attribute is ser no is lot is guarantee date set is instance attribute true return true newrecord beforesave newrecord isinstanceattribute isserno islot isguaranteedate setisinstanceattribute after save verify instance attribute param new record new param success success return success protected boolean after save boolean new record boolean success set instance attribute if is instance attribute string sql update m attributeset mas set is instance attribute y where m attributeset id getm attributeset id and is instance attribute n and is ser no y or is lot y or is guarantee date y or exists select from m attributeuse mau inner join m attribute ma on mau m attribute id ma m attribute id where mau m attributeset id mas m attributeset id and mau is active y and ma is active y and ma is instance attribute y int no db execute update sql get trxname if no 0 log warning set instance attribute set is instance attribute true reset instance attribute if is instance attribute is ser no is lot is guarantee date string sql update m attributeset mas set is instance attribute n where m attributeset id getm attributeset id and is instance attribute y and is ser no n and is lot n and is guarantee date n and not exists select from m attributeuse mau inner join m attribute ma on mau m attribute id ma m attribute id where mau m attributeset id mas m attributeset id and mau is active y and ma is active y and ma is instance attribute y int no db execute update sql get trxname if no 0 log warning reset instance attribute set is instance attribute false return success newrecord aftersave newrecord isinstanceattribute m_attributeset isinstanceattribute m_attributeset_id getm_attributeset_id isinstanceattribute isserno islot isguaranteedate m_attributeuse m_attribute m_attribute_id m_attribute_id m_attributeset_id m_attributeset_id isactive isactive isinstanceattribute executeupdate get_trxname setisinstanceattribute isinstanceattribute isserno islot isguaranteedate m_attributeset isinstanceattribute m_attributeset_id getm_attributeset_id isinstanceattribute isserno islot isguaranteedate m_attributeuse m_attribute m_attribute_id m_attribute_id m_attributeset_id m_attributeset_id isactive isactive isinstanceattribute executeupdate get_trxname setisinstanceattribute standard constructor param ctx context param m rma id id public mrma properties ctx int m rma id string trx name super ctx m rma id trx name if m rma id 0 set name null setsalesrep id 0 setc doctype id 0 setm inout id 0 set doc action docaction complete co set doc status docstatus drafted dr set is approved false set processed false m_rma_id m_rma_id trxname m_rma_id trxname m_rma_id setname setsalesrep_id setc_doctype_id setm_inout_id setdocaction docaction_complete setdocstatus docstatus_drafted setisapproved setprocessed load constructor param ctx context param rs result set public mrma properties ctx result set rs string trx name super ctx rs trx name resultset trxname trxname get lines param requery requary return lines public mrma line get lines boolean requery if m lines null requery return m lines array list mrma line list new array list mrma line string sql select from m rmaline where m rma id prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getm rma id result set rs pstmt execute query while rs next list add new mrma line get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null m lines new mrma line list size list to array m lines return m lines mrmaline getlines m_lines m_lines arraylist mrmaline arraylist mrmaline m_rmaline m_rma_id preparedstatement preparestatement get_trxname setint getm_rma_id resultset executequery mrmaline getctx get_trxname m_lines mrmaline toarray m_lines m_lines get shipment return shipment public m in out get shipment if m inout null getm inout id 0 m inout new m in out get ctx getm inout id get trxname return m inout minout getshipment m_inout getm_inout_id m_inout minout getctx getm_inout_id get_trxname m_inout set m inout id param m inout id id public void setm inout id int m inout id super setm inout id m inout id setc currency id 0 set amt env zero setc bpartner id 0 m inout null m_inout_id m_inout_id setm_inout_id m_inout_id setm_inout_id m_inout_id setc_currency_id setamt setc_bpartner_id m_inout get document info return document info untranslated public string get document info m doc type dt m doc type get get ctx getc doctype id return dt get name get document no getdocumentinfo mdoctype mdoctype getctx getc_doctype_id getname getdocumentno create pdf return file or null public file createpdf try file temp file create temp file get tablename get id pdf return createpdf temp catch exception e log severe could not create pdf e get message return null createtempfile get_tablename get_id _ getmessage create pdf file param file output file return file if success public file createpdf file file report engine re report engine get get ctx report engine invoice getc invoice id if re null return null return re getpdf file reportengine reportengine getctx reportengine getc_invoice_id before save set b partner currency param new record new return true protected boolean before save boolean new record set b partner if getc bpartner id 0 get shipment if m inout null setc bpartner id m inout getc bpartner id set currency if getc currency id 0 get shipment if m inout null if m inout getc order id 0 m order order new m order get ctx m inout getc order id get trxname setc currency id order getc currency id else if m inout getc invoice id 0 m invoice invoice new m invoice get ctx m inout getc invoice id get trxname setc currency id invoice getc currency id return true bpartner newrecord beforesave newrecord bpartner getc_bpartner_id getshipment m_inout setc_bpartner_id m_inout getc_bpartner_id getc_currency_id getshipment m_inout m_inout getc_order_id morder morder getctx m_inout getc_order_id get_trxname setc_currency_id getc_currency_id m_inout getc_invoice_id minvoice minvoice getctx m_inout getc_invoice_id get_trxname setc_currency_id getc_currency_id process document param process action document action return true if performed public boolean process it string process action m processmsg null document engine engine new document engine this get doc status return engine process it process action get doc action processaction processit processaction m_processmsg documentengine documentengine getdocstatus processit processaction getdocaction unlock document return true if success public boolean unlock it log info unlock it to string set processing false return true unlockit unlockit tostring setprocessing invalidate document return true if success public boolean invalidate it log info invalidate it to string return true invalidateit invalidateit tostring prepare document return new status in progress or invalid public string prepare it log info to string m processmsg model validation engine get fire doc validate this model validator timing before prepare if m processmsg null return doc action status invalid m doc type dt m doc type get get ctx getc doctype id mrma line lines get lines false if lines length 0 m processmsg no lines return doc action status invalid check lines big decimal amt env zero for int i 0 i lines length i mrma line line lines i amt amt add line get amt set amt amt m justprepared true return doc action status inprogress prepareit tostring m_processmsg modelvalidationengine firedocvalidate modelvalidator timing_before_prepare m_processmsg docaction status_invalid mdoctype mdoctype getctx getc_doctype_id mrmaline getlines m_processmsg nolines docaction status_invalid bigdecimal mrmaline getamt setamt m_justprepared docaction status_inprogress approve document return true if success public boolean approve it log info approve it to string set is approved true return true approveit approveit tostring setisapproved reject approval return true if success public boolean reject it log info reject it to string set is approved false return true rejectit rejectit tostring setisapproved complete document return new status complete in progress invalid waiting public string complete it re check if m justprepared string status prepare it if doc action status inprogress equals status return status implicit approval if is approved approve it log info complete it to string if true m processmsg need to code creating the credit memo return doc action status inprogress user validation string valid model validation engine get fire doc validate this model validator timing after complete if valid null m processmsg valid return doc action status invalid set processed true set doc action docaction close return doc action status completed completeit m_justprepared prepareit docaction status_inprogress isapproved approveit completeit tostring m_processmsg docaction status_inprogress modelvalidationengine firedocvalidate modelvalidator timing_after_complete m_processmsg docaction status_invalid setprocessed setdocaction docaction_close docaction status_completed void document return true if success public boolean void it log info void it to string revoke credit return false voidit voidit tostring close document cancel not delivered qunatities return true if success public boolean close it log info close it to string return true closeit closeit tostring reverse correction return true if success public boolean reverse correct it log info reverse correct it to string return false reversecorrectit reversecorrectit tostring reverse accrual none return true if success public boolean reverse accrual it log info reverse accrual it to string return false reverseaccrualit reverseaccrualit tostring re activate return true if success public boolean re activate it log info re activate it to string return false reactivateit reactivateit tostring get summary return summary of document public string get summary string buffer sb new string buffer sb append get document no total lines 123 00 1 sb append append msg translate get ctx amt append append get amt append append get lines false length append description if get description null get description length 0 sb append append get description return sb to string getsummary stringbuffer stringbuffer getdocumentno getctx getamt getlines getdescription getdescription getdescription tostring get process message return clear text error message public string get process msg return m processmsg getprocessmsg m_processmsg get document owner responsible return ad user id public int getdoc user id return getsalesrep id ad_user_id getdoc_user_id getsalesrep_id get document approval amount return amount public big decimal get approval amt return get amt bigdecimal getapprovalamt getamt prepare e g get parameters protected void prepare process info parameter para get parameter for int i 0 i para length i string name para i get parameter name if para i get parameter null else log log level severe ad synchronize unknown parameter if m datevalue null m datevalue new timestamp system current time millis processinfoparameter getparameter getparametername getparameter ad_synchronize m_datevalue m_datevalue currenttimemillis perrform process return message throws exception protected string do it throws java lang exception string buffer sql null string buffer sql1 null int no 0 string client check and ad client id m ad client id sql new string buffer select distinct column name name description help entity type from ad column c where not exists select from ad element e where upper c column name upper e column name sql1 new string buffer select distinct column name name description help entity type from ad process para p where not exists select from ad element e where upper p column name upper e column name try prepared statement pstmt db prepare statement sql to string result set rs pstmt execute query while rs next x ad element element new x ad element env get ctx 0 null element set column name rs get string 1 element set name rs get string 2 element set description rs get string 3 element set help rs get string 4 element set entity type rs get string 5 element save get trxname cc column name cc name cc name cc description cc help cc entity type rs close pstmt close catch sql exception e log log level severe sql to string e try prepared statement pstmt1 db prepare statement sql1 to string result set rs1 pstmt1 execute query while rs1 next x ad element element new x ad element env get ctx 0 null element set column name rs1 get string 1 element set name rs1 get string 2 element set description rs1 get string 3 element set help rs1 get string 4 element set entity type rs1 get string 5 element save get trxname cc column name cc name cc name cc description cc help cc entity type rs1 close pstmt1 close catch sql exception e log log level severe sql1 to string e prepare sql new string buffer select m ad element id l ad language m ad client id m ad org id m is active m created m created by m updated m updated by m name m print name m description m help n from ad element m ad language l where l is active y and l is system language y and ad element id ad language not in select ad element id ad language from ad element trl try prepared statement pstmt db prepare statement sql to string result set rs pstmt execute query while rs next sql1 new string buffer insert into ad element trl ad element id ad language ad client id ad org id is active created created by updated updated by name print name description help is translated select m ad element id l ad language m ad client id m ad org id m is active m created m created by m updated m updated by m name m print name m description m help n from ad element m ad language l where l is active y and l is system language y and ad element id ad language not in select ad element id ad language from ad element trl no db execute update sql1 to string sql new string buffer update ad column c set ad element id select ad element id from ad element e where upper c column name upper e column name where ad element id is null no db execute update sql to string sql1 new string buffer delete ad element trl where ad element id in select ad element id from ad element e where not exists select from ad column c where upper e column name upper c column name and not exists select from ad process para p where upper e column name upper p column name no db execute update sql1 to string sql new string buffer delete ad element e where not exists select from ad column c where upper e column name upper c column name and not exists select from ad process para p where upper e column name upper p column name no db execute update sql to string sql1 new string buffer update ad column c set column name name description help select column name name description help from ad element e where c ad element id e ad element id updated sys date where exists select from ad element e where c ad element id e ad element id and c column name e column name or c name e name or nvl c description nvl e description or nvl c help nvl e help no db execute update sql1 to string sql new string buffer update ad field f set name description help select e name e description e help from ad element e ad column c where e ad element id c ad element id and c ad column id f ad column id updated sys date where f is centrally maintained y and f is active y and exists select from ad element e ad column c where f ad column id c ad column id and c ad element id e ad element id and c ad process id is null and f name e name or nvl f description nvl e description or nvl f help nvl e help no db execute update sql to string sql1 new string buffer update ad field trl trl set name select e name from ad element trl e ad column c ad field f where e ad language trl ad language and e ad element id c ad element id and c ad column id f ad column id and f ad field id trl ad field id description select e description from ad element trl e ad column c ad field f where e ad language trl ad language and e ad element id c ad element id and c ad column id f ad column id and f ad field id trl ad field id help select e help from ad element trl e ad column c ad field f where e ad language trl ad language and e ad element id c ad element id and c ad column id f ad column id and f ad field id trl ad field id is translated select e is translated from ad element trl e ad column c ad field f where e ad language trl ad language and e ad element id c ad element id and c ad column id f ad column id and f ad field id trl ad field id updated sys date where exists select from ad field f ad element trl e ad column c where trl ad field id f ad field id and f ad column id c ad column id and c ad element id e ad element id and c ad process id is null and trl ad language e ad language and f is centrally maintained y and f is active y and trl name e name or nvl trl description nvl e description or nvl trl help nvl e help no db execute update sql1 to string sql new string buffer update ad field f set name select e po name from ad element e ad column c where e ad element id c ad element id and c ad column id f ad column id description select e po description from ad element e ad column c where e ad element id c ad element id and c ad column id f ad column id help select e po help from ad element e ad column c where e ad element id c ad element id and c ad column id f ad column id updated sys date where f is centrally maintained y and f is active y and exists select from ad element e ad column c where f ad column id c ad column id and c ad element id e ad element id and c ad process id is null and f name e po name or nvl f description nvl e po description or nvl f help nvl e po help and e po name is not null and exists select from ad tab t ad window w where f ad tab id t ad tab id and t ad window id w ad window id and w isso trx n no db execute update sql to string sql1 new string buffer update ad field trl trl set name select e po name from ad element t doit stringbuffer stringbuffer clientcheck ad_client_id m_ad_client_id stringbuffer columnname entitytype ad_column ad_element columnname columnname stringbuffer columnname entitytype ad_process_para ad_element columnname columnname preparedstatement preparestatement tostring resultset executequery x_ad_element x_ad_element getctx setcolumnname getstring setname getstring setdescription getstring sethelp getstring setentitytype getstring get_trxname columnname entitytype sqlexception tostring preparedstatement preparestatement tostring resultset executequery x_ad_element x_ad_element getctx setcolumnname getstring setname getstring setdescription getstring sethelp getstring setentitytype getstring get_trxname columnname entitytype sqlexception tostring stringbuffer ad_element_id ad_language ad_client_id ad_org_id isactive createdby updatedby printname ad_element ad_language isactive issystemlanguage ad_element_id ad_language ad_element_id ad_language ad_element_trl preparedstatement preparestatement tostring resultset executequery stringbuffer ad_element_trl ad_element_id ad_language ad_client_id ad_org_id isactive createdby updatedby printname istranslated ad_element_id ad_language ad_client_id ad_org_id isactive createdby updatedby printname ad_element ad_language isactive issystemlanguage ad_element_id ad_language ad_element_id ad_language ad_element_trl executeupdate tostring stringbuffer ad_column ad_element_id ad_element_id ad_element columnname columnname ad_element_id executeupdate tostring stringbuffer ad_element_trl ad_element_id ad_element_id ad_element ad_column columnname columnname ad_process_para columnname columnname executeupdate tostring stringbuffer ad_element ad_column columnname columnname ad_process_para columnname columnname executeupdate tostring stringbuffer ad_column columnname columnname ad_element ad_element_id ad_element_id sysdate ad_element ad_element_id ad_element_id columnname columnname executeupdate tostring stringbuffer ad_field ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id sysdate iscentrallymaintained isactive ad_element ad_column ad_column_id ad_column_id ad_element_id ad_element_id ad_process_id executeupdate tostring stringbuffer ad_field_trl ad_element_trl ad_column ad_field ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id ad_field_id ad_field_id ad_element_trl ad_column ad_field ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id ad_field_id ad_field_id ad_element_trl ad_column ad_field ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id ad_field_id ad_field_id istranslated istranslated ad_element_trl ad_column ad_field ad_language ad_language ad_element_id ad_element_id ad_column_id ad_column_id ad_field_id ad_field_id sysdate ad_field ad_element_trl ad_column ad_field_id ad_field_id ad_column_id ad_column_id ad_element_id ad_element_id ad_process_id ad_language ad_language iscentrallymaintained isactive executeupdate tostring stringbuffer ad_field po_name ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id po_description ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id po_help ad_element ad_column ad_element_id ad_element_id ad_column_id ad_column_id sysdate iscentrallymaintained isactive ad_element ad_column ad_column_id ad_column_id ad_element_id ad_element_id ad_process_id po_name po_description po_help po_name ad_tab ad_window ad_tab_id ad_tab_id ad_window_id ad_window_id issotrx executeupdate tostring stringbuffer ad_field_trl po_name ad_element_t basic constructor you need to set the attributes using the set methods public abbr this constructor creates an lt abbr gt tag param element adds an element to the element public abbr element element add element element addelement this constructor creates an lt abbr gt tag param element adds an element to the element public abbr string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public abbr add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public abbr add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public abbr add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public abbr add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public abbr remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param script script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param script script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param script script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param script script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param script script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param script script public void set on mouse move string script add attribute onomousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param script script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param script script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param script script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param script script public void set on key up string script add attribute onkeyup script setonkeyup addattribute get attribute set instance from id or product param ctx context param m attributesetinstance id id or 0 param m product id required if id is 0 return attribute set instance or null public static m attribute set instance get properties ctx int m attributesetinstance id int m product id m attribute set instance ret value null load instance if not 0 if m attributesetinstance id 0 s log fine from m attributesetinstance id m attributesetinstance id return new m attribute set instance ctx m attributesetinstance id null get new from product s log fine from m product id m product id if m product id 0 return null string sql select m attributeset id m attributesetinstance id from m product where m product id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 m product id result set rs pstmt execute query if rs next int m attributeset id rs get int 1 m attributesetinstance id rs get int 2 needed ret value new m attribute set instance ctx 0 m attributeset id null rs close pstmt close pstmt null catch sql exception ex s log log level severe sql ex try if pstmt null pstmt close catch sql exception ex1 pstmt null return ret value m_attributesetinstance_id m_product_id mattributesetinstance m_attributesetinstance_id m_product_id mattributesetinstance retvalue m_attributesetinstance_id s_log m_attributesetinstance_id m_attributesetinstance_id mattributesetinstance m_attributesetinstance_id s_log m_product_id m_product_id m_product_id m_attributeset_id m_attributesetinstance_id m_product m_product_id preparedstatement preparestatement setint m_product_id resultset executequery m_attributeset_id getint m_attributesetinstance_id getint retvalue mattributesetinstance m_attributeset_id sqlexception s_log sqlexception retvalue standard constructor param ctx context param m attributesetinstance id id public m attribute set instance properties ctx int m attributesetinstance id string trx name super ctx m attributesetinstance id trx name if m attributesetinstance id 0 m_attributesetinstance_id mattributesetinstance m_attributesetinstance_id trxname m_attributesetinstance_id trxname m_attributesetinstance_id load constructor param ctx context param rs result set public m attribute set instance properties ctx result set rs string trx name super ctx rs trx name mattributesetinstance resultset trxname trxname standard constructor param ctx context param m attributesetinstance id id param m attributeset id attribute set public m attribute set instance properties ctx int m attributesetinstance id int m attributeset id string trx name this ctx m attributesetinstance id trx name setm attributeset id m attributeset id m_attributesetinstance_id m_attributeset_id mattributesetinstance m_attributesetinstance_id m_attributeset_id trxname m_attributesetinstance_id trxname setm_attributeset_id m_attributeset_id set attribute set param mas attribute set public void setm attribute set m attribute set mas m mas mas setm attributeset id mas getm attributeset id setmattributeset mattributeset m_mas setm_attributeset_id getm_attributeset_id get attribute set return attrbute set or null public m attribute set getm attribute set if m mas null getm attributeset id 0 m mas new m attribute set get ctx getm attributeset id get trxname return m mas mattributeset getmattributeset m_mas getm_attributeset_id m_mas mattributeset getctx getm_attributeset_id get_trxname m_mas set description product values instance values ser no 123 lot u00ab123 u00bb guarantee date 10 25 2003 public void set description make sure we have a attribute set getm attribute set if m mas null set description return string buffer sb new string buffer instance attribute values m attribute attributes m mas getm attributes true for int i 0 i attributes length i m attribute instance mai attributes i getm attribute instance getm attributesetinstance id if mai null mai get value null if sb length 0 sb append sb append mai get value ser no if m mas is ser no get ser no null if sb length 0 sb append sb append m mas get ser no char start append get ser no append m mas get ser no char end lot if m mas is lot get lot null if sb length 0 sb append sb append m mas get lot char start append get lot append m mas get lot char end guarantee date if m mas is guarantee date get guarantee date null if sb length 0 sb append sb append m dateformat format get guarantee date product attribute values attributes m mas getm attributes false for int i 0 i attributes length i m attribute instance mai attributes i getm attribute instance getm attributesetinstance id if mai null mai get value null if sb length 0 sb append sb append mai get value set description sb to string serno guaranteedate setdescription getmattributeset m_mas setdescription stringbuffer stringbuffer mattribute m_mas getmattributes mattributeinstance getmattributeinstance getm_attributesetinstance_id getvalue _ getvalue serno m_mas isserno getserno _ m_mas getsernocharstart getserno m_mas getsernocharend m_mas islot getlot _ m_mas getlotcharstart getlot m_mas getlotcharend guaranteedate m_mas isguaranteedate getguaranteedate _ m_dateformat getguaranteedate m_mas getmattributes mattributeinstance getmattributeinstance getm_attributesetinstance_id getvalue _ getvalue setdescription tostring get guarantee date param get new if true calculates sets guarantee date return guarantee date or null if days 0 public timestamp get guarantee date boolean get new if get new int days getm attribute set get guarantee days if days 0 timestamp ts time util add days new timestamp system current time millis days set guarantee date ts return get guarantee date getnew getguaranteedate getnew getnew getmattributeset getguaranteedays timeutil adddays currenttimemillis setguaranteedate getguaranteedate get lot no param get new if true create set new lot param m product id product used if new return lot public string get lot boolean get new int m product id if get new create lot m product id return get lot getnew m_product_id getlot getnew m_product_id getnew createlot m_product_id getlot create lot param m product id product used if new return lot info public key name pair create lot int m product id key name pair ret value null int m lotctl id getm attribute set getm lotctl id if m lotctl id 0 m lot ctl ctl new m lot ctl get ctx m lotctl id null m lot lot ctl create lot m product id setm lot id lot getm lot id set lot lot get name ret value new key name pair lot getm lot id lot get name return ret value m_product_id keynamepair createlot m_product_id keynamepair retvalue m_lotctl_id getmattributeset getm_lotctl_id m_lotctl_id mlotctl mlotctl getctx m_lotctl_id mlot createlot m_product_id setm_lot_id getm_lot_id setlot getname retvalue keynamepair getm_lot_id getname retvalue to to find lot and set lot id param lot lot param m product id product public void set lot string lot int m product id try to find it m lot m lot m lot get product lot get ctx m product id lot get trxname if m lot null setm lot id m lot getm lot id set lot lot m_product_id setlot m_product_id mlot mlot mlot getproductlot getctx m_product_id get_trxname mlot setm_lot_id mlot getm_lot_id setlot exclude lot creation param ad column id column param isso trx so return true if excluded public boolean is exclude lot int ad column id boolean isso trx getm attribute set if m mas null return m mas is exclude lot ad column id isso trx return false ad_column_id issotrx isexcludelot ad_column_id issotrx getmattributeset m_mas m_mas isexcludelot ad_column_id issotrx get serial no param get new if true create set new ser no return serial number public string get ser no boolean get new if get new int m sernoctl id getm attribute set getm sernoctl id if m sernoctl id 0 m ser no ctl ctl new m ser no ctl get ctx m sernoctl id get trxname set ser no ctl create ser no return get ser no getnew getserno getnew getnew m_sernoctl_id getmattributeset getm_sernoctl_id m_sernoctl_id msernoctl msernoctl getctx m_sernoctl_id get_trxname setserno createserno getserno exclude ser no creation param ad column id column param isso trx so return true if excluded public boolean is exclude ser no int ad column id boolean isso trx getm attribute set if m mas null return m mas is exclude ser no ad column id isso trx return false serno ad_column_id issotrx isexcludeserno ad_column_id issotrx getmattributeset m_mas m_mas isexcludeserno ad_column_id issotrx constructor use query method to populate data param table name public r model data string table name m tablename table name tablename rmodeldata tablename m_tablename tablename dispose public void dispose rows clear m rows clear rows meta clear cols clear m_rows rowsmeta query param ctx param where clause the sql where clause w o the where param order clause public void query properties ctx string where clause string order clause r column rc null create sql string buffer sql new string buffer select int size cols size for int i 0 i size i rc r column cols get i if i 0 sql append sql append rc get colsql sql append from append m tablename append append r model table alias if where clause null where clause length 0 sql append where append where clause string finalsql m role get default ctx false add accesssql sql to string r model table alias m role sql fullyqualified m role sql ro if order clause null order clause length 0 finalsql order by order clause log fine finalsql fill data int index 0 rowset index m rows clear try statement stmt db create statement result set rs stmt execute query finalsql while rs next array list object row new array list object size index 1 columns for int i 0 i size i rc r column cols get i get id if rc isi dcol row add new key name pair rs get int index rs get string index null check else if rs get object index null index row add null else if rc get col class string class row add rs get string index else if rc get col class big decimal class row add rs get big decimal index else if rc get col class double class row add new double rs get double index else if rc get col class integer class row add new integer rs get int index else if rc get col class timestamp class row add rs get timestamp index else if rc get col class boolean class row add new boolean y equals rs get string index else should not happen row add rs get string index m rows add row rs close stmt close catch sql exception e if index 0 log log level severe finalsql e else log log level severe index index rc e e print stack trace process whereclause orderclause whereclause orderclause rcolumn stringbuffer stringbuffer rcolumn getcolsql m_tablename rmodel table_alias whereclause whereclause whereclause mrole getdefault addaccesssql tostring rmodel table_alias mrole sql_fullyqualified mrole sql_ro orderclause orderclause orderclause filldata m_rows createstatement resultset executequery arraylist arraylist rcolumn isidcol keynamepair getint getstring getobject getcolclass getstring getcolclass bigdecimal getbigdecimal getcolclass getdouble getcolclass getint getcolclass gettimestamp getcolclass getstring getstring m_rows sqlexception printstacktrace process data copy data in m rows to rows and perform functions private void process log fine start rows m rows size row level funcions would come here group by values int g size groups size int group bys new int g size object group bys value new object g size object initvalue new object for int i 0 i g size i group bys i integer groups get i int value group bys value i initvalue log fine group by level i col group bys i add additional row to force group change if g size 0 array list object new row new array list object for int c 0 c cols size c new row add m rows add new row function values function group value int f size functions size int func cols new int f size string func funs new string f size int index 0 iterator it functions key set iterator while it has next object key it next func cols index integer key int value func funs index functions get key to string log fine function func funs index col func cols index index big decimal func vals new big decimal f size g size 1 int total index g size place for overall total log fine function values f size g size 1 for int f 0 f f size f for int g 0 g g size 1 g func vals f g env zero rows clear copy m rows into rows for int r 0 r m rows size r array list object row m rows get r do we have a group break boolean have break new boolean group bys length for int level 0 level group bys length level int idx group bys level if group bys value level initvalue have break level false else if group bys value level equals row get idx have break level true else have break level false previous level had a break if level 0 have break level 1 have break level true create group levels reverse order for int level group bys length 1 level 0 level int idx group bys level if group bys value level initvalue group bys value level row get idx else if have break level log fine group by change level level col idx group bys value level create new row array list object new row new array list object for int c 0 c cols size c if c idx the group column if group bys value c null group bys value c to string length 0 new row add else new row add group bys value c else boolean found false for int fc 0 fc func cols length fc if c func cols fc new row add fc fc gl level func funs fc new row add func vals fc level func vals fc level env zero found true if found new row add null for all columns m grouprows add new integer rows size group row indicator rows add new row group bys value level row get idx for all groups functions for int fc 0 fc func cols length fc int col func cols fc convert value to big decimal object value row get col big decimal bd env zero if value null else if value instanceof big decimal bd big decimal value else try bd new big decimal value to string catch exception e for int level 0 level g size 1 level if func funs fc equals r model function sum func vals fc level func vals fc level add bd else if func funs fc equals r model function count func vals fc level func vals fc level add one for all group levels for all functions rows add row for all m rows total row if functions size 0 array list object new row new array list object for int c 0 c cols size c boolean found false for int fc 0 fc func cols length fc if c func cols fc new row add func vals fc total index found true if found new row add null for all columns remove empty row added earlier to force group change if g size 0 rows remove rows size 1 m grouprows add new integer rows size group row indicator rows add new row log fine end rows rows size m rows clear m_rows m_rows gsize groupbys gsize groupbysvalue gsize gsize groupbys intvalue groupbysvalue groupby groupbys gsize arraylist newrow arraylist newrow m_rows newrow groupvalue fsize funccols fsize funcfuns fsize keyset hasnext funccols intvalue funcfuns tostring funcfuns funccols bigdecimal funcvals bigdecimal fsize gsize totalindex gsize functionvalues fsize gsize fsize gsize funcvals m_rows m_rows arraylist m_rows havebreak groupbys groupbys groupbys groupbysvalue havebreak groupbysvalue havebreak havebreak havebreak havebreak groupbys groupbys groupbysvalue groupbysvalue havebreak groupby groupbysvalue arraylist newrow arraylist groupbysvalue groupbysvalue tostring newrow newrow groupbysvalue funccols funccols newrow funcfuns newrow funcvals funcvals newrow m_grouprows newrow groupbysvalue funccols funccols bigdecimal bigdecimal bigdecimal bigdecimal tostring gsize funcfuns rmodel function_sum funcvals funcvals funcfuns rmodel function_count funcvals funcvals m_rows arraylist newrow arraylist funccols funccols newrow funcvals totalindex newrow gsize m_grouprows newrow m_rows is row a group row param row row index return true if group row public boolean is group row int row build boolean array if m grouprowsindicator null m grouprowsindicator new array list boolean rows size for int r 0 r rows size r m grouprowsindicator add new boolean m grouprows contains new integer r if row 0 row m grouprowsindicator size return false return boolean m grouprowsindicator get row boolean value isgrouprow m_grouprowsindicator m_grouprowsindicator arraylist m_grouprowsindicator m_grouprows m_grouprowsindicator m_grouprowsindicator booleanvalue move row param from index param to index throws illegal argument exception if row index is invalid public void move row int from int to if from 0 to rows size throw new illegal argument exception row from invalid if to 0 to rows size throw new illegal argument exception row to invalid move data array list object temp rows get from rows remove from rows add to temp move description indicator m grouprows is not in sync after row move if m grouprowsindicator null boolean tempb m grouprowsindicator get from m grouprowsindicator remove from m grouprowsindicator add to tempb illegalargumentexception moverow illegalargumentexception illegalargumentexception arraylist m_grouprows m_grouprowsindicator m_grouprowsindicator m_grouprowsindicator m_grouprowsindicator get set project param issue issue return project static public m issue project get m issue issue if issue get name null return null m issue project pj null string sql select from r issueproject where name prepared statement pstmt null try pstmt db prepare statement sql null pstmt set string 1 issue get name result set rs pstmt execute query if rs next pj new m issue project issue get ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null new if pj null pj new m issue project issue get ctx 0 null pj set name issue get name pj seta asset id issue pj set system status issue get system status pj set statistics info issue get statistics info pj set profile info issue get profile info if pj save return null set issue setr issueproject id pj getr issueproject id if pj geta asset id 0 issue seta asset id pj geta asset id return pj missueproject missue getname missueproject r_issueproject preparedstatement preparestatement setstring getname resultset executequery missueproject getctx s_log missueproject getctx setname getname seta_asset_id setsystemstatus getsystemstatus setstatisticsinfo getstatisticsinfo setprofileinfo getprofileinfo setr_issueproject_id getr_issueproject_id geta_asset_id seta_asset_id geta_asset_id standard constructor param ctx context param r issueproject id id param trx name trx public m issue project properties ctx int r issueproject id string trx name super ctx r issueproject id trx name r_issueproject_id trxname missueproject r_issueproject_id trxname r_issueproject_id trxname load constructor param ctx context param rs result set param trx name trx public m issue project properties ctx result set rs string trx name super ctx rs trx name trxname missueproject resultset trxname trxname set a asset id param issue issue public void seta asset id m issue issue int a asset id 0 string sql select from a asset a where exists select from a asset group ag tracking assets where a a asset group id ag a asset group id and ag is track issues y and exists select from ad user u where a c bpartner id u c bpartner id or a c bpartnersr id u c bpartner id and u e mail 1 e mail and ser no is null or ser no 2 name super seta asset id a asset id a_asset_id seta_asset_id missue a_asset_id a_asset a_asset_group a_asset_group_id a_asset_group_id istrackissues ad_user c_bpartner_id c_bpartner_id c_bpartnersr_id c_bpartner_id email email serno serno seta_asset_id a_asset_id string representation return info public string to string string buffer sb new string buffer m issue project sb append get id append append get name append a asset id append geta asset id append c project id append getc project id append return sb to string tostring stringbuffer stringbuffer missueproject get_id getname a_asset_id geta_asset_id c_project_id getc_project_id tostring standard constructor public x m demanddetail properties ctx int m demanddetail id string trx name super ctx m demanddetail id trx name if m demanddetail id 0 setm demanddetail id 0 setm demandline id 0 x_m_demanddetail m_demanddetail_id trxname m_demanddetail_id trxname m_demanddetail_id setm_demanddetail_id setm_demandline_id load constructor public x m demanddetail properties ctx result set rs string trx name super ctx rs trx name x_m_demanddetail resultset trxname trxname protected big decimal access level new big decimal 2 access level 2 client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m demanddetail append get id append return sb to string tostring stringbuffer stringbuffer x_m_demanddetail get_id tostring set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 0 set value c orderline id null else set value c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id set_value c_orderline_id set_value c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set demand detail material demand line source detail public void setm demanddetail id int m demanddetail id if m demanddetail id 1 throw new illegal argument exception m demanddetail id is mandatory set valuenocheck m demanddetail id new integer m demanddetail id setm_demanddetail_id m_demanddetail_id m_demanddetail_id illegalargumentexception m_demanddetail_id set_valuenocheck m_demanddetail_id m_demanddetail_id get demand detail material demand line source detail public int getm demanddetail id integer ii integer get value m demanddetail id if ii null return 0 return ii int value getm_demanddetail_id get_value m_demanddetail_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getm demanddetail id intvalue keynamepair getkeynamepair keynamepair get_id valueof getm_demanddetail_id set demand line material demand line public void setm demandline id int m demandline id if m demandline id 1 throw new illegal argument exception m demandline id is mandatory set valuenocheck m demandline id new integer m demandline id setm_demandline_id m_demandline_id m_demandline_id illegalargumentexception m_demandline_id set_valuenocheck m_demandline_id m_demandline_id get demand line material demand line public int getm demandline id integer ii integer get value m demandline id if ii null return 0 return ii int value getm_demandline_id get_value m_demandline_id intvalue set forecast line forecast line public void setm forecastline id int m forecastline id if m forecastline id 0 set value m forecastline id null else set value m forecastline id new integer m forecastline id setm_forecastline_id m_forecastline_id m_forecastline_id set_value m_forecastline_id set_value m_forecastline_id m_forecastline_id get forecast line forecast line public int getm forecastline id integer ii integer get value m forecastline id if ii null return 0 return ii int value getm_forecastline_id get_value m_forecastline_id intvalue set requisition line material requisition line public void setm requisitionline id int m requisitionline id if m requisitionline id 0 set value m requisitionline id null else set value m requisitionline id new integer m requisitionline id setm_requisitionline_id m_requisitionline_id m_requisitionline_id set_value m_requisitionline_id set_value m_requisitionline_id m_requisitionline_id get requisition line material requisition line public int getm requisitionline id integer ii integer get value m requisitionline id if ii null return 0 return ii int value getm_requisitionline_id get_value m_requisitionline_id intvalue persistency constructor param ctx context param ignored ignored public mp instance para properties ctx int ignored string trx name super ctx 0 trx name if ignored 0 throw new illegal argument exception multi key mpinstancepara trxname trxname illegalargumentexception parent constructor param ctx param ad pinstance id id param seq no sequence public mp instance para properties ctx int ad pinstance id int seq no super ctx 0 null setad pinstance id ad pinstance id set seq no seq no ad_pinstance_id seqno mpinstancepara ad_pinstance_id seqno setad_pinstance_id ad_pinstance_id setseqno seqno parent constructor param instance instance param seq no sequence public mp instance para mp instance instance int seq no super instance get ctx 0 instance get trxname setad pinstance id instance getad pinstance id set seq no seq no seqno mpinstancepara mpinstance seqno getctx get_trxname setad_pinstance_id getad_pinstance_id setseqno seqno load constructor param ctx context param rs result set public mp instance para properties ctx result set rs string trx name super ctx rs trx name mpinstancepara resultset trxname trxname string representation return info public string to string string buffer sb new string buffer mp instance para append get id append append get parameter name if getp string null sb append s append getp string if getp string to null sb append append getp string to if getp number null sb append p append getp number if getp number to null sb append append getp number to if getp date null sb append d append getp date if getp date to null sb append append getp date to sb append return sb to string tostring stringbuffer stringbuffer mpinstancepara get_id getparametername getp_string getp_string getp_string_to getp_string_to getp_number getp_number getp_number_to getp_number_to getp_date getp_date getp_date_to getp_date_to tostring set p number param p number no public void setp number int p number setp number new big decimal p number p_number p_number setp_number p_number setp_number bigdecimal p_number set p number param p number no public void setp number integer p number if p number null setp number 0 else setp number integer p number int value p_number p_number setp_number p_number p_number setp_number setp_number p_number intvalue set p number to param p number to no to public void setp number to int p number to setp number to new big decimal p number to p_number p_number_to setp_number_to p_number_to setp_number_to bigdecimal p_number_to set p number to param p number to no to public void setp number to integer p number to if p number to null setp number to 0 else setp number to integer p number to int value p_number p_number_to setp_number_to p_number_to p_number_to setp_number_to setp_number_to p_number_to intvalue set string parameter param parameter name name param string parameter value public void set parameter string parameter name string string parameter set parameter name parameter name setp string string parameter parametername stringparameter setparameter parametername stringparameter setparametername parametername setp_string stringparameter set number parameter param parameter name name param bd parameter value public void set parameter string parameter name big decimal bd parameter set parameter name parameter name setp number bd parameter parametername bdparameter setparameter parametername bigdecimal bdparameter setparametername parametername setp_number bdparameter set number parameter param parameter name name param i parameter value public void set parameter string parameter name int i parameter set parameter name parameter name setp number new big decimal i parameter parametername iparameter setparameter parametername iparameter setparametername parametername setp_number bigdecimal iparameter default constructor param c class public mini cell editor class c super date if c timestamp class m editor new v date else if c big decimal class m editor new v number amount false false true display type amount amount else if c double class m editor new v number number false false true display type number number else if c integer class m editor new v number integer false false true display type integer integer else m editor new v string minicelleditor m_editor vdate bigdecimal m_editor vnumber displaytype m_editor vnumber displaytype m_editor vnumber displaytype m_editor vstring sets an initial value for the editor this will cause the editor to stop editing and lose any partially edited value if the editor is editing when this method is called returns the component that should be added to the client s component hierarchy once installed in the client s hierarchy this component will then be able to draw and receive user input param table param value param is selected param row param column return component public component get table cell editor component j table table object value boolean is selected int row int column a debug trace a debug l5 ddata v cell editor get table cell editor component value null null value to string set value m editor set value value set ui m editor set border null m editor set border ui manager get border table focus cell highlight border m editor set font table get font return component m editor stopediting isselected gettablecelleditorcomponent jtable isselected adebug adebug l5_ddata vcelleditor gettablecelleditorcomponent tostring m_editor setvalue m_editor setborder m_editor setborder uimanager getborder focuscellhighlightborder m_editor setfont getfont m_editor returns the value contained in the editor return value public object get cell editor value a debug trace a debug l5 ddata v cell editor get cell editor value if m editor null return m editor get value return null getcelleditorvalue adebug adebug l5_ddata vcelleditor getcelleditorvalue m_editor m_editor getvalue persistency constructor param ctx context param c rfqresponselineqty id id public m rfq response line qty properties ctx int c rfqresponselineqty id string trx name super ctx c rfqresponselineqty id trx name if c rfqresponselineqty id 0 setc rfqresponselineqty id 0 pk setc rfqlineqty id 0 setc rfqresponseline id 0 set price env zero set discount env zero c_rfqresponselineqty_id mrfqresponselineqty c_rfqresponselineqty_id trxname c_rfqresponselineqty_id trxname c_rfqresponselineqty_id setc_rfqresponselineqty_id setc_rfqlineqty_id setc_rfqresponseline_id setprice setdiscount load constructor param ctx context param rs result set public m rfq response line qty properties ctx result set rs string trx name super ctx rs trx name mrfqresponselineqty resultset trxname trxname parent constructor param line line param qty qty public m rfq response line qty m rfq response line line m rfq line qty qty this line get ctx 0 line get trxname set client org line setc rfqresponseline id line getc rfqresponseline id setc rfqlineqty id qty getc rfqlineqty id mrfqresponselineqty mrfqresponseline mrfqlineqty getctx get_trxname setclientorg setc_rfqresponseline_id getc_rfqresponseline_id setc_rfqlineqty_id getc_rfqlineqty_id get rfq line qty return rfq line qty public m rfq line qty get rfq line qty if m rfqqty null m rfqqty m rfq line qty get get ctx getc rfqlineqty id get trxname return m rfqqty mrfqlineqty getrfqlineqty m_rfqqty m_rfqqty mrfqlineqty getctx getc_rfqlineqty_id get_trxname m_rfqqty is the amount price discount valid return true if valid public boolean is valid amt big decimal price get price if price null env zero compare to price 0 log warning no price price return false big decimal discount get discount if discount null if discount abs compare to onehundred 0 log warning discount 100 discount return false big decimal net get net amt if net null log warning net is null return false if net compare to env zero 0 log warning net 0 net return false return true isvalidamt bigdecimal getprice compareto bigdecimal getdiscount compareto bigdecimal getnetamt compareto get net amt price minus discount in return net amount or null public big decimal get net amt big decimal price get price if price null env zero compare to price 0 return null big decimal discount get discount if discount null env zero compare to discount 0 return price calculate double result price double value 100 0 discount double value 100 0 big decimal factor onehundred subtract discount return price multiply factor divide onehundred 2 big decimal round half up bigdecimal getnetamt bigdecimal getprice compareto bigdecimal getdiscount compareto doublevalue doublevalue bigdecimal bigdecimal round_half_up string representation return info public string to string string buffer sb new string buffer m rfq response line qty sb append get id append rank append get ranking append price append get price append discount append get discount append net append get net amt append return sb to string tostring stringbuffer stringbuffer mrfqresponselineqty get_id getranking getprice getdiscount getnetamt tostring compare based on net amount param o1 the first object to be compared param o2 the second object to be compared return a negative integer zero or a positive integer as the first argument is less than equal to or greater than the second throws class cast exception if the arguments types prevent them from being compared by this comparator public int compare object o1 object o2 if o1 null throw new illegal argument exception o1 null if o2 null throw new illegal argument exception o2 null m rfq response line qty q1 null m rfq response line qty q2 null if o1 instanceof m rfq response line qty q1 m rfq response line qty o1 else throw new class cast exception o1 if o2 instanceof m rfq response line qty q2 m rfq response line qty o2 else throw new class cast exception o2 if q1 is valid amt return 99 if q2 is valid amt return 99 big decimal net1 q1 get net amt if net1 null return 9 big decimal net2 q2 get net amt if net2 null return 9 return net1 compare to net2 classcastexception illegalargumentexception illegalargumentexception mrfqresponselineqty mrfqresponselineqty mrfqresponselineqty mrfqresponselineqty classcastexception mrfqresponselineqty mrfqresponselineqty classcastexception isvalidamt isvalidamt bigdecimal getnetamt bigdecimal getnetamt compareto is net amount equal param obj the reference object with which to compare return true if net amount equal public boolean equals object obj if obj instanceof m rfq response line qty m rfq response line qty cmp m rfq response line qty obj if cmp is valid amt is valid amt return false big decimal cmp net cmp get net amt if cmp net null return false big decimal net cmp get net amt if net null return false return cmp net compare to net 0 return false mrfqresponselineqty mrfqresponselineqty mrfqresponselineqty isvalidamt isvalidamt bigdecimal cmpnet getnetamt cmpnet bigdecimal getnetamt cmpnet compareto before save param new record new return true protected boolean before save boolean new record if is active set ranking 999 return true newrecord beforesave newrecord isactive setranking standard constructor param ctx context param m bomproduct id id param trx name trx public mbom product properties ctx int m bomproduct id string trx name super ctx m bomproduct id trx name if m bomproduct id 0 setm bom id 0 setbom product type bomproducttype standardproduct s setbom qty env one set is phantom false set lead time offset 0 set line 0 sql select nvl max line 0 10 as default value from m bomproduct where m bom id m bom id m_bomproduct_id trxname mbomproduct m_bomproduct_id trxname m_bomproduct_id trxname m_bomproduct_id setm_bom_id setbomproducttype bomproducttype_standardproduct setbomqty setisphantom setleadtimeoffset setline defaultvalue m_bomproduct m_bom_id m_bom_id load constructor param ctx context param rs result set param trx name trx public mbom product properties ctx result set rs string trx name super ctx rs trx name trxname mbomproduct resultset trxname trxname get parent return parent private mbom getbom if m bom null getm bom id 0 m bom mbom get get ctx getm bom id return m bom m_bom getm_bom_id m_bom getctx getm_bom_id m_bom before save param new record new return true false protected boolean before save boolean new record product if getbom product type equals bomproducttype outsideprocessing if getm productbom id 0 setm productbom id 0 else if getm productbom id 0 log save error error msg parse translation get ctx not found m productbom id return false operation if getm productoperation id 0 if get seq no 0 set seq no 0 else if get seq no 0 log save error error msg parse translation get ctx not found seq no return false product attribute instance if getm attributesetinstance id 0 getbom if m bom null mbom bomtype make to order equals m bom getbom type else log save error error msg parse translation get ctx reset m attributesetinstance id not make to order setm attributesetinstance id 0 return false alternate if getbom product type equals bomproducttype alternative getbom product type equals bomproducttype alternativedefault getm bomalternative id 0 log save error error msg parse translation get ctx not found m bomalternative id return false operation if getm productoperation id 0 if get seq no 0 log save error error msg parse translation get ctx not found seq no return false else no op if get seq no 0 set seq no 0 if get lead time offset 0 set lead time offset 0 set line number if get line 0 string sql select nvl max line 0 10 from m bomproduct where m bom id int ii db getsql value get trxname sql getm bom id set line ii return true newrecord beforesave newrecord getbomproducttype bomproducttype_outsideprocessing getm_productbom_id setm_productbom_id getm_productbom_id saveerror parsetranslation getctx notfound m_productbom_id getm_productoperation_id getseqno setseqno getseqno saveerror parsetranslation getctx notfound seqno getm_attributesetinstance_id m_bom bomtype_make_to_order m_bom getbomtype saveerror parsetranslation getctx m_attributesetinstance_id setm_attributesetinstance_id getbomproducttype bomproducttype_alternative getbomproducttype bomproducttype_alternativedefault getm_bomalternative_id saveerror parsetranslation getctx notfound m_bomalternative_id getm_productoperation_id getseqno saveerror parsetranslation getctx notfound seqno getseqno setseqno getleadtimeoffset setleadtimeoffset getline m_bomproduct m_bom_id getsqlvalue get_trxname getm_bom_id setline get accounting schema default info param ctx context param c acctschema id id return defaults public static m acct schema default get properties ctx int c acctschema id m acct schema default ret value null string sql select from c acctschema default where c acctschema id prepared statement pstmt null try pstmt db prepare statement sql null pstmt set int 1 c acctschema id result set rs pstmt execute query if rs next ret value new m acct schema default ctx rs null rs close pstmt close pstmt null catch exception e s log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return ret value c_acctschema_id macctschemadefault c_acctschema_id macctschemadefault retvalue c_acctschema_default c_acctschema_id preparedstatement preparestatement setint c_acctschema_id resultset executequery retvalue macctschemadefault s_log retvalue load constructor param ctx context param c acctschema id parent public m acct schema default properties ctx int c acctschema id string trx name super ctx c acctschema id trx name c_acctschema_id macctschemadefault c_acctschema_id trxname c_acctschema_id trxname load constructor param ctx context param rs result set public m acct schema default properties ctx result set rs string trx name super ctx rs trx name macctschemadefault resultset trxname trxname get realized gain acct for currency param c currency id currency return gain acct public int getrealizedgain acct int c currency id m currency acct acct m currency acct get this c currency id if acct null return acct getrealizedgain acct return super getrealizedgain acct c_currency_id getrealizedgain_acct c_currency_id mcurrencyacct mcurrencyacct c_currency_id getrealizedgain_acct getrealizedgain_acct get realized loss acct for currency param c currency id currency return loss acct public int getrealizedloss acct int c currency id m currency acct acct m currency acct get this c currency id if acct null return acct getrealizedloss acct return super getrealizedloss acct c_currency_id getrealizedloss_acct c_currency_id mcurrencyacct mcurrencyacct c_currency_id getrealizedloss_acct getrealizedloss_acct get acct info list return list public array list key name pair get acct info array list key name pair list new array list key name pair for int i 0 i get columncount i string column name get columnname i if column name ends with acct int id integer get value i list add new key name pair id column name return list arraylist keynamepair getacctinfo arraylist keynamepair arraylist keynamepair get_columncount columnname get_columnname columnname endswith get_value keynamepair columnname set value don t use param column name column name param value value public boolean set value string column name integer value return super set value column name value columnname setvalue columnname set_value columnname before save param new record new return true protected boolean before save boolean new record if getad org id 0 setad org id 0 return true newrecord beforesave newrecord getad_org_id setad_org_id standard constructor public x t report properties ctx int t report id string trx name super ctx t report id trx name if t report id 0 setad pinstance id 0 setfact acct id 0 setpa reportline id 0 setrecord id 0 x_t_report t_report_id trxname t_report_id trxname t_report_id setad_pinstance_id setfact_acct_id setpa_reportline_id setrecord_id load constructor public x t report properties ctx result set rs string trx name super ctx rs trx name x_t_report resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t report append get id append return sb to string tostring stringbuffer stringbuffer x_t_report get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set valuenocheck ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_valuenocheck ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue set col 0 public void setcol 0 big decimal col 0 set valuenocheck col 0 col 0 col_0 setcol_0 bigdecimal col_0 set_valuenocheck col_0 col_0 get col 0 public big decimal getcol 0 big decimal bd big decimal get value col 0 if bd null return env zero return bd col_0 bigdecimal getcol_0 bigdecimal bigdecimal get_value col_0 set col 1 public void setcol 1 big decimal col 1 set valuenocheck col 1 col 1 col_1 setcol_1 bigdecimal col_1 set_valuenocheck col_1 col_1 get col 1 public big decimal getcol 1 big decimal bd big decimal get value col 1 if bd null return env zero return bd col_1 bigdecimal getcol_1 bigdecimal bigdecimal get_value col_1 set col 10 public void setcol 10 big decimal col 10 set valuenocheck col 10 col 10 col_10 setcol_10 bigdecimal col_10 set_valuenocheck col_10 col_10 get col 10 public big decimal getcol 10 big decimal bd big decimal get value col 10 if bd null return env zero return bd col_10 bigdecimal getcol_10 bigdecimal bigdecimal get_value col_10 set col 11 public void setcol 11 big decimal col 11 set valuenocheck col 11 col 11 col_11 setcol_11 bigdecimal col_11 set_valuenocheck col_11 col_11 get col 11 public big decimal getcol 11 big decimal bd big decimal get value col 11 if bd null return env zero return bd col_11 bigdecimal getcol_11 bigdecimal bigdecimal get_value col_11 set col 12 public void setcol 12 big decimal col 12 set valuenocheck col 12 col 12 col_12 setcol_12 bigdecimal col_12 set_valuenocheck col_12 col_12 get col 12 public big decimal getcol 12 big decimal bd big decimal get value col 12 if bd null return env zero return bd col_12 bigdecimal getcol_12 bigdecimal bigdecimal get_value col_12 set col 13 public void setcol 13 big decimal col 13 set valuenocheck col 13 col 13 col_13 setcol_13 bigdecimal col_13 set_valuenocheck col_13 col_13 get col 13 public big decimal getcol 13 big decimal bd big decimal get value col 13 if bd null return env zero return bd col_13 bigdecimal getcol_13 bigdecimal bigdecimal get_value col_13 set col 14 public void setcol 14 big decimal col 14 set valuenocheck col 14 col 14 col_14 setcol_14 bigdecimal col_14 set_valuenocheck col_14 col_14 get col 14 public big decimal getcol 14 big decimal bd big decimal get value col 14 if bd null return env zero return bd col_14 bigdecimal getcol_14 bigdecimal bigdecimal get_value col_14 set col 15 public void setcol 15 big decimal col 15 set valuenocheck col 15 col 15 col_15 setcol_15 bigdecimal col_15 set_valuenocheck col_15 col_15 get col 15 public big decimal getcol 15 big decimal bd big decimal get value col 15 if bd null return env zero return bd col_15 bigdecimal getcol_15 bigdecimal bigdecimal get_value col_15 set col 16 public void setcol 16 big decimal col 16 set valuenocheck col 16 col 16 col_16 setcol_16 bigdecimal col_16 set_valuenocheck col_16 col_16 get col 16 public big decimal getcol 16 big decimal bd big decimal get value col 16 if bd null return env zero return bd col_16 bigdecimal getcol_16 bigdecimal bigdecimal get_value col_16 set col 17 public void setcol 17 big decimal col 17 set valuenocheck col 17 col 17 col_17 setcol_17 bigdecimal col_17 set_valuenocheck col_17 col_17 get col 17 public big decimal getcol 17 big decimal bd big decimal get value col 17 if bd null return env zero return bd col_17 bigdecimal getcol_17 bigdecimal bigdecimal get_value col_17 set col 18 public void setcol 18 big decimal col 18 set valuenocheck col 18 col 18 col_18 setcol_18 bigdecimal col_18 set_valuenocheck col_18 col_18 get col 18 public big decimal getcol 18 big decimal bd big decimal get value col 18 if bd null return env zero return bd col_18 bigdecimal getcol_18 bigdecimal bigdecimal get_value col_18 set col 19 public void setcol 19 big decimal col 19 set valuenocheck col 19 col 19 col_19 setcol_19 bigdecimal col_19 set_valuenocheck col_19 col_19 get col 19 public big decimal getcol 19 big decimal bd big decimal get value col 19 if bd null return env zero return bd col_19 bigdecimal getcol_19 bigdecimal bigdecimal get_value col_19 set col 2 public void setcol 2 big decimal col 2 set valuenocheck col 2 col 2 col_2 setcol_2 bigdecimal col_2 set_valuenocheck col_2 col_2 get col 2 public big decimal getcol 2 big decimal bd big decimal get value col 2 if bd null return env zero return bd col_2 bigdecimal getcol_2 bigdecimal bigdecimal get_value col_2 set col 20 public void setcol 20 big decimal col 20 set valuenocheck col 20 col 20 col_20 setcol_20 bigdecimal col_20 set_valuenocheck col_20 col_20 get col 20 public big decimal getcol 20 big decimal bd big decimal get value col 20 if bd null return env zero return bd col_20 bigdecimal getcol_20 bigdecimal bigdecimal get_value col_20 set col 3 public void setcol 3 big decimal col 3 set valuenocheck col 3 col 3 col_3 setcol_3 bigdecimal col_3 set_valuenocheck col_3 col_3 get col 3 public big decimal getcol 3 big decimal bd big decimal get value col 3 if bd null return env zero return bd col_3 bigdecimal getcol_3 bigdecimal bigdecimal get_value col_3 set col 4 public void setcol 4 big decimal col 4 set valuenocheck col 4 col 4 col_4 setcol_4 bigdecimal col_4 set_valuenocheck col_4 col_4 get col 4 public big decimal getcol 4 big decimal bd big decimal get value col 4 if bd null return env zero return bd col_4 bigdecimal getcol_4 bigdecimal bigdecimal get_value col_4 set col 5 public void setcol 5 big decimal col 5 set valuenocheck col 5 col 5 col_5 setcol_5 bigdecimal col_5 set_valuenocheck col_5 col_5 get col 5 public big decimal getcol 5 big decimal bd big decimal get value col 5 if bd null return env zero return bd col_5 bigdecimal getcol_5 bigdecimal bigdecimal get_value col_5 set col 6 public void setcol 6 big decimal col 6 set valuenocheck col 6 col 6 col_6 setcol_6 bigdecimal col_6 set_valuenocheck col_6 col_6 get col 6 public big decimal getcol 6 big decimal bd big decimal get value col 6 if bd null return env zero return bd col_6 bigdecimal getcol_6 bigdecimal bigdecimal get_value col_6 set col 7 public void setcol 7 big decimal col 7 set valuenocheck col 7 col 7 col_7 setcol_7 bigdecimal col_7 set_valuenocheck col_7 col_7 get col 7 public big decimal getcol 7 big decimal bd big decimal get value col 7 if bd null return env zero return bd col_7 bigdecimal getcol_7 bigdecimal bigdecimal get_value col_7 set col 8 public void setcol 8 big decimal col 8 set valuenocheck col 8 col 8 col_8 setcol_8 bigdecimal col_8 set_valuenocheck col_8 col_8 get col 8 public big decimal getcol 8 big decimal bd big decimal get value col 8 if bd null return env zero return bd col_8 bigdecimal getcol_8 bigdecimal bigdecimal get_value col_8 set col 9 public void setcol 9 big decimal col 9 set valuenocheck col 9 col 9 col_9 setcol_9 bigdecimal col_9 set_valuenocheck col_9 col_9 get col 9 public big decimal getcol 9 big decimal bd big decimal get value col 9 if bd null return env zero return bd col_9 bigdecimal getcol_9 bigdecimal bigdecimal get_value col_9 set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set valuenocheck description description setdescription set_valuenocheck get description optional short description of the record public string get description return string get value description getdescription get_value set accounting fact public void setfact acct id int fact acct id if fact acct id 1 throw new illegal argument exception fact acct id is mandatory set valuenocheck fact acct id new integer fact acct id setfact_acct_id fact_acct_id fact_acct_id illegalargumentexception fact_acct_id set_valuenocheck fact_acct_id fact_acct_id get accounting fact public int getfact acct id integer ii integer get value fact acct id if ii null return 0 return ii int value getfact_acct_id get_value fact_acct_id intvalue set level no public void set level no int level no set valuenocheck level no new integer level no setlevelno levelno set_valuenocheck levelno levelno get level no public int get level no integer ii integer get value level no if ii null return 0 return ii int value getlevelno get_value levelno intvalue set name alphanumeric identifier of the entity public void set name string name if name null name length 60 log warning length 60 truncated name name substring 0 59 set valuenocheck name name setname set_valuenocheck get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set report line public void setpa reportline id int pa reportline id if pa reportline id 1 throw new illegal argument exception pa reportline id is mandatory set valuenocheck pa reportline id new integer pa reportline id setpa_reportline_id pa_reportline_id pa_reportline_id illegalargumentexception pa_reportline_id set_valuenocheck pa_reportline_id pa_reportline_id get report line public int getpa reportline id integer ii integer get value pa reportline id if ii null return 0 return ii int value getpa_reportline_id get_value pa_reportline_id intvalue set record id direct internal record id public void setrecord id int record id if record id 0 throw new illegal argument exception record id is mandatory set valuenocheck record id new integer record id setrecord_id record_id record_id illegalargumentexception record_id set_valuenocheck record_id record_id get record id direct internal record id public int getrecord id integer ii integer get value record id if ii null return 0 return ii int value getrecord_id get_value record_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set valuenocheck seq no new integer seq no setseqno seqno set_valuenocheck seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue standard constructor public x r contactinterest properties ctx int r contactinterest id string trx name super ctx r contactinterest id trx name if r contactinterest id 0 setad user id 0 ad user id setr interestarea id 0 x_r_contactinterest r_contactinterest_id trxname r_contactinterest_id trxname r_contactinterest_id setad_user_id ad_user_id setr_interestarea_id load constructor public x r contactinterest properties ctx result set rs string trx name super ctx rs trx name x_r_contactinterest resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x r contactinterest append get id append return sb to string tostring stringbuffer stringbuffer x_r_contactinterest get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getad user id intvalue keynamepair getkeynamepair keynamepair get_id valueof getad_user_id set opt out date date the contact opted out public void set opt out date timestamp opt out date set valuenocheck opt out date opt out date setoptoutdate optoutdate set_valuenocheck optoutdate optoutdate get opt out date date the contact opted out public timestamp get opt out date return timestamp get value opt out date getoptoutdate get_value optoutdate set interest area interest area or topic public void setr interestarea id int r interestarea id if r interestarea id 1 throw new illegal argument exception r interestarea id is mandatory set valuenocheck r interestarea id new integer r interestarea id setr_interestarea_id r_interestarea_id r_interestarea_id illegalargumentexception r_interestarea_id set_valuenocheck r_interestarea_id r_interestarea_id get interest area interest area or topic public int getr interestarea id integer ii integer get value r interestarea id if ii null return 0 return ii int value getr_interestarea_id get_value r_interestarea_id intvalue set subscribe date date the contact actively subscribed public void set subscribe date timestamp subscribe date set valuenocheck subscribe date subscribe date setsubscribedate subscribedate set_valuenocheck subscribedate subscribedate get subscribe date date the contact actively subscribed public timestamp get subscribe date return timestamp get value subscribe date getsubscribedate get_value subscribedate constructor for fixed format param seq no sequence param column name db dolumn name param start no start no param end no and no param data type data type see constants datatype param max length if string it is the maximum length truncated public imp format row int seq no string column name int start no int end no string data type int max length m seqno seq no set column name column name m startno start no m endno end no set data type data type set max length max length seqno columnname startno endno datatype datatype_ maxlength impformatrow seqno columnname startno endno datatype maxlength m_seqno seqno setcolumnname columnname m_startno startno m_endno endno setdatatype datatype setmaxlength maxlength constructor for non fixed format param seq no sequence param column name db column name param data type data type see constants datatype param max length if string it is the maximum length truncated public imp format row int seq no string column name string data type int max length m seqno seq no set column name column name set data type data type set max length max length seqno columnname datatype datatype_ maxlength impformatrow seqno columnname datatype maxlength m_seqno seqno setcolumnname columnname setdatatype datatype setmaxlength maxlength sequence no return seq no public int get seq no return m seqno getseqno m_seqno set sequence no param new seq no sequence public void set seq no int new seq no m seqno new seq no newseqno setseqno newseqno m_seqno newseqno start position param new start no start position public void set start no int new start no m startno new start no newstartno setstartno newstartno m_startno newstartno get start position return start position public int get start no return m startno getstartno m_startno end position param new end no end position public void set end no int new end no m endno new end no newendno setendno newendno m_endno newendno get end position return end position public int get end no return m endno getendno m_endno column param column name column name public void set column name string column name if column name null column name length 0 throw new illegal argument exception column name must be at least 1 char else m columnname column name columnname setcolumnname columnname columnname columnname illegalargumentexception columnname m_columnname columnname get column name return column name public string get column name return m columnname getcolumnname m_columnname data type param data type data type see constants datatype public void set data type string data type if data type equals datatype string data type equals datatype date data type equals datatype number data type equals datatype constant m datatype data type else throw new illegal argument exception data type must be s d n c datatype datatype_ setdatatype datatype datatype datatype_string datatype datatype_date datatype datatype_number datatype datatype_constant m_datatype datatype illegalargumentexception datatype data type return data type public string get data type return m datatype getdatatype m_datatype is string return true if data type is string public boolean is string if m datatype equals datatype constant return m constantisstring return m datatype equals datatype string isstring m_datatype datatype_constant m_constantisstring m_datatype datatype_string is number return true if data type is number public boolean is number return m datatype equals datatype number isnumber m_datatype datatype_number is date return true if data type is date public boolean is date return m datatype equals datatype date isdate m_datatype datatype_date is constant return true if data type is constant public boolean is constant return m datatype equals datatype constant isconstant m_datatype datatype_constant set format info param data format data format see constants datatype param decimal point decimal point representation param divide by100 divide number by 100 param constant value constant value param callout java callout public void set format info string data format string decimal point boolean divide by100 string constant value string callout if data format null m dataformat else m dataformat data format number if decimal point null decimal point equals m decimalpoint else m decimalpoint m divideby100 divide by100 constant if constant value null constant value length 0 m datatype equals datatype constant m constantvalue m constantisstring true else m constantvalue constant value m constantisstring false for int i 0 i m constantvalue length i char c m constantvalue char at i if character is digit c c if a constant number it must be with not m constantisstring true break callout if callout null int method start callout last index of try if method start 1 no class class c class class for name callout substring 0 method start m callout callout c class new instance m method callout substring method start 1 catch exception e log log level severe m tab set format info e to string if m callout null m method null m method length 0 log log level severe m tab set format info invalid callout callout m callout null dataformat datatype_ decimalpoint divideby100 constantvalue setformatinfo dataformat decimalpoint divideby100 constantvalue dataformat m_dataformat m_dataformat dataformat decimalpoint decimalpoint m_decimalpoint m_decimalpoint m_divideby100 divideby100 constantvalue constantvalue m_datatype datatype_constant m_constantvalue m_constantisstring m_constantvalue constantvalue m_constantisstring m_constantvalue m_constantvalue charat isdigit m_constantisstring methodstart lastindexof methodstart cclass forname methodstart m_callout cclass newinstance m_method methodstart mtab setformatinfo tostring m_callout m_method m_method mtab setformatinfo m_callout get format return data format public string get data format return m dataformat getdataformat m_dataformat get decimal point return decimal point public string get decimal point return m decimalpoint getdecimalpoint m_decimalpoint divide result by 100 return true if result will be divided by 100 public boolean is divide by100 return m divideby100 isdivideby100 m_divideby100 get the constant value return constant value public string get constant value return m constantvalue getconstantvalue m_constantvalue set maximum length for strings truncated ignored if 0 param max length max length public void set max length int max length m maxlength max length maxlength setmaxlength maxlength m_maxlength maxlength parse value field content in are treated as comments param info data item return pased info public string parse string info if info null info length 0 return comment if info starts with info ends with return string ret value null if is number ret value parse number info else if is date ret value parse date info else if is constant ret value m constantisstring parse string m constantvalue m constantvalue else ret value parse string info if m callout null try ret value m callout convert m method ret value catch exception e log log level severe imp format row parse info ret value e if ret value null ret value return ret value trim startswith endswith retvalue isnumber retvalue parsenumber isdate retvalue parsedate isconstant retvalue m_constantisstring parsestring m_constantvalue m_constantvalue retvalue parsestring m_callout retvalue m_callout m_method retvalue impformatrow retvalue retvalue retvalue retvalue return date as yyyy mm dd hh24 mi ss jdbc timestamp format w o miliseconds param info data return date as jdbc format string private string parse date string info if m dformat null try m dformat new simple date format m dataformat catch exception e log log level severe imp format row parse date format m dataformat e if m dformat null m dformat simple date format date format get date instance m dformat set lenient true timestamp ts null try ts new timestamp m dformat parse info get time catch parse exception pe log log level severe imp format row parse date info pe if ts null ts new timestamp system current time millis string date string ts to string return date string substring 0 date string index of cut off miliseconds parsedate m_dformat m_dformat simpledateformat m_dataformat impformatrow parsedate m_dataformat m_dformat m_dformat simpledateformat dateformat getdateinstance m_dformat setlenient m_dformat gettime parseexception impformatrow parsedate currenttimemillis datestring tostring datestring datestring indexof return string clean and backslash check max length param info data return info with in sql format private string parse string string info string ret value info length restriction if m maxlength 0 ret value length m maxlength ret value ret value substring 0 m maxlength copy characters wee need to look through anyway string buffer out new string buffer ret value length for int i 0 i ret value length i char c ret value char at i if c out append else if c out append else out append c return out to string parsestring retvalue m_maxlength retvalue m_maxlength retvalue retvalue m_maxlength stringbuffer stringbuffer retvalue retvalue retvalue charat tostring return number with decimal param info data return converted number private string parse number string info boolean has point info index of 1 boolean has comma info index of 1 delete thousands if has comma m decimalpoint equals info info replace if has point m decimalpoint equals info info replace has comma info index of 1 replace decimal if has comma m decimalpoint equals info info replace remove everything but digits char char array info to char array string buffer sb new string buffer for int i 0 i char array length i if character is digit char array i char array i sb append char array i if sb length 0 return 0 big decimal bd new big decimal sb to string if m divideby100 assumed two decimal scale bd bd divide new big decimal 100 0 2 big decimal round half up return bd to string parsenumber haspoint indexof hascomma indexof hascomma m_decimalpoint haspoint m_decimalpoint hascomma indexof hascomma m_decimalpoint chararray tochararray stringbuffer stringbuffer chararray isdigit chararray chararray chararray bigdecimal bigdecimal tostring m_divideby100 bigdecimal bigdecimal round_half_up tostring standard constructor param ctx context param c commissionrun id id public m commission run properties ctx int c commissionrun id string trx name super ctx c commissionrun id trx name if c commissionrun id 0 setc commission id 0 set document no null set start date new timestamp system current time millis set grand total env zero set processed false c_commissionrun_id mcommissionrun c_commissionrun_id trxname c_commissionrun_id trxname c_commissionrun_id setc_commission_id setdocumentno setstartdate currenttimemillis setgrandtotal setprocessed parent constructor param commission parent public m commission run m commission commission this commission get ctx 0 commission get trxname set client org commission setc commission id commission getc commission id mcommissionrun mcommission getctx get_trxname setclientorg setc_commission_id getc_commission_id load constructor param ctx context param rs result set public m commission run properties ctx result set rs string trx name super ctx rs trx name mcommissionrun resultset trxname trxname get amounts return array of amounts public m commission amt get amts string sql select from c commissionamt where c commissionrun id array list m commission amt list new array list m commission amt prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getc commissionrun id result set rs pstmt execute query while rs next list add new m commission amt get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null convert m commission amt ret value new m commission amt list size list to array ret value return ret value mcommissionamt getamts c_commissionamt c_commissionrun_id arraylist mcommissionamt arraylist mcommissionamt preparedstatement preparestatement get_trxname setint getc_commissionrun_id resultset executequery mcommissionamt getctx get_trxname mcommissionamt retvalue mcommissionamt toarray retvalue retvalue update from amt public void update from amt m commission amt amts get amts big decimal grand total env zero for int i 0 i amts length i m commission amt amt amts i grand total grand total add amt get commission amt set grand total grand total updatefromamt mcommissionamt getamts bigdecimal grandtotal mcommissionamt grandtotal grandtotal getcommissionamt setgrandtotal grandtotal standard constructor public x ad user roles properties ctx int ad user roles id string trx name super ctx ad user roles id trx name if ad user roles id 0 setad role id 0 setad user id 0 x_ad_user_roles ad_user_roles_id trxname ad_user_roles_id trxname ad_user_roles_id setad_role_id setad_user_id load constructor public x ad user roles properties ctx result set rs string trx name super ctx rs trx name x_ad_user_roles resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad user roles append get id append return sb to string tostring stringbuffer stringbuffer x_ad_user_roles get_id tostring set role responsibility role public void setad role id int ad role id if ad role id 0 throw new illegal argument exception ad role id is mandatory set valuenocheck ad role id new integer ad role id setad_role_id ad_role_id ad_role_id illegalargumentexception ad_role_id set_valuenocheck ad_role_id ad_role_id get role responsibility role public int getad role id integer ii integer get value ad role id if ii null return 0 return ii int value getad_role_id get_value ad_role_id intvalue set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 1 throw new illegal argument exception ad user id is mandatory set valuenocheck ad user id new integer ad user id setad_user_id ad_user_id ad_user_id illegalargumentexception ad_user_id set_valuenocheck ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue standard constructor public x t invoicegl properties ctx int t invoicegl id string trx name super ctx t invoicegl id trx name if t invoicegl id 0 setad pinstance id 0 set amt acct balance env zero set amt reval cr env zero set amt reval cr diff env zero set amt reval dr env zero set amt reval dr diff env zero set amt source balance env zero setc conversiontypereval id 0 setc invoice id 0 set date reval new timestamp system current time millis setfact acct id 0 set grand total env zero set is all currencies false set open amt env zero x_t_invoicegl t_invoicegl_id trxname t_invoicegl_id trxname t_invoicegl_id setad_pinstance_id setamtacctbalance setamtrevalcr setamtrevalcrdiff setamtrevaldr setamtrevaldrdiff setamtsourcebalance setc_conversiontypereval_id setc_invoice_id setdatereval currenttimemillis setfact_acct_id setgrandtotal setisallcurrencies setopenamt load constructor public x t invoicegl properties ctx result set rs string trx name super ctx rs trx name x_t_invoicegl resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x t invoicegl append get id append return sb to string tostring stringbuffer stringbuffer x_t_invoicegl get_id tostring set process instance instance of the process public void setad pinstance id int ad pinstance id if ad pinstance id 1 throw new illegal argument exception ad pinstance id is mandatory set value ad pinstance id new integer ad pinstance id setad_pinstance_id ad_pinstance_id ad_pinstance_id illegalargumentexception ad_pinstance_id set_value ad_pinstance_id ad_pinstance_id get process instance instance of the process public int getad pinstance id integer ii integer get value ad pinstance id if ii null return 0 return ii int value getad_pinstance_id get_value ad_pinstance_id intvalue public static final string apar receivablesonly r set ap ar include receivables and or payables transactions public void setapar string apar if apar null throw new illegal argument exception apar is mandatory if apar null apar equals a apar equals p apar equals r else throw new illegal argument exception apar invalid value apar reference id 332 a p r if apar null apar length 1 log warning length 1 truncated apar apar substring 0 0 set value apar apar apar_receivablesonly illegalargumentexception illegalargumentexception reference_id set_value get ap ar include receivables and or payables transactions public string getapar return string get value apar get_value set accounted balance accounted balance amount public void set amt acct balance big decimal amt acct balance if amt acct balance null throw new illegal argument exception amt acct balance is mandatory set value amt acct balance amt acct balance setamtacctbalance bigdecimal amtacctbalance amtacctbalance illegalargumentexception amtacctbalance set_value amtacctbalance amtacctbalance get accounted balance accounted balance amount public big decimal get amt acct balance big decimal bd big decimal get value amt acct balance if bd null return env zero return bd bigdecimal getamtacctbalance bigdecimal bigdecimal get_value amtacctbalance set revaluated amount cr revaluated cr amount public void set amt reval cr big decimal amt reval cr if amt reval cr null throw new illegal argument exception amt reval cr is mandatory set value amt reval cr amt reval cr setamtrevalcr bigdecimal amtrevalcr amtrevalcr illegalargumentexception amtrevalcr set_value amtrevalcr amtrevalcr get revaluated amount cr revaluated cr amount public big decimal get amt reval cr big decimal bd big decimal get value amt reval cr if bd null return env zero return bd bigdecimal getamtrevalcr bigdecimal bigdecimal get_value amtrevalcr set revaluated difference cr revaluated cr amount difference public void set amt reval cr diff big decimal amt reval cr diff if amt reval cr diff null throw new illegal argument exception amt reval cr diff is mandatory set value amt reval cr diff amt reval cr diff setamtrevalcrdiff bigdecimal amtrevalcrdiff amtrevalcrdiff illegalargumentexception amtrevalcrdiff set_value amtrevalcrdiff amtrevalcrdiff get revaluated difference cr revaluated cr amount difference public big decimal get amt reval cr diff big decimal bd big decimal get value amt reval cr diff if bd null return env zero return bd bigdecimal getamtrevalcrdiff bigdecimal bigdecimal get_value amtrevalcrdiff set revaluated amount dr revaluated dr amount public void set amt reval dr big decimal amt reval dr if amt reval dr null throw new illegal argument exception amt reval dr is mandatory set value amt reval dr amt reval dr setamtrevaldr bigdecimal amtrevaldr amtrevaldr illegalargumentexception amtrevaldr set_value amtrevaldr amtrevaldr get revaluated amount dr revaluated dr amount public big decimal get amt reval dr big decimal bd big decimal get value amt reval dr if bd null return env zero return bd bigdecimal getamtrevaldr bigdecimal bigdecimal get_value amtrevaldr set revaluated difference dr revaluated dr amount difference public void set amt reval dr diff big decimal amt reval dr diff if amt reval dr diff null throw new illegal argument exception amt reval dr diff is mandatory set value amt reval dr diff amt reval dr diff setamtrevaldrdiff bigdecimal amtrevaldrdiff amtrevaldrdiff illegalargumentexception amtrevaldrdiff set_value amtrevaldrdiff amtrevaldrdiff get revaluated difference dr revaluated dr amount difference public big decimal get amt reval dr diff big decimal bd big decimal get value amt reval dr diff if bd null return env zero return bd bigdecimal getamtrevaldrdiff bigdecimal bigdecimal get_value amtrevaldrdiff set source balance source balance amount public void set amt source balance big decimal amt source balance if amt source balance null throw new illegal argument exception amt source balance is mandatory set value amt source balance amt source balance setamtsourcebalance bigdecimal amtsourcebalance amtsourcebalance illegalargumentexception amtsourcebalance set_value amtsourcebalance amtsourcebalance get source balance source balance amount public big decimal get amt source balance big decimal bd big decimal get value amt source balance if bd null return env zero return bd bigdecimal getamtsourcebalance bigdecimal bigdecimal get_value amtsourcebalance public static final int c conversiontypereval id ad reference id 352 set revaluation conversion type revaluation currency conversion type public void setc conversiontypereval id int c conversiontypereval id if c conversiontypereval id 1 throw new illegal argument exception c conversiontypereval id is mandatory set value c conversiontypereval id new integer c conversiontypereval id c_conversiontypereval_id_ad_reference_id setc_conversiontypereval_id c_conversiontypereval_id c_conversiontypereval_id illegalargumentexception c_conversiontypereval_id set_value c_conversiontypereval_id c_conversiontypereval_id get revaluation conversion type revaluation currency conversion type public int getc conversiontypereval id integer ii integer get value c conversiontypereval id if ii null return 0 return ii int value getc_conversiontypereval_id get_value c_conversiontypereval_id intvalue public static final int c doctypereval id ad reference id 170 set revaluation document type document type for revaluation journal public void setc doctypereval id int c doctypereval id if c doctypereval id 0 set value c doctypereval id null else set value c doctypereval id new integer c doctypereval id c_doctypereval_id_ad_reference_id setc_doctypereval_id c_doctypereval_id c_doctypereval_id set_value c_doctypereval_id set_value c_doctypereval_id c_doctypereval_id get revaluation document type document type for revaluation journal public int getc doctypereval id integer ii integer get value c doctypereval id if ii null return 0 return ii int value getc_doctypereval_id get_value c_doctypereval_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 1 throw new illegal argument exception c invoice id is mandatory set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id illegalargumentexception c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue set revaluation date date of revaluation public void set date reval timestamp date reval if date reval null throw new illegal argument exception date reval is mandatory set value date reval date reval setdatereval datereval datereval illegalargumentexception datereval set_value datereval datereval get revaluation date date of revaluation public timestamp get date reval return timestamp get value date reval getdatereval get_value datereval set accounting fact public void setfact acct id int fact acct id if fact acct id 1 throw new illegal argument exception fact acct id is mandatory set valuenocheck fact acct id new integer fact acct id setfact_acct_id fact_acct_id fact_acct_id illegalargumentexception fact_acct_id set_valuenocheck fact_acct_id fact_acct_id get accounting fact public int getfact acct id integer ii integer get value fact acct id if ii null return 0 return ii int value getfact_acct_id get_value fact_acct_id intvalue set grand total total amount of document public void set grand total big decimal grand total if grand total null throw new illegal argument exception grand total is mandatory set value grand total grand total setgrandtotal bigdecimal grandtotal grandtotal illegalargumentexception grandtotal set_value grandtotal grandtotal get grand total total amount of document public big decimal get grand total big decimal bd big decimal get value grand total if bd null return env zero return bd bigdecimal getgrandtotal bigdecimal bigdecimal get_value grandtotal set include all currencies report not just foreign currency invoices public void set is all currencies boolean is all currencies set value is all currencies new boolean is all currencies setisallcurrencies isallcurrencies set_value isallcurrencies isallcurrencies get include all currencies report not just foreign currency invoices public boolean is all currencies object oo get value is all currencies if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isallcurrencies get_value isallcurrencies booleanvalue set open amount open item amount public void set open amt big decimal open amt if open amt null throw new illegal argument exception open amt is mandatory set value open amt open amt setopenamt bigdecimal openamt openamt illegalargumentexception openamt set_value openamt openamt get open amount open item amount public big decimal get open amt big decimal bd big decimal get value open amt if bd null return env zero return bd bigdecimal getopenamt bigdecimal bigdecimal get_value openamt set percent percentage public void set percent big decimal percent set value percent percent setpercent bigdecimal set_value get percent percentage public big decimal get percent big decimal bd big decimal get value percent if bd null return env zero return bd bigdecimal getpercent bigdecimal bigdecimal get_value standard constructor public x c orderline properties ctx int c orderline id string trx name super ctx c orderline id trx name if c orderline id 0 setc bpartner location id 0 c bpartner location id setc currency id 0 c currency id setc orderline id 0 setc order id 0 setc tax id 0 setc uom id 0 c uom id set date ordered new timestamp system current time millis date ordered set freight amt env zero set is description false n set line 0 sql select nvl max line 0 10 as default value from c orderline where c order id c order id set line net amt env zero setm attributesetinstance id 0 setm warehouse id 0 m warehouse id set price actual env zero set price entered env zero set price limit env zero set price list env zero set processed false set qty delivered env zero set qty entered env zero 1 set qty invoiced env zero set qty lost sales env zero set qty ordered env zero 1 set qty reserved env zero x_c_orderline c_orderline_id trxname c_orderline_id trxname c_orderline_id setc_bpartner_location_id c_bpartner_location_id setc_currency_id c_currency_id setc_orderline_id setc_order_id setc_tax_id setc_uom_id c_uom_id setdateordered currenttimemillis dateordered setfreightamt setisdescription setline defaultvalue c_orderline c_order_id c_order_id setlinenetamt setm_attributesetinstance_id setm_warehouse_id m_warehouse_id setpriceactual setpriceentered setpricelimit setpricelist setprocessed setqtydelivered setqtyentered setqtyinvoiced setqtylostsales setqtyordered setqtyreserved load constructor public x c orderline properties ctx result set rs string trx name super ctx rs trx name x_c_orderline resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c orderline append get id append return sb to string tostring stringbuffer stringbuffer x_c_orderline get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set valuenocheck c bpartner id null else set valuenocheck c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_valuenocheck c_bpartner_id set_valuenocheck c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set partner location identifies the ship to address for this business partner public void setc bpartner location id int c bpartner location id if c bpartner location id 1 throw new illegal argument exception c bpartner location id is mandatory set value c bpartner location id new integer c bpartner location id setc_bpartner_location_id c_bpartner_location_id c_bpartner_location_id illegalargumentexception c_bpartner_location_id set_value c_bpartner_location_id c_bpartner_location_id get partner location identifies the ship to address for this business partner public int getc bpartner location id integer ii integer get value c bpartner location id if ii null return 0 return ii int value getc_bpartner_location_id get_value c_bpartner_location_id intvalue set charge additional document charges public void setc charge id int c charge id if c charge id 0 set value c charge id null else set value c charge id new integer c charge id setc_charge_id c_charge_id c_charge_id set_value c_charge_id set_value c_charge_id c_charge_id get charge additional document charges public int getc charge id integer ii integer get value c charge id if ii null return 0 return ii int value getc_charge_id get_value c_charge_id intvalue set currency the currency for this record public void setc currency id int c currency id if c currency id 1 throw new illegal argument exception c currency id is mandatory set valuenocheck c currency id new integer c currency id setc_currency_id c_currency_id c_currency_id illegalargumentexception c_currency_id set_valuenocheck c_currency_id c_currency_id get currency the currency for this record public int getc currency id integer ii integer get value c currency id if ii null return 0 return ii int value getc_currency_id get_value c_currency_id intvalue set sales order line sales order line public void setc orderline id int c orderline id if c orderline id 1 throw new illegal argument exception c orderline id is mandatory set valuenocheck c orderline id new integer c orderline id setc_orderline_id c_orderline_id c_orderline_id illegalargumentexception c_orderline_id set_valuenocheck c_orderline_id c_orderline_id get sales order line sales order line public int getc orderline id integer ii integer get value c orderline id if ii null return 0 return ii int value getc_orderline_id get_value c_orderline_id intvalue set order order public void setc order id int c order id if c order id 1 throw new illegal argument exception c order id is mandatory set valuenocheck c order id new integer c order id setc_order_id c_order_id c_order_id illegalargumentexception c_order_id set_valuenocheck c_order_id c_order_id get order order public int getc order id integer ii integer get value c order id if ii null return 0 return ii int value getc_order_id get_value c_order_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc order id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_order_id set project financial project public void setc project id int c project id if c project id 0 set value c project id null else set value c project id new integer c project id setc_project_id c_project_id c_project_id set_value c_project_id set_value c_project_id c_project_id get project financial project public int getc project id integer ii integer get value c project id if ii null return 0 return ii int value getc_project_id get_value c_project_id intvalue set tax tax identifier public void setc tax id int c tax id if c tax id 1 throw new illegal argument exception c tax id is mandatory set value c tax id new integer c tax id setc_tax_id c_tax_id c_tax_id illegalargumentexception c_tax_id set_value c_tax_id c_tax_id get tax tax identifier public int getc tax id integer ii integer get value c tax id if ii null return 0 return ii int value getc_tax_id get_value c_tax_id intvalue set uom unit of measure public void setc uom id int c uom id if c uom id 1 throw new illegal argument exception c uom id is mandatory set valuenocheck c uom id new integer c uom id setc_uom_id c_uom_id c_uom_id illegalargumentexception c_uom_id set_valuenocheck c_uom_id c_uom_id get uom unit of measure public int getc uom id integer ii integer get value c uom id if ii null return 0 return ii int value getc_uom_id get_value c_uom_id intvalue set date delivered date when the product was delivered public void set date delivered timestamp date delivered set valuenocheck date delivered date delivered setdatedelivered datedelivered set_valuenocheck datedelivered datedelivered get date delivered date when the product was delivered public timestamp get date delivered return timestamp get value date delivered getdatedelivered get_value datedelivered set date invoiced date printed on invoice public void set date invoiced timestamp date invoiced set valuenocheck date invoiced date invoiced setdateinvoiced dateinvoiced set_valuenocheck dateinvoiced dateinvoiced get date invoiced date printed on invoice public timestamp get date invoiced return timestamp get value date invoiced getdateinvoiced get_value dateinvoiced set date ordered date of order public void set date ordered timestamp date ordered if date ordered null throw new illegal argument exception date ordered is mandatory set value date ordered date ordered setdateordered dateordered dateordered illegalargumentexception dateordered set_value dateordered dateordered get date ordered date of order public timestamp get date ordered return timestamp get value date ordered getdateordered get_value dateordered set date promised date order was promised public void set date promised timestamp date promised set value date promised date promised setdatepromised datepromised set_value datepromised datepromised get date promised date order was promised public timestamp get date promised return timestamp get value date promised getdatepromised get_value datepromised set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set discount discount in percent public void set discount big decimal discount set value discount discount setdiscount bigdecimal set_value get discount discount in percent public big decimal get discount big decimal bd big decimal get value discount if bd null return env zero return bd bigdecimal getdiscount bigdecimal bigdecimal get_value set freight amount freight amount public void set freight amt big decimal freight amt if freight amt null throw new illegal argument exception freight amt is mandatory set value freight amt freight amt setfreightamt bigdecimal freightamt freightamt illegalargumentexception freightamt set_value freightamt freightamt get freight amount freight amount public big decimal get freight amt big decimal bd big decimal get value freight amt if bd null return env zero return bd bigdecimal getfreightamt bigdecimal bigdecimal get_value freightamt set description only if true the line is just description and no transaction public void set is description boolean is description set value is description new boolean is description setisdescription isdescription set_value isdescription isdescription get description only if true the line is just description and no transaction public boolean is description object oo get value is description if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isdescription get_value isdescription booleanvalue set line no unique line for this document public void set line int line set value line new integer line setline set_value get line no unique line for this document public int get line integer ii integer get value line if ii null return 0 return ii int value getline get_value intvalue set line amount line extended amount quantity actual price without freight and charges public void set line net amt big decimal line net amt if line net amt null throw new illegal argument exception line net amt is mandatory set valuenocheck line net amt line net amt setlinenetamt bigdecimal linenetamt linenetamt illegalargumentexception linenetamt set_valuenocheck linenetamt linenetamt get line amount line extended amount quantity actual price without freight and charges public big decimal get line net amt big decimal bd big decimal get value line net amt if bd null return env zero return bd bigdecimal getlinenetamt bigdecimal bigdecimal get_value linenetamt set attribute set instance product attribute set instance public void setm attributesetinstance id int m attributesetinstance id if m attributesetinstance id 0 throw new illegal argument exception m attributesetinstance id is mandatory set value m attributesetinstance id new integer m attributesetinstance id setm_attributesetinstance_id m_attributesetinstance_id m_attributesetinstance_id illegalargumentexception m_attributesetinstance_id set_value m_attributesetinstance_id m_attributesetinstance_id get attribute set instance product attribute set instance public int getm attributesetinstance id integer ii integer get value m attributesetinstance id if ii null return 0 return ii int value getm_attributesetinstance_id get_value m_attributesetinstance_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set shipper method or manner of product delivery public void setm shipper id int m shipper id if m shipper id 0 set value m shipper id null else set value m shipper id new integer m shipper id setm_shipper_id m_shipper_id m_shipper_id set_value m_shipper_id set_value m_shipper_id m_shipper_id get shipper method or manner of product delivery public int getm shipper id integer ii integer get value m shipper id if ii null return 0 return ii int value getm_shipper_id get_value m_shipper_id intvalue public static final int m warehouse id ad reference id 197 set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id m_warehouse_id_ad_reference_id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set unit price actual price public void set price actual big decimal price actual if price actual null throw new illegal argument exception price actual is mandatory set valuenocheck price actual price actual setpriceactual bigdecimal priceactual priceactual illegalargumentexception priceactual set_valuenocheck priceactual priceactual get unit price actual price public big decimal get price actual big decimal bd big decimal get value price actual if bd null return env zero return bd bigdecimal getpriceactual bigdecimal bigdecimal get_value priceactual set cost price price per unit of measure including all indirect costs freight etc public void set price cost big decimal price cost set value price cost price cost setpricecost bigdecimal pricecost set_value pricecost pricecost get cost price price per unit of measure including all indirect costs freight etc public big decimal get price cost big decimal bd big decimal get value price cost if bd null return env zero return bd bigdecimal getpricecost bigdecimal bigdecimal get_value pricecost set price price entered the price based on the selected base uom public void set price entered big decimal price entered if price entered null throw new illegal argument exception price entered is mandatory set value price entered price entered setpriceentered bigdecimal priceentered priceentered illegalargumentexception priceentered set_value priceentered priceentered get price price entered the price based on the selected base uom public big decimal get price entered big decimal bd big decimal get value price entered if bd null return env zero return bd bigdecimal getpriceentered bigdecimal bigdecimal get_value priceentered set limit price lowest price for a product public void set price limit big decimal price limit if price limit null throw new illegal argument exception price limit is mandatory set value price limit price limit setpricelimit bigdecimal pricelimit pricelimit illegalargumentexception pricelimit set_value pricelimit pricelimit get limit price lowest price for a product public big decimal get price limit big decimal bd big decimal get value price limit if bd null return env zero return bd bigdecimal getpricelimit bigdecimal bigdecimal get_value pricelimit set list price list price public void set price list big decimal price list if price list null throw new illegal argument exception price list is mandatory set value price list price list setpricelist bigdecimal pricelist pricelist illegalargumentexception pricelist set_value pricelist pricelist get list price list price public big decimal get price list big decimal bd big decimal get value price list if bd null return env zero return bd bigdecimal getpricelist bigdecimal bigdecimal get_value pricelist set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set delivered quantity delivered quantity public void set qty delivered big decimal qty delivered if qty delivered null throw new illegal argument exception qty delivered is mandatory set valuenocheck qty delivered qty delivered setqtydelivered bigdecimal qtydelivered qtydelivered illegalargumentexception qtydelivered set_valuenocheck qtydelivered qtydelivered get delivered quantity delivered quantity public big decimal get qty delivered big decimal bd big decimal get value qty delivered if bd null return env zero return bd bigdecimal getqtydelivered bigdecimal bigdecimal get_value qtydelivered set quantity the quantity entered is based on the selected uom public void set qty entered big decimal qty entered if qty entered null throw new illegal argument exception qty entered is mandatory set value qty entered qty entered setqtyentered bigdecimal qtyentered qtyentered illegalargumentexception qtyentered set_value qtyentered qtyentered get quantity the quantity entered is based on the selected uom public big decimal get qty entered big decimal bd big decimal get value qty entered if bd null return env zero return bd bigdecimal getqtyentered bigdecimal bigdecimal get_value qtyentered set quantity invoiced invoiced quantity public void set qty invoiced big decimal qty invoiced if qty invoiced null throw new illegal argument exception qty invoiced is mandatory set valuenocheck qty invoiced qty invoiced setqtyinvoiced bigdecimal qtyinvoiced qtyinvoiced illegalargumentexception qtyinvoiced set_valuenocheck qtyinvoiced qtyinvoiced get quantity invoiced invoiced quantity public big decimal get qty invoiced big decimal bd big decimal get value qty invoiced if bd null return env zero return bd bigdecimal getqtyinvoiced bigdecimal bigdecimal get_value qtyinvoiced set lost sales qty quantity of potential sales public void set qty lost sales big decimal qty lost sales if qty lost sales null throw new illegal argument exception qty lost sales is mandatory set value qty lost sales qty lost sales setqtylostsales bigdecimal qtylostsales qtylostsales illegalargumentexception qtylostsales set_value qtylostsales qtylostsales get lost sales qty quantity of potential sales public big decimal get qty lost sales big decimal bd big decimal get value qty lost sales if bd null return env zero return bd bigdecimal getqtylostsales bigdecimal bigdecimal get_value qtylostsales set ordered quantity ordered quantity public void set qty ordered big decimal qty ordered if qty ordered null throw new illegal argument exception qty ordered is mandatory set value qty ordered qty ordered setqtyordered bigdecimal qtyordered qtyordered illegalargumentexception qtyordered set_value qtyordered qtyordered get ordered quantity ordered quantity public big decimal get qty ordered big decimal bd big decimal get value qty ordered if bd null return env zero return bd bigdecimal getqtyordered bigdecimal bigdecimal get_value qtyordered set reserved quantity reserved quantity public void set qty reserved big decimal qty reserved if qty reserved null throw new illegal argument exception qty reserved is mandatory set valuenocheck qty reserved qty reserved setqtyreserved bigdecimal qtyreserved qtyreserved illegalargumentexception qtyreserved set_valuenocheck qtyreserved qtyreserved get reserved quantity reserved quantity public big decimal get qty reserved big decimal bd big decimal get value qty reserved if bd null return env zero return bd bigdecimal getqtyreserved bigdecimal bigdecimal get_value qtyreserved public static final int ref orderline id ad reference id 271 set referenced order line reference to corresponding sales purchase order public void setref orderline id int ref orderline id if ref orderline id 0 set value ref orderline id null else set value ref orderline id new integer ref orderline id ref_orderline_id_ad_reference_id setref_orderline_id ref_orderline_id ref_orderline_id set_value ref_orderline_id set_value ref_orderline_id ref_orderline_id get referenced order line reference to corresponding sales purchase order public int getref orderline id integer ii integer get value ref orderline id if ii null return 0 return ii int value getref_orderline_id get_value ref_orderline_id intvalue set resource assignment resource assignment public void sets resourceassignment id int s resourceassignment id if s resourceassignment id 0 set value s resourceassignment id null else set value s resourceassignment id new integer s resourceassignment id sets_resourceassignment_id s_resourceassignment_id s_resourceassignment_id set_value s_resourceassignment_id set_value s_resourceassignment_id s_resourceassignment_id get resource assignment resource assignment public int gets resourceassignment id integer ii integer get value s resourceassignment id if ii null return 0 return ii int value gets_resourceassignment_id get_value s_resourceassignment_id intvalue standard constructor public x c paymentbatch properties ctx int c paymentbatch id string trx name super ctx c paymentbatch id trx name if c paymentbatch id 0 setc paymentbatch id 0 setc paymentprocessor id 0 set name null set processed false set processing false x_c_paymentbatch c_paymentbatch_id trxname c_paymentbatch_id trxname c_paymentbatch_id setc_paymentbatch_id setc_paymentprocessor_id setname setprocessed setprocessing load constructor public x c paymentbatch properties ctx result set rs string trx name super ctx rs trx name x_c_paymentbatch resultset trxname trxname protected big decimal access level new big decimal 1 access level 1 org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c paymentbatch append get id append return sb to string tostring stringbuffer stringbuffer x_c_paymentbatch get_id tostring set payment batch payment batch for eft public void setc paymentbatch id int c paymentbatch id if c paymentbatch id 1 throw new illegal argument exception c paymentbatch id is mandatory set valuenocheck c paymentbatch id new integer c paymentbatch id setc_paymentbatch_id c_paymentbatch_id c_paymentbatch_id illegalargumentexception c_paymentbatch_id set_valuenocheck c_paymentbatch_id c_paymentbatch_id get payment batch payment batch for eft public int getc paymentbatch id integer ii integer get value c paymentbatch id if ii null return 0 return ii int value getc_paymentbatch_id get_value c_paymentbatch_id intvalue set payment processor payment processor for electronic payments public void setc paymentprocessor id int c paymentprocessor id if c paymentprocessor id 1 throw new illegal argument exception c paymentprocessor id is mandatory set value c paymentprocessor id new integer c paymentprocessor id setc_paymentprocessor_id c_paymentprocessor_id c_paymentprocessor_id illegalargumentexception c_paymentprocessor_id set_value c_paymentprocessor_id c_paymentprocessor_id get payment processor payment processor for electronic payments public int getc paymentprocessor id integer ii integer get value c paymentprocessor id if ii null return 0 return ii int value getc_paymentprocessor_id get_value c_paymentprocessor_id intvalue set document no document sequence number of the document public void set document no string document no if document no null document no length 30 log warning length 30 truncated document no document no substring 0 29 set value document no document no setdocumentno documentno documentno documentno documentno documentno set_value documentno documentno get document no document sequence number of the document public string get document no return string get value document no getdocumentno get_value documentno return string get value document no public key name pair get key name pair return new key name pair get id get document no get_value documentno keynamepair getkeynamepair keynamepair get_id getdocumentno set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue set processing date public void set processing date timestamp processing date set value processing date processing date setprocessingdate processingdate set_value processingdate processingdate get processing date public timestamp get processing date return timestamp get value processing date getprocessingdate get_value processingdate get formatter return singleton public static c log formatter get if s formatter null s formatter new c log formatter return s formatter clogformatter s_formatter s_formatter clogformatter s_formatter c log formatter private c log formatter super clogformatter clogformatter format param record log record return formatted string public string format log record record string buffer sb new string buffer long ms record get millis timestamp ts null if ms 0 ts new timestamp system current time millis else ts new timestamp ms string ts str try ts str ts to string 00 catch exception e system err println c log formatter format millis ms e to string record get message 1 5 1 5 2 5 ts str time error if record get level level severe 12 12 12 123 sb append if ini is client toolkit get default toolkit beep else if record get level level warning 12 12 12 123 sb append else sb append ts str substring 11 23 int spaces 11 if record get level level info spaces 1 else if record get level level config spaces 3 else if record get level level fine spaces 5 else if record get level level finer spaces 7 else if record get level level finest spaces 9 sb append substring 0 spaces class method if m shortformat sb append get class method record append message sb append record get message parameters string parameters get parameters record if parameters length 0 sb append append parameters append level sb append append record get level get localized name thread if record get threadid 10 sb append append record get threadid append sb append nl if record get thrown null sb append get exception trace record append nl return sb to string logrecord stringbuffer stringbuffer getmillis currenttimemillis tsstr tsstr tostring clogformatter tostring getmessage tsstr _________________________ getlevel isclient getdefaulttoolkit getlevel tsstr getlevel getlevel getlevel getlevel getlevel m_shortformat getclassmethod getmessage getparameters getlevel getlocalizedname getthreadid getthreadid getthrown getexceptiontrace tostring return the header string for a set of formatted records param h the target handler return header string public string get head handler h string class name h get class get name int index class name last index of if index 1 class name class name substring index 1 string buffer sb new string buffer append append new timestamp system current time millis append a dempiere log append class name append append nl return sb to string gethead classname getclass getname classname lastindexof classname classname stringbuffer stringbuffer currenttimemillis adempiere classname tostring return the tail string for a set of formatted records param h the target handler return tail string public string get tail handler h string class name h get class get name int index class name last index of if index 1 class name class name substring index 1 string buffer sb new string buffer append nl append append new timestamp system current time millis append a dempiere log append class name append append nl return sb to string gettail classname getclass getname classname lastindexof classname classname stringbuffer stringbuffer currenttimemillis adempiere classname tostring set format param short format format public void set format boolean short format m shortformat short format shortformat setformat shortformat m_shortformat shortformat get class method from log record param record record return class method public static string get class method log record record string buffer sb new string buffer string class name record get logger name if class name null class name index of default 1 anonymous logger class name index of global 1 global logger class name record get source class name if class name null int index class name last index of if index 1 sb append class name substring index 1 else sb append class name else sb append record get logger name if record get source method name null sb append append record get source method name string ret value sb to string if ret value equals trace print stack return return ret value getclassmethod logrecord stringbuffer stringbuffer classname getloggername classname classname indexof classname indexof classname getsourceclassname classname classname lastindexof classname classname getloggername getsourcemethodname getsourcemethodname retvalue tostring retvalue printstack retvalue get log parameters param record log record return parameters empty string or parameters public static string get parameters log record record string buffer sb new string buffer object parameters record get parameters if parameters null parameters length 0 for int i 0 i parameters length i if i 0 sb append sb append parameters i return sb to string getparameters logrecord stringbuffer stringbuffer getparameters tostring get log exception param record log record return null if exists or string public static string get exception trace log record record throwable thrown record get thrown if thrown null return null string buffer sb new string buffer try print stack string writer sw new string writer print writer pw new print writer sw thrown print stack trace pw pw close sb append sw to string create stack fill exception trace sb thrown catch exception ex return sb to string getexceptiontrace logrecord getthrown stringbuffer stringbuffer stringwriter stringwriter printwriter printwriter printstacktrace tostring fillexceptiontrace tostring fill exception trace param sb string buffer param hdr header param thrown thrown private static void fill exception trace string buffer sb string hdr throwable thrown boolean first error hdr length 0 sb append hdr append thrown to string if thrown instanceof sql exception sql exception ex sql exception thrown sb append state append ex getsql state append error code append ex get error code sb append nl stack trace element trace thrown get stack trace boolean compiere trace false int compiere trace no 0 for int i 0 i trace length i compiere trace trace i get class name starts with org compiere if thrown instanceof server exception rmi compiere trace if compiere trace sb append tat append trace i append nl else if i 20 i 10 compiere trace no 8 break else sb append tat append trace i append nl if compiere trace compiere trace no throwable cause thrown get cause if cause null fill exception trace sb caused by cause fillexceptiontrace stringbuffer firsterror tostring sqlexception sqlexception sqlexception getsqlstate errorcode geterrorcode stacktraceelement getstacktrace compieretrace compieretraceno compieretrace getclassname startswith serverexception compieretrace compieretrace compieretraceno compieretrace compieretraceno getcause fillexceptiontrace standard constructor public x k entry properties ctx int k entry id string trx name super ctx k entry id trx name if k entry id 0 set is public true y setk entry id 0 setk topic id 0 set name null set rating 0 set text msg null x_k_entry k_entry_id trxname k_entry_id trxname k_entry_id setispublic setk_entry_id setk_topic_id setname setrating settextmsg load constructor public x k entry properties ctx result set rs string trx name super ctx rs trx name x_k_entry resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x k entry append get id append return sb to string tostring stringbuffer stringbuffer x_k_entry get_id tostring set session user session online or web public void setad session id int ad session id if ad session id 0 set valuenocheck ad session id null else set valuenocheck ad session id new integer ad session id setad_session_id ad_session_id ad_session_id set_valuenocheck ad_session_id set_valuenocheck ad_session_id ad_session_id get session user session online or web public int getad session id integer ii integer get value ad session id if ii null return 0 return ii int value getad_session_id get_value ad_session_id intvalue set description url url for the description public void set descriptionurl string descriptionurl if descriptionurl null descriptionurl length 120 log warning length 120 truncated descriptionurl descriptionurl substring 0 119 set value descriptionurl descriptionurl setdescriptionurl set_value get description url url for the description public string get descriptionurl return string get value descriptionurl getdescriptionurl get_value set public public can read entry public void set is public boolean is public set value is public new boolean is public setispublic ispublic set_value ispublic ispublic get public public can read entry public boolean is public object oo get value is public if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ispublic get_value ispublic booleanvalue set entry knowledge entry public void setk entry id int k entry id if k entry id 1 throw new illegal argument exception k entry id is mandatory set valuenocheck k entry id new integer k entry id setk_entry_id k_entry_id k_entry_id illegalargumentexception k_entry_id set_valuenocheck k_entry_id k_entry_id get entry knowledge entry public int getk entry id integer ii integer get value k entry id if ii null return 0 return ii int value getk_entry_id get_value k_entry_id intvalue set knowledge source source of a knowledge entry public void setk source id int k source id if k source id 0 set value k source id null else set value k source id new integer k source id setk_source_id k_source_id k_source_id set_value k_source_id set_value k_source_id k_source_id get knowledge source source of a knowledge entry public int getk source id integer ii integer get value k source id if ii null return 0 return ii int value getk_source_id get_value k_source_id intvalue set knowledge topic knowledge topic public void setk topic id int k topic id if k topic id 1 throw new illegal argument exception k topic id is mandatory set valuenocheck k topic id new integer k topic id setk_topic_id k_topic_id k_topic_id illegalargumentexception k_topic_id set_valuenocheck k_topic_id k_topic_id get knowledge topic knowledge topic public int getk topic id integer ii integer get value k topic id if ii null return 0 return ii int value getk_topic_id get_value k_topic_id intvalue set keywords list of keywords separated by space comma or semicolon public void set keywords string keywords if keywords null keywords length 255 log warning length 255 truncated keywords keywords substring 0 254 set value keywords keywords setkeywords set_value get keywords list of keywords separated by space comma or semicolon public string get keywords return string get value keywords getkeywords get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set rating classification or importance public void set rating int rating set value rating new integer rating setrating set_value get rating classification or importance public int get rating integer ii integer get value rating if ii null return 0 return ii int value getrating get_value intvalue set text message text message public void set text msg string text msg if text msg null throw new illegal argument exception text msg is mandatory if text msg length 2000 log warning length 2000 truncated text msg text msg substring 0 1999 set value text msg text msg settextmsg textmsg textmsg illegalargumentexception textmsg textmsg textmsg textmsg set_value textmsg textmsg get text message text message public string get text msg return string get value text msg gettextmsg get_value textmsg set valid to valid to including this date last day public void set valid to timestamp valid to set value valid to valid to setvalidto validto set_value validto validto get valid to valid to including this date last day public timestamp get valid to return timestamp get value valid to getvalidto get_value validto order header change doc type invoice ruld delivery rule payment rule temporary document context doc sub typeso has charges re sets business partner info of required param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string doc type properties ctx int window no m tab m tab m field m field object value integer c doctype id integer value actually c doctypetarget id if c doctype id null c doctype id int value 0 return re create new doc no if there is a doc number already and the existing source used a different sequence number string old doc no string m tab get value document no boolean new doc no old doc no null if new doc no old doc no starts with old doc no ends with new doc no true integer oldc doctype id integer m tab get value c doctype id string sql select d doc sub typeso d has charges n 1 3 d is doc no controlled s current next s current next sys 4 6 s ad sequence id d isso trx 7 8 from c doctype d ad sequence s where c doctype id 1 and d docnosequence id s ad sequence id try int ad sequence id 0 get old ad seqno for comparison if new doc no oldc doctype id int value 0 prepared statement pstmt db prepare statement sql null pstmt set int 1 oldc doctype id int value result set rs pstmt execute query if rs next ad sequence id rs get int 6 rs close pstmt close prepared statement pstmt db prepare statement sql null pstmt set int 1 c doctype id int value result set rs pstmt execute query string doc sub typeso boolean isso trx true if rs next we found document type set context document sub type for sales orders doc sub typeso rs get string 1 if doc sub typeso null doc sub typeso env set context ctx window no order type doc sub typeso no drop ship other than standard if doc sub typeso equals m order docsubtypeso standard m tab set value is drop ship n delivery rule if doc sub typeso equals m order docsubtypeso pos m tab set value delivery rule m order deliveryrule force else if doc sub typeso equals m order docsubtypeso prepay m tab set value delivery rule m order deliveryrule afterreceipt else m tab set value delivery rule m order deliveryrule availability invoice rule if doc sub typeso equals m order docsubtypeso pos doc sub typeso equals m order docsubtypeso prepay doc sub typeso equals m order docsubtypeso oncredit m tab set value invoice rule m order invoicerule immediate else m tab set value invoice rule m order invoicerule afterdelivery payment rule pos order if doc sub typeso equals m order docsubtypeso pos m tab set value payment rule m order paymentrule cash else m tab set value payment rule m order paymentrule oncredit isso trx if n equals rs get string 8 isso trx false set context env set context ctx window no has charges rs get string 2 document no if rs get string 4 equals y is doc no controlled if new doc no ad sequence id rs get int 7 new doc no true if new doc no if ini is property bool ini p compieresys env getad client id env get ctx 1000000 m tab set value document no rs get string 6 else m tab set value document no rs get string 5 rs close pstmt close when b partner is changed the rules are not set if it is a pos or credit order i e defaults from standard b partner this re reads the rules and applies them if doc sub typeso equals m order docsubtypeso pos doc sub typeso equals m order docsubtypeso prepay not for pos pre pay else sql select payment rule c paymentterm id 1 2 invoice rule delivery rule 3 4 freight cost rule delivery via rule 5 6 payment rulepo po paymentterm id from c bpartner where c bpartner id 1 pstmt db prepare statement sql null int c bpartner id env get context as int ctx window no c bpartner id pstmt set int 1 c bpartner id rs pstmt execute query if rs next payment rule string s rs get string isso trx payment rule payment rulepo if s null s length 0 if isso trx s equals b s equals s s equals u no cash check transfer for so trx s p payment term if isso trx s equals b no cash for po trx s p payment term m tab set value payment rule s payment term integer ii new integer rs get int isso trx c paymentterm id po paymentterm id if rs was null m tab set value c paymentterm id ii invoice rule s rs get string 3 if s null s length 0 m tab set value invoice rule s delivery rule s rs get string 4 if s null s length 0 m tab set value delivery rule s freight cost rule s rs get string 5 if s null s length 0 m tab set value freight cost rule s delivery via rule s rs get string 6 if s null s length 0 m tab set value delivery via rule s rs close pstmt close re read customer rules catch sql exception e log log level severe sql e return e get localized message return doctype invoiceruld deliveryrule paymentrule docsubtypeso hascharges windowno mtab mfield doctype windowno mtab mtab mfield mfield c_doctype_id c_doctypetarget_id c_doctype_id c_doctype_id intvalue docno olddocno mtab getvalue documentno newdocno olddocno newdocno olddocno startswith olddocno endswith newdocno oldc_doctype_id mtab getvalue c_doctype_id docsubtypeso hascharges isdocnocontrolled currentnext currentnextsys ad_sequence_id issotrx c_doctype ad_sequence c_doctype_id docnosequence_id ad_sequence_id ad_sequence_id ad_seqno newdocno oldc_doctype_id intvalue preparedstatement preparestatement setint oldc_doctype_id intvalue resultset executequery ad_sequence_id getint preparedstatement preparestatement setint c_doctype_id intvalue resultset executequery docsubtypeso issotrx docsubtypeso getstring docsubtypeso docsubtypeso setcontext windowno ordertype docsubtypeso docsubtypeso morder docsubtypeso_standard mtab setvalue isdropship docsubtypeso morder docsubtypeso_pos mtab setvalue deliveryrule morder deliveryrule_force docsubtypeso morder docsubtypeso_prepay mtab setvalue deliveryrule morder deliveryrule_afterreceipt mtab setvalue deliveryrule morder deliveryrule_availability docsubtypeso morder docsubtypeso_pos docsubtypeso morder docsubtypeso_prepay docsubtypeso morder docsubtypeso_oncredit mtab setvalue invoicerule morder invoicerule_immediate mtab setvalue invoicerule morder invoicerule_afterdelivery docsubtypeso morder docsubtypeso_pos mtab setvalue paymentrule morder paymentrule_cash mtab setvalue paymentrule morder paymentrule_oncredit issotrx getstring issotrx setcontext windowno hascharges getstring documentno getstring isdocnocontrolled newdocno ad_sequence_id getint newdocno newdocno ispropertybool p_compieresys getad_client_id getctx mtab setvalue documentno getstring mtab setvalue documentno getstring bpartner bpartner docsubtypeso morder docsubtypeso_pos docsubtypeso morder docsubtypeso_prepay prepay paymentrule c_paymentterm_id invoicerule deliveryrule freightcostrule deliveryviarule paymentrulepo po_paymentterm_id c_bpartner c_bpartner_id preparestatement c_bpartner_id getcontextasint windowno c_bpartner_id setint c_bpartner_id executequery paymentrule getstring issotrx paymentrule paymentrulepo issotrx so_trx issotrx po_trx mtab setvalue paymentrule getint issotrx c_paymentterm_id po_paymentterm_id wasnull mtab setvalue c_paymentterm_id invoicerule getstring mtab setvalue invoicerule deliveryrule getstring mtab setvalue deliveryrule freightcostrule getstring mtab setvalue freightcostrule deliveryviarule getstring mtab setvalue deliveryviarule sqlexception getlocalizedmessage order header b partner m pricelist id context c bpartner location id bill bpartner id bill location id ad user id po reference so description is discount printed invoice rule delivery rule payment rule freight cost delivery via rule c paymentterm id param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string b partner properties ctx int window no m tab m tab m field m field object value integer c bpartner id integer value if c bpartner id null c bpartner id int value 0 return set callout active true string sql select p ad language p c paymentterm id coalesce p m pricelist id g m pricelist id as m pricelist id p payment rule p po reference p so description p is discount printed p invoice rule p delivery rule p freight cost rule delivery via rule p so creditlimit p so creditlimit p so creditused as credit available lship c bpartner location id c ad user id coalesce p po pricelist id g po pricelist id as po pricelist id p payment rulepo p po paymentterm id lbill c bpartner location id as bill location id p so credit status from c bpartner p inner join c bp group g on p c bp group id g c bp group id left outer join c bpartner location lbill on p c bpartner id lbill c bpartner id and lbill is bill to y and lbill is active y left outer join c bpartner location lship on p c bpartner id lship c bpartner id and lship is ship to y and lship is active y left outer join ad user c on p c bpartner id c c bpartner id where p c bpartner id and p is active y 1 boolean isso trx y equals env get context ctx window no isso trx try prepared statement pstmt db prepare statement sql null pstmt set int 1 c bpartner id int value result set rs pstmt execute query if rs next price list indirect is tax included currency integer ii new integer rs get int isso trx m pricelist id po pricelist id if rs was null m tab set value m pricelist id ii else get default price list int i env get context as int ctx m pricelist id if i 0 m tab set value m pricelist id new integer i bill to m tab set value bill bpartner id c bpartner id int bill location id rs get int bill location id if bill location id 0 m tab set value bill location id null else m tab set value bill location id new integer bill location id ship to location int shipto id rs get int c bpartner location id overwritten by infobp selection works only if info window was used otherwise creates error uses last value may belong to differnt bp if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string loc env get context ctx env window info env tab info c bpartner location id if loc length 0 shipto id integer parse int loc if shipto id 0 m tab set value c bpartner location id null else m tab set value c bpartner location id new integer shipto id contact overwritten by infobp selection int contid rs get int ad user id if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string cont env get context ctx env window info env tab info ad user id if cont length 0 contid integer parse int cont if contid 0 m tab set value ad user id null else m tab set value ad user id new integer contid m tab set value bill user id new integer contid credit available if isso trx double credit limit rs get double so creditlimit string so credit status rs get string so credit status if credit limit 0 double credit available rs get double credit available if rs was null credit available 0 m tab fire data statuse event credit limit over display type get number format display type amount format credit available false po reference string s rs get string po reference if s null s length 0 m tab set value po reference s else m tab set value po reference null so description s rs get string so description if s null s trim length 0 m tab set value description s is discount printed s rs get string is discount printed if s null s length 0 m tab set value is discount printed s else m tab set value is discount printed n defaults if not walkin receipt or walkin invoice string order type env get context ctx window no order type m tab set value invoice rule m order invoicerule afterdelivery m tab set value delivery rule m order deliveryrule availability m tab set value payment rule m order paymentrule oncredit if order type equals m order docsubtypeso prepay m tab set value invoice rule m order invoicerule immediate m tab set value delivery rule m order deliveryrule afterreceipt else if order type equals m order docsubtypeso pos for pos m tab set value payment rule m order paymentrule cash else payment rule s rs get string isso trx payment rule payment rulepo if s null s length 0 if s equals b no cache in non pos s p if isso trx s equals s s equals u no check transfer for so trx s p payment term m tab set value payment rule s payment term ii new integer rs get int isso trx c paymentterm id po paymentterm id if rs was null m tab set value c paymentterm id ii invoice rule s rs get string invoice rule if s null s length 0 m tab set value invoice rule s delivery rule s rs get string delivery rule if s null s length 0 m tab set value delivery rule s freight cost rule s rs get string freight cost rule if s null s length 0 m tab set value freight cost rule s delivery via rule s rs get string delivery via rule if s null s length 0 m tab set value delivery via rule s rs close pstmt close catch sql exception e log log level severe sql e set callout active false return e get localized message set callout active false return bpartner m_pricelist_id c_bpartner_location_id bill_bpartner_id bill_location_id ad_user_id poreference so_description isdiscountprinted invoicerule deliveryrule paymentrule freightcost deliveryviarule c_paymentterm_id windowno mtab mfield bpartner windowno mtab mtab mfield mfield c_bpartner_id c_bpartner_id c_bpartner_id intvalue setcalloutactive ad_language c_paymentterm_id m_pricelist_id m_pricelist_id m_pricelist_id paymentrule poreference so_description isdiscountprinted invoicerule deliveryrule freightcostrule deliveryviarule so_creditlimit so_creditlimit so_creditused creditavailable c_bpartner_location_id ad_user_id po_pricelist_id po_pricelist_id po_pricelist_id paymentrulepo po_paymentterm_id c_bpartner_location_id bill_location_id socreditstatus c_bpartner c_bp_group c_bp_group_id c_bp_group_id c_bpartner_location c_bpartner_id c_bpartner_id isbillto isactive c_bpartner_location c_bpartner_id c_bpartner_id isshipto isactive ad_user c_bpartner_id c_bpartner_id c_bpartner_id isactive issotrx getcontext windowno issotrx preparedstatement preparestatement setint c_bpartner_id intvalue resultset executequery pricelist istaxincluded getint issotrx m_pricelist_id po_pricelist_id wasnull mtab setvalue m_pricelist_id pricelist getcontextasint m_pricelist_id mtab setvalue m_pricelist_id mtab setvalue bill_bpartner_id c_bpartner_id bill_location_id getint bill_location_id bill_location_id mtab setvalue bill_location_id mtab setvalue bill_location_id bill_location_id shipto_id getint c_bpartner_location_id infowindow c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info c_bpartner_location_id shipto_id parseint shipto_id mtab setvalue c_bpartner_location_id mtab setvalue c_bpartner_location_id shipto_id getint ad_user_id c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info ad_user_id parseint mtab setvalue ad_user_id mtab setvalue ad_user_id mtab setvalue bill_user_id creditavailable issotrx creditlimit getdouble so_creditlimit socreditstatus getstring socreditstatus creditlimit creditavailable getdouble creditavailable wasnull creditavailable mtab firedatastatuseevent creditlimitover displaytype getnumberformat displaytype creditavailable getstring poreference mtab setvalue poreference mtab setvalue poreference getstring so_description mtab setvalue isdiscountprinted getstring isdiscountprinted mtab setvalue isdiscountprinted mtab setvalue isdiscountprinted ordertype getcontext windowno ordertype mtab setvalue invoicerule morder invoicerule_afterdelivery mtab setvalue deliveryrule morder deliveryrule_availability mtab setvalue paymentrule morder paymentrule_oncredit ordertype morder docsubtypeso_prepay mtab setvalue invoicerule morder invoicerule_immediate mtab setvalue deliveryrule morder deliveryrule_afterreceipt ordertype morder docsubtypeso_pos mtab setvalue paymentrule morder paymentrule_cash paymentrule getstring issotrx paymentrule paymentrulepo issotrx so_trx mtab setvalue paymentrule getint issotrx c_paymentterm_id po_paymentterm_id wasnull mtab setvalue c_paymentterm_id invoicerule getstring invoicerule mtab setvalue invoicerule deliveryrule getstring deliveryrule mtab setvalue deliveryrule freightcostrule getstring freightcostrule mtab setvalue freightcostrule deliveryviarule getstring deliveryviarule mtab setvalue deliveryviarule sqlexception setcalloutactive getlocalizedmessage setcalloutactive order header invoice b partner m pricelist id context bill location id bill user id po reference so description is discount printed invoice rule payment rule c paymentterm id param ctx context param window no current window no param m tab model tab param m field model field param value the new value return error message or public string b partner bill properties ctx int window no m tab m tab m field m field object value if is callout active return integer bill bpartner id integer value if bill bpartner id null bill bpartner id int value 0 return string sql select p ad language p c paymentterm id p m pricelist id p payment rule p po reference p so description p is discount printed p invoice rule p delivery rule p freight cost rule delivery via rule p so creditlimit p so creditlimit p so creditused as credit available c ad user id p po pricelist id p payment rulepo p po paymentterm id lbill c bpartner location id as bill location id from c bpartner p left outer join c bpartner location lbill on p c bpartner id lbill c bpartner id and lbill is bill to y and lbill is active y left outer join ad user c on p c bpartner id c c bpartner id where p c bpartner id and p is active y 1 boolean isso trx y equals env get context ctx window no isso trx try prepared statement pstmt db prepare statement sql null pstmt set int 1 bill bpartner id int value result set rs pstmt execute query if rs next price list indirect is tax included currency integer ii new integer rs get int isso trx m pricelist id po pricelist id if rs was null m tab set value m pricelist id ii else get default price list int i env get context as int ctx m pricelist id if i 0 m tab set value m pricelist id new integer i int bill location id rs get int bill location id overwritten by infobp selection works only if info window was used otherwise creates error uses last value may belong to differnt bp if bill bpartner id to string equals env get context ctx env window info env tab info c bpartner id string loc env get context ctx env window info env tab info c bpartner location id if loc length 0 bill location id integer parse int loc if bill location id 0 m tab set value bill location id null else m tab set value bill location id new integer bill location id contact overwritten by infobp selection int contid rs get int ad user id if bill bpartner id to string equals env get context ctx env window info env tab info c bpartner id string cont env get context ctx env window info env tab info ad user id if cont length 0 contid integer parse int cont if contid 0 m tab set value bill user id null else m tab set value bill user id new integer contid credit available if isso trx double credit limit rs get double so creditlimit if credit limit 0 double credit available rs get double credit available if rs was null credit available 0 m tab fire data statuse event credit limit over display type get number format display type amount format credit available false po reference string s rs get string po reference if s null s length 0 m tab set value po reference s else m tab set value po reference null so description s rs get string so description if s null s trim length 0 m tab set value description s is discount printed s rs get string is discount printed if s null s length 0 m tab set value is discount printed s else m tab set value is discount printed n defaults if not walkin receipt or walkin invoice string order type env get context ctx window no order type m tab set value invoice rule m order invoicerule afterdelivery m tab set value payment rule m order paymentrule oncredit if order type equals m order docsubtypeso prepay m tab set value invoice rule m order invoicerule immediate else if order type equals m order docsubtypeso pos for pos m tab set value payment rule m order paymentrule cash else payment rule s rs get string isso trx payment rule payment rulepo if s null s length 0 if s equals b no cache in non pos s p if isso trx s equals s s equals u no check transfer for so trx s p payment term m tab set value payment rule s payment term ii new integer rs get int isso trx c paymentterm id po paymentterm id if rs was null m tab set value c paymentterm id ii invoice rule s rs get string invoice rule if s null s length 0 m tab set value invoice rule s rs close pstmt close catch sql exception e log log level severe b partner bill e return e get localized message return bpartner m_pricelist_id bill_location_id bill_user_id poreference so_description isdiscountprinted invoicerule paymentrule c_paymentterm_id windowno mtab mfield bpartnerbill windowno mtab mtab mfield mfield iscalloutactive bill_bpartner_id bill_bpartner_id bill_bpartner_id intvalue ad_language c_paymentterm_id m_pricelist_id paymentrule poreference so_description isdiscountprinted invoicerule deliveryrule freightcostrule deliveryviarule so_creditlimit so_creditlimit so_creditused creditavailable ad_user_id po_pricelist_id paymentrulepo po_paymentterm_id c_bpartner_location_id bill_location_id c_bpartner c_bpartner_location c_bpartner_id c_bpartner_id isbillto isactive ad_user c_bpartner_id c_bpartner_id c_bpartner_id isactive issotrx getcontext windowno issotrx preparedstatement preparestatement setint bill_bpartner_id intvalue resultset executequery pricelist istaxincluded getint issotrx m_pricelist_id po_pricelist_id wasnull mtab setvalue m_pricelist_id pricelist getcontextasint m_pricelist_id mtab setvalue m_pricelist_id bill_location_id getint bill_location_id infowindow bill_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info c_bpartner_location_id bill_location_id parseint bill_location_id mtab setvalue bill_location_id mtab setvalue bill_location_id bill_location_id getint ad_user_id bill_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info ad_user_id parseint mtab setvalue bill_user_id mtab setvalue bill_user_id creditavailable issotrx creditlimit getdouble so_creditlimit creditlimit creditavailable getdouble creditavailable wasnull creditavailable mtab firedatastatuseevent creditlimitover displaytype getnumberformat displaytype creditavailable getstring poreference mtab setvalue poreference mtab setvalue poreference getstring so_description mtab setvalue isdiscountprinted getstring isdiscountprinted mtab setvalue isdiscountprinted mtab setvalue isdiscountprinted ordertype getcontext windowno ordertype mtab setvalue invoicerule morder invoicerule_afterdelivery mtab setvalue paymentrule morder paymentrule_oncredit ordertype morder docsubtypeso_prepay mtab setvalue invoicerule morder invoicerule_immediate ordertype morder docsubtypeso_pos mtab setvalue paymentrule morder paymentrule_cash paymentrule getstring issotrx paymentrule paymentrulepo issotrx so_trx mtab setvalue paymentrule getint issotrx c_paymentterm_id po_paymentterm_id wasnull mtab setvalue c_paymentterm_id invoicerule getstring invoicerule mtab setvalue invoicerule sqlexception bpartnerbill getlocalizedmessage order header price list used also in invoice c currency id is tax included window context enforce price limit std precision m pricelist version id param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string price list properties ctx int window no m tab m tab m field m field object value integer m pricelist id integer value if m pricelist id null m pricelist id int value 0 return if steps log warning init string sql select pl is tax included pl enforce price limit pl c currency id c std precision plv m pricelist version id plv valid from from m pricelist pl c currency c m pricelist version plv where pl c currency id c c currency id and pl m pricelist id plv m pricelist id and pl m pricelist id 1 order by plv valid from desc use newest price list may not be future try prepared statement pstmt db prepare statement sql null pstmt set int 1 m pricelist id int value result set rs pstmt execute query if rs next tax included m tab set value is tax included new boolean y equals rs get string 1 price limit enforce env set context ctx window no enforce price limit rs get string 2 currency integer ii new integer rs get int 3 m tab set value c currency id ii price list version env set context ctx window no m pricelist version id rs get int 5 rs close pstmt close catch sql exception e log log level severe sql e return e get localized message if steps log warning fini return pricelist c_currency_id istaxincluded enforcepricelimit stdprecision m_pricelist_version_id windowno mtab mfield pricelist windowno mtab mtab mfield mfield m_pricelist_id m_pricelist_id m_pricelist_id intvalue istaxincluded enforcepricelimit c_currency_id stdprecision m_pricelist_version_id validfrom m_pricelist c_currency m_pricelist_version c_currency_id c_currency_id m_pricelist_id m_pricelist_id m_pricelist_id validfrom preparedstatement preparestatement setint m_pricelist_id intvalue resultset executequery mtab setvalue istaxincluded getstring setcontext windowno enforcepricelimit getstring getint mtab setvalue c_currency_id pricelist setcontext windowno m_pricelist_version_id getint sqlexception getlocalizedmessage order line product reset c charge id m attributesetinstance id price list price std price limit c currency id enforce price limit uom calls tax param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set callout active true if steps log warning init m tab set value c charge id null set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null price calculation see also qty int c bpartner id env get context as int ctx window no c bpartner id big decimal qty big decimal m tab get value qty ordered boolean isso trx env get context ctx window no isso trx equals y m product pricing pp new m product pricing m product id int value c bpartner id qty isso trx int m pricelist id env get context as int ctx window no m pricelist id pp setm pricelist id m pricelist id plv is only accurate if pl selected in header int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp order date timestamp m tab get value date ordered pp set price date order date m tab set value price list pp get price list m tab set value price limit pp get price limit m tab set value price actual pp get price std m tab set value price entered pp get price std m tab set value c currency id new integer pp getc currency id m tab set value discount pp get discount m tab set value c uom id new integer pp getc uom id m tab set value qty ordered m tab get value qty entered env set context ctx window no enforce price limit pp is enforce price limit y n env set context ctx window no discount schema pp is discount schema y n check update warehouse setting int m warehouse id env get context as int ctx env window info m warehouse id integer wh integer m tab get value m warehouse id if wh int value m warehouse id m tab set value m warehouse id new integer m warehouse id a dialog warn window no warehouse changed if env isso trx ctx window no m product product m product get ctx m product id int value if product is stocked big decimal qty ordered big decimal m tab get value qty ordered int m warehouse id env get context as int ctx window no m warehouse id int m attributesetinstance id env get context as int ctx window no m attributesetinstance id big decimal available m storage get qty available m warehouse id m product id int value m attributesetinstance id null if available null available env zero if available signum 0 m tab fire data statuse event no qty available 0 false else if available compare to qty ordered 0 m tab fire data statuse event insufficient qty available available to string false else integer c orderline id integer m tab get value c orderline id if c orderline id null c orderline id new integer 0 big decimal not reserved m order line get not reserved ctx m warehouse id m product id m attributesetinstance id c orderline id int value if not reserved null not reserved env zero big decimal total available subtract not reserved if total compare to qty ordered 0 string info msg parse translation ctx qty available available qty not reserved not reserved total m tab fire data statuse event insufficient qty available info false set callout active false if steps log warning fini return tax ctx window no m tab m field value c_charge_id m_attributesetinstance_id pricelist pricestd pricelimit c_currency_id enforcepricelimit windowno mtab mfield windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue setcalloutactive mtab setvalue c_charge_id getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id c_bpartner_id getcontextasint windowno c_bpartner_id bigdecimal bigdecimal mtab getvalue qtyordered issotrx getcontext windowno issotrx mproductpricing mproductpricing m_product_id intvalue c_bpartner_id issotrx m_pricelist_id getcontextasint windowno m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id orderdate mtab getvalue dateordered setpricedate orderdate mtab setvalue pricelist getpricelist mtab setvalue pricelimit getpricelimit mtab setvalue priceactual getpricestd mtab setvalue priceentered getpricestd mtab setvalue c_currency_id getc_currency_id mtab setvalue getdiscount mtab setvalue c_uom_id getc_uom_id mtab setvalue qtyordered mtab getvalue qtyentered setcontext windowno enforcepricelimit isenforcepricelimit setcontext windowno discountschema isdiscountschema m_warehouse_id getcontextasint window_info m_warehouse_id mtab getvalue m_warehouse_id intvalue m_warehouse_id mtab setvalue m_warehouse_id m_warehouse_id adialog windowno warehousechanged issotrx windowno mproduct mproduct m_product_id intvalue isstocked bigdecimal qtyordered bigdecimal mtab getvalue qtyordered m_warehouse_id getcontextasint windowno m_warehouse_id m_attributesetinstance_id getcontextasint windowno m_attributesetinstance_id bigdecimal mstorage getqtyavailable m_warehouse_id m_product_id intvalue m_attributesetinstance_id mtab firedatastatuseevent noqtyavailable compareto qtyordered mtab firedatastatuseevent insufficientqtyavailable tostring c_orderline_id mtab getvalue c_orderline_id c_orderline_id c_orderline_id bigdecimal notreserved morderline getnotreserved m_warehouse_id m_product_id m_attributesetinstance_id c_orderline_id intvalue notreserved notreserved bigdecimal notreserved compareto qtyordered parsetranslation qtyavailable qtynotreserved notreserved mtab firedatastatuseevent insufficientqtyavailable setcalloutactive windowno mtab mfield order line charge updates price actual from charge sets price limit price list to zero calles tax param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string charge properties ctx int window no m tab m tab m field m field object value integer c charge id integer value if c charge id null c charge id int value 0 return no product defined if m tab get value m product id null m tab set value c charge id null return charge exclusively m tab set value m attributesetinstance id null m tab set value s resourceassignment id null m tab set value c uom id new integer 100 ea env set context ctx window no discount schema n string sql select charge amt from c charge where c charge id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c charge id int value result set rs pstmt execute query if rs next m tab set value price entered rs get big decimal 1 m tab set value price actual rs get big decimal 1 m tab set value price limit env zero m tab set value price list env zero m tab set value discount env zero rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return tax ctx window no m tab m field value priceactual pricelimit pricelist windowno mtab mfield windowno mtab mtab mfield mfield c_charge_id c_charge_id c_charge_id intvalue mtab getvalue m_product_id mtab setvalue c_charge_id chargeexclusively mtab setvalue m_attributesetinstance_id mtab setvalue s_resourceassignment_id mtab setvalue c_uom_id setcontext windowno discountschema chargeamt c_charge c_charge_id preparedstatement preparestatement setint c_charge_id intvalue resultset executequery mtab setvalue priceentered getbigdecimal mtab setvalue priceactual getbigdecimal mtab setvalue pricelimit mtab setvalue pricelist mtab setvalue sqlexception getlocalizedmessage windowno mtab mfield order line tax basis product charge b partner location sets c tax id calles amount param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string tax properties ctx int window no m tab m tab m field m field object value string column m field get column name if value null return if steps log warning init check product int m product id 0 if column equals m product id m product id integer value int value else m product id env get context as int ctx window no m product id int c charge id 0 if column equals c charge id c charge id integer value int value else c charge id env get context as int ctx window no c charge id log fine product m product id c charge id c charge id if m product id 0 c charge id 0 return amt ctx window no m tab m field value check partner location int shipc bpartner location id 0 if column equals c bpartner location id shipc bpartner location id integer value int value else shipc bpartner location id env get context as int ctx window no c bpartner location id if shipc bpartner location id 0 return amt ctx window no m tab m field value log fine ship bp location shipc bpartner location id timestamp bill date env get context as date ctx window no date ordered log fine bill date bill date timestamp ship date env get context as date ctx window no date promised log fine ship date ship date int ad org id env get context as int ctx window no ad org id log fine org ad org id int m warehouse id env get context as int ctx window no m warehouse id log fine warehouse m warehouse id int billc bpartner location id env get context as int ctx window no bill location id if billc bpartner location id 0 billc bpartner location id shipc bpartner location id log fine bill bp location billc bpartner location id int c tax id tax get ctx m product id c charge id bill date ship date ad org id m warehouse id billc bpartner location id shipc bpartner location id y equals env get context ctx window no isso trx log info tax id c tax id if c tax id 0 m tab fire data statuse event c logger retrieve error else m tab set value c tax id new integer c tax id if steps log warning fini return amt ctx window no m tab m field value bpartner c_tax_id windowno mtab mfield windowno mtab mtab mfield mfield mfield getcolumnname m_product_id m_product_id m_product_id intvalue m_product_id getcontextasint windowno m_product_id c_charge_id c_charge_id c_charge_id intvalue c_charge_id getcontextasint windowno c_charge_id m_product_id c_charge_id c_charge_id m_product_id c_charge_id windowno mtab mfield shipc_bpartner_location_id c_bpartner_location_id shipc_bpartner_location_id intvalue shipc_bpartner_location_id getcontextasint windowno c_bpartner_location_id shipc_bpartner_location_id windowno mtab mfield bp_location shipc_bpartner_location_id billdate getcontextasdate windowno dateordered billdate shipdate getcontextasdate windowno datepromised shipdate ad_org_id getcontextasint windowno ad_org_id ad_org_id m_warehouse_id getcontextasint windowno m_warehouse_id m_warehouse_id billc_bpartner_location_id getcontextasint windowno bill_location_id billc_bpartner_location_id billc_bpartner_location_id shipc_bpartner_location_id bp_location billc_bpartner_location_id c_tax_id m_product_id c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id getcontext windowno issotrx c_tax_id c_tax_id mtab firedatastatuseevent clogger retrieveerror mtab setvalue c_tax_id c_tax_id windowno mtab mfield order line amount called from qty ordered discount and price actual calculates discount or actual amount calculates line net amt enforces price limit param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string amt properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true if steps log warning init int c uom to id env get context as int ctx window no c uom id int m product id env get context as int ctx window no m product id int m pricelist id env get context as int ctx window no m pricelist id int std precision m price list get standard precision ctx m pricelist id big decimal qty entered qty ordered price entered price actual price limit discount price list get values qty entered big decimal m tab get value qty entered qty ordered big decimal m tab get value qty ordered log fine qty entered qty entered ordered qty ordered uom c uom to id price entered big decimal m tab get value price entered price actual big decimal m tab get value price actual discount big decimal m tab get value discount price limit big decimal m tab get value price limit price list big decimal m tab get value price list log fine price list price list limit price limit precision std precision log fine price entered price entered actual price actual discount discount qty changed recalc price if m field get column name equals qty ordered m field get column name equals qty entered m field get column name equals m product id n equals env get context ctx window no discount schema int c bpartner id env get context as int ctx window no c bpartner id if m field get column name equals qty entered qty ordered muom conversion convert product to ctx m product id c uom to id qty entered if qty ordered null qty ordered qty entered boolean isso trx env get context ctx window no isso trx equals y m product pricing pp new m product pricing m product id c bpartner id qty ordered isso trx pp setm pricelist id m pricelist id int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp date timestamp m tab get value date ordered pp set price date date price entered muom conversion convert product from ctx m product id c uom to id pp get price std if price entered null price entered pp get price std log fine qty changed price actual pp get price std price entered price entered discount pp get discount m tab set value price actual pp get price std m tab set value discount pp get discount m tab set value price entered price entered env set context ctx window no discount schema pp is discount schema y n else if m field get column name equals price actual price actual big decimal value price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual log fine price actual price actual price entered price entered m tab set value price entered price entered else if m field get column name equals price entered price entered big decimal value price actual muom conversion convert product to ctx m product id c uom to id price entered if price actual null price actual price entered log fine price entered price entered price actual price actual m tab set value price actual price actual discount entered calculate actual entered if m field get column name equals discount price actual new big decimal 100 0 discount double value 100 0 price list double value if price actual scale std precision price actual price actual set scale std precision big decimal round half up price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual m tab set value price actual price actual m tab set value price entered price entered calculate discount else if price list int value 0 discount env zero else discount new big decimal price list double value price actual double value price list double value 100 0 if discount scale 2 discount discount set scale 2 big decimal round half up m tab set value discount discount log fine price entered price entered actual price actual discount discount check price limit string epl env get context ctx window no enforce price limit boolean enforce env isso trx ctx window no epl null epl equals y if enforce m role get default is overwrite price limit enforce false check price limit if enforce price limit double value 0 0 price actual compare to price limit 0 price actual price limit price entered muom conversion convert product from ctx m product id c uom to id price limit if price entered null price entered price limit log fine under price entered price entered actual price limit m tab set value price actual price limit m tab set value price entered price entered m tab fire data statuse event under limit price false repeat discount calc if price list int value 0 discount new big decimal price list double value price actual double value price list double value 100 0 if discount scale 2 discount discount set scale 2 big decimal round half up m tab set value discount discount line net amt big decimal line net amt qty ordered multiply price actual if line net amt scale std precision line net amt line net amt set scale std precision big decimal round half up log info line net amt line net amt m tab set value line net amt line net amt set callout active false return qtyordered priceactual linenetamt pricelimit windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive c_uom_to_id getcontextasint windowno c_uom_id m_product_id getcontextasint windowno m_product_id m_pricelist_id getcontextasint windowno m_pricelist_id stdprecision mpricelist getstandardprecision m_pricelist_id bigdecimal qtyentered qtyordered priceentered priceactual pricelimit pricelist qtyentered bigdecimal mtab getvalue qtyentered qtyordered bigdecimal mtab getvalue qtyordered qtyentered qtyentered qtyordered c_uom_to_id priceentered bigdecimal mtab getvalue priceentered priceactual bigdecimal mtab getvalue priceactual bigdecimal mtab getvalue pricelimit bigdecimal mtab getvalue pricelimit pricelist bigdecimal mtab getvalue pricelist pricelist pricelist pricelimit stdprecision priceentered priceentered priceactual mfield getcolumnname qtyordered mfield getcolumnname qtyentered mfield getcolumnname m_product_id getcontext windowno discountschema c_bpartner_id getcontextasint windowno c_bpartner_id mfield getcolumnname qtyentered qtyordered muomconversion convertproductto m_product_id c_uom_to_id qtyentered qtyordered qtyordered qtyentered issotrx getcontext windowno issotrx mproductpricing mproductpricing m_product_id c_bpartner_id qtyordered issotrx setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id mtab getvalue dateordered setpricedate priceentered muomconversion convertproductfrom m_product_id c_uom_to_id getpricestd priceentered priceentered getpricestd qtychanged priceactual getpricestd priceentered priceentered getdiscount mtab setvalue priceactual getpricestd mtab setvalue getdiscount mtab setvalue priceentered priceentered setcontext windowno discountschema isdiscountschema mfield getcolumnname priceactual priceactual bigdecimal priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual priceactual priceactual priceentered priceentered mtab setvalue priceentered priceentered mfield getcolumnname priceentered priceentered bigdecimal priceactual muomconversion convertproductto m_product_id c_uom_to_id priceentered priceactual priceactual priceentered priceentered priceentered priceactual priceactual mtab setvalue priceactual priceactual mfield getcolumnname priceactual bigdecimal doublevalue pricelist doublevalue priceactual stdprecision priceactual priceactual setscale stdprecision bigdecimal round_half_up priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual mtab setvalue priceactual priceactual mtab setvalue priceentered priceentered pricelist intvalue bigdecimal pricelist doublevalue priceactual doublevalue pricelist doublevalue setscale bigdecimal round_half_up mtab setvalue priceentered priceentered priceactual pricelimit getcontext windowno enforcepricelimit issotrx windowno mrole getdefault isoverwritepricelimit pricelimit doublevalue priceactual compareto pricelimit priceactual pricelimit priceentered muomconversion convertproductfrom m_product_id c_uom_to_id pricelimit priceentered priceentered pricelimit priceentered priceentered pricelimit mtab setvalue priceactual pricelimit mtab setvalue priceentered priceentered mtab firedatastatuseevent underlimitprice pricelist intvalue bigdecimal pricelist doublevalue priceactual doublevalue pricelist doublevalue setscale bigdecimal round_half_up mtab setvalue bigdecimal linenetamt qtyordered priceactual linenetamt stdprecision linenetamt linenetamt setscale stdprecision bigdecimal round_half_up linenetamt linenetamt mtab setvalue linenetamt linenetamt setcalloutactive order line quantity called from c uom id qty entered qty ordered enforces qty uom relationship param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string qty properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true int m product id env get context as int ctx window no m product id if steps log warning init m product id m product id big decimal qty ordered env zero big decimal qty entered price actual price entered no product if m product id 0 qty entered big decimal m tab get value qty entered qty ordered qty entered m tab set value qty ordered qty ordered uom changed convert from entered product else if m field get column name equals c uom id int c uom to id integer value int value qty entered big decimal m tab get value qty entered qty ordered muom conversion convert product from ctx m product id c uom to id qty entered if qty ordered null qty ordered qty entered boolean conversion qty entered compare to qty ordered 0 price actual big decimal m tab get value price actual price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual log fine uom c uom to id qty entered price actual qty entered price actual conversion qty ordered price entered qty ordered price entered env set context ctx window no uom conversion conversion y n m tab set value qty ordered qty ordered m tab set value price entered price entered qty entered changed calculate qty ordered else if m field get column name equals qty entered int c uom to id env get context as int ctx window no c uom id qty entered big decimal value qty ordered muom conversion convert product from ctx m product id c uom to id qty entered if qty ordered null qty ordered qty entered boolean conversion qty entered compare to qty ordered 0 log fine uom c uom to id qty entered qty entered conversion qty ordered qty ordered env set context ctx window no uom conversion conversion y n m tab set value qty ordered qty ordered qty ordered changed calculate qty entered else if m field get column name equals qty ordered int c uom to id env get context as int ctx window no c uom id qty ordered big decimal value qty entered muom conversion convert product to ctx m product id c uom to id qty ordered if qty entered null qty entered qty ordered boolean conversion qty ordered compare to qty entered 0 log fine uom c uom to id qty ordered qty ordered conversion qty entered qty entered env set context ctx window no uom conversion conversion y n m tab set value qty entered qty entered else qty entered big decimal m tab get value qty entered qty ordered big decimal m tab get value qty ordered storage if m product id 0 env isso trx ctx window no qty ordered signum 0 no negative returns m product product m product get ctx m product id if product is stocked int m warehouse id env get context as int ctx window no m warehouse id int m attributesetinstance id env get context as int ctx window no m attributesetinstance id big decimal available m storage get qty available m warehouse id m product id m attributesetinstance id null if available null available env zero if available signum 0 m tab fire data statuse event no qty available 0 false else if available compare to qty ordered 0 m tab fire data statuse event insufficient qty available available to string false else integer c orderline id integer m tab get value c orderline id if c orderline id null c orderline id new integer 0 big decimal not reserved m order line get not reserved ctx m warehouse id m product id m attributesetinstance id c orderline id int value if not reserved null not reserved env zero big decimal total available subtract not reserved if total compare to qty ordered 0 string info msg parse translation ctx qty available available qty not reserved not reserved total m tab fire data statuse event insufficient qty available info false set callout active false return c_uom_id qtyentered qtyordered windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive m_product_id getcontextasint windowno m_product_id m_product_id m_product_id bigdecimal qtyordered bigdecimal qtyentered priceactual priceentered m_product_id qtyentered bigdecimal mtab getvalue qtyentered qtyordered qtyentered mtab setvalue qtyordered qtyordered mfield getcolumnname c_uom_id c_uom_to_id intvalue qtyentered bigdecimal mtab getvalue qtyentered qtyordered muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered qtyordered qtyordered qtyentered qtyentered compareto qtyordered priceactual bigdecimal mtab getvalue priceactual priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual c_uom_to_id qtyentered priceactual qtyentered priceactual qtyordered priceentered qtyordered priceentered setcontext windowno uomconversion mtab setvalue qtyordered qtyordered mtab setvalue priceentered priceentered qtyentered qtyordered mfield getcolumnname qtyentered c_uom_to_id getcontextasint windowno c_uom_id qtyentered bigdecimal qtyordered muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered qtyordered qtyordered qtyentered qtyentered compareto qtyordered c_uom_to_id qtyentered qtyentered qtyordered qtyordered setcontext windowno uomconversion mtab setvalue qtyordered qtyordered qtyordered qtyentered mfield getcolumnname qtyordered c_uom_to_id getcontextasint windowno c_uom_id qtyordered bigdecimal qtyentered muomconversion convertproductto m_product_id c_uom_to_id qtyordered qtyentered qtyentered qtyordered qtyordered compareto qtyentered c_uom_to_id qtyordered qtyordered qtyentered qtyentered setcontext windowno uomconversion mtab setvalue qtyentered qtyentered qtyentered bigdecimal mtab getvalue qtyentered qtyordered bigdecimal mtab getvalue qtyordered m_product_id issotrx windowno qtyordered mproduct mproduct m_product_id isstocked m_warehouse_id getcontextasint windowno m_warehouse_id m_attributesetinstance_id getcontextasint windowno m_attributesetinstance_id bigdecimal mstorage getqtyavailable m_warehouse_id m_product_id m_attributesetinstance_id mtab firedatastatuseevent noqtyavailable compareto qtyordered mtab firedatastatuseevent insufficientqtyavailable tostring c_orderline_id mtab getvalue c_orderline_id c_orderline_id c_orderline_id bigdecimal notreserved morderline getnotreserved m_warehouse_id m_product_id m_attributesetinstance_id c_orderline_id intvalue notreserved notreserved bigdecimal notreserved compareto qtyordered parsetranslation qtyavailable qtynotreserved notreserved mtab firedatastatuseevent insufficientqtyavailable setcalloutactive compiere system error param message message public compiere system error string message super message compieresystemerror compiere system error param message message param detail detail public compiere system error string message object detail super message set detail detail compieresystemerror setdetail compiere system error param message param cause public compiere system error string message throwable cause super message cause compieresystemerror return returns the detail public object get detail return m detail getdetail m_detail param detail the detail to set public void set detail object detail m detail detail setdetail m_detail string representation return info public string to string super to string string buffer sb new string buffer system error sb append get localized message if m detail null sb append append m detail append return sb to string tostring tostring stringbuffer stringbuffer systemerror getlocalizedmessage m_detail m_detail tostring standard constructor param ctx context param r mailtext id id public m mail text properties ctx int r mailtext id string trx name super ctx r mailtext id trx name r_mailtext_id mmailtext r_mailtext_id trxname r_mailtext_id trxname load constructor param ctx context param rs result set param trx name trx public m mail text properties ctx result set rs string trx name super ctx rs trx name trxname mmailtext resultset trxname trxname get parsed translated mail text param all concatinate all return parsed translated text public string get mail text boolean all if m mailtext null translate if all return parse m mailtext string buffer sb new string buffer sb append m mailtext string s m mailtext2 if s null s length 0 sb append n append s s m mailtext3 if s null s length 0 sb append n append s return parse sb to string getmailtext m_mailtext m_mailtext stringbuffer stringbuffer m_mailtext m_mailtext2 m_mailtext3 tostring get parsed translated mail text return parsed translated text public string get mail text if m mailtext null translate return parse m mailtext getmailtext m_mailtext m_mailtext get parsed translated mail text 2 return parsed translated text public string get mail text2 if m mailtext null translate return parse m mailtext2 getmailtext2 m_mailtext m_mailtext2 get parsed translated mail text 2 return parsed translated text public string get mail text3 if m mailtext null translate return parse m mailtext3 getmailtext3 m_mailtext m_mailtext3 get parsed translated mail header return parsed translated text public string get mail header if m mailheader null translate return parse m mailheader getmailheader m_mailheader m_mailheader parse text param text text return parsed text private string parse string text if text index of 1 return text parse user text parse text m user parse bp text parse text m bpartner parse po text parse text m po return text indexof m_user m_bpartner m_po parse text param text text param po object return parsed text private string parse string text po po if po null text index of 1 return text string in str text string token string buffer out str new string buffer int i in str index of while i 1 out str append in str substring 0 i up to in str in str substring i 1 in str length from first int j in str index of next if j 0 no second tag in str in str break token in str substring 0 j out str append parse variable token po replace context in str in str substring j 1 in str length from second i in str index of out str append in str add remainder return out str to string indexof instr stringbuffer outstr stringbuffer instr indexof outstr instr instr instr instr instr indexof instr instr instr outstr parsevariable instr instr instr instr indexof outstr instr outstr tostring parse variable param variable variable param po po return translated variable or if not found the original tag private string parse variable string variable po po int index po get columnindex variable if index 1 return variable keep for next object value po get value index if value null return return value to string parsevariable get_columnindex get_value tostring set user for parse param ad user id user public void set user int ad user id m user m user get get ctx ad user id ad_user_id setuser ad_user_id m_user muser getctx ad_user_id set user for parse param user user public void set user m user user m user user setuser muser m_user set b partner for parse param c bpartner id bp public void setb partner int c bpartner id m bpartner new mb partner get ctx c bpartner id get trxname bpartner c_bpartner_id setbpartner c_bpartner_id m_bpartner mbpartner getctx c_bpartner_id get_trxname set b partner for parse param bpartner bp public void setb partner mb partner bpartner m bpartner bpartner bpartner setbpartner mbpartner m_bpartner set po for parse param po po public void setpo po po m po po m_po set po for parse param po po param analyse if set to true search for b partner user public void setpo po po boolean analyse m po po if analyse int index po get columnindex c bpartner id if index 0 object oo po get value index if oo instanceof integer int c bpartner id integer oo int value setb partner c bpartner id index po get columnindex ad user id if index 0 object oo po get value index if oo instanceof integer int ad user id integer oo int value set user ad user id bpartner m_po get_columnindex c_bpartner_id get_value c_bpartner_id intvalue setbpartner c_bpartner_id get_columnindex ad_user_id get_value ad_user_id intvalue setuser ad_user_id translate to b partner language private void translate if m bpartner null m bpartner getad language null string key m bpartner getad language get id m mail text trl trl s cachetrl get key if trl null trl get translation m bpartner getad language if trl null s cachetrl put key trl if trl null m mailheader trl mail header m mailtext trl mail text m mailtext2 trl mail text2 m mailtext3 trl mail text3 no translation m mailheader super get mail header m mailtext super get mail text m mailtext2 super get mail text2 m mailtext3 super get mail text3 bpartner m_bpartner m_bpartner getad_language m_bpartner getad_language get_id mmailtexttrl s_cachetrl gettranslation m_bpartner getad_language s_cachetrl m_mailheader mailheader m_mailtext mailtext m_mailtext2 mailtext2 m_mailtext3 mailtext3 m_mailheader getmailheader m_mailtext getmailtext m_mailtext2 getmailtext2 m_mailtext3 getmailtext3 get translation param ad language language return trl private m mail text trl get translation string ad language m mail text trl trl null prepared statement pstmt null string sql select from r mailtext trl where r mailtext id and ad language try pstmt db prepare statement sql null pstmt set int 1 getr mailtext id pstmt set string 2 ad language result set rs pstmt execute query if rs next trl new m mail text trl trl ad language rs get string ad language trl mail header rs get string mail header trl mail text rs get string mail text trl mail text2 rs get string mail text2 trl mail text3 rs get string mail text3 rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null return trl ad_language mmailtexttrl gettranslation ad_language mmailtexttrl preparedstatement r_mailtext_trl r_mailtext_id ad_language preparestatement setint getr_mailtext_id setstring ad_language resultset executequery mmailtexttrl ad_language getstring ad_language mailheader getstring mailheader mailtext getstring mailtext mailtext2 getstring mailtext2 mailtext3 getstring mailtext3 get payment schedule of the invoice param c invoice id invoice id direct param c invoicepayschedule id id indirect return array of schedule public static m invoice pay schedule get invoice pay schedule properties ctx int c invoice id int c invoicepayschedule id string trx name string sql select from c invoicepayschedule ips if c invoice id 0 sql where c invoice id else sql where exists select from c invoicepayschedule x where x c invoicepayschedule id and ips c invoice id x c invoice id sql order by due date array list m invoice pay schedule list new array list m invoice pay schedule prepared statement pstmt null try pstmt db prepare statement sql trx name if c invoice id 0 pstmt set int 1 c invoice id else pstmt set int 1 c invoicepayschedule id result set rs pstmt execute query while rs next list add new m invoice pay schedule ctx rs trx name rs close pstmt close pstmt null catch exception e s log log level severe get invoice pay schedule e try if pstmt null pstmt close pstmt null catch exception e pstmt null m invoice pay schedule ret value new m invoice pay schedule list size list to array ret value return ret value c_invoice_id c_invoicepayschedule_id minvoicepayschedule getinvoicepayschedule c_invoice_id c_invoicepayschedule_id trxname c_invoicepayschedule c_invoice_id c_invoice_id c_invoicepayschedule c_invoicepayschedule_id c_invoice_id c_invoice_id duedate arraylist minvoicepayschedule arraylist minvoicepayschedule preparedstatement preparestatement trxname c_invoice_id setint c_invoice_id setint c_invoicepayschedule_id resultset executequery minvoicepayschedule trxname s_log getinvoicepayschedule minvoicepayschedule retvalue minvoicepayschedule toarray retvalue retvalue standard constructor param ctx context param c invoicepayschedule id id public m invoice pay schedule properties ctx int c invoicepayschedule id string trx name super ctx c invoicepayschedule id trx name if c invoicepayschedule id 0 setc invoice id 0 set discount amt env zero set discount date new timestamp system current time millis set due amt env zero set due date new timestamp system current time millis set is valid false c_invoicepayschedule_id minvoicepayschedule c_invoicepayschedule_id trxname c_invoicepayschedule_id trxname c_invoicepayschedule_id setc_invoice_id setdiscountamt setdiscountdate currenttimemillis setdueamt setduedate currenttimemillis setisvalid load constructor param ctx context param rs result set public m invoice pay schedule properties ctx result set rs string trx name super ctx rs trx name minvoicepayschedule resultset trxname trxname parent constructor param invoice invoice param pay schedule payment schedule public m invoice pay schedule m invoice invoice m pay schedule pay schedule super invoice get ctx 0 invoice get trxname m parent invoice set client org invoice setc invoice id invoice getc invoice id setc payschedule id pay schedule getc payschedule id amounts int scale m currency get std precision get ctx invoice getc currency id big decimal due invoice get grand total if due compare to env zero 0 set due amt env zero set discount amt env zero set is valid false else due due multiply pay schedule get percentage divide hundred scale big decimal round half up set due amt due big decimal discount due multiply pay schedule get discount divide hundred scale big decimal round half up set discount amt discount set is valid true dates timestamp due date time util add days invoice get date invoiced pay schedule get net days set due date due date timestamp discount date time util add days invoice get date invoiced pay schedule get discount days set discount date discount date payschedule minvoicepayschedule minvoice mpayschedule payschedule getctx get_trxname m_parent setclientorg setc_invoice_id getc_invoice_id setc_payschedule_id payschedule getc_payschedule_id mcurrency getstdprecision getctx getc_currency_id bigdecimal getgrandtotal compareto setdueamt setdiscountamt setisvalid payschedule getpercentage bigdecimal round_half_up setdueamt bigdecimal payschedule getdiscount bigdecimal round_half_up setdiscountamt setisvalid duedate timeutil adddays getdateinvoiced payschedule getnetdays setduedate duedate discountdate timeutil adddays getdateinvoiced payschedule getdiscountdays setdiscountdate discountdate return returns the parent public m invoice get parent if m parent null m parent new m invoice get ctx getc invoice id get trxname return m parent minvoice getparent m_parent m_parent minvoice getctx getc_invoice_id get_trxname m_parent param parent the parent to set public void set parent m invoice parent m parent parent setparent minvoice m_parent string representation return info public string to string string buffer sb new string buffer m invoice pay schedule sb append get id append due get due date get due amt append discount append get discount date get discount amt append return sb to string tostring stringbuffer stringbuffer minvoicepayschedule get_id getduedate getdueamt getdiscountdate getdiscountamt tostring before save param new record new return true protected boolean before save boolean new record if is valuechanged due amt log fine before save set is valid false return true newrecord beforesave newrecord is_valuechanged dueamt beforesave setisvalid after save param new record new param success success return success protected boolean after save boolean new record boolean success if is valuechanged due amt log fine after save get parent m parent validate pay schedule m parent save return success newrecord aftersave newrecord is_valuechanged dueamt aftersave getparent m_parent validatepayschedule m_parent invoice header doc type payment rule temporary document context doc sub typeso has charges re sets business partner info of required param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string doc type properties ctx int window no m tab m tab m field m field object value integer c doctype id integer value if c doctype id null c doctype id int value 0 return string sql select d has charges n d is doc no controlled s current next d doc base type from c doctype d ad sequence s where c doctype id 1 and d docnosequence id s ad sequence id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c doctype id int value result set rs pstmt execute query if rs next charges set context env set context ctx window no has charges rs get string 1 document no if rs get string 3 equals y m tab set value document no rs get string 4 doc base type set context string s rs get string 5 env set context ctx window no doc base type s ap check ar credit memo if s starts with ap m tab set value payment rule s check else if s ends with c m tab set value payment rule p on credit rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return doctype paymentrule docsubtypeso hascharges windowno mtab mfield doctype windowno mtab mtab mfield mfield c_doctype_id c_doctype_id c_doctype_id intvalue hascharges isdocnocontrolled currentnext docbasetype c_doctype ad_sequence c_doctype_id docnosequence_id ad_sequence_id preparedstatement preparestatement setint c_doctype_id intvalue resultset executequery setcontext windowno hascharges getstring documentno getstring mtab setvalue documentno getstring docbasetype getstring setcontext windowno docbasetype startswith mtab setvalue paymentrule endswith mtab setvalue paymentrule oncredit sqlexception getlocalizedmessage invoice header b partner m pricelist id context c bpartner location id ad user id po reference so description is discount printed payment rule c paymentterm id param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string b partner properties ctx int window no m tab m tab m field m field object value integer c bpartner id integer value if c bpartner id null c bpartner id int value 0 return string sql select p ad language p c paymentterm id coalesce p m pricelist id g m pricelist id as m pricelist id p payment rule p po reference p so description p is discount printed p so creditlimit p so creditlimit p so creditused as credit available l c bpartner location id c ad user id coalesce p po pricelist id g po pricelist id as po pricelist id p payment rulepo p po paymentterm id from c bpartner p inner join c bp group g on p c bp group id g c bp group id left outer join c bpartner location l on p c bpartner id l c bpartner id and l is bill to y and l is active y left outer join ad user c on p c bpartner id c c bpartner id where p c bpartner id and p is active y 1 boolean isso trx env get context ctx window no isso trx equals y try prepared statement pstmt db prepare statement sql null pstmt set int 1 c bpartner id int value result set rs pstmt execute query if rs next price list is tax included currency integer ii new integer rs get int isso trx m pricelist id po pricelist id if rs was null m tab set value m pricelist id ii else get default price list int i env get context as int ctx m pricelist id if i 0 m tab set value m pricelist id new integer i payment rule string s rs get string isso trx payment rule payment rulepo if s null s length 0 if env get context ctx window no doc base type ends with c credits are payment term s p else if isso trx s equals s s equals u no check transfer for so trx s p payment term m tab set value payment rule s payment term ii new integer rs get int isso trx c paymentterm id po paymentterm id if rs was null m tab set value c paymentterm id ii location int locid rs get int c bpartner location id overwritten by infobp selection works only if info window was used otherwise creates error uses last value may belong to differnt bp if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string loc env get context ctx env window info env tab info c bpartner location id if loc length 0 locid integer parse int loc if locid 0 m tab set value c bpartner location id null else m tab set value c bpartner location id new integer locid contact overwritten by infobp selection int contid rs get int ad user id if c bpartner id to string equals env get context ctx env window info env tab info c bpartner id string cont env get context ctx env window info env tab info ad user id if cont length 0 contid integer parse int cont if contid 0 m tab set value ad user id null else m tab set value ad user id new integer contid credit available if isso trx double credit limit rs get double so creditlimit if credit limit 0 double credit available rs get double credit available if rs was null credit available 0 m tab fire data statuse event credit limit over display type get number format display type amount format credit available false po reference s rs get string po reference if s null s length 0 m tab set value po reference s else m tab set value po reference null so description s rs get string so description if s null s trim length 0 m tab set value description s is discount printed s rs get string is discount printed if s null s length 0 m tab set value is discount printed s else m tab set value is discount printed n rs close pstmt close catch sql exception e log log level severe b partner e return e get localized message return bpartner m_pricelist_id c_bpartner_location_id ad_user_id poreference so_description isdiscountprinted paymentrule c_paymentterm_id windowno mtab mfield bpartner windowno mtab mtab mfield mfield c_bpartner_id c_bpartner_id c_bpartner_id intvalue ad_language c_paymentterm_id m_pricelist_id m_pricelist_id m_pricelist_id paymentrule poreference so_description isdiscountprinted so_creditlimit so_creditlimit so_creditused creditavailable c_bpartner_location_id ad_user_id po_pricelist_id po_pricelist_id po_pricelist_id paymentrulepo po_paymentterm_id c_bpartner c_bp_group c_bp_group_id c_bp_group_id c_bpartner_location c_bpartner_id c_bpartner_id isbillto isactive ad_user c_bpartner_id c_bpartner_id c_bpartner_id isactive issotrx getcontext windowno issotrx preparedstatement preparestatement setint c_bpartner_id intvalue resultset executequery pricelist istaxincluded getint issotrx m_pricelist_id po_pricelist_id wasnull mtab setvalue m_pricelist_id pricelist getcontextasint m_pricelist_id mtab setvalue m_pricelist_id paymentrule getstring issotrx paymentrule paymentrulepo getcontext windowno docbasetype endswith issotrx so_trx mtab setvalue paymentrule getint issotrx c_paymentterm_id po_paymentterm_id wasnull mtab setvalue c_paymentterm_id getint c_bpartner_location_id infowindow c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info c_bpartner_location_id parseint mtab setvalue c_bpartner_location_id mtab setvalue c_bpartner_location_id getint ad_user_id c_bpartner_id tostring getcontext window_info tab_info c_bpartner_id getcontext window_info tab_info ad_user_id parseint mtab setvalue ad_user_id mtab setvalue ad_user_id creditavailable issotrx creditlimit getdouble so_creditlimit creditlimit creditavailable getdouble creditavailable wasnull creditavailable mtab firedatastatuseevent creditlimitover displaytype getnumberformat displaytype creditavailable getstring poreference mtab setvalue poreference mtab setvalue poreference getstring so_description mtab setvalue isdiscountprinted getstring isdiscountprinted mtab setvalue isdiscountprinted mtab setvalue isdiscountprinted sqlexception bpartner getlocalizedmessage set payment term payment term has changed public string payment term properties ctx int window no m tab m tab m field m field object value integer c paymentterm id integer value int c invoice id env get context as int ctx window no c invoice id if c paymentterm id null c paymentterm id int value 0 c invoice id 0 not saved yet return m payment term pt new m payment term ctx c paymentterm id int value null if pt get id 0 return payment term not found boolean valid pt apply c invoice id m tab set value is pay schedule valid valid y n return paymentterm windowno mtab mtab mfield mfield c_paymentterm_id c_invoice_id getcontextasint windowno c_invoice_id c_paymentterm_id c_paymentterm_id intvalue c_invoice_id mpaymentterm mpaymentterm c_paymentterm_id intvalue get_id paymentterm c_invoice_id mtab setvalue ispayschedulevalid invoice line product reset c charge id m attributesetinstance id price list price std price limit c currency id enforce price limit uom calls tax param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string product properties ctx int window no m tab m tab m field m field object value integer m product id integer value if m product id null m product id int value 0 return set callout active true m tab set value c charge id null set attribute if env get context as int ctx env window info env tab info m product id m product id int value env get context as int ctx env window info env tab info m attributesetinstance id 0 m tab set value m attributesetinstance id new integer env get context as int ctx env window info env tab info m attributesetinstance id else m tab set value m attributesetinstance id null price calculation see also qty boolean isso trx env get context ctx window no isso trx equals y int c bpartner id env get context as int ctx window no window no c bpartner id big decimal qty big decimal m tab get value qty invoiced m product pricing pp new m product pricing m product id int value c bpartner id qty isso trx int m pricelist id env get context as int ctx window no m pricelist id pp setm pricelist id m pricelist id int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp date env get context as date ctx window no date invoiced pp set price date date m tab set value price list pp get price list m tab set value price limit pp get price limit m tab set value price actual pp get price std m tab set value price entered pp get price std m tab set value c currency id new integer pp getc currency id m tab set value discount pp get discount m tab set value c uom id new integer pp getc uom id env set context ctx window no enforce price limit pp is enforce price limit y n env set context ctx window no discount schema pp is discount schema y n set callout active false return tax ctx window no m tab m field value c_charge_id m_attributesetinstance_id pricelist pricestd pricelimit c_currency_id enforcepricelimit windowno mtab mfield windowno mtab mtab mfield mfield m_product_id m_product_id m_product_id intvalue setcalloutactive mtab setvalue c_charge_id getcontextasint window_info tab_info m_product_id m_product_id intvalue getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id getcontextasint window_info tab_info m_attributesetinstance_id mtab setvalue m_attributesetinstance_id issotrx getcontext windowno issotrx c_bpartner_id getcontextasint windowno windowno c_bpartner_id bigdecimal bigdecimal mtab getvalue qtyinvoiced mproductpricing mproductpricing m_product_id intvalue c_bpartner_id issotrx m_pricelist_id getcontextasint windowno m_pricelist_id setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id getcontextasdate windowno dateinvoiced setpricedate mtab setvalue pricelist getpricelist mtab setvalue pricelimit getpricelimit mtab setvalue priceactual getpricestd mtab setvalue priceentered getpricestd mtab setvalue c_currency_id getc_currency_id mtab setvalue getdiscount mtab setvalue c_uom_id getc_uom_id setcontext windowno enforcepricelimit isenforcepricelimit setcontext windowno discountschema isdiscountschema setcalloutactive windowno mtab mfield invoice line charge updates price actual from charge sets price limit price list to zero calles tax param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string charge properties ctx int window no m tab m tab m field m field object value integer c charge id integer value if c charge id null c charge id int value 0 return no product defined if m tab get value m product id null m tab set value c charge id null return charge exclusively m tab set value m attributesetinstance id null m tab set value s resourceassignment id null m tab set value c uom id new integer 100 ea env set context ctx window no discount schema n string sql select charge amt from c charge where c charge id try prepared statement pstmt db prepare statement sql null pstmt set int 1 c charge id int value result set rs pstmt execute query if rs next m tab set value price entered rs get big decimal 1 m tab set value price actual rs get big decimal 1 m tab set value price limit env zero m tab set value price list env zero m tab set value discount env zero rs close pstmt close catch sql exception e log log level severe sql e return e get localized message return tax ctx window no m tab m field value priceactual pricelimit pricelist windowno mtab mfield windowno mtab mtab mfield mfield c_charge_id c_charge_id c_charge_id intvalue mtab getvalue m_product_id mtab setvalue c_charge_id chargeexclusively mtab setvalue m_attributesetinstance_id mtab setvalue s_resourceassignment_id mtab setvalue c_uom_id setcontext windowno discountschema chargeamt c_charge c_charge_id preparedstatement preparestatement setint c_charge_id intvalue resultset executequery mtab setvalue priceentered getbigdecimal mtab setvalue priceactual getbigdecimal mtab setvalue pricelimit mtab setvalue pricelist mtab setvalue sqlexception getlocalizedmessage windowno mtab mfield invoice line tax basis product charge b partner location sets c tax id calles amount param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string tax properties ctx int window no m tab m tab m field m field object value string column m field get column name if value null return check product int m product id 0 if column equals m product id m product id integer value int value else m product id env get context as int ctx window no m product id int c charge id 0 if column equals c charge id c charge id integer value int value else c charge id env get context as int ctx window no c charge id log fine product m product id c charge id c charge id if m product id 0 c charge id 0 return amt ctx window no m tab m field value check partner location int shipc bpartner location id env get context as int ctx window no c bpartner location id if shipc bpartner location id 0 return amt ctx window no m tab m field value log fine ship bp location shipc bpartner location id int billc bpartner location id shipc bpartner location id log fine bill bp location billc bpartner location id dates timestamp bill date env get context as date ctx window no date invoiced log fine bill date bill date timestamp ship date bill date log fine ship date ship date int ad org id env get context as int ctx window no ad org id log fine org ad org id int m warehouse id env get context as int ctx m warehouse id log fine warehouse m warehouse id int c tax id tax get ctx m product id c charge id bill date ship date ad org id m warehouse id billc bpartner location id shipc bpartner location id env get context ctx window no isso trx equals y log info tax id c tax id if c tax id 0 m tab fire data statuse event c logger retrieve error else m tab set value c tax id new integer c tax id return amt ctx window no m tab m field value bpartner c_tax_id windowno mtab mfield windowno mtab mtab mfield mfield mfield getcolumnname m_product_id m_product_id m_product_id intvalue m_product_id getcontextasint windowno m_product_id c_charge_id c_charge_id c_charge_id intvalue c_charge_id getcontextasint windowno c_charge_id m_product_id c_charge_id c_charge_id m_product_id c_charge_id windowno mtab mfield shipc_bpartner_location_id getcontextasint windowno c_bpartner_location_id shipc_bpartner_location_id windowno mtab mfield bp_location shipc_bpartner_location_id billc_bpartner_location_id shipc_bpartner_location_id bp_location billc_bpartner_location_id billdate getcontextasdate windowno dateinvoiced billdate shipdate billdate shipdate ad_org_id getcontextasint windowno ad_org_id ad_org_id m_warehouse_id getcontextasint m_warehouse_id m_warehouse_id c_tax_id m_product_id c_charge_id billdate shipdate ad_org_id m_warehouse_id billc_bpartner_location_id shipc_bpartner_location_id getcontext windowno issotrx c_tax_id c_tax_id mtab firedatastatuseevent clogger retrieveerror mtab setvalue c_tax_id c_tax_id windowno mtab mfield invoice amount called from qty invoiced price actual calculates line net amt param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string amt properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true log log level warning amt init int c uom to id env get context as int ctx window no c uom id int m product id env get context as int ctx window no m product id int m pricelist id env get context as int ctx window no m pricelist id int std precision m price list get standard precision ctx m pricelist id big decimal qty entered qty invoiced price entered price actual price limit discount price list get values qty entered big decimal m tab get value qty entered qty invoiced big decimal m tab get value qty invoiced log fine qty entered qty entered invoiced qty invoiced uom c uom to id price entered big decimal m tab get value price entered price actual big decimal m tab get value price actual discount big decimal m tab get value discount price limit big decimal m tab get value price limit price list big decimal m tab get value price list log fine price list price list limit price limit precision std precision log fine price entered price entered actual price actual discount discount qty changed recalc price if m field get column name equals qty invoiced m field get column name equals qty entered m field get column name equals m product id n equals env get context ctx window no discount schema int c bpartner id env get context as int ctx window no c bpartner id if m field get column name equals qty entered qty invoiced muom conversion convert product to ctx m product id c uom to id qty entered if qty invoiced null qty invoiced qty entered boolean isso trx env get context ctx window no isso trx equals y m product pricing pp new m product pricing m product id c bpartner id qty invoiced isso trx pp setm pricelist id m pricelist id int m pricelist version id env get context as int ctx window no m pricelist version id pp setm pricelist version id m pricelist version id timestamp date timestamp m tab get value date invoiced pp set price date date price entered muom conversion convert product from ctx m product id c uom to id pp get price std if price entered null price entered pp get price std log fine amt qty changed price actual pp get price std price entered price entered discount pp get discount m tab set value price actual pp get price std m tab set value discount pp get discount m tab set value price entered price entered env set context ctx window no discount schema pp is discount schema y n else if m field get column name equals price actual price actual big decimal value price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual log fine amt price actual price actual price entered price entered m tab set value price entered price entered else if m field get column name equals price entered price entered big decimal value price actual muom conversion convert product to ctx m product id c uom to id price entered if price actual null price actual price entered log fine amt price entered price entered price actual price actual m tab set value price actual price actual discount entered calculate actual entered if m field get column name equals discount price actual new big decimal 100 0 discount double value 100 0 price list double value if price actual scale std precision price actual price actual set scale std precision big decimal round half up price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual m tab set value price actual price actual m tab set value price entered price entered calculate discount else if price list int value 0 discount env zero else discount new big decimal price list double value price actual double value price list double value 100 0 if discount scale 2 discount discount set scale 2 big decimal round half up m tab set value discount discount log fine amt price entered price entered actual price actual discount discount check price limit string epl env get context ctx window no enforce price limit boolean enforce env isso trx ctx window no epl null epl equals y if enforce m role get default is overwrite price limit enforce false check price limit if enforce price limit double value 0 0 price actual compare to price limit 0 price actual price limit price entered muom conversion convert product from ctx m product id c uom to id price limit if price entered null price entered price limit log fine amt under price entered price entered actual price limit m tab set value price actual price limit m tab set value price entered price entered m tab fire data statuse event under limit price false repeat discount calc if price list int value 0 discount new big decimal price list double value price actual double value price list double value 100 0 if discount scale 2 discount discount set scale 2 big decimal round half up m tab set value discount discount line net amt big decimal line net amt qty invoiced multiply price actual if line net amt scale std precision line net amt line net amt set scale std precision big decimal round half up log info amt line net amt line net amt m tab set value line net amt line net amt calculate tax amount for po boolean isso trx y equals env get context env get ctx window no isso trx if isso trx big decimal tax amt null if m field get column name equals tax amt tax amt big decimal m tab get value tax amt else integer taxid integer m tab get value c tax id if taxid null int c tax id taxid int value m tax tax new m tax ctx c tax id null tax amt tax calculate tax line net amt is tax included window no std precision m tab set value tax amt tax amt add it up m tab set value line total amt line net amt add tax amt set callout active false return qtyinvoiced priceactual linenetamt windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive c_uom_to_id getcontextasint windowno c_uom_id m_product_id getcontextasint windowno m_product_id m_pricelist_id getcontextasint windowno m_pricelist_id stdprecision mpricelist getstandardprecision m_pricelist_id bigdecimal qtyentered qtyinvoiced priceentered priceactual pricelimit pricelist qtyentered bigdecimal mtab getvalue qtyentered qtyinvoiced bigdecimal mtab getvalue qtyinvoiced qtyentered qtyentered qtyinvoiced c_uom_to_id priceentered bigdecimal mtab getvalue priceentered priceactual bigdecimal mtab getvalue priceactual bigdecimal mtab getvalue pricelimit bigdecimal mtab getvalue pricelimit pricelist bigdecimal mtab getvalue pricelist pricelist pricelist pricelimit stdprecision priceentered priceentered priceactual mfield getcolumnname qtyinvoiced mfield getcolumnname qtyentered mfield getcolumnname m_product_id getcontext windowno discountschema c_bpartner_id getcontextasint windowno c_bpartner_id mfield getcolumnname qtyentered qtyinvoiced muomconversion convertproductto m_product_id c_uom_to_id qtyentered qtyinvoiced qtyinvoiced qtyentered issotrx getcontext windowno issotrx mproductpricing mproductpricing m_product_id c_bpartner_id qtyinvoiced issotrx setm_pricelist_id m_pricelist_id m_pricelist_version_id getcontextasint windowno m_pricelist_version_id setm_pricelist_version_id m_pricelist_version_id mtab getvalue dateinvoiced setpricedate priceentered muomconversion convertproductfrom m_product_id c_uom_to_id getpricestd priceentered priceentered getpricestd qtychanged priceactual getpricestd priceentered priceentered getdiscount mtab setvalue priceactual getpricestd mtab setvalue getdiscount mtab setvalue priceentered priceentered setcontext windowno discountschema isdiscountschema mfield getcolumnname priceactual priceactual bigdecimal priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual priceactual priceactual priceentered priceentered mtab setvalue priceentered priceentered mfield getcolumnname priceentered priceentered bigdecimal priceactual muomconversion convertproductto m_product_id c_uom_to_id priceentered priceactual priceactual priceentered priceentered priceentered priceactual priceactual mtab setvalue priceactual priceactual mfield getcolumnname priceactual bigdecimal doublevalue pricelist doublevalue priceactual stdprecision priceactual priceactual setscale stdprecision bigdecimal round_half_up priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual mtab setvalue priceactual priceactual mtab setvalue priceentered priceentered pricelist intvalue bigdecimal pricelist doublevalue priceactual doublevalue pricelist doublevalue setscale bigdecimal round_half_up mtab setvalue priceentered priceentered priceactual pricelimit getcontext windowno enforcepricelimit issotrx windowno mrole getdefault isoverwritepricelimit pricelimit doublevalue priceactual compareto pricelimit priceactual pricelimit priceentered muomconversion convertproductfrom m_product_id c_uom_to_id pricelimit priceentered priceentered pricelimit priceentered priceentered pricelimit mtab setvalue priceactual pricelimit mtab setvalue priceentered priceentered mtab firedatastatuseevent underlimitprice pricelist intvalue bigdecimal pricelist doublevalue priceactual doublevalue pricelist doublevalue setscale bigdecimal round_half_up mtab setvalue bigdecimal linenetamt qtyinvoiced priceactual linenetamt stdprecision linenetamt linenetamt setscale stdprecision bigdecimal round_half_up linenetamt linenetamt mtab setvalue linenetamt linenetamt issotrx getcontext getctx windowno issotrx issotrx bigdecimal taxamt mfield getcolumnname taxamt taxamt bigdecimal mtab getvalue taxamt mtab getvalue c_tax_id c_tax_id intvalue mtax mtax c_tax_id taxamt calculatetax linenetamt istaxincluded windowno stdprecision mtab setvalue taxamt taxamt mtab setvalue linetotalamt linenetamt taxamt setcalloutactive is tax included param window no window no return tax included default false private boolean is tax included int window no string ss env get context env get ctx window no is tax included not set yet if ss length 0 int m pricelist id env get context as int env get ctx window no m pricelist id if m pricelist id 0 return false ss db getsql value string null select is tax included from m pricelist where m pricelist id m pricelist id if ss null ss n env set context env get ctx window no is tax included ss return y equals ss windowno istaxincluded windowno getcontext getctx windowno istaxincluded m_pricelist_id getcontextasint getctx windowno m_pricelist_id m_pricelist_id getsqlvaluestring istaxincluded m_pricelist m_pricelist_id m_pricelist_id setcontext getctx windowno istaxincluded invoice line quantity called from c uom id qty entered qty invoiced enforces qty uom relationship param ctx context param window no current window no param m tab model tab param m field model field param value the new value public string qty properties ctx int window no m tab m tab m field m field object value if is callout active value null return set callout active true int m product id env get context as int ctx window no m product id log log level warning qty init m product id m product id big decimal qty invoiced qty entered price actual price entered no product if m product id 0 qty entered big decimal m tab get value qty entered m tab set value qty invoiced qty entered uom changed convert from entered product else if m field get column name equals c uom id int c uom to id integer value int value qty entered big decimal m tab get value qty entered qty invoiced muom conversion convert product from ctx m product id c uom to id qty entered if qty invoiced null qty invoiced qty entered boolean conversion qty entered compare to qty invoiced 0 price actual big decimal m tab get value price actual price entered muom conversion convert product from ctx m product id c uom to id price actual if price entered null price entered price actual log fine qty uom c uom to id qty entered price actual qty entered price actual conversion qty invoiced price entered qty invoiced price entered env set context ctx window no uom conversion conversion y n m tab set value qty invoiced qty invoiced m tab set value price entered price entered qty entered changed calculate qty invoiced else if m field get column name equals qty entered int c uom to id env get context as int ctx window no c uom id qty entered big decimal value qty invoiced muom conversion convert product from ctx m product id c uom to id qty entered if qty invoiced null qty invoiced qty entered boolean conversion qty entered compare to qty invoiced 0 log fine qty uom c uom to id qty entered qty entered conversion qty invoiced qty invoiced env set context ctx window no uom conversion conversion y n m tab set value qty invoiced qty invoiced qty invoiced changed calculate qty entered else if m field get column name equals qty invoiced int c uom to id env get context as int ctx window no c uom id qty invoiced big decimal value qty entered muom conversion convert product to ctx m product id c uom to id qty invoiced if qty entered null qty entered qty invoiced boolean conversion qty invoiced compare to qty entered 0 log fine qty uom c uom to id qty invoiced qty invoiced conversion qty entered qty entered env set context ctx window no uom conversion conversion y n m tab set value qty entered qty entered set callout active false return c_uom_id qtyentered qtyinvoiced windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive setcalloutactive m_product_id getcontextasint windowno m_product_id m_product_id m_product_id bigdecimal qtyinvoiced qtyentered priceactual priceentered m_product_id qtyentered bigdecimal mtab getvalue qtyentered mtab setvalue qtyinvoiced qtyentered mfield getcolumnname c_uom_id c_uom_to_id intvalue qtyentered bigdecimal mtab getvalue qtyentered qtyinvoiced muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered qtyinvoiced qtyinvoiced qtyentered qtyentered compareto qtyinvoiced priceactual bigdecimal mtab getvalue priceactual priceentered muomconversion convertproductfrom m_product_id c_uom_to_id priceactual priceentered priceentered priceactual c_uom_to_id qtyentered priceactual qtyentered priceactual qtyinvoiced priceentered qtyinvoiced priceentered setcontext windowno uomconversion mtab setvalue qtyinvoiced qtyinvoiced mtab setvalue priceentered priceentered qtyentered qtyinvoiced mfield getcolumnname qtyentered c_uom_to_id getcontextasint windowno c_uom_id qtyentered bigdecimal qtyinvoiced muomconversion convertproductfrom m_product_id c_uom_to_id qtyentered qtyinvoiced qtyinvoiced qtyentered qtyentered compareto qtyinvoiced c_uom_to_id qtyentered qtyentered qtyinvoiced qtyinvoiced setcontext windowno uomconversion mtab setvalue qtyinvoiced qtyinvoiced qtyinvoiced qtyentered mfield getcolumnname qtyinvoiced c_uom_to_id getcontextasint windowno c_uom_id qtyinvoiced bigdecimal qtyentered muomconversion convertproductto m_product_id c_uom_to_id qtyinvoiced qtyentered qtyentered qtyinvoiced qtyinvoiced compareto qtyentered c_uom_to_id qtyinvoiced qtyinvoiced qtyentered qtyentered setcontext windowno uomconversion mtab setvalue qtyentered qtyentered setcalloutactive standard constructor param ctx context param pa sla goal id id public msla goal properties ctx int pa sla goal id string trx name super ctx pa sla goal id trx name if pa sla goal id 0 set measure actual env zero set measure target env zero set processed false pa_sla_goal_id mslagoal pa_sla_goal_id trxname pa_sla_goal_id trxname pa_sla_goal_id setmeasureactual setmeasuretarget setprocessed load constructor param ctx context param rs result set public msla goal properties ctx result set rs string trx name super ctx rs trx name mslagoal resultset trxname trxname get all measures return array of measures public msla measure get all measures string sql select from pa sla measure where pa sla goal id order by date trx return get measures sql mslameasure getallmeasures pa_sla_measure pa_sla_goal_id datetrx getmeasures get new measures only return array of unprocessed measures public msla measure get new measures string sql select from pa sla measure where pa sla goal id and processed n order by date trx return get measures sql mslameasure getnewmeasures pa_sla_measure pa_sla_goal_id datetrx getmeasures get measures param sql sql return array of measures private msla measure get measures string sql array list msla measure list new array list msla measure prepared statement pstmt null try pstmt db prepare statement sql get trxname pstmt set int 1 getpa sla goal id result set rs pstmt execute query while rs next list add new msla measure get ctx rs get trxname rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null msla measure ret value new msla measure list size list to array ret value return ret value mslameasure getmeasures arraylist mslameasure arraylist mslameasure preparedstatement preparestatement get_trxname setint getpa_sla_goal_id resultset executequery mslameasure getctx get_trxname mslameasure retvalue mslameasure toarray retvalue retvalue is the date in the valid range param date date return true if valid public boolean is date valid timestamp date if date null return false if get valid from null date before get valid from return false if get valid to null date after get valid to return false return true isdatevalid getvalidfrom getvalidfrom getvalidto getvalidto standard constructor param frame frame param modal modal param window no window no param a asset id asset param value query value or name if enclosed in param multi selection multiple selections param where clause where clause public info asset frame frame boolean modal int window no int a asset id string value boolean multi selection string where clause super frame modal window no a a asset id multi selection where clause log info value id a asset id where where clause set title msg get msg env get ctx info asset stat init init info value a asset id where clause int no p table get row count set status line integer to string no msg get msg env get ctx searchrows enterquery false set statusdb integer to string no auto query if value null value length 0 execute query p loadedok true focus field value request focus a env position center window frame this windowno a_asset_id multiselection whereclause infoasset windowno a_asset_id multiselection whereclause windowno a_asset_id multiselection whereclause a_asset_id whereclause settitle getmsg getctx infoasset statinit initinfo a_asset_id whereclause p_table getrowcount setstatusline tostring getmsg getctx searchrows_enterquery setstatusdb tostring autoquery executequery p_loadedok fieldvalue requestfocus aenv positioncenterwindow static setup add fields to parameter panel private void stat init label value set text msg get msg env get ctx value field value set background compiereplaf get info background field value add action listener this label name set text msg get msg env get ctx name field name set background compiereplaf get info background field name add action listener this from a asset fbpartner id new v lookup c bpartner id false false true m lookup factory get env get ctx p windowno 0 8065 display type search lbpartner id set label for fbpartner id fbpartner id set background compiereplaf get info background fproduct id new v lookup m product id false false true m lookup factory get env get ctx p windowno 0 8047 display type search lproduct id set label for fproduct id fproduct id set background compiereplaf get info background parameter panel set layout new a layout parameter panel add label value new a layout constraint 0 0 parameter panel add field value null parameter panel add lbpartner id null parameter panel add fbpartner id null parameter panel add label name new a layout constraint 1 0 parameter panel add field name null parameter panel add lproduct id null parameter panel add fproduct id null parameterpanel statinit labelvalue settext getmsg getctx fieldvalue setbackground getinfobackground fieldvalue addactionlistener labelname settext getmsg getctx fieldname setbackground getinfobackground fieldname addactionlistener a_asset fbpartner_id vlookup c_bpartner_id mlookupfactory getctx p_windowno displaytype lbpartner_id setlabelfor fbpartner_id fbpartner_id setbackground getinfobackground fproduct_id vlookup m_product_id mlookupfactory getctx p_windowno displaytype lproduct_id setlabelfor fproduct_id fproduct_id setbackground getinfobackground parameterpanel setlayout alayout parameterpanel labelvalue alayoutconstraint parameterpanel fieldvalue parameterpanel lbpartner_id parameterpanel fbpartner_id parameterpanel labelname alayoutconstraint parameterpanel fieldname parameterpanel lproduct_id parameterpanel fproduct_id dynamic init param value value param where clause where clause private void init info string value int a asset id string where clause create grid string buffer where new string buffer where append a is active y if where clause null where clause length 0 where append and append where clause prepare table s assetlayout s assetfrom where to string a value set value if value null value if value ends with value whereclause initinfo a_asset_id whereclause stringbuffer stringbuffer isactive whereclause whereclause whereclause preparetable s_assetlayout s_assetfrom tostring endswith construct sql where clause and define parameters set parameters needs to set parameters includes first and return where clause string getsql where string buffer sql new string buffer value string value field value get text to upper case if value equals value equals sql append and upper a value like name string name field name get text to upper case if name equals name equals sql append and upper a name like c bpartner id integer c bpartner id integer fbpartner id get value if c bpartner id null sql append and a c bpartner id append c bpartner id m product id integer m product id integer fproduct id get value if m product id null sql append and a m product id append m product id return sql to string setparameters getsqlwhere stringbuffer stringbuffer fieldvalue gettext touppercase fieldname gettext touppercase c_bpartner_id c_bpartner_id fbpartner_id getvalue c_bpartner_id c_bpartner_id c_bpartner_id m_product_id m_product_id fproduct_id getvalue m_product_id m_product_id m_product_id tostring set parameters for query as defined in getsql where param pstmt pstmt param for count for counting records throws sql exception void set parameters prepared statement pstmt boolean for count throws sql exception int index 1 value string value field value get text to upper case if value equals value equals if value ends with value pstmt set string index value log fine value value name string name field name get text to upper case if name equals name equals if name ends with name pstmt set string index name log fine name name getsqlwhere forcount sqlexception setparameters preparedstatement forcount sqlexception fieldvalue gettext touppercase endswith setstring fieldname gettext touppercase endswith setstring save selection details get location partner info public void save selection detail int row p table get selected row if row 1 return publish for callout to read integer id get selected row key env set context env get ctx env window info env tab info a asset id id null 0 id to string saveselectiondetail p_table getselectedrow getselectedrowkey setcontext getctx window_info tab_info a_asset_id tostring show history void show history log info info asset show history showhistory infoasset showhistory has history return true boolean has history return false hashistory zoom void zoom log info info asset zoom integer a asset id get selected row key if a asset id null return m query query new m query a asset query add restriction a asset id m query equal a asset id query set record count 1 int ad windowno getad window id a asset true zoom ad windowno query infoasset a_asset_id getselectedrowkey a_asset_id mquery mquery a_asset addrestriction a_asset_id mquery a_asset_id setrecordcount ad_windowno getad_window_id a_asset ad_windowno has zoom return true boolean has zoom return true haszoom customize void customize log info info asset customize infoasset has customize return false boolean has customize return false for now hascustomize get contents return contents public object get contents return contents getcontents create new log param ctx context param ad replication run id id param ad replicationtable id id param p msg msg public m replication log properties ctx int ad replication run id int ad replicationtable id string p msg string trx name super ctx 0 trx name setad replication run id ad replication run id setad replicationtable id ad replicationtable id set is replicated false setp msg p msg ad_replication_run_id ad_replicationtable_id p_msg mreplicationlog ad_replication_run_id ad_replicationtable_id p_msg trxname trxname setad_replication_run_id ad_replication_run_id setad_replicationtable_id ad_replicationtable_id setisreplicated setp_msg p_msg basic constructor public tt basic constructor param element adds an element to the element public tt element element add element element addelement basic constructor param element adds an element to the element public tt string element add element element addelement sets the lang and xml lang attributes param lang the lang and xml lang attributes public element set lang string lang add attribute lang lang add attribute xml lang lang return this setlang addattribute addattribute adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tt add element string hashcode element element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param hashcode name of element for hash table param element adds an element to the element public tt add element string hashcode string element add element to registry hashcode element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tt add element element element add element to registry element return this addelement addelementtoregistry adds an element to the element param element adds an element to the element public tt add element string element add element to registry element return this addelement addelementtoregistry removes an element from the element param hashcode the name of the element to be removed public tt remove element string hashcode remove element from registry hashcode return this removeelement removeelementfromregistry the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements param the script public void set on click string script add attribute onclick script setonclick addattribute the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements param the script public void set on dbl click string script add attribute ondblclick script setondblclick addattribute the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements param the script public void set on mouse down string script add attribute onmousedown script setonmousedown addattribute the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements param the script public void set on mouse up string script add attribute onmouseup script setonmouseup addattribute the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements param the script public void set on mouse over string script add attribute onmouseover script setonmouseover addattribute the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements param the script public void set on mouse move string script add attribute onmousemove script setonmousemove addattribute the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements param the script public void set on mouse out string script add attribute onmouseout script setonmouseout addattribute the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements param the script public void set on key press string script add attribute onkeypress script setonkeypress addattribute the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements param the script public void set on key down string script add attribute onkeydown script setonkeydown addattribute the onkeyup event occurs when a key is released over an element this attribute may be used with most elements param the script public void set on key up string script add attribute onkeyup script setonkeyup addattribute standard constructor public x s resource properties ctx int s resource id string trx name super ctx s resource id trx name if s resource id 0 set is available true y setm warehouse id 0 set name null sets resourcetype id 0 sets resource id 0 set value null x_s_resource s_resource_id trxname s_resource_id trxname s_resource_id setisavailable setm_warehouse_id setname sets_resourcetype_id sets_resource_id setvalue load constructor public x s resource properties ctx result set rs string trx name super ctx rs trx name x_s_resource resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s resource append get id append return sb to string tostring stringbuffer stringbuffer x_s_resource get_id tostring set user contact user within the system internal or business partner contact public void setad user id int ad user id if ad user id 0 set value ad user id null else set value ad user id new integer ad user id setad_user_id ad_user_id ad_user_id set_value ad_user_id set_value ad_user_id ad_user_id get user contact user within the system internal or business partner contact public int getad user id integer ii integer get value ad user id if ii null return 0 return ii int value getad_user_id get_value ad_user_id intvalue set chargeable quantity public void set chargeable qty big decimal chargeable qty set value chargeable qty chargeable qty setchargeableqty bigdecimal chargeableqty set_value chargeableqty chargeableqty get chargeable quantity public big decimal get chargeable qty big decimal bd big decimal get value chargeable qty if bd null return env zero return bd bigdecimal getchargeableqty bigdecimal bigdecimal get_value chargeableqty set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set available resource is available public void set is available boolean is available set value is available new boolean is available setisavailable isavailable set_value isavailable isavailable get available resource is available public boolean is available object oo get value is available if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isavailable get_value isavailable booleanvalue set warehouse storage warehouse and service point public void setm warehouse id int m warehouse id if m warehouse id 1 throw new illegal argument exception m warehouse id is mandatory set value m warehouse id new integer m warehouse id setm_warehouse_id m_warehouse_id m_warehouse_id illegalargumentexception m_warehouse_id set_value m_warehouse_id m_warehouse_id get warehouse storage warehouse and service point public int getm warehouse id integer ii integer get value m warehouse id if ii null return 0 return ii int value getm_warehouse_id get_value m_warehouse_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set resource type public void sets resourcetype id int s resourcetype id if s resourcetype id 1 throw new illegal argument exception s resourcetype id is mandatory set value s resourcetype id new integer s resourcetype id sets_resourcetype_id s_resourcetype_id s_resourcetype_id illegalargumentexception s_resourcetype_id set_value s_resourcetype_id s_resourcetype_id get resource type public int gets resourcetype id integer ii integer get value s resourcetype id if ii null return 0 return ii int value gets_resourcetype_id get_value s_resourcetype_id intvalue set resource resource public void sets resource id int s resource id if s resource id 1 throw new illegal argument exception s resource id is mandatory set valuenocheck s resource id new integer s resource id sets_resource_id s_resource_id s_resource_id illegalargumentexception s_resource_id set_valuenocheck s_resource_id s_resource_id get resource resource public int gets resource id integer ii integer get value s resource id if ii null return 0 return ii int value gets_resource_id get_value s_resource_id intvalue set search key search key for the record in the format required must be unique public void set value string value if value null throw new illegal argument exception value is mandatory if value length 40 log warning length 40 truncated value value substring 0 39 set value value value setvalue illegalargumentexception set_value get search key search key for the record in the format required must be unique public string get value return string get value value getvalue get_value payment selection line payment amount called from c payselectionline pay amt update difference amt public string pay amt properties ctx int window no m tab m tab m field m field object value if is callout active value null return get invoice info integer ii integer m tab get value c invoice id if ii null return int c invoice id ii int value if c invoice id 0 return big decimal open amt big decimal m tab get value open amt big decimal pay amt big decimal m tab get value pay amt big decimal discount amt big decimal m tab get value discount amt set callout active true big decimal difference amt open amt subtract pay amt subtract discount amt log fine open amt open amt pay amt pay amt discount discount amt difference difference amt m tab set value difference amt difference amt set callout active false return c_payselectionline payamt differenceamt payamt windowno mtab mtab mfield mfield iscalloutactive mtab getvalue c_invoice_id c_invoice_id intvalue c_invoice_id bigdecimal openamt bigdecimal mtab getvalue openamt bigdecimal payamt bigdecimal mtab getvalue payamt bigdecimal discountamt bigdecimal mtab getvalue discountamt setcalloutactive bigdecimal differenceamt openamt payamt discountamt openamt openamt payamt payamt discountamt differenceamt mtab setvalue differenceamt differenceamt setcalloutactive payment selection line invoice called from c payselectionline c invoice id update pay amt difference amt public string invoice properties ctx int window no m tab m tab m field m field object value if is callout active value null return get value int c invoice id integer value int value if c invoice id 0 return int c bankaccount id env get context as int ctx window no c bankaccount id timestamp pay date env get context as date ctx pay date if pay date null pay date new timestamp system current time millis set callout active true big decimal open amt env zero big decimal discount amt env zero boolean isso trx boolean false string sql select currency convert invoice open i c invoice id 0 i c currency id ba c currency id i date invoiced i c conversiontype id i ad client id i ad org id payment term discount i grand total i c currency id i c paymentterm id i date invoiced i isso trx from c invoice v i c bankaccount ba where i c invoice id and ba c bankaccount id 1 2 try prepared statement pstmt db prepare statement sql null pstmt set int 1 c invoice id pstmt set int 2 c bankaccount id pstmt set timestamp 3 pay date result set rs pstmt execute query if rs next open amt rs get big decimal 1 discount amt rs get big decimal 2 isso trx new boolean y equals rs get string 3 rs close pstmt close catch sql exception e log log level severe sql e log fine open amt open amt invoice c invoice id bank acct c bankaccount id m tab set value open amt open amt m tab set value pay amt open amt subtract discount amt m tab set value discount amt discount amt m tab set value difference amt env zero m tab set value isso trx isso trx set callout active false return c_payselectionline c_invoice_id payamt differenceamt windowno mtab mtab mfield mfield iscalloutactive c_invoice_id intvalue c_invoice_id c_bankaccount_id getcontextasint windowno c_bankaccount_id paydate getcontextasdate paydate paydate paydate currenttimemillis setcalloutactive bigdecimal openamt bigdecimal discountamt issotrx currencyconvert invoiceopen c_invoice_id c_currency_id c_currency_id dateinvoiced c_conversiontype_id ad_client_id ad_org_id paymenttermdiscount grandtotal c_currency_id c_paymentterm_id dateinvoiced issotrx c_invoice_v c_bankaccount c_invoice_id c_bankaccount_id preparedstatement preparestatement setint c_invoice_id setint c_bankaccount_id settimestamp paydate resultset executequery openamt getbigdecimal discountamt getbigdecimal issotrx getstring sqlexception openamt openamt c_invoice_id bankacct c_bankaccount_id mtab setvalue openamt openamt mtab setvalue payamt openamt discountamt mtab setvalue discountamt discountamt mtab setvalue differenceamt mtab setvalue issotrx issotrx setcalloutactive default constructor public acct viewer this 0 0 0 acctviewer detail constructor param ad client id client param ad table id table param record id record public acct viewer int ad client id int ad table id int record id super msg get msg env get ctx acct viewer log info ad table id ad table id record id record id set default close operation j frame dispose on close m data new acct viewer data env get ctx env create window no this ad client id ad table id try jb init dyn init ad table id record id a env show center screen this catch exception e log log level severe e dispose ad_client_id ad_table_id record_id acctviewer ad_client_id ad_table_id record_id getmsg getctx acctviewer ad_table_id ad_table_id record_id record_id setdefaultcloseoperation jframe dispose_on_close m_data acctviewerdata getctx createwindowno ad_client_id ad_table_id jbinit dyninit ad_table_id record_id aenv showcenterscreen static init pre main panel tabbed pane query result graph panel pre throws exception private void jb init throws exception image icon ii new image icon org compiere compiere class get resource images info account16 gif set icon image ii get image main layout set hgap 5 main layout set vgap 5 main panel set layout main layout selection panel set layout selection layout this get content pane add main panel border layout center main panel add tabbed pane border layout center selection selection border new titled border border factory create etched border color white new color 148 145 140 msg get msg env get ctx selection selection panel set border selection border lacct schema set label for sel acct schema lacct schema set text msg translate env get ctx c acctschema id lposting type set label for sel posting type lposting type set text msg translate env get ctx posting type sel document set text msg get msg env get ctx select document sel document add action listener this l org set label for sel org l org set text msg translate env get ctx ad org id l acct set label for sel acct l acct set text msg translate env get ctx account id l date set label for sel date from l date set text msg translate env get ctx date acct lsel1 set label for sel1 lsel2 set label for sel2 lsel3 set label for sel3 lsel4 set label for sel4 lsel5 set label for sel5 lsel6 set label for sel6 lsel7 set label for sel7 lsel8 set label for sel8 display display border new titled border border factory create etched border color white new color 148 145 140 msg get msg env get ctx display display panel set border display border display panel set layout display layout display qty set text msg get msg env get ctx display qty display source amt set text msg get msg env get ctx display source info display document info set text msg get msg env get ctx display document info l sort set text msg get msg env get ctx sort by l group set text msg get msg env get ctx group by display panel add display source amt new grid bag constraints 0 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 display panel add display document info new grid bag constraints 0 0 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 display panel add l sort new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 display panel add sort by1 new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 0 5 0 0 display panel add sort by2 new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 0 5 0 0 display panel add group1 new grid bag constraints 1 5 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 0 5 0 0 display panel add group2 new grid bag constraints 1 6 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 0 5 0 0 display panel add l group new grid bag constraints 1 4 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 display panel add display qty new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 display panel add sort by3 new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 5 5 0 5 0 0 display panel add group3 new grid bag constraints 1 7 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 0 5 0 0 display panel add sort by4 new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 display panel add group4 new grid bag constraints 1 8 1 1 0 0 0 0 grid bag constraints center grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lacct schema new grid bag constraints 0 0 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 5 5 0 0 selection panel add sel acct schema new grid bag constraints 1 0 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 5 5 0 0 selection panel add sel document new grid bag constraints 0 1 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 10 5 10 5 0 0 selection panel add sel table new grid bag constraints 1 1 1 1 0 0 0 0 grid bag constraints west grid bag constraints horizontal new insets 10 5 10 5 0 0 selection panel add sel record new grid bag constraints 2 1 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 10 5 10 5 0 0 selection panel add lposting type new grid bag constraints 0 2 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel posting type new grid bag constraints 1 2 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add l date new grid bag constraints 0 3 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel date from new grid bag constraints 1 3 1 1 0 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 5 5 0 5 0 0 selection panel add sel date to new grid bag constraints 2 3 1 1 0 0 0 0 grid bag constraints center grid bag constraints horizontal new insets 5 5 0 5 0 0 selection panel add l org new grid bag constraints 0 4 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 0 0 5 0 0 selection panel add sel org new grid bag constraints 1 4 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add l acct new grid bag constraints 0 5 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel acct new grid bag constraints 1 5 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel1 new grid bag constraints 0 6 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel2 new grid bag constraints 0 7 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel3 new grid bag constraints 0 8 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel1 new grid bag constraints 1 6 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel2 new grid bag constraints 1 7 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel3 new grid bag constraints 1 8 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel4 new grid bag constraints 0 9 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel4 new grid bag constraints 1 9 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel5 new grid bag constraints 0 10 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel5 new grid bag constraints 1 10 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel6 new grid bag constraints 0 11 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel6 new grid bag constraints 1 11 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel7 new grid bag constraints 0 12 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel7 new grid bag constraints 1 12 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 selection panel add lsel8 new grid bag constraints 0 13 1 1 0 0 0 0 grid bag constraints east grid bag constraints none new insets 5 5 0 5 0 0 selection panel add sel8 new grid bag constraints 1 13 2 1 0 0 0 0 grid bag constraints west grid bag constraints none new insets 5 5 0 5 0 0 query layout set hgap 5 query layout set vgap 5 query set layout query layout query add selection panel border layout center query add display panel border layout east tabbed pane add query msg get msg env get ctx viewer query tabbed pane add result msg get msg env get ctx viewer result tabbed pane add graph panel msg get msg env get ctx viewer graph tabbed pane add change listener this result get viewport add table null south south layout set hgap 5 south layout set vgap 5 south panel set layout south layout status line set foreground color blue status line set border border factory create lowere mainpanel tabbedpane graphpanel jbinit imageicon imageicon getresource infoaccount16 seticonimage getimage mainlayout sethgap mainlayout setvgap mainpanel setlayout mainlayout selectionpanel setlayout selectionlayout getcontentpane mainpanel borderlayout mainpanel tabbedpane borderlayout selectionborder titledborder borderfactory createetchedborder getmsg getctx selectionpanel setborder selectionborder lacctschema setlabelfor selacctschema lacctschema settext getctx c_acctschema_id lpostingtype setlabelfor selpostingtype lpostingtype settext getctx postingtype seldocument settext getmsg getctx selectdocument seldocument addactionlistener lorg setlabelfor selorg lorg settext getctx ad_org_id lacct setlabelfor selacct lacct settext getctx account_id ldate setlabelfor seldatefrom ldate settext getctx dateacct setlabelfor setlabelfor setlabelfor setlabelfor setlabelfor setlabelfor setlabelfor setlabelfor displayborder titledborder borderfactory createetchedborder getmsg getctx displaypanel setborder displayborder displaypanel setlayout displaylayout displayqty settext getmsg getctx displayqty displaysourceamt settext getmsg getctx displaysourceinfo displaydocumentinfo settext getmsg getctx displaydocumentinfo lsort settext getmsg getctx sortby lgroup settext getmsg getctx groupby displaypanel displaysourceamt gridbagconstraints gridbagconstraints gridbagconstraints displaypanel displaydocumentinfo gridbagconstraints gridbagconstraints gridbagconstraints displaypanel lsort gridbagconstraints gridbagconstraints gridbagconstraints displaypanel sortby1 gridbagconstraints gridbagconstraints gridbagconstraints displaypanel sortby2 gridbagconstraints gridbagconstraints gridbagconstraints displaypanel gridbagconstraints gridbagconstraints gridbagconstraints displaypanel gridbagconstraints gridbagconstraints gridbagconstraints displaypanel lgroup gridbagconstraints gridbagconstraints gridbagconstraints displaypanel displayqty gridbagconstraints gridbagconstraints gridbagconstraints displaypanel sortby3 gridbagconstraints gridbagconstraints gridbagconstraints displaypanel gridbagconstraints gridbagconstraints gridbagconstraints displaypanel sortby4 gridbagconstraints gridbagconstraints gridbagconstraints displaypanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel lacctschema gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel selacctschema gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel seldocument gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel seltable gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel selrecord gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel lpostingtype gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel selpostingtype gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel ldate gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel seldatefrom gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel seldateto gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel lorg gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel selorg gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel lacct gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel selacct gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints selectionpanel gridbagconstraints gridbagconstraints gridbagconstraints querylayout sethgap querylayout setvgap setlayout querylayout selectionpanel borderlayout displaypanel borderlayout tabbedpane getmsg getctx viewerquery tabbedpane getmsg getctx viewerresult tabbedpane graphpanel getmsg getctx viewergraph tabbedpane addchangelistener getviewport southlayout sethgap southlayout setvgap southpanel setlayout southlayout statusline setforeground statusline setborder borderfactory createlowere dynamic init param ad table id table param record id record private void dyn init int ad table id int record id m data fill acct schema sel acct schema sel acct schema add action listener this action acct schema m data fill table sel table sel table add action listener this sel record set icon m ifind sel record add action listener this sel record set text m data fill posting type sel posting type mandatory elements m data fill org sel org sel acct set action command account id sel acct add action listener this sel acct set text sel acct set icon m ifind document select boolean have doc ad table id 0 record id 0 sel document set selected have doc action document action table status line set text msg get msg env get ctx viewer options initial query if have doc m data ad table id ad table id m data record id record id action query ad_table_id record_id dyninit ad_table_id record_id m_data fillacctschema selacctschema selacctschema addactionlistener actionacctschema m_data filltable seltable seltable addactionlistener selrecord seticon m_ifind selrecord addactionlistener selrecord settext m_data fillpostingtype selpostingtype m_data fillorg selorg selacct setactioncommand account_id selacct addactionlistener selacct settext selacct seticon m_ifind havedoc ad_table_id record_id seldocument setselected havedoc actiondocument actiontable statusline settext getmsg getctx vieweroptions havedoc m_data ad_table_id ad_table_id m_data record_id record_id actionquery dispose public void dispose m data dispose m data null super dispose m_data m_data tab changed param e change event public void state changed change event e log info acct viewer state changed boolean visible m data document query tabbed pane get selected index 1 b re post set visible visible if ini is property bool ini p show advanced force post set visible visible changeevent statechanged changeevent acctviewer statechanged m_data documentquery tabbedpane getselectedindex brepost setvisible ispropertybool p_show_advanced forcepost setvisible action performed action listener param e action event public void action performed action event e log info e get action command object source e get source if source sel acct schema action acct schema else if source b query action query else if source sel document action document else if source sel table action table else if source b re post action re post else if source b print print screen painter print screen this info buttons else if source instanceof c button action button c button source actionevent actionperformed actionevent getactioncommand getsource selacctschema actionacctschema bquery actionquery seldocument actiondocument seltable actiontable brepost actionrepost bprint printscreenpainter printscreen infobuttons cbutton actionbutton cbutton new acct schema private void action acct schema key name pair kp key name pair sel acct schema get selected item if kp null return m data c acctschema id kp get key m data a schema m acct schema get env get ctx m data c acctschema id log info m data a schema to string sort options sort by1 remove all items sort by2 remove all items sort by3 remove all items sort by4 remove all items sort add item new value name pair sort add item new value name pair date acct msg translate env get ctx date acct sort add item new value name pair date trx msg translate env get ctx date trx sort add item new value name pair c period id msg translate env get ctx c period id c label labels new c label lsel1 lsel2 lsel3 lsel4 lsel5 lsel6 lsel7 lsel8 c button buttons new c button sel1 sel2 sel3 sel4 sel5 sel6 sel7 sel8 int selection index 0 m acct schema element elements m data a schema get acct schema elements for int i 0 i elements length selection index labels length i m acct schema element ase elements i string column name ase get column name add sort option sort add item new value name pair column name msg translate env get ctx column name additional elements if ase is element type m acct schema element elementtype organization ase is element type m acct schema element elementtype account labels selection index set text msg translate env get ctx column name labels selection index set visible true buttons selection index set action command column name buttons selection index add action listener this buttons selection index set icon m ifind buttons selection index set text buttons selection index set visible true selection index don t show remaining while selection index labels length labels selection index set visible false buttons selection index set visible false actionacctschema keynamepair keynamepair selacctschema getselecteditem m_data c_acctschema_id getkey m_data aschema macctschema getctx m_data c_acctschema_id m_data aschema tostring sortby1 removeallitems sortby2 removeallitems sortby3 removeallitems sortby4 removeallitems sortadditem valuenamepair sortadditem valuenamepair dateacct getctx dateacct sortadditem valuenamepair datetrx getctx datetrx sortadditem valuenamepair c_period_id getctx c_period_id clabel clabel cbutton cbutton selectionindex macctschemaelement m_data aschema getacctschemaelements selectionindex macctschemaelement columnname getcolumnname sortadditem valuenamepair columnname getctx columnname iselementtype macctschemaelement elementtype_organization iselementtype macctschemaelement elementtype_account selectionindex settext getctx columnname selectionindex setvisible selectionindex setactioncommand columnname selectionindex addactionlistener selectionindex seticon m_ifind selectionindex settext selectionindex setvisible selectionindex selectionindex selectionindex setvisible selectionindex setvisible add to sort param vn name pair private void sort add item value name pair vn sort by1 add item vn sort by2 add item vn sort by3 add item vn sort by4 add item vn sortadditem valuenamepair sortby1 additem sortby2 additem sortby3 additem sortby4 additem query private void action query parameter info string buffer para new string buffer reset selection data m data c acctschema id 0 m data ad org id 0 save selection choices key name pair kp key name pair sel acct schema get selected item if kp null m data c acctschema id kp get key para append c acctschema id append m data c acctschema id value name pair vp value name pair sel posting type get selected item m data posting type vp get value para append posting type append m data posting type document m data document query sel document is selected para append document query append m data document query if sel document is selected if m data ad table id 0 m data record id 0 return para append ad table id append m data ad table id append record id append m data record id else m data date from timestamp sel date from get value para append date from append m data date from m data date to timestamp sel date to get value para append date to append m data date to kp key name pair sel org get selected item if kp null m data ad org id kp get key para append ad org id append m data ad org id iterator it m data where info values iterator while it has next para append append it next save display choices m data display qty display qty is selected para append display qty append m data display qty m data display source amt display source amt is selected para append source append m data display source amt m data display document info display document info is selected para append doc append m data display document info m data sort by1 value name pair sort by1 get selected item get value m data group1 group1 is selected para append sorting append m data sort by1 append append m data group1 m data sort by2 value name pair sort by2 get selected item get value m data group2 group2 is selected para append append m data sort by2 append append m data group2 m data sort by3 value name pair sort by3 get selected item get value m data group3 group3 is selected para append append m data sort by3 append append m data group3 m data sort by4 value name pair sort by4 get selected item get value m data group4 group4 is selected para append append m data sort by4 append append m data group4 b query set enabled false status line set text msg get msg env get ctx processing log config para to string thread yield switch to result pane tabbed pane set selected index 1 set table model with query table set model m data query b query set enabled true status line set text msg get msg env get ctx viewer options actionquery stringbuffer stringbuffer m_data c_acctschema_id m_data ad_org_id keynamepair keynamepair selacctschema getselecteditem m_data c_acctschema_id getkey c_acctschema_id m_data c_acctschema_id valuenamepair valuenamepair selpostingtype getselecteditem m_data postingtype getvalue postingtype m_data postingtype m_data documentquery seldocument isselected documentquery m_data documentquery seldocument isselected m_data ad_table_id m_data record_id ad_table_id m_data ad_table_id record_id m_data record_id m_data datefrom seldatefrom getvalue datefrom m_data datefrom m_data dateto seldateto getvalue dateto m_data dateto keynamepair selorg getselecteditem m_data ad_org_id getkey ad_org_id m_data ad_org_id m_data whereinfo hasnext m_data displayqty displayqty isselected m_data displayqty m_data displaysourceamt displaysourceamt isselected m_data displaysourceamt m_data displaydocumentinfo displaydocumentinfo isselected m_data displaydocumentinfo m_data sortby1 valuenamepair sortby1 getselecteditem getvalue m_data isselected m_data sortby1 m_data m_data sortby2 valuenamepair sortby2 getselecteditem getvalue m_data isselected m_data sortby2 m_data m_data sortby3 valuenamepair sortby3 getselecteditem getvalue m_data isselected m_data sortby3 m_data m_data sortby4 valuenamepair sortby4 getselecteditem getvalue m_data isselected m_data sortby4 m_data bquery setenabled statusline settext getmsg getctx tostring tabbedpane setselectedindex tablemodel setmodel m_data bquery setenabled statusline settext getmsg getctx vieweroptions document selection private void action document boolean doc sel document is selected sel table set enabled doc sel record set enabled doc sel date from set read write doc sel date to set read write doc sel org set enabled doc sel acct set enabled doc sel1 set enabled doc sel2 set enabled doc sel3 set enabled doc sel4 set enabled doc sel5 set enabled doc sel6 set enabled doc sel7 set enabled doc sel8 set enabled doc actiondocument seldocument isselected seltable setenabled selrecord setenabled seldatefrom setreadwrite seldateto setreadwrite selorg setenabled selacct setenabled setenabled setenabled setenabled setenabled setenabled setenabled setenabled setenabled save table selection reset record selection private void action table value name pair vp value name pair sel table get selected item m data ad table id integer m data table info get vp get value int value log config vp get value m data ad table id reset record m data record id 0 sel record set text sel record set action command vp get value id actiontable valuenamepair valuenamepair seltable getselecteditem m_data ad_table_id m_data tableinfo getvalue intvalue getvalue m_data ad_table_id m_data record_id selrecord settext selrecord setactioncommand getvalue _id action button param button pressed button return id private int action button c button button string key column button get action command log info key column string where clause is summary n string lookup column key column if key column equals account id lookup column c elementvalue id m acct schema element ase m data a schema get acct schema element m acct schema element elementtype account if ase null where clause and c element id ase getc element id else if key column equals user1 id lookup column c elementvalue id m acct schema element ase m data a schema get acct schema element m acct schema element elementtype userlist1 if ase null where clause and c element id ase getc element id else if key column equals user2 id lookup column c elementvalue id m acct schema element ase m data a schema get acct schema element m acct schema element elementtype userlist2 if ase null where clause and c element id ase getc element id else if sel document is selected where clause string table name lookup column substring 0 lookup column length 3 info info info create this true m data window no table name lookup column false where clause if info loadedok info dispose info null button set text m data where info put key column return 0 info set visible true string selectsql info get selectedsql c project id 100 or integer key integer info get selected key info null if selectsql null selectsql length 0 key null button set text m data where info put key column no query return 0 save for query log config key column key if button sel record record id m data record id key int value else m data where info put key column key column key int value display selection and resize button set text m data get button text table name lookup column selectsql pack return key int value actionbutton cbutton keycolumn getactioncommand keycolumn whereclause issummary lookupcolumn keycolumn keycolumn account_id lookupcolumn c_elementvalue_id macctschemaelement m_data aschema getacctschemaelement macctschemaelement elementtype_account whereclause c_element_id getc_element_id keycolumn user1_id lookupcolumn c_elementvalue_id macctschemaelement m_data aschema getacctschemaelement macctschemaelement elementtype_userlist1 whereclause c_element_id getc_element_id keycolumn user2_id lookupcolumn c_elementvalue_id macctschemaelement m_data aschema getacctschemaelement macctschemaelement elementtype_userlist2 whereclause c_element_id getc_element_id seldocument isselected whereclause tablename lookupcolumn lookupcolumn m_data windowno tablename lookupcolumn whereclause settext m_data whereinfo keycolumn setvisible getselectedsql c_project_id getselectedkey settext m_data whereinfo keycolumn keycolumn selrecord record_id m_data record_id intvalue m_data whereinfo keycolumn keycolumn intvalue settext m_data getbuttontext tablename lookupcolumn intvalue re post record private void action re post if m data document query m data ad table id 0 m data record id 0 a dialog ask m data window no this post immediate set cursor cursor get predefined cursor cursor wait cursor boolean force force post is selected string error a env post immediate m data window no m data ad client id m data ad table id m data record id force set cursor cursor get default cursor if error null a dialog error 0 this posting error n error action query repost actionrepost m_data documentquery m_data ad_table_id m_data record_id adialog m_data windowno postimmediate setcursor getpredefinedcursor wait_cursor forcepost isselected aenv postimmediate m_data windowno m_data ad_client_id m_data ad_table_id m_data record_id setcursor getdefaultcursor adialog postingerror actionquery standard constructor public x ad process para properties ctx int ad process para id string trx name super ctx ad process para id trx name if ad process para id 0 setad process id 0 setad process para id 0 setad reference id 0 set column name null set entity type null u set field length 0 set is centrally maintained true y set is mandatory false set is range false set name null set seq no 0 sql select nvl max seq no 0 10 as default value from ad process para where ad process id ad process id x_ad_process_para ad_process_para_id trxname ad_process_para_id trxname ad_process_para_id setad_process_id setad_process_para_id setad_reference_id setcolumnname setentitytype setfieldlength setiscentrallymaintained setismandatory setisrange setname setseqno seqno defaultvalue ad_process_para ad_process_id ad_process_id load constructor public x ad process para properties ctx result set rs string trx name super ctx rs trx name x_ad_process_para resultset trxname trxname protected big decimal access level new big decimal 4 access level 4 system protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x ad process para append get id append return sb to string tostring stringbuffer stringbuffer x_ad_process_para get_id tostring set system element system element enables the central maintenance of column description and help public void setad element id int ad element id if ad element id 0 set value ad element id null else set value ad element id new integer ad element id setad_element_id ad_element_id ad_element_id set_value ad_element_id set_value ad_element_id ad_element_id get system element system element enables the central maintenance of column description and help public int getad element id integer ii integer get value ad element id if ii null return 0 return ii int value getad_element_id get_value ad_element_id intvalue set process process or report public void setad process id int ad process id if ad process id 1 throw new illegal argument exception ad process id is mandatory set valuenocheck ad process id new integer ad process id setad_process_id ad_process_id ad_process_id illegalargumentexception ad_process_id set_valuenocheck ad_process_id ad_process_id get process process or report public int getad process id integer ii integer get value ad process id if ii null return 0 return ii int value getad_process_id get_value ad_process_id intvalue set process parameter public void setad process para id int ad process para id if ad process para id 1 throw new illegal argument exception ad process para id is mandatory set valuenocheck ad process para id new integer ad process para id setad_process_para_id ad_process_para_id ad_process_para_id illegalargumentexception ad_process_para_id set_valuenocheck ad_process_para_id ad_process_para_id get process parameter public int getad process para id integer ii integer get value ad process para id if ii null return 0 return ii int value getad_process_para_id get_value ad_process_para_id intvalue public static final int ad reference id ad reference id 1 set reference system reference pick list public void setad reference id int ad reference id if ad reference id 1 throw new illegal argument exception ad reference id is mandatory set value ad reference id new integer ad reference id ad_reference_id_ad_reference_id setad_reference_id ad_reference_id ad_reference_id illegalargumentexception ad_reference_id set_value ad_reference_id ad_reference_id get reference system reference pick list public int getad reference id integer ii integer get value ad reference id if ii null return 0 return ii int value getad_reference_id get_value ad_reference_id intvalue public static final int ad reference value id ad reference id 4 set reference key required to specify if data type is table or list public void setad reference value id int ad reference value id if ad reference value id 0 set value ad reference value id null else set value ad reference value id new integer ad reference value id ad_reference_value_id_ad_reference_id setad_reference_value_id ad_reference_value_id ad_reference_value_id set_value ad_reference_value_id set_value ad_reference_value_id ad_reference_value_id get reference key required to specify if data type is table or list public int getad reference value id integer ii integer get value ad reference value id if ii null return 0 return ii int value getad_reference_value_id get_value ad_reference_value_id intvalue set dynamic validation dynamic validation rule public void setad val rule id int ad val rule id if ad val rule id 0 set value ad val rule id null else set value ad val rule id new integer ad val rule id setad_val_rule_id ad_val_rule_id ad_val_rule_id set_value ad_val_rule_id set_value ad_val_rule_id ad_val_rule_id get dynamic validation dynamic validation rule public int getad val rule id integer ii integer get value ad val rule id if ii null return 0 return ii int value getad_val_rule_id get_value ad_val_rule_id intvalue set db column name name of the column in the database public void set column name string column name if column name null throw new illegal argument exception column name is mandatory if column name length 40 log warning length 40 truncated column name column name substring 0 39 set value column name column name setcolumnname columnname columnname illegalargumentexception columnname columnname columnname columnname set_value columnname columnname get db column name name of the column in the database public string get column name return string get value column name getcolumnname get_value columnname set default logic default value hierarchy separated by public void set default value string default value if default value null default value length 255 log warning length 255 truncated default value default value substring 0 254 set value default value default value setdefaultvalue defaultvalue defaultvalue defaultvalue defaultvalue defaultvalue set_value defaultvalue defaultvalue get default logic default value hierarchy separated by public string get default value return string get value default value getdefaultvalue get_value defaultvalue set default logic 2 default value hierarchy separated by public void set default value2 string default value2 if default value2 null default value2 length 255 log warning length 255 truncated default value2 default value2 substring 0 254 set value default value2 default value2 setdefaultvalue2 defaultvalue2 defaultvalue2 defaultvalue2 defaultvalue2 defaultvalue2 set_value defaultvalue2 defaultvalue2 get default logic 2 default value hierarchy separated by public string get default value2 return string get value default value2 getdefaultvalue2 get_value defaultvalue2 set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value public static final string entitytype usermaintained u set entity type dictionary entity type determines ownership and synchronization public void set entity type string entity type if entity type null throw new illegal argument exception entity type is mandatory if entity type length 4 log warning length 4 truncated entity type entity type substring 0 3 set value entity type entity type entitytype_usermaintained setentitytype entitytype entitytype illegalargumentexception entitytype entitytype entitytype entitytype set_value entitytype entitytype get entity type dictionary entity type determines ownership and synchronization public string get entity type return string get value entity type getentitytype get_value entitytype set length length of the column in the database public void set field length int field length set value field length new integer field length setfieldlength fieldlength set_value fieldlength fieldlength get length length of the column in the database public int get field length integer ii integer get value field length if ii null return 0 return ii int value getfieldlength get_value fieldlength intvalue set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set centrally maintained information maintained in system element table public void set is centrally maintained boolean is centrally maintained set value is centrally maintained new boolean is centrally maintained setiscentrallymaintained iscentrallymaintained set_value iscentrallymaintained iscentrallymaintained get centrally maintained information maintained in system element table public boolean is centrally maintained object oo get value is centrally maintained if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false iscentrallymaintained get_value iscentrallymaintained booleanvalue set mandatory data entry is required in this column public void set is mandatory boolean is mandatory set value is mandatory new boolean is mandatory setismandatory ismandatory set_value ismandatory ismandatory get mandatory data entry is required in this column public boolean is mandatory object oo get value is mandatory if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false ismandatory get_value ismandatory booleanvalue set range the parameter is a range of values public void set is range boolean is range set value is range new boolean is range setisrange isrange set_value isrange isrange get range the parameter is a range of values public boolean is range object oo get value is range if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isrange get_value isrange booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue set value format format of the value can contain fixed format elements variables llooaacca09 public void setv format string v format if v format null v format length 20 log warning length 20 truncated v format v format substring 0 19 set value v format v format _llooaacca09 setvformat vformat vformat vformat vformat vformat set_value vformat vformat get value format format of the value can contain fixed format elements variables llooaacca09 public string getv format return string get value v format _llooaacca09 getvformat get_value vformat set max value maximum value for a field public void set value max string value max if value max null value max length 20 log warning length 20 truncated value max value max substring 0 19 set value value max value max setvaluemax valuemax valuemax valuemax valuemax valuemax set_value valuemax valuemax get max value maximum value for a field public string get value max return string get value value max getvaluemax get_value valuemax set min value minimum value for a field public void set value min string value min if value min null value min length 20 log warning length 20 truncated value min value min substring 0 19 set value value min value min setvaluemin valuemin valuemin valuemin valuemin valuemin set_value valuemin valuemin get min value minimum value for a field public string get value min return string get value value min getvaluemin get_value valuemin standard constructor public x s timetype properties ctx int s timetype id string trx name super ctx s timetype id trx name if s timetype id 0 set name null sets timetype id 0 x_s_timetype s_timetype_id trxname s_timetype_id trxname s_timetype_id setname sets_timetype_id load constructor public x s timetype properties ctx result set rs string trx name super ctx rs trx name x_s_timetype resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x s timetype append get id append return sb to string tostring stringbuffer stringbuffer x_s_timetype get_id tostring set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set comment help comment or hint public void set help string help if help null help length 2000 log warning length 2000 truncated help help substring 0 1999 set value help help sethelp set_value get comment help comment or hint public string get help return string get value help gethelp get_value set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set time type type of time recorded public void sets timetype id int s timetype id if s timetype id 1 throw new illegal argument exception s timetype id is mandatory set valuenocheck s timetype id new integer s timetype id sets_timetype_id s_timetype_id s_timetype_id illegalargumentexception s_timetype_id set_valuenocheck s_timetype_id s_timetype_id get time type type of time recorded public int gets timetype id integer ii integer get value s timetype id if ii null return 0 return ii int value gets_timetype_id get_value s_timetype_id intvalue constructs a new text area a default model is set the initial string is null and rows columns are set to 0 public c text area this new j text area textarea ctextarea jtextarea constructs a new text area with the specified text displayed a default model is created and rows columns are set to 0 param text the text to be displayed or null public c text area string text this new j text area text textarea ctextarea jtextarea constructs a new empty text area with the specified number of rows and columns a default model is created and the initial string is null param rows the number of rows 0 param columns the number of columns 0 exception illegal argument exception if the rows or columns arguments are negative public c text area int rows int columns this new j text area rows columns textarea illegalargumentexception ctextarea jtextarea constructs a new text area with the specified text and number of rows and columns a default model is created param text the text to be displayed or null param rows the number of rows 0 param columns the number of columns 0 exception illegal argument exception if the rows or columns arguments are negative public c text area string text int rows int columns this new j text area text rows columns textarea illegalargumentexception ctextarea jtextarea constructs a new j text area with the given document model and defaults for all of the other arguments null 0 0 param doc the model to use public c text area document doc this new j text area doc jtextarea ctextarea jtextarea constructs a new j text area with the specified number of rows and columns and the given model all of the constructors feed through this constructor param doc the model to use or create a default one if null param text the text to be displayed null if none param rows the number of rows 0 param columns the number of columns 0 exception illegal argument exception if the rows or columns arguments are negative public c text area document doc string text int rows int columns this new j text area doc text rows columns jtextarea illegalargumentexception ctextarea jtextarea create a j scroll area with a j text area use cpmpiere colors line wrap param text area public c text area j text area text area super text area m textarea text area super set opaque false super get viewport set opaque false m textarea set font compiereplaf getfont field m textarea set foreground compiereplaf gettextcolor normal m textarea set line wrap true m textarea set wrap style word true overwrite default tab m textarea fire property change editable is editable is editable jscrollarea jtextarea textarea ctextarea jtextarea textarea textarea m_textarea textarea setopaque getviewport setopaque m_textarea setfont getfont_field m_textarea setforeground gettextcolor_normal m_textarea setlinewrap m_textarea setwrapstyleword m_textarea firepropertychange iseditable iseditable set editor mandatory param mandatory true if you have to enter data public void set mandatory boolean mandatory m mandatory mandatory set background false setmandatory m_mandatory setbackground is field mandatory return true if mandatory public boolean is mandatory return m mandatory ismandatory m_mandatory enable editor param rw true if you can enter select data public void set read write boolean rw if m textarea is editable rw m textarea set editable rw set background false setreadwrite m_textarea iseditable m_textarea seteditable setbackground is it possible to edit return true if editable public boolean is read write return m textarea is editable isreadwrite m_textarea iseditable set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable public void set background boolean error if error set background compiereplaf getfieldbackground error else if is read write set background compiereplaf getfieldbackground inactive else if m mandatory set background compiereplaf getfieldbackground mandatory else set background compiereplaf getfieldbackground normal setbackground setbackground getfieldbackground_error isreadwrite setbackground getfieldbackground_inactive m_mandatory setbackground getfieldbackground_mandatory setbackground getfieldbackground_normal public void set background color color if color equals get background return if m textarea null during init super set background color else m textarea set background color setbackground getbackground m_textarea setbackground m_textarea setbackground public color get background if m textarea null during init return super get background else return m textarea get background getbackground m_textarea getbackground m_textarea getbackground public void set foreground color color if m textarea null during init super set foreground color else m textarea set foreground color setforeground m_textarea setforeground m_textarea setforeground public color get foreground if m textarea null during init return super get foreground else return m textarea get foreground getforeground m_textarea getforeground m_textarea getforeground set editor to value param value value of the editor public void set value object value if value null m textarea set text else m textarea set text value to string setvalue m_textarea settext m_textarea settext tostring return editor value return current value public object get value return m textarea get text getvalue m_textarea gettext return display value return displayed string value public string get display return m textarea get text getdisplay m_textarea gettext set text and position top param text public void set text string text m textarea set text text m textarea set caret position 0 settext m_textarea settext m_textarea setcaretposition m textarea set caret position 0 public string get text return m textarea get text m_textarea setcaretposition gettext m_textarea gettext return m textarea get text public void append string text m textarea append text m_textarea gettext m_textarea public void set columns int cols m textarea set columns cols setcolumns m_textarea setcolumns m textarea set columns cols public int get columns return m textarea get columns m_textarea setcolumns getcolumns m_textarea getcolumns public void set rows int rows m textarea set rows rows setrows m_textarea setrows m textarea set rows rows public int get rows return m textarea get rows m_textarea setrows getrows m_textarea getrows public void set caret position int pos m textarea set caret position pos setcaretposition m_textarea setcaretposition m textarea set caret position pos public int get caret position return m textarea get caret position m_textarea setcaretposition getcaretposition m_textarea getcaretposition public void set editable boolean edit m textarea set editable edit seteditable m_textarea seteditable m textarea set editable edit public boolean is editable return m textarea is editable m_textarea seteditable iseditable m_textarea iseditable public void set line wrap boolean wrap m textarea set line wrap wrap setlinewrap m_textarea setlinewrap m textarea set line wrap wrap public void set wrap style word boolean word m textarea set wrap style word word m_textarea setlinewrap setwrapstyleword m_textarea setwrapstyleword public void set opaque boolean is opaque j scroll pane viewport is always not opaque if m textarea null during init of j scroll pane super set opaque is opaque else m textarea set opaque is opaque setopaque isopaque jscrollpane m_textarea jscrollpane setopaque isopaque m_textarea setopaque isopaque public void add focus listener focus listener l if m textarea null during init super add focus listener l else m textarea add focus listener l addfocuslistener focuslistener m_textarea addfocuslistener m_textarea addfocuslistener m textarea add focus listener l public void add mouse listener mouse listener l m textarea add mouse listener l m_textarea addfocuslistener addmouselistener mouselistener m_textarea addmouselistener m textarea add mouse listener l public void add key listener key listener l m textarea add key listener l m_textarea addmouselistener addkeylistener keylistener m_textarea addkeylistener public void add input method listener input method listener l m textarea add input method listener l addinputmethodlistener inputmethodlistener m_textarea addinputmethodlistener m textarea add input method listener l public input method requests get input method requests return m textarea get input method requests m_textarea addinputmethodlistener inputmethodrequests getinputmethodrequests m_textarea getinputmethodrequests return m textarea get input method requests public void set input verifier input verifier l m textarea set input verifier l m_textarea getinputmethodrequests setinputverifier inputverifier m_textarea setinputverifier standard constructor public x pa report properties ctx int pa report id string trx name super ctx pa report id trx name if pa report id 0 setc acctschema id 0 setc calendar id 0 set list sources false set list trx false set name null setpa reportcolumnset id 0 setpa reportlineset id 0 setpa report id 0 set processing false x_pa_report pa_report_id trxname pa_report_id trxname pa_report_id setc_acctschema_id setc_calendar_id setlistsources setlisttrx setname setpa_reportcolumnset_id setpa_reportlineset_id setpa_report_id setprocessing load constructor public x pa report properties ctx result set rs string trx name super ctx rs trx name x_pa_report resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa report append get id append return sb to string tostring stringbuffer stringbuffer x_pa_report get_id tostring set print format data print format public void setad printformat id int ad printformat id if ad printformat id 0 set value ad printformat id null else set value ad printformat id new integer ad printformat id setad_printformat_id ad_printformat_id ad_printformat_id set_value ad_printformat_id set_value ad_printformat_id ad_printformat_id get print format data print format public int getad printformat id integer ii integer get value ad printformat id if ii null return 0 return ii int value getad_printformat_id get_value ad_printformat_id intvalue set accounting schema rules for accounting public void setc acctschema id int c acctschema id if c acctschema id 1 throw new illegal argument exception c acctschema id is mandatory set value c acctschema id new integer c acctschema id setc_acctschema_id c_acctschema_id c_acctschema_id illegalargumentexception c_acctschema_id set_value c_acctschema_id c_acctschema_id get accounting schema rules for accounting public int getc acctschema id integer ii integer get value c acctschema id if ii null return 0 return ii int value getc_acctschema_id get_value c_acctschema_id intvalue set calendar accounting calendar name public void setc calendar id int c calendar id if c calendar id 1 throw new illegal argument exception c calendar id is mandatory set value c calendar id new integer c calendar id setc_calendar_id c_calendar_id c_calendar_id illegalargumentexception c_calendar_id set_value c_calendar_id c_calendar_id get calendar accounting calendar name public int getc calendar id integer ii integer get value c calendar id if ii null return 0 return ii int value getc_calendar_id get_value c_calendar_id intvalue set description optional short description of the record public void set description string description if description null description length 255 log warning length 255 truncated description description substring 0 254 set value description description setdescription set_value get description optional short description of the record public string get description return string get value description getdescription get_value set list sources list report line sources public void set list sources boolean list sources set value list sources new boolean list sources setlistsources listsources set_value listsources listsources get list sources list report line sources public boolean is list sources object oo get value list sources if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islistsources get_value listsources booleanvalue set list transactions list the report transactions public void set list trx boolean list trx set value list trx new boolean list trx setlisttrx listtrx set_value listtrx listtrx get list transactions list the report transactions public boolean is list trx object oo get value list trx if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false islisttrx get_value listtrx booleanvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 60 log warning length 60 truncated name name substring 0 59 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname set report column set collection of columns for report public void setpa reportcolumnset id int pa reportcolumnset id if pa reportcolumnset id 1 throw new illegal argument exception pa reportcolumnset id is mandatory set value pa reportcolumnset id new integer pa reportcolumnset id setpa_reportcolumnset_id pa_reportcolumnset_id pa_reportcolumnset_id illegalargumentexception pa_reportcolumnset_id set_value pa_reportcolumnset_id pa_reportcolumnset_id get report column set collection of columns for report public int getpa reportcolumnset id integer ii integer get value pa reportcolumnset id if ii null return 0 return ii int value getpa_reportcolumnset_id get_value pa_reportcolumnset_id intvalue set report line set public void setpa reportlineset id int pa reportlineset id if pa reportlineset id 1 throw new illegal argument exception pa reportlineset id is mandatory set value pa reportlineset id new integer pa reportlineset id setpa_reportlineset_id pa_reportlineset_id pa_reportlineset_id illegalargumentexception pa_reportlineset_id set_value pa_reportlineset_id pa_reportlineset_id get report line set public int getpa reportlineset id integer ii integer get value pa reportlineset id if ii null return 0 return ii int value getpa_reportlineset_id get_value pa_reportlineset_id intvalue set financial report financial report public void setpa report id int pa report id if pa report id 1 throw new illegal argument exception pa report id is mandatory set valuenocheck pa report id new integer pa report id setpa_report_id pa_report_id pa_report_id illegalargumentexception pa_report_id set_valuenocheck pa_report_id pa_report_id get financial report financial report public int getpa report id integer ii integer get value pa report id if ii null return 0 return ii int value getpa_report_id get_value pa_report_id intvalue set process now public void set processing boolean processing set value processing new boolean processing setprocessing set_value get process now public boolean is processing object oo get value processing if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessing get_value booleanvalue standard constructor public x m discountschemaline properties ctx int m discountschemaline id string trx name super ctx m discountschemaline id trx name if m discountschemaline id 0 setc conversiontype id 0 set conversion date new timestamp system current time millis date setlimit addamt env zero setlimit base null x setlimit discount env zero setlimit maxamt env zero setlimit minamt env zero setlimit rounding null c setlist addamt env zero setlist base null l setlist discount env zero setlist maxamt env zero setlist minamt env zero setlist rounding null c setm discountschemaline id 0 setm discountschema id 0 set seq no 0 sql select nvl max seq no 0 10 as default value from m discountschemaline where m discountschema id m discountschema id setstd addamt env zero setstd base null s setstd discount env zero setstd maxamt env zero setstd minamt env zero setstd rounding null c x_m_discountschemaline m_discountschemaline_id trxname m_discountschemaline_id trxname m_discountschemaline_id setc_conversiontype_id setconversiondate currenttimemillis setlimit_addamt setlimit_base setlimit_discount setlimit_maxamt setlimit_minamt setlimit_rounding setlist_addamt setlist_base setlist_discount setlist_maxamt setlist_minamt setlist_rounding setm_discountschemaline_id setm_discountschema_id setseqno seqno defaultvalue m_discountschemaline m_discountschema_id m_discountschema_id setstd_addamt setstd_base setstd_discount setstd_maxamt setstd_minamt setstd_rounding load constructor public x m discountschemaline properties ctx result set rs string trx name super ctx rs trx name x_m_discountschemaline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x m discountschemaline append get id append return sb to string tostring stringbuffer stringbuffer x_m_discountschemaline get_id tostring set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue set currency type currency conversion rate type public void setc conversiontype id int c conversiontype id if c conversiontype id 1 throw new illegal argument exception c conversiontype id is mandatory set value c conversiontype id new integer c conversiontype id setc_conversiontype_id c_conversiontype_id c_conversiontype_id illegalargumentexception c_conversiontype_id set_value c_conversiontype_id c_conversiontype_id get currency type currency conversion rate type public int getc conversiontype id integer ii integer get value c conversiontype id if ii null return 0 return ii int value getc_conversiontype_id get_value c_conversiontype_id intvalue set conversion date date for selecting conversion rate public void set conversion date timestamp conversion date if conversion date null throw new illegal argument exception conversion date is mandatory set value conversion date conversion date setconversiondate conversiondate conversiondate illegalargumentexception conversiondate set_value conversiondate conversiondate get conversion date date for selecting conversion rate public timestamp get conversion date return timestamp get value conversion date getconversiondate get_value conversiondate set limit price surcharge amount amount added to the converted copied price before multiplying public void setlimit addamt big decimal limit addamt if limit addamt null throw new illegal argument exception limit addamt is mandatory set value limit addamt limit addamt setlimit_addamt bigdecimal limit_addamt limit_addamt illegalargumentexception limit_addamt set_value limit_addamt limit_addamt get limit price surcharge amount amount added to the converted copied price before multiplying public big decimal getlimit addamt big decimal bd big decimal get value limit addamt if bd null return env zero return bd bigdecimal getlimit_addamt bigdecimal bigdecimal get_value limit_addamt public static final string limit base limitpoprice x set limit price base base price for calculation of the new price public void setlimit base string limit base if limit base null throw new illegal argument exception limit base is mandatory if limit base equals f limit base equals l limit base equals s limit base equals x else throw new illegal argument exception limit base invalid value limit base reference id 194 f l s x if limit base length 1 log warning length 1 truncated limit base limit base substring 0 0 set value limit base limit base limit_base_limitpoprice setlimit_base limit_base limit_base illegalargumentexception limit_base limit_base limit_base limit_base limit_base illegalargumentexception limit_base limit_base reference_id limit_base limit_base limit_base set_value limit_base limit_base get limit price base base price for calculation of the new price public string getlimit base return string get value limit base getlimit_base get_value limit_base set limit price discount discount in percent to be subtracted from base if negative it will be added to base price public void setlimit discount big decimal limit discount if limit discount null throw new illegal argument exception limit discount is mandatory set value limit discount limit discount setlimit_discount bigdecimal limit_discount limit_discount illegalargumentexception limit_discount set_value limit_discount limit_discount get limit price discount discount in percent to be subtracted from base if negative it will be added to base price public big decimal getlimit discount big decimal bd big decimal get value limit discount if bd null return env zero return bd bigdecimal getlimit_discount bigdecimal bigdecimal get_value limit_discount set fixed limit price fixed limit price not calculated public void setlimit fixed big decimal limit fixed set value limit fixed limit fixed setlimit_fixed bigdecimal limit_fixed set_value limit_fixed limit_fixed get fixed limit price fixed limit price not calculated public big decimal getlimit fixed big decimal bd big decimal get value limit fixed if bd null return env zero return bd bigdecimal getlimit_fixed bigdecimal bigdecimal get_value limit_fixed set limit price max margin maximum difference to original limit price ignored if zero public void setlimit maxamt big decimal limit maxamt if limit maxamt null throw new illegal argument exception limit maxamt is mandatory set value limit maxamt limit maxamt setlimit_maxamt bigdecimal limit_maxamt limit_maxamt illegalargumentexception limit_maxamt set_value limit_maxamt limit_maxamt get limit price max margin maximum difference to original limit price ignored if zero public big decimal getlimit maxamt big decimal bd big decimal get value limit maxamt if bd null return env zero return bd bigdecimal getlimit_maxamt bigdecimal bigdecimal get_value limit_maxamt set limit price min margin minimum difference to original limit price ignored if zero public void setlimit minamt big decimal limit minamt if limit minamt null throw new illegal argument exception limit minamt is mandatory set value limit minamt limit minamt setlimit_minamt bigdecimal limit_minamt limit_minamt illegalargumentexception limit_minamt set_value limit_minamt limit_minamt get limit price min margin minimum difference to original limit price ignored if zero public big decimal getlimit minamt big decimal bd big decimal get value limit minamt if bd null return env zero return bd bigdecimal getlimit_minamt bigdecimal bigdecimal get_value limit_minamt public static final string limit rounding ten10002000 t set limit price rounding rounding of the final result public void setlimit rounding string limit rounding if limit rounding null throw new illegal argument exception limit rounding is mandatory if limit rounding equals 0 limit rounding equals 5 limit rounding equals c limit rounding equals d limit rounding equals n limit rounding equals q limit rounding equals t else throw new illegal argument exception limit rounding invalid value limit rounding reference id 155 0 5 c d n q t if limit rounding length 1 log warning length 1 truncated limit rounding limit rounding substring 0 0 set value limit rounding limit rounding limit_rounding_ten10002000 setlimit_rounding limit_rounding limit_rounding illegalargumentexception limit_rounding limit_rounding limit_rounding limit_rounding limit_rounding limit_rounding limit_rounding limit_rounding illegalargumentexception limit_rounding limit_rounding reference_id limit_rounding limit_rounding limit_rounding set_value limit_rounding limit_rounding get limit price rounding rounding of the final result public string getlimit rounding return string get value limit rounding getlimit_rounding get_value limit_rounding set list price surcharge amount list price surcharge amount public void setlist addamt big decimal list addamt if list addamt null throw new illegal argument exception list addamt is mandatory set value list addamt list addamt setlist_addamt bigdecimal list_addamt list_addamt illegalargumentexception list_addamt set_value list_addamt list_addamt get list price surcharge amount list price surcharge amount public big decimal getlist addamt big decimal bd big decimal get value list addamt if bd null return env zero return bd bigdecimal getlist_addamt bigdecimal bigdecimal get_value list_addamt public static final string list base limitpoprice x set list price base price used as the basis for price list calculations public void setlist base string list base if list base null throw new illegal argument exception list base is mandatory if list base equals f list base equals l list base equals s list base equals x else throw new illegal argument exception list base invalid value list base reference id 194 f l s x if list base length 1 log warning length 1 truncated list base list base substring 0 0 set value list base list base list_base_limitpoprice setlist_base list_base list_base illegalargumentexception list_base list_base list_base list_base list_base illegalargumentexception list_base list_base reference_id list_base list_base list_base set_value list_base list_base get list price base price used as the basis for price list calculations public string getlist base return string get value list base getlist_base get_value list_base set list price discount discount from list price as a percentage public void setlist discount big decimal list discount if list discount null throw new illegal argument exception list discount is mandatory set value list discount list discount setlist_discount bigdecimal list_discount list_discount illegalargumentexception list_discount set_value list_discount list_discount get list price discount discount from list price as a percentage public big decimal getlist discount big decimal bd big decimal get value list discount if bd null return env zero return bd bigdecimal getlist_discount bigdecimal bigdecimal get_value list_discount set fixed list price fixes list price not calculated public void setlist fixed big decimal list fixed set value list fixed list fixed setlist_fixed bigdecimal list_fixed set_value list_fixed list_fixed get fixed list price fixes list price not calculated public big decimal getlist fixed big decimal bd big decimal get value list fixed if bd null return env zero return bd bigdecimal getlist_fixed bigdecimal bigdecimal get_value list_fixed set list price max margin maximum margin for a product public void setlist maxamt big decimal list maxamt if list maxamt null throw new illegal argument exception list maxamt is mandatory set value list maxamt list maxamt setlist_maxamt bigdecimal list_maxamt list_maxamt illegalargumentexception list_maxamt set_value list_maxamt list_maxamt get list price max margin maximum margin for a product public big decimal getlist maxamt big decimal bd big decimal get value list maxamt if bd null return env zero return bd bigdecimal getlist_maxamt bigdecimal bigdecimal get_value list_maxamt set list price min margin minimum margin for a product public void setlist minamt big decimal list minamt if list minamt null throw new illegal argument exception list minamt is mandatory set value list minamt list minamt setlist_minamt bigdecimal list_minamt list_minamt illegalargumentexception list_minamt set_value list_minamt list_minamt get list price min margin minimum margin for a product public big decimal getlist minamt big decimal bd big decimal get value list minamt if bd null return env zero return bd bigdecimal getlist_minamt bigdecimal bigdecimal get_value list_minamt public static final string list rounding ten10002000 t set list price rounding rounding rule for final list price public void setlist rounding string list rounding if list rounding null throw new illegal argument exception list rounding is mandatory if list rounding equals 0 list rounding equals 5 list rounding equals c list rounding equals d list rounding equals n list rounding equals q list rounding equals t else throw new illegal argument exception list rounding invalid value list rounding reference id 155 0 5 c d n q t if list rounding length 1 log warning length 1 truncated list rounding list rounding substring 0 0 set value list rounding list rounding list_rounding_ten10002000 setlist_rounding list_rounding list_rounding illegalargumentexception list_rounding list_rounding list_rounding list_rounding list_rounding list_rounding list_rounding list_rounding illegalargumentexception list_rounding list_rounding reference_id list_rounding list_rounding list_rounding set_value list_rounding list_rounding get list price rounding rounding rule for final list price public string getlist rounding return string get value list rounding getlist_rounding get_value list_rounding set discount pricelist line of the pricelist trade discount schema public void setm discountschemaline id int m discountschemaline id if m discountschemaline id 1 throw new illegal argument exception m discountschemaline id is mandatory set valuenocheck m discountschemaline id new integer m discountschemaline id setm_discountschemaline_id m_discountschemaline_id m_discountschemaline_id illegalargumentexception m_discountschemaline_id set_valuenocheck m_discountschemaline_id m_discountschemaline_id get discount pricelist line of the pricelist trade discount schema public int getm discountschemaline id integer ii integer get value m discountschemaline id if ii null return 0 return ii int value getm_discountschemaline_id get_value m_discountschemaline_id intvalue set discount schema schema to calculate the trade discount percentage public void setm discountschema id int m discountschema id if m discountschema id 1 throw new illegal argument exception m discountschema id is mandatory set valuenocheck m discountschema id new integer m discountschema id setm_discountschema_id m_discountschema_id m_discountschema_id illegalargumentexception m_discountschema_id set_valuenocheck m_discountschema_id m_discountschema_id get discount schema schema to calculate the trade discount percentage public int getm discountschema id integer ii integer get value m discountschema id if ii null return 0 return ii int value getm_discountschema_id get_value m_discountschema_id intvalue set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set sequence method of ordering records lowest number comes first public void set seq no int seq no set value seq no new integer seq no setseqno seqno set_value seqno seqno get sequence method of ordering records lowest number comes first public int get seq no integer ii integer get value seq no if ii null return 0 return ii int value getseqno get_value seqno intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of get seq no intvalue keynamepair getkeynamepair keynamepair get_id valueof getseqno set standard price surcharge amount amount added to a price as a surcharge public void setstd addamt big decimal std addamt if std addamt null throw new illegal argument exception std addamt is mandatory set value std addamt std addamt setstd_addamt bigdecimal std_addamt std_addamt illegalargumentexception std_addamt set_value std_addamt std_addamt get standard price surcharge amount amount added to a price as a surcharge public big decimal getstd addamt big decimal bd big decimal get value std addamt if bd null return env zero return bd bigdecimal getstd_addamt bigdecimal bigdecimal get_value std_addamt public static final string std base limitpoprice x set standard price base base price for calculating new standard price public void setstd base string std base if std base null throw new illegal argument exception std base is mandatory if std base equals f std base equals l std base equals s std base equals x else throw new illegal argument exception std base invalid value std base reference id 194 f l s x if std base length 1 log warning length 1 truncated std base std base substring 0 0 set value std base std base std_base_limitpoprice setstd_base std_base std_base illegalargumentexception std_base std_base std_base std_base std_base illegalargumentexception std_base std_base reference_id std_base std_base std_base set_value std_base std_base get standard price base base price for calculating new standard price public string getstd base return string get value std base getstd_base get_value std_base set standard price discount discount percentage to subtract from base price public void setstd discount big decimal std discount if std discount null throw new illegal argument exception std discount is mandatory set value std discount std discount setstd_discount bigdecimal std_discount std_discount illegalargumentexception std_discount set_value std_discount std_discount get standard price discount discount percentage to subtract from base price public big decimal getstd discount big decimal bd big decimal get value std discount if bd null return env zero return bd bigdecimal getstd_discount bigdecimal bigdecimal get_value std_discount set fixed standard price fixed standard price not calculated public void setstd fixed big decimal std fixed set value std fixed std fixed setstd_fixed bigdecimal std_fixed set_value std_fixed std_fixed get fixed standard price fixed standard price not calculated public big decimal getstd fixed big decimal bd big decimal get value std fixed if bd null return env zero return bd bigdecimal getstd_fixed bigdecimal bigdecimal get_value std_fixed set standard max margin maximum margin allowed for a product public void setstd maxamt big decimal std maxamt if std maxamt null throw new illegal argument exception std maxamt is mandatory set value std maxamt std maxamt setstd_maxamt bigdecimal std_maxamt std_maxamt illegalargumentexception std_maxamt set_value std_maxamt std_maxamt get standard max margin maximum margin allowed for a product public big decimal getstd maxamt big decimal bd big decimal get value std maxamt if bd null return env zero return bd bigdecimal getstd_maxamt bigdecimal bigdecimal get_value std_maxamt set standard price min margin minimum margin allowed for a product public void setstd minamt big decimal std minamt if std minamt null throw new illegal argument exception std minamt is mandatory set value std minamt std minamt setstd_minamt bigdecimal std_minamt std_minamt illegalargumentexception std_minamt set_value std_minamt std_minamt get standard price min margin minimum margin allowed for a product public big decimal getstd minamt big decimal bd big decimal get value std minamt if bd null return env zero return bd bigdecimal getstd_minamt bigdecimal bigdecimal get_value std_minamt public static final string std rounding ten10002000 t set standard price rounding rounding rule for calculated price public void setstd rounding string std rounding if std rounding null throw new illegal argument exception std rounding is mandatory if std rounding equals 0 std rounding equals 5 std rounding equals c std rounding equals d std rounding equals n std rounding equals q std rounding equals t else throw new illegal argument exception std rounding invalid value std rounding reference id 155 0 5 c d n q t if std rounding length 1 log warning length 1 truncated std rounding std rounding substring 0 0 set value std rounding std rounding std_rounding_ten10002000 setstd_rounding std_rounding std_rounding illegalargumentexception std_rounding std_rounding std_rounding std_rounding std_rounding std_rounding std_rounding std_rounding illegalargumentexception std_rounding std_rounding reference_id std_rounding std_rounding std_rounding set_value std_rounding std_rounding get standard price rounding rounding rule for calculated price public string getstd rounding return string get value std rounding getstd_rounding get_value std_rounding database db2 public db db2 db_db2 get database name return database short name public string get name return database db db2 getname db_db2 get database description return database long name and version public string get description try if s driver null get driver catch exception e if s driver null return s driver to string return no driver getdescription s_driver getdriver s_driver s_driver tostring get standard jdbc port return standard port public int get standard port return default port 0 getstandardport default_port_0 get and register database driver return driver public driver get driver throws sql exception if s driver null s driver new db2 driver driver manager register driver s driver driver manager set login timeout database connection timeout return s driver getdriver sqlexception s_driver s_driver db2driver drivermanager registerdriver s_driver drivermanager setlogintimeout connection_timeout s_driver get database connection string pre timing pre param connection connection descriptor return connection string public string get connectionurl c connection connection string buffer sb null connection server port database sb new string buffer jdbc db2 cloudscape jdbc db2j net sb append append connection get db host append append connection get db port append append connection get db name m connectionurl sb to string log config m connectionurl m username connection get db uid return m connectionurl getconnectionurl cconnection stringbuffer stringbuffer getdbhost getdbport getdbname m_connectionurl tostring m_connectionurl m_username getdbuid m_connectionurl get connection url param db host db host param db port db port param db name db name param user name user name return connection public string get connectionurl string db host int db port string db name string user name m username user name return jdbc db2 db host db port db name dbhost dbport dbname username getconnectionurl dbhost dbport dbname username m_username username dbhost dbport dbname get jdbc catalog return null not used public string get catalog return null getcatalog get jdbc schema return user name public string get schema if m username null return m username to upper case log severe user name not set yet call get connectionurl first return null getschema m_username m_username touppercase getconnectionurl supports blob return true if blob is supported public boolean supportsblob return true string representation return info public string to string string buffer sb new string buffer db db2 sb append m connectionurl sb append return sb to string tostring stringbuffer stringbuffer db_db2 m_connectionurl tostring get status return status info public string get status string buffer sb new string buffer return sb to string getstatus stringbuffer stringbuffer tostring convert an individual oracle style statements to target database statement syntax param ora statement oracle statement return converted statement oracle statement public string convert statement string ora statement return ora statement orastatement convertstatement orastatement orastatement get name of system user return system public string get system user return db2adm getsystemuser get name of system database param database name database name return e g master or database name public string get system database string database name return database name databasename getsystemdatabase databasename databasename create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return to date 1999 12 31 23 59 59 yyyy mm dd hh24 mi ss or timestamp 2000 01 10 00 00 00 000000 public string to date timestamp time boolean day only if time null if day only return trunc current timestamp return current timestamp timestamp 2000 01 10 00 00 00 000000 string buffer date string new string buffer timestamp yyyy mm dd hh24 mi ss mmmm jdbc timestamp format string my date time to string if day only date string append my date substring 0 10 date string append 00 00 00 000000 else my date my date replace my date my date replace date string append my date date string append 00 return date string to string dayonly to_date to_date dayonly dayonly stringbuffer datestring stringbuffer mydate tostring dayonly datestring mydate datestring mydate mydate mydate mydate datestring mydate datestring datestring tostring create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env public string to char string column name int display type string ad language return column name string buffer ret value new string buffer trim to char ret value append column name numbers if display type is numeric display type if display type display type amount ret value append 9g999g990d00 else ret value append tm9 to char grand total 9g999g990d00 nls numeric characters if language is decimal point ad language reversed ret value append nls numeric characters else if display type is date display type ret value append append language get language ad language getd bdate pattern append ret value append return ret value to string columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype to_char columnname displaytype ad_language columnname stringbuffer retvalue stringbuffer to_char retvalue columnname displaytype isnumeric displaytype displaytype displaytype retvalue retvalue to_char grandtotal nls_numeric_characters isdecimalpoint ad_language retvalue nls_numeric_characters displaytype isdate displaytype retvalue getlanguage ad_language getdbdatepattern retvalue retvalue tostring return number as string for insert statements with correct precision param number number param display type display type return number as string public string to number big decimal number int display type if number null return null return number to string displaytype to_number bigdecimal displaytype tostring get sql commands the following variables are resolved system password compiere user compiere password system password database name database device param cmd type cmd return array of commands to be executed public string get commands int cmd type if cmd create user cmd type return new string if cmd create database cmd type return new string if cmd drop database cmd type return new string return null systempassword compiereuser compierepassword systempassword databasename databasedevice cmdtype cmd_ getcommands cmdtype cmd_create_user cmdtype cmd_create_database cmdtype cmd_drop_database cmdtype create data source param connection connection return data dource public data source get data source c connection connection if m ds null m ds new db2 simple data source m ds set server name connection get db host m ds set port number connection get db port m ds set database name connection get db name m ds set description compiere data source m ds set user connection get db uid m ds set password connection get db pwd m ds set login timeout 5 seconds m ds set use cached cursor true return m ds datasource datasource getdatasource cconnection m_ds m_ds db2simpledatasource m_ds setservername getdbhost m_ds setportnumber getdbport m_ds setdatabasename getdbname m_ds setdescription datasource m_ds setuser getdbuid m_ds setpassword getdbpwd m_ds setlogintimeout m_ds setusecachedcursor m_ds get cached connection param connection info param auto commit true if autocommit connection param transaction isolation connection transaction level return connection or null public connection get cached connection c connection connection boolean auto commit int transaction isolation throws exception connection conn get data source connection get connection conn set auto commit auto commit conn set transaction isolation transaction isolation return conn autocommit transactionisolation getcachedconnection cconnection autocommit transactionisolation getdatasource getconnection setautocommit autocommit settransactionisolation transactionisolation get connection from driver param connection info return connection or null public connection get driver connection c connection connection throws sql exception get driver return driver manager get connection get connectionurl connection connection get db uid connection get db pwd getdriverconnection cconnection sqlexception getdriver drivermanager getconnection getconnectionurl getdbuid getdbpwd get driver connection param db url url param db uid user param db pwd password return connection throws sql exception public connection get driver connection string db url string db uid string db pwd throws sql exception get driver return driver manager get connection db url db uid db pwd dburl dbuid dbpwd sqlexception getdriverconnection dburl dbuid dbpwd sqlexception getdriver drivermanager getconnection dburl dbuid dbpwd close public void close log config to string m ds null tostring m_ds clean up public void cleanup log config get data type param display type display type param precision precision param default value if true adds default value return data type public string get data type int display type int precision boolean default value string ret value null switch display type i ds case display type account case display type assignment case display type color case display type id case display type location case display type locator case display type p attribute case display type search case display type table case display type table dir ret value integer break dynamic precision case display type amount ret value decimal 18 2 if default value ret value default 0 break case display type binary case display type image ret value blob break case display type button ret value char 1 break number dynamic precision case display type cost price ret value decimal 22 6 if default value ret value default 0 break date case display type date case display type date time case display type time ret value timestamp if default value ret value default 0 break number 10 case display type integer ret value number 10 break case display type list ret value char precision break nvarchar case display type memo case display type string case display type text ret value nvarchar precision break case display type text long ret value clob break dyn prec case display type quantity ret value number break case display type yes no ret value char 1 break default log severe unknown display type break return ret value displaytype defaultvalue getdatatype displaytype defaultvalue retvalue displaytype ids displaytype displaytype displaytype displaytype displaytype displaytype displaytype pattribute displaytype displaytype displaytype tabledir retvalue displaytype retvalue defaultvalue retvalue displaytype displaytype retvalue displaytype retvalue displaytype costprice retvalue defaultvalue retvalue displaytype displaytype datetime displaytype retvalue defaultvalue retvalue displaytype retvalue displaytype retvalue displaytype displaytype displaytype retvalue displaytype textlong retvalue displaytype retvalue displaytype yesno retvalue displaytype retvalue testing param args ignored public static void main string args compiere startup environment true c connection cc c connection get db oracle db db oracle cc get database db cleanup try connection conn system out println driver db get driver connection cc data source ds db get data source cc system out println ds ds get connection conn db get cached connection cc true connection transaction read committed system out println cached conn system out println db system out println java classpath n system get property java class path n database meta data dmd conn get meta data system out println driver version dmd get driver version system out println driver major version dmd get driver major version system out println driver minor version dmd get driver minor version system out println driver name dmd get driver name system out println product name dmd get database product name system out println product version n dmd get database product version n catch exception e1 e1 print stack trace db cleanup system out println try connection conn1 db get cached connection cc false connection transaction read committed connection conn2 db get cached connection cc true connection transaction read committed connection conn3 db get cached connection cc false connection transaction read committed system out println 3 db conn1 close conn2 close conn1 db get cached connection cc true connection transaction read committed conn2 db get cached connection cc true connection transaction read committed system out println 3 db conn1 close conn2 close conn3 close system out println 0 db catch exception e1 e1 print stack trace db cleanup system exit 0 system out println system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db get connectionro system out println db get connectionrw system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db create connection false connection transaction read committed system out println db try system out println sleeping thread sleep 60000 system out println db db close db cleanup system out println db catch interrupted exception e connection option 1 try db2 driver driver new db2 driver driver manager register driver driver connection con driver manager get connection jdbc db2 dev1 50000 sample db2admin db2admin adempiere adempiere db2inst1 da dm7rfr system out println connection catalog con get catalog database meta data md con get meta data system out println md get database product name md get database product version system out println md get database major version md get database minor version system out println md get driver name md get driver version system out println md get driver major version md get driver minor version system out println url md geturl system out println user md get user name system out println md get numeric functions system out println md get string functions system out println md get time date functions system out println md get system functions system out println catalogs md get catalog term result set rs md get catalogs while rs next system out println rs get string 1 system out println schemas md get schema term rs md get schemas while rs next system out println rs get string 1 string sql select grantor grantee dbadmauth from syscat dbauth prepared statement pstmt null try pstmt con prepare statement sql rs pstmt execute query while rs next string grantor rs get string 1 string grantee rs get string 2 string dbadmauth rs get string 3 system out println grantor grantee dbadmauth rs close pstmt close pstmt null catch exception e log log level severe sql e try if pstmt null pstmt close pstmt null catch exception e pstmt null system out println sys cat table rs md get tables null syscat null new string table view while rs next system out println user rs get string 2 table rs get string 3 type rs get string 4 rs get string 5 system out println column rs md get columns null syscat dbauth null while rs next system out println tab rs get string 3 col rs get string 4 type rs get string 5 rs get string 6 size rs get string 7 rs get string 8 digits rs get string 9 radix rs get string 10 null rs get string 11 rem rs get string 12 def rs get string 13 rs get string 14 rs get string 15 rs get string 16 ord rs get string 17 null rs get string 18 con close catch sql exception ex ex print stack trace startupenvironment cconnection cconnection db_oracle db_oracle getdatabase getdriverconnection datasource getdatasource getconnection getcachedconnection transaction_read_committed getproperty databasemetadata getmetadata driverversion getdriverversion drivermajorversion getdrivermajorversion driverminorversion getdriverminorversion drivername getdrivername productname getdatabaseproductname productversion getdatabaseproductversion printstacktrace getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed getcachedconnection transaction_read_committed printstacktrace getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed getconnectionro getconnectionrw createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed createconnection transaction_read_committed interruptedexception db2driver db2driver drivermanager registerdriver drivermanager getconnection dadm7rfr getcatalog databasemetadata getmetadata getdatabaseproductname getdatabaseproductversion getdatabasemajorversion getdatabaseminorversion getdrivername getdriverversion getdrivermajorversion getdriverminorversion getusername getnumericfunctions getstringfunctions gettimedatefunctions getsystemfunctions getcatalogterm resultset getcatalogs getstring getschematerm getschemas getstring preparedstatement preparestatement executequery getstring getstring getstring syscat gettables getstring getstring getstring getstring getcolumns getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring getstring sqlexception printstacktrace constructor param is workbench is this a workbench tab tabs on the left side public v tabbed pane boolean is workbench super set tab layout policy j tabbed pane scroll tab layout set workbench is workbench set focusable false isworkbench vtabbedpane isworkbench settablayoutpolicy jtabbedpane scroll_tab_layout setworkbench isworkbench setfocusable to string return info public string to string return m workbenchtab workbench tab window tab selected get selected index of get tab count tostring tostring m_workbenchtab workbenchtab windowtab getselectedindex gettabcount set workbench or window param is workbench public void set workbench boolean is workbench m workbenchtab is workbench if m workbenchtab super set tab placement j tabbed pane bottom else super set tab placement language get login language is left to right j tabbed pane left j tabbed pane right isworkbench setworkbench isworkbench m_workbenchtab isworkbench m_workbenchtab settabplacement jtabbedpane settabplacement getloginlanguage islefttoright jtabbedpane jtabbedpane tab is workbench not window return true if workbench public boolean is workbench return m workbenchtab isworkbench m_workbenchtab set tab placement do not use set via set work bench param not used public void set tab placement int not used new java lang illegal access error do not use v tabbed pane set tab placement directly setworkbench notused settabplacement notused illegalaccesserror vtabbedpane settabplacement dispose all contained v tabbed panes and grid controllers param a panel public void dispose a panel a panel component comp get components for int i 0 i comp length i if comp i instanceof v tabbed pane v tabbed pane tp v tabbed pane comp i tp remove change listener a panel tp dispose a panel else if comp i instanceof grid controller grid controller gc grid controller comp i gc add data status listener a panel gc dispose remove all vtabbedpanes gridcontrollers apanel apanel apanel getcomponents vtabbedpane vtabbedpane vtabbedpane removechangelistener apanel apanel gridcontroller gridcontroller gridcontroller adddatastatuslistener apanel removeall set selected index register unregister mnemonics param index index public void set selected index int index component newc get component at index grid controller newgc null if newc instanceof grid controller newgc grid controller newc int old index get selected index if newgc null old index 0 index old index component oldc get component at old index if oldc null oldc instanceof grid controller grid controller oldgc grid controller oldc if newgc get tab level oldgc get tab level 1 search for right tab for int i index 1 i 0 i component rightc get component at i grid controller rightgc null if rightc instanceof grid controller rightgc grid controller rightc if rightgc get tab level oldgc get tab level 1 a dialog warn 0 this tab switch jump go rightgc get title return a dialog warn 0 this tab switch jump return oldgc set mnemonics false switch super set selected index index if newgc null newgc set mnemonics true setselectedindex getcomponentat gridcontroller gridcontroller gridcontroller oldindex getselectedindex oldindex oldindex getcomponentat oldindex gridcontroller gridcontroller gridcontroller gettablevel gettablevel getcomponentat gridcontroller gridcontroller gridcontroller gettablevel gettablevel adialog tabswitchjumpgo gettitle adialog tabswitchjump setmnemonics setselectedindex setmnemonics standard constructor public x c dunningrunline properties ctx int c dunningrunline id string trx name super ctx c dunningrunline id trx name if c dunningrunline id 0 set amt env zero setc dunningrunentry id 0 setc dunningrunline id 0 set converted amt env zero set days due 0 set fee amt env zero set interest amt env zero set is in dispute false set open amt env zero set processed false set times dunned 0 set total amt env zero x_c_dunningrunline c_dunningrunline_id trxname c_dunningrunline_id trxname c_dunningrunline_id setamt setc_dunningrunentry_id setc_dunningrunline_id setconvertedamt setdaysdue setfeeamt setinterestamt setisindispute setopenamt setprocessed settimesdunned settotalamt load constructor public x c dunningrunline properties ctx result set rs string trx name super ctx rs trx name x_c_dunningrunline resultset trxname trxname protected big decimal access level new big decimal 3 access level 3 client org protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x c dunningrunline append get id append return sb to string tostring stringbuffer stringbuffer x_c_dunningrunline get_id tostring set amount amount public void set amt big decimal amt if amt null throw new illegal argument exception amt is mandatory set value amt amt setamt bigdecimal illegalargumentexception set_value get amount amount public big decimal get amt big decimal bd big decimal get value amt if bd null return env zero return bd bigdecimal getamt bigdecimal bigdecimal get_value set dunning run entry dunning run entry public void setc dunningrunentry id int c dunningrunentry id if c dunningrunentry id 1 throw new illegal argument exception c dunningrunentry id is mandatory set valuenocheck c dunningrunentry id new integer c dunningrunentry id setc_dunningrunentry_id c_dunningrunentry_id c_dunningrunentry_id illegalargumentexception c_dunningrunentry_id set_valuenocheck c_dunningrunentry_id c_dunningrunentry_id get dunning run entry dunning run entry public int getc dunningrunentry id integer ii integer get value c dunningrunentry id if ii null return 0 return ii int value getc_dunningrunentry_id get_value c_dunningrunentry_id intvalue set dunning run line dunning run line public void setc dunningrunline id int c dunningrunline id if c dunningrunline id 1 throw new illegal argument exception c dunningrunline id is mandatory set valuenocheck c dunningrunline id new integer c dunningrunline id setc_dunningrunline_id c_dunningrunline_id c_dunningrunline_id illegalargumentexception c_dunningrunline_id set_valuenocheck c_dunningrunline_id c_dunningrunline_id get dunning run line dunning run line public int getc dunningrunline id integer ii integer get value c dunningrunline id if ii null return 0 return ii int value getc_dunningrunline_id get_value c_dunningrunline_id intvalue set invoice invoice identifier public void setc invoice id int c invoice id if c invoice id 0 set value c invoice id null else set value c invoice id new integer c invoice id setc_invoice_id c_invoice_id c_invoice_id set_value c_invoice_id set_value c_invoice_id c_invoice_id get invoice invoice identifier public int getc invoice id integer ii integer get value c invoice id if ii null return 0 return ii int value getc_invoice_id get_value c_invoice_id intvalue return ii int value public key name pair get key name pair return new key name pair get id string value of getc invoice id intvalue keynamepair getkeynamepair keynamepair get_id valueof getc_invoice_id set payment payment identifier public void setc payment id int c payment id if c payment id 0 set value c payment id null else set value c payment id new integer c payment id setc_payment_id c_payment_id c_payment_id set_value c_payment_id set_value c_payment_id c_payment_id get payment payment identifier public int getc payment id integer ii integer get value c payment id if ii null return 0 return ii int value getc_payment_id get_value c_payment_id intvalue set converted amount converted amount public void set converted amt big decimal converted amt if converted amt null throw new illegal argument exception converted amt is mandatory set value converted amt converted amt setconvertedamt bigdecimal convertedamt convertedamt illegalargumentexception convertedamt set_value convertedamt convertedamt get converted amount converted amount public big decimal get converted amt big decimal bd big decimal get value converted amt if bd null return env zero return bd bigdecimal getconvertedamt bigdecimal bigdecimal get_value convertedamt set days due number of days due negative due in number of days public void set days due int days due set value days due new integer days due setdaysdue daysdue set_value daysdue daysdue get days due number of days due negative due in number of days public int get days due integer ii integer get value days due if ii null return 0 return ii int value getdaysdue get_value daysdue intvalue set fee amount fee amount in invoice currency public void set fee amt big decimal fee amt if fee amt null throw new illegal argument exception fee amt is mandatory set value fee amt fee amt setfeeamt bigdecimal feeamt feeamt illegalargumentexception feeamt set_value feeamt feeamt get fee amount fee amount in invoice currency public big decimal get fee amt big decimal bd big decimal get value fee amt if bd null return env zero return bd bigdecimal getfeeamt bigdecimal bigdecimal get_value feeamt set interest amount interest amount public void set interest amt big decimal interest amt if interest amt null throw new illegal argument exception interest amt is mandatory set value interest amt interest amt setinterestamt bigdecimal interestamt interestamt illegalargumentexception interestamt set_value interestamt interestamt get interest amount interest amount public big decimal get interest amt big decimal bd big decimal get value interest amt if bd null return env zero return bd bigdecimal getinterestamt bigdecimal bigdecimal get_value interestamt set in dispute document is in dispute public void set is in dispute boolean is in dispute set value is in dispute new boolean is in dispute setisindispute isindispute set_value isindispute isindispute get in dispute document is in dispute public boolean is in dispute object oo get value is in dispute if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isindispute get_value isindispute booleanvalue set open amount open item amount public void set open amt big decimal open amt if open amt null throw new illegal argument exception open amt is mandatory set value open amt open amt setopenamt bigdecimal openamt openamt illegalargumentexception openamt set_value openamt openamt get open amount open item amount public big decimal get open amt big decimal bd big decimal get value open amt if bd null return env zero return bd bigdecimal getopenamt bigdecimal bigdecimal get_value openamt set processed the document has been processed public void set processed boolean processed set value processed new boolean processed setprocessed set_value get processed the document has been processed public boolean is processed object oo get value processed if oo null if oo instanceof boolean return boolean oo boolean value return y equals oo return false isprocessed get_value booleanvalue set times dunned number of times dunned previously public void set times dunned int times dunned set value times dunned new integer times dunned settimesdunned timesdunned set_value timesdunned timesdunned get times dunned number of times dunned previously public int get times dunned integer ii integer get value times dunned if ii null return 0 return ii int value gettimesdunned get_value timesdunned intvalue set total amount total amount public void set total amt big decimal total amt if total amt null throw new illegal argument exception total amt is mandatory set value total amt total amt settotalamt bigdecimal totalamt totalamt illegalargumentexception totalamt set_value totalamt totalamt get total amount total amount public big decimal get total amt big decimal bd big decimal get value total amt if bd null return env zero return bd bigdecimal gettotalamt bigdecimal bigdecimal get_value totalamt constructor called from m lookup factory param sql query sql query param key column key column param zoom window zoom window param zoom windowpo po zoom window param zoom query zoom query public m lookup info string sql query string table name string key column int zoom window int zoom windowpo m query zoom query if sql query null throw new illegal argument exception sql query is null query sql query if key column null throw new illegal argument exception key column is null table name table name key column key column zoom window zoom window zoom windowpo zoom windowpo zoom query zoom query mlookupfactory sqlquery keycolumn zoomwindow zoomwindowpo zoomquery mlookupinfo sqlquery tablename keycolumn zoomwindow zoomwindowpo mquery zoomquery sqlquery illegalargumentexception sqlquery sqlquery keycolumn illegalargumentexception keycolumn tablename tablename keycolumn keycolumn zoomwindow zoomwindow zoomwindowpo zoomwindowpo zoomquery zoomquery string representation return info public string to string string buffer sb new string buffer m lookup info append key column append direct append query direct append return sb to string tostring stringbuffer stringbuffer mlookupinfo keycolumn querydirect tostring clone return deep copy public m lookup info clone it try m lookup info clone m lookup info super clone return clone catch exception e c logger get log level severe e return null mlookupinfo cloneit mlookupinfo mlookupinfo clogger get first ad reference id of a matching reference name can have sql like placeholders this is more a development tool than used for production param reference name reference name return ad reference id public static int getad reference id string reference name int ret value 0 string sql select ad reference id name validation type is active from ad reference where name like try prepared statement pstmt db prepare statement sql null pstmt set string 1 reference name result set rs pstmt execute query int i 0 int id 0 string ref name string validation type boolean is active false while rs next id rs get int 1 if i 0 ret value id ref name rs get string 2 validation type rs get string 3 is active rs get string 4 equals y c logger get config ad reference name ref name id id type validation type active is active rs close pstmt close catch sql exception e c logger get log level severe getad reference id e return ret value ad_reference_id referencename ad_reference_id getad_reference_id referencename retvalue ad_reference_id validationtype isactive ad_reference preparedstatement preparestatement setstring referencename resultset executequery refname validationtype isactive getint retvalue refname getstring validationtype getstring isactive getstring clogger ad_reference refname validationtype isactive sqlexception clogger getad_reference_id retvalue get first ad column id of matching column name can have sql like placeholders this is more a development tool than used for production param column name column name return ad column id public static int getad column id string column name int ret value 0 string sql select c ad column id c column name t table name from ad column c ad table t where c column name like and c ad table id t ad table id try prepared statement pstmt db prepare statement sql null pstmt set string 1 column name result set rs pstmt execute query int i 0 int id 0 string col name string tab name while rs next id rs get int 1 if i 0 ret value id col name rs get string 2 tab name rs get string 3 c logger get config name col name id id table tab name rs close pstmt close catch sql exception e c logger get log level severe sql e return ret value ad_column_id columnname columnname ad_column_id getad_column_id columnname retvalue ad_column_id columnname tablename ad_column ad_table columnname ad_table_id ad_table_id preparedstatement preparestatement setstring columnname resultset executequery colname tabname getint retvalue colname getstring tabname getstring clogger colname tabname sqlexception clogger retvalue constructor public callout engine super calloutengine start callout p callout s are used for cross field validation and setting values in other fields when returning a non empty error message string an exception is raised p when invoked the tab model has the new value param ctx context param method name method name param window no current window no param m tab model tab param m field model field param value the new value param old value the old value return error message or public string start properties ctx string method name int window no m tab m tab m field m field object value object old value if method name null method name length 0 throw new illegal argument exception no method name string ret value string buffer msg new string buffer method name append append m field get column name append append value append old append old value append active append is callout active append if is callout active log info msg to string find method method method get method method name if method null throw new illegal argument exception method not found method name int arg length method get parameter types length if arg length 5 arg length 6 throw new illegal argument exception method method name has invalid no of arguments arg length call method try object args null if arg length 6 args new object ctx new integer window no m tab m field value old value else args new object ctx new integer window no m tab m field value ret value string method invoke this args catch exception e set callout active false throwable ex e get cause invocation target exception if ex null ex e log log level severe start method name ex ex print stack trace system err ret value ex get localized message return ret value methodname windowno mtab mfield oldvalue methodname windowno mtab mtab mfield mfield oldvalue methodname methodname illegalargumentexception retvalue stringbuffer stringbuffer methodname mfield getcolumnname oldvalue iscalloutactive iscalloutactive tostring getmethod methodname illegalargumentexception methodname arglength getparametertypes arglength arglength illegalargumentexception methodname arglength arglength windowno mtab mfield oldvalue windowno mtab mfield retvalue setcalloutactive getcause invocationtargetexception methodname printstacktrace retvalue getlocalizedmessage retvalue conversion rules convert a string param method name method name param value the value return converted string or null if no method found public string convert string method name string value if method name null method name length 0 throw new illegal argument exception no method name string ret value null string buffer msg new string buffer method name append append value log info msg to string find method method method get method method name if method null throw new illegal argument exception method not found method name int arg length method get parameter types length if arg length 1 throw new illegal argument exception method method name has invalid no of arguments arg length call method try object args new object value ret value string method invoke this args catch exception e set callout active false log log level severe convert method name e e print stack trace system err return ret value methodname methodname methodname methodname illegalargumentexception retvalue stringbuffer stringbuffer methodname tostring getmethod methodname illegalargumentexception methodname arglength getparametertypes arglength illegalargumentexception methodname arglength retvalue setcalloutactive methodname printstacktrace retvalue get method param method name method name return method or null private method get method string method name method all methods get class get methods for int i 0 i all methods length i if method name equals all methods i get name return all methods i return null methodname getmethod methodname allmethods getclass getmethods allmethods methodname allmethods getname allmethods is callout active return true if active protected static boolean is callout active return s calloutactive iscalloutactive s_calloutactive set callout in active param active active protected static void set callout active boolean active s calloutactive active setcalloutactive s_calloutactive set account date value org compiere model callout engine date acct public string date acct properties ctx int window no m tab m tab m field m field object value if is callout active assuming it is resetting value return set callout active true if value null value instanceof timestamp return m tab set value date acct value set callout active false return calloutengine dateacct dateacct windowno mtab mtab mfield mfield iscalloutactive setcalloutactive mtab setvalue dateacct setcalloutactive rate set multiply rate from divide rate and vice versa org compiere model callout engine rate param ctx context param window no window param m tab tab param m field field param value value return error message public string rate properties ctx int window no m tab m tab m field m field object value if is callout active value null assuming it is conversion rate return set callout active true big decimal rate1 big decimal value big decimal rate2 env zero big decimal one new big decimal 1 0 if rate1 double value 0 0 no divide by zero rate2 one divide rate1 12 big decimal round half up if m field get column name equals multiply rate m tab set value divide rate rate2 else m tab set value multiply rate rate2 log info m field get column name rate1 rate2 set callout active false return calloutengine windowno mtab mfield windowno mtab mtab mfield mfield iscalloutactive conversion_rate setcalloutactive bigdecimal bigdecimal bigdecimal bigdecimal bigdecimal doublevalue bigdecimal round_half_up mfield getcolumnname multiplyrate mtab setvalue dividerate mtab setvalue multiplyrate mfield getcolumnname setcalloutactive standard constructor public x pa goalrestriction properties ctx int pa goalrestriction id string trx name super ctx pa goalrestriction id trx name if pa goalrestriction id 0 set goal restriction type null set name null setpa goalrestriction id 0 setpa goal id 0 x_pa_goalrestriction pa_goalrestriction_id trxname pa_goalrestriction_id trxname pa_goalrestriction_id setgoalrestrictiontype setname setpa_goalrestriction_id setpa_goal_id load constructor public x pa goalrestriction properties ctx result set rs string trx name super ctx rs trx name x_pa_goalrestriction resultset trxname trxname protected big decimal access level new big decimal 6 access level 6 system client protected int get accesslevel return access level int value bigdecimal accesslevel bigdecimal accesslevel get_accesslevel accesslevel intvalue load meta data protected po info initpo properties ctx po info poi po info getpo info ctx table id return poi poinfo poinfo poinfo getpoinfo table_id public string to string string buffer sb new string buffer x pa goalrestriction append get id append return sb to string tostring stringbuffer stringbuffer x_pa_goalrestriction get_id tostring set business partner group business partner group public void setc bp group id int c bp group id if c bp group id 0 set value c bp group id null else set value c bp group id new integer c bp group id setc_bp_group_id c_bp_group_id c_bp_group_id set_value c_bp_group_id set_value c_bp_group_id c_bp_group_id get business partner group business partner group public int getc bp group id integer ii integer get value c bp group id if ii null return 0 return ii int value getc_bp_group_id get_value c_bp_group_id intvalue set business partner identifies a business partner public void setc bpartner id int c bpartner id if c bpartner id 0 set value c bpartner id null else set value c bpartner id new integer c bpartner id setc_bpartner_id c_bpartner_id c_bpartner_id set_value c_bpartner_id set_value c_bpartner_id c_bpartner_id get business partner identifies a business partner public int getc bpartner id integer ii integer get value c bpartner id if ii null return 0 return ii int value getc_bpartner_id get_value c_bpartner_id intvalue public static final string goalrestrictiontype product p set restriction type goal restriction type public void set goal restriction type string goal restriction type if goal restriction type null throw new illegal argument exception goal restriction type is mandatory if goal restriction type equals b goal restriction type equals c goal restriction type equals g goal restriction type equals o goal restriction type equals p else throw new illegal argument exception goal restriction type invalid value goal restriction type reference id 368 b c g o p if goal restriction type length 1 log warning length 1 truncated goal restriction type goal restriction type substring 0 0 set value goal restriction type goal restriction type goalrestrictiontype_product setgoalrestrictiontype goalrestrictiontype goalrestrictiontype illegalargumentexception goalrestrictiontype goalrestrictiontype goalrestrictiontype goalrestrictiontype goalrestrictiontype goalrestrictiontype illegalargumentexception goalrestrictiontype goalrestrictiontype reference_id goalrestrictiontype goalrestrictiontype goalrestrictiontype set_value goalrestrictiontype goalrestrictiontype get restriction type goal restriction type public string get goal restriction type return string get value goal restriction type getgoalrestrictiontype get_value goalrestrictiontype set product category category of a product public void setm product category id int m product category id if m product category id 0 set value m product category id null else set value m product category id new integer m product category id setm_product_category_id m_product_category_id m_product_category_id set_value m_product_category_id set_value m_product_category_id m_product_category_id get product category category of a product public int getm product category id integer ii integer get value m product category id if ii null return 0 return ii int value getm_product_category_id get_value m_product_category_id intvalue set product product service item public void setm product id int m product id if m product id 0 set value m product id null else set value m product id new integer m product id setm_product_id m_product_id m_product_id set_value m_product_id set_value m_product_id m_product_id get product product service item public int getm product id integer ii integer get value m product id if ii null return 0 return ii int value getm_product_id get_value m_product_id intvalue set name alphanumeric identifier of the entity public void set name string name if name null throw new illegal argument exception name is mandatory if name length 120 log warning length 120 truncated name name substring 0 119 set value name name setname illegalargumentexception set_value get name alphanumeric identifier of the entity public string get name return string get value name getname get_value return string get value name public key name pair get key name pair return new key name pair get id get name get_value keynamepair getkeynamepair keynamepair get_id getname public static final int org id ad reference id 322 set organization organizational entity within client public void setorg id int org id if org id 0 set value org id null else set value org id new integer org id org_id_ad_reference_id setorg_id org_id org_id set_value org_id set_value org_id org_id get organization organizational entity within client public int getorg id integer ii integer get value org id if ii null return 0 return ii int value getorg_id get_value org_id intvalue set goal restriction performance goal restriction public void setpa goalrestriction id int pa goalrestriction id if pa goalrestriction id 1 throw new illegal argument exception pa goalrestriction id is mandatory set valuenocheck pa goalrestriction id new integer pa goalrestriction id setpa_goalrestriction_id pa_goalrestriction_id pa_goalrestriction_id illegalargumentexception pa_goalrestriction_id set_valuenocheck pa_goalrestriction_id pa_goalrestriction_id get goal restriction performance goal restriction public int getpa goalrestriction id integer ii integer get value pa goalrestriction id if ii null return 0 return ii int value getpa_goalrestriction_id get_value pa_goalrestriction_id intvalue set goal performance goal public void setpa goal id int pa goal id if pa goal id 1 throw new illegal argument exception pa goal id is mandatory set value pa goal id new integer pa goal id setpa_goal_id pa_goal_id pa_goal_id illegalargumentexception pa_goal_id set_value pa_goal_id pa_goal_id get goal performance goal public int getpa goal id integer ii integer get value pa goal id if ii null return 0 return ii int value getpa_goal_id get_value pa_goal_id intvalue public static final string jndi name compiere server public org compiere interfaces server create throws javax ejb create exception java rmi remote exception jndi_name createexception remoteexception get and create window model value object param ctx environment properties param window no number of this window param ad window id the internal number of the window if not 0 ad menu id is ignored param ad menu id ine internal menu number used when ad window id is 0 return initialized window model public org compiere model m windowvo get windowvo java util properties ctx int window no int ad window id int ad menu id windowno ad_window_id ad_menu_id ad_menu_id ad_window_id mwindowvo getwindowvo windowno ad_window_id ad_menu_id post immediate param ctx client context param ad client id client id of document param ad table id table id of document param record id record id of this document param force force posting return null if success or error message public java lang string post immediate java util properties ctx int ad client id int ad table id int record id boolean force java lang string trx name ad_client_id ad_table_id record_id postimmediate ad_client_id ad_table_id record_id trxname get prepared statement result set param info result info return row set throws not serializable exception public javax sql row set pstmt getrowset org compiere util c statementvo info resultset rowset notserializableexception rowset pstmt_getrowset cstatementvo get statement result set param info result info return row set public javax sql row set stmt getrowset org compiere util c statementvo info resultset rowset rowset stmt_getrowset cstatementvo execute update param info result info return row count public int stmt executeupdate org compiere util c statementvo info stmt_executeupdate cstatementvo get next number for key column 0 is error param ad client id client param table name table name param trx name optional transaction name return next no public int get nextid int ad client id java lang string table name java lang string trx name ad_client_id tablename trxname getnextid ad_client_id tablename trxname get document no from table param ad client id client param table name table name param trx name optional transaction name return document no or null public java lang string get document no int ad client id java lang string table name java lang string trx name ad_client_id tablename trxname getdocumentno ad_client_id tablename trxname get document no based on document type param c doctype id document type param trx name optional transaction name return document no or null public java lang string get document no int c doctype id java lang string trx name c_doctype_id trxname getdocumentno c_doctype_id trxname process remote param ctx context param pi process info return resulting process info public org compiere process process info process java util properties ctx org compiere process process info pi processinfo processinfo run workflow and wait on server param ctx context param pi process info return process info public org compiere process process info workflow java util properties ctx org compiere process process info pi int ad workflow id processinfo processinfo ad_workflow_id online payment from server param ctx context param c payment id payment param c paymentprocessor id processor return true if approved public boolean payment online java util properties ctx int c payment id int c paymentprocessor id java lang string trx name c_payment_id c_paymentprocessor_id paymentonline c_payment_id c_paymentprocessor_id trxname create e mail from server request user param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail public org compiere util e mail createe mail java util properties ctx int ad client id java lang string to java lang string subject java lang string message email ad_client_id email email createemail ad_client_id create e mail from server request user param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail public org compiere util e mail createe mail java util properties ctx int ad client id int ad user id java lang string to java lang string subject java lang string message email ad_client_id email email createemail ad_client_id ad_user_id create e mail from server request user param ad task id task return execution trace public java lang string execute task int ad task id email ad_task_id executetask ad_task_id cash reset param table name table name param record id record or 0 for all return number of records reset public int cache reset java lang string table name int record id tablename record_id cachereset tablename record_id lob update param sql table name param display type display type i e blob clob param value the data return true if updated public boolean updatelob java lang string sql int display type java lang object value displaytype displaytype describes the instance and its content for debugging purpose return debugging information about the instance and its content public java lang string get status getstatus get and create window model value object param ctx environment properties param window no number of this window param ad window id the internal number of the window if not 0 ad menu id is ignored param ad menu id ine internal menu number used when ad window id is 0 return initialized window model windowno ad_window_id ad_menu_id ad_menu_id ad_window_id post immediate param ctx client context param ad client id client id of document param ad table id table id of document param record id record id of this document param force force posting return null if success or error message ad_client_id ad_table_id record_id get prepared statement result set param info result info return row set throws not serializable exception resultset rowset notserializableexception get statement result set param info result info return row set resultset rowset execute update param info result info return row count get next number for key column 0 is error param ad client id client param table name table name param trx name optional transaction name return next no ad_client_id tablename trxname get document no from table param ad client id client param table name table name param trx name optional transaction name return document no or null ad_client_id tablename trxname get document no based on document type param c doctype id document type param trx name optional transaction name return document no or null c_doctype_id trxname process remote param ctx context param pi process info return resulting process info run workflow and wait on server param ctx context param pi process info return process info online payment from server param ctx context param c payment id payment param c paymentprocessor id processor return true if approved c_payment_id c_paymentprocessor_id create e mail from server request user param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail email ad_client_id email create e mail from server request user param ctx context param ad client id client param to recipient email address param subject subject param message message return e mail email ad_client_id email create e mail from server request user param ad task id task return execution trace email ad_task_id cash reset param table name table name param record id record or 0 for all return number of records reset tablename record_id lob update param sql table name param display type display type i e blob clob param value the data return true if updated displaytype public boolean updatelob java lang string sql int display type java lang object value describes the instance and its content for debugging purpose return debugging information about the instance and its content public java lang string get status displaytype getstatus extends javax ejb ejb local object get version date return version e g 2002 09 02 public java lang string get date version ejblocalobject getdateversion public java lang string get date version get main version return main version e g version 2 4 3b public java lang string get main version getdateversion getmainversion public java lang string get main version get database type return database type public java lang string get db type getmainversion getdbtype public java lang string get db type get database host return database host name public java lang string get db host getdbtype getdbhost public java lang string get db host get database port return database port public int get db port getdbhost getdbport public int get db port get database sid return database sid public java lang string get db name getdbport getdbname public java lang string get db name get database url return database url public java lang string get connectionurl getdbname getconnectionurl public java lang string get connectionurl get database uid return database user name public java lang string get db uid getconnectionurl getdbuid public java lang string get db uid get database pwd return database user password public java lang string get db pwd getdbuid getdbpwd public java lang string get db pwd get connection manager host return connection manager host public java lang string get fw host getdbpwd getfwhost public java lang string get fw host get connection manager port return connection manager port public int get fw port getfwhost getfwport public int get fw port get version count return number of version inquiries public int get version count getfwport getversioncount public int get version count get database count return number of database inquiries public int get database count getversioncount getdatabasecount public int get database count describes the instance and its content for debugging purpose return debugging information about the instance and its content public java lang string get status getdatabasecount getstatus public static final string jndi name compiere server local public org compiere interfaces server local create throws javax ejb create exception jndi_name serverlocal serverlocal createexception public static final string jndi name compiere status public org compiere interfaces status create throws javax ejb create exception java rmi remote exception jndi_name createexception remoteexception get version date return version e g 2002 09 02 public java lang string get date version getdateversion get main version return main version e g version 2 4 3b public java lang string get main version getmainversion get database type return database type public java lang string get db type getdbtype get database host return database host name public java lang string get db host getdbhost get database port return database port public int get db port getdbport get database sid return database sid public java lang string get db name getdbname get database url return database url public java lang string get connectionurl getconnectionurl get database uid return database user name public java lang string get db uid getdbuid get database pwd return database user password public java lang string get db pwd getdbpwd get connection manager host return connection manager host public java lang string get fw host getfwhost get connection manager port return connection manager port public int get fw port getfwport get version count return number of version inquiries public int get version count getversioncount get database count return number of database inquiries public int get database count getdatabasecount describes the instance and its content for debugging purpose return debugging information about the instance and its content public java lang string get status getstatus public static final string jndi name compiere status local public org compiere interfaces status local create throws javax ejb create exception jndi_name statuslocal statuslocal createexception get column name return column name set column name patam column name name columnname change listener interface param listener public void add vetoable change listener vetoable change listener listener change listener interface param listener addvetoablechangelistener vetoablechangelistener public void remove vetoable change listener vetoable change listener listener action listener param listener removevetoablechangelistener vetoablechangelistener used to set border for table editors param border set font param font set foreground param color set field window no for value preference param m field windowno valuepreference mfield public void set field m field m field dispose public void dispose setfield mfield mfield load data called when tab is displayed save data called when tab is swiched to another tab register a panel param panel panel apanel public void registera panel a panel panel unregister a panel public void unregister panel registerapanel apanel apanel unregisterpanel initialize panel param window no window param frame parent frame windowno public void init int window no form frame frame dispose free resources public void dispose windowno formframe get amount in words param amount numeric amount 352 80 return amount in words three five two 80 100 reset cache return number of items reset get size of cache return number of items get variable value param variable name name return value variablename set doc status param new status new status newstatus get doc status return document status process document param action document action return true if performed unlock document return true if success public boolean unlock it invalidate document return true if success unlockit public boolean invalidate it prepare document return new status in progress or invalid invalidateit public string prepare it approve document return true if success prepareit public boolean approve it reject approval return true if success approveit public boolean reject it complete document return new status complete in progress invalid waiting rejectit public string complete it void document return true if success completeit public boolean void it close document return true if success voidit public boolean close it reverse correction return true if success closeit public boolean reverse correct it reverse accrual return true if success reversecorrectit public boolean reverse accrual it re activate return true if success reverseaccrualit get summary return summary of document get document no return document no get document info return type and document no create pdf return file get process message return clear text message get document owner return ad user id ad_user_id get document currency return c currency id c_currency_id get document approval amount return amount get document client return ad client id ad_client_id get document organization return ad org id ad_org_id get doc action return document action save document return true if saved get context return context get id of record return id get ad table id return ad table id ad_table_id ad_table_id get logger return logger get transaction return trx name start the process called when pressing the button in it should only return false if the function could not be performed as this causes the process to abort param ctx context param pi process info return true if the next process should be performed process document value workflow param document document param ad table id table return true if wf started ad_table_id initialize validation param engine validation engine param client client get client to be monitored return ad client id ad_client_id user logged in called before preferences are set param ad org id org param ad role id role param ad user id user return error message or null ad_org_id ad_role_id ad_user_id model change of a monitored table called after po before save po before delete when you called add model change for the table param po persistent object param type type return error message or null exception exception if the recipient wishes the change to be not accept beforesave beforedelete addmodelchange type_ validate document called as first step of doc action prepare it or at the end of doc action complete it when you called add doc validate for the table note that totals etc may not be correct before the prepare stage param po persistent object param timing see timing constants return error message or null if not null the pocument will be marked as invalid docaction prepareit docaction completeit adddocvalidate timing_ get database name return database short name get database description return database long name and version get and register database driver return driver get standard jdbc port return standard port get database connection string param connection connection descriptor return connection string get connection url param db host db host param db port db port param db name db name param user name user name return url public string get connectionurl string db host int db port string db name dbhost dbport dbname username getconnectionurl dbhost dbport dbname get jdbc catalog return catalog get jdbc schema return schema supports blob return true if blob is supported string representation return info convert an individual oracle style statements to target database statement syntax param ora statement oracle statement return converted statement orastatement get name of system user return e g sa system get name of system database param database name database name return e g master or database name databasename create sql to date string from timestamp param time date to be converted param day only true if time set to 00 00 00 return date function dayonly create sql for formatted date number param column name the column name in the sql param display type display type param ad language 6 character language setting from env lang return trim to char column name 9g999g990d00 nls numeric characters or trim to char column name tm9 depending on display type and language see org compiere util display type see org compiere util env columnname displaytype ad_language lang_ to_char columnname nls_numeric_characters to_char columnname displaytype displaytype return number as string for insert statements with correct precision param number number param display type display type return number as string displaytype get sql commands code the following variables are resolved system password compiere user compiere password system password database name database device code param cmd type cmd return array of commands to be executed systempassword compiereuser compierepassword systempassword databasename databasedevice cmdtype cmd_ get cached connection on server param connection info param auto commit true if autocommit connection param transaction isolation connection transaction level return connection or null public connection get cached connection c connection connection autocommit transactionisolation getcachedconnection cconnection get connection from driver param connection info return connection or null get driver connection param db url url param db uid user param db pwd password return connection throws sql exception public connection get driver connection string db url string db uid string db pwd dburl dbuid dbpwd sqlexception getdriverconnection dburl dbuid dbpwd create data source param connection connection return data dource datasource get status return status info public string get status close public void close getstatus encryption param value clear value return encrypted string decryption param value encrypted value return decrypted string encryption the methods must recognize clear text values param value clear value return encrypted string decryption the methods must recognize clear text values param value encrypted value return decrypted string encryption the methods must recognize clear text values param value clear value return encrypted string decryption the methods must recognize clear text values param value encrypted value return decrypted string encryption the methods must recognize clear text values param value clear value return encrypted string decryption the methods must recognize clear text values param value encrypted value return decrypted string convert string to digest java script version see http pajhome org uk crypt md5 index html param value message return hex string of message length 32 characters javascript hexstring checks if value is a valid digest param value digest string return true if valid digest public interface c field popup show popup public void show cfieldpopup set value param value get value return value set format param format get format return format enable editor param rw true if you can enter select data is it possible to edit return true if editable set editor mandatory param mandatory true if you have to enter data is field mandatory return true if mandatory set background based on editable mandatory error param error if true set background to error color otherwise mandatory editable set visible param visible true if field is to be shown set editor to value param value value of the editor return editor value return current value return display value return displayed string value public interface filter public filter add attribute string name object attribute addattribute public filter add attribute string name object attribute public filter remove attribute string name addattribute removeattribute public filter add attribute string name object attribute public filter remove attribute string name public boolean has attribute string key addattribute removeattribute hasattribute public filter remove attribute string name public boolean has attribute string key public string process string to process removeattribute hasattribute to_process public boolean has attribute string key public string process string to process public string get info hasattribute to_process getinfo public static final int right 6 set case type public void set case int type setcase public void set case int type used to determine case setting public int get case setcase getcase public int get case get the version number of this codebase public string get version getcase getversion public string get version set the html element type public void set element type string element type getversion htmlelement setelementtype element_type public void set element type string element type get the html element type public string get element type setelementtype element_type htmlelement getelementtype public string get element type set wether or not this element needs a closing tag public void set need closing tag boolean close tag getelementtype setneedclosingtag close_tag public void set need closing tag boolean close tag get whether or not this element needs a closing tag public boolean get need closing tag setneedclosingtag close_tag getneedclosingtag public boolean get need closing tag determine if this element needs a line break if pretty printing public boolean get need line break getneedclosingtag getneedlinebreak public boolean get need line break set tag position element factory center left right public void set tag position int position getneedlinebreak elementfactory settagposition public void set tag position int position get tag position how is the element supposed to be rendered public int get tag position settagposition gettagposition public int get tag position set the start tag character public void set start tag char char start tag gettagposition setstarttagchar start_tag public void set start tag char char start tag get the start tag character public char get start tag char setstarttagchar start_tag getstarttagchar public char get start tag char set the end tag character public void set end tag char char end tag getstarttagchar setendtagchar end_tag public void set end tag char char end tag get the end tag character public char get end tag char setendtagchar end_tag getendtagchar set a modifer for the start of the tag public element set begin start modifier char start modifier setbeginstartmodifier start_modifier public element set begin start modifier char start modifier get a modifier for the start of the tag if one exists public char get begin start modifier setbeginstartmodifier start_modifier getbeginstartmodifier public char get begin start modifier set a modifer for the end of the tag public element set begin end modifier char start modifier getbeginstartmodifier setbeginendmodifier start_modifier public element set begin end modifier char start modifier get the modifier for the end of the tag if one exists public char get begin end modifier setbeginendmodifier start_modifier getbeginendmodifier set a modifer for the start of the tag public element set end start modifier char start modifier setendstartmodifier start_modifier public element set end start modifier char start modifier get a modifier for the start of the tag if one exists public char get end start modifier setendstartmodifier start_modifier getendstartmodifier public char get end start modifier set a modifer for the end of the tag public element set end end modifier char start modifier getendstartmodifier setendendmodifier start_modifier public element set end end modifier char start modifier get the modifier for the end of the tag if one exists public char get end end modifier setendendmodifier start_modifier getendendmodifier public char get end end modifier set the filter state of the element public element set filter state boolean state getendendmodifier setfilterstate public element set filter state boolean state get the filter state of the element public boolean get filter state setfilterstate getfilterstate public boolean get filter state set the pretty print state of the element public element set pretty print boolean pretty print getfilterstate prettyprint setprettyprint pretty_print public element set pretty print boolean pretty print get the pretty print state of the element public boolean get pretty print setprettyprint pretty_print prettyprint getprettyprint public boolean get pretty print set the tab level for pretty printing public void set tab level int tab level getprettyprint settablevel tablevel get the tab level for pretty printing public int get tab level provide a way to output the element to a stream public void output output stream out gettablevel outputstream public void output output stream out provide a way to output the element to a print writer public void output print writer out outputstream printwriter printwriter make sure implementing classes have a set on focus method the onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation this attribute may be used with the following elements label input select textarea and button setonfocus make sure implementing classes have a set on blur method the onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation it may be used with the same elements as onfocus setonblur make sure implementing classes have a set on key press method the onkeypress event occurs when a key is pressed and released over an element this attribute may be used with most elements setonkeypress make sure implementing classes have a set on key down method the onkeydown event occurs when a key is pressed down over an element this attribute may be used with most elements setonkeydown make sure implementing classes have a set on key up method the onkeyup event occurs when a key is released over an element this attribute may be used with most elements setonkeyup make sure implementing classes have a set on click method the onclick event occurs when the pointing device button is clicked over an element this attribute may be used with most elements setonclick make sure implementing classes have a set on dbl click method the ondblclick event occurs when the pointing device button is double clicked over an element this attribute may be used with most elements setondblclick make sure implementing classes have a set on mouse down method the onmousedown event occurs when the pointing device button is pressed over an element this attribute may be used with most elements setonmousedown make sure implementing classes have a set on mouse up method the onmouseup event occurs when the pointing device button is released over an element this attribute may be used with most elements setonmouseup make sure implementing classes have a set on mouse over method the onmouseover event occurs when the pointing device is moved onto an element this attribute may be used with most elements setonmouseover make sure implementing classes have a set on mouse move method the onmousemove event occurs when the pointing device is moved while it is over an element this attribute may be used with most elements setonmousemove make sure implementing classes have a set on mouse out method the onmouseout event occurs when the pointing device is moved away from an element this attribute may be used with most elements setonmouseout make sure implementing classes have a set on load method the onload event occurs when the user agent finishes loading a window or all frames within a frameset this attribute may be used with body and frameset elements setonload make sure implementing classes have a set on unload method the onunload event occurs when the user agent removes a document from a window or frame this attribute may be used with body and frameset elements setonunload make sure implementing classes have a set on submit method the onsubmit event occurs when a form is submitted it only applies to the form element setonsubmit make sure implementing classes have a set on reset method the onreset event occurs when a form is reset it only applies to the form element setonreset make sure implementing classes have a set on select method the onselect event occurs when a user selects some text in a text field this attribute may be used with the input and textarea elements setonselect make sure implementing classes have a set on change method the onchange event occurs when a control loses the input focus and its value has been modified since gaining focus this attribute applies to the following elements input select and textarea setonchange public final static string baseline baseline make sure implementing classes have a set align method public abstract void set align string alignment setalign setalign public abstract void set align string alignment make sure implementing classes have a setv align method public abstract void setv align string alignment setalign setvalign setvalign set the state of the attribute filter param filter attribute state do we need to filter attributes filter_attribute_state set the attribute filter that should be used param attribute filter set the attribute filter to be used attributefilter attribute_filter public element set attribute filter filter attribute filter get the attribute filter that is in use public filter get attribute filter setattributefilter attribute_filter attributefilter getattributefilter add an attribute to the element param name name of the attribute param element value of the attribute add an attribute to the element param name name of the attribute param element value of the attribute add an attribute to the element param name name of the attribute param element value of the attribute add an attribute to the element param name name of the attribute param element value of the attribute remove an attribute from the element param name remove the attribute of this name does the element have an attribute param name of the attribute to ask the element for set the character used to quote attributes param quote char character used to quote attributes quote_char public element set attribute quote char char quote char get the character used to quote attributes public char get attribute quote char setattributequotechar quote_char getattributequotechar set the equality sign for an attribute param equality sign the equality sign used for attributes equality_sign public element set attribute equality sign char equality sign get the equality sign for an attribute public char get attribute equality sign setattributeequalitysign equality_sign getattributeequalitysign public char get attribute equality sign do we surround attributes with qoutes public boolean get attribute quote getattributeequalitysign getattributequote public boolean get attribute quote set wether or not we surround the attributes with quotes public element set attribute quote boolean attribute quote getattributequote setattributequote attribute_quote public abstract element add element to registry element element addelementtoregistry public abstract element add element to registry element element public abstract element add element to registry string element addelementtoregistry addelementtoregistry public abstract element add element to registry element element public abstract element add element to registry string element public abstract element remove element from registry element element addelementtoregistry addelementtoregistry removeelementfromregistry public abstract element add element to registry string element public abstract element remove element from registry element element public abstract element remove element from registry string element addelementtoregistry removeelementfromregistry removeelementfromregistry public abstract element remove element from registry element element public abstract element remove element from registry string element public abstract boolean registry has element element element removeelementfromregistry removeelementfromregistry registryhaselement public abstract element remove element from registry string element public abstract boolean registry has element element element public abstract boolean registry has element string element removeelementfromregistry registryhaselement registryhaselement return the qty to order param wh warehouse param replenish temporary replenishment return qty to order lock user interface called from the worker before processing param pi process info unlock user interface called from the worker when processing is done param pi result of execute a sync call async is the ui locked internal method return true if ui is locked method to be executed async called from the worker param pi process info processinfo get client return ad client id ad_client_id get name return name get description return description get context return context get the frequency type return frequency type get the frequency return frequency get unique id return unique id get the date next run param requery requery database return date next run set date next run param date next work next work datenextwork get the date last run return date lext run set date last run param date last run last run datelastrun save return true if saved get processor logs return logs public interface data status listener extends event listener data changed public void data status changed data status event e datastatuslistener eventlistener datastatuschanged datastatusevent start callout p callout s are used for cross field validation and setting values in other fields when returning a non empty error message string an exception is raised p when invoked the tab model has the new value param ctx context param method method name param window no current window no param m tab model tab param m field model field param value the new value param old value the old value return error message or public string start properties ctx string method int window no windowno mtab mfield oldvalue windowno conversion rules convert a string param method in notation user function param value the value return converted string or null if no method found user_function get created date return created public timestamp get created get summary textual summary of this request public string get summary getcreated getsummary public string get summary get description optional short description of the record public string get description getsummary getdescription public string get description get error an error occured in the execution public boolean is error getdescription iserror public boolean is error get reference reference for this record public string get reference iserror getreference public string get reference get text message text message public string get text msg getreference gettextmsg create new measures for the performance goal param measure measure return true if measure not created via measure calc sql measurecalc create new measures for the performance goal called only if is create measures is true param measure measure return number created iscreatemeasures calculate parformance goal actual param measure measure return new actual measure initialize the loader param controller reference to the m bank statement loader controller object return initialized succesfully mbankstatementloader verify whether the data to be imported is valid return data is valid if the actual loaders does not do any validity checks it will just return true start importing statement lines return statement lines imported succesfully return the most recent error return error message this error message will be handled as a compiere message e g it can be translated return the most recent error description return error discription this is an additional error description it can be used to provided descriptive iformation such as a file name or sql error that can not be translated by the compiere message system the last time this loader aquired bank statement data for ofx this is the dtend value this is generally only available after load lines has been called if a specific loader class does not provided this information it is allowed to return null return date last run loadlines the routing number of the bank account for the statement line return routing number the account number of the bank account for the statement line return bank account number additional reference information statement level reference information if a specific loader class does not provided this it is allowed to return null return error discription statement date date of the bank statement if a specific loader does not provide this it is allowed to return null return statement date transaction id assigned by the bank for ofx this is the fitid if a specific loader does not provide this it is allowed to return null return transaction id additional reference information statement line level reference information for ofx this is the refnum field if a specific loader does not provided this it is allowed to return null return error discription check number check number in case the transaction was initiated by a check for ofx this is the checknum field for ms money ofc this is the chknum field if a specific loader does not provide this it is allowed to return null return transaction reference payee name name information for ofx this is the name or payee name field if a specific loader class does not provide this it is allowed to return null return payee name payee account account information of the other party if a specific loader class does not provide this it is allowed to return null return payee bank account number statement line date this has to be provided by all loader classes return statement line date effective date date theat the funds became available if a specific loader does not provide this it is allowed to return null return effective date transaction type return transaction type this returns the transaction type as used by the bank whether a transaction is credit or debit depends on the amount i e negative this field is for reference only if a specific loader class does not provide this it is allowed to return null indicates whether this transaction is a reversal return true if this is a reversal currency return currency return the currency if included in the statement data it is returned as it appears in the import data it should not be processed by the loader in any way if a specific loader class does not provide this it is allowed to return null statement line amount return statement line amount this has to be provided by all loader classes transaction amount return transaction amount interest amount return interest amount transaction memo return memo additional descriptive information for ofx this is the memo filed for swift mt940 this is the 86 line if a specific loader does not provide this it is allowed to return null charge name return charge name name of the charge in case this transaction is a bank charge if a specific loader class does not provide this it is allowed to return null charge amount return charge amount name of the charge in case this transaction is a bank charge if a specific loader class does not provide this it is allowed to return null match bank statement line param bsl bank statement line return found matches or null match bank statement import line param ibs bank statement import line return found matches or null